Mercurial > dwindows
comparison os2/dw.c @ 150:2a0d7b57a6da
Removed unnecessary parameters from dw_main().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 24 Oct 2002 15:53:27 +0000 |
parents | b479002e013f |
children | 656de0c52c56 |
comparison
equal
deleted
inserted
replaced
149:6028f787f7c8 | 150:2a0d7b57a6da |
---|---|
30 void _do_resize(Box *thisbox, int x, int y); | 30 void _do_resize(Box *thisbox, int x, int y); |
31 | 31 |
32 char ClassName[] = "dynamicwindows"; | 32 char ClassName[] = "dynamicwindows"; |
33 char SplitbarClassName[] = "dwsplitbar"; | 33 char SplitbarClassName[] = "dwsplitbar"; |
34 char DefaultFont[] = "9.WarpSans"; | 34 char DefaultFont[] = "9.WarpSans"; |
35 | |
36 /* this is the callback handle for the window procedure | |
37 * make sure you always match the calling convention! | |
38 */ | |
39 int (* EXPENTRY filterfunc)(HWND, ULONG, MPARAM, MPARAM) = 0L; | |
40 | 35 |
41 HAB dwhab = 0; | 36 HAB dwhab = 0; |
42 HMQ dwhmq = 0; | 37 HMQ dwhmq = 0; |
43 DWTID _dwtid = 0; | 38 DWTID _dwtid = 0; |
44 LONG _foreground = 0xAAAAAA, _background = 0; | 39 LONG _foreground = 0xAAAAAA, _background = 0; |
2095 { | 2090 { |
2096 int result = -1; | 2091 int result = -1; |
2097 static int command_active = 0; | 2092 static int command_active = 0; |
2098 void (* windowfunc)(PVOID) = 0L; | 2093 void (* windowfunc)(PVOID) = 0L; |
2099 | 2094 |
2100 if(filterfunc) | 2095 if(!command_active) |
2101 result = filterfunc(hWnd, msg, mp1, mp2); | |
2102 | |
2103 if(result == -1 && !command_active) | |
2104 { | 2096 { |
2105 /* Make sure we don't end up in infinite recursion */ | 2097 /* Make sure we don't end up in infinite recursion */ |
2106 command_active = 1; | 2098 command_active = 1; |
2107 | 2099 |
2108 result = (int)_run_event(hWnd, msg, mp1, mp2); | 2100 result = (int)_run_event(hWnd, msg, mp1, mp2); |
2802 return rc; | 2794 return rc; |
2803 } | 2795 } |
2804 | 2796 |
2805 /* | 2797 /* |
2806 * Runs a message loop for Dynamic Windows. | 2798 * Runs a message loop for Dynamic Windows. |
2807 * Parameters: | 2799 */ |
2808 * currenthab: The handle to the current anchor block | 2800 void dw_main(void) |
2809 * or NULL if this DW is handling the message loop. | |
2810 * func: Function pointer to the message filter function. | |
2811 */ | |
2812 void dw_main(HAB currenthab, void *func) | |
2813 { | 2801 { |
2814 QMSG qmsg; | 2802 QMSG qmsg; |
2815 HAB habtouse; | |
2816 | |
2817 if(!currenthab) | |
2818 habtouse = dwhab; | |
2819 else | |
2820 habtouse = currenthab; | |
2821 | |
2822 /* Setup the filter function */ | |
2823 filterfunc = (int (* EXPENTRY)(HWND, ULONG, MPARAM, MPARAM))func; | |
2824 | 2803 |
2825 _dwtid = dw_thread_id(); | 2804 _dwtid = dw_thread_id(); |
2826 | 2805 |
2827 while (WinGetMsg(habtouse, &qmsg, 0, 0, 0)) | 2806 while (WinGetMsg(dwhab, &qmsg, 0, 0, 0)) |
2828 WinDispatchMsg(habtouse, &qmsg); | 2807 WinDispatchMsg(dwhab, &qmsg); |
2829 | 2808 |
2830 #ifdef DWDEBUG | 2809 #ifdef DWDEBUG |
2831 fclose(f); | 2810 fclose(f); |
2832 #endif | 2811 #endif |
2833 | 2812 |
2834 if(!currenthab) | 2813 WinDestroyMsgQueue(dwhmq); |
2835 { | 2814 WinTerminate(dwhab); |
2836 WinDestroyMsgQueue(dwhmq); | |
2837 WinTerminate(dwhab); | |
2838 } | |
2839 } | 2815 } |
2840 | 2816 |
2841 /* | 2817 /* |
2842 * Runs a message loop for Dynamic Windows, for a period of milliseconds. | 2818 * Runs a message loop for Dynamic Windows, for a period of milliseconds. |
2843 * Parameters: | 2819 * Parameters: |