Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUISkin.hpp
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 nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_GUI_SKIN_HPP_INCLUDED
6#define NIRT_I_GUI_SKIN_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IAttributeExchangingObject.hpp>
9#include <nirtcpp/core/engine/EGUIAlignment.hpp>
10#include <nirtcpp/core/engine/SColor.hpp>
11#include <nirtcpp/core/engine/rect.hpp>
12
13namespace nirt
14{
15namespace gui
16{
17 class IGUIFont;
18 class IGUISpriteBank;
19 class IGUIElement;
20
22
47
49 const c8* const GUISkinTypeNames[EGST_COUNT+1] =
50 {
51 "windowsClassic",
52 "windowsMetallic",
53 "burning",
54 "unknown",
55 0,
56 };
57
58
117
120 {
121 "3DDarkShadow",
122 "3DShadow",
123 "3DFace",
124 "3DHighlight",
125 "3DLight",
126 "ActiveBorder",
127 "ActiveCaption",
128 "AppWorkspace",
129 "ButtonText",
130 "GrayText",
131 "Highlight",
132 "HighlightText",
133 "InactiveBorder",
134 "InactiveCaption",
135 "ToolTip",
136 "ToolTipBackground",
137 "ScrollBar",
138 "Window",
139 "WindowSymbol",
140 "Icon",
141 "IconHighlight",
142 "GrayWindowSymbol",
143 "Editable",
144 "GrayEditable",
145 "FocusedEditable",
146 0,
147 };
148
203
204
207 {
208 "ScrollBarSize",
209 "MenuHeight",
210 "WindowButtonWidth",
211 "CheckBoxWidth",
212 "MessageBoxWidth",
213 "MessageBoxHeight",
214 "ButtonWidth",
215 "ButtonHeight",
216 "TextDistanceX",
217 "TextDistanceY",
218 "TitleBarTextX",
219 "TitleBarTextY",
220 "MessageBoxGapSpace",
221 "MessageBoxMinTextWidth",
222 "MessageBoxMaxTextWidth",
223 "MessageBoxMinTextHeight",
224 "MessageBoxMaxTextHeight",
225 "ButtonPressedImageOffsetX",
226 "ButtonPressedImageOffsetY",
227 "ButtonPressedTextOffsetX",
228 "ButtonPressedTextOffsetY",
229 "ButtonPressedSpriteOffsetX",
230 "ButtonPressedSpriteOffsetY",
231 0
232 };
233
234
257
260 {
261 "MessageBoxOkay",
262 "MessageBoxCancel",
263 "MessageBoxYes",
264 "MessageBoxNo",
265 "WindowButtonClose",
266 "WindowButtonMaximize",
267 "WindowButtonMinimize",
268 "WindowButtonRestore",
269 0
270 };
271
326
327 const c8* const GUISkinIconNames[EGDI_COUNT+1] =
328 {
329 "windowMaximize",
330 "windowRestore",
331 "windowClose",
332 "windowMinimize",
333 "windowResize",
334 "cursorUp",
335 "cursorDown",
336 "cursorLeft",
337 "cursorRight",
338 "menuMore",
339 "checkBoxChecked",
340 "dropDown",
341 "smallCursorUp",
342 "smallCursorDown",
343 "radioButtonChecked",
344 "moreLeft",
345 "moreRight",
346 "moreUp",
347 "moreDown",
348 "expand",
349 "collapse",
350 "file",
351 "directory",
352 0
353 };
354
355 // Customizable fonts
372
373 const c8* const GUISkinFontNames[EGDF_COUNT+1] =
374 {
375 "defaultFont",
376 "buttonFont",
377 "windowFont",
378 "menuFont",
379 "tooltipFont",
380 0
381 };
382
385 {
386 public:
387
389 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
390
392 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
393
395 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
396
398
400 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
401
403
405 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
406
408 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
409
412
414 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
415
417 virtual IGUISpriteBank* getSpriteBank() const = 0;
418
420 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
421
423
424 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
425
427
431 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
432
434
443 const core::rect<s32>& rect,
444 const core::rect<s32>* clip=0) = 0;
445
447
456 const core::rect<s32>& rect,
457 const core::rect<s32>* clip=0) = 0;
458
460
471 virtual void draw3DSunkenPane(IGUIElement* element,
472 video::SColor bgcolor, bool flat, bool fillBackGround,
473 const core::rect<s32>& rect,
474 const core::rect<s32>* clip=0) = 0;
475
477
491 bool drawTitleBar, video::SColor titleBarColor,
492 const core::rect<s32>& rect,
493 const core::rect<s32>* clip=0,
494 core::rect<s32>* checkClientArea=0) = 0;
495
497
505 virtual void draw3DMenuPane(IGUIElement* element,
506 const core::rect<s32>& rect,
507 const core::rect<s32>* clip=0) = 0;
508
510
516 virtual void draw3DToolBar(IGUIElement* element,
517 const core::rect<s32>& rect,
518 const core::rect<s32>* clip=0) = 0;
519
521
529 virtual void draw3DTabButton(IGUIElement* element, bool active,
530 const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
531
533
542 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
543 const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
544
546
555 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
556 const core::position2di position, u32 starttime=0, u32 currenttime=0,
557 bool loop=false, const core::rect<s32>* clip=0) = 0;
558
560
568 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
569 const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
570
572 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
573 };
574
575
576} // end namespace gui
577} // end namespace nirt
578
579#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Base class of all GUI elements.
Definition IGUIElement.hpp:24
Font interface.
Definition IGUIFont.hpp:40
A skin modifies the look of the GUI elements.
Definition IGUISkin.hpp:385
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index)=0
Sets a default icon.
virtual void draw3DButtonPaneStandard(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d button pane
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const =0
returns default color
virtual void draw3DTabButton(IGUIElement *element, bool active, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)=0
draws a tab button
virtual IGUIFont * getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const =0
returns the default font
virtual core::rect< s32 > draw3DWindowBackground(IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, core::rect< s32 > *checkClientArea=0)=0
draws a window background
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)=0
sets a default color
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size)=0
sets a default size
virtual void draw3DSunkenPane(IGUIElement *element, video::SColor bgcolor, bool flat, bool fillBackGround, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a sunken 3d pane
virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0
draws a 2d rectangle.
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const =0
returns size for the given size type
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const =0
Returns a default icon.
virtual void setFont(IGUIFont *font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT)=0
sets a default font
virtual void draw3DTabBody(IGUIElement *element, bool border, bool background, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT)=0
draws a tab control body
virtual void draw3DToolBar(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d tool bar
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t *newText)=0
Sets a default text.
virtual IGUISpriteBank * getSpriteBank() const =0
returns the sprite bank
virtual void draw3DButtonPanePressed(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a pressed 3d button pane
virtual const wchar_t * getDefaultText(EGUI_DEFAULT_TEXT text) const =0
Returns a default text.
virtual void setSpriteBank(IGUISpriteBank *bank)=0
sets the sprite bank
virtual EGUI_SKIN_TYPE getType() const
get the type of this skin
Definition IGUISkin.hpp:572
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)=0
draws an icon, usually from the skin's sprite bank
virtual void draw3DMenuPane(IGUIElement *element, const core::rect< s32 > &rect, const core::rect< s32 > *clip=0)=0
draws a standard 3d menu pane
Sprite bank interface.
Definition IGUISpriteBank.hpp:71
An object which is able to serialize and deserialize its attributes into an attributes object.
Definition IAttributeExchangingObject.hpp:54
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
EGUI_SKIN_TYPE
Enumeration of available default skins.
Definition IGUISkin.hpp:31
@ EGST_BURNING_SKIN
Burning's skin.
Definition IGUISkin.hpp:39
@ EGST_WINDOWS_METALLIC
Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons.
Definition IGUISkin.hpp:36
@ EGST_UNKNOWN
An unknown skin, not serializable at present.
Definition IGUISkin.hpp:42
@ EGST_WINDOWS_CLASSIC
Default windows look and feel.
Definition IGUISkin.hpp:33
@ EGST_COUNT
this value is not used, it only specifies the number of skin types
Definition IGUISkin.hpp:45
EGUI_DEFAULT_SIZE
Enumeration for default sizes.
Definition IGUISkin.hpp:151
@ EGDS_TITLEBARTEXT_DISTANCE_X
distance for text in the title bar, from the left of the window rect
Definition IGUISkin.hpp:173
@ EGDS_TEXT_DISTANCE_Y
distance for text from background
Definition IGUISkin.hpp:171
@ EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y
pixels to move an unscaled button sprite down when a button is pressed
Definition IGUISkin.hpp:197
@ EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y
pixels to move an unscaled button image down when a button is pressed and the unpressed image looks i...
Definition IGUISkin.hpp:189
@ EGDS_COUNT
Definition IGUISkin.hpp:201
@ EGDS_CHECK_BOX_WIDTH
width of a checkbox check
Definition IGUISkin.hpp:159
@ EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X
pixels to move an unscaled button sprite to the right when a button is pressed
Definition IGUISkin.hpp:195
@ EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH
maximal space to reserve for messagebox text-width
Definition IGUISkin.hpp:181
@ EGDS_BUTTON_WIDTH
width of a default button
Definition IGUISkin.hpp:165
@ EGDS_MESSAGE_BOX_WIDTH
Definition IGUISkin.hpp:161
@ EGDS_BUTTON_PRESSED_TEXT_OFFSET_X
pixels to move the button text to the right when a button is pressed
Definition IGUISkin.hpp:191
@ EGDS_TITLEBARTEXT_DISTANCE_Y
distance for text in the title bar, from the top of the window rect
Definition IGUISkin.hpp:175
@ EGDS_TEXT_DISTANCE_X
distance for text from background
Definition IGUISkin.hpp:169
@ EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT
minimal space to reserve for messagebox text-height
Definition IGUISkin.hpp:183
@ EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH
minimal space to reserve for messagebox text-width
Definition IGUISkin.hpp:179
@ EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X
pixels to move an unscaled button image to the right when a button is pressed and the unpressed image...
Definition IGUISkin.hpp:187
@ EGDS_BUTTON_HEIGHT
height of a default button (OK and cancel buttons)
Definition IGUISkin.hpp:167
@ EGDS_MESSAGE_BOX_GAP_SPACE
free space in a messagebox between borders and contents on all sides
Definition IGUISkin.hpp:177
@ EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y
pixels to move the button text down when a button is pressed
Definition IGUISkin.hpp:193
@ EGDS_MENU_HEIGHT
height of menu
Definition IGUISkin.hpp:155
@ EGDS_MESSAGE_BOX_HEIGHT
Definition IGUISkin.hpp:163
@ EGDS_WINDOW_BUTTON_WIDTH
width and height of a window titlebar button (like minimize/maximize/close buttons)....
Definition IGUISkin.hpp:157
@ EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT
maximal space to reserve for messagebox text-height
Definition IGUISkin.hpp:185
@ EGDS_SCROLLBAR_SIZE
default with / height of scrollbar. Also width of drop-down button in comboboxes.
Definition IGUISkin.hpp:153
EGUI_DEFAULT_FONT
Definition IGUISkin.hpp:357
@ EGDF_MENU
Font for menu items.
Definition IGUISkin.hpp:365
@ EGDF_TOOLTIP
Font for tooltips.
Definition IGUISkin.hpp:367
@ EGDF_BUTTON
Font for buttons.
Definition IGUISkin.hpp:361
@ EGDF_DEFAULT
For static text, edit boxes, lists and most other places.
Definition IGUISkin.hpp:359
@ EGDF_WINDOW
Font for window title bars.
Definition IGUISkin.hpp:363
@ EGDF_COUNT
Definition IGUISkin.hpp:370
const c8 *const GUISkinTypeNames[EGST_COUNT+1]
Names for gui element types.
Definition IGUISkin.hpp:49
const c8 *const GUISkinSizeNames[EGDS_COUNT+1]
Names for default skin sizes.
Definition IGUISkin.hpp:206
EGUI_ALIGNMENT
Definition EGUIAlignment.hpp:15
@ EGUIA_UPPERLEFT
Aligned to parent's top or left side (default)
Definition EGUIAlignment.hpp:17
EGUI_DEFAULT_ICON
Customizable symbols for GUI.
Definition IGUISkin.hpp:274
@ EGDI_MORE_RIGHT
‍icon indicating that there is more content to the right
Definition IGUISkin.hpp:308
@ EGDI_CURSOR_LEFT
scroll bar left button
Definition IGUISkin.hpp:290
@ EGDI_CURSOR_RIGHT
scroll bar right button
Definition IGUISkin.hpp:292
@ EGDI_EXPAND
plus icon for trees
Definition IGUISkin.hpp:314
@ EGDI_SMALL_CURSOR_UP
smaller up arrow
Definition IGUISkin.hpp:300
@ EGDI_COUNT
value not used, it only specifies the number of icons
Definition IGUISkin.hpp:324
@ EGDI_MENU_MORE
icon for menu children
Definition IGUISkin.hpp:294
@ EGDI_WINDOW_CLOSE
close window button
Definition IGUISkin.hpp:280
@ EGDI_WINDOW_RESIZE
resize icon for bottom right corner of a window
Definition IGUISkin.hpp:284
@ EGDI_SMALL_CURSOR_DOWN
smaller down arrow
Definition IGUISkin.hpp:302
@ EGDI_DROP_DOWN
down arrow for dropdown menus
Definition IGUISkin.hpp:298
@ EGDI_CURSOR_DOWN
scroll bar down button
Definition IGUISkin.hpp:288
@ EGDI_FILE
file icon for file selection
Definition IGUISkin.hpp:319
@ EGDI_DIRECTORY
folder icon for file selection
Definition IGUISkin.hpp:321
@ EGDI_CHECK_BOX_CHECKED
tick for checkbox
Definition IGUISkin.hpp:296
@ EGDI_WINDOW_MINIMIZE
minimize window button
Definition IGUISkin.hpp:282
@ EGDI_RADIO_BUTTON_CHECKED
selection dot in a radio button
Definition IGUISkin.hpp:304
@ EGDI_WINDOW_MAXIMIZE
maximize window button
Definition IGUISkin.hpp:276
@ EGDI_COLLAPSE
minus icon for trees
Definition IGUISkin.hpp:317
@ EGDI_CURSOR_UP
scroll bar up button
Definition IGUISkin.hpp:286
@ EGDI_MORE_LEFT
<< icon indicating there is more content to the left
Definition IGUISkin.hpp:306
@ EGDI_MORE_UP
icon indicating that there is more content above
Definition IGUISkin.hpp:310
@ EGDI_MORE_DOWN
icon indicating that there is more content below
Definition IGUISkin.hpp:312
@ EGDI_WINDOW_RESTORE
restore window button
Definition IGUISkin.hpp:278
const c8 *const GUISkinTextNames[EGDT_COUNT+1]
Names for default skin sizes.
Definition IGUISkin.hpp:259
EGUI_DEFAULT_COLOR
Enumeration for skin colors.
Definition IGUISkin.hpp:61
@ EGDC_3D_SHADOW
Shadow color for three-dimensional display elements (for edges facing away from the light source).
Definition IGUISkin.hpp:65
@ EGDC_GRAY_EDITABLE
Grayed (disabled) window background for editable field (editbox, checkbox-field)
Definition IGUISkin.hpp:109
@ EGDC_GRAY_WINDOW_SYMBOL
Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes.
Definition IGUISkin.hpp:105
@ EGDC_BUTTON_TEXT
Text on a button.
Definition IGUISkin.hpp:79
@ EGDC_3D_FACE
Face color for three-dimensional display elements and for dialog box backgrounds.
Definition IGUISkin.hpp:67
@ EGDC_ICON_HIGH_LIGHT
Selected icons in a list or tree.
Definition IGUISkin.hpp:103
@ EGDC_ICON
Icons in a list or tree.
Definition IGUISkin.hpp:101
@ EGDC_SCROLLBAR
Scrollbar gray area.
Definition IGUISkin.hpp:95
@ EGDC_TOOLTIP_BACKGROUND
Tool tip background color.
Definition IGUISkin.hpp:93
@ EGDC_FOCUSED_EDITABLE
Show focus of window background for editable field (editbox or when checkbox-field is pressed)
Definition IGUISkin.hpp:111
@ EGDC_GRAY_TEXT
Grayed (disabled) text.
Definition IGUISkin.hpp:81
@ EGDC_ACTIVE_BORDER
Active window border.
Definition IGUISkin.hpp:73
@ EGDC_3D_HIGH_LIGHT
Highlight color for three-dimensional display elements (for edges facing the light source....
Definition IGUISkin.hpp:69
@ EGDC_INACTIVE_BORDER
Inactive window border.
Definition IGUISkin.hpp:87
@ EGDC_3D_LIGHT
Light color for three-dimensional display elements (for edges facing the light source....
Definition IGUISkin.hpp:71
@ EGDC_HIGH_LIGHT
Item(s) selected in a control.
Definition IGUISkin.hpp:83
@ EGDC_ACTIVE_CAPTION
Active window title bar text.
Definition IGUISkin.hpp:75
@ EGDC_EDITABLE
Window background for editable field (editbox, checkbox-field)
Definition IGUISkin.hpp:107
@ EGDC_APP_WORKSPACE
Background color of multiple document interface (MDI) applications.
Definition IGUISkin.hpp:77
@ EGDC_WINDOW
Window background.
Definition IGUISkin.hpp:97
@ EGDC_3D_DARK_SHADOW
Dark shadow for three-dimensional display elements.
Definition IGUISkin.hpp:63
@ EGDC_TOOLTIP
Tool tip text color.
Definition IGUISkin.hpp:91
@ EGDC_WINDOW_SYMBOL
Window symbols like on close buttons, scroll bars and check boxes.
Definition IGUISkin.hpp:99
@ EGDC_INACTIVE_CAPTION
Inactive window caption.
Definition IGUISkin.hpp:89
@ EGDC_COUNT
Definition IGUISkin.hpp:115
@ EGDC_HIGH_LIGHT_TEXT
Text of item(s) selected in a control.
Definition IGUISkin.hpp:85
EGUI_DEFAULT_TEXT
Definition IGUISkin.hpp:236
@ EGDT_MSG_BOX_YES
Text for the Yes button on a message box.
Definition IGUISkin.hpp:242
@ EGDT_MSG_BOX_NO
Text for the No button on a message box.
Definition IGUISkin.hpp:244
@ EGDT_WINDOW_MINIMIZE
Tooltip text for window minimize button.
Definition IGUISkin.hpp:250
@ EGDT_MSG_BOX_CANCEL
Text for the Cancel button on a message box.
Definition IGUISkin.hpp:240
@ EGDT_WINDOW_CLOSE
Tooltip text for window close button.
Definition IGUISkin.hpp:246
@ EGDT_MSG_BOX_OK
Text for the OK button on a message box.
Definition IGUISkin.hpp:238
@ EGDT_COUNT
this value is not used, it only specifies the number of default texts
Definition IGUISkin.hpp:255
@ EGDT_WINDOW_MAXIMIZE
Tooltip text for window maximize button.
Definition IGUISkin.hpp:248
@ EGDT_WINDOW_RESTORE
Tooltip text for window restore button.
Definition IGUISkin.hpp:252
const c8 *const GUISkinColorNames[EGDC_COUNT+1]
Names for default skin colors.
Definition IGUISkin.hpp:119
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
char c8
8 bit character variable.
Definition irrTypes.hpp:37

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print