Changeset 238:380bad9f6852 for dwt/accessibility/AccessibleObject.d
- Timestamp:
- 05/04/08 18:42:55 (4 years ago)
- Files:
-
- dwt/accessibility/AccessibleObject.d (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/accessibility/AccessibleObject.d
r223 r238 44 44 bool isLightweight = false; 45 45 46 static char[]actionNamePtr;47 static char[]descriptionPtr;48 static char[]keybindingPtr;49 static char[]namePtr;46 static String actionNamePtr; 47 static String descriptionPtr; 48 static String keybindingPtr; 49 static String namePtr; 50 50 static AccessibleObject[AtkObject*] AccessibleObjects; 51 51 static /*const*/ uint ATK_ACTION_TYPE; … … 102 102 event.childID = object.id; 103 103 if (parentResult !is null) { 104 char[]res = fromStringz( parentResult );104 String res = fromStringz( parentResult ); 105 105 event.result = res.dup; 106 106 } … … 110 110 if (event.result is null) return parentResult; 111 111 if (keybindingPtr !is null ) OS.g_free (keybindingPtr.ptr); 112 char[]name = event.result.dup ~ \0;112 String name = event.result.dup ~ \0; 113 113 char* p = cast(char*) OS.g_malloc (name.length); 114 114 keybindingPtr = p ? p[ 0 .. name.length ] : null; … … 134 134 event.childID = object.id; 135 135 if (parentResult !is null) { 136 char[]res = fromStringz( parentResult );136 String res = fromStringz( parentResult ); 137 137 event.result = res.dup; 138 138 } … … 143 143 if (actionNamePtr !is null) OS.g_free (actionNamePtr.ptr); 144 144 145 char[]name = event.result.dup ~ \0;145 String name = event.result.dup ~ \0; 146 146 auto p = cast(char*)OS.g_malloc (name.length); 147 147 actionNamePtr = p ? p[ 0 .. name.length ] : null; … … 368 368 if (descriptionPtr !is null) OS.g_free (descriptionPtr.ptr); 369 369 370 char[]name = event.result.dup ~ \0;370 String name = event.result.dup ~ \0; 371 371 char* p = cast(char*)OS.g_malloc (name.length); 372 372 descriptionPtr = p ? p[ 0 .. name.length ] : null; … … 395 395 if (event.result is null) return parentResult; 396 396 if (namePtr !is null) OS.g_free (namePtr.ptr); 397 char[]name = event.result.dup ~ \0;397 String name = event.result.dup ~ \0; 398 398 char* p = cast(char*)OS.g_malloc (name.length); 399 399 namePtr = p ? p[ 0 .. name.length ] : null; … … 636 636 AccessibleObject object = getAccessibleObject (atkObject); 637 637 if (object is null) return 0; 638 char[]text = object.getText ();638 String text = object.getText (); 639 639 if (text !is null) return text[cast(int)/*64*/offset ]; // TODO 640 640 if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) { … … 652 652 AccessibleObject object = getAccessibleObject (atkObject); 653 653 if (object is null) return 0; 654 char[]text = object.getText ();654 String text = object.getText (); 655 655 if (text !is null) return text.length; 656 656 if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) { … … 723 723 AccessibleObject object = getAccessibleObject (atkObject); 724 724 if (object is null) return null; 725 char[]text = object.getText ();725 String text = object.getText (); 726 726 if (text.length > 0) { 727 727 if (end_offset is -1) { … … 746 746 if (object is null) return null; 747 747 int offset = cast(int)/*64*/offset_value; 748 char[]text = object.getText ();748 String text = object.getText (); 749 749 if (text.length > 0) { 750 750 int length = text.length ; … … 923 923 if (object is null) return null; 924 924 int offset = offset_value; 925 char[]text = object.getText ();925 String text = object.getText (); 926 926 if (text.length > 0) { 927 927 int length = text.length; … … 1041 1041 if (object is null) return null; 1042 1042 int offset = offset_value; 1043 char[]text = object.getText ();1043 String text = object.getText (); 1044 1044 if (text.length > 0) { 1045 1045 int length = text.length; … … 1193 1193 } 1194 1194 1195 char[]getText () {1195 String getText () { 1196 1196 char* parentResult; 1197 char[]parentText = ""; //$NON-NLS-1$1197 String parentText = ""; //$NON-NLS-1$ 1198 1198 if (ATK.g_type_is_a (parentType, ATK_TEXT_TYPE)) { 1199 1199 auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (handle)); … … 1237 1237 } 1238 1238 1239 static int nextIndexOfChar ( char[] string, char[]searchChars, int startIndex) {1239 static int nextIndexOfChar (String string, String searchChars, int startIndex) { 1240 1240 int result = string.length; 1241 1241 for (int i = 0; i < searchChars.length; i++) { … … 1247 1247 } 1248 1248 1249 static int nextIndexOfNotChar ( char[] string, char[]searchChars, int startIndex) {1249 static int nextIndexOfNotChar (String string, String searchChars, int startIndex) { 1250 1250 int length = string.length; 1251 1251 int index = startIndex; … … 1258 1258 } 1259 1259 1260 static int previousIndexOfChar ( char[] string, char[]searchChars, int startIndex) {1260 static int previousIndexOfChar (String string, String searchChars, int startIndex) { 1261 1261 int result = -1; 1262 1262 if (startIndex < 0) return result; … … 1270 1270 } 1271 1271 1272 static int previousIndexOfNotChar ( char[] string, char[]searchChars, int startIndex) {1272 static int previousIndexOfNotChar (String string, String searchChars, int startIndex) { 1273 1273 if (startIndex < 0) return -1; 1274 1274 int index = startIndex - 1;
