aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/tools/GUIEditor
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/tools/GUIEditor')
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h169
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp120
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h54
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h68
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h179
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h59
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp120
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h53
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp356
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp927
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h168
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h114
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp340
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h128
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h70
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h140
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp336
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp95
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h73
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h61
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj295
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj293
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj213
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj217
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp77
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile43
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp76
33 files changed, 5236 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h
new file mode 100644
index 0000000..0585498
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h
@@ -0,0 +1,169 @@
1/*
2 This base class is used by the Attribute editor for making your own attribute types.
3
4 The attribute editor will try and create an attribute called "AttribType_attribute",
5 and if it fails, it will create a "string_attribute".
6
7*/
8
9#ifndef __C_GUI_ATTRIBUTE_H_INCLUDED__
10#define __C_GUI_ATTRIBUTE_H_INCLUDED__
11
12#include "IGUIElement.h"
13#include "IGUIEnvironment.h"
14#include "IGUIFont.h"
15#include "IGUIStaticText.h"
16#include "IAttributes.h"
17#include "CGUIEditWorkspace.h"
18
19namespace irr
20{
21
22namespace gui
23{
24
25 const u32 ATTRIBEDIT_ATTRIB_CHANGED=MAKE_IRR_ID('A','T','T','R');
26
27 class CGUIAttribute : public IGUIElement
28 {
29 public:
30 //! constructor
31 CGUIAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
32 IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
33 AttribName(0), Attribs(0), Index(0), MyParentID(myParentID)
34 {
35
36 #ifdef _DEBUG
37 setDebugName("CGUIAttribute");
38 #endif
39
40 AttribName = environment->addStaticText(0,
41 core::rect<s32>(0, 0,
42 100, Environment->getSkin()->getFont()->getDimension(L"A").Height),
43 false, false, this, -1, false);
44 AttribName->grab();
45 AttribName->setSubElement(true);
46 AttribName->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
47 }
48
49 virtual ~CGUIAttribute()
50 {
51 if (Attribs)
52 Attribs->drop();
53 if (AttribName)
54 AttribName->drop();
55 }
56
57 virtual bool OnEvent(const SEvent &e)
58 {
59 if (IsEnabled)
60 {
61 switch (e.EventType)
62 {
63 case EET_GUI_EVENT:
64 switch (e.GUIEvent.EventType)
65 {
66 case EGET_ELEMENT_FOCUSED:
67 if (Parent && isMyChild(e.GUIEvent.Caller))
68 Parent->bringToFront(this);
69 break;
70 case EGET_ELEMENT_HOVERED:
71 case EGET_ELEMENT_LEFT:
72 return IGUIElement::OnEvent(e);
73 case EGET_ELEMENT_FOCUS_LOST:
74 updateAttrib();
75 return IGUIElement::OnEvent(e);
76 default:
77 return updateAttrib();
78 }
79 break;
80 case EET_KEY_INPUT_EVENT:
81 return true;
82 default:
83 break;
84 }
85 }
86
87 return IGUIElement::OnEvent(e);
88 }
89
90 //! sets the attribute to use
91 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
92 {
93 if (Attribs)
94 Attribs->drop();
95 Attribs = attribs;
96 if (Attribs)
97 Attribs->grab();
98 Index = attribIndex;
99
100 core::stringw name(attribs->getAttributeName(attribIndex));
101 name += L" (";
102 name += attribs->getAttributeTypeString(attribIndex);
103 name += L")";
104 AttribName->setText(name.c_str());
105
106 core::rect<s32> r = Parent->getAbsolutePosition();
107 core::rect<s32> r2(0, 5,
108 r.getWidth(), Environment->getSkin()->getFont()->getDimension(L"A").Height + 10 );
109
110 AttribName->setRelativePosition(r2);
111
112 // get minimum height
113 s32 y=0;
114 core::list<IGUIElement*>::Iterator it = Children.begin();
115 for (; it != Children.end(); ++it)
116 {
117 if (y < (*it)->getRelativePosition().LowerRightCorner.Y)
118 y = (*it)->getRelativePosition().LowerRightCorner.Y;
119 }
120 setMinSize( core::dimension2du(0, y+5));
121
122 updateAttrib(false);
123 }
124
125 //! sets the parent ID, for identifying where events came from
126 void setParentID(s32 parentID)
127 {
128 MyParentID = parentID;
129 }
130
131 //! save the attribute and possibly post the event to its parent
132 virtual bool updateAttrib(bool sendEvent=true)
133 {
134 if (Attribs && IsEnabled && sendEvent)
135 {
136 // build event and pass to parent
137 SEvent event;
138 event.EventType = (EEVENT_TYPE)ATTRIBEDIT_ATTRIB_CHANGED;
139 event.UserEvent.UserData1 = MyParentID;
140 event.UserEvent.UserData2 = Index;
141 return Parent->OnEvent(event);
142 }
143
144 return true;
145 }
146
147 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0)
148 {
149 IGUIElement::serializeAttributes(out, options);
150 }
151
152 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
153 {
154 IGUIElement::deserializeAttributes(in, options);
155 if (AttribName)
156 AttribName->setText(Text.c_str());
157 }
158
159 protected:
160 IGUIStaticText* AttribName;
161 io::IAttributes* Attribs;
162 u32 Index;
163 s32 MyParentID;
164 };
165
166} // namespace gui
167} // namespace irr
168
169#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp
new file mode 100644
index 0000000..45913b6
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp
@@ -0,0 +1,120 @@
1
2#include "CGUIAttributeEditor.h"
3#include "IGUIEnvironment.h"
4#include "IFileSystem.h"
5#include "IVideoDriver.h"
6#include "IAttributes.h"
7#include "IGUIFont.h"
8#include "IGUIScrollBar.h"
9#include "CGUIEditWorkspace.h"
10#include "CGUIAttribute.h"
11#include "CGUIStringAttribute.h"
12
13namespace irr
14{
15namespace gui
16{
17
18using namespace core;
19using namespace io;
20
21CGUIAttributeEditor::CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent) :
22 CGUIPanel(environment, parent, id, rect<s32>(0, 0, 100, 100)),
23 Attribs(0), Panel(0)
24{
25 #ifdef _DEBUG
26 setDebugName("CGUIAttributeEditor");
27 #endif
28
29 // create attributes
30 Attribs = environment->getFileSystem()->createEmptyAttributes(Environment->getVideoDriver());
31
32 calculateClientArea();
33 resizeInnerPane();
34
35 // refresh attrib list
36 refreshAttribs();
37
38 IGUIScrollBar* sb = getVScrollBar();
39 core::rect<s32> r = sb->getRelativePosition();
40 r.LowerRightCorner.Y -= 16;
41 sb->setRelativePosition(r);
42}
43
44CGUIAttributeEditor::~CGUIAttributeEditor()
45{
46 for (u32 i=0; i<AttribList.size(); ++i)
47 {
48 AttribList[i]->remove();
49 AttribList[i]->drop();
50 }
51 AttribList.clear();
52
53 Attribs->drop();
54}
55
56
57IAttributes* CGUIAttributeEditor::getAttribs()
58{
59 return Attribs;
60}
61
62void CGUIAttributeEditor::refreshAttribs()
63{
64 // clear the attribute list
65 u32 i;
66 for (i=0; i<AttribList.size(); ++i)
67 {
68 AttribList[i]->remove();
69 AttribList[i]->drop();
70 }
71 AttribList.clear();
72
73 position2di top(10, 5);
74 rect<s32> r(top.X, top.Y,
75 getClientArea().getWidth() - 10,
76 5 + Environment->getSkin()->getFont()->getDimension(L"A").Height);
77
78 // add attribute elements
79 u32 c = Attribs->getAttributeCount();
80 for (i=0; i<c; ++i)
81 {
82
83 // try to create attribute
84 stringc str = Attribs->getAttributeTypeString(i);
85 str += "_attribute";
86 CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), 0);
87
88 // if this doesn't exist, use a string editor
89 if (!n)
90 n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", 0);
91
92 if (n)
93 {
94 AttribList.push_back(n);
95 n->setParentID(getID());
96 n->grab();
97 }
98
99 // We can't set "this" as parent above as we need functionality
100 // of the overloaded addChild which isn't called in the constructor.
101 // (that's a general Irrlicht messup with too fat constructors)
102 addChild(n);
103
104 AttribList[i]->setSubElement(true);
105 AttribList[i]->setRelativePosition(r);
106 AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
107 AttribList[i]->setAttrib(Attribs, i);
108 r += position2di(0, AttribList[i]->getRelativePosition().getHeight() + 5);
109 }
110}
111
112void CGUIAttributeEditor::updateAttribs()
113{
114 for (u32 i=0; i<AttribList.size(); ++i)
115 AttribList[i]->updateAttrib(false);
116}
117
118} // namespace gui
119} // namespace irr
120
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h
new file mode 100644
index 0000000..0bcdab5
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h
@@ -0,0 +1,54 @@
1#ifndef __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
2#define __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
3
4#include "IGUIElement.h"
5#include "CGUIPanel.h"
6#include "irrArray.h"
7#include "IAttributes.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14
15 class CGUIAttribute;
16
17
18 class CGUIAttributeEditor : public CGUIPanel
19 {
20 public:
21
22 //! constructor
23 CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent=0);
24
25 //! destructor
26 ~CGUIAttributeEditor();
27
28 // gets the current attributes list
29 virtual io::IAttributes* getAttribs();
30
31 // update the attribute list after making a change
32 void refreshAttribs();
33
34 // save the attributes
35 void updateAttribs();
36
37 //! Returns the type name of the gui element.
38 virtual const c8* getTypeName() const
39 {
40 return GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR];
41 }
42
43 private:
44
45 core::array<CGUIAttribute*> AttribList; // attributes editing controls
46 io::IAttributes* Attribs; // current attributes
47 CGUIPanel* Panel;
48 };
49
50} // end namespace gui
51} // end namespace irr
52
53#endif // __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
54
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h
new file mode 100644
index 0000000..b0521db
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h
@@ -0,0 +1,68 @@
1#ifndef __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUICheckBox.h"
6#include "EGUIEditTypes.h"
7
8namespace irr
9{
10namespace gui
11{
12
13 class CGUIBoolAttribute : public CGUIAttribute
14 {
15 public:
16 //
17 CGUIBoolAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
18 CGUIAttribute(environment, parent, myParentID), AttribCheckBox(0)
19 {
20
21 core::rect<s32> r = getAbsolutePosition();
22 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
23 r.getWidth() - 5,
24 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 15 );
25
26 AttribCheckBox = environment->addCheckBox(false, r2, this);
27 AttribCheckBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
28 AttribCheckBox->setSubElement(true);
29 AttribCheckBox->grab();
30 }
31
32 virtual ~CGUIBoolAttribute()
33 {
34 if (AttribCheckBox)
35 AttribCheckBox->drop();
36 }
37
38 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
39 {
40 AttribCheckBox->setChecked(attribs->getAttributeAsBool(attribIndex));
41 CGUIAttribute::setAttrib(attribs, attribIndex);
42 }
43
44 // save the attribute and possibly post the event to its parent
45 virtual bool updateAttrib(bool sendEvent=true)
46 {
47 if (!Attribs)
48 return true;
49
50 Attribs->setAttribute(Index, AttribCheckBox->isChecked());
51
52 return CGUIAttribute::updateAttrib(sendEvent);
53 }
54
55 //! Returns the type name of the gui element.
56 virtual const c8* getTypeName() const
57 {
58 return GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE];
59 }
60
61 private:
62 IGUICheckBox* AttribCheckBox;
63 };
64
65} // namespace gui
66} // namespace irr
67
68#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h
new file mode 100644
index 0000000..e0c5212
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h
@@ -0,0 +1,179 @@
1#ifndef __C_GUI_COLOR_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_COLOR_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIStaticText.h"
6#include "IGUIScrollBar.h"
7#include "IGUITabControl.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14 class CGUIColorAttribute : public CGUIAttribute
15 {
16 public:
17 //
18 CGUIColorAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
19 CGUIAttribute(environment, parent, myParentID),
20 AttribSliderA(0), AttribSliderR(0), AttribSliderG(0), AttribSliderB(0),
21 AttribEditBox(0), AttribColor(0)
22 {
23 s32 fh = Environment->getSkin()->getFont()->getDimension(L"A").Height;
24
25 core::rect<s32> r0(getAbsolutePosition()),
26 r2(0, fh + 5, r0.getWidth() - 5, fh*2 + 10 ),
27 r3(r2),
28 r4(r2.getWidth() - 20, 3, r2.getWidth() - 3, r2.getHeight()-3);
29
30 AttribColor = Environment->addTab(r4, this, 0);
31 AttribColor->grab();
32 AttribColor->setDrawBackground(true);
33 AttribColor->setSubElement(true);
34 AttribColor->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
35
36 s32 h=2;
37 r2 += core::position2di(0, h*4 + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)*2);
38 r3.LowerRightCorner.Y = r3.UpperLeftCorner.Y + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)/2;
39
40 AttribSliderA = environment->addScrollBar(true, r3, this, -1);
41 AttribSliderA->setMax(255);
42 AttribSliderA->grab();
43 AttribSliderA->setSubElement(true);
44 AttribSliderA->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45 r3 += core::position2di(0, r3.getHeight()+h);
46 AttribSliderR = environment->addScrollBar(true, r3, this, -1);
47 AttribSliderR->setMax(255);
48 AttribSliderR->grab();
49 AttribSliderR->setSubElement(true);
50 AttribSliderR->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
51 r3 += core::position2di(0, r3.getHeight()+h);
52 AttribSliderG = environment->addScrollBar(true, r3, this, -1);
53 AttribSliderG->setMax(255);
54 AttribSliderG->grab();
55 AttribSliderG->setSubElement(true);
56 AttribSliderG->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
57 r3 += core::position2di(0, r3.getHeight()+h);
58 AttribSliderB = environment->addScrollBar(true, r3, this, -1);
59 AttribSliderB->setMax(255);
60 AttribSliderB->grab();
61 AttribSliderB->setSubElement(true);
62 AttribSliderB->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
63
64 // add editbox
65 AttribEditBox = environment->addEditBox(
66 L"",
67 r2,
68 true, this, -1);
69 AttribEditBox->grab();
70 AttribEditBox->setSubElement(true);
71 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
72 }
73
74 virtual ~CGUIColorAttribute()
75 {
76 if (AttribSliderA)
77 AttribSliderA->drop();
78 if (AttribSliderR)
79 AttribSliderR->drop();
80 if (AttribSliderG)
81 AttribSliderG->drop();
82 if (AttribSliderB)
83 AttribSliderB->drop();
84 if (AttribEditBox)
85 AttribEditBox->drop();
86 if (AttribColor)
87 AttribColor->drop();
88 }
89
90 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
91 {
92 video::SColor col = attribs->getAttributeAsColor(attribIndex);
93
94 AttribSliderA->setPos(col.getAlpha());
95 AttribSliderR->setPos(col.getRed());
96 AttribSliderG->setPos(col.getGreen());
97 AttribSliderB->setPos(col.getBlue());
98 AttribEditBox->setText( attribs->getAttributeAsStringW(attribIndex).c_str() );
99 AttribColor->setBackgroundColor(col);
100
101 CGUIAttribute::setAttrib(attribs, attribIndex);
102 }
103
104 virtual bool OnEvent(const SEvent &e)
105 {
106 switch (e.EventType)
107 {
108
109 case EET_GUI_EVENT:
110 switch (e.GUIEvent.EventType)
111 {
112 case EGET_EDITBOX_ENTER:
113 case EGET_ELEMENT_FOCUS_LOST:
114 if (e.GUIEvent.Caller == AttribEditBox)
115 {
116 // update scrollbars from textbox
117 Attribs->setAttribute(Index, AttribEditBox->getText());
118 video::SColor col = Attribs->getAttributeAsColor(Index);
119 AttribSliderA->setPos(col.getAlpha());
120 AttribSliderR->setPos(col.getRed());
121 AttribSliderG->setPos(col.getGreen());
122 AttribSliderB->setPos(col.getBlue());
123 // update colour
124 AttribColor->setBackgroundColor(col);
125 }
126 break;
127 case EGET_SCROLL_BAR_CHANGED:
128 {
129 // update editbox from scrollbars
130 video::SColor col( AttribSliderA->getPos(), AttribSliderR->getPos(),
131 AttribSliderG->getPos(), AttribSliderB->getPos());
132
133 Attribs->setAttribute(Index, col);
134 AttribEditBox->setText( Attribs->getAttributeAsStringW(Index).c_str());
135 // update colour
136 AttribColor->setBackgroundColor(col);
137 }
138 return updateAttrib();
139 default:
140 break;
141 }
142 break;
143 default:
144 break;
145 }
146 return CGUIAttribute::OnEvent(e);
147 }
148
149 // save the attribute and possibly post the event to its parent
150 virtual bool updateAttrib(bool sendEvent=true)
151 {
152 if (!Attribs)
153 return true;
154
155 Attribs->setAttribute(Index, AttribEditBox->getText());
156 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
157 return CGUIAttribute::updateAttrib(sendEvent);
158 }
159
160 //! Returns the type name of the gui element.
161 virtual const c8* getTypeName() const
162 {
163 return GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE];
164 }
165
166 private:
167 IGUIScrollBar* AttribSliderA;
168 IGUIScrollBar* AttribSliderR;
169 IGUIScrollBar* AttribSliderG;
170 IGUIScrollBar* AttribSliderB;
171 IGUIEditBox* AttribEditBox;
172 IGUITab* AttribColor;
173 };
174
175} // namespace gui
176} // namespace irr
177
178#endif
179
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
new file mode 100644
index 0000000..635501a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
@@ -0,0 +1,59 @@
1/*
2 This is a custom editor for stubbing problematic elements out,
3 for example elements which include modal screens
4*/
5
6#ifndef __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
7#define __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
8
9#include "IGUIElement.h"
10#include "IGUIEnvironment.h"
11#include "IGUIStaticText.h"
12
13namespace irr
14{
15
16namespace gui
17{
18 class CGUIDummyEditorStub : public IGUIElement
19 {
20 public:
21 //! constructor
22 CGUIDummyEditorStub(IGUIEnvironment* environment, IGUIElement *parent, const char *text) :
23 IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
24 TextBox(0), TypeName(text)
25 {
26
27 #ifdef _DEBUG
28 setDebugName("CGUIDummyEditorStub");
29 #endif
30
31 core::dimension2du d = Environment->getSkin()->getFont()->getDimension(L"A");
32 s32 h = d.Height / 2;
33 s32 w = d.Width / 2;
34
35 TextBox = environment->addStaticText(core::stringw(text).c_str(),
36 core::rect<s32>(50-w, 50-h, 50+w, 50+h),
37 false, false, this, -1, false);
38 TextBox->grab();
39 TextBox->setSubElement(true);
40 TextBox->setAlignment(EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER);
41 }
42
43 virtual ~CGUIDummyEditorStub()
44 {
45 if (TextBox)
46 TextBox->drop();
47 }
48 virtual const c8* getTypeName() const { return TypeName.c_str(); }
49
50 protected:
51 IGUIStaticText* TextBox;
52 core::stringc TypeName;
53
54 };
55
56} // namespace gui
57} // namespace irr
58
59#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp
new file mode 100644
index 0000000..9552745
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp
@@ -0,0 +1,120 @@
1#include "CGUIEditFactory.h"
2#include "IGUIEnvironment.h"
3#include "irrString.h"
4
5#include "EGUIEditTypes.h"
6
7#include "CGUIEditWorkspace.h"
8#include "CGUIEditWindow.h"
9#include "CGUIPanel.h"
10#include "CGUITextureCacheBrowser.h"
11#include "CGUIAttributeEditor.h"
12#include "CGUIStringAttribute.h"
13#include "CGUIBoolAttribute.h"
14#include "CGUIEnumAttribute.h"
15#include "CGUIColorAttribute.h"
16#include "CGUITextureAttribute.h"
17#include "CGUIDummyEditorStub.h"
18
19namespace irr
20{
21namespace gui
22{
23
24CGUIEditFactory::CGUIEditFactory(IGUIEnvironment* env)
25: Environment(env)
26{
27 #ifdef _DEBUG
28 setDebugName("CGUIEditFactory");
29 #endif
30
31 // don't grab the gui environment here to prevent cyclic references
32}
33
34
35CGUIEditFactory::~CGUIEditFactory()
36{
37}
38
39
40//! adds an element to the environment based on its type name
41IGUIElement* CGUIEditFactory::addGUIElement(const c8* typeName, IGUIElement* parent)
42{
43 /*
44 here we create elements, add them to the manager, and then drop them
45 */
46
47 core::stringc elementType(typeName);
48 IGUIElement* ret=0;
49 if (!parent)
50 parent = Environment->getRootGUIElement();
51
52 // editor workspace
53 if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDIT]))
54 ret = new CGUIEditWorkspace(Environment, -1, 0);
55 // editor window
56 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW]))
57 ret = new CGUIEditWindow(Environment, core::rect<s32>(0,0,100,100), 0);
58 // Klasker's GUI Panel
59 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIPANEL]))
60 ret = new CGUIPanel(Environment, 0);
61 // texture cache browser
62 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREBROWSER]))
63 ret = new CGUITextureCacheBrowser(Environment, -1, 0);
64 // block of attribute editors
65 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR]))
66 ret = new CGUIAttributeEditor(Environment, -1, 0);
67 //! single attribute editors
68 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE]))
69 ret = new CGUIStringAttribute(Environment, 0, -1);
70 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE]))
71 ret = new CGUIBoolAttribute(Environment, 0, -1);
72 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE]))
73 ret = new CGUIEnumAttribute(Environment, 0, -1);
74 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE]))
75 ret = new CGUIColorAttribute(Environment, 0, -1);
76 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORFATTRIBUTE]))
77 ret = new CGUIColorAttribute(Environment, 0, -1);
78 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE]))
79 ret = new CGUITextureAttribute(Environment, 0, -1);
80 // stubs and custom editors
81 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_CONTEXTMENUEDITOR]) ||
82 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MENUEDITOR]) ||
83 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_FILEDIALOGEDITOR]) ||
84 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORDIALOGEDITOR]) ||
85 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MODALSCREENEDITOR]) )
86 ret = new CGUIDummyEditorStub(Environment, 0, typeName);
87
88 // add the element to its parent
89 if (ret)
90 parent->addChild(ret);
91
92 // the environment now has the reference, so we can drop the element
93 if (ret)
94 ret->drop();
95
96 return ret;
97}
98
99
100//! returns amount of element types this factory is able to create
101s32 CGUIEditFactory::getCreatableGUIElementTypeCount() const
102{
103 return EGUIEDIT_COUNT;
104}
105
106
107//! returns type name of a createable element type
108const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const
109{
110 if (idx>=0 && idx<EGUIEDIT_COUNT)
111 return GUIEditElementTypeNames[idx];
112
113 return 0;
114}
115
116
117
118} // end namespace gui
119} // end namespace irr
120
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h
new file mode 100644
index 0000000..e6f8815
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h
@@ -0,0 +1,53 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUIEDIT_FACTORY_H_INCLUDED__
6#define __C_GUIEDIT_FACTORY_H_INCLUDED__
7
8#include "IGUIElementFactory.h"
9
10namespace irr
11{
12namespace gui
13{
14 class IGUIElement;
15 class IGUIEnvironment;
16
17 //! Interface making it possible to dynamicly create gui elements
18 class CGUIEditFactory : public IGUIElementFactory
19 {
20 public:
21
22 CGUIEditFactory(IGUIEnvironment* env);
23 ~CGUIEditFactory();
24
25 //! adds a GUI element to the GUI Environment based on its type name
26 /** \param typeName: Type name of the element to add.
27 \param parent: Parent scene node of the new element, can be null to add it to the root.
28 \return Returns pointer to the new element or null if not successful. */
29 virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0);
30
31 //! returns amount of GUI element types this factory is able to create
32 virtual s32 getCreatableGUIElementTypeCount() const;
33
34 //! returns type name of a createable GUI element type by index
35 /** \param idx: Index of the type in this factory. Must be a value between 0 and
36 getCreatableGUIElementTypeCount() */
37 virtual const c8* getCreateableGUIElementTypeName(s32 idx) const;
38
39 // not used:
40 virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const {return 0;} ;
41 virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const { return EGUIET_ELEMENT;};
42 virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) {return 0;};
43 private:
44
45 IGUIEnvironment* Environment;
46 };
47
48
49} // end namespace scene
50} // end namespace irr
51
52#endif
53
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp
new file mode 100644
index 0000000..2ff96ae
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp
@@ -0,0 +1,356 @@
1
2#include "CGUIEditWindow.h"
3#include "IGUISkin.h"
4#include "IGUIEnvironment.h"
5#include "IGUIElementFactory.h"
6#include "IAttributes.h"
7#include "IGUIFont.h"
8#include "IGUITabControl.h"
9#include "IGUITreeView.h"
10#include "CGUIEditWorkspace.h"
11
12using namespace irr;
13using namespace gui;
14
15//! constructor
16CGUIEditWindow::CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent)
17 : IGUIWindow(environment, parent, -1, rectangle),
18 Dragging(false), IsDraggable(true), Resizing(false), SelectedElement(0),
19 AttribEditor(0), OptionEditor(0), EnvEditor(0)
20{
21 #ifdef _DEBUG
22 setDebugName("CGUIEditWindow");
23 #endif
24
25 // we can't tab out of this window
26 setTabGroup(true);
27 // we can ctrl+tab to it
28 setTabStop(true);
29 // the tab order number is auto-assigned
30 setTabOrder(-1);
31
32 // set window text
33 setText(L"GUI Editor");
34
35 // return if we have no skin.
36 IGUISkin *skin = environment->getSkin();
37 if (!skin)
38 return;
39
40 s32 th = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
41
42 setRelativePosition(core::rect<s32>(50,50,250,500));
43 setMinSize(core::dimension2du(200,200));
44
45 IGUITabControl *TabControl = environment->addTabControl(core::rect<s32>(1,th+5,199,449), this, false, true);
46 TabControl->setSubElement(true);
47 TabControl->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
48
49 TabControl->addTab(L"Tools");
50 //L"Texture Cache Browser"
51 //L"Font Browser"
52 //L"Font Generator"
53 //L"Sprite Editor"
54 //Environment->addGUIElement("textureCacheBrowser", this);
55
56 IGUITab* EditorTab = TabControl->addTab(L"Editor");
57 OptionEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", EditorTab);
58 OptionEditor->grab();
59 OptionEditor->setID(EGUIEDCE_OPTION_EDITOR);
60 OptionEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
61 OptionEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
62
63 if (Parent && Parent->getParent() == Environment->getRootGUIElement())
64 {
65 IGUITab* EnvTab = TabControl->addTab(L"Env");
66 EnvEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", EnvTab);
67 EnvEditor->grab();
68 EnvEditor->setID(EGUIEDCE_ENV_EDITOR);
69 EnvEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
70 EnvEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
71 }
72 IGUITab* ElementTab = TabControl->addTab(L"Element");
73
74 AttribEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", ElementTab);
75 AttribEditor->grab();
76 AttribEditor->setID(EGUIEDCE_ATTRIB_EDITOR);
77 AttribEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
78 AttribEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
79
80 IGUITab* TreeTab = TabControl->addTab(L"Tree");
81 TreeView = environment->addTreeView(core::rect<s32>(0,0,0,0), TreeTab);
82 TreeView->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
83 TreeView->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
84 IGUITreeViewNode* treenode = TreeView->getRoot();
85 //treenode->addChildFront(L"Elements");
86 ResizeButton = environment->addButton(core::rect<s32>(199-th,449-th,199,449), this);
87 ResizeButton->setDrawBorder(false);
88 ResizeButton->setEnabled(false);
89 ResizeButton->setSpriteBank(skin->getSpriteBank());
90 ResizeButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_RESIZE), skin->getColor(EGDC_WINDOW_SYMBOL));
91 ResizeButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_RESIZE), skin->getColor(EGDC_WINDOW_SYMBOL));
92 ResizeButton->grab();
93 ResizeButton->setSubElement(true);
94 ResizeButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
95 updateTree();
96}
97
98
99//! destructor
100CGUIEditWindow::~CGUIEditWindow()
101{
102 // drop everything
103 if (AttribEditor)
104 AttribEditor->drop();
105 if (EnvEditor)
106 EnvEditor->drop();
107 if (OptionEditor)
108 OptionEditor->drop();
109 if (ResizeButton)
110 ResizeButton->drop();
111}
112
113IGUITreeView* CGUIEditWindow::getTreeView() const
114{
115 return TreeView;
116}
117CGUIAttributeEditor* CGUIEditWindow::getEnvironmentEditor() const
118{
119 return EnvEditor;
120}
121
122CGUIAttributeEditor* CGUIEditWindow::getAttributeEditor() const
123{
124 return AttribEditor;
125}
126
127CGUIAttributeEditor* CGUIEditWindow::getOptionEditor() const
128{
129 return OptionEditor;
130}
131
132IGUITreeViewNode* CGUIEditWindow::getTreeNode(IGUIElement* element, IGUITreeViewNode* searchnode)
133{
134 IGUITreeViewNode* child = searchnode->getFirstChild();
135 while (child)
136 {
137 if (((IGUIElement*) child->getData()) == element)
138 return child;
139
140 if (child->hasChildren())
141 {
142 IGUITreeViewNode* foundnode = getTreeNode(element, child);
143 if (foundnode)
144 return foundnode;
145 }
146 child = child->getNextSibling();
147 }
148 return 0;
149}
150
151void CGUIEditWindow::addChildrenToTree(IGUIElement* parentElement, IGUITreeViewNode* treenode)
152{
153 core::stringw name = core::stringw(parentElement->getTypeName());
154 if (parentElement->getID() != -1)
155 name += core::stringw(L" [") + core::stringw(parentElement->getID()) + core::stringw(L"]");
156
157 IGUITreeViewNode* newnode = treenode->addChildBack(name.c_str());
158 newnode->setData((void*)parentElement);
159 core::list<IGUIElement*> children = parentElement->getChildren();
160
161 for (core::list<IGUIElement*>::Iterator i = children.begin(); i != children.end(); i++ )
162 {
163 if(core::stringc((*i)->getTypeName()) != "GUIEditor" && !(*i)->isSubElement())
164 addChildrenToTree(*i, newnode);
165 }
166}
167
168void CGUIEditWindow::updateTree()
169{
170 TreeView->getRoot()->clearChildren();
171 IGUIElement* root = Environment->getRootGUIElement();
172 addChildrenToTree(root, TreeView->getRoot());
173 TreeView->getRoot()->getFirstChild()->setExpanded(true);
174}
175
176void CGUIEditWindow::setSelectedElement(IGUIElement *sel)
177{
178 // save changes
179 AttribEditor->updateAttribs();
180 IGUITreeViewNode* elementTreeNode = getTreeNode(sel, TreeView->getRoot());
181
182 if (elementTreeNode)
183 {
184 elementTreeNode->setSelected(true);
185 while (elementTreeNode)
186 {
187 elementTreeNode->setExpanded(true);
188 elementTreeNode = elementTreeNode->getParent();
189 }
190 }
191
192 io::IAttributes* Attribs = AttribEditor->getAttribs();
193
194 if (SelectedElement && sel != SelectedElement)
195 {
196 // deserialize attributes
197 SelectedElement->deserializeAttributes(Attribs);
198 }
199 // clear the attributes list
200 Attribs->clear();
201 SelectedElement = sel;
202
203 // get the new attributes
204 if (SelectedElement)
205 SelectedElement->serializeAttributes(Attribs);
206
207 AttribEditor->refreshAttribs();
208}
209
210//! draws the element and its children.
211//! same code as for a window
212void CGUIEditWindow::draw()
213{
214 if (!IsVisible)
215 return;
216
217 IGUISkin* skin = Environment->getSkin();
218
219 core::rect<s32> rect = AbsoluteRect;
220
221 // draw body fast
222 rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
223 AbsoluteRect, &AbsoluteClippingRect);
224
225 if (Text.size())
226 {
227 rect.UpperLeftCorner.X += skin->getSize(EGDS_TEXT_DISTANCE_X);
228 rect.UpperLeftCorner.Y += skin->getSize(EGDS_TEXT_DISTANCE_Y);
229 rect.LowerRightCorner.X -= skin->getSize(EGDS_WINDOW_BUTTON_WIDTH) + 5;
230
231 IGUIFont* font = skin->getFont();
232 if (font)
233 font->draw(Text.c_str(), rect, skin->getColor(EGDC_ACTIVE_CAPTION), false, true, &AbsoluteClippingRect);
234 }
235
236 IGUIElement::draw();
237}
238
239
240//! called if an event happened.
241bool CGUIEditWindow::OnEvent(const SEvent &event)
242{
243 switch(event.EventType)
244 {
245 case EET_GUI_EVENT:
246 switch(event.GUIEvent.EventType)
247 {
248 case EGET_ELEMENT_FOCUS_LOST:
249 if (event.GUIEvent.Caller == this ||
250 event.GUIEvent.Caller == ResizeButton)
251 {
252 Dragging = false;
253 Resizing = false;
254 }
255 break;
256 default:
257 break;
258 }
259
260 break;
261 case EET_MOUSE_INPUT_EVENT:
262 switch(event.MouseInput.Event)
263 {
264 case EMIE_LMOUSE_PRESSED_DOWN:
265 {
266 DragStart.X = event.MouseInput.X;
267 DragStart.Y = event.MouseInput.Y;
268
269 IGUIElement* clickedElement = getElementFromPoint(DragStart);
270
271 if (clickedElement == this)
272 {
273 Dragging = IsDraggable;
274 //Environment->setFocus(this);
275 if (Parent)
276 Parent->bringToFront(this);
277 return true;
278 }
279 else if (clickedElement == ResizeButton)
280 {
281 Resizing = true;
282 //Environment->setFocus(this);
283 if (Parent)
284 Parent->bringToFront(this);
285 return true;
286 }
287 break;
288 }
289 case EMIE_LMOUSE_LEFT_UP:
290 if (Dragging || Resizing)
291 {
292 Dragging = false;
293 Resizing = false;
294 return true;
295 }
296 break;
297 case EMIE_MOUSE_MOVED:
298 if (Dragging || Resizing)
299 {
300 // gui window should not be dragged outside of its parent
301 if (Parent)
302 if (event.MouseInput.X < Parent->getAbsolutePosition().UpperLeftCorner.X +1 ||
303 event.MouseInput.Y < Parent->getAbsolutePosition().UpperLeftCorner.Y +1 ||
304 event.MouseInput.X > Parent->getAbsolutePosition().LowerRightCorner.X -1 ||
305 event.MouseInput.Y > Parent->getAbsolutePosition().LowerRightCorner.Y -1)
306
307 return true;
308 core::position2di diff(event.MouseInput.X - DragStart.X, event.MouseInput.Y - DragStart.Y);
309 if (Dragging)
310 {
311 move(diff);
312 DragStart.X = event.MouseInput.X;
313 DragStart.Y = event.MouseInput.Y;
314 }
315 else if (Resizing)
316 {
317 core::position2di dp = RelativeRect.LowerRightCorner + diff;
318 setRelativePosition(core::rect<s32>(RelativeRect.UpperLeftCorner, dp));
319 DragStart += dp - RelativeRect.LowerRightCorner + diff;
320 }
321
322 return true;
323 }
324 break;
325 default:
326 break;
327 }
328 default:
329 break;
330 }
331
332 return Parent ? Parent->OnEvent(event) : false;
333}
334
335bool CGUIEditWindow::isDraggable() const
336{
337 return IsDraggable;
338}
339
340void CGUIEditWindow::setDraggable(bool draggable)
341{
342 IsDraggable = draggable;
343
344 if (Dragging && !IsDraggable)
345 Dragging = false;
346}
347
348
349// we're supposed to supply these if we're creating an IGUIWindow
350// but we don't need them so we'll just return null
351
352//! Returns the rectangle of the drawable area (without border, without titlebar and without scrollbars)
353core::rect<s32> CGUIEditWindow::getClientRect() const {return core::recti();}
354IGUIButton* CGUIEditWindow::getCloseButton() const {return 0;}
355IGUIButton* CGUIEditWindow::getMinimizeButton() const {return 0;}
356IGUIButton* CGUIEditWindow::getMaximizeButton() const {return 0;}
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h
new file mode 100644
index 0000000..4b1d72f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h
@@ -0,0 +1,88 @@
1#ifndef __C_GUI_EDITOR_H_INCLUDED__
2#define __C_GUI_EDITOR_H_INCLUDED__
3
4
5#include "IGUIWindow.h"
6#include "CGUIAttributeEditor.h"
7//#include "IGUIStaticText.h"
8#include "IGUIButton.h"
9#include "IGUITreeView.h"
10#include "irrArray.h"
11#include "IAttributes.h"
12#include "EGUIEditTypes.h"
13
14namespace irr
15{
16namespace gui
17{
18 class CGUIEditWindow : public IGUIWindow
19 {
20 public:
21
22 //! constructor
23 CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent);
24
25 //! destructor
26 ~CGUIEditWindow();
27
28 //! this part draws the window
29 virtual void draw();
30 //! handles events
31 virtual bool OnEvent(const SEvent &event);
32
33 //! change selection
34 virtual void setSelectedElement(IGUIElement *sel);
35
36 //! get draggable
37 virtual bool isDraggable() const;
38
39 //! get draggable
40 virtual void setDraggable(bool draggable);
41
42 // not used
43 virtual core::rect<s32> getClientRect() const;
44 virtual IGUIButton* getCloseButton() const;
45 virtual IGUIButton* getMinimizeButton() const;
46 virtual IGUIButton* getMaximizeButton() const;
47 virtual void setDrawBackground(bool draw) { }
48 virtual bool getDrawBackground() const { return true; }
49 virtual void setDrawTitlebar(bool draw) { }
50 virtual bool getDrawTitlebar() const { return true; }
51
52 IGUITreeView* getTreeView() const;
53 CGUIAttributeEditor* getAttributeEditor() const;
54 CGUIAttributeEditor* getOptionEditor() const;
55 CGUIAttributeEditor* getEnvironmentEditor() const;
56
57 //! Returns the type name of the gui element.
58 virtual const c8* getTypeName() const
59 {
60 return GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW];
61 }
62
63 void updateTree();
64 private:
65
66 void addChildrenToTree(IGUIElement* parentElement, IGUITreeViewNode* treenode);
67 IGUITreeViewNode* getTreeNode(IGUIElement* element, IGUITreeViewNode* searchnode);
68 // for dragging the window
69 bool Dragging;
70 bool IsDraggable;
71 bool Resizing;
72 core::position2d<s32> DragStart;
73
74 IGUIElement* SelectedElement; // current selected element
75
76 CGUIAttributeEditor* AttribEditor; // edits the current attribute
77 CGUIAttributeEditor* OptionEditor; // edits the options for the window
78 CGUIAttributeEditor* EnvEditor; // edits attributes for the environment
79 IGUITreeView* TreeView; // tree view of all elements in scene
80 IGUIButton* ResizeButton;
81
82 };
83
84} // end namespace gui
85} // end namespace irr
86
87#endif // __C_GUI_EDITOR_H_INCLUDED__
88
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp
new file mode 100644
index 0000000..a45e5d3
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp
@@ -0,0 +1,927 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5// Thanks to Midnight for all his testing, bug fixes and patches :)
6
7#include "CGUIEditWorkspace.h"
8#include "IGUIEnvironment.h"
9#include "IVideoDriver.h"
10#include "IOSOperator.h"
11#include "IReadFile.h"
12#include "IFileSystem.h"
13#include "IXMLWriter.h"
14#include "IGUISkin.h"
15#include "IGUIElementFactory.h"
16#include "CGUIEditWindow.h"
17#include "IGUIContextMenu.h"
18#include "IGUIFileOpenDialog.h"
19#include "IGUITreeView.h"
20#include "CGUIAttribute.h"
21#include "CMemoryReadWriteFile.h"
22
23namespace irr
24{
25namespace gui
26{
27
28//! constructor
29CGUIEditWorkspace::CGUIEditWorkspace(IGUIEnvironment* environment, s32 id, IGUIElement *parent)
30: IGUIElement(EGUIET_ELEMENT, environment, parent ? parent : environment->getRootGUIElement(), id, environment->getRootGUIElement()->getAbsolutePosition()),
31 CurrentMode(EGUIEDM_SELECT), MouseOverMode(EGUIEDM_SELECT),
32 GridSize(10,10), MenuCommandStart(0x3D17), DrawGrid(false), UseGrid(true),
33 MouseOverElement(0), SelectedElement(0), EditorWindow(0)
34{
35 #ifdef _DEBUG
36 setDebugName("CGUIEditWorkspace");
37 #endif
38
39 // this element is never saved.
40 setSubElement(true);
41
42 // it resizes to fit a resizing window
43 setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
44
45 EditorWindow = (CGUIEditWindow*) Environment->addGUIElement("GUIEditWindow", this);
46 if (EditorWindow)
47 {
48 EditorWindow->grab();
49 EditorWindow->setSubElement(true);
50
51 Environment->setFocus(EditorWindow);
52 serializeAttributes(EditorWindow->getOptionEditor()->getAttribs());
53 EditorWindow->getOptionEditor()->refreshAttribs();
54
55 if (EditorWindow->getEnvironmentEditor())
56 {
57 Environment->serializeAttributes(EditorWindow->getEnvironmentEditor()->getAttribs());
58 EditorWindow->getEnvironmentEditor()->refreshAttribs();
59 }
60 }
61}
62
63
64//! destructor
65CGUIEditWorkspace::~CGUIEditWorkspace()
66{
67 if (EditorWindow)
68 EditorWindow->drop();
69}
70
71
72void CGUIEditWorkspace::setMenuCommandIDStart(s32 id)
73{
74 MenuCommandStart = id;
75}
76
77CGUIEditWorkspace::EGUIEDIT_MODE CGUIEditWorkspace::getModeFromPos(core::position2di p)
78{
79 if (SelectedElement)
80 {
81 core::rect<s32> r = SelectedElement->getAbsolutePosition();
82
83 if (TLRect.isPointInside(p))
84 return EGUIEDM_RESIZE_TL;
85
86 else if (TRRect.isPointInside(p))
87 return EGUIEDM_RESIZE_TR;
88
89 else if (BLRect.isPointInside(p) )
90 return EGUIEDM_RESIZE_BL;
91
92 else if (BRRect.isPointInside(p))
93 return EGUIEDM_RESIZE_BR;
94
95 else if (TopRect.isPointInside(p))
96 return EGUIEDM_RESIZE_T;
97
98 else if (BRect.isPointInside(p))
99 return EGUIEDM_RESIZE_B;
100
101 else if (LRect.isPointInside(p))
102 return EGUIEDM_RESIZE_L;
103
104 else if (RRect.isPointInside(p))
105 return EGUIEDM_RESIZE_R;
106
107 else if (getEditableElementFromPoint(SelectedElement, p) == SelectedElement)
108 return EGUIEDM_MOVE;
109
110 else
111 return EGUIEDM_SELECT;
112 }
113
114 return EGUIEDM_SELECT;
115
116}
117
118IGUIElement* CGUIEditWorkspace::getEditableElementFromPoint(IGUIElement *start, const core::position2di &point, s32 index )
119{
120 IGUIElement* target = 0;
121
122 // we have to search from back to front.
123
124 core::list<IGUIElement*>::ConstIterator it = start->getChildren().getLast();
125 s32 count=0;
126 while(it != start->getChildren().end())
127 {
128 target = getEditableElementFromPoint((*it),point);
129 if (target)
130 {
131 if (!target->isSubElement() && !isMyChild(target) && target != this)
132 {
133 if (index == count)
134 return target;
135 else
136 count++;
137 }
138 else
139 target = 0;
140 }
141 --it;
142 }
143
144 if (start->getAbsolutePosition().isPointInside(point))
145 target = start;
146
147 return target;
148}
149
150void CGUIEditWorkspace::setSelectedElement(IGUIElement *sel)
151{
152 IGUIElement* focus = Environment->getFocus();
153 // we only give focus back to children
154 if (!isMyChild(focus))
155 focus = 0;
156
157 if (SelectedElement != Parent)
158 {
159 if (SelectedElement != sel && EditorWindow)
160 {
161 EditorWindow->setSelectedElement(sel);
162 SelectedElement = sel;
163 }
164 }
165 else
166 SelectedElement = 0;
167
168 if (focus)
169 Environment->setFocus(focus);
170 else
171 Environment->setFocus(this);
172}
173
174IGUIElement* CGUIEditWorkspace::getSelectedElement()
175{
176 return SelectedElement;
177}
178void CGUIEditWorkspace::selectNextSibling()
179{
180 IGUIElement* p=0;
181
182 if (SelectedElement && SelectedElement->getParent())
183 p = SelectedElement->getParent();
184 else
185 p = Parent;
186
187 core::list<IGUIElement*>::ConstIterator it = p->getChildren().begin();
188 // find selected element
189 if (SelectedElement)
190 while (*it != SelectedElement)
191 ++it;
192 if (it !=p->getChildren().end())
193 ++it;
194 // find next non sub-element
195 while (it != p->getChildren().end() && (*it)->isSubElement())
196 ++it;
197
198 if (it != p->getChildren().end())
199 setSelectedElement(*it);
200}
201void CGUIEditWorkspace::selectPreviousSibling()
202{
203 IGUIElement* p=0;
204
205 if (SelectedElement && SelectedElement->getParent())
206 p = SelectedElement->getParent();
207 else
208 p = Parent;
209
210 core::list<IGUIElement*>::ConstIterator it = p->getChildren().getLast();
211 // find selected element
212 if (SelectedElement)
213 while (*it != SelectedElement)
214 --it;
215 if (it != p->getChildren().end())
216 --it;
217 // find next non sub-element
218 while (it != p->getChildren().end() && (*it)->isSubElement())
219 --it;
220
221 if (it != p->getChildren().end())
222 setSelectedElement(*it);
223}
224
225//! called if an event happened.
226bool CGUIEditWorkspace::OnEvent(const SEvent &e)
227{
228 IGUIFileOpenDialog* dialog=0;
229 switch(e.EventType)
230 {
231 case ATTRIBEDIT_ATTRIB_CHANGED:
232 {
233 switch (e.UserEvent.UserData1)
234 {
235 case EGUIEDCE_ATTRIB_EDITOR:
236 {
237 // update selected items attributes
238 if (SelectedElement)
239 {
240 SelectedElement->deserializeAttributes(EditorWindow->getAttributeEditor()->getAttribs());
241 EditorWindow->updateTree();
242 }
243 return true;
244 }
245 case EGUIEDCE_OPTION_EDITOR:
246 {
247 // update editor options
248 deserializeAttributes(EditorWindow->getOptionEditor()->getAttribs());
249 return true;
250 }
251 case EGUIEDCE_ENV_EDITOR:
252 {
253 // update environment
254 Environment->deserializeAttributes(EditorWindow->getEnvironmentEditor()->getAttribs());
255 return true;
256 }
257 }
258 }
259 break;
260
261 case EET_KEY_INPUT_EVENT:
262 if (!e.KeyInput.PressedDown)
263 {
264 switch (e.KeyInput.Key)
265 {
266 case KEY_DELETE:
267 if (SelectedElement)
268 {
269 IGUIElement* el = SelectedElement;
270 setSelectedElement(0);
271 MouseOverElement = 0;
272 el->remove();
273 EditorWindow->updateTree();
274 }
275 break;
276 case KEY_KEY_X:
277 if (e.KeyInput.Control && SelectedElement)
278 {
279 // cut
280 CopySelectedElementXML();
281 // delete element
282 IGUIElement *el = SelectedElement;
283 setSelectedElement(0);
284 MouseOverElement = 0;
285 el->remove();
286 }
287 break;
288 case KEY_KEY_C:
289 // copy
290 if (e.KeyInput.Control && SelectedElement)
291 {
292 CopySelectedElementXML();
293 }
294 break;
295 case KEY_KEY_V:
296 // paste
297 if (e.KeyInput.Control)
298 {
299 PasteXMLToSelectedElement();
300 }
301 break;
302 default:
303 break;
304 }
305
306 return true;
307 }
308 break;
309
310 case EET_MOUSE_INPUT_EVENT:
311
312 switch(e.MouseInput.Event)
313 {
314 case EMIE_MOUSE_WHEEL:
315 {
316 f32 wheel = e.MouseInput.Wheel;
317
318 if (wheel > 0)
319 selectPreviousSibling();
320 else
321 selectNextSibling();
322 }
323 break;
324 case EMIE_LMOUSE_PRESSED_DOWN:
325 {
326 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
327
328 IGUIElement* newSelection = getElementFromPoint(p);
329
330 if (newSelection != this && isMyChild(newSelection) ) // redirect event
331 {
332 Environment->setFocus(newSelection);
333 return true;
334 }
335
336 // hide the gui editor
337 if (EditorWindow)
338 EditorWindow->setVisible(false);
339
340 if (CurrentMode == EGUIEDM_SELECT)
341 {
342 if (SelectedElement)
343 {
344 // start moving or dragging
345 CurrentMode = getModeFromPos(p);
346
347 if (CurrentMode == EGUIEDM_MOVE)
348 StartMovePos = SelectedElement->getAbsolutePosition().UpperLeftCorner;
349
350 DragStart = p;
351 SelectedArea = SelectedElement->getAbsolutePosition();
352 }
353
354 if (CurrentMode < EGUIEDM_MOVE)
355 {
356 // selecting an element...
357 MouseOverElement = getEditableElementFromPoint(Parent, p);
358
359 if (MouseOverElement == Parent)
360 MouseOverElement = 0;
361
362 setSelectedElement(MouseOverElement);
363 }
364 }
365
366 break;
367 }
368 case EMIE_RMOUSE_PRESSED_DOWN:
369 if (CurrentMode == EGUIEDM_SELECT_NEW_PARENT || CurrentMode >= EGUIEDM_MOVE)
370 {
371 // cancel dragging
372 CurrentMode = EGUIEDM_SELECT;
373 }
374 else
375 {
376 DragStart = core::position2di(e.MouseInput.X,e.MouseInput.Y);
377 // root menu
378 IGUIContextMenu* mnu = Environment->addContextMenu(
379 core::rect<s32>(e.MouseInput.X, e.MouseInput.Y, e.MouseInput.Y+100, e.MouseInput.Y+100),this);
380 mnu->addItem(L"File",-1,true,true);
381 mnu->addItem(L"Edit",-1,true,true);
382 mnu->addItem(L"View",-1,true,true);
383 mnu->addItem(SelectedElement ? L"Add child" : L"Add" ,-1,true,true);
384
385 // file menu
386 IGUIContextMenu* sub = mnu->getSubMenu(0);
387 IGUIContextMenu* sub2 =0;
388
389 sub->addItem(L"New", MenuCommandStart + EGUIEDMC_FILE_NEW );
390 sub->addItem(L"Load...",MenuCommandStart + EGUIEDMC_FILE_LOAD);
391 sub->addItem(L"Save...",MenuCommandStart + EGUIEDMC_FILE_SAVE);
392
393 // edit menu
394 sub = mnu->getSubMenu(1);
395 sub->addItem(L"Cut (ctrl+x)", MenuCommandStart + EGUIEDMC_CUT_ELEMENT, (SelectedElement != 0));
396 sub->addItem(L"Copy (ctrl+c)", MenuCommandStart + EGUIEDMC_COPY_ELEMENT, (SelectedElement != 0));
397 sub->addItem(L"Paste (ctrl+v)", MenuCommandStart + EGUIEDMC_PASTE_ELEMENT,
398 (core::stringc(Environment->getOSOperator()->getTextFromClipboard()) != ""));
399 sub->addItem(L"Delete (del)", MenuCommandStart + EGUIEDMC_DELETE_ELEMENT, (SelectedElement != 0));
400 sub->addSeparator();
401 sub->addItem(L"Set parent", MenuCommandStart + EGUIEDMC_SET_PARENT, (SelectedElement != 0));
402 sub->addItem(L"Bring to front", MenuCommandStart + EGUIEDMC_BRING_TO_FRONT, (SelectedElement != 0));
403 sub->addSeparator();
404 sub->addItem(L"Save to XML...", MenuCommandStart + EGUIEDMC_SAVE_ELEMENT, (SelectedElement != 0));
405
406 sub = mnu->getSubMenu(2);
407 // view menu
408 if (EditorWindow)
409 sub->addItem(EditorWindow->isVisible() ? L"Hide window" : L"Show window", MenuCommandStart + EGUIEDMC_TOGGLE_EDITOR);
410
411 sub = mnu->getSubMenu(3);
412
413 s32 i,j,c=0;
414 sub->addItem(L"Default factory",-1,true, true);
415
416 // add elements from each factory
417 for (i=0; u32(i) < Environment->getRegisteredGUIElementFactoryCount(); ++i)
418 {
419 sub2 = sub->getSubMenu(i);
420
421 IGUIElementFactory *f = Environment->getGUIElementFactory(i);
422
423 for (j=0; j< f->getCreatableGUIElementTypeCount(); ++j)
424 {
425 sub2->addItem(core::stringw(f->getCreateableGUIElementTypeName(j)).c_str(), MenuCommandStart + EGUIEDMC_COUNT + c);
426 c++;
427 }
428
429 if (u32(i+1) < Environment->getRegisteredGUIElementFactoryCount())
430 {
431 core::stringw strFact;
432 strFact = L"Factory ";
433 strFact += i+1;
434 sub->addItem(strFact.c_str(),-1, true, true);
435 }
436 }
437 sub->addSeparator();
438 sub->addItem(L"From XML...", MenuCommandStart + EGUIEDMC_INSERT_XML);
439
440 // set focus to menu
441 Environment->setFocus(mnu);
442
443 }
444 break;
445 case EMIE_LMOUSE_LEFT_UP:
446
447 // make window visible again
448 if (EditorWindow)
449 EditorWindow->setVisible(true);
450 if (CurrentMode == EGUIEDM_SELECT_NEW_PARENT)
451 {
452 if (SelectedElement)
453 {
454 MouseOverElement = getEditableElementFromPoint(Parent,
455 core::position2di(e.MouseInput.X,e.MouseInput.Y));
456 if (MouseOverElement)
457 {
458 MouseOverElement->addChild(SelectedElement);
459 setSelectedElement(0);
460 setSelectedElement(SelectedElement);
461 }
462 }
463 CurrentMode = EGUIEDM_SELECT;
464 }
465 else if (CurrentMode >= EGUIEDM_MOVE)
466 {
467 IGUIElement *sel = SelectedElement;
468 // unselect
469 setSelectedElement(0);
470
471 // move
472 core::position2d<s32> p(0,0);
473 if (sel->getParent())
474 p = sel->getParent()->getAbsolutePosition().UpperLeftCorner;
475
476 sel->setRelativePosition(SelectedArea - p);
477
478 // select
479 setSelectedElement(sel);
480
481 // reset selection mode...
482 CurrentMode = EGUIEDM_SELECT;
483 }
484 break;
485 case EMIE_MOUSE_MOVED:
486 // always on top
487 Parent->bringToFront(this);
488
489 // if selecting
490 if (CurrentMode == EGUIEDM_SELECT || CurrentMode == EGUIEDM_SELECT_NEW_PARENT)
491 {
492
493 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
494
495 // highlight the element that the mouse is over
496 MouseOverElement = getEditableElementFromPoint(Parent, p);
497 if (MouseOverElement == Parent)
498 {
499 MouseOverElement = 0;
500 }
501
502 if (CurrentMode == EGUIEDM_SELECT)
503 {
504 MouseOverMode = getModeFromPos(p);
505 if (MouseOverMode > EGUIEDM_MOVE)
506 {
507 MouseOverElement = SelectedElement;
508 }
509 }
510 }
511 else if (CurrentMode == EGUIEDM_MOVE)
512 {
513 // get difference
514 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
515 p -= DragStart;
516
517 // apply to top corner
518 p = StartMovePos + p;
519 if (UseGrid)
520 {
521 p.X = (p.X/GridSize.Width)*GridSize.Width;
522 p.Y = (p.Y/GridSize.Height)*GridSize.Height;
523 }
524
525 SelectedArea += p - SelectedArea.UpperLeftCorner;
526 }
527 else if (CurrentMode > EGUIEDM_MOVE)
528 {
529 // get difference from start position
530 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
531 if (UseGrid)
532 {
533 p.X = (p.X/GridSize.Width)*GridSize.Width;
534 p.Y = (p.Y/GridSize.Height)*GridSize.Height;
535 }
536
537 switch(CurrentMode)
538 {
539 case EGUIEDM_RESIZE_T:
540 SelectedArea.UpperLeftCorner.Y = p.Y;
541 break;
542 case EGUIEDM_RESIZE_B:
543 SelectedArea.LowerRightCorner.Y = p.Y;
544 break;
545 case EGUIEDM_RESIZE_L:
546 SelectedArea.UpperLeftCorner.X = p.X;
547 break;
548 case EGUIEDM_RESIZE_R:
549 SelectedArea.LowerRightCorner.X = p.X;
550 break;
551 case EGUIEDM_RESIZE_TL:
552 SelectedArea.UpperLeftCorner = p;
553 break;
554 case EGUIEDM_RESIZE_TR:
555 SelectedArea.UpperLeftCorner.Y = p.Y;
556 SelectedArea.LowerRightCorner.X = p.X;
557 break;
558 case EGUIEDM_RESIZE_BL:
559 SelectedArea.UpperLeftCorner.X = p.X;
560 SelectedArea.LowerRightCorner.Y = p.Y;
561 break;
562 case EGUIEDM_RESIZE_BR:
563 SelectedArea.LowerRightCorner = p;
564 break;
565 default:
566 break;
567 }
568 }
569
570 break;
571 default:
572 break;
573 }
574 break;
575
576 case EET_GUI_EVENT:
577 switch(e.GUIEvent.EventType)
578 {
579 case EGET_TREEVIEW_NODE_SELECT:
580 {
581 IGUITreeViewNode* eventnode = ((IGUITreeView*)e.GUIEvent.Caller)->getLastEventNode();
582 if(!eventnode->isRoot())
583 setSelectedElement((IGUIElement*)(eventnode->getData()));
584 break;
585 }
586 // load a gui file
587 case EGET_FILE_SELECTED:
588 dialog = (IGUIFileOpenDialog*)e.GUIEvent.Caller;
589 Environment->loadGUI(core::stringc(dialog->getFileName()).c_str());
590 break;
591
592 case EGET_MENU_ITEM_SELECTED:
593 {
594 IGUIContextMenu *menu = (IGUIContextMenu*)e.GUIEvent.Caller;
595 s32 cmdID = menu->getItemCommandId(menu->getSelectedItem()) - MenuCommandStart;
596
597 IGUIElement* el;
598
599 switch(cmdID)
600 {
601
602 //! file commands
603 case EGUIEDMC_FILE_NEW:
604 // clear all elements belonging to our parent
605 setSelectedElement(0);
606 MouseOverElement = 0;
607 el = Parent;
608 grab();
609 // remove all children
610 while(Children.end() != el->getChildren().begin())
611 el->removeChild(*(el->getChildren().begin()));
612 // attach to parent again
613 el->addChild(this);
614 drop();
615
616 break;
617 case EGUIEDMC_FILE_LOAD:
618 Environment->addFileOpenDialog(L"Please select a GUI file to open", false, this);
619 break;
620 case EGUIEDMC_FILE_SAVE:
621 Environment->saveGUI("guiTest.xml");
622 break;
623
624 //! edit menu
625 case EGUIEDMC_CUT_ELEMENT:
626 {
627 CopySelectedElementXML();
628 // delete element
629 el = SelectedElement;
630 setSelectedElement(0);
631 MouseOverElement = 0;
632 el->remove();
633 break;
634 }
635 case EGUIEDMC_COPY_ELEMENT:
636 CopySelectedElementXML();
637 break;
638 case EGUIEDMC_PASTE_ELEMENT:
639 PasteXMLToSelectedElement();
640 break;
641 case EGUIEDMC_DELETE_ELEMENT:
642 el = SelectedElement;
643 setSelectedElement(0);
644 MouseOverElement = 0;
645 el->remove();
646 break;
647 case EGUIEDMC_SET_PARENT:
648 CurrentMode = EGUIEDM_SELECT_NEW_PARENT;
649 break;
650 case EGUIEDMC_BRING_TO_FRONT:
651 if (SelectedElement->getParent())
652 SelectedElement->getParent()->bringToFront(SelectedElement);
653 break;
654
655 case EGUIEDMC_SAVE_ELEMENT:
656 //TODO: add 'save' dialog.
657 Environment->saveGUI("guiTest.xml", SelectedElement ? SelectedElement : Environment->getRootGUIElement() );
658 break;
659
660 //! toggle edit window
661 case EGUIEDMC_TOGGLE_EDITOR:
662 break;
663
664 case EGUIEDMC_INSERT_XML:
665 Environment->loadGUI("guiTest.xml", SelectedElement ? SelectedElement : Environment->getRootGUIElement() );
666 break;
667
668 default:
669 // create element from factory?
670 if (cmdID >= EGUIEDMC_COUNT)
671 {
672
673 s32 num = cmdID - EGUIEDMC_COUNT; // get index
674 // loop through all factories
675 s32 i, c=Environment->getRegisteredGUIElementFactoryCount();
676 for (i=0; i<c && num > Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount(); ++i)
677 {
678 num -= Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount();
679 }
680 if (num < Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount() )
681 {
682 core::stringc name = Environment->getGUIElementFactory(i)->getCreateableGUIElementTypeName(num);
683 IGUIElement *parentElement = SelectedElement ? SelectedElement : Environment->getRootGUIElement();
684 // add it
685 IGUIElement *newElement = Environment->getGUIElementFactory(i)->addGUIElement(name.c_str(),parentElement);
686 if (newElement)
687 {
688 core::position2di p = DragStart - parentElement->getAbsolutePosition().UpperLeftCorner;
689 newElement->setRelativePosition(core::rect<s32>(p,p+core::position2di(100,100)));
690 //Environment->removeFocus(newElement);
691 }
692 }
693 }
694 break;
695 }
696 EditorWindow->updateTree();
697 }
698 return true;
699 default:
700 break;
701 }
702 break;
703
704 default:
705 break;
706 }
707
708 // even if we didn't absorb the event,
709 // we never pass events back to the GUI we're editing!
710 return false;
711}
712
713
714//! draws the element and its children
715void CGUIEditWorkspace::draw()
716{
717 video::IVideoDriver *driver = Environment->getVideoDriver();
718
719 if (DrawGrid)
720 {
721 // draw the grid
722
723 core::rect<s32> r = getAbsolutePosition();
724
725 s32 cy = r.UpperLeftCorner.Y;
726 while (cy < r.LowerRightCorner.Y)
727 {
728 s32 cx = r.UpperLeftCorner.X;
729 while (cx < r.LowerRightCorner.X)
730 {
731 driver->draw2DRectangle(video::SColor(40,0,0,90),core::rect<s32>(cx+1,cy+1,GridSize.Width+cx,GridSize.Height+cy));
732 cx += GridSize.Width;
733 }
734 cy += GridSize.Height;
735 }
736 }
737 if (MouseOverElement &&
738 MouseOverElement != SelectedElement &&
739 MouseOverElement != Parent)
740 {
741 core::rect<s32> r = MouseOverElement->getAbsolutePosition();
742 driver->draw2DRectangle(video::SColor(100,0,0,255), r);
743 }
744 if (SelectedElement && CurrentMode == EGUIEDM_SELECT)
745 {
746 driver->draw2DRectangle(video::SColor(100,0,255,0),SelectedElement->getAbsolutePosition());
747 }
748 if (CurrentMode >= EGUIEDM_MOVE)
749 {
750 driver->draw2DRectangle(video::SColor(100,255,0,0),SelectedArea);
751 }
752
753 if ( (SelectedElement && CurrentMode >= EGUIEDM_MOVE) ||
754 (SelectedElement && MouseOverElement == SelectedElement && MouseOverMode >= EGUIEDM_MOVE) )
755 {
756 // draw handles for moving
757 EGUIEDIT_MODE m = CurrentMode;
758 core::rect<s32> r = SelectedArea;
759 if (m < EGUIEDM_MOVE)
760 {
761 m = MouseOverMode;
762 r = SelectedElement->getAbsolutePosition();
763 }
764
765 core::position2di d = core::position2di(4,4);
766
767 TLRect = core::rect<s32>(r.UpperLeftCorner, r.UpperLeftCorner + d );
768 TRRect = core::rect<s32>(r.LowerRightCorner.X-4, r.UpperLeftCorner.Y, r.LowerRightCorner.X, r.UpperLeftCorner.Y+4);
769 TopRect = core::rect<s32>(r.getCenter().X-2, r.UpperLeftCorner.Y,r.getCenter().X+2, r.UpperLeftCorner.Y+4 );
770 BLRect = core::rect<s32>(r.UpperLeftCorner.X, r.LowerRightCorner.Y-4, r.UpperLeftCorner.X+4, r.LowerRightCorner.Y);
771 LRect = core::rect<s32>(r.UpperLeftCorner.X,r.getCenter().Y-2, r.UpperLeftCorner.X+4, r.getCenter().Y+2 );
772 RRect = core::rect<s32>(r.LowerRightCorner.X-4,r.getCenter().Y-2, r.LowerRightCorner.X, r.getCenter().Y+2 );
773 BRRect = core::rect<s32>(r.LowerRightCorner-d, r.LowerRightCorner);
774 BRect = core::rect<s32>(r.getCenter().X-2, r.LowerRightCorner.Y-4,r.getCenter().X+2, r.LowerRightCorner.Y );
775
776 // top left
777 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_RESIZE_L || m == EGUIEDM_RESIZE_TL || m == EGUIEDM_MOVE )
778 driver->draw2DRectangle(video::SColor(100,255,255,255), TLRect);
779
780 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_RESIZE_R || m == EGUIEDM_RESIZE_TR || m == EGUIEDM_MOVE )
781 driver->draw2DRectangle(video::SColor(100,255,255,255), TRRect);
782
783 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_MOVE )
784 driver->draw2DRectangle(video::SColor(100,255,255,255), TopRect);
785
786 if (m == EGUIEDM_RESIZE_L || m == EGUIEDM_RESIZE_BL || m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
787 driver->draw2DRectangle(video::SColor(100,255,255,255), BLRect);
788
789 if (m == EGUIEDM_RESIZE_L || m == EGUIEDM_MOVE )
790 driver->draw2DRectangle(video::SColor(100,255,255,255), LRect);
791
792 if (m == EGUIEDM_RESIZE_R || m == EGUIEDM_MOVE )
793 driver->draw2DRectangle(video::SColor(100,255,255,255), RRect);
794
795 if (m == EGUIEDM_RESIZE_R || m == EGUIEDM_RESIZE_BR || m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
796 driver->draw2DRectangle(video::SColor(100,255,255,255), BRRect );
797
798 if (m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
799 driver->draw2DRectangle(video::SColor(100,255,255,255), BRect);
800
801
802 }
803
804 IGUIElement::draw();
805}
806
807
808void CGUIEditWorkspace::setDrawGrid(bool drawGrid)
809{
810 DrawGrid = drawGrid;
811}
812
813void CGUIEditWorkspace::setGridSize(const core::dimension2di& gridSize)
814{
815 GridSize = gridSize;
816 if (GridSize.Width < 2)
817 GridSize.Width = 2;
818 if (GridSize.Height < 2)
819 GridSize.Height = 2;
820}
821
822void CGUIEditWorkspace::setUseGrid(bool useGrid)
823{
824 UseGrid = useGrid;
825}
826
827
828//! Removes a child.
829void CGUIEditWorkspace::removeChild(IGUIElement* child)
830{
831 IGUIElement::removeChild(child);
832
833 if (Children.empty())
834 remove();
835}
836
837
838void CGUIEditWorkspace::updateAbsolutePosition()
839{
840 core::rect<s32> parentRect(0,0,0,0);
841
842 if (Parent)
843 {
844 parentRect = Parent->getAbsolutePosition();
845 RelativeRect.UpperLeftCorner.X = 0;
846 RelativeRect.UpperLeftCorner.Y = 0;
847 RelativeRect.LowerRightCorner.X = parentRect.getWidth();
848 RelativeRect.LowerRightCorner.Y = parentRect.getHeight();
849 }
850
851 IGUIElement::updateAbsolutePosition();
852}
853
854void CGUIEditWorkspace::CopySelectedElementXML()
855{
856 core::stringc XMLText;
857 core::stringw wXMLText;
858 // create memory write file
859 io::CMemoryReadWriteFile* memWrite = new io::CMemoryReadWriteFile("#Clipboard#");
860 // save gui to mem file
861 io::IXMLWriter* xml = Environment->getFileSystem()->createXMLWriter(memWrite);
862 Environment->writeGUIElement(xml, SelectedElement);
863
864 // copy to clipboard- wide chars not supported yet :(
865 wXMLText = (wchar_t*)&memWrite->getData()[0];
866 u32 i = memWrite->getData().size()/sizeof(wchar_t);
867 if (wXMLText.size() > i)
868 wXMLText[i] = L'\0';
869 XMLText = wXMLText.c_str();
870 memWrite->drop();
871 xml->drop();
872 Environment->getOSOperator()->copyToClipboard(XMLText.c_str());
873}
874
875void CGUIEditWorkspace::PasteXMLToSelectedElement()
876{
877 // get clipboard data
878 core::stringc XMLText = Environment->getOSOperator()->getTextFromClipboard();
879 // convert to stringw
880 core::stringw wXMLText = XMLText.c_str();
881
882 io::CMemoryReadWriteFile* memWrite = new io::CMemoryReadWriteFile("#Clipboard#");
883
884 io::IXMLWriter* xmlw = Environment->getFileSystem()->createXMLWriter(memWrite);
885 xmlw->writeXMLHeader(); // it needs one of those
886 xmlw->drop();
887
888 // write clipboard data
889 memWrite->write((void*)&wXMLText[0], wXMLText.size() * sizeof(wchar_t));
890
891 // rewind file
892 memWrite->seek(0, false);
893
894 // read xml
895 Environment->loadGUI(memWrite, SelectedElement);
896
897 // reset focus
898 Environment->setFocus(this);
899
900 // drop the read file
901 memWrite->drop();
902}
903
904void CGUIEditWorkspace::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options)
905{
906 out->addBool("DrawGrid", DrawGrid);
907 out->addBool("UseGrid", UseGrid);
908 out->addPosition2d("GridSize", core::position2di(GridSize.Width, GridSize.Height));
909 out->addInt("MenuCommandStart", MenuCommandStart);
910}
911
912void CGUIEditWorkspace::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
913{
914 setDrawGrid(in->getAttributeAsBool("DrawGrid"));
915 setUseGrid(in->getAttributeAsBool("UseGrid"));
916
917 core::position2di tmpp = in->getAttributeAsPosition2d("GridSize");
918 core::dimension2di tmpd(tmpp.X, tmpp.Y);
919 setGridSize(tmpd);
920 setMenuCommandIDStart(in->getAttributeAsInt("MenuCommandStart"));
921}
922
923
924} // end namespace gui
925} // end namespace irr
926
927
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h
new file mode 100644
index 0000000..3f21258
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h
@@ -0,0 +1,168 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUIEDIT_WORKSPACE_H_INCLUDED__
6#define __C_GUIEDIT_WORKSPACE_H_INCLUDED__
7
8#include "IGUIElement.h"
9#include "CGUIEditWindow.h"
10#include "EGUIEditTypes.h"
11
12namespace irr
13{
14namespace gui
15{
16
17 //! Adding the GUI Editor Workspace to an element allows you
18 /** to create, edit, load and save any elements supported
19 by any loaded factories.
20 When you add it without a parent (to the root element)
21 it will also allow you to edit, load and save settings in
22 the current skin.
23 */
24
25 // custom events
26 enum EGUIEDIT_CUSTOM_EVENTS
27 {
28 EGUIEDCE_ATTRIB_EDITOR = MAKE_IRR_ID('g','A','t','t'),
29 EGUIEDCE_OPTION_EDITOR = MAKE_IRR_ID('g','O','p','t'),
30 EGUIEDCE_ENV_EDITOR = MAKE_IRR_ID('g','E','n','v')
31 };
32
33 class CGUIEditWorkspace : public IGUIElement
34 {
35 public:
36
37 //! constructor
38 CGUIEditWorkspace(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0);
39
40 //! destructor
41 ~CGUIEditWorkspace();
42
43 //! called if an event happened.
44 virtual bool OnEvent(const SEvent &event);
45
46 //! Removes a child.
47 virtual void removeChild(IGUIElement* child);
48
49 //! draws the element and its children
50 virtual void draw();
51
52 //! Updates the absolute position.
53 virtual void updateAbsolutePosition();
54
55 //! Sets the menu command id's
56 /** The GUI editor defaults to command ID's from 0xED17 to 0xED17+EGUIEDMC_COUNT
57 In the rare case that these are already in use and you wish to use menus
58 while the editor is present you can set a new offset here.
59 */
60 virtual void setMenuCommandIDStart(s32 id);
61
62 //! grid drawing...
63 virtual void setDrawGrid(bool drawGrid);
64 virtual void setGridSize(const core::dimension2di& gridSize);
65 virtual void setUseGrid(bool useGrid);
66
67 //! returns the first editable element under the mouse
68 virtual IGUIElement* getEditableElementFromPoint(IGUIElement *start, const core::position2di &point, s32 index=0 );
69
70 //! selecting elements
71 virtual void setSelectedElement(IGUIElement *sel);
72 virtual void selectNextSibling();
73 virtual void selectPreviousSibling();
74
75 //! returns the selected element
76 virtual IGUIElement* getSelectedElement();
77
78 //! copies the xml of the selected element and all children to the clipboard
79 virtual void CopySelectedElementXML();
80
81 //! copies the xml of the selected element and all children to the clipboard
82 virtual void PasteXMLToSelectedElement();
83
84 virtual const c8* getTypeName() const
85 {
86 return GUIEditElementTypeNames[EGUIEDIT_GUIEDIT];
87 }
88
89 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
90 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
91
92 private:
93
94 enum EGUIEDIT_MODE
95 {
96 // when we are currently selecting an element
97 EGUIEDM_SELECT=0,
98 // selecting a new parent for the selected element
99 EGUIEDM_SELECT_NEW_PARENT,
100
101 // moving the selected element
102 EGUIEDM_MOVE,
103 // resizing the selected element
104 EGUIEDM_RESIZE_TL,
105 EGUIEDM_RESIZE_T,
106 EGUIEDM_RESIZE_TR,
107 EGUIEDM_RESIZE_R,
108 EGUIEDM_RESIZE_BR,
109 EGUIEDM_RESIZE_B,
110 EGUIEDM_RESIZE_BL,
111 EGUIEDM_RESIZE_L
112 };
113
114 enum EGUIEDIT_MENUCOMMANDS
115 {
116 //! file commands
117 EGUIEDMC_FILE_NEW,
118 EGUIEDMC_FILE_LOAD,
119 EGUIEDMC_FILE_SAVE,
120 //! edit menu
121 EGUIEDMC_CUT_ELEMENT,
122 EGUIEDMC_COPY_ELEMENT,
123 EGUIEDMC_PASTE_ELEMENT,
124 EGUIEDMC_DELETE_ELEMENT,
125 EGUIEDMC_SET_PARENT,
126 EGUIEDMC_BRING_TO_FRONT,
127 EGUIEDMC_SAVE_ELEMENT,
128 //! grid
129 EGUIEDMC_TOGGLE_EDITOR,
130
131 EGUIEDMC_INSERT_XML,
132
133 //! number of menu options
134 EGUIEDMC_COUNT
135 };
136
137 EGUIEDIT_MODE getModeFromPos(core::position2di p);
138
139 EGUIEDIT_MODE CurrentMode;
140 EGUIEDIT_MODE MouseOverMode;
141 core::position2di DragStart;
142 core::position2di StartMovePos;
143 core::rect<s32> SelectedArea;
144
145 core::dimension2di GridSize;
146 s32 MenuCommandStart;
147 bool DrawGrid, UseGrid;
148
149 IGUIElement *MouseOverElement,
150 *SelectedElement;
151 CGUIEditWindow *EditorWindow;
152
153 core::rect<s32> TLRect;
154 core::rect<s32> TRRect;
155 core::rect<s32> TopRect;
156 core::rect<s32> BLRect;
157 core::rect<s32> LRect;
158 core::rect<s32> RRect;
159 core::rect<s32> BRRect;
160 core::rect<s32> BRect;
161 };
162
163
164} // end namespace gui
165} // end namespace irr
166
167#endif
168
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h
new file mode 100644
index 0000000..9e3958d
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h
@@ -0,0 +1,114 @@
1#ifndef __C_GUI_ENUM_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_ENUM_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIComboBox.h"
6#include "IGUIEditBox.h"
7#include "EGUIEditTypes.h"
8
9namespace irr
10{
11namespace gui
12{
13
14 class CGUIEnumAttribute : public CGUIAttribute
15 {
16 public:
17 //
18 CGUIEnumAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
19 CGUIAttribute(environment, parent, myParentID),
20 AttribComboBox(0), AttribEditBox(0)
21 {
22
23 }
24
25 virtual ~CGUIEnumAttribute()
26 {
27 if (AttribComboBox)
28 AttribComboBox->drop();
29 if (AttribEditBox)
30 AttribEditBox->drop();
31 }
32
33 // save the attribute and possibly post the event to its parent
34 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
35 {
36
37 if (AttribComboBox)
38 {
39 AttribComboBox->remove();
40 AttribComboBox->drop();
41 AttribComboBox = 0;
42 }
43
44 if (AttribEditBox)
45 {
46 AttribEditBox->remove();
47 AttribEditBox->drop();
48 AttribEditBox = 0;
49 }
50
51 core::array<core::stringc> outLiterals;
52 attribs->getAttributeEnumerationLiteralsOfEnumeration(attribIndex, outLiterals);
53
54 core::rect<s32> r = getAbsolutePosition();
55 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
56 r.getWidth() - 5,
57 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 20 );
58
59 if (outLiterals.size() > 0)
60 {
61 AttribComboBox = Environment->addComboBox(r2, this, -1);
62 for (u32 i=0; i<outLiterals.size(); ++i)
63 AttribComboBox->addItem( core::stringw(outLiterals[i].c_str()).c_str());
64
65 AttribComboBox->setSelected( attribs->getAttributeAsInt(attribIndex) );
66
67 AttribComboBox->grab();
68 AttribComboBox->setSubElement(true);
69 AttribComboBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
70 }
71 else
72 {
73
74 AttribEditBox = Environment->addEditBox(
75 attribs->getAttributeAsStringW(attribIndex).c_str(),
76 r2, true, this, -1);
77 AttribEditBox->grab();
78 AttribEditBox->setSubElement(true);
79 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
80 }
81
82 CGUIAttribute::setAttrib(attribs, attribIndex);
83 }
84
85 //! save the attribute and possibly post the event to its parent
86 virtual bool updateAttrib(bool sendEvent=true)
87 {
88 if (!Attribs)
89 return true;
90
91 if (AttribComboBox)
92 Attribs->setAttribute(Index, AttribComboBox->getText());
93 else if (AttribEditBox)
94 Attribs->setAttribute(Index, AttribEditBox->getText());
95
96 return CGUIAttribute::updateAttrib(sendEvent);
97 }
98
99 //! Returns the type name of the gui element.
100 virtual const c8* getTypeName() const
101 {
102 return GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE];
103 }
104
105 private:
106 IGUIComboBox* AttribComboBox;
107 IGUIEditBox* AttribEditBox;
108 };
109
110} // namespace gui
111} // namespace irr
112
113#endif
114
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp
new file mode 100644
index 0000000..4135b7a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp
@@ -0,0 +1,340 @@
1// Copyright 2006-2012 Asger Feldthaus
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5/*
6 Originally Klasker's but I've messed around with it lots - Gaz
7*/
8
9#include "CGUIPanel.h"
10#include "IGUIEnvironment.h"
11#include "IGUIScrollBar.h"
12#include "IGUITabControl.h"
13#include "IVideoDriver.h"
14
15const int SCROLL_BAR_SIZE = 16; // Scroll bars are 16 pixels wide
16const int BORDER_WIDTH = 2;
17
18namespace irr
19{
20namespace gui
21{
22
23CGUIPanel::CGUIPanel(IGUIEnvironment* environment, IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
24 bool border, E_SCROLL_BAR_MODE vMode, E_SCROLL_BAR_MODE hMode)
25 : IGUIElement(EGUIET_ELEMENT, environment, parent, id, rectangle),
26 VScrollBar(0), HScrollBar(0), ClipPane(0), InnerPane(0),
27 VScrollBarMode(vMode), HScrollBarMode(hMode), NeedsUpdate(true), Border(border)
28{
29 #ifdef _DEBUG
30 setDebugName("CGUIPanel");
31 #endif
32
33 s32 width = rectangle.getWidth();
34 s32 height = rectangle.getHeight();
35
36 core::rect<s32> rct = core::rect<s32>(width - SCROLL_BAR_SIZE,0, width, height);
37
38 VScrollBar = environment->addScrollBar(false, rct, 0, id);
39 VScrollBar->setSubElement(true);
40 VScrollBar->setTabStop(false);
41 VScrollBar->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
42 VScrollBar->grab();
43 IGUIElement::addChild(VScrollBar);
44
45 rct = core::rect<s32>(0, height - SCROLL_BAR_SIZE, width - SCROLL_BAR_SIZE,height );
46
47 HScrollBar = environment->addScrollBar(true, rct, 0, id);
48 HScrollBar->setSubElement(true);
49 HScrollBar->setTabStop(false);
50 HScrollBar->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
51 HScrollBar->grab();
52 IGUIElement::addChild(HScrollBar);
53
54 rct = core::rect<s32>(0,0, width - SCROLL_BAR_SIZE, height - SCROLL_BAR_SIZE);
55
56 ClipPane = environment->addTab( rct, 0, -1);
57 ClipPane->setSubElement(true);
58 ClipPane->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
59 ClipPane->grab();
60 IGUIElement::addChild(ClipPane);
61
62 InnerPane = environment->addTab(rct, ClipPane, -1);
63 InnerPane->setSubElement(true);
64 InnerPane->grab();
65
66 calculateClientArea();
67 resizeInnerPane();
68}
69
70CGUIPanel::~CGUIPanel()
71{
72 // because the inner pane has the list of children, we need to remove the outer ones manually
73 IGUIElement::removeChild(VScrollBar);
74 IGUIElement::removeChild(HScrollBar);
75 IGUIElement::removeChild(ClipPane);
76
77 // now we can drop the others
78 VScrollBar->drop();
79 HScrollBar->drop();
80 ClipPane->drop();
81 InnerPane->drop();
82}
83
84
85void CGUIPanel::draw()
86{
87 if (NeedsUpdate)
88 {
89 calculateClientArea();
90 resizeInnerPane();
91 NeedsUpdate = false;
92 }
93
94 IGUISkin* skin = Environment->getSkin();
95 if (Border && skin)
96 {
97 skin->draw3DSunkenPane( this, skin->getColor( EGDC_APP_WORKSPACE), false, true, AbsoluteRect, &AbsoluteClippingRect );
98 }
99
100 IGUIElement::draw();
101}
102
103void CGUIPanel::addChild(IGUIElement *child)
104{
105 // add the child to the inner pane
106 InnerPane->addChild(child);
107
108 NeedsUpdate = true;
109}
110
111void CGUIPanel::removeChild(IGUIElement *child)
112{
113 InnerPane->removeChild(child);
114
115 NeedsUpdate = true;
116}
117
118//! returns children of the inner pane
119const core::list<IGUIElement*>& CGUIPanel::getChildren()
120{
121 return InnerPane->getChildren();
122}
123
124bool CGUIPanel::hasBorder() const
125{
126 return Border;
127}
128
129void CGUIPanel::setBorder( bool enabled )
130{
131 Border = enabled;
132}
133
134IGUIScrollBar* CGUIPanel::getVScrollBar() const
135{
136 return VScrollBar;
137}
138
139IGUIScrollBar* CGUIPanel::getHScrollBar() const
140{
141 return HScrollBar;
142}
143
144E_SCROLL_BAR_MODE CGUIPanel::getVScrollBarMode() const
145{
146 return VScrollBarMode;
147}
148
149void CGUIPanel::setVScrollBarMode( E_SCROLL_BAR_MODE mode )
150{
151 VScrollBarMode = mode;
152 NeedsUpdate = true;
153}
154
155E_SCROLL_BAR_MODE CGUIPanel::getHScrollBarMode() const
156{
157 return HScrollBarMode;
158}
159
160void CGUIPanel::setHScrollBarMode(E_SCROLL_BAR_MODE mode)
161{
162 HScrollBarMode = mode;
163 NeedsUpdate = true;
164}
165
166bool CGUIPanel::OnEvent(const SEvent &event)
167{
168 // Redirect mouse wheel to scrollbar
169 if (event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_MOUSE_WHEEL)
170 {
171 if (VScrollBar->isVisible())
172 {
173 Environment->setFocus(VScrollBar);
174 VScrollBar->OnEvent(event);
175 return true;
176 }
177 else if (VScrollBar->isVisible())
178 {
179 Environment->setFocus(HScrollBar);
180 HScrollBar->OnEvent(event);
181 return true;
182 }
183 }
184 else
185 {
186 if (event.EventType == EET_GUI_EVENT && event.GUIEvent.EventType == EGET_SCROLL_BAR_CHANGED &&
187 (event.GUIEvent.Caller == HScrollBar || event.GUIEvent.Caller == VScrollBar) )
188 {
189 moveInnerPane();
190
191 return true;
192 }
193 }
194
195 return IGUIElement::OnEvent(event);
196}
197
198void CGUIPanel::moveInnerPane()
199{
200 core::dimension2d<s32> dim = InnerPane->getAbsolutePosition().getSize();
201 core::position2d<s32> newpos(HScrollBar->isVisible() ? -HScrollBar->getPos() : 0 , VScrollBar->isVisible() ? -VScrollBar->getPos() : 0);
202 core::rect<s32> r(newpos, newpos + dim);
203 InnerPane->setRelativePosition(r);
204}
205
206
207void CGUIPanel::updateAbsolutePosition()
208{
209 IGUIElement::updateAbsolutePosition();
210 calculateClientArea();
211 resizeInnerPane();
212}
213
214
215void CGUIPanel::resizeInnerPane()
216{
217 if (!HScrollBar || !VScrollBar || !InnerPane || !ClipPane)
218 return;
219
220 // get outer pane size
221 core::rect<s32> outerRect = ClipPane->getRelativePosition();
222
223 // resize flexible children depending on outer pane
224 InnerPane->setRelativePosition(outerRect);
225
226 // get desired size (total size of all children)
227 core::rect<s32> totalRect(0, 0, 0, 0);
228
229 core::list<IGUIElement*>::ConstIterator it;
230
231 for (it = InnerPane->getChildren().begin();
232 it != InnerPane->getChildren().end(); ++it)
233 {
234 core::rect<s32> rct = (*it)->getRelativePosition();
235 totalRect.addInternalPoint(rct.UpperLeftCorner);
236 totalRect.addInternalPoint(rct.LowerRightCorner);
237 }
238
239 // move children if pane needs to grow
240 core::position2di adjustedMovement(0,0);
241
242 if (totalRect.UpperLeftCorner.X < 0)
243 adjustedMovement.X = -totalRect.UpperLeftCorner.X;
244 if (totalRect.UpperLeftCorner.Y < 0)
245 adjustedMovement.Y = -totalRect.UpperLeftCorner.Y;
246
247 if (adjustedMovement.X > 0 || adjustedMovement.Y > 0)
248 {
249 totalRect += adjustedMovement;
250
251 for (it = InnerPane->getChildren().begin();
252 it != InnerPane->getChildren().end(); ++it )
253 {
254 (*it)->move(adjustedMovement);
255 }
256 }
257
258 // make sure the inner pane is at least as big as the outer
259 if (totalRect.getWidth() < outerRect.getWidth())
260 {
261 totalRect.UpperLeftCorner.X = 0;
262 totalRect.LowerRightCorner.X = outerRect.getWidth();
263 }
264 if (totalRect.getHeight() < outerRect.getHeight())
265 {
266 totalRect.UpperLeftCorner.Y = 0;
267 totalRect.LowerRightCorner.Y = outerRect.getHeight();
268 }
269
270 InnerPane->setRelativePosition(totalRect);
271
272 // scrollbars
273 if ( HScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
274 (totalRect.getWidth() > outerRect.getWidth() || HScrollBarMode == ESBM_ALWAYS_VISIBLE) )
275 {
276 HScrollBar->setVisible(true);
277 HScrollBar->setMax(totalRect.getWidth() - outerRect.getWidth());
278 bringToFront(HScrollBar);
279 }
280 else
281 HScrollBar->setVisible(false);
282
283 if ( VScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
284 (totalRect.getHeight() > outerRect.getHeight() || VScrollBarMode == ESBM_ALWAYS_VISIBLE) )
285 {
286 VScrollBar->setVisible(true);
287 VScrollBar->setMax(totalRect.getHeight() - outerRect.getHeight());
288 bringToFront(VScrollBar);
289 }
290 else
291 VScrollBar->setVisible(false);
292
293 // move to adjust for scrollbar pos
294 moveInnerPane();
295}
296
297void CGUIPanel::calculateClientArea()
298{
299 core::rect<s32> ClientArea(0,0, AbsoluteRect.getWidth(),AbsoluteRect.getHeight());
300
301 if (VScrollBar->isVisible())
302 ClientArea.LowerRightCorner.X -= VScrollBar->getRelativePosition().getWidth();
303
304 if (HScrollBar->isVisible())
305 ClientArea.LowerRightCorner.Y -= HScrollBar->getRelativePosition().getHeight();
306
307 if (Border)
308 {
309 ClientArea.UpperLeftCorner += core::position2d<s32>( BORDER_WIDTH, BORDER_WIDTH );
310 ClientArea.LowerRightCorner -= core::position2d<s32>( BORDER_WIDTH, BORDER_WIDTH );
311 }
312
313 ClipPane->setRelativePosition(ClientArea);
314}
315
316core::rect<s32> CGUIPanel::getClientArea() const
317{
318 return ClipPane->getRelativePosition();
319}
320
321void CGUIPanel::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options)
322{
323 IGUIElement::serializeAttributes(out, options);
324
325 out->addBool("border", Border);
326 out->addEnum("horizontalScrollBar", HScrollBarMode, GUIScrollBarModeNames );
327 out->addEnum("verticalScrollBar", VScrollBarMode, GUIScrollBarModeNames );
328}
329
330void CGUIPanel::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
331{
332 IGUIElement::deserializeAttributes(in, options);
333
334 setBorder(in->getAttributeAsBool("border"));
335 setHScrollBarMode((E_SCROLL_BAR_MODE)in->getAttributeAsEnumeration("horizontalScrollBar", GUIScrollBarModeNames));
336 setVScrollBarMode((E_SCROLL_BAR_MODE)in->getAttributeAsEnumeration("verticalScrollBar", GUIScrollBarModeNames));
337}
338
339} // namespace gui
340} // namespace irr
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h
new file mode 100644
index 0000000..cb6f79a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h
@@ -0,0 +1,128 @@
1// Copyright 2006-2012 Asger Feldthaus
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef _C_GUI_PANEL_H_
6#define _C_GUI_PANEL_H_
7
8#include "IGUIElement.h"
9#include "EGUIEditTypes.h"
10
11namespace irr
12{
13namespace gui
14{
15
16class IGUIScrollBar;
17class IGUITab;
18
19enum E_SCROLL_BAR_MODE
20{
21 //! The scrollbar will only show up when needed.
22 ESBM_AUTOMATIC = 0,
23
24 //! The scrollbar will never be visible.
25 ESBM_ALWAYS_INVISIBLE,
26
27 //! The scrollbar will always the visible.
28 ESBM_ALWAYS_VISIBLE,
29
30 //! just a count of how many are in this enum
31 ESBM_COUNT
32};
33
34const c8* const GUIScrollBarModeNames[] =
35{
36 "automatic",
37 "alwaysInvisible",
38 "alwaysVisible",
39 0
40};
41
42class CGUIPanel : public IGUIElement
43{
44public:
45 CGUIPanel( IGUIEnvironment* environment, IGUIElement* parent, s32 id=-1,
46 const core::rect<s32>& rectangle = core::rect<s32>(0,0,100,100),
47 bool border=false,
48 E_SCROLL_BAR_MODE vMode=ESBM_AUTOMATIC,
49 E_SCROLL_BAR_MODE hMode=ESBM_ALWAYS_INVISIBLE );
50
51 virtual ~CGUIPanel();
52
53 //! draws the panel and its children
54 virtual void draw();
55
56 //! returns true if it has a border, false if not
57 bool hasBorder() const;
58
59 //! sets whether the element draws a border
60 void setBorder(bool enabled);
61
62 //! returns a pointer to the vertical scrollbar
63 IGUIScrollBar* getVScrollBar() const;
64
65 //! returns a pointer to the horizontal scrollbar
66 IGUIScrollBar* getHScrollBar() const;
67
68 //! returns the vertical scrollbar visibility rule
69 E_SCROLL_BAR_MODE getVScrollBarMode() const;
70
71 //! sets the vertical scrollbar visibility rule
72 void setVScrollBarMode(E_SCROLL_BAR_MODE mode);
73
74 //! returns the horizontal scrollbar visibility rule
75 E_SCROLL_BAR_MODE getHScrollBarMode() const;
76
77 //! sets the horizontal scrollbar visibility rule
78 void setHScrollBarMode(E_SCROLL_BAR_MODE mode);
79
80 //! returns the visible area inside the panel, excluding scrollbar and border
81 core::rect<s32> getClientArea() const;
82
83 virtual bool OnEvent(const SEvent &event);
84
85 //! adds a child to the panel
86 virtual void addChild(IGUIElement* child);
87
88 //! removes a child from the panel
89 virtual void removeChild(IGUIElement* child);
90
91 //! updates the absolute position
92 virtual void updateAbsolutePosition();
93
94 //! returns children of the inner pane
95 virtual const core::list<IGUIElement*>& getChildren();
96
97 //! Returns the type name of the gui element.
98 virtual const c8* getTypeName() const
99 {
100 return GUIEditElementTypeNames[EGUIEDIT_GUIPANEL];
101 }
102
103 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
104 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
105
106protected:
107 void moveInnerPane();
108 void resizeInnerPane();
109 void calculateClientArea();
110
111private:
112
113 IGUIScrollBar* VScrollBar;
114 IGUIScrollBar* HScrollBar;
115 IGUITab* ClipPane;
116 IGUITab* InnerPane;
117
118 E_SCROLL_BAR_MODE VScrollBarMode;
119 E_SCROLL_BAR_MODE HScrollBarMode;
120
121 bool NeedsUpdate;
122 bool Border;
123};
124
125} // namespace gui
126} // namespace irr
127
128#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h
new file mode 100644
index 0000000..af9ac03
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h
@@ -0,0 +1,70 @@
1#ifndef __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIEditBox.h"
6#include "EGUIEditTypes.h"
7
8namespace irr
9{
10namespace gui
11{
12
13 class CGUIStringAttribute : public CGUIAttribute
14 {
15 public:
16 //
17 CGUIStringAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
18 CGUIAttribute(environment, parent, myParentID),
19 AttribEditBox(0)
20 {
21 core::rect<s32> r = getAbsolutePosition();
22 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
23 r.getWidth() - 5,
24 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 15 );
25
26 AttribEditBox = environment->addEditBox(0, r2, true, this, -1);
27 AttribEditBox->grab();
28 AttribEditBox->setSubElement(true);
29 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
30
31 }
32
33 virtual ~CGUIStringAttribute()
34 {
35 if (AttribEditBox)
36 AttribEditBox->drop();
37 }
38
39 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
40 {
41 AttribEditBox->setText(attribs->getAttributeAsStringW(attribIndex).c_str());
42 CGUIAttribute::setAttrib(attribs, attribIndex);
43 }
44
45 //! save the attribute and possibly post the event to its parent
46 virtual bool updateAttrib(bool sendEvent=true)
47 {
48 if (!Attribs)
49 return true;
50
51 Attribs->setAttribute(Index, AttribEditBox->getText());
52 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
53
54 return CGUIAttribute::updateAttrib(sendEvent);
55 }
56
57 //! Returns the type name of the gui element.
58 virtual const c8* getTypeName() const
59 {
60 return GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE];
61 }
62
63 private:
64 IGUIEditBox* AttribEditBox;
65 };
66
67} // namespace gui
68} // namespace irr
69
70#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h
new file mode 100644
index 0000000..6a4fef2
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h
@@ -0,0 +1,140 @@
1#ifndef __C_GUI_TEXTURE_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_TEXTURE_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIEditBox.h"
6#include "IGUIImage.h"
7#include "IGUIButton.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14
15 class CGUITextureAttribute : public CGUIAttribute
16 {
17 public:
18 //
19 CGUITextureAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
20 CGUIAttribute(environment, parent, myParentID),
21 AttribEditBox(0), AttribImage(0), AttribButton(0)
22 {
23 IGUISkin* skin = Environment->getSkin();
24
25 core::rect<s32> r = getAbsolutePosition();
26 s32 topy = skin->getFont()->getDimension(L"A").Height + 10;
27 s32 h = skin->getFont()->getDimension(L"A").Height + 5;
28
29 AttribImage = environment->addImage(0, core::position2di(0, topy), false, this);
30 AttribImage->setRelativePosition( core::rect<s32>(0,topy, r.getWidth() - 5, 100+topy));
31 AttribImage->grab();
32 AttribImage->setSubElement(true);
33 AttribImage->setScaleImage(true);
34 AttribImage->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
35
36 topy += 105;
37
38 core::rect<s32> r2(0, topy, r.getWidth() - 15 - skin->getSize(EGDS_CHECK_BOX_WIDTH), topy + h);
39 core::rect<s32> br(r.getWidth() - 10 - skin->getSize(EGDS_CHECK_BOX_WIDTH), topy, r.getWidth(), topy + h);
40
41 AttribEditBox = environment->addEditBox(0, r2, true, this, -1);
42 AttribEditBox->grab();
43 AttribEditBox->setSubElement(true);
44 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45
46 AttribButton = environment->addButton(br, this, -1, L"...");
47 AttribButton->grab();
48 AttribButton->setSubElement(true);
49 AttribButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
50 //AttribButton->setSpriteBank(skin->getSpriteBank());
51 //AttribButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_FILE), skin->getColor(EGDC_WINDOW_SYMBOL));
52 //AttribButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_FILE), skin->getColor(EGDC_WINDOW_SYMBOL), true);
53 }
54
55 virtual ~CGUITextureAttribute()
56 {
57 if (AttribEditBox)
58 AttribEditBox->drop();
59 if (AttribImage)
60 AttribImage->drop();
61 if (AttribButton)
62 AttribButton->drop();
63 }
64
65 virtual bool OnEvent(const SEvent &e)
66 {
67
68 if (IsEnabled)
69 {
70 switch (e.EventType)
71 {
72 case EET_GUI_EVENT:
73 switch (e.GUIEvent.EventType)
74 {
75 case EGET_BUTTON_CLICKED:
76 // button click: open file dialog
77 if (e.GUIEvent.Caller == AttribButton)
78 {
79 //Environment->addGUIElement("textureBrowser", Environment->getRootGUIElement());
80 return true;
81 }
82 break;
83 case EGET_FILE_SELECTED:
84 // file selected: change editbox value and set event
85
86 return true;
87 case EGET_FILE_CHOOSE_DIALOG_CANCELLED:
88
89 return true;
90 default:
91 break;
92 }
93 break;
94 case EET_KEY_INPUT_EVENT:
95 return true;
96 default:
97 break;
98 }
99 }
100 return CGUIAttribute::OnEvent(e);
101 }
102
103 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
104 {
105 AttribEditBox->setText(attribs->getAttributeAsStringW(attribIndex).c_str());
106 AttribImage->setImage(attribs->getAttributeAsTexture(Index));
107
108 CGUIAttribute::setAttrib(attribs, attribIndex);
109 }
110
111 //! save the attribute and possibly post the event to its parent
112 virtual bool updateAttrib(bool sendEvent=true)
113 {
114 if (!Attribs)
115 return true;
116
117 Attribs->setAttribute(Index, AttribEditBox->getText());
118 core::stringw tmp = Attribs->getAttributeAsStringW(Index);
119 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
120 AttribImage->setImage(Attribs->getAttributeAsTexture(Index));
121
122 return CGUIAttribute::updateAttrib(sendEvent);
123 }
124
125 //! Returns the type name of the gui element.
126 virtual const c8* getTypeName() const
127 {
128 return GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE];
129 }
130
131 private:
132 IGUIEditBox* AttribEditBox;
133 IGUIImage* AttribImage;
134 IGUIButton* AttribButton;
135 };
136
137} // namespace gui
138} // namespace irr
139
140#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp
new file mode 100644
index 0000000..bac5233
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp
@@ -0,0 +1,336 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#include "CGUITextureCacheBrowser.h"
6#include "IGUIEnvironment.h"
7#include "IGUIButton.h"
8#include "IGUISkin.h"
9#include "IGUIFont.h"
10#include "IVideoDriver.h"
11
12namespace irr
13{
14namespace gui
15{
16
17CGUITextureCacheBrowser::CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id, IGUIElement *parent)
18: IGUIWindow(environment, parent, id, core::rect<s32>(0,0,300,200)),
19 CloseButton(0), Panel(0), SelectedTexture(-1), Dragging(false), IsDraggable(true)
20{
21 #ifdef _DEBUG
22 setDebugName("CGUITextureCacheBrowser");
23 #endif
24
25 IGUISkin* skin = 0;
26 IGUISpriteBank* sprites = 0;
27 video::SColor color(255,255,255,255);
28
29 if (environment)
30 skin = environment->getSkin();
31
32 s32 buttonw = 15;
33 if (skin)
34 {
35 buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
36 sprites = skin->getSpriteBank();
37 color = skin->getColor(EGDC_WINDOW_SYMBOL);
38 }
39 s32 posx = RelativeRect.getWidth() - buttonw - 4;
40
41 CloseButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
42 L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close" );
43 CloseButton->setSubElement(true);
44 CloseButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45 if (sprites)
46 {
47 CloseButton->setSpriteBank(sprites);
48 CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
49 CloseButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_CLOSE), color);
50 }
51
52 CloseButton->grab();
53
54 // window title
55 Text = L"Texture Browser";
56
57 // panel element
58 Panel = new CGUIPanel(environment, this);
59 Panel->setRelativePosition( core::rect<s32>(1, buttonw + 5, 151, RelativeRect.getHeight() - 1));
60 Panel->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
61 Panel->setBorder(true);
62 Panel->setSubElement(true);
63
64 // some buttons
65
66
67 // add images from texture cache
68 updateImageList();
69
70}
71
72CGUITextureCacheBrowser::~CGUITextureCacheBrowser()
73{
74 if (CloseButton)
75 CloseButton->drop();
76 if (Panel)
77 Panel->drop();
78
79 // drop images
80 u32 i;
81 for (i=0; i<Images.size(); ++i)
82 {
83 Images[i]->drop();
84 Images[i]->remove();
85 }
86 Images.clear();
87}
88void CGUITextureCacheBrowser::updateImageList()
89{
90 if (!Panel)
91 return;
92
93 video::IVideoDriver* Driver = Environment->getVideoDriver();
94
95 // clear images
96 u32 i;
97 for (i=0; i<Images.size(); ++i)
98 {
99 Images[i]->drop();
100 Images[i]->remove();
101 }
102 Images.clear();
103
104 u32 count = (u32)Driver->getTextureCount();
105
106 s32 h = Panel->getClientArea().getWidth()-10;
107 s32 hw = h/2;
108 core::rect<s32> pos(Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X - hw, 5,
109 Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X + hw, h+5);
110
111 core::position2di moveDist(0, h+5);
112
113 for (u32 i=0; i<count; ++i)
114 {
115 core::stringw details;
116 video::ITexture* tex = Driver->getTextureByIndex(i);
117 details = L"File name: ";
118 details += tex->getName();
119 details += L"\nFormat: ";
120 video::ECOLOR_FORMAT cf = tex->getColorFormat();
121
122 bool alpha = false;
123
124 switch (cf)
125 {
126 case video::ECF_A1R5G5B5:
127 details += L"A1R5G5B5 (16-bit with 1-bit alpha channel)\n";
128 alpha = true;
129 break;
130 case video::ECF_R5G6B5:
131 details += L"R5G6B5 (16-bit, no alpha channel)\n";
132 break;
133 case video::ECF_R8G8B8:
134 details += L"R8G8B8 (16-bit, no alpha channel)\n";
135 break;
136 case video::ECF_A8R8G8B8:
137 details += L"R8G8B8 (32-bit with 8-bit alpha channel)\n";
138 alpha = true;
139 break;
140 default:
141 details += L"Unknown\n";
142 }
143
144 core::dimension2du osize = tex->getOriginalSize();
145 core::dimension2du size = tex->getOriginalSize();
146
147 details += "Size: ";
148 details += size.Width;
149 details += "x";
150 details += size.Height;
151
152 if (osize != size)
153 {
154 details += "\nOriginal Size: ";
155 details += osize.Width;
156 details += "x";
157 details += osize.Height;
158 }
159
160 details += L"\nMip-maps: ";
161
162 if (tex->hasMipMaps())
163 details += L"Yes\n";
164 else
165 details += L"No\n";
166
167 IGUIImage* img = Environment->addImage(tex, core::position2di(1,1), alpha, Panel, i);
168 img->grab();
169 Images.push_back(img);
170 img->setRelativePosition(pos);
171 img->setToolTipText(details.c_str());
172 img->setScaleImage(true);
173 img->setColor( SelectedTexture == (s32)i ? video::SColor(255,255,255,255) : video::SColor(128,128,128,128) );
174
175 pos = pos + moveDist;
176 }
177}
178
179void CGUITextureCacheBrowser::updateAbsolutePosition()
180{
181 IGUIWindow::updateAbsolutePosition();
182 updateImageList();
183}
184
185//! called if an event happened.
186bool CGUITextureCacheBrowser::OnEvent(const SEvent &event)
187{
188 switch(event.EventType)
189 {
190 case EET_GUI_EVENT:
191 if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST)
192 {
193 if (event.GUIEvent.Caller == (IGUIElement*)this)
194 Dragging = false;
195 return true;
196 }
197 else
198 if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
199 {
200 if (event.GUIEvent.Caller == CloseButton)
201 {
202 remove();
203 return true;
204 }
205 }
206 break;
207 case EET_MOUSE_INPUT_EVENT:
208 switch(event.MouseInput.Event)
209 {
210 case EMIE_LMOUSE_PRESSED_DOWN:
211 DragStart.X = event.MouseInput.X;
212 DragStart.Y = event.MouseInput.Y;
213
214 if (getElementFromPoint(DragStart) == this)
215 {
216 if (!Environment->hasFocus(this))
217 {
218 Dragging = IsDraggable;
219 //Environment->setFocus(this);
220 if (Parent)
221 Parent->bringToFront(this);
222 }
223 return true;
224 }
225 else
226 {
227 if (Panel->getAbsolutePosition().isPointInside(DragStart))
228 {
229 // select an image
230 IGUIElement* el = Panel->getElementFromPoint(DragStart);
231 if (el && el != Panel)
232 {
233 if (el->getType() == EGUIET_IMAGE)
234 {
235 setSelected(el->getID());
236 }
237 }
238 else
239 {
240 setSelected();
241 }
242 }
243 }
244 break;
245 case EMIE_LMOUSE_LEFT_UP:
246 Dragging = false;
247 //Environment->removeFocus(this);
248 return true;
249 case EMIE_MOUSE_MOVED:
250 if (Dragging)
251 {
252 // gui window should not be dragged outside its parent
253 if (Parent)
254 if (event.MouseInput.X < Parent->getAbsolutePosition().UpperLeftCorner.X +1 ||
255 event.MouseInput.Y < Parent->getAbsolutePosition().UpperLeftCorner.Y +1 ||
256 event.MouseInput.X > Parent->getAbsolutePosition().LowerRightCorner.X -1 ||
257 event.MouseInput.Y > Parent->getAbsolutePosition().LowerRightCorner.Y -1)
258
259 return true;
260
261
262 move(core::position2d<s32>(event.MouseInput.X - DragStart.X, event.MouseInput.Y - DragStart.Y));
263 DragStart.X = event.MouseInput.X;
264 DragStart.Y = event.MouseInput.Y;
265 return true;
266 }
267 break;
268 default:
269 break;
270 }
271 default:
272 break;
273 }
274
275 return Parent ? Parent->OnEvent(event) : false;
276}
277
278void CGUITextureCacheBrowser::setSelected(s32 index)
279{
280 SelectedTexture = index;
281 updateImageList();
282 printf("Texture %d selected\n", index);
283}
284
285void CGUITextureCacheBrowser::draw()
286{
287 if (!IsVisible)
288 return;
289
290 IGUISkin* skin = Environment->getSkin();
291
292 core::rect<s32> rect = AbsoluteRect;
293 core::rect<s32> *cl = &AbsoluteClippingRect;
294
295 // draw body fast
296 rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
297 AbsoluteRect, &AbsoluteClippingRect);
298
299 // draw window text
300 if (Text.size())
301 {
302 rect.UpperLeftCorner.X += skin->getSize(EGDS_TEXT_DISTANCE_X);
303 rect.UpperLeftCorner.Y += skin->getSize(EGDS_TEXT_DISTANCE_Y);
304 rect.LowerRightCorner.X -= skin->getSize(EGDS_WINDOW_BUTTON_WIDTH) + 5;
305
306 IGUIFont* font = skin->getFont();
307 if (font)
308 font->draw(Text.c_str(), rect, skin->getColor(EGDC_ACTIVE_CAPTION), false, true, cl);
309 }
310
311 IGUIElement::draw();
312}
313
314
315bool CGUITextureCacheBrowser::isDraggable() const
316{
317 return IsDraggable;
318}
319
320void CGUITextureCacheBrowser::setDraggable(bool draggable)
321{
322 IsDraggable = draggable;
323
324 if (Dragging && !IsDraggable)
325 Dragging = false;
326}
327
328
329//! Returns the rectangle of the drawable area (without border, without titlebar and without scrollbars)
330core::rect<s32> CGUITextureCacheBrowser::getClientRect() const
331{
332 return core::recti();
333}
334
335} // namespace gui
336} // namespace irr
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h
new file mode 100644
index 0000000..108d4d6
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h
@@ -0,0 +1,88 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__
6#define __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__
7
8#include "IGUIWindow.h"
9#include "CGUIPanel.h"
10#include "IGUIImage.h"
11#include "EGUIEditTypes.h"
12
13namespace irr
14{
15namespace gui
16{
17
18 //! Texture cache browser
19
20 const u32 TEXTURE_BROWSER_TEXTURE_SELECTED = 0x5E1EC7ED; // custom event number for texture selected
21
22 class CGUITextureCacheBrowser : public IGUIWindow
23 {
24 public:
25
26 //! constructor
27 CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0);
28
29 //! destructor
30 ~CGUITextureCacheBrowser();
31
32 //! event handler
33 virtual bool OnEvent(const SEvent &event);
34
35 //! draws the element
36 virtual void draw();
37
38 //! update absolute position
39 virtual void updateAbsolutePosition();
40
41 //! this shoudln't be serialized, but this is included as it's an example
42 virtual const c8* getTypeName() const { return "textureCacheBrowser"; }
43
44 //! Returns pointer to the close button
45 virtual IGUIButton* getCloseButton() const { return CloseButton; }
46
47 //! Returns pointer to the minimize button
48 virtual IGUIButton* getMinimizeButton() const { return 0;}
49
50 //! Returns pointer to the maximize button
51 virtual IGUIButton* getMaximizeButton() const { return 0;}
52
53 //! get draggable
54 virtual bool isDraggable() const;
55
56 //! get draggable
57 virtual void setDraggable(bool draggable);
58
59 //! not used
60 virtual core::rect<s32> getClientRect() const;
61 virtual void setDrawBackground(bool draw) { }
62 virtual bool getDrawBackground() const { return true; }
63 virtual void setDrawTitlebar(bool draw) { }
64 virtual bool getDrawTitlebar() const { return true; }
65
66
67 void setSelected(s32 index=-1);
68
69 private:
70
71 void updateImageList();
72
73 core::array<IGUIImage*> Images;
74 core::position2d<s32> DragStart;
75
76 IGUIButton* CloseButton;
77 CGUIPanel* Panel;
78 s32 SelectedTexture;
79 bool Dragging;
80 bool IsDraggable;
81 };
82
83
84} // end namespace gui
85} // end namespace irr
86
87#endif
88
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp
new file mode 100644
index 0000000..0a69587
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp
@@ -0,0 +1,95 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#include "CMemoryReadWriteFile.h"
6
7using namespace irr;
8using namespace io;
9
10CMemoryReadWriteFile::CMemoryReadWriteFile(const c8* filename)
11: Data(), FileName(filename), Pos(0)
12{
13}
14
15
16s32 CMemoryReadWriteFile::write(const void* buffer, u32 sizeToWrite)
17{
18 // no point in writing 0 bytes
19 if (sizeToWrite < 1)
20 return 0;
21
22 // expand size
23 if (Pos + sizeToWrite > Data.size())
24 Data.set_used(Pos+sizeToWrite);
25
26 // copy data
27 memcpy( (void*) &Data[Pos], buffer, (size_t) sizeToWrite);
28
29 Pos += sizeToWrite;
30
31 return sizeToWrite;
32
33}
34
35bool CMemoryReadWriteFile::seek(long finalPos, bool relativeMovement)
36{
37 if (relativeMovement)
38 {
39 if (finalPos + Pos < 0)
40 return 0;
41 else
42 Pos += finalPos;
43 }
44 else
45 {
46 Pos = finalPos;
47 }
48
49 if (Pos > (s32)Data.size())
50 Data.set_used(Pos+1);
51
52 return true;
53
54}
55
56const io::path& CMemoryReadWriteFile::getFileName() const
57{
58 return FileName;
59}
60
61long CMemoryReadWriteFile::getPos() const
62{
63 return Pos;
64}
65
66core::array<c8>& CMemoryReadWriteFile::getData()
67{
68 return Data;
69}
70
71
72long CMemoryReadWriteFile::getSize() const
73{
74 return Data.size();
75}
76
77
78s32 CMemoryReadWriteFile::read(void* buffer, u32 sizeToRead)
79{
80 // cant read past the end
81 if (Pos + sizeToRead >= Data.size())
82 sizeToRead = Data.size() - Pos;
83
84 // cant read 0 bytes
85 if (!sizeToRead)
86 return 0;
87
88 // copy data
89 memcpy( buffer, (void*) &Data[Pos], (size_t) sizeToRead);
90
91 Pos += sizeToRead;
92
93 return sizeToRead;
94}
95
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h
new file mode 100644
index 0000000..de20ae7
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h
@@ -0,0 +1,73 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
6#define __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
7
8#include "IWriteFile.h"
9#include "IReadFile.h"
10#include "irrArray.h"
11#include "irrString.h"
12#include "memory.h"
13
14namespace irr
15{
16namespace io
17{
18
19 //! Provides write acess to an array as if it is a file.
20 class CMemoryReadWriteFile : public virtual IWriteFile, public virtual IReadFile
21 {
22 public:
23
24 CMemoryReadWriteFile(const c8* filename=0);
25
26 //! Reads an amount of bytes from the file.
27 //! \param buffer: Pointer to buffer of bytes to write.
28 //! \param sizeToWrite: Amount of bytes to wrtie to the file.
29 //! \return Returns how much bytes were written.
30 virtual s32 write(const void* buffer, u32 sizeToWrite);
31
32 //! Changes position in file, returns true if successful.
33 //! \param finalPos: Destination position in the file.
34 //! \param relativeMovement: If set to true, the position in the file is
35 //! changed relative to current position. Otherwise the position is changed
36 //! from begin of file.
37 //! \return Returns true if successful, otherwise false.
38 virtual bool seek(long finalPos, bool relativeMovement = false);
39
40 //! Returns size of file.
41 //! \return Returns the size of the file in bytes.
42 virtual long getSize() const;
43
44 //! Reads an amount of bytes from the file.
45 //! \param buffer: Pointer to buffer where to read bytes will be written to.
46 //! \param sizeToRead: Amount of bytes to read from the file.
47 //! \return Returns how much bytes were read.
48 virtual s32 read(void* buffer, u32 sizeToRead);
49
50 //! Returns the current position in the file.
51 //! \return Returns the current position in the file in bytes.
52 virtual long getPos() const;
53
54 //! Returns name of file.
55 //! \return Returns the file name as zero terminated character string.
56 virtual const io::path& getFileName() const;
57
58 //! Returns file data as an array
59 core::array<c8>& getData();
60
61 private:
62
63 core::array<c8> Data;
64 io::path FileName;
65 long Pos;
66 };
67
68
69
70} // end namespace io
71} // end namespace irr
72
73#endif // __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h
new file mode 100644
index 0000000..88d119e
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h
@@ -0,0 +1,61 @@
1#ifndef __C_GUIEDIT_TYPES_H_INCLUDED__
2#define __C_GUIEDIT_TYPES_H_INCLUDED__
3
4#include "irrTypes.h"
5
6namespace irr {
7namespace gui {
8
9enum EGUIEDIT_ELEMENT_TYPES
10{
11 // GUI Editor
12 EGUIEDIT_GUIEDIT=0,
13 EGUIEDIT_GUIEDITWINDOW,
14 // Generic
15 EGUIEDIT_GUIPANEL,
16 EGUIEDIT_TEXTUREBROWSER,
17 // Attribute editors
18 EGUIEDIT_ATTRIBUTEEDITOR,
19 EGUIEDIT_STRINGATTRIBUTE,
20 EGUIEDIT_BOOLATTRIBUTE,
21 EGUIEDIT_ENUMATTRIBUTE,
22 EGUIEDIT_COLORATTRIBUTE,
23 EGUIEDIT_COLORFATTRIBUTE,
24 EGUIEDIT_TEXTUREATTRIBUTE,
25 // Dummy editor stubs
26 EGUIEDIT_CONTEXTMENUEDITOR,
27 EGUIEDIT_MENUEDITOR,
28 EGUIEDIT_FILEDIALOGEDITOR,
29 EGUIEDIT_COLORDIALOGEDITOR,
30 EGUIEDIT_MODALSCREENEDITOR,
31 // Count
32 EGUIEDIT_COUNT
33};
34
35const c8* const GUIEditElementTypeNames[] =
36{
37 "GUIEditor",
38 "GUIEditWindow",
39 "panel",
40 "textureCacheBrowser",
41 "attributeEditor",
42 "string_attribute",
43 "bool_attribute",
44 "enum_attribute",
45 "color_attribute",
46 "colorf_attribute",
47 "texture_attribute",
48 // dummy editors
49 "contextMenu_editor",
50 "menu_editor",
51 "fileOpenDialog_editor",
52 "colorSelectDialog_editor",
53 "modalScreen_editor",
54 0
55};
56
57} // gui
58} // irr
59
60#endif
61
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln
new file mode 100644
index 0000000..6f76269
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 9.00
3# Visual C++ Express 2005
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor", "GUI Editor.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj
new file mode 100644
index 0000000..81c6fa9
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj
@@ -0,0 +1,295 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="GUI Editor"
6 ProjectGUID="{853A396E-C031-4C26-A716-5B4E176BE11D}"
7 RootNamespace="GUI Editor"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="2"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 FavorSizeOrSpeed="0"
45 WholeProgramOptimization="false"
46 AdditionalIncludeDirectories="..\..\include"
47 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
48 MinimalRebuild="true"
49 BasicRuntimeChecks="3"
50 RuntimeLibrary="1"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 Detect64BitPortabilityProblems="true"
54 DebugInformationFormat="4"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib "
68 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
69 LinkIncremental="2"
70 AdditionalLibraryDirectories="&quot;..\..\lib\Win32-visualstudio&quot;"
71 GenerateDebugInformation="true"
72 ProgramDatabaseFile="$(OutDir)/GUIEditor.pdb"
73 SubSystem="1"
74 TargetMachine="1"
75 />
76 <Tool
77 Name="VCALinkTool"
78 />
79 <Tool
80 Name="VCManifestTool"
81 />
82 <Tool
83 Name="VCXDCMakeTool"
84 />
85 <Tool
86 Name="VCBscMakeTool"
87 />
88 <Tool
89 Name="VCFxCopTool"
90 />
91 <Tool
92 Name="VCAppVerifierTool"
93 />
94 <Tool
95 Name="VCWebDeploymentTool"
96 />
97 <Tool
98 Name="VCPostBuildEventTool"
99 />
100 </Configuration>
101 <Configuration
102 Name="Release|Win32"
103 OutputDirectory="Release"
104 IntermediateDirectory="Release"
105 ConfigurationType="1"
106 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
107 CharacterSet="2"
108 >
109 <Tool
110 Name="VCPreBuildEventTool"
111 />
112 <Tool
113 Name="VCCustomBuildTool"
114 />
115 <Tool
116 Name="VCXMLDataGeneratorTool"
117 />
118 <Tool
119 Name="VCWebServiceProxyGeneratorTool"
120 />
121 <Tool
122 Name="VCMIDLTool"
123 />
124 <Tool
125 Name="VCCLCompilerTool"
126 Optimization="3"
127 WholeProgramOptimization="true"
128 AdditionalIncludeDirectories="..\..\include"
129 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
130 RuntimeLibrary="0"
131 UsePrecompiledHeader="0"
132 WarningLevel="3"
133 Detect64BitPortabilityProblems="true"
134 DebugInformationFormat="3"
135 />
136 <Tool
137 Name="VCManagedResourceCompilerTool"
138 />
139 <Tool
140 Name="VCResourceCompilerTool"
141 />
142 <Tool
143 Name="VCPreLinkEventTool"
144 />
145 <Tool
146 Name="VCLinkerTool"
147 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
148 LinkIncremental="1"
149 GenerateDebugInformation="true"
150 SubSystem="1"
151 OptimizeReferences="2"
152 EnableCOMDATFolding="2"
153 TargetMachine="1"
154 />
155 <Tool
156 Name="VCALinkTool"
157 />
158 <Tool
159 Name="VCManifestTool"
160 />
161 <Tool
162 Name="VCXDCMakeTool"
163 />
164 <Tool
165 Name="VCBscMakeTool"
166 />
167 <Tool
168 Name="VCFxCopTool"
169 />
170 <Tool
171 Name="VCAppVerifierTool"
172 />
173 <Tool
174 Name="VCWebDeploymentTool"
175 />
176 <Tool
177 Name="VCPostBuildEventTool"
178 />
179 </Configuration>
180 </Configurations>
181 <References>
182 </References>
183 <Files>
184 <Filter
185 Name="gui"
186 >
187 <File
188 RelativePath=".\CGUIEditFactory.cpp"
189 >
190 </File>
191 <File
192 RelativePath=".\CGUIEditFactory.h"
193 >
194 </File>
195 <File
196 RelativePath=".\CGUIEditWindow.cpp"
197 >
198 </File>
199 <File
200 RelativePath=".\CGUIEditWindow.h"
201 >
202 </File>
203 <File
204 RelativePath=".\CGUIEditWorkspace.cpp"
205 >
206 </File>
207 <File
208 RelativePath=".\CGUIEditWorkspace.h"
209 >
210 </File>
211 <File
212 RelativePath=".\CGUITextureCacheBrowser.cpp"
213 >
214 </File>
215 <File
216 RelativePath=".\CGUITextureCacheBrowser.h"
217 >
218 </File>
219 <Filter
220 Name="GUIAttributes"
221 >
222 <File
223 RelativePath=".\CGUIAttribute.h"
224 >
225 </File>
226 <File
227 RelativePath=".\CGUIAttributeEditor.cpp"
228 >
229 </File>
230 <File
231 RelativePath=".\CGUIAttributeEditor.h"
232 >
233 </File>
234 <File
235 RelativePath=".\CGUIBoolAttribute.h"
236 >
237 </File>
238 <File
239 RelativePath=".\CGUIColorAttribute.h"
240 >
241 </File>
242 <File
243 RelativePath=".\CGUIEnumAttribute.h"
244 >
245 </File>
246 <File
247 RelativePath=".\CGUIStringAttribute.h"
248 >
249 </File>
250 <File
251 RelativePath=".\CGUITextureAttribute.h"
252 >
253 </File>
254 </Filter>
255 <Filter
256 Name="Useful GUI Elements"
257 >
258 <File
259 RelativePath=".\CGUIPanel.cpp"
260 >
261 </File>
262 <File
263 RelativePath=".\CGUIPanel.h"
264 >
265 </File>
266 </Filter>
267 <Filter
268 Name="Element Editors"
269 >
270 <File
271 RelativePath=".\CGUIDummyEditorStub.h"
272 >
273 </File>
274 </Filter>
275 </Filter>
276 <Filter
277 Name="io"
278 >
279 <File
280 RelativePath=".\CMemoryReadWriteFile.cpp"
281 >
282 </File>
283 <File
284 RelativePath=".\CMemoryReadWriteFile.h"
285 >
286 </File>
287 </Filter>
288 <File
289 RelativePath=".\main.cpp"
290 >
291 </File>
292 </Files>
293 <Globals>
294 </Globals>
295</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln
new file mode 100644
index 0000000..0acf300
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 10.00
3# Visual C++ Express 2008
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor_v9", "GUI Editor_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj
new file mode 100644
index 0000000..6d73d03
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj
@@ -0,0 +1,293 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="GUI Editor_v9"
6 ProjectGUID="{853A396E-C031-4C26-A716-5B4E176BE11D}"
7 RootNamespace="GUI Editor"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="Debug"
22 IntermediateDirectory="Debug"
23 ConfigurationType="1"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="2"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 FavorSizeOrSpeed="0"
46 WholeProgramOptimization="false"
47 AdditionalIncludeDirectories="..\..\include"
48 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
49 MinimalRebuild="true"
50 BasicRuntimeChecks="3"
51 RuntimeLibrary="1"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 DebugInformationFormat="4"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib "
68 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
69 LinkIncremental="2"
70 AdditionalLibraryDirectories="&quot;..\..\lib\Win32-visualstudio&quot;"
71 GenerateDebugInformation="true"
72 ProgramDatabaseFile="$(OutDir)/GUIEditor.pdb"
73 SubSystem="1"
74 RandomizedBaseAddress="1"
75 DataExecutionPrevention="0"
76 TargetMachine="1"
77 />
78 <Tool
79 Name="VCALinkTool"
80 />
81 <Tool
82 Name="VCManifestTool"
83 />
84 <Tool
85 Name="VCXDCMakeTool"
86 />
87 <Tool
88 Name="VCBscMakeTool"
89 />
90 <Tool
91 Name="VCFxCopTool"
92 />
93 <Tool
94 Name="VCAppVerifierTool"
95 />
96 <Tool
97 Name="VCPostBuildEventTool"
98 />
99 </Configuration>
100 <Configuration
101 Name="Release|Win32"
102 OutputDirectory="Release"
103 IntermediateDirectory="Release"
104 ConfigurationType="1"
105 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
106 CharacterSet="2"
107 >
108 <Tool
109 Name="VCPreBuildEventTool"
110 />
111 <Tool
112 Name="VCCustomBuildTool"
113 />
114 <Tool
115 Name="VCXMLDataGeneratorTool"
116 />
117 <Tool
118 Name="VCWebServiceProxyGeneratorTool"
119 />
120 <Tool
121 Name="VCMIDLTool"
122 />
123 <Tool
124 Name="VCCLCompilerTool"
125 Optimization="3"
126 AdditionalIncludeDirectories="..\..\include"
127 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
128 RuntimeLibrary="0"
129 UsePrecompiledHeader="0"
130 WarningLevel="3"
131 Detect64BitPortabilityProblems="false"
132 DebugInformationFormat="3"
133 />
134 <Tool
135 Name="VCManagedResourceCompilerTool"
136 />
137 <Tool
138 Name="VCResourceCompilerTool"
139 />
140 <Tool
141 Name="VCPreLinkEventTool"
142 />
143 <Tool
144 Name="VCLinkerTool"
145 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
146 LinkIncremental="1"
147 AdditionalLibraryDirectories="../../lib/Win32-Visualstudio"
148 GenerateDebugInformation="true"
149 SubSystem="1"
150 OptimizeReferences="2"
151 EnableCOMDATFolding="2"
152 RandomizedBaseAddress="1"
153 DataExecutionPrevention="0"
154 TargetMachine="1"
155 />
156 <Tool
157 Name="VCALinkTool"
158 />
159 <Tool
160 Name="VCManifestTool"
161 />
162 <Tool
163 Name="VCXDCMakeTool"
164 />
165 <Tool
166 Name="VCBscMakeTool"
167 />
168 <Tool
169 Name="VCFxCopTool"
170 />
171 <Tool
172 Name="VCAppVerifierTool"
173 />
174 <Tool
175 Name="VCPostBuildEventTool"
176 />
177 </Configuration>
178 </Configurations>
179 <References>
180 </References>
181 <Files>
182 <Filter
183 Name="gui"
184 >
185 <File
186 RelativePath=".\CGUIEditFactory.cpp"
187 >
188 </File>
189 <File
190 RelativePath=".\CGUIEditFactory.h"
191 >
192 </File>
193 <File
194 RelativePath=".\CGUIEditWindow.cpp"
195 >
196 </File>
197 <File
198 RelativePath=".\CGUIEditWindow.h"
199 >
200 </File>
201 <File
202 RelativePath=".\CGUIEditWorkspace.cpp"
203 >
204 </File>
205 <File
206 RelativePath=".\CGUIEditWorkspace.h"
207 >
208 </File>
209 <File
210 RelativePath=".\CGUITextureCacheBrowser.cpp"
211 >
212 </File>
213 <File
214 RelativePath=".\CGUITextureCacheBrowser.h"
215 >
216 </File>
217 <Filter
218 Name="GUIAttributes"
219 >
220 <File
221 RelativePath=".\CGUIAttribute.h"
222 >
223 </File>
224 <File
225 RelativePath=".\CGUIAttributeEditor.cpp"
226 >
227 </File>
228 <File
229 RelativePath=".\CGUIAttributeEditor.h"
230 >
231 </File>
232 <File
233 RelativePath=".\CGUIBoolAttribute.h"
234 >
235 </File>
236 <File
237 RelativePath=".\CGUIColorAttribute.h"
238 >
239 </File>
240 <File
241 RelativePath=".\CGUIEnumAttribute.h"
242 >
243 </File>
244 <File
245 RelativePath=".\CGUIStringAttribute.h"
246 >
247 </File>
248 <File
249 RelativePath=".\CGUITextureAttribute.h"
250 >
251 </File>
252 </Filter>
253 <Filter
254 Name="Useful GUI Elements"
255 >
256 <File
257 RelativePath=".\CGUIPanel.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\CGUIPanel.h"
262 >
263 </File>
264 </Filter>
265 <Filter
266 Name="Element Editors"
267 >
268 <File
269 RelativePath=".\CGUIDummyEditorStub.h"
270 >
271 </File>
272 </Filter>
273 </Filter>
274 <Filter
275 Name="io"
276 >
277 <File
278 RelativePath=".\CMemoryReadWriteFile.cpp"
279 >
280 </File>
281 <File
282 RelativePath=".\CMemoryReadWriteFile.h"
283 >
284 </File>
285 </Filter>
286 <File
287 RelativePath=".\main.cpp"
288 >
289 </File>
290 </Files>
291 <Globals>
292 </Globals>
293</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj
new file mode 100644
index 0000000..7022876
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj
@@ -0,0 +1,213 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectGuid>{853A396E-C031-4C26-A716-5B4E176BE11D}</ProjectGuid>
23 <RootNamespace>GUI Editor</RootNamespace>
24 <Keyword>Win32Proj</Keyword>
25 <ProjectName>GUIEditor</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <CharacterSet>MultiByte</CharacterSet>
35 </PropertyGroup>
36 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
37 <ConfigurationType>Application</ConfigurationType>
38 <CharacterSet>MultiByte</CharacterSet>
39 </PropertyGroup>
40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
41 <ConfigurationType>Application</ConfigurationType>
42 <CharacterSet>MultiByte</CharacterSet>
43 </PropertyGroup>
44 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
45 <ImportGroup Label="ExtensionSettings">
46 </ImportGroup>
47 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
48 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
49 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <PropertyGroup Label="UserMacros" />
64 <PropertyGroup>
65 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
66 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
67 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
68 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
69 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
74 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
75 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
76 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
77 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
78 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
79 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
80 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
84 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
86 </PropertyGroup>
87 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
88 <ClCompile>
89 <Optimization>Disabled</Optimization>
90 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
91 <WholeProgramOptimization>false</WholeProgramOptimization>
92 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
93 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
94 <MinimalRebuild>true</MinimalRebuild>
95 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
96 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
97 <PrecompiledHeader>
98 </PrecompiledHeader>
99 <WarningLevel>Level3</WarningLevel>
100 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
101 </ClCompile>
102 <Link>
103 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
104 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
105 <GenerateDebugInformation>true</GenerateDebugInformation>
106 <SubSystem>Console</SubSystem>
107 <DataExecutionPrevention>
108 </DataExecutionPrevention>
109 </Link>
110 </ItemDefinitionGroup>
111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
112 <ClCompile>
113 <Optimization>Disabled</Optimization>
114 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
115 <WholeProgramOptimization>false</WholeProgramOptimization>
116 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
117 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
119 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
120 <PrecompiledHeader>
121 </PrecompiledHeader>
122 <WarningLevel>Level3</WarningLevel>
123 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
124 </ClCompile>
125 <Link>
126 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
127 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
128 <GenerateDebugInformation>true</GenerateDebugInformation>
129 <SubSystem>Console</SubSystem>
130 <DataExecutionPrevention>
131 </DataExecutionPrevention>
132 </Link>
133 </ItemDefinitionGroup>
134 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
135 <ClCompile>
136 <Optimization>Full</Optimization>
137 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
138 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
140 <PrecompiledHeader>
141 </PrecompiledHeader>
142 <WarningLevel>Level3</WarningLevel>
143 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
144 </ClCompile>
145 <Link>
146 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
147 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
148 <GenerateDebugInformation>true</GenerateDebugInformation>
149 <SubSystem>Console</SubSystem>
150 <OptimizeReferences>true</OptimizeReferences>
151 <EnableCOMDATFolding>true</EnableCOMDATFolding>
152 <DataExecutionPrevention>
153 </DataExecutionPrevention>
154 </Link>
155 </ItemDefinitionGroup>
156 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
157 <ClCompile>
158 <Optimization>Full</Optimization>
159 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
160 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
161 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
162 <PrecompiledHeader>
163 </PrecompiledHeader>
164 <WarningLevel>Level3</WarningLevel>
165 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
166 </ClCompile>
167 <Link>
168 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
169 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
170 <GenerateDebugInformation>true</GenerateDebugInformation>
171 <SubSystem>Console</SubSystem>
172 <OptimizeReferences>true</OptimizeReferences>
173 <EnableCOMDATFolding>true</EnableCOMDATFolding>
174 <DataExecutionPrevention>
175 </DataExecutionPrevention>
176 </Link>
177 </ItemDefinitionGroup>
178 <ItemGroup>
179 <ClCompile Include="CGUIEditFactory.cpp" />
180 <ClCompile Include="CGUIEditWindow.cpp" />
181 <ClCompile Include="CGUIEditWorkspace.cpp" />
182 <ClCompile Include="CGUITextureCacheBrowser.cpp" />
183 <ClCompile Include="CGUIAttributeEditor.cpp" />
184 <ClCompile Include="CGUIPanel.cpp" />
185 <ClCompile Include="CMemoryReadWriteFile.cpp" />
186 <ClCompile Include="main.cpp" />
187 </ItemGroup>
188 <ItemGroup>
189 <ClInclude Include="CGUIEditFactory.h" />
190 <ClInclude Include="CGUIEditWindow.h" />
191 <ClInclude Include="CGUIEditWorkspace.h" />
192 <ClInclude Include="CGUITextureCacheBrowser.h" />
193 <ClInclude Include="CGUIAttribute.h" />
194 <ClInclude Include="CGUIAttributeEditor.h" />
195 <ClInclude Include="CGUIBoolAttribute.h" />
196 <ClInclude Include="CGUIColorAttribute.h" />
197 <ClInclude Include="CGUIEnumAttribute.h" />
198 <ClInclude Include="CGUIStringAttribute.h" />
199 <ClInclude Include="CGUITextureAttribute.h" />
200 <ClInclude Include="CGUIPanel.h" />
201 <ClInclude Include="CGUIDummyEditorStub.h" />
202 <ClInclude Include="CMemoryReadWriteFile.h" />
203 </ItemGroup>
204 <ItemGroup>
205 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht10.0.vcxproj">
206 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
207 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
208 </ProjectReference>
209 </ItemGroup>
210 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
211 <ImportGroup Label="ExtensionTargets">
212 </ImportGroup>
213</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters
new file mode 100644
index 0000000..1d06fa4
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters
@@ -0,0 +1,88 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="gui">
5 <UniqueIdentifier>{f6ad9df9-ebaa-4c0f-997b-c8101c1fc669}</UniqueIdentifier>
6 </Filter>
7 <Filter Include="gui\GUIAttributes">
8 <UniqueIdentifier>{7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7}</UniqueIdentifier>
9 </Filter>
10 <Filter Include="gui\Useful GUI Elements">
11 <UniqueIdentifier>{ab2c3f3a-1d99-4619-b5df-47fdd9449f3f}</UniqueIdentifier>
12 </Filter>
13 <Filter Include="gui\Element Editors">
14 <UniqueIdentifier>{740a4255-37cc-4ac4-94e9-f2f0970491a8}</UniqueIdentifier>
15 </Filter>
16 <Filter Include="io">
17 <UniqueIdentifier>{a28a0b21-3336-432f-9759-ff2dc064874a}</UniqueIdentifier>
18 </Filter>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="CGUIEditFactory.cpp">
22 <Filter>gui</Filter>
23 </ClCompile>
24 <ClCompile Include="CGUIEditWindow.cpp">
25 <Filter>gui</Filter>
26 </ClCompile>
27 <ClCompile Include="CGUIEditWorkspace.cpp">
28 <Filter>gui</Filter>
29 </ClCompile>
30 <ClCompile Include="CGUITextureCacheBrowser.cpp">
31 <Filter>gui</Filter>
32 </ClCompile>
33 <ClCompile Include="CGUIAttributeEditor.cpp">
34 <Filter>gui\GUIAttributes</Filter>
35 </ClCompile>
36 <ClCompile Include="CGUIPanel.cpp">
37 <Filter>gui\Useful GUI Elements</Filter>
38 </ClCompile>
39 <ClCompile Include="CMemoryReadWriteFile.cpp">
40 <Filter>io</Filter>
41 </ClCompile>
42 <ClCompile Include="main.cpp" />
43 </ItemGroup>
44 <ItemGroup>
45 <ClInclude Include="CGUIEditFactory.h">
46 <Filter>gui</Filter>
47 </ClInclude>
48 <ClInclude Include="CGUIEditWindow.h">
49 <Filter>gui</Filter>
50 </ClInclude>
51 <ClInclude Include="CGUIEditWorkspace.h">
52 <Filter>gui</Filter>
53 </ClInclude>
54 <ClInclude Include="CGUITextureCacheBrowser.h">
55 <Filter>gui</Filter>
56 </ClInclude>
57 <ClInclude Include="CGUIAttribute.h">
58 <Filter>gui\GUIAttributes</Filter>
59 </ClInclude>
60 <ClInclude Include="CGUIAttributeEditor.h">
61 <Filter>gui\GUIAttributes</Filter>
62 </ClInclude>
63 <ClInclude Include="CGUIBoolAttribute.h">
64 <Filter>gui\GUIAttributes</Filter>
65 </ClInclude>
66 <ClInclude Include="CGUIColorAttribute.h">
67 <Filter>gui\GUIAttributes</Filter>
68 </ClInclude>
69 <ClInclude Include="CGUIEnumAttribute.h">
70 <Filter>gui\GUIAttributes</Filter>
71 </ClInclude>
72 <ClInclude Include="CGUIStringAttribute.h">
73 <Filter>gui\GUIAttributes</Filter>
74 </ClInclude>
75 <ClInclude Include="CGUITextureAttribute.h">
76 <Filter>gui\GUIAttributes</Filter>
77 </ClInclude>
78 <ClInclude Include="CGUIPanel.h">
79 <Filter>gui\Useful GUI Elements</Filter>
80 </ClInclude>
81 <ClInclude Include="CGUIDummyEditorStub.h">
82 <Filter>gui\Element Editors</Filter>
83 </ClInclude>
84 <ClInclude Include="CMemoryReadWriteFile.h">
85 <Filter>io</Filter>
86 </ClInclude>
87 </ItemGroup>
88</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj
new file mode 100644
index 0000000..6c6f28b
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj
@@ -0,0 +1,217 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectGuid>{853A396E-C031-4C26-A716-5B4E176BE11D}</ProjectGuid>
23 <RootNamespace>GUI Editor</RootNamespace>
24 <Keyword>Win32Proj</Keyword>
25 <ProjectName>GUIEditor</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <CharacterSet>MultiByte</CharacterSet>
36 <PlatformToolset>v110</PlatformToolset>
37 </PropertyGroup>
38 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
39 <ConfigurationType>Application</ConfigurationType>
40 <CharacterSet>MultiByte</CharacterSet>
41 <PlatformToolset>v110</PlatformToolset>
42 </PropertyGroup>
43 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
44 <ConfigurationType>Application</ConfigurationType>
45 <CharacterSet>MultiByte</CharacterSet>
46 <PlatformToolset>v110</PlatformToolset>
47 </PropertyGroup>
48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
49 <ImportGroup Label="ExtensionSettings">
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
64 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
66 </ImportGroup>
67 <PropertyGroup Label="UserMacros" />
68 <PropertyGroup>
69 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
75 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
77 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
78 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
79 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
80 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
81 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
82 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
83 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
84 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
85 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
86 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
87 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
88 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
89 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
90 </PropertyGroup>
91 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
92 <ClCompile>
93 <Optimization>Disabled</Optimization>
94 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
95 <WholeProgramOptimization>false</WholeProgramOptimization>
96 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
97 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98 <MinimalRebuild>true</MinimalRebuild>
99 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
100 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
101 <PrecompiledHeader>
102 </PrecompiledHeader>
103 <WarningLevel>Level3</WarningLevel>
104 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
105 </ClCompile>
106 <Link>
107 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
108 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
109 <GenerateDebugInformation>true</GenerateDebugInformation>
110 <SubSystem>Console</SubSystem>
111 <DataExecutionPrevention>
112 </DataExecutionPrevention>
113 </Link>
114 </ItemDefinitionGroup>
115 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
116 <ClCompile>
117 <Optimization>Disabled</Optimization>
118 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
119 <WholeProgramOptimization>false</WholeProgramOptimization>
120 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
121 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
122 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
123 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
124 <PrecompiledHeader>
125 </PrecompiledHeader>
126 <WarningLevel>Level3</WarningLevel>
127 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
128 </ClCompile>
129 <Link>
130 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
131 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
132 <GenerateDebugInformation>true</GenerateDebugInformation>
133 <SubSystem>Console</SubSystem>
134 <DataExecutionPrevention>
135 </DataExecutionPrevention>
136 </Link>
137 </ItemDefinitionGroup>
138 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
139 <ClCompile>
140 <Optimization>Full</Optimization>
141 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
142 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
143 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
144 <PrecompiledHeader>
145 </PrecompiledHeader>
146 <WarningLevel>Level3</WarningLevel>
147 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
148 </ClCompile>
149 <Link>
150 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
151 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
152 <GenerateDebugInformation>true</GenerateDebugInformation>
153 <SubSystem>Console</SubSystem>
154 <OptimizeReferences>true</OptimizeReferences>
155 <EnableCOMDATFolding>true</EnableCOMDATFolding>
156 <DataExecutionPrevention>
157 </DataExecutionPrevention>
158 </Link>
159 </ItemDefinitionGroup>
160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
161 <ClCompile>
162 <Optimization>Full</Optimization>
163 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
166 <PrecompiledHeader>
167 </PrecompiledHeader>
168 <WarningLevel>Level3</WarningLevel>
169 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
170 </ClCompile>
171 <Link>
172 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
173 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
174 <GenerateDebugInformation>true</GenerateDebugInformation>
175 <SubSystem>Console</SubSystem>
176 <OptimizeReferences>true</OptimizeReferences>
177 <EnableCOMDATFolding>true</EnableCOMDATFolding>
178 <DataExecutionPrevention>
179 </DataExecutionPrevention>
180 </Link>
181 </ItemDefinitionGroup>
182 <ItemGroup>
183 <ClCompile Include="CGUIEditFactory.cpp" />
184 <ClCompile Include="CGUIEditWindow.cpp" />
185 <ClCompile Include="CGUIEditWorkspace.cpp" />
186 <ClCompile Include="CGUITextureCacheBrowser.cpp" />
187 <ClCompile Include="CGUIAttributeEditor.cpp" />
188 <ClCompile Include="CGUIPanel.cpp" />
189 <ClCompile Include="CMemoryReadWriteFile.cpp" />
190 <ClCompile Include="main.cpp" />
191 </ItemGroup>
192 <ItemGroup>
193 <ClInclude Include="CGUIEditFactory.h" />
194 <ClInclude Include="CGUIEditWindow.h" />
195 <ClInclude Include="CGUIEditWorkspace.h" />
196 <ClInclude Include="CGUITextureCacheBrowser.h" />
197 <ClInclude Include="CGUIAttribute.h" />
198 <ClInclude Include="CGUIAttributeEditor.h" />
199 <ClInclude Include="CGUIBoolAttribute.h" />
200 <ClInclude Include="CGUIColorAttribute.h" />
201 <ClInclude Include="CGUIEnumAttribute.h" />
202 <ClInclude Include="CGUIStringAttribute.h" />
203 <ClInclude Include="CGUITextureAttribute.h" />
204 <ClInclude Include="CGUIPanel.h" />
205 <ClInclude Include="CGUIDummyEditorStub.h" />
206 <ClInclude Include="CMemoryReadWriteFile.h" />
207 </ItemGroup>
208 <ItemGroup>
209 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht11.0.vcxproj">
210 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
211 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
212 </ProjectReference>
213 </ItemGroup>
214 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
215 <ImportGroup Label="ExtensionTargets">
216 </ImportGroup>
217</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters
new file mode 100644
index 0000000..1d06fa4
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters
@@ -0,0 +1,88 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="gui">
5 <UniqueIdentifier>{f6ad9df9-ebaa-4c0f-997b-c8101c1fc669}</UniqueIdentifier>
6 </Filter>
7 <Filter Include="gui\GUIAttributes">
8 <UniqueIdentifier>{7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7}</UniqueIdentifier>
9 </Filter>
10 <Filter Include="gui\Useful GUI Elements">
11 <UniqueIdentifier>{ab2c3f3a-1d99-4619-b5df-47fdd9449f3f}</UniqueIdentifier>
12 </Filter>
13 <Filter Include="gui\Element Editors">
14 <UniqueIdentifier>{740a4255-37cc-4ac4-94e9-f2f0970491a8}</UniqueIdentifier>
15 </Filter>
16 <Filter Include="io">
17 <UniqueIdentifier>{a28a0b21-3336-432f-9759-ff2dc064874a}</UniqueIdentifier>
18 </Filter>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="CGUIEditFactory.cpp">
22 <Filter>gui</Filter>
23 </ClCompile>
24 <ClCompile Include="CGUIEditWindow.cpp">
25 <Filter>gui</Filter>
26 </ClCompile>
27 <ClCompile Include="CGUIEditWorkspace.cpp">
28 <Filter>gui</Filter>
29 </ClCompile>
30 <ClCompile Include="CGUITextureCacheBrowser.cpp">
31 <Filter>gui</Filter>
32 </ClCompile>
33 <ClCompile Include="CGUIAttributeEditor.cpp">
34 <Filter>gui\GUIAttributes</Filter>
35 </ClCompile>
36 <ClCompile Include="CGUIPanel.cpp">
37 <Filter>gui\Useful GUI Elements</Filter>
38 </ClCompile>
39 <ClCompile Include="CMemoryReadWriteFile.cpp">
40 <Filter>io</Filter>
41 </ClCompile>
42 <ClCompile Include="main.cpp" />
43 </ItemGroup>
44 <ItemGroup>
45 <ClInclude Include="CGUIEditFactory.h">
46 <Filter>gui</Filter>
47 </ClInclude>
48 <ClInclude Include="CGUIEditWindow.h">
49 <Filter>gui</Filter>
50 </ClInclude>
51 <ClInclude Include="CGUIEditWorkspace.h">
52 <Filter>gui</Filter>
53 </ClInclude>
54 <ClInclude Include="CGUITextureCacheBrowser.h">
55 <Filter>gui</Filter>
56 </ClInclude>
57 <ClInclude Include="CGUIAttribute.h">
58 <Filter>gui\GUIAttributes</Filter>
59 </ClInclude>
60 <ClInclude Include="CGUIAttributeEditor.h">
61 <Filter>gui\GUIAttributes</Filter>
62 </ClInclude>
63 <ClInclude Include="CGUIBoolAttribute.h">
64 <Filter>gui\GUIAttributes</Filter>
65 </ClInclude>
66 <ClInclude Include="CGUIColorAttribute.h">
67 <Filter>gui\GUIAttributes</Filter>
68 </ClInclude>
69 <ClInclude Include="CGUIEnumAttribute.h">
70 <Filter>gui\GUIAttributes</Filter>
71 </ClInclude>
72 <ClInclude Include="CGUIStringAttribute.h">
73 <Filter>gui\GUIAttributes</Filter>
74 </ClInclude>
75 <ClInclude Include="CGUITextureAttribute.h">
76 <Filter>gui\GUIAttributes</Filter>
77 </ClInclude>
78 <ClInclude Include="CGUIPanel.h">
79 <Filter>gui\Useful GUI Elements</Filter>
80 </ClInclude>
81 <ClInclude Include="CGUIDummyEditorStub.h">
82 <Filter>gui\Element Editors</Filter>
83 </ClInclude>
84 <ClInclude Include="CMemoryReadWriteFile.h">
85 <Filter>io</Filter>
86 </ClInclude>
87 </ItemGroup>
88</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp
new file mode 100644
index 0000000..2b57608
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp
@@ -0,0 +1,77 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="GUI Editor" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Windows">
10 <Option platforms="Windows;" />
11 <Option output="..\..\bin\win32-gcc\GUIEditor.exe" prefix_auto="0" extension_auto="0" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Option projectResourceIncludeDirsRelation="1" />
15 <Compiler>
16 <Add option="-g" />
17 </Compiler>
18 <Linker>
19 <Add directory="..\..\lib\Win32-gcc" />
20 </Linker>
21 </Target>
22 <Target title="Linux">
23 <Option platforms="Unix;" />
24 <Option output="..\..\bin\Linux\GUIEditor" prefix_auto="0" extension_auto="0" />
25 <Option type="1" />
26 <Option compiler="gcc" />
27 <Option projectResourceIncludeDirsRelation="1" />
28 <Compiler>
29 <Add option="-g" />
30 <Add option="-D_IRR_STATIC_LIB_" />
31 </Compiler>
32 <Linker>
33 <Add library="Irrlicht" />
34 <Add library="Xxf86vm" />
35 <Add library="GL" />
36 <Add directory="..\..\lib\Linux" />
37 </Linker>
38 </Target>
39 </Build>
40 <VirtualTargets>
41 <Add alias="All" targets="Windows;Linux;" />
42 </VirtualTargets>
43 <Compiler>
44 <Add directory="..\..\include" />
45 </Compiler>
46 <Linker>
47 <Add library="Irrlicht" />
48 </Linker>
49 <Unit filename="CGUIAttribute.h" />
50 <Unit filename="CGUIAttributeEditor.cpp" />
51 <Unit filename="CGUIAttributeEditor.h" />
52 <Unit filename="CGUIBoolAttribute.h" />
53 <Unit filename="CGUIColorAttribute.h" />
54 <Unit filename="CGUIEditFactory.cpp" />
55 <Unit filename="CGUIEditFactory.h" />
56 <Unit filename="CGUIEditWindow.cpp" />
57 <Unit filename="CGUIEditWindow.h" />
58 <Unit filename="CGUIEditWorkspace.cpp" />
59 <Unit filename="CGUIEditWorkspace.h" />
60 <Unit filename="CGUIEnumAttribute.h" />
61 <Unit filename="CGUIPanel.cpp" />
62 <Unit filename="CGUIPanel.h" />
63 <Unit filename="CGUIStringAttribute.h" />
64 <Unit filename="CGUITextureAttribute.h" />
65 <Unit filename="CGUITextureCacheBrowser.cpp" />
66 <Unit filename="CGUITextureCacheBrowser.h" />
67 <Unit filename="CMemoryReadWriteFile.cpp" />
68 <Unit filename="CMemoryReadWriteFile.h" />
69 <Unit filename="EGUIEditTypes.h" />
70 <Unit filename="main.cpp" />
71 <Extensions>
72 <code_completion />
73 <debugger />
74 <envvars />
75 </Extensions>
76 </Project>
77</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile b/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile
new file mode 100644
index 0000000..02f8189
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile
@@ -0,0 +1,43 @@
1# Irrlicht Engine GUIEditor Makefile
2Target = GUIEditor
3Sources = CGUIAttributeEditor.cpp CGUIEditFactory.cpp CGUIEditWindow.cpp CGUIEditWorkspace.cpp CGUIPanel.cpp CGUITextureCacheBrowser.cpp CMemoryReadWriteFile.cpp main.cpp
4
5CPPFLAGS = -I../../include -I/usr/X11R6/include
6CXXFLAGS = -Wall -O3 -ffast-math
7
8ifeq ($(HOSTTYPE), x86_64)
9LIBSELECT=64
10endif
11
12all: all_linux
13
14# target specific settings
15all_linux: SYSTEM=Linux
16all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11
17
18all_win32 clean_win32: SYSTEM=Win32-gcc
19all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
20
21# if you enable sound add the proper library for linking
22#LDFLAGS += -lIrrKlang
23#LDFLAGS += -laudiere
24#LDFLAGS += -lSDL_mixer -lSDL
25
26all_win32 clean_win32: SUF=.exe
27# name of the binary - only valid for targets which set SYSTEM
28DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
29
30OBJ = $(Sources:.cpp=.o)
31
32all_linux all_win32: $(OBJ)
33 $(warning Building...)
34 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
35
36clean: clean_linux clean_win32
37 $(warning Cleaning...)
38 @$(RM) $(OBJ)
39
40clean_linux clean_win32:
41 @$(RM) $(DESTPATH)
42
43.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp
new file mode 100644
index 0000000..e8434b2
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp
@@ -0,0 +1,76 @@
1#include <irrlicht.h>
2#include "driverChoice.h"
3
4// include the gui creator element factory
5#include "CGUIEditFactory.h"
6
7using namespace irr;
8using namespace gui;
9
10#ifdef _MSC_VER
11#pragma comment(lib, "Irrlicht.lib")
12#endif
13
14int main()
15{
16 // ask user for driver
17 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
18 if (driverType==video::EDT_COUNT)
19 return 1;
20
21 IrrlichtDevice *device = createDevice(driverType, core::dimension2du(800, 600));
22 video::IVideoDriver* driver = device->getVideoDriver();
23 scene::ISceneManager* smgr = device->getSceneManager();
24 gui::IGUIEnvironment *env = device->getGUIEnvironment();
25
26 device->setResizable(true);
27
28 /*
29 first we create the factory which can make new GUI elements
30 and register it with the gui environment.
31 */
32
33 IGUIElementFactory* factory = new CGUIEditFactory(env);
34 env->registerGUIElementFactory(factory);
35 // remember to drop since we created with a create call
36 factory->drop();
37
38 IGUISkin *skin = env->createSkin(EGST_WINDOWS_METALLIC);
39 env->setSkin(skin);
40
41 IGUIFont *font = env->getFont("../../media/lucida.xml");
42 if (font)
43 skin->setFont(font);
44 skin->drop();
45
46 // change transparency of skin
47 for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
48 {
49 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
50 col.setAlpha(250);
51 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
52 }
53
54 /*
55 now we add the GUI Editor Workspace
56 */
57
58 env->addGUIElement("GUIEditor");
59
60 while(device->run())
61 {
62 device->sleep(10);
63
64 if (device->isWindowActive())
65 {
66 driver->beginScene(true, true, video::SColor(0,200,200,200));
67 smgr->drawAll();
68 env->drawAll();
69 driver->endScene();
70 }
71 }
72
73 device->drop();
74
75 return 0;
76}