From 0c490335a9f4b78b347d8eb263918333a00abff4 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 28 Apr 2004 17:46:04 +0000 Subject: [PATCH] Have each game declare a name which is used for window titles etc. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4167 cda61777-01e9-0310-a592-d414129be87e --- cube.c | 2 ++ gtk.c | 1 + net.c | 2 ++ puzzles.h | 1 + windows.c | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cube.c b/cube.c index 934d475..e9c6e9a 100644 --- 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 8a26730..78eb8e8 100644 --- 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 cb324e8..001eaae 100644 --- 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 { \ diff --git a/puzzles.h b/puzzles.h index 81a9a7a..ae14848 100644 --- 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); diff --git a/windows.c b/windows.c index 29b50bc..4db17f4 100644 --- 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); } -- 2.11.0