diff options
152 files changed, 210 insertions, 177 deletions
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index a3bc6568fa..d61eb394c8 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -302,7 +302,7 @@ int main (int argc, char **argv) { /* If there's no DISPLAY, we silently error out. We don't want to break * headless builds. */ - if (! gtk_init_check (&argc, &argv)) + if (! gtk_init_check ()) return 0; toplevels = get_all_widgets (); diff --git a/examples/builder.c b/examples/builder.c index a05646fdbe..d732068383 100644 --- a/examples/builder.c +++ b/examples/builder.c @@ -15,7 +15,7 @@ main (int argc, GObject *window; GObject *button; - gtk_init (&argc, &argv); + gtk_init (); /* Construct a GtkBuilder instance and load our UI description */ builder = gtk_builder_new (); diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c index 0a22d00213..d75d766031 100644 --- a/gtk/gtk-builder-tool.c +++ b/gtk/gtk-builder-tool.c @@ -1071,7 +1071,7 @@ main (int argc, const char *argv[]) { g_set_prgname ("gtk-builder-tool"); - gtk_init (NULL, NULL); + gtk_init (); gtk_test_register_all_types (); diff --git a/gtk/gtk-launch.c b/gtk/gtk-launch.c index bf84ad614a..76a95e46c5 100644 --- a/gtk/gtk-launch.c +++ b/gtk/gtk-launch.c @@ -114,7 +114,7 @@ main (int argc, char *argv[]) } - gtk_init (&argc, &argv); + gtk_init (); app_name = *args; #ifdef G_OS_UNIX diff --git a/gtk/gtk-query-settings.c b/gtk/gtk-query-settings.c index 29ae214dc5..6a025f5899 100644 --- a/gtk/gtk-query-settings.c +++ b/gtk/gtk-query-settings.c @@ -30,7 +30,7 @@ main (int argc, char **argv) int max_prop_name_length = 0; gchar *pattern = NULL; - gtk_init (&argc, &argv); + gtk_init (); if (argc > 1) pattern = argv[1]; diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c index a1b2271cab..ff70808584 100644 --- a/gtk/gtkapplication.c +++ b/gtk/gtkapplication.c @@ -290,7 +290,7 @@ gtk_application_startup (GApplication *g_application) gtk_action_muxer_insert (application->priv->muxer, "app", G_ACTION_GROUP (application)); - gtk_init (NULL, NULL); + gtk_init (); application->priv->impl = gtk_application_impl_new (application, gdk_display_get_default ()); gtk_application_impl_startup (application->priv->impl, application->priv->register_session); diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index c85fa25782..30f5d9073e 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -96,7 +96,7 @@ gtk_test_init (int *argcp, */ gdk_disable_multidevice (); - gtk_init (argcp, argvp); + gtk_init (); } static gboolean diff --git a/tests/animated-resizing.c b/tests/animated-resizing.c index f0f5269682..5f686cef59 100644 --- a/tests/animated-resizing.c +++ b/tests/animated-resizing.c @@ -173,8 +173,6 @@ main(int argc, char **argv) GOptionContext *context = g_option_context_new (NULL); g_option_context_add_main_entries (context, options, NULL); frame_stats_add_options (g_option_context_get_main_group (context)); - g_option_context_add_group (context, - gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { @@ -182,6 +180,8 @@ main(int argc, char **argv) return 1; } + gtk_init (); + g_print ("# Load factor: %g\n", load_factor); g_print ("# Resizing?: %s\n", diff --git a/tests/animated-revealing.c b/tests/animated-revealing.c index 11b3f99bce..febfc00262 100644 --- a/tests/animated-revealing.c +++ b/tests/animated-revealing.c @@ -28,8 +28,6 @@ main(int argc, char **argv) GOptionContext *context = g_option_context_new (NULL); g_option_context_add_main_entries (context, options, NULL); frame_stats_add_options (g_option_context_get_main_group (context)); - g_option_context_add_group (context, - gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { @@ -37,6 +35,8 @@ main(int argc, char **argv) return 1; } + gtk_init (); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", gtk_main_quit, NULL); frame_stats_ensure (GTK_WINDOW (window)); diff --git a/tests/flicker.c b/tests/flicker.c index 4743eb8ea5..85890f938e 100644 --- a/tests/flicker.c +++ b/tests/flicker.c @@ -203,7 +203,7 @@ main (int argc, char *argv[]) { GtkWidget *window1; - gtk_init (&argc, &argv); + gtk_init (); window1 = create_flicker (); gtk_widget_show (window1); diff --git a/tests/gdkgears.c b/tests/gdkgears.c index 584c3fa16c..19f8068f42 100644 --- a/tests/gdkgears.c +++ b/tests/gdkgears.c @@ -112,7 +112,7 @@ main (int argc, char *argv[]) *revealer, *frame, *label, *scrolled, *popover; int i; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_titlebar (GTK_WINDOW (window), g_object_new (GTK_TYPE_HEADER_BAR, "visible", TRUE, "title", "GdkGears", NULL)); diff --git a/tests/listmodel.c b/tests/listmodel.c index 625a099270..1d98bc7fba 100644 --- a/tests/listmodel.c +++ b/tests/listmodel.c @@ -171,7 +171,7 @@ main (int argc, char *argv[]) GListStore *store; gint i; - gtk_init (NULL, NULL); + gtk_init (); store = g_list_store_new (my_object_get_type ()); for (i = 0; i < 100; i++) diff --git a/tests/motion-compression.c b/tests/motion-compression.c index e69956a25e..a49147ce60 100644 --- a/tests/motion-compression.c +++ b/tests/motion-compression.c @@ -43,7 +43,7 @@ main (int argc, char **argv) GtkWidget *scale; GtkWidget *da; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 300, 300); diff --git a/tests/overlayscroll.c b/tests/overlayscroll.c index 4c3c641fac..e1ec8b8272 100644 --- a/tests/overlayscroll.c +++ b/tests/overlayscroll.c @@ -51,7 +51,7 @@ main (int argc, char *argv[]) GtkWidget *combo; GtkAdjustment *adj; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 480); diff --git a/tests/print-editor.c b/tests/print-editor.c index 27ebb674c5..cf79140f6b 100644 --- a/tests/print-editor.c +++ b/tests/print-editor.c @@ -781,7 +781,7 @@ main (int argc, char **argv) GtkApplication *app; GError *error = NULL; - gtk_init (NULL, NULL); + gtk_init (); settings = gtk_print_settings_new_from_file ("print-settings.ini", &error); if (error) { diff --git a/tests/rendernode-create-tests.c b/tests/rendernode-create-tests.c index 93d894396b..b55e76816e 100644 --- a/tests/rendernode-create-tests.c +++ b/tests/rendernode-create-tests.c @@ -362,7 +362,7 @@ main (int argc, char **argv) char *pattern; guint i, n; - gtk_init (&argc, &argv); + gtk_init (); n = 100000; pattern = "*"; diff --git a/tests/rendernode.c b/tests/rendernode.c index 292be48fad..f35f74c7bd 100644 --- a/tests/rendernode.c +++ b/tests/rendernode.c @@ -24,14 +24,18 @@ main(int argc, char **argv) char *contents; gsize len; int run; + GOptionContext *context; - if (!gtk_init_with_args (&argc, &argv, "NODE-FILE PNG-FILE", - options, NULL, &error)) + context = g_option_context_new ("NODE-FILE PNG-FILE"); + g_option_context_add_main_entries (context, options, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) { g_printerr ("Option parsing failed: %s\n", error->message); return 1; } + gtk_init (); + if (runs < 1) { g_printerr ("Number of runs given with -r/--runs must be at least 1 and not %d.\n", runs); diff --git a/tests/scrolling-performance.c b/tests/scrolling-performance.c index 90be21b553..99b0fa47d9 100644 --- a/tests/scrolling-performance.c +++ b/tests/scrolling-performance.c @@ -105,8 +105,6 @@ main (int argc, char **argv) GOptionContext *context = g_option_context_new (NULL); g_option_context_add_main_entries (context, options, NULL); frame_stats_add_options (g_option_context_get_main_group (context)); - g_option_context_add_group (context, - gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { @@ -114,6 +112,8 @@ main (int argc, char **argv) return 1; } + gtk_init (); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); frame_stats_ensure (GTK_WINDOW (window)); gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); diff --git a/tests/simple.c b/tests/simple.c index 30ebd1499a..b23350e178 100644 --- a/tests/simple.c +++ b/tests/simple.c @@ -30,7 +30,7 @@ main (int argc, char *argv[]) { GtkWidget *window; - gtk_init (&argc, &argv); + gtk_init (); window = g_object_connect (g_object_new (gtk_window_get_type (), "type", GTK_WINDOW_TOPLEVEL, diff --git a/tests/stresstest-toolbar.c b/tests/stresstest-toolbar.c index ba10d73b5e..bab169f76b 100644 --- a/tests/stresstest-toolbar.c +++ b/tests/stresstest-toolbar.c @@ -135,7 +135,7 @@ main (gint argc, gchar **argv) { Info info; - gtk_init (&argc, &argv); + gtk_init (); info.toolbar = NULL; info.counter = 0; diff --git a/tests/syncscroll.c b/tests/syncscroll.c index 2824a89a6f..7797194edf 100644 --- a/tests/syncscroll.c +++ b/tests/syncscroll.c @@ -20,7 +20,7 @@ main (int argc, char *argv[]) GtkWidget *win, *box, *tv, *sw, *sb; GtkAdjustment *adj; - gtk_init (NULL, NULL); + gtk_init (); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (win), 640, 480); diff --git a/tests/testaccel.c b/tests/testaccel.c index f3b64d13ab..4f5c1fc4b4 100644 --- a/tests/testaccel.c +++ b/tests/testaccel.c @@ -121,7 +121,7 @@ main (gint argc, gchar **argv) { GtkWidget *dialog; - gtk_init (&argc, &argv); + gtk_init (); dialog = key_test (); diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c index f7f977267b..ac4fddbe6e 100644 --- a/tests/testadjustsize.c +++ b/tests/testadjustsize.c @@ -365,7 +365,7 @@ main (int argc, char *argv[]) { GtkCssProvider *provider; - gtk_init (&argc, &argv); + gtk_init (); provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, diff --git a/tests/testanimation.c b/tests/testanimation.c index 2dd60f910d..8c039516ae 100644 --- a/tests/testanimation.c +++ b/tests/testanimation.c @@ -410,7 +410,7 @@ main (int argc, { gint i; - gtk_init (&argc, &argv); + gtk_init (); i = 1; while (i < argc) diff --git a/tests/testappchooser.c b/tests/testappchooser.c index 25666dfe8d..f4c3ff0548 100644 --- a/tests/testappchooser.c +++ b/tests/testappchooser.c @@ -157,7 +157,7 @@ main (int argc, char **argv) GtkWidget *w1; gchar *path; - gtk_init (&argc, &argv); + gtk_init (); toplevel = gtk_window_new (GTK_WINDOW_TOPLEVEL); grid = gtk_grid_new (); diff --git a/tests/testappchooserbutton.c b/tests/testappchooserbutton.c index bf37cd57c4..6ff01d11f8 100644 --- a/tests/testappchooserbutton.c +++ b/tests/testappchooserbutton.c @@ -68,7 +68,7 @@ main (int argc, { GtkWidget *w; - gtk_init (&argc, &argv); + gtk_init (); toplevel = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testassistant.c b/tests/testassistant.c index 2e188bae38..fd4074bf67 100644 --- a/tests/testassistant.c +++ b/tests/testassistant.c @@ -703,7 +703,7 @@ main (int argc, gchar *argv[]) GtkWidget *window, *box, *button; gint i; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 30f4a1924a..d402665b7c 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -76,7 +76,7 @@ main (int argc, int i, j; GtkCssProvider *provider; - gtk_init (&argc, &argv); + gtk_init (); provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, diff --git a/tests/testbbox.c b/tests/testbbox.c index 502914f1da..d137eb774c 100644 --- a/tests/testbbox.c +++ b/tests/testbbox.c @@ -118,7 +118,7 @@ main (int argc, GtkWidget *vbox, *hbox, *combo_styles, *combo_types, *option; int i; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (G_OBJECT (window), "delete-event", G_CALLBACK (gtk_main_quit), NULL); diff --git a/tests/testbox.c b/tests/testbox.c index 6885f41b2e..1215d9c793 100644 --- a/tests/testbox.c +++ b/tests/testbox.c @@ -132,7 +132,7 @@ main (int argc, char *argv[]) GtkWidget *label; GtkWidget *spin; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testboxcss.c b/tests/testboxcss.c index 517e530d1c..451dbf2f9f 100644 --- a/tests/testboxcss.c +++ b/tests/testboxcss.c @@ -146,7 +146,7 @@ main (gint argc, gchar **argv) GtkStyleProvider *provider; GtkTextBuffer *css; - gtk_init (&argc, &argv); + gtk_init (); css = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (css, diff --git a/tests/testbuttons.c b/tests/testbuttons.c index 7217311b00..6c58cb3b70 100644 --- a/tests/testbuttons.c +++ b/tests/testbuttons.c @@ -27,7 +27,7 @@ int main (int argc, char *argv[]) gboolean use_underline; GtkWidget *label; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testcairo.c b/tests/testcairo.c index e2e22d874d..e482bb33e9 100644 --- a/tests/testcairo.c +++ b/tests/testcairo.c @@ -189,7 +189,7 @@ main (int argc, char **argv) { GtkWidget *window, *darea; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testcalendar.c b/tests/testcalendar.c index aec6406d32..4162a769d2 100644 --- a/tests/testcalendar.c +++ b/tests/testcalendar.c @@ -701,7 +701,7 @@ create_calendar(void) int main(int argc, char *argv[] ) { - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("GTK_RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testcellarea.c b/tests/testcellarea.c index 7de3625435..eae9f02c3f 100644 --- a/tests/testcellarea.c +++ b/tests/testcellarea.c @@ -614,7 +614,7 @@ background_area (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testcellrenderertext.c b/tests/testcellrenderertext.c index c9648a5255..1c82eb8e15 100644 --- a/tests/testcellrenderertext.c +++ b/tests/testcellrenderertext.c @@ -254,7 +254,7 @@ main (int argc, char **argv) GtkWidget *label; GtkWidget *tree; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", diff --git a/tests/testclipboard.c b/tests/testclipboard.c index 010ee354f3..2ab4441ac2 100644 --- a/tests/testclipboard.c +++ b/tests/testclipboard.c @@ -109,7 +109,7 @@ main (int argc, char **argv) { GtkWidget *window; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_dialog_new_with_buttons ("Clipboard", NULL, diff --git a/tests/testcolorchooser.c b/tests/testcolorchooser.c index 4fb6354055..9457632a88 100644 --- a/tests/testcolorchooser.c +++ b/tests/testcolorchooser.c @@ -36,7 +36,7 @@ main (int argc, char *argv[]) GtkWidget *dialog; gint i; - gtk_init (NULL, NULL); + gtk_init (); dialog = gtk_color_chooser_dialog_new ("Select a color", NULL); diff --git a/tests/testcolorchooser2.c b/tests/testcolorchooser2.c index c90962f55b..a0c4f113ba 100644 --- a/tests/testcolorchooser2.c +++ b/tests/testcolorchooser2.c @@ -41,7 +41,7 @@ int main (int argc, char *argv[]) GtkWidget *entry; GtkBuilder *builder; - gtk_init (NULL, NULL); + gtk_init (); builder = gtk_builder_new_from_file ("testcolorchooser2.ui"); window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); diff --git a/tests/testcombo.c b/tests/testcombo.c index 2f33493768..9ea0ea6361 100644 --- a/tests/testcombo.c +++ b/tests/testcombo.c @@ -1058,7 +1058,7 @@ main (int argc, char **argv) gchar *text; gint i; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testcombochange.c b/tests/testcombochange.c index b74477baa3..4c8a8fa34f 100644 --- a/tests/testcombochange.c +++ b/tests/testcombochange.c @@ -234,7 +234,7 @@ main (int argc, char **argv) test_init (); - gtk_init (&argc, &argv); + gtk_init (); model = gtk_list_store_new (1, G_TYPE_STRING); contents = g_array_new (FALSE, FALSE, sizeof (char)); diff --git a/tests/testdialog.c b/tests/testdialog.c index 0b90b69387..941acfdba1 100644 --- a/tests/testdialog.c +++ b/tests/testdialog.c @@ -316,7 +316,7 @@ main (int argc, char *argv[]) GtkWidget *box; GtkWidget *button; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); diff --git a/tests/testdnd.c b/tests/testdnd.c index 2011578f6d..083d0e2dba 100644 --- a/tests/testdnd.c +++ b/tests/testdnd.c @@ -590,7 +590,7 @@ main (int argc, char **argv) test_init (); - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", diff --git a/tests/testdnd2.c b/tests/testdnd2.c index 2cccf04f9a..029c24d9f9 100644 --- a/tests/testdnd2.c +++ b/tests/testdnd2.c @@ -355,7 +355,7 @@ main (int argc, char *Argv[]) GtkWidget *grid; GtkWidget *entry; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Drag And Drop"); diff --git a/tests/testellipsise.c b/tests/testellipsise.c index 52ea06f5d9..7749c8675b 100644 --- a/tests/testellipsise.c +++ b/tests/testellipsise.c @@ -127,7 +127,7 @@ main (int argc, char *argv[]) GtkWidget *window, *vbox, *label; GtkWidget *combo, *scale, *overlay, *da; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); diff --git a/tests/testemblems.c b/tests/testemblems.c index 3d8ee8091f..171d2a7f3a 100644 --- a/tests/testemblems.c +++ b/tests/testemblems.c @@ -8,7 +8,7 @@ int main (int argc, char **argv) GIcon *icon; GIcon *icon2; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testentrycompletion.c b/tests/testentrycompletion.c index 4bb0124e7c..6bb4468da8 100644 --- a/tests/testentrycompletion.c +++ b/tests/testentrycompletion.c @@ -296,7 +296,7 @@ main (int argc, char *argv[]) GtkTreeModel *completion_model; GtkCellRenderer *cell; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "delete_event", gtk_main_quit, NULL); diff --git a/tests/testentryicons.c b/tests/testentryicons.c index 1025c0a806..d5b20d5b12 100644 --- a/tests/testentryicons.c +++ b/tests/testentryicons.c @@ -108,7 +108,7 @@ main (int argc, char **argv) GIcon *icon; GtkTargetList *tlist; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Gtk Entry Icons Test"); diff --git a/tests/testerrors.c b/tests/testerrors.c index 24dd5d3309..42cf8ff709 100644 --- a/tests/testerrors.c +++ b/tests/testerrors.c @@ -133,7 +133,7 @@ main (gint argc, gchar *argv[]) { GdkDisplay *extra_display; - gtk_init (&argc, &argv); + gtk_init (); test_error_trapping (gdk_display_get_default ()); diff --git a/tests/testexpand.c b/tests/testexpand.c index 028b64c216..750020bde1 100644 --- a/tests/testexpand.c +++ b/tests/testexpand.c @@ -156,7 +156,7 @@ create_grid_window (void) int main (int argc, char *argv[]) { - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testexpander.c b/tests/testexpander.c index 61329dca6c..286e479009 100644 --- a/tests/testexpander.c +++ b/tests/testexpander.c @@ -30,7 +30,7 @@ main (int argc, char *argv[]) GtkWidget *tv; GtkTextBuffer *buffer; - gtk_init (&argc, &argv); + gtk_init (); dialog = gtk_message_dialog_new_with_markup (NULL, 0, diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 6d31224226..5cb628a1e2 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -540,13 +540,19 @@ main (int argc, char **argv) { "initial-folder", 'F', 0, G_OPTION_ARG_FILENAME, &initial_folder, "Initial folder to show", "FILENAME" }, { NULL } }; + GOptionContext *context; - if (!gtk_init_with_args (&argc, &argv, "", options, NULL, &error)) + context = g_option_context_new (""); + g_option_context_add_main_entries (context, options, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("Failed to parse args: %s\n", error->message); g_error_free (error); return 1; } + g_option_context_free (context); + + gtk_init (); if (initial_filename && initial_folder) { diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c index 96deb114f3..74bc80a030 100644 --- a/tests/testfilechooserbutton.c +++ b/tests/testfilechooserbutton.c @@ -230,11 +230,10 @@ main (int argc, context = g_option_context_new ("- test GtkFileChooserButton widget"); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_parse (context, &argc, &argv, NULL); g_option_context_free (context); - gtk_init (&argc, &argv); + gtk_init (); /* to test rtl layout, use "--right-to-left" */ if (rtl) diff --git a/tests/testflowbox.c b/tests/testflowbox.c index 779ee4df4e..156a933d00 100644 --- a/tests/testflowbox.c +++ b/tests/testflowbox.c @@ -666,7 +666,7 @@ main (int argc, char *argv[]) { GtkWidget *window; - gtk_init (&argc, &argv); + gtk_init (); window = create_window (); diff --git a/tests/testfontchooser.c b/tests/testfontchooser.c index 7ecab02d17..13d19b3b33 100644 --- a/tests/testfontchooser.c +++ b/tests/testfontchooser.c @@ -61,7 +61,7 @@ main (int argc, char *argv[]) GtkWidget *box; GtkWidget *fontchooser; - gtk_init (NULL, NULL); + gtk_init (); fontchooser = gtk_font_chooser_widget_new (); diff --git a/tests/testfontchooserdialog.c b/tests/testfontchooserdialog.c index 2e2da14a37..43ecaf067d 100644 --- a/tests/testfontchooserdialog.c +++ b/tests/testfontchooserdialog.c @@ -70,7 +70,7 @@ main (int argc, char *argv[]) GtkWidget *window; GtkWidget *font_button; - gtk_init (&argc, &argv); + gtk_init (); font_button = gtk_font_button_new (); diff --git a/tests/testfontoptions.c b/tests/testfontoptions.c index 7db27bcf7a..5e29ebc046 100644 --- a/tests/testfontoptions.c +++ b/tests/testfontoptions.c @@ -32,7 +32,7 @@ main (int argc, char *argv[]) { GtkWidget *window, *label, *grid, *demo; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); grid = gtk_grid_new (); diff --git a/tests/testframe.c b/tests/testframe.c index ea241b4c3b..8d6ea09086 100644 --- a/tests/testframe.c +++ b/tests/testframe.c @@ -136,7 +136,7 @@ int main (int argc, char **argv) GtkWidget *xalign_spin, *yalign_spin, *button, *grid, *label; gfloat xalign, yalign; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 300, 300); diff --git a/tests/testfullscreen.c b/tests/testfullscreen.c index 29e853a579..9059f3b077 100644 --- a/tests/testfullscreen.c +++ b/tests/testfullscreen.c @@ -44,7 +44,7 @@ main (int argc, char *argv[]) { GtkWidget *window, *vbox, *button; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testgaction.c b/tests/testgaction.c index c9ae96ed5d..c45e3c45e3 100644 --- a/tests/testgaction.c +++ b/tests/testgaction.c @@ -97,7 +97,7 @@ static const char *menu_data = int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); GtkWidget *menubutton = gtk_menu_button_new (); diff --git a/tests/testgiconpixbuf.c b/tests/testgiconpixbuf.c index ab52c97818..5c406aac66 100644 --- a/tests/testgiconpixbuf.c +++ b/tests/testgiconpixbuf.c @@ -28,7 +28,7 @@ main (int argc, GEmblem *emblem; gchar *str; - gtk_init (&argc, &argv); + gtk_init (); pixbuf = gdk_pixbuf_new_from_file ("apple-red.png", NULL); toplevel = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testglarea.c b/tests/testglarea.c index 187637d952..08ed63ce73 100644 --- a/tests/testglarea.c +++ b/tests/testglarea.c @@ -397,7 +397,7 @@ main (int argc, char *argv[]) GtkWidget *window, *box, *button, *controls; int i; - gtk_init (&argc, &argv); + gtk_init (); /* create a new pixel format; we use this to configure the * GL context, and to check for features diff --git a/tests/testglblending.c b/tests/testglblending.c index bb3b186bdd..d220ff8f03 100644 --- a/tests/testglblending.c +++ b/tests/testglblending.c @@ -8,7 +8,7 @@ main (int argc, char *argv[]) { GtkWidget *window, *fixed, *gears, *spinner; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Test GL/gtk inter-blending"); diff --git a/tests/testgmenu.c b/tests/testgmenu.c index c92b1439bc..a0943c9ceb 100644 --- a/tests/testgmenu.c +++ b/tests/testgmenu.c @@ -625,8 +625,12 @@ main (int argc, char *argv[]) { "import", 0, 0, G_OPTION_ARG_NONE, &do_import, "Use exported actions and menus", NULL }, { NULL, } }; + GOptionContext *context; - gtk_init_with_args (&argc, &argv, NULL, entries, NULL, NULL); + context = g_option_context_new (""); + g_option_context_add_main_entries (context, entries, NULL); + g_option_context_parse (context, &argc, &argv, NULL); + gtk_init (); if (do_export && do_import) { diff --git a/tests/testgrid.c b/tests/testgrid.c index 37e2d79e78..eb0af50a78 100644 --- a/tests/testgrid.c +++ b/tests/testgrid.c @@ -453,7 +453,7 @@ spanning_grid (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testgrouping.c b/tests/testgrouping.c index 4b412d01ef..01f4a83f08 100644 --- a/tests/testgrouping.c +++ b/tests/testgrouping.c @@ -105,7 +105,7 @@ main (int argc, char **argv) GtkCellRenderer *renderer; GtkTreeViewColumn *column; - gtk_init (&argc, &argv); + gtk_init (); model = create_model (); diff --git a/tests/testgtk.c b/tests/testgtk.c index abefd0c8d4..7e08e27dcb 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -8894,7 +8894,7 @@ main (int argc, char *argv[]) g_set_application_name ("GTK+ Test Program"); - gtk_init (&argc, &argv); + gtk_init (); provider = gtk_css_provider_new (); diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index c766e4ce49..57ed406503 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -133,7 +133,7 @@ main (int argc, char *argv[]) GtkWidget *content; GtkCssProvider *provider; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_style_context_add_class (gtk_widget_get_style_context (window), "main"); diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c index 444a201370..b1108388e4 100644 --- a/tests/testheightforwidth.c +++ b/tests/testheightforwidth.c @@ -967,7 +967,7 @@ main (int argc, char *argv[]) { GtkWidget *window; - gtk_init (&argc, &argv); + gtk_init (); window = create_window (); diff --git a/tests/testicontheme.c b/tests/testicontheme.c index e7f10dff24..f34e93a9fd 100644 --- a/tests/testicontheme.c +++ b/tests/testicontheme.c @@ -69,7 +69,7 @@ main (int argc, char *argv[]) int scale = 1; GtkIconLookupFlags flags; - gtk_init (&argc, &argv); + gtk_init (); if (argc < 3) { diff --git a/tests/testiconview-keynav.c b/tests/testiconview-keynav.c index 98f662a285..5ab125361d 100644 --- a/tests/testiconview-keynav.c +++ b/tests/testiconview-keynav.c @@ -235,7 +235,7 @@ main (int argc, char *argv[]) GtkWidget *vbox; Views views; - gtk_init (&argc, &argv); + gtk_init (); set_styles (); diff --git a/tests/testiconview.c b/tests/testiconview.c index 9cb5498fc4..72f8fab5d1 100644 --- a/tests/testiconview.c +++ b/tests/testiconview.c @@ -420,7 +420,7 @@ main (gint argc, gchar **argv) GtkCellRenderer *cell; GtkTreeViewColumn *tvc; - gtk_init (&argc, &argv); + gtk_init (); /* to test rtl layout, set RTL=1 in the environment */ if (g_getenv ("RTL")) diff --git a/tests/testimage.c b/tests/testimage.c index 522b282378..7f61f7588b 100644 --- a/tests/testimage.c +++ b/tests/testimage.c @@ -87,7 +87,7 @@ main (int argc, char **argv) GIcon *icon; GFile *file; - gtk_init (&argc, &argv); + gtk_init (); if (argc > 1) icon_name = argv[1]; diff --git a/tests/testinput.c b/tests/testinput.c index 9c91bf51fa..38899ca4ed 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -238,7 +238,7 @@ main (int argc, char *argv[]) GdkWindow *gdk_win; GdkSeat *seat; - gtk_init (&argc, &argv); + gtk_init (); seat = gdk_display_get_default_seat (gdk_display_get_default ()); diff --git a/tests/testkineticscrolling.c b/tests/testkineticscrolling.c index 94bd6b85c0..fe412d0fa7 100644 --- a/tests/testkineticscrolling.c +++ b/tests/testkineticscrolling.c @@ -137,7 +137,7 @@ kinetic_scrolling (void) int main (int argc, char **argv) { - gtk_init (NULL, NULL); + gtk_init (); kinetic_scrolling (); diff --git a/tests/testlevelbar.c b/tests/testlevelbar.c index ccf4141cbd..23385f86ae 100644 --- a/tests/testlevelbar.c +++ b/tests/testlevelbar.c @@ -82,7 +82,7 @@ main (int argc, char *argv[]) GtkWidget *box2; GtkWidget *sw; - gtk_init (&argc, &argv); + gtk_init (); add_custom_css (); diff --git a/tests/testlist.c b/tests/testlist.c index 06f98fd311..05daa90180 100644 --- a/tests/testlist.c +++ b/tests/testlist.c @@ -255,7 +255,7 @@ main (int argc, char *argv[]) GtkWidget *window, *hbox, *vbox, *list, *row, *row3, *row_vbox, *row_hbox, *l; GtkWidget *check, *button, *combo, *scrolled; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); diff --git a/tests/testlist2.c b/tests/testlist2.c index 5f0a09e2a5..d00421c32c 100644 --- a/tests/testlist2.c +++ b/tests/testlist2.c @@ -102,7 +102,7 @@ int main (int argc, char *argv[]) gint i; gchar *text; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 300, 300); diff --git a/tests/testlist3.c b/tests/testlist3.c index 9ebd1c1cca..14e4fbe812 100644 --- a/tests/testlist3.c +++ b/tests/testlist3.c @@ -51,7 +51,7 @@ main (int argc, char *argv[]) gint i; gchar *text; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), -1, 300); diff --git a/tests/testlockbutton.c b/tests/testlockbutton.c index f64cea8882..d6c3cff98a 100644 --- a/tests/testlockbutton.c +++ b/tests/testlockbutton.c @@ -218,7 +218,7 @@ main (int argc, char *argv[]) GtkWidget *update; GPermission *permission; - gtk_init (&argc, &argv); + gtk_init (); permission = g_object_new (G_TYPE_TEST_PERMISSION, NULL); diff --git a/tests/testmenubutton.c b/tests/testmenubutton.c index d51133ed4a..7df63c8907 100644 --- a/tests/testmenubutton.c +++ b/tests/testmenubutton.c @@ -46,7 +46,7 @@ int main (int argc, char **argv) guint row = 0; GMenu *menu; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_resize (GTK_WINDOW (window), 400, 300); diff --git a/tests/testmountoperation.c b/tests/testmountoperation.c index 3887c31f32..0a707e2e0c 100644 --- a/tests/testmountoperation.c +++ b/tests/testmountoperation.c @@ -106,13 +106,19 @@ main (int argc, char *argv[]) { "no-pw-save", 's', 0, G_OPTION_ARG_NONE, &dont_save_password, "Don't show password save options.", NULL }, { NULL } }; + GOptionContext *context; - if (!gtk_init_with_args (&argc, &argv, "", options, NULL, &error)) + context = g_option_context_new (""); + g_option_context_add_main_entries (context, options, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("Failed to parse args: %s\n", error->message); g_error_free (error); return 1; } + g_option_context_free (context); + + gtk_init (); if (force_rtl) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testmultidisplay.c b/tests/testmultidisplay.c index 0b28b47e09..8ad28190ea 100644 --- a/tests/testmultidisplay.c +++ b/tests/testmultidisplay.c @@ -105,7 +105,7 @@ main (int argc, char *argv[]) GdkScreen *scr2 = NULL; /* Quiet GCC */ gboolean correct_second_display = FALSE; - gtk_init (&argc, &argv); + gtk_init (); if (argc == 2) screen2_name = g_strdup (argv[1]); diff --git a/tests/testnoscreen.c b/tests/testnoscreen.c index edc71e872e..baaaa8c858 100644 --- a/tests/testnoscreen.c +++ b/tests/testnoscreen.c @@ -26,8 +26,12 @@ int main (int argc, char *argv[]) GtkWidget *window; GtkWidget *button; GdkDisplay *display; + gboolean has_display; - gtk_parse_args (&argc, &argv); + gdk_set_allowed_backends ("x11"); + g_unsetenv ("DISPLAY"); + has_display = gtk_init_check (); + g_assert (!has_display); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); button = gtk_button_new (); diff --git a/tests/testnotebookdnd.c b/tests/testnotebookdnd.c index 436baabfe8..6ee3cfbbf0 100644 --- a/tests/testnotebookdnd.c +++ b/tests/testnotebookdnd.c @@ -320,7 +320,7 @@ main (gint argc, gchar *argv[]) { GtkWidget *window, *grid; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); grid = gtk_grid_new (); diff --git a/tests/testorientable.c b/tests/testorientable.c index e778eacdac..d089f5e7cb 100644 --- a/tests/testorientable.c +++ b/tests/testorientable.c @@ -51,7 +51,7 @@ main (int argc, char **argv) GtkWidget *box, *button; GList *orientables = NULL; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); grid= gtk_grid_new (); diff --git a/tests/testoverlay.c b/tests/testoverlay.c index 88a8be95f2..4b60f5403a 100644 --- a/tests/testoverlay.c +++ b/tests/testoverlay.c @@ -549,7 +549,7 @@ main (int argc, char *argv[]) GtkWidget *win9; GtkCssProvider *css_provider; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testoverlaystyleclass.c b/tests/testoverlaystyleclass.c index f93eba616d..8ca78ae998 100644 --- a/tests/testoverlaystyleclass.c +++ b/tests/testoverlaystyleclass.c @@ -45,7 +45,7 @@ main (int argc, char *argv[]) GtkCssProvider *provider; gchar *str; - gtk_init (&argc, &argv); + gtk_init (); provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, diff --git a/tests/testpixbuf-scale.c b/tests/testpixbuf-scale.c index 73bbf9a1cf..434336cc26 100644 --- a/tests/testpixbuf-scale.c +++ b/tests/testpixbuf-scale.c @@ -67,7 +67,7 @@ main(int argc, char **argv) const gchar *creator; GError *error; - gtk_init (&argc, &argv); + gtk_init (); if (argc != 2) { fprintf (stderr, "Usage: testpixbuf-scale FILE\n"); diff --git a/tests/testplacesview.c b/tests/testplacesview.c index 4a87e3b408..91d5e6aff6 100644 --- a/tests/testplacesview.c +++ b/tests/testplacesview.c @@ -8,7 +8,7 @@ main (int argc, char *argv[]) GtkWidget *win; GtkWidget *view; - gtk_init (&argc, &argv); + gtk_init (); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (win), 400, 600); diff --git a/tests/testpopover.c b/tests/testpopover.c index 306e7c9c28..5fdd8865a8 100644 --- a/tests/testpopover.c +++ b/tests/testpopover.c @@ -48,7 +48,7 @@ main (int argc, char *argv[]) GtkWidget *check; GtkWidget *combo; - gtk_init (&argc, &argv); + gtk_init (); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (win), 400, 600); diff --git a/tests/testpopup.c b/tests/testpopup.c index 98916c56a1..7b3ccfc299 100644 --- a/tests/testpopup.c +++ b/tests/testpopup.c @@ -53,7 +53,7 @@ main (int argc, char *argv[]) { GtkWidget *window; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testpopupat.c b/tests/testpopupat.c index cf9a4538e8..5c0ace65ec 100644 --- a/tests/testpopupat.c +++ b/tests/testpopupat.c @@ -44,7 +44,7 @@ main (int argc, GtkWidget *window; GtkWidget *app_chooser_widget; - gtk_init (&argc, &argv); + gtk_init (); builder = gtk_builder_new_from_file ("popupat.ui"); diff --git a/tests/testprint.c b/tests/testprint.c index 5a6e1da650..896efeb114 100644 --- a/tests/testprint.c +++ b/tests/testprint.c @@ -98,7 +98,7 @@ main (int argc, char **argv) GtkPrintOperation *print; TestPrintFileOperation *print_file; - gtk_init (&argc, &argv); + gtk_init (); /* Test some random drawing, with per-page paper settings */ print = gtk_print_operation_new (); diff --git a/tests/testrc.c b/tests/testrc.c index dd9a29631a..6ef1e0ee49 100644 --- a/tests/testrc.c +++ b/tests/testrc.c @@ -52,7 +52,7 @@ main (int argc, char *argv[]) { gint i; - gtk_init (&argc, &argv); + gtk_init (); load_types (); for (i = 0; tests[i].test; i++) diff --git a/tests/testrecentchooser.c b/tests/testrecentchooser.c index 4ac0722c4c..fcc32a39bc 100644 --- a/tests/testrecentchooser.c +++ b/tests/testrecentchooser.c @@ -111,7 +111,7 @@ main (int argc, gint i; gboolean multiple = FALSE; - gtk_init (&argc, &argv); + gtk_init (); /* to test rtl layout, set RTL=1 in the environment */ if (g_getenv ("RTL")) diff --git a/tests/testrecentchoosermenu.c b/tests/testrecentchoosermenu.c index 0c644b92ce..110b9677ce 100644 --- a/tests/testrecentchoosermenu.c +++ b/tests/testrecentchoosermenu.c @@ -150,7 +150,7 @@ main (int argc, char *argv[]) GtkWidget *button; GtkAccelGroup *accel_group; - gtk_init (&argc, &argv); + gtk_init (); manager = gtk_recent_manager_get_default (); diff --git a/tests/testrevealer.c b/tests/testrevealer.c index 2de4c576b9..9059cd3ade 100644 --- a/tests/testrevealer.c +++ b/tests/testrevealer.c @@ -6,7 +6,7 @@ main (gint argc, { GtkWidget *window, *revealer, *box, *widget, *entry; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request (window, 300, 300); diff --git a/tests/testrichtext.c b/tests/testrichtext.c index 7da1bef897..7572599fc6 100644 --- a/tests/testrichtext.c +++ b/tests/testrichtext.c @@ -143,7 +143,7 @@ main (gint argc, GdkAtom atom; guint i, broken = 0; - gtk_init (&argc, &argv); + gtk_init (); /* initialize random numbers, disable this for deterministic testing */ if (1) diff --git a/tests/testscale.c b/tests/testscale.c index a8294ca4a3..a74613c831 100644 --- a/tests/testscale.c +++ b/tests/testscale.c @@ -114,7 +114,7 @@ int main (int argc, char *argv[]) gdouble pos_marks[4] = { 0.0, 33.3, 66.6, 100.0 }; const gchar *pos_labels[4] = { "Left", "Right", "Top", "Bottom" }; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Ranges with marks"); diff --git a/tests/testscrolledge.c b/tests/testscrolledge.c index 094d3764c6..b1e04dcc8b 100644 --- a/tests/testscrolledge.c +++ b/tests/testscrolledge.c @@ -97,7 +97,7 @@ main (int argc, char *argv[]) GtkWidget *overlay; GtkWidget *label; - gtk_init (NULL, NULL); + gtk_init (); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (win), 600, 400); diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c index cecc1770b1..87da5ad93d 100644 --- a/tests/testscrolledwindow.c +++ b/tests/testscrolledwindow.c @@ -364,7 +364,7 @@ scrollable_policy (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); scrollable_policy (); diff --git a/tests/testselection.c b/tests/testselection.c index 7176985590..9f5d07309a 100644 --- a/tests/testselection.c +++ b/tests/testselection.c @@ -402,7 +402,7 @@ main (int argc, char *argv[]) }; static gint ntargets = sizeof(targetlist) / sizeof(targetlist[0]); - gtk_init (&argc, &argv); + gtk_init (); init_atoms(); diff --git a/tests/testselectionmode.c b/tests/testselectionmode.c index 6cea2b1052..dfb8c4da04 100644 --- a/tests/testselectionmode.c +++ b/tests/testselectionmode.c @@ -179,7 +179,7 @@ main (int argc, char *argv[]) GSimpleActionGroup *group; GSimpleAction *action; - gtk_init (NULL, NULL); + gtk_init (); builder = gtk_builder_new_from_file ("selectionmode.ui"); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); diff --git a/tests/testsensitive.c b/tests/testsensitive.c index 7ecaf365e1..7e3edaa597 100644 --- a/tests/testsensitive.c +++ b/tests/testsensitive.c @@ -58,7 +58,7 @@ int main (int argc, char *argv[]) GtkWidget *bu; GtkWidget *w, *c; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c index 686de064b3..24c80bf4e7 100644 --- a/tests/testspinbutton.c +++ b/tests/testspinbutton.c @@ -68,7 +68,7 @@ prepare_window_for_orientation (GtkOrientation orientation) int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); prepare_window_for_orientation (GTK_ORIENTATION_HORIZONTAL); prepare_window_for_orientation (GTK_ORIENTATION_VERTICAL); diff --git a/tests/testsplitheaders.c b/tests/testsplitheaders.c index 5becbdb0c3..42de06d74f 100644 --- a/tests/testsplitheaders.c +++ b/tests/testsplitheaders.c @@ -42,7 +42,7 @@ main (int argc, char *argv[]) GtkWidget *check; GtkWidget *header; - gtk_init (NULL, NULL); + gtk_init (); builder = gtk_builder_new_from_file ("testsplitheaders.ui"); diff --git a/tests/teststack.c b/tests/teststack.c index 9e0dcf89b2..48dba7ef23 100644 --- a/tests/teststack.c +++ b/tests/teststack.c @@ -118,7 +118,7 @@ main (gint argc, GtkTreeIter iter; GEnumClass *class; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request (window, 300, 300); diff --git a/tests/teststackedheaders.c b/tests/teststackedheaders.c index 53470db8a6..830e9da761 100644 --- a/tests/teststackedheaders.c +++ b/tests/teststackedheaders.c @@ -23,7 +23,7 @@ main (int argc, char *argv[]) GtkBuilder *builder; GtkWidget *win; - gtk_init (NULL, NULL); + gtk_init (); builder = gtk_builder_new (); gtk_builder_add_callback_symbol (builder, "back_to_main", G_CALLBACK (back_to_main)); diff --git a/tests/testswitch.c b/tests/testswitch.c index ee0a569846..0d07327ce0 100644 --- a/tests/testswitch.c +++ b/tests/testswitch.c @@ -156,7 +156,7 @@ int main (int argc, char *argv[]) GtkWidget *window; GtkWidget *vbox, *hbox; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "GtkSwitch"); diff --git a/tests/testtextview.c b/tests/testtextview.c index 0cfd0a15ed..e6d74b9f5e 100644 --- a/tests/testtextview.c +++ b/tests/testtextview.c @@ -196,7 +196,7 @@ main (int argc, char **argv) GtkTextBuffer *buffer; GtkTextChildAnchor *anchor; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); sw = gtk_scrolled_window_new (NULL, NULL); diff --git a/tests/testthreads.c b/tests/testthreads.c index 867e44b614..8c4c8d58b7 100644 --- a/tests/testthreads.c +++ b/tests/testthreads.c @@ -127,7 +127,7 @@ main (int argc, char **argv) exit(1); } - gtk_init (&argc, &argv); + gtk_init (); pthread_mutex_lock (&nthreads_mutex); diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index d284b52cee..116201fcde 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -490,7 +490,7 @@ main (gint argc, gchar **argv) GIcon *gicon; GSList *group; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testtoolbar2.c b/tests/testtoolbar2.c index 211958f871..878f43aff1 100644 --- a/tests/testtoolbar2.c +++ b/tests/testtoolbar2.c @@ -9,7 +9,7 @@ int main (int argc, char *argv[]) GtkWidget *view; GtkWidget *button; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); diff --git a/tests/testtooltips.c b/tests/testtooltips.c index 7a064c40d5..1d071e2f60 100644 --- a/tests/testtooltips.c +++ b/tests/testtooltips.c @@ -262,7 +262,7 @@ main (int argc, char *argv[]) gchar *text, *markup; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Tooltips test"); diff --git a/tests/testtoplevelembed.c b/tests/testtoplevelembed.c index 31561b8558..4df5aec021 100644 --- a/tests/testtoplevelembed.c +++ b/tests/testtoplevelembed.c @@ -57,7 +57,7 @@ main (gint argc, gchar **argv) GtkWidget *window; GtkWidget *widget; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Toplevel widget embedding example"); diff --git a/tests/testtreechanging.c b/tests/testtreechanging.c index f974486736..76bd4e32bd 100644 --- a/tests/testtreechanging.c +++ b/tests/testtreechanging.c @@ -474,7 +474,7 @@ main (int argc, GtkTreeModel *model; guint i; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testtreecolumns.c b/tests/testtreecolumns.c index d6d3d77aa4..2d71118ddb 100644 --- a/tests/testtreecolumns.c +++ b/tests/testtreecolumns.c @@ -720,7 +720,7 @@ main (int argc, char *argv[]) GtkTreeModel *sample_model; gint i; - gtk_init (&argc, &argv); + gtk_init (); /* First initialize all the models for signal purposes */ left_tree_model = (GtkTreeModel *) gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); diff --git a/tests/testtreecolumnsizing.c b/tests/testtreecolumnsizing.c index c3ade30ad5..7be0a1cba3 100644 --- a/tests/testtreecolumnsizing.c +++ b/tests/testtreecolumnsizing.c @@ -170,7 +170,7 @@ main (int argc, char **argv) GtkWidget *tree_view; GtkWidget *button; - gtk_init (&argc, &argv); + gtk_init (); /* Window and box */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testtreednd.c b/tests/testtreednd.c index 0a84ec3b8a..c308d45426 100644 --- a/tests/testtreednd.c +++ b/tests/testtreednd.c @@ -118,7 +118,7 @@ main (int argc, char *argv[]) GtkWidget *window; GtkWidget *box; - gtk_init (NULL, NULL); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testtreeedit.c b/tests/testtreeedit.c index 994f0342c1..1b3b8bfcf5 100644 --- a/tests/testtreeedit.c +++ b/tests/testtreeedit.c @@ -229,7 +229,7 @@ main (gint argc, gchar **argv) GtkCellArea *area; CallbackData callback[4]; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testtreeflow.c b/tests/testtreeflow.c index 6c73ab656a..7ac171ca79 100644 --- a/tests/testtreeflow.c +++ b/tests/testtreeflow.c @@ -127,7 +127,7 @@ main (int argc, char *argv[]) GtkWidget *button; GtkTreePath *path; - gtk_init (&argc, &argv); + gtk_init (); path = gtk_tree_path_new_from_string ("80"); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/tests/testtreefocus.c b/tests/testtreefocus.c index 6841101a52..c32258d725 100644 --- a/tests/testtreefocus.c +++ b/tests/testtreefocus.c @@ -346,7 +346,7 @@ main (int argc, char *argv[]) gint col_offset; GtkTreeViewColumn *column; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet"); diff --git a/tests/testtreemenu.c b/tests/testtreemenu.c index 1368084250..3d2417ba97 100644 --- a/tests/testtreemenu.c +++ b/tests/testtreemenu.c @@ -545,7 +545,7 @@ tree_menu (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); tree_menu (); diff --git a/tests/testtreemodel.c b/tests/testtreemodel.c index c240b18aa9..031dab580a 100644 --- a/tests/testtreemodel.c +++ b/tests/testtreemodel.c @@ -256,8 +256,12 @@ int main (int argc, char *argv[]) { GtkTreeModel *model; - - gtk_init_with_args (&argc, &argv, NULL, entries, NULL, NULL); + GOptionContext *context; + + context = g_option_context_new (""); + g_option_context_add_main_entries (context, entries, NULL); + g_option_context_parse (context, &argc, &argv, NULL); + gtk_init (); model = GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING)); diff --git a/tests/testtreepos.c b/tests/testtreepos.c index 77cf205dd3..ad2cbd0fee 100644 --- a/tests/testtreepos.c +++ b/tests/testtreepos.c @@ -91,7 +91,7 @@ int main (int argc, char *argv[]) GtkTreeStore *store; GtkTreeIter iter; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); sw = gtk_scrolled_window_new (NULL, NULL); diff --git a/tests/testtreesort.c b/tests/testtreesort.c index 8239ad26ec..80ac65eb98 100644 --- a/tests/testtreesort.c +++ b/tests/testtreesort.c @@ -112,7 +112,7 @@ main (int argc, char *argv[]) GtkWidget *window2, *vbox2, *scrolled_window2, *tree_view2; GtkWidget *window3, *vbox3, *scrolled_window3, *tree_view3; - gtk_init (&argc, &argv); + gtk_init (); /** * First window - Just a GtkTreeStore diff --git a/tests/testtreeview.c b/tests/testtreeview.c index 8e00395820..def4ebff3f 100644 --- a/tests/testtreeview.c +++ b/tests/testtreeview.c @@ -663,7 +663,7 @@ main (int argc, GtkTreeModel *model; gint i; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testverticalcells.c b/tests/testverticalcells.c index e9e2bcd492..a25abf6328 100644 --- a/tests/testverticalcells.c +++ b/tests/testverticalcells.c @@ -299,7 +299,7 @@ main (gint argc, gchar **argv) GtkTreeViewColumn *column; GtkCellArea *area; - gtk_init (&argc, &argv); + gtk_init (); if (g_getenv ("RTL")) gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL); diff --git a/tests/testvolumebutton.c b/tests/testvolumebutton.c index 0dfcc673fe..611a2941e2 100644 --- a/tests/testvolumebutton.c +++ b/tests/testvolumebutton.c @@ -82,7 +82,7 @@ main (int argc, GtkWidget *box; GtkWidget *vbox; - gtk_init (&argc, &argv); + gtk_init (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c index 8a76399077..95e23b6d48 100644 --- a/tests/testwindowsize.c +++ b/tests/testwindowsize.c @@ -136,7 +136,7 @@ create_window (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); create_window (); diff --git a/tests/testxinerama.c b/tests/testxinerama.c index 538460bd12..38550f4a60 100644 --- a/tests/testxinerama.c +++ b/tests/testxinerama.c @@ -108,7 +108,7 @@ main (int argc, char *argv[]) GdkDisplay *display; gint i, num_monitors; - gtk_init (&argc, &argv); + gtk_init (); display = gdk_display_get_default (); diff --git a/tests/treestoretest.c b/tests/treestoretest.c index f930a388db..45fee12e32 100644 --- a/tests/treestoretest.c +++ b/tests/treestoretest.c @@ -439,7 +439,7 @@ make_window (gint view_type) int main (int argc, char *argv[]) { - gtk_init (&argc, &argv); + gtk_init (); base_model = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING); diff --git a/tests/video-timer.c b/tests/video-timer.c index d0d3bc52ca..1a68a7bdd2 100644 --- a/tests/video-timer.c +++ b/tests/video-timer.c @@ -365,14 +365,21 @@ main(int argc, char **argv) GtkWidget *da; GError *error = NULL; GdkFrameClock *frame_clock; + GOptionContext *context; - if (!gtk_init_with_args (&argc, &argv, "", - options, NULL, &error)) + context = g_option_context_new (""); + g_option_context_add_main_entries (context, options, NULL); + + if (!g_option_context_parse (context, &argc, &argv, &error)) { g_printerr ("Option parsing failed: %s\n", error->message); return 1; } + g_option_context_free (context); + + gtk_init (); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 300, 300); g_signal_connect (window, "destroy", diff --git a/tests/visuals/visuals.c b/tests/visuals/visuals.c index 5dc9530bee..27c2904d20 100644 --- a/tests/visuals/visuals.c +++ b/tests/visuals/visuals.c @@ -62,7 +62,7 @@ main (int argc, char *argv[]) GtkWidget *window; const gchar *filename; - gtk_init (&argc, &argv); + gtk_init (); if (argc < 2) return 1; diff --git a/testsuite/a11y/derive.c b/testsuite/a11y/derive.c index 6ecb47cf1d..b9e4d4d41c 100644 --- a/testsuite/a11y/derive.c +++ b/testsuite/a11y/derive.c @@ -62,7 +62,7 @@ int main (int argc, char *argv[]) GtkWidget *widget; GtkAccessible *accessible; - gtk_init (NULL, NULL); + gtk_init (); widget = GTK_WIDGET (g_object_new (my_button_get_type (), NULL)); accessible = GTK_ACCESSIBLE (gtk_widget_get_accessible (widget)); diff --git a/testsuite/gdk/Makefile.am b/testsuite/gdk/Makefile.am index b8cbca3e12..03cb577468 100644 --- a/testsuite/gdk/Makefile.am +++ b/testsuite/gdk/Makefile.am @@ -5,13 +5,13 @@ NULL= noinst_PROGRAMS = $(TEST_PROGS) AM_CPPFLAGS = \ - $(GDK_DEP_CFLAGS) \ + $(GTK_DEP_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir)/gdk \ $(NULL) LDADD = \ - $(GDK_DEP_LIBS) \ + $(GTK_DEP_LIBS) \ $(top_builddir)/gtk/libgtk-4.la \ $(NULL) diff --git a/testsuite/gdk/cairo.c b/testsuite/gdk/cairo.c index 77be879c97..071ca33767 100644 --- a/testsuite/gdk/cairo.c +++ b/testsuite/gdk/cairo.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_set_source_big_pixbuf (void) @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/drawing/set-source-big-pixbuf", test_set_source_big_pixbuf); diff --git a/testsuite/gdk/cursor.c b/testsuite/gdk/cursor.c index 5ae3bc064e..ec2997a600 100644 --- a/testsuite/gdk/cursor.c +++ b/testsuite/gdk/cursor.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static char *cursor_names[] = { "none", @@ -76,7 +76,7 @@ main (int argc, char *argv[]) char *test_name; g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); for (i = 0; i < G_N_ELEMENTS (cursor_names); i++) { diff --git a/testsuite/gdk/display.c b/testsuite/gdk/display.c index 297c8e8ae4..c5b3b1641a 100644 --- a/testsuite/gdk/display.c +++ b/testsuite/gdk/display.c @@ -1,6 +1,6 @@ #include <stdlib.h> -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_unset_display_subprocess1 (void) @@ -9,7 +9,7 @@ test_unset_display_subprocess1 (void) g_unsetenv ("DISPLAY"); - g_assert (!gdk_init_check (NULL, NULL)); + g_assert (!gtk_init_check ()); manager = gdk_display_manager_get (); g_assert (manager != NULL); g_assert (gdk_display_manager_get_default_display (manager) == NULL); @@ -20,7 +20,7 @@ test_unset_display_subprocess2 (void) { g_unsetenv ("DISPLAY"); - gdk_init (NULL, NULL); + gtk_init (); } static void @@ -41,7 +41,7 @@ test_bad_display_subprocess1 (void) g_setenv ("DISPLAY", "poo", TRUE); - g_assert (!gdk_init_check (NULL, NULL)); + g_assert (!gtk_init_check ()); manager = gdk_display_manager_get (); g_assert (manager != NULL); g_assert (gdk_display_manager_get_default_display (manager) == NULL); @@ -51,7 +51,7 @@ static void test_bad_display_subprocess2 (void) { g_setenv ("DISPLAY", "poo", TRUE); - gdk_init (NULL, NULL); + gtk_init (); } static void diff --git a/testsuite/gdk/encoding.c b/testsuite/gdk/encoding.c index 6ae96095d6..016d1cee28 100644 --- a/testsuite/gdk/encoding.c +++ b/testsuite/gdk/encoding.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> #ifdef GDK_WINDOWING_X11 #include <gdk/x11/gdkx.h> #endif @@ -38,7 +38,7 @@ int main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/encoding/to-text-list", test_to_text_list); diff --git a/testsuite/gdk/keysyms.c b/testsuite/gdk/keysyms.c index 7d786f557c..dc94faec23 100644 --- a/testsuite/gdk/keysyms.c +++ b/testsuite/gdk/keysyms.c @@ -1,5 +1,5 @@ #include <locale.h> -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_keysyms_basic (void) @@ -59,7 +59,7 @@ int main (int argc, char *argv[]) setlocale (LC_ALL, ""); g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/keysyms/basic", test_keysyms_basic); g_test_add_func ("/keysyms/void", test_keysyms_void); diff --git a/testsuite/gdk/rectangle.c b/testsuite/gdk/rectangle.c index 6089ff6ba3..1b9cbe9135 100644 --- a/testsuite/gdk/rectangle.c +++ b/testsuite/gdk/rectangle.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_rectangle_equal (void) @@ -70,7 +70,7 @@ main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); g_test_bug_base ("http://bugzilla.gnome.org/"); diff --git a/testsuite/gdk/seat.c b/testsuite/gdk/seat.c index 326b70dc89..8fadb82a6f 100644 --- a/testsuite/gdk/seat.c +++ b/testsuite/gdk/seat.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_list_seats (void) @@ -109,7 +109,7 @@ main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); g_test_bug_base ("http://bugzilla.gnome.org/"); diff --git a/testsuite/gtk/accessible.c b/testsuite/gtk/accessible.c index cdf3253730..7f5a034b94 100644 --- a/testsuite/gtk/accessible.c +++ b/testsuite/gtk/accessible.c @@ -24,7 +24,7 @@ main (int argc, char *argv[]) const GType *tp; guint i, n; - gtk_init (&argc, &argv); + gtk_init (); tp = gtk_test_list_all_types (&n); diff --git a/testsuite/gtk/cssprovider.c b/testsuite/gtk/cssprovider.c index da44a0371c..02549a0171 100644 --- a/testsuite/gtk/cssprovider.c +++ b/testsuite/gtk/cssprovider.c @@ -65,7 +65,7 @@ test_section_load_nonexisting_file (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/cssprovider/section-in-load-from-data", test_section_in_load_from_data); diff --git a/testsuite/gtk/displayclose.c b/testsuite/gtk/displayclose.c index 39fd794e92..60f90f8f49 100644 --- a/testsuite/gtk/displayclose.c +++ b/testsuite/gtk/displayclose.c @@ -6,14 +6,17 @@ main (int argc, char **argv) const gchar *display_name; GdkDisplay *display; GtkWidget *win, *but; + gboolean has_display; g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - if (!gtk_parse_args (&argc, &argv)) - return 1; + gdk_set_allowed_backends ("x11"); + display_name = g_getenv ("DISPLAY"); + g_unsetenv ("DISPLAY"); + has_display = gtk_init_check (); + g_assert (!has_display); - display_name = gdk_get_display_arg_name(); - display = gdk_display_open(display_name); + display = gdk_display_open (display_name); if (!display) return 1; diff --git a/testsuite/gtk/firefox-stylecontext.c b/testsuite/gtk/firefox-stylecontext.c index 86dc1ee5f0..f02cb3aaf5 100644 --- a/testsuite/gtk/firefox-stylecontext.c +++ b/testsuite/gtk/firefox-stylecontext.c @@ -53,11 +53,7 @@ test_init_of_theme (void) int main (int argc, char *argv[]) { - /* If gdk_init() is called before gtk_init() the GTK code takes - * a different path (why?) - */ - gdk_init (NULL, NULL); - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/style/init_of_theme", test_init_of_theme); diff --git a/testsuite/gtk/gtkmenu.c b/testsuite/gtk/gtkmenu.c index e2667ba135..c17d50aa75 100644 --- a/testsuite/gtk/gtkmenu.c +++ b/testsuite/gtk/gtkmenu.c @@ -422,7 +422,7 @@ test_bind_menu (void) GRand *rand; gint i; - gtk_init (0, 0); + gtk_init (); rand = g_rand_new_with_seed (g_test_rand_int ()); model = random_menu_new (rand, TOP_ORDER); diff --git a/testsuite/gtk/revealer-size.c b/testsuite/gtk/revealer-size.c index 8c09a49125..cc1708ab67 100644 --- a/testsuite/gtk/revealer-size.c +++ b/testsuite/gtk/revealer-size.c @@ -128,7 +128,7 @@ slide_up_no_animations () int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/sizing/revealer/slide_right_animations", slide_right_animations); diff --git a/testsuite/gtk/scrolledwindow.c b/testsuite/gtk/scrolledwindow.c index b62b32393d..f960c38339 100644 --- a/testsuite/gtk/scrolledwindow.c +++ b/testsuite/gtk/scrolledwindow.c @@ -125,7 +125,7 @@ min_max_content_height (void) int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/sizing/scrolledwindow/min_content_width", min_content_width); diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index 57a8dd53c6..b66d91739b 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -508,7 +508,7 @@ test_style_priorities_three_context_higher (PrioritiesFixture *f, int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/style/parse/selectors", test_parse_selectors); |