GNOME Bugzilla – Bug 350070
iagno new version-3
Last modified: 2006-08-05 15:25:28 UTC
I made iagno new version. Please try this patch. file save, file open, sound, network supported. keyboard input supported but not compleat. resizeable window is not supported yet. diff -uNr gnome-games-2.14.1.org/iagno/properties.c gnome-games-2.14.1/iagno/properties.c --- gnome-games-2.14.1.org/iagno/properties.c 2006-08-05 15:32:11.000000000 +0900 +++ gnome-games-2.14.1/iagno/properties.c 2006-08-05 22:07:46.000000000 +0900 @@ -1,7 +1,5 @@ -/* -*- mode:C; indent-tabs-mode:t; tab-width:8; c-basic-offset:8; -*- */ - /* - * Properties.c - Properties and preferences part of iagno + * properties.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,689 +18,934 @@ * For more details see the file COPYING. */ -#include <config.h> -#include <gnome.h> +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> #include <string.h> -#include <gconf/gconf-client.h> -#include <games-gconf.h> -#include <games-frame.h> -#include <games-files.h> - -#include "properties.h" -#include "gnothello.h" -#include "othello.h" - -#define KEY_TILESET "/apps/iagno/tileset" -#define KEY_BLACK_LEVEL "/apps/iagno/black_level" -#define KEY_WHITE_LEVEL "/apps/iagno/white_level" -#define KEY_QUICK_MOVES "/apps/iagno/quick_moves" -#define KEY_ANIMATE "/apps/iagno/animate" -#define KEY_ANIMATE_STAGGER "/apps/iagno/animate_stagger" -#define KEY_SHOW_GRID "/apps/iagno/show_grid" -#define KEY_FLIP_FINAL_RESULTS "/apps/iagno/flip_final_results" - - -extern GtkWidget *window; -extern guint black_computer_level; -extern guint white_computer_level; -extern guint computer_speed; -extern guint black_computer_id; -extern guint white_computer_id; -extern gchar *tile_set; -extern gchar *tile_set_tmp; -extern gint8 pixmaps[8][8]; -extern gint animate; -extern gint animate_stagger; -extern gint flip_pixmaps_id; -extern gint flip_final; -extern gint grid; - -guint t_black_computer_level; -guint t_white_computer_level; -gint t_animate; -gint t_quick_moves; -gint t_animate_stagger; -gint t_flip_final; -gint t_grid; - -static GamesFileList * theme_file_list = NULL; - -static void apply_changes (void); - -/* - * FIXME: - * This was only a quick port to gconf. - * It doesn't abide by the HIG. - */ - -static gint clamp_int (gint input, gint low, gint high) -{ - if (input < low) - input = low; - if (input > high) - input = high; - - return input; -} - -void -load_properties (void) -{ - GConfClient *client; - GError *error = NULL; - - client = gconf_client_get_default (); - if (!games_gconf_sanity_check_string (client, KEY_TILESET)) { - exit(1); - } - black_computer_level = gconf_client_get_int (client, KEY_BLACK_LEVEL, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - black_computer_level = clamp_int (black_computer_level, 0, 3); - - white_computer_level = gconf_client_get_int (client, KEY_WHITE_LEVEL, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - white_computer_level = clamp_int (white_computer_level, 0, 3); - - if (gconf_client_get_bool (client, KEY_QUICK_MOVES, &error)) - computer_speed = COMPUTER_MOVE_DELAY / 2; - else - computer_speed = COMPUTER_MOVE_DELAY; - - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - - if (tile_set) - g_free (tile_set); - - tile_set = gconf_client_get_string (client, KEY_TILESET, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - if (tile_set == NULL) - tile_set = g_strdup ("classic.png"); - - animate = gconf_client_get_int (client, KEY_ANIMATE, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - animate = clamp_int (animate, 0, 2); - - animate_stagger = gconf_client_get_bool (client, KEY_ANIMATE_STAGGER, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - - grid = gconf_client_get_bool (client, KEY_SHOW_GRID, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - - flip_final = gconf_client_get_bool (client, KEY_FLIP_FINAL_RESULTS, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - - switch (animate) { - case 0: - flip_pixmaps_id = g_timeout_add (100, flip_pixmaps, &error); - break; - case 1: - flip_pixmaps_id = g_timeout_add (PIXMAP_FLIP_DELAY * 8, flip_pixmaps, NULL); - break; - default: - case 2: - flip_pixmaps_id = g_timeout_add (PIXMAP_FLIP_DELAY, flip_pixmaps, NULL); - break; - } - - g_object_unref (client); -} - -static void -reset_properties (void) -{ - GConfClient *client; - GError *error = NULL; +#include <stdio.h> - client = gconf_client_get_default (); - - black_computer_level = - gconf_client_get_int (client, KEY_BLACK_LEVEL, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - t_black_computer_level = black_computer_level - = clamp_int (black_computer_level, 0, 3); - - white_computer_level = - gconf_client_get_int (client, KEY_WHITE_LEVEL, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - t_white_computer_level = white_computer_level - = clamp_int (white_computer_level, 0, 3); - - t_quick_moves = gconf_client_get_bool (client, KEY_QUICK_MOVES, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - - if (tile_set_tmp) - g_free (tile_set_tmp); - - tile_set_tmp = gconf_client_get_string (client, KEY_TILESET, &error); - if (error) { - g_warning (G_STRLOC ": gconf error: %s\n", error->message); - g_error_free (error); - error = NULL; - } - if (tile_set_tmp == NULL) - tile_set_tmp = g_strdup("classic.png"); - - t_animate = animate; - t_animate_stagger = animate_stagger; - t_grid = grid; - t_flip_final = flip_final; - - g_object_unref (client); -} - -static void -black_computer_level_select (GtkWidget *widget, gpointer data) -{ - if ((GPOINTER_TO_INT(data) != t_black_computer_level) - && (GTK_TOGGLE_BUTTON (widget)->active)) { - t_black_computer_level = GPOINTER_TO_INT(data); - apply_changes (); - } -} - -static void -white_computer_level_select (GtkWidget *widget, gpointer data) -{ - if ((GPOINTER_TO_INT(data) != t_white_computer_level) - && (GTK_TOGGLE_BUTTON (widget)->active)) { - t_white_computer_level = GPOINTER_TO_INT(data); - apply_changes (); - } -} - -static void -quick_moves_select (GtkWidget *widget, gpointer data) -{ - if (GTK_TOGGLE_BUTTON (widget)->active) - t_quick_moves = 1; - else - t_quick_moves = 0; - apply_changes (); -} - -static void -flip_final_select (GtkWidget *widget, gpointer data) -{ - if (GTK_TOGGLE_BUTTON (widget)->active) - t_flip_final = 1; - else - t_flip_final = 0; - apply_changes (); -} - -static void -animate_stagger_select (GtkWidget *widget, gpointer data) -{ - if (GTK_TOGGLE_BUTTON (widget)->active) - t_animate_stagger = 1; - else - t_animate_stagger = 0; - apply_changes (); -} - -static void -grid_select (GtkWidget *widget, gpointer data) -{ - if (GTK_TOGGLE_BUTTON (widget)->active) - t_grid = 1; - else - t_grid = 0; - apply_changes (); -} - -static void -animate_select (GtkWidget *widget, gpointer data) -{ - if (GTK_TOGGLE_BUTTON (widget)->active) { - t_animate = GPOINTER_TO_INT(data); - } - apply_changes (); -} - -static void -save_properties (void) -{ - GConfClient *client; - - client = gconf_client_get_default (); - - gconf_client_set_int (client, KEY_BLACK_LEVEL, - black_computer_level, NULL); - gconf_client_set_int (client, KEY_WHITE_LEVEL, - white_computer_level, NULL); - - gconf_client_set_bool (client, KEY_QUICK_MOVES, - t_quick_moves, NULL); - - gconf_client_set_string (client, KEY_TILESET, - tile_set_tmp, NULL); - - gconf_client_set_int (client, KEY_ANIMATE, - animate, NULL); - - gconf_client_set_bool (client, KEY_ANIMATE_STAGGER, - animate_stagger, NULL); - gconf_client_set_bool (client, KEY_SHOW_GRID, - grid, NULL); - gconf_client_set_bool (client, KEY_FLIP_FINAL_RESULTS, - flip_final, NULL); -} - -static void -apply_changes (void) -{ - guint i, j; - - black_computer_level = t_black_computer_level; - white_computer_level = t_white_computer_level; - - if (black_computer_id) { - g_source_remove (black_computer_id); - black_computer_id = 0; - } - - if (white_computer_id) { - g_source_remove (white_computer_id); - white_computer_id = 0; - } - - if (t_quick_moves) - computer_speed = COMPUTER_MOVE_DELAY / 2; - else - computer_speed = COMPUTER_MOVE_DELAY; - - if (strcmp (tile_set, tile_set_tmp)) { - g_free (tile_set); - tile_set = g_strdup (tile_set_tmp); - load_pixmaps (); - set_bg_color (); - for (i = 0; i < 8; i++) - for (j = 0; j < 8; j++) - if (pixmaps [i][j] >= BLACK_TURN && - pixmaps[i][j] <= WHITE_TURN) - gui_draw_pixmap_buffer (pixmaps[i][j], i, j); - else - gui_draw_pixmap_buffer (0, i, j); - gui_draw_grid(); - } - - animate = t_animate; - - if (flip_pixmaps_id) { - g_source_remove (flip_pixmaps_id); - flip_pixmaps_id = 0; - } - - switch (animate) { - case 0: - flip_pixmaps_id = g_timeout_add (100, flip_pixmaps, - NULL); - break; - case 1: - flip_pixmaps_id = g_timeout_add (PIXMAP_FLIP_DELAY * 8, - flip_pixmaps, NULL); - break; - case 2: flip_pixmaps_id = g_timeout_add (PIXMAP_FLIP_DELAY, - flip_pixmaps, NULL); - break; - } - - animate_stagger = t_animate_stagger; - - flip_final = t_flip_final; - - if (grid != t_grid) { - grid = t_grid; - gui_draw_grid (); - } - - check_computer_players (); - - save_properties (); -} - -static gboolean -close_cb (GtkWidget *widget) -{ - gtk_widget_hide (widget); - - return TRUE; -} - -void -set_selection (GtkWidget *widget, gpointer data) -{ - gchar * filename; - - if (tile_set_tmp) - g_free (tile_set_tmp); - - filename = games_file_list_get_nth (theme_file_list, - gtk_combo_box_get_active (GTK_COMBO_BOX (widget))); - - tile_set_tmp = g_strdup (filename); - - apply_changes (); -} - -void -free_str (GtkWidget *widget, void *data) -{ - g_free(data); -} - -static GtkWidget * -fill_menu (void) -{ - gchar *dname = NULL; - - /* FIXME: we need to check that both dname is valid and that - * games_file_list_new_images returns something. */ - - dname = gnome_program_locate_file (NULL, - GNOME_FILE_DOMAIN_APP_PIXMAP, - "iagno", FALSE, NULL); - - if (theme_file_list) - g_object_unref (theme_file_list); - - theme_file_list = games_file_list_new_images (dname, NULL); - g_free (dname); - - games_file_list_transform_basename (theme_file_list); +#include <bonobo.h> +#include <gnome.h> - return games_file_list_create_widget (theme_file_list, tile_set, - GAMES_FILE_LIST_REMOVE_EXTENSION | - GAMES_FILE_LIST_REPLACE_UNDERSCORES); -} +#include "gnothello.h" +#include "properties.h" +#include "games-clock.h" -void -show_properties_dialog (void) -{ - GtkWidget *notebook; - GtkWidget *hbox; - GtkWidget *label; - GtkWidget *label2; - GtkWidget *table; - GtkWidget *button; - GtkWidget *frame; - GtkWidget *vbox, *vbox2; - GtkWidget *propbox = NULL; - GtkWidget *option_menu; - - if (propbox) { - gtk_window_present (GTK_WINDOW (propbox)); - return; - } - - reset_properties (); - - propbox = gtk_dialog_new_with_buttons (_("Iagno Preferences"), - GTK_WINDOW (window), - 0, - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); - - gtk_dialog_set_has_separator (GTK_DIALOG (propbox), FALSE); - gtk_container_set_border_width (GTK_CONTAINER (propbox), 5); - gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (propbox)->vbox), 2); - gtk_window_set_resizable (GTK_WINDOW (propbox), FALSE); - notebook = gtk_notebook_new (); - gtk_container_set_border_width (GTK_CONTAINER (notebook), 5); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (propbox)->vbox), - notebook); - - label = gtk_label_new (_("Players")); - - vbox = gtk_vbox_new (FALSE, 18); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), - vbox, label); - - table = gtk_table_new (1, 2, FALSE); - gtk_table_set_col_spacings (GTK_TABLE (table), 18); - gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); - - button = gtk_check_button_new_with_mnemonic (_("_Use quick moves")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - (computer_speed == COMPUTER_MOVE_DELAY / 2)); - g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK - (quick_moves_select), NULL); - - gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); - - - frame = games_frame_new (_("Dark")); - gtk_table_attach_defaults (GTK_TABLE (table), frame, 0, 1, 0, 1); - - vbox = gtk_vbox_new (FALSE, 6); - - button = gtk_radio_button_new_with_label (NULL, _("Human")); - if (black_computer_level == 0) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (black_computer_level_select), - (gpointer) 0); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Level one")); - if (black_computer_level == 1) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (black_computer_level_select), - (gpointer) 1); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Level two")); - if (black_computer_level == 2) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (black_computer_level_select), - (gpointer) 2); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Level three")); - if (black_computer_level == 3) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (black_computer_level_select), - (gpointer) 3); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox); - - frame = games_frame_new (_("Light")); - gtk_table_attach_defaults (GTK_TABLE (table), frame, 1, 2, 0, 1); - - vbox = gtk_vbox_new (FALSE, 6); - - button = gtk_radio_button_new_with_label (NULL, _("Human")); - if (white_computer_level == 0) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (white_computer_level_select), - (gpointer) 0); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Level one")); - if (white_computer_level == 1) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (white_computer_level_select), - (gpointer) 1); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Level two")); - if (white_computer_level == 2) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (white_computer_level_select), - (gpointer) 2); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), - _("Level three")); - if (white_computer_level == 3) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (white_computer_level_select), - (gpointer) 3); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - gtk_container_add (GTK_CONTAINER (frame), vbox); - - - label = gtk_label_new (_("Appearance")); - - table = gtk_table_new (1, 2, FALSE); - gtk_table_set_col_spacings (GTK_TABLE (table), 18); - gtk_container_set_border_width (GTK_CONTAINER (table), 12); - - frame = games_frame_new (_("Animation")); - - vbox = gtk_vbox_new (FALSE, 6); - - button = gtk_radio_button_new_with_label (NULL, _("None")); - if (animate == 0) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (animate_select), (gpointer) 0); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Partial")); - if (animate == 1) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (animate_select), (gpointer) 1); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_radio_button_new_with_label (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (button)), _("Complete")); - if (animate == 2) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (animate_select), (gpointer) 2); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_table_attach_defaults (GTK_TABLE (table), frame, 0, 1, 0, 1); - - frame = games_frame_new (_("Options")); - vbox = gtk_vbox_new (FALSE, 6); - gtk_container_add (GTK_CONTAINER (frame), vbox); - button = gtk_check_button_new_with_mnemonic (_("_Stagger flips")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - t_animate_stagger); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (animate_stagger_select), NULL); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - button = gtk_check_button_new_with_mnemonic (_("S_how grid")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - t_grid); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (grid_select), NULL); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - button = gtk_check_button_new_with_mnemonic (_("_Flip final results")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - t_flip_final); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (flip_final_select), NULL); - - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - hbox = gtk_hbox_new (FALSE, 12); - - label2 = gtk_label_new_with_mnemonic (_("_Tile set:")); - - gtk_box_pack_start (GTK_BOX (hbox), label2, FALSE, FALSE, 0); - - option_menu = fill_menu (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label2), option_menu); - g_signal_connect(G_OBJECT(option_menu), "changed", - G_CALLBACK (set_selection), NULL); - gtk_box_pack_start (GTK_BOX (hbox), option_menu, TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - - gtk_table_attach_defaults (GTK_TABLE (table), frame, 1, 2, 0, 1); - - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), table, - label); - - g_signal_connect (G_OBJECT (propbox), "response", G_CALLBACK - (close_cb), NULL); - g_signal_connect (G_OBJECT (propbox), "delete_event", G_CALLBACK - (close_cb), NULL); +GtkWidget *drawingarea; +GtkWidget *b_score_status; +GtkWidget *w_score_status; +GtkWidget *info_status; +GtkWidget *entry; +GtkWidget *b_time_status; +GtkWidget *w_time_status; + +extern guint t_black_computer_level; +extern guint t_white_computer_level; +extern gboolean t_quick_moves; +extern guint t_animate; +extern gboolean t_animate_stagger; +extern gboolean t_grid; +extern gboolean t_flip_final; +extern gchar *t_tile_set; + +/* This is an internally used function to create pixmaps. */ +GdkPixbuf * +create_pixbuf (const gchar *filename) +{ + gchar *pathname = NULL; + GdkPixbuf *pixbuf; + GError *error = NULL; + + if (!filename || !filename[0]) + return NULL; + + pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, + filename, TRUE, NULL); + + if (!pathname) + { + g_warning (_("Couldn't find pixmap file: %s"), filename); + return NULL; + } + + pixbuf = gdk_pixbuf_new_from_file (pathname, &error); + if (!pixbuf) + { + fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", + pathname, error->message); + g_error_free (error); + } + g_free (pathname); + return pixbuf; +} + + +#define GLADE_HOOKUP_OBJECT(component,widget,name) \ + g_object_set_data_full (G_OBJECT (component), name, \ + gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) + +#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ + g_object_set_data (G_OBJECT (component), name, widget) + +static GnomeUIInfo file_menu_uiinfo[] = +{ + GNOMEUIINFO_MENU_OPEN_ITEM (on_open_activate, NULL), + GNOMEUIINFO_MENU_SAVE_ITEM (on_save_activate, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_EXIT_ITEM (on_quit_activate, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo game_menu_uiinfo[] = +{ + GNOMEUIINFO_MENU_NEW_GAME_ITEM (on_new_game_activate, NULL), + { + GNOME_APP_UI_ITEM, N_("New Net_Work Game"), + NULL, + (gpointer) on_new_network_game_activate, NULL, NULL, + GNOME_APP_PIXMAP_NONE, NULL, + 0, (GdkModifierType) 0, NULL + }, + GNOMEUIINFO_MENU_UNDO_MOVE_ITEM (on_undo_activate, NULL), + GNOMEUIINFO_MENU_HINT_ITEM (on_hint_activate, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo setting_menu_uiinfo[] = +{ + GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preference_activate, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo Help_menu_uiinfo[] = +{ + GNOMEUIINFO_HELP ("iagno"), + GNOMEUIINFO_MENU_ABOUT_ITEM (on_about_activate, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo menubar_uiinfo[] = +{ + GNOMEUIINFO_MENU_FILE_TREE (file_menu_uiinfo), + GNOMEUIINFO_MENU_GAME_TREE (game_menu_uiinfo), + GNOMEUIINFO_MENU_SETTINGS_TREE (setting_menu_uiinfo), + GNOMEUIINFO_MENU_HELP_TREE (Help_menu_uiinfo), + GNOMEUIINFO_END +}; + + +GtkWidget * +create_window (void) +{ + GtkWidget *window; + GtkWidget *vbox1; + GtkWidget *menubar; + GtkWidget *toolbar; + GtkIconSize tmp_toolbar_icon_size; + GtkWidget *newbutton; + GtkWidget *undobutton; + GtkWidget *headbutton; + GtkWidget *backbutton; + GtkWidget *forwardbutton; + GtkWidget *lastbutton; + GtkWidget *infobutton; + GtkWidget *quitbutton; + GtkWidget *hbox1; + GtkWidget *b_score_label; + GtkWidget *w_score_label; + GtkWidget *b_time_label; + GtkWidget *w_time_label; + GtkWidget *hbox2; + GtkAccelGroup *accel_group; + + accel_group = gtk_accel_group_new (); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (window), _("iagno")); + gtk_window_set_resizable (GTK_WINDOW (window), FALSE); + gtk_window_set_destroy_with_parent (GTK_WINDOW (window), TRUE); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox1); + gtk_container_add (GTK_CONTAINER (window), vbox1); + + menubar = gtk_menu_bar_new (); + gtk_widget_show (menubar); + gtk_box_pack_start (GTK_BOX (vbox1), menubar, FALSE, FALSE, 0); + gnome_app_fill_menu (GTK_MENU_SHELL (menubar), menubar_uiinfo, + accel_group, FALSE, 0); + + toolbar = gtk_toolbar_new (); + gtk_widget_show (toolbar); + gtk_box_pack_start (GTK_BOX (vbox1), toolbar, FALSE, FALSE, 0); + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH); + tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar)); + + newbutton = (GtkWidget *) gtk_tool_button_new_from_stock ("gtk-new"); + gtk_widget_show (newbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (newbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), newbutton); + gtk_container_set_border_width (GTK_CONTAINER (newbutton), 1); + + undobutton = (GtkWidget *) gtk_tool_button_new_from_stock ("gtk-undo"); + gtk_widget_show (undobutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (undobutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), undobutton); + gtk_container_set_border_width (GTK_CONTAINER (undobutton), 1); + + headbutton = (GtkWidget *) gtk_tool_button_new_from_stock ("gtk-goto-first"); + gtk_widget_show (headbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (headbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), headbutton); + gtk_container_set_border_width (GTK_CONTAINER (headbutton), 1); + gtk_widget_add_accelerator (headbutton, "clicked", accel_group, + GDK_F, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK, + GTK_ACCEL_VISIBLE); + + backbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-go-back"); + gtk_widget_show (backbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (backbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), backbutton); + gtk_container_set_border_width (GTK_CONTAINER (backbutton), 1); + gtk_widget_add_accelerator (backbutton, "clicked", accel_group, + GDK_B, (GdkModifierType) GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); + + forwardbutton = + (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-go-forward"); + gtk_widget_show (forwardbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (forwardbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), forwardbutton); + gtk_container_set_border_width (GTK_CONTAINER (forwardbutton), 1); + gtk_widget_add_accelerator (forwardbutton, "clicked", accel_group, + GDK_F, (GdkModifierType) GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); + + lastbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-goto-last"); + gtk_widget_show (lastbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (lastbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), lastbutton); + gtk_container_set_border_width (GTK_CONTAINER (lastbutton), 1); + gtk_widget_add_accelerator (lastbutton, "clicked", accel_group, + GDK_L, (GdkModifierType) GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); + + infobutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-dialog-info"); + gtk_widget_show (infobutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (infobutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), infobutton); + gtk_container_set_border_width (GTK_CONTAINER (infobutton), 1); + gtk_widget_add_accelerator (infobutton, "clicked", accel_group, + GDK_H, (GdkModifierType) GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); + + quitbutton = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-quit"); + gtk_widget_show (quitbutton); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (quitbutton), FALSE); + gtk_container_add (GTK_CONTAINER (toolbar), quitbutton); + gtk_container_set_border_width (GTK_CONTAINER (quitbutton), 1); + + + drawingarea = gtk_drawing_area_new (); + gtk_widget_show (drawingarea); + gtk_box_pack_start (GTK_BOX (vbox1), drawingarea, FALSE, FALSE, 0); + gtk_widget_set_size_request (drawingarea, BOARDWIDTH, BOARDHEIGHT); + gtk_widget_set_events (drawingarea, GDK_BUTTON_PRESS_MASK); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0); + + b_score_label = gtk_label_new (_("Dark:")); + gtk_widget_show (b_score_label); + gtk_box_pack_start (GTK_BOX (hbox1), b_score_label, TRUE, TRUE, 0); + + b_score_status = gtk_label_new (_("00")); + gtk_widget_show (b_score_status); + gtk_box_pack_start (GTK_BOX (hbox1), b_score_status, TRUE, TRUE, 0); + + w_score_label = gtk_label_new (_("Light:")); + gtk_widget_show (w_score_label); + gtk_box_pack_start (GTK_BOX (hbox1), w_score_label, TRUE, TRUE, 0); + + w_score_status = gtk_label_new (_("00")); + gtk_widget_show (w_score_status); + gtk_box_pack_start (GTK_BOX (hbox1), w_score_status, TRUE, TRUE, 0); + + b_time_label = gtk_label_new (_("Dark:")); + gtk_widget_show (b_time_label); + gtk_box_pack_start (GTK_BOX (hbox1), b_time_label, TRUE, TRUE, 0); + + b_time_status = games_clock_new (); + gtk_widget_show (b_time_status); + gtk_box_pack_start (GTK_BOX (hbox1), b_time_status, TRUE, TRUE, 0); + + w_time_label = gtk_label_new (_("Light:")); + gtk_widget_show (w_time_label); + gtk_box_pack_start (GTK_BOX (hbox1), w_time_label, TRUE, TRUE, 0); + + w_time_status = games_clock_new (); + gtk_widget_show (w_time_status); + gtk_box_pack_start (GTK_BOX (hbox1), w_time_status, TRUE, TRUE, 0); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox1), hbox2, TRUE, TRUE, 0); + + info_status = gtk_statusbar_new (); + gtk_widget_show (info_status); + gtk_box_pack_start (GTK_BOX (hbox2), info_status, TRUE, TRUE, 0); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (info_status), FALSE); + + entry = gtk_entry_new (); + gtk_widget_set_name (entry, "entry"); + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (hbox2), entry, FALSE, FALSE, 0); + gtk_widget_add_accelerator (entry, "notify", accel_group, + GDK_Return, (GdkModifierType) 0, + GTK_ACCEL_VISIBLE); + gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); + + g_signal_connect ((gpointer) window, "destroy", + G_CALLBACK (gtk_main_quit), NULL); + g_signal_connect ((gpointer) newbutton, "clicked", + G_CALLBACK (on_newbutton_clicked), NULL); + g_signal_connect ((gpointer) undobutton, "clicked", + G_CALLBACK (on_undobutton_clicked), NULL); + g_signal_connect ((gpointer) headbutton, "clicked", + G_CALLBACK (on_headbutton_clicked), NULL); + g_signal_connect ((gpointer) backbutton, "clicked", + G_CALLBACK (on_backbutton_clicked), NULL); + g_signal_connect ((gpointer) forwardbutton, "clicked", + G_CALLBACK (on_forwardbutton_clicked), NULL); + g_signal_connect ((gpointer) lastbutton, "clicked", + G_CALLBACK (on_lastbutton_clicked), NULL); + g_signal_connect ((gpointer) infobutton, "clicked", + G_CALLBACK (on_infobutton_clicked), NULL); + g_signal_connect ((gpointer) quitbutton, "clicked", + G_CALLBACK (on_quitbutton_clicked), NULL); + g_signal_connect ((gpointer) drawingarea, "expose_event", + G_CALLBACK (on_drawingarea_expose_event), NULL); + g_signal_connect ((gpointer) drawingarea, "button_press_event", + G_CALLBACK (on_drawingarea_button_press_event), NULL); + g_signal_connect ((gpointer) entry, "notify", + G_CALLBACK (on_entry_notify), NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (window, window, "window"); + GLADE_HOOKUP_OBJECT (window, vbox1, "vbox1"); + GLADE_HOOKUP_OBJECT (window, menubar, "menubar"); + GLADE_HOOKUP_OBJECT (window, menubar_uiinfo[0].widget, "file"); + GLADE_HOOKUP_OBJECT (window, file_menu_uiinfo[0].widget, "open"); + GLADE_HOOKUP_OBJECT (window, file_menu_uiinfo[1].widget, "save"); + GLADE_HOOKUP_OBJECT (window, file_menu_uiinfo[3].widget, "separator1"); + GLADE_HOOKUP_OBJECT (window, file_menu_uiinfo[4].widget, "quit"); + GLADE_HOOKUP_OBJECT (window, menubar_uiinfo[1].widget, "game"); + GLADE_HOOKUP_OBJECT (window, game_menu_uiinfo[0].widget, "new_game"); + GLADE_HOOKUP_OBJECT (window, game_menu_uiinfo[1].widget, "new_network_game"); + GLADE_HOOKUP_OBJECT (window, game_menu_uiinfo[2].widget, "undo"); + GLADE_HOOKUP_OBJECT (window, game_menu_uiinfo[3].widget, "hint"); + GLADE_HOOKUP_OBJECT (window, menubar_uiinfo[2].widget, "setting"); + GLADE_HOOKUP_OBJECT (window, setting_menu_uiinfo[0].widget, "preference"); + GLADE_HOOKUP_OBJECT (window, menubar_uiinfo[3].widget, "Help"); + GLADE_HOOKUP_OBJECT (window, Help_menu_uiinfo[0].widget, "help"); + GLADE_HOOKUP_OBJECT (window, Help_menu_uiinfo[1].widget, "about"); + GLADE_HOOKUP_OBJECT (window, toolbar, "toolbar"); + GLADE_HOOKUP_OBJECT (window, newbutton, "newbutton"); + GLADE_HOOKUP_OBJECT (window, undobutton, "undobutton"); + GLADE_HOOKUP_OBJECT (window, headbutton, "headbutton"); + GLADE_HOOKUP_OBJECT (window, backbutton, "backbutton"); + GLADE_HOOKUP_OBJECT (window, forwardbutton, "forwardbutton"); + GLADE_HOOKUP_OBJECT (window, lastbutton, "lastbutton"); + GLADE_HOOKUP_OBJECT (window, infobutton, "infobutton"); + GLADE_HOOKUP_OBJECT (window, quitbutton, "quitbutton"); + GLADE_HOOKUP_OBJECT (window, drawingarea, "drawingarea"); + GLADE_HOOKUP_OBJECT (window, hbox1, "hbox1"); + GLADE_HOOKUP_OBJECT (window, b_score_label, "b_score_label"); + GLADE_HOOKUP_OBJECT (window, b_score_status, "b_score_status"); + GLADE_HOOKUP_OBJECT (window, w_score_label, "w_score_label"); + GLADE_HOOKUP_OBJECT (window, w_score_status, "w_score_status"); + GLADE_HOOKUP_OBJECT (window, b_time_label, "b_time_label"); + GLADE_HOOKUP_OBJECT (window, b_time_status, "b_time_status"); + GLADE_HOOKUP_OBJECT (window, w_time_label, "w_time_label"); + GLADE_HOOKUP_OBJECT (window, w_time_status, "w_time_status"); + GLADE_HOOKUP_OBJECT (window, hbox2, "hbox2"); + GLADE_HOOKUP_OBJECT (window, info_status, "info_status"); + GLADE_HOOKUP_OBJECT (window, entry, "entry"); + + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); + + return window; +} + +GtkWidget * +create_about_dialog (void) +{ + GtkWidget *about_dialog; + const gchar *authors[] = { + "Ian Peters", + NULL + }; + /* TRANSLATORS: Replace this string with your names, one name per line. */ + gchar *translators = _("translator-credits"); + GdkPixbuf *about_dialog_logo_pixbuf; + + about_dialog = gtk_about_dialog_new (); + gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about_dialog), VERSION); + gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (about_dialog), _("Iagno")); + gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (about_dialog), + _("Copyright (c) 1998-2004 Ian Peters")); + gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (about_dialog), + _("A disk flipping game derived from Reversi.")); + gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (about_dialog), authors); + gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG + (about_dialog), translators); + about_dialog_logo_pixbuf = create_pixbuf ("iagno.png"); + gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about_dialog), + about_dialog_logo_pixbuf); + + g_signal_connect ((gpointer) about_dialog, "close", + G_CALLBACK (gtk_widget_hide), NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (about_dialog, about_dialog, "about_dialog"); + + return about_dialog; +} + +GtkWidget * +create_propaties_dialog (void) +{ + GtkWidget *propaties_dialog; + GtkWidget *dialog_vbox2; + GtkWidget *notebook; + GtkWidget *vbox17; + GtkWidget *hbox13; + GtkWidget *frame2; + GtkWidget *alignment2; + GtkWidget *vbox18; + GtkWidget *b_human; + GSList *b_human_group = NULL; + GtkWidget *b_level1; + GtkWidget *b_level2; + GtkWidget *b_level3; + GtkWidget *Dark; + GtkWidget *frame3; + GtkWidget *alignment3; + GtkWidget *vbox19; + GtkWidget *w_human; + GSList *w_human_group = NULL; + GtkWidget *w_level1; + GtkWidget *w_level2; + GtkWidget *w_level3; + GtkWidget *Light; + GtkWidget *quick_moves; + GtkWidget *Players; + GtkWidget *hbox14; + GtkWidget *frame4; + GtkWidget *alignment4; + GtkWidget *vbox20; + GtkWidget *none; + GSList *none_group = NULL; + GtkWidget *partial; + GtkWidget *complete; + GtkWidget *Animation; + GtkWidget *frame5; + GtkWidget *alignment5; + GtkWidget *vbox21; + GtkWidget *stagger_flips; + GtkWidget *show_grid; + GtkWidget *flip_final_results; + GtkWidget *hbox15; + GtkWidget *Tile_set; + GtkWidget *tile_set_box; + GtkWidget *Options; + GtkWidget *Appearance; + GtkWidget *dialog_action_area2; + GtkWidget *apply_button; + GtkWidget *cancel_button; + GtkWidget *ok_button; + + propaties_dialog = gtk_dialog_new (); + gtk_window_set_title (GTK_WINDOW (propaties_dialog), + _("Iagno Preferences")); + gtk_window_set_resizable (GTK_WINDOW (propaties_dialog), FALSE); + gtk_window_set_type_hint (GTK_WINDOW (propaties_dialog), + GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog_vbox2 = GTK_DIALOG (propaties_dialog)->vbox; + gtk_widget_show (dialog_vbox2); + + notebook = gtk_notebook_new (); + gtk_widget_show (notebook); + gtk_box_pack_start (GTK_BOX (dialog_vbox2), notebook, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (notebook), 5); + + vbox17 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox17); + gtk_container_add (GTK_CONTAINER (notebook), vbox17); + + hbox13 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox13); + gtk_box_pack_start (GTK_BOX (vbox17), hbox13, TRUE, TRUE, 0); + + frame2 = gtk_frame_new (NULL); + gtk_widget_show (frame2); + gtk_box_pack_start (GTK_BOX (hbox13), frame2, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE); + + alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment2); + gtk_container_add (GTK_CONTAINER (frame2), alignment2); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0); + + vbox18 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox18); + gtk_container_add (GTK_CONTAINER (alignment2), vbox18); + + b_human = gtk_radio_button_new_with_mnemonic (NULL, _("Human")); + gtk_widget_show (b_human); + gtk_box_pack_start (GTK_BOX (vbox18), b_human, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (b_human), b_human_group); + b_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b_human)); + if (t_black_computer_level == 0) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_human), TRUE); + + b_level1 = gtk_radio_button_new_with_mnemonic (NULL, _("Level one")); + gtk_widget_show (b_level1); + gtk_box_pack_start (GTK_BOX (vbox18), b_level1, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (b_level1), b_human_group); + b_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b_level1)); + if (t_black_computer_level == 1) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_level1), TRUE); + + b_level2 = gtk_radio_button_new_with_mnemonic (NULL, _("Level two")); + gtk_widget_show (b_level2); + gtk_box_pack_start (GTK_BOX (vbox18), b_level2, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (b_level2), b_human_group); + b_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b_level2)); + if (t_black_computer_level == 2) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_level2), TRUE); + + b_level3 = gtk_radio_button_new_with_mnemonic (NULL, _("Level three")); + gtk_widget_show (b_level3); + gtk_box_pack_start (GTK_BOX (vbox18), b_level3, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (b_level3), b_human_group); + b_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b_level3)); + if (t_black_computer_level == 3) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_level3), TRUE); + + Dark = gtk_label_new (_("Dark")); + gtk_widget_show (Dark); + gtk_frame_set_label_widget (GTK_FRAME (frame2), Dark); + gtk_label_set_use_markup (GTK_LABEL (Dark), TRUE); + + frame3 = gtk_frame_new (NULL); + gtk_widget_show (frame3); + gtk_box_pack_start (GTK_BOX (hbox13), frame3, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_NONE); + + alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (frame3), alignment3); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 0, 0, 12, 0); + + vbox19 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox19); + gtk_container_add (GTK_CONTAINER (alignment3), vbox19); + + w_human = gtk_radio_button_new_with_mnemonic (NULL, _("Human")); + gtk_widget_show (w_human); + gtk_box_pack_start (GTK_BOX (vbox19), w_human, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (w_human), w_human_group); + w_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w_human)); + if (t_white_computer_level == 0) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w_human), TRUE); + + w_level1 = gtk_radio_button_new_with_mnemonic (NULL, _("Level one")); + gtk_widget_show (w_level1); + gtk_box_pack_start (GTK_BOX (vbox19), w_level1, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (w_level1), w_human_group); + w_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w_level1)); + if (t_white_computer_level == 1) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w_level1), TRUE); + + w_level2 = gtk_radio_button_new_with_mnemonic (NULL, _("Level two")); + gtk_widget_show (w_level2); + gtk_box_pack_start (GTK_BOX (vbox19), w_level2, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (w_level2), w_human_group); + w_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w_level2)); + if (t_white_computer_level == 2) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w_level2), TRUE); + + w_level3 = gtk_radio_button_new_with_mnemonic (NULL, _("Level three")); + gtk_widget_show (w_level3); + gtk_box_pack_start (GTK_BOX (vbox19), w_level3, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (w_level3), w_human_group); + w_human_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w_level3)); + if (t_white_computer_level == 3) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w_level3), TRUE); + + Light = gtk_label_new (_("Light")); + gtk_widget_show (Light); + gtk_frame_set_label_widget (GTK_FRAME (frame3), Light); + gtk_label_set_use_markup (GTK_LABEL (Light), TRUE); + + quick_moves = gtk_check_button_new_with_mnemonic (_("_Use quick moves")); + gtk_widget_show (quick_moves); + gtk_box_pack_start (GTK_BOX (vbox17), quick_moves, FALSE, FALSE, 0); + if (t_quick_moves == 2) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (quick_moves), TRUE); + + Players = gtk_label_new (_("Players")); + gtk_widget_show (Players); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), + gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0), Players); + + hbox14 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox14); + gtk_container_add (GTK_CONTAINER (notebook), hbox14); + + frame4 = gtk_frame_new (NULL); + gtk_widget_show (frame4); + gtk_box_pack_start (GTK_BOX (hbox14), frame4, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_NONE); + + alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment4); + gtk_container_add (GTK_CONTAINER (frame4), alignment4); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0); + + vbox20 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox20); + gtk_container_add (GTK_CONTAINER (alignment4), vbox20); + + none = gtk_radio_button_new_with_mnemonic (NULL, _("None")); + gtk_widget_show (none); + gtk_box_pack_start (GTK_BOX (vbox20), none, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (none), none_group); + none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (none)); + if (t_animate == 0) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (none), TRUE); + + partial = gtk_radio_button_new_with_mnemonic (NULL, _("Partial")); + gtk_widget_show (partial); + gtk_box_pack_start (GTK_BOX (vbox20), partial, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (partial), none_group); + none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (partial)); + if (t_animate == 1) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (partial), TRUE); + + complete = gtk_radio_button_new_with_mnemonic (NULL, _("Complete")); + gtk_widget_show (complete); + gtk_box_pack_start (GTK_BOX (vbox20), complete, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (complete), none_group); + none_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (complete)); + if (t_animate == 2) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (complete), TRUE); + + Animation = gtk_label_new (_("Animation")); + gtk_widget_show (Animation); + gtk_frame_set_label_widget (GTK_FRAME (frame4), Animation); + gtk_label_set_use_markup (GTK_LABEL (Animation), TRUE); + + frame5 = gtk_frame_new (NULL); + gtk_widget_show (frame5); + gtk_box_pack_start (GTK_BOX (hbox14), frame5, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame5), GTK_SHADOW_NONE); + + alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment5); + gtk_container_add (GTK_CONTAINER (frame5), alignment5); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment5), 0, 0, 12, 0); + + vbox21 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox21); + gtk_container_add (GTK_CONTAINER (alignment5), vbox21); + + stagger_flips = gtk_check_button_new_with_mnemonic (_("_Stagger flips")); + gtk_widget_show (stagger_flips); + gtk_box_pack_start (GTK_BOX (vbox21), stagger_flips, FALSE, FALSE, 0); + if (t_animate_stagger) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (stagger_flips), TRUE); + + show_grid = gtk_check_button_new_with_mnemonic (_("S_how grid")); + gtk_widget_show (show_grid); + gtk_box_pack_start (GTK_BOX (vbox21), show_grid, FALSE, FALSE, 0); + if (t_grid == 1) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_grid), TRUE); + + flip_final_results = + gtk_check_button_new_with_mnemonic (_("_Flip final results")); + gtk_widget_show (flip_final_results); + gtk_box_pack_start (GTK_BOX (vbox21), flip_final_results, FALSE, FALSE, 0); + if (t_flip_final) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flip_final_results), TRUE); + + hbox15 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox15); + gtk_box_pack_start (GTK_BOX (vbox21), hbox15, FALSE, FALSE, 0); + + Tile_set = gtk_label_new (_("_Tile Set: ")); + gtk_widget_show (Tile_set); + gtk_box_pack_start (GTK_BOX (hbox15), Tile_set, FALSE, FALSE, 0); + + tile_set_box = gtk_combo_box_new_text (); + gtk_widget_show (tile_set_box); + gtk_box_pack_start (GTK_BOX (hbox15), tile_set_box, FALSE, FALSE, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (tile_set_box), _("classic.png")); + gtk_combo_box_append_text (GTK_COMBO_BOX (tile_set_box), _("woodtrim.png")); + if (g_str_equal (t_tile_set, _("woodtrim.png"))) + gtk_combo_box_set_active (GTK_COMBO_BOX (tile_set_box), 1); + else + gtk_combo_box_set_active (GTK_COMBO_BOX (tile_set_box), 0); + + Options = gtk_label_new (_("Options")); + gtk_widget_show (Options); + gtk_frame_set_label_widget (GTK_FRAME (frame5), Options); + gtk_label_set_use_markup (GTK_LABEL (Options), TRUE); + + Appearance = gtk_label_new (_("Appearance")); + gtk_widget_show (Appearance); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), + gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), Appearance); + + dialog_action_area2 = GTK_DIALOG (propaties_dialog)->action_area; + gtk_widget_show (dialog_action_area2); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), + GTK_BUTTONBOX_END); + + apply_button = gtk_button_new_from_stock ("gtk-apply"); + gtk_widget_show (apply_button); + gtk_dialog_add_action_widget (GTK_DIALOG (propaties_dialog), + apply_button, GTK_RESPONSE_APPLY); + GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); + + cancel_button = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_show (cancel_button); + gtk_dialog_add_action_widget (GTK_DIALOG (propaties_dialog), + cancel_button, GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + ok_button = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_show (ok_button); + gtk_dialog_add_action_widget (GTK_DIALOG (propaties_dialog), + ok_button, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) propaties_dialog, "close", + G_CALLBACK (gtk_widget_hide), NULL); + g_signal_connect ((gpointer) b_human, "toggled", + G_CALLBACK (on_bcomputer_level_changed), + GINT_TO_POINTER (0)); + g_signal_connect ((gpointer) b_level1, "toggled", + G_CALLBACK (on_bcomputer_level_changed), + GINT_TO_POINTER (1)); + g_signal_connect ((gpointer) b_level2, "toggled", + G_CALLBACK (on_bcomputer_level_changed), + GINT_TO_POINTER (2)); + g_signal_connect ((gpointer) b_level3, "toggled", + G_CALLBACK (on_bcomputer_level_changed), + GINT_TO_POINTER (3)); + g_signal_connect ((gpointer) w_human, "toggled", + G_CALLBACK (on_wcomputer_level_changed), + GINT_TO_POINTER (0)); + g_signal_connect ((gpointer) w_level1, "toggled", + G_CALLBACK (on_wcomputer_level_changed), + GINT_TO_POINTER (1)); + g_signal_connect ((gpointer) w_level2, "toggled", + G_CALLBACK (on_wcomputer_level_changed), + GINT_TO_POINTER (2)); + g_signal_connect ((gpointer) w_level3, "toggled", + G_CALLBACK (on_wcomputer_level_changed), + GINT_TO_POINTER (3)); + g_signal_connect ((gpointer) quick_moves, "toggled", + G_CALLBACK (on_quick_moves_toggled), NULL); + g_signal_connect ((gpointer) none, "toggled", + G_CALLBACK (on_animate_changed), GINT_TO_POINTER (0)); + g_signal_connect ((gpointer) partial, "toggled", + G_CALLBACK (on_animate_changed), GINT_TO_POINTER (1)); + g_signal_connect ((gpointer) complete, "toggled", + G_CALLBACK (on_animate_changed), GINT_TO_POINTER (2)); + g_signal_connect ((gpointer) stagger_flips, "toggled", + G_CALLBACK (on_stagger_flips_toggled), NULL); + g_signal_connect ((gpointer) show_grid, "toggled", + G_CALLBACK (on_show_grid_toggled), NULL); + g_signal_connect ((gpointer) flip_final_results, "toggled", + G_CALLBACK (on_flip_final_results_toggled), NULL); + g_signal_connect ((gpointer) tile_set_box, "changed", + G_CALLBACK (on_tile_set_changed), NULL); + g_signal_connect ((gpointer) apply_button, "clicked", + G_CALLBACK (on_apply_button_clicked), NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_propaties_cancel_clicked), NULL); + g_signal_connect ((gpointer) ok_button, "clicked", + G_CALLBACK (on_ok_button_clicked), NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (propaties_dialog, propaties_dialog, + "propaties_dialog"); + GLADE_HOOKUP_OBJECT_NO_REF (propaties_dialog, dialog_vbox2, "dialog_vbox2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, notebook, "notebook"); + GLADE_HOOKUP_OBJECT (propaties_dialog, vbox17, "vbox17"); + GLADE_HOOKUP_OBJECT (propaties_dialog, hbox13, "hbox13"); + GLADE_HOOKUP_OBJECT (propaties_dialog, frame2, "frame2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, alignment2, "alignment2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, vbox18, "vbox18"); + GLADE_HOOKUP_OBJECT (propaties_dialog, b_human, "b_human"); + GLADE_HOOKUP_OBJECT (propaties_dialog, b_level1, "b_level1"); + GLADE_HOOKUP_OBJECT (propaties_dialog, b_level2, "b_level2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, b_level3, "b_level3"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Dark, "Dark"); + GLADE_HOOKUP_OBJECT (propaties_dialog, frame3, "frame3"); + GLADE_HOOKUP_OBJECT (propaties_dialog, alignment3, "alignment3"); + GLADE_HOOKUP_OBJECT (propaties_dialog, vbox19, "vbox19"); + GLADE_HOOKUP_OBJECT (propaties_dialog, w_human, "w_human"); + GLADE_HOOKUP_OBJECT (propaties_dialog, w_level1, "w_level1"); + GLADE_HOOKUP_OBJECT (propaties_dialog, w_level2, "w_level2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, w_level3, "w_level3"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Light, "Light"); + GLADE_HOOKUP_OBJECT (propaties_dialog, quick_moves, "quick_moves"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Players, "Players"); + GLADE_HOOKUP_OBJECT (propaties_dialog, hbox14, "hbox14"); + GLADE_HOOKUP_OBJECT (propaties_dialog, frame4, "frame4"); + GLADE_HOOKUP_OBJECT (propaties_dialog, alignment4, "alignment4"); + GLADE_HOOKUP_OBJECT (propaties_dialog, vbox20, "vbox20"); + GLADE_HOOKUP_OBJECT (propaties_dialog, none, "none"); + GLADE_HOOKUP_OBJECT (propaties_dialog, partial, "partial"); + GLADE_HOOKUP_OBJECT (propaties_dialog, complete, "complete"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Animation, "Animation"); + GLADE_HOOKUP_OBJECT (propaties_dialog, frame5, "frame5"); + GLADE_HOOKUP_OBJECT (propaties_dialog, alignment5, "alignment5"); + GLADE_HOOKUP_OBJECT (propaties_dialog, vbox21, "vbox21"); + GLADE_HOOKUP_OBJECT (propaties_dialog, stagger_flips, "stagger_flips"); + GLADE_HOOKUP_OBJECT (propaties_dialog, show_grid, "show_grid"); + GLADE_HOOKUP_OBJECT (propaties_dialog, flip_final_results, + "flip_final_results"); + GLADE_HOOKUP_OBJECT (propaties_dialog, hbox15, "hbox15"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Tile_set, "Tile_set"); + GLADE_HOOKUP_OBJECT (propaties_dialog, tile_set_box, "tile_set_box"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Options, "Options"); + GLADE_HOOKUP_OBJECT (propaties_dialog, Appearance, "Appearance"); + GLADE_HOOKUP_OBJECT_NO_REF (propaties_dialog, dialog_action_area2, + "dialog_action_area2"); + GLADE_HOOKUP_OBJECT (propaties_dialog, apply_button, "apply_button"); + GLADE_HOOKUP_OBJECT (propaties_dialog, cancel_button, "cancel_button"); + GLADE_HOOKUP_OBJECT (propaties_dialog, ok_button, "ok_button"); + + return propaties_dialog; +} + +GtkWidget * +create_file_open_dialog (void) +{ + GtkWidget *file_open_dialog; + GtkWidget *dialog_vbox3; + GtkWidget *dialog_action_area3; + GtkWidget *cancel_button; + GtkWidget *open_button; + + file_open_dialog = + gtk_file_chooser_dialog_new ("", NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, NULL); + gtk_window_set_type_hint (GTK_WINDOW (file_open_dialog), + GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog_vbox3 = GTK_DIALOG (file_open_dialog)->vbox; + gtk_widget_show (dialog_vbox3); + + dialog_action_area3 = GTK_DIALOG (file_open_dialog)->action_area; + gtk_widget_show (dialog_action_area3); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), + GTK_BUTTONBOX_END); + + cancel_button = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_show (cancel_button); + gtk_dialog_add_action_widget (GTK_DIALOG (file_open_dialog), + cancel_button, GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + open_button = gtk_button_new_from_stock ("gtk-open"); + gtk_widget_show (open_button); + gtk_dialog_add_action_widget (GTK_DIALOG (file_open_dialog), + open_button, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (open_button, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) file_open_dialog, "close", + G_CALLBACK (gtk_widget_hide), NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_file_open_cancel_clicked), NULL); + g_signal_connect ((gpointer) open_button, "clicked", + G_CALLBACK (on_open_button_clicked), NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (file_open_dialog, file_open_dialog, + "file_open_dialog"); + GLADE_HOOKUP_OBJECT_NO_REF (file_open_dialog, dialog_vbox3, "dialog_vbox3"); + GLADE_HOOKUP_OBJECT_NO_REF (file_open_dialog, dialog_action_area3, + "dialog_action_area3"); + GLADE_HOOKUP_OBJECT (file_open_dialog, cancel_button, "cancel_button"); + GLADE_HOOKUP_OBJECT (file_open_dialog, open_button, "open_button"); + + gtk_widget_grab_default (open_button); + return file_open_dialog; +} + +GtkWidget * +create_file_save_dialog (void) +{ + GtkWidget *file_save_dialog; + GtkWidget *dialog_vbox4; + GtkWidget *dialog_action_area4; + GtkWidget *cancel_button; + GtkWidget *save_button; + + file_save_dialog = + gtk_file_chooser_dialog_new ("", NULL, + GTK_FILE_CHOOSER_ACTION_SAVE, NULL); + gtk_window_set_type_hint (GTK_WINDOW (file_save_dialog), + GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog_vbox4 = GTK_DIALOG (file_save_dialog)->vbox; + gtk_widget_show (dialog_vbox4); + + dialog_action_area4 = GTK_DIALOG (file_save_dialog)->action_area; + gtk_widget_show (dialog_action_area4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area4), + GTK_BUTTONBOX_END); + + cancel_button = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_show (cancel_button); + gtk_dialog_add_action_widget (GTK_DIALOG (file_save_dialog), + cancel_button, GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); + + save_button = gtk_button_new_from_stock ("gtk-save"); + gtk_widget_show (save_button); + gtk_dialog_add_action_widget (GTK_DIALOG (file_save_dialog), + save_button, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (save_button, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) file_save_dialog, "close", + G_CALLBACK (gtk_widget_hide), NULL); + g_signal_connect ((gpointer) cancel_button, "clicked", + G_CALLBACK (on_file_save_cancel_clicked), NULL); + g_signal_connect ((gpointer) save_button, "clicked", + G_CALLBACK (on_save_button_clicked), NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (file_save_dialog, file_save_dialog, + "file_save_dialog"); + GLADE_HOOKUP_OBJECT_NO_REF (file_save_dialog, dialog_vbox4, "dialog_vbox4"); + GLADE_HOOKUP_OBJECT_NO_REF (file_save_dialog, dialog_action_area4, + "dialog_action_area4"); + GLADE_HOOKUP_OBJECT (file_save_dialog, cancel_button, "cancel_button"); + GLADE_HOOKUP_OBJECT (file_save_dialog, save_button, "save_button"); - gtk_widget_show_all (propbox); + gtk_widget_grab_default (save_button); + return file_save_dialog; } diff -uNr gnome-games-2.14.1.org/iagno/properties.h gnome-games-2.14.1/iagno/properties.h --- gnome-games-2.14.1.org/iagno/properties.h 2006-08-05 15:32:11.000000000 +0900 +++ gnome-games-2.14.1/iagno/properties.h 2006-08-05 15:32:35.000000000 +0900 @@ -1,7 +1,31 @@ +/* + * properties.h + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For more details see the file COPYING. + */ + #ifndef _PROPERTIES_H_ #define _PROPERTIES_H_ -void load_properties (void); -void show_properties_dialog (void); +GdkPixbuf* create_pixbuf (const gchar *filename); +GtkWidget* create_window (void); +GtkWidget* create_about_dialog (void); +GtkWidget* create_propaties_dialog (void); +GtkWidget* create_file_open_dialog (void); +GtkWidget* create_file_save_dialog (void); #endif
Please attach the patches instead. *** This bug has been marked as a duplicate of 350068 ***