changeset 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 6028f787f7c8
children 656de0c52c56
files dw.h gtk/dw.c os2/dw.c win/dw.c
diffstat 4 files changed, 12 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Thu Oct 24 05:39:00 2002 +0000
+++ b/dw.h	Thu Oct 24 15:53:27 2002 +0000
@@ -290,7 +290,6 @@
 	int realid;
 } NotebookPage;
 
-typedef unsigned long HAB;
 typedef HANDLE HMTX;
 typedef HANDLE HEV;
 
@@ -473,7 +472,6 @@
 #define HWND_DESKTOP             ((HWND)0)
 
 typedef GtkWidget *HWND;
-typedef void *HAB;
 #ifndef _ENVRNMNT_H
 typedef unsigned long ULONG;
 #endif
@@ -606,7 +604,7 @@
 #else
 int dw_init(int newthread, int argc, char *argv[]);
 #endif
-void dw_main(HAB currenthab, void *filterfunc);
+void dw_main(void);
 void dw_main_sleep(int seconds);
 void dw_free(void *ptr);
 int dw_window_show(HWND handle);
--- a/gtk/dw.c	Thu Oct 24 05:39:00 2002 +0000
+++ b/gtk/dw.c	Thu Oct 24 15:53:27 2002 +0000
@@ -782,12 +782,8 @@
 
 /*
  * Runs a message loop for Dynamic Windows.
- * Parameters:
- *           currenthab: The handle to the current anchor block
- *                       or NULL if this DW is handling the message loop.
- *           func: Function pointer to the message filter function.
- */
-void dw_main(HAB currenthab, void *func)
+ */
+void dw_main(void)
 {
 	_dw_thread = pthread_self();
 	_dw_thread_add(_dw_thread);
--- a/os2/dw.c	Thu Oct 24 05:39:00 2002 +0000
+++ b/os2/dw.c	Thu Oct 24 15:53:27 2002 +0000
@@ -33,11 +33,6 @@
 char SplitbarClassName[] = "dwsplitbar";
 char DefaultFont[] = "9.WarpSans";
 
-/* this is the callback handle for the window procedure
- * make sure you always match the calling convention!
- */
-int (* EXPENTRY filterfunc)(HWND, ULONG, MPARAM, MPARAM) = 0L;
-
 HAB dwhab = 0;
 HMQ dwhmq = 0;
 DWTID _dwtid = 0;
@@ -2097,10 +2092,7 @@
 	static int command_active = 0;
 	void (* windowfunc)(PVOID) = 0L;
 
-	if(filterfunc)
-		result = filterfunc(hWnd, msg, mp1, mp2);
-
-	if(result == -1 && !command_active)
+	if(!command_active)
 	{
         /* Make sure we don't end up in infinite recursion */
 		command_active = 1;
@@ -2804,38 +2796,22 @@
 
 /*
  * Runs a message loop for Dynamic Windows.
- * Parameters:
- *           currenthab: The handle to the current anchor block
- *                       or NULL if this DW is handling the message loop.
- *           func: Function pointer to the message filter function.
- */
-void dw_main(HAB currenthab, void *func)
+ */
+void dw_main(void)
 {
 	QMSG qmsg;
-	HAB habtouse;
-
-	if(!currenthab)
-		habtouse = dwhab;
-	else
-		habtouse = currenthab;
-
-	/* Setup the filter function */
-	filterfunc = (int (* EXPENTRY)(HWND, ULONG, MPARAM, MPARAM))func;
 
 	_dwtid = dw_thread_id();
 
-	while (WinGetMsg(habtouse, &qmsg, 0, 0, 0))
-		WinDispatchMsg(habtouse, &qmsg);
+	while (WinGetMsg(dwhab, &qmsg, 0, 0, 0))
+		WinDispatchMsg(dwhab, &qmsg);
 
 #ifdef DWDEBUG
 	fclose(f);
 #endif
 
-	if(!currenthab)
-	{
-		WinDestroyMsgQueue(dwhmq);
-		WinTerminate(dwhab);
-	}
+	WinDestroyMsgQueue(dwhmq);
+	WinTerminate(dwhab);
 }
 
 /*
--- a/win/dw.c	Thu Oct 24 05:39:00 2002 +0000
+++ b/win/dw.c	Thu Oct 24 15:53:27 2002 +0000
@@ -18,10 +18,6 @@
 #include <time.h>
 #include "dw.h"
 
-/* this is the callback handle for the window procedure */
-/* make sure you always match the calling convention! */
-int (*filterfunc)(HWND, UINT, WPARAM, LPARAM) = 0L;
-
 HWND popup = (HWND)NULL, hwndBubble = (HWND)NULL, hwndBubbleLast, DW_HWND_OBJECT = (HWND)NULL;
 
 HINSTANCE DWInstance = NULL;
@@ -1185,9 +1181,6 @@
 	if(msg == WM_HSCROLL)
 		msg = WM_VSCROLL;
 
-	if(filterfunc)
-		result = filterfunc(hWnd, msg, mp1, mp2);
-
 	if(result == -1)
 	{
 		/* Avoid infinite recursion */
@@ -2782,18 +2775,11 @@
 
 /*
  * Runs a message loop for Dynamic Windows.
- * Parameters:
- *           currenthab: The handle to the current anchor block
- *                       or NULL if this DW is handling the message loop.
- *           func: Function pointer to the message filter function.
- */
-void dw_main(HAB currenthab, void *func)
+ */
+void dw_main(void)
 {
 	MSG msg;
 
-	/* Setup the filter function */
-	filterfunc = func;
-
 	_dwtid = dw_thread_id();
 
 	while (GetMessage(&msg, NULL, 0, 0))