chiark / gitweb /
Have each game declare a name which is used for window titles etc.
authorSimon Tatham <anakin@pobox.com>
Wed, 28 Apr 2004 17:46:04 +0000 (17:46 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 28 Apr 2004 17:46:04 +0000 (17:46 +0000)
[originally from svn r4167]

cube.c
gtk.c
net.c
puzzles.h
windows.c

diff --git a/cube.c b/cube.c
index 934d4751de6a16b945b09cc441c7b7cdb48fb1c7..e9c6e9aea2b8ee3341d7b561bcaaed271e6c9495 100644 (file)
--- a/cube.c
+++ b/cube.c
@@ -10,6 +10,8 @@
 
 #include "puzzles.h"
 
+const char *const game_name = "Cube";
+
 #define MAXVERTICES 20
 #define MAXFACES 20
 #define MAXORDER 4
diff --git a/gtk.c b/gtk.c
index 8a26730040f866c3d2b6997a573650c091ae2f9e..78eb8e82e90522d29733fba7d9e7408e8c72c7ed 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -314,6 +314,7 @@ static frontend *new_window(void)
     midend_new_game(fe->me, NULL);
 
     fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    gtk_window_set_title(GTK_WINDOW(fe->window), game_name);
 #if 0
     gtk_window_set_resizable(GTK_WINDOW(fe->window), FALSE);
 #else
diff --git a/net.c b/net.c
index cb324e8e3fe736d8640c5b6e023b5bf89e2a9900..001eaaebd2371d3a24451b9feacb480856cdd724 100644 (file)
--- a/net.c
+++ b/net.c
@@ -11,6 +11,8 @@
 #include "puzzles.h"
 #include "tree234.h"
 
+const char *const game_name = "Net";
+
 #define PI 3.141592653589793238462643383279502884197169399
 
 #define MATMUL(xr,yr,m,x,y) do { \
index 81a9a7a444f652c3643c61b665a250d0433b9b0a..ae14848971a37a706f1699f430e228d21dbb39a6 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -93,6 +93,7 @@ void random_free(random_state *state);
 /*
  * Game-specific routines
  */
+extern const char *const game_name;
 game_params *default_params(void);
 int game_fetch_preset(int i, char **name, game_params **params);
 void free_params(game_params *params);
index 29b50bc8f15bb671d0ab7a1871896ce93b710f59..4db17f4d7931a12bf5218c2b4be1a3ef05ba7b38 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -234,7 +234,7 @@ static frontend *new_window(HINSTANCE inst)
                       (WS_THICKFRAME | WS_MAXIMIZEBOX | WS_OVERLAPPED),
                       TRUE, 0);
 
-    fe->hwnd = CreateWindowEx(0, "puzzle", "puzzle",
+    fe->hwnd = CreateWindowEx(0, game_name, game_name,
                              WS_OVERLAPPEDWINDOW &~
                              (WS_THICKFRAME | WS_MAXIMIZEBOX),
                              CW_USEDEFAULT, CW_USEDEFAULT,
@@ -489,7 +489,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
        wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
        wndclass.hbrBackground = NULL;
        wndclass.lpszMenuName = NULL;
-       wndclass.lpszClassName = "puzzle";
+       wndclass.lpszClassName = game_name;
 
        RegisterClass(&wndclass);
     }