Context.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <gale/key/key.hpp>
9 #include <gale/Application.hpp>
10 #include <gale/context/Context.hpp>
11 #include <gale/context/clipBoard.hpp>
12 #include <gale/context/commandLine.hpp>
13 
14 #include <ewol/debug.hpp>
15 #include <ewol/ewol.hpp>
16 #include <ewol/object/Manager.hpp>
17 #include <ewol/widget/Manager.hpp>
18 #include <ewol/widget/Windows.hpp>
22 #include <ememory/memory.hpp>
23 
24 namespace ewol {
25  // Here we hereted from the gale application to be agnostic of the OW where we work ...
26  class Context : public gale::Application {
27  private:
29  public:
31  return m_application;
32  }
33  public:
34  gale::context::CommandLine& getCmd() {
35  return gale::getContext().getCmd();
36  };
37  private:
38  ewol::context::ConfigFont m_configFont;
39  public:
40  ewol::context::ConfigFont& getFontDefault() {
41  return m_configFont;
42  };
43  private:
44  ewol::object::Manager m_objectManager;
45  public:
46  ewol::object::Manager& getEObjectManager() {
47  return m_objectManager;
48  };
49  private:
50  ewol::widget::Manager m_widgetManager;
51  public:
52  ewol::widget::Manager& getWidgetManager() {
53  return m_widgetManager;
54  };
55  public:
56  gale::resource::Manager& getResourcesManager() {
57  return gale::getContext().getResourcesManager();
58  };
59  public:
60  Context(ewol::context::Application* _application);
61  virtual ~Context();
62  private:
64  public: // herited function:
65  void onCreate(gale::Context& _context) override;
66  void onStart(gale::Context& _context) override;
67  void onResume(gale::Context& _context) override;
68  void onRegenerateDisplay(gale::Context& _context) override;
69  void onDraw(gale::Context& _context) override;
70  void onPause(gale::Context& _context) override;
71  void onStop(gale::Context& _context) override;
72  void onDestroy(gale::Context& _context) override;
73  void onKillDemand(gale::Context& _context) override;
74  void onPointer(enum gale::key::type _type,
75  int32_t _pointerID,
76  const vec2& _pos,
77  gale::key::status _state) override;
78  void onKeyboard(const gale::key::Special& _special,
79  enum gale::key::keyboard _type,
80  char32_t _value,
81  gale::key::status _state) override;
82  void onClipboardEvent(enum gale::context::clipBoard::clipboardListe _clipboardId) override;
83  public:
87  void resetIOEvent();
88  private:
89  ewol::widget::WindowsShared m_windowsCurrent;
90  public:
95  void setWindows(const ewol::widget::WindowsShared& _windows);
101 
105  void forceRedrawAll();
106 
122  void onResize(const ivec2& _size) override;
123  public:
136  static int main(int _argc, const char *_argv[]);
137  private:
138  size_t m_initStepId;
139  size_t m_initTotalStep;
140  public:
145  void setInitImage(const std::string& _fileName);
146  public:
150  void requestUpdateSize();
151  void onPeriod(const echrono::Clock& _time) override;
152  };
157  Context& getContext();
158 };
159 
Definition: InputManager.hpp:42
ewol::widget::WindowsShared getWindows()
get the current windows that is displayed
void forceRedrawAll()
Redraw all the windows.
Definition: Manager.hpp:16
void inputEventGrabPointer(ewol::WidgetShared _widget)
This fonction lock the pointer properties to move in relative instead of absolute.
Definition: Application.hpp:12
void requestUpdateSize()
Request a display after call a resize.
void setInitImage(const std::string &_fileName)
Special for init (main) set the start image when loading data.
Definition: Area.hpp:16
void setWindows(const ewol::widget::WindowsShared &_windows)
set the current windows to display :
static int main(int _argc, const char *_argv[])
This is the only one things the User might done in his main();.
Definition: ConfigFont.hpp:12
void inputEventUnGrabPointer()
This fonction un-lock the pointer properties to move in relative instead of absolute.
Definition: Context.hpp:26
void inputEventTransfertWidget(ewol::WidgetShared _source, ewol::WidgetShared _destination)
This is to transfert the event from one widget to another one.
void resetIOEvent()
reset event management for the IO like Input ou Mouse or keyborad
Definition: Manager.hpp:18
Context & getContext()
From everyware in the program, we can get the context inteface.