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-2009 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_TEST_WIDTH,
    00168                 EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
    00170                 EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
    00171
    00174                 EGDS_COUNT
    00175         };
    00176
    00177
    00179         const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
    00180         {
    00181                 "ScrollBarSize",
    00182                 "MenuHeight",
    00183                 "WindowButtonWidth",
    00184                 "CheckBoxWidth",
    00185                 "MessageBoxWidth",
    00186                 "MessageBoxHeight",
    00187                 "ButtonWidth",
    00188                 "ButtonHeight",
    00189                 "TextDistanceX",
    00190                 "TextDistanceY",
    00191                 "TitleBarTextX",
    00192                 "TitleBarTextY",
    00193                 "MessageBoxGapSpace",
    00194                 "MessageBoxMinTextWidth",
    00195                 "MessageBoxMaxTextWidth",
    00196                 "MessageBoxMinTextHeight",
    00197                 "MessageBoxMaxTextHeight",
    00198                 0
    00199         };
    00200
    00201
    00202         enum EGUI_DEFAULT_TEXT
    00203         {
    00205                 EGDT_MSG_BOX_OK = 0,
    00207                 EGDT_MSG_BOX_CANCEL,
    00209                 EGDT_MSG_BOX_YES,
    00211                 EGDT_MSG_BOX_NO,
    00213                 EGDT_WINDOW_CLOSE,
    00215                 EGDT_WINDOW_MAXIMIZE,
    00217                 EGDT_WINDOW_MINIMIZE,
    00219                 EGDT_WINDOW_RESTORE,
    00220
    00222                 EGDT_COUNT
    00223         };
    00224
    00226         const c8* const GUISkinTextNames[EGDT_COUNT+1] =
    00227         {
    00228                 "MessageBoxOkay",
    00229                 "MessageBoxCancel",
    00230                 "MessageBoxYes",
    00231                 "MessageBoxNo",
    00232                 "WindowButtonClose",
    00233                 "WindowButtonMaximize",
    00234                 "WindowButtonMinimize",
    00235                 "WindowButtonRestore",
    00236                 0
    00237         };
    00238
    00240         enum EGUI_DEFAULT_ICON
    00241         {
    00243                 EGDI_WINDOW_MAXIMIZE = 0,
    00245                 EGDI_WINDOW_RESTORE,
    00247                 EGDI_WINDOW_CLOSE,
    00249                 EGDI_WINDOW_MINIMIZE,
    00251                 EGDI_WINDOW_RESIZE,
    00253                 EGDI_CURSOR_UP,
    00255                 EGDI_CURSOR_DOWN,
    00257                 EGDI_CURSOR_LEFT,
    00259                 EGDI_CURSOR_RIGHT,
    00261                 EGDI_MENU_MORE,
    00263                 EGDI_CHECK_BOX_CHECKED,
    00265                 EGDI_DROP_DOWN,
    00267                 EGDI_SMALL_CURSOR_UP,
    00269                 EGDI_SMALL_CURSOR_DOWN,
    00271                 EGDI_RADIO_BUTTON_CHECKED,
    00273                 EGDI_MORE_LEFT,
    00275                 EGDI_MORE_RIGHT,
    00277                 EGDI_MORE_UP,
    00279                 EGDI_MORE_DOWN,
    00281                 EGDI_EXPAND,
    00283                 EGDI_COLLAPSE,
    00285                 EGDI_FILE,
    00287                 EGDI_DIRECTORY,
    00288
    00290                 EGDI_COUNT
    00291         };
    00292
    00293         const c8* const GUISkinIconNames[EGDI_COUNT+1] =
    00294         {
    00295                 "windowMaximize",
    00296                 "windowRestore",
    00297                 "windowClose",
    00298                 "windowMinimize",
    00299                 "windowResize",
    00300                 "cursorUp",
    00301                 "cursorDown",
    00302                 "cursorLeft",
    00303                 "cursorRight",
    00304                 "menuMore",
    00305                 "checkBoxChecked",
    00306                 "dropDown",
    00307                 "smallCursorUp",
    00308                 "smallCursorDown",
    00309                 "radioButtonChecked",
    00310                 "moreLeft",
    00311                 "moreRight",
    00312                 "moreUp",
    00313                 "moreDown",
    00314                 "expand",
    00315                 "collapse",
    00316                 "file",
    00317                 "directory",
    00318                 0
    00319         };
    00320
    00321         // Customizable fonts
    00322         enum EGUI_DEFAULT_FONT
    00323         {
    00325                 EGDF_DEFAULT=0,
    00327                 EGDF_BUTTON,
    00329                 EGDF_WINDOW,
    00331                 EGDF_MENU,
    00333                 EGDF_TOOLTIP,
    00336                 EGDF_COUNT
    00337         };
    00338
    00339         const c8* const GUISkinFontNames[EGDF_COUNT+1] =
    00340         {
    00341                 "defaultFont",
    00342                 "buttonFont",
    00343                 "windowFont",
    00344                 "menuFont",
    00345                 "tooltipFont",
    00346                 0
    00347         };
    00348
    00350         class IGUISkin : public virtual io::IAttributeExchangingObject
    00351         {
    00352         public:
    00353
    00355                 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
    00356
    00358                 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
    00359
    00361                 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
    00362
    00364
    00366                 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
    00367
    00369
    00371                 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
    00372
    00374                 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
    00375
    00377                 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
    00378
    00380                 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
    00381
    00383                 virtual IGUISpriteBank* getSpriteBank() const = 0;
    00384
    00386                 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
    00387
    00389
    00390                 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
    00391
    00393
    00397                 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
    00398
    00400
    00408                 virtual void draw3DButtonPaneStandard(IGUIElement* element,
    00409                         const core::rect<s32>& rect,
    00410                         const core::rect<s32>* clip=0) = 0;
    00411
    00413
    00421                 virtual void draw3DButtonPanePressed(IGUIElement* element,
    00422                         const core::rect<s32>& rect,
    00423                         const core::rect<s32>* clip=0) = 0;
    00424
    00426
    00437                 virtual void draw3DSunkenPane(IGUIElement* element,
    00438                         video::SColor bgcolor, bool flat, bool fillBackGround,
    00439                         const core::rect<s32>& rect,
    00440                         const core::rect<s32>* clip=0) = 0;
    00441
    00443
    00456                 virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
    00457                         bool drawTitleBar, video::SColor titleBarColor,
    00458                         const core::rect<s32>& rect,
    00459                         const core::rect<s32>* clip=0,
    00460                         core::rect<s32>* checkClientArea=0) = 0;
    00461
    00463
    00471                 virtual void draw3DMenuPane(IGUIElement* element,
    00472                         const core::rect<s32>& rect,
    00473                         const core::rect<s32>* clip=0) = 0;
    00474
    00476
    00482                 virtual void draw3DToolBar(IGUIElement* element,
    00483                         const core::rect<s32>& rect,
    00484                         const core::rect<s32>* clip=0) = 0;
    00485
    00487
    00495                 virtual void draw3DTabButton(IGUIElement* element, bool active,
    00496                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
    00497
    00499
    00508                 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
    00509                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
    00510
    00512
    00521                 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
    00522                         const core::position2di position, u32 starttime=0, u32 currenttime=0,
    00523                         bool loop=false, const core::rect<s32>* clip=0) = 0;
    00524
    00526
    00534                 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
    00535                         const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
    00536
    00538                 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
    00539         };
    00540
    00541
    00542 } // end namespace gui
    00543 } // end namespace irr
    00544
    00545 #endif
    00546

| The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Feb 14 13:06:57 2010 by Doxygen (1.6.2)