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,
    00163                 EGDS_COUNT
    00164         };
    00165
    00166
    00168         const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
    00169         {
    00170                 "ScrollBarSize",
    00171                 "MenuHeight",
    00172                 "WindowButtonWidth",
    00173                 "CheckBoxWidth",
    00174                 "MessageBoxWidth",
    00175                 "MessageBoxHeight",
    00176                 "ButtonWidth",
    00177                 "ButtonHeight",
    00178                 "TextDistanceX",
    00179                 "TextDistanceY",
    00180                 "TitleBarTextX",
    00181                 "TitleBarTextY",
    00182                 0,
    00183         };
    00184
    00185
    00186         enum EGUI_DEFAULT_TEXT
    00187         {
    00189                 EGDT_MSG_BOX_OK = 0,
    00191                 EGDT_MSG_BOX_CANCEL,
    00193                 EGDT_MSG_BOX_YES,
    00195                 EGDT_MSG_BOX_NO,
    00197                 EGDT_WINDOW_CLOSE,
    00199                 EGDT_WINDOW_MAXIMIZE,
    00201                 EGDT_WINDOW_MINIMIZE,
    00203                 EGDT_WINDOW_RESTORE,
    00204
    00206                 EGDT_COUNT
    00207         };
    00208
    00210         const c8* const GUISkinTextNames[EGDT_COUNT+1] =
    00211         {
    00212                 "MessageBoxOkay",
    00213                 "MessageBoxCancel",
    00214                 "MessageBoxYes",
    00215                 "MessageBoxNo",
    00216                 "WindowButtonClose",
    00217                 "WindowButtonMaximize",
    00218                 "WindowButtonMinimize",
    00219                 "WindowButtonRestore",
    00220                 0,
    00221         };
    00222
    00224         enum EGUI_DEFAULT_ICON
    00225         {
    00227                 EGDI_WINDOW_MAXIMIZE = 0,
    00229                 EGDI_WINDOW_RESTORE,
    00231                 EGDI_WINDOW_CLOSE,
    00233                 EGDI_WINDOW_MINIMIZE,
    00235                 EGDI_WINDOW_RESIZE,
    00237                 EGDI_CURSOR_UP,
    00239                 EGDI_CURSOR_DOWN,
    00241                 EGDI_CURSOR_LEFT,
    00243                 EGDI_CURSOR_RIGHT,
    00245                 EGDI_MENU_MORE,
    00247                 EGDI_CHECK_BOX_CHECKED,
    00249                 EGDI_DROP_DOWN,
    00251                 EGDI_SMALL_CURSOR_UP,
    00253                 EGDI_SMALL_CURSOR_DOWN,
    00255                 EGDI_RADIO_BUTTON_CHECKED,
    00257                 EGDI_MORE_LEFT,
    00259                 EGDI_MORE_RIGHT,
    00261                 EGDI_MORE_UP,
    00263                 EGDI_MORE_DOWN,
    00265                 EGDI_EXPAND,
    00267                 EGDI_COLLAPSE,
    00269                 EGDI_FILE,
    00271                 EGDI_DIRECTORY,
    00272
    00274                 EGDI_COUNT
    00275         };
    00276
    00277         const c8* const GUISkinIconNames[EGDI_COUNT+1] =
    00278         {
    00279                 "windowMaximize",
    00280                 "windowRestore",
    00281                 "windowClose",
    00282                 "windowMinimize",
    00283                 "windowResize",
    00284                 "cursorUp",
    00285                 "cursorDown",
    00286                 "cursorLeft",
    00287                 "cursorRight",
    00288                 "menuMore",
    00289                 "checkBoxChecked",
    00290                 "dropDown",
    00291                 "smallCursorUp",
    00292                 "smallCursorDown",
    00293                 "radioButtonChecked",
    00294                 "moreLeft",
    00295                 "moreRight",
    00296                 "moreUp",
    00297                 "moreDown",
    00298                 "expand",
    00299                 "collapse",
    00300                 "file",
    00301                 "directory",
    00302                 0
    00303         };
    00304
    00305         // Customizable fonts
    00306         enum EGUI_DEFAULT_FONT
    00307         {
    00309                 EGDF_DEFAULT=0,
    00311                 EGDF_BUTTON,
    00313                 EGDF_WINDOW,
    00315                 EGDF_MENU,
    00317                 EGDF_TOOLTIP,
    00320                 EGDF_COUNT
    00321         };
    00322
    00323         const c8* const GUISkinFontNames[EGDF_COUNT+1] =
    00324         {
    00325                 "defaultFont",
    00326                 "buttonFont",
    00327                 "windowFont",
    00328                 "menuFont",
    00329                 "tooltipFont",
    00330                 0
    00331         };
    00332
    00334         class IGUISkin : public virtual io::IAttributeExchangingObject
    00335         {
    00336         public:
    00337
    00339                 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
    00340
    00342                 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
    00343
    00345                 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
    00346
    00348
    00350                 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
    00351
    00353
    00355                 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
    00356
    00358                 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
    00359
    00361                 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
    00362
    00364                 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
    00365
    00367                 virtual IGUISpriteBank* getSpriteBank() const = 0;
    00368
    00370                 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
    00371
    00373
    00374                 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
    00375
    00377
    00381                 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
    00382
    00384
    00392                 virtual void draw3DButtonPaneStandard(IGUIElement* element,
    00393                         const core::rect<s32>& rect,
    00394                         const core::rect<s32>* clip=0) = 0;
    00395
    00397
    00405                 virtual void draw3DButtonPanePressed(IGUIElement* element,
    00406                         const core::rect<s32>& rect,
    00407                         const core::rect<s32>* clip=0) = 0;
    00408
    00410
    00421                 virtual void draw3DSunkenPane(IGUIElement* element,
    00422                         video::SColor bgcolor, bool flat, bool fillBackGround,
    00423                         const core::rect<s32>& rect,
    00424                         const core::rect<s32>* clip=0) = 0;
    00425
    00427
    00436                 virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
    00437                         bool drawTitleBar, video::SColor titleBarColor,
    00438                         const core::rect<s32>& rect,
    00439                         const core::rect<s32>* clip=0) = 0;
    00440
    00442
    00450                 virtual void draw3DMenuPane(IGUIElement* element,
    00451                         const core::rect<s32>& rect,
    00452                         const core::rect<s32>* clip=0) = 0;
    00453
    00455
    00461                 virtual void draw3DToolBar(IGUIElement* element,
    00462                         const core::rect<s32>& rect,
    00463                         const core::rect<s32>* clip=0) = 0;
    00464
    00466
    00474                 virtual void draw3DTabButton(IGUIElement* element, bool active,
    00475                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
    00476
    00478
    00487                 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
    00488                         const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
    00489
    00491
    00500                 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
    00501                         const core::position2di position, u32 starttime=0, u32 currenttime=0,
    00502                         bool loop=false, const core::rect<s32>* clip=0) = 0;
    00503
    00505
    00513                 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
    00514                         const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
    00515
    00517                 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
    00518         };
    00519
    00520
    00521 } // end namespace gui
    00522 } // end namespace irr
    00523
    00524 #endif
    00525

| The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:03 2010 by Doxygen (1.5.6)