2002-04-13 04:39:04 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2002 The ScummVM project
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*/
|
|
|
|
|
2001-11-10 19:12:32 +00:00
|
|
|
#if !defined(gui_h)
|
|
|
|
#define gui_h
|
|
|
|
|
2002-03-16 18:03:28 +00:00
|
|
|
struct ResString {
|
|
|
|
int num;
|
|
|
|
char string[80];
|
|
|
|
};
|
|
|
|
|
2001-11-09 18:57:46 +00:00
|
|
|
enum {
|
|
|
|
GUI_NONE = 0,
|
2002-03-14 16:49:59 +00:00
|
|
|
GUI_RESTEXT = 1,
|
2001-11-09 18:57:46 +00:00
|
|
|
GUI_IMAGE = 2,
|
2002-03-14 16:49:59 +00:00
|
|
|
GUI_STAT = 3,
|
|
|
|
GUI_CUSTOMTEXT = 4,
|
|
|
|
GUI_VARTEXT = 5,
|
|
|
|
GUI_ACTIONTEXT = 6,
|
|
|
|
GUI_KEYTEXT = 7
|
2001-11-09 18:57:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
GWF_BORDER = 1,
|
|
|
|
GWF_CLEARBG = 2,
|
|
|
|
GWF_PARENT = 4,
|
|
|
|
GWF_DELAY = 8,
|
|
|
|
GWF_DEFAULT = GWF_BORDER|GWF_CLEARBG,
|
2002-03-08 08:42:11 +00:00
|
|
|
GWF_BUTTON = GWF_BORDER|GWF_CLEARBG|GWF_DELAY
|
2001-11-09 18:57:46 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GuiWidget {
|
|
|
|
byte _type;
|
|
|
|
byte _page;
|
|
|
|
byte _flags;
|
|
|
|
int16 _x,_y;
|
|
|
|
uint16 _w,_h;
|
|
|
|
uint16 _id;
|
|
|
|
byte _string_number;
|
|
|
|
};
|
|
|
|
|
2001-11-10 20:51:55 +00:00
|
|
|
#define SAVEGAME_NAME_LEN 32
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
class Gui {
|
|
|
|
public:
|
2001-11-09 18:57:46 +00:00
|
|
|
Scumm *_s;
|
|
|
|
const GuiWidget *_widgets[4];
|
2002-03-16 05:33:25 +00:00
|
|
|
int _return_to;
|
2001-11-09 18:57:46 +00:00
|
|
|
int _curX, _curY;
|
|
|
|
VirtScreen *_vs;
|
|
|
|
byte _color,_shadowcolor;
|
|
|
|
byte _bgcolor;
|
|
|
|
byte _textcolor;
|
|
|
|
byte _textcolorhi;
|
2002-04-12 21:26:59 +00:00
|
|
|
bool _old_cursor_mode;
|
2001-11-09 18:57:46 +00:00
|
|
|
int _parentX, _parentY;
|
|
|
|
byte _active;
|
|
|
|
byte _clickTimer;
|
|
|
|
byte _cur_page;
|
2001-11-14 18:40:39 +00:00
|
|
|
byte _dialog;
|
2001-11-09 18:57:46 +00:00
|
|
|
int _clickWidget;
|
|
|
|
char *_queryMess;
|
|
|
|
|
2002-03-14 16:49:59 +00:00
|
|
|
/* optiondialog specifics */
|
|
|
|
int _gui_variables[100];
|
|
|
|
|
2001-11-09 18:57:46 +00:00
|
|
|
/* savedialog specifics */
|
|
|
|
int _slotIndex;
|
|
|
|
int _editString;
|
|
|
|
int _editLen;
|
|
|
|
bool valid_games[9];
|
2001-11-10 20:51:55 +00:00
|
|
|
char game_names[9][SAVEGAME_NAME_LEN];
|
2002-03-25 18:17:40 +00:00
|
|
|
void loop(Scumm *s);
|
2001-11-09 18:57:46 +00:00
|
|
|
void init(Scumm *s);
|
|
|
|
void draw(int start, int end);
|
|
|
|
void draw(int item) { draw(item,-1); }
|
|
|
|
void drawWidget(const GuiWidget *w);
|
|
|
|
void moveto(int x, int y);
|
|
|
|
void lineto(int x, int y);
|
|
|
|
void hline(int x, int y, int x2);
|
|
|
|
void vline(int x, int y, int y2);
|
2002-03-14 13:57:28 +00:00
|
|
|
void drawChar(const char str, int xx, int yy);
|
2001-11-09 18:57:46 +00:00
|
|
|
void drawString(const char *str, int x, int y, int w, byte color, bool center);
|
|
|
|
void widgetClear(const GuiWidget *w);
|
|
|
|
void widgetBorder(const GuiWidget *w);
|
|
|
|
byte *getBasePtr(int x, int y);
|
|
|
|
const GuiWidget *widgetFromPos(int x, int y);
|
|
|
|
void leftMouseClick(int x, int y);
|
|
|
|
void handleCommand(int cmd);
|
|
|
|
void close();
|
|
|
|
const char *queryString(int string, int id);
|
|
|
|
void getSavegameNames(int start);
|
|
|
|
void editString(int index);
|
|
|
|
void showCaret(bool show);
|
2002-03-14 16:49:59 +00:00
|
|
|
void addLetter(byte letter);
|
2001-11-09 18:57:46 +00:00
|
|
|
void queryMessage(const char *msg, const char *alts);
|
|
|
|
byte getDefaultColor(int color);
|
2002-03-14 16:49:59 +00:00
|
|
|
|
|
|
|
// Dialogs
|
2002-03-25 18:17:40 +00:00
|
|
|
void saveLoadDialog(Scumm *s);
|
|
|
|
void pause(Scumm *s);
|
|
|
|
void options(Scumm *s);
|
|
|
|
void launcher(Scumm *s);
|
2002-03-14 16:49:59 +00:00
|
|
|
|
|
|
|
void handleSoundDialogCommand(int cmd);
|
|
|
|
void handleOptionsDialogCommand(int cmd);
|
|
|
|
void handleKeysDialogCommand(int cmd);
|
2002-03-16 05:33:25 +00:00
|
|
|
void handleLauncherDialogCommand(int cmd);
|
2001-11-09 18:57:46 +00:00
|
|
|
};
|
2002-04-13 04:39:04 +00:00
|
|
|
#endif
|