]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUISkin.cpp
08a5900720725d2e87dd630a611496a4a1300d60
[irrlicht.git] / source / Irrlicht / CGUISkin.cpp
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #include "CGUISkin.h"\r
6 #ifdef _IRR_COMPILE_WITH_GUI_\r
7 \r
8 #include "IGUIFont.h"\r
9 #include "IGUISpriteBank.h"\r
10 #include "IGUIElement.h"\r
11 #include "IVideoDriver.h"\r
12 #include "IAttributes.h"\r
13 \r
14 namespace irr\r
15 {\r
16 namespace gui\r
17 {\r
18 \r
19 CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)\r
20 : SpriteBank(0), Driver(driver), Type(type)\r
21 {\r
22         #ifdef _DEBUG\r
23         setDebugName("CGUISkin");\r
24         #endif\r
25 \r
26         if ((Type == EGST_WINDOWS_CLASSIC) || (Type == EGST_WINDOWS_METALLIC))\r
27         {\r
28                 Colors[EGDC_3D_DARK_SHADOW]     = video::SColor(101,50,50,50);\r
29                 Colors[EGDC_3D_SHADOW]          = video::SColor(101,130,130,130);\r
30                 Colors[EGDC_3D_FACE]            = video::SColor(101,210,210,210);\r
31                 Colors[EGDC_3D_HIGH_LIGHT]      = video::SColor(101,255,255,255);\r
32                 Colors[EGDC_3D_LIGHT]           = video::SColor(101,210,210,210);\r
33                 Colors[EGDC_ACTIVE_BORDER]      = video::SColor(101,16,14,115);\r
34                 Colors[EGDC_ACTIVE_CAPTION]     = video::SColor(255,255,255,255);\r
35                 Colors[EGDC_APP_WORKSPACE]      = video::SColor(101,100,100,100);\r
36                 Colors[EGDC_BUTTON_TEXT]        = video::SColor(240,10,10,10);\r
37                 Colors[EGDC_GRAY_TEXT]          = video::SColor(240,130,130,130);\r
38                 Colors[EGDC_HIGH_LIGHT]         = video::SColor(101,8,36,107);\r
39                 Colors[EGDC_HIGH_LIGHT_TEXT]    = video::SColor(240,255,255,255);\r
40                 Colors[EGDC_INACTIVE_BORDER]    = video::SColor(101,165,165,165);\r
41                 Colors[EGDC_INACTIVE_CAPTION]   = video::SColor(255,30,30,30);\r
42                 Colors[EGDC_TOOLTIP]            = video::SColor(200,0,0,0);\r
43                 Colors[EGDC_TOOLTIP_BACKGROUND] = video::SColor(200,255,255,225);\r
44                 Colors[EGDC_SCROLLBAR]          = video::SColor(101,230,230,230);\r
45                 Colors[EGDC_WINDOW]             = video::SColor(101,255,255,255);\r
46                 Colors[EGDC_WINDOW_SYMBOL]      = video::SColor(200,10,10,10);\r
47                 Colors[EGDC_ICON]               = video::SColor(200,255,255,255);\r
48                 Colors[EGDC_ICON_HIGH_LIGHT]    = video::SColor(200,8,36,107);\r
49                 Colors[EGDC_GRAY_WINDOW_SYMBOL] = video::SColor(240,100,100,100);\r
50                 Colors[EGDC_EDITABLE]                   = video::SColor(255,255,255,255);\r
51                 Colors[EGDC_GRAY_EDITABLE]              = video::SColor(255,120,120,120);\r
52                 Colors[EGDC_FOCUSED_EDITABLE]   = video::SColor(255,240,240,255);\r
53 \r
54 \r
55                 Sizes[EGDS_SCROLLBAR_SIZE] = 14;\r
56                 Sizes[EGDS_MENU_HEIGHT] = 30;\r
57                 Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;\r
58                 Sizes[EGDS_CHECK_BOX_WIDTH] = 18;\r
59                 Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;\r
60                 Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;\r
61                 Sizes[EGDS_BUTTON_WIDTH] = 80;\r
62                 Sizes[EGDS_BUTTON_HEIGHT] = 30;\r
63 \r
64                 Sizes[EGDS_TEXT_DISTANCE_X] = 2;\r
65                 Sizes[EGDS_TEXT_DISTANCE_Y] = 0;\r
66 \r
67                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 2;\r
68                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 0;\r
69         }\r
70         else\r
71         {\r
72                 //0x80a6a8af\r
73                 Colors[EGDC_3D_DARK_SHADOW]     =       0x60767982;\r
74                 //Colors[EGDC_3D_FACE]                  =       0xc0c9ccd4;             // tab background\r
75                 Colors[EGDC_3D_FACE]                    =       0xc0cbd2d9;             // tab background\r
76                 Colors[EGDC_3D_SHADOW]                  =       0x50e4e8f1;             // tab background, and left-top highlight\r
77                 Colors[EGDC_3D_HIGH_LIGHT]              =       0x40c7ccdc;\r
78                 Colors[EGDC_3D_LIGHT]                   =       0x802e313a;\r
79                 Colors[EGDC_ACTIVE_BORDER]              =       0x80404040;             // window title\r
80                 Colors[EGDC_ACTIVE_CAPTION]     =       0xffd0d0d0;\r
81                 Colors[EGDC_APP_WORKSPACE]              =       0xc0646464;             // unused\r
82                 Colors[EGDC_BUTTON_TEXT]                =       0xd0161616;\r
83                 Colors[EGDC_GRAY_TEXT]                  =       0x3c141414;\r
84                 Colors[EGDC_HIGH_LIGHT]                 =       0x6c606060;\r
85                 Colors[EGDC_HIGH_LIGHT_TEXT]    =       0xd0e0e0e0;\r
86                 Colors[EGDC_INACTIVE_BORDER]    =       0xf0a5a5a5;\r
87                 Colors[EGDC_INACTIVE_CAPTION]   =       0xffd2d2d2;\r
88                 Colors[EGDC_TOOLTIP]                    =       0xf00f2033;\r
89                 Colors[EGDC_TOOLTIP_BACKGROUND] =       0xc0cbd2d9;\r
90                 Colors[EGDC_SCROLLBAR]                  =       0xf0e0e0e0;\r
91                 Colors[EGDC_WINDOW]                             =       0xf0f0f0f0;\r
92                 Colors[EGDC_WINDOW_SYMBOL]              =       0xd0161616;\r
93                 Colors[EGDC_ICON]                               =       0xd0161616;\r
94                 Colors[EGDC_ICON_HIGH_LIGHT]    =       0xd0606060;\r
95                 Colors[EGDC_GRAY_WINDOW_SYMBOL] =       0x3c101010;\r
96                 Colors[EGDC_EDITABLE]                   =       0xf0ffffff;\r
97                 Colors[EGDC_GRAY_EDITABLE]              =       0xf0cccccc;\r
98                 Colors[EGDC_FOCUSED_EDITABLE]   =       0xf0fffff0;\r
99 \r
100                 Sizes[EGDS_SCROLLBAR_SIZE] = 14;\r
101                 Sizes[EGDS_MENU_HEIGHT] = 48;\r
102                 Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;\r
103                 Sizes[EGDS_CHECK_BOX_WIDTH] = 18;\r
104                 Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;\r
105                 Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;\r
106                 Sizes[EGDS_BUTTON_WIDTH] = 80;\r
107                 Sizes[EGDS_BUTTON_HEIGHT] = 30;\r
108 \r
109                 Sizes[EGDS_TEXT_DISTANCE_X] = 3;\r
110                 Sizes[EGDS_TEXT_DISTANCE_Y] = 2;\r
111 \r
112                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 3;\r
113                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 2;\r
114         }\r
115 \r
116         Sizes[EGDS_MESSAGE_BOX_GAP_SPACE] = 15;\r
117         Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH] = 0;\r
118         Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH] = 500;\r
119         Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT] = 0;\r
120         Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT] = 99999;\r
121 \r
122         Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X] = 1;\r
123         Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y] = 1;\r
124         Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_X] = 0;\r
125         Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y] = 2;\r
126         Sizes[EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X] = 0;\r
127         Sizes[EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y] = 0;\r
128 \r
129         Texts[EGDT_MSG_BOX_OK] = L"OK";\r
130         Texts[EGDT_MSG_BOX_CANCEL] = L"Cancel";\r
131         Texts[EGDT_MSG_BOX_YES] = L"Yes";\r
132         Texts[EGDT_MSG_BOX_NO] = L"No";\r
133         Texts[EGDT_WINDOW_CLOSE] = L"Close";\r
134         Texts[EGDT_WINDOW_RESTORE] = L"Restore";\r
135         Texts[EGDT_WINDOW_MINIMIZE] = L"Minimize";\r
136         Texts[EGDT_WINDOW_MAXIMIZE] = L"Maximize";\r
137 \r
138         Icons[EGDI_WINDOW_MAXIMIZE] = 225;\r
139         Icons[EGDI_WINDOW_RESTORE] = 226;\r
140         Icons[EGDI_WINDOW_CLOSE] = 227;\r
141         Icons[EGDI_WINDOW_MINIMIZE] = 228;\r
142         Icons[EGDI_CURSOR_UP] = 229;\r
143         Icons[EGDI_CURSOR_DOWN] = 230;\r
144         Icons[EGDI_CURSOR_LEFT] = 231;\r
145         Icons[EGDI_CURSOR_RIGHT] = 232;\r
146         Icons[EGDI_MENU_MORE] = 232;\r
147         Icons[EGDI_CHECK_BOX_CHECKED] = 233;\r
148         Icons[EGDI_DROP_DOWN] = 234;\r
149         Icons[EGDI_SMALL_CURSOR_UP] = 235;\r
150         Icons[EGDI_SMALL_CURSOR_DOWN] = 236;\r
151         Icons[EGDI_RADIO_BUTTON_CHECKED] = 237;\r
152         Icons[EGDI_MORE_LEFT] = 238;\r
153         Icons[EGDI_MORE_RIGHT] = 239;\r
154         Icons[EGDI_MORE_UP] = 240;\r
155         Icons[EGDI_MORE_DOWN] = 241;\r
156         Icons[EGDI_WINDOW_RESIZE] = 242;\r
157         Icons[EGDI_EXPAND] = 243;\r
158         Icons[EGDI_COLLAPSE] = 244;\r
159 \r
160         Icons[EGDI_FILE] = 245;\r
161         Icons[EGDI_DIRECTORY] = 246;\r
162 \r
163         for (u32 i=0; i<EGDF_COUNT; ++i)\r
164                 Fonts[i] = 0;\r
165 \r
166         UseGradient = (Type == EGST_WINDOWS_METALLIC) || (Type == EGST_BURNING_SKIN) ;\r
167 }\r
168 \r
169 \r
170 //! destructor\r
171 CGUISkin::~CGUISkin()\r
172 {\r
173         for (u32 i=0; i<EGDF_COUNT; ++i)\r
174         {\r
175                 if (Fonts[i])\r
176                         Fonts[i]->drop();\r
177         }\r
178 \r
179         if (SpriteBank)\r
180                 SpriteBank->drop();\r
181 }\r
182 \r
183 \r
184 //! returns default color\r
185 video::SColor CGUISkin::getColor(EGUI_DEFAULT_COLOR color) const\r
186 {\r
187         if ((u32)color < EGDC_COUNT)\r
188                 return Colors[color];\r
189         else\r
190                 return video::SColor();\r
191 }\r
192 \r
193 \r
194 //! sets a default color\r
195 void CGUISkin::setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)\r
196 {\r
197         if ((u32)which < EGDC_COUNT)\r
198                 Colors[which] = newColor;\r
199 }\r
200 \r
201 \r
202 //! returns size for the given size type\r
203 s32 CGUISkin::getSize(EGUI_DEFAULT_SIZE size) const\r
204 {\r
205         if ((u32)size < EGDS_COUNT)\r
206                 return Sizes[size];\r
207         else\r
208                 return 0;\r
209 }\r
210 \r
211 \r
212 //! sets a default size\r
213 void CGUISkin::setSize(EGUI_DEFAULT_SIZE which, s32 size)\r
214 {\r
215         if ((u32)which < EGDS_COUNT)\r
216                 Sizes[which] = size;\r
217 }\r
218 \r
219 \r
220 //! returns the default font\r
221 IGUIFont* CGUISkin::getFont(EGUI_DEFAULT_FONT which) const\r
222 {\r
223         if (((u32)which < EGDF_COUNT) && Fonts[which])\r
224                 return Fonts[which];\r
225         else\r
226                 return Fonts[EGDF_DEFAULT];\r
227 }\r
228 \r
229 \r
230 //! sets a default font\r
231 void CGUISkin::setFont(IGUIFont* font, EGUI_DEFAULT_FONT which)\r
232 {\r
233         if ((u32)which >= EGDF_COUNT)\r
234                 return;\r
235 \r
236         if (font)\r
237         {\r
238                 font->grab();\r
239                 if (Fonts[which])\r
240                         Fonts[which]->drop();\r
241 \r
242                 Fonts[which] = font;\r
243         }\r
244 }\r
245 \r
246 \r
247 //! gets the sprite bank stored\r
248 IGUISpriteBank* CGUISkin::getSpriteBank() const\r
249 {\r
250         return SpriteBank;\r
251 }\r
252 \r
253 \r
254 //! set a new sprite bank or remove one by passing 0\r
255 void CGUISkin::setSpriteBank(IGUISpriteBank* bank)\r
256 {\r
257         if (bank)\r
258                 bank->grab();\r
259 \r
260         if (SpriteBank)\r
261                 SpriteBank->drop();\r
262 \r
263         SpriteBank = bank;\r
264 }\r
265 \r
266 \r
267 //! Returns a default icon\r
268 u32 CGUISkin::getIcon(EGUI_DEFAULT_ICON icon) const\r
269 {\r
270         if ((u32)icon < EGDI_COUNT)\r
271                 return Icons[icon];\r
272         else\r
273                 return 0;\r
274 }\r
275 \r
276 \r
277 //! Sets a default icon\r
278 void CGUISkin::setIcon(EGUI_DEFAULT_ICON icon, u32 index)\r
279 {\r
280         if ((u32)icon < EGDI_COUNT)\r
281                 Icons[icon] = index;\r
282 }\r
283 \r
284 \r
285 //! Returns a default text. For example for Message box button captions:\r
286 //! "OK", "Cancel", "Yes", "No" and so on.\r
287 const wchar_t* CGUISkin::getDefaultText(EGUI_DEFAULT_TEXT text) const\r
288 {\r
289         if ((u32)text < EGDT_COUNT)\r
290                 return Texts[text].c_str();\r
291         else\r
292                 return Texts[0].c_str();\r
293 }\r
294 \r
295 \r
296 //! Sets a default text. For example for Message box button captions:\r
297 //! "OK", "Cancel", "Yes", "No" and so on.\r
298 void CGUISkin::setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText)\r
299 {\r
300         if ((u32)which < EGDT_COUNT)\r
301                 Texts[which] = newText;\r
302 }\r
303 \r
304 \r
305 //! draws a standard 3d button pane\r
306 /**     Used for drawing for example buttons in normal state.\r
307 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
308 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
309 \param rect: Defining area where to draw.\r
310 \param clip: Clip area.\r
311 \param element: Pointer to the element which wishes to draw this. This parameter\r
312 is usually not used by ISkin, but can be used for example by more complex\r
313 implementations to find out how to draw the part exactly. */\r
314 void CGUISkin::draw3DButtonPaneStandard(IGUIElement* element,\r
315                                         const core::rect<s32>& r,\r
316                                         const core::rect<s32>* clip)\r
317 {\r
318         if (!Driver)\r
319                 return;\r
320 \r
321         core::rect<s32> rect = r;\r
322 \r
323         if ( Type == EGST_BURNING_SKIN )\r
324         {\r
325                 rect.UpperLeftCorner.X -= 1;\r
326                 rect.UpperLeftCorner.Y -= 1;\r
327                 rect.LowerRightCorner.X += 1;\r
328                 rect.LowerRightCorner.Y += 1;\r
329                 draw3DSunkenPane(element,\r
330                                         getColor( EGDC_WINDOW ).getInterpolated( 0xFFFFFFFF, 0.9f )\r
331                                         ,false, true, rect, clip);\r
332                 return;\r
333         }\r
334 \r
335         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
336 \r
337         rect.LowerRightCorner.X -= 1;\r
338         rect.LowerRightCorner.Y -= 1;\r
339         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
340 \r
341         rect.UpperLeftCorner.X += 1;\r
342         rect.UpperLeftCorner.Y += 1;\r
343         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
344 \r
345         rect.LowerRightCorner.X -= 1;\r
346         rect.LowerRightCorner.Y -= 1;\r
347 \r
348         if (!UseGradient)\r
349         {\r
350                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
351         }\r
352         else\r
353         {\r
354                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
355                 const video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f);\r
356                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
357         }\r
358 }\r
359 \r
360 \r
361 //! draws a pressed 3d button pane\r
362 /**     Used for drawing for example buttons in pressed state.\r
363 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
364 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
365 \param rect: Defining area where to draw.\r
366 \param clip: Clip area.\r
367 \param element: Pointer to the element which wishes to draw this. This parameter\r
368 is usually not used by ISkin, but can be used for example by more complex\r
369 implementations to find out how to draw the part exactly. */\r
370 void CGUISkin::draw3DButtonPanePressed(IGUIElement* element,\r
371                                         const core::rect<s32>& r,\r
372                                         const core::rect<s32>* clip)\r
373 {\r
374         if (!Driver)\r
375                 return;\r
376 \r
377         core::rect<s32> rect = r;\r
378         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
379 \r
380         rect.LowerRightCorner.X -= 1;\r
381         rect.LowerRightCorner.Y -= 1;\r
382         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
383 \r
384         rect.UpperLeftCorner.X += 1;\r
385         rect.UpperLeftCorner.Y += 1;\r
386         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
387 \r
388         rect.UpperLeftCorner.X += 1;\r
389         rect.UpperLeftCorner.Y += 1;\r
390 \r
391         if (!UseGradient)\r
392         {\r
393                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
394         }\r
395         else\r
396         {\r
397                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
398                 const video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f);\r
399                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
400         }\r
401 }\r
402 \r
403 \r
404 //! draws a sunken 3d pane\r
405 /** Used for drawing the background of edit, combo or check boxes.\r
406 \param element: Pointer to the element which wishes to draw this. This parameter\r
407 is usually not used by ISkin, but can be used for example by more complex\r
408 implementations to find out how to draw the part exactly.\r
409 \param bgcolor: Background color.\r
410 \param flat: Specifies if the sunken pane should be flat or displayed as sunken\r
411 deep into the ground.\r
412 \param rect: Defining area where to draw.\r
413 \param clip: Clip area. */\r
414 void CGUISkin::draw3DSunkenPane(IGUIElement* element, video::SColor bgcolor,\r
415                                 bool flat, bool fillBackGround,\r
416                                 const core::rect<s32>& r,\r
417                                 const core::rect<s32>* clip)\r
418 {\r
419         if (!Driver)\r
420                 return;\r
421 \r
422         core::rect<s32> rect = r;\r
423 \r
424         if (fillBackGround)\r
425                 Driver->draw2DRectangle(bgcolor, rect, clip);\r
426 \r
427         if (flat)\r
428         {\r
429                 // draw flat sunken pane\r
430 \r
431                 rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
432                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // top\r
433 \r
434                 ++rect.UpperLeftCorner.Y;\r
435                 rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
436                 rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
437                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // left\r
438 \r
439                 rect = r;\r
440                 ++rect.UpperLeftCorner.Y;\r
441                 rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
442                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // right\r
443 \r
444                 rect = r;\r
445                 ++rect.UpperLeftCorner.X;\r
446                 rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
447                 --rect.LowerRightCorner.X;\r
448                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // bottom\r
449         }\r
450         else\r
451         {\r
452                 // draw deep sunken pane\r
453                 rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
454                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // top\r
455                 ++rect.UpperLeftCorner.X;\r
456                 ++rect.UpperLeftCorner.Y;\r
457                 --rect.LowerRightCorner.X;\r
458                 ++rect.LowerRightCorner.Y;\r
459                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
460 \r
461                 rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
462                 rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y+1;\r
463                 rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
464                 rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
465                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // left\r
466                 ++rect.UpperLeftCorner.X;\r
467                 ++rect.UpperLeftCorner.Y;\r
468                 ++rect.LowerRightCorner.X;\r
469                 --rect.LowerRightCorner.Y;\r
470                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
471 \r
472                 rect = r;\r
473                 rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
474                 ++rect.UpperLeftCorner.Y;\r
475                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // right\r
476                 --rect.UpperLeftCorner.X;\r
477                 ++rect.UpperLeftCorner.Y;\r
478                 --rect.LowerRightCorner.X;\r
479                 --rect.LowerRightCorner.Y;\r
480                 Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);\r
481 \r
482                 rect = r;\r
483                 ++rect.UpperLeftCorner.X;\r
484                 rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
485                 --rect.LowerRightCorner.X;\r
486                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // bottom\r
487                 ++rect.UpperLeftCorner.X;\r
488                 --rect.UpperLeftCorner.Y;\r
489                 --rect.LowerRightCorner.X;\r
490                 --rect.LowerRightCorner.Y;\r
491                 Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);\r
492         }\r
493 }\r
494 \r
495 \r
496 //! draws a window background\r
497 // return where to draw title bar text.\r
498 core::rect<s32> CGUISkin::draw3DWindowBackground(IGUIElement* element,\r
499                                 bool drawTitleBar, video::SColor titleBarColor,\r
500                                 const core::rect<s32>& r,\r
501                                 const core::rect<s32>* clip,\r
502                                 core::rect<s32>* checkClientArea)\r
503 {\r
504         if (!Driver)\r
505         {\r
506                 if ( checkClientArea )\r
507                 {\r
508                         *checkClientArea = r;\r
509                 }\r
510                 return r;\r
511         }\r
512 \r
513         core::rect<s32> rect = r;\r
514 \r
515         // top border\r
516         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
517         if ( !checkClientArea )\r
518         {\r
519                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
520         }\r
521 \r
522         // left border\r
523         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
524         rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
525         if ( !checkClientArea )\r
526         {\r
527                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
528         }\r
529 \r
530         // right border dark outer line\r
531         rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;\r
532         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
533         rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;\r
534         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
535         if ( !checkClientArea )\r
536         {\r
537                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
538         }\r
539 \r
540         // right border bright innner line\r
541         rect.UpperLeftCorner.X -= 1;\r
542         rect.LowerRightCorner.X -= 1;\r
543         rect.UpperLeftCorner.Y += 1;\r
544         rect.LowerRightCorner.Y -= 1;\r
545         if ( !checkClientArea )\r
546         {\r
547                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
548         }\r
549 \r
550         // bottom border dark outer line\r
551         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
552         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
553         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
554         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
555         if ( !checkClientArea )\r
556         {\r
557                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
558         }\r
559 \r
560         // bottom border bright inner line\r
561         rect.UpperLeftCorner.X += 1;\r
562         rect.LowerRightCorner.X -= 1;\r
563         rect.UpperLeftCorner.Y -= 1;\r
564         rect.LowerRightCorner.Y -= 1;\r
565         if ( !checkClientArea )\r
566         {\r
567                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
568         }\r
569 \r
570         // client area for background\r
571         rect = r;\r
572         rect.UpperLeftCorner.X +=1;\r
573         rect.UpperLeftCorner.Y +=1;\r
574         rect.LowerRightCorner.X -= 2;\r
575         rect.LowerRightCorner.Y -= 2;\r
576         if (checkClientArea)\r
577         {\r
578                 *checkClientArea = rect;\r
579         }\r
580 \r
581         if ( !checkClientArea )\r
582         {\r
583                 if (!UseGradient)\r
584                 {\r
585                         Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
586                 }\r
587                 else if ( Type == EGST_BURNING_SKIN )\r
588                 {\r
589                         const video::SColor c1 = getColor(EGDC_WINDOW).getInterpolated ( 0xFFFFFFFF, 0.9f );\r
590                         const video::SColor c2 = getColor(EGDC_WINDOW).getInterpolated ( 0xFFFFFFFF, 0.8f );\r
591 \r
592                         Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
593                 }\r
594                 else\r
595                 {\r
596                         const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
597                         const video::SColor c1 = getColor(EGDC_3D_FACE);\r
598                         Driver->draw2DRectangle(rect, c1, c1, c1, c2, clip);\r
599                 }\r
600         }\r
601 \r
602         // title bar\r
603         rect = r;\r
604         rect.UpperLeftCorner.X += 2;\r
605         rect.UpperLeftCorner.Y += 2;\r
606         rect.LowerRightCorner.X -= 2;\r
607         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + getSize(EGDS_WINDOW_BUTTON_WIDTH) + 2;\r
608 \r
609         if (drawTitleBar )\r
610         {\r
611                 if (checkClientArea)\r
612                 {\r
613                         (*checkClientArea).UpperLeftCorner.Y = rect.LowerRightCorner.Y;\r
614                 }\r
615                 else\r
616                 {\r
617                         // draw title bar\r
618                         //if (!UseGradient)\r
619                         //      Driver->draw2DRectangle(titleBarColor, rect, clip);\r
620                         //else\r
621                         if ( Type == EGST_BURNING_SKIN )\r
622                         {\r
623                                 const video::SColor c = titleBarColor.getInterpolated( video::SColor(titleBarColor.getAlpha(),255,255,255), 0.8f);\r
624                                 Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip);\r
625                         }\r
626                         else\r
627                         {\r
628                                 const video::SColor c = titleBarColor.getInterpolated(video::SColor(titleBarColor.getAlpha(),0,0,0), 0.2f);\r
629                                 Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip);\r
630                         }\r
631                 }\r
632         }\r
633 \r
634         return rect;\r
635 }\r
636 \r
637 \r
638 //! draws a standard 3d menu pane\r
639 /**     Used for drawing for menus and context menus.\r
640 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
641 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
642 \param element: Pointer to the element which wishes to draw this. This parameter\r
643 is usually not used by ISkin, but can be used for example by more complex\r
644 implementations to find out how to draw the part exactly.\r
645 \param rect: Defining area where to draw.\r
646 \param clip: Clip area. */\r
647 void CGUISkin::draw3DMenuPane(IGUIElement* element,\r
648                         const core::rect<s32>& r, const core::rect<s32>* clip)\r
649 {\r
650         if (!Driver)\r
651                 return;\r
652 \r
653         core::rect<s32> rect = r;\r
654 \r
655         if ( Type == EGST_BURNING_SKIN )\r
656         {\r
657                 rect.UpperLeftCorner.Y -= 3;\r
658                 draw3DButtonPaneStandard(element, rect, clip);\r
659                 return;\r
660         }\r
661 \r
662         // in this skin, this is exactly what non pressed buttons look like,\r
663         // so we could simply call\r
664         // draw3DButtonPaneStandard(element, rect, clip);\r
665         // here.\r
666         // but if the skin is transparent, this doesn't look that nice. So\r
667         // We draw it a little bit better, with some more draw2DRectangle calls,\r
668         // but there aren't that much menus visible anyway.\r
669 \r
670         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
671         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
672 \r
673         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
674         rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
675         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
676 \r
677         rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;\r
678         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
679         rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;\r
680         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
681         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
682 \r
683         rect.UpperLeftCorner.X -= 1;\r
684         rect.LowerRightCorner.X -= 1;\r
685         rect.UpperLeftCorner.Y += 1;\r
686         rect.LowerRightCorner.Y -= 1;\r
687         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
688 \r
689         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
690         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
691         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
692         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
693         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
694 \r
695         rect.UpperLeftCorner.X += 1;\r
696         rect.LowerRightCorner.X -= 1;\r
697         rect.UpperLeftCorner.Y -= 1;\r
698         rect.LowerRightCorner.Y -= 1;\r
699         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
700 \r
701         rect = r;\r
702         rect.UpperLeftCorner.X +=1;\r
703         rect.UpperLeftCorner.Y +=1;\r
704         rect.LowerRightCorner.X -= 2;\r
705         rect.LowerRightCorner.Y -= 2;\r
706 \r
707         if (!UseGradient)\r
708                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
709         else\r
710         {\r
711                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
712                 const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
713                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
714         }\r
715 }\r
716 \r
717 \r
718 //! draws a standard 3d tool bar\r
719 /**     Used for drawing for toolbars and menus.\r
720 \param element: Pointer to the element which wishes to draw this. This parameter\r
721 is usually not used by ISkin, but can be used for example by more complex\r
722 implementations to find out how to draw the part exactly.\r
723 \param rect: Defining area where to draw.\r
724 \param clip: Clip area. */\r
725 void CGUISkin::draw3DToolBar(IGUIElement* element,\r
726                                 const core::rect<s32>& r,\r
727                                 const core::rect<s32>* clip)\r
728 {\r
729         if (!Driver)\r
730                 return;\r
731 \r
732         core::rect<s32> rect = r;\r
733 \r
734         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
735         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
736         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
737         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
738         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
739 \r
740         rect = r;\r
741         rect.LowerRightCorner.Y -= 1;\r
742 \r
743         if (!UseGradient)\r
744         {\r
745                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
746         }\r
747         else\r
748         if ( Type == EGST_BURNING_SKIN )\r
749         {\r
750                 const video::SColor c1 = 0xF0000000 | getColor(EGDC_3D_FACE).color;\r
751                 const video::SColor c2 = 0xF0000000 | getColor(EGDC_3D_SHADOW).color;\r
752 \r
753                 rect.LowerRightCorner.Y += 1;\r
754                 Driver->draw2DRectangle(rect, c1, c2, c1, c2, clip);\r
755         }\r
756         else\r
757         {\r
758                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
759                 const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
760                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
761         }\r
762 }\r
763 \r
764 \r
765 //! draws a tab button\r
766 /**     Used for drawing for tab buttons on top of tabs.\r
767 \param element: Pointer to the element which wishes to draw this. This parameter\r
768 is usually not used by ISkin, but can be used for example by more complex\r
769 implementations to find out how to draw the part exactly.\r
770 \param active: Specifies if the tab is currently active.\r
771 \param rect: Defining area where to draw.\r
772 \param clip: Clip area. */\r
773 void CGUISkin::draw3DTabButton(IGUIElement* element, bool active,\r
774         const core::rect<s32>& frameRect, const core::rect<s32>* clip, EGUI_ALIGNMENT alignment)\r
775 {\r
776         if (!Driver)\r
777                 return;\r
778 \r
779         core::rect<s32> tr = frameRect;\r
780 \r
781         if ( alignment == EGUIA_UPPERLEFT )\r
782         {\r
783                 tr.LowerRightCorner.X -= 2;\r
784                 tr.LowerRightCorner.Y = tr.UpperLeftCorner.Y + 1;\r
785                 tr.UpperLeftCorner.X += 1;\r
786                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
787 \r
788                 // draw left highlight\r
789                 tr = frameRect;\r
790                 tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
791                 tr.UpperLeftCorner.Y += 1;\r
792                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
793 \r
794                 // draw grey background\r
795                 tr = frameRect;\r
796                 tr.UpperLeftCorner.X += 1;\r
797                 tr.UpperLeftCorner.Y += 1;\r
798                 tr.LowerRightCorner.X -= 2;\r
799                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
800 \r
801                 // draw right middle gray shadow\r
802                 tr.LowerRightCorner.X += 1;\r
803                 tr.UpperLeftCorner.X = tr.LowerRightCorner.X - 1;\r
804                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
805 \r
806                 tr.LowerRightCorner.X += 1;\r
807                 tr.UpperLeftCorner.X += 1;\r
808                 tr.UpperLeftCorner.Y += 1;\r
809                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), tr, clip);\r
810         }\r
811         else\r
812         {\r
813                 tr.LowerRightCorner.X -= 2;\r
814                 tr.UpperLeftCorner.Y = tr.LowerRightCorner.Y - 1;\r
815                 tr.UpperLeftCorner.X += 1;\r
816                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
817 \r
818                 // draw left highlight\r
819                 tr = frameRect;\r
820                 tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
821                 tr.LowerRightCorner.Y -= 1;\r
822                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
823 \r
824                 // draw grey background\r
825                 tr = frameRect;\r
826                 tr.UpperLeftCorner.X += 1;\r
827                 tr.UpperLeftCorner.Y -= 1;\r
828                 tr.LowerRightCorner.X -= 2;\r
829                 tr.LowerRightCorner.Y -= 1;\r
830                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
831 \r
832                 // draw right middle gray shadow\r
833                 tr.LowerRightCorner.X += 1;\r
834                 tr.UpperLeftCorner.X = tr.LowerRightCorner.X - 1;\r
835                 //tr.LowerRightCorner.Y -= 1;\r
836                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
837 \r
838                 tr.LowerRightCorner.X += 1;\r
839                 tr.UpperLeftCorner.X += 1;\r
840                 tr.LowerRightCorner.Y -= 1;\r
841                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), tr, clip);\r
842         }\r
843 }\r
844 \r
845 \r
846 //! draws a tab control body\r
847 /**     \param element: Pointer to the element which wishes to draw this. This parameter\r
848 is usually not used by ISkin, but can be used for example by more complex\r
849 implementations to find out how to draw the part exactly.\r
850 \param border: Specifies if the border should be drawn.\r
851 \param background: Specifies if the background should be drawn.\r
852 \param rect: Defining area where to draw.\r
853 \param clip: Clip area. */\r
854 void CGUISkin::draw3DTabBody(IGUIElement* element, bool border, bool background,\r
855         const core::rect<s32>& rect, const core::rect<s32>* clip, s32 tabHeight, EGUI_ALIGNMENT alignment)\r
856 {\r
857         if (!Driver)\r
858                 return;\r
859 \r
860         core::rect<s32> tr = rect;\r
861 \r
862         if ( tabHeight == -1 )\r
863                 tabHeight = getSize(gui::EGDS_BUTTON_HEIGHT);\r
864 \r
865         // draw border.\r
866         if (border)\r
867         {\r
868                 if ( alignment == EGUIA_UPPERLEFT )\r
869                 {\r
870                         // draw left hightlight\r
871                         tr.UpperLeftCorner.Y += tabHeight + 2;\r
872                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
873                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
874 \r
875                         // draw right shadow\r
876                         tr.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
877                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
878                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
879 \r
880                         // draw lower shadow\r
881                         tr = rect;\r
882                         tr.UpperLeftCorner.Y = tr.LowerRightCorner.Y - 1;\r
883                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
884                 }\r
885                 else\r
886                 {\r
887                         // draw left hightlight\r
888                         tr.LowerRightCorner.Y -= tabHeight + 2;\r
889                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
890                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
891 \r
892                         // draw right shadow\r
893                         tr.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
894                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
895                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
896 \r
897                         // draw lower shadow\r
898                         tr = rect;\r
899                         tr.LowerRightCorner.Y = tr.UpperLeftCorner.Y + 1;\r
900                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
901                 }\r
902         }\r
903 \r
904         if (background)\r
905         {\r
906                 if ( alignment == EGUIA_UPPERLEFT )\r
907                 {\r
908                         tr = rect;\r
909                         tr.UpperLeftCorner.Y += tabHeight + 2;\r
910                         tr.LowerRightCorner.X -= 1;\r
911                         tr.UpperLeftCorner.X += 1;\r
912                         tr.LowerRightCorner.Y -= 1;\r
913                 }\r
914                 else\r
915                 {\r
916                         tr = rect;\r
917                         tr.UpperLeftCorner.X += 1;\r
918                         tr.UpperLeftCorner.Y -= 1;\r
919                         tr.LowerRightCorner.X -= 1;\r
920                         tr.LowerRightCorner.Y -= tabHeight + 2;\r
921                         //tr.UpperLeftCorner.X += 1;\r
922                 }\r
923 \r
924                 if (!UseGradient)\r
925                         Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
926                 else\r
927                 {\r
928                         video::SColor c1 = getColor(EGDC_3D_FACE);\r
929                         video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
930                         Driver->draw2DRectangle(tr, c1, c1, c2, c2, clip);\r
931                 }\r
932         }\r
933 }\r
934 \r
935 \r
936 //! draws an icon, usually from the skin's sprite bank\r
937 /**     \param parent: Pointer to the element which wishes to draw this icon.\r
938 This parameter is usually not used by IGUISkin, but can be used for example\r
939 by more complex implementations to find out how to draw the part exactly.\r
940 \param icon: Specifies the icon to be drawn.\r
941 \param position: The position to draw the icon\r
942 \param starttime: The time at the start of the animation\r
943 \param currenttime: The present time, used to calculate the frame number\r
944 \param loop: Whether the animation should loop or not\r
945 \param clip: Clip area. */\r
946 void CGUISkin::drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,\r
947                         const core::position2di position,\r
948                         u32 starttime, u32 currenttime,\r
949                         bool loop, const core::rect<s32>* clip)\r
950 {\r
951         if (!SpriteBank)\r
952                 return;\r
953 \r
954         bool gray = element && !element->isEnabled();\r
955         SpriteBank->draw2DSprite(Icons[icon], position, clip,\r
956                         Colors[gray? EGDC_GRAY_WINDOW_SYMBOL : EGDC_WINDOW_SYMBOL], starttime, currenttime, loop, true);\r
957 }\r
958 \r
959 \r
960 EGUI_SKIN_TYPE CGUISkin::getType() const\r
961 {\r
962         return Type;\r
963 }\r
964 \r
965 \r
966 //! draws a 2d rectangle.\r
967 void CGUISkin::draw2DRectangle(IGUIElement* element,\r
968                 const video::SColor &color, const core::rect<s32>& pos,\r
969                 const core::rect<s32>* clip)\r
970 {\r
971         Driver->draw2DRectangle(color, pos, clip);\r
972 }\r
973 \r
974 } // end namespace gui\r
975 } // end namespace irr\r
976 \r
977 #endif // _IRR_COMPILE_WITH_GUI_\r
978 \r