Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InexorConsoleLayer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string> // for string
4 
5 #include "include/cef_app.h"
6 #include "include/cef_base.h" // for CefString
7 #include "include/cef_v8.h" // for CefV8Value (p...
8 #include "inexor/ui/context/InexorContextProvider.hpp" // for InexorContext...
9 #include "inexor/ui/layer/InexorLayerProvider.hpp" // for AbstractInexo...
10 
11 namespace inexor {
12 namespace ui {
13 namespace layer {
14 
20 {
21 
22  public:
24  : AbstractInexorLayerProvider(name, url),
25  _name(name),
26  _url(url) {};
27 
28  // InexorCefContextProvider
29  void InitializeContext() override;
30  bool Execute(const CefString& name, CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval, CefString& exception) override;
31  bool Get(const CefString& name, const CefRefPtr<CefV8Value> object, CefRefPtr<CefV8Value>& retval, CefString& exception) override;
32  bool Set(const CefString& name, const CefRefPtr<CefV8Value> object, const CefRefPtr<CefV8Value> value, CefString& exception) override;
33  std::string GetContextName() override { return _name; };
34 
35  // User interface resize handling
36  void Reload();
37  void Resize(int x, int y, int width, int height);
38  void AutoResize(int width, int height);
39 
40  // Intercept setters for event handling
41  void SetVisibility(bool _is_visible) override;
42  void SetAcceptingKeyInput(bool _is_accepting_key_input) override;
43  void SetAcceptingMouseInput(bool _is_accepting_mouse_input) override;
44 
45  void Show() {
46  SetVisibility(true);
47  // Don't accept input on the CONSOLE layer
48  SetAcceptingKeyInput(false);
50  };
51 
52  void Hide() {
53  SetVisibility(false);
54  SetAcceptingKeyInput(false);
56  };
57 
58  private:
61 
62  // Include the default reference counting implementation.
64 };
65 
66 }
67 }
68 }
void SetAcceptingKeyInput(bool _is_accepting_key_input) override
Definition: InexorConsoleLayer.cpp:64
GLenum GLsizei GLsizei height
Definition: glexts.hpp:291
bool Execute(const CefString &name, CefRefPtr< CefV8Value > object, const CefV8ValueList &arguments, CefRefPtr< CefV8Value > &retval, CefString &exception) override
Definition: InexorConsoleLayer.cpp:82
std::string name
Definition: InexorLayerProvider.hpp:114
GLenum GLsizei width
Definition: glexts.hpp:291
Definition: InexorContextProvider.hpp:16
bool Set(const CefString &name, const CefRefPtr< CefV8Value > object, const CefRefPtr< CefV8Value > value, CefString &exception) override
Definition: InexorConsoleLayer.cpp:94
InexorConsoleLayer(std::string &name, std::string &url)
Definition: InexorConsoleLayer.hpp:23
std::string _url
Definition: InexorConsoleLayer.hpp:60
Definition: InexorLayerProvider.hpp:60
void Reload()
Definition: InexorConsoleLayer.cpp:32
std::string _name
Definition: InexorConsoleLayer.hpp:56
void SetVisibility(bool _is_visible) override
Definition: InexorConsoleLayer.cpp:57
std::string url
Definition: InexorLayerProvider.hpp:115
std::string GetContextName() override
Definition: InexorConsoleLayer.hpp:33
bool Get(const CefString &name, const CefRefPtr< CefV8Value > object, CefRefPtr< CefV8Value > &retval, CefString &exception) override
Definition: InexorConsoleLayer.cpp:88
void SetAcceptingMouseInput(bool _is_accepting_mouse_input) override
Definition: InexorConsoleLayer.cpp:71
char string[MAXSTRLEN]
cube-strings (char arrays of fixed size).
Definition: cube_types.hpp:18
GLsizei GLboolean const GLfloat * value
Definition: glexts.hpp:57
void Show()
Definition: InexorConsoleLayer.hpp:45
void InitializeContext() override
Definition: InexorConsoleLayer.cpp:78
void Hide()
Definition: InexorConsoleLayer.hpp:52
void AutoResize(int width, int height)
Definition: InexorConsoleLayer.cpp:48
The console layer of the inexor user interface.
Definition: InexorConsoleLayer.hpp:18
IMPLEMENT_REFCOUNTING(InexorConsoleLayer)
void Resize(int x, int y, int width, int height)
Definition: InexorConsoleLayer.cpp:38