tUse glib-style signals - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
commit 3ba11f24b1b22fb027dba0b64b2b8533284938c1
parent b8b897faa17d39c4d8ab40b7fa0a11614158dd59
Author: Ben Webb 
Date:   Thu, 26 Nov 2020 00:44:49 -0800

Use glib-style signals

Diffstat:
  M src/gtkport/gtkport.c               |      28 ++++++++++++++--------------
  M src/gtkport/gtkport.h               |      11 +++++------

2 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -2619,10 +2619,10 @@ void gtk_check_button_realize(GtkWidget *widget)
                                 widget->allocation.height, Parent, NULL,
                                 hInst, NULL);
   gtk_set_default_font(widget->hWnd);
-  gtk_signal_connect(GTK_OBJECT(widget), "clicked",
-                     gtk_toggle_button_toggled, NULL);
-  gtk_signal_connect(GTK_OBJECT(widget), "toggled",
-                     gtk_check_button_toggled, NULL);
+  g_signal_connect(GTK_OBJECT(widget), "clicked",
+                   gtk_toggle_button_toggled, NULL);
+  g_signal_connect(GTK_OBJECT(widget), "toggled",
+                   gtk_check_button_toggled, NULL);
   toggled = GTK_TOGGLE_BUTTON(widget)->toggled;
   GTK_TOGGLE_BUTTON(widget)->toggled = !toggled;
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), toggled);
t@@ -2643,10 +2643,10 @@ void gtk_radio_button_realize(GtkWidget *widget)
                                 widget->allocation.height, Parent, NULL,
                                 hInst, NULL);
   gtk_set_default_font(widget->hWnd);
-  gtk_signal_connect(GTK_OBJECT(widget), "clicked",
-                     gtk_radio_button_clicked, NULL);
-  gtk_signal_connect(GTK_OBJECT(widget), "toggled",
-                     gtk_radio_button_toggled, NULL);
+  g_signal_connect(GTK_OBJECT(widget), "clicked",
+                   gtk_radio_button_clicked, NULL);
+  g_signal_connect(GTK_OBJECT(widget), "toggled",
+                   gtk_radio_button_toggled, NULL);
   toggled = GTK_TOGGLE_BUTTON(widget)->toggled;
   GTK_TOGGLE_BUTTON(widget)->toggled = !toggled;
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), toggled);
t@@ -3580,8 +3580,8 @@ void gtk_signal_emit(GObject *object, const gchar *name, ...)
     g_warning("gtk_signal_emit: unknown signal %s", name);
 }
 
-guint gtk_signal_connect(GObject *object, const gchar *name,
-                         GtkSignalFunc func, gpointer func_data)
+guint g_signal_connect(GObject *object, const gchar *name,
+                       GtkSignalFunc func, gpointer func_data)
 {
   GtkSignal *signal;
   GtkSignalType *signal_type;
t@@ -3591,7 +3591,7 @@ guint gtk_signal_connect(GObject *object, const gchar *name,
     return 0;
   signal_type = gtk_get_signal_type(object, name);
   if (!signal_type) {
-    g_warning("gtk_signal_connect: unknown signal %s", name);
+    g_warning("g_signal_connect: unknown signal %s", name);
     return 0;
   }
   signal_list = (GSList *)g_datalist_get_data(&object->signals, name);
t@@ -3604,8 +3604,8 @@ guint gtk_signal_connect(GObject *object, const gchar *name,
   return 0;
 }
 
-guint gtk_signal_connect_object(GObject *object, const gchar *name,
-                                GtkSignalFunc func, GObject *slot_object)
+guint g_signal_connect_swapped(GObject *object, const gchar *name,
+                               GtkSignalFunc func, GObject *slot_object)
 {
   GtkSignal *signal;
   GtkSignalType *signal_type;
t@@ -3615,7 +3615,7 @@ guint gtk_signal_connect_object(GObject *object, const gchar *name,
     return 0;
   signal_type = gtk_get_signal_type(object, name);
   if (!signal_type) {
-    g_warning("gtk_signal_connect_object: unknown signal %s", name);
+    g_warning("g_signal_connect_swapped: unknown signal %s", name);
     return 0;
   }
   signal_list = (GSList *)g_datalist_get_data(&object->signals, name);
diff --git a/src/gtkport/gtkport.h b/src/gtkport/gtkport.h
t@@ -414,12 +414,11 @@ void gtk_toggle_button_set_active(GtkToggleButton *toggle_button,
                                   gboolean is_active);
 void gtk_main_quit();
 void gtk_main();
-guint gtk_signal_connect(GObject *object, const gchar *name,
-                         GtkSignalFunc func, gpointer func_data);
-#define g_signal_connect gtk_signal_connect
-guint gtk_signal_connect_object(GObject *object, const gchar *name,
-                                GtkSignalFunc func,
-                                GObject *slot_object);
+guint g_signal_connect(GObject *object, const gchar *name,
+                       GtkSignalFunc func, gpointer func_data);
+guint g_signal_connect_swapped(GObject *object, const gchar *name,
+                               GtkSignalFunc func,
+                               GObject *slot_object);
 void gtk_signal_emit(GObject *object, const gchar *name, ...);
 void SetCustomWndProc(WNDPROC wndproc);
 void win32_init(HINSTANCE hInstance, HINSTANCE hPrevInstance,