Changeset 474
- Timestamp:
- 03/22/08 10:57:03 (6 months ago)
- Files:
-
- trunk/wrap/APILookupGLib.txt (modified) (27 diffs)
- trunk/wrap/APILookupGObject.txt (modified) (8 diffs)
- trunk/wrap/APILookupGStreamer.txt (modified) (10 diffs)
- trunk/wrap/APILookupGdk.txt (modified) (1 diff)
- trunk/wrap/APILookupGdkPixbuf.txt (modified) (1 diff)
- trunk/wrap/APILookupGlade.txt (modified) (4 diffs)
- trunk/wrap/APILookupGtk.txt (modified) (115 diffs)
- trunk/wrap/APILookupPango.txt (modified) (4 diffs)
- trunk/wrap/APILookupSourceView.txt (modified) (1 diff)
- trunk/wrap/Loader.d (modified) (14 diffs)
- trunk/wrap/paths.d (modified) (5 diffs)
- trunk/wrap/utils/GtkDClass.d (modified) (1 diff)
- trunk/wrap/utils/GtkWrapper.d (modified) (1 diff)
- trunk/wrap/utils/funct.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wrap/APILookupGLib.txt
r470 r474 59 59 public alias uint XID; 60 60 61 version(Tango) public alias char[] string; 62 61 63 addTypedefs: end 62 64 … … 290 292 291 293 code: start 292 293 const static char[10] digits = "0123456789"; /// 0..9 294 295 /************************************************* 296 * Convert C-style 0 terminated string s to char[] string. 297 * copied from phobos 298 */ 299 public static char[] toString(char *s) 300 { 301 return s ? s[0 .. strlen(s)] : cast(char[])null; 302 } 303 304 /********************************* 305 * Convert array of chars s[] to a C-style 0 terminated string. 306 * copied from phobos 307 */ 308 public static char* toStringz(char[] s) 309 in 310 { 311 } 312 out (result) 313 { 314 // if (result) 315 // { 316 // // TODO this one fails in some case??? 317 // assert(strlen(result) == s.length); 318 // assert(memcmp(result, s, s.length) == 0); 319 // } 320 } 321 body 322 { 323 if ( s is null ) return null; 324 char[] copy; 325 326 if (s.length == 0) 327 { 328 copy = ""; 329 } 330 else 331 { 332 // Need to make a copy 333 copy = new char[s.length + 1]; 334 copy[0..s.length] = s; 335 copy[s.length] = 0; 336 } 337 338 return copy.ptr; 339 } 340 294 const static char[10] digits = "0123456789"; /// 0..9 295 296 /************************************************* 297 * Convert C-style 0 terminated string s to char[] string. 298 * copied from phobos 299 */ 300 public static string toString(char *s) 301 { 302 version(D_Version2) 303 return s ? s[0 .. strlen(s)].idup : cast(string)null; 304 else 305 return s ? s[0 .. strlen(s)].dup : cast(string)null; 306 } 307 308 /********************************* 309 * Convert array of chars s[] to a C-style 0 terminated string. 310 * copied from phobos 311 */ 312 public static char* toStringz(string s) 313 in 314 { 315 } 316 out (result) 317 { 318 // if (result) 319 // { 320 // // TODO this one fails in some case??? 321 // assert(strlen(result) == s.length); 322 // assert(memcmp(result, s, s.length) == 0); 323 // } 324 } 325 body 326 { 327 if ( s is null ) return null; 328 char[] copy; 329 330 if (s.length == 0) 331 { 332 copy = "".dup; 333 } 334 else 335 { 336 // Need to make a copy 337 copy = new char[s.length + 1]; 338 copy[0..s.length] = s.dup; 339 copy[s.length] = 0; 340 } 341 342 return copy.ptr; 343 } 344 341 345 /** */ 342 public static char** toStringzArray( char[][] args)346 public static char** toStringzArray(string[] args) 343 347 { 344 348 if ( args is null ) … … 348 352 char** argv = (new char*[args.length]).ptr; 349 353 int argc = 0; 350 foreach ( char[]p; args)351 { 352 argv[argc++] = cast(char*)(p ~'\0');354 foreach (string p; args) 355 { 356 argv[argc++] = cast(char*)(p.dup~'\0'); 353 357 } 354 358 argv[argc] = null; … … 356 360 return argv; 357 361 } 358 362 359 363 /** */ 360 public static char[][] toStringArray(char** args)364 public static string[] toStringArray(char** args) 361 365 { 362 366 if ( args is null ) … … 364 368 return null; 365 369 } 366 char[][] argv;370 string[] argv; 367 371 368 372 char* arg = args[0]; … … 377 381 return argv; 378 382 } 379 383 380 384 /** */ 381 public static char[]toString(bool b)385 public static string toString(bool b) 382 386 { 383 387 return b ? "true" : "false"; … … 392 396 return result[0 .. 1]; 393 397 } 394 398 395 399 /** */ 396 public static char[]toString(ubyte ub) { return toString(cast(uint) ub); } /// ditto400 public static string toString(ubyte ub) { return toString(cast(uint) ub); } /// ditto 397 401 /** */ 398 public static char[]toString(ushort us) { return toString(cast(uint) us); } /// ditto402 public static string toString(ushort us) { return toString(cast(uint) us); } /// ditto 399 403 400 404 /** */ 401 public static char[] toString(uint u) 402 { char[uint.sizeof * 3] buffer = void; 405 public static string toString(uint u) 406 { 407 char[uint.sizeof * 3] buffer = void; 403 408 int ndigits; 404 409 char c; 405 char[]result;406 410 string result; 411 407 412 ndigits = 0; 408 413 if (u < 10) 409 // Avoid storage allocation for simple stuff 410 result = digits[u .. u + 1]; 414 { 415 version(D_Version2) 416 result = digits[u .. u + 1].idup; 417 else 418 // Avoid storage allocation for simple stuff 419 result = digits[u .. u + 1]; 420 } 411 421 else 412 422 { 423 while (u) 424 { 425 c = (u % 10) + '0'; 426 u /= 10; 427 ndigits++; 428 buffer[buffer.length - ndigits] = c; 429 } 430 431 version(D_Version2) 432 { 433 //result = new char[ndigits]; 434 result = buffer[buffer.length - ndigits .. buffer.length].idup; 435 } 436 else 437 { 438 result = new char[ndigits]; 439 result[] = buffer[buffer.length - ndigits .. buffer.length]; 440 } 441 } 442 return result; 443 } 444 445 /** */ 446 public static string toString(ulong u) 447 { 448 char[ulong.sizeof * 3] buffer; 449 int ndigits; 450 char c; 451 string result; 452 453 if (u < 0x1_0000_0000) 454 return toString(cast(uint)u); 455 456 ndigits = 0; 413 457 while (u) 414 458 { … … 418 462 buffer[buffer.length - ndigits] = c; 419 463 } 420 result = new char[ndigits]; 421 result[] = buffer[buffer.length - ndigits .. buffer.length]; 464 465 version(D_Version2) 466 { 467 //result = new char[ndigits]; 468 result = buffer[buffer.length - ndigits .. buffer.length].idup; 469 } 470 else 471 { 472 result = new char[ndigits]; 473 result[] = buffer[buffer.length - ndigits .. buffer.length]; 422 474 } 423 475 return result; 424 476 } 425 477 426 478 /** */ 427 public static char[] toString(ulong u) 428 { char[ulong.sizeof * 3] buffer; 429 int ndigits; 479 public static string toString(byte b) { return toString(cast(int) b); } /// ditto 480 /** */ 481 public static string toString(short s) { return toString(cast(int) s); } /// ditto 482 483 /** */ 484 public static string toString(int i) 485 { 486 char[1 + int.sizeof * 3] buffer; 430 487 char c; 431 char[] result; 432 433 if (u < 0x1_0000_0000) 434 return toString(cast(uint)u); 435 ndigits = 0; 436 while (u) 437 { 438 c = (u % 10) + '0'; 439 u /= 10; 440 ndigits++; 441 buffer[buffer.length - ndigits] = c; 442 } 443 result = new char[ndigits]; 444 result[] = buffer[buffer.length - ndigits .. buffer.length]; 445 return result; 446 } 447 448 /** */ 449 public static char[] toString(byte b) { return toString(cast(int) b); } /// ditto 450 /** */ 451 public static char[] toString(short s) { return toString(cast(int) s); } /// ditto 452 453 /** */ 454 public static char[] toString(int i) 455 { char[1 + int.sizeof * 3] buffer; 456 char c; 457 char[] result; 458 488 string result; 489 459 490 if (i >= 0) 460 return toString(cast(uint)i);461 491 return toString(cast(uint)i); 492 462 493 uint u = -i; 463 494 int ndigits = 1; 464 495 while (u) 465 496 { 466 c = (u % 10) + '0';467 u /= 10;468 buffer[buffer.length - ndigits] = c;469 ndigits++;497 c = (u % 10) + '0'; 498 u /= 10; 499 buffer[buffer.length - ndigits] = c; 500 ndigits++; 470 501 } 471 502 buffer[buffer.length - ndigits] = '-'; 472 result = new char[ndigits]; 473 result[] = buffer[buffer.length - ndigits .. buffer.length]; 503 504 version(D_Version2) 505 { 506 //result = new char[ndigits]; 507 result = buffer[buffer.length - ndigits .. buffer.length].idup; 508 } 509 else 510 { 511 result = new char[ndigits]; 512 result[] = buffer[buffer.length - ndigits .. buffer.length]; 513 } 474 514 return result; 475 515 } 476 477 516 code: end 478 517 … … 672 711 673 712 code: start 674 713 675 714 version(Tango) alias splitLines splitlines; 676 677 678 char[]workingDirectory = ".";679 char[][] argv;680 char[][] envp;715 716 717 string workingDirectory = "."; 718 string[] argv; 719 string[] envp; 681 720 GSpawnFlags flags = SpawnFlags.SEARCH_PATH; 682 GSpawnChildSetupFunc childSetup; 721 GSpawnChildSetupFunc childSetup; 683 722 void* userData; 684 723 GPid childPid; … … 690 729 int stdOut; 691 730 int stdErr; 692 731 693 732 // for commandLineSync 694 733 int exitStatus; … … 702 741 * Creates a Spawn for execution. 703 742 */ 704 public this( char[] program, char[][] envp=null)743 public this(string program, string[] envp=null) 705 744 { 706 745 argv ~= program; … … 711 750 * Creates a Spawn for execution. 712 751 */ 713 public this( char[][] program, char[][] envp=null)752 public this(string[] program, string[] envp=null) 714 753 { 715 754 argv = program; … … 757 796 * Adds a parameter to the execution program 758 797 */ 759 public void addParm( char[]parm)798 public void addParm(string parm) 760 799 { 761 800 argv ~= parm; 762 801 } 763 802 764 803 /** 765 804 * Gets the last error message 766 805 */ 767 public char[]getLastError()806 public string getLastError() 768 807 { 769 808 if ( error != null ) … … 773 812 return ""; 774 813 } 775 814 776 815 version(Tango) 777 816 { … … 779 818 extern (C) FILE* fdopen(int, char*); //Generates linker error on linux. 780 819 else 781 private import tango.stdc.posix.stdio; 782 } 783 820 private import tango.stdc.posix.stdio; 821 } 822 784 823 /** 785 824 * Executes the prepared process … … 787 826 public int execAsyncWithPipes( 788 827 ChildWatch externalWatch = null, 789 bool delegate( char[]) readOutput = null,790 bool delegate( char[]) readError = null )828 bool delegate(string) readOutput = null, 829 bool delegate(string) readError = null ) 791 830 { 792 831 int result = g_spawn_async_with_pipes( … … 827 866 class ReadFile : Thread 828 867 { 829 bool delegate( char[]) read;868 bool delegate(string) read; 830 869 FILE* file; 831 870 832 871 int lineCount; 833 872 834 this(FILE* file, bool delegate ( char[]) read )873 this(FILE* file, bool delegate (string) read ) 835 874 { 836 875 this.file = file; … … 840 879 public int run() 841 880 { 842 char[]line = readLine(file);881 string line = readLine(file); 843 882 while( line !is null ) 844 883 { … … 852 891 line = readLine(file); 853 892 } 854 return 0; 855 } 856 } 857 858 private char[]readLine(FILE* stream, int max=4096)893 return 0; 894 } 895 } 896 897 private string readLine(FILE* stream, int max=4096) 859 898 { 860 899 if ( feof(stream) ) … … 866 905 return null; 867 906 } 868 char[]line;907 string line; 869 908 line.length = max+1; 870 char* lineP = fgets( line.ptr, max, stream);909 char* lineP = fgets(Str.toStringz(line), max, stream); 871 910 if ( lineP is null ) 872 911 { … … 878 917 //foreach ( char c ; line ) 879 918 //{ 880 // printf("%c", c);919 // printf("%c", c); 881 920 //} 882 921 //printf("\n\n"); 883 return line[0..l]; 922 return line[0..l]; 884 923 } 885 924 … … 895 934 } 896 935 897 936 898 937 public bool endOfOutput() 899 938 { … … 908 947 } 909 948 910 char[]getOutputString()949 string getOutputString() 911 950 { 912 951 return Str.toString(strOutput); 913 952 } 914 953 915 char[]getErrorString()954 string getErrorString() 916 955 { 917 956 return Str.toString(strError); … … 922 961 return exitStatus; 923 962 } 924 963 925 964 /** 926 * Executes a command synchronasly and 965 * Executes a command synchronasly and 927 966 * optionally calls delegates for sysout, syserr and end of job 928 * 967 * 929 968 */ 930 969 public int commandLineSync( 931 970 ChildWatch externalWatch = null, 932 bool delegate( char[]) readOutput = null,933 bool delegate( char[]) readError = null )934 { 935 char[]commandLine;936 foreach ( int count, char[]arg; argv)971 bool delegate(string) readOutput = null, 972 bool delegate(string) readError = null ) 973 { 974 string commandLine; 975 foreach ( int count, string arg; argv) 937 976 { 938 977 if ( count > 0 ) … … 943 982 } 944 983 int status = g_spawn_command_line_sync( 945 Str.toStringz(commandLine),946 &strOutput,947 &strError,948 &exitStatus,949 &error);984 Str.toStringz(commandLine), 985 &strOutput, 986 &strError, 987 &exitStatus, 988 &error); 950 989 if ( readOutput != null ) 951 990 { 952 foreach ( char[]line ; splitlines(Str.toString(strOutput)) )991 foreach ( string line ; splitlines(Str.toString(strOutput)) ) 953 992 { 954 993 readOutput(line); … … 957 996 if ( readError != null ) 958 997 { 959 foreach ( char[]line ; splitlines(Str.toString(strError)) )998 foreach ( string line ; splitlines(Str.toString(strError)) ) 960 999 { 961 1000 readError(line); … … 968 1007 return status; 969 1008 } 970 971 972 973 974 1009 code: end 975 1010 trunk/wrap/APILookupGObject.txt
r455 r474 183 183 * data = a pointer 184 184 */ 185 public: void setDataFull( char[]key, gpointer data)185 public: void setDataFull(string key, gpointer data) 186 186 { 187 187 //writefln("setData objectG=%X data=%X type %s",gObject,data,key); … … 333 333 // * data = a pointer 334 334 // */ 335 // private void setDestroyNotify( char[]key, gpointer data)335 // private void setDestroyNotify(string key, gpointer data) 336 336 // { 337 337 // //writefln("setData objectG=%X data=%X type %s",gObject,data,key); … … 358 358 359 359 /** */ 360 public void setProperty( char[]propertyName, int value)360 public void setProperty(string propertyName, int value) 361 361 { 362 362 setProperty(propertyName, new Value(value)); … … 364 364 365 365 /** */ 366 public void setProperty( char[] propertyName, char[]value)366 public void setProperty(string propertyName, string value) 367 367 { 368 368 setProperty(propertyName, new Value(value)); … … 370 370 371 371 /** */ 372 public void setProperty( char[]propertyName, long value)372 public void setProperty(string propertyName, long value) 373 373 { 374 374 //We use g_object_set instead of g_object_set_property, because Value doesn't like longs and ulongs for some reason. … … 377 377 378 378 /** */ 379 public void setProperty( char[]propertyName, ulong value)379 public void setProperty(string propertyName, ulong value) 380 380 { 381 381 g_object_set( gObject, Str.toStringz(propertyName), value, null); … … 446 446 447 447 /** */ 448 this( char[]value)448 this(string value) 449 449 { 450 450 this(); … … 543 543 code: start 544 544 /** */ 545 public static uint connectData(void* instanc, char[]detailedSignal, GCallback cHandler, Object data, GClosureNotify destroyData, GConnectFlags connectFlags)545 public static uint connectData(void* instanc, string detailedSignal, GCallback cHandler, Object data, GClosureNotify destroyData, GConnectFlags connectFlags) 546 546 { 547 547 // gulong g_signal_connect_data (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GClosureNotify destroy_data, GConnectFlags connect_flags); trunk/wrap/APILookupGStreamer.txt
r337 r474 154 154 * Call this function before using any other GStreamer functions in your applications. 155 155 */ 156 public static void init( char[][] args) //public static void init(int* argc, char**[] argv)156 public static void init(string[] args) //public static void init(int* argc, char**[] argv) 157 157 { 158 158 char** argv = cast(char**) new char*[args.length]; 159 159 int argc = 0; 160 foreach ( char[]p; args)160 foreach (string p; args) 161 161 { 162 162 argv[argc++] = cast(char*)p; … … 186 186 * a new GstBin 187 187 */ 188 public this( char[]name)188 public this(string name) 189 189 { 190 190 // GstElement* gst_bin_new (const gchar *name); … … 412 412 * This set's the filename for a filesrc element. 413 413 */ 414 public void location( char[]set )414 public void location( string set ) 415 415 { 416 416 //g_object_set( G_OBJECT(getElementStruct()), "location", set, NULL); … … 528 528 * new GstElement or NULL if unable to create element 529 529 */ 530 public static Element make( char[]factoryname )530 public static Element make( string factoryname ) 531 531 { 532 532 // GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name); … … 704 704 * a new GstPad, or NULL in case of an error. 705 705 */ 706 public this( char[]name, Pad target)706 public this(string name, Pad target) 707 707 { 708 708 // GstPad* gst_ghost_pad_new (const gchar *name, GstPad *target); … … 1034 1034 * The new warning message. 1035 1035 */ 1036 public static Message newWarning(ObjectGst src, ErrorG error, char[]dbug)1036 public static Message newWarning(ObjectGst src, ErrorG error, string dbug) 1037 1037 { 1038 1038 // GstMessage* gst_message_new_warning (GstObject *src, GError *error, gchar *debug); … … 1085 1085 * The new error message. 1086 1086 */ 1087 public static Message newError(ObjectGst src, ErrorG error, char[]dbug)1087 public static Message newError(ObjectGst src, ErrorG error, string dbug) 1088 1088 { 1089 1089 // GstMessage* gst_message_new_error (GstObject *src, GError *error, gchar *debug); … … 1103 1103 * The new info message. 1104 1104 */ 1105 public static Message newInfo(ObjectGst src, ErrorG error, char[]dbug)1105 public static Message newInfo(ObjectGst src, ErrorG error, string dbug) 1106 1106 { 1107 1107 // GstMessage* gst_message_new_info (GstObject *src, GError *error, gchar *debug); … … 1232 1232 code: start 1233 1233 /** */ 1234 public this ( char[]name)1234 public this (string name) 1235 1235 { 1236 1236 this.gstPipeline = cast(GstPipeline*) gst_pipeline_new(Str.toStringz(name)); … … 1283 1283 * name = the name to set 1284 1284 */ 1285 public void setFeatureName( char[]name)1285 public void setFeatureName(string name) 1286 1286 { 1287 1287 // void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name); trunk/wrap/APILookupGdk.txt
r433 r474 713 713 * Create and loads a font 714 714 */ 715 public this( char[]fontName)715 public this(string fontName) 716 716 { 717 717 this(gdk_font_load(Str.toStringz(fontName))); trunk/wrap/APILookupGdkPixbuf.txt
r444 r474 198 198 * A newly-created pixbuf loader. 199 199 */ 200 public this ( char[]type, GError** error, bool isMimeType=false)200 public this (string type, GError** error, bool isMimeType=false) 201 201 { 202 202 if ( isMimeType ) trunk/wrap/APILookupGlade.txt
r434 r474 114 114 * the widget matching name, or NULL if none exists. 115 115 */ 116 public Widget getWidget( char[]name)116 public Widget getWidget(string name) 117 117 { 118 118 // GtkWidget* glade_xml_get_widget (GladeXML *self, const char *name); … … 137 137 * domain = the translation domain for the XML file (or NULL for default) 138 138 */ 139 public this ( char[] fname, char[] root = null, char[]domain=null)139 public this (string fname, string root = null, string domain=null) 140 140 { 141 141 // GladeXML* glade_xml_new (const char *fname, const char *root, const char *domain); … … 156 156 * name, or NULL if none exists. 157 157 */ 158 public Widget[] getWidgetPrefix( char[]name)158 public Widget[] getWidgetPrefix(string name) 159 159 { 160 160 // GList* glade_xml_get_widget_prefix (GladeXML *self, const char *name); … … 291 291 uint utype = cast(uint)(*pt2); 292 292 293 char[]tname = Type.name(cast(GType)utype);293 string tname = Type.name(cast(GType)utype); 294 294 295 295 switch(tname) { trunk/wrap/APILookupGtk.txt
r472 r474 142 142 * Call this function before using any other GTK+ functions in your GUI applications. 143 143 */ 144 public static void init( char[][] args)144 public static void init(string[] args) 145 145 { 146 146 char** argv = (new char*[args.length]).ptr; 147 147 int argc = 0; 148 foreach ( char[]p; args)148 foreach (string p; args) 149 149 { 150 150 argv[argc++] = cast(char*)p; … … 163 163 * This is to be used on any call to GDK not executed from the main thread. 164 164 */ 165 public static void initMultiThread( char[][] args)165 public static void initMultiThread(string[] args) 166 166 { 167 167 Thread.init(null); … … 756 756 757 757 /** */ 758 public void addButtons( char[][] buttonsText, ResponseType[] responses)758 public void addButtons(string[] buttonsText, ResponseType[] responses) 759 759 { 760 760 for ( int i=0 ; i<buttonsText.length && i<responses.length ; i++) … … 817 817 * a new GtkMessageDialog 818 818 */ 819 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, char[] messageFormat, char[]message=null )819 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, string messageFormat, string message=null ) 820 820 { 821 821 this(parent, flags, type, buttons, false, messageFormat, message ); … … 858 858 * message = the message - should be null, any formatting should be done prior to call this constructor 859 859 */ 860 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bool markup, char[] messageFormat, char[]message=null )860 public this (Window parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, bool markup, string messageFormat, string message=null ) 861 861 { 862 862 if ( markup ) … … 908 908 * title = The title of the dialog 909 909 */ 910 public static void information( char[] message, char[]title)910 public static void information(string message, string title) 911 911 { 912 912 information(null, message, title); … … 920 920 * title = The title of the dialog 921 921 */ 922 public static void information(Window parent, char[] message, char[]title)922 public static void information(Window parent, string message, string title) 923 923 { 924 924 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0, … … 939 939 * title = The title of the dialog 940 940 */ 941 public static void error( char[] message, char[]title)941 public static void error(string message, string title) 942 942 { 943 943 error(null, message, title); … … 951 951 * title = The title of the dialog 952 952 */ 953 public static void error(Window parent, char[] message, char[]title)953 public static void error(Window parent, string message, string title) 954 954 { 955 955 MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0, … … 971 971 * title = The title of the dialog 972 972 */ 973 public static bool yesNo( char[] message, char[]title)973 public static bool yesNo(string message, string title) 974 974 { 975 975 return yesNo(null, message, title); … … 983 983 * title = The title of the dialog 984 984 */ 985 public static bool yesNo(Window parent, char[] message, char[]title)985 public static bool yesNo(Window parent, string message, string title) 986 986 { 987 987 MessageDialog d = new MessageDialog( … … 1005 1005 * title = The title of the dialog 1006 1006 */ 1007 public static ResponseType yesNoCancel( char[] message, char[]title)1007 public static ResponseType yesNoCancel(string message, string title) 1008 1008 { 1009 1009 return yesNoCancel(null, message, title); … … 1017 1017 * title = The title of the dialog 1018 1018 */ 1019 public static ResponseType yesNoCancel(Window parent, char[] message, char[]title)1019 public static ResponseType yesNoCancel(Window parent, string message, string title) 1020 1020 { 1021 1021 MessageDialog d = new MessageDialog( … … 1067 1067 * title = The Window title 1068 1068 */ 1069 public this( char[]title)1069 public this(string title) 1070 1070 { 1071 1071 this(GtkWindowType.TOPLEVEL); … … 1109 1109 * Creates a new MainWindow with a title 1110 1110 */ 1111 public this( char[]title)1111 public this(string title) 1112 1112 { 1113 1113 super(title); … … 1254 1254 { 1255 1255 // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id, GtkIconSize size); 1256 this(cast(GtkImage*)gtk_image_new_from_stock(St ockDesc[stockID].ptr, size) );1256 this(cast(GtkImage*)gtk_image_new_from_stock(Str.toStringz(StockDesc[stockID]), size) ); 1257 1257 } 1258 1258 … … 1268 1268 * a new GtkImage displaying the themed icon 1269 1269 */ 1270 public this ( char[]iconName, GtkIconSize size)1270 public this (string iconName, GtkIconSize size) 1271 1271 { 1272 1272 // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, GtkIconSize size); … … 1308 1308 * mnemonic = when false uses the literal text passed in without mnemonic 1309 1309 */ 1310 public this ( char[]str, bool mnemonic=true)1310 public this (string str, bool mnemonic=true) 1311 1311 { 1312 1312 if ( mnemonic ) … … 1377 1377 { 1378 1378 // GtkStatusIcon* gtk_status_icon_new_from_stock (const gchar *stock_id); 1379 this(cast(GtkStatusIcon*)gtk_status_icon_new_from_stock(St ockDesc[stockID].ptr) );1379 this(cast(GtkStatusIcon*)gtk_status_icon_new_from_stock(Str.toStringz(StockDesc[stockID])) ); 1380 1380 } 1381 1381 … … 1390 1390 * with gtk_status_icon_new_from_file. 1391 1391 */ 1392 public this ( char[]iconName, bool loadFromFile = false)1392 public this (string iconName, bool loadFromFile = false) 1393 1393 { 1394 1394 //TODO: look at a better way to do this. … … 1427 1427 code: start 1428 1428 1429 1430 1429 private static IconSize currentIconSize = IconSize.BUTTON; 1431 1430 1432 1431 /** An arbitrary string to be used by the application */ 1433 private char[]action;1432 private string action; 1434 1433 1435 1434 /** */ … … 1446 1445 1447 1446 /** */ 1448 public void setActionName( char[]action)1449 { 1450 this.action = action .dup;1447 public void setActionName(string action) 1448 { 1449 this.action = action; 1451 1450 } 1452 1451 1453 1452 /** */ 1454 public char[]getActionName()1453 public string getActionName() 1455 1454 { 1456 1455 return action; … … 1471 1470 * a new GtkButton 1472 1471 */ 1473 public this ( char[]label, bool mnemonic=true)1472 public this (string label, bool mnemonic=true) 1474 1473 { 1475 1474 if ( mnemonic ) … … 1505 1504 else 1506 1505 { 1507 this(cast(GtkButton*)gtk_button_new_from_stock(St ockDesc[stockID].ptr) );1506 this(cast(GtkButton*)gtk_button_new_from_stock(Str.toStringz(StockDesc[stockID])) ); 1508 1507 } 1509 1508 … … 1518 1517 1519 1518 /** */ 1520 public this( char[]label, void delegate(Button) dlg, bool mnemonic=true)1519 public this(string label, void delegate(Button) dlg, bool mnemonic=true) 1521 1520 { 1522 1521 this(label, mnemonic); … … 1525 1524 1526 1525 /** */ 1527 public this( char[] label, void delegate(Button) dlg, char[]action)1526 public this(string label, void delegate(Button) dlg, string action) 1528 1527 { 1529 1528 this(label); … … 1558 1557 * mnemonic = true if the button has an mnemnonic 1559 1558 */ 1560 public this ( char[]label, bool mnemonic=true)1559 public this (string label, bool mnemonic=true) 1561 1560 { 1562 1561 if ( mnemonic ) … … 1573 1572 1574 1573 /** */ 1575 public this( char[]label, void delegate(CheckButton) onClicked, bool mnemonic=true)1574 public this(string label, void delegate(CheckButton) onClicked, bool mnemonic=true) 1576 1575 { 1577 1576 this(label, mnemonic); … … 1608 1607 * mnemonic for the button. 1609 1608 */ 1610 public this (ListSG group, char[]label, bool mnemonic=true)1609 public this (ListSG group, string label, bool mnemonic=true) 1611 1610 { 1612 1611 if ( mnemonic ) … … 1638
