changeset 4106:a843ce9d77ea

[gaim-migrate @ 4321] code re-org committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Fri, 20 Dec 2002 18:10:17 +0000
parents e92d7712b8ba
children 06435b94c3d7
files src/win32/systray.c src/win32/win32dep.c
diffstat 2 files changed, 80 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/src/win32/systray.c	Fri Dec 20 18:08:47 2002 +0000
+++ b/src/win32/systray.c	Fri Dec 20 18:10:17 2002 +0000
@@ -370,59 +370,6 @@
 }
 
 /*
- * GAIM WINDOW FILTERS 
- **********************/
-
-static GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
-
-	MSG *msg = (MSG*)xevent;
-
-	switch( msg->message ) {
-	case WM_SYSCOMMAND:
-		if( msg->wParam == SC_MINIMIZE ) {
-			hide_buddy_list();
-			return GDK_FILTER_REMOVE;
-		}
-		break;
-	case WM_CLOSE:
-		hide_buddy_list();
-		return GDK_FILTER_REMOVE;
-	}
-
-	return GDK_FILTER_CONTINUE;
-}
-
-static GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
-	MSG *msg = (MSG*)xevent;
-
-	switch( msg->message ) {
-	case WM_CLOSE:
-		wgaim_systray_minimize(mainwindow);
-		gtk_widget_hide(mainwindow);
-		return GDK_FILTER_REMOVE;
-	}
-
-	return GDK_FILTER_CONTINUE;
-}
-
-static GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
-	MSG *msg = (MSG*)xevent;
-
-	switch( msg->message ) {
-	case WM_SYSCOMMAND:
-		if( msg->wParam == SC_MINIMIZE ) {
-			if(imaway) {
-				wgaim_systray_minimize(imaway);
-				gtk_widget_hide(imaway);
-			}
-			return GDK_FILTER_REMOVE;
-		}
-		break;
-	}
-	return GDK_FILTER_CONTINUE;
-}
-
-/*
  * GAIM EVENT CALLBACKS
  ***********************/
 
@@ -450,6 +397,60 @@
  *  PUBLIC CODE
  */
 
+/*
+ * GAIM WINDOW FILTERS 
+ **********************/
+
+GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
+
+	MSG *msg = (MSG*)xevent;
+
+	switch( msg->message ) {
+	case WM_SYSCOMMAND:
+		if( msg->wParam == SC_MINIMIZE ) {
+			hide_buddy_list();
+			return GDK_FILTER_REMOVE;
+		}
+		break;
+	case WM_CLOSE:
+		hide_buddy_list();
+		return GDK_FILTER_REMOVE;
+	}
+
+	return GDK_FILTER_CONTINUE;
+}
+
+GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
+	MSG *msg = (MSG*)xevent;
+
+	switch( msg->message ) {
+	case WM_CLOSE:
+		wgaim_systray_minimize(mainwindow);
+		gtk_widget_hide(mainwindow);
+		return GDK_FILTER_REMOVE;
+	}
+
+	return GDK_FILTER_CONTINUE;
+}
+
+GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) {
+	MSG *msg = (MSG*)xevent;
+
+	switch( msg->message ) {
+	case WM_SYSCOMMAND:
+		if( msg->wParam == SC_MINIMIZE ) {
+			if(imaway) {
+				wgaim_systray_minimize(imaway);
+				gtk_widget_hide(imaway);
+			}
+			return GDK_FILTER_REMOVE;
+		}
+		break;
+	}
+	return GDK_FILTER_CONTINUE;
+}
+
+
 /* Create a hidden window and associate it with the systray icon.
    We use this hidden window to proccess WM_TRAYMESSAGE msgs. */
 void wgaim_systray_init(void) {
@@ -484,26 +485,6 @@
 	DestroyWindow(systray_hwnd);
 }
 
-/* This function is called after the buddy list has been created */
-void wgaim_created_blistwin( GtkWidget *blist ) {
-	gdk_window_add_filter (GTK_WIDGET(blist)->window,
-			       st_buddywin_filter,
-			       NULL);
-}
-
-/* This function is called after the login window has been created */
-void wgaim_created_loginwin( GtkWidget *loginwin ) {
-	gdk_window_add_filter (GTK_WIDGET(loginwin)->window,
-			       st_loginwin_filter,
-			       NULL);
-}
-
-void wgaim_created_backwin( GtkWidget *backwin ) {
-	gdk_window_add_filter (GTK_WIDGET(backwin)->window,
-			       st_backwin_filter,
-			       NULL);
-}
-
 void wgaim_systray_minimize( GtkWidget *window ) {
 	MinimizeWndToTray(GDK_WINDOW_HWND(window->window));
 }
--- a/src/win32/win32dep.c	Fri Dec 20 18:08:47 2002 +0000
+++ b/src/win32/win32dep.c	Fri Dec 20 18:10:17 2002 +0000
@@ -54,6 +54,11 @@
 BOOL (*MyFlashWindowEx)(PFLASHWINFO pfwi)=NULL;
 FARPROC wgaim_find_and_loadproc(char*, char*);
 
+/* Gaim window filters from systray.c */
+extern GdkFilterReturn st_buddywin_filter(GdkXEvent*, GdkEvent*, gpointer);
+extern GdkFilterReturn st_loginwin_filter(GdkXEvent*, GdkEvent*, gpointer);
+extern GdkFilterReturn st_backwin_filter(GdkXEvent*, GdkEvent*, gpointer);
+
 /*
  *  STATIC CODE
  */
@@ -118,6 +123,27 @@
 	}
 }
 
+/*
+ *  These functions are called after their respective windows are created.
+ */
+void wgaim_created_blistwin( GtkWidget *blist ) {
+	gdk_window_add_filter (GTK_WIDGET(blist)->window,
+			       st_buddywin_filter,
+			       NULL);
+}
+
+void wgaim_created_loginwin( GtkWidget *loginwin ) {
+	gdk_window_add_filter (GTK_WIDGET(loginwin)->window,
+			       st_loginwin_filter,
+			       NULL);
+}
+
+void wgaim_created_backwin( GtkWidget *backwin ) {
+	gdk_window_add_filter (GTK_WIDGET(backwin)->window,
+			       st_backwin_filter,
+			       NULL);
+}
+
 /* Determine Gaim Paths during Runtime */
 
 char* wgaim_install_dir(void) {