Changeset 474

Show
Ignore:
Timestamp:
03/22/08 10:57:03 (6 months ago)
Author:
Mike Wey
Message:

change char[] to string

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wrap/APILookupGLib.txt

    r470 r474  
    5959public alias uint XID; 
    6060 
     61version(Tango) public alias char[] string; 
     62 
    6163addTypedefs: end 
    6264 
     
    290292 
    291293code: 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     
    341345    /** */ 
    342     public static char** toStringzArray(char[][] args) 
     346    public static char** toStringzArray(string[] args) 
    343347    { 
    344348        if ( args is null ) 
     
    348352        char** argv = (new char*[args.length]).ptr; 
    349353        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'); 
    353357        } 
    354358        argv[argc] = null; 
     
    356360        return argv; 
    357361    } 
    358  
     362     
    359363    /** */ 
    360     public static char[][] toStringArray(char** args) 
     364    public static string[] toStringArray(char** args) 
    361365    { 
    362366        if ( args is null ) 
     
    364368            return null; 
    365369        } 
    366         char[][] argv; 
     370        string[] argv; 
    367371         
    368372        char* arg = args[0]; 
     
    377381        return argv; 
    378382    } 
    379  
     383     
    380384    /** */ 
    381     public static char[] toString(bool b) 
     385    public static string toString(bool b) 
    382386    { 
    383387        return b ? "true" : "false"; 
     
    392396        return result[0 .. 1]; 
    393397    } 
    394  
     398     
    395399    /** */ 
    396     public static char[] toString(ubyte ub)  { return toString(cast(uint) ub); } /// ditto 
     400    public static string toString(ubyte ub)  { return toString(cast(uint) ub); } /// ditto 
    397401    /** */ 
    398     public static char[] toString(ushort us) { return toString(cast(uint) us); } /// ditto 
     402    public static string toString(ushort us) { return toString(cast(uint) us); } /// ditto 
    399403     
    400404    /** */ 
    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; 
    403408        int ndigits; 
    404409        char c; 
    405         char[] result; 
    406      
     410        string result; 
     411        
    407412        ndigits = 0; 
    408413        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        } 
    411421        else 
    412422        { 
     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; 
    413457        while (u) 
    414458        { 
     
    418462            buffer[buffer.length - ndigits] = c; 
    419463        } 
    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]; 
    422474        } 
    423475        return result; 
    424476    } 
    425  
     477     
    426478    /** */ 
    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; 
    430487        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         
    459490        if (i >= 0) 
    460         return toString(cast(uint)i); 
    461      
     491           return toString(cast(uint)i); 
     492        
    462493        uint u = -i; 
    463494        int ndigits = 1; 
    464495        while (u) 
    465496        { 
    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++; 
    470501        } 
    471502        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        } 
    474514        return result; 
    475515    } 
    476  
    477516code: end 
    478517 
     
    672711 
    673712code: start 
    674  
     713     
    675714    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; 
    681720    GSpawnFlags flags = SpawnFlags.SEARCH_PATH; 
    682     GSpawnChildSetupFunc childSetup;  
     721    GSpawnChildSetupFunc childSetup; 
    683722    void* userData; 
    684723    GPid childPid; 
     
    690729    int stdOut; 
    691730    int stdErr; 
    692  
     731     
    693732    // for commandLineSync 
    694733    int exitStatus; 
     
    702741     * Creates a Spawn for execution. 
    703742     */ 
    704     public this(char[] program, char[][] envp=null) 
     743    public this(string program, string[] envp=null) 
    705744    { 
    706745        argv ~= program; 
     
    711750     * Creates a Spawn for execution. 
    712751     */ 
    713     public this(char[][] program, char[][] envp=null) 
     752    public this(string[] program, string[] envp=null) 
    714753    { 
    715754        argv = program; 
     
    757796     * Adds a parameter to the execution program 
    758797     */ 
    759     public void addParm(char[] parm) 
     798    public void addParm(string parm) 
    760799    { 
    761800        argv ~= parm; 
    762801    } 
    763  
     802     
    764803    /** 
    765804     * Gets the last error message 
    766805     */ 
    767     public char[] getLastError() 
     806    public string getLastError() 
    768807    { 
    769808        if ( error != null ) 
     
    773812        return ""; 
    774813    } 
    775  
     814     
    776815    version(Tango) 
    777816    { 
     
    779818            extern (C) FILE*  fdopen(int, char*); //Generates linker error on linux. 
    780819        else 
    781             private import tango.stdc.posix.stdio;  
    782     } 
    783  
     820            private import tango.stdc.posix.stdio; 
     821    } 
     822     
    784823    /** 
    785824     * Executes the prepared process 
     
    787826    public int execAsyncWithPipes( 
    788827        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 ) 
    791830    { 
    792831        int result = g_spawn_async_with_pipes( 
     
    827866    class ReadFile : Thread 
    828867    { 
    829         bool delegate(char[]) read; 
     868        bool delegate(string) read; 
    830869        FILE* file; 
    831870         
    832871        int lineCount; 
    833872         
    834         this(FILE* file, bool delegate (char[]) read ) 
     873        this(FILE* file, bool delegate (string) read ) 
    835874        { 
    836875            this.file = file; 
     
    840879        public int run() 
    841880        { 
    842             char[] line = readLine(file); 
     881            string line = readLine(file); 
    843882            while( line !is null ) 
    844883            { 
     
    852891                line = readLine(file); 
    853892            } 
    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) 
    859898    { 
    860899        if ( feof(stream) ) 
     
    866905            return null; 
    867906        } 
    868         char[] line; 
     907        string line; 
    869908        line.length = max+1; 
    870         char* lineP = fgets(line.ptr, max, stream); 
     909        char* lineP = fgets(Str.toStringz(line), max, stream); 
    871910        if ( lineP is null ) 
    872911        { 
     
    878917        //foreach ( char c ; line ) 
    879918        //{ 
    880         //        printf("%c", c); 
     919        //       printf("%c", c); 
    881920        //} 
    882921        //printf("\n\n"); 
    883         return line[0..l];      
     922        return line[0..l]; 
    884923    } 
    885924     
     
    895934    } 
    896935     
    897  
     936     
    898937    public bool endOfOutput() 
    899938    { 
     
    908947    } 
    909948     
    910     char[] getOutputString() 
     949    string getOutputString() 
    911950    { 
    912951        return Str.toString(strOutput); 
    913952    } 
    914953     
    915     char[] getErrorString() 
     954    string getErrorString() 
    916955    { 
    917956        return Str.toString(strError); 
     
    922961        return exitStatus; 
    923962    } 
    924  
     963     
    925964    /** 
    926      * Executes a command synchronasly and  
     965     * Executes a command synchronasly and 
    927966     * optionally calls delegates for sysout, syserr and end of job 
    928      *  
     967     * 
    929968     */ 
    930969    public int commandLineSync( 
    931970        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) 
    937976        { 
    938977            if ( count > 0 ) 
     
    943982        } 
    944983        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); 
    950989        if ( readOutput != null ) 
    951990        { 
    952             foreach ( char[] line ; splitlines(Str.toString(strOutput)) ) 
     991            foreach ( string line ; splitlines(Str.toString(strOutput)) ) 
    953992            { 
    954993                readOutput(line); 
     
    957996        if ( readError != null ) 
    958997        { 
    959             foreach ( char[] line ; splitlines(Str.toString(strError)) ) 
     998            foreach ( string line ; splitlines(Str.toString(strError)) ) 
    960999            { 
    9611000                readError(line); 
     
    9681007        return status; 
    9691008    } 
    970      
    971  
    972      
    973  
    9741009code: end 
    9751010 
  • trunk/wrap/APILookupGObject.txt

    r455 r474  
    183183     *  data = a pointer 
    184184     */ 
    185     public: void setDataFull(char[] key, gpointer data) 
     185    public: void setDataFull(string key, gpointer data) 
    186186    { 
    187187        //writefln("setData objectG=%X data=%X type %s",gObject,data,key); 
     
    333333//   *  data = a pointer 
    334334//   */ 
    335 //  private void setDestroyNotify(char[] key, gpointer data) 
     335//  private void setDestroyNotify(string key, gpointer data) 
    336336//  { 
    337337//      //writefln("setData objectG=%X data=%X type %s",gObject,data,key); 
     
    358358 
    359359    /** */ 
    360     public void setProperty(char[] propertyName, int value) 
     360    public void setProperty(string propertyName, int value) 
    361361    { 
    362362        setProperty(propertyName, new Value(value)); 
     
    364364     
    365365    /** */ 
    366     public void setProperty(char[] propertyName, char[] value) 
     366    public void setProperty(string propertyName, string value) 
    367367    { 
    368368        setProperty(propertyName, new Value(value)); 
     
    370370     
    371371    /** */ 
    372     public void setProperty(char[] propertyName, long value) 
     372    public void setProperty(string propertyName, long value) 
    373373    { 
    374374        //We use g_object_set instead of g_object_set_property, because Value doesn't like longs and ulongs for some reason. 
     
    377377 
    378378    /** */ 
    379     public void setProperty(char[] propertyName, ulong value) 
     379    public void setProperty(string propertyName, ulong value) 
    380380    { 
    381381        g_object_set( gObject, Str.toStringz(propertyName), value, null); 
     
    446446 
    447447    /** */ 
    448     this(char[] value) 
     448    this(string value) 
    449449    { 
    450450        this(); 
     
    543543code: start 
    544544    /** */ 
    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) 
    546546    { 
    547547        // 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  
    154154     * Call this function before using any other GStreamer functions in your applications. 
    155155     */ 
    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) 
    157157    { 
    158158        char** argv = cast(char**) new char*[args.length]; 
    159159        int argc = 0; 
    160         foreach (char[] p; args) 
     160        foreach (string p; args) 
    161161        { 
    162162            argv[argc++] = cast(char*)p; 
     
    186186     *  a new GstBin 
    187187     */ 
    188     public this(char[] name) 
     188    public this(string name) 
    189189    { 
    190190        // GstElement* gst_bin_new (const gchar *name); 
     
    412412     *  This set's the filename for a filesrc element. 
    413413     */ 
    414     public void location( char[] set ) 
     414    public void location( string set ) 
    415415    { 
    416416        //g_object_set( G_OBJECT(getElementStruct()), "location", set, NULL); 
     
    528528     *  new GstElement or NULL if unable to create element 
    529529     */ 
    530     public static Element make( char[] factoryname ) 
     530    public static Element make( string factoryname ) 
    531531    { 
    532532        // GstElement* gst_element_factory_make (const gchar *factoryname,  const gchar *name); 
     
    704704     *  a new GstPad, or NULL in case of an error. 
    705705     */ 
    706     public this(char[] name, Pad target) 
     706    public this(string name, Pad target) 
    707707    { 
    708708        // GstPad* gst_ghost_pad_new (const gchar *name,  GstPad *target); 
     
    10341034     *  The new warning message. 
    10351035     */ 
    1036     public static Message newWarning(ObjectGst src, ErrorG error, char[] dbug) 
     1036    public static Message newWarning(ObjectGst src, ErrorG error, string dbug) 
    10371037    { 
    10381038        // GstMessage* gst_message_new_warning (GstObject *src,  GError *error,  gchar *debug); 
     
    10851085     *  The new error message. 
    10861086     */ 
    1087     public static Message newError(ObjectGst src, ErrorG error, char[] dbug) 
     1087    public static Message newError(ObjectGst src, ErrorG error, string dbug) 
    10881088    { 
    10891089        // GstMessage* gst_message_new_error (GstObject *src,  GError *error,  gchar *debug); 
     
    11031103     *  The new info message. 
    11041104     */ 
    1105     public static Message newInfo(ObjectGst src, ErrorG error, char[] dbug) 
     1105    public static Message newInfo(ObjectGst src, ErrorG error, string dbug) 
    11061106    { 
    11071107        // GstMessage* gst_message_new_info (GstObject *src,  GError *error,  gchar *debug); 
     
    12321232code: start 
    12331233/** */ 
    1234 public this (char[] name) 
     1234public this (string name) 
    12351235{ 
    12361236    this.gstPipeline = cast(GstPipeline*) gst_pipeline_new(Str.toStringz(name)); 
     
    12831283     *  name = the name to set 
    12841284     */ 
    1285     public void setFeatureName(char[] name) 
     1285    public void setFeatureName(string name) 
    12861286    { 
    12871287        // void gst_plugin_feature_set_name (GstPluginFeature *feature,  const gchar *name); 
  • trunk/wrap/APILookupGdk.txt

    r433 r474  
    713713     * Create and loads a font 
    714714     */ 
    715     public this(char[] fontName) 
     715    public this(string fontName) 
    716716    { 
    717717        this(gdk_font_load(Str.toStringz(fontName))); 
  • trunk/wrap/APILookupGdkPixbuf.txt

    r444 r474  
    198198     *  A newly-created pixbuf loader. 
    199199     */ 
    200     public this (char[] type, GError** error, bool isMimeType=false) 
     200    public this (string type, GError** error, bool isMimeType=false) 
    201201    { 
    202202        if ( isMimeType ) 
  • trunk/wrap/APILookupGlade.txt

    r434 r474  
    114114     *  the widget matching name, or NULL if none exists. 
    115115     */ 
    116     public Widget getWidget(char[] name) 
     116    public Widget getWidget(string name) 
    117117    { 
    118118        // GtkWidget* glade_xml_get_widget (GladeXML *self,  const char *name); 
     
    137137     *  domain = the translation domain for the XML file (or NULL for default) 
    138138     */ 
    139     public this (char[] fname, char[] root = null, char[] domain=null) 
     139    public this (string fname, string root = null, string domain=null) 
    140140    { 
    141141        // GladeXML* glade_xml_new (const char *fname,  const char *root,  const char *domain); 
     
    156156     *  name, or NULL if none exists. 
    157157     */ 
    158     public Widget[] getWidgetPrefix(char[] name) 
     158    public Widget[] getWidgetPrefix(string name) 
    159159    { 
    160160        // GList* glade_xml_get_widget_prefix (GladeXML *self,  const char *name); 
     
    291291        uint utype =  cast(uint)(*pt2); 
    292292          
    293         char[] tname = Type.name(cast(GType)utype); 
     293        string tname = Type.name(cast(GType)utype); 
    294294         
    295295        switch(tname) { 
  • trunk/wrap/APILookupGtk.txt

    r472 r474  
    142142     * Call this function before using any other GTK+ functions in your GUI applications. 
    143143     */ 
    144     public static void init(char[][] args) 
     144    public static void init(string[] args) 
    145145    { 
    146146        char** argv = (new char*[args.length]).ptr; 
    147147        int argc = 0; 
    148         foreach (char[] p; args) 
     148        foreach (string p; args) 
    149149        { 
    150150            argv[argc++] = cast(char*)p; 
     
    163163     * This is to be used on any call to GDK not executed from the main thread. 
    164164     */ 
    165     public static void initMultiThread(char[][] args) 
     165    public static void initMultiThread(string[] args) 
    166166    { 
    167167        Thread.init(null); 
     
    756756     
    757757    /** */ 
    758     public void addButtons(char[][] buttonsText, ResponseType[] responses) 
     758    public void addButtons(string[] buttonsText, ResponseType[] responses) 
    759759    { 
    760760        for ( int i=0 ; i<buttonsText.length && i<responses.length ; i++) 
     
    817817     *  a new GtkMessageDialog 
    818818     */ 
    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 ) 
    820820    { 
    821821        this(parent, flags, type, buttons, false, messageFormat, message ); 
     
    858858     *  message = the message - should be null, any formatting should be done prior to call this constructor 
    859859     */ 
    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 ) 
    861861    { 
    862862        if ( markup ) 
     
    908908     *  title = The title of the dialog 
    909909     */ 
    910     public static void information(char[] message, char[] title) 
     910    public static void information(string message, string title) 
    911911    { 
    912912        information(null, message, title); 
     
    920920     *  title = The title of the dialog 
    921921     */ 
    922     public static void information(Window parent, char[] message, char[] title) 
     922    public static void information(Window parent, string message, string title) 
    923923    { 
    924924        MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0, 
     
    939939     *  title = The title of the dialog 
    940940     */ 
    941     public static void error(char[] message, char[] title) 
     941    public static void error(string message, string title) 
    942942    { 
    943943        error(null, message, title); 
     
    951951     *  title = The title of the dialog 
    952952     */ 
    953     public static void error(Window parent, char[] message, char[] title) 
     953    public static void error(Window parent, string message, string title) 
    954954    { 
    955955        MessageDialog d = new MessageDialog(parent, cast(GtkDialogFlags)0, 
     
    971971     *  title = The title of the dialog 
    972972     */ 
    973     public static bool yesNo(char[] message, char[] title) 
     973    public static bool yesNo(string message, string title) 
    974974    { 
    975975        return yesNo(null, message, title); 
     
    983983     *  title = The title of the dialog 
    984984     */ 
    985     public static bool yesNo(Window parent, char[] message, char[] title) 
     985    public static bool yesNo(Window parent, string message, string title) 
    986986    { 
    987987        MessageDialog d = new MessageDialog( 
     
    10051005     *  title = The title of the dialog 
    10061006     */ 
    1007     public static ResponseType yesNoCancel(char[] message, char[] title) 
     1007    public static ResponseType yesNoCancel(string message, string title) 
    10081008    { 
    10091009        return yesNoCancel(null, message, title); 
     
    10171017     *  title = The title of the dialog 
    10181018     */ 
    1019     public static ResponseType yesNoCancel(Window parent, char[] message, char[] title) 
     1019    public static ResponseType yesNoCancel(Window parent, string message, string title) 
    10201020    { 
    10211021        MessageDialog d = new MessageDialog( 
     
    10671067     *      title = The Window title 
    10681068     */ 
    1069     public this(char[] title) 
     1069    public this(string title) 
    10701070    { 
    10711071        this(GtkWindowType.TOPLEVEL); 
     
    11091109     * Creates a new MainWindow with a title 
    11101110     */ 
    1111     public this(char[] title) 
     1111    public this(string title) 
    11121112    { 
    11131113        super(title); 
     
    12541254    { 
    12551255        // GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,  GtkIconSize size); 
    1256         this(cast(GtkImage*)gtk_image_new_from_stock(StockDesc[stockID].ptr, size) ); 
     1256        this(cast(GtkImage*)gtk_image_new_from_stock(Str.toStringz(StockDesc[stockID]), size) ); 
    12571257    } 
    12581258     
     
    12681268     *  a new GtkImage displaying the themed icon 
    12691269     */ 
    1270     public this (char[] iconName, GtkIconSize size) 
     1270    public this (string iconName, GtkIconSize size) 
    12711271    { 
    12721272        // GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name,  GtkIconSize size); 
     
    13081308     *  mnemonic = when false uses the literal text passed in without mnemonic 
    13091309     */ 
    1310     public this (char[] str, bool mnemonic=true) 
     1310    public this (string str, bool mnemonic=true) 
    13111311    { 
    13121312        if ( mnemonic ) 
     
    13771377    { 
    13781378        // GtkStatusIcon* gtk_status_icon_new_from_stock (const gchar *stock_id); 
    1379         this(cast(GtkStatusIcon*)gtk_status_icon_new_from_stock(StockDesc[stockID].ptr) ); 
     1379        this(cast(GtkStatusIcon*)gtk_status_icon_new_from_stock(Str.toStringz(StockDesc[stockID])) ); 
    13801380    } 
    13811381 
     
    13901390     *  with gtk_status_icon_new_from_file. 
    13911391     */ 
    1392     public this (char[] iconName, bool loadFromFile = false) 
     1392    public this (string iconName, bool loadFromFile = false) 
    13931393    { 
    13941394        //TODO: look at a better way to do this. 
     
    14271427code: start 
    14281428 
    1429  
    14301429    private static IconSize currentIconSize = IconSize.BUTTON; 
    14311430 
    14321431    /** An arbitrary string to be used by the application */ 
    1433     private char[] action; 
     1432    private string action; 
    14341433 
    14351434    /** */ 
     
    14461445 
    14471446    /** */ 
    1448     public void setActionName(char[] action) 
    1449     { 
    1450         this.action = action.dup
     1447    public void setActionName(string action) 
     1448    { 
     1449        this.action = action
    14511450    } 
    14521451 
    14531452    /** */ 
    1454     public char[] getActionName() 
     1453    public string getActionName() 
    14551454    { 
    14561455        return action; 
     
    14711470     *  a new GtkButton 
    14721471     */ 
    1473     public this (char[] label, bool mnemonic=true) 
     1472    public this (string label, bool mnemonic=true) 
    14741473    { 
    14751474        if ( mnemonic ) 
     
    15051504        else 
    15061505        { 
    1507             this(cast(GtkButton*)gtk_button_new_from_stock(StockDesc[stockID].ptr) ); 
     1506            this(cast(GtkButton*)gtk_button_new_from_stock(Str.toStringz(StockDesc[stockID])) ); 
    15081507        } 
    15091508         
     
    15181517     
    15191518    /** */ 
    1520     public this(char[] label, void delegate(Button) dlg, bool mnemonic=true) 
     1519    public this(string label, void delegate(Button) dlg, bool mnemonic=true) 
    15211520    { 
    15221521        this(label, mnemonic); 
     
    15251524 
    15261525    /** */ 
    1527     public this(char[] label, void delegate(Button) dlg, char[] action) 
     1526    public this(string label, void delegate(Button) dlg, string action) 
    15281527    { 
    15291528        this(label); 
     
    15581557     *  mnemonic = true if the button has an mnemnonic 
    15591558     */ 
    1560     public this (char[] label, bool mnemonic=true) 
     1559    public this (string label, bool mnemonic=true) 
    15611560    { 
    15621561        if ( mnemonic ) 
     
    15731572 
    15741573    /** */ 
    1575     public this(char[] label, void delegate(CheckButton) onClicked, bool mnemonic=true) 
     1574    public this(string label, void delegate(CheckButton) onClicked, bool mnemonic=true) 
    15761575    { 
    15771576        this(label, mnemonic); 
     
    16081607     *  mnemonic for the button. 
    16091608     */ 
    1610     public this (ListSG group, char[] label, bool mnemonic=true) 
     1609    public this (ListSG group, string label, bool mnemonic=true) 
    16111610    { 
    16121611        if ( mnemonic ) 
     
    1638