Mercurial > projects > dwt-linux
comparison dwt/dnd/Clipboard.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | de2578a843a7 |
children | 5a30aa9820f3 |
comparison
equal
deleted
inserted
replaced
237:98b80b00af79 | 238:380bad9f6852 |
---|---|
111 * @exception DWTException <ul> | 111 * @exception DWTException <ul> |
112 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> | 112 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> |
113 * </ul> | 113 * </ul> |
114 */ | 114 */ |
115 protected void checkSubclass () { | 115 protected void checkSubclass () { |
116 char[] name = this.classinfo.name; | 116 String name = this.classinfo.name; |
117 char[] validName = Clipboard.classinfo.name; | 117 String validName = Clipboard.classinfo.name; |
118 if ( validName !=/*eq*/ name ) { | 118 if ( validName !=/*eq*/ name ) { |
119 DND.error (DWT.ERROR_INVALID_SUBCLASS); | 119 DND.error (DWT.ERROR_INVALID_SUBCLASS); |
120 } | 120 } |
121 } | 121 } |
122 /** | 122 /** |
550 * @exception DWTException <ul> | 550 * @exception DWTException <ul> |
551 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 551 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
552 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 552 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
553 * </ul> | 553 * </ul> |
554 */ | 554 */ |
555 public char[][] getAvailableTypeNames() { | 555 public String[] getAvailableTypeNames() { |
556 checkWidget(); | 556 checkWidget(); |
557 auto types1 = getAvailableClipboardTypes(); | 557 auto types1 = getAvailableClipboardTypes(); |
558 auto types2 = getAvailablePrimaryTypes(); | 558 auto types2 = getAvailablePrimaryTypes(); |
559 char[][] result = new char[][types1.length + types2.length]; | 559 String[] result = new String[types1.length + types2.length]; |
560 int count = 0; | 560 int count = 0; |
561 for (int i = 0; i < types1.length; i++) { | 561 for (int i = 0; i < types1.length; i++) { |
562 auto pName = OS.gdk_atom_name(types1[i]); | 562 auto pName = OS.gdk_atom_name(types1[i]); |
563 if (pName is null) { | 563 if (pName is null) { |
564 continue; | 564 continue; |
565 } | 565 } |
566 char[] buffer = tango.stdc.stringz.fromStringz( pName ).dup; | 566 String buffer = tango.stdc.stringz.fromStringz( pName ).dup; |
567 OS.g_free (pName); | 567 OS.g_free (pName); |
568 result[count++] = "GTKCLIPBOARD "~buffer; | 568 result[count++] = "GTKCLIPBOARD "~buffer; |
569 } | 569 } |
570 for (int i = 0; i < types2.length; i++) { | 570 for (int i = 0; i < types2.length; i++) { |
571 auto pName = OS.gdk_atom_name(types2[i]); | 571 auto pName = OS.gdk_atom_name(types2[i]); |
572 if (pName is null) { | 572 if (pName is null) { |
573 continue; | 573 continue; |
574 } | 574 } |
575 char[] buffer = tango.stdc.stringz.fromStringz( pName ).dup; | 575 String buffer = tango.stdc.stringz.fromStringz( pName ).dup; |
576 OS.g_free (pName); | 576 OS.g_free (pName); |
577 result[count++] = "GTKPRIMARYCLIPBOARD "~buffer; | 577 result[count++] = "GTKPRIMARYCLIPBOARD "~buffer; |
578 } | 578 } |
579 if (count < result.length){ | 579 if (count < result.length){ |
580 char[][] temp = new char[][count]; | 580 String[] temp = new String[count]; |
581 System.arraycopy(result, 0, temp, 0, count); | 581 System.arraycopy(result, 0, temp, 0, count); |
582 result = temp; | 582 result = temp; |
583 } | 583 } |
584 return result; | 584 return result; |
585 } | 585 } |
616 } | 616 } |
617 return types; | 617 return types; |
618 } | 618 } |
619 | 619 |
620 GtkSelectionData* gtk_clipboard_wait_for_contents(void* clipboard, void* target) { | 620 GtkSelectionData* gtk_clipboard_wait_for_contents(void* clipboard, void* target) { |
621 char[] key = "org.eclipse.swt.internal.gtk.dispatchEvent"; | 621 String key = "org.eclipse.swt.internal.gtk.dispatchEvent"; |
622 Display display = this.display; | 622 Display display = this.display; |
623 ArrayWrapperInt arr = new ArrayWrapperInt( [ OS.GDK_PROPERTY_NOTIFY, OS.GDK_SELECTION_CLEAR, OS.GDK_SELECTION_REQUEST, OS.GDK_SELECTION_NOTIFY ] ); | 623 ArrayWrapperInt arr = new ArrayWrapperInt( [ OS.GDK_PROPERTY_NOTIFY, OS.GDK_SELECTION_CLEAR, OS.GDK_SELECTION_REQUEST, OS.GDK_SELECTION_NOTIFY ] ); |
624 display.setData(key, arr ); | 624 display.setData(key, arr ); |
625 GtkSelectionData* selection_data = OS.gtk_clipboard_wait_for_contents(clipboard, target); | 625 GtkSelectionData* selection_data = OS.gtk_clipboard_wait_for_contents(clipboard, target); |
626 display.setData(key, null); | 626 display.setData(key, null); |