[gnome-robots] Rename app to window



commit c75c3088103931ff687b473358afae800fb0f16e
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun May 18 19:30:39 2014 -0500

    Rename app to window
    
    Prep for GtkApplication

 src/game.c       |    8 ++++----
 src/gnobots.c    |   28 ++++++++++++++--------------
 src/gnobots.h    |    2 +-
 src/menu.c       |   10 +++++-----
 src/properties.c |    2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/game.c b/src/game.c
index 9f04b06..6b730a2 100644
--- a/src/game.c
+++ b/src/game.c
@@ -112,7 +112,7 @@ message_box (gchar * msg)
 {
   GtkWidget *box;
 
-  box = gtk_message_dialog_new (GTK_WINDOW (app), GTK_DIALOG_MODAL,
+  box = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL,
                                 GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", msg);
   gtk_dialog_run (GTK_DIALOG (box));
   gtk_widget_destroy (box);
@@ -140,7 +140,7 @@ show_scores (gint pos, gboolean endofgame)
     if (sorrydialog != NULL) {
       gtk_window_present (GTK_WINDOW (sorrydialog));
     } else {
-      sorrydialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (app),
+      sorrydialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (window),
                                                         GTK_DIALOG_DESTROY_WITH_PARENT,
                                                         GTK_MESSAGE_INFO,
                                                         GTK_BUTTONS_NONE,
@@ -162,7 +162,7 @@ show_scores (gint pos, gboolean endofgame)
     if (scoresdialog != NULL) {
       gtk_window_present (GTK_WINDOW (scoresdialog));
     } else {
-      scoresdialog = games_scores_dialog_new (GTK_WINDOW (app), 
+      scoresdialog = games_scores_dialog_new (GTK_WINDOW (window),
                                         highscores, _("Robots Scores"));
       games_scores_dialog_set_category_description (GAMES_SCORES_DIALOG
                                                     (scoresdialog),
@@ -625,7 +625,7 @@ init_game (void)
 {
   create_game_timer ();
 
-  g_signal_connect (GTK_WIDGET (app), "key_press_event",
+  g_signal_connect (GTK_WIDGET (window), "key_press_event",
                     G_CALLBACK (keyboard_cb), 0);
 
   start_new_game ();
diff --git a/src/gnobots.c b/src/gnobots.c
index 0d7483b..2db6961 100644
--- a/src/gnobots.c
+++ b/src/gnobots.c
@@ -52,7 +52,7 @@
 /**********************************************************************/
 /* Exported Variables                                                 */
 /**********************************************************************/
-GtkWidget *app = NULL;
+GtkWidget *window = NULL;
 static gint window_width = 0, window_height = 0;
 static gboolean window_is_fullscreen = FALSE, window_is_maximized = FALSE;
 GtkWidget *game_area = NULL;
@@ -209,17 +209,17 @@ main (int argc, char *argv[])
 
   gtk_window_set_default_icon_name ("gnome-robots");
 
-  app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_title (GTK_WINDOW (app), _("Robots"));
-  g_signal_connect (GTK_WINDOW (app), "configure-event", G_CALLBACK (window_configure_event_cb), NULL);
-  g_signal_connect (GTK_WINDOW (app), "window-state-event", G_CALLBACK (window_state_event_cb), NULL);
-  gtk_window_set_default_size (GTK_WINDOW (app), g_settings_get_int (settings, "window-width"), 
g_settings_get_int (settings, "window-height"));
+  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_title (GTK_WINDOW (window), _("Robots"));
+  g_signal_connect (GTK_WINDOW (window), "configure-event", G_CALLBACK (window_configure_event_cb), NULL);
+  g_signal_connect (GTK_WINDOW (window), "window-state-event", G_CALLBACK (window_state_event_cb), NULL);
+  gtk_window_set_default_size (GTK_WINDOW (window), g_settings_get_int (settings, "window-width"), 
g_settings_get_int (settings, "window-height"));
   if (g_settings_get_boolean (settings, "window-is-fullscreen"))
-    gtk_window_fullscreen (GTK_WINDOW (app));
+    gtk_window_fullscreen (GTK_WINDOW (window));
   if (g_settings_get_boolean (settings, "window-is-maximized"))
-    gtk_window_maximize (GTK_WINDOW (app));
+    gtk_window_maximize (GTK_WINDOW (window));
 
-  g_signal_connect (G_OBJECT (app), "delete_event",
+  g_signal_connect (G_OBJECT (window), "delete_event",
                    G_CALLBACK (quit_game), NULL);
 
   statusbar = gnobots_statusbar_new ();
@@ -227,7 +227,7 @@ main (int argc, char *argv[])
 
   games_stock_prepare_for_statusbar_tooltips (ui_manager, statusbar);
   create_game_menus (ui_manager);
-  gtk_window_add_accel_group (GTK_WINDOW (app),
+  gtk_window_add_accel_group (GTK_WINDOW (window),
                              gtk_ui_manager_get_accel_group (ui_manager));
 
   menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
@@ -259,7 +259,7 @@ main (int argc, char *argv[])
   gtk_box_pack_start (GTK_BOX (vbox), gridframe, TRUE, TRUE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
 
-  gtk_container_add (GTK_CONTAINER (app), vbox);
+  gtk_container_add (GTK_CONTAINER (window), vbox);
 
   gtk_widget_set_size_request (GTK_WIDGET (game_area),
                               MINIMUM_TILE_WIDTH * GAME_WIDTH,
@@ -267,10 +267,10 @@ main (int argc, char *argv[])
 
   /* Set the window position if it was set by the session manager */
   if (session_xpos >= 0 && session_ypos >= 0) {
-    gtk_window_move (GTK_WINDOW (app), session_xpos, session_ypos);
+    gtk_window_move (GTK_WINDOW (window), session_xpos, session_ypos);
   }
 
-  gtk_widget_show_all (app);
+  gtk_widget_show_all (window);
 
   if (!load_game_configs ()) {
     /* Oops, no configs, we probably haven't been installed properly. */
@@ -289,7 +289,7 @@ main (int argc, char *argv[])
 
   if (!load_game_graphics ()) {
     /* Oops, no graphics, we probably haven't been installed properly. */
-    errordialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (app),
+    errordialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (window),
                                          GTK_DIALOG_MODAL,
                                          GTK_MESSAGE_ERROR,
                                          GTK_BUTTONS_OK,
diff --git a/src/gnobots.h b/src/gnobots.h
index 0b1e6f2..e5f46b6 100644
--- a/src/gnobots.h
+++ b/src/gnobots.h
@@ -8,7 +8,7 @@
 /**********************************************************************/
 /* Exported Variables                                                 */
 /**********************************************************************/
-extern GtkWidget *app;
+extern GtkWidget *window;
 extern GtkWidget *game_area;
 extern GamesScores *highscores;
 extern GSettings *settings;
diff --git a/src/menu.c b/src/menu.c
index 290651f..87f6148 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -231,7 +231,7 @@ help_cb (GtkAction * action, gpointer data)
 {
   GError *error = NULL;
 
-  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (app)), "help:gnome-robots", gtk_get_current_event_time 
(), &error);
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), "help:gnome-robots", gtk_get_current_event_time 
(), &error);
   if (error)
     g_warning ("Failed to show help: %s", error->message);
   g_clear_error (&error);
@@ -258,7 +258,7 @@ about_cb (GtkAction * action, gpointer data)
   const gchar *documenters[] =
     { "Aruna Sankaranarayanan", NULL };
 
-  gtk_show_about_dialog (GTK_WINDOW (app),
+  gtk_show_about_dialog (GTK_WINDOW (window),
                         "name", _("Robots"),
                         "version", VERSION,
                         "copyright", "Copyright © 1998–2008 Mark Rae",
@@ -311,10 +311,10 @@ create_game_menus (GtkUIManager * ui_manager)
 
   gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
   gtk_action_group_add_actions (action_group, action_entry,
-                               G_N_ELEMENTS (action_entry), app);
+                               G_N_ELEMENTS (action_entry), window);
   gtk_action_group_add_toggle_actions (action_group, toggle_action_entry,
                                       G_N_ELEMENTS (toggle_action_entry),
-                                      app);
+                                      window);
 
   gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
   gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, NULL);
@@ -325,7 +325,7 @@ create_game_menus (GtkUIManager * ui_manager)
   wait_action = gtk_action_group_get_action (action_group, "Wait");
   toolbar_toggle_action =
     gtk_action_group_get_action (action_group, "ShowToolbar");
-  fullscreen_action = GTK_ACTION (games_fullscreen_action_new ("Fullscreen", GTK_WINDOW (app)));
+  fullscreen_action = GTK_ACTION (games_fullscreen_action_new ("Fullscreen", GTK_WINDOW (window)));
   gtk_action_group_add_action_with_accel (action_group, fullscreen_action, NULL);
 
   return;
diff --git a/src/properties.c b/src/properties.c
index 90adca8..81450e5 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -393,7 +393,7 @@ show_properties_dialog (void)
     return;
 
   propbox = gtk_dialog_new_with_buttons (_("Preferences"),
-                                        GTK_WINDOW (app),
+                                        GTK_WINDOW (window),
                                         GTK_DIALOG_USE_HEADER_BAR,
                                         NULL);
   gtk_container_set_border_width (GTK_CONTAINER (propbox), 5);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]