Esempio n. 1
0
        public virtual void InsertObject(id anObject, uint index)
        {
            if (anObject == null)
                throw new ArgumentNullException();

            _list.Insert((int)index, anObject);
        }
 public virtual bool ReplaceObject(id oldObj, id newObj)
 {
     return false;
 }
Esempio n. 3
0
        public override id InitWithCoder(NSCoder aDecoder)
        {
            //base.InitWithCoder(aDecoder);

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey(@"NSDestination"))
                {
                    _dst = aDecoder.DecodeObjectForKey(@"NSDestination");
                }
                if (aDecoder.ContainsValueForKey(@"NSSource"))
                {
                    _src = aDecoder.DecodeObjectForKey(@"NSSource");
                }
                if (aDecoder.ContainsValueForKey(@"NSLabel"))
                {
                    _tag = (NSString)aDecoder.DecodeObjectForKey(@"NSLabel");
                }
            }
            else
            {

            }

            return this;
        }
        public override id InitWithCoder(NSCoder aDecoder)
        {
            base.InitWithCoder(aDecoder);

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey("NSViewClass"))
                {
                    _viewClass = (id)aDecoder.DecodeObjectForKey("NSViewClass");
                }
                if (aDecoder.ContainsValueForKey("NSWindowClass"))
                {
                    _windowClass = (NSString)aDecoder.DecodeObjectForKey("NSWindowClass");
                }
                if (aDecoder.ContainsValueForKey("NSWindowStyleMask"))
                {
                    _windowStyle = (uint)aDecoder.DecodeIntForKey("NSWindowStyleMask");
                }
                if (aDecoder.ContainsValueForKey("NSWindowBacking"))
                {
                    _backingStoreType = (NSBackingStoreType)aDecoder.DecodeIntForKey("NSWindowBacking");
                }
                if (aDecoder.ContainsValueForKey("NSWindowView"))
                {
                    _view = (id)aDecoder.DecodeObjectForKey("NSWindowView");
                }
                if (aDecoder.ContainsValueForKey("NSWTFlags"))
                {
                    uint flags = (uint)aDecoder.DecodeIntForKey("NSWTFlags");
                    _flags = PrimitiveConversion.FromLong<GSWindowTemplateFlags>(flags);
                }
                if (aDecoder.ContainsValueForKey("NSMinSize"))
                {
                    _minSize = aDecoder.DecodeSizeForKey("NSMinSize");
                }
                if (aDecoder.ContainsValueForKey("NSMaxSize"))
                {
                    _maxSize = aDecoder.DecodeSizeForKey("NSMaxSize");
                }
                else
                {
                    _maxSize = new NSSize((float)10e+4, (float)10e+4);
                }

                if (aDecoder.ContainsValueForKey("NSWindowRect"))
                {
                    _windowRect = aDecoder.DecodeRectForKey("NSWindowRect");
                }
                if (aDecoder.ContainsValueForKey("NSFrameAutosaveName"))
                {
                    _autosaveName = (NSString)aDecoder.DecodeObjectForKey("NSFrameAutosaveName");
                }
                if (aDecoder.ContainsValueForKey("NSWindowTitle"))
                {
                    _title = (NSString)aDecoder.DecodeObjectForKey("NSWindowTitle");
                    _windowStyle |= (uint)NSWindowStyleMasks.NSTitledWindowMask;
                }

                //_baseWindowClass = [NSWindow class];
            }
            else
            {
                //[NSException raise: NSInvalidArgumentException 
                //             format: @"Can't decode %@ with %@.",NSStringFromClass([self class]),
                //             NSStringFromClass([coder class])];
            }

            //if (aDecoder.AllowsKeyedCoding)
            //{
            //    StyleMask = (NSWindowStyleMasks)aDecoder.DecodeIntForKey("NSWindowStyleMask");
            //    Backing = aDecoder.DecodeIntForKey("NSWindowBacking");
            //    WindowRect = aDecoder.DecodeRectForKey("NSWindowRect");
            //    NSWTFlags = (uint)aDecoder.DecodeIntForKey("NSWTFlags");
            //    if (aDecoder.ContainsValueForKey("NSWindowTitle"))
            //    {
            //        Title = (NSString)aDecoder.DecodeObjectForKey("NSWindowTitle");
            //        StyleMask |= NSWindowStyleMasks.NSTitledWindowMask;
            //    }

            //    WindowClass = (NSString)aDecoder.DecodeObjectForKey("NSWindowClass");
            //    Toolbar = (NSToolbar)aDecoder.DecodeObjectForKey("NSViewClass");
            //    WindowView = (NSView)aDecoder.DecodeObjectForKey("NSWindowView");
            //    ScreenRect = (NSRect)aDecoder.DecodeRectForKey("NSScreenRect");
            //    IsRestorable = aDecoder.DecodeBoolForKey("NSWindowIsRestorable");

            //    MinSize = aDecoder.DecodeSizeForKey("NSMinSize");

            //    if (aDecoder.ContainsValueForKey("NSMaxSize"))
            //    {
            //        MaxSize = aDecoder.DecodeSizeForKey("NSMaxSize");
            //    }
            //    else
            //    {
            //        MaxSize = new NSSize((float)10e+4, (float)10e+4);
            //    }
            //}

            return this;
        }
Esempio n. 5
0
        public override bool IsEqual(id other)
        {
            if (other == (id)this)
                return true;

            if (other.IsKindOfClass(GSRGBColor.Class) == false
                || ((GSRGBColor)other).RedComponent != _red_component
                || ((GSRGBColor)other).GreenComponent != _green_component
                || ((GSRGBColor)other).BlueComponent != _blue_component
                || ((GSRGBColor)other).AlphaComponent != _alpha_component)
            {
                return false;
            }
            return true;
        }
Esempio n. 6
0
 public id PerformSelector(SEL aSelector, id anObject)
 {
     return null;
 }
Esempio n. 7
0
 public override bool IsEqual(id other)
 {
     if (other == this)
         return true;
     if (other.IsKindOfClass(NSColorClass) == true)
         return false;
     else
     {
         //[self subclassResponsibility: _cmd);
         return true;
     }
 }
        public virtual id ObjectForKey(id aKey)
        {
            id obj = null;

            return obj;
        }
Esempio n. 9
0
        public override id InitWithCoder(NSCoder aDecoder)
        {
            id self = this;

            if (base.InitWithCoder(aDecoder) == null)
                return null;

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey("NSTag"))
                {
                    this.Tag = aDecoder.DecodeIntForKey("NSTag");
                }
                if (aDecoder.ContainsValueForKey("NSTarget"))
                {
                    this.Target = aDecoder.DecodeObjectForKey("NSTarget");
                }
                if (aDecoder.ContainsValueForKey("NSAction"))
                {
                    NSString action = (NSString)aDecoder.DecodeObjectForKey("NSAction");
                    this.Action = SEL.SelectorFromString(action);
                }
            }

            return self;
        }
Esempio n. 10
0
 internal virtual void _SetNextText(id anObject)
 {
     this.NextKeyView = anObject;
 }
Esempio n. 11
0
 internal virtual void _SetPreviousText(id anObject)
 {
     this.PreviousKeyView = anObject;
 }
Esempio n. 12
0
 internal virtual void _SetDelegate(id anObject)
 {
     _delegate = anObject;
 }
Esempio n. 13
0
 public virtual void SelectText(id sender)
 {
     //FIXME
 }
        public override id _DecodeArrayOfObjectsForElement(GSXibElement element)
        {
            NSArray values = element.Values;
            int max = values.Count;
            id[] list = new id[max];
            int i;

            for (i = 0; i < max; i++)
            {
                list[i] = this.ObjectForXib((GSXibElement)values.ObjectAtIndex(i));
                if (list[i] == null)
                    System.Diagnostics.Trace.WriteLine(string.Format("No object for {0} at index {1}", values.ObjectAtIndex(i).ToString(), i));
            }

            return NSArray.ArrayWithObjects(list);
        }
Esempio n. 15
0
        public override id InitWithCoder(NSCoder aDecoder)
        {
            id self = this;

            base.InitWithCoder(aDecoder);

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey("label"))
                {
                    _label = (NSString)aDecoder.DecodeObjectForKey("label");
                }
                if (aDecoder.ContainsValueForKey("source"))
                {
                    _source = (id)aDecoder.DecodeObjectForKey("source");
                }
                if (aDecoder.ContainsValueForKey("destination"))
                {
                    _destination = (id)aDecoder.DecodeObjectForKey("destination");
                }
            }

            return self;
        }
Esempio n. 16
0
 public static NSData ArchivedDataWithRootObject(id rootObject)
 {
     return null;
 }
Esempio n. 17
0
 public virtual bool IsEqual(id otherObj)
 {
     return this.Equals(otherObj);
 }
Esempio n. 18
0
 public virtual void performClick(id sender)
 {
     //FIXME
 }
Esempio n. 19
0
 public static void InsertKnownAbsent(NSMapTable map, IntPtr key, id value)
 {
     // FIXME
 }
Esempio n. 20
0
        public override id InitWithCoder(NSCoder aDecoder)
        {
            id self = this;

            base.InitWithCoder(aDecoder);

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey(@"NSBoxType"))
                {
                    int boxType = aDecoder.DecodeIntForKey(@"NSBoxType");
                    this.BoxType = (NSBoxType)boxType;
                }
                if (aDecoder.ContainsValueForKey(@"NSBorderType"))
                {
                    NSBorderType borderType = (NSBorderType)aDecoder.DecodeIntForKey(@"NSBorderType");
                    this.BorderType = borderType;
                }
                if (aDecoder.ContainsValueForKey(@"NSTitlePosition"))
                {
                    NSTitlePosition titlePosition = (NSTitlePosition)aDecoder.DecodeIntForKey(@"NSTitlePosition");
                    this.TitlePosition = titlePosition;
                }
                if (aDecoder.ContainsValueForKey(@"NSTransparent"))
                {
                    // On Apple this is always NO, we keep it for old GNUstep archives
                    _transparent = aDecoder.DecodeBoolForKey(@"NSTransparent");
                }
                if (aDecoder.ContainsValueForKey(@"NSFullyTransparent"))
                {
                    _transparent = aDecoder.DecodeBoolForKey(@"NSFullyTransparent");
                }
                if (aDecoder.ContainsValueForKey(@"NSOffsets"))
                {
                    this.ContentViewMargins = aDecoder.DecodeSizeForKey(@"NSOffsets");
                }
                if (aDecoder.ContainsValueForKey(@"NSTitleCell"))
                {
                    NSCell titleCell = (NSCell)aDecoder.DecodeObjectForKey(@"NSTitleCell");
                    _cell = titleCell;
                }
                if (aDecoder.ContainsValueForKey(@"NSContentView"))
                {
                    NSView contentView = (NSView)aDecoder.DecodeObjectForKey(@"NSContentView");
                    this.ContentView = contentView;
                }
            }

            return this;
        }
Esempio n. 21
0
        public override bool IsEqual(id other)
        {
            if (other == (id)this)
                return true;

            if (other.IsKindOfClass(GSNamedColor.Class) == false
                || ((GSNamedColor)other).CatalogNameComponent.IsEqualToString(_catalog_name) == false
                || ((GSNamedColor)other).ColorNameComponent.IsEqualToString(_color_name) == false)
            {
                return false;
            }
            return true;
        }
Esempio n. 22
0
        public override id InitWithFrame(NSRect frameRect)
        {
            id self = this;

            NSView cv;

            if (base.InitWithFrame(frameRect) == null)
                return null;

            _cell = (id)Objc.MsgSend(NSCell.Alloc(), "InitTextCell", @"Title");
            ((NSCell)_cell).Alignment = NSTextAlignment.NSCenterTextAlignment;
            ((NSCell)_cell).Bordered = false;
            ((NSCell)_cell).Editable = false;
            this.TitleFont = NSFont.SystemFontOfSize(NSFont.SmallSystemFontSize);

            _offsets.Width = 5;
            _offsets.Height = 5;
            _border_rect = _bounds;
            _border_type = NSBorderType.NSGrooveBorder;
            _title_position = NSTitlePosition.NSAtTop;
            _title_rect = NSRect.Zero;

            // FIXME
            //this.AutoresizesSubviews = false;

            cv = (NSView)NSView.Alloc().Init();
            this.ContentView = cv;

            return self;
        }
Esempio n. 23
0
        public virtual void RemoveObjectIdenticalTo(id anObject)
        {
            uint	i;

            if (anObject == null)
            {
                //NSWarnMLog(@"attempt to remove nil object");
                return;
            }
            i = (uint)this.Count;
            if (i > 0)
            {
                while (i-- > 0)
                {
                    id	o = this.ObjectAtIndex((int)i);

                    if (o == anObject)
                    {
                        this.RemoveObjectAtIndex(i);
                    }
                }
            }
        }
Esempio n. 24
0
 public virtual void SetContentView(NSView aView)
 {
     if (aView != null)
     {
         base.ReplaceSubviewWith((NSView)_content_view, (NSView)aView);
         _content_view = aView;
         ((NSView)_content_view).Frame = CalcSizesAllowingNegative(false);
     }
 }
Esempio n. 25
0
 public virtual void RemoveObject(id anObject)
 {
     uint foundIndex = IndexOfObject(anObject);
     if (foundIndex != NS.NotFound)
     {
         RemoveObjectAtIndex(foundIndex);
     }
 }
Esempio n. 26
0
        public override id InitWithCoder(NSCoder aDecoder)
        {
            id self = this;

            if (aDecoder.AllowsKeyedCoding)
            {
                _className = (NSString)aDecoder.DecodeObjectForKey(@"NSClassName");
                _extension = (NSString)aDecoder.DecodeObjectForKey(@"NSExtension");
                _object = aDecoder.DecodeObjectForKey(@"NSObject");
            }
            else
            {

            }

            //base.InitWithCoder(decoder);

            //var xElement = decoder.XmlElement;
            //var xNSClassName = xElement.Descendants().Where(c =>
            //       ((string)c.Attribute("key")) == "NSClassName").FirstOrDefault();
            //if (xNSClassName != null)
            //{
            //    _className = xNSClassName.Value;
            //}

            return self;
        }
Esempio n. 27
0
 public virtual void SetDelegate(id dlgate)
 {
     _delegate = dlgate;
 }
Esempio n. 28
0
 public virtual void SetRealObject(id obj)
 {
     _object = obj;
 }
Esempio n. 29
0
 public virtual void ReplaceObject(id anObject, id anotherObject)
 {
 }
Esempio n. 30
0
 // Init instance of symbolic link type
 public virtual id InitSymbolicLinkWithDestination(NSString path)
 {
     if (base.Init() != null)
     {
         _wrapperData = path;
         _wrapperType = GSFileWrapperType.GSFileWrapperSymbolicLinkType;
     }
     return this;
 }