Let glib-genmarshal write our marshallers

This commit is contained in:
Christian Dywan 2009-01-08 02:29:07 +01:00
parent 4e84376e28
commit 43f48a9b43
7 changed files with 12 additions and 217 deletions

4
midori/marshal.list Normal file
View file

@ -0,0 +1,4 @@
BOOLEAN:VOID
VOID:OBJECT,ENUM
VOID:STRING,BOOLEAN
VOID:STRING,INT,STRING

View 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)
{

View file

@ -12,8 +12,10 @@
#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)
{

View 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)
{

View 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)
{

View 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'

View file

@ -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')