[gtk+] Update callers
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Update callers
- Date: Thu, 19 Jan 2017 18:54:16 +0000 (UTC)
commit 2c7e567f05eb31aa3b78ed83fd92a09153525210
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 28 08:53:22 2016 -0500
Update callers
Adapt all our tests and examples to the new initialization api.
docs/tools/shooter.c | 2 +-
examples/builder.c | 2 +-
gtk/gtk-builder-tool.c | 2 +-
gtk/gtk-launch.c | 2 +-
gtk/gtk-query-settings.c | 2 +-
gtk/gtkapplication.c | 2 +-
gtk/gtktestutils.c | 2 +-
tests/animated-resizing.c | 4 ++--
tests/animated-revealing.c | 4 ++--
tests/flicker.c | 2 +-
tests/gdkgears.c | 2 +-
tests/listmodel.c | 2 +-
tests/motion-compression.c | 2 +-
tests/overlayscroll.c | 2 +-
tests/print-editor.c | 2 +-
tests/rendernode-create-tests.c | 2 +-
tests/rendernode.c | 8 ++++++--
tests/scrolling-performance.c | 4 ++--
tests/simple.c | 2 +-
tests/stresstest-toolbar.c | 2 +-
tests/syncscroll.c | 2 +-
tests/testaccel.c | 2 +-
tests/testadjustsize.c | 2 +-
tests/testanimation.c | 2 +-
tests/testappchooser.c | 2 +-
tests/testappchooserbutton.c | 2 +-
tests/testassistant.c | 2 +-
tests/testbaseline.c | 2 +-
tests/testbbox.c | 2 +-
tests/testbox.c | 2 +-
tests/testboxcss.c | 2 +-
tests/testbuttons.c | 2 +-
tests/testcairo.c | 2 +-
tests/testcalendar.c | 2 +-
tests/testcellarea.c | 2 +-
tests/testcellrenderertext.c | 2 +-
tests/testclipboard.c | 2 +-
tests/testcolorchooser.c | 2 +-
tests/testcolorchooser2.c | 2 +-
tests/testcombo.c | 2 +-
tests/testcombochange.c | 2 +-
tests/testdialog.c | 2 +-
tests/testdnd.c | 2 +-
tests/testdnd2.c | 2 +-
tests/testellipsise.c | 2 +-
tests/testemblems.c | 2 +-
tests/testentrycompletion.c | 2 +-
tests/testentryicons.c | 2 +-
tests/testerrors.c | 2 +-
tests/testexpand.c | 2 +-
tests/testexpander.c | 2 +-
tests/testfilechooser.c | 8 +++++++-
tests/testfilechooserbutton.c | 3 +--
tests/testflowbox.c | 2 +-
tests/testfontchooser.c | 2 +-
tests/testfontchooserdialog.c | 2 +-
tests/testfontoptions.c | 2 +-
tests/testframe.c | 2 +-
tests/testfullscreen.c | 2 +-
tests/testgaction.c | 2 +-
tests/testgiconpixbuf.c | 2 +-
tests/testglarea.c | 2 +-
tests/testglblending.c | 2 +-
tests/testgmenu.c | 6 +++++-
tests/testgrid.c | 2 +-
tests/testgrouping.c | 2 +-
tests/testgtk.c | 2 +-
tests/testheaderbar.c | 2 +-
tests/testheightforwidth.c | 2 +-
tests/testicontheme.c | 2 +-
tests/testiconview-keynav.c | 2 +-
tests/testiconview.c | 2 +-
tests/testimage.c | 2 +-
tests/testinput.c | 2 +-
tests/testkineticscrolling.c | 2 +-
tests/testlevelbar.c | 2 +-
tests/testlist.c | 2 +-
tests/testlist2.c | 2 +-
tests/testlist3.c | 2 +-
tests/testlockbutton.c | 2 +-
tests/testmenubutton.c | 2 +-
tests/testmountoperation.c | 8 +++++++-
tests/testmultidisplay.c | 2 +-
tests/testnoscreen.c | 6 +++++-
tests/testnotebookdnd.c | 2 +-
tests/testorientable.c | 2 +-
tests/testoverlay.c | 2 +-
tests/testoverlaystyleclass.c | 2 +-
tests/testpixbuf-scale.c | 2 +-
tests/testplacesview.c | 2 +-
tests/testpopover.c | 2 +-
tests/testpopup.c | 2 +-
tests/testpopupat.c | 2 +-
tests/testprint.c | 2 +-
tests/testrc.c | 2 +-
tests/testrecentchooser.c | 2 +-
tests/testrecentchoosermenu.c | 2 +-
tests/testrevealer.c | 2 +-
tests/testrichtext.c | 2 +-
tests/testscale.c | 2 +-
tests/testscrolledge.c | 2 +-
tests/testscrolledwindow.c | 2 +-
tests/testselection.c | 2 +-
tests/testselectionmode.c | 2 +-
tests/testsensitive.c | 2 +-
tests/testspinbutton.c | 2 +-
tests/testsplitheaders.c | 2 +-
tests/teststack.c | 2 +-
tests/teststackedheaders.c | 2 +-
tests/testswitch.c | 2 +-
tests/testtextview.c | 2 +-
tests/testthreads.c | 2 +-
tests/testtoolbar.c | 2 +-
tests/testtoolbar2.c | 2 +-
tests/testtooltips.c | 2 +-
tests/testtoplevelembed.c | 2 +-
tests/testtreechanging.c | 2 +-
tests/testtreecolumns.c | 2 +-
tests/testtreecolumnsizing.c | 2 +-
tests/testtreednd.c | 2 +-
tests/testtreeedit.c | 2 +-
tests/testtreeflow.c | 2 +-
tests/testtreefocus.c | 2 +-
tests/testtreemenu.c | 2 +-
tests/testtreemodel.c | 8 ++++++--
tests/testtreepos.c | 2 +-
tests/testtreesort.c | 2 +-
tests/testtreeview.c | 2 +-
tests/testverticalcells.c | 2 +-
tests/testvolumebutton.c | 2 +-
tests/testwindowsize.c | 2 +-
tests/testxinerama.c | 2 +-
tests/treestoretest.c | 2 +-
tests/video-timer.c | 11 +++++++++--
tests/visuals/visuals.c | 2 +-
testsuite/a11y/derive.c | 2 +-
testsuite/gdk/Makefile.am | 4 ++--
testsuite/gdk/cairo.c | 4 ++--
testsuite/gdk/cursor.c | 4 ++--
testsuite/gdk/display.c | 10 +++++-----
testsuite/gdk/encoding.c | 4 ++--
testsuite/gdk/keysyms.c | 4 ++--
testsuite/gdk/rectangle.c | 4 ++--
testsuite/gdk/seat.c | 4 ++--
testsuite/gtk/accessible.c | 2 +-
testsuite/gtk/cssprovider.c | 2 +-
testsuite/gtk/displayclose.c | 11 +++++++----
testsuite/gtk/firefox-stylecontext.c | 6 +-----
testsuite/gtk/gtkmenu.c | 2 +-
testsuite/gtk/revealer-size.c | 2 +-
testsuite/gtk/scrolledwindow.c | 2 +-
testsuite/gtk/stylecontext.c | 2 +-
152 files changed, 210 insertions(+), 177 deletions(-)
---
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c
index a3bc656..d61eb39 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 a05646f..d732068 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 0a22d00..d75d766 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 bf84ad6..76a95e4 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 29ae214..6a025f5 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 a1b2271..ff70808 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 c85fa25..30f5d90 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 f0f5269..5f686ce 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 11b3f99..febfc00 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 4743eb8..85890f9 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 584c3fa..19f8068 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 625a099..1d98bc7 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 e69956a..a49147c 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 4c3c641..e1ec8b8 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 27ebb67..cf79140 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 93d8943..b55e768 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 292be48..f35f74c 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 90be21b..99b0fa4 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 30ebd14..b23350e 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 ba10d73..bab169f 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 2824a89..7797194 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 f3b64d1..4f5c1fc 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 f7f9772..ac4fddb 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 2dd60f9..8c03951 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 25666df..f4c3ff0 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 bf37cd5..6ff01d1 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 2e188ba..fd4074b 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 30f4a19..d402665 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 502914f..d137eb7 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 6885f41..1215d9c 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 517e530..451dbf2 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 7217311..6c58cb3 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 e2e22d8..e482bb3 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 aec6406..4162a76 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 7de3625..eae9f02 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 c9648a5..1c82eb8 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 010ee35..2ab4441 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 4fb6354..9457632 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 c90962f..a0c4f11 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 2f33493..9ea0ea6 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 b74477b..4c8a8fa 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 0b90b69..941acfd 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 2011578..083d0e2 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 2cccf04..029c24d 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 52ea06f..7749c86 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 3d8ee80..171d2a7 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 4bb0124..6bb4468 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 1025c0a..d5b20d5 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 24dd5d3..42cf8ff 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 028b64c..750020b 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 61329dc..286e479 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 6d31224..5cb628a 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 96deb11..74bc80a 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 779ee4d..156a933 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 7ecab02..13d19b3 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 2e2da14..43ecaf0 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 7db27bc..5e29ebc 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 ea241b4..8d6ea09 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 29e853a..9059f3b 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 c9ae96e..c45e3c4 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 ab52c97..5c406aa 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 187637d..08ed63c 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 bb3b186..d220ff8 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 c92b143..a0943c9 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 37e2d79..eb0af50 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 4b412d0..01f4a83 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 abefd0c..7e08e27 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 c766e4c..57ed406 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 444a201..b110838 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 e7f10df..f34e93a 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 98f662a..5ab1253 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 9cb5498..72f8fab 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 522b282..7f61f75 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 9c91bf5..38899ca 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 94bd6b8..fe412d0 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 ccf4141..23385f8 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 06f98fd..05daa90 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 5f0a09e..d00421c 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 9ebd1c1..14e4fbe 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 f64cea8..d6c3cff 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 d51133e..7df63c8 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 3887c31..0a707e2 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 0b28b47..8ad2819 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 edc71e8..baaaa8c 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 436baab..6ee3cfb 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 e778eac..d089f5e 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 88a8be9..4b60f54 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 f93eba6..8ca78ae 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 73bbf9a..434336c 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 4a87e3b..91d5e6a 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 306e7c9..5fdd886 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 98916c5..7b3ccfc 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 cf9a453..5c0ace6 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 5a6e1da..896efeb 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 dd9a296..6ef1e0e 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 4ac0722..fcc32a3 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 0c644b9..110b967 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 2de4c57..9059cd3 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 7da1bef..7572599 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 a8294ca..a74613c 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 094d376..b1e04dc 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 cecc177..87da5ad 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 7176985..9f5d073 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 6cea2b1..dfb8c4d 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 7ecaf36..7e3edaa 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 686de06..24c80bf 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 5becbdb..42de06d 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 9e0dcf8..48dba7e 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 53470db..830e9da 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 ee0a569..0d07327 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 0cfd0a1..e6d74b9 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 867e44b..8c4c8d5 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 d284b52..116201f 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 211958f..878f43a 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 7a064c4..1d071e2 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 31561b8..4df5aec 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 f974486..76bd4e3 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 d6d3d77..2d71118 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 c3ade30..7be0a1c 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 0a84ec3..c308d45 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 994f034..1b3b8bf 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 6c73ab6..7ac171c 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 6841101..c32258d 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 1368084..3d2417b 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 c240b18..031dab5 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 77cf205..ad2cbd0 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 8239ad2..80ac65e 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 8e00395..def4ebf 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 e9e2bcd..a25abf6 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 0dfcc67..611a294 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 8a76399..95e23b6 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 538460b..38550f4 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 f930a38..45fee12 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 d0d3bc5..1a68a7b 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 5dc9530..27c2904 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 6ecb47c..b9e4d4d 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 b8cbca3..03cb577 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 77be879..071ca33 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 5ae3bc0..ec2997a 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 297c8e8..c5b3b16 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 6ae9609..016d1ce 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 7d786f5..dc94fae 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 6089ff6..1b9cbe9 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 326b70d..8fadb82 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 cdf3253..7f5a034 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 da44a03..02549a0 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 39fd794..60f90f8 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 86dc1ee..f02cb3a 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 e2667ba..c17d50a 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 8c09a49..cc1708a 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 b62b323..f960c38 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 57a8dd5..b66d917 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]