]> spindle.queued.net Git - midori/commitdiff
Let glib-genmarshal write our marshallers
authorChristian Dywan <christian@twotoasts.de>
Thu, 8 Jan 2009 01:29:07 +0000 (02:29 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 8 Jan 2009 01:29:07 +0000 (02:29 +0100)
midori/marshal.list [new file with mode: 0644]
midori/midori-locationaction.c
midori/midori-panel.c
midori/midori-searchaction.c
midori/midori-view.c
midori/wscript_build
wscript

diff --git a/midori/marshal.list b/midori/marshal.list
new file mode 100644 (file)
index 0000000..53e9849
--- /dev/null
@@ -0,0 +1,4 @@
+BOOLEAN:VOID
+VOID:OBJECT,ENUM
+VOID:STRING,BOOLEAN
+VOID:STRING,INT,STRING
index c3b004bfed4772cede7b72677709134ca3fb1ea9..7fcf78678205f92b1e7d0825b59398b341bb9fc3 100644 (file)
@@ -13,6 +13,7 @@
 #include "midori-locationaction.h"
 
 #include "gtkiconentry.h"
+#include "marshal.h"
 #include "sokoke.h"
 
 #include <string.h>
@@ -95,42 +96,6 @@ static void
 midori_location_action_disconnect_proxy (GtkAction* action,
                                          GtkWidget* proxy);
 
-static void
-midori_cclosure_marshal_VOID__STRING_BOOLEAN (GClosure*     closure,
-                                              GValue*       return_value,
-                                              guint         n_param_values,
-                                              const GValue* param_values,
-                                              gpointer      invocation_hint,
-                                              gpointer      marshal_data)
-{
-    typedef void(*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer      data1,
-                                                      const gchar*  arg_1,
-                                                      gboolean      arg_2,
-                                                      gpointer      data2);
-    register GMarshalFunc_VOID__STRING_BOOLEAN callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-
-    g_return_if_fail (n_param_values == 3);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data
-        ? marshal_data : cc->callback);
-    callback (data1,
-              g_value_get_string (param_values + 1),
-              g_value_get_boolean (param_values + 2),
-              data2);
-}
-
 static void
 midori_location_action_class_init (MidoriLocationActionClass* class)
 {
index 9794d257c23ec29fed76b5dd80e142ed051949bd..4129d825ebaab1507af67bdbb43b1a970c1130e7 100644 (file)
 #include "midori-panel.h"
 
 #include "midori-view.h"
-#include "sokoke.h"
+
 #include "compat.h"
+#include "marshal.h"
+#include "sokoke.h"
 
 #include <glib/gi18n.h>
 
@@ -81,40 +83,6 @@ midori_panel_close (MidoriPanel* panel)
     return FALSE;
 }
 
-static void
-midori_cclosure_marshal_BOOLEAN__VOID (GClosure*     closure,
-                                       GValue*       return_value,
-                                       guint         n_param_values,
-                                       const GValue* param_values,
-                                       gpointer      invocation_hint,
-                                       gpointer      marshal_data)
-{
-    typedef gboolean(*GMarshalFunc_BOOLEAN__VOID) (gpointer  data1,
-                                                   gpointer  data2);
-    register GMarshalFunc_BOOLEAN__VOID callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-    gboolean v_return;
-
-    g_return_if_fail (return_value != NULL);
-    g_return_if_fail (n_param_values == 1);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data
-        ? marshal_data : cc->callback);
-    v_return = callback (data1, data2);
-    g_value_set_boolean (return_value, v_return);
-}
-
 static void
 midori_panel_class_init (MidoriPanelClass* class)
 {
index b32d30e95366074e37f710d2e267bb92d92b3b51..6a9d21c497682321a35d30a3c6a59d8d85e67f1d 100644 (file)
@@ -12,6 +12,7 @@
 #include "midori-searchaction.h"
 
 #include "gtkiconentry.h"
+#include "marshal.h"
 #include "sokoke.h"
 
 #include <glib/gi18n.h>
@@ -90,42 +91,6 @@ static void
 midori_search_action_disconnect_proxy (GtkAction* action,
                                        GtkWidget* proxy);
 
-static void
-midori_cclosure_marshal_VOID__STRING_BOOLEAN (GClosure*     closure,
-                                              GValue*       return_value,
-                                              guint         n_param_values,
-                                              const GValue* param_values,
-                                              gpointer      invocation_hint,
-                                              gpointer      marshal_data)
-{
-    typedef void(*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer      data1,
-                                                      const gchar*  arg_1,
-                                                      gboolean      arg_2,
-                                                      gpointer      data2);
-    register GMarshalFunc_VOID__STRING_BOOLEAN callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-
-    g_return_if_fail (n_param_values == 3);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data
-        ? marshal_data : cc->callback);
-    callback (data1,
-              g_value_get_string (param_values + 1),
-              g_value_get_boolean (param_values + 2),
-              data2);
-}
-
 static void
 midori_search_action_class_init (MidoriSearchActionClass* class)
 {
index 89b5e600e5a662ff4c664d4bfa5e056e48fbda40..bd114f782ae069e0776dab34e3dac178a73e36f1 100644 (file)
@@ -18,6 +18,7 @@
 #include "midori-stock.h"
 
 #include "compat.h"
+#include "marshal.h"
 #include "sokoke.h"
 
 #include <string.h>
@@ -163,116 +164,6 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
                                 GParamSpec*        pspec,
                                 MidoriView*        view);
 
-static void
-midori_cclosure_marshal_VOID__STRING_BOOLEAN (GClosure*     closure,
-                                              GValue*       return_value,
-                                              guint         n_param_values,
-                                              const GValue* param_values,
-                                              gpointer      invocation_hint,
-                                              gpointer      marshal_data)
-{
-    typedef void(*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer  data1,
-                                                      gpointer  arg_1,
-                                                      gboolean  arg_2,
-                                                      gpointer  data2);
-    register GMarshalFunc_VOID__STRING_BOOLEAN callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-
-    g_return_if_fail (n_param_values == 3);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data
-        ? marshal_data : cc->callback);
-    callback (data1,
-              (gchar*)g_value_get_string (param_values + 1),
-              g_value_get_boolean (param_values + 2),
-              data2);
-}
-
-static void
-midori_cclosure_marshal_VOID__OBJECT_ENUM (GClosure*     closure,
-                                           GValue*       return_value,
-                                           guint         n_param_values,
-                                           const GValue* param_values,
-                                           gpointer      invocation_hint,
-                                           gpointer      marshal_data)
-{
-    typedef void(*GMarshalFunc_VOID__OBJECT_ENUM) (gpointer  data1,
-                                                   gpointer  arg_1,
-                                                   gint      arg_2,
-                                                   gpointer  data2);
-    register GMarshalFunc_VOID__OBJECT_ENUM callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-
-    g_return_if_fail (n_param_values == 3);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_VOID__OBJECT_ENUM) (marshal_data
-        ? marshal_data : cc->callback);
-    callback (data1,
-              g_value_get_object (param_values + 1),
-              g_value_get_enum (param_values + 2),
-              data2);
-}
-
-static void
-midori_cclosure_marshal_VOID__STRING_INT_STRING (GClosure*     closure,
-                                                 GValue*       return_value,
-                                                 guint         n_param_values,
-                                                 const GValue* param_values,
-                                                 gpointer      invocation_hint,
-                                                 gpointer      marshal_data)
-{
-    typedef void(*GMarshalFunc_VOID__STRING_INT_STRING) (gpointer  data1,
-                                                         gpointer  arg_1,
-                                                         gint      arg_2,
-                                                         gpointer  arg_3,
-                                                         gpointer  data2);
-    register GMarshalFunc_VOID__STRING_INT_STRING callback;
-    register GCClosure* cc = (GCClosure*) closure;
-    register gpointer data1, data2;
-
-    g_return_if_fail (n_param_values == 4);
-
-    if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-        data1 = closure->data;
-        data2 = g_value_peek_pointer (param_values + 0);
-    }
-    else
-    {
-        data1 = g_value_peek_pointer (param_values + 0);
-        data2 = closure->data;
-    }
-    callback = (GMarshalFunc_VOID__STRING_INT_STRING) (marshal_data
-        ? marshal_data : cc->callback);
-    callback (data1,
-              (gchar*)g_value_get_string (param_values + 1),
-              g_value_get_int (param_values + 2),
-              (gchar*)g_value_get_string (param_values + 3),
-              data2);
-}
-
 static void
 midori_view_class_init (MidoriViewClass* class)
 {
index 3e3b132447d6572a65c3dac88fb14345ffcbfb05..9c8d12733124ab5db2a99116f7eb70f4525949b4 100644 (file)
@@ -6,5 +6,6 @@ obj = bld.new_task_gen ('cc', 'program')
 obj.target = 'midori'
 obj.includes = '. .. ../panels'
 obj.find_sources_in_dirs ('. ../panels')
+obj.add_marshal_file ('marshal.list', 'midori_cclosure_marshal')
 obj.uselib = 'UNIQUE LIBSOUP GMODULE GTHREAD GIO GTK SQLITE WEBKIT LIBXML'
 obj.uselib_local = 'katze'
diff --git a/wscript b/wscript
index 31383330a688943bd4fdc78fac240ca0ff700cf0..a1565052aa4d824702a7d0b076876591a8336c7c 100644 (file)
--- a/wscript
+++ b/wscript
@@ -50,6 +50,7 @@ def configure (conf):
         return dirvalue
 
     conf.check_tool ('compiler_cc')
+    conf.check_tool ('glib2')
 
     if option_enabled ('userdocs'):
         conf.find_program ('rst2html.py', var='RST2HTML')