Changeset 92

Show
Ignore:
Timestamp:
01/27/06 05:30:34 (3 years ago)
Author:
Shawn Liu
Message:

ResourceManager?, VecT, SimpType? made deprecated

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/win32/import/dwt/browser/browser.d

    r82 r92  
    555555    } 
    556556     
    557     VecT!(CloseWindowListener).remove(closeWindowListeners, listener); 
     557    TVector!(CloseWindowListener).remove(closeWindowListeners, listener); 
    558558} 
    559559 
     
    577577    checkWidget(); 
    578578    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    579     VecT!(LocationListener).remove(locationListeners, listener); 
     579    TVector!(LocationListener).remove(locationListeners, listener); 
    580580} 
    581581 
     
    599599    checkWidget(); 
    600600    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    601     VecT!(OpenWindowListener).remove(openWindowListeners, listener); 
     601    TVector!(OpenWindowListener).remove(openWindowListeners, listener); 
    602602} 
    603603 
     
    621621    checkWidget(); 
    622622    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    623     VecT!(ProgressListener).remove(progressListeners, listener); 
     623    TVector!(ProgressListener).remove(progressListeners, listener); 
    624624} 
    625625 
     
    643643    checkWidget(); 
    644644    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    645     VecT!(StatusTextListener).remove(statusTextListeners, listener); 
     645    TVector!(StatusTextListener).remove(statusTextListeners, listener); 
    646646} 
    647647 
     
    665665    checkWidget(); 
    666666    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    667     VecT!(TitleListener).remove(titleListeners, listener); 
     667    TVector!(TitleListener).remove(titleListeners, listener); 
    668668} 
    669669 
     
    687687    checkWidget(); 
    688688    if (listener is null) DWT.error (__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    689     VecT!(VisibilityWindowListener).remove(visibilityWindowListeners, listener); 
     689    TVector!(VisibilityWindowListener).remove(visibilityWindowListeners, listener); 
    690690} 
    691691 
  • trunk/current/win32/import/dwt/custom/styledtexthelper.d

    r82 r92  
    17491749        // expand the lines by powers of 2 
    17501750        RANGE[] newLines = new RANGE[len+Compatibility.pow2(expandExp)]; 
    1751         SimpType!(RANGE).arraycopy(lines, 0, newLines, 0, len); 
     1751        SimpleType!(RANGE).arraycopy(lines, 0, newLines, 0, len); 
    17521752        lines = newLines; 
    17531753        expandExp++; 
     
    17761776        newLines = new RANGE[size+Compatibility.pow2(replaceExpandExp)]; 
    17771777        replaceExpandExp++; 
    1778         SimpType!(RANGE).arraycopy(linesArray, 0, newLines, 0, size); 
     1778        SimpleType!(RANGE).arraycopy(linesArray, 0, newLines, 0, size); 
    17791779    } 
    17801780    RANGE range; 
     
    19471947    } 
    19481948    RANGE[] newLines = new RANGE[lineCnt+1]; 
    1949     SimpType!(RANGE).arraycopy(indexedLines, 0, newLines, 0, lineCnt); 
     1949    SimpleType!(RANGE).arraycopy(indexedLines, 0, newLines, 0, lineCnt); 
    19501950 
    19511951    RANGE range; 
     
    23652365    } 
    23662366    RANGE[] newLines = new RANGE[size+Math.max(10, numLines)]; 
    2367     SimpType!(RANGE).arraycopy(lines, 0, newLines, 0, size); 
     2367    SimpleType!(RANGE).arraycopy(lines, 0, newLines, 0, size); 
    23682368    lines = newLines; 
    23692369} 
     
    35303530    } 
    35313531    RANGE[] newLines = new RANGE[Math.max(size * 2, numLines)]; 
    3532     SimpType!(RANGE).arraycopy(visualLines, 0, newLines, 0, size); 
     3532    SimpleType!(RANGE).arraycopy(visualLines, 0, newLines, 0, size); 
    35333533    visualLines = newLines; 
    35343534    resetVisualLines(size, visualLines.length - size);   
     
    38023802    // there are more visual lines for a given logical line than before 
    38033803    if (visualLines[visualLineIndex][LINE_OFFSET] != -1) { 
    3804         SimpType!(RANGE).arraycopy(visualLines, visualLineIndex, visualLines, visualLineIndex + 1, visualLineCount - visualLineIndex); 
     3804        SimpleType!(RANGE).arraycopy(visualLines, visualLineIndex, visualLines, visualLineIndex + 1, visualLineCount - visualLineIndex); 
    38053805 
    38063806        RANGE range; 
     
    38763876    if (emptyLineCount > 0) { 
    38773877        int copyLineCount = visualLineCount - visualLineIndex; 
    3878         SimpType!(RANGE).arraycopy(visualLines, visualLineIndex + emptyLineCount, visualLines, visualLineIndex, copyLineCount); 
     3878        SimpleType!(RANGE).arraycopy(visualLines, visualLineIndex + emptyLineCount, visualLines, visualLineIndex, copyLineCount); 
    38793879        resetVisualLines(visualLineIndex + copyLineCount, emptyLineCount); 
    38803880    } 
  • trunk/current/win32/import/dwt/extra/make-dwtextra-lib.bat

    r82 r92  
    11@echo deleting old intermediate files ... 
    22 
    3 del *.obj *.map /s /q 
     3del *.obj *.map *.rsp *.lsp *.ksp *.def /s /q 
    44 
    55@echo Build release version ... 
  • trunk/current/win32/import/dwt/graphics/device.d

    r82 r92  
    1414private import dwt.dwt; 
    1515 
    16   
    17  
    1816private import dwt.graphics.color; 
    19 private import dwt.graphics.cursor; 
    2017private import dwt.graphics.devicedata; 
    2118private import dwt.graphics.drawable; 
    2219private import dwt.graphics.font; 
    2320private import dwt.graphics.fontdata; 
    24 private import dwt.graphics.fontmetrics; 
    25 private import dwt.graphics.gc; 
    2621private import dwt.graphics.gcdata; 
    27 private import dwt.graphics.image; 
    28 private import dwt.graphics.imagedata; 
    29 private import dwt.graphics.imageloader; 
    30 private import dwt.graphics.imageloaderevent; 
    31 private import dwt.graphics.imageloaderlistener; 
    32 private import dwt.graphics.palettedata; 
    3322private import dwt.graphics.point; 
    3423private import dwt.graphics.rectangle; 
    35 private import dwt.graphics.region; 
    36 private import dwt.graphics.rgb; 
    37 private import dwt.graphics.textlayout; 
    38 private import dwt.graphics.textstyle; 
    39 private import dwt.internal.bidiutil; 
    40 private import dwt.internal.cloneablecompatibility; 
    4124private import dwt.internal.compatibility; 
    42 private import dwt.internal.library; 
    43 private import dwt.internal.serializablecompatibility; 
    44 private import dwt.internal.dwteventlistener; 
    45 private import dwt.internal.dwteventobject; 
    4625private import dwt.internal.win32.os; 
    4726 
    48  
    49  
    50  
     27private import dwt.util.util; 
    5128private import dwt.util.javatypes; 
    52 private import dwt.util.util; 
    53 private import dwt.util.vector; 
    54 private import dwt.util.hashtable; 
    55 private import dwt.util.eventhandler; 
    56 private import dwt.util.javatypes; 
    57 //private import dwt.internal.callback; 
    5829 
    5930 
     
    6738     
    6839    private import std.windows.charset; 
    69     private import std.windows.syserror; 
    70  
    7140     
    7241    /* Debugging */ 
     
    529498    if (error == 0) return ""; 
    530499     
    531     // there is bug in phobos sysErrorString(), call fromMBSz() myself  
    532     char[] buffer = std.windows.syserror.sysErrorString(error); 
    533     if(buffer[--$] != '\0') 
    534         buffer ~= '\0'; 
    535     return std.windows.charset.fromMBSz(buffer); 
    536        
    537 //  TCHAR* buffer = null; 
    538 //  int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 
    539 //  int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, cast(TCHAR*)&buffer, 0, null); 
    540 //  char[] errorNum = ("[GetLastError=") ~ Converter.toHex(error) ~ "] "; 
    541 //  if (length == 0) return errorNum; 
    542 //  char[] buffer1 = Converter.TCHARzToStr(buffer, length); 
    543 //  if ( *buffer != 0)  
    544 //      OS.LocalFree(cast(HLOCAL)buffer); 
    545 //  return errorNum ~ buffer1; 
     500    TCHAR* buffer = null; 
     501    int dwFlags = OS.FORMAT_MESSAGE_ALLOCATE_BUFFER | OS.FORMAT_MESSAGE_FROM_SYSTEM | OS.FORMAT_MESSAGE_IGNORE_INSERTS; 
     502    int length = OS.FormatMessage(dwFlags, null, error, OS.LANG_USER_DEFAULT, cast(TCHAR*)&buffer, 0, null); 
     503    char[] errorNum = ("[GetLastError=") ~ Converter.toHex(error) ~ "] "; 
     504    if (length == 0) return errorNum; 
     505    char[] buffer1 = Converter.TCHARzToStr(buffer, length); 
     506    if ( *buffer != 0)  
     507        OS.LocalFree(cast(HLOCAL)buffer); 
     508    return errorNum ~ buffer1; 
    546509} 
    547510 
  • trunk/current/win32/import/dwt/ole/win32/olecontrolsite.d

    r82 r92  
    4141 
    4242 
    43 private alias SimpType!(Variant).arraycopy arraycopy; 
     43private alias SimpleType!(Variant).arraycopy arraycopy; 
    4444 
    4545class _IDispatchImpl : IDispatch { 
     
    747747                        oleEventSinkIUnknown = null; 
    748748                    } else { 
    749                         VecT!(OleEventSink).remove(oleEventSink, i); 
    750                         VecT!(GUID*).remove(oleEventSinkGUID, i); 
    751                         VecT!(IUnknown).remove(oleEventSinkIUnknown, i); 
     749                        TVector!(OleEventSink).remove(oleEventSink, i); 
     750                        TVector!(GUID*).remove(oleEventSinkGUID, i); 
     751                        TVector!(IUnknown).remove(oleEventSinkIUnknown, i); 
    752752                    } 
    753753                } 
  • trunk/current/win32/import/dwt/ole/win32/olemisc.d

    r76 r92  
    117117        TypedHandler hand = handlers[i]; 
    118118        if(hand && hand.equals(handler)){ 
    119             VecT!(TypedHandler).remove(handlers, hand); 
     119            TVector!(TypedHandler).remove(handlers, hand); 
    120120            hand = null; 
    121121            return; 
  • trunk/current/win32/import/dwt/util/resourcemanager.d

    r82 r92  
    2626 */ 
    2727 
    28 public class ResourceManager { 
     28// since there is a ResourceManager class in JFace, and I may port JFace from java to D soon, 
     29// to avoid name conflicts, rename this class to DWTResourceManager 
     30 
     31deprecated alias DWTResourceManager ResourceManager; 
     32 
     33public class DWTResourceManager { 
    2934 
    3035    private import std.c.windows.windows; 
     
    5762            Widget w = cast(Widget)e.getSource(); 
    5863            assert(w !is null); 
    59             if(w in ResourceManager.users) 
    60                 ResourceManager.users.remove(w); 
    61             if (ResourceManager.users.length == 0) 
    62                 ResourceManager.dispose(); 
     64            if(w in DWTResourceManager.users) 
     65                DWTResourceManager.users.remove(w); 
     66            if (DWTResourceManager.users.length == 0) 
     67                DWTResourceManager.dispose(); 
    6368        } 
    6469//      widget.handleDispose(null, &onDispose); 
  • trunk/current/win32/import/dwt/util/util.d

    r82 r92  
    176176} 
    177177 
    178 template SimpType(T) 
     178deprecated alias SimpleType SimpType; 
     179 
     180template SimpleType(T) 
    179181{ 
    180182    debug{ 
    181183        static void validCheck(uint SrcLen, uint DestLen, uint copyLen){ 
    182184            if(SrcLen < copyLen || DestLen < copyLen|| SrcLen < 0 || DestLen < 0){ 
    183                 Util.trace("Error : VecT.arraycopy(), out of bounds."); 
     185                Util.trace("Error : SimpleType.arraycopy(), out of bounds."); 
    184186                assert(0); 
    185187            } 
     
    287289        return GetTickCount(); 
    288290    } 
    289     alias SimpType!(int).arraycopy arraycopy; 
    290     alias SimpType!(byte).arraycopy arraycopy; 
    291     alias SimpType!(double).arraycopy arraycopy; 
    292     alias SimpType!(float).arraycopy arraycopy; 
    293     alias SimpType!(short).arraycopy arraycopy; 
    294     alias SimpType!(long).arraycopy arraycopy; 
    295     alias SimpType!(uint).arraycopy arraycopy; 
    296     alias SimpType!(ushort).arraycopy arraycopy; 
    297     alias SimpType!(ubyte).arraycopy arraycopy; 
    298     alias SimpType!(ulong).arraycopy arraycopy;    
    299     alias SimpType!(char).arraycopy arraycopy;     
    300     alias SimpType!(wchar).arraycopy arraycopy;    
    301     alias SimpType!(Object).arraycopy arraycopy; 
    302     alias SimpType!(void*).arraycopy arraycopy; 
    303     alias SimpType!(HANDLE).arraycopy arraycopy; 
    304     alias SimpType!(IUnknown).arraycopy arraycopy; 
    305     alias SimpType!(GUID*).arraycopy arraycopy; 
    306  
    307  
    308     alias SimpType!(int[]).arraycopy arraycopy; 
    309     alias SimpType!(byte[]).arraycopy arraycopy; 
    310     alias SimpType!(double[]).arraycopy arraycopy; 
    311     alias SimpType!(float[]).arraycopy arraycopy; 
    312     alias SimpType!(short[]).arraycopy arraycopy; 
    313     alias SimpType!(long[]).arraycopy arraycopy; 
    314     alias SimpType!(uint[]).arraycopy arraycopy; 
    315     alias SimpType!(ushort[]).arraycopy arraycopy; 
    316     alias SimpType!(ubyte[]).arraycopy arraycopy; 
    317     alias SimpType!(ulong[]).arraycopy arraycopy;  
    318     alias SimpType!(char[]).arraycopy arraycopy;   
    319     alias SimpType!(wchar[]).arraycopy arraycopy;  
    320     alias SimpType!(Object[]).arraycopy arraycopy; 
    321     alias SimpType!(LPVOID[]).arraycopy arraycopy; 
    322     alias SimpType!(HANDLE[]).arraycopy arraycopy; 
    323     alias SimpType!(IUnknown[]).arraycopy arraycopy; 
    324     alias SimpType!(GUID*[]).arraycopy arraycopy; 
     291    alias SimpleType!(int).arraycopy arraycopy; 
     292    alias SimpleType!(byte).arraycopy arraycopy; 
     293    alias SimpleType!(double).arraycopy arraycopy; 
     294    alias SimpleType!(float).arraycopy arraycopy; 
     295    alias SimpleType!(short).arraycopy arraycopy; 
     296    alias SimpleType!(long).arraycopy arraycopy; 
     297    alias SimpleType!(uint).arraycopy arraycopy; 
     298    alias SimpleType!(ushort).arraycopy arraycopy; 
     299    alias SimpleType!(ubyte).arraycopy arraycopy; 
     300    alias SimpleType!(ulong).arraycopy arraycopy;  
     301    alias SimpleType!(char).arraycopy arraycopy;   
     302    alias SimpleType!(wchar).arraycopy arraycopy;  
     303    alias SimpleType!(Object).arraycopy arraycopy; 
     304    alias SimpleType!(void*).arraycopy arraycopy; 
     305    alias SimpleType!(HANDLE).arraycopy arraycopy; 
     306    alias SimpleType!(IUnknown).arraycopy arraycopy; 
     307    alias SimpleType!(GUID*).arraycopy arraycopy; 
     308 
     309 
     310    alias SimpleType!(int[]).arraycopy arraycopy; 
     311    alias SimpleType!(byte[]).arraycopy arraycopy; 
     312    alias SimpleType!(double[]).arraycopy arraycopy; 
     313    alias SimpleType!(float[]).arraycopy arraycopy; 
     314    alias SimpleType!(short[]).arraycopy arraycopy; 
     315    alias SimpleType!(long[]).arraycopy arraycopy; 
     316    alias SimpleType!(uint[]).arraycopy arraycopy; 
     317    alias SimpleType!(ushort[]).arraycopy arraycopy; 
     318    alias SimpleType!(ubyte[]).arraycopy arraycopy; 
     319    alias SimpleType!(ulong[]).arraycopy arraycopy;    
     320    alias SimpleType!(char[]).arraycopy arraycopy;     
     321    alias SimpleType!(wchar[]).arraycopy arraycopy;    
     322    alias SimpleType!(Object[]).arraycopy arraycopy; 
     323    alias SimpleType!(LPVOID[]).arraycopy arraycopy; 
     324    alias SimpleType!(HANDLE[]).arraycopy arraycopy; 
     325    alias SimpleType!(IUnknown[]).arraycopy arraycopy; 
     326    alias SimpleType!(GUID*[]).arraycopy arraycopy; 
    325327 
    326328} 
  • trunk/current/win32/import/dwt/util/vector.d

    r76 r92  
    1  
     1/************************************* 
     2 * Java Vector like array implementation. 
     3 * 
     4 * Contributors: Shawn Liu 
     5 * 
     6 */ 
     7 
    28module dwt.util.vector; 
    39 
    410private import dwt.dwt; 
    5 //private import dwt.util.util; 
    6 //private import dwt.string; 
    7  
    8  
    9  
    1011 
    1112int foo; 
    1213 
    13 // don't use T as simple data type, such as int, char 
    14 template VecT(T) 
    15 {    
     14 
     15 
     16deprecated alias TVector VecT; 
     17 
     18/** 
     19 * Don't use T as simple data type, such as int, char,  
     20 */ 
     21template TVector(T) 
     22
    1623    static boolean contains(T[] items, T element, boolean byRef = true) { 
    1724 
    1825        return indexOf(items, element, byRef) >= 0; 
     26    } 
     27 
     28    static void sort (inout T[] items, int function(T a,T b) compareFunc) 
     29    { 
     30        assert(compareFunc); 
     31         
     32        if(!items.length) return; 
     33         
     34        T tmp; 
     35        boolean notdone=1; 
     36        int c=0,c2=0; 
     37        for(;notdone;) 
     38        { 
     39            notdone=0; 
     40            for(c=items.length-1;c>0;c=c2) 
     41            { 
     42                c2=c-1; 
     43                if(compareFunc(items[c],items[c2])<0) 
     44                { 
     45                    tmp=items[c2]; 
     46                    items[c2]=items[c]; 
     47                    items[c]=tmp; 
     48                    notdone=1; 
     49                } 
     50            } 
     51        } 
     52    } 
     53 
     54    static boolean deleteItems(inout T[] items, int index, int len=1) 
     55    { 
     56        if(index<0 || index>=items.length || index+len>items.length) return false; 
     57        if(len==0) return true; 
     58        if(len==items.length) 
     59        { 
     60            items.length=0; 
     61            return true; 
     62        } 
     63        items=items[0..index]~items[index+len..items.length]; 
     64        return true; 
    1965    } 
    2066 
     
    3480    static T remove(inout T[] items, int index) 
    3581    { 
    36         if(items.length == 0) 
     82        if(items.length == 0) { 
    3783            return null; 
    38          
     84        } 
     85 
    3986        if(index < 0 || index >= items.length){ 
    40             DWT.error(__FILE__, __LINE__, "Out of array bounds."); 
     87            debug{ 
     88                DWT.error(__FILE__, __LINE__, "Out of array bounds."); 
     89            } 
    4190            return null; 
    4291        } 
     
    61110     
    62111    /** 
    63      * remove an item from Array, compare the item by reference or content    
     112     * remove an item from Array, compare the item by reference or content 
     113     * if T is char[], you may do a string content compare by set byRef to false     
    64114     */ 
    65115    static int remove(inout T[] items, T item, boolean byRef = true) 
     
    88138    static void insert(inout T[] items, T item, int index = -1) 
    89139    {    
    90         if(item is null)  
    91             return; 
    92          
    93140        if(index == -1) 
    94141            index = items.length; 
    95142         
    96143        if(index < 0 || index > items.length ){ 
    97             DWT.error(__FILE__, __LINE__, "Out of array bounds."); 
     144            debug{ 
     145                DWT.error(__FILE__, __LINE__, "Out of array bounds."); 
     146            } 
    98147            return; 
    99148        } 
     
    119168    } 
    120169     
    121 }   // end of class VecT(T) 
     170}   // end of class TVector(T) 
    122171 
    123172 
     
    134183//  Util.printObj(xx, new String("xx")); 
    135184 
    136     VecT!(Object).insert(objs, xx, 2); 
    137      
    138      
    139     VecT!(Object).insert(objs, xx); 
     185    TVector!(Object).insert(objs, xx, 2); 
     186     
     187     
     188    TVector!(Object).insert(objs, xx); 
    140189 
    141190    assert(obj2 is objs[3]); 
     
    148197     
    149198 
    150     VecT!(Object).remove(objs, 1); 
     199    TVector!(Object).remove(objs, 1); 
    151200 
    152201    assert(obj2 is objs[2]); 
     
    157206    } 
    158207 
    159     VecT!(Object).remove(objs, xx); 
     208    TVector!(Object).remove(objs, xx); 
    160209     
    161210//  Util.trace("\ndump 3\n"); 
     
    172221    cArr ~= c1; 
    173222    cArr ~= c2; 
    174     VecT!(char[]).insert(cArr, "abcd"); 
     223    TVector!(char[]).insert(cArr, "abcd"); 
    175224 
    176225    assert(cArr[2] == "abcd"); 
     
    178227} 
    179228 
    180  
     229/** 
     230 * Java Vector like array implementation. 
     231 * Don't use T as simple data type, such as int, char,  
     232 */ 
    181233class Vector(T) 
    182234{ 
     
    208260    public void insertElementAt(T element, int index) 
    209261    { 
    210         VecT!(T).insert(_values, element, index); 
     262        TVector!(T).insert(_values, element, index); 
    211263    } 
    212264         
     
    250302    public void removeElement(T element) 
    251303    { 
    252         VecT!(T).remove(_values, element); 
     304        TVector!(T).remove(_values, element); 
    253305    } 
    254306     
    255307    public T removeElementAt(int index) 
    256308    { 
    257         return VecT!(T).remove(this._values, index); 
     309        return TVector!(T).remove(this._values, index); 
    258310    } 
    259311     
    260312    public T[] values(){ return _values[];} 
    261313 
     314 
    262315    public boolean contains(T element) 
    263316    { 
    264         if( cast(int)cast(void*)element == 0) return false; 
    265  
    266317        foreach(T t; _values){ 
    267318            if(t is element) 
  • trunk/current/win32/import/make-dwt-lib.bat

    r82 r92  
    11@echo deleting old intermediate files ... 
    22 
    3 del *.obj *.map /s /q 
     3del *.obj *.map *.rsp *.lsp *.ksp *.def /s /q 
    44 
    55@echo Build release version ... 
  • trunk/current/win32/packages/dwt/examples/controlexample/controlexample.d

    r76 r92  
    276276     */ 
    277277    public this(Composite parent) { 
    278         ResourceManager.registerResourceUser(parent); 
    279         parent.getShell().setImage(ResourceManager.getImage("DLOGO", "BMPFILE")); 
     278        DWTResourceManager.registerResourceUser(parent); 
     279        parent.getShell().setImage(DWTResourceManager.getImage("DLOGO", "BMPFILE")); 
    280280        intStringRes();      
    281281        initResources(); 
     
    344344     * Frees the resources 
    345345     */ 
    346      // <Shawn> ResourceManager will freeResources automatically 
     346     // <Shawn> DWTResourceManager will freeResources automatically 
    347347    void freeResources() { 
    348348//      if (images !is null) { 
     
    392392                images = new Image[imageLocations.length]; 
    393393                for (int i = 0; i < imageLocations.length; ++i) { 
    394                     images[i] = ResourceManager.getImage(imageLocations[i], "GIFFILE"); 
     394                    images[i] = DWTResourceManager.getImage(imageLocations[i], "GIFFILE"); 
    395395                } 
    396396            } 
  • trunk/current/win32/packages/dwt/examples/controlexample/styledtexttab.d

    r76 r92  
    4747//      ImageData mask = new ImageData(name ~ "_mask.bmp"); 
    4848//      return new Image (display, source, mask); 
    49         return ResourceManager.getImage("TARGET", "BMPFILE"); 
     49        return DWTResourceManager.getImage("TARGET", "BMPFILE"); 
    5050    } 
    5151     
  • trunk/current/win32/packages/dwt/examples/dummyeclipse/dummyeclipse.d

    r76 r92  
    5151         
    5252        Display display = getDisplay(); 
    53         ResourceManager.registerResourceUser(this); 
     53        DWTResourceManager.registerResourceUser(this); 
    5454         
    5555        // not like java, stores image file in jar file, 
     
    5959        gradientColors[2] = null; 
    6060         
    61         this.getShell().setImage(ResourceManager.getImage("SAMPLE", GIFFILE)); 
     61        this.getShell().setImage(DWTResourceManager.getImage("SAMPLE", GIFFILE)); 
    6262        initGUI(); 
    6363    } 
     
    231231        cLabel7LData.verticalAlignment = GridData.FILL; 
    232232        cLabel7.setText("Properties"); 
    233         cLabel7.setImage(ResourceManager.getImage("PROP_PS", GIFFILE)); 
     233        cLabel7.setImage(DWTResourceManager.getImage("PROP_PS", GIFFILE)); 
    234234        cLabel7.setForeground(getDisplay().getSystemColor(DWT.COLOR_WHITE)); 
    235235        cLabel7.setLayoutData(cLabel7LData); 
     
    241241 
    242242        with(new ToolItem(toolBar, DWT.NONE)) { 
    243             setImage(ResourceManager.getImage("VIEW_MENU", GIFFILE)); 
     243            setImage(DWTResourceManager.getImage("VIEW_MENU", GIFFILE)); 
    244244        } 
    245245 
    246246        with(new ToolItem(toolBar, DWT.NONE)) { 
    247             setImage(ResourceManager.getImage("CLOSE_VIEW", GIFFILE)); 
     247            setImage(DWTResourceManager.getImage("CLOSE_VIEW", GIFFILE)); 
    248248        } 
    249249 
     
    359359         
    360360        newToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 
    361         newToolItem.setImage(ResourceManager.getImage("NEW_WIZ", GIFFILE)); 
     361        newToolItem.setImage(DWTResourceManager.getImage("NEW_WIZ", GIFFILE)); 
    362362         
    363363        // java like anonymous class, remember to introduce  
     
    373373         
    374374        ToolItem toolItem6 = new ToolItem(toolBar, DWT.NONE); 
    375         toolItem6.setImage(ResourceManager.getImage("SAVEAS_EDIT", GIFFILE)); 
     375        toolItem6.setImage(DWTResourceManager.getImage("SAVEAS_EDIT", GIFFILE)); 
    376376 
    377377        ToolItem toolItem5 = new ToolItem(toolBar, DWT.NONE); 
    378         toolItem5.setImage(ResourceManager.getImage("SAVE_EDIT", GIFFILE)); 
     378        toolItem5.setImage(DWTResourceManager.getImage("SAVE_EDIT", GIFFILE)); 
    379379 
    380380        ToolItem toolItem8 = new ToolItem(toolBar, DWT.NONE); 
    381         toolItem8.setImage(ResourceManager.getImage("PRINT_EDIT", GIFFILE)); 
     381        toolItem8.setImage(DWTResourceManager.getImage("PRINT_EDIT", GIFFILE)); 
    382382 
    383383        new ToolItem(toolBar, DWT.SEPARATOR); 
    384384 
    385385        ToolItem toolItem13 = new ToolItem(toolBar, DWT.NONE); 
    386         toolItem13.setImage(ResourceManager.getImage("BUILD_EXEC", GIFFILE)); 
     386        toolItem13.setImage(DWTResourceManager.getImage("BUILD_EXEC", GIFFILE)); 
    387387         
    388388         
    389389        debugToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 
    390390        debugToolItem.handleSelection(this, &debugToolItemWidgetSelected); 
    391         debugToolItem.setImage(ResourceManager.getImage("DEBUG_EXEC", GIFFILE)); 
     391        debugToolItem.setImage(DWTResourceManager.getImage("DEBUG_EXEC", GIFFILE)); 
    392392         
    393393        runToolItem = new ToolItem(toolBar, DWT.DROP_DOWN); 
    394         runToolItem.setImage(ResourceManager.getImage("RUN_EXEC", GIFFILE)); 
     394        runToolItem.setImage(DWTResourceManager.getImage("RUN_EXEC", GIFFILE)); 
    395395        runToolItem.handleSelection(this, &runToolItemWidgetSelected);           
    396396    } 
     
    435435        cLabel5.setBackground(getDisplay().getSystemColor(DWT.COLOR_WIDGET_BACKGROUND)); 
    436436        cLabel5.setText("Hierarchy Test"); 
    437         cLabel5.setImage(ResourceManager.getImage("SAMPLE", GIFFILE)); 
     437        cLabel5.setImage(DWTResourceManager.getImage("SAMPLE", GIFFILE)); 
    438438        cLabel5.setLayoutData(cLabel5LData); 
    439439 
     
    481481        TreeItem treeItem7 = new TreeItem(tree3, DWT.NONE); 
    482482        treeItem7.setText("testPackage"); 
    483         treeItem7.setImage(ResourceManager.getImage("PACKAGE", GIFFILE)); 
     483        treeItem7.setImage(DWTResourceManager.getImage("PACKAGE", GIFFILE)); 
    484484        treeItem7.setExpanded(true); 
    485485 
    486486        TreeItem treeItem8 = new TreeItem(treeItem7, DWT.NONE); 
    487487        treeItem8.setText("Class1"); 
    488         treeItem8.setImage(ResourceManager.getImage("JCU_OBJ", GIFFILE)); 
     488        treeItem8.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 
    489489 
    490490        TreeItem treeItem9 = new TreeItem(treeItem7, DWT.NONE); 
    491491        treeItem9.setText("Class2"); 
    492         treeItem9.setImage(ResourceManager.getImage("JCU_OBJ", GIFFILE)); 
     492        treeItem9.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 
    493493 
    494494        CLabel cLabel4 = new CLabel(composite9, DWT.NONE); 
     
    498498        cLabel4LData.grabExcessHorizontalSpace = true; 
    499499        cLabel4.setText("Package Explorer"); 
    500         cLabel4.setImage(ResourceManager.getImage("PACKAGE", GIFFILE)); 
     500        cLabel4.setImage(DWTResourceManager.getImage("PACKAGE", GIFFILE)); 
    501501        cLabel4.setLayoutData(cLabel4LData); 
    502502 
     
    506506 
    507507        ToolItem toolItem3 = new ToolItem(toolBar5, DWT.NONE); 
    508         toolItem3.setImage(ResourceManager.getImage("VIEW_MENU", GIFFILE)); 
     508        toolItem3.setImage(DWTResourceManager.getImage("VIEW_MENU", GIFFILE)); 
    509509 
    510510        ToolItem toolItem4 = new ToolItem(toolBar5, DWT.NONE); 
    511         toolItem4.setImage(ResourceManager.getImage("close_view", GIFFILE)); 
     511        toolItem4.setImage(DWTResourceManager.getImage("close_view", GIFFILE)); 
    512512 
    513513        cTabFolder_topleft.setSelection(0); 
     
    522522        CTabItem cTabItem6 = new CTabItem(cTabFolder_topright, DWT.NONE); 
    523523        cTabItem6.setText("  FakeJava.java  "); 
    524         cTabItem6.setImage(ResourceManager.getImage("JCU_OBJ", GIFFILE)); 
     524        cTabItem6.setImage(DWTResourceManager.getImage("JCU_OBJ", GIFFILE)); 
    525525 
    526526        CTabItem cTabItem7 = new CTabItem(cTabFolder_topright, DWT.NONE); 
    527527        cTabItem7.setText("  FakeJava.form  "); 
    528         cTabItem7.setImage(ResourceManager.getImage("FORM", GIFFILE)); 
     528        cTabItem7.setImage(DWTResourceManager.getImage("FORM", GIFFILE)); 
    529529 
    530530        ScrolledComposite scrolledComposite1 = new ScrolledComposite( 
     
    607607                setText("&Save"); 
    608608                handleSelection(this, &onMenuSelected); 
    609                 setImage(ResourceManager.getImage("SAVE", GIFFILE)); 
     609                setImage(DWTResourceManager.getImage("SAVE", GIFFILE)); 
    610610            } 
    611611            // exit  
  • trunk/current/win32/packages/dwt/examples/traytest/Traytest.d

    r76 r92  
    160160 
    161161        // Install a timer to animate icons  
    162         // ResourceManager helps to dispose images when shell disposing 
    163         ResourceManager.registerResourceUser(shell); 
    164         images  ~= ResourceManager.getImage("TARGET", "GIFFILE"); 
    165         images  ~= ResourceManager.getImage("OPENFOLDER", "GIFFILE"); 
    166         images  ~= ResourceManager.getImage("CLOSEDFOLDER", "GIFFILE"); 
     162        // DWTResourceManager helps to dispose images when shell disposing 
     163        DWTResourceManager.registerResourceUser(shell); 
     164        images  ~= DWTResourceManager.getImage("TARGET", "GIFFILE"); 
     165        images  ~= DWTResourceManager.getImage("OPENFOLDER", "GIFFILE"); 
     166        images  ~= DWTResourceManager.getImage("CLOSEDFOLDER", "GIFFILE"); 
    167167         
    168168        void delegate(Object) pfunc = &onTimer;