5#ifndef __GUI_SKIN_H_INCLUDED__
6#define __GUI_SKIN_H_INCLUDED__
25 GUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver);
37 virtual video::SColor
getColor(EGUI_DEFAULT_COLOR color)
const;
40 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor);
43 virtual s32
getSize(EGUI_DEFAULT_SIZE size)
const;
46 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size);
49 virtual IGUIFont*
getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT)
const;
52 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT);
62 virtual u32
getIcon(EGUI_DEFAULT_ICON icon)
const;
69 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index);
74 virtual const wchar_t*
getDefaultText(EGUI_DEFAULT_TEXT text)
const;
79 virtual void setDefaultText(EGUI_DEFAULT_TEXT which,
const wchar_t* newText);
91 const core::rect<s32>& rect,
92 const core::rect<s32>* clip=0)
98 const core::rect<s32>& rect,
99 const core::rect<s32>* clip=0,
100 const video::SColor* colors=0);
112 const core::rect<s32>& rect,
113 const core::rect<s32>* clip=0)
119 const core::rect<s32>& rect,
120 const core::rect<s32>* clip=0,
121 const video::SColor* colors=0);
134 video::SColor bgcolor,
bool flat,
136 const core::rect<s32>& rect,
137 const core::rect<s32>* clip=0)
143 video::SColor bgcolor,
bool flat,
145 const core::rect<s32>& rect,
146 const core::rect<s32>* clip=0,
147 const video::SColor* colors=0);
164 bool drawTitleBar, video::SColor titleBarColor,
165 const core::rect<s32>& rect,
166 const core::rect<s32>* clip,
167 core::rect<s32>* checkClientArea)
170 rect, clip, checkClientArea);
174 bool drawTitleBar, video::SColor titleBarColor,
175 const core::rect<s32>& rect,
176 const core::rect<s32>* clip,
177 core::rect<s32>* checkClientArea,
178 const video::SColor* colors=0);
190 const core::rect<s32>& rect,
191 const core::rect<s32>* clip=0)
197 const core::rect<s32>& rect,
198 const core::rect<s32>* clip=0,
199 const video::SColor* colors=0);
209 const core::rect<s32>& rect,
210 const core::rect<s32>* clip=0)
216 const core::rect<s32>& rect,
217 const core::rect<s32>* clip=0,
218 const video::SColor* colors=0);
229 const core::rect<s32>& rect,
const core::rect<s32>* clip=0, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)
235 const core::rect<s32>& rect,
const core::rect<s32>* clip=0, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT,
236 const video::SColor* colors=0);
246 virtual void draw3DTabBody(IGUIElement* element,
bool border,
bool background,
247 const core::rect<s32>& rect,
const core::rect<s32>* clip=0, s32 tabHeight=-1, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)
253 const core::rect<s32>& rect,
const core::rect<s32>* clip=0, s32 tabHeight=-1, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT,
254 const video::SColor* colors=0);
266 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
267 const core::position2di position,
268 u32 starttime=0, u32 currenttime=0,
269 bool loop=
false,
const core::rect<s32>* clip=0)
271 drawColoredIcon(element, icon, position, starttime, currenttime, loop, clip);
274 virtual void drawColoredIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
275 const core::position2di position,
276 u32 starttime=0, u32 currenttime=0,
277 bool loop=
false,
const core::rect<s32>* clip=0,
278 const video::SColor* colors=0);
289 virtual void draw2DRectangle(IGUIElement* element,
const video::SColor &color,
290 const core::rect<s32>& pos,
const core::rect<s32>* clip = 0);
294 virtual EGUI_SKIN_TYPE
getType()
const;
297 virtual void getColors(video::SColor* colors);
314 #define set3DSkinColors(skin, button_color) \
316 skin->setColor(EGDC_3D_FACE, button_color); \
317 skin->setColor(EGDC_3D_DARK_SHADOW, button_color, 0.25f); \
318 skin->setColor(EGDC_3D_SHADOW, button_color, 0.5f); \
319 skin->setColor(EGDC_3D_LIGHT, button_color); \
320 skin->setColor(EGDC_3D_HIGH_LIGHT, button_color, 1.5f); \
323 #define getElementSkinColor(color) \
327 IGUISkin* skin = Environment->getSkin(); \
329 return skin->getColor(color); \
331 return Colors[color]; \
334 #define setElementSkinColor(which, newColor, shading) \
338 Colors = new video::SColor[EGDC_COUNT]; \
339 GUISkin* skin = (GUISkin *)Environment->getSkin(); \
341 skin->getColors(Colors); \
343 Colors[which] = newColor; \
344 setShading(Colors[which],shading); \
352 color.setRed(color.getRed() * s);
353 color.setGreen(color.getGreen() * s);
354 color.setBlue(color.getBlue() * s);
360 color.setRed(color.getRed() + (255 - color.getRed()) * s);
361 color.setGreen(color.getGreen() + (255 - color.getGreen()) * s);
362 color.setBlue(color.getBlue() + (255 - color.getBlue()) * s);
virtual void draw3DButtonPanePressed(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)
draws a pressed 3d button pane
Definition guiSkin.h:111
virtual void draw3DToolBar(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)
draws a standard 3d tool bar
Definition guiSkin.h:208
virtual void drawColored3DToolBar(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws a standard 3d tool bar
Definition guiSkin.cpp:754
IGUIFont * Fonts[EGDF_COUNT]
Definition guiSkin.h:305
float Scale
Definition guiSkin.h:301
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t *newText)
Sets a default text.
Definition guiSkin.cpp:297
virtual core::rect< s32 > draw3DWindowBackground(IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip, core::rect< s32 > *checkClientArea)
draws a window background
Definition guiSkin.h:163
EGUI_SKIN_TYPE Type
Definition guiSkin.h:311
virtual void drawColored3DSunkenPane(IGUIElement *element, video::SColor bgcolor, bool flat, bool fillBackGround, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws a sunken 3d pane
Definition guiSkin.cpp:426
virtual void drawColored3DTabBody(IGUIElement *element, bool border, bool background, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, s32 tabHeight=-1, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT, const video::SColor *colors=0)
draws a tab control body
Definition guiSkin.cpp:894
virtual void setSpriteBank(IGUISpriteBank *bank)
sets the sprite bank used for drawing icons
Definition guiSkin.cpp:254
virtual void getColors(video::SColor *colors)
gets the colors
Definition guiSkin.cpp:1028
IGUISpriteBank * SpriteBank
Definition guiSkin.h:306
virtual void drawColored3DTabButton(IGUIElement *element, bool active, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT, const video::SColor *colors=0)
draws a tab button
Definition guiSkin.cpp:807
virtual void drawIcon(IGUIElement *element, EGUI_DEFAULT_ICON icon, const core::position2di position, u32 starttime=0, u32 currenttime=0, bool loop=false, const core::rect< s32 > *clip=0)
draws an icon, usually from the skin's sprite bank
Definition guiSkin.h:266
virtual EGUI_SKIN_TYPE getType() const
get the type of this skin
Definition guiSkin.cpp:1011
virtual void drawColoredIcon(IGUIElement *element, EGUI_DEFAULT_ICON icon, const core::position2di position, u32 starttime=0, u32 currenttime=0, bool loop=false, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws an icon, usually from the skin's sprite bank
Definition guiSkin.cpp:992
u32 Icons[EGDI_COUNT]
Definition guiSkin.h:304
s32 Sizes[EGDS_COUNT]
Definition guiSkin.h:303
virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)
draws a 2d rectangle.
Definition guiSkin.cpp:1018
virtual void drawColored3DButtonPaneStandard(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws a standard 3d button pane
Definition guiSkin.cpp:314
virtual IGUIFont * getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const
returns the default font
Definition guiSkin.cpp:220
virtual IGUISpriteBank * getSpriteBank() const
gets the sprite bank used for drawing icons
Definition guiSkin.cpp:247
virtual void draw3DButtonPaneStandard(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)
draws a standard 3d button pane
Definition guiSkin.h:90
virtual void setScale(float scale)
sets display density scaling factor
Definition guiSkin.h:34
GUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver *driver)
Definition guiSkin.cpp:20
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size)
sets a default size
Definition guiSkin.cpp:212
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)
sets a default color
Definition guiSkin.cpp:194
video::IVideoDriver * Driver
Definition guiSkin.h:308
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const
returns size for the given size type
Definition guiSkin.cpp:202
virtual core::rect< s32 > drawColored3DWindowBackground(IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip, core::rect< s32 > *checkClientArea, const video::SColor *colors=0)
draws a window background
Definition guiSkin.cpp:515
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const
returns default color
Definition guiSkin.cpp:184
virtual void draw3DMenuPane(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)
draws a standard 3d menu pane
Definition guiSkin.h:189
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index)
Sets a default icon.
Definition guiSkin.cpp:277
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const
Returns a default icon.
Definition guiSkin.cpp:267
virtual void draw3DTabButton(IGUIElement *element, bool active, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)
draws a tab button
Definition guiSkin.h:228
virtual void draw3DTabBody(IGUIElement *element, bool border, bool background, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, s32 tabHeight=-1, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)
draws a tab control body
Definition guiSkin.h:246
virtual const wchar_t * getDefaultText(EGUI_DEFAULT_TEXT text) const
Returns a default text.
Definition guiSkin.cpp:286
virtual void draw3DSunkenPane(IGUIElement *element, video::SColor bgcolor, bool flat, bool fillBackGround, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)
draws a sunken 3d pane
Definition guiSkin.h:133
virtual ~GUISkin()
destructor
Definition guiSkin.cpp:170
virtual float getScale() const
returns display density scaling factor
Definition guiSkin.h:31
virtual void drawColored3DButtonPanePressed(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws a pressed 3d button pane
Definition guiSkin.cpp:376
virtual void setFont(IGUIFont *font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT)
sets a default font
Definition guiSkin.cpp:230
core::stringw Texts[EGDT_COUNT]
Definition guiSkin.h:307
bool UseGradient
Definition guiSkin.h:309
video::SColor Colors[EGDC_COUNT]
Definition guiSkin.h:302
virtual void drawColored3DMenuPane(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, const video::SColor *colors=0)
draws a standard 3d menu pane
Definition guiSkin.cpp:670
void setShading(video::SColor &color, f32 s)
Sets the shading.
Definition guiSkin.h:348