diff dwt/internal/cocoa/NSColorList.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSColorList.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSColorList;
+
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSColor;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSObject;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSColorList : NSObject
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public NSArray allKeys ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_allKeys);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public static NSArray availableColorLists ()
+    {
+        objc.id result = OS.objc_msgSend(OS.class_NSColorList, OS.sel_availableColorLists);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public static NSColorList colorListNamed (NSString name)
+    {
+        objc.id result = OS.objc_msgSend(OS.class_NSColorList, OS.sel_colorListNamed_1, name !is null ? name.id : null);
+        return result !is null ? new NSColorList(result) : null;
+    }
+
+    public NSColor colorWithKey (NSString key)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_colorWithKey_1, key !is null ? key.id : null);
+        return result !is null ? new NSColor(result) : null;
+    }
+
+    public NSColorList initWithName_ (NSString name)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithName_1, name !is null ? name.id : null);
+        return result !is null ? this : null;
+    }
+
+    public NSColorList initWithName_fromFile_ (NSString name, NSString path)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithName_1fromFile_1, name !is null ? name.id : null, path !is null ? path.id : null);
+        return result !is null ? this : null;
+    }
+
+    public void insertColor (NSColor color, NSString key, NSUInteger loc)
+    {
+        OS.objc_msgSend(this.id, OS.sel_insertColor_1key_1atIndex_1, color !is null ? color.id : null, key !is null ? key.id : null, loc);
+    }
+
+    public bool isEditable ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isEditable) !is null;
+    }
+
+    public NSString name ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_name);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void removeColorWithKey (NSString key)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeColorWithKey_1, key !is null ? key.id : null);
+    }
+
+    public void removeFile ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeFile);
+    }
+
+    public void setColor (NSColor color, NSString key)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setColor_1forKey_1, color !is null ? color.id : null, key !is null ? key.id : null);
+    }
+
+    public bool writeToFile (NSString path)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_writeToFile_1, path !is null ? path.id : null) !is null;
+    }
+
+}