-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.hpp
executable file
·79 lines (54 loc) · 1.46 KB
/
frame.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef FRAME_HPP
#define FRAME_HPP
#include "event.hpp"
#include "image.hpp"
#include "networknode.hpp"
#include <string>
void initFrames();
class RootWidget;
class Frame : public EventListener
{
public:
Frame();
virtual ~Frame();
virtual void redraw();
virtual void timepass();
virtual Image *getBackground() const;
void enable();
void disable();
virtual void setupWidgets() = 0;
virtual void onEnable() {}
virtual void onDisable() {}
bool keyDown(SDL_keysym sym);
bool keyUp(SDL_keysym sym);
bool mouseDown(int x, int y, int button, int mod);
bool mouseUp(int x, int y, int button);
//bool mouseMotion(int x, int y, int xrel, int yrel);
virtual void disconnected(NetworkNode *node) {}
static void changeFrame(Frame *newFrame);
protected:
RootWidget *rootWidget;
bool enabled;
};
///////////////////////////////////////////////////////////////////////////
class PostMortem:public Frame
{
public:
PostMortem();
~PostMortem();
void setupWidgets();
void set(const std::string &str, bool safe);
void set(bool safe);
void set(const std::string &str);
bool keyDown(SDL_keysym sym);
bool mouseDown(int x, int y, int button, int mod);
private:
void close();
std::string text;
bool safeToQuit;
};
extern PostMortem *postMortem;
///////////////////////////////////////////////////////////////////////////
extern Frame *activeFrame;
extern Image mainMenuBackground;
#endif