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