4 # gtk-doc - GTK DocBook documentation generator.
5 # Copyright (C) 1998 Damon Chaplin
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # This gets information about object heirarchies and signals
24 # by compiling a small C program. CFLAGS and LDFLAGS must be
25 # set appropriately before running this script.
27 # NOTE: the lookup_signal_arg_names() function contains the argument names of
28 # standard GTK signal handlers. This may need to be updated for new
29 # GTK signals or Gnome widget signals.
33 unshift @INC, '/usr/share/gtk-doc/data';
34 require "gtkdoc-common.pl";
38 # name of documentation module
44 my $TYPE_INIT_FUNC="g_type_init ()";
46 # --nogtkinit is deprecated, as it is the default now anyway.
47 %optctl = (module => \$MODULE,
49 types => \$TYPES_FILE,
50 nogtkinit => \$NO_GTK_INIT,
51 'type-init-func' => \$TYPE_INIT_FUNC,
52 'output-dir' => \$OUTPUT_DIR,
53 'inspect-dir' => \$INSPECT_DIR,
54 'version' => \$PRINT_VERSION,
55 'help' => \$PRINT_HELP);
57 GetOptions(\%optctl, "module=s", "source=s", "types:s", "output-dir:s", "inspect-dir:s", "nogtkinit", "type-init-func:s", "version", "help");
60 # Do nothing. This just avoids a warning.
73 print "gstdoc-scangobj version 1.5\n";
74 print "\n--module=MODULE_NAME Name of the doc module being parsed";
75 print "\n--source=SOURCE_NAME Name of the source module for plugins";
76 print "\n--types=FILE The name of the file to store the types in";
77 print "\n--type-init-func=FUNC The init function to call instead of g_type_init ()";
78 print "\n--output-dir=DIRNAME The directory where the results are stored";
79 print "\n--inspect-dir=DIRNAME The directory where the plugin inspect data is stored";
80 print "\n--version Print the version of this program";
81 print "\n--help Print this help\n";
85 $OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
87 $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
89 open (TYPES, $TYPES_FILE) || die "Cannot open $TYPES_FILE: $!\n";
90 open (OUTPUT, ">$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n";
92 my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals";
93 my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new";
94 my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy";
95 my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new";
96 my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces";
97 my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new";
98 my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites";
99 my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new";
100 my $old_args_filename = "$OUTPUT_DIR/$MODULE.args";
101 my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new";
103 # write a C program to scan the types
116 } elsif (/^type:(.*)$/) {
119 push @impl_types, $t;
126 $ntypes = @types + @impl_types;
136 #ifdef GTK_IS_WIDGET_CLASS
137 #include <gtk/gtkversion.h>
140 static GType *object_types = NULL;
142 static GString *xmlstr = NULL;
145 xmlprint (gint indent, const gchar *tag, const gchar *data)
147 const gchar indent_str[] = " ";
150 g_string_truncate (xmlstr, 0);
151 g_string_append_len (xmlstr, indent_str, MIN (indent, strlen (indent_str)));
152 g_string_append_printf (xmlstr, "<%s>", tag);
157 s = g_markup_escape_text (data, -1);
158 g_string_append (xmlstr, s);
162 g_string_append_printf (xmlstr, "</%s>\\n", tag);
167 gst_feature_sort_compare (gconstpointer a, gconstpointer b)
169 return strcmp (((GstPluginFeature *)a)->name, ((GstPluginFeature *)b)->name);
173 static_pad_template_compare (gconstpointer a, gconstpointer b)
175 GstStaticPadTemplate *spt_a = (GstStaticPadTemplate *) a;
176 GstStaticPadTemplate *spt_b = (GstStaticPadTemplate *) b;
178 /* we want SINK before SRC (enum is UNKNOWN, SRC, SINK) */
179 if (spt_a->direction != spt_b->direction)
180 return spt_b->direction - spt_a->direction;
182 /* we want ALWAYS first, SOMETIMES second, REQUEST last
183 * (enum is ALWAYS, SOMETIMES, REQUEST) */
184 if (spt_a->presence != spt_b->presence)
185 return spt_a->presence - spt_b->presence;
187 return strcmp (spt_a->name_template, spt_b->name_template);
191 get_object_types (void)
193 GList *plugins = NULL;
194 GList *factories = NULL;
196 GstElementFactory *factory = NULL;
201 /* get a list of features from plugins in our source module */
202 plugins = gst_registry_get_plugin_list (gst_registry_get_default());
204 xmlstr = g_string_new ("");
206 reinspect = !g_file_test ("scanobj-build.stamp", G_FILE_TEST_EXISTS);
212 FILE *inspect = NULL;
215 plugin = (GstPlugin *) (plugins->data);
216 plugins = g_list_next (plugins);
217 source = gst_plugin_get_source (plugin);
218 /*g_print ("plugin: %s source: %s\\n", plugin->desc.name, source);*/
219 if (!source || strcmp (source, "$SOURCE") != 0) {
223 /* skip static coreelements plugin with pipeline and bin element factory */
224 if (gst_plugin_get_filename (plugin) == NULL)
227 g_print ("plugin: %s source: %s\\n", plugin->desc.name, source);
230 inspect_name = g_strdup_printf ("$INSPECT_DIR" G_DIR_SEPARATOR_S "plugin-%s.xml",
232 inspect = fopen (inspect_name, "w");
233 if (inspect == NULL) {
234 g_error ("Could not open %s for writing: %s\\n", inspect_name,
237 g_free (inspect_name);
239 /* output plugin data */
240 fputs ("<plugin>\\n",inspect);
241 fputs (xmlprint(2, "name", plugin->desc.name),inspect);
242 fputs (xmlprint(2, "description", plugin->desc.description),inspect);
243 fputs (xmlprint(2, "filename", plugin->filename),inspect);
244 fputs (xmlprint(2, "basename", plugin->basename),inspect);
245 fputs (xmlprint(2, "version", plugin->desc.version),inspect);
246 fputs (xmlprint(2, "license", plugin->desc.license),inspect);
247 fputs (xmlprint(2, "source", plugin->desc.source),inspect);
248 fputs (xmlprint(2, "package", plugin->desc.package),inspect);
249 fputs (xmlprint(2, "origin", plugin->desc.origin),inspect);
250 fputs (" <elements>\\n", inspect);
254 gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
257 /* sort factories by feature->name */
258 features = g_list_sort (features, gst_feature_sort_compare);
261 GstPluginFeature *feature;
262 feature = GST_PLUGIN_FEATURE (features->data);
263 feature = gst_plugin_feature_load (feature);
265 g_warning ("Could not load plugin feature %s",
266 gst_plugin_feature_get_name (feature));
269 if (GST_IS_ELEMENT_FACTORY (feature)) {
270 const gchar *pad_dir[] = { "unknown","source","sink" };
271 const gchar *pad_pres[] = { "always","sometimes","request" };
274 /*g_print (" feature: %s\\n", feature->name);*/
276 factory = GST_ELEMENT_FACTORY (feature);
277 factories = g_list_prepend (factories, factory);
280 /* output element data */
281 fputs (" <element>\\n", inspect);
282 fputs (xmlprint(6, "name", feature->name),inspect);
283 fputs (xmlprint(6, "longname", gst_element_factory_get_longname (factory)),inspect);
284 fputs (xmlprint(6, "class", gst_element_factory_get_klass (factory)),inspect);
285 fputs (xmlprint(6, "description", gst_element_factory_get_description (factory)),inspect);
286 fputs (xmlprint(6, "author", gst_element_factory_get_author (factory)),inspect);
287 fputs (" <pads>\\n", inspect);
289 /* output pad-template data */
290 pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory));
291 pads = g_list_sort (pads, static_pad_template_compare);
292 for (pad = pads; pad != NULL; pad = pad->next) {
293 GstStaticPadTemplate *pt = pad->data;
295 fputs (" <caps>\\n", inspect);
296 fputs (xmlprint(10, "name", pt->name_template),inspect);
297 fputs (xmlprint(10, "direction", pad_dir[pt->direction]),inspect);
298 fputs (xmlprint(10, "presence", pad_pres[pt->presence]),inspect);
299 fputs (xmlprint(10, "details", pt->static_caps.string),inspect);
300 fputs (" </caps>\\n", inspect);
303 fputs (" </pads>\\n </element>\\n", inspect);
306 features = g_list_next (features);
310 fputs (" </elements>\\n</plugin>", inspect);
315 g_string_free (xmlstr, TRUE);
317 g_message ("number of element factories: %d", g_list_length (factories));
319 /* allocate the object_types array to hold them */
320 object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1);
327 factory = GST_ELEMENT_FACTORY (l->data);
328 type = gst_element_factory_get_element_type (factory);
330 g_message ("adding type %p for factory %s", (void *) type, gst_element_factory_get_longname (factory));
331 object_types[i++] = type;
333 g_message ("type info for factory %s not found",
334 gst_element_factory_get_longname (factory));
341 # get_type functions:
346 g_message ("$_ () didn't return a valid type");
349 object_types[i++] = type;
354 # Implicit types retrieved from GLib:
357 type = g_type_from_name ("$_");
359 g_message ("Implicit type $_ not found");
362 object_types[i++] = type;
371 /* Need to make sure all the types are loaded in and initialize
372 * their signals and properties.
374 for (i=0; object_types[i]; i++) {
375 if (G_TYPE_IS_CLASSED (object_types[i]))
376 g_type_class_ref (object_types[i]);
378 g_warning ("not reffing type: %s", g_type_name (object_types[i]));
386 * This uses GObject type functions to output signal prototypes and the object
390 /* The output files */
391 const gchar *signals_filename = "$new_signals_filename";
392 const gchar *hierarchy_filename = "$new_hierarchy_filename";
393 const gchar *interfaces_filename = "$new_interfaces_filename";
394 const gchar *prerequisites_filename = "$new_prerequisites_filename";
395 const gchar *args_filename = "$new_args_filename";
398 static void output_signals (void);
399 static void output_object_signals (FILE *fp,
401 static void output_object_signal (FILE *fp,
402 const gchar *object_class_name,
404 static const gchar * get_type_name (GType type,
405 gboolean * is_pointer);
406 static const gchar * get_gdk_event (const gchar * signal_name);
407 static const gchar ** lookup_signal_arg_names (const gchar * type,
408 const gchar * signal_name);
410 static void output_object_hierarchy (void);
411 static void output_hierarchy (FILE *fp,
415 static void output_object_interfaces (void);
416 static void output_interfaces (FILE *fp,
419 static void output_interface_prerequisites (void);
420 static void output_prerequisites (FILE *fp,
423 static void output_args (void);
424 static void output_object_args (FILE *fp, GType object_type);
427 main (int argc, char *argv[])
429 /* Silence the compiler: */
430 if (argv != argv) argc = argc;
437 output_object_hierarchy ();
438 output_object_interfaces ();
439 output_interface_prerequisites ();
447 output_signals (void)
452 fp = fopen (signals_filename, "w");
455 g_warning ("Couldn't open output file: %s : %s", signals_filename, strerror(errno));
459 for (i = 0; object_types[i]; i++)
460 output_object_signals (fp, object_types[i]);
466 compare_signals (const void *a, const void *b)
468 const guint *signal_a = a;
469 const guint *signal_b = b;
471 return strcmp (g_signal_name (*signal_a), g_signal_name (*signal_b));
474 /* This outputs all the signals of one object. */
476 output_object_signals (FILE *fp, GType object_type)
478 const gchar *object_class_name;
479 guint *signals, n_signals;
482 if (G_TYPE_IS_INSTANTIATABLE (object_type) ||
483 G_TYPE_IS_INTERFACE (object_type))
486 object_class_name = g_type_name (object_type);
488 signals = g_signal_list_ids (object_type, &n_signals);
489 qsort (signals, n_signals, sizeof (guint), compare_signals);
491 for (sig = 0; sig < n_signals; sig++)
493 output_object_signal (fp, object_class_name, signals[sig]);
500 /* This outputs one signal. */
502 output_object_signal (FILE *fp,
503 const gchar *object_name,
506 GSignalQuery query_info;
507 const gchar *type_name, *ret_type, *object_arg, *arg_name;
508 gchar *pos, *object_arg_lower;
510 gchar ret_type_buffer[1024], buffer[1024];
512 const gchar **arg_names;
513 gint param_num, widget_num, event_num, callback_num;
515 gchar signal_name[128];
518 /* g_print ("Object: %s Signal: %u\\n", object_name, signal_id);*/
521 widget_num = event_num = callback_num = 0;
523 g_signal_query (signal_id, &query_info);
525 /* Output the return type and function name. */
526 ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
527 sprintf (ret_type_buffer, "%s%s", ret_type, is_pointer ? "*" : "");
529 /* Output the signal object type and the argument name. We assume the
530 type is a pointer - I think that is OK. We remove "Gtk" or "Gnome" and
531 convert to lower case for the argument name. */
533 sprintf (pos, "%s ", object_name);
536 if (!strncmp (object_name, "Gtk", 3))
537 object_arg = object_name + 3;
538 else if (!strncmp (object_name, "Gnome", 5))
539 object_arg = object_name + 5;
541 object_arg = object_name;
543 object_arg_lower = g_ascii_strdown (object_arg, -1);
544 sprintf (pos, "*%s\\n", object_arg_lower);
546 if (!strncmp (object_arg_lower, "widget", 6))
548 g_free(object_arg_lower);
550 /* Convert signal name to use underscores rather than dashes '-'. */
551 strcpy (signal_name, query_info.signal_name);
552 for (i = 0; signal_name[i]; i++)
554 if (signal_name[i] == '-')
555 signal_name[i] = '_';
558 /* Output the signal parameters. */
559 arg_names = lookup_signal_arg_names (object_name, signal_name);
561 for (param = 0; param < query_info.n_params; param++)
565 sprintf (pos, "%s\\n", arg_names[param]);
570 type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
572 /* Most arguments to the callback are called "arg1", "arg2", etc.
573 GdkWidgets are called "widget", "widget2", ...
574 GdkEvents are called "event", "event2", ...
575 GtkCallbacks are called "callback", "callback2", ... */
576 if (!strcmp (type_name, "GtkWidget"))
579 arg_num = &widget_num;
581 else if (!strcmp (type_name, "GdkEvent"))
583 type_name = get_gdk_event (signal_name);
585 arg_num = &event_num;
588 else if (!strcmp (type_name, "GtkCallback")
589 || !strcmp (type_name, "GtkCCallback"))
591 arg_name = "callback";
592 arg_num = &callback_num;
597 arg_num = ¶m_num;
599 sprintf (pos, "%s ", type_name);
602 if (!arg_num || *arg_num == 0)
603 sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name);
605 sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name,
620 /* We use one-character flags for simplicity. */
621 if (query_info.signal_flags & G_SIGNAL_RUN_FIRST)
623 if (query_info.signal_flags & G_SIGNAL_RUN_LAST)
625 if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP)
627 if (query_info.signal_flags & G_SIGNAL_NO_RECURSE)
629 if (query_info.signal_flags & G_SIGNAL_DETAILED)
631 if (query_info.signal_flags & G_SIGNAL_ACTION)
633 if (query_info.signal_flags & G_SIGNAL_NO_HOOKS)
638 "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
639 object_name, query_info.signal_name, ret_type_buffer, flags, buffer);
643 /* Returns the type name to use for a signal argument or return value, given
644 the GtkType from the signal info. It also sets is_pointer to TRUE if the
645 argument needs a '*' since it is a pointer. */
647 get_type_name (GType type, gboolean * is_pointer)
649 const gchar *type_name;
652 type_name = g_type_name (type);
666 /* These all have normal C type names so they are OK. */
670 /* A GtkString is really a gchar*. */
676 /* We use a gint for both of these. Hopefully a subtype with a decent
677 name will be registered and used instead, as GTK+ does itself. */
681 /* The boxed type shouldn't be used itself, only subtypes. Though we
682 return 'gpointer' just in case. */
686 /* A GParam is really a GParamSpec*. */
694 /* For all GObject subclasses we can use the class name with a "*",
695 e.g. 'GtkWidget *'. */
696 if (g_type_is_a (type, G_TYPE_OBJECT))
699 if (G_TYPE_IS_CLASSED (type))
702 /* All boxed subtypes will be pointers as well. */
703 if (g_type_is_a (type, G_TYPE_BOXED))
706 /* All pointer subtypes will be pointers as well. */
707 if (g_type_is_a (type, G_TYPE_POINTER))
710 /* But enums are not */
711 if (g_type_is_a (type, G_TYPE_ENUM) ||
712 g_type_is_a (type, G_TYPE_FLAGS))
720 get_gdk_event (const gchar * signal_name)
722 static const gchar *GbGDKEvents[] =
724 "button_press_event", "GdkEventButton",
725 "button_release_event", "GdkEventButton",
726 "motion_notify_event", "GdkEventMotion",
727 "delete_event", "GdkEvent",
728 "destroy_event", "GdkEvent",
729 "expose_event", "GdkEventExpose",
730 "key_press_event", "GdkEventKey",
731 "key_release_event", "GdkEventKey",
732 "enter_notify_event", "GdkEventCrossing",
733 "leave_notify_event", "GdkEventCrossing",
734 "configure_event", "GdkEventConfigure",
735 "focus_in_event", "GdkEventFocus",
736 "focus_out_event", "GdkEventFocus",
737 "map_event", "GdkEvent",
738 "unmap_event", "GdkEvent",
739 "property_notify_event", "GdkEventProperty",
740 "selection_clear_event", "GdkEventSelection",
741 "selection_request_event", "GdkEventSelection",
742 "selection_notify_event", "GdkEventSelection",
743 "proximity_in_event", "GdkEventProximity",
744 "proximity_out_event", "GdkEventProximity",
745 "drag_begin_event", "GdkEventDragBegin",
746 "drag_request_event", "GdkEventDragRequest",
747 "drag_end_event", "GdkEventDragRequest",
748 "drop_enter_event", "GdkEventDropEnter",
749 "drop_leave_event", "GdkEventDropLeave",
750 "drop_data_available_event", "GdkEventDropDataAvailable",
751 "other_event", "GdkEventOther",
752 "client_event", "GdkEventClient",
753 "no_expose_event", "GdkEventNoExpose",
754 "visibility_notify_event", "GdkEventVisibility",
755 "window_state_event", "GdkEventWindowState",
756 "scroll_event", "GdkEventScroll",
762 for (i = 0; GbGDKEvents[i]; i += 2)
764 if (!strcmp (signal_name, GbGDKEvents[i]))
765 return GbGDKEvents[i + 1];
771 /* This returns argument names to use for some known GTK signals.
772 It is passed a widget name, e.g. 'GtkCList' and a signal name, e.g.
773 'select_row' and it returns a pointer to an array of argument types and
775 static const gchar **
776 lookup_signal_arg_names (const gchar * type, const gchar * signal_name)
778 /* Each arg array starts with the object type name and the signal name,
779 and then signal arguments follow. */
780 static const gchar *GbArgTable[][16] =
782 {"GtkCList", "select_row",
785 "GdkEventButton *event"},
786 {"GtkCList", "unselect_row",
789 "GdkEventButton *event"},
790 {"GtkCList", "click_column",
793 {"GtkCList", "resize_column",
797 {"GtkCList", "extend_selection",
798 "GtkScrollType scroll_type",
800 "gboolean auto_start_selection"},
801 {"GtkCList", "scroll_vertical",
802 "GtkScrollType scroll_type",
804 {"GtkCList", "scroll_horizontal",
805 "GtkScrollType scroll_type",
808 {"GtkCTree", "tree_select_row",
809 "GtkCTreeNode *node",
811 {"GtkCTree", "tree_unselect_row",
812 "GtkCTreeNode *node",
814 {"GtkCTree", "tree_expand",
815 "GtkCTreeNode *node"},
816 {"GtkCTree", "tree_collapse",
817 "GtkCTreeNode *node"},
818 {"GtkCTree", "tree_move",
819 "GtkCTreeNode *node",
820 "GtkCTreeNode *new_parent",
821 "GtkCTreeNode *new_sibling"},
822 {"GtkCTree", "change_focus_row_expansion",
823 "GtkCTreeExpansionType expansion"},
825 {"GtkEditable", "insert_text",
827 "gint new_text_length",
829 {"GtkEditable", "delete_text",
832 {"GtkEditable", "set_editable",
833 "gboolean is_editable"},
834 {"GtkEditable", "move_cursor",
837 {"GtkEditable", "move_word",
839 {"GtkEditable", "move_page",
842 {"GtkEditable", "move_to_row",
844 {"GtkEditable", "move_to_column",
847 {"GtkEditable", "kill_char",
849 {"GtkEditable", "kill_word",
851 {"GtkEditable", "kill_line",
855 {"GtkInputDialog", "enable_device",
856 "GdkDevice *deviceid"},
857 {"GtkInputDialog", "disable_device",
858 "GdkDevice *deviceid"},
860 {"GtkListItem", "extend_selection",
861 "GtkScrollType scroll_type",
863 "gboolean auto_start_selection"},
864 {"GtkListItem", "scroll_vertical",
865 "GtkScrollType scroll_type",
867 {"GtkListItem", "scroll_horizontal",
868 "GtkScrollType scroll_type",
871 {"GtkMenuShell", "move_current",
872 "GtkMenuDirectionType direction"},
873 {"GtkMenuShell", "activate_current",
874 "gboolean force_hide"},
877 {"GtkNotebook", "switch_page",
878 "GtkNotebookPage *page",
880 {"GtkStatusbar", "text_pushed",
883 {"GtkStatusbar", "text_popped",
886 {"GtkTipsQuery", "widget_entered",
889 "gchar *tip_private"},
890 {"GtkTipsQuery", "widget_selected",
893 "gchar *tip_private",
894 "GdkEventButton *event"},
895 {"GtkToolbar", "orientation_changed",
896 "GtkOrientation orientation"},
897 {"GtkToolbar", "style_changed",
898 "GtkToolbarStyle style"},
899 {"GtkWidget", "draw",
900 "GdkRectangle *area"},
901 {"GtkWidget", "size_request",
902 "GtkRequisition *requisition"},
903 {"GtkWidget", "size_allocate",
904 "GtkAllocation *allocation"},
905 {"GtkWidget", "state_changed",
906 "GtkStateType state"},
907 {"GtkWidget", "style_set",
908 "GtkStyle *previous_style"},
910 {"GtkWidget", "install_accelerator",
911 "gchar *signal_name",
915 {"GtkWidget", "add_accelerator",
916 "guint accel_signal_id",
917 "GtkAccelGroup *accel_group",
919 "GdkModifierType accel_mods",
920 "GtkAccelFlags accel_flags"},
922 {"GtkWidget", "parent_set",
923 "GtkObject *old_parent"},
925 {"GtkWidget", "remove_accelerator",
926 "GtkAccelGroup *accel_group",
928 "GdkModifierType accel_mods"},
929 {"GtkWidget", "debug_msg",
931 {"GtkWindow", "move_resize",
936 {"GtkWindow", "set_focus",
937 "GtkWidget *widget"},
939 {"GtkWidget", "selection_get",
940 "GtkSelectionData *data",
943 {"GtkWidget", "selection_received",
944 "GtkSelectionData *data",
947 {"GtkWidget", "drag_begin",
948 "GdkDragContext *drag_context"},
949 {"GtkWidget", "drag_end",
950 "GdkDragContext *drag_context"},
951 {"GtkWidget", "drag_data_delete",
952 "GdkDragContext *drag_context"},
953 {"GtkWidget", "drag_leave",
954 "GdkDragContext *drag_context",
956 {"GtkWidget", "drag_motion",
957 "GdkDragContext *drag_context",
961 {"GtkWidget", "drag_drop",
962 "GdkDragContext *drag_context",
966 {"GtkWidget", "drag_data_get",
967 "GdkDragContext *drag_context",
968 "GtkSelectionData *data",
971 {"GtkWidget", "drag_data_received",
972 "GdkDragContext *drag_context",
975 "GtkSelectionData *data",
984 for (i = 0; GbArgTable[i][0]; i++)
987 if (!strcmp (type, GbArgTable[i][0])
988 && !strcmp (signal_name, GbArgTable[i][1]))
989 return &GbArgTable[i][2];
995 /* This outputs the hierarchy of all objects which have been initialized,
996 i.e. by calling their XXX_get_type() initialization function. */
998 output_object_hierarchy (void)
1003 fp = fopen (hierarchy_filename, "w");
1006 g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, strerror(errno));
1009 output_hierarchy (fp, G_TYPE_OBJECT, 0);
1010 output_hierarchy (fp, G_TYPE_INTERFACE, 0);
1012 for (i=0; object_types[i]; i++) {
1013 if (!g_type_parent (object_types[i]) &&
1014 (object_types[i] != G_TYPE_NONE) &&
1015 (object_types[i] != G_TYPE_OBJECT) &&
1016 (object_types[i] != G_TYPE_INTERFACE)
1018 g_warning ("printing hierarchy for root type: %s",
1019 g_type_name (object_types[i]));
1020 output_hierarchy (fp, object_types[i], 0);
1024 for (i=0; object_types[i]; i++) {
1025 if(object_types[i] != G_TYPE_NONE) {
1026 g_print ("type has not been added to hierarchy: %s\\n",
1027 g_type_name (object_types[i]));
1036 type_cmp (const void * p1, const void * p2)
1038 return strcmp (g_type_name (*((GType *) p1)), g_type_name (*((GType *) p2)));
1041 /* This is called recursively to output the hierarchy of a widget. */
1043 output_hierarchy (FILE *fp,
1055 for (i=0; object_types[i]; i++) {
1056 if(object_types[i] == type) {
1057 g_print ("added type to hierarchy (level %d): %s\\n",
1058 level, g_type_name (type));
1059 object_types[i] = G_TYPE_NONE;
1065 for (i = 0; i < level; i++)
1067 fprintf (fp, "%s", g_type_name (type));
1068 fprintf (fp, "\\n");
1070 children = g_type_children (type, &n_children);
1072 qsort (&children[0], n_children, sizeof (GType), type_cmp);
1074 for (i=0; i < n_children; i++) {
1075 output_hierarchy (fp, children[i], level + 1);
1081 static void output_object_interfaces (void)
1086 fp = fopen (interfaces_filename, "w");
1089 g_warning ("Couldn't open output file: %s : %s", interfaces_filename, strerror(errno));
1092 output_interfaces (fp, G_TYPE_OBJECT);
1094 for (i = 0; object_types[i]; i++)
1096 if (!g_type_parent (object_types[i]) &&
1097 (object_types[i] != G_TYPE_OBJECT) &&
1098 G_TYPE_IS_INSTANTIATABLE (object_types[i]))
1100 output_interfaces (fp, object_types[i]);
1107 output_interfaces (FILE *fp,
1111 GType *children, *interfaces;
1112 guint n_children, n_interfaces;
1117 interfaces = g_type_interfaces (type, &n_interfaces);
1119 if (n_interfaces > 0)
1121 fprintf (fp, "%s", g_type_name (type));
1122 for (i=0; i < n_interfaces; i++)
1123 fprintf (fp, " %s", g_type_name (interfaces[i]));
1124 fprintf (fp, "\\n");
1126 g_free (interfaces);
1128 children = g_type_children (type, &n_children);
1130 for (i=0; i < n_children; i++)
1131 output_interfaces (fp, children[i]);
1136 static void output_interface_prerequisites (void)
1140 fp = fopen (prerequisites_filename, "w");
1143 g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, strerror(errno));
1146 output_prerequisites (fp, G_TYPE_INTERFACE);
1151 output_prerequisites (FILE *fp,
1154 #if GLIB_CHECK_VERSION(2,1,0)
1156 GType *children, *prerequisites;
1157 guint n_children, n_prerequisites;
1162 prerequisites = g_type_interface_prerequisites (type, &n_prerequisites);
1164 if (n_prerequisites > 0)
1166 fprintf (fp, "%s", g_type_name (type));
1167 for (i=0; i < n_prerequisites; i++)
1168 fprintf (fp, " %s", g_type_name (prerequisites[i]));
1169 fprintf (fp, "\\n");
1171 g_free (prerequisites);
1173 children = g_type_children (type, &n_children);
1175 for (i=0; i < n_children; i++)
1176 output_prerequisites (fp, children[i]);
1188 fp = fopen (args_filename, "w");
1191 g_warning ("Couldn't open output file: %s : %s", args_filename, strerror(errno));
1195 for (i = 0; object_types[i]; i++) {
1196 output_object_args (fp, object_types[i]);
1203 compare_param_specs (const void *a, const void *b)
1205 GParamSpec *spec_a = *(GParamSpec **)a;
1206 GParamSpec *spec_b = *(GParamSpec **)b;
1208 return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b));
1211 /* Its common to have unsigned properties restricted
1212 * to the signed range. Therefore we make this look
1213 * a bit nicer by spelling out the max constants.
1216 /* Don't use "==" with floats, it might trigger a gcc warning. */
1217 #define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y)
1220 describe_double_constant (gdouble value)
1224 if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE))
1225 desc = g_strdup ("G_MAXDOUBLE");
1226 else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE))
1227 desc = g_strdup ("G_MINDOUBLE");
1228 else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE))
1229 desc = g_strdup ("-G_MAXDOUBLE");
1230 else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT))
1231 desc = g_strdup ("G_MAXFLOAT");
1232 else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT))
1233 desc = g_strdup ("G_MINFLOAT");
1234 else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT))
1235 desc = g_strdup ("-G_MAXFLOAT");
1237 /* make sure floats are output with a decimal dot irrespective of
1238 * current locale. Use formatd since we want human-readable numbers
1239 * and do not need the exact same bit representation when deserialising */
1240 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1241 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value);
1248 describe_signed_constant (gint64 value)
1252 if (value == G_MAXINT)
1253 desc = g_strdup ("G_MAXINT");
1254 else if (value == G_MININT)
1255 desc = g_strdup ("G_MININT");
1256 else if (value == G_MAXUINT)
1257 desc = g_strdup ("G_MAXUINT");
1258 else if (value == G_MAXLONG)
1259 desc = g_strdup ("G_MAXLONG");
1260 else if (value == G_MINLONG)
1261 desc = g_strdup ("G_MINLONG");
1262 else if (value == G_MAXULONG)
1263 desc = g_strdup ("G_MAXULONG");
1264 else if (value == G_MAXINT64)
1265 desc = g_strdup ("G_MAXINT64");
1266 else if (value == G_MININT64)
1267 desc = g_strdup ("G_MININT64");
1269 desc = g_strdup_printf ("%" G_GINT64_FORMAT, value);
1275 describe_unsigned_constant (guint64 value)
1279 if (value == G_MAXINT)
1280 desc = g_strdup ("G_MAXINT");
1281 else if (value == G_MININT)
1282 desc = g_strdup ("G_MININT");
1283 else if (value == G_MAXUINT)
1284 desc = g_strdup ("G_MAXUINT");
1285 else if (value == G_MAXLONG)
1286 desc = g_strdup ("G_MAXLONG");
1287 else if (value == G_MINLONG)
1288 desc = g_strdup ("G_MINLONG");
1289 else if (value == G_MAXULONG)
1290 desc = g_strdup ("G_MAXULONG");
1291 else if (value == G_MAXINT64)
1292 desc = g_strdup ("G_MAXINT64");
1293 else if (value == G_MININT64)
1294 desc = g_strdup ("G_MININT64");
1295 else if (value == G_MAXUINT64)
1296 desc = g_strdup ("G_MAXUINT64");
1298 desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
1304 describe_type (GParamSpec *spec)
1310 if (G_IS_PARAM_SPEC_CHAR (spec))
1312 GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1314 lower = describe_signed_constant (pspec->minimum);
1315 upper = describe_signed_constant (pspec->maximum);
1316 if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8)
1317 desc = g_strdup ("");
1318 else if (pspec->minimum == G_MININT8)
1319 desc = g_strdup_printf ("<= %s", upper);
1320 else if (pspec->maximum == G_MAXINT8)
1321 desc = g_strdup_printf (">= %s", lower);
1323 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1327 else if (G_IS_PARAM_SPEC_UCHAR (spec))
1329 GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1331 lower = describe_unsigned_constant (pspec->minimum);
1332 upper = describe_unsigned_constant (pspec->maximum);
1333 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8)
1334 desc = g_strdup ("");
1335 else if (pspec->minimum == 0)
1336 desc = g_strdup_printf ("<= %s", upper);
1337 else if (pspec->maximum == G_MAXUINT8)
1338 desc = g_strdup_printf (">= %s", lower);
1340 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1344 else if (G_IS_PARAM_SPEC_INT (spec))
1346 GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1348 lower = describe_signed_constant (pspec->minimum);
1349 upper = describe_signed_constant (pspec->maximum);
1350 if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT)
1351 desc = g_strdup ("");
1352 else if (pspec->minimum == G_MININT)
1353 desc = g_strdup_printf ("<= %s", upper);
1354 else if (pspec->maximum == G_MAXINT)
1355 desc = g_strdup_printf (">= %s", lower);
1357 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1361 else if (G_IS_PARAM_SPEC_UINT (spec))
1363 GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1365 lower = describe_unsigned_constant (pspec->minimum);
1366 upper = describe_unsigned_constant (pspec->maximum);
1367 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT)
1368 desc = g_strdup ("");
1369 else if (pspec->minimum == 0)
1370 desc = g_strdup_printf ("<= %s", upper);
1371 else if (pspec->maximum == G_MAXUINT)
1372 desc = g_strdup_printf (">= %s", lower);
1374 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1378 else if (G_IS_PARAM_SPEC_LONG (spec))
1380 GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1382 lower = describe_signed_constant (pspec->minimum);
1383 upper = describe_signed_constant (pspec->maximum);
1384 if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG)
1385 desc = g_strdup ("");
1386 else if (pspec->minimum == G_MINLONG)
1387 desc = g_strdup_printf ("<= %s", upper);
1388 else if (pspec->maximum == G_MAXLONG)
1389 desc = g_strdup_printf (">= %s", lower);
1391 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1395 else if (G_IS_PARAM_SPEC_ULONG (spec))
1397 GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1400 lower = describe_unsigned_constant (pspec->minimum);
1401 upper = describe_unsigned_constant (pspec->maximum);
1402 if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG)
1403 desc = g_strdup ("");
1404 else if (pspec->minimum == 0)
1405 desc = g_strdup_printf ("<= %s", upper);
1406 else if (pspec->maximum == G_MAXULONG)
1407 desc = g_strdup_printf (">= %s", lower);
1409 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1413 else if (G_IS_PARAM_SPEC_INT64 (spec))
1415 GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1417 lower = describe_signed_constant (pspec->minimum);
1418 upper = describe_signed_constant (pspec->maximum);
1419 if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64)
1420 desc = g_strdup ("");
1421 else if (pspec->minimum == G_MININT64)
1422 desc = g_strdup_printf ("<= %s", upper);
1423 else if (pspec->maximum == G_MAXINT64)
1424 desc = g_strdup_printf (">= %s", lower);
1426 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1430 else if (G_IS_PARAM_SPEC_UINT64 (spec))
1432 GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1434 lower = describe_unsigned_constant (pspec->minimum);
1435 upper = describe_unsigned_constant (pspec->maximum);
1436 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64)
1437 desc = g_strdup ("");
1438 else if (pspec->minimum == 0)
1439 desc = g_strdup_printf ("<= %s", upper);
1440 else if (pspec->maximum == G_MAXUINT64)
1441 desc = g_strdup_printf (">= %s", lower);
1443 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1447 else if (G_IS_PARAM_SPEC_FLOAT (spec))
1449 GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1451 lower = describe_double_constant (pspec->minimum);
1452 upper = describe_double_constant (pspec->maximum);
1453 if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT))
1455 if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
1456 desc = g_strdup ("");
1458 desc = g_strdup_printf ("<= %s", upper);
1460 else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
1461 desc = g_strdup_printf (">= %s", lower);
1463 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1467 else if (G_IS_PARAM_SPEC_DOUBLE (spec))
1469 GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1471 lower = describe_double_constant (pspec->minimum);
1472 upper = describe_double_constant (pspec->maximum);
1473 if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE))
1475 if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
1476 desc = g_strdup ("");
1478 desc = g_strdup_printf ("<= %s", upper);
1480 else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
1481 desc = g_strdup_printf (">= %s", lower);
1483 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1489 desc = g_strdup ("");
1496 describe_default (GParamSpec *spec)
1500 if (G_IS_PARAM_SPEC_CHAR (spec))
1502 GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1504 desc = g_strdup_printf ("%d", pspec->default_value);
1506 else if (G_IS_PARAM_SPEC_UCHAR (spec))
1508 GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1510 desc = g_strdup_printf ("%u", pspec->default_value);
1512 else if (G_IS_PARAM_SPEC_BOOLEAN (spec))
1514 GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec);
1516 desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE");
1518 else if (G_IS_PARAM_SPEC_INT (spec))
1520 GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1522 desc = g_strdup_printf ("%d", pspec->default_value);
1524 else if (G_IS_PARAM_SPEC_UINT (spec))
1526 GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1528 desc = g_strdup_printf ("%u", pspec->default_value);
1530 else if (G_IS_PARAM_SPEC_LONG (spec))
1532 GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1534 desc = g_strdup_printf ("%ld", pspec->default_value);
1536 else if (G_IS_PARAM_SPEC_LONG (spec))
1538 GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1540 desc = g_strdup_printf ("%lu", pspec->default_value);
1542 else if (G_IS_PARAM_SPEC_INT64 (spec))
1544 GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1546 desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value);
1548 else if (G_IS_PARAM_SPEC_UINT64 (spec))
1550 GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1552 desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value);
1554 else if (G_IS_PARAM_SPEC_UNICHAR (spec))
1556 GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec);
1558 if (g_unichar_isprint (pspec->default_value))
1559 desc = g_strdup_printf ("'%c'", pspec->default_value);
1561 desc = g_strdup_printf ("%u", pspec->default_value);
1563 else if (G_IS_PARAM_SPEC_ENUM (spec))
1565 GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec);
1567 GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value);
1569 desc = g_strdup_printf ("%s", value->value_name);
1571 desc = g_strdup_printf ("%d", pspec->default_value);
1573 else if (G_IS_PARAM_SPEC_FLAGS (spec))
1575 GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec);
1576 guint default_value;
1579 default_value = pspec->default_value;
1580 acc = g_string_new ("");
1582 while (default_value)
1584 GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
1590 g_string_append (acc, "|");
1591 g_string_append (acc, value->value_name);
1593 default_value &= ~value->value;
1596 if (default_value == 0)
1597 desc = g_string_free (acc, FALSE);
1600 desc = g_strdup_printf ("%d", pspec->default_value);
1601 g_string_free (acc, TRUE);
1604 else if (G_IS_PARAM_SPEC_FLOAT (spec))
1606 GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1608 /* make sure floats are output with a decimal dot irrespective of
1609 * current locale. Use formatd since we want human-readable numbers
1610 * and do not need the exact same bit representation when deserialising */
1611 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1612 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1613 pspec->default_value);
1615 else if (G_IS_PARAM_SPEC_DOUBLE (spec))
1617 GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1619 /* make sure floats are output with a decimal dot irrespective of
1620 * current locale. Use formatd since we want human-readable numbers
1621 * and do not need the exact same bit representation when deserialising */
1622 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1623 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1624 pspec->default_value);
1626 else if (G_IS_PARAM_SPEC_STRING (spec))
1628 GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec);
1630 if (pspec->default_value)
1632 gchar *esc = g_strescape (pspec->default_value, NULL);
1634 desc = g_strdup_printf ("\\"%s\\"", esc);
1639 desc = g_strdup_printf ("NULL");
1643 desc = g_strdup ("");
1651 output_object_args (FILE *fp, GType object_type)
1654 const gchar *object_class_name;
1656 gchar flags[16], *pos;
1657 GParamSpec **properties;
1659 gboolean child_prop;
1660 gboolean style_prop;
1661 gboolean is_pointer;
1662 const gchar *type_name;
1664 gchar *default_value;
1666 if (G_TYPE_IS_OBJECT (object_type))
1668 class = g_type_class_peek (object_type);
1672 properties = g_object_class_list_properties (class, &n_properties);
1674 #if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3)
1675 else if (G_TYPE_IS_INTERFACE (object_type))
1677 class = g_type_default_interface_ref (object_type);
1682 properties = g_object_interface_list_properties (class, &n_properties);
1688 object_class_name = g_type_name (object_type);
1694 qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs);
1695 for (arg = 0; arg < n_properties; arg++)
1697 GParamSpec *spec = properties[arg];
1698 const gchar *nick, *blurb, *dot;
1700 if (spec->owner_type != object_type)
1704 /* We use one-character flags for simplicity. */
1705 if (child_prop && !style_prop)
1709 if (spec->flags & G_PARAM_READABLE)
1711 if (spec->flags & G_PARAM_WRITABLE)
1713 if (spec->flags & G_PARAM_CONSTRUCT)
1715 if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
1719 nick = g_param_spec_get_nick (spec);
1720 blurb = g_param_spec_get_blurb (spec);
1724 int str_len = strlen (blurb);
1725 if (str_len > 0 && blurb[str_len - 1] != '.')
1729 type_desc = describe_type (spec);
1730 default_value = describe_default (spec);
1731 type_name = get_type_name (spec->value_type, &is_pointer);
1732 fprintf (fp, "<ARG>\\n<NAME>%s::%s</NAME>\\n<TYPE>%s%s</TYPE>\\n<RANGE>%s</RANGE>\\n<FLAGS>%s</FLAGS>\\n<NICK>%s</NICK>\\n<BLURB>%s%s</BLURB>\\n<DEFAULT>%s</DEFAULT>\\n</ARG>\\n\\n",
1733 object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value);
1735 g_free (default_value);
1738 g_free (properties);
1740 #ifdef GTK_IS_CONTAINER_CLASS
1741 if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) {
1742 properties = gtk_container_class_list_child_properties (class, &n_properties);
1748 #ifdef GTK_IS_WIDGET_CLASS
1749 #if GTK_CHECK_VERSION(2,1,0)
1750 if (!style_prop && GTK_IS_WIDGET_CLASS (class)) {
1751 properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties);
1765 # Compile and run our file
1767 $CC = $ENV{CC} ? $ENV{CC} : "gcc";
1768 $LD = $ENV{LD} ? $ENV{LD} : $CC;
1769 $CFLAGS = $ENV{CFLAGS} ? "$ENV{CFLAGS}" : "";
1770 $LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : "";
1773 if ($CC =~ /libtool/) {
1774 $o_file = "$MODULE-scan.lo"
1776 $o_file = "$MODULE-scan.o"
1779 print "gtk-doc: Compiling scanner\n";
1780 $command = "$CC $CFLAGS -c -o $o_file $MODULE-scan.c";
1781 system($command) == 0 or die "Compilation of scanner failed: $!\n";
1783 print "gtk-doc: Linking scanner\n";
1784 $command = "$LD -o $MODULE-scan $o_file $LDFLAGS";
1785 system($command) == 0 or die "Linking of scanner failed: $!\n";
1787 print "gtk-doc: Running scanner $MODULE-scan\n";
1788 system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n";
1790 if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) {
1791 unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan";
1794 #&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0);
1795 &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0);
1796 &UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0);
1797 &UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0);
1798 #&UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0);