diff --git a/gdk/Makefile.am b/gdk/Makefile.am index fe6af7d6f..d70b93ba0 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -207,7 +207,12 @@ Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0 Gdk_2_0_gir_LIBS = $(gdktargetlib) Gdk_2_0_gir_FILES = $(introspection_files) Gdk_2_0_gir_EXPORT_PACKAGES = gdk-2.0 -Gdk_2_0_gir_CFLAGS = $(INCLUDES) +Gdk_2_0_gir_CFLAGS = \ + -DGDK_COMPILATION \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_builddir)/gdk \ + $(INCLUDES) INTROSPECTION_GIRS += Gdk-2.0.gir if USE_X11 @@ -250,7 +255,13 @@ GdkX11_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0 GdkX11_2_0_gir_LIBS = $(gdktargetlib) GdkX11_2_0_gir_FILES = $(x11_introspection_files) GdkX11_2_0_gir_EXPORT_PACKAGES = gdk-x11-2.0 -GdkX11_2_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk +GdkX11_2_0_gir_CFLAGS = \ + -DGDK_COMPILATION \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_builddir)/gdk \ + $(INCLUDES) \ + -L$(top_builddir)/gdk INTROSPECTION_GIRS += GdkX11-2.0.gir introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files)) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index f82ec4e34..5df302638 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1062,19 +1062,29 @@ introspection_files = \ gtktypebuiltins.h \ gtktypebuiltins.c -Gtk-2.0.gir: $(INTROSPECTION_SCANNER) $(gtktargetlib) $(top_builddir)/gdk/Gdk-2.0.gir Makefile -Gtk_2_0_gir_SCANNERFLAGS = --include-uninstalled=$(top_builddir)/gdk/Gdk-2.0.gir +Gtk_2_0_gir_SCANNERFLAGS = \ + --identifier-prefix=Gtk \ + --symbol-prefix=gtk \ + --include-uninstalled=$(top_builddir)/gdk/Gdk-2.0.gir if USE_X11 Gtk_2_0_gir_SCANNERFLAGS += --add-include-path=$(top_builddir)/gdk/x11 endif Gtk_2_0_gir_INCLUDES = Atk-1.0 Gtk_2_0_gir_CFLAGS = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/gdk \ + -I$(top_builddir)/gdk \ + -I$(top_srcdir)/gtk \ + -I$(top_builddir)/gtk \ + -DGTK_COMPILATION \ $(INCLUDES) \ - -UGDK_DISABLE_DEPRECATED \ - -UGTK_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ -DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API Gtk_2_0_gir_LIBS = $(gtktargetlib) -Gtk_2_0_gir_FILES = $(introspection_files) +Gtk_2_0_gir_FILES = \ + $(filter-out gtkprivate.h gtkpixdatautils.h gtktextlayout.h gtkmarshal.h, \ + $(introspection_files)) Gtk_2_0_gir_EXPORT_PACKAGES = gtk+-2.0 INTROSPECTION_GIRS += Gtk-2.0.gir diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index 19392851d..49d245441 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1059,7 +1059,6 @@ gtk_icon_size_register_alias (const gchar *alias, /** * gtk_icon_size_from_name: * @name: the name to look up. - * @returns: the icon size with the given name. * * Looks up the icon size associated with @name. * @@ -1083,7 +1082,6 @@ gtk_icon_size_from_name (const gchar *name) /** * gtk_icon_size_get_name: * @size: (type int): a #GtkIconSize. - * @returns: the name of the given icon size. * * Gets the canonical name of the given icon size. The returned string * is statically allocated and should not be freed. diff --git a/tests/testgtk.c b/tests/testgtk.c index c5ef54125..f95b587c2 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -4229,47 +4229,50 @@ dump_accels (gpointer callback_data, { gtk_accel_map_save_fd (1 /* stdout */); } - + +#define IF_CB(callback) ((GtkItemFactoryCallback) (callback)) + static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, NULL, 0, "" }, - { "/File/tearoff1", NULL, gtk_ifactory_cb, 0, "" }, - { "/File/_New", NULL, gtk_ifactory_cb, 0, "", GTK_STOCK_NEW }, - { "/File/_Open", NULL, gtk_ifactory_cb, 0, "", GTK_STOCK_OPEN }, - { "/File/_Save", NULL, gtk_ifactory_cb, 0, "", GTK_STOCK_SAVE }, - { "/File/Save _As...", "A", gtk_ifactory_cb, 0, "", GTK_STOCK_SAVE }, - { "/File/_Dump \"_Accels\"", NULL, dump_accels, 0 }, + { "/_File", NULL, NULL, 0, "" }, + { "/File/tearoff1", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/File/_New", NULL, IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_NEW }, + { "/File/_Open", NULL, IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_OPEN }, + { "/File/_Save", NULL, IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_SAVE }, + { "/File/Save _As...", "A", IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_SAVE }, + { "/File/_Dump \"_Accels\"", NULL, IF_CB (dump_accels), 0 }, { "/File/\\/Test__Escaping/And\\/\n\tWei\\\\rdly", - NULL, gtk_ifactory_cb, 0 }, - { "/File/sep1", NULL, gtk_ifactory_cb, 0, "" }, - { "/File/_Quit", NULL, gtk_ifactory_cb, 0, "", GTK_STOCK_QUIT }, + NULL, IF_CB (gtk_ifactory_cb), 0 }, + { "/File/sep1", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/File/_Quit", NULL, IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_QUIT }, - { "/_Preferences", NULL, 0, 0, "" }, - { "/_Preferences/_Color", NULL, 0, 0, "" }, - { "/_Preferences/Color/_Red", NULL, gtk_ifactory_cb, 0, "" }, - { "/_Preferences/Color/_Green", NULL, gtk_ifactory_cb, 0, "/Preferences/Color/Red" }, - { "/_Preferences/Color/_Blue", NULL, gtk_ifactory_cb, 0, "/Preferences/Color/Red" }, - { "/_Preferences/_Shape", NULL, 0, 0, "" }, - { "/_Preferences/Shape/_Square", NULL, gtk_ifactory_cb, 0, "" }, - { "/_Preferences/Shape/_Rectangle", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Square" }, - { "/_Preferences/Shape/_Oval", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Rectangle" }, - { "/_Preferences/Shape/_Rectangle", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Square" }, - { "/_Preferences/Shape/_Oval", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Rectangle" }, - { "/_Preferences/Shape/_Image", NULL, gtk_ifactory_cb, 0, "", apple }, - { "/_Preferences/Coffee", NULL, gtk_ifactory_cb, 0, "" }, - { "/_Preferences/Toast", NULL, gtk_ifactory_cb, 0, "" }, - { "/_Preferences/Marshmallow Froot Loops", NULL, gtk_ifactory_cb, 0, "" }, + { "/_Preferences", NULL, 0, 0, "" }, + { "/_Preferences/_Color", NULL, 0, 0, "" }, + { "/_Preferences/Color/_Red", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/_Preferences/Color/_Green", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Color/Red" }, + { "/_Preferences/Color/_Blue", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Color/Red" }, + { "/_Preferences/_Shape", NULL, 0, 0, "" }, + { "/_Preferences/Shape/_Square", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/_Preferences/Shape/_Rectangle", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Shape/Square" }, + { "/_Preferences/Shape/_Oval", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Shape/Rectangle" }, + { "/_Preferences/Shape/_Rectangle", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Shape/Square" }, + { "/_Preferences/Shape/_Oval", NULL, IF_CB (gtk_ifactory_cb), 0, "/Preferences/Shape/Rectangle" }, + { "/_Preferences/Shape/_Image", NULL, IF_CB (gtk_ifactory_cb), 0, "", apple }, + { "/_Preferences/Coffee", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/_Preferences/Toast", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, + { "/_Preferences/Marshmallow Froot Loops", NULL, IF_CB (gtk_ifactory_cb), 0, "" }, /* For testing deletion of menus */ - { "/_Preferences/Should_NotAppear", NULL, 0, 0, "" }, - { "/Preferences/ShouldNotAppear/SubItem1", NULL, gtk_ifactory_cb, 0 }, - { "/Preferences/ShouldNotAppear/SubItem2", NULL, gtk_ifactory_cb, 0 }, + { "/_Preferences/Should_NotAppear", NULL, 0, 0, "" }, + { "/Preferences/ShouldNotAppear/SubItem1", NULL, IF_CB (gtk_ifactory_cb), 0 }, + { "/Preferences/ShouldNotAppear/SubItem2", NULL, IF_CB (gtk_ifactory_cb), 0 }, - { "/_Help", NULL, 0, 0, "" }, - { "/Help/_Help", NULL, gtk_ifactory_cb, 0, "", GTK_STOCK_HELP}, - { "/Help/_About", NULL, gtk_ifactory_cb, 0 }, + { "/_Help", NULL, 0, 0, "" }, + { "/Help/_Help", NULL, IF_CB (gtk_ifactory_cb), 0, "", GTK_STOCK_HELP}, + { "/Help/_About", NULL, IF_CB (gtk_ifactory_cb), 0 }, }; +#undef IF_CB static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); diff --git a/tests/testsocket.c b/tests/testsocket.c index 6801e0976..8ef2bfb03 100644 --- a/tests/testsocket.c +++ b/tests/testsocket.c @@ -62,12 +62,16 @@ quit_cb (gpointer callback_data, gtk_widget_destroy (message_dialog); } +#define IF_CB(callback) ((GtkItemFactoryCallback) (callback)) + static GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "" }, - { "/File/_Quit", "Q", quit_cb, 0 }, + { "/File/_Quit", "Q", IF_CB (quit_cb), 0 }, }; +#undef IF_CB + static void socket_destroyed (GtkWidget *widget, Socket *socket) diff --git a/tests/testsocket_common.c b/tests/testsocket_common.c index 1a4fece2a..571047794 100644 --- a/tests/testsocket_common.c +++ b/tests/testsocket_common.c @@ -60,17 +60,21 @@ print_hello (GtkWidget *w, } } +#define IF_CB(callback) ((GtkItemFactoryCallback) (callback)) + static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, NULL, 0, "" }, - { "/File/_New", "N", print_hello, ACTION_FILE_NEW, "" }, - { "/File/_Open", "O", print_hello, ACTION_FILE_OPEN, "" }, - { "/File/sep1", NULL, NULL, 0, "" }, - { "/File/Quit", "Q", gtk_main_quit, 0, "" }, - { "/O_K", "K",print_hello, ACTION_OK, "" }, - { "/_Help", NULL, NULL, 0, "" }, - { "/_Help/About", NULL, print_hello, ACTION_HELP_ABOUT, "" }, + { "/_File", NULL, NULL, 0, "" }, + { "/File/_New", "N", IF_CB (print_hello), ACTION_FILE_NEW, "" }, + { "/File/_Open", "O", IF_CB (print_hello), ACTION_FILE_OPEN, "" }, + { "/File/sep1", NULL, NULL, 0, "" }, + { "/File/Quit", "Q", IF_CB (gtk_main_quit), 0, "" }, + { "/O_K", "K", IF_CB (print_hello), ACTION_OK, "" }, + { "/_Help", NULL, NULL, 0, "" }, + { "/_Help/About", NULL, IF_CB (print_hello), ACTION_HELP_ABOUT, "" }, }; +#undef IF_CB + static void remove_buttons (GtkWidget *widget, GtkWidget *other_button) { diff --git a/tests/testtext.c b/tests/testtext.c index 25a6279bd..b32541b1c 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -1946,71 +1946,75 @@ view_init_menus (View *view) gtk_menu_item_activate (GTK_MENU_ITEM (menu_item)); } +#define IF_CB(callback) ((GtkItemFactoryCallback) (callback)) + static GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "" }, - { "/File/_New", "N", do_new, 0, NULL }, - { "/File/New _View", NULL, do_new_view, 0, NULL }, - { "/File/_Open", "O", do_open, 0, NULL }, - { "/File/_Save", "S", do_save, 0, NULL }, - { "/File/Save _As...", NULL, do_save_as, 0, NULL }, + { "/File/_New", "N", IF_CB (do_new), 0, NULL }, + { "/File/New _View", NULL, IF_CB (do_new_view), 0, NULL }, + { "/File/_Open", "O", IF_CB (do_open), 0, NULL }, + { "/File/_Save", "S", IF_CB (do_save), 0, NULL }, + { "/File/Save _As...", NULL, IF_CB (do_save_as), 0, NULL }, { "/File/sep1", NULL, NULL, 0, "" }, - { "/File/_Close", "W" , do_close, 0, NULL }, - { "/File/E_xit", "Q" , do_exit, 0, NULL }, + { "/File/_Close", "W" , IF_CB (do_close), 0, NULL }, + { "/File/E_xit", "Q" , IF_CB (do_exit), 0, NULL }, { "/_Edit", NULL, 0, 0, "" }, - { "/Edit/Copy", NULL, do_copy, 0, NULL }, + { "/Edit/Copy", NULL, IF_CB (do_copy), 0, NULL }, { "/Edit/sep1", NULL, NULL, 0, "" }, - { "/Edit/Find...", NULL, do_search, 0, NULL }, - { "/Edit/Select All", "A", do_select_all, 0, NULL }, + { "/Edit/Find...", NULL, IF_CB (do_search), 0, NULL }, + { "/Edit/Select All", "A", IF_CB (do_select_all), 0, NULL }, { "/_Settings", NULL, NULL, 0, "" }, - { "/Settings/Wrap _Off", NULL, do_wrap_changed, GTK_WRAP_NONE, "" }, - { "/Settings/Wrap _Words", NULL, do_wrap_changed, GTK_WRAP_WORD, "/Settings/Wrap Off" }, - { "/Settings/Wrap _Chars", NULL, do_wrap_changed, GTK_WRAP_CHAR, "/Settings/Wrap Off" }, + { "/Settings/Wrap _Off", NULL, IF_CB (do_wrap_changed), GTK_WRAP_NONE, "" }, + { "/Settings/Wrap _Words", NULL, IF_CB (do_wrap_changed), GTK_WRAP_WORD, "/Settings/Wrap Off" }, + { "/Settings/Wrap _Chars", NULL, IF_CB (do_wrap_changed), GTK_WRAP_CHAR, "/Settings/Wrap Off" }, { "/Settings/sep1", NULL, NULL, 0, "" }, - { "/Settings/Editable", NULL, do_editable_changed, TRUE, "" }, - { "/Settings/Not editable", NULL, do_editable_changed, FALSE, "/Settings/Editable" }, + { "/Settings/Editable", NULL, IF_CB (do_editable_changed), TRUE, "" }, + { "/Settings/Not editable", NULL, IF_CB (do_editable_changed), FALSE, "/Settings/Editable" }, { "/Settings/sep1", NULL, NULL, 0, "" }, - { "/Settings/Cursor normal", NULL, do_cursor_visible_changed, 1, "" }, - { "/Settings/Cursor not visible", NULL, do_cursor_visible_changed, 0, "/Settings/Cursor normal" }, - { "/Settings/Cursor colored", NULL, do_cursor_visible_changed, 2, "/Settings/Cursor normal" }, + { "/Settings/Cursor normal", NULL, IF_CB (do_cursor_visible_changed), 1, "" }, + { "/Settings/Cursor not visible", NULL, IF_CB (do_cursor_visible_changed), 0, "/Settings/Cursor normal" }, + { "/Settings/Cursor colored", NULL, IF_CB (do_cursor_visible_changed), 2, "/Settings/Cursor normal" }, { "/Settings/sep1", NULL, NULL, 0, "" }, - { "/Settings/Left-to-Right", NULL, do_direction_changed, GTK_TEXT_DIR_LTR, "" }, - { "/Settings/Right-to-Left", NULL, do_direction_changed, GTK_TEXT_DIR_RTL, "/Settings/Left-to-Right" }, + { "/Settings/Left-to-Right", NULL, IF_CB (do_direction_changed), GTK_TEXT_DIR_LTR, "" }, + { "/Settings/Right-to-Left", NULL, IF_CB (do_direction_changed), GTK_TEXT_DIR_RTL, "/Settings/Left-to-Right" }, { "/Settings/sep1", NULL, NULL, 0, "" }, - { "/Settings/Sane spacing", NULL, do_spacing_changed, FALSE, "" }, - { "/Settings/Funky spacing", NULL, do_spacing_changed, TRUE, "/Settings/Sane spacing" }, + { "/Settings/Sane spacing", NULL, IF_CB (do_spacing_changed), FALSE, "" }, + { "/Settings/Funky spacing", NULL, IF_CB (do_spacing_changed), TRUE, "/Settings/Sane spacing" }, { "/Settings/sep1", NULL, NULL, 0, "" }, - { "/Settings/Don't cycle color tags", NULL, do_color_cycle_changed, FALSE, "" }, - { "/Settings/Cycle colors", NULL, do_color_cycle_changed, TRUE, "/Settings/Don't cycle color tags" }, + { "/Settings/Don't cycle color tags", NULL, IF_CB (do_color_cycle_changed), FALSE, "" }, + { "/Settings/Cycle colors", NULL, IF_CB (do_color_cycle_changed), TRUE, "/Settings/Don't cycle color tags" }, { "/_Attributes", NULL, NULL, 0, "" }, - { "/Attributes/Editable", NULL, do_apply_editable, TRUE, NULL }, - { "/Attributes/Not editable", NULL, do_apply_editable, FALSE, NULL }, - { "/Attributes/Invisible", NULL, do_apply_invisible, FALSE, NULL }, - { "/Attributes/Visible", NULL, do_apply_invisible, TRUE, NULL }, - { "/Attributes/Rise", NULL, do_apply_rise, FALSE, NULL }, - { "/Attributes/Large", NULL, do_apply_large, FALSE, NULL }, - { "/Attributes/Indent", NULL, do_apply_indent, FALSE, NULL }, - { "/Attributes/Margins", NULL, do_apply_margin, FALSE, NULL }, - { "/Attributes/Custom tabs", NULL, do_apply_tabs, FALSE, NULL }, - { "/Attributes/Default tabs", NULL, do_apply_tabs, TRUE, NULL }, - { "/Attributes/Color cycles", NULL, do_apply_colors, TRUE, NULL }, - { "/Attributes/No colors", NULL, do_apply_colors, FALSE, NULL }, - { "/Attributes/Remove all tags", NULL, do_remove_tags, 0, NULL }, - { "/Attributes/Properties", NULL, do_properties, 0, NULL }, - { "/Attributes/Rich Text copy & drag", NULL, do_rich_text, 0, NULL }, - { "/Attributes/Rich Text paste & drop", NULL, do_rich_text, 1, NULL }, + { "/Attributes/Editable", NULL, IF_CB (do_apply_editable), TRUE, NULL }, + { "/Attributes/Not editable", NULL, IF_CB (do_apply_editable), FALSE, NULL }, + { "/Attributes/Invisible", NULL, IF_CB (do_apply_invisible), FALSE, NULL }, + { "/Attributes/Visible", NULL, IF_CB (do_apply_invisible), TRUE, NULL }, + { "/Attributes/Rise", NULL, IF_CB (do_apply_rise), FALSE, NULL }, + { "/Attributes/Large", NULL, IF_CB (do_apply_large), FALSE, NULL }, + { "/Attributes/Indent", NULL, IF_CB (do_apply_indent), FALSE, NULL }, + { "/Attributes/Margins", NULL, IF_CB (do_apply_margin), FALSE, NULL }, + { "/Attributes/Custom tabs", NULL, IF_CB (do_apply_tabs), FALSE, NULL }, + { "/Attributes/Default tabs", NULL, IF_CB (do_apply_tabs), TRUE, NULL }, + { "/Attributes/Color cycles", NULL, IF_CB (do_apply_colors), TRUE, NULL }, + { "/Attributes/No colors", NULL, IF_CB (do_apply_colors), FALSE, NULL }, + { "/Attributes/Remove all tags", NULL, IF_CB (do_remove_tags), 0, NULL }, + { "/Attributes/Properties", NULL, IF_CB (do_properties), 0, NULL }, + { "/Attributes/Rich Text copy & drag", NULL, IF_CB (do_rich_text), 0, NULL }, + { "/Attributes/Rich Text paste & drop", NULL, IF_CB (do_rich_text), 1, NULL }, { "/_Test", NULL, NULL, 0, "" }, - { "/Test/_Example", NULL, do_example, 0, NULL }, - { "/Test/_Insert and scroll", NULL, do_insert_and_scroll, 0, NULL }, - { "/Test/_Add fixed children", NULL, do_add_children, 0, NULL }, - { "/Test/A_dd focusable children", NULL, do_add_focus_children, 0, NULL }, + { "/Test/_Example", NULL, IF_CB (do_example), 0, NULL }, + { "/Test/_Insert and scroll", NULL, IF_CB (do_insert_and_scroll), 0, NULL }, + { "/Test/_Add fixed children", NULL, IF_CB (do_add_children), 0, NULL }, + { "/Test/A_dd focusable children", NULL, IF_CB (do_add_focus_children), 0, NULL }, }; +#undef IF_CB + static gboolean save_buffer (Buffer *buffer) {