diff dwt/internal/cocoa/NSMutableDictionary.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSMutableDictionary.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/cocoa/NSMutableDictionary.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,89 +1,56 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 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
+ *    IBM Corporation - initial API and implementation
  *     
  * Port to the D programming language:
- *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *    Jacob Carlborg <doob@me.com>
  *******************************************************************************/
 module dwt.internal.cocoa.NSMutableDictionary;
 
-import dwt.internal.cocoa.id;
-import dwt.internal.cocoa.NSArray;
+import dwt.dwthelper.utils;
+import cocoa = dwt.internal.cocoa.id;
 import dwt.internal.cocoa.NSDictionary;
-import dwt.internal.cocoa.NSInteger;
 import dwt.internal.cocoa.NSString;
 import dwt.internal.cocoa.OS;
+import dwt.internal.objc.cocoa.Cocoa;
 import objc = dwt.internal.objc.runtime;
 
-public class NSMutableDictionary : NSDictionary
-{
+public class NSMutableDictionary : NSDictionary {
 
-    public this ()
-    {
-        super();
-    }
-
-    public this (objc.id id)
-    {
-        super(id);
-    }
+public this() {
+    super();
+}
 
-    public void addEntriesFromDictionary (NSDictionary otherDictionary)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_addEntriesFromDictionary_1, otherDictionary !is null ? otherDictionary.id_ : null);
-    }
+public this(objc.id id) {
+    super(id);
+}
 
-    public static NSMutableDictionary dictionaryWithCapacity (NSUInteger numItems)
-    {
-        objc.id result = OS.objc_msgSend(OS.class_NSMutableDictionary, OS.sel_dictionaryWithCapacity_1, numItems);
-        return result !is null ? new NSMutableDictionary(result) : null;
-    }
-
-    public NSMutableDictionary initWithCapacity (NSUInteger numItems)
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCapacity_1, numItems);
-        return result !is null ? this : null;
-    }
+public this(cocoa.id id) {
+    super(id);
+}
 
-    public void removeAllObjects ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_removeAllObjects);
-    }
+public static NSMutableDictionary dictionaryWithCapacity(NSUInteger numItems) {
+    objc.id result = OS.objc_msgSend(OS.class_NSMutableDictionary, OS.sel_dictionaryWithCapacity_, numItems);
+    return result !is null ? new NSMutableDictionary(result) : null;
+}
 
-    public void removeObjectForKey (id aKey)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_removeObjectForKey_1, aKey !is null ? aKey.id_ : null);
-    }
-
-    public void removeObjectsForKeys (NSArray keyArray)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_removeObjectsForKeys_1, keyArray !is null ? keyArray.id_ : null);
-    }
+public void setObject(cocoa.id anObject, cocoa.id aKey) {
+    OS.objc_msgSend(this.id, OS.sel_setObject_forKey_, anObject !is null ? anObject.id : null, aKey !is null ? aKey.id : null);
+}
 
-    public void setDictionary (NSDictionary otherDictionary)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDictionary_1, otherDictionary !is null ? otherDictionary.id_ : null);
-    }
-
-    public void setObject (id anObject, id aKey)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setObject_1forKey_1, anObject !is null ? anObject.id_ : null, aKey !is null ? aKey.id_ : null);
-    }
+public void setValue(cocoa.id value, NSString key) {
+    OS.objc_msgSend(this.id, OS.sel_setValue_forKey_, value !is null ? value.id : null, key !is null ? key.id : null);
+}
 
-    public void setObject (id anObject, objc.id aKey)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setObject_1forKey_1, anObject !is null ? anObject.id_ : null, aKey);
-    }
-
-    public void setValue (id value, NSString key)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setValue_1forKey_1, value !is null ? value.id_ : null, key !is null ? key.id_ : null);
-    }
+public static NSDictionary dictionaryWithObject(cocoa.id object, cocoa.id key) {
+    objc.id result = OS.objc_msgSend(OS.class_NSMutableDictionary, OS.sel_dictionaryWithObject_forKey_, object !is null ? object.id : null, key !is null ? key.id : null);
+    return result !is null ? new NSMutableDictionary(result) : null;
+}
 
 }