Commit dd77b5db authored by Tim Janik's avatar Tim Janik

main part for GtkArgSetFunc/GtkArgGetFunc implementation.

-timj
parent 18681dc6
......@@ -47,7 +47,8 @@ gtk_adjustment_get_type ()
sizeof (GtkAdjustmentClass),
(GtkClassInitFunc) gtk_adjustment_class_init,
(GtkObjectInitFunc) gtk_adjustment_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
adjustment_type = gtk_type_unique (gtk_data_get_type (), &adjustment_info);
......
......@@ -40,7 +40,8 @@ gtk_alignment_get_type ()
sizeof (GtkAlignmentClass),
(GtkClassInitFunc) gtk_alignment_class_init,
(GtkObjectInitFunc) gtk_alignment_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
alignment_type = gtk_type_unique (gtk_bin_get_type (), &alignment_info);
......
......@@ -41,7 +41,8 @@ gtk_arrow_get_type ()
sizeof (GtkArrowClass),
(GtkClassInitFunc) gtk_arrow_class_init,
(GtkObjectInitFunc) gtk_arrow_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
arrow_type = gtk_type_unique (gtk_misc_get_type (), &arrow_info);
......
......@@ -50,7 +50,8 @@ gtk_aspect_frame_get_type ()
sizeof (GtkAspectFrameClass),
(GtkClassInitFunc) gtk_aspect_frame_class_init,
(GtkObjectInitFunc) gtk_aspect_frame_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
aspect_frame_type = gtk_type_unique (gtk_frame_get_type (), &aspect_frame_info);
......
......@@ -42,7 +42,8 @@ gtk_button_box_get_type ()
sizeof (GtkButtonBoxClass),
(GtkClassInitFunc) gtk_button_box_class_init,
(GtkObjectInitFunc) gtk_button_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
button_box_type = gtk_type_unique (gtk_box_get_type (), &button_box_info);
......
......@@ -53,7 +53,8 @@ gtk_bin_get_type ()
sizeof (GtkBinClass),
(GtkClassInitFunc) gtk_bin_class_init,
(GtkObjectInitFunc) gtk_bin_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
bin_type = gtk_type_unique (gtk_container_get_type (), &bin_info);
......
......@@ -53,7 +53,8 @@ gtk_box_get_type ()
sizeof (GtkBoxClass),
(GtkClassInitFunc) gtk_box_class_init,
(GtkObjectInitFunc) gtk_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
box_type = gtk_type_unique (gtk_container_get_type (), &box_info);
......
......@@ -36,12 +36,18 @@ enum {
LEAVE,
LAST_SIGNAL
};
enum {
ARG_0,
ARG_LABEL
};
static void gtk_button_class_init (GtkButtonClass *klass);
static void gtk_button_init (GtkButton *button);
static void gtk_button_arg (GtkButton *button,
GtkArg *arg);
static void gtk_button_set_arg (GtkButton *button,
GtkArg *arg,
guint arg_id);
static void gtk_button_destroy (GtkObject *object);
static void gtk_button_map (GtkWidget *widget);
static void gtk_button_unmap (GtkWidget *widget);
......@@ -101,7 +107,8 @@ gtk_button_get_type ()
sizeof (GtkButtonClass),
(GtkClassInitFunc) gtk_button_class_init,
(GtkObjectInitFunc) gtk_button_init,
(GtkArgFunc) gtk_button_arg,
(GtkArgSetFunc) gtk_button_set_arg,
(GtkArgGetFunc) NULL,
};
button_type = gtk_type_unique (gtk_container_get_type (), &button_info);
......@@ -123,7 +130,7 @@ gtk_button_class_init (GtkButtonClass *klass)
parent_class = gtk_type_class (gtk_container_get_type ());
gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING);
gtk_object_add_arg_type ("GtkButton::label", GTK_TYPE_STRING, ARG_LABEL);
button_signals[PRESSED] =
gtk_signal_new ("pressed",
......@@ -204,23 +211,28 @@ gtk_button_init (GtkButton *button)
}
static void
gtk_button_arg (GtkButton *button,
GtkArg *arg)
gtk_button_set_arg (GtkButton *button,
GtkArg *arg,
guint arg_id)
{
if (strcmp (arg->name, "label") == 0)
{
GtkWidget *label;
GtkWidget *label;
switch (arg_id)
{
case ARG_LABEL:
gtk_container_disable_resize (GTK_CONTAINER (button));
if (button->child)
gtk_widget_destroy (button->child);
label = gtk_label_new (GTK_VALUE_STRING(*arg));
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (button), label);
gtk_container_enable_resize (GTK_CONTAINER (button));
break;
default:
g_assert_not_reached ();
}
}
......
......@@ -59,7 +59,8 @@ gtk_check_button_get_type ()
sizeof (GtkCheckButtonClass),
(GtkClassInitFunc) gtk_check_button_class_init,
(GtkObjectInitFunc) gtk_check_button_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
check_button_type = gtk_type_unique (gtk_toggle_button_get_type (), &check_button_info);
......
......@@ -60,7 +60,8 @@ gtk_check_menu_item_get_type ()
sizeof (GtkCheckMenuItemClass),
(GtkClassInitFunc) gtk_check_menu_item_class_init,
(GtkObjectInitFunc) gtk_check_menu_item_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
check_menu_item_type = gtk_type_unique (gtk_menu_item_get_type (), &check_menu_item_info);
......
......@@ -252,7 +252,8 @@ gtk_clist_get_type ()
sizeof (GtkCListClass),
(GtkClassInitFunc) gtk_clist_class_init,
(GtkObjectInitFunc) gtk_clist_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
clist_type = gtk_type_unique (gtk_container_get_type (), &clist_info);
......
......@@ -82,7 +82,8 @@ gtk_combo_box_get_type ()
sizeof (GtkComboBoxClass),
(GtkClassInitFunc) gtk_combo_box_class_init,
(GtkObjectInitFunc) gtk_combo_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
combo_box_type = gtk_type_unique (gtk_entry_get_type (), &combo_box_info);
......
......@@ -28,6 +28,13 @@ enum {
FOCUS,
LAST_SIGNAL
};
enum {
ARG_0,
ARG_BORDER_WIDTH,
ARG_AUTO_RESIZE,
ARG_BLOCK_RESIZE,
ARG_CHILD
};
typedef void (*GtkContainerSignal1) (GtkObject *object,
......@@ -64,8 +71,9 @@ static void gtk_container_marshal_signal_4 (GtkObject *object,
static void gtk_container_class_init (GtkContainerClass *klass);
static void gtk_container_init (GtkContainer *container);
static void gtk_container_arg (GtkContainer *container,
GtkArg *arg);
static void gtk_container_set_arg (GtkContainer *container,
GtkArg *arg,
guint arg_id);
static gint gtk_real_container_need_resize (GtkContainer *container);
static gint gtk_real_container_focus (GtkContainer *container,
GtkDirectionType direction);
......@@ -105,7 +113,8 @@ gtk_container_get_type ()
sizeof (GtkContainerClass),
(GtkClassInitFunc) gtk_container_class_init,
(GtkObjectInitFunc) gtk_container_init,
(GtkArgFunc) gtk_container_arg,
(GtkArgSetFunc) gtk_container_set_arg,
(GtkArgGetFunc) NULL,
};
container_type = gtk_type_unique (gtk_widget_get_type (), &container_info);
......@@ -123,10 +132,10 @@ gtk_container_class_init (GtkContainerClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_LONG);
gtk_object_add_arg_type ("GtkContainer::auto_resize", GTK_TYPE_BOOL);
gtk_object_add_arg_type ("GtkContainer::block_resize", GTK_TYPE_BOOL);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET);
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_LONG, ARG_BORDER_WIDTH);
gtk_object_add_arg_type ("GtkContainer::auto_resize", GTK_TYPE_BOOL, ARG_AUTO_RESIZE);
gtk_object_add_arg_type ("GtkContainer::block_resize", GTK_TYPE_BOOL, ARG_BLOCK_RESIZE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, ARG_CHILD);
container_signals[ADD] =
gtk_signal_new ("add",
......@@ -193,30 +202,32 @@ gtk_container_init (GtkContainer *container)
}
static void
gtk_container_arg (GtkContainer *container,
GtkArg *arg)
gtk_container_set_arg (GtkContainer *container,
GtkArg *arg,
guint arg_id)
{
if (strcmp (arg->name, "border_width") == 0)
switch (arg_id)
{
case ARG_BORDER_WIDTH:
gtk_container_border_width (container, GTK_VALUE_LONG (*arg));
}
else if (strcmp (arg->name, "auto_resize") == 0)
{
break;
case ARG_AUTO_RESIZE:
if (GTK_VALUE_BOOL (*arg))
gtk_container_enable_resize (container);
else
gtk_container_disable_resize (container);
}
else if (strcmp (arg->name, "block_resize") == 0)
{
break;
case ARG_BLOCK_RESIZE:
if (GTK_VALUE_BOOL (*arg))
gtk_container_block_resize (container);
else
gtk_container_unblock_resize (container);
}
else if (strcmp (arg->name, "child") == 0)
{
break;
case ARG_CHILD:
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
break;
default:
g_assert_not_reached ();
}
}
......
......@@ -62,7 +62,8 @@ gtk_curve_get_type (void)
sizeof (GtkCurveClass),
(GtkClassInitFunc) gtk_curve_class_init,
(GtkObjectInitFunc) gtk_curve_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
curve_type = gtk_type_unique (gtk_drawing_area_get_type (), &curve_info);
......
......@@ -45,7 +45,8 @@ gtk_data_get_type ()
sizeof (GtkDataClass),
(GtkClassInitFunc) gtk_data_class_init,
(GtkObjectInitFunc) NULL,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
data_type = gtk_type_unique (gtk_object_get_type (), &data_info);
......
......@@ -40,7 +40,8 @@ gtk_dialog_get_type ()
sizeof (GtkDialogClass),
(GtkClassInitFunc) gtk_dialog_class_init,
(GtkObjectInitFunc) gtk_dialog_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
dialog_type = gtk_type_unique (gtk_window_get_type (), &dialog_info);
......
......@@ -39,7 +39,8 @@ gtk_drawing_area_get_type ()
sizeof (GtkDrawingAreaClass),
(GtkClassInitFunc) gtk_drawing_area_class_init,
(GtkObjectInitFunc) gtk_drawing_area_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
drawing_area_type = gtk_type_unique (gtk_widget_get_type (), &drawing_area_info);
......
......@@ -227,7 +227,8 @@ gtk_entry_get_type ()
sizeof (GtkEntryClass),
(GtkClassInitFunc) gtk_entry_class_init,
(GtkObjectInitFunc) gtk_entry_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
entry_type = gtk_type_unique (gtk_widget_get_type (), &entry_info);
......
......@@ -46,7 +46,8 @@ gtk_event_box_get_type ()
sizeof (GtkEventBoxClass),
(GtkClassInitFunc) gtk_event_box_class_init,
(GtkObjectInitFunc) gtk_event_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
event_box_type = gtk_type_unique (gtk_bin_get_type (), &event_box_info);
......
......@@ -308,7 +308,8 @@ gtk_file_selection_get_type ()
sizeof (GtkFileSelectionClass),
(GtkClassInitFunc) gtk_file_selection_class_init,
(GtkObjectInitFunc) gtk_file_selection_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
file_selection_type = gtk_type_unique (gtk_window_get_type (), &filesel_info);
......
......@@ -61,7 +61,8 @@ gtk_fixed_get_type ()
sizeof (GtkFixedClass),
(GtkClassInitFunc) gtk_fixed_class_init,
(GtkObjectInitFunc) gtk_fixed_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
fixed_type = gtk_type_unique (gtk_container_get_type (), &fixed_info);
......
......@@ -51,7 +51,8 @@ gtk_frame_get_type ()
sizeof (GtkFrameClass),
(GtkClassInitFunc) gtk_frame_class_init,
(GtkObjectInitFunc) gtk_frame_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
frame_type = gtk_type_unique (gtk_bin_get_type (), &frame_info);
......
......@@ -210,7 +210,8 @@ gtk_gamma_curve_get_type (void)
sizeof (GtkGammaCurveClass),
(GtkClassInitFunc) gtk_gamma_curve_class_init,
(GtkObjectInitFunc) gtk_gamma_curve_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
gamma_curve_type =
......
......@@ -61,7 +61,8 @@ gtk_handle_box_get_type ()
sizeof (GtkHandleBoxClass),
(GtkClassInitFunc) gtk_handle_box_class_init,
(GtkObjectInitFunc) gtk_handle_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
handle_box_type = gtk_type_unique (gtk_event_box_get_type (), &handle_box_info);
......
......@@ -43,7 +43,8 @@ gtk_hbutton_box_get_type ()
sizeof (GtkHButtonBoxClass),
(GtkClassInitFunc) gtk_hbutton_box_class_init,
(GtkObjectInitFunc) gtk_hbutton_box_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hbutton_box_type = gtk_type_unique (gtk_button_box_get_type (), &hbutton_box_info);
......
......@@ -40,7 +40,8 @@ gtk_hbox_get_type ()
sizeof (GtkHBoxClass),
(GtkClassInitFunc) gtk_hbox_class_init,
(GtkObjectInitFunc) gtk_hbox_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hbox_type = gtk_type_unique (gtk_box_get_type (), &hbox_info);
......
......@@ -49,7 +49,8 @@ gtk_hpaned_get_type ()
sizeof (GtkHPanedClass),
(GtkClassInitFunc) gtk_hpaned_class_init,
(GtkObjectInitFunc) gtk_hpaned_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hpaned_type = gtk_type_unique (gtk_paned_get_type (), &hpaned_info);
......
......@@ -51,7 +51,8 @@ gtk_hruler_get_type ()
sizeof (GtkHRulerClass),
(GtkClassInitFunc) gtk_hruler_class_init,
(GtkObjectInitFunc) gtk_hruler_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hruler_type = gtk_type_unique (gtk_ruler_get_type (), &hruler_info);
......
......@@ -58,7 +58,8 @@ gtk_hscale_get_type ()
sizeof (GtkHScaleClass),
(GtkClassInitFunc) gtk_hscale_class_init,
(GtkObjectInitFunc) gtk_hscale_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hscale_type = gtk_type_unique (gtk_scale_get_type (), &hscale_info);
......
......@@ -54,7 +54,8 @@ gtk_hscrollbar_get_type ()
sizeof (GtkHScrollbarClass),
(GtkClassInitFunc) gtk_hscrollbar_class_init,
(GtkObjectInitFunc) gtk_hscrollbar_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hscrollbar_type = gtk_type_unique (gtk_scrollbar_get_type (), &hscrollbar_info);
......
......@@ -38,7 +38,8 @@ gtk_hseparator_get_type ()
sizeof (GtkHSeparatorClass),
(GtkClassInitFunc) gtk_hseparator_class_init,
(GtkObjectInitFunc) gtk_hseparator_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
hseparator_type = gtk_type_unique (gtk_separator_get_type (), &hseparator_info);
......
......@@ -39,7 +39,8 @@ gtk_image_get_type ()
sizeof (GtkImageClass),
(GtkClassInitFunc) gtk_image_class_init,
(GtkObjectInitFunc) gtk_image_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
image_type = gtk_type_unique (gtk_misc_get_type (), &image_info);
......
......@@ -140,7 +140,8 @@ gtk_input_dialog_get_type ()
sizeof (GtkInputDialogClass),
(GtkClassInitFunc) gtk_input_dialog_class_init,
(GtkObjectInitFunc) gtk_input_dialog_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
input_dialog_type = gtk_type_unique (gtk_dialog_get_type (),
......
......@@ -51,7 +51,8 @@ gtk_item_get_type ()
sizeof (GtkItemClass),
(GtkClassInitFunc) gtk_item_class_init,
(GtkObjectInitFunc) gtk_item_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
item_type = gtk_type_unique (gtk_bin_get_type (), &item_info);
......
......@@ -45,7 +45,8 @@ gtk_label_get_type ()
sizeof (GtkLabelClass),
(GtkClassInitFunc) gtk_label_class_init,
(GtkObjectInitFunc) gtk_label_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
label_type = gtk_type_unique (gtk_misc_get_type (), &label_info);
......
......@@ -91,7 +91,8 @@ gtk_list_get_type ()
sizeof (GtkListClass),
(GtkClassInitFunc) gtk_list_class_init,
(GtkObjectInitFunc) gtk_list_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
list_type = gtk_type_unique (gtk_container_get_type (), &list_info);
......
......@@ -59,7 +59,8 @@ gtk_list_item_get_type ()
sizeof (GtkListItemClass),
(GtkClassInitFunc) gtk_list_item_class_init,
(GtkObjectInitFunc) gtk_list_item_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
list_item_type = gtk_type_unique (gtk_item_get_type (), &list_item_info);
......
......@@ -65,7 +65,8 @@ gtk_menu_get_type ()
sizeof (GtkMenuClass),
(GtkClassInitFunc) gtk_menu_class_init,
(GtkObjectInitFunc) gtk_menu_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
menu_type = gtk_type_unique (gtk_menu_shell_get_type (), &menu_info);
......
......@@ -51,7 +51,8 @@ gtk_menu_bar_get_type ()
sizeof (GtkMenuBarClass),
(GtkClassInitFunc) gtk_menu_bar_class_init,
(GtkObjectInitFunc) gtk_menu_bar_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
menu_bar_type = gtk_type_unique (gtk_menu_shell_get_type (), &menu_bar_info);
......
......@@ -86,7 +86,8 @@ gtk_menu_item_get_type ()
sizeof (GtkMenuItemClass),
(GtkClassInitFunc) gtk_menu_item_class_init,
(GtkObjectInitFunc) gtk_menu_item_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
menu_item_type = gtk_type_unique (gtk_item_get_type (), &menu_item_info);
......
......@@ -74,7 +74,8 @@ gtk_menu_shell_get_type ()
sizeof (GtkMenuShellClass),
(GtkClassInitFunc) gtk_menu_shell_class_init,
(GtkObjectInitFunc) gtk_menu_shell_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
menu_shell_type = gtk_type_unique (gtk_container_get_type (), &menu_shell_info);
......
......@@ -38,7 +38,8 @@ gtk_misc_get_type ()
sizeof (GtkMiscClass),
(GtkClassInitFunc) gtk_misc_class_init,
(GtkObjectInitFunc) gtk_misc_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
misc_type = gtk_type_unique (gtk_widget_get_type (), &misc_info);
......
......@@ -95,7 +95,8 @@ gtk_notebook_get_type ()
sizeof (GtkNotebookClass),
(GtkClassInitFunc) gtk_notebook_class_init,
(GtkObjectInitFunc) gtk_notebook_init,
(GtkArgFunc) NULL,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
notebook_type = gtk_type_unique (gtk_container_get_type (), &notebook_info);
......
......@@ -28,6 +28,11 @@ enum {
DESTROY,
LAST_SIGNAL
};
enum {
ARG_0,
ARG_USER_DATA,
ARG_SIGNAL
};
typedef struct _GtkObjectData GtkObjectData;
......@@ -44,13 +49,16 @@ struct _GtkArgInfo
{
char *name;
GtkType type;
GtkType class_type;
guint arg_id;
};
static void gtk_object_class_init (GtkObjectClass *klass);
static void gtk_object_init (GtkObject *object);
static void gtk_object_arg (GtkObject *object,
GtkArg *arg);
static void gtk_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_real_object_destroy (GtkObject *object);
static void gtk_object_data_init (void);
static GtkObjectData* gtk_object_data_new (void);
......@@ -95,7 +103,8 @@ gtk_object_init_type ()
sizeof (GtkObjectClass),
(GtkClassInitFunc) gtk_object_class_init,
(GtkObjectInitFunc) gtk_object_init,
(GtkArgFunc) gtk_object_arg,
gtk_object_set_arg,
NULL,
};
object_type = gtk_type_unique (0, &object_info);
......@@ -122,8 +131,8 @@ gtk_object_class_init (GtkObjectClass *class)
class->signals = NULL;
class->nsignals = 0;
gtk_object_add_arg_type ("GtkObject::user_data", GTK_TYPE_POINTER);
gtk_object_add_arg_type ("GtkObject::signal", GTK_TYPE_SIGNAL);
gtk_object_add_arg_type ("GtkObject::user_data", GTK_TYPE_POINTER, ARG_USER_DATA);
gtk_object_add_arg_type ("GtkObject::signal", GTK_TYPE_SIGNAL, ARG_SIGNAL);
object_signals[DESTROY] =
gtk_signal_new ("destroy",
......@@ -163,24 +172,27 @@ gtk_object_init (GtkObject *object)
*****************************************/
static void
gtk_object_arg (GtkObject *object,
GtkArg *arg)
gtk_object_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
if (strcmp (arg->name, "user_data") == 0)
switch (arg_id)
{
case ARG_USER_DATA:
gtk_object_set_user_data (object, GTK_VALUE_POINTER (*arg));
}
else if (strncmp (arg->name, "signal", 6) == 0)
{
if ((arg->name[6] != ':') || (arg->name[7] != ':'))
break;
case ARG_SIGNAL:
if ((arg->name[11 + 6] != ':') || (arg->name[11 + 7] != ':'))
{
g_print ("invalid signal argument: \"%s\"\n", arg->name);
return;
}
gtk_signal_connect (object, arg->name + 8,
gtk_signal_connect (object, arg->name + 11 + 8,
(GtkSignalFunc) GTK_VALUE_SIGNAL (*arg).f,
GTK_VALUE_SIGNAL (*arg).d);
break;
default:
g_assert_not_reached ();
}
}
......@@ -344,29 +356,40 @@ gtk_object_setv (GtkObject *obj,
gint nargs,
GtkArg *args)
{
guint class_type;
char class_name[1024];
char *arg_name;
int i;
g_return_if_fail (obj != NULL);
if (!arg_info_ht)
return;
for (i = 0; i < nargs; i++)
{
arg_name = strchr (args[i].name, ':');
if (!arg_name || (arg_name[0] != ':') || (arg_name[1] != ':'))
GtkArgInfo *info;
gchar *lookup_name;
gchar *d;
lookup_name = g_strdup (args[i].name);
d = strchr (lookup_name, ':');
if (d && d[1] == ':')
{
g_print ("invalid arg name: \"%s\"\n", args[i].name);
continue;