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;
200 /* get a list of features from plugins in our source module */
201 plugins = gst_registry_get_plugin_list (gst_registry_get_default());
203 xmlstr = g_string_new ("");
209 FILE *inspect = NULL;
212 plugin = (GstPlugin *) (plugins->data);
213 plugins = g_list_next (plugins);
214 source = gst_plugin_get_source (plugin);
215 /*g_print ("plugin: %s source: %s\\n", plugin->desc.name, source);*/
216 if (!source || strcmp (source, "$SOURCE") != 0) {
220 /* skip static coreelements plugin with pipeline and bin element factory */
221 if (gst_plugin_get_filename (plugin) == NULL)
224 g_print ("plugin: %s source: %s\\n", plugin->desc.name, source);
226 inspect_name = g_strdup_printf ("$INSPECT_DIR" G_DIR_SEPARATOR_S "plugin-%s.xml",
228 inspect = fopen (inspect_name, "w");
229 if (inspect == NULL) {
230 g_error ("Could not open %s for writing: %s\\n", inspect_name,
233 g_free (inspect_name);
235 /* output plugin data */
236 fputs ("<plugin>\\n",inspect);
237 fputs (xmlprint(2, "name", plugin->desc.name),inspect);
238 fputs (xmlprint(2, "description", plugin->desc.description),inspect);
239 fputs (xmlprint(2, "filename", plugin->filename),inspect);
240 fputs (xmlprint(2, "basename", plugin->basename),inspect);
241 fputs (xmlprint(2, "version", plugin->desc.version),inspect);
242 fputs (xmlprint(2, "license", plugin->desc.license),inspect);
243 fputs (xmlprint(2, "source", plugin->desc.source),inspect);
244 fputs (xmlprint(2, "package", plugin->desc.package),inspect);
245 fputs (xmlprint(2, "origin", plugin->desc.origin),inspect);
246 fputs (" <elements>\\n", inspect);
249 gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
252 /* sort factories by feature->name */
253 features = g_list_sort (features, gst_feature_sort_compare);
256 GstPluginFeature *feature;
257 feature = GST_PLUGIN_FEATURE (features->data);
258 feature = gst_plugin_feature_load (feature);
260 g_warning ("Could not load plugin feature %s",
261 gst_plugin_feature_get_name (feature));
264 if (GST_IS_ELEMENT_FACTORY (feature)) {
265 const gchar *pad_dir[] = { "unknown","source","sink" };
266 const gchar *pad_pres[] = { "always","sometimes","request" };
269 /*g_print (" feature: %s\\n", feature->name);*/
271 factory = GST_ELEMENT_FACTORY (feature);
272 factories = g_list_prepend (factories, factory);
274 /* output element data */
275 fputs (" <element>\\n", inspect);
276 fputs (xmlprint(6, "name", feature->name),inspect);
277 fputs (xmlprint(6, "longname", factory->details.longname),inspect);
278 fputs (xmlprint(6, "class", factory->details.klass),inspect);
279 fputs (xmlprint(6, "description", factory->details.description),inspect);
280 fputs (xmlprint(6, "author", factory->details.author),inspect);
281 fputs (" <pads>\\n", inspect);
283 /* output pad-template data */
284 pads = g_list_copy ((GList *) gst_element_factory_get_static_pad_templates (factory));
285 pads = g_list_sort (pads, static_pad_template_compare);
286 for (pad = pads; pad != NULL; pad = pad->next) {
287 GstStaticPadTemplate *pt = pad->data;
289 fputs (" <caps>\\n", inspect);
290 fputs (xmlprint(10, "name", pt->name_template),inspect);
291 fputs (xmlprint(10, "direction", pad_dir[pt->direction]),inspect);
292 fputs (xmlprint(10, "presence", pad_pres[pt->presence]),inspect);
293 fputs (xmlprint(10, "details", pt->static_caps.string),inspect);
294 fputs (" </caps>\\n", inspect);
297 fputs (" </pads>\\n </element>\\n", inspect);
299 features = g_list_next (features);
302 fputs (" </elements>\\n</plugin>", inspect);
306 g_string_free (xmlstr, TRUE);
308 g_message ("number of element factories: %d", g_list_length (factories));
310 /* allocate the object_types array to hold them */
311 object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1);
318 factory = GST_ELEMENT_FACTORY (l->data);
319 type = gst_element_factory_get_element_type (factory);
321 g_message ("adding type %p for factory %s", (void *) type, gst_element_factory_get_longname (factory));
322 object_types[i++] = type;
324 g_message ("type info for factory %s not found",
325 gst_element_factory_get_longname (factory));
332 # get_type functions:
337 g_message ("$_ () didn't return a valid type");
340 object_types[i++] = type;
345 # Implicit types retrieved from GLib:
348 type = g_type_from_name ("$_");
350 g_message ("Implicit type $_ not found");
353 object_types[i++] = type;
362 /* Need to make sure all the types are loaded in and initialize
363 * their signals and properties.
365 for (i=0; object_types[i]; i++) {
366 if (G_TYPE_IS_CLASSED (object_types[i]))
367 g_type_class_ref (object_types[i]);
369 g_warning ("not reffing type: %s", g_type_name (object_types[i]));
377 * This uses GObject type functions to output signal prototypes and the object
381 /* The output files */
382 const gchar *signals_filename = "$new_signals_filename";
383 const gchar *hierarchy_filename = "$new_hierarchy_filename";
384 const gchar *interfaces_filename = "$new_interfaces_filename";
385 const gchar *prerequisites_filename = "$new_prerequisites_filename";
386 const gchar *args_filename = "$new_args_filename";
389 static void output_signals (void);
390 static void output_object_signals (FILE *fp,
392 static void output_object_signal (FILE *fp,
393 const gchar *object_class_name,
395 static const gchar * get_type_name (GType type,
396 gboolean * is_pointer);
397 static const gchar * get_gdk_event (const gchar * signal_name);
398 static const gchar ** lookup_signal_arg_names (const gchar * type,
399 const gchar * signal_name);
401 static void output_object_hierarchy (void);
402 static void output_hierarchy (FILE *fp,
406 static void output_object_interfaces (void);
407 static void output_interfaces (FILE *fp,
410 static void output_interface_prerequisites (void);
411 static void output_prerequisites (FILE *fp,
414 static void output_args (void);
415 static void output_object_args (FILE *fp, GType object_type);
418 main (int argc, char *argv[])
420 /* Silence the compiler: */
421 if (argv != argv) argc = argc;
428 output_object_hierarchy ();
429 output_object_interfaces ();
430 output_interface_prerequisites ();
438 output_signals (void)
443 fp = fopen (signals_filename, "w");
446 g_warning ("Couldn't open output file: %s : %s", signals_filename, strerror(errno));
450 for (i = 0; object_types[i]; i++)
451 output_object_signals (fp, object_types[i]);
457 compare_signals (const void *a, const void *b)
459 const guint *signal_a = a;
460 const guint *signal_b = b;
462 return strcmp (g_signal_name (*signal_a), g_signal_name (*signal_b));
465 /* This outputs all the signals of one object. */
467 output_object_signals (FILE *fp, GType object_type)
469 const gchar *object_class_name;
470 guint *signals, n_signals;
473 if (G_TYPE_IS_INSTANTIATABLE (object_type) ||
474 G_TYPE_IS_INTERFACE (object_type))
477 object_class_name = g_type_name (object_type);
479 signals = g_signal_list_ids (object_type, &n_signals);
480 qsort (signals, n_signals, sizeof (guint), compare_signals);
482 for (sig = 0; sig < n_signals; sig++)
484 output_object_signal (fp, object_class_name, signals[sig]);
491 /* This outputs one signal. */
493 output_object_signal (FILE *fp,
494 const gchar *object_name,
497 GSignalQuery query_info;
498 const gchar *type_name, *ret_type, *object_arg, *arg_name;
499 gchar *pos, *object_arg_lower;
501 gchar ret_type_buffer[1024], buffer[1024];
503 const gchar **arg_names;
504 gint param_num, widget_num, event_num, callback_num;
506 gchar signal_name[128];
509 /* g_print ("Object: %s Signal: %u\\n", object_name, signal_id);*/
512 widget_num = event_num = callback_num = 0;
514 g_signal_query (signal_id, &query_info);
516 /* Output the return type and function name. */
517 ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
518 sprintf (ret_type_buffer, "%s%s", ret_type, is_pointer ? "*" : "");
520 /* Output the signal object type and the argument name. We assume the
521 type is a pointer - I think that is OK. We remove "Gtk" or "Gnome" and
522 convert to lower case for the argument name. */
524 sprintf (pos, "%s ", object_name);
527 if (!strncmp (object_name, "Gtk", 3))
528 object_arg = object_name + 3;
529 else if (!strncmp (object_name, "Gnome", 5))
530 object_arg = object_name + 5;
532 object_arg = object_name;
534 object_arg_lower = g_ascii_strdown (object_arg, -1);
535 sprintf (pos, "*%s\\n", object_arg_lower);
537 if (!strncmp (object_arg_lower, "widget", 6))
539 g_free(object_arg_lower);
541 /* Convert signal name to use underscores rather than dashes '-'. */
542 strcpy (signal_name, query_info.signal_name);
543 for (i = 0; signal_name[i]; i++)
545 if (signal_name[i] == '-')
546 signal_name[i] = '_';
549 /* Output the signal parameters. */
550 arg_names = lookup_signal_arg_names (object_name, signal_name);
552 for (param = 0; param < query_info.n_params; param++)
556 sprintf (pos, "%s\\n", arg_names[param]);
561 type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
563 /* Most arguments to the callback are called "arg1", "arg2", etc.
564 GdkWidgets are called "widget", "widget2", ...
565 GdkEvents are called "event", "event2", ...
566 GtkCallbacks are called "callback", "callback2", ... */
567 if (!strcmp (type_name, "GtkWidget"))
570 arg_num = &widget_num;
572 else if (!strcmp (type_name, "GdkEvent"))
574 type_name = get_gdk_event (signal_name);
576 arg_num = &event_num;
579 else if (!strcmp (type_name, "GtkCallback")
580 || !strcmp (type_name, "GtkCCallback"))
582 arg_name = "callback";
583 arg_num = &callback_num;
588 arg_num = ¶m_num;
590 sprintf (pos, "%s ", type_name);
593 if (!arg_num || *arg_num == 0)
594 sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name);
596 sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name,
611 /* We use one-character flags for simplicity. */
612 if (query_info.signal_flags & G_SIGNAL_RUN_FIRST)
614 if (query_info.signal_flags & G_SIGNAL_RUN_LAST)
616 if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP)
618 if (query_info.signal_flags & G_SIGNAL_NO_RECURSE)
620 if (query_info.signal_flags & G_SIGNAL_DETAILED)
622 if (query_info.signal_flags & G_SIGNAL_ACTION)
624 if (query_info.signal_flags & G_SIGNAL_NO_HOOKS)
629 "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
630 object_name, query_info.signal_name, ret_type_buffer, flags, buffer);
634 /* Returns the type name to use for a signal argument or return value, given
635 the GtkType from the signal info. It also sets is_pointer to TRUE if the
636 argument needs a '*' since it is a pointer. */
638 get_type_name (GType type, gboolean * is_pointer)
640 const gchar *type_name;
643 type_name = g_type_name (type);
657 /* These all have normal C type names so they are OK. */
661 /* A GtkString is really a gchar*. */
667 /* We use a gint for both of these. Hopefully a subtype with a decent
668 name will be registered and used instead, as GTK+ does itself. */
672 /* The boxed type shouldn't be used itself, only subtypes. Though we
673 return 'gpointer' just in case. */
677 /* A GParam is really a GParamSpec*. */
685 /* For all GObject subclasses we can use the class name with a "*",
686 e.g. 'GtkWidget *'. */
687 if (g_type_is_a (type, G_TYPE_OBJECT))
690 if (G_TYPE_IS_CLASSED (type))
693 /* All boxed subtypes will be pointers as well. */
694 if (g_type_is_a (type, G_TYPE_BOXED))
697 /* All pointer subtypes will be pointers as well. */
698 if (g_type_is_a (type, G_TYPE_POINTER))
701 /* But enums are not */
702 if (g_type_is_a (type, G_TYPE_ENUM) ||
703 g_type_is_a (type, G_TYPE_FLAGS))
711 get_gdk_event (const gchar * signal_name)
713 static const gchar *GbGDKEvents[] =
715 "button_press_event", "GdkEventButton",
716 "button_release_event", "GdkEventButton",
717 "motion_notify_event", "GdkEventMotion",
718 "delete_event", "GdkEvent",
719 "destroy_event", "GdkEvent",
720 "expose_event", "GdkEventExpose",
721 "key_press_event", "GdkEventKey",
722 "key_release_event", "GdkEventKey",
723 "enter_notify_event", "GdkEventCrossing",
724 "leave_notify_event", "GdkEventCrossing",
725 "configure_event", "GdkEventConfigure",
726 "focus_in_event", "GdkEventFocus",
727 "focus_out_event", "GdkEventFocus",
728 "map_event", "GdkEvent",
729 "unmap_event", "GdkEvent",
730 "property_notify_event", "GdkEventProperty",
731 "selection_clear_event", "GdkEventSelection",
732 "selection_request_event", "GdkEventSelection",
733 "selection_notify_event", "GdkEventSelection",
734 "proximity_in_event", "GdkEventProximity",
735 "proximity_out_event", "GdkEventProximity",
736 "drag_begin_event", "GdkEventDragBegin",
737 "drag_request_event", "GdkEventDragRequest",
738 "drag_end_event", "GdkEventDragRequest",
739 "drop_enter_event", "GdkEventDropEnter",
740 "drop_leave_event", "GdkEventDropLeave",
741 "drop_data_available_event", "GdkEventDropDataAvailable",
742 "other_event", "GdkEventOther",
743 "client_event", "GdkEventClient",
744 "no_expose_event", "GdkEventNoExpose",
745 "visibility_notify_event", "GdkEventVisibility",
746 "window_state_event", "GdkEventWindowState",
747 "scroll_event", "GdkEventScroll",
753 for (i = 0; GbGDKEvents[i]; i += 2)
755 if (!strcmp (signal_name, GbGDKEvents[i]))
756 return GbGDKEvents[i + 1];
762 /* This returns argument names to use for some known GTK signals.
763 It is passed a widget name, e.g. 'GtkCList' and a signal name, e.g.
764 'select_row' and it returns a pointer to an array of argument types and
766 static const gchar **
767 lookup_signal_arg_names (const gchar * type, const gchar * signal_name)
769 /* Each arg array starts with the object type name and the signal name,
770 and then signal arguments follow. */
771 static const gchar *GbArgTable[][16] =
773 {"GtkCList", "select_row",
776 "GdkEventButton *event"},
777 {"GtkCList", "unselect_row",
780 "GdkEventButton *event"},
781 {"GtkCList", "click_column",
784 {"GtkCList", "resize_column",
788 {"GtkCList", "extend_selection",
789 "GtkScrollType scroll_type",
791 "gboolean auto_start_selection"},
792 {"GtkCList", "scroll_vertical",
793 "GtkScrollType scroll_type",
795 {"GtkCList", "scroll_horizontal",
796 "GtkScrollType scroll_type",
799 {"GtkCTree", "tree_select_row",
800 "GtkCTreeNode *node",
802 {"GtkCTree", "tree_unselect_row",
803 "GtkCTreeNode *node",
805 {"GtkCTree", "tree_expand",
806 "GtkCTreeNode *node"},
807 {"GtkCTree", "tree_collapse",
808 "GtkCTreeNode *node"},
809 {"GtkCTree", "tree_move",
810 "GtkCTreeNode *node",
811 "GtkCTreeNode *new_parent",
812 "GtkCTreeNode *new_sibling"},
813 {"GtkCTree", "change_focus_row_expansion",
814 "GtkCTreeExpansionType expansion"},
816 {"GtkEditable", "insert_text",
818 "gint new_text_length",
820 {"GtkEditable", "delete_text",
823 {"GtkEditable", "set_editable",
824 "gboolean is_editable"},
825 {"GtkEditable", "move_cursor",
828 {"GtkEditable", "move_word",
830 {"GtkEditable", "move_page",
833 {"GtkEditable", "move_to_row",
835 {"GtkEditable", "move_to_column",
838 {"GtkEditable", "kill_char",
840 {"GtkEditable", "kill_word",
842 {"GtkEditable", "kill_line",
846 {"GtkInputDialog", "enable_device",
847 "GdkDevice *deviceid"},
848 {"GtkInputDialog", "disable_device",
849 "GdkDevice *deviceid"},
851 {"GtkListItem", "extend_selection",
852 "GtkScrollType scroll_type",
854 "gboolean auto_start_selection"},
855 {"GtkListItem", "scroll_vertical",
856 "GtkScrollType scroll_type",
858 {"GtkListItem", "scroll_horizontal",
859 "GtkScrollType scroll_type",
862 {"GtkMenuShell", "move_current",
863 "GtkMenuDirectionType direction"},
864 {"GtkMenuShell", "activate_current",
865 "gboolean force_hide"},
868 {"GtkNotebook", "switch_page",
869 "GtkNotebookPage *page",
871 {"GtkStatusbar", "text_pushed",
874 {"GtkStatusbar", "text_popped",
877 {"GtkTipsQuery", "widget_entered",
880 "gchar *tip_private"},
881 {"GtkTipsQuery", "widget_selected",
884 "gchar *tip_private",
885 "GdkEventButton *event"},
886 {"GtkToolbar", "orientation_changed",
887 "GtkOrientation orientation"},
888 {"GtkToolbar", "style_changed",
889 "GtkToolbarStyle style"},
890 {"GtkWidget", "draw",
891 "GdkRectangle *area"},
892 {"GtkWidget", "size_request",
893 "GtkRequisition *requisition"},
894 {"GtkWidget", "size_allocate",
895 "GtkAllocation *allocation"},
896 {"GtkWidget", "state_changed",
897 "GtkStateType state"},
898 {"GtkWidget", "style_set",
899 "GtkStyle *previous_style"},
901 {"GtkWidget", "install_accelerator",
902 "gchar *signal_name",
906 {"GtkWidget", "add_accelerator",
907 "guint accel_signal_id",
908 "GtkAccelGroup *accel_group",
910 "GdkModifierType accel_mods",
911 "GtkAccelFlags accel_flags"},
913 {"GtkWidget", "parent_set",
914 "GtkObject *old_parent"},
916 {"GtkWidget", "remove_accelerator",
917 "GtkAccelGroup *accel_group",
919 "GdkModifierType accel_mods"},
920 {"GtkWidget", "debug_msg",
922 {"GtkWindow", "move_resize",
927 {"GtkWindow", "set_focus",
928 "GtkWidget *widget"},
930 {"GtkWidget", "selection_get",
931 "GtkSelectionData *data",
934 {"GtkWidget", "selection_received",
935 "GtkSelectionData *data",
938 {"GtkWidget", "drag_begin",
939 "GdkDragContext *drag_context"},
940 {"GtkWidget", "drag_end",
941 "GdkDragContext *drag_context"},
942 {"GtkWidget", "drag_data_delete",
943 "GdkDragContext *drag_context"},
944 {"GtkWidget", "drag_leave",
945 "GdkDragContext *drag_context",
947 {"GtkWidget", "drag_motion",
948 "GdkDragContext *drag_context",
952 {"GtkWidget", "drag_drop",
953 "GdkDragContext *drag_context",
957 {"GtkWidget", "drag_data_get",
958 "GdkDragContext *drag_context",
959 "GtkSelectionData *data",
962 {"GtkWidget", "drag_data_received",
963 "GdkDragContext *drag_context",
966 "GtkSelectionData *data",
975 for (i = 0; GbArgTable[i][0]; i++)
978 if (!strcmp (type, GbArgTable[i][0])
979 && !strcmp (signal_name, GbArgTable[i][1]))
980 return &GbArgTable[i][2];
986 /* This outputs the hierarchy of all objects which have been initialized,
987 i.e. by calling their XXX_get_type() initialization function. */
989 output_object_hierarchy (void)
994 fp = fopen (hierarchy_filename, "w");
997 g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, strerror(errno));
1000 output_hierarchy (fp, G_TYPE_OBJECT, 0);
1001 output_hierarchy (fp, G_TYPE_INTERFACE, 0);
1003 for (i=0; object_types[i]; i++) {
1004 if (!g_type_parent (object_types[i]) &&
1005 (object_types[i] != G_TYPE_NONE) &&
1006 (object_types[i] != G_TYPE_OBJECT) &&
1007 (object_types[i] != G_TYPE_INTERFACE)
1009 g_warning ("printing hierarchy for root type: %s",
1010 g_type_name (object_types[i]));
1011 output_hierarchy (fp, object_types[i], 0);
1015 for (i=0; object_types[i]; i++) {
1016 if(object_types[i] != G_TYPE_NONE) {
1017 g_print ("type has not been added to hierarchy: %s\\n",
1018 g_type_name (object_types[i]));
1027 type_cmp (const void * p1, const void * p2)
1029 return strcmp (g_type_name (*((GType *) p1)), g_type_name (*((GType *) p2)));
1032 /* This is called recursively to output the hierarchy of a widget. */
1034 output_hierarchy (FILE *fp,
1046 for (i=0; object_types[i]; i++) {
1047 if(object_types[i] == type) {
1048 g_print ("added type to hierarchy (level %d): %s\\n",
1049 level, g_type_name (type));
1050 object_types[i] = G_TYPE_NONE;
1056 for (i = 0; i < level; i++)
1058 fprintf (fp, "%s", g_type_name (type));
1059 fprintf (fp, "\\n");
1061 children = g_type_children (type, &n_children);
1063 qsort (&children[0], n_children, sizeof (GType), type_cmp);
1065 for (i=0; i < n_children; i++) {
1066 output_hierarchy (fp, children[i], level + 1);
1072 static void output_object_interfaces (void)
1077 fp = fopen (interfaces_filename, "w");
1080 g_warning ("Couldn't open output file: %s : %s", interfaces_filename, strerror(errno));
1083 output_interfaces (fp, G_TYPE_OBJECT);
1085 for (i = 0; object_types[i]; i++)
1087 if (!g_type_parent (object_types[i]) &&
1088 (object_types[i] != G_TYPE_OBJECT) &&
1089 G_TYPE_IS_INSTANTIATABLE (object_types[i]))
1091 output_interfaces (fp, object_types[i]);
1098 output_interfaces (FILE *fp,
1102 GType *children, *interfaces;
1103 guint n_children, n_interfaces;
1108 interfaces = g_type_interfaces (type, &n_interfaces);
1110 if (n_interfaces > 0)
1112 fprintf (fp, "%s", g_type_name (type));
1113 for (i=0; i < n_interfaces; i++)
1114 fprintf (fp, " %s", g_type_name (interfaces[i]));
1115 fprintf (fp, "\\n");
1117 g_free (interfaces);
1119 children = g_type_children (type, &n_children);
1121 for (i=0; i < n_children; i++)
1122 output_interfaces (fp, children[i]);
1127 static void output_interface_prerequisites (void)
1131 fp = fopen (prerequisites_filename, "w");
1134 g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, strerror(errno));
1137 output_prerequisites (fp, G_TYPE_INTERFACE);
1142 output_prerequisites (FILE *fp,
1145 #if GLIB_CHECK_VERSION(2,1,0)
1147 GType *children, *prerequisites;
1148 guint n_children, n_prerequisites;
1153 prerequisites = g_type_interface_prerequisites (type, &n_prerequisites);
1155 if (n_prerequisites > 0)
1157 fprintf (fp, "%s", g_type_name (type));
1158 for (i=0; i < n_prerequisites; i++)
1159 fprintf (fp, " %s", g_type_name (prerequisites[i]));
1160 fprintf (fp, "\\n");
1162 g_free (prerequisites);
1164 children = g_type_children (type, &n_children);
1166 for (i=0; i < n_children; i++)
1167 output_prerequisites (fp, children[i]);
1179 fp = fopen (args_filename, "w");
1182 g_warning ("Couldn't open output file: %s : %s", args_filename, strerror(errno));
1186 for (i = 0; object_types[i]; i++) {
1187 output_object_args (fp, object_types[i]);
1194 compare_param_specs (const void *a, const void *b)
1196 GParamSpec *spec_a = *(GParamSpec **)a;
1197 GParamSpec *spec_b = *(GParamSpec **)b;
1199 return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b));
1202 /* Its common to have unsigned properties restricted
1203 * to the signed range. Therefore we make this look
1204 * a bit nicer by spelling out the max constants.
1207 /* Don't use "==" with floats, it might trigger a gcc warning. */
1208 #define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y)
1211 describe_double_constant (gdouble value)
1215 if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE))
1216 desc = g_strdup ("G_MAXDOUBLE");
1217 else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE))
1218 desc = g_strdup ("G_MINDOUBLE");
1219 else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE))
1220 desc = g_strdup ("-G_MAXDOUBLE");
1221 else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT))
1222 desc = g_strdup ("G_MAXFLOAT");
1223 else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT))
1224 desc = g_strdup ("G_MINFLOAT");
1225 else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT))
1226 desc = g_strdup ("-G_MAXFLOAT");
1228 /* make sure floats are output with a decimal dot irrespective of
1229 * current locale. Use formatd since we want human-readable numbers
1230 * and do not need the exact same bit representation when deserialising */
1231 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1232 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value);
1239 describe_signed_constant (gint64 value)
1243 if (value == G_MAXINT)
1244 desc = g_strdup ("G_MAXINT");
1245 else if (value == G_MININT)
1246 desc = g_strdup ("G_MININT");
1247 else if (value == G_MAXUINT)
1248 desc = g_strdup ("G_MAXUINT");
1249 else if (value == G_MAXLONG)
1250 desc = g_strdup ("G_MAXLONG");
1251 else if (value == G_MINLONG)
1252 desc = g_strdup ("G_MINLONG");
1253 else if (value == G_MAXULONG)
1254 desc = g_strdup ("G_MAXULONG");
1255 else if (value == G_MAXINT64)
1256 desc = g_strdup ("G_MAXINT64");
1257 else if (value == G_MININT64)
1258 desc = g_strdup ("G_MININT64");
1260 desc = g_strdup_printf ("%" G_GINT64_FORMAT, value);
1266 describe_unsigned_constant (guint64 value)
1270 if (value == G_MAXINT)
1271 desc = g_strdup ("G_MAXINT");
1272 else if (value == G_MININT)
1273 desc = g_strdup ("G_MININT");
1274 else if (value == G_MAXUINT)
1275 desc = g_strdup ("G_MAXUINT");
1276 else if (value == G_MAXLONG)
1277 desc = g_strdup ("G_MAXLONG");
1278 else if (value == G_MINLONG)
1279 desc = g_strdup ("G_MINLONG");
1280 else if (value == G_MAXULONG)
1281 desc = g_strdup ("G_MAXULONG");
1282 else if (value == G_MAXINT64)
1283 desc = g_strdup ("G_MAXINT64");
1284 else if (value == G_MININT64)
1285 desc = g_strdup ("G_MININT64");
1286 else if (value == G_MAXUINT64)
1287 desc = g_strdup ("G_MAXUINT64");
1289 desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
1295 describe_type (GParamSpec *spec)
1301 if (G_IS_PARAM_SPEC_CHAR (spec))
1303 GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1305 lower = describe_signed_constant (pspec->minimum);
1306 upper = describe_signed_constant (pspec->maximum);
1307 if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8)
1308 desc = g_strdup ("");
1309 else if (pspec->minimum == G_MININT8)
1310 desc = g_strdup_printf ("<= %s", upper);
1311 else if (pspec->maximum == G_MAXINT8)
1312 desc = g_strdup_printf (">= %s", lower);
1314 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1318 else if (G_IS_PARAM_SPEC_UCHAR (spec))
1320 GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1322 lower = describe_unsigned_constant (pspec->minimum);
1323 upper = describe_unsigned_constant (pspec->maximum);
1324 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8)
1325 desc = g_strdup ("");
1326 else if (pspec->minimum == 0)
1327 desc = g_strdup_printf ("<= %s", upper);
1328 else if (pspec->maximum == G_MAXUINT8)
1329 desc = g_strdup_printf (">= %s", lower);
1331 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1335 else if (G_IS_PARAM_SPEC_INT (spec))
1337 GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1339 lower = describe_signed_constant (pspec->minimum);
1340 upper = describe_signed_constant (pspec->maximum);
1341 if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT)
1342 desc = g_strdup ("");
1343 else if (pspec->minimum == G_MININT)
1344 desc = g_strdup_printf ("<= %s", upper);
1345 else if (pspec->maximum == G_MAXINT)
1346 desc = g_strdup_printf (">= %s", lower);
1348 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1352 else if (G_IS_PARAM_SPEC_UINT (spec))
1354 GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1356 lower = describe_unsigned_constant (pspec->minimum);
1357 upper = describe_unsigned_constant (pspec->maximum);
1358 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT)
1359 desc = g_strdup ("");
1360 else if (pspec->minimum == 0)
1361 desc = g_strdup_printf ("<= %s", upper);
1362 else if (pspec->maximum == G_MAXUINT)
1363 desc = g_strdup_printf (">= %s", lower);
1365 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1369 else if (G_IS_PARAM_SPEC_LONG (spec))
1371 GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1373 lower = describe_signed_constant (pspec->minimum);
1374 upper = describe_signed_constant (pspec->maximum);
1375 if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG)
1376 desc = g_strdup ("");
1377 else if (pspec->minimum == G_MINLONG)
1378 desc = g_strdup_printf ("<= %s", upper);
1379 else if (pspec->maximum == G_MAXLONG)
1380 desc = g_strdup_printf (">= %s", lower);
1382 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1386 else if (G_IS_PARAM_SPEC_ULONG (spec))
1388 GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1391 lower = describe_unsigned_constant (pspec->minimum);
1392 upper = describe_unsigned_constant (pspec->maximum);
1393 if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG)
1394 desc = g_strdup ("");
1395 else if (pspec->minimum == 0)
1396 desc = g_strdup_printf ("<= %s", upper);
1397 else if (pspec->maximum == G_MAXULONG)
1398 desc = g_strdup_printf (">= %s", lower);
1400 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1404 else if (G_IS_PARAM_SPEC_INT64 (spec))
1406 GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1408 lower = describe_signed_constant (pspec->minimum);
1409 upper = describe_signed_constant (pspec->maximum);
1410 if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64)
1411 desc = g_strdup ("");
1412 else if (pspec->minimum == G_MININT64)
1413 desc = g_strdup_printf ("<= %s", upper);
1414 else if (pspec->maximum == G_MAXINT64)
1415 desc = g_strdup_printf (">= %s", lower);
1417 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1421 else if (G_IS_PARAM_SPEC_UINT64 (spec))
1423 GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1425 lower = describe_unsigned_constant (pspec->minimum);
1426 upper = describe_unsigned_constant (pspec->maximum);
1427 if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64)
1428 desc = g_strdup ("");
1429 else if (pspec->minimum == 0)
1430 desc = g_strdup_printf ("<= %s", upper);
1431 else if (pspec->maximum == G_MAXUINT64)
1432 desc = g_strdup_printf (">= %s", lower);
1434 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1438 else if (G_IS_PARAM_SPEC_FLOAT (spec))
1440 GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1442 lower = describe_double_constant (pspec->minimum);
1443 upper = describe_double_constant (pspec->maximum);
1444 if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT))
1446 if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
1447 desc = g_strdup ("");
1449 desc = g_strdup_printf ("<= %s", upper);
1451 else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
1452 desc = g_strdup_printf (">= %s", lower);
1454 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1458 else if (G_IS_PARAM_SPEC_DOUBLE (spec))
1460 GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1462 lower = describe_double_constant (pspec->minimum);
1463 upper = describe_double_constant (pspec->maximum);
1464 if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE))
1466 if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
1467 desc = g_strdup ("");
1469 desc = g_strdup_printf ("<= %s", upper);
1471 else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
1472 desc = g_strdup_printf (">= %s", lower);
1474 desc = g_strdup_printf ("[%s,%s]", lower, upper);
1480 desc = g_strdup ("");
1487 describe_default (GParamSpec *spec)
1491 if (G_IS_PARAM_SPEC_CHAR (spec))
1493 GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1495 desc = g_strdup_printf ("%d", pspec->default_value);
1497 else if (G_IS_PARAM_SPEC_UCHAR (spec))
1499 GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1501 desc = g_strdup_printf ("%u", pspec->default_value);
1503 else if (G_IS_PARAM_SPEC_BOOLEAN (spec))
1505 GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec);
1507 desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE");
1509 else if (G_IS_PARAM_SPEC_INT (spec))
1511 GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1513 desc = g_strdup_printf ("%d", pspec->default_value);
1515 else if (G_IS_PARAM_SPEC_UINT (spec))
1517 GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1519 desc = g_strdup_printf ("%u", pspec->default_value);
1521 else if (G_IS_PARAM_SPEC_LONG (spec))
1523 GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1525 desc = g_strdup_printf ("%ld", pspec->default_value);
1527 else if (G_IS_PARAM_SPEC_LONG (spec))
1529 GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1531 desc = g_strdup_printf ("%lu", pspec->default_value);
1533 else if (G_IS_PARAM_SPEC_INT64 (spec))
1535 GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1537 desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value);
1539 else if (G_IS_PARAM_SPEC_UINT64 (spec))
1541 GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1543 desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value);
1545 else if (G_IS_PARAM_SPEC_UNICHAR (spec))
1547 GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec);
1549 if (g_unichar_isprint (pspec->default_value))
1550 desc = g_strdup_printf ("'%c'", pspec->default_value);
1552 desc = g_strdup_printf ("%u", pspec->default_value);
1554 else if (G_IS_PARAM_SPEC_ENUM (spec))
1556 GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec);
1558 GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value);
1560 desc = g_strdup_printf ("%s", value->value_name);
1562 desc = g_strdup_printf ("%d", pspec->default_value);
1564 else if (G_IS_PARAM_SPEC_FLAGS (spec))
1566 GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec);
1567 guint default_value;
1570 default_value = pspec->default_value;
1571 acc = g_string_new ("");
1573 while (default_value)
1575 GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
1581 g_string_append (acc, "|");
1582 g_string_append (acc, value->value_name);
1584 default_value &= ~value->value;
1587 if (default_value == 0)
1588 desc = g_string_free (acc, FALSE);
1591 desc = g_strdup_printf ("%d", pspec->default_value);
1592 g_string_free (acc, TRUE);
1595 else if (G_IS_PARAM_SPEC_FLOAT (spec))
1597 GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1599 /* make sure floats are output with a decimal dot irrespective of
1600 * current locale. Use formatd since we want human-readable numbers
1601 * and do not need the exact same bit representation when deserialising */
1602 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1603 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1604 pspec->default_value);
1606 else if (G_IS_PARAM_SPEC_DOUBLE (spec))
1608 GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1610 /* make sure floats are output with a decimal dot irrespective of
1611 * current locale. Use formatd since we want human-readable numbers
1612 * and do not need the exact same bit representation when deserialising */
1613 desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1614 g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1615 pspec->default_value);
1617 else if (G_IS_PARAM_SPEC_STRING (spec))
1619 GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec);
1621 if (pspec->default_value)
1623 gchar *esc = g_strescape (pspec->default_value, NULL);
1625 desc = g_strdup_printf ("\\"%s\\"", esc);
1630 desc = g_strdup_printf ("NULL");
1634 desc = g_strdup ("");
1642 output_object_args (FILE *fp, GType object_type)
1645 const gchar *object_class_name;
1647 gchar flags[16], *pos;
1648 GParamSpec **properties;
1650 gboolean child_prop;
1651 gboolean style_prop;
1652 gboolean is_pointer;
1653 const gchar *type_name;
1655 gchar *default_value;
1657 if (G_TYPE_IS_OBJECT (object_type))
1659 class = g_type_class_peek (object_type);
1663 properties = g_object_class_list_properties (class, &n_properties);
1665 #if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3)
1666 else if (G_TYPE_IS_INTERFACE (object_type))
1668 class = g_type_default_interface_ref (object_type);
1673 properties = g_object_interface_list_properties (class, &n_properties);
1679 object_class_name = g_type_name (object_type);
1685 qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs);
1686 for (arg = 0; arg < n_properties; arg++)
1688 GParamSpec *spec = properties[arg];
1689 const gchar *nick, *blurb, *dot;
1691 if (spec->owner_type != object_type)
1695 /* We use one-character flags for simplicity. */
1696 if (child_prop && !style_prop)
1700 if (spec->flags & G_PARAM_READABLE)
1702 if (spec->flags & G_PARAM_WRITABLE)
1704 if (spec->flags & G_PARAM_CONSTRUCT)
1706 if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
1710 nick = g_param_spec_get_nick (spec);
1711 blurb = g_param_spec_get_blurb (spec);
1715 int str_len = strlen (blurb);
1716 if (str_len > 0 && blurb[str_len - 1] != '.')
1720 type_desc = describe_type (spec);
1721 default_value = describe_default (spec);
1722 type_name = get_type_name (spec->value_type, &is_pointer);
1723 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",
1724 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);
1726 g_free (default_value);
1729 g_free (properties);
1731 #ifdef GTK_IS_CONTAINER_CLASS
1732 if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) {
1733 properties = gtk_container_class_list_child_properties (class, &n_properties);
1739 #ifdef GTK_IS_WIDGET_CLASS
1740 #if GTK_CHECK_VERSION(2,1,0)
1741 if (!style_prop && GTK_IS_WIDGET_CLASS (class)) {
1742 properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties);
1756 # Compile and run our file
1758 $CC = $ENV{CC} ? $ENV{CC} : "gcc";
1759 $LD = $ENV{LD} ? $ENV{LD} : $CC;
1760 $CFLAGS = $ENV{CFLAGS} ? "$ENV{CFLAGS}" : "";
1761 $LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : "";
1764 if ($CC =~ /libtool/) {
1765 $o_file = "$MODULE-scan.lo"
1767 $o_file = "$MODULE-scan.o"
1770 print "gtk-doc: Compiling scanner\n";
1771 $command = "$CC $CFLAGS -c -o $o_file $MODULE-scan.c";
1772 system($command) == 0 or die "Compilation of scanner failed: $!\n";
1774 print "gtk-doc: Linking scanner\n";
1775 $command = "$LD -o $MODULE-scan $o_file $LDFLAGS";
1776 system($command) == 0 or die "Linking of scanner failed: $!\n";
1778 print "gtk-doc: Running scanner $MODULE-scan\n";
1779 system("sh -c ./$MODULE-scan") == 0 or die "Scan failed: $!\n";
1781 if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) {
1782 unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan";
1785 #&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0);
1786 &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0);
1787 &UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0);
1788 &UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0);
1789 #&UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0);