Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# IGUISkin.h

Go to the documentation of this file.

    00001 // Copyright (C) 2002-2010 Nikolaus Gebhardt
    00002 // This file is part of the "Irrlicht Engine".
    00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
    00004
    00005 #ifndef __I_GUI_SKIN_H_INCLUDED__
    00006 #define __I_GUI_SKIN_H_INCLUDED__
    00007
    00008 #include "IAttributeExchangingObject.h"
    00009 #include "EGUIAlignment.h"
    00010 #include "SColor.h"
    00011 #include "rect.h"
    00012
    00013 namespace irr
    00014 {
    00015 namespace gui
    00016 {
    00017         class IGUIFont;
    00018         class IGUISpriteBank;
    00019         class IGUIElement;
    00020
    00022
    00030         enum EGUI_SKIN_TYPE
    00031         {
    00033                 EGST_WINDOWS_CLASSIC=0,
    00035                 EGST_WINDOWS_METALLIC,
    00037                 EGST_BURNING_SKIN,
    00038
    00040                 EGST_UNKNOWN,
    00041
    00043                 EGST_COUNT
    00044         };
    00045
    00047         const c8* const GUISkinTypeNames[EGST_COUNT+1] =
    00048         {
    00049                 "windowsClassic",
    00050                 "windowsMetallic",
    00051                 "burning",
    00052                 "unknown",
    00053                 0,
    00054         };
    00055
    00056
    00058         enum EGUI_DEFAULT_COLOR
    00059         {
    00061                 EGDC_3D_DARK_SHADOW = 0,
    00063                 EGDC_3D_SHADOW,
    00065                 EGDC_3D_FACE,
    00067                 EGDC_3D_HIGH_LIGHT,
    00069                 EGDC_3D_LIGHT,
    00071                 EGDC_ACTIVE_BORDER,
    00073                 EGDC_ACTIVE_CAPTION,
    00075                 EGDC_APP_WORKSPACE,
    00077                 EGDC_BUTTON_TEXT,
    00079                 EGDC_GRAY_TEXT,
    00081                 EGDC_HIGH_LIGHT,
    00083                 EGDC_HIGH_LIGHT_TEXT,
    00085                 EGDC_INACTIVE_BORDER,
    00087                 EGDC_INACTIVE_CAPTION,
    00089                 EGDC_TOOLTIP,
    00091                 EGDC_TOOLTIP_BACKGROUND,
    00093                 EGDC_SCROLLBAR,
    00095                 EGDC_WINDOW,
    00097                 EGDC_WINDOW_SYMBOL,
    00099                 EGDC_ICON,
    00101                 EGDC_ICON_HIGH_LIGHT,
    00104                 EGDC_COUNT
    00105         };
    00106
    00108         const c8* const GUISkinColorNames[EGDC_COUNT+1] =
    00109         {
    00110                 "3DDarkShadow",
    00111                 "3DShadow",
    00112                 "3DFace",
    00113                 "3DHighlight",
    00114                 "3DLight",
    00115                 "ActiveBorder",
    00116                 "ActiveCaption",
    00117                 "AppWorkspace",
    00118                 "ButtonText",
    00119                 "GrayText",
    00120                 "Highlight",
    00121                 "HighlightText",
    00122                 "InactiveBorder",
    00123                 "InactiveCaption",
    00124                 "ToolTip",
    00125                 "ToolTipBackground",
    00126                 "ScrollBar",
    00127                 "Window",
    00128                 "WindowSymbol",
    00129                 "Icon",
    00130                 "IconHighlight",
    00131                 0,
    00132         };
    00133
    00135         enum EGUI_DEFAULT_SIZE
    00136         {
    00138                 EGDS_SCROLLBAR_SIZE = 0,
    00140                 EGDS_MENU_HEIGHT,
    00142                 EGDS_WINDOW_BUTTON_WIDTH,
    00144                 EGDS_CHECK_BOX_WIDTH,
    00146                 EGDS_MESSAGE_BOX_WIDTH,
    00148                 EGDS_MESSAGE_BOX_HEIGHT,
    00150                 EGDS_BUTTON_WIDTH,
    00152                 EGDS_BUTTON_HEIGHT,
    00154                 EGDS_TEXT_DISTANCE_X,
    00156                 EGDS_TEXT_DISTANCE_Y,
    00158                 EGDS_TITLEBARTEXT_DISTANCE_X,
    00160                 EGDS_TITLEBARTEXT_DISTANCE_Y,
    00162                 EGDS_MESSAGE_BOX_GAP_SPACE,
    00164                 EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH,
    00166                 EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH,
    00168                 EGDS_MESSAGE_BOX_MAX_TEST_WIDTH = EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH,
    00170                 EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
    00172                 EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
    00173
    00176                 EGDS_COUNT
    00177         };
    00178
    00179
    00181         const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
    00182         {
    00183                 "ScrollBarSize",
    00184                 "MenuHeight",
    00185                 "WindowButtonWidth",
    00186                 "CheckBoxWidth",
    00187                 "MessageBoxWidth",
    00188                 "MessageBoxHeight",
    00189                 "ButtonWidth",
    00190                 "ButtonHeight",
    00191                 "TextDistanceX",
    00192                 "TextDistanceY",
    00193                 "TitleBarTextX",
    00194                 "TitleBarTextY",
    00195                 "MessageBoxGapSpace",
    00196                 "MessageBoxMinTextWidth",
    00197                 "MessageBoxMaxTextWidth",
    00198                 "MessageBoxMinTextHeight",
    00199                 "MessageBoxMaxTextHeight",
    00200                 0
    00201         };
    00202
    00203
    00204         enum EGUI_DEFAULT_TEXT
    00205         {
    00207                 EGDT_MSG_BOX_OK = 0,
    00209                 EGDT_MSG_BOX_CANCEL,
    00211                 EGDT_MSG_BOX_YES,
    00213                 EGDT_MSG_BOX_NO,
    00215                 EGDT_WINDOW_CLOSE,
    00217                 EGDT_WINDOW_MAXIMIZE,
    00219                 EGDT_WINDOW_MINIMIZE,
    00221                 EGDT_WINDOW_RESTORE,
    00222
    00224                 EGDT_COUNT
    00225         };
    00226
    00228         const c8* const GUISkinTextNames[EGDT_COUNT+1] =
    00229         {
    00230                 "MessageBoxOkay",
    00231                 "MessageBoxCancel",
    00232                 "MessageBoxYes",
    00233                 "MessageBoxNo",
    00234                 "WindowButtonClose",
    00235                 "WindowButtonMaximize",
    00236                 "WindowButtonMinimize",
    00237                 "WindowButtonRestore",
    00238                 0
    00239         };
    00240
    00242         enum EGUI_DEFAULT_ICON
    00243         {
    00245                 EGDI_WINDOW_MAXIMIZE = 0,
    00247                 EGDI_WINDOW_RESTORE,
    00249                 EGDI_WINDOW_CLOSE,
    00251                 EGDI_WINDOW_MINIMIZE,
    00253                 EGDI_WINDOW_RESIZE,
    00255                 EGDI_CURSOR_UP,
    00257                 EGDI_CURSOR_DOWN,
    00259                 EGDI_CURSOR_LEFT,
    00261                 EGDI_CURSOR_RIGHT,
    00263                 EGDI_MENU_MORE,
    00265                 EGDI_CHECK_BOX_CHECKED,
    00267                 EGDI_DROP_DOWN,
    00269                 EGDI_SMALL_CURSOR_UP,
    00271                 EGDI_SMALL_CURSOR_DOWN,
    00273                 EGDI_RADIO_BUTTON_CHECKED,
    00275                 EGDI_MORE_LEFT,
    00277                 EGDI_MORE_RIGHT,
    00279                 EGDI_MORE_UP,
    00281                 EGDI_MORE_DOWN,
    00283                 EGDI_EXPAND,
    00285                 EGDI_COLLAPSE,
    00287                 EGDI_FILE,
    00289                 EGDI_DIRECTORY,
    00290
    00292                 EGDI_COUNT
    00293         };
    00294
    00295         const c8* const GUISkinIconNames[EGDI_COUNT+1] =
    00296         {
    00297                 "windowMaximize",
    00298                 "windowRestore",
    00299                 "windowClose",
    00300                 "windowMinimize",
    00301                 "windowResize",
    00302                 "cursorUp",
    00303                 "cursorDown",
    00304                 "cursorLeft",
    00305                 "cursorRight",
    00306                 "menuMore",
    00307                 "checkBoxChecked",
    00308                 "dropDown",
    00309                 "smallCursorUp",
    00310                 "smallCursorDown",
    00311                 "radioButtonChecked",
    00312                 "moreLeft",
    00313                 "moreRight",
    00314                 "moreUp",
    00315                 "moreDown",
    00316                 "expand",
    00317                 "collapse",
    00318                 "file",
    00319                 "directory",
    00320                 0
    00321         };
    00322
    00323         // Customizable fonts
    00324         enum EGUI_DEFAULT_FONT
    00325         {
    00327                 EGDF_DEFAULT=0,
    00329                 EGDF_BUTTON,
    00331                 EGDF_WINDOW,
    00333                 EGDF_MENU,
    00335                 EGDF_TOOLTIP,
    00338                 EGDF_COUNT
    00339         };
    00340
    00341         const c8* const GUISkinFontNames[EGDF_COUNT+1] =
    00342         {
    00343                 "defaultFont",
    00344                 "buttonFont",
    00345                 "windowFont",
    00346                 "menuFont",
    00347                 "tooltipFont",
    00348                 0
    00349         };
    00350
    00352         class IGUISkin : public virtual io::IAttributeExchangingObject
    00353         {
    00354         public:
    00355
    00357                 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
    00358
    00360                 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
    00361
    00363                 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
    00364
    00366
    00368                 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
    00369
    00371
    00373                 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
    00374
    00376                 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
    00377
    00379                 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
    00380
    00382                 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
    00383
    00385                 virtual IGUISpriteBank* getSpriteBank() const = 0;
    00386
    00388                 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
    00389
    00391
    00392                 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
    00393
    00395
    00399                 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
    00400
    00402
    00410                 virtual void draw3DButtonPaneStandard(IGUIElement* element,
    00411                         const core::rect<s32>& rect,
    00412                         const core::rect<s32>* clip=0) = 0;
    00413
    00415
    00423                 virtual void draw3DButtonPanePressed(IGUIElement* element,
    00424                         const core::rect<s32>& rect,
    00425                         const core::rect<s32>* clip=0) = 0;
    00426
    00428
    00439                 virtual void draw3DSunkenPane(IGUIElement* element,
    00440                         video::SColor bgcolor, bool flat, bool fillBackGround,
    00441                         const core::rect<s32>& rect,
    00442                         const core::rect<s32>* clip=0) = 0;
    00443
    00445
    00458                 virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
    00459                         bool drawTitleBar, video::SColor titleBarColor,
    00460                         const core::rect<s32>& rect,
    00461                         const core::rect<s32>* clip=0,
    00462                         core::rect<s32>* checkClientArea=0) = 0;
    00463
    00465
    00473                 virtual void draw3DMenuPane(IGUIElement* element,
    00474                         const core::rect<s32>& rect,
    00475                         const core::rect<s32>* clip=0) = 0;
    00476
    00478
    00484                 virtual void draw3DToolBar(IGUIElement* element,
    00485                         const core::rect<s32>& rect,
    00486                         const core::rect<s32>* clip=0) = 0;
    00487
    00489
    00497                 virtual void draw3DTabButton(IGUIElement* element, bool active,
    00498                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
    00499
    00501
    00510                 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
    00511                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
    00512
    00514
    00523                 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
    00524                         const core::position2di position, u32 starttime=0, u32 currenttime=0,
    00525                         bool loop=false, const core::rect<s32>* clip=0) = 0;
    00526
    00528
    00536                 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
    00537                         const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
    00538
    00540                 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
    00541         };
    00542
    00543
    00544 } // end namespace gui
    00545 } // end namespace irr
    00546
    00547 #endif
    00548

| The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:56 2010 by Doxygen (1.6.2)