diff dwt/widgets/IME.d @ 51:e6f04eb518ae

Updated Canvas to 3.514
author Jacob Carlborg <doob@me.com>
date Sun, 07 Dec 2008 21:24:13 +0100
parents d8635bb48c7c
children 6309d49b16b7
line wrap: on
line diff
--- a/dwt/widgets/IME.d	Sun Dec 07 21:06:50 2008 +0100
+++ b/dwt/widgets/IME.d	Sun Dec 07 21:24:13 2008 +0100
@@ -33,6 +33,7 @@
 import dwt.internal.cocoa.OS;
 
 import dwt.dwthelper.utils;
+import dwt.internal.objc.cocoa.Cocoa;
 import dwt.widgets.Canvas;
 import dwt.widgets.Widget;
 
@@ -106,7 +107,7 @@
     createWidget ();
 }
 
-int /*long*/ attributedSubstringFromRange (int /*long*/ id, int /*long*/ sel, int /*long*/ rangePtr) {
+objc.id attributedSubstringFromRange (objc.id id, objc.SEL sel, objc.id rangePtr) {
     Event event = new Event ();
     event.detail = DWT.COMPOSITION_SELECTION;
     sendEvent (DWT.ImeComposition, event);
@@ -120,10 +121,10 @@
         attriStr.autorelease ();
         return attriStr.id;
     }
-    return 0;
+    return null;
 }
 
-int /*long*/ characterIndexForPoint (int /*long*/ id, int /*long*/ sel, int /*long*/ point) {
+NSInteger characterIndexForPoint (objc.id id, objc.SEL sel, objc.id point) {
     if (!isInlineEnabled ()) return OS.NSNotFound;
     NSPoint pt = new NSPoint ();
     OS.memmove (pt, point, NSPoint.sizeof);
@@ -147,7 +148,7 @@
     }
 }
 
-NSRect firstRectForCharacterRange(int /*long*/ id, int /*long*/ sel, int /*long*/ range) {
+NSRect firstRectForCharacterRange(objc.id id, objc.SEL sel, objc.id range) {
     NSRect rect = new NSRect ();
     Caret caret = parent.caret;
     if (caret !is null) {
@@ -352,18 +353,18 @@
     return false; 
 }
 
-bool hasMarkedText (int /*long*/ id, int /*long*/ sel) {
+bool hasMarkedText (objc.id id, objc.SEL sel) {
     return text.length () !is 0;
 }
 
-bool insertText (int /*long*/ id, int /*long*/ sel, int /*long*/ string) {
+bool insertText (objc.id id, objc.SEL sel, objc.id string) {
     if (startOffset is -1) return true;
     NSString str = new NSString (string);
     if (str.isKindOfClass (OS.objc_getClass ("NSAttributedString"))) {
-        str = new NSAttributedString (string).string ();
+        str = (new NSAttributedString (string)).string ();
     }
-    int length = (int)/*64*/str.length ();
-    int end = startOffset + text.length ();
+    NSUInteger length = str.length ();
+    NSUInteger end = startOffset + text.length ();
     ranges = null;
     styles = null;
     caretOffset = commitCount = length;
@@ -383,7 +384,7 @@
     return hooks (DWT.ImeComposition);
 }
 
-NSRange markedRange (int /*long*/ id, int /*long*/ sel) {
+NSRange markedRange (objc.id id, objc.SEL sel) {
     if (startOffset is -1) {
         Event event = new Event ();
         event.detail = DWT.COMPOSITION_SELECTION;
@@ -409,7 +410,7 @@
     ranges = null;
 }
 
-NSRange selectedRange (int /*long*/ id, int /*long*/ sel) {
+NSRange selectedRange (objc.id id, objc.SEL sel) {
     Event event = new Event ();
     event.detail = DWT.COMPOSITION_SELECTION;
     sendEvent (DWT.ImeComposition, event);
@@ -443,7 +444,7 @@
     }
 }
 
-bool setMarkedText_selectedRange (int /*long*/ id, int /*long*/ sel, int /*long*/ string, int /*long*/ selRange) {
+bool setMarkedText_selectedRange (objc.id id, objc.SEL sel, objc.id string, objc.id selRange) {
     if (!isInlineEnabled ()) return true;
     ranges = null;
     styles = null;
@@ -502,14 +503,14 @@
     return true;
 }
 
-int /*long*/ validAttributesForMarkedText (int /*long*/ id, int /*long*/ sel) {
+objc.id validAttributesForMarkedText (objc.id id, objc.SEL sel) {
     NSMutableArray attribs = NSMutableArray.arrayWithCapacity (6);
-    attribs.addObject (new NSString (OS.NSForegroundColorAttributeName ()));
-    attribs.addObject (new NSString (OS.NSBackgroundColorAttributeName ()));
-    attribs.addObject (new NSString (OS.NSUnderlineStyleAttributeName ()));
-    attribs.addObject (new NSString (OS.NSUnderlineColorAttributeName ()));
-    attribs.addObject (new NSString (OS.NSStrikethroughStyleAttributeName ()));
-    attribs.addObject (new NSString (OS.NSStrikethroughColorAttributeName ()));
+    attribs.addObject (new NSString (OS.NSForegroundColorAttributeName_ ));
+    attribs.addObject (new NSString (OS.NSBackgroundColorAttributeName_ ));
+    attribs.addObject (new NSString (OS.NSUnderlineStyleAttributeName_ ));
+    attribs.addObject (new NSString (OS.NSUnderlineColorAttributeName_ ));
+    attribs.addObject (new NSString (OS.NSStrikethroughStyleAttributeName_ ));
+    attribs.addObject (new NSString (OS.NSStrikethroughColorAttributeName_ ));
     return attribs.id;
 }