[four-in-a-row] Uptade variables and methods scope.



commit 3efbefb4756f691e3ffb0d126fa00a9517c7c6d2
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Aug 24 13:23:38 2019 +0200

    Uptade variables and methods scope.

 src/ai.vala                  |  58 +++----
 src/four-in-a-row.vala       | 355 ++++++++++++++++++++-----------------------
 src/game-board-view.vala     |  51 +++----
 src/game-board.vala          |  71 +++++----
 src/games-controls-list.vala | 122 +++++++--------
 src/prefs-box.vala           |  91 +++++------
 src/prefs.vala               |  69 ++++-----
 src/scorebox.vala            |  53 ++++---
 src/test-ai.vala             |  78 +++++-----
 src/theme.vala               |  15 +-
 src/vapi/config.vapi         |  10 +-
 11 files changed, 480 insertions(+), 493 deletions(-)
---
diff --git a/src/ai.vala b/src/ai.vala
index e38dbf2..ee8c03b 100644
--- a/src/ai.vala
+++ b/src/ai.vala
@@ -17,25 +17,26 @@
  * You should have received a copy of the GNU General Public License
  * along with Four-in-a-row.  If not, see <http://www.gnu.org/licenses/>. */
 
-/* Here NEG_INF is supposed to be the lowest possible int value. int.MIN
-MAX_HEURIST_VALUE is the maximum value that the heuristic functions can return.
-It is returned when AI wins. -1*MAX_HEURIST_VALUE is returned when Human wins
-MAX_HEURIST_VALUE < NEG_INF/plies */
-const int NEG_INF = -100000;
-const int MAX_HEURIST_VALUE = 10000;
-const int BOARD_ROWS = 6;
-const int BOARD_COLUMNS = 7;
-enum Player { NONE, HUMAN, AI; }
-enum Difficulty { EASY, MEDIUM, HARD; }
-
-public int playgame(string moves_until_now)
+private enum Player { NONE, HUMAN, AI; }
+private enum Difficulty { EASY, MEDIUM, HARD; }
+
+private int playgame(string moves_until_now)
 {
-    var t = new DecisionTree();
+    DecisionTree t = new DecisionTree();
     return t.playgame(moves_until_now);
 }
 
-public class DecisionTree
+private class DecisionTree
 {
+    /* Here NEG_INF is supposed to be the lowest possible int value. int.MIN
+    MAX_HEURIST_VALUE is the maximum value that the heuristic functions can return.
+    It is returned when AI wins. -1*MAX_HEURIST_VALUE is returned when Human wins
+    MAX_HEURIST_VALUE < NEG_INF/plies */
+    private const int NEG_INF = -100000;
+    private const int MAX_HEURIST_VALUE = 10000;
+    private const int BOARD_ROWS = 6;
+    private const int BOARD_COLUMNS = 7;
+
     /* to mantain the status of the board, to be used by the heuristic function, the top left cell is [0, 0] 
*/
     private Player[,] board = new Player [BOARD_ROWS, BOARD_COLUMNS];
     /* plies - depth of the DecisionTree */
@@ -48,7 +49,7 @@ public class DecisionTree
     private Difficulty level;
 
     /* Initializes an empty board */
-    public DecisionTree()
+    internal DecisionTree()
     {
         for (int i = 0; i < BOARD_ROWS; i++)
             for (int j = 0; j < BOARD_COLUMNS; j++)
@@ -56,7 +57,7 @@ public class DecisionTree
     }
 
     /* utility function for debugging purposes, prints a snapshot of current status of the board */
-    public void print_board()
+    internal void print_board()
     {
         for (int i = 0; i< BOARD_ROWS; i++)
         {
@@ -136,7 +137,7 @@ public class DecisionTree
                backward_diagonal_win(row, column);
     }
 
-    private bool forward_diagonal_win(int i, int j)
+    private inline bool forward_diagonal_win(int i, int j)
     {
         int count = 0;
 
@@ -146,7 +147,7 @@ public class DecisionTree
         return count >= 4;
     }
 
-    private bool backward_diagonal_win(int i, int j)
+    private inline bool backward_diagonal_win(int i, int j)
     {
         int count = 0;
 
@@ -156,7 +157,7 @@ public class DecisionTree
         return count >= 4;
     }
 
-    private bool horizontal_win(int i, int j)
+    private inline bool horizontal_win(int i, int j)
     {
         int count = 0;
 
@@ -166,7 +167,7 @@ public class DecisionTree
         return count >= 4;
     }
 
-    private bool vertical_win(int i, int j)
+    private inline bool vertical_win(int i, int j)
     {
         int count = 0;
 
@@ -195,7 +196,7 @@ public class DecisionTree
             return false;
 
         /* don't forget AI could make the first move */
-        var player = last_moving_player != Player.AI ? Player.AI : Player.HUMAN;
+        Player player = last_moving_player != Player.AI ? Player.AI : Player.HUMAN;
         board [row, column] = player;
         last_moving_player = player;
 
@@ -216,14 +217,14 @@ public class DecisionTree
     }
 
     /* vstr is the sequence of moves made until now. We update DecisionTree::board to reflect these sequence 
of moves. */
-    public void update_board(string vstr)
+    private void update_board(string vstr)
     {
         next_move_in_column = -1;
 
         /* AI will make the first move, nothing to add to the board */
         if (vstr.length == 2) return;
 
-        var move = vstr.length % 2 == 0 ? Player.AI : Player.HUMAN;
+        Player move = vstr.length % 2 == 0 ? Player.AI : Player.HUMAN;
 
         for (int i = 1; i < vstr.length - 1; i++)
         {
@@ -270,7 +271,7 @@ public class DecisionTree
     }
 
     /* returns the column number in which the next move has to be made. Returns -1 if the board is full. */
-    public int playgame(string vstr)
+    internal int playgame(string vstr)
     {
         /* set the Difficulty level */
         set_level(vstr);
@@ -320,8 +321,8 @@ public class DecisionTree
 
     private int heurist_hard()
     {
-        var count = count_3_in_a_row(Player.AI) - count_3_in_a_row(Player.HUMAN);
-        return count == 0 ? Random.int_range(1, 49) : count * 100;
+        int count = count_3_in_a_row(Player.AI) - count_3_in_a_row(Player.HUMAN);
+        return count == 0 ? (int) Random.int_range(1, 49) : count * 100;
     }
 
     /* Count the number of threes in a row for Player P. It counts all those 3 which have an empty cell in 
the vicinity to make it
@@ -357,7 +358,7 @@ public class DecisionTree
     }
 
     /* checks if all adjacent cells to board [i, j] are empty */
-    private bool all_adjacent_empty(int i, int j)
+    private inline bool all_adjacent_empty(int i, int j)
     {
         for (int k = -1 ; k <= 1; k++)
         {
@@ -394,7 +395,7 @@ public class DecisionTree
     }
 
     /* utility function for testing purposes */
-    public int playandcheck(string vstr)
+    internal int playandcheck(string vstr)
     {
         set_level(vstr);
         update_board(vstr);
@@ -412,4 +413,3 @@ public class DecisionTree
         return next_move_in_column + 1;
     }
 }
-
diff --git a/src/four-in-a-row.vala b/src/four-in-a-row.vala
index b38cb36..87e4c57 100644
--- a/src/four-in-a-row.vala
+++ b/src/four-in-a-row.vala
@@ -19,52 +19,85 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-const int SIZE_VSTR = 53;
-const int SPEED_BLINK = 150;
-const int SPEED_MOVE = 35;
-const int SPEED_DROP = 20;
-const char vlevel[] = {'0','a','b','c','\0'};
-const int DEFAULT_WIDTH = 495;
-const int DEFAULT_HEIGHT = 435;
-const string APPNAME_LONG = "Four-in-a-row";
-
-class FourInARow : Gtk.Application {
-    SimpleAction hint_action;
-    SimpleAction undo_action;
-    SimpleAction new_game_action;
-    public bool gameover;
-    public bool player_active;
-    PlayerID player;
-    PlayerID winner;
-    public PlayerID who_starts;
-    PrefsBox? prefsbox = null;
-    Scorebox scorebox;
-    GameBoardView game_board_view;
-    Board game_board;
-    Gtk.ApplicationWindow window;
+private const int SIZE_VSTR = 53;
+private const int SPEED_BLINK = 150;
+private const int SPEED_MOVE = 35;
+private const int SPEED_DROP = 20;
+private const char vlevel[] = {'0','a','b','c','\0'};
+private const int DEFAULT_WIDTH = 495;
+private const int DEFAULT_HEIGHT = 435;
+private const string APPNAME_LONG = "Four-in-a-row";
+
+private class FourInARow : Gtk.Application {
+    private static int main(string[] argv) {
+        Intl.setlocale();
+
+        var application = new FourInARow();
+
+        Intl.bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+        Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+        Intl.textdomain(GETTEXT_PACKAGE);
+
+        var context = new OptionContext();
+        context.add_group(Gtk.get_option_group(true));
+        try {
+            context.parse(ref argv);
+        } catch (Error error) {
+            print("%s", error.message);
+            return 1;
+        }
+
+        Environment.set_application_name(_(APPNAME_LONG));
+
+        var app_retval = application.run(argv);
+
+        return app_retval;
+    }
+
+    private enum AnimID {
+        NONE,
+        MOVE,
+        DROP,
+        BLINK,
+        HINT
+    }
+
+    private SimpleAction hint_action;
+    private SimpleAction undo_action;
+    private SimpleAction new_game_action;
+    private bool gameover;
+    private bool player_active;
+    private PlayerID player;
+    private PlayerID winner;
+    internal PlayerID who_starts;
+    private PrefsBox? prefsbox = null;
+    private Scorebox scorebox;
+    private GameBoardView game_board_view;
+    private Board game_board;
+    private Gtk.ApplicationWindow window;
     /**
      * score:
      *
      * The scores for the current instance (Player 1, Player 2, Draw)
      */
-    public int score[3];
-    static AnimID anim;
-    char vstr[53];
-    int moves;
-    public int column;
-    public int column_moveto;
-    int row;
-    int row_dropto;
-    int blink_r1 = 0;
-    int blink_c1 = 0;
-    int blink_r2 = 0;
-    int blink_c2 = 0;
-    int blink_t = 0;
-    int blink_n = 0;
-    bool blink_on = false;
-    public uint timeout = 0;
-
-    const ActionEntry app_entries[] = {
+    private int score[3];
+    private static AnimID anim;
+    private char vstr[53];
+    private int moves;
+    private int column;
+    private int column_moveto;
+    private int row;
+    private int row_dropto;
+    private int blink_r1 = 0;
+    private int blink_c1 = 0;
+    private int blink_r2 = 0;
+    private int blink_c2 = 0;
+    private int blink_t = 0;
+    private int blink_n = 0;
+    private bool blink_on = false;
+    private uint timeout = 0;
+
+    private const ActionEntry app_entries[] = { // see also add_actions()
         {"scores", on_game_scores},
         {"quit", on_game_exit},
         {"preferences", on_settings_preferences},
@@ -72,7 +105,7 @@ class FourInARow : Gtk.Application {
         {"about", on_help_about}
     };
 
-    public void game_reset() {
+    internal void game_reset() {
         stop_anim();
 
         undo_action.set_enabled(false);
@@ -104,7 +137,7 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    public void blink_winner(int n) {
+    private void blink_winner(int n) {
         /* blink the winner's line(s) n times */
 
         if (winner == NOBODY)
@@ -125,7 +158,7 @@ class FourInARow : Gtk.Application {
 
     }
 
-    public void add_actions() {
+    private inline void add_actions() {
         new_game_action = new SimpleAction("new-game", null);
         new_game_action.activate.connect(this.on_game_new);
         add_action(new_game_action);
@@ -147,7 +180,7 @@ class FourInARow : Gtk.Application {
         add_action_entries(app_entries, this);
     }
 
-     bool column_clicked_cb(int column) {
+     private inline bool column_clicked_cb(int column) {
         if (player_active) {
             return false;
         }
@@ -160,12 +193,12 @@ class FourInARow : Gtk.Application {
         return true;
     }
 
-    void on_game_new(Variant? v) {
+    private inline void on_game_new(Variant? v) {
         stop_anim();
         game_reset();
     }
 
-    public void draw_line(int r1, int c1, int r2, int c2, int tile) {
+    private inline void draw_line(int r1, int c1, int r2, int c2, int tile) {
         /* draw a line of 'tile' from r1,c1 to r2,c2 */
 
         bool done = false;
@@ -184,7 +217,7 @@ class FourInARow : Gtk.Application {
 
         do {
             done = (r1 == r2 && c1 == c2);
-            game_board.set(r1, c1, (Tile) tile);
+            game_board[r1, c1] = (Tile)tile;
             game_board_view.draw_tile(r1, c1);
             if (r1 != r2)
                 r1 += d_row;
@@ -193,7 +226,7 @@ class FourInARow : Gtk.Application {
         } while (!done);
     }
 
-    public FourInARow() {
+    private FourInARow() {
         Object(application_id: "org.gnome.Four-in-a-row",
                flags: ApplicationFlags.FLAGS_NONE);
         anim = AnimID.NONE;
@@ -221,7 +254,7 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    public void prompt_player() {
+    private void prompt_player() {
         int players = Prefs.instance.get_n_human_players();
         bool human = is_player_human();
         string who;
@@ -284,17 +317,17 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    public void swap_player() {
+    private void swap_player() {
         player = (player == PlayerID.PLAYER1) ? PlayerID.PLAYER2 : PlayerID.PLAYER1;
         move_cursor(3);
         prompt_player();
     }
 
-    public void game_process_move(int c) {
+    private void game_process_move(int c) {
         process_move(c);
     }
 
-    public void process_move3(int c) {
+    private void process_move3(int c) {
         play_sound(SoundID.DROP);
 
         vstr[++moves] = '1' + (char)c;
@@ -320,26 +353,12 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    public void game_init() {
-        anim = AnimID.NONE;
-        gameover = true;
-        player_active = false;
-        player = PlayerID.PLAYER1;
-        winner = PlayerID.NOBODY;
-        score[PlayerID.PLAYER1] = 0;
-        score[PlayerID.PLAYER2] = 0;
-        score[PlayerID.NOBODY] = 0;
-
-        who_starts = PlayerID.PLAYER2;     /* This gets reversed immediately. */
-        clear_board();
-    }
-
-    public bool is_player_human() {
+    private bool is_player_human() {
         return player == PLAYER1 ? Prefs.instance.level[PlayerID.PLAYER1] == Level.HUMAN
             : Prefs.instance.level[PlayerID.PLAYER2] == Level.HUMAN;
     }
 
-    public void process_move2(int c) {
+    private void process_move2(int c) {
         int r = game_board.first_empty_row(c);
         if (r > 0) {
             row = 0;
@@ -352,7 +371,7 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    public void process_move(int c) {
+    private void process_move(int c) {
         if (timeout != 0) {
             var temp = new Animate(c, this);
             Timeout.add(SPEED_DROP, temp.exec);
@@ -365,53 +384,53 @@ class FourInARow : Gtk.Application {
         timeout = Timeout.add(SPEED_DROP, temp.exec);
     }
 
-    public void drop() {
+    private inline void drop() {
         Tile tile = player == PLAYER1 ? Tile.PLAYER1 : Tile.PLAYER2;
 
-        game_board.set(row, column, Tile.CLEAR);
+        game_board[row, column] = Tile.CLEAR;
         game_board_view.draw_tile(row, column);
 
         row++;
-        game_board.set(row, column, tile);
+        game_board[row, column] = tile;
         game_board_view.draw_tile(row, column);
     }
 
-    public void move(int c) {
-        game_board.set(0, column, Tile.CLEAR);
+    private inline void move(int c) {
+        game_board[0, column] = Tile.CLEAR;
         game_board_view.draw_tile(0, column);
 
         column = c;
-        game_board.set(0, c, player == PlayerID.PLAYER1 ? Tile.PLAYER1 : Tile.PLAYER2);
+        game_board[0, c] = player == PlayerID.PLAYER1 ? Tile.PLAYER1 : Tile.PLAYER2;
 
         game_board_view.draw_tile(0, c);
     }
 
-    public void move_cursor(int c) {
+    private void move_cursor(int c) {
         move(c);
         column = column_moveto = c;
         row = row_dropto = 0;
     }
 
-    void set_status_message(string? message) {
+    private void set_status_message(string? message) {
         headerbar.set_title(message);
     }
 
-    class NextMove {
+    private class NextMove {
         int c;
         FourInARow application;
 
-        public NextMove(int c, FourInARow application) {
+        internal NextMove(int c, FourInARow application) {
             this.c = c;
             this.application = application;
         }
 
-        public bool exec() {
+        internal bool exec() {
             application.process_move(c);
             return false;
         }
     }
 
-    void stop_anim() {
+    private void stop_anim() {
         if (timeout == 0)
             return;
         anim = AnimID.NONE;
@@ -419,7 +438,7 @@ class FourInARow : Gtk.Application {
         timeout = 0;
     }
 
-    void clear_board() {
+    private void clear_board() {
         game_board.clear();
 
         for (var i = 0; i < SIZE_VSTR; i++)
@@ -430,7 +449,7 @@ class FourInARow : Gtk.Application {
         moves = 0;
     }
 
-    void blink_tile(int r, int c, int t, int n) {
+    private inline void blink_tile(int r, int c, int t, int n) {
         if (timeout != 0)
             return;
         blink_r1 = r;
@@ -445,7 +464,7 @@ class FourInARow : Gtk.Application {
         timeout = Timeout.add(SPEED_BLINK, temp.exec);
     }
 
-    void on_game_hint(SimpleAction action, Variant? parameter) {
+    private inline void on_game_hint(SimpleAction action, Variant? parameter) {
         string s;
         int c;
 
@@ -480,76 +499,77 @@ class FourInARow : Gtk.Application {
             undo_action.set_enabled(true);
     }
 
-    void on_game_scores(SimpleAction action, Variant? parameter) {
-            scorebox.present();
-            return;
+    private inline void on_game_scores(SimpleAction action, Variant? parameter) {
+        scorebox.present();
+        return;
     }
 
-    void on_game_exit(SimpleAction action, Variant? parameter) {
+    private inline void on_game_exit(SimpleAction action, Variant? parameter) {
         stop_anim();
         quit();
     }
 
-    class Animate {
+    private class Animate {
         int c;
         FourInARow application;
-        public Animate(int c, FourInARow application) {
+        internal Animate(int c, FourInARow application) {
             this.c = c;
             this.application = application;
         }
 
-        public bool exec() {
-            if (anim == AnimID.NONE)
-            return false;
-
+        internal bool exec() {
             switch (anim) {
-            case AnimID.NONE:
-                break;
-            case AnimID.HINT:
-            case AnimID.MOVE:
-                if (application.column < application.column_moveto) {
-                    application.move(application.column + 1);
-                } else if (application.column > application.column_moveto) {
-                    application.move(application.column - 1);
-                } else {
-                    application.timeout = 0;
-                    if (anim == AnimID.MOVE) {
-                        anim = AnimID.NONE;
-                        application.process_move2(c);
+                case AnimID.NONE:
+                    return false;
+
+                case AnimID.HINT:
+                case AnimID.MOVE:
+                    if (application.column < application.column_moveto) {
+                        application.move(application.column + 1);
+                    } else if (application.column > application.column_moveto) {
+                        application.move(application.column - 1);
+                    } else {
+                        application.timeout = 0;
+                        if (anim == AnimID.MOVE) {
+                            anim = AnimID.NONE;
+                            application.process_move2(c);
+                        } else {
+                            anim = AnimID.NONE;
+                        }
+                        return false;
+                    }
+                    return true;
+
+                case AnimID.DROP:
+                    if (application.row < application.row_dropto) {
+                        application.drop();
                     } else {
                         anim = AnimID.NONE;
+                        application.timeout = 0;
+                        application.process_move3(c);
+                        return false;
                     }
-                    return false;
-                }
-                break;
-            case AnimID.DROP:
-                if (application.row < application.row_dropto) {
-                    application.drop();
-                } else {
-                    anim = AnimID.NONE;
-                    application.timeout = 0;
-                    application.process_move3(c);
-                    return false;
-                }
-                break;
-            case AnimID.BLINK:
-                application.draw_line(application.blink_r1, application.blink_c1,
-                                      application.blink_r2, application.blink_c2,
-                                      application.blink_on ? application.blink_t : Tile.CLEAR);
-                application.blink_n--;
-                if (application.blink_n <= 0 && application.blink_on) {
-                    anim = AnimID.NONE;
-                    application.timeout = 0;
-                    return false;
-                }
-                application.blink_on = !application.blink_on;
-                break;
+                    return true;
+
+                case AnimID.BLINK:
+                    application.draw_line(application.blink_r1, application.blink_c1,
+                                          application.blink_r2, application.blink_c2,
+                                          application.blink_on ? application.blink_t : Tile.CLEAR);
+                    application.blink_n--;
+                    if (application.blink_n <= 0 && application.blink_on) {
+                        anim = AnimID.NONE;
+                        application.timeout = 0;
+                        return false;
+                    }
+                    application.blink_on = !application.blink_on;
+                    return true;
+
+                default: assert_not_reached ();
             }
-            return true;
         }
     }
 
-    void on_game_undo(SimpleAction action, Variant? parameter) {
+    private inline void on_game_undo(SimpleAction action, Variant? parameter) {
         int r, c;
 
         if (timeout != 0)
@@ -570,7 +590,7 @@ class FourInARow : Gtk.Application {
         }
         move_cursor(c);
 
-        game_board.set(r, c, Tile.CLEAR);
+        game_board[r, c] = Tile.CLEAR;
         game_board_view.draw_tile(r, c);
 
         if (Prefs.instance.get_n_human_players() == 1 && !is_player_human()) {
@@ -582,18 +602,17 @@ class FourInARow : Gtk.Application {
                 moves--;
                 swap_player();
                 move_cursor(c);
-                game_board.set(r, c, Tile.CLEAR);
+                game_board[r, c] = Tile.CLEAR;
                 game_board_view.draw_tile(r, c);
             }
         }
     }
 
-
-    void on_settings_preferences(SimpleAction action, Variant? parameter) {
+    private inline void on_settings_preferences(SimpleAction action, Variant? parameter) {
         prefsbox_open();
     }
 
-    void on_help_about(SimpleAction action, Variant? parameter) {
+    private inline void on_help_about(SimpleAction action, Variant? parameter) {
         const string authors[] = {"Tim Musson <trmusson ihug co nz>",
             "David Neary <bolsh gimp org>",
             "Nikhar Agrawal <nikharagrawal2006 gmail com>",
@@ -625,7 +644,7 @@ class FourInARow : Gtk.Application {
             website: "https://wiki.gnome.org/Apps/Four-in-a-row";);
     }
 
-    void on_help_contents(SimpleAction action, Variant? parameter) {
+    private inline void on_help_contents(SimpleAction action, Variant? parameter) {
         try {
             Gtk.show_uri_on_window(window,
                 "help:four-in-a-row",
@@ -635,7 +654,7 @@ class FourInARow : Gtk.Application {
         }
     }
 
-    void check_game_state() {
+    private inline void check_game_state() {
         if (game_board.is_line_at((Tile)player, row, column)) {
             gameover = true;
             winner = player;
@@ -659,7 +678,6 @@ class FourInARow : Gtk.Application {
     protected override void startup() {
         base.startup();
 
-
         Gtk.AspectFrame frame;
         GLib.Menu app_menu, section;
         Gtk.MenuButton menu_button;
@@ -715,9 +733,9 @@ class FourInARow : Gtk.Application {
         undo_action.set_enabled(false);
     }
 
-    Gtk.HeaderBar headerbar;
+    private Gtk.HeaderBar headerbar;
 
-    bool on_key_press(Gdk.EventKey  e) {
+    private inline bool on_key_press(Gdk.EventKey e) {
         if ((player_active) || timeout != 0 ||
                 (e.keyval != Prefs.instance.keypress_left &&
                 e.keyval != Prefs.instance.keypress_right &&
@@ -742,7 +760,7 @@ class FourInARow : Gtk.Application {
         return true;
     }
 
-    public void prefsbox_open() {
+    private inline void prefsbox_open() {
         if (prefsbox != null) {
             prefsbox.present();
             return;
@@ -773,7 +791,7 @@ class FourInARow : Gtk.Application {
         ERRORED
     }
 
-    private void init_sound() {
+    private inline void init_sound() {
         try {
             sound_context = new GSound.Context();
             sound_context_state = SoundContextState.WORKING;
@@ -830,28 +848,20 @@ class FourInARow : Gtk.Application {
     }
 }
 
-public enum AnimID {
-    NONE,
-    MOVE,
-    DROP,
-    BLINK,
-    HINT
-}
-
-public enum PlayerID {
+private enum PlayerID {
     PLAYER1 = 0,
     PLAYER2,
     NOBODY
 }
 
-public enum Level {
+private enum Level {
     HUMAN,
     WEAK,
     MEDIUM,
     STRONG
 }
 
-public enum Tile {
+private enum Tile {
     PLAYER1 = 0,
     PLAYER2,
     CLEAR,
@@ -859,32 +869,3 @@ public enum Tile {
     PLAYER1_CURSOR,
     PLAYER2_CURSOR,
 }
-
-public int main(string[] argv) {
-    Intl.setlocale();
-
-    var application = new FourInARow();
-
-    Intl.bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
-    Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
-    Intl.textdomain(GETTEXT_PACKAGE);
-
-    var context = new OptionContext();
-    context.add_group(Gtk.get_option_group(true));
-    try {
-        context.parse(ref argv);
-    } catch (Error error) {
-        print("%s", error.message);
-        return 1;
-    }
-
-    Environment.set_application_name(_(APPNAME_LONG));
-
-    application.game_init();
-
-    var app_retval = application.run(argv);
-
-    return app_retval;
-}
-
-
diff --git a/src/game-board-view.vala b/src/game-board-view.vala
index e999872..aad0111 100644
--- a/src/game-board-view.vala
+++ b/src/game-board-view.vala
@@ -19,19 +19,19 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-class GameBoardView : Gtk.DrawingArea {
-    int boardsize = 0;
-    int tilesize = 0;
-    int offset[6];
+private class GameBoardView : Gtk.DrawingArea {
+    private int boardsize = 0;
+    private int tilesize = 0;
+    private int offset[6];
     /* unscaled pixbufs */
-    Gdk.Pixbuf pb_tileset_raw;
-    Gdk.Pixbuf pb_bground_raw;
+    private Gdk.Pixbuf pb_tileset_raw;
+    private Gdk.Pixbuf pb_bground_raw;
     /* scaled pixbufs */
-    Gdk.Pixbuf pb_tileset;
-    Gdk.Pixbuf pb_bground;
-    Board game_board;
+    private Gdk.Pixbuf pb_tileset;
+    private Gdk.Pixbuf pb_bground;
+    private Board game_board;
 
-    public GameBoardView(Board game_board) {
+    internal GameBoardView(Board game_board) {
         /* set a min size to avoid pathological behavior of gtk when scaling down */
         set_size_request(350, 350);
         halign = Gtk.Align.FILL;
@@ -40,14 +40,12 @@ class GameBoardView : Gtk.DrawingArea {
         events = Gdk.EventMask.EXPOSURE_MASK |
                           Gdk.EventMask.BUTTON_PRESS_MASK |
                           Gdk.EventMask.BUTTON_RELEASE_MASK;
-        Prefs.instance.theme_changed.connect(() =>{
-            change_theme();
-        });
+        Prefs.instance.theme_changed.connect(() => change_theme());
         load_pixmaps();
         this.game_board = game_board;
     }
 
-    private int get_column(int xpos) {
+    private inline int get_column(int xpos) {
         /* Derive column from pixel position */
         int c = xpos / tilesize;
         if (c > 6)
@@ -58,7 +56,7 @@ class GameBoardView : Gtk.DrawingArea {
         return c;
     }
 
-    public void draw_tile(int r, int c) {
+    internal inline void draw_tile(int r, int c) {
         queue_draw_area(c*tilesize + board_x, r*tilesize + board_y, tilesize, tilesize);
     }
 
@@ -85,7 +83,7 @@ class GameBoardView : Gtk.DrawingArea {
         return true;
     }
 
-     public bool change_theme() {
+    private inline bool change_theme() {
         if (!load_pixmaps())
             return false;
 
@@ -118,7 +116,7 @@ class GameBoardView : Gtk.DrawingArea {
         return false;
     }
 
-    void draw_grid(Cairo.Context cr) {
+    private inline void draw_grid(Cairo.Context cr) {
         const double dashes[] = { 4.0, 4.0 };
         int i;
         Gdk.RGBA color = Gdk.RGBA();
@@ -142,13 +140,13 @@ class GameBoardView : Gtk.DrawingArea {
 
         /* Draw separator line at the top */
         cr.set_dash(null, 0);
-        cr.move_to(0, tilesize+0.5);
-        cr.line_to(boardsize, tilesize +0.5);
+        cr.move_to(0, tilesize + 0.5);
+        cr.line_to(boardsize, tilesize + 0.5);
 
         cr.stroke();
     }
 
-    void load_error(string fname) {
+    private void load_error(string fname) {
         Gtk.MessageDialog dialog;
 
         dialog = new Gtk.MessageDialog(get_window() as Gtk.Window, Gtk.DialogFlags.MODAL,
@@ -159,10 +157,10 @@ class GameBoardView : Gtk.DrawingArea {
         dialog.destroy();
     }
 
-    void paint_tile(Cairo.Context cr, int r, int c) {
+    private inline void paint_tile(Cairo.Context cr, int r, int c) {
         int x = c * tilesize + board_x;
         int y = r * tilesize + board_y;
-        int tile = game_board.get(r, c);
+        int tile = game_board [r, c];
         int os = 0;
 
         if (tile == Tile.CLEAR && r != 0)
@@ -198,13 +196,13 @@ class GameBoardView : Gtk.DrawingArea {
         cr.restore();
     }
 
-    public void refresh_pixmaps() {
+    internal void refresh_pixmaps() {
         /* scale the pixbufs */
         pb_tileset = pb_tileset_raw.scale_simple(tilesize * 6, tilesize, Gdk.InterpType.BILINEAR);
         pb_bground = pb_bground_raw.scale_simple(boardsize, boardsize, Gdk.InterpType.BILINEAR);
     }
 
-    public bool load_pixmaps() {
+    private bool load_pixmaps() {
         string fname;
         Gdk.Pixbuf pb_tileset_tmp;
         Gdk.Pixbuf pb_bground_tmp = null;
@@ -277,14 +275,11 @@ class GameBoardView : Gtk.DrawingArea {
      *
      * Which column was clicked on
      */
-    public signal bool column_clicked(int column);
+    internal signal bool column_clicked(int column);
 
     protected override bool button_press_event(Gdk.EventButton e) {
         int x;
         get_window().get_device_position(e.device, out x, null, null);
         return column_clicked(get_column(x));
     }
-
 }
-
-
diff --git a/src/game-board.vala b/src/game-board.vala
index af178d5..76a21cc 100644
--- a/src/game-board.vala
+++ b/src/game-board.vala
@@ -19,31 +19,31 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-class Board : Object {
-    static Tile[,] gboard;
-    const int BOARD_SIZE = 7;
+private class Board : Object {
+    private static Tile[,] gboard;
+    private const int BOARD_SIZE = 7;
 
-    public Board() {
+    internal Board() {
         gboard = new Tile[BOARD_SIZE, BOARD_SIZE];
     }
 
-    public new void @set(int x, int y, Tile tile) {
-        gboard[x,y] = tile;
+    internal new void @set(int x, int y, Tile tile) {
+        gboard[x, y] = tile;
     }
 
-    public new Tile @get(int x, int y) {
+    internal new Tile @get(int x, int y) {
         return gboard[x, y];
     }
 
-    public void clear() {
-        for (var r = 0; r < BOARD_SIZE; r++) {
-            for (var c = 0; c < BOARD_SIZE; c++) {
+    internal void clear() {
+        for (int r = 0; r < BOARD_SIZE; r++) {
+            for (int c = 0; c < BOARD_SIZE; c++) {
                 gboard[r, c] = Tile.CLEAR;
             }
         }
     }
 
-    public int first_empty_row(int c) {
+    internal int first_empty_row(int c) {
         int r = 1;
 
         while (r < BOARD_SIZE && gboard[r, c] == Tile.CLEAR)
@@ -51,7 +51,22 @@ class Board : Object {
         return r - 1;
     }
 
-    bool is_hline_at(Tile p, int r, int c, out int r1, out int c1, out int r2, out int c2) {
+    /*\
+    * * check if there is a line passing by a given point
+    \*/
+
+    internal bool is_line_at(Tile p, int r, int c,
+                             out int r1 = null, out int c1 = null,
+                             out int r2 = null, out int c2 = null) {
+        return is_hline_at (p, r, c, out r1, out c1, out r2, out c2) ||
+               is_vline_at (p, r, c, out r1, out c1, out r2, out c2) ||
+               is_dline1_at(p, r, c, out r1, out c1, out r2, out c2) ||
+               is_dline2_at(p, r, c, out r1, out c1, out r2, out c2);
+    }
+
+    private inline bool is_hline_at(Tile p, int r, int c,
+                                    out int r1, out int c1,
+                                    out int r2, out int c2) {
         r1 = r;
         r2 = r;
         c1 = c;
@@ -65,39 +80,35 @@ class Board : Object {
         return false;
     }
 
-    public bool is_line_at(Tile p, int r, int c, out int r1 = null,
-                           out int c1 = null, out int r2 = null, out int c2 = null) {
-        return is_hline_at(p, r, c, out r1, out c1, out r2, out c2) ||
-            is_vline_at(p, r, c, out r1, out c1, out r2, out c2) ||
-            is_dline1_at(p, r, c, out r1, out c1, out r2, out c2) ||
-            is_dline2_at(p, r, c, out r1, out c1, out r2, out c2);
-    }
-
-    bool is_vline_at(Tile p, int r, int c, out int r1 , out int c1, out int r2, out int c2) {
+    private inline bool is_vline_at(Tile p, int r, int c,
+                                    out int r1 , out int c1,
+                                    out int r2, out int c2) {
         r1 = r;
         r2 = r;
         c1 = c;
         c2 = c;
-        while (r1 > 1 && get(r1 - 1, c) == p)
+        while (r1 > 1 && @get(r1 - 1, c) == p)
             r1 = r1 - 1;
-        while (r2 < 6 && get(r2 + 1, c) == p)
+        while (r2 < 6 && @get(r2 + 1, c) == p)
             r2 = r2 + 1;
         if (r2 - r1 >= 3)
             return true;
         return false;
     }
 
-    bool is_dline1_at(Tile p, int r, int c, out int r1, out int c1, out int r2, out int c2) {
+    private inline bool is_dline1_at(Tile p, int r, int c,
+                                     out int r1, out int c1,
+                                     out int r2, out int c2) {
         /* upper left to lower right */
         r1 = r;
         r2 = r;
         c1 = c;
         c2 = c;
-        while (c1 > 0 && r1 > 1 && get(r1 - 1, c1 - 1) == p) {
+        while (c1 > 0 && r1 > 1 && @get(r1 - 1, c1 - 1) == p) {
             r1 = r1 - 1;
             c1 = c1 - 1;
         }
-        while (c2 < 6 && r2 < 6 && get(r2 + 1, c2 + 1) == p) {
+        while (c2 < 6 && r2 < 6 && @get(r2 + 1, c2 + 1) == p) {
             r2 = r2 + 1;
             c2 = c2 + 1;
         }
@@ -106,17 +117,19 @@ class Board : Object {
         return false;
     }
 
-    bool is_dline2_at(Tile p, int r, int c, out int r1, out int c1, out int r2, out int c2) {
+    private inline bool is_dline2_at(Tile p, int r, int c,
+                                     out int r1, out int c1,
+                                     out int r2, out int c2) {
         /* upper right to lower left */
         r1 = r;
         r2 = r;
         c1 = c;
         c2 = c;
-        while (c1 < 6 && r1 > 1 && get(r1 - 1, c1 + 1) == p) {
+        while (c1 < 6 && r1 > 1 && @get(r1 - 1, c1 + 1) == p) {
             r1 = r1 - 1;
             c1 = c1 + 1;
         }
-        while (c2 > 0 && r2 < 6 && get(r2 + 1, c2 - 1) == p) {
+        while (c2 > 0 && r2 < 6 && @get(r2 + 1, c2 - 1) == p) {
             r2 = r2 + 1;
             c2 = c2 - 1;
         }
diff --git a/src/games-controls-list.vala b/src/games-controls-list.vala
index f28e479..b806d10 100644
--- a/src/games-controls-list.vala
+++ b/src/games-controls-list.vala
@@ -19,41 +19,43 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
+using Gtk;
+
 /*
  * Needed to force vala to include headers in the correct order.
  * See https://gitlab.gnome.org/GNOME/vala/issues/98
+ * Cannot reproduce 08/2019, but the bug is not closed (1/2).
  */
-const string games_controls_gettext_package = GETTEXT_PACKAGE;
-
-enum Columns {
-    CONFKEY_COLUMN = 0,
-    LABEL_COLUMN,
-    KEYCODE_COLUMN,
-    KEYMODS_COLUMN,
-    DEFAULT_KEYCODE_COLUMN,
-    DEFAULT_KEYMODS_COLUMN,
-    N_COLUMNS
-}
+private const string games_controls_gettext_package = GETTEXT_PACKAGE;
+
+private class GamesControlsList : ScrolledWindow {
+    private enum Columns {
+        CONFKEY_COLUMN = 0,
+        LABEL_COLUMN,
+        KEYCODE_COLUMN,
+        KEYMODS_COLUMN,
+        DEFAULT_KEYCODE_COLUMN,
+        DEFAULT_KEYMODS_COLUMN,
+        N_COLUMNS
+    }
 
-public class GamesControlsList : Gtk.ScrolledWindow {
-    Gtk.TreeModel model;
-    Gtk.ListStore store;
-    Gtk.TreeView view;
+    private TreeModel model;
+    private Gtk.ListStore store;
+    private TreeView view;
 
-    Settings settings;
-    ulong notify_handler_id;
+    private GLib.Settings settings;
+    private ulong notify_handler_id;
 
-    public GamesControlsList(GLib.Settings settings) {
-        Gtk.CellRenderer label_renderer;
-        Gtk.CellRendererAccel key_renderer;
-        Gtk.TreeViewColumn column;
+    internal GamesControlsList(GLib.Settings settings) {
+        CellRenderer label_renderer;
+        CellRendererAccel key_renderer;
+        TreeViewColumn column;
 
-        this.hscrollbar_policy = Gtk.PolicyType.NEVER;
-        this.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
-        this.shadow_type = Gtk.ShadowType.IN;
+        this.hscrollbar_policy = PolicyType.NEVER;
+        this.vscrollbar_policy = PolicyType.AUTOMATIC;
+        this.shadow_type = ShadowType.IN;
         this.settings = settings;
-        notify_handler_id = settings.changed
-            .connect(settings_changed_cb);
+        notify_handler_id = settings.changed.connect(settings_changed_cb);
 
         store = new Gtk.ListStore(Columns.N_COLUMNS,
             Type.STRING,
@@ -64,26 +66,26 @@ public class GamesControlsList : Gtk.ScrolledWindow {
             Type.UINT);
 
         model = store;
-        view = new Gtk.TreeView.with_model(model);
+        view = new TreeView.with_model(model);
 
         view.headers_visible = false;
         view.enable_search = false;
 
-        label_renderer = new Gtk.CellRendererText();
-        column = new Gtk.TreeViewColumn.with_attributes("Control", label_renderer,
+        label_renderer = new CellRendererText();
+        column = new TreeViewColumn.with_attributes("Control", label_renderer,
             "text", Columns.LABEL_COLUMN);
 
         view.append_column(column);
 
-        key_renderer = new Gtk.CellRendererAccel();
+        key_renderer = new CellRendererAccel();
 
         key_renderer.editable = true;
-        key_renderer.accel_mode = Gtk.CellRendererAccelMode.OTHER;
+        key_renderer.accel_mode = CellRendererAccelMode.OTHER;
 
         key_renderer.accel_edited.connect(this.accel_edited_cb);
         key_renderer.accel_cleared.connect(this.accel_cleared_cb);
 
-        column = new Gtk.TreeViewColumn.with_attributes("Key", key_renderer,
+        column = new TreeViewColumn.with_attributes("Key", key_renderer,
             "accel-key", Columns.KEYCODE_COLUMN,
             "accel-mods", Columns.KEYMODS_COLUMN);
 
@@ -91,13 +93,13 @@ public class GamesControlsList : Gtk.ScrolledWindow {
         this.add(view);
     }
 
-    void accel_cleared_cb(string path_string) {
-        Gtk.TreePath path;
-        Gtk.TreeIter iter;
+    private inline void accel_cleared_cb(string path_string) {
+        TreePath path;
+        TreeIter iter;
         string conf_key = null;
         int default_keyval = 0; //set to 0 to make valac happy
 
-        path = new Gtk.TreePath.from_string(path_string);
+        path = new TreePath.from_string(path_string);
         if (path == null)
             return;
 
@@ -105,9 +107,9 @@ public class GamesControlsList : Gtk.ScrolledWindow {
             return;
         }
 
-        model.get(iter,
-                  Columns.CONFKEY_COLUMN, conf_key,
-                  Columns.DEFAULT_KEYCODE_COLUMN, default_keyval);
+        model.@get(iter,
+                   Columns.CONFKEY_COLUMN, conf_key,
+                   Columns.DEFAULT_KEYCODE_COLUMN, default_keyval);
 
         if (conf_key == null)
             return;
@@ -117,14 +119,14 @@ public class GamesControlsList : Gtk.ScrolledWindow {
         settings.set_int(conf_key, default_keyval);
     }
 
-    void accel_edited_cb(string path_string, uint keyval, Gdk.ModifierType mask, uint hardware_keycode) {
-        Gtk.TreePath path;
-        Gtk.TreeIter iter;
+    private inline void accel_edited_cb(string path_string, uint keyval, Gdk.ModifierType mask, uint 
hardware_keycode) {
+        TreePath path;
+        TreeIter iter;
         string conf_key = null;
         bool valid;
         bool unused_key = true;
 
-        path = new Gtk.TreePath.from_string(path_string);
+        path = new TreePath.from_string(path_string);
         if (path == null)
             return;
 
@@ -132,7 +134,7 @@ public class GamesControlsList : Gtk.ScrolledWindow {
             return;
         }
 
-        model.get(iter, Columns.CONFKEY_COLUMN, conf_key);
+        model.@get(iter, Columns.CONFKEY_COLUMN, conf_key);
         if (conf_key == null)
             return;
 
@@ -140,16 +142,16 @@ public class GamesControlsList : Gtk.ScrolledWindow {
         while (valid) {
             string actual_conf_key = null;
 
-            model.get(iter, Columns.CONFKEY_COLUMN, actual_conf_key);
+            model.@get(iter, Columns.CONFKEY_COLUMN, actual_conf_key);
 
             if (settings.get_int(actual_conf_key) == keyval) {
                 unused_key = false;
 
                 if (conf_key == actual_conf_key) {
-                    var dialog = new Gtk.MessageDialog.with_markup(null,
-                        Gtk.DialogFlags.DESTROY_WITH_PARENT,
-                        Gtk.MessageType.WARNING,
-                        Gtk.ButtonsType.OK,
+                    MessageDialog dialog = new MessageDialog.with_markup(null,
+                        DialogFlags.DESTROY_WITH_PARENT,
+                        MessageType.WARNING,
+                        ButtonsType.OK,
                         "<span weight=\"bold\" size=\"larger\">%s</span>",
                         _("This key is already in use."));
 
@@ -167,8 +169,8 @@ public class GamesControlsList : Gtk.ScrolledWindow {
             settings.set_int(conf_key, (int)keyval);
     }
 
-    void add_control(string conf_key, string? label, uint default_keyval) {
-        Gtk.TreeIter iter;
+    private void add_control(string conf_key, string? label, uint default_keyval) {
+        TreeIter iter;
         uint keyval;
 
         if (label == null)
@@ -186,7 +188,7 @@ public class GamesControlsList : Gtk.ScrolledWindow {
 
     }
 
-    public void add_controls(string first_gconf_key, ...) {
+    internal inline void add_controls(string first_gconf_key, ...) {
         var args = va_list();
         string? key;
         string label;
@@ -201,8 +203,8 @@ public class GamesControlsList : Gtk.ScrolledWindow {
         }
     }
 
-    void settings_changed_cb (string key) {
-        Gtk.TreeIter iter;
+    private inline void settings_changed_cb (string key) {
+        TreeIter iter;
         bool valid;
 
         /* find our gconf key in the list store and update it */
@@ -210,24 +212,22 @@ public class GamesControlsList : Gtk.ScrolledWindow {
         while (valid) {
             string conf_key;
 
-            model.get(iter, Columns.CONFKEY_COLUMN, out conf_key);
+            model.@get(iter, Columns.CONFKEY_COLUMN, out conf_key);
 
             if (key == conf_key) {
                 uint keyval, default_keyval;
 
-                model.get(iter, Columns.DEFAULT_KEYCODE_COLUMN, out default_keyval);
+                model.@get(iter, Columns.DEFAULT_KEYCODE_COLUMN, out default_keyval);
 
                 keyval = settings.get_int(key);
 
-                store.set(iter,
-                          Columns.KEYCODE_COLUMN, keyval,
-                          Columns.KEYMODS_COLUMN, 0 /* FIXME? */);
-
+                store.@set(iter,
+                           Columns.KEYCODE_COLUMN, keyval,
+                           Columns.KEYMODS_COLUMN, 0 /* FIXME? */);
                 break;
             }
 
             valid = store.iter_next(ref iter);
         }
     }
-
 }
diff --git a/src/prefs-box.vala b/src/prefs-box.vala
index a85d59d..914a5cb 100644
--- a/src/prefs-box.vala
+++ b/src/prefs-box.vala
@@ -18,19 +18,26 @@
  * You should have received a copy of the GNU General Public License
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
-class PrefsBox : Gtk.Dialog {
-    Gtk.Notebook notebook;
-    Gtk.ComboBox combobox;
-    Gtk.ComboBoxText combobox_theme;
-    Gtk.ToggleButton checkbutton_sound;
-
-    public PrefsBox(Gtk.Window parent) {
-        Gtk.Grid grid;
+
+using Gtk;
+
+private class PrefsBox : Dialog {
+    private const uint DEFAULT_KEY_LEFT = Gdk.Key.Left;
+    private const uint DEFAULT_KEY_RIGHT = Gdk.Key.Right;
+    private const uint DEFAULT_KEY_DROP = Gdk.Key.Down;
+
+    internal PrefsBox(Window parent) {
+        Notebook notebook;
+        ComboBox combobox;
+        ComboBoxText combobox_theme;
+        ToggleButton checkbutton_sound;
+
+        Grid grid;
         GamesControlsList controls_list;
-        Gtk.Label label;
-        Gtk.CellRendererText renderer;
+        Label label;
+        CellRendererText renderer;
         Gtk.ListStore model;
-        Gtk.TreeIter iter;
+        TreeIter iter;
 
         Object(
             title: _("Preferences"),
@@ -40,74 +47,74 @@ class PrefsBox : Gtk.Dialog {
         modal = true;
         border_width = 5;
         get_content_area().spacing = 2;
-        notebook = new Gtk.Notebook();
+        notebook = new Notebook();
         notebook.set_border_width(5);
         get_content_area().pack_start(notebook, true, true, 0);
 
         /* game tab */
-        grid = new Gtk.Grid();
+        grid = new Grid();
         grid.set_row_spacing(6);
         grid.set_column_spacing(12);
         grid.set_border_width(12);
 
-        label = new Gtk.Label(_("Game"));
+        label = new Label(_("Game"));
         notebook.append_page(grid, label);
 
-        label = new Gtk.Label(_("Opponent:"));  // TODO add a mnemonic, like for _Theme:
+        label = new Label(_("Opponent:"));  // TODO add a mnemonic, like for _Theme:
         label.set_xalign((float)0.0);
         label.set_yalign((float)0.5);
         label.set_hexpand(true);
         grid.attach(label,0,0 ,1, 1);
 
-        combobox = new Gtk.ComboBox();
-        renderer = new Gtk.CellRendererText();
+        combobox = new ComboBox();
+        renderer = new CellRendererText();
         combobox.pack_start(renderer, true);
         combobox.add_attribute(renderer, "text", 0);
         model = new Gtk.ListStore(2, typeof(string), typeof(int));
         combobox.set_model(model);
         model.append(out iter);
-        model.set(iter, 0, _("Human"), 1, Level.HUMAN);
+        model.@set(iter, 0, _("Human"), 1, Level.HUMAN);
         if (Prefs.instance.level[PlayerID.PLAYER2] == Level.HUMAN)
             combobox.set_active_iter(iter);
         model.append(out iter);
-        model.set(iter, 0, _("Level one"), 1, Level.WEAK);
+        model.@set(iter, 0, _("Level one"), 1, Level.WEAK);
         if (Prefs.instance.level[PlayerID.PLAYER2] == Level.WEAK)
             combobox.set_active_iter(iter);
         model.append(out iter);
-        model.set(iter, 0, _("Level two"), 1, Level.MEDIUM);
+        model.@set(iter, 0, _("Level two"), 1, Level.MEDIUM);
         if (Prefs.instance.level[PlayerID.PLAYER2] == Level.MEDIUM)
             combobox.set_active_iter(iter);
         model.append(out iter);
-        model.set(iter, 0, _("Level three"), 1, Level.STRONG);
+        model.@set(iter, 0, _("Level three"), 1, Level.STRONG);
         if (Prefs.instance.level[PlayerID.PLAYER2] == Level.STRONG)
             combobox.set_active_iter(iter);
 
         combobox.changed.connect(on_select_opponent);
         grid.attach(combobox, 1, 0, 1, 1);
 
-        label = new Gtk.Label.with_mnemonic(_("_Theme:"));
+        label = new Label.with_mnemonic(_("_Theme:"));
         label.set_xalign((float)0.0);
         label.set_yalign((float)0.5);
         label.set_hexpand(true);
         grid.attach(label, 0, 1, 1, 1);
 
-        combobox_theme = new Gtk.ComboBoxText();
+        combobox_theme = new ComboBoxText();
         for (int i = 0; i < theme.length; i++) {
             combobox_theme.append_text(_(theme_get_title(i)));
         }
         label.set_mnemonic_widget(combobox_theme);
         grid.attach(combobox_theme, 1, 1, 1, 1);
 
-        checkbutton_sound = new Gtk.CheckButton.with_mnemonic(_("E_nable sounds"));
+        checkbutton_sound = new CheckButton.with_mnemonic(_("E_nable sounds"));
         grid.attach(checkbutton_sound, 0, 2, 2, 1);
 
         /* keyboard tab */
-        label = new Gtk.Label.with_mnemonic(_("Keyboard Controls"));
+        label = new Label.with_mnemonic(_("Keyboard Controls"));
 
         controls_list = new GamesControlsList(Prefs.instance.settings);
-        controls_list.add_controls("key-left", _("Move left"), DEFAULT_KEY_LEFT,
-                       "key-right", _("Move right"), DEFAULT_KEY_RIGHT,
-                       "key-drop", _("Drop marble"), DEFAULT_KEY_DROP);
+        controls_list.add_controls("key-left",  _("Move left"),     DEFAULT_KEY_LEFT,
+                                   "key-right", _("Move right"),    DEFAULT_KEY_RIGHT,
+                                   "key-drop",  _("Drop marble"),   DEFAULT_KEY_DROP);
         controls_list.border_width = 12;
         notebook.append_page(controls_list, label);
 
@@ -118,34 +125,30 @@ class PrefsBox : Gtk.Dialog {
         /* connect signals */
         combobox_theme.changed.connect(on_select_theme);
         checkbutton_sound.toggled.connect(Prefs.instance.on_toggle_sound);
-        Prefs.instance.theme_changed.connect((theme_id) => {
-            combobox_theme.set_active(theme_id);
-        });
-        Prefs.instance.notify["do_sound"].connect(() => {
-            checkbutton_sound.set_active(Prefs.instance.do_sound);
-        });
+        Prefs.instance.theme_changed.connect((theme_id) => combobox_theme.set_active(theme_id));
+        Prefs.instance.notify["do_sound"].connect(() => 
checkbutton_sound.set_active(Prefs.instance.do_sound));
     }
 
-    protected override bool delete_event(Gdk.EventAny event) {
+    protected override bool delete_event(Gdk.EventAny event) {  // TODO use hide_on_delete (Gtk3) or 
hide-on-close (Gtk4) 2/2
         hide();
         return true;
     }
 
-    void on_select_theme(Gtk.ComboBox combo) {
-        int id = combo.get_active();
+    private static inline void on_select_theme(ComboBox combobox) {
+        int id = combobox.get_active();
         Prefs.instance.theme_id = id;
     }
 
-    void on_select_opponent(Gtk.ComboBox w) {
+    private inline void on_select_opponent(ComboBox combobox) {
         FourInARow app = (FourInARow)application;
-        Gtk.TreeIter iter;
-        int value;
+        TreeIter iter;
+        int iter_value;
 
-        w.get_active_iter(out iter);
-        w.get_model().get(iter, 1, out value);
+        combobox.get_active_iter(out iter);
+        combobox.get_model().@get(iter, 1, out iter_value);
 
-        Prefs.instance.level[PlayerID.PLAYER2] = (Level)value;
-        Prefs.instance.settings.set_int("opponent", value);
+        Prefs.instance.level[PlayerID.PLAYER2] = (Level)iter_value;
+        Prefs.instance.settings.set_int("opponent", iter_value);
         app.who_starts = PlayerID.PLAYER2; /* This gets reversed in game_reset. */
         app.game_reset();
     }
diff --git a/src/prefs.vala b/src/prefs.vala
index 0e5eb3b..fb17e39 100644
--- a/src/prefs.vala
+++ b/src/prefs.vala
@@ -19,10 +19,13 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-class Prefs : Object {
-    public bool do_sound{ get; set;}
-    int _theme_id;
-    public int theme_id {
+private class Prefs : Object {
+    private const int DEFAULT_THEME_ID = 0;
+
+    [CCode (notify = false)] internal bool do_sound{ internal get; internal set;}
+
+    private int _theme_id;
+    [CCode (notify = true)] internal int theme_id {
         get{
             return sane_theme_id(_theme_id);
         }
@@ -30,20 +33,19 @@ class Prefs : Object {
             _theme_id = sane_theme_id(value);
         }
     }
-    public Level level[2];
-    public int keypress_drop { get; set; }
-    public int keypress_right { get; set; }
-    public int keypress_left { get; set; }
-    public Settings settings;
 
-    static Once<Prefs> _instance;
-    public static Prefs instance { get {
-        return _instance.once(() => {
-            return new Prefs();
-        });
+    internal Level level[2];
+    [CCode (notify = false)] internal int keypress_drop  { internal get; internal set; }
+    [CCode (notify = false)] internal int keypress_right { internal get; internal set; }
+    [CCode (notify = false)] internal int keypress_left  { internal get; internal set; }
+    internal Settings settings;
+
+    private static Once<Prefs> _instance;
+    [CCode (notify = false)] internal static Prefs instance { internal get {
+        return _instance.once(() => { return new Prefs(); });
     }}
 
-    public Prefs() {
+    internal Prefs() {
         settings = new GLib.Settings("org.gnome.Four-in-a-row");
         level[PlayerID.PLAYER1] = Level.HUMAN; /* Human. Always human. */
         level[PlayerID.PLAYER2] = (Level) settings.get_int("opponent");
@@ -61,10 +63,10 @@ class Prefs : Object {
         theme_id = sane_theme_id(theme_id);
     }
 
-    static int sane_theme_id(int val) {
+    private static int sane_theme_id(int val) {
         if (val < 0 || val >= theme.length)
             return DEFAULT_THEME_ID;
-            return val;
+        return val;
     }
 
     /**
@@ -74,16 +76,16 @@ class Prefs : Object {
      *
      * @theme_id: The new theme_id
      */
-    public signal void theme_changed(int theme_id);
+    internal signal void theme_changed(int theme_id);
 
-    private void theme_id_changed_cb (string key) {
+    private inline void theme_id_changed_cb (string key) {
         int val = sane_theme_id(settings.get_int("theme-id"));
         if (val != theme_id)
             theme_id = val;
         theme_changed(theme_id);
     }
 
-    public int get_n_human_players() {
+    internal int get_n_human_players() {
         if (level[PlayerID.PLAYER1] != Level.HUMAN && level[PlayerID.PLAYER2] != Level.HUMAN)
             return 0;
         if (level[PlayerID.PLAYER1] != Level.HUMAN || level[PlayerID.PLAYER2] != Level.HUMAN)
@@ -91,26 +93,15 @@ class Prefs : Object {
         return 2;
     }
 
-    public void on_toggle_sound(Gtk.ToggleButton t) {
+    internal inline void on_toggle_sound(Gtk.ToggleButton t) {
         do_sound = t.get_active();
     }
 
+    private static Level sane_player_level(Level val) {
+        if (val < Level.HUMAN)
+            return Level.HUMAN;
+        if (val > Level.STRONG)
+            return Level.STRONG;
+        return val;
+    }
 }
-
-
-
-const uint DEFAULT_KEY_LEFT = Gdk.Key.Left;
-const uint DEFAULT_KEY_RIGHT = Gdk.Key.Right;
-const uint DEFAULT_KEY_DROP = Gdk.Key.Down;
-const int DEFAULT_THEME_ID = 0;
-
-
-public Level sane_player_level(Level val) {
-    if (val < Level.HUMAN)
-        return Level.HUMAN;
-    if (val > Level.STRONG)
-        return Level.STRONG;
-    return val;
-}
-
-
diff --git a/src/scorebox.vala b/src/scorebox.vala
index b623be5..07bf5de 100644
--- a/src/scorebox.vala
+++ b/src/scorebox.vala
@@ -19,70 +19,70 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-class Scorebox : Gtk.Dialog {
-    Gtk.Label[] label_name;
-    Gtk.Label label_score[3];
-    public new FourInARow application;
+using Gtk;
 
-    public Scorebox(Gtk.Window parent, FourInARow application) {
+private class Scorebox : Dialog {
+    private Label[] label_name;
+    private Label[] label_score;
+
+    internal Scorebox(Window parent, FourInARow application) {
         Object(title: _("Scores"),
                use_header_bar: 1,
                destroy_with_parent: true,
                resizable: false,
-               border_width: 5);
+               border_width: 5,
+               application: application);
         get_content_area().spacing = 2;
         set_transient_for(parent);
         modal = true;
 
-        Gtk.Grid grid, grid2;
+        Grid grid, grid2;
 
-        label_name = new Gtk.Label[3];
-        label_score = new Gtk.Label[3];
+        label_name = new Label[3];
+        label_score = new Label[3];
 
-        grid = new Gtk.Grid();
-        grid.halign = Gtk.Align.CENTER;
+        grid = new Grid();
+        grid.halign = Align.CENTER;
         grid.row_spacing = 6;
-        grid.orientation = Gtk.Orientation.VERTICAL;
+        grid.orientation = Orientation.VERTICAL;
         grid.border_width = 5;
 
         get_content_area().pack_start(grid);
 
-        grid2 = new Gtk.Grid();
+        grid2 = new Grid();
         grid.add(grid2);
         grid2.column_spacing = 6;
 
-        label_name[PlayerID.PLAYER1] = new Gtk.Label(null);
+        label_name[PlayerID.PLAYER1] = new Label(null);
         grid2.attach(label_name[PlayerID.PLAYER1], 0, 0, 1, 1);
         label_name[PlayerID.PLAYER1].xalign = 0;
         label_name[PlayerID.PLAYER1].yalign = 0.5f;
 
-        label_score[PlayerID.PLAYER1] = new Gtk.Label(null);
+        label_score[PlayerID.PLAYER1] = new Label(null);
         grid2.attach(label_score[PlayerID.PLAYER1], 1, 0, 1, 1);
         label_score[PlayerID.PLAYER1].xalign = 0;
         label_score[PlayerID.PLAYER1].yalign = 0.5f;
 
-        label_name[PlayerID.PLAYER2] = new Gtk.Label(null);
+        label_name[PlayerID.PLAYER2] = new Label(null);
         grid2.attach(label_name[PlayerID.PLAYER2], 0, 1, 1, 1);
         label_name[PlayerID.PLAYER2].xalign = 0;
         label_name[PlayerID.PLAYER2].yalign = 0.5f;
 
-        label_score[PlayerID.PLAYER2] = new Gtk.Label(null);
+        label_score[PlayerID.PLAYER2] = new Label(null);
         grid2.attach(label_score[PlayerID.PLAYER2], 1, 1, 1, 1);
         label_score[PlayerID.PLAYER2].set_xalign(0);
         label_score[PlayerID.PLAYER2].set_yalign(0.5f);
 
-        label_name[PlayerID.NOBODY] = new Gtk.Label(_("Drawn:"));
+        label_name[PlayerID.NOBODY] = new Label(_("Drawn:"));
         grid2.attach(label_name[PlayerID.NOBODY], 0, 2, 1, 1);
         label_name[PlayerID.NOBODY].set_xalign(0);
         label_name[PlayerID.NOBODY].set_yalign(0.5f);
 
-        label_score[PlayerID.NOBODY] = new Gtk.Label(null);
+        label_score[PlayerID.NOBODY] = new Label(null);
         grid2.attach(label_score[PlayerID.NOBODY], 1, 2, 1, 1);
         label_score[PlayerID.NOBODY].set_xalign(0);
         label_score[PlayerID.NOBODY].set_yalign(0.5f);
         grid.show_all();
-
-        this.application = application;
     }
 
     /**
@@ -90,9 +90,12 @@ class Scorebox : Gtk.Dialog {
      *
      * updates the scorebox with the latest scores
      */
-    public void update(int[] scores) {
+    internal void update(int[] scores) {
         if (Prefs.instance.get_n_human_players() == 1) {
-            if (Prefs.instance.level[PlayerID.PLAYER1] == Level.HUMAN) {
+            if (Prefs.instance.level[PlayerID.PLAYER1] == Level.HUMAN) {    // FIXME shouldn't it be 
Player1&Player2?
+
+
+
                 label_name[PlayerID.PLAYER1].set_text(_("You:"));
                 label_name[PlayerID.PLAYER2].label = _("Me:");
             } else {
@@ -105,11 +108,11 @@ class Scorebox : Gtk.Dialog {
         }
         label_score[PlayerID.PLAYER1].label = scores[PlayerID.PLAYER1].to_string();
         label_score[PlayerID.PLAYER2].label = scores[PlayerID.PLAYER2].to_string();
-        label_score[PlayerID.NOBODY].label = scores[PlayerID.NOBODY].to_string();
+        label_score[PlayerID.NOBODY].label  = scores[PlayerID.NOBODY].to_string();
 
     }
 
-    public override bool delete_event(Gdk.EventAny event) {
+    protected override bool delete_event(Gdk.EventAny event) {  // TODO use hide_on_delete (Gtk3) or 
hide-on-close (Gtk4) 1/2
         hide();
         return true;
     }
diff --git a/src/test-ai.vala b/src/test-ai.vala
index 42c5a0b..84c344f 100644
--- a/src/test-ai.vala
+++ b/src/test-ai.vala
@@ -19,13 +19,32 @@
  * along with Four-in-a-row.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-const int NUMBER_GAMES = 5;
-const int MAXIMUM_GAMES = 100;
-const int THRESHOLD_DENOMINATOR = 4;
+private const int NUMBER_GAMES = 5;
+private const int MAXIMUM_GAMES = 100;
+private const int THRESHOLD_DENOMINATOR = 4;
+
+private int main (string[] args)
+{
+    Test.init (ref args);
+    Test.add_func ("/AI/Take Win/Horizontal Win", test_horizontal_win);
+    Test.add_func ("/AI/Take Win/Vertical Win", test_vertical_win);
+    Test.add_func ("/AI/Take Win/Forward Diagonal Win", test_forward_diagonal_win);
+    Test.add_func ("/AI/Take Win/Backward Diagonal Win", test_backward_diagonal_win);
+    Test.add_func ("/AI/Avoid Loss/Horizontal Loss", test_avoid_horizontal_loss);
+    Test.add_func ("/AI/Avoid Loss/Vertical Loss", test_avoid_vertical_loss);
+    Test.add_func ("/AI/Avoid Loss/Forward Diagonal Loss", test_avoid_forward_diagonal_loss);
+    Test.add_func ("/AI/Avoid Loss/Backward Diagonal Loss", test_avoid_backward_diagonal_loss);
+    Test.add_func ("/AI/AI vs AI/Easy vs Medium", test_easy_vs_medium);
+    Test.add_func ("/AI/AI vs AI/Easy vs Hard", test_easy_vs_hard);
+    Test.add_func ("/AI/AI vs AI/Medium vs Hard", test_medium_vs_hard);
+    Test.add_func ("/AI/Draw", test_draw);
+    Test.add_func ("/AI/Random", test_random);
+    return Test.run ();
+}
 
 /* Tests if the AI makes moves so as to take up immediate horizontal wins. The argument to playgame function 
is the sequence of moves
  made until now. The return value of playgame function is the column number in which the AI should move.*/
-private void test_horizontal_win ()
+private static inline void test_horizontal_win ()
 {
     /*In the first statement below, the AI has made moves into the 1st, 2nd and 3rd columns. To win, AI must 
move in the 4th column.*/
     assert (playgame ("a1727370") == 4);
@@ -35,7 +54,7 @@ private void test_horizontal_win ()
 }
 
 /* Tests if the AI makes moves so as to take up immediate vertical wins.*/
-private void test_vertical_win ()
+private static inline void test_vertical_win ()
 {
     assert (playgame ("a1213140") == 1);
     assert (playgame ("a14456535526613130") == 1);
@@ -44,7 +63,7 @@ private void test_vertical_win ()
 }
 
 /* Tests if the AI makes moves so as to take up immediate forward diagonal wins.*/
-private void test_forward_diagonal_win ()
+private static inline void test_forward_diagonal_win ()
 {
     assert (playgame ("a54221164712446211622157570") == 7);
     assert (playgame ("a4256424426621271412117175776343330") == 3);
@@ -53,7 +72,7 @@ private void test_forward_diagonal_win ()
 }
 
 /* Tests if the AI makes moves so as to take up immediate backward diagonal wins.*/
-private void test_backward_diagonal_win ()
+private static inline void test_backward_diagonal_win ()
 {
     assert (playgame ("5422327343142110") == 1);
     assert (playgame ("a1415113315143220") == 2);
@@ -63,7 +82,7 @@ private void test_backward_diagonal_win ()
 
 /* Tests if the AI makes moves which prevents HUMAN from taking immediate vertical victories. Consider that 
a HUMAN has 3 balls in the
    first column. The AI's next move should be in the 1st column or else, HUMAN will claim victory on his 
next turn.*/
-private void test_avoid_vertical_loss ()
+private static inline void test_avoid_vertical_loss ()
 {
     assert (playgame ("a42563117273430") == 3);
     assert (playgame ("a3642571541322340") == 4);
@@ -72,7 +91,7 @@ private void test_avoid_vertical_loss ()
 }
 
 /* Tests if the AI makes moves which prevents HUMAN from taking immediate forward diagonal victories*/
-private void test_avoid_forward_diagonal_loss ()
+private static inline void test_avoid_forward_diagonal_loss ()
 {
     assert (playgame ("a34256477331566570") == 7);
     assert (playgame ("a1445662644751711370") == 7);
@@ -81,7 +100,7 @@ private void test_avoid_forward_diagonal_loss ()
 }
 
 /* Tests if the AI makes moves which prevents HUMAN from taking immediate backward diagonal victories*/
-private void test_avoid_backward_diagonal_loss ()
+private static inline void test_avoid_backward_diagonal_loss ()
 {
     assert (playgame ("a47465234222530") == 3);
     assert (playgame ("a4344223537211510") == 1);
@@ -91,7 +110,7 @@ private void test_avoid_backward_diagonal_loss ()
 }
 
 /* Tests if the AI makes moves which prevents HUMAN from taking immediate horizontal victories*/
-private void test_avoid_horizontal_loss ()
+private static inline void test_avoid_horizontal_loss ()
 {
     assert (playgame ("a445360") == 7);
     assert (playgame ("a745534131117114777720") == 2);
@@ -100,7 +119,7 @@ private void test_avoid_horizontal_loss ()
 }
 
 /* Tests if AI can detect full boards, and thus draw games.*/
-private void test_draw ()
+private static inline void test_draw ()
 {
     assert (playgame ("a1311313113652226667224247766737374455445550") == 0);
     assert (playgame ("a6121151135432322433425566474425617635677770") == 0);
@@ -109,7 +128,7 @@ private void test_draw ()
 }
 
 /* Tests if AI makes valid moves, i.e., between column 1 and column 7*/
-private void test_random ()
+private static inline void test_random ()
 {
     int x = playgame ("a443256214350");
     assert (x >= 1 && x <= 7);
@@ -125,7 +144,7 @@ private void test_random ()
 }
 
 /* Pits two AI's of varying difficulty levels against each other and returns the number of games won by 
easier AI.*/
-private int test_ai_vs_ai (string easier, string harder)
+private static inline int test_ai_vs_ai (string easier, string harder)
 {
     int easier_wins = 0;
     int draw = 0;
@@ -133,10 +152,10 @@ private int test_ai_vs_ai (string easier, string harder)
 
     for (int i = 0; i < NUMBER_GAMES; i++)
     {
-        var e = new StringBuilder ();
+        StringBuilder e = new StringBuilder ();
         e.append (easier);
 
-        var m = new StringBuilder ();
+        StringBuilder m = new StringBuilder ();
         m.append (harder);
 
         while (true)
@@ -182,7 +201,7 @@ private int test_ai_vs_ai (string easier, string harder)
 
 /* Repeatedly contest between the two AI until either easier win ratio is less than a threshold
    or maximum numbers of contests have been played.*/
-private void repeat_contests (string easier, string harder, out int games_contested, out int easy_wins)
+private static inline void repeat_contests (string easier, string harder, out int games_contested, out int 
easy_wins)
 {
     easy_wins = test_ai_vs_ai (easier, harder);
     games_contested = NUMBER_GAMES;
@@ -194,7 +213,7 @@ private void repeat_contests (string easier, string harder, out int games_contes
     }
 }
 
-private void test_easy_vs_medium ()
+private static inline void test_easy_vs_medium ()
 {
     int easy_wins;
     int games_contested;
@@ -203,7 +222,7 @@ private void test_easy_vs_medium ()
     assert (easy_wins <= games_contested/THRESHOLD_DENOMINATOR);
 }
 
-private void test_easy_vs_hard ()
+private static inline void test_easy_vs_hard ()
 {
     int easy_wins;
     int games_contested;
@@ -212,7 +231,7 @@ private void test_easy_vs_hard ()
     assert (easy_wins <= games_contested/THRESHOLD_DENOMINATOR);
 }
 
-private void test_medium_vs_hard ()
+private static inline void test_medium_vs_hard ()
 {
     int medium_wins;
     int games_contested;
@@ -220,22 +239,3 @@ private void test_medium_vs_hard ()
 
     assert (medium_wins <= games_contested/THRESHOLD_DENOMINATOR);
 }
-
-public int main (string[] args)
-{
-    Test.init (ref args);
-    Test.add_func ("/AI/Take Win/Horizontal Win", test_horizontal_win);
-    Test.add_func ("/AI/Take Win/Vertical Win", test_vertical_win);
-    Test.add_func ("/AI/Take Win/Forward Diagonal Win", test_forward_diagonal_win);
-    Test.add_func ("/AI/Take Win/Backward Diagonal Win", test_backward_diagonal_win);
-    Test.add_func ("/AI/Avoid Loss/Horizontal Loss", test_avoid_horizontal_loss);
-    Test.add_func ("/AI/Avoid Loss/Vertical Loss", test_avoid_vertical_loss);
-    Test.add_func ("/AI/Avoid Loss/Forward Diagonal Loss", test_avoid_forward_diagonal_loss);
-    Test.add_func ("/AI/Avoid Loss/Backward Diagonal Loss", test_avoid_backward_diagonal_loss);
-    Test.add_func ("/AI/AI vs AI/Easy vs Medium", test_easy_vs_medium);
-    Test.add_func ("/AI/AI vs AI/Easy vs Hard", test_easy_vs_hard);
-    Test.add_func ("/AI/AI vs AI/Medium vs Hard", test_medium_vs_hard);
-    Test.add_func ("/AI/Draw", test_draw);
-    Test.add_func ("/AI/Random", test_random);
-    return Test.run ();
-}
diff --git a/src/theme.vala b/src/theme.vala
index 91d7c32..da3f270 100644
--- a/src/theme.vala
+++ b/src/theme.vala
@@ -19,7 +19,7 @@
  * along with GNOME Four-in-a-row. If not, see <http://www.gnu.org/licenses/>.
  */
 
-struct Theme {
+private struct Theme {
     public string title;
     public string fname_tileset;
     public string fname_bground;
@@ -35,32 +35,33 @@ struct Theme {
 /*
  * Needed to force vala to include headers in the correct order.
  * See https://gitlab.gnome.org/GNOME/vala/issues/98
+ * Cannot reproduce 08/2019, but the bug is not closed (2/2).
  */
-const string theme_gettext_package = GETTEXT_PACKAGE;
+private const string theme_gettext_package = GETTEXT_PACKAGE;
 
-string theme_get_title(int id) {
+private static string theme_get_title(int id) {
     return theme[id].title;
 }
 
-string theme_get_player_turn(PlayerID who) {
+private static string theme_get_player_turn(PlayerID who) {
     if (who == PlayerID.PLAYER1)
         return theme[Prefs.instance.theme_id].player1_turn;
     return theme[Prefs.instance.theme_id].player2_turn;
 }
 
-string theme_get_player_win(PlayerID who) {
+private static string theme_get_player_win(PlayerID who) {
     if (who == PlayerID.PLAYER1)
         return theme[Prefs.instance.theme_id].player1_win;
     return theme[Prefs.instance.theme_id].player2_win;
 }
 
-string theme_get_player(PlayerID who) {
+private static string theme_get_player(PlayerID who) {
     if (who == PlayerID.PLAYER1)
         return theme[Prefs.instance.theme_id].player1;
     return theme[Prefs.instance.theme_id].player2;
 }
 
-const Theme theme[] = {
+private const Theme theme[] = {
     {
         N_("High Contrast"),
         "tileset_50x50_hcontrast.svg",
diff --git a/src/vapi/config.vapi b/src/vapi/config.vapi
index fbcc70d..e9a89fa 100644
--- a/src/vapi/config.vapi
+++ b/src/vapi/config.vapi
@@ -1,5 +1,5 @@
-public const string GETTEXT_PACKAGE;
-public const string DATA_DIRECTORY;
-public const string VERSION;
-public const string SOUND_DIRECTORY;
-public const string LOCALEDIR;
+private const string GETTEXT_PACKAGE;
+private const string DATA_DIRECTORY;
+private const string VERSION;
+private const string SOUND_DIRECTORY;
+private const string LOCALEDIR;


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