#ifndef __INTERFACE_GUMPS__H_
#define __INTERFACE_GUMPS__H_
#include <string>
#include <SDL/SDL_types.h>
#include <list>
#include "gumps.h"
#include "action.h"
class InterfaceGump
{
public:
InterfaceGump();
virtual ~InterfaceGump();
void add(InterfaceGump *gump);
class InterfaceGump *getLast();
void setText(string &text);
virtual bool mouseDoubleClick(Uint8 button,Uint16 x,Uint16 y);
virtual bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
virtual bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
virtual InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
virtual bool mouseMove(Uint16 x,Uint16 y);
virtual void mouseExit();
virtual void move(int x,int y,int w,int h);
virtual void draw();
int x,y,width,height; //calibrated locations
Uint16 partial;
Uint32 fontcolor;
Uint16 fontNumber;
bool emboss,engrave;
protected:
list<InterfaceGump *>children;
};
class GumpMain : public InterfaceGump {
public:
GumpMain(string &name);
~GumpMain();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
string gumpName;
void (Action::*close)();
string sx,sy,sw,sh;
bool hasRect;
};
class GumpRect : public InterfaceGump {
public:
GumpRect(string &args);
~GumpRect();
string sx,sy,sw,sh;
};
class GumpBackground : public InterfaceGump {
public:
GumpBackground(string &args);
~GumpBackground();
void move(int x,int y,int w,int h);
void draw();
private:
Gump gump;
Uint16 gumpID;
//int flag;
bool flag;
string sx,sy;
};
class GumpInterface : public InterfaceGump {
public:
GumpInterface(string &args);
~GumpInterface();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
private:
string sx,sy,sw,sh;
Uint16 id;
};
class GumpSizableBackground : public InterfaceGump {
public:
GumpSizableBackground(string &args);
~GumpSizableBackground();
void move(int x,int y,int w,int h);
void draw();
private:
string sx,sy,sw,sh;
Uint16 g[9],flag;
Gump gump;
};
class GumpButton : public InterfaceGump {
public:
GumpButton(string &args);
~GumpButton();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
string sx,sy,sw,sh;
Gump *gump,normal,over,down;
bool mDown,mOver;
Uint16 gumpID,overID,downID,flag1,flag2;
Uint32 ID;
};
class GumpLayoutButton : public InterfaceGump {
public:
GumpLayoutButton(string &args);
~GumpLayoutButton();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
string sx,sy,sw,sh;
InterfaceGump *normal,*gump,*over,*down;
bool mDown,mOver;
string text;
Uint32 ID;
};
class GumpDecoration : public InterfaceGump {
public:
GumpDecoration(string &args);
~GumpDecoration();
void move(int x,int y,int w,int h);
void draw();
private:
string sx,sy;
Gump gump;
Uint32 ID;
Uint16 gumpID,flag;
};
class GumpText : public InterfaceGump {
public:
GumpText(string &args);
~GumpText();
void move(int x,int y,int w,int h);
void draw();
private:
string sx,sy,sw,sh;
string text;
Uint16 unk;
};
class GumpInterfaceButton : public InterfaceGump {
public:
GumpInterfaceButton(string &args);
~GumpInterfaceButton();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
InterfaceGump *gump,*normal,*over,*down;
string text,sx,sy,sw,sh;
bool mDown,mOver;
Uint32 ID;
};
class GumpInterfaceRadioButton : public InterfaceGump {
public:
GumpInterfaceRadioButton(string &args);
~GumpInterfaceRadioButton();
void move(int x,int y,int w,int h);
void draw();
private:
Uint32 ID,ID2;
Uint16 Choice;
InterfaceGump *gump,*over,*down,*gump2,*over2,*down2;
string text,text2,sx,sy,sw,sh;
};
class GumpTextArea : public InterfaceGump {
public:
GumpTextArea(string &args);
~GumpTextArea();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
Uint32 ID;
string *textarea;
bool password;
private:
string sx,sy,sw,sh;
Uint16 alignment;
};
class GumpFontColor : public InterfaceGump {
public:
GumpFontColor(string &args);
~GumpFontColor();
void draw();
private:
};
class GumpFontNumber : public InterfaceGump {
public:
GumpFontNumber(string &args);
~GumpFontNumber();
private:
};
class GumpPartialHue : public InterfaceGump {
public:
GumpPartialHue(string &args);
~GumpPartialHue();
void draw();
private:
};
class GumpLayoutToggle : public InterfaceGump {
public:
GumpLayoutToggle(string &args);
~GumpLayoutToggle();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
Uint32 ID;
string sx,sy,sw,sh,text,text2;
InterfaceGump *gump,*normal,*down,*over,*normal2,*down2,*over2;
bool mDown,mOver,state;
};
class GumpToggle : public InterfaceGump {
public:
GumpToggle(string &args);
~GumpToggle();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
Uint32 ID;
string sx,sy;
Gump *gump,normal,over,down,normal2,over2,down2;
bool mDown,mOver,state;
Uint16 gumpID,overID,downID,gump2ID,over2ID,down2ID;
};
class GumpVList : public InterfaceGump {
public:
GumpVList(string &args);
~GumpVList();
void move(int x,int y,int w,int h);
void draw();
Uint32 ID;
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void clear();
private:
string sx,sy,sw,sh;
Uint16 unk;
InterfaceGump *vScrollGump,*hScrollGump;
};
class GumpVListChild : public InterfaceGump {
public:
GumpVListChild(Uint32 ID,string sg,string sgd,string sgo,string entry);
GumpVListChild(Uint32 ID,string sg,Uint16 prof);
~GumpVListChild();
virtual void move(int x,int y,int w,int h);
virtual void draw();
virtual bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
virtual bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
virtual InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
virtual void mouseExit();
private:
InterfaceGump *normal,*gump,*over,*down;
bool mDown,mOver;
string text;
Uint32 ID;
Uint16 textID;
bool adv;
};
class GumpColorPicker : public InterfaceGump {
public:
GumpColorPicker(string &args);
~GumpColorPicker();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
Uint32 ID;
Uint16 baseHue;
bool visible;
private:
string sx,sy,sw,sh;
Uint16 unk,rows,cols,numWide,numTall;
Sprite *picker;
bool mDown,mOver;
};
class GumpHScrollBar : public InterfaceGump {
public:
GumpHScrollBar(string &args);
~GumpHScrollBar();
void move(int x,int y,int w,int h);
void draw();
bool mouseDown(Uint8 button,Uint16 x,Uint16 y);
bool mouseUp(Uint8 button,Uint16 x,Uint16 y);
InterfaceGump *mouseEnter(Uint16 x,Uint16 y);
void mouseExit();
private:
Uint32 ID;
string sx,sy,sw,sh;
bool mDown,mOver;
GumpMain *scroll;
};
class Scene : public InterfaceGump
{
public:
Scene();
~Scene();
void move(int x, int y, int w, int h);
void draw();
};
#endif