[gnome-robots/arnaudb/wip/gtk4: 1/33] Do not use tabs.



commit d3c161c0bc9346b7f377c6b819463a99f20911fe
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat May 23 20:18:14 2020 +0200

    Do not use tabs.
    
    And other code style things.

 src/cursor-down-left.h  |   4 +-
 src/cursor-down-right.h |   4 +-
 src/cursor-down.h       |   4 +-
 src/cursor-hold.h       |   4 +-
 src/cursor-left.h       |   4 +-
 src/cursor-right.h      |   4 +-
 src/cursor-up-left.h    |   4 +-
 src/cursor-up-right.h   |   4 +-
 src/cursor-up.h         |   4 +-
 src/find-file.c         |   2 +-
 src/find-file.h         |   4 +-
 src/game.c              |  15 +++---
 src/gameconfig.c        |   6 +--
 src/games-controls.c    |  14 +++---
 src/games-controls.h    |   2 +-
 src/games-file-list.c   |  99 +++++++++++++++++++--------------------
 src/games-file-list.h   |   2 +-
 src/games-preimage.c    |   6 +--
 src/gnome-robots.c      | 122 ++++++++++++++++++++++--------------------------
 src/graphics.c          |  22 ++++-----
 src/meson.build         |   2 +-
 src/properties.c        |  74 ++++++++++++++---------------
 22 files changed, 195 insertions(+), 211 deletions(-)
---
diff --git a/src/cursor-down-left.h b/src/cursor-down-left.h
index c3a7907..3ff1bc8 100644
--- a/src/cursor-down-left.h
+++ b/src/cursor-down-left.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_down_left)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_down_left[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_down_left[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_down_left[] = 
+static const guint8 cursor_down_left[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-down-right.h b/src/cursor-down-right.h
index cb8cae4..837e1c8 100644
--- a/src/cursor-down-right.h
+++ b/src/cursor-down-right.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_down_right)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_down_right[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_down_right[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_down_right[] = 
+static const guint8 cursor_down_right[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-down.h b/src/cursor-down.h
index a262d70..9f028cd 100644
--- a/src/cursor-down.h
+++ b/src/cursor-down.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_down)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_down[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_down[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_down[] = 
+static const guint8 cursor_down[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-hold.h b/src/cursor-hold.h
index 671ed26..103b259 100644
--- a/src/cursor-hold.h
+++ b/src/cursor-hold.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_hold)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_hold[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_hold[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_hold[] = 
+static const guint8 cursor_hold[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-left.h b/src/cursor-left.h
index 4d111ed..29b52b2 100644
--- a/src/cursor-left.h
+++ b/src/cursor-left.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_left)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_left[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_left[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_left[] = 
+static const guint8 cursor_left[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-right.h b/src/cursor-right.h
index 4683d97..4b8c0d8 100644
--- a/src/cursor-right.h
+++ b/src/cursor-right.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_right)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_right[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_right[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_right[] = 
+static const guint8 cursor_right[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-up-left.h b/src/cursor-up-left.h
index 7e65492..4516606 100644
--- a/src/cursor-up-left.h
+++ b/src/cursor-up-left.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_up_left)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_up_left[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_up_left[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_up_left[] = 
+static const guint8 cursor_up_left[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-up-right.h b/src/cursor-up-right.h
index dc6b833..354e167 100644
--- a/src/cursor-up-right.h
+++ b/src/cursor-up-right.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_up_right)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_up_right[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_up_right[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_up_right[] = 
+static const guint8 cursor_up_right[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/cursor-up.h b/src/cursor-up.h
index fb4e315..12ec59c 100644
--- a/src/cursor-up.h
+++ b/src/cursor-up.h
@@ -4,9 +4,9 @@
 #pragma align 4 (cursor_up)
 #endif
 #ifdef __GNUC__
-static const guint8 cursor_up[] __attribute__ ((__aligned__ (4))) = 
+static const guint8 cursor_up[] __attribute__ ((__aligned__ (4))) =
 #else
-static const guint8 cursor_up[] = 
+static const guint8 cursor_up[] =
 #endif
 { ""
   /* Pixbuf magic (0x47646b50) */
diff --git a/src/find-file.c b/src/find-file.c
index 259e6b3..eda3c3b 100644
--- a/src/find-file.c
+++ b/src/find-file.c
@@ -3,7 +3,7 @@
    Copyright 2006 Callum McKenzie
 
    This library is free software; you can redistribute it and'or modify
-   it under the terms of the GNU Library General Public License as published 
+   it under the terms of the GNU Library General Public License as published
    by the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
diff --git a/src/find-file.h b/src/find-file.h
index 4889c5a..723aa66 100644
--- a/src/find-file.h
+++ b/src/find-file.h
@@ -3,7 +3,7 @@
    Copyright 2006 Callum McKenzie
 
    This library is free software; you can redistribute it and'or modify
-   it under the terms of the GNU Library General Public License as published 
+   it under the terms of the GNU Library General Public License as published
    by the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
@@ -25,7 +25,7 @@
 
 G_BEGIN_DECLS
   gchar * games_find_similar_file (const gchar * target,
-                                  const gchar * directory);
+                                   const gchar * directory);
 
 G_END_DECLS
 #endif
diff --git a/src/game.c b/src/game.c
index b3ba9d2..ab30ffe 100644
--- a/src/game.c
+++ b/src/game.c
@@ -164,7 +164,8 @@ log_score (gint sc)
                        game_config_filename (current_game_config ()));
   } else {
     sbuf =
-      g_strdup_printf ("%s", game_config_filename (current_game_config ()));
+      g_strdup_printf ("%s",
+                       game_config_filename (current_game_config ()));
   }
 
   if (sc != 0) {
@@ -272,7 +273,7 @@ clear_arena (void)
  * load_temp_arena
  *
  * Description:
- * Set up the temporary arena for processing speculative moves. 
+ * Set up the temporary arena for processing speculative moves.
  *
  **/
 static void
@@ -339,8 +340,7 @@ generate_level (void)
   if (num_robots1 > MAX_ROBOTS) {
     current_level = 0;
     num_robots1 = game_config ()->initial_type1;
-    message_box (_
-                 ("Congratulations, You Have Defeated the Robots!! \nBut Can You do it Again?"));
+    message_box (_("Congratulations, You Have Defeated the Robots!! \nBut Can You do it Again?"));
     play_sound (SOUND_VICTORY);
   }
 
@@ -355,8 +355,7 @@ generate_level (void)
     current_level = 0;
     num_robots1 = game_config ()->initial_type1;
     num_robots2 = game_config ()->initial_type2;
-    message_box (_
-                 ("Congratulations, You Have Defeated the Robots!! \nBut Can You do it Again?"));
+    message_box (_("Congratulations, You Have Defeated the Robots!! \nBut Can You do it Again?"));
     play_sound (SOUND_VICTORY);
   }
 
@@ -554,7 +553,7 @@ init_game (void)
 {
   create_game_timer ();
 
-  g_signal_connect (GTK_WIDGET (window), "key_press_event",
+  g_signal_connect (GTK_WIDGET (window), "key-press-event",
                     G_CALLBACK (keyboard_cb), 0);
 
   start_new_game ();
@@ -1296,7 +1295,7 @@ get_dir (int ix, int iy, int *odx, int *ody)
 
   angle = atan2 (dy, dx);
 
-  /* Note the adjustment we have to make (+9, not +8) because atan2's idea 
+  /* Note the adjustment we have to make (+9, not +8) because atan2's idea
    * of octants and the ones we want are shifted by PI/8. */
   octant = (((int) floor (8.0 * angle / M_PI) + 9) / 2) % 8;
 
diff --git a/src/gameconfig.c b/src/gameconfig.c
index ced46a9..afcbf9a 100644
--- a/src/gameconfig.c
+++ b/src/gameconfig.c
@@ -98,9 +98,9 @@ load_config (gchar * fname)
     vptr = NULL;
     while (*bptr) {
       if (*bptr == '=') {
-       *bptr = 0;
-       vptr = ++bptr;
-       break;
+        *bptr = 0;
+        vptr = ++bptr;
+        break;
       }
       bptr++;
     }
diff --git a/src/games-controls.c b/src/games-controls.c
index 1264a77..cac6c48 100644
--- a/src/games-controls.c
+++ b/src/games-controls.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright © 2004 Paolo Borelli
  * Copyright © 2007, 2009 Christian Persch
  *
@@ -200,9 +200,9 @@ games_controls_list_constructor (GType type,
   /* label column */
   label_renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes ("Control",
-                                                    label_renderer,
-                                                    "text", LABEL_COLUMN,
-                                                    NULL);
+                                                     label_renderer,
+                                                     "text", LABEL_COLUMN,
+                                                     NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (priv->view), column);
 
   /* key column */
@@ -217,10 +217,10 @@ games_controls_list_constructor (GType type,
                     G_CALLBACK (accel_cleared_cb), list);
 
   column = gtk_tree_view_column_new_with_attributes ("Key",
-                                                    key_renderer,
+                                                     key_renderer,
                                                      "accel-key", KEYCODE_COLUMN,
                                                      "accel-mods", KEYMODS_COLUMN,
-                                                    NULL);
+                                                     NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (priv->view), column);
 
   gtk_container_add (GTK_CONTAINER (scrolled_window), priv->view);
@@ -331,7 +331,7 @@ games_controls_list_add_controls (GamesControlsList *list,
   va_end (args);
 }
 
-#if 0                          /* possible TODO stuff */
+#if 0             /* possible TODO stuff */
 
 -add a "Reset to default" button which resets each command to the defaut key
   (the default can be obtained with gconf_client_get_default_from_schema)
diff --git a/src/games-controls.h b/src/games-controls.h
index 8c3893a..de4c35d 100644
--- a/src/games-controls.h
+++ b/src/games-controls.h
@@ -1,5 +1,5 @@
 /*
- * games-controls.h: keyboard controls utility functions. 
+ * games-controls.h: keyboard controls utility functions.
  *
  * Copyright © 2004 Paolo Borelli
  *
diff --git a/src/games-file-list.c b/src/games-file-list.c
index 827b0cc..0d2b586 100644
--- a/src/games-file-list.c
+++ b/src/games-file-list.c
@@ -2,7 +2,7 @@
    Copyright © 2003 Callum McKenzie
 
    This library is free software; you can redistribute it and'or modify
-   it under the terms of the GNU Library General Public License as published 
+   it under the terms of the GNU Library General Public License as published
    by the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
@@ -76,13 +76,13 @@ games_file_list_new_internal (const gchar * glob, va_list path)
     dir = g_dir_open (pathelement, 0, NULL);
     if (dir != NULL) {
       while ((filename = g_dir_read_name (dir)) != NULL) {
-       if (g_pattern_match_string (filespec, filename)) {
-         fullname = g_build_filename (pathelement, filename, NULL);
-         if (g_file_test (fullname, G_FILE_TEST_IS_REGULAR)) {
-           list = g_list_append (list, fullname);
-         } else
-           g_free (fullname);
-       }
+        if (g_pattern_match_string (filespec, filename)) {
+          fullname = g_build_filename (pathelement, filename, NULL);
+          if (g_file_test (fullname, G_FILE_TEST_IS_REGULAR)) {
+            list = g_list_append (list, fullname);
+          } else
+            g_free (fullname);
+        }
       }
       g_dir_close (dir);
     }
@@ -95,16 +95,16 @@ games_file_list_new_internal (const gchar * glob, va_list path)
 
 /**
  * games_file_list_new:
- * @glob: A pattern to match files against. See g_pattern_spec_new () for 
+ * @glob: A pattern to match files against. See g_pattern_spec_new () for
  * details.
- * @varargs: A NULL terminated list of strings containing directory names to 
+ * @varargs: A NULL terminated list of strings containing directory names to
  * be searched for files.
- * 
- * This function takes a glob and a NULL terminated list of directories 
- * and constructs a list of all files in the directories that match the glob. 
+ *
+ * This function takes a glob and a NULL terminated list of directories
+ * and constructs a list of all files in the directories that match the glob.
  * Only regular files are returned.
- * 
- * Return value: A pointer to a new GamesFileList containing files 
+ *
+ * Return value: A pointer to a new GamesFileList containing files
  * matching the glob in the path.
  **/
 GamesFileList *
@@ -179,8 +179,7 @@ games_image_suffix_list_init (void)
 
     suffix = suffices;
     while (*suffix) {
-      image_suffix_list =
-       g_slist_append (image_suffix_list, g_strdup_printf (".%s", *suffix));
+      image_suffix_list = g_slist_append (image_suffix_list, g_strdup_printf (".%s", *suffix));
       suffix++;
     }
 
@@ -213,12 +212,12 @@ games_file_list_new_images_single (const gchar * directory)
     suffix = image_suffix_list;
     while (suffix) {
       if (g_str_has_suffix (filename, suffix->data)) {
-       fullname = g_build_filename (directory, filename, NULL);
-       if (g_file_test (fullname, G_FILE_TEST_IS_REGULAR)) {
-         list = g_list_append (list, fullname);
-       } else
-         g_free (fullname);
-       break;
+        fullname = g_build_filename (directory, filename, NULL);
+        if (g_file_test (fullname, G_FILE_TEST_IS_REGULAR)) {
+          list = g_list_append (list, fullname);
+        } else
+          g_free (fullname);
+        break;
       }
       suffix = g_slist_next (suffix);
     }
@@ -231,15 +230,15 @@ games_file_list_new_images_single (const gchar * directory)
 
 /**
  * games_file_list_new_images:
- * @path1: A NULL-terminated list of strings containing directories to be 
+ * @path1: A NULL-terminated list of strings containing directories to be
  * searched.
- * 
+ *
  * A convenience function which constructs a list of filenames which
  * are images that can be loaded via gdk-pixbuf. Whether a file is an
  * image or not is determined by its extension. The list of possible
  * extensions is determined by querying the gdk-pixbuf library the
  * first time this function is called.
- * 
+ *
  * Return value: A new GamesFileList containing the list of image files.
  **/
 GamesFileList *
@@ -257,7 +256,7 @@ games_file_list_new_images (const gchar * path1, ...)
   va_start (paths, path1);
   while ((pathentry = va_arg (paths, gchar *)) != NULL) {
     priv->list = g_list_concat (priv->list,
-                         games_file_list_new_images_single (pathentry));
+                                games_file_list_new_images_single (pathentry));
   }
   va_end (paths);
 
@@ -271,20 +270,20 @@ games_file_list_new_images (const gchar * path1, ...)
  * games_file_list_create_widget:
  * @filelist: The list of files to use.
  * @selection: The name to select as the default. NULL means no default.
- * @flags: A set of flags to specify how the names are displayed. 
- * 
- * Create a combo box with the given list of strings as the entries. If 
- * selection is non-NULL the matching file name is selected by default. 
- * Otherwise nothing is selected. The flags affect how the names are 
- * displayed. The valid flags are GAMES_FILE_LIST_REMOVE_EXTENSION, which 
+ * @flags: A set of flags to specify how the names are displayed.
+ *
+ * Create a combo box with the given list of strings as the entries. If
+ * selection is non-NULL the matching file name is selected by default.
+ * Otherwise nothing is selected. The flags affect how the names are
+ * displayed. The valid flags are GAMES_FILE_LIST_REMOVE_EXTENSION, which
  * removes extensions, and GAMES_FILE_LIST_REPLACE_UNDERSCORES with replaces
  * underscores with spaces.
- * 
+ *
  * Return value: (transfer full): A widget with the list of names.
  **/
 GtkWidget *
 games_file_list_create_widget (GamesFileList * filelist,
-                              const gchar * selection, guint flags)
+                               const gchar * selection, guint flags)
 {
   GamesFileListPrivate *priv = games_file_list_get_instance_private (filelist);
   gint itemno;
@@ -308,14 +307,14 @@ games_file_list_create_widget (GamesFileList * filelist,
     if (flags & GAMES_FILE_LIST_REMOVE_EXTENSION) {
       s = g_strrstr (visible, ".");
       if (s)
-       *s = '\0';
+        *s = '\0';
     }
     if (flags & GAMES_FILE_LIST_REPLACE_UNDERSCORES) {
       s = visible;
       while (*s) {
-       if (*s == '_')
-         *s = ' ';
-       s++;
+        if (*s == '_')
+          *s = ' ';
+        s++;
       }
     }
 
@@ -339,7 +338,7 @@ games_file_list_create_widget (GamesFileList * filelist,
 /**
  * games_file_list_length:
  * @filelist: The list of files to use.
- * 
+ *
  * Get the number of elements in the file list.
  **/
 gsize
@@ -353,12 +352,12 @@ games_file_list_length (GamesFileList * filelist)
 /**
  * games_file_list_for_each:
  * @filelist: The file list to iterate over.
- * @function: (scope call): The function to call on each item. It gets called with two 
- * arguments: the file name and the pointer supplied to this function in 
+ * @function: (scope call): The function to call on each item. It gets called with two
+ * arguments: the file name and the pointer supplied to this function in
  * the userdata argument.
  * @userdata: (closure): An arbitrary pointer that gets passed as the second argument
  * to each call of function.
- * 
+ *
  * Apply a function to each file name in the list.
  **/
 void
@@ -373,12 +372,12 @@ games_file_list_for_each (GamesFileList * filelist, GFunc function,
 /**
  * games_file_list_find:
  * @filelist: The file list to iterate over.
- * @function: (scope call): The function to call on each item. It gets called with two 
- * arguments: the file name and the pointer supplied to this function in 
+ * @function: (scope call): The function to call on each item. It gets called with two
+ * arguments: the file name and the pointer supplied to this function in
  * the userdata argument.
  * @userdata: (closure): An arbitrary pointer that gets passed as the second argument
  * to each call of function.
- * 
+ *
  * Find a file name by iterating through a list until the given function
  * returns 0.
  *
@@ -387,7 +386,7 @@ games_file_list_for_each (GamesFileList * filelist, GFunc function,
  **/
 gchar *
 games_file_list_find (GamesFileList * filelist, GCompareFunc function,
-                     gpointer userdata)
+                      gpointer userdata)
 {
   GamesFileListPrivate *priv = games_file_list_get_instance_private (filelist);
   GList *element;
@@ -401,10 +400,10 @@ games_file_list_find (GamesFileList * filelist, GCompareFunc function,
  * games_file_list_get_nth:
  * @filelist: The list of file names to select from.
  * @n: The 0-based index into the list.
- * 
+ *
  * Obtain the (n+1)th file name from the list.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 /* Return the nth filename in the list. */
 const gchar *
diff --git a/src/games-file-list.h b/src/games-file-list.h
index ac51180..ebe9baf 100644
--- a/src/games-file-list.h
+++ b/src/games-file-list.h
@@ -2,7 +2,7 @@
    Copyright 2003 Callum McKenzie
 
    This library is free software; you can redistribute it and'or modify
-   it under the terms of the GNU Library General Public License as published 
+   it under the terms of the GNU Library General Public License as published
    by the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
diff --git a/src/games-preimage.c b/src/games-preimage.c
index 65e86b2..966e4a0 100644
--- a/src/games-preimage.c
+++ b/src/games-preimage.c
@@ -1,12 +1,12 @@
 /*
    Copyright © 2004 Richard Hoelscher
    Copyright © 2007 Christian Persch
-   
+
    This library is free software; you can redistribute it and'or modify
-   it under the terms of the GNU Library General Public License as published 
+   it under the terms of the GNU Library General Public License as published
    by the Free Software Foundation; either version 3, or (at your option)
    any later version.
-   
+
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index 57c1e0a..798cd6d 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -88,36 +88,36 @@ static void wait_cb (GSimpleAction *action, GVariant *parameter, gpointer user_d
 /**********************************************************************/
 
 static const GActionEntry app_entries[] = {
-  { "new-game", new_game_cb, NULL, NULL, NULL },
-  { "preferences", preferences_cb, NULL, NULL, NULL },
-  { "scores", scores_cb, NULL, NULL, NULL },
-  { "help", help_cb, NULL, NULL, NULL },
-  { "about", about_cb, NULL, NULL, NULL },
-  { "quit", quit_cb, NULL, NULL, NULL },
+  { "new-game",         new_game_cb,        NULL, NULL, NULL },
+  { "preferences",      preferences_cb,     NULL, NULL, NULL },
+  { "scores",           scores_cb,          NULL, NULL, NULL },
+  { "help",             help_cb,            NULL, NULL, NULL },
+  { "about",            about_cb,           NULL, NULL, NULL },
+  { "quit",             quit_cb,            NULL, NULL, NULL },
 };
 
 static const GActionEntry win_entries[] = {
-  { "random-teleport", random_teleport_cb, NULL, NULL, NULL },
-  { "safe-teleport", safe_teleport_cb, NULL, NULL, NULL },
-  { "wait", wait_cb, NULL, NULL, NULL },
+  { "random-teleport",  random_teleport_cb, NULL, NULL, NULL },
+  { "safe-teleport",    safe_teleport_cb,   NULL, NULL, NULL },
+  { "wait",             wait_cb,            NULL, NULL, NULL },
 };
 
 static const key_value scorecats[] = {
-       {"classic_robots", N_("Classic robots")},
-       {"classic_robots-safe", N_("Classic robots with safe moves")},
-       {"classic_robots-super-safe", N_("Classic robots with super-safe moves")},
-       {"nightmare", N_("Nightmare")},
-       {"nightmare-safe", N_("Nightmare with safe moves")},
-       {"nightmare-super-safe", N_("Nightmare with super-safe moves")},
-       {"robots2", N_("Robots2")},
-       {"robots2-safe", N_("Robots2 with safe moves")},
-       {"robots2-super-safe", N_("Robots2 with super-safe moves")},
-       {"robots2_easy", N_("Robots2 easy")},
-       {"robots2_easy-safe", N_("Robots2 easy with safe moves")},
-       {"robots2_easy-super-safe", N_("Robots2 easy with super-safe moves")},
-       {"robots_with_safe_teleport", N_("Robots with safe teleport")},
-       {"robots_with_safe_teleport-safe", N_("Robots with safe teleport with safe moves")},
-       {"robots_with_safe_teleport-super-safe", N_("Robots with safe teleport with super-safe moves")}
+  { "classic_robots",                       N_("Classic robots")},
+  { "classic_robots-safe",                  N_("Classic robots with safe moves")},
+  { "classic_robots-super-safe",            N_("Classic robots with super-safe moves")},
+  { "nightmare",                            N_("Nightmare")},
+  { "nightmare-safe",                       N_("Nightmare with safe moves")},
+  { "nightmare-super-safe",                 N_("Nightmare with super-safe moves")},
+  { "robots2",                              N_("Robots2")},
+  { "robots2-safe",                         N_("Robots2 with safe moves")},
+  { "robots2-super-safe",                   N_("Robots2 with super-safe moves")},
+  { "robots2_easy",                         N_("Robots2 easy")},
+  { "robots2_easy-safe",                    N_("Robots2 easy with safe moves")},
+  { "robots2_easy-super-safe",              N_("Robots2 easy with super-safe moves")},
+  { "robots_with_safe_teleport",            N_("Robots with safe teleport")},
+  { "robots_with_safe_teleport-safe",       N_("Robots with safe teleport with safe moves")},
+  { "robots_with_safe_teleport-super-safe", N_("Robots with safe teleport with super-safe moves")}
 };
 static gint no_categories = 15;
 
@@ -216,23 +216,22 @@ about_cb (GSimpleAction *action, GVariant *parameter, gpointer user_data)
 
   const gchar *artists[] = { "Kirstie Opstad <K Opstad ed ac uk>", "Rasoul M.P. Aghdam (player death 
sound)", NULL };
 
-  const gchar *documenters[] =
-    { "Aruna Sankaranarayanan", NULL };
+  const gchar *documenters[] = { "Aruna Sankaranarayanan", NULL };
 
   gtk_show_about_dialog (GTK_WINDOW (window),
-                        "name", _("Robots"),
-                        "version", VERSION,
-                        "copyright", "Copyright © 1998–2008 Mark Rae\nCopyright © 2014–2016 Michael 
Catanzaro",
-                        "license-type", GTK_LICENSE_GPL_3_0,
-                        "comments", _("Based on classic BSD Robots"),
-                        "authors", authors,
-                        "artists", artists,
-                        "documenters", documenters,
-                        "translator-credits", _("translator-credits"),
-                        "logo-icon-name", "org.gnome.Robots",
-                        "website",
-                        "https://wiki.gnome.org/Apps/Robots";,
-                        NULL);
+                         "name", _("Robots"),
+                         "version", VERSION,
+                         "copyright", "Copyright © 1998–2008 Mark Rae\nCopyright © 2014–2016 Michael 
Catanzaro",
+                         "license-type", GTK_LICENSE_GPL_3_0,
+                         "comments", _("Based on classic BSD Robots"),
+                         "authors", authors,
+                         "artists", artists,
+                         "documenters", documenters,
+                         "translator-credits", _("translator-credits"),
+                         "logo-icon-name", "org.gnome.Robots",
+                         "website",
+                         "https://wiki.gnome.org/Apps/Robots";,
+                         NULL);
 }
 
 static void
@@ -385,18 +384,12 @@ activate (GtkApplication *app, gpointer user_data)
   make_cursors ();
 
   game_area = gtk_drawing_area_new ();
-  gtk_widget_add_events (game_area, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
-                        GDK_POINTER_MOTION_MASK);
-  g_signal_connect (G_OBJECT (game_area), "button-press-event",
-                   G_CALLBACK (mouse_cb), NULL);
-  g_signal_connect (G_OBJECT (game_area), "motion-notify-event",
-                   G_CALLBACK (move_cb), NULL);
-  g_signal_connect (G_OBJECT (game_area), "configure-event",
-                   G_CALLBACK (resize_cb), NULL);
-  g_signal_connect (G_OBJECT (game_area), "draw",
-                   G_CALLBACK (draw_cb), NULL);
-  g_signal_connect (G_OBJECT (game_area), "destroy",
-                    G_CALLBACK (gtk_widget_destroyed), &game_area);
+  gtk_widget_add_events (game_area, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | 
GDK_POINTER_MOTION_MASK);
+  g_signal_connect (G_OBJECT (game_area), "button-press-event",     G_CALLBACK (mouse_cb),  NULL);
+  g_signal_connect (G_OBJECT (game_area), "motion-notify-event",    G_CALLBACK (move_cb),   NULL);
+  g_signal_connect (G_OBJECT (game_area), "configure-event",        G_CALLBACK (resize_cb), NULL);
+  g_signal_connect (G_OBJECT (game_area), "draw",                   G_CALLBACK (draw_cb),   NULL);
+  g_signal_connect (G_OBJECT (game_area), "destroy",                G_CALLBACK (gtk_widget_destroyed), 
&game_area);
 
   gridframe = GTK_WIDGET (games_grid_frame_new (GAME_WIDTH, GAME_HEIGHT));
   gtk_container_add (GTK_CONTAINER (gridframe), game_area);
@@ -444,8 +437,8 @@ activate (GtkApplication *app, gpointer user_data)
   gtk_container_add (GTK_CONTAINER (window), vbox);
 
   gtk_widget_set_size_request (GTK_WIDGET (game_area),
-                              MINIMUM_TILE_WIDTH * GAME_WIDTH,
-                              MINIMUM_TILE_HEIGHT * GAME_HEIGHT);
+                               MINIMUM_TILE_WIDTH * GAME_WIDTH,
+                               MINIMUM_TILE_HEIGHT * GAME_HEIGHT);
 
   importer = games_scores_directory_importer_new ();
   highscores = games_scores_context_new_with_importer ("gnome-robots",
@@ -463,11 +456,10 @@ activate (GtkApplication *app, gpointer user_data)
   if (!load_game_configs ()) {
     /* Oops, no configs, we probably haven't been installed properly. */
     errordialog = gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR,
-                                         GTK_BUTTONS_OK,
-                                         "<b>%s</b>\n\n%s",
-                                         _("No game data could be found."),
-                                         _
-                                         ("The program Robots was unable to find any valid game 
configuration files. Please check that the program is installed correctly."));
+                                                      GTK_BUTTONS_OK,
+                                                      "<b>%s</b>\n\n%s",
+                                                      _("No game data could be found."),
+                                                      _("The program Robots was unable to find any valid 
game configuration files. Please check that the program is installed correctly."));
     gtk_window_set_resizable (GTK_WINDOW (errordialog), FALSE);
 
     gtk_dialog_run (GTK_DIALOG (errordialog));
@@ -479,14 +471,12 @@ activate (GtkApplication *app, gpointer user_data)
   if (!load_game_graphics ()) {
     /* Oops, no graphics, we probably haven't been installed properly. */
     errordialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (window),
-                                         GTK_DIALOG_MODAL,
-                                         GTK_MESSAGE_ERROR,
-                                         GTK_BUTTONS_OK,
-                                         "<b>%s</b>\n\n%s",
-                                         _
-                                         ("Some graphics files are missing or corrupt."),
-                                         _
-                                         ("The program Robots was unable to load all the necessary graphics 
files. Please check that the program is installed correctly."));
+                                                      GTK_DIALOG_MODAL,
+                                                      GTK_MESSAGE_ERROR,
+                                                      GTK_BUTTONS_OK,
+                                                      "<b>%s</b>\n\n%s",
+                                                      _("Some graphics files are missing or corrupt."),
+                                                      _("The program Robots was unable to load all the 
necessary graphics files. Please check that the program is installed correctly."));
     gtk_dialog_run (GTK_DIALOG (errordialog));
     exit (1);
   }
diff --git a/src/graphics.c b/src/graphics.c
index b35b0d6..fcbd2ab 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -334,7 +334,7 @@ draw_tile_pixmap (gint tileno, gint x, gint y, cairo_t * cr)
 
   x *= tile_width;
   y *= tile_height;
-  
+
   cairo_rectangle (cr, x, y, tile_width, tile_height);
   cairo_fill (cr);
 
@@ -353,8 +353,8 @@ draw_tile_pixmap (gint tileno, gint x, gint y, cairo_t * cr)
 
 /**
  * draw_object
- * @x: x position 
- * @y: y position 
+ * @x: x position
+ * @y: y position
  * @type: object type
  * @cr: context to draw on
  *
@@ -504,8 +504,8 @@ draw_bubble (cairo_t * cr)
 
 /**
  * add_bubble
- * @x: x position 
- * @y: y position 
+ * @x: x position
+ * @y: y position
  *
  * Description:
  * adds a bubble at @x,@y
@@ -568,8 +568,8 @@ remove_splat_bubble (void)
 
 /**
  * add_yahoo_bubble
- * @x: x position 
- * @y: y position 
+ * @x: x position
+ * @y: y position
  *
  * Description:
  * adds and "Yahoo" bubble at @x,@y
@@ -583,8 +583,8 @@ add_yahoo_bubble (gint x, gint y)
 
 /**
  * add_aieee_bubble
- * @x: x position 
- * @y: y position 
+ * @x: x position
+ * @y: y position
  *
  * Description:
  * adds and "Aieee" bubble at @x,@y
@@ -597,8 +597,8 @@ add_aieee_bubble (gint x, gint y)
 
 /**
  * add_splat_bubble
- * @x: x position 
- * @y: y position 
+ * @x: x position
+ * @y: y position
  *
  * Description:
  * adds a "Splat" speech bubble at @x,@y
diff --git a/src/meson.build b/src/meson.build
index c26cefd..0675107 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -13,7 +13,7 @@ sources = files(
     'sound.c'
 )
 resources = gnome.compile_resources(
-    'resources', 
+    'resources',
     '@0  gresource xml'.format(meson.project_name()),
     source_dir: '../'
 )
diff --git a/src/properties.c b/src/properties.c
index 38402fa..d389c5e 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -339,16 +339,16 @@ make_theme_menu (void)
    * getting tid of the bubble pixmaps. */
 
   return games_file_list_create_widget (theme_list,
-                                       properties.themename,
-                                       GAMES_FILE_LIST_REMOVE_EXTENSION |
-                                       GAMES_FILE_LIST_REPLACE_UNDERSCORES);
+                                        properties.themename,
+                                        GAMES_FILE_LIST_REMOVE_EXTENSION |
+                                        GAMES_FILE_LIST_REPLACE_UNDERSCORES);
 }
 
 static void
 bg_color_callback (GtkWidget * widget, gpointer data)
 {
   gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (widget),
-                             &properties.bgcolour);
+                              &properties.bgcolour);
   set_background_color (properties.bgcolour);
   clear_game_area ();
   conf_set_background_color (&properties.bgcolour);
@@ -389,15 +389,15 @@ show_properties_dialog (void)
     return;
 
   propbox = gtk_dialog_new_with_buttons (_("Preferences"),
-                                        GTK_WINDOW (window),
-                                        GTK_DIALOG_USE_HEADER_BAR | GTK_DIALOG_MODAL,
-                                        NULL,
-                                        NULL);
+                                         GTK_WINDOW (window),
+                                         GTK_DIALOG_USE_HEADER_BAR | GTK_DIALOG_MODAL,
+                                         NULL,
+                                         NULL);
   gtk_container_set_border_width (GTK_CONTAINER (propbox), 5);
   gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (propbox))), 2);
   /* Set up notebook and add it to hbox of the gtk_dialog */
   g_signal_connect (G_OBJECT (propbox), "destroy",
-                   G_CALLBACK (gtk_widget_destroyed), &propbox);
+                    G_CALLBACK (gtk_widget_destroyed), &propbox);
 
   notebook = gtk_notebook_new ();
   gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
@@ -421,11 +421,11 @@ show_properties_dialog (void)
   gtk_grid_attach (GTK_GRID (grid), typemenu, 1, 0, 1, 1);
 
   g_signal_connect (G_OBJECT (typemenu), "changed",
-                   G_CALLBACK (type_selection), NULL);
+                    G_CALLBACK (type_selection), NULL);
 
   chkbox = gtk_check_button_new_with_mnemonic (_("_Use safe moves"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbox),
-                               properties.safe_moves);
+                                properties.safe_moves);
   gtk_grid_attach (GTK_GRID (grid), chkbox, 0, 1, 2, 1);
   gtk_widget_set_tooltip_text (chkbox,
                                _("Prevent accidental moves that result in getting killed."));
@@ -433,21 +433,21 @@ show_properties_dialog (void)
 
   chkbox = gtk_check_button_new_with_mnemonic (_("U_se super safe moves"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbox),
-                               properties.super_safe_moves);
+                                properties.super_safe_moves);
   g_signal_connect (G_OBJECT (chkbox), "clicked",
-                   (GCallback) super_safe_cb, NULL);
+                    (GCallback) super_safe_cb, NULL);
   gtk_grid_attach (GTK_GRID (grid), chkbox, 0, 2, 2, 1);
   gtk_widget_set_tooltip_text (chkbox,
                                _("Prevents all moves that result in getting killed."));
   gtk_widget_set_sensitive (chkbox, properties.safe_moves);
 
   g_signal_connect (G_OBJECT (safe_chkbox), "clicked",
-                   (GCallback) safe_cb, (gpointer) chkbox);
+                    (GCallback) safe_cb, (gpointer) chkbox);
 
   chkbox = gtk_check_button_new_with_mnemonic (_("_Enable sounds"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbox), properties.sound);
   g_signal_connect (G_OBJECT (chkbox), "clicked",
-                   (GCallback) sound_cb, NULL);
+                    (GCallback) sound_cb, NULL);
   gtk_grid_attach (GTK_GRID (grid), chkbox, 0, 3, 2, 1);
   gtk_widget_set_tooltip_text (chkbox,
                                _("Play sounds for events like winning a level and dying."));
@@ -472,7 +472,7 @@ show_properties_dialog (void)
 
   pmapmenu = make_theme_menu ();
   g_signal_connect (G_OBJECT (pmapmenu), "changed",
-                   G_CALLBACK (pmap_selection), NULL);
+                    G_CALLBACK (pmap_selection), NULL);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), pmapmenu);
 
   gtk_grid_attach (GTK_GRID (grid), pmapmenu, 1, 0, 1, 1);
@@ -483,8 +483,8 @@ show_properties_dialog (void)
 
   w = gtk_color_button_new ();
   gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &properties.bgcolour);
-  g_signal_connect (G_OBJECT (w), "color_set",
-                   G_CALLBACK (bg_color_callback), NULL);
+  g_signal_connect (G_OBJECT (w), "color-set",
+                    G_CALLBACK (bg_color_callback), NULL);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
 
   gtk_grid_attach (GTK_GRID (grid), w, 1, 1, 1, 1);
@@ -501,15 +501,15 @@ show_properties_dialog (void)
 
   controls_list = games_controls_list_new (settings);
   games_controls_list_add_controls (GAMES_CONTROLS_LIST (controls_list),
-                                   "key00", _("Key to move NW"), g_settings_get_default_value (settings, 
"key00"),
-                                   "key01", _("Key to move N"), g_settings_get_default_value (settings, 
"key01"),
-                                   "key02", _("Key to move NE"), g_settings_get_default_value (settings, 
"key02"),
-                                   "key03", _("Key to move W"), g_settings_get_default_value (settings, 
"key03"),
-                                   "key04", _("Key to hold"), g_settings_get_default_value (settings, 
"key04"),
-                                   "key05", _("Key to move E"), g_settings_get_default_value (settings, 
"key05"),
-                                   "key06", _("Key to move SW"), g_settings_get_default_value (settings, 
"key06"),
-                                   "key07", _("Key to move S"), g_settings_get_default_value (settings, 
"key07"),
-                                   "key08", _("Key to move SE"), g_settings_get_default_value (settings, 
"key08"),
+                                    "key00", _("Key to move NW"), g_settings_get_default_value (settings, 
"key00"),
+                                    "key01", _("Key to move N"), g_settings_get_default_value (settings, 
"key01"),
+                                    "key02", _("Key to move NE"), g_settings_get_default_value (settings, 
"key02"),
+                                    "key03", _("Key to move W"), g_settings_get_default_value (settings, 
"key03"),
+                                    "key04", _("Key to hold"), g_settings_get_default_value (settings, 
"key04"),
+                                    "key05", _("Key to move E"), g_settings_get_default_value (settings, 
"key05"),
+                                    "key06", _("Key to move SW"), g_settings_get_default_value (settings, 
"key06"),
+                                    "key07", _("Key to move S"), g_settings_get_default_value (settings, 
"key07"),
+                                    "key08", _("Key to move SE"), g_settings_get_default_value (settings, 
"key08"),
                                     NULL);
 
   gtk_box_pack_start (GTK_BOX (vbox), controls_list, TRUE, TRUE, 0);
@@ -520,17 +520,17 @@ show_properties_dialog (void)
 
   dbut = gtk_button_new_with_mnemonic (_("_Restore Defaults"));
   g_signal_connect (G_OBJECT (dbut), "clicked",
-                   G_CALLBACK (defkey_cb), NULL);
+                    G_CALLBACK (defkey_cb), NULL);
   gtk_box_pack_start (GTK_BOX (hbox), dbut, FALSE, FALSE, 0);
 
   label = gtk_label_new_with_mnemonic (_("Keyboard"));
   gtk_notebook_append_page (GTK_NOTEBOOK (notebook), kpage, label);
 
 
-  g_signal_connect (G_OBJECT (propbox), "delete_event",
-                   G_CALLBACK (delete_cb), NULL);
+  g_signal_connect (G_OBJECT (propbox), "delete-event",
+                    G_CALLBACK (delete_cb), NULL);
   g_signal_connect (G_OBJECT (propbox), "response",
-                   G_CALLBACK (apply_cb), NULL);
+                    G_CALLBACK (apply_cb), NULL);
 
   gtk_widget_show_all (propbox);
 }
@@ -573,14 +573,10 @@ load_properties (void)
   }
   g_free (cname);
 
-  properties.safe_moves = g_settings_get_boolean (settings,
-                                                 KEY_SAFE_MOVES);
-  properties.super_safe_moves = g_settings_get_boolean (settings,
-                                                       KEY_SUPER_SAFE_MOVES);
-  properties.sound = g_settings_get_boolean (settings,
-                                             KEY_ENABLE_SOUND);
-  properties.show_toolbar = g_settings_get_boolean (settings,
-                                                    KEY_SHOW_TOOLBAR);
+  properties.safe_moves       = g_settings_get_boolean (settings, KEY_SAFE_MOVES);
+  properties.super_safe_moves = g_settings_get_boolean (settings, KEY_SUPER_SAFE_MOVES);
+  properties.sound            = g_settings_get_boolean (settings, KEY_ENABLE_SOUND);
+  properties.show_toolbar     = g_settings_get_boolean (settings, KEY_SHOW_TOOLBAR);
 
   load_game_graphics ();
   set_game_config (properties.selected_config);



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