Mercurial > projects > dwt-linux
diff dwt/accessibility/AccessibleObject.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | d0081b1505da |
children | ce446666f5a2 |
line wrap: on
line diff
--- a/dwt/accessibility/AccessibleObject.d Sat Apr 26 10:01:30 2008 +0200 +++ b/dwt/accessibility/AccessibleObject.d Mon May 05 00:42:55 2008 +0200 @@ -43,10 +43,10 @@ */ bool isLightweight = false; - static char[] actionNamePtr; - static char[] descriptionPtr; - static char[] keybindingPtr; - static char[] namePtr; + static String actionNamePtr; + static String descriptionPtr; + static String keybindingPtr; + static String namePtr; static AccessibleObject[AtkObject*] AccessibleObjects; static /*const*/ uint ATK_ACTION_TYPE; static /*const*/ uint ATK_COMPONENT_TYPE; @@ -101,7 +101,7 @@ AccessibleEvent event = new AccessibleEvent (object); event.childID = object.id; if (parentResult !is null) { - char[] res = fromStringz( parentResult ); + String res = fromStringz( parentResult ); event.result = res.dup; } for (int i = 0; i < listeners.length; i++) { @@ -109,7 +109,7 @@ } if (event.result is null) return parentResult; if (keybindingPtr !is null ) OS.g_free (keybindingPtr.ptr); - char[] name = event.result.dup ~ \0; + String name = event.result.dup ~ \0; char* p = cast(char*) OS.g_malloc (name.length); keybindingPtr = p ? p[ 0 .. name.length ] : null; return keybindingPtr.ptr; @@ -133,7 +133,7 @@ AccessibleControlEvent event = new AccessibleControlEvent (object); event.childID = object.id; if (parentResult !is null) { - char[] res = fromStringz( parentResult ); + String res = fromStringz( parentResult ); event.result = res.dup; } for (int i = 0; i < listeners.length; i++) { @@ -142,7 +142,7 @@ if (event.result is null) return parentResult; if (actionNamePtr !is null) OS.g_free (actionNamePtr.ptr); - char[] name = event.result.dup ~ \0; + String name = event.result.dup ~ \0; auto p = cast(char*)OS.g_malloc (name.length); actionNamePtr = p ? p[ 0 .. name.length ] : null; return actionNamePtr.ptr; @@ -367,7 +367,7 @@ if (event.result is null) return parentResult; if (descriptionPtr !is null) OS.g_free (descriptionPtr.ptr); - char[] name = event.result.dup ~ \0; + String name = event.result.dup ~ \0; char* p = cast(char*)OS.g_malloc (name.length); descriptionPtr = p ? p[ 0 .. name.length ] : null; return descriptionPtr.ptr; } @@ -394,7 +394,7 @@ } if (event.result is null) return parentResult; if (namePtr !is null) OS.g_free (namePtr.ptr); - char[] name = event.result.dup ~ \0; + String name = event.result.dup ~ \0; char* p = cast(char*)OS.g_malloc (name.length); namePtr = p ? p[ 0 .. name.length ] : null; return namePtr.ptr; @@ -635,7 +635,7 @@ if (DEBUG) Stdout.formatln ("-->atkText_get_character_at_offset"); AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return 0; - char[] text = object.getText (); + String text = object.getText (); if (text !is null) return text[cast(int)/*64*/offset ]; // TODO if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) { auto textIface = cast(AtkTextIface*)ATK.g_type_class_peek (object.parentType); @@ -651,7 +651,7 @@ if (DEBUG) Stdout.formatln ("-->atkText_get_character_count"); AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return 0; - char[] text = object.getText (); + String text = object.getText (); if (text !is null) return text.length; if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) { auto textIface = cast(AtkTextIface*)ATK.g_type_class_peek (object.parentType); @@ -722,7 +722,7 @@ if (DEBUG) Stdout.formatln ("-->atkText_get_text: {},{}", start_offset, end_offset); AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return null; - char[] text = object.getText (); + String text = object.getText (); if (text.length > 0) { if (end_offset is -1) { end_offset = text.length ; @@ -745,7 +745,7 @@ AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return null; int offset = cast(int)/*64*/offset_value; - char[] text = object.getText (); + String text = object.getText (); if (text.length > 0) { int length = text.length ; offset = Math.min (offset, length - 1); @@ -922,7 +922,7 @@ AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return null; int offset = offset_value; - char[] text = object.getText (); + String text = object.getText (); if (text.length > 0) { int length = text.length; offset = Math.min (offset, length - 1); @@ -1040,7 +1040,7 @@ AccessibleObject object = getAccessibleObject (atkObject); if (object is null) return null; int offset = offset_value; - char[] text = object.getText (); + String text = object.getText (); if (text.length > 0) { int length = text.length; offset = Math.min (offset, length - 1); @@ -1192,9 +1192,9 @@ return result !is null ? result : new AccessibleControlListener [0]; } - char[] getText () { + String getText () { char* parentResult; - char[] parentText = ""; //$NON-NLS-1$ + String parentText = ""; //$NON-NLS-1$ if (ATK.g_type_is_a (parentType, ATK_TEXT_TYPE)) { auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (handle)); int /*long*/ characterCount = 0; @@ -1236,7 +1236,7 @@ } } - static int nextIndexOfChar (char[] string, char[] searchChars, int startIndex) { + static int nextIndexOfChar (String string, String searchChars, int startIndex) { int result = string.length; for (int i = 0; i < searchChars.length; i++) { char current = searchChars[i]; @@ -1246,7 +1246,7 @@ return result; } - static int nextIndexOfNotChar (char[] string, char[] searchChars, int startIndex) { + static int nextIndexOfNotChar (String string, String searchChars, int startIndex) { int length = string.length; int index = startIndex; while (index < length) { @@ -1257,7 +1257,7 @@ return index; } - static int previousIndexOfChar (char[] string, char[] searchChars, int startIndex) { + static int previousIndexOfChar (String string, String searchChars, int startIndex) { int result = -1; if (startIndex < 0) return result; string = string[0 .. startIndex]; @@ -1269,7 +1269,7 @@ return result; } - static int previousIndexOfNotChar (char[] string, char[] searchChars, int startIndex) { + static int previousIndexOfNotChar (String string, String searchChars, int startIndex) { if (startIndex < 0) return -1; int index = startIndex - 1; while (index >= 0) {