diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-03-02 19:11:47 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-03-02 19:11:47 +0000 |
commit | f832e3484d146343e6f6bf4b36c4f19746f521f2 (patch) | |
tree | 68b59d24f1a4146508e595588a87842f971e64b6 /gtk | |
parent | 36e686e6a723f83abc4ff31b076765cdd069b241 (diff) | |
download | gdk-pixbuf-f832e3484d146343e6f6bf4b36c4f19746f521f2.tar.gz |
Switch style of stamp file usage.
Sat Mar 2 13:26:58 2002 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Switch style of stamp file usage.
* gtk/Makefile.am gtk/typeutils.[ch]: Switch all the exported
enumeration/fags TYPE variables over to macros for get_type() functions,
for lazy definition and to get rid of expensive relocations.
* gtk/gtkiconfactory.[ch] gtk/gtkselection.[ch] gtk/gtkstyle.[ch]
gtk/gtktextiter.[ch] gtk/gtktexttag.[ch] gtk/gtktreemodel.[ch]
gtk/gtktypeutils.[ch] gtk/gtkwidget.[ch]: Switch boxed type
definitions over manually coded get_type() functions.
* gtk/gtk.def: Updates for above
* gtk/{genmarshal.pl,makeenums.awk,makeenums.h,maketypes.awk}:
Remove from CVS, no longer used.
* configure.in: Remove checks for awk.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/.cvsignore | 6 | ||||
-rw-r--r-- | gtk/Makefile.am | 124 | ||||
-rwxr-xr-x | gtk/genmarshal.pl | 157 | ||||
-rwxr-xr-x | gtk/gtk.def | 176 | ||||
-rw-r--r-- | gtk/gtkiconfactory.c | 26 | ||||
-rw-r--r-- | gtk/gtkiconfactory.h | 4 | ||||
-rw-r--r-- | gtk/gtkselection.c | 13 | ||||
-rw-r--r-- | gtk/gtkselection.h | 8 | ||||
-rw-r--r-- | gtk/gtkstyle.c | 13 | ||||
-rw-r--r-- | gtk/gtkstyle.h | 7 | ||||
-rw-r--r-- | gtk/gtktextiter.c | 13 | ||||
-rw-r--r-- | gtk/gtktextiter.h | 4 | ||||
-rw-r--r-- | gtk/gtktexttag.c | 13 | ||||
-rw-r--r-- | gtk/gtktexttag.h | 4 | ||||
-rw-r--r-- | gtk/gtktreemodel.c | 26 | ||||
-rw-r--r-- | gtk/gtktreemodel.h | 5 | ||||
-rw-r--r-- | gtk/gtktypeutils.c | 77 | ||||
-rw-r--r-- | gtk/gtktypeutils.h | 16 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 14 | ||||
-rw-r--r-- | gtk/gtkwidget.h | 6 | ||||
-rw-r--r-- | gtk/makeenums.awk | 152 | ||||
-rw-r--r-- | gtk/makeenums.h | 5 | ||||
-rw-r--r-- | gtk/maketypes.awk | 155 | ||||
-rw-r--r-- | gtk/oldest-source-stamp | 0 |
24 files changed, 313 insertions, 711 deletions
diff --git a/gtk/.cvsignore b/gtk/.cvsignore index 443ebb087..0484fe777 100644 --- a/gtk/.cvsignore +++ b/gtk/.cvsignore @@ -14,16 +14,14 @@ gtkmarshal.h gtkmarshal.c gtkmarshalers.h gtkmarshalers.c +gtktypebuiltins.c gtktypebuiltins.h -gtktypebuiltins_ids.c -gtktypebuiltins_vars.c -gtktypebuiltins_evals.c +gtktypebuiltinss.c gtk.defs gtk-win32.rc testdnd stamp-gtktypebuiltins.h stamp-gtkmarshal.h stamp-gtkmarshalers.h -stamp-gtk.defs gtk-query-immodules-2.0 .saved diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 779bea0c9..0115e06d0 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -385,6 +385,7 @@ gtk_c_sources = @STRIP_BEGIN@ \ gtktreestore.c \ gtktreeview.c \ gtktreeviewcolumn.c \ + gtktypebuiltins.c \ gtktypeutils.c \ gtkvbbox.c \ gtkvbox.c \ @@ -423,9 +424,7 @@ gtk_built_sources = @STRIP_BEGIN@ \ stamp-gtk.defs \ stamp-gtktypebuiltins.h \ stamp-gtkmarshalers.h \ - gtktypebuiltins_vars.c \ - gtktypebuiltins_ids.c \ - gtktypebuiltins_evals.c \ + gtktypebuiltins.c \ gtkmarshalers.c \ gtkmarshalers.h \ gtkmarshal.c \ @@ -437,8 +436,6 @@ gtk_built_sources = @STRIP_BEGIN@ \ # their own .lo rules and don't get publically installed gtk_extra_sources = @STRIP_BEGIN@ \ gtkversion.h.in \ - maketypes.awk \ - makeenums.h \ gtk-boxed.defs \ gtkmarshalers.list \ gtkmarshal.list \ @@ -456,44 +453,40 @@ EXTRA_DIST += $(gtk_built_sources) # rules to generate built sources # # setup autogeneration dependancies -gen_sources = xgen-gdef xgen-gtbh xgen-gtbvc xgen-gtbic xgen-gtbec xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc +gen_sources = xgen-gdef xgen-gtbh xgen-gtic xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc CLEANFILES = $(gen_sources) -## automake 1.5 supports this without the horrible 'oldest-source-stamp' -## hack below +## automake 1.5 supports this without $(OBJECTS): $(gtk_built_sources) hack #BUILT_SOURCES = $(gtk_built_sources) -Makefile: oldest-source-stamp # oh boy, does automake SUCK! -oldest-source-stamp: $(gtk_built_sources) -$(OBJECTS): oldest-source-stamp ${gtk_built_public_sources} # this is our oldest file, used for implicit auto-generation deps +$(libgtk_x11_1_3_la_OBJECTS) $(libgtk_linux_fb_1_3_la_OBJECTS) $(libgtk_win32_1_3_la_OBJECTS): ${gtk_built_public_sources} -# initial creation of the real stamp-* files -gtk.defs gtkmarshalers.h gtktypebuiltins.h: # never add deps here - test -f "$(srcdir)/$(@F)" || touch $(srcdir)/$(@F) -# normal autogeneration rules # all autogenerated files need to be generated in the srcdir, # so old versions get remade and are not confused with newer # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. -$(srcdir)/stamp-gtk.defs: @REBUILD@ gtk.defs gtk-boxed.defs $(gtk_public_h_sources) - case @GLIB_MKENUMS@ in \ - .*) glib_mkenums=`pwd`/@GLIB_MKENUMS@ ;; \ - *) glib_mkenums=@GLIB_MKENUMS@ ;; \ - esac; \ - cd $(srcdir) \ - && $$glib_mkenums --comments ";; @comment@" \ - --fprod "; enumerations from \"@filename@\"\n " \ - --vhead "(define-@type@ @EnumName@" \ - --vprod " (@valuenick@ @VALUENAME@)" \ - --vtail ")" \ - $(gtk_public_h_sources) > xgen-gdef \ - && cat gtk-boxed.defs >> xgen-gdef \ - && (cmp -s xgen-gdef gtk.defs || cp xgen-gdef gtk.defs) \ - && rm -f xgen-gdef \ - && echo timestamp > $(@F) - -$(srcdir)/stamp-gtkmarshalers.h: @REBUILD@ gtkmarshalers.list gtkmarshalers.h +$(srcdir)/gtk.defs: @REBUILD@ gtk.defs gtk-boxed.defs $(gtk_public_h_sources) \ + case @GLIB_MKENUMS@ in \ + .*) glib_mkenums=`pwd`/@GLIB_MKENUMS@ ;; \ + *) glib_mkenums=@GLIB_MKENUMS@ ;; \ + esac; \ + cd $(srcdir) \ + && $$glib_mkenums --comments ";; @comment@" \ + --fprod "; enumerations from \"@filename@\"\n " \ + --vhead "(define-@type@ @EnumName@" \ + --vprod " (@valuenick@ @VALUENAME@)" \ + --vtail ")" \ + $(gtk_public_h_sources) > xgen-gdef \ + && cat gtk-boxed.defs >> xgen-gdef \ + && gtk.defs || cp xgen-gdef gtk.defs \ + && rm -f xgen-gdef + +all-local: @REBUILD@ gtk.defs + +$(srcdir)/gtkmarshalers.h: stamp-gtkmarshalers.h + @true +stamp-gtkmarshalers.h: @REBUILD@ gtkmarshalers.list case @GLIB_GENMARSHAL@ in \ .*) glib_genmarshal=`pwd`/@GLIB_GENMARSHAL@ ;; \ *) glib_genmarshal=@GLIB_GENMARSHAL@ ;; \ @@ -502,8 +495,8 @@ $(srcdir)/stamp-gtkmarshalers.h: @REBUILD@ gtkmarshalers.list gtkmarshalers.h && $$glib_genmarshal --prefix=_gtk_marshal gtkmarshalers.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh gtkmarshalers.h || cp xgen-gmlh gtkmarshalers.h) \ && rm -f xgen-gmlh \ - && echo timestamp > $(@F) -$(srcdir)/gtkmarshalers.c: @REBUILD@ $(srcdir)/stamp-gtkmarshalers.h + && echo timestamp > $(@F) +$(srcdir)/gtkmarshalers.c: @REBUILD@ gtkmarshalers.list case @GLIB_GENMARSHAL@ in \ .*) glib_genmarshal=`pwd`/@GLIB_GENMARSHAL@ ;; \ *) glib_genmarshal=@GLIB_GENMARSHAL@ ;; \ @@ -511,8 +504,11 @@ $(srcdir)/gtkmarshalers.c: @REBUILD@ $(srcdir)/stamp-gtkmarshalers.h cd $(srcdir) \ && $$glib_genmarshal --prefix=_gtk_marshal gtkmarshalers.list --body >> xgen-gmlc \ && cp xgen-gmlc gtkmarshalers.c \ - && rm -f xgen-gmlc -$(srcdir)/gtkmarshal.h: @REBUILD@ gtkmarshal.list + && rm -f xgen-gmlc + +$(srcdir)/gtkmarshal.h: stamp-gtkmarshal.h + @true +stamp-gtkmarshal.h: @REBUILD@ gtkmarshal.list case @GLIB_GENMARSHAL@ in \ .*) glib_genmarshal=`pwd`/@GLIB_GENMARSHAL@ ;; \ *) glib_genmarshal=@GLIB_GENMARSHAL@ ;; \ @@ -521,9 +517,10 @@ $(srcdir)/gtkmarshal.h: @REBUILD@ gtkmarshal.list && echo "#ifndef GTK_DISABLE_DEPRECATED" > xgen-gmh \ && $$glib_genmarshal --prefix=gtk_marshal gtkmarshal.list --header >> xgen-gmh \ && echo "#endif /* GTK_DISABLE_DEPRECATED */" >> xgen-gmh \ - && cp xgen-gmh gtkmarshal.h \ - && rm -f xgen-gmh -$(srcdir)/gtkmarshal.c: @REBUILD@ gtkmarshal.h + && (cmp -s xgen-gmh gtkmarshal.h || cp xgen-gmh gtkmarshal.h) \ + && rm -f xgen-gmh \ + && echo timestamp > $(@F) +$(srcdir)/gtkmarshal.c: @REBUILD@ gtkmarshal.list case @GLIB_GENMARSHAL@ in \ .*) glib_genmarshal=`pwd`/@GLIB_GENMARSHAL@ ;; \ *) glib_genmarshal=@GLIB_GENMARSHAL@ ;; \ @@ -533,37 +530,28 @@ $(srcdir)/gtkmarshal.c: @REBUILD@ gtkmarshal.h && cp xgen-gmc gtkmarshal.c \ && rm -f xgen-gmc -$(srcdir)/stamp-gtktypebuiltins.h: @REBUILD@ maketypes.awk $(srcdir)/stamp-gtk.defs gtktypebuiltins.h - cd $(srcdir) \ - && LC_ALL=C $(AWK) -f maketypes.awk gtk.defs macros > xgen-gtbh \ - && (cmp -s xgen-gtbh gtktypebuiltins.h || cp xgen-gtbh gtktypebuiltins.h) \ +$(srcdir)/gtktypebuiltins.h: stamp-gtktypebuiltins.h + @true +stamp-gtktypebuiltins.h: @REBUILD@ $(gtk_public_h_sources) Makefile + ( cd $(srcdir) && glib-mkenums \ + --fhead "#ifndef __GTK_TYPE_BUILTINS_H__\n#define __GTK_TYPE_BUILTINS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define GTK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __GTK_TYPE_BUILTINS_H__ */" \ + $(gtk_public_h_sources) ) >> xgen-gtbh \ + && (cmp -s xgen-gtbh $(srcdir)/gtktypebuiltins.h || cp xgen-gtbh $(srcdir)/gtktypebuiltins.h ) \ && rm -f xgen-gtbh \ && echo timestamp > $(@F) -$(srcdir)/gtktypebuiltins_vars.c: @REBUILD@ maketypes.awk $(srcdir)/stamp-gtk.defs - cd $(srcdir) \ - && LC_ALL=C $(AWK) -f maketypes.awk gtk.defs variables > xgen-gtbvc \ - && cp xgen-gtbvc $(@F) \ - && rm -f xgen-gtbvc -$(srcdir)/gtktypebuiltins_ids.c: @REBUILD@ maketypes.awk $(srcdir)/stamp-gtk.defs - cd $(srcdir) \ - && LC_ALL=C $(AWK) -f maketypes.awk gtk.defs entries > xgen-gtbic \ - && cp xgen-gtbic $(@F) \ - && rm -f xgen-gtbic -$(srcdir)/gtktypebuiltins_evals.c: @REBUILD@ $(gtk_public_h_sources) - case @GLIB_MKENUMS@ in \ - .*) glib_mkenums=`pwd`/@GLIB_MKENUMS@ ;; \ - *) glib_mkenums=@GLIB_MKENUMS@ ;; \ - esac; \ - cd $(srcdir) \ - && $$glib_mkenums \ +$(srcdir)/gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) Makefile + ( cd $(srcdir) && glib-mkenums \ + --fhead "#define GTK_ENABLE_BROKEN\n#include \"gtk.h\"\n#include \"gtkprivate.h\"" \ --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "static const GtkEnumValue _@enum_name@_values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n};" \ - $(gtk_public_h_sources) > xgen-gtbec \ - && cp xgen-gtbec $(@F) \ - && rm -f xgen-gtbec - + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(gtk_public_h_sources) ) > xgen-gtbc \ + && cp xgen-gtbc $(srcdir)/gtktypebuiltins.c \ + && rm -f xgen-gtbc # target platform: lib_LTLIBRARIES = $(gtktargetlib) diff --git a/gtk/genmarshal.pl b/gtk/genmarshal.pl deleted file mode 100755 index cfde7948b..000000000 --- a/gtk/genmarshal.pl +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/perl -w -# -# by Elliot Lee <sopwith@redhat.com> - -%trans = ( "NONE"=>"void", "CHAR"=>"char", - "BOOL"=>"gboolean", "INT"=>"gint", - "UINT"=>"guint", "LONG"=>"glong", - "ULONG"=>"gulong", "FLOAT"=>"gfloat", - "DOUBLE"=>"gdouble", "STRING"=>"gpointer", - "ENUM"=>"gint", "FLAGS"=>"gint", - "BOXED"=>"gpointer", - "POINTER"=>"gpointer", - "OBJECT"=>"gpointer", - -# complex types. These need special handling. - "SIGNAL"=>"SIGNAL" - ); - -if ($#ARGV != 2) { - die ("Wrong number of arguments given, need <source> <target.h> <target.c>"); -} - -open(IL, "<" . $ARGV[0]) || die ("Open failed: $!"); -open(OH, ">" . $ARGV[1]) || die ("Open failed: $!"); -open(OS, ">" . $ARGV[2]) || die ("Open failed: $!"); - -print OH <<EOT; -#ifndef __GTK_MARSHAL_H__ -#define __GTK_MARSHAL_H__ - -#include <gtk/gtktypeutils.h> -#include <gtk/gtkobject.h> - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define gtk_signal_default_marshaller gtk_marshal_NONE__NONE - -EOT - -print OS qq(#include "gtkmarshal.h"\n\n); - -while (defined($aline = <IL>)) { - chomp $aline; - ($retval, $paramlist) = split(/:/, $aline, 2); - @params = split(/\s*,\s*/, $paramlist); - - my $funcname = $retval."__".join("_",@params); - my $defname; - - next if (exists $defs{$funcname}); - - $doequiv = 0; - for (@params, $retval) { - if ($trans{$_} eq "gpointer" && $_ ne "POINTER") { - $doequiv = 1; - last; - } - if($_ eq "ENUM" || $_ eq "UINT" || $_ eq "ULONG") { - $doequiv = 1; - last; - } - } - - # Translate all function pointers to gpointer - $defname = $funcname; - if($doequiv) { - print OH "#define gtk_marshal_$funcname "; - $defs{$defname} = 1; - - for (@params, $retval) { - if ($trans{$_} eq "gpointer") { - $_ = "POINTER"; - } - if($_ eq "ENUM") { - $_ = "UINT"; - } - if($_ eq "UINT") { - $_ = "INT"; # Unvalidated assumption - please check - } - if($_ eq "ULONG") { - $_ = "LONG"; - } - } - - $funcname = $retval."__".join("_",@params); - - print OH "gtk_marshal_$funcname\n\n"; - next if (exists $defs{$funcname}); - } - $defs{$funcname} = 1; - - print OH <<EOT; -void gtk_marshal_$funcname (GtkObject *object, - GtkSignalFunc func, - gpointer func_data, - GtkArg *args); - -EOT - - print OS "typedef $trans{$retval} (*GtkSignal_$funcname) (GtkObject *object, \n"; - $argn = 1; - for (@params) { - if($_ eq "SIGNAL") { - print OS "gpointer arg".$argn."a,\n"; - print OS "gpointer arg".$argn."b,\n"; - $argn++; - } else { - print OS "$trans{$_} arg".$argn++.",\n" unless $_ eq "NONE"; - } - } - print OS "gpointer user_data);\n"; - - print OS <<EOT; -void gtk_marshal_$funcname (GtkObject *object, - GtkSignalFunc func, - gpointer func_data, - GtkArg *args) -{ - GtkSignal_$funcname rfunc; -EOT - - if($retval ne "NONE") { - print OS " $trans{$retval} *return_val;\n"; - $retn = 0; - $retn = scalar @params unless $params[0] eq "NONE"; - print OS " return_val = GTK_RETLOC_$retval (args[$retn]);\n"; - } - print OS " rfunc = (GtkSignal_$funcname) func;\n"; - print OS " *return_val = " unless $retval eq "NONE"; - print OS " (* rfunc) (object,\n"; - - for($i = 0; $i < (scalar @params); $i++) { - if ($params[$i] eq "SIGNAL") { - print OS <<EOT; -GTK_VALUE_SIGNAL(args[$i]).f, -GTK_VALUE_SIGNAL(args[$i]).d, -EOT - } elsif ($params[$i] eq "NONE") { - } else { - print OS " GTK_VALUE_$params[$i](args[$i]),\n"; - } - } - - print OS " func_data);\n}\n\n"; -} -print OH <<EOT; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GTK_MARSHAL_H__ */ -EOT - -close(IL); close(OH); close(OS); diff --git a/gtk/gtk.def b/gtk/gtk.def index 62487ad20..578ef63bd 100755 --- a/gtk/gtk.def +++ b/gtk/gtk.def @@ -1,91 +1,84 @@ EXPORTS - GTK_TYPE_ACCEL_FLAGS - GTK_TYPE_ANCHOR_TYPE - GTK_TYPE_ARG_FLAGS - GTK_TYPE_ARROW_TYPE - GTK_TYPE_ATTACH_OPTIONS - GTK_TYPE_BORDER - GTK_TYPE_BUTTONS_TYPE - GTK_TYPE_BUTTON_ACTION - GTK_TYPE_BUTTON_BOX_STYLE - GTK_TYPE_CALENDAR_DISPLAY_OPTIONS - GTK_TYPE_CELL_RENDERER_MODE - GTK_TYPE_CELL_RENDERER_STATE - GTK_TYPE_CELL_TYPE - GTK_TYPE_CLIST_DRAG_POS - GTK_TYPE_CORNER_TYPE - GTK_TYPE_CTREE_EXPANDER_STYLE - GTK_TYPE_CTREE_EXPANSION_TYPE - GTK_TYPE_CTREE_LINE_STYLE - GTK_TYPE_CTREE_POS - GTK_TYPE_CURVE_TYPE - GTK_TYPE_DEBUG_FLAG - GTK_TYPE_DELETE_TYPE - GTK_TYPE_DEST_DEFAULTS - GTK_TYPE_DIALOG_FLAGS - GTK_TYPE_DIRECTION_TYPE - GTK_TYPE_EXPANDER_STYLE - GTK_TYPE_ICON_SET - GTK_TYPE_ICON_SIZE - GTK_TYPE_IMAGE_TYPE - GTK_TYPE_JUSTIFICATION - GTK_TYPE_MATCH_TYPE - GTK_TYPE_MENU_DIRECTION_TYPE - GTK_TYPE_MESSAGE_TYPE - GTK_TYPE_METRIC_TYPE - GTK_TYPE_MOVEMENT_STEP - GTK_TYPE_NOTEBOOK_TAB - GTK_TYPE_OBJECT_FLAGS - GTK_TYPE_ORIENTATION - GTK_TYPE_PACK_TYPE - GTK_TYPE_PATH_PRIORITY_TYPE - GTK_TYPE_PATH_TYPE - GTK_TYPE_POLICY_TYPE - GTK_TYPE_POSITION_TYPE - GTK_TYPE_PREVIEW_TYPE - GTK_TYPE_PRIVATE_FLAGS - GTK_TYPE_PROGRESS_BAR_ORIENTATION - GTK_TYPE_PROGRESS_BAR_STYLE - GTK_TYPE_RC_FLAGS - GTK_TYPE_RC_TOKEN_TYPE - GTK_TYPE_RELIEF_STYLE - GTK_TYPE_REQUISITION - GTK_TYPE_RESIZE_MODE - GTK_TYPE_RESPONSE_TYPE - GTK_TYPE_SCROLL_TYPE - GTK_TYPE_SELECTION_DATA - GTK_TYPE_SELECTION_MODE - GTK_TYPE_SHADOW_TYPE - GTK_TYPE_SIDE_TYPE - GTK_TYPE_SIGNAL_RUN_TYPE - GTK_TYPE_SIZE_GROUP_MODE - GTK_TYPE_SORT_TYPE - GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY - GTK_TYPE_SPIN_TYPE - GTK_TYPE_STATE_TYPE - GTK_TYPE_SUBMENU_DIRECTION - GTK_TYPE_SUBMENU_PLACEMENT - GTK_TYPE_TARGET_FLAGS - GTK_TYPE_TEXT_ATTRIBUTES - GTK_TYPE_TEXT_DIRECTION - GTK_TYPE_TEXT_ITER - GTK_TYPE_TEXT_WINDOW_TYPE - GTK_TYPE_TOOLBAR_CHILD_TYPE - GTK_TYPE_TOOLBAR_SPACE_STYLE - GTK_TYPE_TOOLBAR_STYLE - GTK_TYPE_TREE_ITER - GTK_TYPE_TREE_MODEL_FLAGS - GTK_TYPE_TREE_PATH - GTK_TYPE_TREE_VIEW_COLUMN_SIZING - GTK_TYPE_TREE_VIEW_DROP_POSITION - GTK_TYPE_TREE_VIEW_MODE - GTK_TYPE_UPDATE_TYPE - GTK_TYPE_VISIBILITY - GTK_TYPE_WIDGET_FLAGS - GTK_TYPE_WIDGET_HELP_TYPE - GTK_TYPE_WINDOW_POSITION - GTK_TYPE_WINDOW_TYPE - GTK_TYPE_WRAP_MODE + gtk_accel_flags_get_type + gtk_anchor_type_get_type + gtk_arg_flags_get_type + gtk_arrow_type_get_type + gtk_attach_options_get_type + gtk_buttons_type_get_type + gtk_button_action_get_type + gtk_button_box_style_get_type + gtk_calendar_display_options_get_type + gtk_cell_renderer_mode_get_type + gtk_cell_renderer_state_get_type + gtk_cell_type_get_type + gtk_clist_drag_pos_get_type + gtk_corner_type_get_type + gtk_ctree_expander_style_get_type + gtk_ctree_expansion_type_get_type + gtk_ctree_line_style_get_type + gtk_ctree_pos_get_type + gtk_curve_type_get_type + gtk_debug_flag_get_type + gtk_delete_type_get_type + gtk_dest_defaults_get_type + gtk_dialog_flags_get_type + gtk_direction_type_get_type + gtk_expander_style_get_type + gtk_icon_size_get_type + gtk_image_type_get_type + gtk_justification_get_type + gtk_match_type_get_type + gtk_menu_direction_type_get_type + gtk_message_type_get_type + gtk_metric_type_get_type + gtk_movement_step_get_type + gtk_notebook_tab_get_type + gtk_object_flags_get_type + gtk_orientation_get_type + gtk_pack_type_get_type + gtk_path_priority_type_get_type + gtk_path_type_get_type + gtk_policy_type_get_type + gtk_position_type_get_type + gtk_preview_type_get_type + gtk_private_flags_get_type + gtk_progress_bar_orientation_get_type + gtk_progress_bar_style_get_type + gtk_rc_flags_get_type + gtk_rc_token_type_get_type + gtk_relief_style_get_type + gtk_resize_mode_get_type + gtk_response_type_get_type + gtk_scroll_type_get_type + gtk_selection_mode_get_type + gtk_shadow_type_get_type + gtk_side_type_get_type + gtk_signal_run_type_get_type + gtk_size_group_mode_get_type + gtk_sort_type_get_type + gtk_spin_button_update_policy_get_type + gtk_spin_type_get_type + gtk_state_type_get_type + gtk_submenu_direction_get_type + gtk_submenu_placement_get_type + gtk_target_flags_get_type + gtk_text_direction_get_type + gtk_text_search_flags_get_type + gtk_text_window_type_get_type + gtk_toolbar_child_type_get_type + gtk_toolbar_space_style_get_type + gtk_toolbar_style_get_type + gtk_tree_model_flags_get_type + gtk_tree_view_column_sizing_get_type + gtk_tree_view_drop_position_get_type + gtk_tree_view_mode_get_type + gtk_update_type_get_type + gtk_visibility_get_type + gtk_widget_flags_get_type + gtk_widget_help_type_get_type + gtk_window_position_get_type + gtk_window_type_get_type + gtk_wrap_mode_get_type gtk_accel_group_connect gtk_accel_group_connect_by_path @@ -157,6 +150,7 @@ EXPORTS gtk_bindings_activate gtk_border_copy gtk_border_free + gtk_border_get_type gtk_box_get_homogeneous gtk_box_get_spacing gtk_box_get_type @@ -678,6 +672,7 @@ EXPORTS gtk_icon_set_add_source gtk_icon_set_copy gtk_icon_set_get_sizes + gtk_icon_set_get_type gtk_icon_set_new gtk_icon_set_new_from_pixbuf gtk_icon_set_ref @@ -698,6 +693,7 @@ EXPORTS gtk_icon_source_get_size_wildcarded gtk_icon_source_get_state gtk_icon_source_get_state_wildcarded + gtk_icon_source_get_type gtk_icon_source_new gtk_icon_source_set_direction gtk_icon_source_set_direction_wildcarded @@ -1203,6 +1199,7 @@ EXPORTS gtk_rc_style_unref gtk_requisition_copy gtk_requisition_free + gtk_requisition_get_type gtk_rgb_to_hsv gtk_ruler_draw_pos gtk_ruler_draw_ticks @@ -1241,6 +1238,7 @@ EXPORTS gtk_selection_data_free gtk_selection_data_get_targets gtk_selection_data_get_text + gtk_selection_data_get_type gtk_selection_data_set gtk_selection_data_set_text gtk_selection_data_targets_include_text @@ -1363,6 +1361,7 @@ EXPORTS gtk_text_anchored_child_set_layout gtk_text_attributes_copy gtk_text_attributes_copy_values + gtk_text_attributes_get_type gtk_text_attributes_new gtk_text_attributes_ref gtk_text_attributes_unref @@ -1493,6 +1492,7 @@ EXPORTS gtk_text_iter_get_tags gtk_text_iter_get_text gtk_text_iter_get_toggled_tags + gtk_text_iter_get_type gtk_text_iter_get_visible_line_index gtk_text_iter_get_visible_line_offset gtk_text_iter_get_visible_slice @@ -1718,6 +1718,7 @@ EXPORTS gtk_tree_item_set_subtree gtk_tree_iter_copy gtk_tree_iter_free + gtk_tree_iter_get_type gtk_tree_model_foreach gtk_tree_model_get gtk_tree_model_get_column_type @@ -1760,6 +1761,7 @@ EXPORTS gtk_tree_path_free gtk_tree_path_get_depth gtk_tree_path_get_indices + gtk_tree_path_get_type gtk_tree_path_is_ancestor gtk_tree_path_is_descendant gtk_tree_path_new diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index 306591de5..79eda20e1 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1190,6 +1190,19 @@ gtk_icon_set_unref (GtkIconSet *icon_set) } } +GType +gtk_icon_set_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeIconSet", + (GBoxedCopyFunc) gtk_icon_set_ref, + (GBoxedFreeFunc) gtk_icon_set_unref); + + return our_type; +} + /** * gtk_icon_set_copy: * @icon_set: a #GtkIconSet @@ -1660,6 +1673,19 @@ gtk_icon_source_free (GtkIconSource *source) g_free (source); } +GType +gtk_icon_source_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeIconSource", + (GBoxedCopyFunc) gtk_icon_source_copy, + (GBoxedFreeFunc) gtk_icon_source_free); + + return our_type; +} + /** * gtk_icon_source_set_filename: * @source: a #GtkIconSource diff --git a/gtk/gtkiconfactory.h b/gtk/gtkiconfactory.h index 53496a9c4..de02cfd9f 100644 --- a/gtk/gtkiconfactory.h +++ b/gtk/gtkiconfactory.h @@ -42,6 +42,8 @@ typedef struct _GtkIconFactoryClass GtkIconFactoryClass; #define GTK_IS_ICON_FACTORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ICON_FACTORY)) #define GTK_IS_ICON_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_FACTORY)) #define GTK_ICON_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_FACTORY, GtkIconFactoryClass)) +#define GTK_TYPE_ICON_SET (gtk_icon_set_get_type ()) +#define GTK_TYPE_ICON_SOURCE (gtk_icon_source_get_type ()) struct _GtkIconFactory { @@ -99,6 +101,7 @@ G_CONST_RETURN gchar* gtk_icon_size_get_name (GtkIconSize size); /* Icon sets */ +GType gtk_icon_set_get_type (void); GtkIconSet* gtk_icon_set_new (void); GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf); @@ -125,6 +128,7 @@ void gtk_icon_set_get_sizes (GtkIconSet *icon_set, GtkIconSize **sizes, gint *n_sizes); +GType gtk_icon_source_get_type (void); GtkIconSource* gtk_icon_source_new (void); GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source); void gtk_icon_source_free (GtkIconSource *source); diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 95018fcfb..1974fb1c7 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1819,6 +1819,19 @@ gtk_selection_data_free (GtkSelectionData *data) g_free (data); } +GType +gtk_selection_data_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeSelectionData", + (GBoxedCopyFunc) gtk_selection_data_copy, + (GBoxedFreeFunc) gtk_selection_data_free); + + return our_type; +} + static int gtk_selection_bytes_per_item (gint format) { diff --git a/gtk/gtkselection.h b/gtk/gtkselection.h index 76036e9f1..3e25d0d19 100644 --- a/gtk/gtkselection.h +++ b/gtk/gtkselection.h @@ -39,6 +39,8 @@ extern "C" { typedef struct _GtkTargetList GtkTargetList; typedef struct _GtkTargetEntry GtkTargetEntry; +#define GTK_TYPE_SELECTION_DATA (gtk_selection_data_get_type ()) + /* The contents of a selection are returned in a GtkSelectionData * structure. selection/target identify the request. type specifies * the type of the return; if length < 0, and the data should be @@ -151,8 +153,10 @@ gboolean gtk_selection_notify (GtkWidget *widget, GdkEventSelection *event); gboolean gtk_selection_property_notify (GtkWidget *widget, GdkEventProperty *event); -GtkSelectionData *gtk_selection_data_copy (GtkSelectionData *data); -void gtk_selection_data_free (GtkSelectionData *data); + +GType gtk_selection_data_get_type (void); +GtkSelectionData *gtk_selection_data_copy (GtkSelectionData *data); +void gtk_selection_data_free (GtkSelectionData *data); diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index 30104c441..472a20c41 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -5545,6 +5545,19 @@ gtk_border_free (GtkBorder *border) g_free (border); } +GType +gtk_border_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeBorder", + (GBoxedCopyFunc) gtk_border_copy, + (GBoxedFreeFunc) gtk_border_free); + + return our_type; +} + /** * gtk_style_get_font: * @style: a #GtkStyle diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h index 02b8a6e27..844187466 100644 --- a/gtk/gtkstyle.h +++ b/gtk/gtkstyle.h @@ -43,6 +43,8 @@ extern "C" { #define GTK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE)) #define GTK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass)) +#define GTK_TYPE_BORDER (gtk_border_get_type ()) + /* Some forward declarations needed to rationalize the header * files. */ @@ -849,8 +851,9 @@ void gtk_paint_resize_grip (GtkStyle *style, gint height); -GtkBorder *gtk_border_copy (const GtkBorder *border); -void gtk_border_free (GtkBorder *border); +GType gtk_border_get_type (void); +GtkBorder *gtk_border_copy (const GtkBorder *border); +void gtk_border_free ( GtkBorder *border); /* --- private API --- */ const GValue* _gtk_style_peek_property_value (GtkStyle *style, diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index 166ddde49..bb30ed0bb 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -463,6 +463,19 @@ gtk_text_iter_free (GtkTextIter *iter) g_free (iter); } +GType +gtk_text_iter_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeTextIter", + (GBoxedCopyFunc) gtk_text_iter_copy, + (GBoxedFreeFunc) gtk_text_iter_free); + + return our_type; +} + GtkTextLineSegment* _gtk_text_iter_get_indexable_segment (const GtkTextIter *iter) { diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h index 7c0396871..0c8c56cc9 100644 --- a/gtk/gtktextiter.h +++ b/gtk/gtktextiter.h @@ -48,6 +48,8 @@ typedef enum { typedef struct _GtkTextBuffer GtkTextBuffer; +#define GTK_TYPE_TEXT_ITER (gtk_text_iter_get_type ()) + struct _GtkTextIter { /* GtkTextIter is an opaque datatype; ignore all these fields. * Initialize the iter with gtk_text_buffer_get_iter_* @@ -83,6 +85,8 @@ GtkTextBuffer *gtk_text_iter_get_buffer (const GtkTextIter *iter); GtkTextIter *gtk_text_iter_copy (const GtkTextIter *iter); void gtk_text_iter_free (GtkTextIter *iter); +GType gtk_text_iter_get_type (void); + /* * Convert to different kinds of index */ diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 7000d88b5..b6baa4b26 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -1865,6 +1865,19 @@ gtk_text_attributes_copy (GtkTextAttributes *src) return dest; } +GType +gtk_text_attributes_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeTextAttributes", + (GBoxedCopyFunc) gtk_text_attributes_ref, + (GBoxedFreeFunc) gtk_text_attributes_unref); + + return our_type; +} + /** * gtk_text_attributes_copy_values: * @src: a #GtkTextAttributes diff --git a/gtk/gtktexttag.h b/gtk/gtktexttag.h index 03a38a2ca..52f54fe6f 100644 --- a/gtk/gtktexttag.h +++ b/gtk/gtktexttag.h @@ -20,6 +20,8 @@ typedef struct _GtkTextAttributes GtkTextAttributes; #define GTK_IS_TEXT_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_TAG)) #define GTK_TEXT_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_TAG, GtkTextTagClass)) +#define GTK_TYPE_TEXT_ATTRIBUTES (gtk_text_attributes_get_type ()) + typedef struct _GtkTextTag GtkTextTag; typedef struct _GtkTextTagClass GtkTextTagClass; @@ -213,6 +215,8 @@ void gtk_text_attributes_copy_values (GtkTextAttributes *src, void gtk_text_attributes_unref (GtkTextAttributes *values); void gtk_text_attributes_ref (GtkTextAttributes *values); +GType gtk_text_attributes_get_type (void); + #ifdef __cplusplus } diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 7a62b1e14..ece4ed251 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -358,6 +358,19 @@ gtk_tree_path_copy (GtkTreePath *path) return retval; } +GType +gtk_tree_path_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeTreePath", + (GBoxedCopyFunc) gtk_tree_path_copy, + (GBoxedFreeFunc) gtk_tree_path_free); + + return our_type; +} + /** * gtk_tree_path_compare: * @a: A #GtkTreePath. @@ -569,6 +582,19 @@ gtk_tree_iter_free (GtkTreeIter *iter) g_free (iter); } +GType +gtk_tree_iter_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeTreeIter", + (GBoxedCopyFunc) gtk_tree_iter_copy, + (GBoxedFreeFunc) gtk_tree_iter_free); + + return our_type; +} + /** * gtk_tree_model_get_flags: * @tree_model: A #GtkTreeModel. diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index 6bc0e231d..09109a8a1 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -29,6 +29,9 @@ G_BEGIN_DECLS #define GTK_IS_TREE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_MODEL)) #define GTK_TREE_MODEL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_TREE_MODEL, GtkTreeModelIface)) +#define GTK_TYPE_TREE_ITER (gtk_tree_iter_get_type ()) +#define GTK_TYPE_TREE_PATH (gtk_tree_path_get_type ()) + typedef struct _GtkTreeIter GtkTreeIter; typedef struct _GtkTreePath GtkTreePath; typedef struct _GtkTreeRowReference GtkTreeRowReference; @@ -124,6 +127,7 @@ gint gtk_tree_path_get_depth (GtkTreePath *path); gint *gtk_tree_path_get_indices (GtkTreePath *path); void gtk_tree_path_free (GtkTreePath *path); GtkTreePath *gtk_tree_path_copy (GtkTreePath *path); +GType gtk_tree_path_get_type (void); gint gtk_tree_path_compare (const GtkTreePath *a, const GtkTreePath *b); void gtk_tree_path_next (GtkTreePath *path); @@ -163,6 +167,7 @@ void gtk_tree_row_reference_reordered (GObject *proxy, /* GtkTreeIter operations */ GtkTreeIter * gtk_tree_iter_copy (GtkTreeIter *iter); void gtk_tree_iter_free (GtkTreeIter *iter); +GType gtk_tree_iter_get_type (void); GtkType gtk_tree_model_get_type (void) G_GNUC_CONST; GtkTreeModelFlags gtk_tree_model_get_flags (GtkTreeModel *tree_model); diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c index f5b191809..8eed73056 100644 --- a/gtk/gtktypeutils.c +++ b/gtk/gtktypeutils.c @@ -101,28 +101,6 @@ gtk_type_new (GtkType type) return object; } -/* includes for various places - * with enum definitions - */ -#define GTK_ENABLE_BROKEN -#include "makeenums.h" -/* type variable declarations - */ -#include "gtktypebuiltins_vars.c" -GType GTK_TYPE_IDENTIFIER = 0; -#include "gtktypebuiltins_evals.c" /* enum value definition arrays */ - -/* Hack to communicate with GLib object debugging for now - */ -#ifdef G_OS_WIN32 -#define IMPORT __declspec(dllimport) -#else -#define IMPORT -#endif - -#include <gtk.h> /* for gtktypebuiltins_ids.c */ -#include <gdk.h> /* gtktypebuiltins_ids.c */ - void gtk_type_init (GTypeDebugFlags debug_flags) { @@ -130,19 +108,6 @@ gtk_type_init (GTypeDebugFlags debug_flags) if (!initialized) { - static struct { - gchar *type_name; - GtkType *type_id; - GtkType parent; - gconstpointer pointer1; - gpointer pointer2; - } builtin_info[GTK_TYPE_N_BUILTINS + 1] = { -#include "gtktypebuiltins_ids.c" /* type entries */ - { NULL } - }; - GTypeInfo tinfo = { 0, }; - guint i; - initialized = TRUE; /* initialize GLib type system @@ -152,36 +117,21 @@ gtk_type_init (GTypeDebugFlags debug_flags) /* GTK_TYPE_OBJECT */ gtk_object_get_type (); + } +} - /* GTK_TYPE_IDENTIFIER - */ - GTK_TYPE_IDENTIFIER = g_type_register_static (G_TYPE_STRING, "GtkIdentifier", &tinfo, 0); - - /* enums and flags - */ - for (i = 0; i < GTK_TYPE_N_BUILTINS; i++) - { - GtkType type_id = 0; - - if (builtin_info[i].parent == G_TYPE_ENUM) - type_id = g_enum_register_static (builtin_info[i].type_name, builtin_info[i].pointer1); - else if (builtin_info[i].parent == G_TYPE_FLAGS) - type_id = g_flags_register_static (builtin_info[i].type_name, builtin_info[i].pointer1); - else if (builtin_info[i].parent == GTK_TYPE_BOXED) - { - if (builtin_info[i].pointer1 && builtin_info[i].pointer2) - type_id = g_boxed_type_register_static (builtin_info[i].type_name, - builtin_info[i].pointer1, - builtin_info[i].pointer2); - else - type_id = g_type_register_static (GTK_TYPE_BOXED, builtin_info[i].type_name, &tinfo, 0); - } - else - g_assert_not_reached (); - - *builtin_info[i].type_id = type_id; - } +GType +gtk_identifier_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + { + GTypeInfo tinfo = { 0, }; + our_type = g_type_register_static (G_TYPE_STRING, "GtkIdentifier", &tinfo, 0); } + + return our_type; } GtkEnumValue* @@ -243,3 +193,4 @@ gtk_type_flags_find_value (GtkType flags_type, return value; } + diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h index 494069864..2200af8af 100644 --- a/gtk/gtktypeutils.h +++ b/gtk/gtktypeutils.h @@ -105,6 +105,9 @@ G_END_DECLS G_BEGIN_DECLS +/* urg */ +#define GTK_TYPE_IDENTIFIER (gtk_identifier_get_type ()) +GType gtk_identifier_get_type (void); /* --- typedefs --- */ /* here we come with some necessary forward declarations for structures and @@ -249,19 +252,6 @@ GtkEnumValue* gtk_type_enum_find_value (GtkType enum_type, GtkFlagValue* gtk_type_flags_find_value (GtkType flags_type, const gchar *value_name); -#ifdef G_OS_WIN32 -# ifdef GTK_COMPILATION -# define GTKTYPEUTILS_VAR __declspec(dllexport) -# else -# define GTKTYPEUTILS_VAR extern __declspec(dllimport) -# endif -#else -# define GTKTYPEUTILS_VAR extern -#endif - -/* urg */ -GTKTYPEUTILS_VAR GType GTK_TYPE_IDENTIFIER; - #endif /* GTK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 57c5d38b4..3c7369b52 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -6371,6 +6371,19 @@ gtk_requisition_free (GtkRequisition *requisition) g_free (requisition); } +GType +gtk_requisition_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTypeRequisition", + (GBoxedCopyFunc) gtk_requisition_copy, + (GBoxedFreeFunc) gtk_requisition_free); + + return our_type; +} + AtkObject* gtk_widget_get_accessible (GtkWidget *widget) { @@ -6430,4 +6443,3 @@ gtk_widget_ref_accessible (AtkImplementor *implementor) g_object_ref (G_OBJECT (accessible)); return accessible; } - diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 1be3abb9f..2176e71f0 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -131,6 +131,7 @@ typedef enum #define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END #define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END +#define GTK_TYPE_REQUISITION (gtk_requisition_get_type ()) /* forward declaration to avoid excessive includes (and concurrent includes) */ @@ -737,8 +738,9 @@ void gtk_widget_class_path (GtkWidget *widget, gchar **path, gchar **path_reversed); -GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition); -void gtk_requisition_free (GtkRequisition *requisition); +GType gtk_requisition_get_type (void); +GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition); +void gtk_requisition_free (GtkRequisition *requisition); #if defined (GTK_TRACE_OBJECTS) && defined (__GNUC__) # define gtk_widget_ref gtk_object_ref diff --git a/gtk/makeenums.awk b/gtk/makeenums.awk deleted file mode 100644 index eaec10d13..000000000 --- a/gtk/makeenums.awk +++ /dev/null @@ -1,152 +0,0 @@ - -BEGIN { - type_name = ""; # GtkEnumType - type_macro = ""; # GTK_TYPE_ENUM_TYPE - type_ident = ""; # _gtk_enum_type - type_flags = 0; - type_counter = 0; - delete value_names; # GTK_ENUM_VALUE - delete value_nicks; # enum-value - VI = 0; - gen_arrays = 0; - gen_defs = 0; - comment_file = ""; - - for (i = 1; i < ARGC; i++) - { - if (ARGV[i] == "arrays") - gen_arrays = 1; - else if (ARGV[i] == "defs") - gen_defs = 1; - ARGV[i] = ""; - } - - if (gen_arrays) - printf ("/* generated by makeenums.awk */\n\n"); - else if (gen_defs) - printf (";; generated by makeenums.awk ; -*- scheme -*-\n\n"); - else - { - printf ("hm? what do you want me to do?\n") > "/dev/stderr"; - exit 1; - } -} - -function set_type (set_type_1) -{ - type_name = set_type_1; - type_macro = "GTK_TYPE"; - type_ident = ""; - for (i = 0; i < length (type_name); i++) - { - ch = substr (type_name, i + 1, 1); - Ch = toupper (ch); - if (Ch == ch) - { - type_macro = type_macro "_" Ch; - type_ident = type_ident "_" tolower (ch); - } - else - { - type_macro = type_macro Ch; - type_ident = type_ident ch; - } - } -} - -function set_value (set_value_1, set_value_2) -{ - value_names[VI] = set_value_1; - value_nicks[VI] = tolower (set_value_2); - while (match (value_nicks[VI], "_")) - sub ("_", "-", value_nicks[VI]); -} - -function generate_arrays () -{ - if (gen_arrays) - { - printf ("static GtkEnumValue %s_values[] = {\n", type_ident); - for (i = 0; i < VI; i++) - { - printf (" { %s, \"%s\", \"%s\" },\n", - value_names[i], value_names[i], value_nicks[i]); - } - printf (" { 0, NULL, NULL }\n"); - printf ("};\n"); - } -} - -function generate_defs () -{ - if (gen_defs) - { - if (comment_file != "") - { - printf ("\n; enumerations from \"%s\"\n", comment_file); - comment_file = ""; - } - - printf ("\n(define-%s %s", - type_flags ? "flags" : "enum", - type_name); - for (i = 0; i < VI; i++) - { - printf ("\n (%s %s)", - value_nicks[i], value_names[i]); - } - printf (")\n"); - } -} - -function basename (basename_1) -{ - sub ("\"", "", basename_1); - while (match (basename_1, "/")) - sub (".*/", "", basename_1); - sub ("\"", "", basename_1); - return basename_1; -} - -# parse keywords - -/G_ENUM_E/ { - if ($3 != "+" || $5 != "+") - printf ("huh? G_ENUM_E keyword without arg?\n") > "/dev/stderr"; - else - set_type($4); - type_flags = 0; - - generate_defs(); - generate_arrays(); - VI = 0; -} - -/G_ENUM_F/ { - if ($3 != "+" || $5 != "+") - printf ("huh? G_ENUM_F keyword without arg?\n") > "/dev/stderr"; - else - set_type($4); - type_flags = 1; - - generate_defs(); - generate_arrays(); - VI = 0; -} - -/G_ENUM_V/ { - if ($2 != "+" || $4 != "+" || $6 != "+") - printf ("huh? G_ENUM_V keyword without arg?\n") > "/dev/stderr"; - else - set_value($3, $5); - VI += 1; -} - -# feature per file comments -/# / { - comment_file = basename($3); -} - -END { - printf("\n"); -} diff --git a/gtk/makeenums.h b/gtk/makeenums.h deleted file mode 100644 index 3d42f093d..000000000 --- a/gtk/makeenums.h +++ /dev/null @@ -1,5 +0,0 @@ -#include <gdk/gdkprivate.h> -#include <gdk/gdk.h> -#include <gtk/gtk.h> -#include <gtk/gtkprivate.h> -#include <gtk/gtkdebug.h> diff --git a/gtk/maketypes.awk b/gtk/maketypes.awk deleted file mode 100644 index 715e6cd95..000000000 --- a/gtk/maketypes.awk +++ /dev/null @@ -1,155 +0,0 @@ - -BEGIN { - type_name = ""; # GtkEnumType - type_macro = ""; # GTK_TYPE_ENUM_TYPE - type_ident = ""; # _gtk_enum_type - type_counter = 0; - gen_macros = 0; - gen_entries = 0; - gen_vars = 0; - boxed_copy = ""; - boxed_free = ""; - - for (i = 2; i < ARGC; i++) - { - if (ARGV[i] == "macros") - gen_macros = 1; - else if (ARGV[i] == "entries") - gen_entries = 1; - else if (ARGV[i] == "variables") - gen_vars = 1; - ARGV[i] = ""; - } - - if (gen_macros) - { - printf ("/* type macros, generated by maketypes.awk */\n"); - printf ("\n"); - printf ("#ifdef G_OS_WIN32\n"); - printf ("# ifdef GTK_COMPILATION\n"); - printf ("# define GTKTYPEBUILTINS_VAR __declspec(dllexport)\n"); - printf ("# else\n"); - printf ("# define GTKTYPEBUILTINS_VAR extern __declspec(dllimport)\n"); - printf ("# endif\n"); - printf ("#else\n"); - printf ("# ifdef GTK_COMPILATION\n"); - printf ("# define GTKTYPEBUILTINS_VAR\n"); - printf ("# else\n"); - printf ("# define GTKTYPEBUILTINS_VAR extern\n"); - printf ("# endif\n"); - printf ("#endif\n"); - printf ("\n"); - } - else if (gen_entries) - printf ("/* type entries, generated by maketypes.awk */\n\n"); - else if (gen_vars) - printf ("/* type variables, generated by maketypes.awk */\n\n"); - else - { - printf ("hm? what do you want me to do?\n") > "/dev/stderr"; - exit 1; - } -} - -function set_type (set_type_1) -{ - type_counter += 1; - type_name = set_type_1; - type_macro = "GTK_TYPE_"; - - tmp = type_name; -# OK, the following is ridiculous, and sed s///g would be far easier - gsub ("[A-Z]", "@&", tmp); - gsub ("[^A-Z]@", "&_", tmp); - gsub ("@", "", tmp); - gsub ("[A-Z][A-Z][A-Z][0-9a-z]", "@&", tmp); - gsub ("@..", "&_", tmp); - gsub ("@", "", tmp); - type_macro = type_macro toupper (tmp); - type_ident = "_" tolower (tmp); - - sub ("^GTK_TYPE_GTK_", "GTK_TYPE_", type_macro); -} - -function generate (generate_what) -{ - if (gen_macros) - { - printf ("GTKTYPEBUILTINS_VAR GType %s;\n", type_macro); - } - if (gen_entries) - { - printf (" { \"%s\", &%s,\n", type_name, type_macro); - if (generate_what == "BOXED") - printf (" GTK_TYPE_%s, %s, %s, },\n", generate_what, boxed_copy, boxed_free); - else - printf (" GTK_TYPE_%s, %s_values },\n", generate_what, type_ident); - } - if (gen_vars) - { - printf ("GTKTYPEBUILTINS_VAR GType %s = 0;\n", type_macro); - } -} - -# skip scheme comments -";" { - sub (";.*", ""); -} - -# parse keywords - -/\(define-enum/ { - if ($2 == "") - printf ("huh? define-enum keyword without arg?\n") > "/dev/stderr"; - else - { - set_type($2); - generate("ENUM"); - } -} - -/\(define-flags/ { - if ($2 == "") - printf ("huh? define-flags keyword without arg?\n") > "/dev/stderr"; - else - { - set_type($2); - generate("FLAGS"); - } -} - -/\(define-boxed/ { - if ($2 == "") - printf ("huh? define-boxed keyword without arg?\n") > "/dev/stderr"; - else - { - boxed_copy = "NULL"; - boxed_free = "NULL"; - set_type($2); - do { - getline; - sub (";.*", "", $0); - } while ($0 ~ /^[ \t]*$/); - tmp_var1 = $1; - if ($0 ~ /\)/) { generate("BOXED"); next; } - do { - getline; - sub (";.*", "", $0); - } while ($0 ~ /^[ \t]*$/); - tmp_var2 = $1; - sub (/\).*/, "", tmp_var2); - if (tmp_var1 ~ /^[_A-Za-z][_A-Za-z0-9]*$/ && - tmp_var2 ~ /^[_A-Za-z][_A-Za-z0-9]*$/) - { - boxed_copy = tmp_var1; - boxed_free = tmp_var2; - # printf ("read boxed funcs: %s %s\n", boxed_copy, boxed_free) > "/dev/stderr"; - } - generate("BOXED"); - } -} - -END { - if (gen_macros) - printf("\n#define\tGTK_TYPE_N_BUILTINS\t(%u)\n", type_counter); -} diff --git a/gtk/oldest-source-stamp b/gtk/oldest-source-stamp deleted file mode 100644 index e69de29bb..000000000 --- a/gtk/oldest-source-stamp +++ /dev/null |