Show
Ignore:
Timestamp:
05/17/08 11:34:28 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.4M7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/internal/BidiUtil.d

    r212 r213  
    1818import dwt.internal.win32.OS; 
    1919 
     20import dwt.widgets.Control; 
    2021import tango.util.Convert; 
    2122import dwt.dwthelper.utils; 
     
    113114    subclass(hwnd); 
    114115} 
     116public static void addLanguageListener (Control control, Runnable runnable) { 
     117    addLanguageListener(control.handle, runnable); 
     118} 
    115119/** 
    116120 * Proc used for OS.EnumSystemLanguageGroups call during isBidiPlatform test. 
     
    408412public static int getKeyboardLanguage() { 
    409413    int layout = cast(int) OS.GetKeyboardLayout(0); 
    410     // only interested in low 2 bytes, which is the primary 
    411     // language identifier 
    412     layout = layout & 0x000000FF; 
    413     if (layout is LANG_HEBREW) return KEYBOARD_BIDI; 
    414     if (layout is LANG_ARABIC) return KEYBOARD_BIDI; 
     414    int langID = OS.PRIMARYLANGID(OS.LOWORD(layout)); 
     415    if (langID is LANG_HEBREW) return KEYBOARD_BIDI; 
     416    if (langID is LANG_ARABIC) return KEYBOARD_BIDI; 
    415417    // return non-bidi for all other languages 
    416418    return KEYBOARD_NON_BIDI; 
     
    483485    void*[] list = getKeyboardLanguageList(); 
    484486    for (int i=0; i<list.length; i++) { 
    485         int id = cast(int)list[i] & 0x000000FF
     487        int id = OS.PRIMARYLANGID(OS.LOWORD( cast(int) list[i]))
    486488        if ((id is LANG_ARABIC) || (id is LANG_HEBREW)) { 
    487489            return true; 
     
    499501    languageMap.remove(hwnd); 
    500502    unsubclass(hwnd); 
     503} 
     504public static void removeLanguageListener (Control control) { 
     505    removeLanguageListener(control.handle); 
    501506} 
    502507/** 
     
    518523        // set to first bidi language 
    519524        for (int i=0; i<list.length; i++) { 
    520             int id = cast(int)list[i] & 0x000000FF
     525            int id = OS.PRIMARYLANGID(OS.LOWORD( cast(int) list[i]))
    521526            if ((id is LANG_ARABIC) || (id is LANG_HEBREW)) { 
    522527                OS.ActivateKeyboardLayout(list[i], 0); 
     
    530535        // Hebrew or Arabic) 
    531536        for (int i=0; i<list.length; i++) { 
    532             int id = cast(int)list[i] & 0x000000FF
     537            int id = OS.PRIMARYLANGID(OS.LOWORD( cast(int) list[i]))
    533538            if ((id !is LANG_HEBREW) && (id !is LANG_ARABIC)) { 
    534539                OS.ActivateKeyboardLayout(list[i], 0); 
     
    560565    return true; 
    561566} 
     567public static bool setOrientation (Control control, int orientation) { 
     568    return setOrientation(control.handle, orientation); 
     569} 
    562570/** 
    563571 * Override the window proc. 
     
    568576    HWND key = hwnd; 
    569577    if ( ( key in oldProcMap ) is null) { 
    570         int oldProc = OS.GetWindowLong(hwnd, OS.GWL_WNDPROC); 
     578        int /*long*/ oldProc = OS.GetWindowLongPtr(hwnd, OS.GWLP_WNDPROC); 
    571579        oldProcMap[key] = cast(WNDPROC)oldProc; 
    572580        WNDPROC t = &windowProc; // test signature 
    573         OS.SetWindowLong(hwnd, OS.GWL_WNDPROC, cast(int) &windowProc); 
     581        OS.SetWindowLongPtr(hwnd, OS.GWLP_WNDPROC, cast(LONG_PTR)&windowProc); 
    574582    } 
    575583} 
     
    635643        } 
    636644        if (proc is null) return; 
    637         OS.SetWindowLong(hwnd, OS.GWL_WNDPROC, cast(int)proc ); 
     645        OS.SetWindowLongPtr(hwnd, OS.GWLP_WNDPROC, cast(LONG_PTR) proc ); 
    638646    } 
    639647} 
     
    657665        } 
    658666    auto oldProc = oldProcMap[key]; 
    659     return OS.CallWindowProc ( oldProc, hwnd, msg, wParam, lParam); 
    660 } 
    661  
    662 } 
     667    return oldProc( hwnd, msg, wParam, lParam); 
     668} 
     669 
     670}