comparison os2/dw.c @ 1226:d865c29fc06a

Added taskbar support for OS/2 using the System Tray XCenter plugin.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 10 Oct 2011 11:03:43 +0000
parents 70dca53cb071
children 365f92e85771
comparison
equal deleted inserted replaced
1225:f5b79d8b0694 1226:d865c29fc06a
58 HMQ dwhmq = 0; 58 HMQ dwhmq = 0;
59 DWTID _dwtid = 0; 59 DWTID _dwtid = 0;
60 LONG _foreground = 0xAAAAAA, _background = DW_CLR_DEFAULT; 60 LONG _foreground = 0xAAAAAA, _background = DW_CLR_DEFAULT;
61 61
62 HWND hwndApp = NULLHANDLE, hwndBubble = NULLHANDLE, hwndBubbleLast = NULLHANDLE, hwndEmph = NULLHANDLE; 62 HWND hwndApp = NULLHANDLE, hwndBubble = NULLHANDLE, hwndBubbleLast = NULLHANDLE, hwndEmph = NULLHANDLE;
63 HWND hwndTrayServer = NULLHANDLE, hwndTaskBar = NULLHANDLE;
64 ;
63 PRECORDCORE pCoreEmph = NULL; 65 PRECORDCORE pCoreEmph = NULL;
64 ULONG aulBuffer[4]; 66 ULONG aulBuffer[4];
65 HWND lasthcnr = 0, lastitem = 0, popup = 0, desktop; 67 HWND lasthcnr = 0, lastitem = 0, popup = 0, desktop;
66 HMOD wpconfig = 0; 68 HMOD wpconfig = 0;
67 69
3013 /* Delay removing the signal until we've executed 3015 /* Delay removing the signal until we've executed
3014 * the signal handler. 3016 * the signal handler.
3015 */ 3017 */
3016 WinPostMsg(hWnd, WM_USER+2, mp1, mp2); 3018 WinPostMsg(hWnd, WM_USER+2, mp1, mp2);
3017 break; 3019 break;
3020 case WM_DDE_INITIATEACK:
3021 /* aswer dde server */
3022 hwndTrayServer = (HWND)mp1;
3023 break;
3024 case WM_BUTTON1DOWN | 0x2000:
3025 case WM_BUTTON2DOWN | 0x2000:
3026 case WM_BUTTON3DOWN | 0x2000:
3027 case WM_BUTTON1UP | 0x2000:
3028 case WM_BUTTON2UP | 0x2000:
3029 case WM_BUTTON3UP | 0x2000:
3030 if(hwndTaskBar)
3031 result = _run_event(hwndTaskBar, msg & ~0x2000, mp1, mp2);
3032 break;
3018 case WM_USER+2: 3033 case WM_USER+2:
3019 _clear_emphasis(); 3034 _clear_emphasis();
3020 if(dw_window_get_data((HWND)mp2, "_dw_popup")) 3035 if(dw_window_get_data((HWND)mp2, "_dw_popup"))
3021 _free_menu_data((HWND)mp2); 3036 _free_menu_data((HWND)mp2);
3022 break; 3037 break;
3687 3702
3688 /* This is a window that hangs around as long as the 3703 /* This is a window that hangs around as long as the
3689 * application does and handles menu messages. 3704 * application does and handles menu messages.
3690 */ 3705 */
3691 hwndApp = dw_window_new(HWND_OBJECT, "", 0); 3706 hwndApp = dw_window_new(HWND_OBJECT, "", 0);
3707 /* Attempt to locate a tray server */
3708 WinDdeInitiate(hwndApp, "SystrayServer", "TRAY", NULL);
3709
3692 DosLoadModule(objnamebuf, sizeof(objnamebuf), "WPCONFIG", &wpconfig); 3710 DosLoadModule(objnamebuf, sizeof(objnamebuf), "WPCONFIG", &wpconfig);
3693 3711
3694 return rc; 3712 return rc;
3695 } 3713 }
3696 3714
8109 * icon: Icon handle to display in the taskbar. 8127 * icon: Icon handle to display in the taskbar.
8110 * bubbletext: Text to show when the mouse is above the icon. 8128 * bubbletext: Text to show when the mouse is above the icon.
8111 */ 8129 */
8112 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext) 8130 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext)
8113 { 8131 {
8114 handle = handle; 8132 /* Make sure we have our server */
8115 icon = icon; 8133 if(!hwndTrayServer)
8116 bubbletext = bubbletext; 8134 return;
8117 /* TODO */ 8135
8136 WinSendMsg(hwndApp, WM_SETICON, (MPARAM)icon, 0);
8137 hwndTaskBar = handle;
8138 WinPostMsg(hwndTrayServer, WM_USER+1, (MPARAM)hwndApp, (MPARAM)icon);
8118 } 8139 }
8119 8140
8120 /* 8141 /*
8121 * Deletes an icon from the taskbar. 8142 * Deletes an icon from the taskbar.
8122 * Parameters: 8143 * Parameters:
8123 * handle: Window handle that was used with dw_taskbar_insert(). 8144 * handle: Window handle that was used with dw_taskbar_insert().
8124 * icon: Icon handle that was used with dw_taskbar_insert(). 8145 * icon: Icon handle that was used with dw_taskbar_insert().
8125 */ 8146 */
8126 void API dw_taskbar_delete(HWND handle, HICN icon) 8147 void API dw_taskbar_delete(HWND handle, HICN icon)
8127 { 8148 {
8128 handle = handle; 8149 /* Make sure we have our server */
8129 icon = icon; 8150 if(!hwndTrayServer)
8130 /* TODO */ 8151 return;
8152
8153 WinPostMsg(hwndTrayServer, WM_USER+2, (MPARAM)hwndApp, (MPARAM)0);
8154 hwndTaskBar = NULLHANDLE;
8131 } 8155 }
8132 8156
8133 /* 8157 /*
8134 * Creates a rendering context widget (window) to be packed. 8158 * Creates a rendering context widget (window) to be packed.
8135 * Parameters: 8159 * Parameters: