[gtetrinet] Remove deprecated GTK+ symbols.



commit b034b04cedd30d37250aa5a3a53d33ff944c955b
Author: Prema S <premum gmail com>
Date:   Mon May 2 13:05:22 2011 +0200

    Remove deprecated GTK+ symbols.
    
    Remove all GTK+ deprecated symbols except for gtk_draw_drawable and
    gdk_bitmap_create_from_data. Other libgnome usage also remains.
    
    Partially fixes #595381.
    
    Signed-off-by: Jordi Mallach <jordi sindominio net>
    Signed-off-by: Ignacio Casal Quinteiro <icq gnome org>

 src/dialogs.c   |   12 ++++++------
 src/gtetrinet.c |    4 ++--
 src/misc.c      |    2 +-
 src/tetrinet.c  |   37 +++++++++++++++++++------------------
 4 files changed, 28 insertions(+), 27 deletions(-)
---
diff --git a/src/dialogs.c b/src/dialogs.c
index 8f19320..0d63305 100644
--- a/src/dialogs.c
+++ b/src/dialogs.c
@@ -54,7 +54,7 @@ void connectingdialog_button (GtkWidget *dialog, gint button)
     dialog = dialog;
     switch (button) {
     case GTK_RESPONSE_CANCEL:
-        gtk_timeout_remove (timeouttag);
+        g_source_remove (timeouttag);
         timeouttag = 0;
         if (connectingdialog == 0) return;
         client_disconnect ();
@@ -93,8 +93,8 @@ void connectingdialog_new (void)
     gtk_box_pack_start (GTK_BOX (GTK_DIALOG(connectingdialog)->vbox),
                         progressbar, TRUE, TRUE, 0);
 
-    timeouttag = gtk_timeout_add (20, (GtkFunction)connectingdialog_timeout,
-                                  NULL);
+    timeouttag = g_timeout_add (20, (GtkFunction)connectingdialog_timeout,
+                                NULL);
     g_signal_connect (G_OBJECT(connectingdialog), "response",
                         GTK_SIGNAL_FUNC(connectingdialog_button), NULL);
     g_signal_connect (G_OBJECT(connectingdialog), "delete_event",
@@ -163,15 +163,15 @@ void teamdialog_new (void)
     /* entry and label */
     hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
     widget = gtk_label_new (_("Team name:"));
-    gtk_box_pack_start_defaults (GTK_BOX (hbox), widget);
+    gtk_box_pack_start (GTK_BOX (hbox), widget ,TRUE, TRUE, 0);
     entry = gnome_entry_new ("Team");
     gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
                         team_utf8);
     g_object_set (G_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
                   "activates_default", TRUE, NULL);
-    gtk_box_pack_start_defaults (GTK_BOX (hbox), entry);
+    gtk_box_pack_start (GTK_BOX (hbox), entry  ,TRUE, TRUE, 0);
     gtk_container_set_border_width (GTK_CONTAINER (hbox), GNOME_PAD_SMALL);
-    gtk_box_pack_end_defaults (GTK_BOX (GTK_DIALOG (team_dialog)->vbox), hbox);
+    gtk_box_pack_end (GTK_BOX (GTK_DIALOG (team_dialog)->vbox), hbox ,TRUE, TRUE, 0);
 
     /* pass the entry in the data pointer */
     g_signal_connect (G_OBJECT(team_dialog), "response",
diff --git a/src/gtetrinet.c b/src/gtetrinet.c
index dbac787..4450dd5 100644
--- a/src/gtetrinet.c
+++ b/src/gtetrinet.c
@@ -419,7 +419,7 @@ gint keypress (GtkWidget *widget, GdkEventKey *key)
     if (game_area)
     { /* keys for the playing field - key releases needed - install timeout */
       if (keytimeoutid && key->time == k.time)
-        gtk_timeout_remove (keytimeoutid);
+        g_source_remove (keytimeoutid);
     }
 
     /* Check if it's a GTetrinet key */
@@ -472,7 +472,7 @@ gint keyrelease (GtkWidget *widget, GdkEventKey *key)
     if (game_area)
     {
         k = *key;
-        keytimeoutid = gtk_timeout_add (10, keytimeout, 0);
+        keytimeoutid = g_timeout_add (10, keytimeout, 0);
         g_signal_stop_emission_by_name (G_OBJECT(widget), "key-release-event");
         return TRUE;
     }
diff --git a/src/misc.c b/src/misc.c
index db0c51f..4a48f3c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -286,7 +286,7 @@ void adjust_bottom_text_view (GtkTextView *tv)
   if (!g_list_find(adj_list, tv))
   {
     if (!adj_list)
-      gtk_idle_add(cb_adjust_bottom, adj_list);
+      g_idle_add (cb_adjust_bottom, adj_list);
     
     adj_list = g_list_append(adj_list, tv);
   }
diff --git a/src/tetrinet.c b/src/tetrinet.c
index 8dbb36e..635c795 100644
--- a/src/tetrinet.c
+++ b/src/tetrinet.c
@@ -1504,9 +1504,9 @@ void tetrinet_playerlost (void)
     sound_playsound (S_YOULOSE);
     /* end timeout thingies */
     if (movedowntimeout)
-        gtk_timeout_remove (movedowntimeout);
+        g_source_remove (movedowntimeout);
     if (nextblocktimeout)
-        gtk_timeout_remove (nextblocktimeout);
+        g_source_remove (nextblocktimeout);
     movedowntimeout = nextblocktimeout = 0;
     tetris_makeblock (-1, 0);
 }
@@ -1521,9 +1521,9 @@ void tetrinet_endgame (void)
     sound_stopmidi ();
     ingame = playing = FALSE;
     if (movedowntimeout)
-        gtk_timeout_remove (movedowntimeout);
+        g_source_remove (movedowntimeout);
     if (nextblocktimeout)
-        gtk_timeout_remove (nextblocktimeout);
+        g_source_remove (nextblocktimeout);
     movedowntimeout = nextblocktimeout = 0;
     tetris_makeblock (-1, 0);
     fields_drawnextblock (blankblock);
@@ -1568,15 +1568,15 @@ void tetrinet_updatelevels (void)
 void tetrinet_settimeout (int duration)
 {
     if (movedowntimeout)
-        gtk_timeout_remove (movedowntimeout);
-    movedowntimeout = gtk_timeout_add (duration, (GtkFunction)tetrinet_timeout,
-                                       NULL);
+        g_source_remove (movedowntimeout);
+    movedowntimeout = g_timeout_add (duration, (GtkFunction)tetrinet_timeout,
+                                     NULL);
 }
 
 void tetrinet_removetimeout (void)
 {
     if (movedowntimeout)
-        gtk_timeout_remove (movedowntimeout);
+        g_source_remove (movedowntimeout);
     movedowntimeout = 0;
 }
 
@@ -1615,8 +1615,8 @@ void tetrinet_nextblock (void)
     if (nextblocktimeout) return;
     tetrinet_removetimeout ();
     nextblocktimeout =
-        gtk_timeout_add ( (btrixgame ? 0 : NEXTBLOCKDELAY),
-                (GtkFunction)tetrinet_nextblocktimeout, NULL);
+        g_timeout_add ((btrixgame ? 0 : NEXTBLOCKDELAY),
+                       (GtkFunction)tetrinet_nextblocktimeout, NULL);
 }
 
 gint tetrinet_nextblocktimeout (void)
@@ -1690,8 +1690,8 @@ int tetrinet_removelines ()
         /* end of if */ ;
     }
     /* give it a little delay in drawing */
-    gtk_timeout_add (40, (GtkFunction)tetrinet_removelinestimeout,
-                     NULL);
+    g_timeout_add (40, (GtkFunction)tetrinet_removelinestimeout,
+                   NULL);
     return sound;
 }
 
@@ -1890,14 +1890,15 @@ void moderatorupdate (int now)
 {
     if (now) {
         if (mutimeout) {
-            gtk_timeout_remove (mutimeout);
+            g_source_remove (mutimeout);
             moderatorupdate_timeout ();
         }
     }
     else {
         if (mutimeout)
-            gtk_timeout_remove (mutimeout);
-        mutimeout = gtk_timeout_add (PARTYLINEDELAY2, (GtkFunction)moderatorupdate_timeout, NULL);
+            g_source_remove (mutimeout);
+        mutimeout = g_timeout_add (PARTYLINEDELAY2,
+                                   (GtkFunction)moderatorupdate_timeout, NULL);
     }
 }
 
@@ -1982,12 +1983,12 @@ int partylineupdate_timeout (void)
 
 void partylineupdate (int now)
 {
-    if (putimeout) gtk_timeout_remove (putimeout);
+    if (putimeout) g_source_remove (putimeout);
     if (now)
         partylineupdate_timeout ();
     else
-        putimeout = gtk_timeout_add (PARTYLINEDELAY1, (GtkFunction)partylineupdate_timeout,
-                                     NULL);
+        putimeout = g_timeout_add (PARTYLINEDELAY1, (GtkFunction)partylineupdate_timeout,
+                                   NULL);
 }
 
 void partylineupdate_join (char *name)



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