diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp')
-rw-r--r-- | libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp index 9552745..0748360 100644 --- a/libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp +++ b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIEditFactory.cpp | |||
@@ -1,120 +1,120 @@ | |||
1 | #include "CGUIEditFactory.h" | 1 | #include "CGUIEditFactory.h" |
2 | #include "IGUIEnvironment.h" | 2 | #include "IGUIEnvironment.h" |
3 | #include "irrString.h" | 3 | #include "irrString.h" |
4 | 4 | ||
5 | #include "EGUIEditTypes.h" | 5 | #include "EGUIEditTypes.h" |
6 | 6 | ||
7 | #include "CGUIEditWorkspace.h" | 7 | #include "CGUIEditWorkspace.h" |
8 | #include "CGUIEditWindow.h" | 8 | #include "CGUIEditWindow.h" |
9 | #include "CGUIPanel.h" | 9 | #include "CGUIPanel.h" |
10 | #include "CGUITextureCacheBrowser.h" | 10 | #include "CGUITextureCacheBrowser.h" |
11 | #include "CGUIAttributeEditor.h" | 11 | #include "CGUIAttributeEditor.h" |
12 | #include "CGUIStringAttribute.h" | 12 | #include "CGUIStringAttribute.h" |
13 | #include "CGUIBoolAttribute.h" | 13 | #include "CGUIBoolAttribute.h" |
14 | #include "CGUIEnumAttribute.h" | 14 | #include "CGUIEnumAttribute.h" |
15 | #include "CGUIColorAttribute.h" | 15 | #include "CGUIColorAttribute.h" |
16 | #include "CGUITextureAttribute.h" | 16 | #include "CGUITextureAttribute.h" |
17 | #include "CGUIDummyEditorStub.h" | 17 | #include "CGUIDummyEditorStub.h" |
18 | 18 | ||
19 | namespace irr | 19 | namespace irr |
20 | { | 20 | { |
21 | namespace gui | 21 | namespace gui |
22 | { | 22 | { |
23 | 23 | ||
24 | CGUIEditFactory::CGUIEditFactory(IGUIEnvironment* env) | 24 | CGUIEditFactory::CGUIEditFactory(IGUIEnvironment* env) |
25 | : Environment(env) | 25 | : Environment(env) |
26 | { | 26 | { |
27 | #ifdef _DEBUG | 27 | #ifdef _DEBUG |
28 | setDebugName("CGUIEditFactory"); | 28 | setDebugName("CGUIEditFactory"); |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | // don't grab the gui environment here to prevent cyclic references | 31 | // don't grab the gui environment here to prevent cyclic references |
32 | } | 32 | } |
33 | 33 | ||
34 | 34 | ||
35 | CGUIEditFactory::~CGUIEditFactory() | 35 | CGUIEditFactory::~CGUIEditFactory() |
36 | { | 36 | { |
37 | } | 37 | } |
38 | 38 | ||
39 | 39 | ||
40 | //! adds an element to the environment based on its type name | 40 | //! adds an element to the environment based on its type name |
41 | IGUIElement* CGUIEditFactory::addGUIElement(const c8* typeName, IGUIElement* parent) | 41 | IGUIElement* CGUIEditFactory::addGUIElement(const c8* typeName, IGUIElement* parent) |
42 | { | 42 | { |
43 | /* | 43 | /* |
44 | here we create elements, add them to the manager, and then drop them | 44 | here we create elements, add them to the manager, and then drop them |
45 | */ | 45 | */ |
46 | 46 | ||
47 | core::stringc elementType(typeName); | 47 | core::stringc elementType(typeName); |
48 | IGUIElement* ret=0; | 48 | IGUIElement* ret=0; |
49 | if (!parent) | 49 | if (!parent) |
50 | parent = Environment->getRootGUIElement(); | 50 | parent = Environment->getRootGUIElement(); |
51 | 51 | ||
52 | // editor workspace | 52 | // editor workspace |
53 | if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDIT])) | 53 | if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDIT])) |
54 | ret = new CGUIEditWorkspace(Environment, -1, 0); | 54 | ret = new CGUIEditWorkspace(Environment, -1, 0); |
55 | // editor window | 55 | // editor window |
56 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW])) | 56 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW])) |
57 | ret = new CGUIEditWindow(Environment, core::rect<s32>(0,0,100,100), 0); | 57 | ret = new CGUIEditWindow(Environment, core::rect<s32>(0,0,100,100), 0); |
58 | // Klasker's GUI Panel | 58 | // Klasker's GUI Panel |
59 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIPANEL])) | 59 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIPANEL])) |
60 | ret = new CGUIPanel(Environment, 0); | 60 | ret = new CGUIPanel(Environment, 0); |
61 | // texture cache browser | 61 | // texture cache browser |
62 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREBROWSER])) | 62 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREBROWSER])) |
63 | ret = new CGUITextureCacheBrowser(Environment, -1, 0); | 63 | ret = new CGUITextureCacheBrowser(Environment, -1, 0); |
64 | // block of attribute editors | 64 | // block of attribute editors |
65 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR])) | 65 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR])) |
66 | ret = new CGUIAttributeEditor(Environment, -1, 0); | 66 | ret = new CGUIAttributeEditor(Environment, -1, 0); |
67 | //! single attribute editors | 67 | //! single attribute editors |
68 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE])) | 68 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE])) |
69 | ret = new CGUIStringAttribute(Environment, 0, -1); | 69 | ret = new CGUIStringAttribute(Environment, 0, -1); |
70 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE])) | 70 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE])) |
71 | ret = new CGUIBoolAttribute(Environment, 0, -1); | 71 | ret = new CGUIBoolAttribute(Environment, 0, -1); |
72 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE])) | 72 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE])) |
73 | ret = new CGUIEnumAttribute(Environment, 0, -1); | 73 | ret = new CGUIEnumAttribute(Environment, 0, -1); |
74 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE])) | 74 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE])) |
75 | ret = new CGUIColorAttribute(Environment, 0, -1); | 75 | ret = new CGUIColorAttribute(Environment, 0, -1); |
76 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORFATTRIBUTE])) | 76 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORFATTRIBUTE])) |
77 | ret = new CGUIColorAttribute(Environment, 0, -1); | 77 | ret = new CGUIColorAttribute(Environment, 0, -1); |
78 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE])) | 78 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE])) |
79 | ret = new CGUITextureAttribute(Environment, 0, -1); | 79 | ret = new CGUITextureAttribute(Environment, 0, -1); |
80 | // stubs and custom editors | 80 | // stubs and custom editors |
81 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_CONTEXTMENUEDITOR]) || | 81 | else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_CONTEXTMENUEDITOR]) || |
82 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MENUEDITOR]) || | 82 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MENUEDITOR]) || |
83 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_FILEDIALOGEDITOR]) || | 83 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_FILEDIALOGEDITOR]) || |
84 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORDIALOGEDITOR]) || | 84 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORDIALOGEDITOR]) || |
85 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MODALSCREENEDITOR]) ) | 85 | elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MODALSCREENEDITOR]) ) |
86 | ret = new CGUIDummyEditorStub(Environment, 0, typeName); | 86 | ret = new CGUIDummyEditorStub(Environment, 0, typeName); |
87 | 87 | ||
88 | // add the element to its parent | 88 | // add the element to its parent |
89 | if (ret) | 89 | if (ret) |
90 | parent->addChild(ret); | 90 | parent->addChild(ret); |
91 | 91 | ||
92 | // the environment now has the reference, so we can drop the element | 92 | // the environment now has the reference, so we can drop the element |
93 | if (ret) | 93 | if (ret) |
94 | ret->drop(); | 94 | ret->drop(); |
95 | 95 | ||
96 | return ret; | 96 | return ret; |
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | //! returns amount of element types this factory is able to create | 100 | //! returns amount of element types this factory is able to create |
101 | s32 CGUIEditFactory::getCreatableGUIElementTypeCount() const | 101 | s32 CGUIEditFactory::getCreatableGUIElementTypeCount() const |
102 | { | 102 | { |
103 | return EGUIEDIT_COUNT; | 103 | return EGUIEDIT_COUNT; |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | //! returns type name of a createable element type | 107 | //! returns type name of a createable element type |
108 | const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const | 108 | const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const |
109 | { | 109 | { |
110 | if (idx>=0 && idx<EGUIEDIT_COUNT) | 110 | if (idx>=0 && idx<EGUIEDIT_COUNT) |
111 | return GUIEditElementTypeNames[idx]; | 111 | return GUIEditElementTypeNames[idx]; |
112 | 112 | ||
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
115 | 115 | ||
116 | 116 | ||
117 | 117 | ||
118 | } // end namespace gui | 118 | } // end namespace gui |
119 | } // end namespace irr | 119 | } // end namespace irr |
120 | 120 | ||