GUI
App.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 by Maciej Wiecierzewski
3  */
4 
5 #ifndef APP_H
6 #define APP_H
7 
8 #include <allegro5/allegro.h>
9 #include <allegro5/allegro_font.h>
10 
11 #include "Button.h"
12 #include "CustomWidget.h"
13 #include "EditBox.h"
14 #include "Event.h"
15 #include "Events.h"
16 #include "GUISystem.h"
17 #include "Handle.h"
18 #include "Renderer.h"
19 #include "TextField.h"
20 
21 
22 using namespace gui;
23 
25 
26 class App
27 {
28  public:
36  App(int argc, char **argv);
37 
38  virtual ~App();
39 
43  void initAllegro();
44 
48  void init();
49 
56  bool loop(bool waitForEvent = false);
57 
58  //Widget functions
59  void setButtonOnClick(Event& event);
60  Widget *createWidget(GUISystem *guiSystem);
61 
62  protected:
63 
64  private:
65  ALLEGRO_DISPLAY *display;
66  ALLEGRO_EVENT_QUEUE *queue;
67  ALLEGRO_FONT *font;
68 
71 
72  //Widgets
78 
82  static bool initialized;
83 };
84 
85 #endif // APP_H