1 /***************************************************************************
2                         gui.h  -  GUI interface class
3                              -------------------
4     begin                : Thu Aug 28 2003
5     copyright            : (C) 2003 by Gabor Torok
6     email                : cctorok@yahoo.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef GUI_GUI_H
19 #define GUI_GUI_H
20 #pragma once
21 
22 #include "../configlang.h"
23 
24 class Widget;
25 class Texture;
26 class EventHandler;
27 
28 /**
29  * This is the only class thru which the gui interacts with the rest of scourge.
30  * It is important to keep this in mind so that:
31  * -the gui classes can be used by other apps
32  * -compilation is sped up (by not including things from outside of this dir.
33  */
34 class ScourgeGui {
35 public:
ScourgeGui()36 	ScourgeGui() {
37 	}
38 
~ScourgeGui()39 	virtual ~ScourgeGui() {
40 	}
41 
42 	virtual void processEventsAndRepaint() = 0;
43 	virtual void playSound( const std::string& file, int panning ) = 0;
44 	virtual void texPrint( GLfloat x, GLfloat y, const char *fmt, ... ) = 0;
45 	virtual int textWidth( const char *fmt, ... ) = 0;
46 	virtual int getScreenWidth() = 0;
47 	virtual int getScreenHeight() = 0;
48 	virtual void setCursorMode( int n, bool useTimer = false ) = 0;
49 	virtual int getCursorMode() = 0;
50 	virtual Texture const& getHighlightTexture() = 0;
51 	virtual Texture const& getGuiTexture() = 0;
52 	virtual Texture const& getGuiTexture2() = 0;
53 	virtual Uint16 getMouseX() = 0;
54 	virtual Uint16 getMouseY() = 0;
55 	virtual void drawTooltip( float xpos2, float ypos2, float zpos2,
56 	                          float zrot, float yrot,
57 	                          char *message,
58 	                          float r = 0, float g = 0.15f, float b = 0.05f, float zoom = 1.0f ) = 0;
59 	virtual void setFontType( int fontType ) = 0;
60 	virtual Texture const& loadSystemTexture( char *line ) = 0;
61 	virtual void unlockMouse() = 0;
62 	virtual void lockMouse( Widget *widget ) = 0;
63 	virtual void allWindowsClosed() = 0;
64 	virtual void blockEvent() = 0;
65 	virtual void registerEventHandler( Widget *w, EventHandler *eh ) = 0;
66 	virtual void unregisterEventHandler( Widget *w ) = 0;
67 	virtual EventHandler *getEventHandler( Widget *w ) = 0;
68 };
69 
70 #endif
71