[PATCH] removing gtk_timeout_* from gnome-panel



hi

	here is a simple patch that removes the usage of gtk_timeout_* funcions
and replaces them with g_timeout_add and g_source_remove, the patch is
agains gnome-panel HEAD.

regards
Diego


Index: panel-widget.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-widget.c,v
retrieving revision 1.311
diff -u -r1.311 panel-widget.c
--- panel-widget.c	2002/02/25 11:50:34	1.311
+++ panel-widget.c	2002/02/28 16:20:40
@@ -1826,7 +1826,7 @@
 	g_return_if_fail (ad != NULL);
 
 	if (moving_timeout != 0) {
-		gtk_timeout_remove (moving_timeout);
+		g_source_remove (moving_timeout);
 		moving_timeout = 0;
 		been_moved = FALSE;
 	}
@@ -1863,7 +1863,7 @@
 
 	remove_all_move_bindings (panel);
 	if (moving_timeout != 0) {
-		gtk_timeout_remove (moving_timeout);
+		g_source_remove (moving_timeout);
 		moving_timeout = 0;
 		been_moved = FALSE;
 	}
@@ -2284,7 +2284,7 @@
 		been_moved = FALSE;
 		panel_widget_applet_move_to_cursor(panel);
 		moving_timeout =
-			gtk_timeout_add (50, move_timeout_handler, panel);
+			g_timeout_add (50, move_timeout_handler, panel);
 	} else
 		been_moved = TRUE;
 }
Index: session.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/session.c,v
retrieving revision 1.294
diff -u -r1.294 session.c
--- session.c	2002/02/25 11:50:34	1.294
+++ session.c	2002/02/28 16:20:41
@@ -155,7 +155,7 @@
 	int pts = panels_to_sync;
 
 	if (sync_handler != 0) {
-		gtk_timeout_remove (sync_handler);
+		g_source_remove (sync_handler);
 		sync_handler = 0;
 	}
 
@@ -187,7 +187,7 @@
 {
 	if (sync_handler == 0) {
 		/* don't sync for another 30 secs */
-		sync_handler = gtk_timeout_add (30000, sync_handler_timeout, NULL);
+		sync_handler = g_timeout_add (30000, sync_handler_timeout, NULL);
 		sync_handler_needed = FALSE;
 		panel_config_sync ();
 	} else {
@@ -207,7 +207,7 @@
 void
 panel_session_setup_config_sync (void)
 {
-	config_sync_timeout = gtk_timeout_add (10*1000, panel_session_do_sync, NULL);
+	config_sync_timeout = g_timeout_add (10*1000, panel_session_do_sync, NULL);
 }
 
 /* This is called when the session manager requests a shutdown.  It
@@ -253,7 +253,7 @@
 {
 	GSList *l;
 
-	gtk_timeout_remove (config_sync_timeout);
+	g_source_remove (config_sync_timeout);
 	config_sync_timeout = 0;
   
 	status_inhibit = TRUE;
Index: status-docklet.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/status-docklet.c,v
retrieving revision 1.21
diff -u -r1.21 status-docklet.c
--- status-docklet.c	2002/01/10 13:22:40	1.21
+++ status-docklet.c	2002/02/28 16:20:41
@@ -104,7 +104,7 @@
 	docklet = STATUS_DOCKLET(o);
 	
 	if (docklet->timeout_handle != -1)
-		gtk_timeout_remove(docklet->timeout_handle);
+		g_source_remove(docklet->timeout_handle);
 	docklet->timeout_handle = -1;
 	
 	/*if we do have a plug, set the "status_docklet" data to NULL,
@@ -318,12 +318,12 @@
 	g_return_if_fail(IS_STATUS_DOCKLET(docklet));
 
 	if(docklet->timeout_handle != -1)
-		gtk_timeout_remove(docklet->timeout_handle);
+		g_source_remove(docklet->timeout_handle);
 
 	if(!try_getting_plug(docklet)) {
 		docklet->tries ++;
 		if(docklet->tries < docklet->maximum_retries)
-			docklet->timeout_handle = gtk_timeout_add(STATUS_DOCKLET_RETRY_EVERY*1000,
+			docklet->timeout_handle = g_timeout_add(STATUS_DOCKLET_RETRY_EVERY*1000,
 								  try_timeout,docklet);
 		else
 			docklet->tries = 0;
Index: main.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/main.c,v
retrieving revision 1.316
diff -u -r1.316 main.c
--- main.c	2002/02/25 11:50:33	1.316
+++ main.c	2002/02/28 16:20:41
@@ -228,7 +228,7 @@
 	panel_session_setup_config_sync ();
 
 	/* add some timeouts */
-	gtk_timeout_add (10*1000, menu_age_timeout, NULL);
+	g_timeout_add (10*1000, menu_age_timeout, NULL);
 
 	status_applet_create_offscreen ();
 
Index: menu.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/menu.c,v
retrieving revision 1.538
diff -u -r1.538 menu.c
--- menu.c	2002/02/27 11:34:10	1.538
+++ menu.c	2002/02/28 16:20:47
@@ -1434,10 +1434,10 @@
 	g_object_set_data (G_OBJECT (dedit), "apply_timeout", NULL);
 
 	if (timeout != 0)
-		gtk_timeout_remove (timeout);
+		g_source_remove (timeout);
 
 	/* Will save after 5 seconds */
-	timeout = gtk_timeout_add (5 * 1000,
+	timeout = g_timeout_add (5 * 1000,
 				   ditem_properties_apply_timeout,
 				   dedit);
 
@@ -1458,7 +1458,7 @@
 	g_object_set_data (G_OBJECT (dedit), "apply_timeout", NULL);
 
 	if (timeout != 0) {
-		gtk_timeout_remove (timeout);
+		g_source_remove (timeout);
 
 		ditem_properties_apply_timeout (dedit);
 	}
Index: nothing.cP
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/nothing.cP,v
retrieving revision 1.22
diff -u -r1.22 nothing.cP
--- nothing.cP	2002/01/11 07:03:45	1.22
+++ nothing.cP	2002/02/28 16:20:48
@@ -24,7 +24,7 @@
 {
 	goat_pages = 0;
 	if(goat_timeout) {
-		gtk_timeout_remove(goat_timeout);
+		g_source_remove(goat_timeout);
 		goat_timeout = 0;
 	}
 	goat_x = goat_y = -1;
@@ -212,7 +212,7 @@
 					G_CALLBACK (goat_realize),NULL);
 		
 		gtk_widget_show(goat_darea);
-		goat_timeout = gtk_timeout_add(60,goat_timeout_func,NULL);
+		goat_timeout = g_timeout_add(60,goat_timeout_func,NULL);
 		/*the GEGL shall not be translated*/
 		gtk_notebook_append_page (nbook, goat_darea,
 					  gtk_label_new ("GEGL"));
@@ -252,7 +252,7 @@
                 g_object_unref (G_OBJECT (phsh.phsh_mask[i]));
         }
         gdk_window_destroy (phsh.win);
-        gtk_timeout_remove (phsh.handler);
+        g_timeout_remove (phsh.handler);
         memset (&phsh, 0, sizeof (AppletContainer));
 }
 
@@ -339,8 +339,8 @@
 
         if (xevent->type == ButtonPress &&
             ! phsh.hide_mode) {
-                gtk_timeout_remove (phsh.handler);
-                phsh.handler = gtk_timeout_add (90, phsh_move, NULL);
+                g_timeout_remove (phsh.handler);
+                phsh.handler = g_timeout_add (90, phsh_move, NULL);
                 phsh.xs *= 2.0;
                 phsh.ys *= 2.5;
                 phsh.hide_mode = TRUE;
@@ -453,7 +453,7 @@
                                NULL);
 
         gdk_window_show (phsh.win);
-        phsh.handler = gtk_timeout_add (150, phsh_move, NULL);
+        phsh.handler = g_timeout_add (150, phsh_move, NULL);
 }
 
 static guint screen_check_id = 0;
@@ -465,7 +465,7 @@
 
         check_screen ();
 
-        screen_check_id = gtk_timeout_add (rand()%120*1000,
+        screen_check_id = g_timeout_add (rand()%120*1000,
                                            check_screen_timeout, NULL);
         return FALSE;
 }
@@ -474,12 +474,12 @@
 start_screen_check (void)
 {
         if (screen_check_id > 0)
-                gtk_timeout_remove (screen_check_id);
+                g_source_remove (screen_check_id);
 
         screen_check_id = 0;
         check_screen ();
 
-        screen_check_id = gtk_timeout_add (rand()%120*1000, check_screen_timeout, NULL);
+        screen_check_id = g_timeout_add (rand()%120*1000, check_screen_timeout, NULL);
 }
 
 typedef struct {
@@ -1422,7 +1422,7 @@
 	int handler = GPOINTER_TO_INT (data);
 
 	if (handler != 0)
-		gtk_timeout_remove (handler);
+		g_source_remove (handler);
 	g_object_set_data (G_OBJECT (win), "move_window_handler", NULL);
 }
 
@@ -1433,7 +1433,7 @@
 	int handler = GPOINTER_TO_INT (data);
 
 	if (handler == 0) {
-		handler = gtk_timeout_add (30, move_window_handler, window);
+		handler = g_timeout_add (30, move_window_handler, window);
 		data = GINT_TO_POINTER (handler);
 		g_object_set_data (G_OBJECT (window), "move_window_handler", data);
 		g_signal_connect (G_OBJECT (window), "destroy",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]