cgv
Loading...
Searching...
No Matches
console.cxx
1#include "console.h"
2#include <cgv/type/variant.h>
3
4using namespace cgv::type;
5
6#ifdef _WIN32
7#include <windows.h>
8#endif
9
10namespace cgv {
11 namespace base {
12
14console::console()
15{
16}
19{
20 static console_ptr cp(new console);
21 return cp;
22}
23
25std::string console::get_type_name() const
26{
27 return "console";
28}
31{
32 return "x:int32;y:int32;w:int32;h:int32;show:bool;title:string";
33}
35bool console::set_void(const std::string& property, const std::string& value_type, const void* value_ptr)
36{
37#if defined(_MSC_VER)
38 if (property == "x") {
39 int32_type x;
40 get_variant(x, value_type, value_ptr);
42 RECT rect;
45 return true;
46 }
47 if (property == "y") {
48 int32_type y;
49 get_variant(y, value_type, value_ptr);
51 RECT rect;
54 return true;
55 }
56 if (property == "w") {
57 int32_type w;
58 get_variant(w, value_type, value_ptr);
60 RECT rect;
63 return true;
64 }
65 if (property == "h") {
66 int32_type h;
67 get_variant(h, value_type, value_ptr);
69 RECT rect;
72 return true;
73 }
74#endif
75 return false;
76}
78bool console::get_void(const std::string& property, const std::string& value_type, void* value_ptr)
79{
80 return false;
81}
82 }
83}
interface to the console of the application with implementation of the property interface
Definition console.h:19
bool get_void(const std::string &property, const std::string &value_type, void *value_ptr)
abstract interface for the getter of a dynamic property.
Definition console.cxx:78
std::string get_type_name() const
return "console"
Definition console.cxx:25
std::string get_property_declarations()
supported properties are x:int32;y:int32;w:int32;h:int32;show:bool;title:string
Definition console.cxx:30
bool set_void(const std::string &property, const std::string &value_type, const void *value_ptr)
abstract interface for the setter of a dynamic property.
Definition console.cxx:35
static console_ptr get_console()
return console singleton
Definition console.cxx:18
complete implementation of method actions that only call one method when entering a node
Definition action.h:113
reference counted pointer, which can work together with types that are derived from ref_counted,...
Definition ref_ptr.h:160
namespace for compile time type information
int int32_type
this type provides an 32 bit signed integer type
the cgv namespace
Definition print.h:11