Ocular Engine
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
PropertyWidgetRegistrar.hpp
1
17
#pragma once
18
#ifndef __H__OCULAR_EDITOR_PROPERTY_WIDGET_REGISTRAR__H__
19
#define __H__OCULAR_EDITOR_PROPERTY_WIDGET_REGISTRAR__H__
20
21
#include "OcularEditor.hpp"
22
23
//------------------------------------------------------------------------------------------
24
29
namespace
Ocular
30
{
35
namespace
Editor
36
{
37
template
<
class
T>
38
class
PropertyWidgetRegistrar
39
{
40
public
:
41
42
PropertyWidgetRegistrar
(std::string
const
& type)
43
{
44
if
(!OcularEditor.getPropertyWidgetFactory().registerComponent<T>(type))
45
{
46
OcularLogger->error(
"Failed to register PropertyWidget for type '"
, type,
"' as the type is already in use"
,
47
OCULAR_INTERNAL_LOG(
"PropertyWidgetRegistrar"
,
"PropertyWidgetRegistrar"
));
48
}
49
}
50
51
~
PropertyWidgetRegistrar
()
52
{
53
54
}
55
56
protected
:
57
58
private
:
59
};
60
}
64
}
69
#define OCULAR_REGISTER_PROPERTY_WIDGET(X,Y) Ocular::Editor::PropertyWidgetRegistrar<X> OCULAR_INTERNAL_PropertyWidgetRegistrar(Y)
70
71
//------------------------------------------------------------------------------------------
72
73
#endif
Ocular
Note: Once this library is made dynamic, this will no longer be needed.
Definition:
Common.hpp:70
Ocular::Editor::PropertyWidgetRegistrar
Definition:
PropertyWidgetRegistrar.hpp:38
OcularEditor
include
Widgets
Properties
PropertyWidgetRegistrar.hpp
Generated on Tue Oct 18 2016 01:28:56 for Ocular Engine by
1.8.10