Changeset 255:5a30aa9820f3

Show
Ignore:
Timestamp:
06/15/08 16:32:20 (3 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

removed tango.stdc.stringz imports and allow null for arrays and string arguments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/accessibility/AccessibleFactory.d

    r238 r255  
    2626import dwt.DWT; 
    2727 
    28 import tango.stdc.stringz; 
    2928import tango.io.Stdout; 
    3029 
  • dwt/accessibility/AccessibleObject.d

    r240 r255  
    2727import dwt.dwthelper.utils; 
    2828import tango.io.Stdout; 
    29 import tango.stdc.stringz; 
    3029import tango.text.Util; 
    3130import Math = tango.math.Math; 
  • dwt/custom/CCombo.d

    r240 r255  
    193193 * @param string the new item 
    194194 * 
    195  * @exception IllegalArgumentException <ul> 
    196  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    197  * </ul> 
    198195 * @exception DWTException <ul> 
    199196 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    205202public void add (String string) { 
    206203    checkWidget(); 
    207     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     204    // DWT extension: allow null for zero length string 
     205    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    208206    list.add (string); 
    209207} 
     
    221219 * 
    222220 * @exception IllegalArgumentException <ul> 
    223  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    224221 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li> 
    225222 * </ul> 
     
    233230public void add (String string, int index) { 
    234231    checkWidget(); 
    235     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     232    // DWT extension: allow null for zero length string 
     233    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    236234    list.add (string, index); 
    237235} 
     
    870868 * @return the index of the item 
    871869 * 
    872  * @exception IllegalArgumentException <ul> 
    873  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    874  * </ul> 
    875870 * @exception DWTException <ul> 
    876871 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    880875public int indexOf (String string) { 
    881876    checkWidget (); 
    882     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     877    // DWT extension: allow null for zero length string 
     878    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    883879    return list.indexOf (string); 
    884880} 
     
    894890 * @return the index of the item 
    895891 * 
    896  * @exception IllegalArgumentException <ul> 
    897  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    898  * </ul> 
    899892 * @exception DWTException <ul> 
    900893 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    904897public int indexOf (String string, int start) { 
    905898    checkWidget (); 
    906     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     899    // DWT extension: allow null for zero length string 
     900    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    907901    return list.indexOf (string, start); 
    908902} 
     
    12381232 * 
    12391233 * @exception IllegalArgumentException <ul> 
    1240  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    12411234 *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li> 
    12421235 * </ul> 
     
    12481241public void remove (String string) { 
    12491242    checkWidget(); 
    1250     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1243    // DWT extension: allow null for zero length string 
     1244    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    12511245    list.remove (string); 
    12521246} 
     
    14221416 * @exception IllegalArgumentException <ul> 
    14231417 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> 
    1424  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    14251418 * </ul> 
    14261419 * @exception DWTException <ul> 
     
    14391432 * 
    14401433 * @exception IllegalArgumentException <ul> 
    1441  *    <li>ERROR_NULL_ARGUMENT - if the items array is null</li> 
    14421434 *    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li> 
    14431435 * </ul> 
     
    15311523 * @param string the new text 
    15321524 * 
    1533  * @exception IllegalArgumentException <ul> 
    1534  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    1535  * </ul> 
    15361525 * @exception DWTException <ul> 
    15371526 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    15411530public void setText (String string) { 
    15421531    checkWidget(); 
    1543     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1532    // DWT extension: allow null for zero length string 
     1533    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    15441534    int index = list.indexOf (string); 
    15451535    if (index is -1) { 
  • dwt/custom/CTabItem.d

    r240 r255  
    773773 * Otherwise return <code>false</code>. The initial value is defined by the style (DWT.CLOSE) 
    774774 * that was used to create the receiver. 
    775  *  
     775 * 
    776776 * @return <code>true</code> if the close button should be shown 
    777777 * 
     
    780780 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    781781 * </ul> 
    782  *  
     782 * 
    783783 * @since 3.4 
    784784 */ 
     
    10221022 * If the parent (CTabFolder) was created with DWT.CLOSE style, changing this value has 
    10231023 * no effect. 
    1024  *  
     1024 * 
    10251025 * @param close the new state of the close button 
    10261026 * 
     
    10291029 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    10301030 * </ul> 
    1031  *  
     1031 * 
    10321032 * @since 3.4 
    10331033 */ 
     
    10411041public override void setText (String string) { 
    10421042    checkWidget(); 
    1043     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    1044     if (string==getText()) return; 
     1043    // DWT extension: allow null for zero length string 
     1044    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1045    if (string.equals (getText())) return; 
    10451046    super.setText(string); 
    10461047    shortenedText = null; 
  • dwt/custom/PopupList.d

    r238 r255  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2007 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    264264* 
    265265* @exception IllegalArgumentException <ul> 
    266 *    <li>ERROR_NULL_ARGUMENT - if the items array is null</li> 
    267266*    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li> 
    268267* </ul> 
  • dwt/custom/StyledText.d

    r240 r255  
    15991599 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    16001600 * </ul> 
    1601  * @exception IllegalArgumentException <ul> 
    1602  *    <li>ERROR_NULL_ARGUMENT when listener is null</li> 
    1603  * </ul> 
    16041601 */ 
    16051602public void append(String string) { 
    16061603    checkWidget(); 
    1607     if (string is null) { 
    1608         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    1609     } 
     1604    // DWT extension: allow null for zero length string 
     1605//     if (string is null) { 
     1606//         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     1607//     } 
    16101608    int lastChar = Math.max(getCharCount(), 0); 
    16111609    replaceTextRange(lastChar, 0, string); 
     
    49354933 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    49364934 * </ul> 
    4937  * @exception IllegalArgumentException <ul> 
    4938  *    <li>ERROR_NULL_ARGUMENT when string is null</li> 
    4939  * </ul> 
    49404935 */ 
    49414936public void insert(String string) { 
    49424937    checkWidget(); 
    4943     if (string is null) { 
    4944         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    4945     } 
     4938    // DWT extension: allow null for zero length string 
     4939//     if (string is null) { 
     4940//         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     4941//     } 
    49464942    Point sel = getSelectionRange(); 
    49474943    replaceTextRange(sel.x, sel.y, string); 
     
    64586454 * @exception IllegalArgumentException <ul> 
    64596455 *   <li>ERROR_INVALID_RANGE when either start or end is outside the valid range (0 <= offset <= getCharCount())</li> 
    6460  *   <li>ERROR_NULL_ARGUMENT when ranges is null</li> 
    64616456 * </ul> 
    64626457 * 
     
    64686463    checkWidget(); 
    64696464    if (isListening(LineGetStyle)) return; 
    6470     if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     6465    // DWT extension: allow null for zero length string 
     6466    //if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    64716467    setStyleRanges(start, length, null, ranges, false); 
    64726468} 
     
    65016497 *   <li>ERROR_INVALID_ARGUMENT when either start or end is inside a multi byte line delimiter. 
    65026498 *      Splitting a line delimiter for example by inserting text in between the CR and LF and deleting part of a line delimiter is not supported</li> 
    6503  *   <li>ERROR_NULL_ARGUMENT when string is null</li> 
    65046499 * </ul> 
    65056500 */ 
    65066501public void replaceTextRange(int start, int length, String text) { 
    65076502    checkWidget(); 
    6508     if (text is null) { 
    6509         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    6510     } 
     6503    // DWT extension: allow null for zero length string 
     6504//     if (text is null) { 
     6505//         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     6506//     } 
    65116507    int contentLength = getCharCount(); 
    65126508    int end = start + length; 
     
    80968092 * </ul> 
    80978093 * @exception IllegalArgumentException <ul> 
    8098  *    <li>ERROR_NULL_ARGUMENT when the list of ranges is null</li> 
    80998094 *    <li>ERROR_INVALID_RANGE when the last of the style ranges is outside the valid range (> getCharCount())</li> 
    81008095 * </ul> 
     
    81058100    checkWidget(); 
    81068101    if (isListening(LineGetStyle)) return; 
    8107     if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     8102    // DWT extension: allow null for zero length string 
     8103    //if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    81088104    setStyleRanges(0, 0, null, ranges, true); 
    81098105} 
     
    81438139 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    81448140 * </ul> 
    8145  * @exception IllegalArgumentException <ul> 
    8146  *    <li>ERROR_NULL_ARGUMENT when string is null</li> 
    8147  * </ul> 
    81488141 */ 
    81498142public void setText(String text) { 
    81508143    checkWidget(); 
    8151     if (text is null) { 
    8152         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    8153     } 
     8144    // DWT extension: allow null for zero length string 
     8145//     if (text is null) { 
     8146//         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     8147//     } 
    81548148    Event event = new Event(); 
    81558149    event.start = 0; 
  • dwt/custom/TableTree.d

    r238 r255  
    765765 * 
    766766 * @exception IllegalArgumentException <ul> 
    767  *    <li>ERROR_NULL_ARGUMENT - if the array of items is null</li> 
     767 *    <li>ERROR_NULL_ARGUMENT - if one of the items is null</li> 
    768768 *    <li>ERROR_INVALID_ARGUMENT - if one of the item has been disposed</li> 
    769769 * </ul> 
     
    777777public void setSelection (TableTreeItem[] items) { 
    778778    checkWidget (); 
    779     if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     779    // DWT extension: allow null for zero length string 
     780    //if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    780781    int length = items.length; 
    781782    if (length is 0 || ((table.getStyle() & DWT.SINGLE) !is 0 && length > 1)) { 
  • dwt/custom/TableTreeItem.d

    r240 r255  
    820820 * @param text the new text 
    821821 * 
    822  * @exception IllegalArgumentException <ul> 
    823  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    824  * </ul> 
    825822 * @exception DWTException <ul> 
    826823 *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> 
     
    830827public void setText(int index, String text) { 
    831828    checkWidget(); 
    832     if (text is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     829    // DWT extension: allow null for zero length string 
     830    //if (text is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    833831    int columnCount = Math.max(parent.getTable().getColumnCount(), 1); 
    834832    if (index < 0 || index >= columnCount) return; 
  • dwt/dnd/Clipboard.d

    r238 r255  
    2929 
    3030import tango.core.Thread; 
    31 static import tango.stdc.stringz; 
    3231static import tango.stdc.string; 
    3332 
     
    564563            continue; 
    565564        } 
    566         String buffer = tango.stdc.stringz.fromStringz( pName ).dup; 
     565        String buffer = fromStringz( pName ).dup; 
    567566        OS.g_free (pName); 
    568567        result[count++] = "GTKCLIPBOARD "~buffer; 
     
    573572            continue; 
    574573        } 
    575         String buffer = tango.stdc.stringz.fromStringz( pName ).dup; 
     574        String buffer = fromStringz( pName ).dup; 
    576575        OS.g_free (pName); 
    577576        result[count++] = "GTKPRIMARYCLIPBOARD "~buffer; 
  • dwt/dnd/FileTransfer.d

    r240 r255  
    9090        OS.g_free(localePtr); 
    9191        if (error !is null || uriPtr is null) continue; 
    92         String temp = tango.stdc.stringz.fromStringz( uriPtr ).dup; 
     92        String temp = fromStringz( uriPtr ).dup; 
    9393        OS.g_free(uriPtr); 
    9494        int newLength = (i > 0) ? buffer.length+separator.length+temp.length :  temp.length; 
     
    163163        OS.g_free(localePtr); 
    164164        if (error !is null || utf8Ptr is null) continue; 
    165         String buffer = tango.stdc.stringz.fromStringz( utf8Ptr ).dup; 
     165        String buffer = fromStringz( utf8Ptr ).dup; 
    166166        OS.g_free(utf8Ptr); 
    167167        String name = buffer; 
  • dwt/dnd/TextTransfer.d

    r238 r255  
    2020import dwt.dnd.DND; 
    2121 
    22  
    23 static import tango.stdc.stringz; 
    2422 
    2523/** 
     
    8179    } 
    8280    String string = (cast(ArrayWrapperString)object).array; 
    83     char* utf8 = tango.stdc.stringz.toStringz(string); 
     81    char* utf8 = toStringz(string); 
    8482    if  (transferData.type is cast(void*) COMPOUND_TEXT_ID) { 
    8583        void* encoding; 
     
    131129    int count = OS.gdk_text_property_to_utf8_list(transferData.type, transferData.format, transferData.pValue, transferData.length, &list); 
    132130    if (count is 0) return null; 
    133     String utf8 = tango.stdc.stringz.fromStringz( list[0] ).dup; 
     131    String utf8 = fromStringz( list[0] ).dup; 
    134132    OS.g_strfreev(list); 
    135133    return new ArrayWrapperString( utf8 ); 
  • dwt/dnd/Transfer.d

    r238 r255  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2007 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    2020import dwt.dnd.TransferData; 
    2121 
    22 static import tango.stdc.stringz; 
    2322 
    2423/** 
     
    140139public static int registerType(String formatName){ 
    141140    if (formatName is null) return OS.GDK_NONE; 
    142     char* buffer = tango.stdc.stringz.toStringz( formatName ); 
     141    char* buffer = toStringz( formatName ); 
    143142    return cast(int)/*64*/OS.gdk_atom_intern(buffer, false); 
    144143} 
  • dwt/dnd/URLTransfer.d

    r240 r255  
    9797    int size = (transferData.format * transferData.length / 8); 
    9898    if (size <= 0) return null; 
    99     String string = tango.stdc.stringz.fromStringz(cast(char*)transferData.pValue).dup; 
     99    String string = fromStringz(cast(char*)transferData.pValue).dup; 
    100100    int end = string.indexOf('\0'); 
    101101    return new ArrayWrapperString((end is -1) ? string : string.substring(0, end)); 
  • dwt/dwthelper/utils.d

    r254 r255  
    1111import tango.io.Stdout; 
    1212import tango.io.Print; 
    13 import tango.stdc.stringz; 
     13static import tango.stdc.stringz; 
    1414static import tango.text.Util; 
    1515static import tango.text.Text; 
     
    630630} 
    631631 
     632public alias tango.stdc.stringz.toStringz toStringz; 
     633public alias tango.stdc.stringz.toString16z toString16z; 
     634public alias tango.stdc.stringz.fromStringz fromStringz; 
     635public alias tango.stdc.stringz.fromString16z fromString16z; 
     636 
    632637static String toHex(uint value, bool prefix = true, int radix = 8){ 
    633638    return tango.text.convert.Integer.toString( 
  • dwt/graphics/Device.d

    r240 r255  
    2929 
    3030import tango.core.Exception; 
    31 import tango.stdc.stringz; 
    3231import tango.io.Stdout; 
    3332 
     
    591590            int flags = OS.G_LOG_LEVEL_MASK | OS.G_LOG_FLAG_FATAL | OS.G_LOG_FLAG_RECURSION; 
    592591            for (int i=0; i<log_domains.length; i++) { 
    593                 handler_ids [i] = OS.g_log_set_handler (toStringz(log_domains [i]), flags, & logFunction, cast(void*)this); 
     592                handler_ids [i] = OS.g_log_set_handler (log_domains [i].toStringzValidPtr(), flags, & logFunction, cast(void*)this); 
    594593            } 
    595594        } 
     
    691690    checkDevice(); 
    692691    if (path is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    693     return cast(bool) OS.FcConfigAppFontAddFile (null, toStringz(path)); 
     692    return cast(bool) OS.FcConfigAppFontAddFile (null, path.toStringzValidPtr()); 
    694693} 
    695694 
     
    792791        for (int i=0; i<handler_ids.length; i++) { 
    793792            if (handler_ids [i] !is 0 ) { 
    794                 OS.g_log_remove_handler (toStringz(log_domains [i]), handler_ids [i]); 
     793                OS.g_log_remove_handler (log_domains [i].toStringzValidPtr(), handler_ids [i]); 
    795794                handler_ids [i] = 0; 
    796795            } 
     
    821820            for (int i=0; i<handler_ids.length; i++) { 
    822821                if (handler_ids [i] !is 0) { 
    823                     OS.g_log_remove_handler (toStringz(log_domains [i]), handler_ids [i]); 
     822                    OS.g_log_remove_handler (log_domains [i].toStringzValidPtr(), handler_ids [i]); 
    824823                    handler_ids [i] = 0; 
    825824                } 
     
    831830            int flags = OS.G_LOG_LEVEL_MASK | OS.G_LOG_FLAG_FATAL | OS.G_LOG_FLAG_RECURSION; 
    832831            for (int i=0; i<log_domains.length; i++) { 
    833                 handler_ids [i] = OS.g_log_set_handler (toStringz(log_domains [i]), flags, & logFunction, cast(void*)this ); 
     832                handler_ids [i] = OS.g_log_set_handler (log_domains [i].toStringzValidPtr(), flags, & logFunction, cast(void*)this ); 
    834833            } 
    835834        } 
  • dwt/graphics/Font.d

    r240 r255  
    2424 
    2525import tango.text.convert.Format; 
    26 import tango.stdc.stringz; 
    2726 
    2827/** 
  • dwt/graphics/GC.d

    r242 r255  
    4646import tango.text.convert.Format; 
    4747import tango.stdc.string; 
    48 import tango.stdc.stringz; 
    4948 
    5049 
  • dwt/graphics/Image.d

    r240 r255  
    3434import tango.text.convert.Format; 
    3535import tango.stdc.string; 
    36 import tango.stdc.stringz; 
    3736 
    3837/** 
  • dwt/graphics/ImageData.d

    r240 r255  
    445445    int bytesPerLine = (((width * depth + 7) / 8) + (scanlinePad - 1)) 
    446446        / scanlinePad * scanlinePad; 
    447      
     447 
    448448    /* 
    449449     * When the image is being loaded from a PNG, we need to use the theoretical minimum 
  • dwt/graphics/TextLayout.d

    r246 r255  
    3333 
    3434import tango.text.convert.Format; 
    35 import tango.stdc.stringz; 
    3635import tango.stdc.string; 
    3736import tango.text.convert.Utf; 
  • dwt/internal/Converter.d

    r238 r255  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2004 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    1414 
    1515import dwt.dwthelper.utils; 
    16  
    17  
    18 //import dwt.internal.gtk.OS; 
    19 import tango.stdc.stringz; 
    2016 
    2117extern(C) { 
  • dwt/printing/PrintDialog.d

    r240 r255  
    2929import tango.util.Convert; 
    3030import Math = tango.math.Math; 
    31 static import tango.stdc.stringz; 
    3231 
    3332/** 
     
    285284        return Printer.getDefaultPrinterData(); 
    286285    } else { 
    287         char* titleBytes = tango.stdc.stringz.toStringz( getText() ); 
     286        char* titleBytes = toStringz( getText() ); 
    288287        auto topHandle = getParent().handle; 
    289288        while (topHandle !is null && !OS.GTK_IS_WINDOW(topHandle)) { 
     
    310309            //TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590) 
    311310            if (printerData.printToFile) { 
    312                 char* buffer = tango.stdc.stringz.toStringz(printerData.fileName); 
     311                char* buffer = toStringz(printerData.fileName); 
    313312                OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); 
    314313            } 
    315314            if (printerData.driver.equals("GtkPrintBackendFile") && printerData.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$ 
    316                 char* buffer = tango.stdc.stringz.toStringz(printerData.fileName); 
     315                char* buffer = toStringz(printerData.fileName); 
    317316                OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); 
    318317            } 
     
    324323 
    325324        if (printToFile) { 
    326             char* buffer = tango.stdc.stringz.toStringz( "Print to File" ); //$NON-NLS-1$ 
     325            char* buffer = toStringz( "Print to File" ); //$NON-NLS-1$ 
    327326            OS.gtk_print_settings_set_printer(settings, buffer); 
    328327        } 
     
    393392                if (printToFile) { 
    394393                    auto address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr); 
    395                     data.fileName = tango.stdc.stringz.fromStringz( address).dup; 
     394                    data.fileName = fromStringz( address).dup; 
    396395                } 
    397396 
     
    440439 
    441440void GtkPrintSettingsMeth (char* key, char* value) { 
    442     store( tango.stdc.stringz.fromStringz(key).dup, tango.stdc.stringz.fromStringz(value).dup ); 
     441    store( fromStringz(key).dup, fromStringz(value).dup ); 
    443442} 
    444443 
     
    456455 
    457456void storeBytes(String key, char* value) { 
    458     store(key, tango.stdc.stringz.fromStringz(value).dup ); 
     457    store(key, fromStringz(value).dup ); 
    459458} 
    460459 
  • dwt/printing/Printer.d

    r240 r255  
    2929import dwt.dwthelper.utils; 
    3030 
    31 static import tango.stdc.stringz; 
    3231import tango.io.Stdout; 
    3332import tango.util.Convert; 
     
    179178    auto backend = OS.gtk_printer_get_backend(printer); 
    180179    auto address = OS.G_OBJECT_TYPE_NAME(backend); 
    181     String backendType =tango.stdc.stringz.fromStringz( address ).dup; 
     180    String backendType = fromStringz( address ).dup; 
    182181 
    183182    address = OS.gtk_printer_get_name (printer); 
    184     String name =tango.stdc.stringz.fromStringz( address ).dup; 
     183    String name = fromStringz( address ).dup; 
    185184 
    186185    return new PrinterData (backendType, name); 
     
    469468public bool startJob(String jobName) { 
    470469    checkDevice(); 
    471     char* buffer = tango.stdc.stringz.toStringz(jobName); 
     470    char* buffer = toStringz(jobName); 
    472471    printJob = OS.gtk_print_job_new (buffer, printer, settings, pageSetup); 
    473472    if (printJob is null) return false; 
     
    737736    //TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590) 
    738737    if (data.printToFile) { 
    739         char* buffer = tango.stdc.stringz.toStringz( data.fileName ); 
     738        char* buffer = toStringz( data.fileName ); 
    740739        OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); 
    741740    } 
    742741    if (data.driver.equals("GtkPrintBackendFile") && data.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$ 
    743         char* buffer = tango.stdc.stringz.toStringz( data.fileName ); 
     742        char* buffer = toStringz( data.fileName ); 
    744743        OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); 
    745744    } 
  • dwt/program/Program.d

    r240 r255  
    2525 
    2626import tango.sys.SharedLib; 
    27 import tango.stdc.stringz; 
    2827import tango.core.Exception; 
    2928import tango.core.Array; 
     
    706705 * @return the program or <code>null</code> 
    707706 * 
    708  * @exception IllegalArgumentException <ul> 
    709  *      <li>ERROR_NULL_ARGUMENT when extension is null</li> 
    710  *  </ul> 
    711707 */ 
    712708public static Program findProgram(String extension) { 
     
    719715 */ 
    720716static Program findProgram(Display display, String extension) { 
    721     if (extension is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     717    // DWT extension: allow null for zero length string 
     718    //if (extension is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    722719    if (extension.length is 0) return null; 
    723720    if (extension.charAt(0) !is '.') extension = "." ~ extension; 
  • dwt/widgets/Button.d

    r248 r255  
    2727import dwt.widgets.Decorations; 
    2828 
    29 import tango.stdc.stringz; 
    3029import tango.io.Stdout; 
    3130 
     
    783782 * @param string the new text 
    784783 * 
    785  * @exception IllegalArgumentException <ul> 
    786  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    787  * </ul> 
    788784 * @exception DWTException <ul> 
    789785 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    793789public void setText (String string) { 
    794790    checkWidget (); 
    795     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     791    // DWT extension: allow null for zero length string 
     792    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    796793    if ((style & DWT.ARROW) !is 0) return; 
    797794    text = string; 
  • dwt/widgets/ColorDialog.d

    r240 r255  
    1313module dwt.widgets.ColorDialog; 
    1414 
    15  
    16  
    1715import dwt.DWT; 
    1816import dwt.DWTException; 
     
    2422import dwt.widgets.Display; 
    2523 
    26 import tango.stdc.stringz
     24import dwt.dwthelper.utils
    2725 
    2826/** 
  • dwt/widgets/Combo.d

    r241 r255  
    2727 
    2828import dwt.dwthelper.utils; 
    29 import tango.stdc.stringz; 
    3029import Math = tango.math.Math; 
    3130 
     
    139138 * @param string the new item 
    140139 * 
    141  * @exception IllegalArgumentException <ul> 
    142  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    143  * </ul> 
    144140 * @exception DWTException <ul> 
    145141 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    151147public void add (String string) { 
    152148    checkWidget(); 
    153     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     149    // DWT extension: allow null for zero length string 
     150    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    154151    add (string, items.length); 
    155152} 
     
    168165 * 
    169166 * @exception IllegalArgumentException <ul> 
    170  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    171167 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li> 
    172168 * </ul> 
     
    180176public void add (String string, int index) { 
    181177    checkWidget(); 
    182     if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     178    // DWT extension: allow null for zero length string 
     179    //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    183180    if (!(0 <= index && index <= items.length)) { 
    184181        error (DWT.ERROR_INVALID_RANGE); 
     
    189186    System.arraycopy (items, index, newIte