move unmaintained files into outdated folder
If an old port is resurrected to work with current version code, its files can be relocated to the appropriate sys or win folder as required. In the meantime, the burden of upkeep can be avoided for the stuff in the outdated folder for now.
This commit is contained in:
1
outdated/win/gnome/.gitattributes
vendored
Normal file
1
outdated/win/gnome/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* NH_filestag=(file%s_for_GNOME_versions_-_untested_for_3.7)
|
||||
53
outdated/win/gnome/README
Normal file
53
outdated/win/gnome/README
Normal file
@@ -0,0 +1,53 @@
|
||||
This directory contains the windowing code written for GnomeHack. The NetHack
|
||||
devteam is in the process of making it part of the normal distribution.
|
||||
It should be noted that this is still work in progress and that there are
|
||||
still problems with this code. So use at your own risk. Of course any
|
||||
contributions, especially bug fixes, are more than welcome!
|
||||
|
||||
These files are based on the files from GnomeHack 1.0.5 by Erik Andersen.
|
||||
Some files have been renamed to fit into 8.3 name constraints (yuk!).
|
||||
These are:
|
||||
|
||||
GnomeHack.h gnomeprv.h
|
||||
GnomeHackAskStringDialog.c gnaskstr.c
|
||||
GnomeHackAskStringDialog.h gnaskstr.h
|
||||
GnomeHackBind.c gnbind.c
|
||||
GnomeHackBind.h gnbind.h
|
||||
GnomeHackGlyph.c gnglyph.c
|
||||
GnomeHackGlyph.h gnglyph.h
|
||||
GnomeHackMainWindow.c gnmain.c
|
||||
GnomeHackMainWindow.h gnmain.h
|
||||
GnomeHackMapWindow.c gnmap.c
|
||||
GnomeHackMapWindow.h gnmap.h
|
||||
GnomeHackMenuWindow.c gnmenu.c
|
||||
GnomeHackMenuWindow.h gnmenu.h
|
||||
GnomeHackMessageWindow.c gnmesg.c
|
||||
GnomeHackMessageWindow.h gnmesg.h
|
||||
GnomeHackPlayerSelDialog.c gnplayer.c
|
||||
GnomeHackPlayerSelDialog.h gnplayer.h
|
||||
GnomeHackSettings.c gnopts.c
|
||||
GnomeHackSettings.h gnopts.h
|
||||
GnomeHackSignals.c gnsignal.c
|
||||
GnomeHackSignals.h gnsignal.h
|
||||
GnomeHackStatusWindow.c gnstatus.c
|
||||
GnomeHackStatusWindow.h gnstatus.h
|
||||
GnomeHackTextWindow.c gntext.c
|
||||
GnomeHackTextWindow.h gntext.h
|
||||
GnomeHackYesNoDialog.c gnyesno.c
|
||||
GnomeHackYesNoDialog.h gnyesno.h
|
||||
|
||||
Other files have been removed because we don't or can't use them (yet).
|
||||
|
||||
Makefile.am
|
||||
Makefile.in
|
||||
gnomehack.desktop
|
||||
gnomehack.desktop.in
|
||||
|
||||
NetHack currently doesn't use autoconf, so the setup for that has not
|
||||
made the translation.
|
||||
|
||||
Note: All loss in style, elegance, and readability is entirely our fault
|
||||
and not Erik's.
|
||||
|
||||
|
||||
|
||||
1451
outdated/win/gnome/gn_xpms.h
Normal file
1451
outdated/win/gnome/gn_xpms.h
Normal file
File diff suppressed because it is too large
Load Diff
57
outdated/win/gnome/gnaskstr.c
Normal file
57
outdated/win/gnome/gnaskstr.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/* NetHack 3.6 gnaskstr.c $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnaskstr.h"
|
||||
#include "gnmain.h"
|
||||
#include <gnome.h>
|
||||
|
||||
static void
|
||||
ghack_ask_string_callback(gchar *string, gpointer data)
|
||||
{
|
||||
char **user_text = (char **) data;
|
||||
|
||||
g_assert(user_text != NULL);
|
||||
|
||||
*user_text = string; /* note - value must be g_free'd */
|
||||
}
|
||||
|
||||
int
|
||||
ghack_ask_string_dialog(const char *szMessageStr, const char *szDefaultStr,
|
||||
const char *szTitleStr, char *buffer)
|
||||
{
|
||||
int i;
|
||||
GtkWidget *dialog;
|
||||
gchar *user_text = NULL;
|
||||
|
||||
dialog =
|
||||
gnome_request_dialog(FALSE, szMessageStr, szDefaultStr, 0,
|
||||
ghack_ask_string_callback, &user_text, NULL);
|
||||
g_assert(dialog != NULL);
|
||||
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), szTitleStr);
|
||||
|
||||
gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
|
||||
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(dialog),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
|
||||
i = gnome_dialog_run_and_close(GNOME_DIALOG(dialog));
|
||||
|
||||
/* Quit */
|
||||
if (i != 0 || user_text == NULL) {
|
||||
if (user_text)
|
||||
g_free(user_text);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (*user_text == 0) {
|
||||
g_free(user_text);
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_assert(strlen(user_text) > 0);
|
||||
strcpy(buffer, user_text);
|
||||
g_free(user_text);
|
||||
return 0;
|
||||
}
|
||||
12
outdated/win/gnome/gnaskstr.h
Normal file
12
outdated/win/gnome/gnaskstr.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* NetHack 3.6 gnaskstr.h $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackAskStringDialog_h
|
||||
#define GnomeHackAskStringDialog_h
|
||||
|
||||
int ghack_ask_string_dialog(const char *szMessageStr,
|
||||
const char *szDefaultStr, const char *szTitleStr,
|
||||
char *buffer);
|
||||
|
||||
#endif /* GnomeHackAskStringDialog_h */
|
||||
1192
outdated/win/gnome/gnbind.c
Normal file
1192
outdated/win/gnome/gnbind.c
Normal file
File diff suppressed because it is too large
Load Diff
88
outdated/win/gnome/gnbind.h
Normal file
88
outdated/win/gnome/gnbind.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/* NetHack 3.6 gnbind.h $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackBind_h
|
||||
#define GnomeHackBind_h
|
||||
|
||||
/*
|
||||
* This header files defines the interface between the window port specific
|
||||
* code in the Gnome port and the rest of the nethack game engine.
|
||||
*/
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "gnomeprv.h"
|
||||
#include "gnmain.h"
|
||||
#include "gnmap.h"
|
||||
#include "gnmenu.h"
|
||||
#include "gnplayer.h"
|
||||
#include "gnsignal.h"
|
||||
#include "gnstatus.h"
|
||||
#include "gntext.h"
|
||||
#include "gnmesg.h"
|
||||
#include "gnyesno.h"
|
||||
#include "gnglyph.h"
|
||||
#include "gnworn.h"
|
||||
|
||||
/* Create an array to keep track of the various windows */
|
||||
|
||||
#ifndef MAXWINDOWS
|
||||
#define MAXWINDOWS 15
|
||||
#endif
|
||||
|
||||
typedef struct gnome_nhwindow_data {
|
||||
GtkWidget *win;
|
||||
int type;
|
||||
} GNHWinData;
|
||||
|
||||
/* Some prototypes */
|
||||
void gnome_init_nhwindows(int *argc, char **argv);
|
||||
void gnome_player_selection(void);
|
||||
void gnome_askname(void);
|
||||
void gnome_get_nh_event(void);
|
||||
void gnome_exit_nhwindows(const char *);
|
||||
void gnome_suspend_nhwindows(const char *);
|
||||
void gnome_resume_nhwindows(void);
|
||||
winid gnome_create_nhwindow(int type);
|
||||
void gnome_create_nhwindow_by_id(int type, winid i);
|
||||
void gnome_clear_nhwindow(winid wid);
|
||||
void gnome_display_nhwindow(winid wid, BOOLEAN_P block);
|
||||
void gnome_destroy_nhwindow(winid wid);
|
||||
void gnome_curs(winid wid, int x, int y);
|
||||
void gnome_putstr(winid wid, int attr, const char *text);
|
||||
void gnome_display_file(const char *filename, BOOLEAN_P must_exist);
|
||||
void gnome_start_menu(winid wid, unsigned long mbehavior);
|
||||
void gnome_add_menu(winid wid, int glyph, const ANY_P *identifier,
|
||||
CHAR_P accelerator, CHAR_P group_accel, int attr,
|
||||
const char *str, BOOLEAN_P presel);
|
||||
void gnome_end_menu(winid wid, const char *prompt);
|
||||
int gnome_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
||||
/* No need for message_menu -- we'll use genl_message_menu instead */
|
||||
void gnome_update_inventory(void);
|
||||
void gnome_mark_synch(void);
|
||||
void gnome_wait_synch(void);
|
||||
void gnome_cliparound(int x, int y);
|
||||
/* The following function does the right thing. The nethack
|
||||
* gnome_cliparound (which lacks the winid) simply calls this function.
|
||||
*/
|
||||
void gnome_cliparound_proper(winid wid, int x, int y);
|
||||
void gnome_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph);
|
||||
void gnome_raw_print(const char *str);
|
||||
void gnome_raw_print_bold(const char *str);
|
||||
int gnome_nhgetch(void);
|
||||
int gnome_nh_poskey(int *x, int *y, int *mod);
|
||||
void gnome_nhbell(void);
|
||||
int gnome_doprev_message(void);
|
||||
char gnome_yn_function(const char *question, const char *choices, CHAR_P def);
|
||||
void gnome_getlin(const char *question, char *input);
|
||||
int gnome_get_ext_cmd(void);
|
||||
void gnome_number_pad(int state);
|
||||
void gnome_delay_output(void);
|
||||
void gnome_start_screen(void);
|
||||
void gnome_end_screen(void);
|
||||
void gnome_outrip(winid wid, int how, time_t when);
|
||||
void gnome_delete_nhwindow_by_reference(GtkWidget *menuWin);
|
||||
|
||||
#endif /* GnomeHackBind_h */
|
||||
221
outdated/win/gnome/gnglyph.c
Normal file
221
outdated/win/gnome/gnglyph.c
Normal file
@@ -0,0 +1,221 @@
|
||||
/* NetHack 3.6 gnglyph.c $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnglyph.h"
|
||||
#include "tile2x11.h"
|
||||
|
||||
/* from tile.c */
|
||||
extern int total_tiles_used;
|
||||
|
||||
static GHackGlyphs ghack_glyphs;
|
||||
static GdkImlibImage **ghack_tiles = NULL;
|
||||
|
||||
/* NAME:
|
||||
* ghack_init_glyphs(char* xpm_file)
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* char *xpm_file -- The name of the image file.
|
||||
* May be any image format imlib recognizes.
|
||||
* Does not have to be XPM.
|
||||
*
|
||||
* RETURNS:
|
||||
* TRUE upon successful loading of the glyphs.
|
||||
* FALSE upon failure.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Constructor for the Glyph object. Well, really each glyph
|
||||
* object is a collection of glyphs, or tiles. This constructor
|
||||
* takes a single argument: the name of the image file that contains
|
||||
* the tile images.
|
||||
*
|
||||
* NOTES:
|
||||
* The glyphs (tiles) must be in the image in a certain way: the
|
||||
* glyphs must be stacked such that the resultant image is
|
||||
* TILE_X * TILES_PER_ROW wide, and
|
||||
* TILE_Y * (number of glyphs) / TILES_PER_ROW high (rounded up).
|
||||
* In this sense, TILE_X == TILE_Y, and can be any reasonable integer
|
||||
* say, 16 <= TILE_X <= 64. Because the glyph number is tightly
|
||||
* coupled to the Nethack object it represents, the order of the
|
||||
* glyphs in the image is imporant: Glyph 1 is at the top of the
|
||||
* image, while Glyph N (the last glyph) is at the bottom.
|
||||
*
|
||||
* What's the difference between a glyph and a tile? Well, a
|
||||
* tile is just an image. A glyph is a tile that knows its
|
||||
* place in line.
|
||||
*
|
||||
* This initializer relies heavily on gdk_imlib. Thanks, Rasterman.
|
||||
*/
|
||||
|
||||
int
|
||||
ghack_init_glyphs(const char *xpmFile)
|
||||
{
|
||||
ghack_glyphs.im = gdk_imlib_load_image((char *) xpmFile);
|
||||
if (!ghack_glyphs.im) {
|
||||
g_error("Couldn't load required xpmFile!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdk_imlib_render(ghack_glyphs.im, ghack_glyphs.im->rgb_width,
|
||||
ghack_glyphs.im->rgb_height);
|
||||
|
||||
if ((ghack_glyphs.im->rgb_width % TILES_PER_ROW) != 0
|
||||
|| ghack_glyphs.im->rgb_width <= TILES_PER_ROW) {
|
||||
g_error(
|
||||
"%s is not a multiple of %d (number of tiles/row) pixels wide",
|
||||
xpmFile, TILES_PER_ROW);
|
||||
return -1;
|
||||
}
|
||||
ghack_glyphs.count = total_tiles_used;
|
||||
if ((ghack_glyphs.count % TILES_PER_ROW) != 0) {
|
||||
ghack_glyphs.count +=
|
||||
TILES_PER_ROW - (ghack_glyphs.count % TILES_PER_ROW);
|
||||
}
|
||||
ghack_glyphs.width = ghack_glyphs.im->rgb_width / TILES_PER_ROW;
|
||||
ghack_glyphs.height =
|
||||
ghack_glyphs.im->rgb_height / (ghack_glyphs.count / TILES_PER_ROW);
|
||||
|
||||
/* Assume the tiles are organized in rows of TILES_PER_ROW */
|
||||
ghack_tiles = g_new0(GdkImlibImage *, ghack_glyphs.count);
|
||||
return (ghack_tiles == NULL) ? -1 : 0;
|
||||
}
|
||||
|
||||
void
|
||||
ghack_free_glyphs()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ghack_glyphs.count; i++)
|
||||
gdk_imlib_destroy_image(ghack_tiles[i]);
|
||||
g_free(ghack_tiles);
|
||||
gdk_imlib_destroy_image(ghack_glyphs.im);
|
||||
ghack_glyphs.im = NULL;
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_glyph_count( )
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* None.
|
||||
*
|
||||
* RETURNS:
|
||||
* int -- The number of glyphs in this object.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Simply reports the number of glyphs in this object.
|
||||
*/
|
||||
|
||||
int
|
||||
ghack_glyph_count()
|
||||
{
|
||||
return ghack_glyphs.count;
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_glyph_height()
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* None
|
||||
*
|
||||
* RETURNS:
|
||||
* int -- The glyph height.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Returns the standard glyph height.
|
||||
*/
|
||||
|
||||
int
|
||||
ghack_glyph_height()
|
||||
{
|
||||
return ghack_glyphs.height;
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_glyph_width()
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* None
|
||||
*
|
||||
* RETURNS:
|
||||
* int -- The glyph width.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Returns the standard glyph width.
|
||||
*/
|
||||
|
||||
int
|
||||
ghack_glyph_width()
|
||||
{
|
||||
return ghack_glyphs.width;
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_image_from_glyph( int glyph, gboolean force)
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* int glyph -- The glyph number.
|
||||
* gboolean force -- force it to re-render.
|
||||
*
|
||||
* RETURNS:
|
||||
* GdkImlibImage* -- The glyph image, as a GdkImlibImage.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Decodes the glyph into an image suitable for manipulation
|
||||
*/
|
||||
|
||||
GdkImlibImage *
|
||||
ghack_image_from_glyph(int glyph, gboolean force)
|
||||
{
|
||||
int tile = glyph2tile[glyph];
|
||||
|
||||
if (tile >= ghack_glyphs.count || tile < 0) {
|
||||
g_warning(
|
||||
"Aiiee! I've was asked for a tile outside the allowed range!\n"
|
||||
"Email this to other-gnomehack@lists.debian.org");
|
||||
g_warning("Max tile: %d Tile asked for: %d", ghack_glyphs.count,
|
||||
tile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ghack_glyphs.im == NULL) {
|
||||
g_warning("Aiiee! I've been asked to clone from a null image.\n"
|
||||
"Email this to other-gnomehack@lists.debian.org");
|
||||
g_warning("making image from tile %d, force=%s\n", tile,
|
||||
(force == TRUE) ? "TRUE" : "FALSE");
|
||||
}
|
||||
|
||||
if (force == TRUE) {
|
||||
g_warning("Aiiee! I've been asked to force rendering.\n"
|
||||
"Email this to other-gnomehack@lists.debian.org");
|
||||
g_warning("making image from tile %d, force=%s\n", tile,
|
||||
(force == TRUE) ? "TRUE" : "FALSE");
|
||||
}
|
||||
|
||||
if (!ghack_tiles[tile] || force) {
|
||||
int src_x, src_y;
|
||||
#if 0
|
||||
fprintf( stderr, "crop_and_clone: glyph=%d, tile=%d, ptr=%p, x=%d, y=%d, w=%d, h=%d\n", glyph, tile,
|
||||
(void*)&(ghack_tiles[tile]), 0,
|
||||
tile * ghack_glyphs.width,
|
||||
ghack_glyphs.height,
|
||||
ghack_glyphs.width);
|
||||
#endif
|
||||
if (ghack_glyphs.im->pixmap == NULL)
|
||||
g_warning("Aiiee! ghack_glyphs.im->pixmap==NULL!!!!\n");
|
||||
src_x = (tile % TILES_PER_ROW) * ghack_glyphs.width;
|
||||
src_y = (tile / TILES_PER_ROW) * ghack_glyphs.height;
|
||||
ghack_tiles[tile] = gdk_imlib_crop_and_clone_image(
|
||||
ghack_glyphs.im, src_x, src_y, ghack_glyphs.width,
|
||||
ghack_glyphs.height);
|
||||
}
|
||||
|
||||
if (ghack_tiles[tile] && (!ghack_tiles[tile]->pixmap || force)) {
|
||||
if (gdk_imlib_render(ghack_tiles[tile], ghack_tiles[tile]->rgb_width,
|
||||
ghack_tiles[tile]->rgb_height) == 0) {
|
||||
g_error("GLYPH: couldn't create tile # %d", tile);
|
||||
}
|
||||
if (!ghack_tiles[tile]->pixmap)
|
||||
g_error("Strange, tile # %d didn't get rendered???", tile);
|
||||
}
|
||||
|
||||
return ghack_tiles[tile];
|
||||
}
|
||||
41
outdated/win/gnome/gnglyph.h
Normal file
41
outdated/win/gnome/gnglyph.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* NetHack 3.6 gnglyph.h $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackGlyph_h
|
||||
#define GnomeHackGlyph_h
|
||||
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
/* the prototypes in system headers contain useless argument names
|
||||
that trigger spurious warnings if gcc's `-Wshadow' option is used */
|
||||
#undef index
|
||||
#define index _hide_index_
|
||||
#define time _hide_time_
|
||||
|
||||
#include <gdk_imlib.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#undef index
|
||||
#define index strchr
|
||||
#undef time
|
||||
|
||||
extern short glyph2tile[]; /* From tile.c */
|
||||
|
||||
typedef struct {
|
||||
GdkImlibImage *im;
|
||||
int count;
|
||||
int width;
|
||||
int height;
|
||||
} GHackGlyphs;
|
||||
|
||||
extern int ghack_init_glyphs(const char *);
|
||||
extern void ghack_free_glyphs(void);
|
||||
extern void ghack_dispose_glyphs(void);
|
||||
extern int ghack_glyph_count(void);
|
||||
extern GdkImlibImage *ghack_image_from_glyph(int, gboolean);
|
||||
extern int ghack_glyph_height(void);
|
||||
extern int ghack_glyph_width(void);
|
||||
|
||||
#endif /* GnomeHackGlyph_h */
|
||||
706
outdated/win/gnome/gnmain.c
Normal file
706
outdated/win/gnome/gnmain.c
Normal file
@@ -0,0 +1,706 @@
|
||||
/* NetHack 3.6 gnmain.c $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnmain.h"
|
||||
#include "gnsignal.h"
|
||||
#include "gnbind.h"
|
||||
#include "gnopts.h"
|
||||
#include <gnome.h>
|
||||
#include <getopt.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include "hack.h"
|
||||
#include "date.h"
|
||||
|
||||
static GtkWidget *mainWindow = NULL;
|
||||
static GtkWidget *about = NULL;
|
||||
static GtkWidget *hBoxFirstRow;
|
||||
static GtkWidget *vBoxMain;
|
||||
|
||||
int restarted = 0;
|
||||
int os_x = 0, os_y = 0, os_w = 0, os_h = 0;
|
||||
|
||||
static GnomeClient *session_id;
|
||||
|
||||
static void
|
||||
ghack_quit_game(GtkWidget *widget, int button)
|
||||
{
|
||||
gtk_widget_hide(widget);
|
||||
if (button == 0) {
|
||||
gnome_exit_nhwindows(0);
|
||||
gtk_object_unref(GTK_OBJECT(session_id));
|
||||
clearlocks();
|
||||
gtk_exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_quit_game_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget *box;
|
||||
box = gnome_message_box_new(
|
||||
_("Do you really want to quit?"), GNOME_MESSAGE_BOX_QUESTION,
|
||||
GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, NULL);
|
||||
gnome_dialog_set_default(GNOME_DIALOG(box), 1);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(box),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 1, 'n', 0);
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 0, 'y', 0);
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(box), TRUE);
|
||||
gtk_signal_connect(GTK_OBJECT(box), "clicked",
|
||||
(GtkSignalFunc) ghack_quit_game, NULL);
|
||||
gtk_widget_show(box);
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_save_game(GtkWidget *widget, int button)
|
||||
{
|
||||
gtk_widget_hide(widget);
|
||||
if (button == 0) {
|
||||
if (dosave0()) {
|
||||
/* make sure they see the Saving message */
|
||||
display_nhwindow(WIN_MESSAGE, TRUE);
|
||||
gnome_exit_nhwindows("Be seeing you...");
|
||||
clearlocks();
|
||||
gtk_exit(0);
|
||||
} else
|
||||
(void) doredraw();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ghack_save_game_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget *box;
|
||||
box = gnome_message_box_new(
|
||||
_("Quit and save the current game?"), GNOME_MESSAGE_BOX_QUESTION,
|
||||
GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, NULL);
|
||||
gnome_dialog_set_default(GNOME_DIALOG(box), 1);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(box),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 1, 'n', 0);
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 0, 'y', 0);
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(box), TRUE);
|
||||
gtk_signal_connect(GTK_OBJECT(box), "clicked",
|
||||
(GtkSignalFunc) ghack_save_game, NULL);
|
||||
gtk_widget_show(box);
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_new_game(GtkWidget *widget, int button)
|
||||
{
|
||||
if (button == 0) {
|
||||
g_message("This feature is not yet implemented. Sorry.");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_new_game_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget *box;
|
||||
box = gnome_message_box_new(
|
||||
_("Start a new game?"), GNOME_MESSAGE_BOX_QUESTION,
|
||||
GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, NULL);
|
||||
gnome_dialog_set_default(GNOME_DIALOG(box), 1);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(box),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 1, 'n', 0);
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 0, 'y', 0);
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(box), TRUE);
|
||||
gtk_signal_connect(GTK_OBJECT(box), "clicked",
|
||||
(GtkSignalFunc) ghack_new_game, NULL);
|
||||
gtk_widget_show(box);
|
||||
}
|
||||
|
||||
static void
|
||||
about_destroy_callback(void)
|
||||
{
|
||||
about = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_about_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
char buf[BUFSZ] = "\0";
|
||||
char buf1[BUFSZ] = "\0";
|
||||
const gchar *authors[] = { "Erik Andersen", "Anthony Taylor",
|
||||
"Jeff Garzik", "The Nethack Dev Team", NULL };
|
||||
|
||||
if (about) {
|
||||
gdk_window_raise(about->window);
|
||||
return;
|
||||
}
|
||||
|
||||
getversionstring(buf);
|
||||
#if 0
|
||||
/* XXX this needs further re-write to use DEVTEAM_EMAIL, DEVTEAM_URL,
|
||||
* sysopt.support, etc. I'm not doing it now because I can't test
|
||||
* it yet. (keni)
|
||||
*/
|
||||
/* out of date first cut: */
|
||||
! len = strlen(buf);
|
||||
! char *str1 = _("\nSend comments and bug reports to:\n");
|
||||
! len += strlen(str1);
|
||||
! len += sysopt.email;
|
||||
! char *str2 = _("\nThis game is free software. See License for details.");
|
||||
! len += strlen(str2);
|
||||
! str = (char*)alloc(len+1);
|
||||
! strcat(buf, str1);
|
||||
! strcat(buf, sysopt.email);
|
||||
! strcat(buf, str2);
|
||||
free(str) below
|
||||
#else
|
||||
strcat(buf1, VERSION_STRING);
|
||||
strcat(buf,
|
||||
_("\nSend comments and bug reports to: nethack-bugs@nethack.org\n"
|
||||
"This game is free software. See License for details."));
|
||||
#endif
|
||||
about = gnome_about_new(_("Nethack"), buf1,
|
||||
"Copyright (C) 1985-2002 Mike Stephenson",
|
||||
(const char **) authors, buf, NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(about), "destroy",
|
||||
(GtkSignalFunc) about_destroy_callback, NULL);
|
||||
|
||||
gtk_widget_show(about);
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_settings_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
ghack_settings_dialog();
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_accelerator_selected(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GdkEventKey event;
|
||||
int key = GPOINTER_TO_INT(data);
|
||||
/* g_message("An accelerator for \"%c\" was selected", key); */
|
||||
/* stuff a key directly into the keybuffer */
|
||||
event.state = 0;
|
||||
event.keyval = key;
|
||||
ghack_handle_key_press(NULL, &event, NULL);
|
||||
}
|
||||
|
||||
#ifndef M
|
||||
#ifndef NHSTDC
|
||||
#define M(c) (0x80 | (c))
|
||||
#else
|
||||
#define M(c) ((c) -128)
|
||||
#endif /* NHSTDC */
|
||||
#endif
|
||||
#ifndef C
|
||||
#define C(c) (0x1f & (c))
|
||||
#endif
|
||||
|
||||
GnomeUIInfo game_tree[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("_Change Settings..."),
|
||||
N_("Change Game Settings"), ghack_settings_cb, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Version"), NULL, ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('v'), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, 'v', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("History..."), NULL, ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('V'), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, 'V', GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Compilation..."), NULL,
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('v')), NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, 'v', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Options..."), NULL, ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('O'), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_PREF, 'O', GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Explore Mode..."), NULL,
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('X'), NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_QUIT, 'X', GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
GNOMEUIINFO_MENU_NEW_GAME_ITEM(ghack_new_game_cb, NULL),
|
||||
GNOMEUIINFO_MENU_SAVE_ITEM(ghack_save_game_cb, NULL),
|
||||
{ GNOME_APP_UI_ITEM, N_("Exit"), NULL, ghack_quit_game_cb,
|
||||
GINT_TO_POINTER(M('Q')), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, 'Q', GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo edit_menu[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("Inventory"), N_("Edit/View your Inventory"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('i'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'i', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Discoveries"), N_("Edit/View your Discoveries"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('\\'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, '\\', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("List/reorder your spells"),
|
||||
N_("List/reorder your spells"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('x'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'x', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Adjust letters"),
|
||||
N_("Adjust letter for items in your Inventory"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('a')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'a', GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Name object"), N_("Assign a name to an object"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('n')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'n', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Name creature"),
|
||||
N_("Assign a name to a creature"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('C'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'C',
|
||||
GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Qualifications"), N_("Edit your Qualifications"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('e')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'e', GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo apparel_menu[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("Wield Weapon"),
|
||||
N_("Select a weapon to fight with"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('w'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'w', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Remove Apparel..."),
|
||||
N_("Remove apparel dialog bog"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('A'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'A',
|
||||
GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Wear Armor"), N_("Put on armor"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('W'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'W', GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Take off Armor"),
|
||||
N_("Take off armor you are wearing"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('T'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'T',
|
||||
GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Put on non-armor"),
|
||||
N_("Put on non-armor apparel"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('P'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'P',
|
||||
GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Remove non-armor"),
|
||||
N_("Remove non-armor apparel you are wearing"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('R'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'R', GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo action_menu[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("Get"),
|
||||
N_("Pick up things at the current location"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(','), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, ',', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Loot"), N_("loot a box on the floor"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('l')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'l', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Sit"), N_("sit down"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('s')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 's', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Force"), N_("force a lock"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('f')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'f', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Kick"), N_("kick something (usually a door)"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(C('d')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'd', GDK_CONTROL_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Jump"), N_("jump to another location"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('j')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'j', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Ride"), N_("Ride (or stop riding) a monster"),
|
||||
doride, GINT_TO_POINTER(M('r')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'R',
|
||||
GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Wipe face"), N_("wipe off your face"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('w')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'w', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Throw/Shoot"), N_("throw or shoot a weapon"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('t'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 't', 0 },
|
||||
{
|
||||
GNOME_APP_UI_ITEM, N_("Quiver/Ready"),
|
||||
N_("ready or quiver some ammunition"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('Q'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'Q',
|
||||
GDK_SHIFT_MASK,
|
||||
},
|
||||
{ GNOME_APP_UI_ITEM, N_("Open Door"), N_("open a door"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('o'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'o', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Close Door"), N_("open a door"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('c'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'c', 0 },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Drop"), N_("drop an object"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('d'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'd', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Drop Many"),
|
||||
N_("drop selected types of objects"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('D'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'D',
|
||||
GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Eat"), N_("eat something"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('e'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'e', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Engrave"),
|
||||
N_("write a message in the dust on the floor"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('E'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'E', GDK_SHIFT_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Apply"),
|
||||
N_("apply or use a tool (pick-axe, key, camera, etc.)"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('a'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'a', 0 },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Up"), N_("go up the stairs"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('<'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, '<', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Down"), N_("go down the stairs"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('>'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, '>', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Rest"), N_("wait for a moment"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('.'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, '.', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Search"),
|
||||
N_("search for secret doors, hidden traps and monsters"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('s'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 's', 0 },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Chat"), N_("talk to someone"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('c')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'c', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Pay"), N_("pay your bill to the shopkeeper"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('p'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'p', 0 },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo magic_menu[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("Quaff potion"), N_("drink a potion"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('q'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'q', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Read Book/Scroll"),
|
||||
N_("read a spell book or a scroll"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('r'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'r', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Zap Wand"), N_("zap a wand"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('z'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'z', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Zap Spell"), N_("cast a spell"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER('Z'), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'Z', GDK_SHIFT_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Dip"), N_("dip an object into something"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('d')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'd', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Rub"), N_("Rub something (i.e. a lamp)"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('r')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'r', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Invoke"),
|
||||
N_("invoke an object's special powers"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER(M('i')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'i',
|
||||
GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Offer"), N_("offer a sacrifice to the gods"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('o')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'o', GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Pray"), N_("pray to the gods for help"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('p')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 'p', GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("Teleport"), N_("teleport (if you can)"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(C('t')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 't', GDK_CONTROL_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Monster Action"),
|
||||
N_("use a monster's special ability"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER(M('m')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'm',
|
||||
GDK_MOD1_MASK },
|
||||
{ GNOME_APP_UI_ITEM, N_("Turn Undead"), N_("turn undead"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(M('t')), NULL,
|
||||
GNOME_APP_PIXMAP_NONE, NULL, 't', GDK_MOD1_MASK },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo help_menu[] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("About..."), N_("About GnomeHack"),
|
||||
ghack_about_cb, NULL, NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, 0, 0, NULL },
|
||||
{ GNOME_APP_UI_ITEM, N_("Help"), NULL, ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('?'), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, '?', 0 },
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
{ GNOME_APP_UI_ITEM, N_("What is here"),
|
||||
N_("Check what items occupy the current location"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(':'), NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, ':', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("What is that"), N_("Identify an object"),
|
||||
ghack_accelerator_selected, GINT_TO_POINTER(';'), NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, ';', 0 },
|
||||
{ GNOME_APP_UI_ITEM, N_("Identify a map symbol"),
|
||||
N_("Identify a map symbol"), ghack_accelerator_selected,
|
||||
GINT_TO_POINTER('/'), NULL, GNOME_APP_PIXMAP_STOCK,
|
||||
GNOME_STOCK_MENU_ABOUT, '/', 0 },
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
GnomeUIInfo mainmenu[] = { GNOMEUIINFO_MENU_GAME_TREE(game_tree),
|
||||
GNOMEUIINFO_MENU_EDIT_TREE(edit_menu),
|
||||
{ GNOME_APP_UI_SUBTREE, N_("Apparel"), NULL,
|
||||
apparel_menu, NULL, NULL, 0, NULL, 0, 0, NULL },
|
||||
{ GNOME_APP_UI_SUBTREE, N_("Action"), NULL,
|
||||
action_menu, NULL, NULL, 0, NULL, 0, 0, NULL },
|
||||
{ GNOME_APP_UI_SUBTREE, N_("Magic"), NULL,
|
||||
magic_menu, NULL, NULL, 0, NULL, 0, 0, NULL },
|
||||
GNOMEUIINFO_MENU_HELP_TREE(help_menu),
|
||||
GNOMEUIINFO_END };
|
||||
|
||||
static void
|
||||
ghack_main_window_key_press(GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
/* First, turn off the key press propogation. We've got the
|
||||
* key, but we don't wan't the underlying Gtk widgets to get it,
|
||||
* since they do the wrong thing with the arrow keys (shift focus)... */
|
||||
gtk_signal_emit_stop_by_name(GTK_OBJECT(mainWindow), "key_press_event");
|
||||
|
||||
/* stuff the key event into the keybuffer */
|
||||
ghack_handle_key_press(widget, event, data);
|
||||
}
|
||||
|
||||
/* parsing args */
|
||||
void
|
||||
parse_args(int argc, char *argv[])
|
||||
{
|
||||
gint ch;
|
||||
|
||||
struct option options[] = { /* Default args */
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "version", no_argument, NULL, 'v' },
|
||||
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
gchar *id = NULL;
|
||||
|
||||
/* initialize getopt */
|
||||
optarg = NULL;
|
||||
optind = 0;
|
||||
optopt = 0;
|
||||
|
||||
while ((ch = getopt_long(argc, argv, "hv", options, NULL)) != EOF) {
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
g_print(
|
||||
_("%s: A gnomified 'Hello World' program\n\n"
|
||||
"Usage: %s [--help] [--version]\n\n"
|
||||
"Options:\n"
|
||||
" --help display this help and exit\n"
|
||||
" --version output version information and exit\n"),
|
||||
argv[0], argv[0]);
|
||||
exit(0);
|
||||
break;
|
||||
case 'v':
|
||||
g_print(_("NetHack %s.\n"), VERSION_STRING);
|
||||
exit(0);
|
||||
break;
|
||||
case ':':
|
||||
case '?':
|
||||
g_print(_("Options error\n"));
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* SM stuff */
|
||||
session_id = gnome_client_new();
|
||||
#if 0
|
||||
session_id = gnome_client_new (
|
||||
/* callback to save the state and parameter for it */
|
||||
save_state, argv[0],
|
||||
/* callback to die and parameter for it */
|
||||
NULL, NULL,
|
||||
/* id from the previous session if restarted, NULL otherwise */
|
||||
id);
|
||||
#endif
|
||||
/* set the program name */
|
||||
gnome_client_set_program(session_id, argv[0]);
|
||||
g_free(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* [ALI] Gnome installs its own handler(s) for SIGBUS, SIGFPE and SIGSEGV.
|
||||
* These handlers will fork and exec a helper program. When that helper
|
||||
* comes to initialize GTK+, it may fail if setuid/setgid. We solve this
|
||||
* by dropping privileges before passing the signal along the chain.
|
||||
* Note: We don't need to either drop or mask the saved ID since this
|
||||
* will be reset when the child process performs the execve() anyway.
|
||||
*/
|
||||
|
||||
static struct {
|
||||
int signum;
|
||||
void (*handler)(int);
|
||||
} ghack_chain[] = {
|
||||
{ SIGBUS },
|
||||
{ SIGFPE },
|
||||
{ SIGSEGV },
|
||||
{ SIGILL } /* Not currently handled by Gnome */
|
||||
};
|
||||
|
||||
static void
|
||||
ghack_sig_handler(int signum)
|
||||
{
|
||||
int i;
|
||||
uid_t uid, euid;
|
||||
gid_t gid, egid;
|
||||
uid = getuid();
|
||||
euid = geteuid();
|
||||
gid = getgid();
|
||||
egid = getegid();
|
||||
if (gid != egid)
|
||||
setgid(gid);
|
||||
if (uid != euid)
|
||||
setuid(uid);
|
||||
for (i = SIZE(ghack_chain) - 1; i >= 0; i--)
|
||||
if (ghack_chain[i].signum == signum) {
|
||||
ghack_chain[i].handler(signum);
|
||||
break;
|
||||
}
|
||||
if (i < 0)
|
||||
impossible("Unhandled ghack signal");
|
||||
if (uid != euid)
|
||||
setuid(euid);
|
||||
if (gid != egid)
|
||||
setgid(egid);
|
||||
}
|
||||
|
||||
/* initialize gnome and fir up the main window */
|
||||
void
|
||||
ghack_init_main_window(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
struct timeval tv;
|
||||
uid_t uid, euid;
|
||||
|
||||
/* It seems that the authors of gnome_score_init() drop group
|
||||
* priveledges. We need group priveledges, so until we change the
|
||||
* way we save games to do things the gnome way(???), this stays
|
||||
* commented out. (after hours of frusteration...)
|
||||
* -Erik
|
||||
*/
|
||||
/* gnome_score_init("gnomehack"); */
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
srand(tv.tv_usec);
|
||||
|
||||
uid = getuid();
|
||||
euid = geteuid();
|
||||
if (uid != euid)
|
||||
setuid(uid);
|
||||
hide_privileges(TRUE);
|
||||
/* XXX gnome_init must print nethack options for --help, but does not */
|
||||
gnome_init("nethack", VERSION_STRING, argc, argv);
|
||||
hide_privileges(FALSE);
|
||||
parse_args(argc, argv);
|
||||
|
||||
/* Initialize the i18n stuff (not that gnomehack supperts it yet...) */
|
||||
#if 0
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
gdk_imlib_init();
|
||||
|
||||
/* Main window */
|
||||
mainWindow =
|
||||
gnome_app_new((char *) "nethack", (char *) N_("Nethack for Gnome"));
|
||||
gtk_widget_realize(mainWindow);
|
||||
if (restarted) {
|
||||
gtk_widget_set_uposition(mainWindow, os_x, os_y);
|
||||
gtk_widget_set_usize(mainWindow, os_w, os_h);
|
||||
}
|
||||
gtk_window_set_default_size(GTK_WINDOW(mainWindow), 800, 600);
|
||||
gtk_window_set_policy(GTK_WINDOW(mainWindow), FALSE, TRUE, TRUE);
|
||||
gnome_app_create_menus(GNOME_APP(mainWindow), mainmenu);
|
||||
gtk_signal_connect(GTK_OBJECT(mainWindow), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(ghack_main_window_key_press), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(mainWindow), "delete_event",
|
||||
GTK_SIGNAL_FUNC(ghack_quit_game_cb), NULL);
|
||||
|
||||
/* Put some stuff into our main window */
|
||||
vBoxMain = gtk_vbox_new(FALSE, 0);
|
||||
hBoxFirstRow = gtk_hbox_new(FALSE, 0);
|
||||
|
||||
/* pack Boxes into other boxes to produce the right structure */
|
||||
gtk_box_pack_start(GTK_BOX(vBoxMain), hBoxFirstRow, FALSE, TRUE, 0);
|
||||
|
||||
/* pack vBoxMain which contains all our widgets into the main window. */
|
||||
gnome_app_set_contents(GNOME_APP(mainWindow), vBoxMain);
|
||||
|
||||
/* DONT show the main window yet, due to a Gtk bug that causes it
|
||||
* to not refresh the window when adding widgets after the window
|
||||
* has already been shown */
|
||||
if (uid != euid)
|
||||
setuid(euid);
|
||||
for (i = 0; i < SIZE(ghack_chain); i++)
|
||||
ghack_chain[i].handler =
|
||||
signal(ghack_chain[i].signum, ghack_sig_handler);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_add_map_window(GtkWidget *win)
|
||||
{
|
||||
GtkWidget *vBox;
|
||||
|
||||
vBox = gtk_vbox_new(TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vBox), win, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(vBoxMain), vBox, TRUE, TRUE, 2);
|
||||
gtk_widget_show_all(vBox);
|
||||
/* Ok, now show the main window -- now that we have added in
|
||||
* all the windows (relys on nethack displaying the map window last
|
||||
* (This is an ugly kludge, BTW)
|
||||
*/
|
||||
gtk_widget_show_all(mainWindow);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_add_message_window(GtkWidget *win)
|
||||
{
|
||||
gtk_box_pack_start(GTK_BOX(hBoxFirstRow), win, TRUE, TRUE, 2);
|
||||
gtk_widget_show_all(win);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_add_status_window(GtkWidget *win)
|
||||
{
|
||||
gtk_box_pack_start(GTK_BOX(hBoxFirstRow), win, FALSE, TRUE, 2);
|
||||
gtk_widget_show_all(win);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_add_worn_window(GtkWidget *win)
|
||||
{
|
||||
gtk_box_pack_end(GTK_BOX(hBoxFirstRow), win, FALSE, TRUE, 2);
|
||||
gtk_widget_show_all(win);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_add_text_window(GtkWidget *win)
|
||||
{
|
||||
g_warning("Fixme!!! AddTextWindow is not yet implemented");
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_remove_window(GtkWidget *win)
|
||||
{
|
||||
g_warning("Fixme!!! RemoveWindow is not yet implemented");
|
||||
}
|
||||
|
||||
void
|
||||
ghack_main_window_update_inventory()
|
||||
{
|
||||
/* For now, do very little. Eventually we may allow the inv. window
|
||||
to stay active. When we do this, we'll need to implement this...
|
||||
g_warning("Fixme!!! updateInventory is not yet implemented");
|
||||
*/
|
||||
gnome_display_nhwindow(WIN_WORN, FALSE);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ghack_get_main_window()
|
||||
{
|
||||
return (GTK_WIDGET(mainWindow));
|
||||
}
|
||||
22
outdated/win/gnome/gnmain.h
Normal file
22
outdated/win/gnome/gnmain.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* NetHack 3.6 gnmain.h $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackMainWindow_h
|
||||
#define GnomeHackMainWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void ghack_init_main_window(int argc, char **argv);
|
||||
void ghack_main_window_add_map_window(GtkWidget *win);
|
||||
void ghack_main_window_add_message_window(GtkWidget *win);
|
||||
void ghack_main_window_add_status_window(GtkWidget *win);
|
||||
void ghack_main_window_add_text_window(GtkWidget *);
|
||||
void ghack_main_window_add_worn_window(GtkWidget *win);
|
||||
void ghack_main_window_remove_window(GtkWidget *);
|
||||
void ghack_main_window_update_inventory();
|
||||
void ghack_save_game_cb(GtkWidget *widget, gpointer data);
|
||||
GtkWidget *ghack_get_main_window();
|
||||
|
||||
#endif /* GnomeHackMainWindow_h */
|
||||
529
outdated/win/gnome/gnmap.c
Normal file
529
outdated/win/gnome/gnmap.c
Normal file
@@ -0,0 +1,529 @@
|
||||
/* NetHack 3.6 gnmap.c $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnmap.h"
|
||||
#include "gnglyph.h"
|
||||
#include "gnsignal.h"
|
||||
#include "hack.h"
|
||||
|
||||
#ifndef ROWNO
|
||||
#define ROWNO 21
|
||||
#define COLNO 80
|
||||
#endif
|
||||
|
||||
/* globals static to this file go here */
|
||||
struct {
|
||||
GnomeCanvas *canvas;
|
||||
GnomeCanvasImage *map[(ROWNO + 1) * COLNO];
|
||||
GnomeCanvasImage *overlay[(ROWNO + 1) * COLNO];
|
||||
double zoom;
|
||||
GtkWidget *frame;
|
||||
} ghack_map;
|
||||
|
||||
static GdkImlibImage *background;
|
||||
static GdkImlibImage *petmark;
|
||||
static GnomeCanvasGroup *myCanvasGroup;
|
||||
|
||||
/* static function declarations -- local to this file go here */
|
||||
void ghack_map_cursor_to(GtkWidget *win, int x, int y, gpointer data);
|
||||
void ghack_map_putstr(GtkWidget *win, int attr, const char *text,
|
||||
gpointer data);
|
||||
void ghack_map_print_glyph(GtkObject *win, guint x, guint y,
|
||||
GdkImlibImage *im, gpointer data);
|
||||
void ghack_map_clear(GtkWidget *win, gpointer data);
|
||||
static void ghack_map_display(GtkWidget *win, boolean block, gpointer data);
|
||||
static void ghack_map_cliparound(GtkWidget *win, int x, int y, gpointer data);
|
||||
static void ghack_map_window_zoom(GtkAdjustment *adj, gpointer data);
|
||||
|
||||
/* The following XPM is the artwork of Warwick Allison
|
||||
* <warwick@troll.no>. It has been borrowed from
|
||||
* the most excellent NetHackQt, until such time as
|
||||
* we can come up with something better.
|
||||
*
|
||||
* More information about NetHackQt can be had from:
|
||||
* http://www.troll.no/~warwick/nethack/
|
||||
*/
|
||||
|
||||
/* XPM */
|
||||
static char *pet_mark_xpm[] = {
|
||||
/* width height ncolors chars_per_pixel */
|
||||
"8 7 2 1",
|
||||
/* colors */
|
||||
". c None", " c #FF0000",
|
||||
/* pixels */
|
||||
"........", ".. . .", ". ", ". ",
|
||||
".. .", "... ..", ".... ..."
|
||||
};
|
||||
|
||||
/* NAME:
|
||||
* ghack_init_map_window( )
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* NONE
|
||||
*
|
||||
* RETURNS:
|
||||
* GtkWidget*
|
||||
*
|
||||
* PURPOSE:
|
||||
* Create the basic map necessities. Create a canvas;
|
||||
* give it a background. Attach all the right signals
|
||||
* to all the right places. Generally prepare the map
|
||||
* to behave properly.
|
||||
*/
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_map_window()
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *table;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *w;
|
||||
GtkWidget *hSeparator;
|
||||
GtkAdjustment *adj;
|
||||
GnomeCanvasImage *bg;
|
||||
double width, height, x, y;
|
||||
int i;
|
||||
|
||||
width = COLNO * ghack_glyph_width();
|
||||
height = ROWNO * ghack_glyph_height();
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 4);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
/* Add in a horiz seperator */
|
||||
hSeparator = gtk_hseparator_new();
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hSeparator, FALSE, FALSE, 2);
|
||||
gtk_widget_show(hSeparator);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 4);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show(hbox);
|
||||
|
||||
/* Create the Zoom spinbutton.
|
||||
*/
|
||||
ghack_map.zoom = 1.0;
|
||||
w = gtk_label_new("Zoom:");
|
||||
gtk_box_pack_start(GTK_BOX(hbox), w, FALSE, FALSE, 0);
|
||||
gtk_widget_show(w);
|
||||
adj =
|
||||
GTK_ADJUSTMENT(gtk_adjustment_new(1.00, 0.5, 3.00, 0.05, 0.50, 0.50));
|
||||
w = gtk_spin_button_new(adj, 0.5, 2);
|
||||
gtk_widget_set_usize(w, 50, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), w, FALSE, FALSE, 0);
|
||||
gtk_widget_show(w);
|
||||
|
||||
/* Canvas and scrollbars
|
||||
*/
|
||||
gtk_widget_push_visual(gdk_imlib_get_visual());
|
||||
gtk_widget_push_colormap(gdk_imlib_get_colormap());
|
||||
ghack_map.canvas = GNOME_CANVAS(gnome_canvas_new());
|
||||
// gtk_widget_push_visual(gdk_rgb_get_visual());
|
||||
// gtk_widget_push_colormap(gdk_rgb_get_cmap());
|
||||
// ghack_map.canvas = GNOME_CANVAS (gnome_canvas_new_aa());
|
||||
|
||||
gtk_widget_pop_colormap();
|
||||
gtk_widget_pop_visual();
|
||||
gtk_widget_show(GTK_WIDGET(ghack_map.canvas));
|
||||
|
||||
table = gtk_table_new(2, 2, FALSE);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
|
||||
gtk_widget_show(table);
|
||||
|
||||
frame = gtk_frame_new(NULL);
|
||||
ghack_map.frame = frame;
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_table_attach(GTK_TABLE(table), frame, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show(frame);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(ghack_map.canvas));
|
||||
gnome_canvas_set_scroll_region(GNOME_CANVAS(ghack_map.canvas), 0, 0,
|
||||
width + 2 * ghack_glyph_width(),
|
||||
height + 2 * ghack_glyph_height());
|
||||
|
||||
gnome_canvas_set_pixels_per_unit(GNOME_CANVAS(ghack_map.canvas), 1.0);
|
||||
|
||||
w = gtk_hscrollbar_new(GTK_LAYOUT(ghack_map.canvas)->hadjustment);
|
||||
gtk_table_attach(GTK_TABLE(table), w, 0, 1, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(w);
|
||||
|
||||
w = gtk_vscrollbar_new(GTK_LAYOUT(ghack_map.canvas)->vadjustment);
|
||||
gtk_table_attach(GTK_TABLE(table), w, 1, 2, 0, 1, GTK_FILL,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show(w);
|
||||
|
||||
myCanvasGroup = GNOME_CANVAS_GROUP(gnome_canvas_item_new(
|
||||
gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas)),
|
||||
gnome_canvas_group_get_type(), "x", 0.0, "y", 0.0, NULL));
|
||||
|
||||
/* Tile the map background with a pretty image */
|
||||
background = gdk_imlib_load_image((char *) "mapbg.xpm");
|
||||
if (background == NULL) {
|
||||
g_warning(
|
||||
"Bummer! Failed to load the map background image (mapbg.xpm)!");
|
||||
} else {
|
||||
gdk_imlib_render(background, background->rgb_width,
|
||||
background->rgb_height);
|
||||
|
||||
/* Tile the map background */
|
||||
for (y = 0; y < height + background->rgb_height;
|
||||
y += background->rgb_height) {
|
||||
for (x = 0; x < width + background->rgb_width;
|
||||
x += background->rgb_width) {
|
||||
bg = GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x",
|
||||
(double) x, "y", (double) y, "width",
|
||||
(double) background->rgb_width, "height",
|
||||
(double) background->rgb_height, "image", background,
|
||||
"anchor", (GtkAnchorType) GTK_ANCHOR_CENTER, NULL));
|
||||
gnome_canvas_item_lower_to_bottom(GNOME_CANVAS_ITEM(bg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ghack_map.map is an array of canvas images. Each cell of
|
||||
* the array will contain one tile. Here, we create the
|
||||
* space for the cells and then create the cells for easy
|
||||
* access later.
|
||||
*/
|
||||
for (i = 0, y = 0; y < height; y += ghack_glyph_height()) {
|
||||
for (x = 0; x < width; x += ghack_glyph_width()) {
|
||||
ghack_map.map[i++] = GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x", (double) x,
|
||||
"y", (double) y, "width", (double) ghack_glyph_width(),
|
||||
"height", (double) ghack_glyph_height(), "anchor",
|
||||
GTK_ANCHOR_NORTH_WEST, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the pet mark image */
|
||||
petmark = gdk_imlib_create_image_from_xpm_data(pet_mark_xpm);
|
||||
if (petmark == NULL) {
|
||||
g_warning("Bummer! Failed to load the pet_mark image!");
|
||||
} else {
|
||||
gdk_imlib_render(petmark, petmark->rgb_width, petmark->rgb_height);
|
||||
|
||||
/* ghack_map.overlay is an array of canvas images used to
|
||||
* overlay tile images...
|
||||
*/
|
||||
for (i = 0, y = 0; y < height; y += ghack_glyph_height()) {
|
||||
for (x = 0; x < width; x += ghack_glyph_width()) {
|
||||
ghack_map.overlay[i] =
|
||||
GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x",
|
||||
(double) x, "y", (double) y, "width",
|
||||
(double) petmark->rgb_width, "height",
|
||||
(double) petmark->rgb_height, "image", petmark,
|
||||
"anchor", GTK_ANCHOR_NORTH_WEST, NULL));
|
||||
gnome_canvas_item_lower_to_bottom(
|
||||
GNOME_CANVAS_ITEM(ghack_map.overlay[i++]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Resize the canvas when the spinbutton changes
|
||||
*/
|
||||
gtk_signal_connect(GTK_OBJECT(adj), "value_changed",
|
||||
(GtkSignalFunc) ghack_map_window_zoom,
|
||||
ghack_map.canvas);
|
||||
|
||||
/* Game signals
|
||||
*/
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_curs",
|
||||
GTK_SIGNAL_FUNC(ghack_map_cursor_to), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_putstr",
|
||||
GTK_SIGNAL_FUNC(ghack_map_putstr), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_print_glyph",
|
||||
GTK_SIGNAL_FUNC(ghack_map_print_glyph), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_clear",
|
||||
GTK_SIGNAL_FUNC(ghack_map_clear), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_display",
|
||||
GTK_SIGNAL_FUNC(ghack_map_display), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(vbox), "ghack_cliparound",
|
||||
GTK_SIGNAL_FUNC(ghack_map_cliparound), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(ghack_map.canvas), "button_press_event",
|
||||
GTK_SIGNAL_FUNC(ghack_handle_button_press), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(ghack_map.canvas), "gnome_delay_output",
|
||||
GTK_SIGNAL_FUNC(ghack_delay), NULL);
|
||||
|
||||
return GTK_WIDGET(vbox);
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_map_window_zoom
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* double zoom -- The zoom factor
|
||||
*
|
||||
* RETURNS:
|
||||
* Nothing.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Zoom the map image in and out. This should allow the user to
|
||||
* dynamically scale the map. Ideally, the background should
|
||||
* *NOT* scale, but this may be impractical.
|
||||
*/
|
||||
|
||||
static void
|
||||
ghack_map_window_zoom(GtkAdjustment *adj, gpointer data)
|
||||
{
|
||||
if (adj->value > 3.0)
|
||||
adj->value = 3.0;
|
||||
if (adj->value < 0.5)
|
||||
adj->value = 0.5;
|
||||
ghack_map.zoom = adj->value;
|
||||
gnome_canvas_set_pixels_per_unit(data, adj->value);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_map_cursor_to(GtkWidget *win, int x, int y, gpointer data)
|
||||
{
|
||||
GnomeCanvasGroup *group;
|
||||
static GnomeCanvasRE *cursor = NULL;
|
||||
|
||||
double x1, y1, x2, y2;
|
||||
float hp;
|
||||
guint r, g, b;
|
||||
|
||||
x1 = x * ghack_glyph_width() - 1;
|
||||
y1 = y * ghack_glyph_height() - 1;
|
||||
x2 = x1 + ghack_glyph_width() + 2;
|
||||
y2 = y1 + ghack_glyph_height() + 2;
|
||||
hp = u.mtimedone ? (u.mhmax ? (float) u.mh / u.mhmax : 1)
|
||||
: (u.uhpmax ? (float) u.uhp / u.uhpmax : 1);
|
||||
|
||||
r = 255;
|
||||
g = (hp >= 0.75) ? 255 : (hp >= 0.25 ? 255 * 2 * (hp - 0.25) : 0);
|
||||
b = (hp >= 0.75) ? 255 * 4 * (hp - 0.75)
|
||||
: (hp >= 0.25 ? 0 : 255 * 4 * (0.25 - hp));
|
||||
|
||||
group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));
|
||||
|
||||
if (!cursor) {
|
||||
cursor = GNOME_CANVAS_RE(gnome_canvas_item_new(
|
||||
group, gnome_canvas_rect_get_type(), "width_units", 1.0, NULL));
|
||||
}
|
||||
gnome_canvas_item_set(GNOME_CANVAS_ITEM(cursor), "outline_color_rgba",
|
||||
GNOME_CANVAS_COLOR(r, g, b), "x1", x1, "y1", y1,
|
||||
"x2", x2, "y2", y2, NULL);
|
||||
|
||||
gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(cursor));
|
||||
gnome_canvas_item_show(GNOME_CANVAS_ITEM(cursor));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_map_putstr(GtkWidget *win, int attr, const char *text, gpointer data)
|
||||
{
|
||||
g_warning("Fixme!!! ghack_map_putstr is not implemented");
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_map_print_glyph( )
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* XCHAR_P x, y -- The coordinates where which to print the glyph
|
||||
* GdkImlibImage* glyph -- The glyph image to print
|
||||
*
|
||||
* RETURNS:
|
||||
* Nothing.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Draw the glyph-tile at the specified coordinates.
|
||||
*/
|
||||
|
||||
void
|
||||
ghack_map_print_glyph(GtkObject *win, guint x, guint y, GdkImlibImage *im,
|
||||
gpointer data)
|
||||
{
|
||||
GnomeCanvasGroup *group;
|
||||
int i = y * COLNO + x;
|
||||
int glyph = glyph_at(x, y);
|
||||
GnomeCanvasImage *canvas_image = GNOME_CANVAS_IMAGE(ghack_map.map[i]);
|
||||
|
||||
group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));
|
||||
|
||||
gnome_canvas_item_set(GNOME_CANVAS_ITEM(canvas_image), "image", im, NULL);
|
||||
gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));
|
||||
|
||||
canvas_image = GNOME_CANVAS_IMAGE(ghack_map.overlay[i]);
|
||||
|
||||
if (x == u.ux && y == u.uy)
|
||||
ghack_map_cliparound(NULL, x, y, NULL);
|
||||
|
||||
if (glyph_is_pet(glyph)
|
||||
#ifdef TEXTCOLOR
|
||||
&& iflags.hilite_pet
|
||||
#endif
|
||||
) {
|
||||
gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(canvas_image));
|
||||
gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));
|
||||
} else {
|
||||
gnome_canvas_item_hide(GNOME_CANVAS_ITEM(canvas_image));
|
||||
}
|
||||
}
|
||||
|
||||
/* NAME:
|
||||
* ghack_map_clear( )
|
||||
*
|
||||
* ARGUMENTS:
|
||||
* NONE
|
||||
*
|
||||
* RETURNS:
|
||||
* Nothing.
|
||||
*
|
||||
* PURPOSE:
|
||||
* Clear the map by hiding all the map tiles.
|
||||
*/
|
||||
|
||||
void
|
||||
ghack_map_clear(GtkWidget *win, gpointer data)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ROWNO * COLNO; i++) {
|
||||
if (GNOME_IS_CANVAS_IMAGE(ghack_map.map[i])) {
|
||||
gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.map[i]));
|
||||
}
|
||||
if (GNOME_IS_CANVAS_IMAGE(ghack_map.overlay[i])) {
|
||||
gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.overlay[i]));
|
||||
}
|
||||
}
|
||||
gnome_canvas_update_now(GNOME_CANVAS(ghack_map.canvas));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_map_display(GtkWidget *win, boolean block, gpointer data)
|
||||
{
|
||||
gtk_widget_show_all(GTK_WIDGET(win));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_map_cliparound(GtkWidget *win, int x, int y, gpointer data)
|
||||
{
|
||||
int map_width, map_height;
|
||||
int to_x, to_y;
|
||||
int cur_x, cur_y;
|
||||
int width, height, half_width, half_height;
|
||||
|
||||
x *= ghack_glyph_width() * ghack_map.zoom;
|
||||
y *= ghack_glyph_height() * ghack_map.zoom;
|
||||
map_width = COLNO * ghack_glyph_width() * ghack_map.zoom;
|
||||
map_height = ROWNO * ghack_glyph_height() * ghack_map.zoom;
|
||||
|
||||
gdk_window_get_size(GTK_LAYOUT(ghack_map.canvas)->bin_window, &width,
|
||||
&height);
|
||||
gnome_canvas_get_scroll_offsets(ghack_map.canvas, &cur_x, &cur_y);
|
||||
|
||||
half_width = width * 0.5;
|
||||
half_height = height * 0.5;
|
||||
|
||||
if (((x - cur_x) < (width * 0.25)) || ((x - cur_x) > (width * 0.75))) {
|
||||
to_x = ((x - half_width) > 0) ? x - half_width : 0;
|
||||
to_x = ((x + half_width) > map_width) ? map_width - 2 * half_width
|
||||
: to_x;
|
||||
} else {
|
||||
to_x = cur_x;
|
||||
}
|
||||
|
||||
if (((y - cur_y) < (height * 0.25)) || ((y - cur_y) > (height * 0.75))) {
|
||||
to_y = ((y - half_height) > 0) ? y - half_height : 0;
|
||||
to_y = ((y + half_height) > map_height) ? map_height - 2 * half_height
|
||||
: to_y;
|
||||
} else {
|
||||
to_y = cur_y;
|
||||
}
|
||||
|
||||
if (to_x != cur_x || to_y != cur_y)
|
||||
gnome_canvas_scroll_to(ghack_map.canvas, to_x, to_y);
|
||||
// gnome_canvas_update_now ( ghack_map.canvas);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_reinit_map_window()
|
||||
{
|
||||
GnomeCanvasImage *bg;
|
||||
double width, height, x, y;
|
||||
int i;
|
||||
|
||||
/* ghack_map_clear(NULL, NULL); */
|
||||
|
||||
width = COLNO * ghack_glyph_width();
|
||||
height = ROWNO * ghack_glyph_height();
|
||||
|
||||
gnome_canvas_set_scroll_region(GNOME_CANVAS(ghack_map.canvas), 0, 0,
|
||||
width + 2 * ghack_glyph_width(),
|
||||
height + 2 * ghack_glyph_height());
|
||||
|
||||
/* remove everything currently in the canvas map */
|
||||
gtk_object_destroy(GTK_OBJECT(myCanvasGroup));
|
||||
|
||||
/* Put some groups back */
|
||||
myCanvasGroup = GNOME_CANVAS_GROUP(gnome_canvas_item_new(
|
||||
gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas)),
|
||||
gnome_canvas_group_get_type(), "x", 0.0, "y", 0.0, NULL));
|
||||
|
||||
/* Tile the map background with a pretty image */
|
||||
if (background != NULL) {
|
||||
/* Tile the map background */
|
||||
for (y = 0; y < height + background->rgb_height;
|
||||
y += background->rgb_height) {
|
||||
for (x = 0; x < width + background->rgb_width;
|
||||
x += background->rgb_width) {
|
||||
bg = GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x",
|
||||
(double) x, "y", (double) y, "width",
|
||||
(double) background->rgb_width, "height",
|
||||
(double) background->rgb_height, "image", background,
|
||||
"anchor", (GtkAnchorType) GTK_ANCHOR_CENTER, NULL));
|
||||
gnome_canvas_item_lower_to_bottom(GNOME_CANVAS_ITEM(bg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ghack_map.map is an array of canvas images. Each cell of
|
||||
* the array will contain one tile. Here, we create the
|
||||
* space for the cells and then create the cells for easy
|
||||
* access later.
|
||||
*/
|
||||
for (i = 0, y = 0; y < height; y += ghack_glyph_height()) {
|
||||
for (x = 0; x < width; x += ghack_glyph_width()) {
|
||||
ghack_map.map[i++] = GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x", (double) x,
|
||||
"y", (double) y, "width", (double) ghack_glyph_width(),
|
||||
"height", (double) ghack_glyph_height(), "anchor",
|
||||
GTK_ANCHOR_NORTH_WEST, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
if (petmark != NULL) {
|
||||
/* ghack_map.overlay is an array of canvas images used to
|
||||
* overlay tile images...
|
||||
*/
|
||||
for (i = 0, y = 0; y < height; y += ghack_glyph_height()) {
|
||||
for (x = 0; x < width; x += ghack_glyph_width()) {
|
||||
ghack_map.overlay[i] =
|
||||
GNOME_CANVAS_IMAGE(gnome_canvas_item_new(
|
||||
myCanvasGroup, gnome_canvas_image_get_type(), "x",
|
||||
(double) x, "y", (double) y, "width",
|
||||
(double) petmark->rgb_width, "height",
|
||||
(double) petmark->rgb_height, "image", petmark,
|
||||
"anchor", GTK_ANCHOR_NORTH_WEST, NULL));
|
||||
gnome_canvas_item_lower_to_bottom(
|
||||
GNOME_CANVAS_ITEM(ghack_map.overlay[i++]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ghack_map_cliparound(NULL, u.ux, u.uy, NULL);
|
||||
ghack_map_cursor_to(NULL, u.ux, u.uy, NULL);
|
||||
gnome_canvas_update_now(ghack_map.canvas);
|
||||
doredraw();
|
||||
}
|
||||
16
outdated/win/gnome/gnmap.h
Normal file
16
outdated/win/gnome/gnmap.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* NetHack 3.6 gnmap.h $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackMapWindow_h
|
||||
#define GnomeHackMapWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gdk_imlib.h>
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
GtkWidget *ghack_init_map_window(void);
|
||||
void ghack_reinit_map_window(void);
|
||||
|
||||
#endif /* GnomeHackMapWindow_h */
|
||||
741
outdated/win/gnome/gnmenu.c
Normal file
741
outdated/win/gnome/gnmenu.c
Normal file
@@ -0,0 +1,741 @@
|
||||
/* NetHack 3.6 gnmenu.c $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gnome.h>
|
||||
#include "gnmenu.h"
|
||||
#include "gnmain.h"
|
||||
#include "gnbind.h"
|
||||
#include "func_tab.h"
|
||||
|
||||
typedef enum { MenuUnknown = 0, MenuText, MenuMenu } MenuWinType;
|
||||
|
||||
typedef struct {
|
||||
ANY_P identifier;
|
||||
gchar accelerator[BUFSZ];
|
||||
int itemNumber;
|
||||
int selected;
|
||||
} menuItem;
|
||||
|
||||
typedef struct {
|
||||
int curItem;
|
||||
int numRows;
|
||||
int charIdx;
|
||||
guint32 lastTime;
|
||||
} extMenu;
|
||||
|
||||
static GdkColor color_blue = { 0, 0, 0, 0xffff };
|
||||
|
||||
static void
|
||||
ghack_menu_window_key(GtkWidget *menuWin, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
int i, numRows;
|
||||
menuItem *item;
|
||||
MenuWinType isMenu;
|
||||
|
||||
isMenu = (MenuWinType) GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "isMenu"));
|
||||
|
||||
if (isMenu == MenuMenu) {
|
||||
GtkWidget *clist;
|
||||
gint selection_mode;
|
||||
|
||||
clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
|
||||
g_assert(clist != NULL);
|
||||
numRows = GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(clist), "numRows"));
|
||||
selection_mode = GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(clist), "selection_mode"));
|
||||
for (i = 0; i <= numRows; ++i) {
|
||||
item = (menuItem *) gtk_clist_get_row_data(GTK_CLIST(clist), i);
|
||||
if (item == NULL)
|
||||
continue;
|
||||
if (!strcmp(item->accelerator, ""))
|
||||
continue;
|
||||
|
||||
if ((!strcmp(item->accelerator, event->string))
|
||||
|| ((selection_mode == GTK_SELECTION_MULTIPLE)
|
||||
&& (event->keyval == ','))) {
|
||||
if (item->selected) {
|
||||
gtk_clist_unselect_row(GTK_CLIST(clist), item->itemNumber,
|
||||
0);
|
||||
item->selected = FALSE;
|
||||
} else {
|
||||
gtk_clist_select_row(GTK_CLIST(clist), item->itemNumber,
|
||||
0);
|
||||
if (gtk_clist_row_is_visible(GTK_CLIST(clist),
|
||||
item->itemNumber)
|
||||
!= GTK_VISIBILITY_FULL)
|
||||
gtk_clist_moveto(GTK_CLIST(clist), item->itemNumber,
|
||||
0, 0.5, 0);
|
||||
item->selected = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_menu_row_selected(GtkCList *clist, int row, int col, GdkEvent *event)
|
||||
{
|
||||
/* FIXME: Do something */
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_clear(GtkWidget *menuWin, gpointer data)
|
||||
{
|
||||
MenuWinType isMenu;
|
||||
int i, numRows;
|
||||
menuItem *item;
|
||||
|
||||
isMenu = (MenuWinType) GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "isMenu"));
|
||||
|
||||
if (isMenu == MenuMenu) {
|
||||
GtkWidget *clist;
|
||||
|
||||
clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
|
||||
g_assert(clist != NULL);
|
||||
|
||||
/* destroy existing menu data, if any */
|
||||
if (clist) {
|
||||
/* destroy all the row_data we stored in the clist */
|
||||
numRows = GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(clist), "numRows"));
|
||||
for (i = 0; i < numRows; i++) {
|
||||
item =
|
||||
(menuItem *) gtk_clist_get_row_data(GTK_CLIST(clist), i);
|
||||
if (item != NULL) {
|
||||
g_free(item);
|
||||
gtk_clist_set_row_data(GTK_CLIST(clist), i,
|
||||
(gpointer) NULL);
|
||||
}
|
||||
}
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "numItems",
|
||||
GINT_TO_POINTER(-1));
|
||||
gtk_clist_clear(GTK_CLIST(clist));
|
||||
}
|
||||
}
|
||||
|
||||
else if (isMenu == MenuText) {
|
||||
GnomeLess *gless;
|
||||
|
||||
gless = GNOME_LESS(gtk_object_get_data(GTK_OBJECT(menuWin), "gless"));
|
||||
g_assert(gless != NULL);
|
||||
|
||||
gtk_editable_delete_text(GTK_EDITABLE(gless->text), 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_display(GtkWidget *menuWin, gboolean blocking,
|
||||
gpointer data)
|
||||
{
|
||||
// if(blocking) {
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(menuWin), TRUE);
|
||||
gnome_dialog_set_close(GNOME_DIALOG(menuWin), TRUE);
|
||||
gnome_dialog_run_and_close(GNOME_DIALOG(menuWin));
|
||||
//}
|
||||
// else {
|
||||
// gtk_widget_show(menuWin);
|
||||
//}
|
||||
}
|
||||
|
||||
gint
|
||||
ghack_menu_hide(GtkWidget *menuWin, GdkEvent *event, gpointer data)
|
||||
{
|
||||
gtk_widget_hide(menuWin);
|
||||
return FALSE; /* FIXME: what is correct result here? */
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_start_menu(GtkWidget *menuWin, gpointer data)
|
||||
{
|
||||
GtkWidget *frame1, *swin, *clist;
|
||||
MenuWinType isMenu;
|
||||
|
||||
g_assert(menuWin != NULL);
|
||||
g_assert(data == NULL);
|
||||
|
||||
/* destroy existing menu data, if any */
|
||||
frame1 = gtk_object_get_data(GTK_OBJECT(menuWin), "frame1");
|
||||
if (frame1)
|
||||
gtk_widget_destroy(frame1);
|
||||
|
||||
isMenu = MenuMenu;
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "isMenu",
|
||||
GINT_TO_POINTER(isMenu));
|
||||
|
||||
gtk_widget_set_usize(GTK_WIDGET(menuWin), 500, 400);
|
||||
gtk_window_set_policy(GTK_WINDOW(menuWin), TRUE, TRUE, FALSE);
|
||||
|
||||
frame1 = gtk_frame_new("Make your selection");
|
||||
g_assert(frame1 != NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "frame1", frame1);
|
||||
gtk_widget_show(GTK_WIDGET(frame1));
|
||||
gtk_container_set_border_width(GTK_CONTAINER(frame1), 5);
|
||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(menuWin)->vbox), frame1, TRUE,
|
||||
TRUE, 0);
|
||||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
g_assert(swin != NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "swin", swin);
|
||||
gtk_widget_show(GTK_WIDGET(swin));
|
||||
gtk_container_add(GTK_CONTAINER(frame1), swin);
|
||||
|
||||
clist = gtk_clist_new(4);
|
||||
g_assert(clist != NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "clist", clist);
|
||||
gtk_widget_show(GTK_WIDGET(clist));
|
||||
gtk_container_add(GTK_CONTAINER(swin), clist);
|
||||
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(clist), "select_row",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_row_selected), NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "numItems", GINT_TO_POINTER(-1));
|
||||
}
|
||||
|
||||
int
|
||||
ghack_menu_window_select_menu(GtkWidget *menuWin, MENU_ITEM_P **_selected,
|
||||
gint how)
|
||||
{
|
||||
gint rc;
|
||||
guint num_sel, i, idx;
|
||||
GtkWidget *clist;
|
||||
GList *cur;
|
||||
MENU_ITEM_P *selected = NULL;
|
||||
menuItem *item;
|
||||
|
||||
g_assert(_selected != NULL);
|
||||
*_selected = NULL;
|
||||
|
||||
if (how == PICK_NONE) {
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(menuWin), TRUE);
|
||||
rc = gnome_dialog_run_and_close(GNOME_DIALOG(menuWin));
|
||||
return (rc == 1 ? -1 : 0);
|
||||
}
|
||||
|
||||
clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
|
||||
g_assert(clist != NULL);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "selection_mode",
|
||||
GINT_TO_POINTER((how == PICK_ANY)
|
||||
? GTK_SELECTION_MULTIPLE
|
||||
: GTK_SELECTION_SINGLE));
|
||||
gtk_clist_set_selection_mode(GTK_CLIST(clist),
|
||||
(how == PICK_ANY) ? GTK_SELECTION_MULTIPLE
|
||||
: GTK_SELECTION_SINGLE);
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(menuWin), TRUE);
|
||||
rc = gnome_dialog_run_and_close(GNOME_DIALOG(menuWin));
|
||||
if ((rc == 1) || (GTK_CLIST(clist)->selection == NULL)) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
num_sel = g_list_length(GTK_CLIST(clist)->selection);
|
||||
if (num_sel < 1) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* fill in array with selections from clist */
|
||||
selected = g_new0(MENU_ITEM_P, num_sel);
|
||||
g_assert(selected != NULL);
|
||||
cur = GTK_CLIST(clist)->selection;
|
||||
i = 0;
|
||||
while (cur) {
|
||||
g_assert(i < num_sel);
|
||||
|
||||
/* grab row number from clist selection list */
|
||||
idx = GPOINTER_TO_INT(cur->data);
|
||||
|
||||
item = (menuItem *) gtk_clist_get_row_data(GTK_CLIST(clist), idx);
|
||||
selected[i].item = item->identifier;
|
||||
selected[i].count = -1;
|
||||
cur = g_list_next(cur);
|
||||
i++;
|
||||
}
|
||||
|
||||
*_selected = selected;
|
||||
|
||||
return ((int) num_sel);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_add_menu(GtkWidget *menuWin, gpointer menu_item,
|
||||
gpointer data)
|
||||
{
|
||||
GHackMenuItem *item;
|
||||
GtkWidget *clist;
|
||||
gchar buf[BUFSZ] = "", accelBuf[BUFSZ] = "";
|
||||
gchar *pbuf;
|
||||
char *text[4] = { buf, NULL, NULL, NULL };
|
||||
gint nCurrentRow = -1, numItems = -1;
|
||||
MenuWinType isMenu;
|
||||
GtkStyle *bigStyle = NULL;
|
||||
gboolean item_selectable;
|
||||
GdkImlibImage *image;
|
||||
static gboolean special;
|
||||
|
||||
g_assert(menu_item != NULL);
|
||||
item = (GHackMenuItem *) menu_item;
|
||||
item_selectable = (item->identifier->a_int == 0) ? FALSE : TRUE;
|
||||
isMenu = (MenuWinType) GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "isMenu"));
|
||||
|
||||
clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
|
||||
g_assert(clist != NULL);
|
||||
/* This is a special kludge to make the special hidden help menu item work
|
||||
* as designed */
|
||||
if (special == TRUE) {
|
||||
special = FALSE;
|
||||
item_selectable = TRUE;
|
||||
}
|
||||
if (!strcmp(item->str, "The NetHack license.")) {
|
||||
special = TRUE;
|
||||
}
|
||||
|
||||
if (item->str) {
|
||||
/* First, make a new blank entry in the clist */
|
||||
nCurrentRow = gtk_clist_append(GTK_CLIST(clist), text);
|
||||
|
||||
if (item->glyph != NO_GLYPH) {
|
||||
image = ghack_image_from_glyph(item->glyph, FALSE);
|
||||
if (image == NULL || image->pixmap == NULL) {
|
||||
g_warning("Bummer -- having to force rendering for glyph %d!",
|
||||
item->glyph);
|
||||
/* wierd -- pixmap is NULL so retry rendering it */
|
||||
image = ghack_image_from_glyph(item->glyph, TRUE);
|
||||
}
|
||||
if (image == NULL || image->pixmap == NULL) {
|
||||
g_error("Aiiee! glyph is still NULL for item\n\"%s\"",
|
||||
item->str);
|
||||
} else
|
||||
gtk_clist_set_pixmap(GTK_CLIST(clist), nCurrentRow, 1,
|
||||
gdk_imlib_move_image(image),
|
||||
gdk_imlib_move_mask(image));
|
||||
}
|
||||
if (item->accelerator) {
|
||||
/* FIXME: handle accelerator, */
|
||||
g_snprintf(accelBuf, sizeof(accelBuf), "%c ", item->accelerator);
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 0, accelBuf);
|
||||
g_snprintf(buf, sizeof(buf), "%s", item->str);
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 2, buf);
|
||||
} else {
|
||||
if (item->group_accel) {
|
||||
/* FIXME: maybe some day I should try to handle
|
||||
* group accelerators... */
|
||||
}
|
||||
if (((item->attr == 0) && (item->identifier->a_int != 0))
|
||||
|| (special == TRUE)) {
|
||||
numItems = GPOINTER_TO_INT(gtk_object_get_data(
|
||||
GTK_OBJECT(clist), "numItems")) + 1;
|
||||
|
||||
/* Ok, now invent a unique accelerator */
|
||||
if (('a' + numItems) <= 'z') {
|
||||
g_snprintf(accelBuf, sizeof(accelBuf), "%c ",
|
||||
'a' + numItems);
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 0,
|
||||
accelBuf);
|
||||
} else if (('A' + numItems - 26) <= 'Z') {
|
||||
g_snprintf(accelBuf, sizeof(accelBuf), "%c ",
|
||||
'A' + numItems - 26);
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 0,
|
||||
accelBuf);
|
||||
} else {
|
||||
accelBuf[0] = buf[0] = 0;
|
||||
}
|
||||
g_snprintf(buf, sizeof(buf), "%s", item->str);
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 2, buf);
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "numItems",
|
||||
GINT_TO_POINTER(numItems));
|
||||
|
||||
/* This junk is to specially handle the options menu */
|
||||
pbuf = strstr(buf, " [");
|
||||
if (pbuf == NULL) {
|
||||
pbuf = strstr(buf, "\t[");
|
||||
}
|
||||
if (pbuf != NULL) {
|
||||
*pbuf = 0;
|
||||
pbuf++;
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 3,
|
||||
pbuf);
|
||||
}
|
||||
}
|
||||
/* FIXME: handle more than 26*2 accelerators (but how?
|
||||
* since I only have so many keys to work with???)
|
||||
else
|
||||
{
|
||||
foo();
|
||||
}
|
||||
*/
|
||||
else {
|
||||
g_snprintf(buf, sizeof(buf), "%s", item->str);
|
||||
pbuf = strstr(buf, " [");
|
||||
if (pbuf == NULL) {
|
||||
pbuf = strstr(buf, "\t[");
|
||||
}
|
||||
if (pbuf != NULL) {
|
||||
*pbuf = 0;
|
||||
pbuf++;
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 3,
|
||||
pbuf);
|
||||
}
|
||||
gtk_clist_set_text(GTK_CLIST(clist), nCurrentRow, 2, buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (item->attr) {
|
||||
switch (item->attr) {
|
||||
case ATR_ULINE:
|
||||
case ATR_BOLD:
|
||||
case ATR_BLINK:
|
||||
case ATR_INVERSE:
|
||||
bigStyle = gtk_style_copy(GTK_WIDGET(clist)->style);
|
||||
g_assert(bigStyle != NULL);
|
||||
gdk_font_unref(bigStyle->font);
|
||||
bigStyle->font =
|
||||
gdk_font_load("-misc-fixed-*-*-*-*-20-*-*-*-*-*-*-*");
|
||||
bigStyle->fg[GTK_STATE_NORMAL] = color_blue;
|
||||
gtk_clist_set_cell_style(GTK_CLIST(clist), nCurrentRow, 2,
|
||||
bigStyle);
|
||||
item_selectable = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
g_assert(nCurrentRow >= 0);
|
||||
gtk_clist_set_selectable(GTK_CLIST(clist), nCurrentRow,
|
||||
item_selectable);
|
||||
|
||||
if (item_selectable == TRUE && item->presel == TRUE) {
|
||||
/* pre-select this item */
|
||||
gtk_clist_select_row(GTK_CLIST(clist), nCurrentRow, 0);
|
||||
}
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "numRows",
|
||||
GINT_TO_POINTER(nCurrentRow));
|
||||
|
||||
/* We have to allocate memory here, since the menu_item currently
|
||||
* lives on the stack, and will otherwise go to the great bit bucket
|
||||
* in the sky as soon as this function exits, which would leave a
|
||||
* pointer to crap in the row_data. Use g_memdup to make a private,
|
||||
* persistant copy of the item identifier.
|
||||
*
|
||||
* We need to arrange to blow away this memory somewhere (like
|
||||
* ghack_menu_destroy and ghack_menu_window_clear for example).
|
||||
*
|
||||
* -Erik
|
||||
*/
|
||||
{
|
||||
menuItem newItem;
|
||||
menuItem *pNewItem;
|
||||
|
||||
newItem.identifier = *item->identifier;
|
||||
newItem.itemNumber = nCurrentRow;
|
||||
newItem.selected = FALSE;
|
||||
newItem.accelerator[0] = 0;
|
||||
/* only copy 1 char, since accel keys are by definition 1 char */
|
||||
if (accelBuf[0]) {
|
||||
strncpy(newItem.accelerator, accelBuf, 1);
|
||||
}
|
||||
newItem.accelerator[1] = 0;
|
||||
|
||||
pNewItem = g_memdup(&newItem, sizeof(menuItem));
|
||||
gtk_clist_set_row_data(GTK_CLIST(clist), nCurrentRow,
|
||||
(gpointer) pNewItem);
|
||||
}
|
||||
}
|
||||
/* Now adjust the column widths to match the contents */
|
||||
gtk_clist_columns_autosize(GTK_CLIST(clist));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_end_menu(GtkWidget *menuWin, gpointer data)
|
||||
{
|
||||
const char *p = (const char *) data;
|
||||
|
||||
if ((p) && (*p)) {
|
||||
GtkWidget *frame1 =
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "frame1");
|
||||
g_assert(frame1 != NULL);
|
||||
|
||||
gtk_frame_set_label(GTK_FRAME(frame1), p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_window_put_string(GtkWidget *menuWin, int attr, const char *text,
|
||||
gpointer data)
|
||||
{
|
||||
GnomeLess *gless;
|
||||
MenuWinType isMenu;
|
||||
|
||||
if (text == NULL)
|
||||
return;
|
||||
|
||||
isMenu = (MenuWinType) GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "isMenu"));
|
||||
|
||||
if (isMenu == MenuText) {
|
||||
gless = GNOME_LESS(gtk_object_get_data(GTK_OBJECT(menuWin), "gless"));
|
||||
g_assert(gless != NULL);
|
||||
g_assert(gless->text != NULL);
|
||||
g_assert(GTK_IS_TEXT(gless->text));
|
||||
|
||||
/* Don't bother with attributes yet */
|
||||
gtk_text_insert(GTK_TEXT(gless->text), NULL, NULL, NULL, text, -1);
|
||||
gtk_text_insert(GTK_TEXT(gless->text), NULL, NULL, NULL, "\n", -1);
|
||||
|
||||
}
|
||||
|
||||
else if (isMenu == MenuUnknown) {
|
||||
isMenu = MenuText;
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "isMenu",
|
||||
GINT_TO_POINTER(isMenu));
|
||||
|
||||
gtk_widget_set_usize(GTK_WIDGET(menuWin), 500, 400);
|
||||
gtk_window_set_policy(GTK_WINDOW(menuWin), TRUE, TRUE, FALSE);
|
||||
|
||||
gless = GNOME_LESS(gnome_less_new());
|
||||
g_assert(gless != NULL);
|
||||
gtk_object_set_data(GTK_OBJECT(menuWin), "gless", gless);
|
||||
gtk_widget_show(GTK_WIDGET(gless));
|
||||
|
||||
gnome_less_show_string(gless, text);
|
||||
gtk_text_insert(GTK_TEXT(gless->text), NULL, NULL, NULL, "\n", -1);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(menuWin)->vbox),
|
||||
GTK_WIDGET(gless), TRUE, TRUE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ghack_menu_destroy(GtkWidget *menuWin, gpointer data)
|
||||
{
|
||||
MenuWinType isMenu;
|
||||
|
||||
isMenu = (MenuWinType) GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(menuWin), "isMenu"));
|
||||
|
||||
if (isMenu == MenuText) {
|
||||
GnomeLess *gless;
|
||||
|
||||
gless = GNOME_LESS(gtk_object_get_data(GTK_OBJECT(menuWin), "gless"));
|
||||
g_assert(gless != NULL);
|
||||
g_assert(gless->text != NULL);
|
||||
g_assert(GTK_IS_TEXT(gless->text));
|
||||
gtk_widget_destroy(GTK_WIDGET(gless));
|
||||
}
|
||||
|
||||
else if (isMenu == MenuMenu) {
|
||||
GtkWidget *frame1, *swin, *clist;
|
||||
|
||||
/* destroy existing menu data, if any */
|
||||
clist = gtk_object_get_data(GTK_OBJECT(menuWin), "clist");
|
||||
if (clist) {
|
||||
/* destroy all the row_data we stored in the clist */
|
||||
int i, numRows;
|
||||
menuItem *item;
|
||||
numRows = GPOINTER_TO_INT(
|
||||
gtk_object_get_data(GTK_OBJECT(clist), "numRows"));
|
||||
for (i = 0; i < numRows; i++) {
|
||||
item =
|
||||
(menuItem *) gtk_clist_get_row_data(GTK_CLIST(clist), i);
|
||||
if (item != NULL) {
|
||||
g_free(item);
|
||||
gtk_clist_set_row_data(GTK_CLIST(clist), i,
|
||||
(gpointer) NULL);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(clist), "numItems",
|
||||
GINT_TO_POINTER(-1));
|
||||
gtk_widget_destroy(clist);
|
||||
}
|
||||
swin = gtk_object_get_data(GTK_OBJECT(menuWin), "swin");
|
||||
if (swin) {
|
||||
gtk_widget_destroy(swin);
|
||||
}
|
||||
frame1 = gtk_object_get_data(GTK_OBJECT(menuWin), "frame1");
|
||||
if (frame1) {
|
||||
gtk_widget_destroy(frame1);
|
||||
}
|
||||
}
|
||||
gnome_delete_nhwindow_by_reference(menuWin);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_menu_window(void)
|
||||
{
|
||||
GtkWidget *menuWin = NULL;
|
||||
GtkWidget *parent = ghack_get_main_window();
|
||||
|
||||
menuWin = gnome_dialog_new("GnomeHack", GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||
|
||||
gnome_dialog_set_default(GNOME_DIALOG(menuWin), 0);
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "destroy",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_destroy), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "delete_event",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_hide), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_clear",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_clear), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_display",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_display), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_start_menu",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_start_menu), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_add_menu",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_add_menu), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_end_menu",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_end_menu), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_select_menu",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_select_menu), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "ghack_putstr",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_put_string), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(menuWin), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_window_key), NULL);
|
||||
|
||||
/* Center the dialog over parent */
|
||||
g_assert(parent != NULL);
|
||||
g_assert(menuWin != NULL);
|
||||
g_assert(GTK_IS_WINDOW(parent));
|
||||
g_assert(GNOME_IS_DIALOG(menuWin));
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(menuWin), GTK_WINDOW(parent));
|
||||
|
||||
return menuWin;
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_ext_key_hit(GtkWidget *menuWin, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
GtkWidget *clist;
|
||||
extMenu *info = (extMenu *) data;
|
||||
int i;
|
||||
char c = event->string[0];
|
||||
|
||||
clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
|
||||
g_assert(clist != NULL);
|
||||
|
||||
/* if too long between keystrokes, reset to initial state */
|
||||
if (event->time - info->lastTime > 500)
|
||||
goto init_state;
|
||||
|
||||
/* see if current item continue to match */
|
||||
if (info->charIdx > 0) {
|
||||
if (extcmdlist[info->curItem].ef_txt[info->charIdx] == c) {
|
||||
++info->charIdx;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
|
||||
/* see if the prefix matches a later command in the list */
|
||||
if (info->curItem >= 0) {
|
||||
for (i = info->curItem + 1; i < info->numRows; ++i) {
|
||||
if (!strncmp(extcmdlist[info->curItem].ef_txt,
|
||||
extcmdlist[i].ef_txt, info->charIdx)) {
|
||||
if (extcmdlist[i].ef_txt[info->charIdx] == c) {
|
||||
++info->charIdx;
|
||||
info->curItem = i;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init_state:
|
||||
/* reset to initial state, look for matching 1st character */
|
||||
for (i = 0; i < info->numRows; ++i) {
|
||||
if (extcmdlist[i].ef_txt[0] == c) {
|
||||
info->charIdx = 1;
|
||||
info->curItem = i;
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
|
||||
/* no match: leave prior, if any selection in place */
|
||||
return;
|
||||
|
||||
found:
|
||||
info->lastTime = event->time;
|
||||
gtk_clist_select_row(GTK_CLIST(clist), info->curItem, 0);
|
||||
if (gtk_clist_row_is_visible(GTK_CLIST(clist), info->curItem)
|
||||
!= GTK_VISIBILITY_FULL)
|
||||
gtk_clist_moveto(GTK_CLIST(clist), info->curItem, 0, 0.5, 0);
|
||||
}
|
||||
|
||||
int
|
||||
ghack_menu_ext_cmd(void)
|
||||
{
|
||||
int n;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *swin;
|
||||
GtkWidget *frame1;
|
||||
GtkWidget *clist;
|
||||
extMenu info;
|
||||
|
||||
dialog = gnome_dialog_new("Extended Commands", GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(dialog), FALSE);
|
||||
gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(ghack_ext_key_hit), &info);
|
||||
|
||||
frame1 = gtk_frame_new("Make your selection");
|
||||
gtk_object_set_data(GTK_OBJECT(dialog), "frame1", frame1);
|
||||
gtk_widget_show(frame1);
|
||||
gtk_container_border_width(GTK_CONTAINER(frame1), 3);
|
||||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
clist = gtk_clist_new(2);
|
||||
gtk_object_set_data(GTK_OBJECT(dialog), "clist", clist);
|
||||
gtk_widget_set_usize(clist, 500, 400);
|
||||
gtk_container_add(GTK_CONTAINER(swin), clist);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(clist), "select_row",
|
||||
GTK_SIGNAL_FUNC(ghack_menu_row_selected), NULL);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(frame1), swin);
|
||||
gtk_box_pack_start_defaults(GTK_BOX(GNOME_DIALOG(dialog)->vbox), frame1);
|
||||
|
||||
/* Add the extended commands into the list here... */
|
||||
for (n = 0; extcmdlist[n].ef_txt; ++n) {
|
||||
const char *text[3] = { extcmdlist[n].ef_txt, extcmdlist[n].ef_desc,
|
||||
NULL };
|
||||
gtk_clist_insert(GTK_CLIST(clist), n, (char **) text);
|
||||
}
|
||||
|
||||
/* fill in starting info fields */
|
||||
info.curItem = -1;
|
||||
info.numRows = n;
|
||||
info.charIdx = 0;
|
||||
info.lastTime = 0;
|
||||
|
||||
gtk_clist_columns_autosize(GTK_CLIST(clist));
|
||||
gtk_widget_show_all(swin);
|
||||
|
||||
/* Center the dialog over over parent */
|
||||
gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
|
||||
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(dialog),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
|
||||
/* Run the dialog -- returning whichever button was pressed */
|
||||
n = gnome_dialog_run_and_close(GNOME_DIALOG(dialog));
|
||||
|
||||
/* Quit on button 2 or error */
|
||||
return (n != 0) ? -1 : info.curItem;
|
||||
}
|
||||
32
outdated/win/gnome/gnmenu.h
Normal file
32
outdated/win/gnome/gnmenu.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* NetHack 3.6 gnmenu.h $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackMenuWindow_h
|
||||
#define GnomeHackMenuWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
#include "gnomeprv.h"
|
||||
|
||||
GtkWidget *ghack_init_menu_window(void);
|
||||
|
||||
struct _GHackMenuItem {
|
||||
int glyph;
|
||||
const ANY_P *identifier;
|
||||
CHAR_P accelerator;
|
||||
CHAR_P group_accel;
|
||||
int attr;
|
||||
unsigned itemflags;
|
||||
const char *str;
|
||||
BOOLEAN_P presel;
|
||||
};
|
||||
|
||||
typedef struct _GHackMenuItem GHackMenuItem;
|
||||
|
||||
int ghack_menu_window_select_menu(GtkWidget *menuWin, MENU_ITEM_P **_selected,
|
||||
gint how);
|
||||
int ghack_menu_ext_cmd(void);
|
||||
|
||||
#endif /* GnomeHackMenuWindow_h */
|
||||
99
outdated/win/gnome/gnmesg.c
Normal file
99
outdated/win/gnome/gnmesg.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/* NetHack 3.6 gnmesg.c $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnmesg.h"
|
||||
#include "gnsignal.h"
|
||||
|
||||
/* Pick an arbitrary number of chars such as 80 col X 40 rows text = 3200
|
||||
* chars */
|
||||
#define nCharsBeforeDeletingStuff 3200
|
||||
|
||||
/* Message Window widgets */
|
||||
GtkWidget *MW_table;
|
||||
GtkWidget *MW_text;
|
||||
GtkWidget *MW_scrollbar;
|
||||
|
||||
void
|
||||
ghack_message_window_clear(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
/* Seems nethack calls this after every move -- we don't want
|
||||
* to really clear the window at all though. Ignore the request */
|
||||
gint len;
|
||||
|
||||
len = gtk_text_get_length(GTK_TEXT(MW_text));
|
||||
|
||||
if (len < nCharsBeforeDeletingStuff)
|
||||
return;
|
||||
|
||||
gtk_text_freeze(GTK_TEXT(MW_text));
|
||||
gtk_text_set_point(GTK_TEXT(MW_text), 0);
|
||||
gtk_text_forward_delete(GTK_TEXT(MW_text),
|
||||
len - ((guint)(nCharsBeforeDeletingStuff * 0.5)));
|
||||
gtk_text_set_point(GTK_TEXT(MW_text),
|
||||
(guint)(nCharsBeforeDeletingStuff * 0.5));
|
||||
gtk_text_thaw(GTK_TEXT(MW_text));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_message_window_destroy(GtkWidget *win, gpointer data)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ghack_message_window_display(GtkWidget *widget, boolean block, gpointer data)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ghack_message_window_put_string(GtkWidget *widget, int attr, const char *text,
|
||||
gpointer data)
|
||||
{
|
||||
if (text == NULL)
|
||||
return;
|
||||
|
||||
/* Don't bother with attributes yet */
|
||||
gtk_text_insert(GTK_TEXT(MW_text), NULL, NULL, NULL, text, -1);
|
||||
gtk_text_insert(GTK_TEXT(MW_text), NULL, NULL, NULL, "\n", -1);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_message_window_use_RIP(int how)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ghack_message_window_scroll(int dx, int dy)
|
||||
{
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_message_window(void)
|
||||
{
|
||||
MW_table = gtk_table_new(2, 1, FALSE);
|
||||
gtk_table_set_row_spacing(GTK_TABLE(MW_table), 0, 2);
|
||||
|
||||
MW_text = gtk_text_new(NULL, NULL);
|
||||
gtk_text_set_editable(GTK_TEXT(MW_text), FALSE);
|
||||
gtk_text_set_word_wrap(GTK_TEXT(MW_text), TRUE);
|
||||
gtk_table_attach(GTK_TABLE(MW_table), MW_text, 0, 1, 0, 1,
|
||||
(GTK_EXPAND | GTK_FILL), (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
MW_scrollbar = gtk_vscrollbar_new(GTK_TEXT(MW_text)->vadj);
|
||||
gtk_table_attach(GTK_TABLE(MW_table), MW_scrollbar, 1, 2, 0, 1, GTK_FILL,
|
||||
(GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(MW_table), "ghack_putstr",
|
||||
GTK_SIGNAL_FUNC(ghack_message_window_put_string),
|
||||
NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(MW_table), "ghack_clear",
|
||||
GTK_SIGNAL_FUNC(ghack_message_window_clear), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(MW_table), "gnome_delay_output",
|
||||
GTK_SIGNAL_FUNC(ghack_delay), NULL);
|
||||
|
||||
gtk_widget_show_all(MW_table);
|
||||
|
||||
return GTK_WIDGET(MW_table);
|
||||
}
|
||||
22
outdated/win/gnome/gnmesg.h
Normal file
22
outdated/win/gnome/gnmesg.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* NetHack 3.6 gnmesg.h $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackMessageWindow_h
|
||||
#define GnomeHackMessageWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include "config.h"
|
||||
|
||||
GtkWidget *ghack_init_message_window(/* GnomeHackKeyBuffer g_keybuffer,
|
||||
GnomeHackClickBuffer g_clickbuffer */);
|
||||
void ghack_message_window_clear(GtkWidget *widget, gpointer data);
|
||||
void ghack_message_window_destroy();
|
||||
void ghack_message_window_display(GtkWidget *widget, boolean block,
|
||||
gpointer data);
|
||||
void ghack_message_window_put_string(GtkWidget *widget, int attr,
|
||||
const char *text, gpointer data);
|
||||
void ghack_message_window_use_RIP(int how);
|
||||
void ghack_message_window_scroll(int dx, int dy);
|
||||
|
||||
#endif /* GnomeHackMessageWindow_h */
|
||||
15
outdated/win/gnome/gnomeprv.h
Normal file
15
outdated/win/gnome/gnomeprv.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* NetHack 3.6 gnomeprv.h $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHack_h
|
||||
#define GnomeHack_h
|
||||
|
||||
/* These are the base nethack include files */
|
||||
#include "hack.h"
|
||||
#include "dlb.h"
|
||||
#include "patchlevel.h"
|
||||
|
||||
#include "winGnome.h"
|
||||
|
||||
#endif /* GnomeHack_h */
|
||||
114
outdated/win/gnome/gnopts.c
Normal file
114
outdated/win/gnome/gnopts.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/* NetHack 3.6 gnopts.c $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnopts.h"
|
||||
#include "gnglyph.h"
|
||||
#include "gnmain.h"
|
||||
#include "gnmap.h"
|
||||
#include <gnome.h>
|
||||
#include <ctype.h>
|
||||
#include "hack.h"
|
||||
|
||||
static gint tileset;
|
||||
static GtkWidget *clist;
|
||||
const char *tilesets[] = { "Traditional (16x16)", "Big (32x32)", 0 };
|
||||
|
||||
static void
|
||||
opt_sel_key_hit(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; tilesets[i] != 0; ++i) {
|
||||
if (tilesets[i][0] == toupper(event->keyval)) {
|
||||
tileset = i;
|
||||
gtk_clist_select_row(GTK_CLIST(clist), i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
opt_sel_row_selected(GtkCList *cList, int row, int col, GdkEvent *event)
|
||||
{
|
||||
tileset = row;
|
||||
}
|
||||
|
||||
void
|
||||
ghack_settings_dialog()
|
||||
{
|
||||
int i;
|
||||
static GtkWidget *dialog;
|
||||
static GtkWidget *swin;
|
||||
static GtkWidget *frame1;
|
||||
|
||||
dialog = gnome_dialog_new(_("GnomeHack Settings"), GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(dialog), FALSE);
|
||||
gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(opt_sel_key_hit), tilesets);
|
||||
|
||||
frame1 = gtk_frame_new(_("Choose one of the following tilesets:"));
|
||||
gtk_object_set_data(GTK_OBJECT(dialog), "frame1", frame1);
|
||||
gtk_widget_show(frame1);
|
||||
gtk_container_border_width(GTK_CONTAINER(frame1), 3);
|
||||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
clist = gtk_clist_new(2);
|
||||
gtk_clist_column_titles_hide(GTK_CLIST(clist));
|
||||
gtk_widget_set_usize(GTK_WIDGET(clist), 100, 180);
|
||||
gtk_container_add(GTK_CONTAINER(swin), clist);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(clist), "select_row",
|
||||
GTK_SIGNAL_FUNC(opt_sel_row_selected), NULL);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(frame1), swin);
|
||||
gtk_box_pack_start_defaults(GTK_BOX(GNOME_DIALOG(dialog)->vbox), frame1);
|
||||
|
||||
/* Add the tilesets into the list here... */
|
||||
for (i = 0; tilesets[i]; i++) {
|
||||
gchar accelBuf[BUFSZ];
|
||||
const char *text[3] = { accelBuf, tilesets[i], NULL };
|
||||
sprintf(accelBuf, "%c ", tolower(tilesets[i][0]));
|
||||
gtk_clist_insert(GTK_CLIST(clist), i, (char **) text);
|
||||
}
|
||||
|
||||
gtk_clist_columns_autosize(GTK_CLIST(clist));
|
||||
gtk_widget_show_all(swin);
|
||||
|
||||
/* Center the dialog over over parent */
|
||||
gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
|
||||
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(dialog),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
|
||||
/* Run the dialog -- returning whichever button was pressed */
|
||||
i = gnome_dialog_run(GNOME_DIALOG(dialog));
|
||||
gnome_dialog_close(GNOME_DIALOG(dialog));
|
||||
|
||||
/* They hit Quit or error */
|
||||
if (i != 0) {
|
||||
return;
|
||||
}
|
||||
switch (tileset) {
|
||||
case 0:
|
||||
/* They selected traditional */
|
||||
ghack_free_glyphs();
|
||||
if (ghack_init_glyphs(HACKDIR "/x11tiles"))
|
||||
g_error("ERROR: Could not initialize glyphs.\n");
|
||||
ghack_reinit_map_window();
|
||||
break;
|
||||
case 1:
|
||||
ghack_free_glyphs();
|
||||
if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm"))
|
||||
g_error("ERROR: Could not initialize glyphs.\n");
|
||||
ghack_reinit_map_window();
|
||||
|
||||
/* They selected big */
|
||||
break;
|
||||
default:
|
||||
/* This shouldn't happen */
|
||||
g_warning("This shouldn't happen\n");
|
||||
}
|
||||
}
|
||||
10
outdated/win/gnome/gnopts.h
Normal file
10
outdated/win/gnome/gnopts.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* NetHack 3.6 gnopts.h $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackSettings_h
|
||||
#define GnomeHackSettings_h
|
||||
|
||||
void ghack_settings_dialog(void);
|
||||
|
||||
#endif /* GnomeHackSettings.h */
|
||||
100
outdated/win/gnome/gnplayer.c
Normal file
100
outdated/win/gnome/gnplayer.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/* NetHack 3.6 gnplayer.c $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include <gnome.h>
|
||||
#include <ctype.h>
|
||||
#include "gnplayer.h"
|
||||
#include "gnmain.h"
|
||||
#include "hack.h"
|
||||
|
||||
static gint role_number;
|
||||
static GtkWidget *clist;
|
||||
|
||||
static void
|
||||
player_sel_key_hit(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
const char **roles = data;
|
||||
int i;
|
||||
for (i = 0; roles[i] != 0; ++i) {
|
||||
if (tolower(roles[i][0]) == tolower(event->keyval)) {
|
||||
role_number = i;
|
||||
gtk_clist_select_row(GTK_CLIST(clist), i, 0);
|
||||
if (gtk_clist_row_is_visible(GTK_CLIST(clist), i)
|
||||
!= GTK_VISIBILITY_FULL)
|
||||
gtk_clist_moveto(GTK_CLIST(clist), i, 0, 0.5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
player_sel_row_selected(GtkCList *clist, int row, int col, GdkEvent *event)
|
||||
{
|
||||
role_number = row;
|
||||
}
|
||||
|
||||
int
|
||||
ghack_player_sel_dialog(const char **choices, const gchar *title,
|
||||
const gchar *prompt)
|
||||
{
|
||||
int i;
|
||||
static GtkWidget *dialog;
|
||||
static GtkWidget *swin;
|
||||
static GtkWidget *frame1;
|
||||
|
||||
dialog = gnome_dialog_new(title, GNOME_STOCK_BUTTON_OK, _("Random"),
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(dialog), FALSE);
|
||||
gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(player_sel_key_hit), choices);
|
||||
|
||||
frame1 = gtk_frame_new(prompt);
|
||||
gtk_object_set_data(GTK_OBJECT(dialog), "frame1", frame1);
|
||||
gtk_widget_show(frame1);
|
||||
gtk_container_border_width(GTK_CONTAINER(frame1), 3);
|
||||
|
||||
swin = gtk_scrolled_window_new(NULL, NULL);
|
||||
clist = gtk_clist_new(2);
|
||||
gtk_clist_column_titles_hide(GTK_CLIST(clist));
|
||||
gtk_widget_set_usize(GTK_WIDGET(clist), 100, 180);
|
||||
gtk_container_add(GTK_CONTAINER(swin), clist);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(clist), "select_row",
|
||||
GTK_SIGNAL_FUNC(player_sel_row_selected), NULL);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(frame1), swin);
|
||||
gtk_box_pack_start_defaults(GTK_BOX(GNOME_DIALOG(dialog)->vbox), frame1);
|
||||
|
||||
/* Add the roles into the list here... */
|
||||
for (i = 0; choices[i]; i++) {
|
||||
gchar accelBuf[BUFSZ];
|
||||
const char *text[3] = { accelBuf, choices[i], NULL };
|
||||
sprintf(accelBuf, "%c ", tolower(choices[i][0]));
|
||||
gtk_clist_insert(GTK_CLIST(clist), i, (char **) text);
|
||||
}
|
||||
|
||||
gtk_clist_columns_autosize(GTK_CLIST(clist));
|
||||
gtk_widget_show_all(swin);
|
||||
|
||||
/* Center the dialog over over parent */
|
||||
gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
|
||||
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(dialog),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
|
||||
/* Run the dialog -- returning whichever button was pressed */
|
||||
i = gnome_dialog_run_and_close(GNOME_DIALOG(dialog));
|
||||
|
||||
/* Quit on button 2 or error */
|
||||
if (i < 0 || i > 1) {
|
||||
return (ROLE_NONE);
|
||||
}
|
||||
/* Random is button 1*/
|
||||
if (i == 1) {
|
||||
return (ROLE_RANDOM);
|
||||
}
|
||||
return (role_number);
|
||||
}
|
||||
10
outdated/win/gnome/gnplayer.h
Normal file
10
outdated/win/gnome/gnplayer.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* NetHack 3.6 gnplayer.h $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackPlayerSelDialog_h
|
||||
#define GnomeHackPlayerSelDialog_h
|
||||
|
||||
int ghack_player_sel_dialog(const char **, const gchar *, const gchar *);
|
||||
|
||||
#endif /* GnomeHackPlayerSelDialog_h */
|
||||
399
outdated/win/gnome/gnsignal.c
Normal file
399
outdated/win/gnome/gnsignal.c
Normal file
@@ -0,0 +1,399 @@
|
||||
/* NetHack 3.6 gnsignal.c $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
|
||||
/* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnsignal.h"
|
||||
#include "gnmain.h"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
GList *g_keyBuffer;
|
||||
GList *g_clickBuffer;
|
||||
int g_numKeys = 0;
|
||||
int g_numClicks = 0;
|
||||
int g_askingQuestion = 0;
|
||||
static int s_done = FALSE;
|
||||
|
||||
/*
|
||||
* ghack_init_signals
|
||||
*
|
||||
* Create some signals and attach them to the GtkWidget class.
|
||||
* These are the signals:
|
||||
*
|
||||
* ghack_curs : NONE:INT,INT
|
||||
* INT 1 = x
|
||||
* INT 2 = y
|
||||
*
|
||||
* ghack_putstr : NONE:INT,POINTER
|
||||
* INT = attribute
|
||||
* POINTER = char* string to print
|
||||
*
|
||||
* ghack_print_glyph : NONE:INT,INT,POINTER
|
||||
* INT 1 = x
|
||||
* INT 2 = y
|
||||
* INT 3 = GtkPixmap* to rendered glyph
|
||||
*
|
||||
* ghack_clear : NONE:NONE
|
||||
*
|
||||
* ghack_display : NONE:BOOL
|
||||
* BOOL = blocking flag
|
||||
*
|
||||
* ghack_start_menu : NONE:NONE
|
||||
*
|
||||
* ghack_add_menu : NONE:POINTER
|
||||
* POINTER = GHackMenuItem*
|
||||
*
|
||||
* ghack_end_menu : NONE:POINTER
|
||||
* POINTER = char* to closing string
|
||||
*
|
||||
* ghack_select_menu : NONE:POINTER,INT,POINTER
|
||||
* POINTER = int pointer-- filled with number
|
||||
* of selected items on return
|
||||
* INT = number of items selected
|
||||
* POINTER = structure to fill
|
||||
*
|
||||
* ghack_cliparound : NONE:INT,INT
|
||||
* INT 1 = x
|
||||
* INT 2 = y
|
||||
*/
|
||||
|
||||
void
|
||||
ghack_init_signals(void)
|
||||
{
|
||||
ghack_signals[GHSIG_CURS] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_curs", GTK_RUN_FIRST,
|
||||
gtk_marshal_NONE__INT_INT, GTK_TYPE_NONE, 2, GTK_TYPE_INT,
|
||||
GTK_TYPE_INT);
|
||||
|
||||
ghack_signals[GHSIG_PUTSTR] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_putstr", GTK_RUN_FIRST,
|
||||
gtk_marshal_NONE__INT_POINTER, GTK_TYPE_NONE, 2, GTK_TYPE_INT,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
ghack_signals[GHSIG_PRINT_GLYPH] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_print_glyph",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__INT_INT_POINTER, GTK_TYPE_NONE, 3,
|
||||
GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_POINTER);
|
||||
|
||||
ghack_signals[GHSIG_CLEAR] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_clear", GTK_RUN_FIRST,
|
||||
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
|
||||
ghack_signals[GHSIG_DISPLAY] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_display", GTK_RUN_FIRST,
|
||||
gtk_marshal_NONE__BOOL, GTK_TYPE_NONE, 1, GTK_TYPE_BOOL);
|
||||
|
||||
ghack_signals[GHSIG_START_MENU] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_start_menu",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
|
||||
ghack_signals[GHSIG_ADD_MENU] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_add_menu",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
ghack_signals[GHSIG_END_MENU] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_end_menu",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
ghack_signals[GHSIG_SELECT_MENU] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_select_menu",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__POINTER_INT_POINTER, GTK_TYPE_NONE,
|
||||
3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_POINTER);
|
||||
|
||||
ghack_signals[GHSIG_CLIPAROUND] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_cliparound",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__INT_INT, GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_INT, GTK_TYPE_INT);
|
||||
|
||||
ghack_signals[GHSIG_FADE_HIGHLIGHT] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "ghack_fade_highlight",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
|
||||
ghack_signals[GHSIG_DELAY] = gtk_object_class_user_signal_new(
|
||||
gtk_type_class(gtk_widget_get_type()), "gnome_delay_output",
|
||||
GTK_RUN_FIRST, gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
||||
}
|
||||
|
||||
/* For want of a better place, I'm putting the delay output stuff here
|
||||
* -Erik
|
||||
*/
|
||||
static gint
|
||||
timeout_callback(gpointer data)
|
||||
{
|
||||
s_done = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
ghack_delay(GtkWidget *win, int numMillisecs, gpointer data)
|
||||
{
|
||||
s_done = FALSE;
|
||||
gtk_timeout_add((unsigned int) numMillisecs, timeout_callback, NULL);
|
||||
while (s_done == FALSE)
|
||||
gtk_main_iteration();
|
||||
}
|
||||
|
||||
void
|
||||
ghack_handle_button_press(GtkWidget *widget, GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GHClick *click;
|
||||
double x1, y1;
|
||||
|
||||
if (event->type != GDK_BUTTON_PRESS)
|
||||
return;
|
||||
|
||||
gnome_canvas_window_to_world(GNOME_CANVAS(widget), event->x, event->y,
|
||||
&x1, &y1);
|
||||
/*
|
||||
g_message("I got a click at %f,%f with button %d \n",
|
||||
x1, y1, event->button);
|
||||
*/
|
||||
|
||||
/* We allocate storage here, so we need to remember if (g_numClicks>0)
|
||||
* to blow this away when closing the app using something like
|
||||
* while (g_clickBuffer)
|
||||
* {
|
||||
* g_free((GHClick)g_clickBuffer->data);
|
||||
* g_clickBuffer = g_clickBuffer->next;
|
||||
* }
|
||||
* g_list_free( g_clickBuffer );
|
||||
*
|
||||
*/
|
||||
click = g_new(GHClick, 1);
|
||||
|
||||
click->x = (int) x1 / ghack_glyph_width();
|
||||
click->y = (int) y1 / ghack_glyph_height();
|
||||
click->mod = (event->button == 1) ? CLICK_1 : CLICK_2;
|
||||
|
||||
g_clickBuffer = g_list_prepend(g_clickBuffer, click);
|
||||
/* Could use g_list_length(), but it is stupid and just
|
||||
* traverses the list while counting, so we'll just do
|
||||
* the counting ourselves in advance. */
|
||||
g_numClicks++;
|
||||
}
|
||||
|
||||
#ifndef M
|
||||
#ifndef NHSTDC
|
||||
#define M(c) (0x80 | (c))
|
||||
#else
|
||||
#define M(c) ((c) -128)
|
||||
#endif /* NHSTDC */
|
||||
#endif
|
||||
#ifndef C
|
||||
#define C(c) (0x1f & (c))
|
||||
#endif
|
||||
|
||||
void
|
||||
ghack_handle_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
{
|
||||
static int was_pound = 0;
|
||||
int key = 0;
|
||||
int ctl = GDK_CONTROL_MASK;
|
||||
int alt = GDK_MOD1_MASK;
|
||||
|
||||
/* Turn this on to debug key events */
|
||||
#if 0
|
||||
g_message("I got a \"%s\" key (%d) %s%s",
|
||||
gdk_keyval_name (event->keyval), event->keyval,
|
||||
(event->state&ctl)? "+CONTROL":"", (event->state&alt)? "+ALT":"");
|
||||
#endif
|
||||
|
||||
switch (event->keyval) {
|
||||
/* special keys to do stuff with */
|
||||
|
||||
/* Set up the direction keys */
|
||||
|
||||
/* First handle the arrow keys -- these always mean move */
|
||||
case GDK_Right:
|
||||
case GDK_rightarrow:
|
||||
key = Cmd.move_E;
|
||||
break;
|
||||
case GDK_Left:
|
||||
case GDK_leftarrow:
|
||||
key = Cmd.move_W;
|
||||
break;
|
||||
case GDK_Up:
|
||||
case GDK_uparrow:
|
||||
key = Cmd.move_N;
|
||||
break;
|
||||
case GDK_Down:
|
||||
case GDK_downarrow:
|
||||
key = Cmd.move_S;
|
||||
break;
|
||||
case GDK_Home:
|
||||
key = Cmd.move_NW;
|
||||
break;
|
||||
case GDK_End:
|
||||
key = Cmd.move_SW;
|
||||
break;
|
||||
case GDK_Page_Down:
|
||||
key = Cmd.move_SE;
|
||||
break;
|
||||
case GDK_Page_Up:
|
||||
key = Cmd.move_NE;
|
||||
break;
|
||||
case ' ':
|
||||
key = '.';
|
||||
break;
|
||||
|
||||
/* Now, handle the numberpad (move or numbers) */
|
||||
case GDK_KP_Right:
|
||||
case GDK_KP_6:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_6;
|
||||
else
|
||||
key = '6';
|
||||
break;
|
||||
|
||||
case GDK_KP_Left:
|
||||
case GDK_KP_4:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_4;
|
||||
else
|
||||
key = '4';
|
||||
break;
|
||||
|
||||
case GDK_KP_Up:
|
||||
case GDK_KP_8:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_8;
|
||||
else
|
||||
key = '8';
|
||||
break;
|
||||
|
||||
case GDK_KP_Down:
|
||||
case GDK_KP_2:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_2;
|
||||
else
|
||||
key = '2';
|
||||
break;
|
||||
|
||||
/* Move Top-Left */
|
||||
case GDK_KP_Home:
|
||||
case GDK_KP_7:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_7;
|
||||
else
|
||||
key = '7';
|
||||
break;
|
||||
|
||||
case GDK_KP_Page_Up:
|
||||
case GDK_KP_9:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_9;
|
||||
else
|
||||
key = '9';
|
||||
break;
|
||||
|
||||
case GDK_KP_End:
|
||||
case GDK_KP_1:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_1;
|
||||
else
|
||||
key = '1';
|
||||
break;
|
||||
|
||||
case GDK_KP_Page_Down:
|
||||
case GDK_KP_3:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_3;
|
||||
else
|
||||
key = '3';
|
||||
break;
|
||||
|
||||
case GDK_KP_5:
|
||||
if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
&& iflags.num_pad)
|
||||
key = GDK_KP_5;
|
||||
else
|
||||
key = '5';
|
||||
break;
|
||||
|
||||
case GDK_KP_Delete:
|
||||
case GDK_KP_Decimal:
|
||||
key = '.';
|
||||
break;
|
||||
|
||||
/* can't just ignore "#", it's a core feature */
|
||||
case GDK_numbersign:
|
||||
key = '#';
|
||||
break;
|
||||
|
||||
/* We will probably want to do something with these later... */
|
||||
case GDK_KP_Begin:
|
||||
case GDK_KP_F1:
|
||||
case GDK_F1:
|
||||
case GDK_KP_F2:
|
||||
case GDK_F2:
|
||||
case GDK_KP_F3:
|
||||
case GDK_F3:
|
||||
case GDK_KP_F4:
|
||||
case GDK_F4:
|
||||
case GDK_F5:
|
||||
case GDK_F6:
|
||||
case GDK_F7:
|
||||
case GDK_F8:
|
||||
case GDK_F9:
|
||||
case GDK_F10:
|
||||
case GDK_F11:
|
||||
case GDK_F12:
|
||||
break;
|
||||
/* various keys to ignore */
|
||||
case GDK_KP_Insert:
|
||||
case GDK_Insert:
|
||||
case GDK_Delete:
|
||||
case GDK_Print:
|
||||
case GDK_BackSpace:
|
||||
case GDK_Pause:
|
||||
case GDK_Scroll_Lock:
|
||||
case GDK_Shift_Lock:
|
||||
case GDK_Num_Lock:
|
||||
case GDK_Caps_Lock:
|
||||
case GDK_Control_L:
|
||||
case GDK_Control_R:
|
||||
case GDK_Shift_L:
|
||||
case GDK_Shift_R:
|
||||
case GDK_Alt_L:
|
||||
case GDK_Alt_R:
|
||||
case GDK_Meta_L:
|
||||
case GDK_Meta_R:
|
||||
case GDK_Mode_switch:
|
||||
case GDK_Multi_key:
|
||||
return;
|
||||
|
||||
default:
|
||||
key = event->keyval;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((event->state & alt) || was_pound) {
|
||||
key = M(event->keyval);
|
||||
} else if (event->state & ctl) {
|
||||
key = C(event->keyval);
|
||||
}
|
||||
if (was_pound) {
|
||||
was_pound = 0;
|
||||
}
|
||||
|
||||
/* Ok, here is where we do clever stuff to overide the default
|
||||
* game behavior */
|
||||
if (g_askingQuestion == 0) {
|
||||
if (key == 'S' || key == M('S') || key == C('S')) {
|
||||
ghack_save_game_cb(NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
g_keyBuffer = g_list_prepend(g_keyBuffer, GINT_TO_POINTER(key));
|
||||
g_numKeys++;
|
||||
}
|
||||
53
outdated/win/gnome/gnsignal.h
Normal file
53
outdated/win/gnome/gnsignal.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* NetHack 3.6 gnsignal.h $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackSignals_h
|
||||
#define GnomeHackSignals_h
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gnome.h>
|
||||
#include "gnomeprv.h"
|
||||
#include "gnglyph.h"
|
||||
|
||||
/* The list of custom signals */
|
||||
|
||||
enum {
|
||||
GHSIG_CURS,
|
||||
GHSIG_PUTSTR,
|
||||
GHSIG_PRINT_GLYPH,
|
||||
GHSIG_CLEAR,
|
||||
GHSIG_DISPLAY,
|
||||
GHSIG_START_MENU,
|
||||
GHSIG_ADD_MENU,
|
||||
GHSIG_END_MENU,
|
||||
GHSIG_SELECT_MENU,
|
||||
GHSIG_CLIPAROUND,
|
||||
GHSIG_FADE_HIGHLIGHT,
|
||||
GHSIG_DELAY,
|
||||
GHSIG_LAST_SIG
|
||||
};
|
||||
|
||||
guint ghack_signals[GHSIG_LAST_SIG];
|
||||
|
||||
extern void ghack_init_signals(void);
|
||||
|
||||
void ghack_handle_key_press(GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data);
|
||||
void ghack_handle_button_press(GtkWidget *widget, GdkEventButton *event,
|
||||
gpointer data);
|
||||
|
||||
typedef struct {
|
||||
int x, y, mod;
|
||||
} GHClick;
|
||||
|
||||
extern GList *g_keyBuffer;
|
||||
extern GList *g_clickBuffer;
|
||||
extern int g_numKeys;
|
||||
extern int g_numClicks;
|
||||
|
||||
extern int g_askingQuestion;
|
||||
|
||||
void ghack_delay(GtkWidget *win, int numMillisecs, gpointer data);
|
||||
|
||||
#endif /* GnomeHackSignals_h */
|
||||
908
outdated/win/gnome/gnstatus.c
Normal file
908
outdated/win/gnome/gnstatus.c
Normal file
@@ -0,0 +1,908 @@
|
||||
/* NetHack 3.6 gnstatus.c $NHDT-Date: 1432512806 2015/05/25 00:13:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnstatus.h"
|
||||
#include "gnsignal.h"
|
||||
#include "gn_xpms.h"
|
||||
#include "gnomeprv.h"
|
||||
|
||||
extern const char *hu_stat[]; /* from eat.c */
|
||||
extern const char *enc_stat[]; /* from botl.c */
|
||||
|
||||
void ghack_status_window_update_stats();
|
||||
void ghack_status_window_clear(GtkWidget *win, gpointer data);
|
||||
void ghack_status_window_destroy(GtkWidget *win, gpointer data);
|
||||
void ghack_status_window_display(GtkWidget *win, boolean block,
|
||||
gpointer data);
|
||||
void ghack_status_window_cursor_to(GtkWidget *win, int x, int y,
|
||||
gpointer data);
|
||||
void ghack_status_window_put_string(GtkWidget *win, int attr,
|
||||
const char *text, gpointer data);
|
||||
|
||||
static void ghack_fade_highlighting();
|
||||
static void ghack_highlight_widget(GtkWidget *widget, GtkStyle *oldStyle,
|
||||
GtkStyle *newStyle);
|
||||
|
||||
/* some junk to handle when to fade the highlighting */
|
||||
#define NUM_TURNS_HIGHLIGHTED 3
|
||||
|
||||
static GList *s_HighLightList;
|
||||
|
||||
typedef struct {
|
||||
GtkWidget *widget;
|
||||
GtkStyle *oldStyle;
|
||||
int nTurnsLeft;
|
||||
} Highlight;
|
||||
|
||||
/* Ok, now for a LONG list of widgets... */
|
||||
static GtkWidget *statTable = NULL;
|
||||
static GtkWidget *titleLabel = NULL;
|
||||
static GtkWidget *dgnLevelLabel = NULL;
|
||||
static GtkWidget *strPix = NULL;
|
||||
static GtkWidget *strLabel = NULL;
|
||||
static GtkWidget *dexPix = NULL;
|
||||
static GtkWidget *dexLabel = NULL;
|
||||
static GtkWidget *intPix = NULL;
|
||||
static GtkWidget *intLabel = NULL;
|
||||
static GtkWidget *wisPix = NULL;
|
||||
static GtkWidget *wisLabel = NULL;
|
||||
static GtkWidget *conPix = NULL;
|
||||
static GtkWidget *conLabel = NULL;
|
||||
static GtkWidget *chaPix = NULL;
|
||||
static GtkWidget *chaLabel = NULL;
|
||||
static GtkWidget *goldLabel = NULL;
|
||||
static GtkWidget *hpLabel = NULL;
|
||||
static GtkWidget *powLabel = NULL;
|
||||
static GtkWidget *acLabel = NULL;
|
||||
static GtkWidget *levlLabel = NULL;
|
||||
static GtkWidget *expLabel = NULL;
|
||||
static GtkWidget *timeLabel = NULL;
|
||||
static GtkWidget *scoreLabel = NULL;
|
||||
static GtkWidget *alignPix = NULL;
|
||||
static GtkWidget *alignLabel = NULL;
|
||||
static GtkWidget *hungerPix = NULL;
|
||||
static GtkWidget *hungerLabel = NULL;
|
||||
static GtkWidget *sickPix = NULL;
|
||||
static GtkWidget *sickLabel = NULL;
|
||||
static GtkWidget *blindPix = NULL;
|
||||
static GtkWidget *blindLabel = NULL;
|
||||
static GtkWidget *stunPix = NULL;
|
||||
static GtkWidget *stunLabel = NULL;
|
||||
static GtkWidget *halluPix = NULL;
|
||||
static GtkWidget *halluLabel = NULL;
|
||||
static GtkWidget *confuPix = NULL;
|
||||
static GtkWidget *confuLabel = NULL;
|
||||
static GtkWidget *encumbPix = NULL;
|
||||
static GtkWidget *encumbLabel = NULL;
|
||||
|
||||
static GtkStyle *normalStyle = NULL;
|
||||
static GtkStyle *bigStyle = NULL;
|
||||
static GtkStyle *redStyle = NULL;
|
||||
static GtkStyle *greenStyle = NULL;
|
||||
static GtkStyle *bigRedStyle = NULL;
|
||||
static GtkStyle *bigGreenStyle = NULL;
|
||||
|
||||
/* Pure red */
|
||||
static GdkColor color_red = { 0, 0xff00, 0, 0 };
|
||||
/* ForestGreen (looks better than just pure green) */
|
||||
static GdkColor color_green = { 0, 0x2200, 0x8b00, 0x2200 };
|
||||
|
||||
static int lastDepth;
|
||||
static int lastStr;
|
||||
static int lastInt;
|
||||
static int lastWis;
|
||||
static int lastDex;
|
||||
static int lastCon;
|
||||
static int lastCha;
|
||||
static long lastAu;
|
||||
static int lastHP;
|
||||
static int lastMHP;
|
||||
static int lastLevel;
|
||||
static int lastPOW;
|
||||
static int lastMPOW;
|
||||
static int lastAC;
|
||||
static int lastExp;
|
||||
static aligntyp lastAlignment;
|
||||
static unsigned lastHungr;
|
||||
static long lastConf;
|
||||
static long lastBlind;
|
||||
static long lastStun;
|
||||
static long lastHalu;
|
||||
static long lastSick;
|
||||
static int lastEncumb;
|
||||
|
||||
void
|
||||
ghack_status_window_clear(GtkWidget *win, gpointer data)
|
||||
{
|
||||
/* Don't think we need this at all */
|
||||
}
|
||||
|
||||
void
|
||||
ghack_status_window_destroy(GtkWidget *win, gpointer data)
|
||||
{
|
||||
while (s_HighLightList) {
|
||||
g_free((Highlight *) s_HighLightList->data);
|
||||
s_HighLightList = s_HighLightList->next;
|
||||
}
|
||||
g_list_free(s_HighLightList);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_status_window_display(GtkWidget *win, boolean block, gpointer data)
|
||||
{
|
||||
gtk_widget_show_all(GTK_WIDGET(win));
|
||||
}
|
||||
|
||||
void
|
||||
ghack_status_window_cursor_to(GtkWidget *win, int x, int y, gpointer data)
|
||||
{
|
||||
/* Don't think we need this at all */
|
||||
}
|
||||
|
||||
void
|
||||
ghack_status_window_put_string(GtkWidget *win, int attr, const char *text,
|
||||
gpointer data)
|
||||
{
|
||||
ghack_status_window_update_stats();
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_status_window()
|
||||
{
|
||||
GtkWidget *horizSep0, *horizSep1, *horizSep2, *horizSep3;
|
||||
GtkWidget *statsHBox, *strVBox, *dexVBox, *intVBox, *statHBox;
|
||||
GtkWidget *wisVBox, *conVBox, *chaVBox;
|
||||
GtkWidget *alignVBox, *hungerVBox, *sickVBox, *blindVBox;
|
||||
GtkWidget *stunVBox, *halluVBox, *confuVBox, *encumbVBox;
|
||||
|
||||
/* Set up a (ridiculous) initial state */
|
||||
lastDepth = 9999;
|
||||
lastStr = 9999;
|
||||
lastInt = 9999;
|
||||
lastWis = 9999;
|
||||
lastDex = 9999;
|
||||
lastCon = 9999;
|
||||
lastCha = 9999;
|
||||
lastAu = 9999;
|
||||
lastHP = 9999;
|
||||
lastMHP = 9999;
|
||||
lastLevel = 9999;
|
||||
lastPOW = 9999;
|
||||
lastMPOW = 9999;
|
||||
lastAC = 9999;
|
||||
lastExp = 9999;
|
||||
lastAlignment = A_NEUTRAL; /* start off guessing neutral */
|
||||
lastHungr = 9999;
|
||||
lastConf = 9999;
|
||||
lastBlind = 9999;
|
||||
lastStun = 9999;
|
||||
lastHalu = 9999;
|
||||
lastSick = 9999;
|
||||
lastEncumb = 9999;
|
||||
|
||||
statTable = gtk_table_new(10, 8, FALSE);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(statTable), 1);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(statTable), 1);
|
||||
|
||||
/* Begin the first row of the table -- the title */
|
||||
titleLabel = gtk_label_new(_("GnomeHack!"));
|
||||
gtk_table_attach(GTK_TABLE(statTable), titleLabel, 0, 8, 0, 1, GTK_FILL,
|
||||
0, 0, 0);
|
||||
if (!normalStyle)
|
||||
normalStyle =
|
||||
gtk_style_copy(gtk_widget_get_style(GTK_WIDGET(titleLabel)));
|
||||
|
||||
/* Set up some styles to draw stuff with */
|
||||
if (!redStyle) {
|
||||
g_assert(greenStyle == NULL);
|
||||
g_assert(bigStyle == NULL);
|
||||
g_assert(bigRedStyle == NULL);
|
||||
g_assert(bigGreenStyle == NULL);
|
||||
|
||||
greenStyle = gtk_style_copy(normalStyle);
|
||||
redStyle = gtk_style_copy(normalStyle);
|
||||
bigRedStyle = gtk_style_copy(normalStyle);
|
||||
bigGreenStyle = gtk_style_copy(normalStyle);
|
||||
bigStyle = gtk_style_copy(normalStyle);
|
||||
|
||||
greenStyle->fg[GTK_STATE_NORMAL] = color_green;
|
||||
redStyle->fg[GTK_STATE_NORMAL] = color_red;
|
||||
bigRedStyle->fg[GTK_STATE_NORMAL] = color_red;
|
||||
bigGreenStyle->fg[GTK_STATE_NORMAL] = color_green;
|
||||
|
||||
gdk_font_unref(bigRedStyle->font);
|
||||
gdk_font_unref(bigGreenStyle->font);
|
||||
bigRedStyle->font =
|
||||
gdk_font_load("-misc-fixed-*-*-*-*-20-*-*-*-*-*-*-*");
|
||||
bigGreenStyle->font =
|
||||
gdk_font_load("-misc-fixed-*-*-*-*-20-*-*-*-*-*-*-*");
|
||||
|
||||
gdk_font_unref(bigStyle->font);
|
||||
bigStyle->font =
|
||||
gdk_font_load("-misc-fixed-*-*-*-*-20-*-*-*-*-*-*-*");
|
||||
}
|
||||
gtk_widget_set_style(GTK_WIDGET(titleLabel), bigStyle);
|
||||
|
||||
/* Begin the second row */
|
||||
dgnLevelLabel = gtk_label_new(_("Nethack for Gnome"));
|
||||
gtk_table_attach(GTK_TABLE(statTable), dgnLevelLabel, 0, 8, 1, 2,
|
||||
GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_set_style(GTK_WIDGET(dgnLevelLabel), bigStyle);
|
||||
|
||||
/* Begin the third row */
|
||||
horizSep0 = gtk_hseparator_new();
|
||||
gtk_table_attach(GTK_TABLE(statTable), horizSep0, 0, 8, 2, 3, GTK_FILL,
|
||||
GTK_FILL, 0, 0);
|
||||
|
||||
/* Begin the fourth row */
|
||||
statsHBox = gtk_hbox_new(TRUE, 0);
|
||||
|
||||
strVBox = gtk_vbox_new(FALSE, 0);
|
||||
strPix = gnome_pixmap_new_from_xpm_d(str_xpm);
|
||||
strLabel = gtk_label_new("STR: ");
|
||||
gtk_box_pack_start(GTK_BOX(strVBox), strPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(strVBox), strLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(strVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
dexVBox = gtk_vbox_new(FALSE, 0);
|
||||
dexPix = gnome_pixmap_new_from_xpm_d(dex_xpm);
|
||||
dexLabel = gtk_label_new("DEX: ");
|
||||
gtk_box_pack_start(GTK_BOX(dexVBox), dexPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(dexVBox), dexLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(dexVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
conVBox = gtk_vbox_new(FALSE, 0);
|
||||
conPix = gnome_pixmap_new_from_xpm_d(cns_xpm);
|
||||
conLabel = gtk_label_new("CON: ");
|
||||
gtk_box_pack_start(GTK_BOX(conVBox), conPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(conVBox), conLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(conVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
intVBox = gtk_vbox_new(FALSE, 0);
|
||||
intPix = gnome_pixmap_new_from_xpm_d(int_xpm);
|
||||
intLabel = gtk_label_new("INT: ");
|
||||
gtk_box_pack_start(GTK_BOX(intVBox), intPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(intVBox), intLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(intVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
wisVBox = gtk_vbox_new(FALSE, 0);
|
||||
wisPix = gnome_pixmap_new_from_xpm_d(wis_xpm);
|
||||
wisLabel = gtk_label_new("WIS: ");
|
||||
gtk_box_pack_start(GTK_BOX(wisVBox), wisPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(wisVBox), wisLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(wisVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
chaVBox = gtk_vbox_new(FALSE, 0);
|
||||
chaPix = gnome_pixmap_new_from_xpm_d(cha_xpm);
|
||||
chaLabel = gtk_label_new("CHA: ");
|
||||
gtk_box_pack_start(GTK_BOX(chaVBox), chaPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(chaVBox), chaLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statsHBox), GTK_WIDGET(chaVBox), TRUE, TRUE,
|
||||
2);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(statTable), GTK_WIDGET(statsHBox), 0, 8, 3, 4,
|
||||
GTK_FILL, 0, 0, 0);
|
||||
|
||||
/* Begin the fifth row */
|
||||
horizSep1 = gtk_hseparator_new();
|
||||
gtk_table_attach(GTK_TABLE(statTable), horizSep1, 0, 8, 4, 5, GTK_FILL,
|
||||
GTK_FILL, 0, 0);
|
||||
|
||||
/* Begin the sixth row */
|
||||
hpLabel = gtk_label_new("HP: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), hpLabel, 0, 1, 5, 6, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
acLabel = gtk_label_new("AC: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), acLabel, 2, 3, 5, 6, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
powLabel = gtk_label_new("Power: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), powLabel, 4, 5, 5, 6, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
goldLabel = gtk_label_new("Au: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), goldLabel, 6, 7, 5, 6, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
/* Begin the seventh row */
|
||||
horizSep2 = gtk_hseparator_new();
|
||||
gtk_table_attach(GTK_TABLE(statTable), horizSep2, 0, 8, 6, 7, GTK_FILL,
|
||||
GTK_FILL, 0, 0);
|
||||
|
||||
/* Begin the eigth row */
|
||||
levlLabel = gtk_label_new("Level: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), levlLabel, 0, 1, 7, 8, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
expLabel = gtk_label_new("Exp: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), expLabel, 2, 3, 7, 8, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
timeLabel = gtk_label_new("Time: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), timeLabel, 4, 5, 7, 8, GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
scoreLabel = gtk_label_new("Score: ");
|
||||
gtk_table_attach(GTK_TABLE(statTable), scoreLabel, 6, 7, 7, 8, GTK_FILL,
|
||||
0, 0, 0);
|
||||
|
||||
/* Begin the ninth row */
|
||||
horizSep3 = gtk_hseparator_new();
|
||||
gtk_table_attach(GTK_TABLE(statTable), horizSep3, 0, 8, 8, 9, GTK_FILL,
|
||||
GTK_FILL, 0, 0);
|
||||
|
||||
/* Begin the tenth and last row */
|
||||
statHBox = gtk_hbox_new(FALSE, 0);
|
||||
|
||||
alignVBox = gtk_vbox_new(FALSE, 0);
|
||||
alignPix = gnome_pixmap_new_from_xpm_d(neutral_xpm);
|
||||
alignLabel = gtk_label_new("Neutral");
|
||||
gtk_box_pack_start(GTK_BOX(alignVBox), alignPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(alignVBox), alignLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(alignVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
hungerVBox = gtk_vbox_new(FALSE, 0);
|
||||
hungerPix = gnome_pixmap_new_from_xpm_d(hungry_xpm);
|
||||
hungerLabel = gtk_label_new("Hungry");
|
||||
gtk_box_pack_start(GTK_BOX(hungerVBox), hungerPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(hungerVBox), hungerLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(hungerVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
sickVBox = gtk_vbox_new(FALSE, 0);
|
||||
sickPix = gnome_pixmap_new_from_xpm_d(sick_fp_xpm);
|
||||
sickLabel = gtk_label_new("FoodPois");
|
||||
gtk_box_pack_start(GTK_BOX(sickVBox), sickPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(sickVBox), sickLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(sickVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
blindVBox = gtk_vbox_new(FALSE, 0);
|
||||
blindPix = gnome_pixmap_new_from_xpm_d(blind_xpm);
|
||||
blindLabel = gtk_label_new("Blind");
|
||||
gtk_box_pack_start(GTK_BOX(blindVBox), blindPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(blindVBox), blindLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(blindVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
stunVBox = gtk_vbox_new(FALSE, 0);
|
||||
stunPix = gnome_pixmap_new_from_xpm_d(stunned_xpm);
|
||||
stunLabel = gtk_label_new("Stun");
|
||||
gtk_box_pack_start(GTK_BOX(stunVBox), stunPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(stunVBox), stunLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(stunVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
confuVBox = gtk_vbox_new(FALSE, 0);
|
||||
confuPix = gnome_pixmap_new_from_xpm_d(confused_xpm);
|
||||
confuLabel = gtk_label_new("Confused");
|
||||
gtk_box_pack_start(GTK_BOX(confuVBox), confuPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(confuVBox), confuLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(confuVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
halluVBox = gtk_vbox_new(FALSE, 0);
|
||||
halluPix = gnome_pixmap_new_from_xpm_d(hallu_xpm);
|
||||
halluLabel = gtk_label_new("Hallu");
|
||||
gtk_box_pack_start(GTK_BOX(halluVBox), halluPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(halluVBox), halluLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(halluVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
encumbVBox = gtk_vbox_new(FALSE, 0);
|
||||
encumbPix = gnome_pixmap_new_from_xpm_d(slt_enc_xpm);
|
||||
encumbLabel = gtk_label_new("Burdened");
|
||||
gtk_box_pack_start(GTK_BOX(encumbVBox), encumbPix, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(encumbVBox), encumbLabel, TRUE, TRUE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(statHBox), GTK_WIDGET(encumbVBox), TRUE, FALSE,
|
||||
2);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(statTable), GTK_WIDGET(statHBox), 0, 8, 9, 10,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
||||
/* Set up the necessary signals */
|
||||
gtk_signal_connect(GTK_OBJECT(statTable), "ghack_fade_highlight",
|
||||
GTK_SIGNAL_FUNC(ghack_fade_highlighting), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(statTable), "ghack_putstr",
|
||||
GTK_SIGNAL_FUNC(ghack_status_window_put_string), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(statTable), "ghack_clear",
|
||||
GTK_SIGNAL_FUNC(ghack_status_window_clear), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(statTable), "ghack_curs",
|
||||
GTK_SIGNAL_FUNC(ghack_status_window_cursor_to), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(statTable), "gnome_delay_output",
|
||||
GTK_SIGNAL_FUNC(ghack_delay), NULL);
|
||||
|
||||
/* Lastly, show the status window and everything in it */
|
||||
gtk_widget_show_all(statTable);
|
||||
|
||||
return GTK_WIDGET(statTable);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_status_window_update_stats()
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
gchar *buf1;
|
||||
const char *hung;
|
||||
const char *enc;
|
||||
static int firstTime = TRUE;
|
||||
long umoney;
|
||||
|
||||
/* First, fill in the player name and the dungeon level */
|
||||
strcpy(buf, g.plname);
|
||||
if ('a' <= buf[0] && buf[0] <= 'z')
|
||||
buf[0] += 'A' - 'a';
|
||||
strcat(buf, " the ");
|
||||
if (u.mtimedone) {
|
||||
char mname[BUFSZ];
|
||||
int k = 0;
|
||||
|
||||
strcpy(mname, mons[u.umonnum].mname);
|
||||
while (mname[k] != 0) {
|
||||
if ((k == 0 || (k > 0 && mname[k - 1] == ' ')) && 'a' <= mname[k]
|
||||
&& mname[k] <= 'z') {
|
||||
mname[k] += 'A' - 'a';
|
||||
}
|
||||
k++;
|
||||
}
|
||||
strcat(buf, mname);
|
||||
} else {
|
||||
strcat(buf, rank_of(u.ulevel, pl_character[0], flags.female));
|
||||
}
|
||||
gtk_label_get(GTK_LABEL(titleLabel), &buf1);
|
||||
if (strcmp(buf1, buf) != 0 && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(titleLabel, bigStyle, bigGreenStyle);
|
||||
}
|
||||
gtk_label_set(GTK_LABEL(titleLabel), buf);
|
||||
|
||||
if (In_endgame(&u.uz)) {
|
||||
strcpy(buf, (Is_astralevel(&u.uz) ? "Astral Plane" : "End Game"));
|
||||
} else {
|
||||
sprintf(buf, "%s, level %d", dungeons[u.uz.dnum].dname, depth(&u.uz));
|
||||
}
|
||||
if (lastDepth > depth(&u.uz) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(dgnLevelLabel, bigStyle, bigRedStyle);
|
||||
} else if (lastDepth < depth(&u.uz) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(dgnLevelLabel, bigStyle, bigGreenStyle);
|
||||
}
|
||||
lastDepth = depth(&u.uz);
|
||||
gtk_label_set(GTK_LABEL(dgnLevelLabel), buf);
|
||||
|
||||
/* Next, fill in the player's stats */
|
||||
if (ACURR(A_STR) > 118) {
|
||||
sprintf(buf, "STR:%d", ACURR(A_STR) - 100);
|
||||
} else if (ACURR(A_STR) == 118) {
|
||||
sprintf(buf, "STR:18/**");
|
||||
} else if (ACURR(A_STR) > 18) {
|
||||
sprintf(buf, "STR:18/%02d", ACURR(A_STR) - 18);
|
||||
} else {
|
||||
sprintf(buf, "STR:%d", ACURR(A_STR));
|
||||
}
|
||||
if (lastStr < ACURR(A_STR) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(strLabel, normalStyle, greenStyle);
|
||||
} else if (lastStr > ACURR(A_STR) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(strLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastStr = ACURR(A_STR);
|
||||
gtk_label_set(GTK_LABEL(strLabel), buf);
|
||||
|
||||
sprintf(buf, "INT:%d", ACURR(A_INT));
|
||||
if (lastInt < ACURR(A_INT) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(intLabel, normalStyle, greenStyle);
|
||||
} else if (lastInt > ACURR(A_INT) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(intLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastInt = ACURR(A_INT);
|
||||
gtk_label_set(GTK_LABEL(intLabel), buf);
|
||||
|
||||
sprintf(buf, "WIS:%d", ACURR(A_WIS));
|
||||
if (lastWis < ACURR(A_WIS) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(wisLabel, normalStyle, greenStyle);
|
||||
} else if (lastWis > ACURR(A_WIS) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(wisLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastWis = ACURR(A_WIS);
|
||||
gtk_label_set(GTK_LABEL(wisLabel), buf);
|
||||
|
||||
sprintf(buf, "DEX:%d", ACURR(A_DEX));
|
||||
if (lastDex < ACURR(A_DEX) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(dexLabel, normalStyle, greenStyle);
|
||||
} else if (lastDex > ACURR(A_DEX) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(dexLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastDex = ACURR(A_DEX);
|
||||
gtk_label_set(GTK_LABEL(dexLabel), buf);
|
||||
|
||||
sprintf(buf, "CON:%d", ACURR(A_CON));
|
||||
if (lastCon < ACURR(A_CON) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(conLabel, normalStyle, greenStyle);
|
||||
} else if (lastCon > ACURR(A_CON) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(conLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastCon = ACURR(A_CON);
|
||||
gtk_label_set(GTK_LABEL(conLabel), buf);
|
||||
|
||||
sprintf(buf, "CHA:%d", ACURR(A_CHA));
|
||||
if (lastCha < ACURR(A_CHA) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(chaLabel, normalStyle, greenStyle);
|
||||
} else if (lastCha > ACURR(A_CHA) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(chaLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastCha = ACURR(A_CHA);
|
||||
gtk_label_set(GTK_LABEL(chaLabel), buf);
|
||||
|
||||
/* Now do the non-pixmaped stats (gold and such) */
|
||||
umoney = money_cnt(g.invent);
|
||||
sprintf(buf, "Au:%ld", umoney);
|
||||
if (lastAu < umoney && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(goldLabel, normalStyle, greenStyle);
|
||||
} else if (lastAu > umoney && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(goldLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastAu = umoney;
|
||||
gtk_label_set(GTK_LABEL(goldLabel), buf);
|
||||
|
||||
if (u.mtimedone) {
|
||||
/* special case: when polymorphed, show "HD", disable exp */
|
||||
sprintf(buf, "HP:%d/%d", ((u.mh > 0) ? u.mh : 0), u.mhmax);
|
||||
if ((lastHP < u.mh || lastMHP < u.mhmax) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(hpLabel, normalStyle, greenStyle);
|
||||
} else if ((lastHP > u.mh || lastMHP > u.mhmax)
|
||||
&& firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(hpLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastHP = u.mh;
|
||||
lastMHP = u.mhmax;
|
||||
} else {
|
||||
sprintf(buf, "HP:%d/%d", ((u.uhp > 0) ? u.uhp : 0), u.uhpmax);
|
||||
if ((lastHP < u.uhp || lastMHP < u.uhpmax) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(hpLabel, normalStyle, greenStyle);
|
||||
} else if ((lastHP > u.uhp || lastMHP > u.uhpmax)
|
||||
&& firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(hpLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastHP = u.uhp;
|
||||
lastMHP = u.uhpmax;
|
||||
}
|
||||
gtk_label_set(GTK_LABEL(hpLabel), buf);
|
||||
|
||||
if (u.mtimedone) {
|
||||
/* special case: when polymorphed, show "HD", disable exp */
|
||||
sprintf(buf, "HD:%d", mons[u.umonnum].mlevel);
|
||||
if (lastLevel < mons[u.umonnum].mlevel && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(levlLabel, normalStyle, greenStyle);
|
||||
} else if (lastLevel > mons[u.umonnum].mlevel && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(levlLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastLevel = mons[u.umonnum].mlevel;
|
||||
} else {
|
||||
sprintf(buf, "Level:%d", u.ulevel);
|
||||
if (lastLevel < u.ulevel && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(levlLabel, normalStyle, greenStyle);
|
||||
} else if (lastLevel > u.ulevel && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(levlLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastLevel = u.ulevel;
|
||||
}
|
||||
gtk_label_set(GTK_LABEL(levlLabel), buf);
|
||||
|
||||
sprintf(buf, "Power:%d/%d", u.uen, u.uenmax);
|
||||
if ((lastPOW < u.uen || lastMPOW < u.uenmax) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(powLabel, normalStyle, greenStyle);
|
||||
}
|
||||
if ((lastPOW > u.uen || lastMPOW > u.uenmax) && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(powLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastPOW = u.uen;
|
||||
lastMPOW = u.uenmax;
|
||||
gtk_label_set(GTK_LABEL(powLabel), buf);
|
||||
|
||||
sprintf(buf, "AC:%d", u.uac);
|
||||
if (lastAC > u.uac && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(acLabel, normalStyle, greenStyle);
|
||||
} else if (lastAC < u.uac && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(acLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastAC = u.uac;
|
||||
gtk_label_set(GTK_LABEL(acLabel), buf);
|
||||
|
||||
if (flags.showexp) {
|
||||
sprintf(buf, "Exp:%ld", u.uexp);
|
||||
if (lastExp < u.uexp && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(expLabel, normalStyle, greenStyle);
|
||||
} else if (lastExp > u.uexp && firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(expLabel, normalStyle, redStyle);
|
||||
}
|
||||
lastExp = u.uexp;
|
||||
gtk_label_set(GTK_LABEL(expLabel), buf);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(expLabel), "");
|
||||
}
|
||||
|
||||
if (flags.time) {
|
||||
sprintf(buf, "Time:%ld", g.moves);
|
||||
gtk_label_set(GTK_LABEL(timeLabel), buf);
|
||||
} else
|
||||
gtk_label_set(GTK_LABEL(timeLabel), "");
|
||||
#ifdef SCORE_ON_BOTL
|
||||
if (flags.showscore) {
|
||||
sprintf(buf, "Score:%ld", botl_score());
|
||||
gtk_label_set(GTK_LABEL(scoreLabel), buf);
|
||||
} else
|
||||
gtk_label_set(GTK_LABEL(scoreLabel), "");
|
||||
#else
|
||||
{
|
||||
gtk_label_set(GTK_LABEL(scoreLabel), "");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* See if their alignment has changed */
|
||||
if (lastAlignment != u.ualign.type) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(alignLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastAlignment = u.ualign.type;
|
||||
/* looks like their alignment has changed -- change out the icon */
|
||||
if (u.ualign.type == A_CHAOTIC) {
|
||||
gtk_label_set(GTK_LABEL(alignLabel), "Chaotic");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(alignPix), chaotic_xpm);
|
||||
} else if (u.ualign.type == A_NEUTRAL) {
|
||||
gtk_label_set(GTK_LABEL(alignLabel), "Neutral");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(alignPix), neutral_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(alignLabel), "Lawful");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(alignPix), lawful_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
hung = hu_stat[u.uhs];
|
||||
if (lastHungr != u.uhs) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(hungerLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastHungr = u.uhs;
|
||||
if (hung[0] == ' ') {
|
||||
gtk_label_set(GTK_LABEL(hungerLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(hungerPix), nothing_xpm);
|
||||
} else if (u.uhs == 0 /* SATIATED */) {
|
||||
gtk_label_set(GTK_LABEL(hungerLabel), hung);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(hungerPix), satiated_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(hungerLabel), hung);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(hungerPix), hungry_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
if (lastConf != Confusion) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(confuLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastConf = Confusion;
|
||||
if (Confusion) {
|
||||
gtk_label_set(GTK_LABEL(confuLabel), "Confused");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(confuPix), confused_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(confuLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(confuPix), nothing_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
if (lastBlind != Blind) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(blindLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastBlind = Blind;
|
||||
if (Blind) {
|
||||
gtk_label_set(GTK_LABEL(blindLabel), "Blind");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(blindPix), blind_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(blindLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(blindPix), nothing_xpm);
|
||||
}
|
||||
}
|
||||
if (lastStun != Stunned) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(stunLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastStun = Stunned;
|
||||
if (Stunned) {
|
||||
gtk_label_set(GTK_LABEL(stunLabel), "Stun");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(stunPix), stunned_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(stunLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(stunPix), nothing_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
if (lastHalu != Hallucination) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(halluLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastHalu = Hallucination;
|
||||
if (Hallucination) {
|
||||
gtk_label_set(GTK_LABEL(halluLabel), "Hallu");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(halluPix), hallu_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(halluLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(halluPix), nothing_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
if (lastSick != Sick) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(sickLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastSick = Sick;
|
||||
if (Sick) {
|
||||
if (u.usick_type & SICK_VOMITABLE) {
|
||||
gtk_label_set(GTK_LABEL(sickLabel), "FoodPois");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(sickPix), sick_fp_xpm);
|
||||
} else if (u.usick_type & SICK_NONVOMITABLE) {
|
||||
gtk_label_set(GTK_LABEL(sickLabel), "Ill");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(sickPix), sick_il_xpm);
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(sickLabel), "FoodPois");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(sickPix), sick_fp_xpm);
|
||||
}
|
||||
} else {
|
||||
gtk_label_set(GTK_LABEL(sickLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(sickPix), nothing_xpm);
|
||||
}
|
||||
}
|
||||
|
||||
enc = enc_stat[near_capacity()];
|
||||
if (lastEncumb != near_capacity()) {
|
||||
if (firstTime == FALSE) {
|
||||
/* Ok, this changed so add it to the highlighing list */
|
||||
ghack_highlight_widget(encumbLabel, normalStyle, redStyle);
|
||||
}
|
||||
|
||||
lastEncumb = near_capacity();
|
||||
switch (lastEncumb) {
|
||||
case 0:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), " ");
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), nothing_xpm);
|
||||
break;
|
||||
case 1:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), enc);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), slt_enc_xpm);
|
||||
break;
|
||||
case 2:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), enc);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), mod_enc_xpm);
|
||||
break;
|
||||
case 3:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), enc);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), hvy_enc_xpm);
|
||||
break;
|
||||
case 4:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), enc);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), ext_enc_xpm);
|
||||
break;
|
||||
case 5:
|
||||
gtk_label_set(GTK_LABEL(encumbLabel), enc);
|
||||
gnome_pixmap_load_xpm_d(GNOME_PIXMAP(encumbPix), ovr_enc_xpm);
|
||||
}
|
||||
}
|
||||
firstTime = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
ghack_fade_highlighting()
|
||||
{
|
||||
GList *item;
|
||||
Highlight *highlt;
|
||||
|
||||
/* Remove any items from the queue if their time is up */
|
||||
for (item = g_list_first(s_HighLightList); item;) {
|
||||
highlt = (Highlight *) item->data;
|
||||
if (highlt) {
|
||||
if (highlt->nTurnsLeft <= 0) {
|
||||
gtk_widget_set_style(GTK_WIDGET(highlt->widget),
|
||||
highlt->oldStyle);
|
||||
s_HighLightList = g_list_remove_link(s_HighLightList, item);
|
||||
g_free(highlt);
|
||||
g_list_free_1(item);
|
||||
item = g_list_first(s_HighLightList);
|
||||
continue;
|
||||
} else
|
||||
(highlt->nTurnsLeft)--;
|
||||
}
|
||||
if (item)
|
||||
item = item->next;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Widget changed, so add it to the highlighing list */
|
||||
static void
|
||||
ghack_highlight_widget(GtkWidget *widget, GtkStyle *oldStyle,
|
||||
GtkStyle *newStyle)
|
||||
{
|
||||
Highlight *highlt;
|
||||
GList *item;
|
||||
|
||||
/* Check if this widget is already in the queue. If so then
|
||||
* remove it, so we will only have the new entry in the queue */
|
||||
for (item = g_list_first(s_HighLightList); item;) {
|
||||
highlt = (Highlight *) item->data;
|
||||
if (highlt) {
|
||||
if (highlt->widget == widget) {
|
||||
s_HighLightList = g_list_remove_link(s_HighLightList, item);
|
||||
g_free(highlt);
|
||||
g_list_free_1(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (item)
|
||||
item = item->next;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Ok, now highlight this widget and add it into the fade
|
||||
* highlighting queue */
|
||||
highlt = g_new(Highlight, 1);
|
||||
highlt->nTurnsLeft = NUM_TURNS_HIGHLIGHTED;
|
||||
highlt->oldStyle = oldStyle;
|
||||
highlt->widget = widget;
|
||||
s_HighLightList = g_list_prepend(s_HighLightList, highlt);
|
||||
gtk_widget_set_style(GTK_WIDGET(widget), newStyle);
|
||||
}
|
||||
14
outdated/win/gnome/gnstatus.h
Normal file
14
outdated/win/gnome/gnstatus.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* NetHack 3.6 gnstatus.h $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackStatusWindow_h
|
||||
#define GnomeHackStatusWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
GtkWidget *ghack_init_status_window();
|
||||
|
||||
#endif /* GnomeHackStatusWindow_h */
|
||||
151
outdated/win/gnome/gntext.c
Normal file
151
outdated/win/gnome/gntext.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* NetHack 3.6 gntext.c $NHDT-Date: 1432512804 2015/05/25 00:13:24 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gntext.h"
|
||||
#include "gnmain.h"
|
||||
#include <gnome.h>
|
||||
|
||||
/* include the standard RIP window (win/X11/rip.xpm) */
|
||||
#include "gn_rip.h"
|
||||
|
||||
/* dimensions of the pixmap */
|
||||
#define RIP_IMAGE_WIDTH 400
|
||||
#define RIP_IMAGE_HEIGHT 200
|
||||
|
||||
/* dimensions and location of area where we can draw text on the pixmap */
|
||||
#define RIP_DRAW_WIDTH 84
|
||||
#define RIP_DRAW_HEIGHT 89
|
||||
#define RIP_DRAW_X 114
|
||||
#define RIP_DRAW_Y 69
|
||||
|
||||
/* Text Window widgets */
|
||||
GtkWidget *RIP = NULL;
|
||||
GtkWidget *RIPlabel = NULL;
|
||||
GtkWidget *TW_window = NULL;
|
||||
GnomeLess *gless;
|
||||
|
||||
static int showRIP = 0;
|
||||
|
||||
void
|
||||
ghack_text_window_clear(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
g_assert(gless != NULL);
|
||||
gtk_editable_delete_text(GTK_EDITABLE(gless->text), 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_text_window_destroy()
|
||||
{
|
||||
TW_window = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
ghack_text_window_display(GtkWidget *widget, boolean block, gpointer data)
|
||||
{
|
||||
if (showRIP == 1) {
|
||||
gtk_widget_show(GTK_WIDGET(RIP));
|
||||
gtk_window_set_title(GTK_WINDOW(TW_window), "Rest In Peace");
|
||||
}
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(TW_window), "destroy",
|
||||
(GtkSignalFunc) ghack_text_window_destroy, NULL);
|
||||
if (block)
|
||||
gnome_dialog_run(GNOME_DIALOG(TW_window));
|
||||
else
|
||||
gnome_dialog_run_and_close(GNOME_DIALOG(TW_window));
|
||||
|
||||
if (showRIP == 1) {
|
||||
showRIP = 0;
|
||||
gtk_widget_hide(GTK_WIDGET(RIP));
|
||||
gtk_window_set_title(GTK_WINDOW(TW_window), "Text Window");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ghack_text_window_put_string(GtkWidget *widget, int attr, const char *text,
|
||||
gpointer data)
|
||||
{
|
||||
if (text == NULL)
|
||||
return;
|
||||
|
||||
/* Don't bother with attributes yet */
|
||||
gtk_text_insert(GTK_TEXT(gless->text), NULL, NULL, NULL, text, -1);
|
||||
gtk_text_insert(GTK_TEXT(gless->text), NULL, NULL, NULL, "\n", -1);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_text_window()
|
||||
{
|
||||
GtkWidget *pixmap;
|
||||
if (TW_window)
|
||||
return (GTK_WIDGET(TW_window));
|
||||
|
||||
TW_window = gnome_dialog_new("Text Window", GNOME_STOCK_BUTTON_OK, NULL);
|
||||
gtk_window_set_default_size(GTK_WINDOW(TW_window), 500, 400);
|
||||
gtk_window_set_policy(GTK_WINDOW(TW_window), TRUE, TRUE, FALSE);
|
||||
gtk_window_set_title(GTK_WINDOW(TW_window), "Text Window");
|
||||
|
||||
/* create GNOME pixmap object */
|
||||
pixmap = gnome_pixmap_new_from_xpm_d(rip_xpm);
|
||||
g_assert(pixmap != NULL);
|
||||
gtk_widget_show(GTK_WIDGET(pixmap));
|
||||
|
||||
/* create label with our "death message", sized to fit into the
|
||||
* tombstone */
|
||||
RIPlabel = gtk_label_new("RIP");
|
||||
g_assert(RIPlabel != NULL);
|
||||
/* gtk_label_set_justify is broken? */
|
||||
gtk_label_set_justify(GTK_LABEL(RIPlabel), GTK_JUSTIFY_CENTER);
|
||||
gtk_label_set_line_wrap(GTK_LABEL(RIPlabel), TRUE);
|
||||
gtk_widget_set_usize(RIPlabel, RIP_DRAW_WIDTH, RIP_DRAW_HEIGHT);
|
||||
gtk_widget_show(RIPlabel);
|
||||
|
||||
/* create a fixed sized widget for the RIP pixmap */
|
||||
RIP = gtk_fixed_new();
|
||||
g_assert(RIP != NULL);
|
||||
gtk_widget_set_usize(RIP, RIP_IMAGE_WIDTH, RIP_IMAGE_HEIGHT);
|
||||
gtk_fixed_put(GTK_FIXED(RIP), pixmap, 0, 0);
|
||||
gtk_fixed_put(GTK_FIXED(RIP), RIPlabel, RIP_DRAW_X, RIP_DRAW_Y);
|
||||
gtk_widget_show(RIP);
|
||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(TW_window)->vbox), RIP, TRUE,
|
||||
TRUE, 0);
|
||||
|
||||
/* create a gnome Less widget for the text stuff */
|
||||
gless = GNOME_LESS(gnome_less_new());
|
||||
g_assert(gless != NULL);
|
||||
gtk_widget_show(GTK_WIDGET(gless));
|
||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(TW_window)->vbox),
|
||||
GTK_WIDGET(gless), TRUE, TRUE, 0);
|
||||
|
||||
/* Hook up some signals */
|
||||
gtk_signal_connect(GTK_OBJECT(TW_window), "ghack_putstr",
|
||||
GTK_SIGNAL_FUNC(ghack_text_window_put_string), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(TW_window), "ghack_clear",
|
||||
GTK_SIGNAL_FUNC(ghack_text_window_clear), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(TW_window), "ghack_display",
|
||||
GTK_SIGNAL_FUNC(ghack_text_window_display), NULL);
|
||||
|
||||
/* Center the dialog over over parent */
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(TW_window),
|
||||
GTK_WINDOW(ghack_get_main_window()));
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(TW_window), TRUE);
|
||||
gtk_widget_show_all(TW_window);
|
||||
gtk_widget_hide(GTK_WIDGET(RIP));
|
||||
gnome_dialog_close_hides(GNOME_DIALOG(TW_window), TRUE);
|
||||
|
||||
return GTK_WIDGET(TW_window);
|
||||
}
|
||||
|
||||
void
|
||||
ghack_text_window_rip_string(const char *string)
|
||||
{
|
||||
/* This is called to specify that the next message window will
|
||||
* be a RIP window, which will include this text */
|
||||
|
||||
showRIP = 1;
|
||||
gtk_label_set(GTK_LABEL(RIPlabel), string);
|
||||
}
|
||||
21
outdated/win/gnome/gntext.h
Normal file
21
outdated/win/gnome/gntext.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* NetHack 3.6 gntext.h $NHDT-Date: 1432512805 2015/05/25 00:13:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackTextWindow_h
|
||||
#define GnomeHackTextWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
GtkWidget *ghack_init_text_window();
|
||||
void ghack_text_window_clear(GtkWidget *widget, gpointer data);
|
||||
void ghack_text_window_destroy();
|
||||
void ghack_text_window_display(GtkWidget *widget, boolean block,
|
||||
gpointer data);
|
||||
void ghack_text_window_put_string(GtkWidget *widget, int attr,
|
||||
const char *text, gpointer data);
|
||||
void ghack_text_window_rip_string(const char *ripString);
|
||||
|
||||
#endif /* GnomeHackTextWindow_h */
|
||||
103
outdated/win/gnome/gnworn.c
Normal file
103
outdated/win/gnome/gnworn.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/* NetHack 3.6 gnworn.c 2009/05/06 10:58:06 1.3 */
|
||||
/*
|
||||
* $NHDT-Date: 1432512804 2015/05/25 00:13:24 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $
|
||||
*/
|
||||
/* Copyright (C) 2002, Dylan Alex Simon */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnworn.h"
|
||||
#include "gnglyph.h"
|
||||
#include "gnsignal.h"
|
||||
#include "gnomeprv.h"
|
||||
|
||||
#define WORN_WIDTH 3
|
||||
#define WORN_HEIGHT 6
|
||||
|
||||
#define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ \
|
||||
{ \
|
||||
{ \
|
||||
uquiver, uarmh, u.twoweap ? NULL : uswapwep \
|
||||
} \
|
||||
, { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \
|
||||
{ uleft, uamul, uright }, { uarms, uarmc, uarmg }, \
|
||||
{ uarmu, uarm, uskin }, \
|
||||
{ \
|
||||
uball, uarmf, uchain \
|
||||
} \
|
||||
}
|
||||
|
||||
static GtkWidget *worn_contents[WORN_HEIGHT][WORN_WIDTH];
|
||||
static struct obj *last_worn_objects[WORN_HEIGHT][WORN_WIDTH];
|
||||
|
||||
GdkImlibImage *image_of_worn_object(struct obj *o);
|
||||
void ghack_worn_display(GtkWidget *win, boolean block, gpointer data);
|
||||
|
||||
GtkWidget *
|
||||
ghack_init_worn_window()
|
||||
{
|
||||
GtkWidget *top;
|
||||
GtkWidget *table;
|
||||
GtkWidget *tablealign;
|
||||
GtkWidget *label;
|
||||
int i, j;
|
||||
|
||||
top = gtk_vbox_new(FALSE, 2);
|
||||
|
||||
table = gtk_table_new(WORN_HEIGHT, WORN_WIDTH, TRUE);
|
||||
for (i = 0; i < WORN_HEIGHT; i++) {
|
||||
for (j = 0; j < WORN_WIDTH; j++) {
|
||||
worn_contents[i][j] =
|
||||
gnome_pixmap_new_from_imlib(image_of_worn_object(NULL));
|
||||
last_worn_objects[i][j] = NULL; /* a pointer that will never be */
|
||||
gtk_table_attach(GTK_TABLE(table),
|
||||
GTK_WIDGET(worn_contents[i][j]), j, j + 1, i,
|
||||
i + 1, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
tablealign = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
|
||||
gtk_box_pack_start(GTK_BOX(top), tablealign, FALSE, FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(tablealign), table);
|
||||
|
||||
label = gtk_label_new("Equipment");
|
||||
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
|
||||
gtk_box_pack_start(GTK_BOX(top), label, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(top), "ghack_display",
|
||||
GTK_SIGNAL_FUNC(ghack_worn_display), NULL);
|
||||
|
||||
return top;
|
||||
}
|
||||
|
||||
GdkImlibImage *
|
||||
image_of_worn_object(struct obj *o)
|
||||
{
|
||||
int glyph;
|
||||
GdkImlibImage *im;
|
||||
|
||||
if (o)
|
||||
glyph = obj_to_glyph(o, rn2_on_display_rng);
|
||||
else
|
||||
glyph = cmap_to_glyph(S_stone);
|
||||
|
||||
im = ghack_image_from_glyph(glyph, FALSE);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
void
|
||||
ghack_worn_display(GtkWidget *win, boolean block, gpointer data)
|
||||
{
|
||||
int i, j;
|
||||
struct obj *worn_objects[WORN_HEIGHT][WORN_WIDTH] = WORN_OBJECT_LIST;
|
||||
|
||||
for (i = 0; i < WORN_HEIGHT; i++) {
|
||||
for (j = 0; j < WORN_WIDTH; j++) {
|
||||
if (worn_objects[i][j] != last_worn_objects[i][j]) {
|
||||
last_worn_objects[i][j] = worn_objects[i][j];
|
||||
gnome_pixmap_load_imlib(
|
||||
GNOME_PIXMAP(worn_contents[i][j]),
|
||||
image_of_worn_object(worn_objects[i][j]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
outdated/win/gnome/gnworn.h
Normal file
17
outdated/win/gnome/gnworn.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* NetHack 3.6 gnworn.h 2009/05/06 10:58:06 1.3 */
|
||||
/*
|
||||
* $NHDT-Date: 1432512804 2015/05/25 00:13:24 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $
|
||||
*/
|
||||
/* Copyright (C) 2002 by Dylan Alex Simon */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackWornWindow_h
|
||||
#define GnomeHackWornWindow_h
|
||||
|
||||
#include <gnome.h>
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
GtkWidget *ghack_init_worn_window();
|
||||
|
||||
#endif /* GnomeHackWornWindow_h */
|
||||
70
outdated/win/gnome/gnyesno.c
Normal file
70
outdated/win/gnome/gnyesno.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/* NetHack 3.6 gnyesno.c $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "gnbind.h"
|
||||
#include "gnyesno.h"
|
||||
|
||||
int
|
||||
ghack_yes_no_dialog(const char *question, const char *choices, int def)
|
||||
{
|
||||
int i = 0, ret;
|
||||
gchar button_name[BUFSZ];
|
||||
GtkWidget *box;
|
||||
GtkWidget *mainWnd = NULL;
|
||||
|
||||
box = gnome_message_box_new(question, GNOME_MESSAGE_BOX_QUESTION, NULL);
|
||||
/* add buttons for each choice */
|
||||
if (!strcmp(GNOME_STOCK_BUTTON_OK, choices)) {
|
||||
gnome_dialog_append_button(GNOME_DIALOG(box), GNOME_STOCK_BUTTON_OK);
|
||||
gnome_dialog_set_default(GNOME_DIALOG(box), 0);
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), 0, 'o', 0);
|
||||
#if 0
|
||||
g_print("Setting accelerator '%c' for button %d\n", 'o', 0);
|
||||
#endif
|
||||
} else {
|
||||
for (; choices[i] != '\0'; i++) {
|
||||
if (choices[i] == 'y') {
|
||||
sprintf(button_name, GNOME_STOCK_BUTTON_YES);
|
||||
} else if (choices[i] == 'n') {
|
||||
sprintf(button_name, GNOME_STOCK_BUTTON_NO);
|
||||
} else if (choices[i] == 'q') {
|
||||
sprintf(button_name, "Quit");
|
||||
} else {
|
||||
sprintf(button_name, "%c", choices[i]);
|
||||
}
|
||||
if (def == choices[i])
|
||||
gnome_dialog_set_default(GNOME_DIALOG(box), i);
|
||||
gnome_dialog_append_button(GNOME_DIALOG(box), button_name);
|
||||
gnome_dialog_set_accelerator(GNOME_DIALOG(box), i, choices[i], 0);
|
||||
#if 0
|
||||
g_print("Setting accelerator '%c' for button %d\n", choices[i], i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/* Perhaps add in a quit game button, like this... */
|
||||
gnome_dialog_append_button ( GNOME_DIALOG(box), GNOME_STOCK_BUTTON_CLOSE);
|
||||
gnome_dialog_set_accelerator( GNOME_DIALOG(box), i, choices[i], 0);
|
||||
g_print("Setting accelerator '%c' for button %d\n", 'Q', i);
|
||||
#endif
|
||||
|
||||
gnome_dialog_set_close(GNOME_DIALOG(box), TRUE);
|
||||
mainWnd = ghack_get_main_window();
|
||||
gtk_window_set_modal(GTK_WINDOW(box), TRUE);
|
||||
gtk_window_set_title(GTK_WINDOW(box), "GnomeHack");
|
||||
if (mainWnd != NULL) {
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(box), GTK_WINDOW(mainWnd));
|
||||
}
|
||||
|
||||
ret = gnome_dialog_run_and_close(GNOME_DIALOG(box));
|
||||
|
||||
#if 0
|
||||
g_print("You selected button %d\n", ret);
|
||||
#endif
|
||||
|
||||
if (ret == -1)
|
||||
return ('\033');
|
||||
else
|
||||
return (choices[ret]);
|
||||
}
|
||||
11
outdated/win/gnome/gnyesno.h
Normal file
11
outdated/win/gnome/gnyesno.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/* NetHack 3.6 gnyesno.h $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef GnomeHackYesNoDialog_h
|
||||
#define GnomeHackYesNoDialog_h
|
||||
|
||||
int ghack_yes_no_dialog(const char *szQuestionStr, const char *szChoicesStr,
|
||||
int nDefault);
|
||||
|
||||
#endif
|
||||
353
outdated/win/gnome/mapbg.xpm
Normal file
353
outdated/win/gnome/mapbg.xpm
Normal file
@@ -0,0 +1,353 @@
|
||||
/* XPM */
|
||||
static char * mapbg_xpm[] = {
|
||||
"96 96 254 2",
|
||||
" c None",
|
||||
". c #BC6C33",
|
||||
"+ c #AC6324",
|
||||
"@ c #B46B2B",
|
||||
"# c #B47734",
|
||||
"$ c #AC6B2C",
|
||||
"% c #B46C3D",
|
||||
"& c #BC7945",
|
||||
"* c #A4774B",
|
||||
"= c #B48643",
|
||||
"- c #AC7F40",
|
||||
"; c #AC773A",
|
||||
"> c #C49054",
|
||||
", c #C48044",
|
||||
"' c #B4642C",
|
||||
") c #B45E21",
|
||||
"! c #BC642B",
|
||||
"~ c #BD723E",
|
||||
"{ c #C4884E",
|
||||
"] c #C48F4B",
|
||||
"^ c #C49753",
|
||||
"/ c #CC9052",
|
||||
"( c #CC7234",
|
||||
"_ c #B4804F",
|
||||
": c #C4985D",
|
||||
"< c #946232",
|
||||
"[ c #AC6431",
|
||||
"} c #C46637",
|
||||
"| c #945222",
|
||||
"1 c #8C5435",
|
||||
"2 c #844C29",
|
||||
"3 c #945836",
|
||||
"4 c #AC653D",
|
||||
"5 c #A45E2B",
|
||||
"6 c #AC5E2A",
|
||||
"7 c #A44D21",
|
||||
"8 c #A45823",
|
||||
"9 c #A4592C",
|
||||
"0 c #B46C34",
|
||||
"a c #B46536",
|
||||
"b c #AC7240",
|
||||
"c c #AC7231",
|
||||
"d c #944C1B",
|
||||
"e c #8C5223",
|
||||
"f c #945722",
|
||||
"g c #AC6B34",
|
||||
"h c #944C24",
|
||||
"i c #9C5222",
|
||||
"j c #B47234",
|
||||
"k c #C4783B",
|
||||
"l c #BC7833",
|
||||
"m c #BC7F3B",
|
||||
"n c #BC8044",
|
||||
"o c #BC783C",
|
||||
"p c #A46332",
|
||||
"q c #9C6331",
|
||||
"r c #B4773C",
|
||||
"s c #B4723D",
|
||||
"t c #A46B33",
|
||||
"u c #B48043",
|
||||
"v c #CC814C",
|
||||
"w c #B46422",
|
||||
"x c #C47946",
|
||||
"y c #C48743",
|
||||
"z c #BC6D3D",
|
||||
"A c #BC6536",
|
||||
"B c #94522E",
|
||||
"C c #A4643E",
|
||||
"D c #B45E2F",
|
||||
"E c #A45223",
|
||||
"F c #9C4C1B",
|
||||
"G c #B47845",
|
||||
"H c #C4804D",
|
||||
"I c #9C5723",
|
||||
"J c #AC5E35",
|
||||
"K c #A45935",
|
||||
"L c #9B5E29",
|
||||
"M c #BE7234",
|
||||
"N c #BC8744",
|
||||
"O c #AC5924",
|
||||
"P c #A45E35",
|
||||
"Q c #9C582C",
|
||||
"R c #AC501F",
|
||||
"S c #9C5935",
|
||||
"T c #8C4D28",
|
||||
"U c #643D21",
|
||||
"V c #845437",
|
||||
"W c #B47E31",
|
||||
"X c #844126",
|
||||
"Y c #B45823",
|
||||
"Z c #954627",
|
||||
"` c #9C4C24",
|
||||
" . c #7C4124",
|
||||
".. c #B4592D",
|
||||
"+. c #9C5E37",
|
||||
"@. c #945644",
|
||||
"#. c #AC6C3E",
|
||||
"$. c #8C4627",
|
||||
"%. c #9C643E",
|
||||
"&. c #744021",
|
||||
"*. c #A4723C",
|
||||
"=. c #844628",
|
||||
"-. c #743819",
|
||||
";. c #844019",
|
||||
">. c #944D2D",
|
||||
",. c #A4512C",
|
||||
"'. c #B45227",
|
||||
"). c #C4622A",
|
||||
"!. c #9C522E",
|
||||
"~. c #7C3A1A",
|
||||
"{. c #BC5E24",
|
||||
"]. c #CC8243",
|
||||
"^. c #9C664C",
|
||||
"/. c #AC5934",
|
||||
"(. c #9C4E2E",
|
||||
"_. c #7C4B29",
|
||||
":. c #8C532C",
|
||||
"<. c #A46423",
|
||||
"[. c #7C422C",
|
||||
"}. c #743214",
|
||||
"|. c #AC592C",
|
||||
"1. c #8C4224",
|
||||
"2. c #C47F3C",
|
||||
"3. c #8C421C",
|
||||
"4. c #8C410F",
|
||||
"5. c #8C5D3E",
|
||||
"6. c #8C5B32",
|
||||
"7. c #88461A",
|
||||
"8. c #663626",
|
||||
"9. c #AC6B4C",
|
||||
"0. c #94411A",
|
||||
"a. c #845C30",
|
||||
"b. c #744B20",
|
||||
"c. c #7C4D34",
|
||||
"d. c #CC874A",
|
||||
"e. c #D49053",
|
||||
"f. c #C46C32",
|
||||
"g. c #BC814D",
|
||||
"h. c #CC7842",
|
||||
"i. c #A45A44",
|
||||
"j. c #8C4B1A",
|
||||
"k. c #843204",
|
||||
"l. c #945E37",
|
||||
"m. c #7C564C",
|
||||
"n. c #74422C",
|
||||
"o. c #95461B",
|
||||
"p. c #AC7747",
|
||||
"q. c #745634",
|
||||
"r. c #94572C",
|
||||
"s. c #7C4621",
|
||||
"t. c #CC7A54",
|
||||
"u. c #B47654",
|
||||
"v. c #BC5E2C",
|
||||
"w. c #B49056",
|
||||
"x. c #C4915C",
|
||||
"y. c #B4874E",
|
||||
"z. c #BC884D",
|
||||
"A. c #A46C45",
|
||||
"B. c #D48749",
|
||||
"C. c #BC5A30",
|
||||
"D. c #CCA06C",
|
||||
"E. c #BCA26C",
|
||||
"F. c #BC8F54",
|
||||
"G. c #BC895C",
|
||||
"H. c #BC8F4C",
|
||||
"I. c #BC995E",
|
||||
"J. c #C46D3D",
|
||||
"K. c #D4985A",
|
||||
"L. c #C4562C",
|
||||
"M. c #843A16",
|
||||
"N. c #C49F63",
|
||||
"O. c #BC9652",
|
||||
"P. c #B48F4C",
|
||||
"Q. c #CC915C",
|
||||
"R. c #BC5824",
|
||||
"S. c #B49A60",
|
||||
"T. c #CC9F60",
|
||||
"U. c #DC995F",
|
||||
"V. c #AC8A54",
|
||||
"W. c #B4875F",
|
||||
"X. c #C4885C",
|
||||
"Y. c #BC905E",
|
||||
"Z. c #CC975B",
|
||||
"`. c #D4A167",
|
||||
" + c #7C5334",
|
||||
".+ c #9C6B39",
|
||||
"++ c #845323",
|
||||
"@+ c #B46D4C",
|
||||
"#+ c #A46B3C",
|
||||
"$+ c #CC9864",
|
||||
"%+ c #8C4E34",
|
||||
"&+ c #743A24",
|
||||
"*+ c #6C3D2E",
|
||||
"=+ c #C45E30",
|
||||
"-+ c #AC7E52",
|
||||
";+ c #9C6C47",
|
||||
">+ c #6C3C1B",
|
||||
",+ c #CC8954",
|
||||
"'+ c #542810",
|
||||
")+ c #7C5E3C",
|
||||
"!+ c #84532C",
|
||||
"~+ c #946C45",
|
||||
"{+ c #946340",
|
||||
"]+ c #BCA870",
|
||||
"^+ c #B49E5C",
|
||||
"/+ c #C47E5C",
|
||||
"(+ c #AC8E44",
|
||||
"_+ c #8C633A",
|
||||
":+ c #C4A86C",
|
||||
"<+ c #CCA76E",
|
||||
"[+ c #CCA961",
|
||||
"}+ c #7A462D",
|
||||
"|+ c #8C6644",
|
||||
"1+ c #744623",
|
||||
"2+ c #A47248",
|
||||
"3+ c #94624C",
|
||||
"4+ c #845E3C",
|
||||
"5+ c #7C5329",
|
||||
"6+ c #9C7249",
|
||||
"7+ c #844D34",
|
||||
"8+ c #6C4C30",
|
||||
"9+ c #A46E54",
|
||||
"0+ c #A4624C",
|
||||
"a+ c #6C3E24",
|
||||
"b+ c #5C3224",
|
||||
"c+ c #D4A66C",
|
||||
"d+ c #744B30",
|
||||
"e+ c #BC926C",
|
||||
"f+ c #AC7954",
|
||||
"g+ c #AC522C",
|
||||
"h+ c #6C4526",
|
||||
"i+ c #A47A54",
|
||||
"j+ c #BC6644",
|
||||
"k+ c #BC6E4C",
|
||||
"l+ c #A48650",
|
||||
"m+ c #AC825C",
|
||||
"n+ c #CC6A34",
|
||||
"o+ c #9C7E5C",
|
||||
"p+ c #7C623C",
|
||||
"q+ c #5C3A2C",
|
||||
"r+ c #644A34",
|
||||
"s+ c #4C3624",
|
||||
"t+ c #844B1B",
|
||||
"u+ c #7C4018",
|
||||
"v+ c #D49A68",
|
||||
"w+ c #7C4B1C",
|
||||
"x+ c #742E04",
|
||||
"y+ c #CC8157",
|
||||
"z+ c #745A44",
|
||||
"A+ c #B46644",
|
||||
"B+ c #643614",
|
||||
"C+ c #C4A65C",
|
||||
"D+ c #843A04",
|
||||
"E+ c #6C2E14",
|
||||
". + @ # @ $ % & * = - ; > , ' . ) ! ~ { ] ^ ] / ( ' , _ : < [ } [ | 1 2 3 4 5 ! 6 7 8 ' 8 9 0 a b c d | [ 0 % e 8 f 5 ~ g h i % & % 5 a ' 8 ' a < j k l m { n o . ! 6 . 0 % p p q g r s 0 @ 0 . ",
|
||||
"j + $ # @ t g s u > u c { v @ ! w ' ~ x y y m u . ) z r > f 5 A [ B 3 2 B C 6 @ D E E 8 F i 6 0 g G 0 o H , j d I I [ & % i f [ . @ . 6 J K 2 3 L $ . M o N # j D ' O % [ 0 p P L g & l 0 0 . % ",
|
||||
"4 Q 5 % j $ @ g u / G t M k ' R 9 9 J A . M p 3 . O ! M { L 3 4 [ Q S T B Q 6 ' 6 6 J a a 9 9 a c & 0 ~ ~ z 0 L 5 8 5 [ [ d 8 & M . x i B 3 U V 3 4 . l & N m W 6 6 8 % [ g 8 5 q % & o j [ [ 0 ",
|
||||
"3 X h [ 0 0 0 0 ~ n j p 0 z Y 7 T Z ` Y ! ' Q .a ..! . , t +.@.#.[ C S S 9 [ . D a J a z J 8 % , o + 8 8 [ @ ' J 9 Q 6 5 5 [ x P [ 4 $.1 %.&.V S p ~ o b *.; c 9 6 5 % [ [ 5 p p b & o 0 $ [ 6 ",
|
||||
"=.-.;.9 a . j j . 0 [ @ z . Y O >.h ,.'.).! !.~.P D {.! ].& ^.T & & s % 4 [ A . 4 /.` Z (.d Q , H #.8 E 8 [ [ [ a 9 /.% z 0 . ~ _.1 :.T S C S | < <.M 0 | 2 T >.Q Q | [ 5 [ p 0 0 % # s j % 5 !.",
|
||||
"[.}.~.!.' 0 @ @ . 6 O 0 ~ a D Y P K |.... . K 1.8 D {.! 2.y b Q o x % % a 6 . A ,.` 3.1.1.4.i ~ & 5 i d 8 J 9 [ A J |.D a D a a 5.3 .;.h 8 a I 6.f $ g 7.}.1.$.T T T +.Q 0 g 0 % % 0 0 0 % 5 h ",
|
||||
"_.8.;.E 6 ' ' @ ' O 8 ' @ . a ..+ D 9 9 0 o ~ p 6 ' ! . , n 0 . 0 o [ A a |.a 6 ` 3.Z (.>.$.I 0 #.e h d !.J I C a D E F F 7 |.D 9.>.>.Z 0.9 a 8 a.b.Q [ =.;.!.K 2 T 7.S 5 #.[ 0 g [ g g % g J Q ",
|
||||
"c.-.;.8 D ) @ w . ' w [ a ~ ~ Y O O 9 S c d.e.d.f.A . H g.# @ h.$ ~ [ % z |.. 6 /.Z ` i.Z d [ o %.j.S P 4 % Q p E 8 O 7 F Z E /.O k.a a 9 & #.l.m.n.B C j.T 5 ) :.:.2 q p % [ [ [ [ [ [ [ 4 p Q ",
|
||||
"o.F i I 9 [ 0 0 ' 6 8 6 # n o 0 @ ) L W d.].0 [ + @ M k m ; $ @ $ 0 j 0 0 0 0 a c g G p.q f p s ' 0 d !.Q h & M Y '.7 E 7 7 7 R [ @ ) |.[ 4 3 b.q.b.2 L % g P r.j.I 6 a a 6 + [ [ p [ [ g & & I ",
|
||||
"I d d E 0 ~ 0 6 ' O E 8 j n m . ( j # N 2.@ O !.@ @ ! M r # # M # m n , & r % s m r & o p I [ [ $ @ 7.Q P Q o j f.. O 8 F 7 O ..6 ' ' ..a a q 2 _.s.;.j.F o.o.j.I 5 p O 8 O @ M [ 0 0 g 0 o ~ L ",
|
||||
"[ 9 F 9 z t.. O ' ) O w r n , ~ A % u.n o w |.|.a ' D ' o o n ~ j l , N n r G _ u 0 #.a |.[ 0 # n r | 9 P 8 0 [ l o o % g [ D 6 7 O ..Y a A 4 p C #.s ' O 6 D a g % 0 a [ 6 [ 0 @ , k o o n o c ",
|
||||
"[ [ [ ' a . a |.8 O Y 0 o ~ . v./.r.S #.z . D D 5 6 ..! s & o ~ # o m r u _ w.x.y.p.[ J 6 % y z.] n p g a 6 @ [ # m y { m ~ @ @ 9 |.D ' A ~ % [ A.G x ~ ' ! 0 z 0 0 0 % . 0 [ [ [ o o $ M # 0 o ",
|
||||
"g s ~ 0 0 a ' ' O ' ~ B.{ o ' C./.$.;.B ' A R ` Z ,...A . o & ~ y m N N ] : : D.E.F.G.g.G _ H.I.y N s % 0 a z M r u m & o o m m & & ~ ~ l j 0 <.t s G j $ 0 # j % [ 8 [ 0 % . ~ @ o o 0 r j # y ",
|
||||
"o o l s o & , x 0 J.B.e.K., . L.a >.M.d 6 ! E 3.M.o...! . & n r 2.y n { > : : F.I.I.N.: y.F.O.P.n o a ' D 6 ' 0 $ c % o & o o m & G # j # r c [ q p L I I L <.p . ' [ 0 o % 0 % o k o o o o o , ",
|
||||
"k n o o & { / Q., l ~ , { m ! R.D !.h 6 . . ) P 7.i ..w M m { n m n N z.z.z.y.= y.z.I.S.w.I.x.g.o ' 6 Y R O 8 [ [ a [ a z o r # s j j j @ 0 . 0 ~ . 0 0 0 0 0 o ! . o H o [ [ a g 6 [ s 0 g g g ",
|
||||
"@ o o r c u > T.U.H # n ] n J.).D 6 0 k ( M ~ & +.[ D w l y / g.{ { { { N z.] > y z.w.w.V.W.X.& ~ 6 Y R Y ! ' 0 ~ a E 7 9 0 m n o k k k . ' D } D D A z z ' [ A 6 ' 0 0 p L [ x a I [ & & & s g ",
|
||||
"I E D ! 0 s z.F.T.H.o o h.d., c j m / Y.Z.`.n t ' ' $ , y y N m m y y ] { z.n N n { ; > H.r / z.~ p E O D 6 ' . @ 5 i d F 5 g r [ j o 0 g % 0 [ ' 6 5 p I 4.4.o.o.d e U +c.6..+[ i j d.# m { p ",
|
||||
"0 5 i O a g.Q.F.T.^ N o & ].n @ # m { b p.Q.N c ! a M , / { m m W m N z.z.n N y n { ; z.] u ] r 0 + 8 ..a D w @ @ ' 8 d T r.g r @ 0 g [ <.[ [ p 5 5 [ p Q Q 5 z 6 p :.b.V _.l.p s 5 0 m @ # { G ",
|
||||
"H ~ [ a & H g._ > Z.: ] z.] , o . o ~ f Q H H j . . x y d., 2.o y N z.z.z.N n & { { ; z.> u { s 0 a D 6 v.a ' w Y O >. .&.2 q $ g 0 [ 5 5 [ [ [ 0 [ | 7.>.Q 9 h !.P ++2 5.=.4 @ C | Q P Q 5 0 k ",
|
||||
"H , s % @+#.#+#+#.z.$+N.: Z.H k 0 a a E 9 & x ~ z k x , , l M k y ] > ^ > G.n m { N u ] ^ { y s k . a |.6 ! ' + {.|.%+&+*+V p l [ $ @ [ $ 0 0 p % S 7.$.B C Q T ;.3 T 2 @.%+a @ +.T $.>.K 9 [ k ",
|
||||
"n & q B +.+.S p :.#+y.Y.w.H.{ , J.a a /.a z a o x k , o ~ . . f.# n ] : Z.: > { o n u > ^ { n o ~ J.a 9 6 0 . @ =+O T 8.8.1 [ 0 $ 0 s j % % g 0 +.Q S !.B h h f ~.4 t %.3 3 4 6 r.T X $.i.J a k ",
|
||||
"~ % B e ^.%.e T 3 q * -+_ u H / x a a a A 0 [ & , { , n l M f.. . o z.> : : ] H o n N F.z.n o J.~ a [ [ 0 % M M w |.Z }.-.T L O j ~ o 0 $ [ [ % p 5 9 K i j.j.| 4.% G p 1 S B r.| T X Z K a [ . ",
|
||||
"' % +.l.* ;+2 2 ;+%.q s b b u x.x % 0 . 0 M j n N z.y n o o f.! ).. & z.F.> z.n n n z.H.z.n 0 . a [ [ b & r g j @ 0 [ >.` K a ' 0 r o % [ 5 5 g $ p 8 9 a ~ o # D @ o #+T @.>+1 K 5 5 [ % ~ z J ",
|
||||
"E a +.1 ;+;+6.A.* %.+.@+% p #+= #.g 0 0 M , r y u N N n o k . {.R.v.0 u G.F.{ z.,+y > H.H.G ' ' @ [ g n z.# $ <.<.0 a |.E a A 0 <.0 x o g L 8 [ <.% 0 8 8 @ k m B.M o g V 1 '+)+h Q @ j M 0 J o.",
|
||||
"_..+^.!+6.l.l.l.~+;+6.V {+:.:.A.r.e q G F.N.]+]+^+I.^ K.d.' 6 z @ M % a /+{ y.H.(+T.^ u ,+2.a ' [ <.t y.x.y.b t L $ @ ' [ 0 # g j j r % [ I p g [ 0 O Y ) w 2.y l j $ @ 5 I P i I <.0 0 0 0 5 e ",
|
||||
":.%.< :.1 {+l.3 ~+;+_+6.l.!+s.5.3 T q g.> > :+<+:+: H.y ].. ) A + ' 6 9 [ G z.> P.[+^ N { d.0 . . @ s g.z.n 0 @ j o o 0 @ M r # $ j o #.[ <.g #.j . 6 . . 0 , y j l k , g 8 p 5 [ g a z % a 5 i ",
|
||||
"A.%.%.+.l.C #+%.{+~+{+{+5.}+n.}+3 6.#.H { z.> T.<+Z.n o , ~ ! a w ' D 9 !.[ n ] O.<+N.= ] y o l M . o o & s 0 . n n o 0 $ j r # $ j s 0 #.s s # g [ 9 0 z 5 g #+2.o , ,+d.H & 0 s % a a a [ J 5 ",
|
||||
"b S %.C +.^.9.A.5.{+~+^.|+1+*+n.c.1 #.H x o H ,+> { n s x k . . . ! A A O a v y I.[+N.N H.y m 2.h.l l & o r ~ o & m r g g s o G j g b G G r r & r #.[ % 4 | S q o 5 <.~ , d.o $ z a 6 a a /.4 a ",
|
||||
"#.3 +.%.r.+.2+b 5.5.3+;+5.c.n.n.8.T #.~ 0 z x & % & & o x M . z ! D A A D o d.d.: T.: H.z.] y ] 2.m n n z.N N n m G r # r r m r n g c g.{ G j o H r [ #.9 7.e q [ | [ $ g o o o % a [ J [ [ a a ",
|
||||
"C p %.C {+l.;+;+{+4+3+;+l.%+2 .2 Q @+z J 6 K Q [ M & & , s 0 l ~ ' a ' ' o , n F.F.> H.m N N m N N u y.z.H.z.N n n n n z.n G o , s r G.F.r # & o & [ g L j.Q p o 5 0 [ 0 , o x M . s g % % % a ",
|
||||
"C A.#+A.A.;+5.1 ~+5.{+;+^.S +.Q #.g ~ x 6 h $.=.. [ [ r g.o # , , H o 0 j o m N = N { N u u m r N N N n _ u = = & u u _ N _ n r & & n z.z.n o # x x j o o $ o r ].L + [ 0 d.g g 0 n , n u n % p ",
|
||||
"q p.2+A.* ;+5+1+6+a.< A.#+#+~ g v ' . h.a $. .7+. + I #.{ { m / H e.{ k d.y N ] N N ] / n n y m N { { { G G u _ r b r u = u G r ~ g.{ u y.z.n @ 0 0 0 o 2.y ].m , + , o s , 0 & @ , { N , y o 5 ",
|
||||
"k @ j j . H & 6.a.6+a.6+;+s ~ [ 2.j C C !.j.b.8+[ K j.l r H.N.P.= z.K.N Z.; N > r z.H.N ] r t o u u n n u u u V.<.G I p ;.g g u = V.H.u { # o g $ g G z.z.m m , N = = ] # y m # W <.o ~ ; t r t ",
|
||||
". + $ [ ' ~ & .+l.;+l.2+9+#.~ a n q 1 2 T &.1+q.C [ % { y T.^ I.> z./ o e.r n z.# u N N { u # l u u m r r r p.u s % [ J I 5 r { z.u > u { r r 0 j ~ b g t #.o d.H.y N K.y { o r n g k o g.N { j ",
|
||||
"D 9 + + O ' % b S 0+@.9+C C 4 z A.}+a+b+V &._.7+e p { { { c+F.<+Z.N n $ y 0 ~ % j $ r y n # ~ 0 u m n G r s G n & $ % 5 4 j.t n F.G.] g.{ r n 0 d.n p $.X I # 2.y n u y g 0 0 , 2.' . % & { e.. ",
|
||||
"..|.6 a D D a j S @.2 3+1 5.S #.S [.d+U l.T +.B e b X.g.> D.F.N.x.z.r 6 M D ' |.0 [ o , r j ~ $ r n g.& & r r & s p % P % j.<.p.> z.z._ / n n o y & S ~.~.Q j m / H H v 5 I |.x M ' A /.5 s x a ",
|
||||
"C./.9 9 D v.' . %.7+a+c.d+c.2 q !.1 3+2 #+9 % S u.Z.G.y.e+x.z.f+> { & [ . ....... 0 , v % . ~ ' [ b & n & s ~ s t #.& G & b _ g.z._ z.g./ g.{ H m g Q X >.s { y 5 L p , [ a [ x . ! A |.4.Q z {.",
|
||||
"..g+d 0.7 ..' z %.c.U }+h+5+s.l.$.%+3 h ' ' z g G.$+-+_ Y.* f+r._ H & w D O ..D A z ~ o j % 0 a I [ s G r s b s G x.H X.G X.G.z.G.= G.z.x.z.> > z.u #.C b H > N <.| d % % h.~ ~ . } v./.~.d D v.",
|
||||
"..|.d ;.F ..D . C T _.c.[.B $.P }+ .%+K z ' s _ z.i+-+i+_ 2+;+e t r z [ 6 |.|.A 6 a D [ 0 ~ 0 [ E [ s g.G G r u > : z._ p.G.F.P.Y.F.F.F.: y.> Z.Z.> g.n g.> ] > U.,+o , [ ~ a ! f.{...J 3.| D ! ",
|
||||
"v.J.p h /.A A J.i.B B @.=.i.(.j+a.c.@.k+t.~ A.l+F..+e+m+W.f+;+:.P s % ' D a a z ..D 8 I ~ & 0 a /.@+x z.z.= y.z.x.y.p.A.b y.I.N.: Y.N.: : y.F.N.x.F.N y ] ] : T.r n n , 5 5 [ ' M ! /.k+B 4 . n+",
|
||||
"] u 6 R ! A z g.I #.=.%+l.%+J a B T p [ & C k+g.u ; g.e+o+p+ +3 {+q #.[ 6 . o g [ H [ n { > N j D 6 a & { : I.w._ _ !+_.+.9.Y.N.]+S.I.F.Z.u n n u u - H.Z.N # y I l o u j j m l l l + $ K.] u : ",
|
||||
"z.m @ ' f.~ ~ g.& & :.1 @.S % a %.+.C % @+[ u.& u b _ m+~+)+_+^.#+#.% @ [ . & c s d.g.> ] { z.N ~ z s u G.x.O.F.G -+c.&.1 ^.y.I.]+S.N.G.> n n N ] = ; W Z.] u n @ n o m n m , $ l 2.j k e.{ N Z.",
|
||||
"n , j . k o n > { G e T 3 C H a P 0+J % [ [ % & n G _ f+|+4+2+f+p 4 % a ' ~ , s & % { { F.N z.z., n & n z.z.F.y.s 9+b.U c.@._ O.S.I.N.G.H.n { { N ] H.= H.y m y , , s j g j & . j M . M & [ 5 r ",
|
||||
"n o j . o y z.T.,+_ r.:.:.#.,+a 3 K !.4 8 a % x u G u.A._+|+9+#.4 #.z a [ ~ x % G f u u > ^ z.N N u u g.z.z.g.G p 3 8+q+*+V p.] w.I.T.z.G.z.{ { u ] Z.> z.= r #.~ ].r g <.<.~ o ~ x k z A O i a ",
|
||||
"& o j @ , N ] : K.{ p.#+p #.H g Q P Q a 6 ~ ~ H _ g.& _ p.-+p.#+% % @+0 0 % & #.& | G y.Z.> H.y.> z.u u g.g.G b i 2 r+s+8.7+#+r -+F.T.F.> g.{ g.> ] = u y.g.t t++ & & , r g j 0 o ~ z z z J D z ",
|
||||
"0 o o o n & _ G.x.> { _ G g.H & #.s % s z H H & W.u.g.X.G.e+g.A.i.3 p % % 0 ~ z ~ #.g.> > y.u n Z.> u G r r s #.S 2 +}+n.3 C c u z.Z.> > g.{ & > N y.u p.u #.| g ~ r n H & & 0 r b g a a 6 ' a ",
|
||||
"g o x o @+p +.@+= G.> { ,+{ g.{ g.g., o H v H #.6.1 %.u.-+i+2+l.:.u+!+#.s g M x % & G g.g.G ; u { z.{ n s % g 0 S 2 %.l.Q @+r G G u { G.> _ n G N u > > u p.u.g & G ; r u r u s F.= n & 0 . a a ",
|
||||
"g o n % 9 $.>.0+z.> Z.Q.v+,+n ,+z.n n 0 , & u.I 8+&.1 A.* i+;++.5.&.++b r [ @ ~ % /+5 G g.g.n G c r { H & [ [ p 3 2 C t a ].{ u g.G z.z.: r _ & > u G.x.z._ b r.b n z.> N b G r P.- u n o ~ M 0 ",
|
||||
";.P 9 ~ #.u+7.6.t u F.y.g.o k m . . a ~ I ~ j p ++s.w+;+{+< _ ;+7+l.2 _ 4 s ' M c c # & s g 0 k @ o u u r g 8 |.2 &.t+b P.w.y.r ; { z.H.; z.o s t ; z.: F.z.n ; # m r t #.c r & u H.; y o ~ ~ Q ",
|
||||
"h T x+K & | r.r.% & y.u s s z s a 9 p [ g & n <.l.>+&.b 2+%.p.f+V 1 3 #.% g % o m u n & & % $ [ p 0 r r n g 9 6 +.e Q u F.P.N r n n ; = u { r s ; r y.x.y.N u # u N o c s s G g.] Z.= ] % a J T ",
|
||||
"X S 3.j.9 K 4 Q A s s % % a 4 +.+.e Q r.G & d.g b 7.:.p.G p.b p.6.6.4 [ x % > z.z.{ { { y n o % $ j r u g.r [ a 3 Q 4 & _ y.n % p.n u g.; ; s H , n z.{ z.g.n o o , n s r & G H = F.= H 9 7 (.T ",
|
||||
"~.P S 3.0.i a K J.~ & & u.@+^.l.l.1 3 e #.G { & u.r.C #.p.H G c .+t % J y+u.T.y.G.g.F.] { r & H ~ o G , ,+& [ [ T K % G ; - & g #.#.s g.s #.s ,+y 2.{ H r b & r #.& o s r o & n z.] z.{ 9 /.,.(.",
|
||||
"S 1.M.,.|./.a a a u.n g.@++.c.8+V {+6.l.< G { / G +.p q #.{ r s u m % % x g.Y.l+X.#.#.u n g [ k+o ~ g & { & [ [ S a k+x p.G & 4 #.r.3 #.& & @+s r s & r 5 | Q p 9 #.s s o n G H H.F.z.n E ,.Z Z ",
|
||||
"4 ` ` |.A ~ z J P #.s r t e q+s+c.~+5.q l.g.g.K.{ % t % s b 4 s r , 0 n H : : w./+r.7.+.; #.[ . s [ I [ & G p 4 S 4 k+n G u g.% 3 t+T Q u.#.#.t C p g % | 4.7.T >.C s r n N n z.F.z.z.G 7 ..Z >.",
|
||||
"J a J.D |.J.~ E 4 C #.o z +.d+r+!+;+%.%.p.g.g.Q.K.X.r G s +.Q %.a o b > : T.T.: ~ Q u+=.P @+~ f.s [ i <.& & @+r | !.[ s G u & @+2 s.:.B #.p #+t 3 !.C a S h B :.$.P G n ] z.N F.Z.x.^ { [ } ..a ",
|
||||
"D R D D O a 6 h (.h i ' a 4 5.z+6.%.A..+G.z.g.u z.K.G #.%.r.r.T 6 ~ n Z.N.F.> { . [ >.X T J . f.H g 8 #.y+H g.H 3 i 9 % ; p.b [ 6.s.=.T #.#.#+l.=.X 3 4 [ +.Q 3 $.C g.{ ^ ^ H.F.x.F.: 2.8 v.R [ ",
|
||||
"E a D 8 8 6 5 I 5+5+!+B [ ~ C 5+#+* L u.#.s p #.0 [ #.3 +.1 1 =.p u.r Z./ n G H % 5 B 2 T L 0 ! $ l W m { n s o p.b g G ~ #.P +.l.w+w+f .+G r L 1+s.f K [ 6 9 o a P g & m m g.z.u m { , 0 O D ..",
|
||||
"R |.O E 8 ' [ [ ++!+1 Q ..a [ {+G -+r.#+4 #+p g 8 5 C e 1 2 2 =.q r #.Q.{ r #.z.% p q L +.#.~ . j 2.m 2.{ { n l b p.n H g 5 +.#.b T j.+.% 0 0 @ 2 T S 5 [ 6 I 4 a 6 0 x & r n g.m u m G @ [ a |.",
|
||||
"D D O O D 0 z ~ Q S K /...D % & _ f+f +.p #.p +.| +.C 2 2 2 5.2 p s g e.{ # c H & % #.b t #.4 ` K % m o g.H g.# p.s s % #.p S S K S J 4 x a [ D r.r.q [ % a i 5 a 6 0 o g [ #.#.o # 0 0 0 z . 6 ",
|
||||
"A ..J D J J z ~ J P J a A ! z g.2+A.e P % @+C r.T l.A.7+2 7++.:.p G g / , n & H /+& u ] / Q.@+1.9 ~ ,+g.G z.,+y & p.#.g g 4 9 T 1.P @+/.~ 4 D 9 +.r.P [ o ~ I 8 a [ a 0 [ 5 P [ 0 g 0 g z , , [ ",
|
||||
"v.O D 4 (.` /.a [ S 3 J . a #.A.l.C Q 5 k+s A.:.=.3 ^.s._.2 3 r.I ~ 0 m o , o s +.B e t z.Q.u.$.1.[ & <.j.r.G # s g.g.r #.[ P !.2 %.#.B C S P 4 P 9 p [ , & 5 8 [ p [ 0 [ [ a a ~ ' [ @ ~ v x 0 ",
|
||||
"v./.D P Z h K 7 P r.T p s ~ q :.6.#+C 9 z C C :._.1 l.s.2 :.q !.Q ~ [ o k , ~ [ C B e L g.`.v+G @+H / #.t+Q & , s & n o r s [ d !+!+1 < 3 7.j.C [ /.[ g H , [ I S I p [ [ % z z % [ 0 z ~ k k 0 ",
|
||||
"! |.P S X B J ` /.K S C z & q _.:.#+% |.4 Q +.V T 7+1 2 3 S [ 5 9 [ Q ~ H v % [ +.r.3 r.+._ : z.g.n y u I p ~ ' g o o r n , a d 2 s.2 b 3 T ;.C D J [ g H H [ 9 T T f [ g . % [ [ 5 ' o . 0 . . ",
|
||||
"' E !.T u+S 4 h g+/.K J z z S . .C & D a >.S 7+%+2 1 2 +.p [ 5 i (.4.~ v x [ 0 +.C 9.+.3 b H.H.,+N ] / G x x 8 8 l Z./ m o ~ 6 :.T T 9.$.+.K A+/.|.[ g , ,+g 5 2 2 +.g % o 0 8 I | [ k % ) A k ",
|
||||
"O O 8 Z h K p p <.+.r.B Q q :.&.&+S @+#.9 B S {+I f r.T 2 l.l.e ;.q 9 x x k ~ 9 q.B+1 0+S C s / 2.N ^ C+O.; [ v.Y 0 M ,+m n [ ' I I 5 % 4 t r r [ [ 0 0 , n { ; R O @ p.; #.p 9 7.Q #.% a O O z ",
|
||||
"i 9 9 i !.L S r.< 3 >.:.Q +.:. .}+3 4 4 6 Q Q +.$ Q L 3 1 :.r.e | p 5 ~ 0 s [ 5 5.s.c.^.0+r.p n H m u H.z.j @ J.+ [ t r r n o k [ i S 4 #.s r # j 0 o 0 , o n n . ' <.p p r.!.Q Q P [ 4 % [ !.9 ",
|
||||
"2 B P J 9 S :.c._.2 =.%+P #.4 @.T >.P 4 J 5 P %.[ % C 3 2 B l.T 9 [ [ . 6 z [ #._.>+'+c.{+_.Q #.,+# j m N r o , e./ ] u = n n s [ 3.3.P u.g.n N o c o 0 ~ g n { , 0 [ a [ B $.2 d Q Q Q C C B T ",
|
||||
"&.1 P [ 6 3 2 1+c.V %+3 4 @+P >.%+%+B J [ K 9 P a P +.B 2 :.%.%.a [ z . 9 % r.C i.@.>+ +|+2 >.6 r M j ~ x d.z.N > Z.T.z.^ > / n J ;.u+Q u.{ { N G 0 % 0 0 5 0 n m j . a ..!.T u+7.5 4 r.>.1 2 =.",
|
||||
"h+7++.J +.r.c.d+_.!+1 C #.o % S T =.>.S K Q Q J 4 7.X 1 1 2 C H ~ % x z 5 [ T B 0+3 V 1+4+l.B a <.0 z ' . , y r - N Z.= H.z./ z.& S | #.G n z.u N j o 0 o O [ [ N , % E ` !.S :.I % @+Q 2 _.n.n.",
|
||||
"n.7+3 3 r.B !+V b.++3 +.j o 0 S =.2 T B >.>.(.K $.T _.&._.A.& ~ b s % & g #.L q d 2 1 a+u+%.I % 6 M ~ w [ o , r n { > n u u N z.,+G s G g.y.z.z.n r r 0 . 8 8 I o d.& |.i J 4 S 6 g p B 1 2 n.a+",
|
||||
"=.=.7+V 6.1 1 r.l.{+S +.5 p r.;.c.7+7+2 T >.>.(. .1 +U _._ ,+6 l.C L s s & g.X.s #.#.C Q p g $ . J.. @ [ . ~ . 0 o o n n z.z.> > , n z.n z.> z.n r r [ 0 O 6 E + o , G & n % I [ [ !.T :.7+}+}+",
|
||||
"$.=._. +V 6.3 9 !+1 %+%+r.C S %+_.7+7+[.=.B (.T 1 n.h+5+|+p.o @ ++l.s.t #.& X.Q.N g.x y+k+0 ,+W A ' @ 0 0 + D ) O [ [ x 0 u ; u y N N u - z.F._ u r o [ ' ' . . E [ r N { y 0 R % 4 p r.B =. .7+",
|
||||
"2 s.7+1 &+1 .:._.1+1+2 1 %+7+1.5+2 X $.[.n._.3 >.Q i [ M g #.p 2 e :.l.f #.[ a g p #.% 0 % z . $ m 8 x |.v.' w *.$ # @ j l p f + , k s d f z.n u ; o # $ o l 2.m $ <.j x o [ L @ j % [ h $.P 1.",
|
||||
"1 2 2 %+ .S T :._._._.2 7+2 %+@.6.T %+X [.n. .T B K 8 6 [ 0 #.p 2 2 !+e T #+Q 9 t p g % [ ' a 5 r.<.I . /.a 6 w p #.~ M z ~ [ 9 $ r g.g f t n z., u m , c , # 2.2.l j s s [ <.[ $ j s % | >.K >.",
|
||||
"S T T T $.%.3 T c.c.2 _.}+=.1 +.+.S B }+n.h+s.1.!.Q 6 |.' o #.p 2 1 :.2 2 #.3 | r.p #.a 9 [ [ I &.2 <.' a A J [ d Q J z z z A+a g s { #.C _ b G.m & r { $ y g 0 j o o g <.[ s o $ & r & 4 L p S ",
|
||||
"p Q S >.>.C P | 2 2 V 2 2 2 3 C P 4 S 2 h+1+7+Z 3 ` |.D J.~ [ p 1 3 :.5+2 2++.T :.p @+[ 9 J [ f 8.>+t + . a 9 P 0.` F |.a D a D I #.& A.G _ *.n n s s n 0 , g @ t s s #.p g r o s & s o & g [ g ",
|
||||
"a [ J K S S 4 r.%+1 3 3 3 S %.C 9 a J %+&.2 S /.+.>.E D } z K S B 3 :._._.A.1 2 3 #.& a 9 9 C r.b+>+#.5 0 J Q B 0 a 8 a z . . a 4.P L #+f+b G g.x g x % & & , m 0 o s [ p #.t <.#.G $ s m % g p ",
|
||||
"5 P 4 P Q T +.Q S P P 4 4 #.p 9 B K D i T S J A+#.0+E D A ..4 q S S 3 2 s.%.7+2 1 +.@+a /.[ #.l.8.1+#.8 6 !.>.2 6 i D+| I F + 8 E #.L #.p.t n & & P & 5 o s H n o s % C p q q f @+#.g r r s b p ",
|
||||
"8 9 P J S M.+.S P [ % 4 [ 4 J Q j.Q ..'.|.D a j+l.u.9 D D E s +.J C p 3 2 3 2 %+2 >.K a a #.4 l.>+1 P O ,.Z r.w+S Q -.r.p L & . z a [ G G ; o j a i a Q 5 p o G M j $ p S r.3 %.t #.s m s b & S ",
|
||||
"9 i 4 4 0+u+%.%.' % . [ 6 |.9 Q w+(.7 L.=+A A ) >+p.J D |.` G T 4 % 4 +.2 1 [.1 3 :.!.a % 4 l.s.&.q 9 /.,.$.r.++T =.E+2 @.T #.% } F % G & { s @ P ` K I d p [ % l M g q | 2 r.A.+.t G n t #.u.B ",
|
||||
"t r.J @+P B 9 ' a [ J |.J p B ;.T Q [ D v.. . + ; l w . 4 T #+e t #+6.!+!+:.f P K S r.S 0 % S &+s.f P Q ` Q 5 Q <.+ | <.0 5 7.l.P I 8 ' . @ 0 % a Q i i ` [ % I 6 & P #.| >+3 S !+p q c b - C C ",
|
||||
"t r.P A+q p % A % [ [ 9 6 P S =.T Q a D A M k m m 2.@ f.P T #+q 4 [ r.T 3 S P [ K S S #.% 4 B }+e L +.Q ` 9 P 6 # l j k o g t+| P !.8 D ' 6 J [ [ 8 9 5 5 5 6 I i 0 g r q u+r.@.6.p p 0 b & #.a ",
|
||||
"#+q J 4 P #+% a [ J O 8 9 !.>.2 ` 9 /...! k ].].y / M M 5 T #.[ z |.K =.C K A+z P S +.4 [ !.>.7+3 3 | ` ` 8 6 a j o l l 0 s p C 9 ` 7 ,.|.8 9 |.K 9 5 a @+6 i 9 i @ j o t j.:.e ++S 9 P p g [ A ",
|
||||
"q C J P p % % |.' [ 6 9 !.| >.T ,.9 |.|.' . k 2.N 2.k k P T 4 g z J p ;.C B 4 A+[ 5 +.P 8 ` >.V T T h (.8 |.D z y 2.o k $ o g I ,.` 7 ,.9 g+9 |.|.[ [ a z [ i 9 I [ [ 0 L T r.:.1 +.S Q +.q P A+",
|
||||
":.+.J P #.g.% a a a [ P 9 Q !.S |./.|.|.D z M ~ r o h.k [ Q C [ s p #+s.3 s.3 +.5 #.4 9 O 6 3 7+[.T Q |.6 a A A #.o 2.B., d.~ L ,.,.,.K /.K g+/.8 a 6 9 4 4 Q Q Q 9 d h h T 1 V 5+6.1 2 _._.++3 ",
|
||||
":.C A+4 s & ~ a a p P P K K 9 |.,.,.,.|.D a ' a [ @ f.k #.C [ [ s #+%.b.c.h+_.:.| C 4 6 J a !.&.X T K 5 6 a [ 9 f p [ ~ k y+o a 9 K K K K 9 9 |.6 a |.i 9 [ 9 | Z $.0.0.Z >.%+s.b.++e &.h+U h+_.",
|
||||
"1 #.k+#.s r #.z Q Q B r.K 9 O ..8 !.E 9 O |.Y Y a O . . b b b g #.#+l._.d+&.&.2 | 9 4 J ..D B &.$.B I i 5 g p T Q 4 8 [ 8 [ I [ 9 K 9 Q Q Q 9 [ ' [ [ 6 9 S Q h h !.(.` h >.=.s.++l.+.s.c.U 8+c.",
|
||||
"_.4 @+[ s b a x S T :.S P 6 D v.J K |.|.|...g+'.A O v.. #._ G r a C B }+[.}+ .7+I +.p D D |.3 V B S I d 5 G 4 2 7.C 5 a a ' i % 8 9 Q :.| I p ' . 6 A ~ P I Q B p 6 [ E F d t+w+t+h K .1+b+*+}+",
|
||||
"r.q S f q r z.- !.i Q L g ' ! ).O A O z [ 4.+ ' #.I z ..a K r.#+| T 2 i.[ i [ L h i 7 J I f | Q ` 5 + 0 @ c b f e $ c m j H r #.Q I f [ Q Q 0+T r.q t % [ 6 |...p t m y r L T ;.t+:.r.p u+&.h+q.",
|
||||
"< A.b p g u _ - #.p 5 6 0 . . ! 6 |.d 6 % 6 . O 5 d 9 9 J Q Q q [ S %+C P E [ f T P 9 9 h p +.S 6 6 5 j j j & g o , j $ I g G v #+#.f 5 [ #.g u+f p n r @ [ a a g 0 r o c [ Q T 7.T K a Q | e 6.",
|
||||
"#+G g._ p.u N u f+#.p 6 A . . @ @ [ g % % a A A [ K Q r.r.;.p @+~ C r.S K 8 9 B u+Q ,.` ;.l.I h 8 6 6 2.v # o s . z 0 o o & p | f G & s s s G [ r # 2.<.l l , 0 & n o j c #.p h $.3.` /.a 4 a C ",
|
||||
"f+g.z.n u u y.z.u r a v.A M o # o o , & a . a } z x G p.< u+4 t.~ p r.S 9 ,.Q T ;.P /.8 7.q +.B 8 ' ' , ,+o z g D 8 E 0 x o 5 T D+u.,+].o 0 l { ,+0 @ I k o n p g & o g j ~ #.5 3 1.h F /.J x ~ ",
|
||||
"n u G G u n z.] y.n o . f.k 2.m o j s 0 a % ....a x x.x.G.f % j+0 Q r.S 9 6 9 h T P /.J Q q Q K ' J.[ [ o ~ . ' ,.,.|.6 a 6 4 z r.[ % 0 o l $ n s 5 0 8 o I Q e d [ #.g o n & ~ 2+Q q h p [ & o ",
|
||||
"& r b c u n N n N , x M ~ k 2.m j M ~ s [ ` 8 |.z % & z.Z.% z /.0 I S S /.z a Q B 9 g+a Q 5 B K D z I I g #.5 F d (.a [ % [ a a #.Q I 5 z o j y & p [ 6 ~ !.B T j.[ 0 g x & ~ , g.p.G #.g c o j ",
|
||||
"~ @ j r m G o o m m # j 2.d.2.@ @ 2.& v % 7.6 ~ x + 0 s v & a a a Q +.P J ~ ' g J J '.A 6 % [ z 9 [ h T #.P F 4.K S 9 d 6 J % D C Q % 0 [ M & { / & 0 0 ~ 0 [ +.9 @+[ g x o $ o r & G g.#.o o c ",
|
||||
". @ j n , r 0 0 x l # # y K.].. M ~ <.y+H 5 & x 2.0 ].x ].z O ' a B P S O ~ . g 5 ..R ..O % a A z 4 u+7.A.+.` E :.p u.9 P 8 A+a 9 9 v ~ [ s % % N ] B.B.k z g g 4 s J [ & M [ o + 0 0 & 0 & l @ "};
|
||||
Reference in New Issue
Block a user