? get-type.patch Index: ChangeLog =================================================================== RCS file: /cvs/gnome/glade2/ChangeLog,v retrieving revision 1.14 diff -u -r1.14 ChangeLog --- ChangeLog 2001/07/11 04:34:58 1.14 +++ ChangeLog 2001/07/14 19:09:13 @@ -1,3 +1,12 @@ +2001-07-14 Archit Baweja + + * src/glade-widget-class.c (glade_widget_class_compose_get_type_func): + changed to negate use of in the XML files. + + * src/glade-widget-class.c (glade_widget_class_new_from_node): check + if get_type function is provided in GetTypeFunction tag. Else use above + function. + 2001-07-10 Chema Celorio * src/glade-gtk.c (glade_gtk_entry_set_text): implement. Index: src/glade-widget-class.c =================================================================== RCS file: /cvs/gnome/glade2/src/glade-widget-class.c,v retrieving revision 1.9 diff -u -r1.9 glade-widget-class.c --- src/glade-widget-class.c 2001/07/11 04:34:59 1.9 +++ src/glade-widget-class.c 2001/07/14 19:09:23 @@ -45,20 +45,28 @@ #include "glade-parameter.h" #include "glade-widget-class.h" -#if 0 /* Keep arround */ + static gchar * glade_widget_class_compose_get_type_func (GladeWidgetClass *class) { gchar *retval; GString *tmp; - gint i = 1; + gint i = 1, j; tmp = g_string_new (class->name); while (tmp->str[i]) { if (isupper (tmp->str[i])) { - tmp = g_string_insert_c (tmp, i, '_'); - i+=2; + tmp = g_string_insert_c (tmp, i++, '_'); + + j = 0; + while (isupper (tmp->str[i++])) + j++; + + if (j > 2) { + g_string_insert_c (tmp, i-2, '_'); + } + continue; } i++; @@ -70,8 +78,8 @@ return retval; } -#endif + static GladeWidgetClass * glade_widget_class_new (void) { @@ -201,10 +209,14 @@ class->name = glade_xml_get_value_string_required (node, GLADE_TAG_NAME, NULL); class->generic_name = glade_xml_get_value_string_required (node, GLADE_TAG_GENERIC_NAME, NULL); + init_function_name = glade_xml_get_value_string_required (node, GLADE_TAG_GET_TYPE_FUNC, NULL); - init_function_name = glade_xml_get_value_string_required (node, GLADE_TAG_GET_TYPE_FUNCTION, NULL); - if (!init_function_name) - return FALSE; + if (!init_function_name) { + init_function_name = glade_widget_class_compose_get_type_func (class); + if (!init_function_name) + return FALSE; + } + if (!glade_widget_class_set_type (class, init_function_name)) return NULL; g_free (init_function_name); Index: widgets/gtkbutton.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkbutton.xml,v retrieving revision 1.5 diff -u -r1.5 gtkbutton.xml --- widgets/gtkbutton.xml 2001/07/09 07:16:00 1.5 +++ widgets/gtkbutton.xml 2001/07/14 19:09:23 @@ -1,6 +1,5 @@ GtkButton - gtk_button_get_type button False Index: widgets/gtkcheckbutton.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkcheckbutton.xml,v retrieving revision 1.6 diff -u -r1.6 gtkcheckbutton.xml --- widgets/gtkcheckbutton.xml 2001/07/11 04:34:59 1.6 +++ widgets/gtkcheckbutton.xml 2001/07/14 19:09:23 @@ -1,6 +1,5 @@ GtkCheckButton - gtk_check_button_get_type checkbutton False @@ -20,4 +19,4 @@ - \ No newline at end of file + Index: widgets/gtkcombo.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkcombo.xml,v retrieving revision 1.1 diff -u -r1.1 gtkcombo.xml --- widgets/gtkcombo.xml 2001/07/05 07:34:34 1.1 +++ widgets/gtkcombo.xml 2001/07/14 19:09:24 @@ -1,6 +1,5 @@ GtkCombo - gtk_combo_get_type combo False @@ -11,4 +10,4 @@ - \ No newline at end of file + Index: widgets/gtkentry.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkentry.xml,v retrieving revision 1.3 diff -u -r1.3 gtkentry.xml --- widgets/gtkentry.xml 2001/07/09 07:16:00 1.3 +++ widgets/gtkentry.xml 2001/07/14 19:09:24 @@ -1,7 +1,6 @@ GtkEntry - gtk_entry_get_type entry False @@ -19,4 +18,4 @@ - \ No newline at end of file + Index: widgets/gtkframe.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkframe.xml,v retrieving revision 1.4 diff -u -r1.4 gtkframe.xml --- widgets/gtkframe.xml 2001/07/11 04:34:59 1.4 +++ widgets/gtkframe.xml 2001/07/14 19:09:24 @@ -1,7 +1,6 @@ GtkFrame - gtk_frame_get_type frame False True @@ -20,4 +19,4 @@ - \ No newline at end of file + Index: widgets/gtkhandlebox.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkhandlebox.xml,v retrieving revision 1.2 diff -u -r1.2 gtkhandlebox.xml --- widgets/gtkhandlebox.xml 2001/07/11 04:34:59 1.2 +++ widgets/gtkhandlebox.xml 2001/07/14 19:09:26 @@ -1,6 +1,5 @@ GtkHandleBox - gtk_handle_box_get_type handlebox False True Index: widgets/gtkhbox.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkhbox.xml,v retrieving revision 1.6 diff -u -r1.6 gtkhbox.xml --- widgets/gtkhbox.xml 2001/07/09 07:16:00 1.6 +++ widgets/gtkhbox.xml 2001/07/14 19:09:26 @@ -1,6 +1,5 @@ GtkHBox - gtk_hbox_get_type hbox False True Index: widgets/gtkhseparator.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkhseparator.xml,v retrieving revision 1.1 diff -u -r1.1 gtkhseparator.xml --- widgets/gtkhseparator.xml 2001/07/05 07:34:34 1.1 +++ widgets/gtkhseparator.xml 2001/07/14 19:09:26 @@ -1,6 +1,5 @@ GtkHSeparator - gtk_hseparator_get_type hseparator False @@ -12,4 +11,4 @@ - \ No newline at end of file + Index: widgets/gtklabel.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtklabel.xml,v retrieving revision 1.5 diff -u -r1.5 gtklabel.xml --- widgets/gtklabel.xml 2001/07/09 07:16:00 1.5 +++ widgets/gtklabel.xml 2001/07/14 19:09:27 @@ -1,7 +1,6 @@ GtkLabel - gtk_label_get_type label False Index: widgets/gtknotebook.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtknotebook.xml,v retrieving revision 1.3 diff -u -r1.3 gtknotebook.xml --- widgets/gtknotebook.xml 2001/07/09 07:16:00 1.3 +++ widgets/gtknotebook.xml 2001/07/14 19:09:27 @@ -1,7 +1,6 @@ GtkNotebook - gtk_notebook_get_type notebook False @@ -11,4 +10,4 @@ - \ No newline at end of file + Index: widgets/gtkoptionmenu.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkoptionmenu.xml,v retrieving revision 1.2 diff -u -r1.2 gtkoptionmenu.xml --- widgets/gtkoptionmenu.xml 2001/07/11 04:34:59 1.2 +++ widgets/gtkoptionmenu.xml 2001/07/14 19:09:27 @@ -1,6 +1,5 @@ GtkOptionMenu - gtk_option_menu_get_type optionmenu False @@ -26,4 +25,4 @@ - \ No newline at end of file + Index: widgets/gtkprogressbar.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkprogressbar.xml,v retrieving revision 1.3 diff -u -r1.3 gtkprogressbar.xml --- widgets/gtkprogressbar.xml 2001/07/11 04:34:59 1.3 +++ widgets/gtkprogressbar.xml 2001/07/14 19:09:27 @@ -1,6 +1,5 @@ GtkProgressBar - gtk_progress_bar_get_type progressbar False @@ -33,4 +32,4 @@ - \ No newline at end of file + Index: widgets/gtkradiobutton.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkradiobutton.xml,v retrieving revision 1.2 diff -u -r1.2 gtkradiobutton.xml --- widgets/gtkradiobutton.xml 2001/07/09 07:16:00 1.2 +++ widgets/gtkradiobutton.xml 2001/07/14 19:09:27 @@ -1,6 +1,5 @@ GtkRadioButton - gtk_radio_button_get_type radiobutton False @@ -13,4 +12,4 @@ - \ No newline at end of file + Index: widgets/gtkspinbutton.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkspinbutton.xml,v retrieving revision 1.3 diff -u -r1.3 gtkspinbutton.xml --- widgets/gtkspinbutton.xml 2001/07/09 07:16:00 1.3 +++ widgets/gtkspinbutton.xml 2001/07/14 19:09:27 @@ -1,7 +1,6 @@ GtkSpinButton - gtk_spin_button_get_type spinbutton False @@ -20,7 +19,6 @@ Object GtkAdjustment - gtk_adjustment_get_type @@ -47,4 +45,4 @@ - \ No newline at end of file + Index: widgets/gtktable.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtktable.xml,v retrieving revision 1.6 diff -u -r1.6 gtktable.xml --- widgets/gtktable.xml 2001/07/09 07:16:00 1.6 +++ widgets/gtktable.xml 2001/07/14 19:09:30 @@ -1,6 +1,5 @@ GtkTable - gtk_table_get_type table False True Index: widgets/gtktogglebutton.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtktogglebutton.xml,v retrieving revision 1.4 diff -u -r1.4 gtktogglebutton.xml --- widgets/gtktogglebutton.xml 2001/07/11 04:34:59 1.4 +++ widgets/gtktogglebutton.xml 2001/07/14 19:09:30 @@ -1,6 +1,5 @@ GtkToggleButton - gtk_toggle_button_get_type togglebutton False @@ -16,4 +15,4 @@ - \ No newline at end of file + Index: widgets/gtkvbox.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkvbox.xml,v retrieving revision 1.7 diff -u -r1.7 gtkvbox.xml --- widgets/gtkvbox.xml 2001/07/09 07:16:00 1.7 +++ widgets/gtkvbox.xml 2001/07/14 19:09:31 @@ -1,6 +1,5 @@ GtkVBox - gtk_vbox_get_type vbox False True Index: widgets/gtkvseparator.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkvseparator.xml,v retrieving revision 1.2 diff -u -r1.2 gtkvseparator.xml --- widgets/gtkvseparator.xml 2001/07/11 04:34:59 1.2 +++ widgets/gtkvseparator.xml 2001/07/14 19:09:31 @@ -1,6 +1,5 @@ GtkVSeparator - gtk_vseparator_get_type vseparator False @@ -11,4 +10,4 @@ - \ No newline at end of file + Index: widgets/gtkwindow.xml =================================================================== RCS file: /cvs/gnome/glade2/widgets/gtkwindow.xml,v retrieving revision 1.8 diff -u -r1.8 gtkwindow.xml --- widgets/gtkwindow.xml 2001/07/09 07:16:00 1.8 +++ widgets/gtkwindow.xml 2001/07/14 19:09:31 @@ -1,6 +1,5 @@ GtkWindow - gtk_window_get_type window True True