diff dwt/internal/cocoa/NSTextStorage.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/NSTextStorage.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/cocoa/NSTextStorage.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,175 +1,47 @@
 /*******************************************************************************
- * 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.NSTextStorage;
 
-import dwt.internal.cocoa.id;
+import dwt.dwthelper.utils;
+import cocoa = dwt.internal.cocoa.id;
 import dwt.internal.cocoa.NSArray;
-import dwt.internal.cocoa.NSColor;
-import dwt.internal.cocoa.NSFont;
-import dwt.internal.cocoa.NSInteger;
 import dwt.internal.cocoa.NSLayoutManager;
 import dwt.internal.cocoa.NSMutableAttributedString;
-import dwt.internal.cocoa.NSRange;
 import dwt.internal.cocoa.OS;
 import objc = dwt.internal.objc.runtime;
 
-public class NSTextStorage : NSMutableAttributedString
-{
-
-    public this ()
-    {
-        super();
-    }
-
-    public this (objc.id id)
-    {
-        super(id);
-    }
-
-    public void addLayoutManager (NSLayoutManager obj)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_addLayoutManager_1, obj !is null ? obj.id_ : null);
-    }
-
-    public NSArray attributeRuns ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributeRuns);
-        return result !is null ? new NSArray(result) : null;
-    }
-
-    public NSInteger changeInLength ()
-    {
-        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_changeInLength);
-    }
-
-    public NSArray characters ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_characters);
-        return result !is null ? new NSArray(result) : null;
-    }
+public class NSTextStorage : NSMutableAttributedString {
 
-    public id delegatee ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate);
-        return result !is null ? new id(result) : null;
-    }
-
-    public void edited (NSUInteger editedMask, NSRange range, NSInteger delta)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_edited_1range_1changeInLength_1, editedMask, range, delta);
-    }
-
-    public NSUInteger editedMask ()
-    {
-        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_editedMask);
-    }
+public this() {
+    super();
+}
 
-    public NSRange editedRange ()
-    {
-        NSRange result;
-        OS.objc_msgSend_stret(&result, this.id_, OS.sel_editedRange);
-        return result;
-    }
-
-    public void ensureAttributesAreFixedInRange (NSRange range)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_ensureAttributesAreFixedInRange_1, range);
-    }
-
-    public bool fixesAttributesLazily ()
-    {
-        return OS.objc_msgSend(this.id_, OS.sel_fixesAttributesLazily) !is null;
-    }
-
-    public NSFont font ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_font);
-        return result !is null ? new NSFont(result) : null;
-    }
+public this(objc.id id) {
+    super(id);
+}
 
-    public NSColor foregroundColor ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_foregroundColor);
-        return result !is null ? new NSColor(result) : null;
-    }
-
-    public void invalidateAttributesInRange (NSRange range)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_invalidateAttributesInRange_1, range);
-    }
-
-    public NSArray layoutManagers ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_layoutManagers);
-        return result !is null ? new NSArray(result) : null;
-    }
-
-    public NSArray paragraphs ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_paragraphs);
-        return result !is null ? new NSArray(result) : null;
-    }
-
-    public void processEditing ()
-    {
-        OS.objc_msgSend(this.id_, OS.sel_processEditing);
-    }
-
-    public void removeLayoutManager (NSLayoutManager obj)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_removeLayoutManager_1, obj !is null ? obj.id_ : null);
-    }
+public this(cocoa.id id) {
+    super(id);
+}
 
-    public void setAttributeRuns (NSArray attributeRuns)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setAttributeRuns_1, attributeRuns !is null ? attributeRuns.id_ : null);
-    }
-
-    public void setCharacters (NSArray characters)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setCharacters_1, characters !is null ? characters.id_ : null);
-    }
-
-    public void setDelegate (id delegatee)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id_ : null);
-    }
-
-    public void setFont (NSFont font)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setFont_1, font !is null ? font.id_ : null);
-    }
+public void addLayoutManager(NSLayoutManager obj) {
+    OS.objc_msgSend(this.id, OS.sel_addLayoutManager_, obj !is null ? obj.id : null);
+}
 
-    public void setForegroundColor (NSColor color)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setForegroundColor_1, color !is null ? color.id_ : null);
-    }
-
-    public void setParagraphs (NSArray paragraphs)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setParagraphs_1, paragraphs !is null ? paragraphs.id_ : null);
-    }
-
-    public void setWords (NSArray words)
-    {
-        OS.objc_msgSend(this.id_, OS.sel_setWords_1, words !is null ? words.id_ : null);
-    }
-
-    public NSArray words ()
-    {
-        objc.id result = OS.objc_msgSend(this.id_, OS.sel_words);
-        return result !is null ? new NSArray(result) : null;
-    }
+public NSArray paragraphs() {
+    objc.id result = OS.objc_msgSend(this.id, OS.sel_paragraphs);
+    return result !is null ? new NSArray(result) : null;
+}
 
 }