Changeset 136


Ignore:
Timestamp:
May 14, 2009, 11:38:40 PM (16 years ago)
Author:
lpino
Message:

More changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Display.java

    r134 r136  
    109109    PSZ windowClass;
    110110    // Two vars below are intentionally commented. See comments inside init().
    111 //    int threadId, processId;
     111    int threadId, processId;
    112112    static int windowClassCount = 0;
    113113    static final String WindowName = "SWT_Window";
     
    141141    int hwndShell;
    142142    /* System Fonts */
    143 //    int [] systemFonts;
     143    int [] systemFonts;
    144144
    145145    /* Image list cache */
     
    831831 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
    832832 * </ul>
    833  */
    834 //@@TODO (dmik): 
    835 //public int getIconDepth () {
    836 //    checkDevice ();
    837 //
    838 //    /* Use the character encoding for the default locale */
    839 //    TCHAR buffer1 = new TCHAR (0, "Control Panel\\Desktop\\WindowMetrics", true);
    840 //
    841 //    int [] phkResult = new int [1];
    842 //    int result = OS.RegOpenKeyEx (OS.HKEY_CURRENT_USER, buffer1, 0, OS.KEY_READ, phkResult);
    843 //    if (result != 0) return 4;
    844 //    int depth = 4;
    845 //    int [] lpcbData = {128};
    846 //
    847 //    /* Use the character encoding for the default locale */
    848 //    TCHAR lpData = new TCHAR (0, lpcbData [0]);
    849 //    TCHAR buffer2 = new TCHAR (0, "Shell Icon BPP", true);
    850 //
    851 //    result = OS.RegQueryValueEx (phkResult [0], buffer2, 0, null, lpData, lpcbData);
    852 //    if (result == 0) {
    853 //        try {
    854 //            depth = Integer.parseInt (lpData.toString (0, lpData.strlen ()));
    855 //        } catch (NumberFormatException e) {};
    856 //    }
    857 //    OS.RegCloseKey (phkResult [0]);
    858 //    return depth;
    859 //}
     833 */
     834public int getIconDepth () {
     835    checkDevice ();
     836    GCData hpsData = new GCData();
     837    int hps = internal_new_GC (hpsData);
     838    int colorInfo[] = new int [2];
     839    OS.DevQueryCaps (hpsData.hdc, OS.CAPS_COLOR_PLANES, 2, colorInfo);
     840    internal_dispose_GC (hps, hpsData);
     841    return colorInfo [0] * colorInfo [1];
     842}
    860843//
    861844//ImageList getImageList (Point size) {
     
    10581041//        case SWT.COLOR_WIDGET_LIGHT_SHADOW:     pixel = OS.GetSysColor (OS.COLOR_3DLIGHT);      break;
    10591042//        case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: pixel = OS.GetSysColor (OS.COLOR_3DHIGHLIGHT);  break;
    1060 //        case SWT.COLOR_WIDGET_BACKGROUND:       pixel = OS.GetSysColor (OS.COLOR_3DFACE);   break;
     1043        case SWT.COLOR_WIDGET_BACKGROUND:       pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_DIALOGBACKGROUND,0);   break;
    10611044        case SWT.COLOR_WIDGET_BORDER:       pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_WINDOWFRAME,0);   break;
    10621045//        case SWT.COLOR_WIDGET_FOREGROUND:
     
    11481131    OS.objcpy (pib, ppib[0]);
    11491132//    threadId = tib.tib_ptib2.tib2_ultid;
    1150 //    processId = pib.pib_ulpid;
     1133    processId = pib.pib_ulpid;
    11511134   
    11521135    /* "Morph" the current process to PM mode if not already in it */
     
    11871170//@@TODO (dmik):
    11881171//    /* Initialize the system font */
    1189 //    int systemFont = 0;
     1172    int systemFont = 0;
    11901173//    if (!OS.IsWinCE) {
    11911174//        NONCLIENTMETRICS info = new NONCLIENTMETRICS ();
     
    11971180//    if (systemFont == 0) systemFont = OS.GetStockObject (OS.DEFAULT_GUI_FONT);
    11981181//    if (systemFont == 0) systemFont = OS.GetStockObject (OS.SYSTEM_FONT);
    1199 //    if (systemFont != 0) systemFonts = new int [] {systemFont};
     1182    if (systemFont != 0) systemFonts = new int [] {systemFont};
    12001183
    12011184    /* Create the message only HWND */
     
    14381421    /* Release the system fonts */
    14391422//@@TODO (dmik): later   
    1440 //    if (systemFonts != null) {
     1423    if (systemFonts != null) {
    14411424//        for (int i=0; i<systemFonts.length; i++) {
    14421425//            if (systemFonts [i] != 0) OS.DeleteObject (systemFonts [i]);
    14431426//        }
    1444 //    }
    1445 //    systemFonts = null;
     1427    }
     1428    systemFonts = null;
    14461429
    14471430    /* Release Custom Colors for ChooseColor */
     
    16521635//    checkDevice ();
    16531636//    if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
    1654 //    OS.SetCursorPos (point.x, point.y);
     1637//    OS.SetCursorPos (point.x, point.y); WinSetPointerPos
    16551638//}
    16561639
Note: See TracChangeset for help on using the changeset viewer.