IGUISkin.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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 irrlicht.h
  4. #pragma once
  5. #include "IReferenceCounted.h"
  6. #include "EGUIAlignment.h"
  7. #include "SColor.h"
  8. #include "rect.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. class IGUIFont;
  14. class IGUISpriteBank;
  15. class IGUIElement;
  16. //! Enumeration of available default skins.
  17. /** To set one of the skins, use the following code, for example to set
  18. the Windows classic skin:
  19. \code
  20. gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
  21. environment->setSkin(newskin);
  22. newskin->drop();
  23. \endcode
  24. */
  25. enum EGUI_SKIN_TYPE
  26. {
  27. //! Default windows look and feel
  28. EGST_WINDOWS_CLASSIC = 0,
  29. //! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons
  30. EGST_WINDOWS_METALLIC,
  31. //! Burning's skin
  32. EGST_BURNING_SKIN,
  33. //! An unknown skin, not serializable at present
  34. EGST_UNKNOWN,
  35. //! this value is not used, it only specifies the number of skin types
  36. EGST_COUNT
  37. };
  38. //! Names for gui element types
  39. const c8 *const GUISkinTypeNames[EGST_COUNT + 1] = {
  40. "windowsClassic",
  41. "windowsMetallic",
  42. "burning",
  43. "unknown",
  44. 0,
  45. };
  46. //! Enumeration for skin colors
  47. enum EGUI_DEFAULT_COLOR
  48. {
  49. //! Dark shadow for three-dimensional display elements.
  50. EGDC_3D_DARK_SHADOW = 0,
  51. //! Shadow color for three-dimensional display elements (for edges facing away from the light source).
  52. EGDC_3D_SHADOW,
  53. //! Face color for three-dimensional display elements and for dialog box backgrounds.
  54. EGDC_3D_FACE,
  55. //! Highlight color for three-dimensional display elements (for edges facing the light source.)
  56. EGDC_3D_HIGH_LIGHT,
  57. //! Light color for three-dimensional display elements (for edges facing the light source.)
  58. EGDC_3D_LIGHT,
  59. //! Active window border.
  60. EGDC_ACTIVE_BORDER,
  61. //! Active window title bar text.
  62. EGDC_ACTIVE_CAPTION,
  63. //! Background color of multiple document interface (MDI) applications.
  64. EGDC_APP_WORKSPACE,
  65. //! Text on a button
  66. EGDC_BUTTON_TEXT,
  67. //! Grayed (disabled) text.
  68. EGDC_GRAY_TEXT,
  69. //! Item(s) selected in a control.
  70. EGDC_HIGH_LIGHT,
  71. //! Text of item(s) selected in a control.
  72. EGDC_HIGH_LIGHT_TEXT,
  73. //! Inactive window border.
  74. EGDC_INACTIVE_BORDER,
  75. //! Inactive window caption.
  76. EGDC_INACTIVE_CAPTION,
  77. //! Tool tip text color
  78. EGDC_TOOLTIP,
  79. //! Tool tip background color
  80. EGDC_TOOLTIP_BACKGROUND,
  81. //! Scrollbar gray area
  82. EGDC_SCROLLBAR,
  83. //! Window background
  84. EGDC_WINDOW,
  85. //! Window symbols like on close buttons, scroll bars and check boxes
  86. EGDC_WINDOW_SYMBOL,
  87. //! Icons in a list or tree
  88. EGDC_ICON,
  89. //! Selected icons in a list or tree
  90. EGDC_ICON_HIGH_LIGHT,
  91. //! Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes
  92. EGDC_GRAY_WINDOW_SYMBOL,
  93. //! Window background for editable field (editbox, checkbox-field)
  94. EGDC_EDITABLE,
  95. //! Grayed (disabled) window background for editable field (editbox, checkbox-field)
  96. EGDC_GRAY_EDITABLE,
  97. //! Show focus of window background for editable field (editbox or when checkbox-field is pressed)
  98. EGDC_FOCUSED_EDITABLE,
  99. //! this value is not used, it only specifies the amount of default colors
  100. //! available.
  101. EGDC_COUNT
  102. };
  103. //! Names for default skin colors
  104. const c8 *const GUISkinColorNames[EGDC_COUNT + 1] = {
  105. "3DDarkShadow",
  106. "3DShadow",
  107. "3DFace",
  108. "3DHighlight",
  109. "3DLight",
  110. "ActiveBorder",
  111. "ActiveCaption",
  112. "AppWorkspace",
  113. "ButtonText",
  114. "GrayText",
  115. "Highlight",
  116. "HighlightText",
  117. "InactiveBorder",
  118. "InactiveCaption",
  119. "ToolTip",
  120. "ToolTipBackground",
  121. "ScrollBar",
  122. "Window",
  123. "WindowSymbol",
  124. "Icon",
  125. "IconHighlight",
  126. "GrayWindowSymbol",
  127. "Editable",
  128. "GrayEditable",
  129. "FocusedEditable",
  130. 0,
  131. };
  132. //! Enumeration for default sizes.
  133. enum EGUI_DEFAULT_SIZE
  134. {
  135. //! default with / height of scrollbar. Also width of drop-down button in comboboxes.
  136. EGDS_SCROLLBAR_SIZE = 0,
  137. //! height of menu
  138. EGDS_MENU_HEIGHT,
  139. //! width and height of a window titlebar button (like minimize/maximize/close buttons). The titlebar height is also calculated from that.
  140. EGDS_WINDOW_BUTTON_WIDTH,
  141. //! width of a checkbox check
  142. EGDS_CHECK_BOX_WIDTH,
  143. //! \deprecated This may be removed by Irrlicht 1.9
  144. EGDS_MESSAGE_BOX_WIDTH,
  145. //! \deprecated This may be removed by Irrlicht 1.9
  146. EGDS_MESSAGE_BOX_HEIGHT,
  147. //! width of a default button
  148. EGDS_BUTTON_WIDTH,
  149. //! height of a default button (OK and cancel buttons)
  150. EGDS_BUTTON_HEIGHT,
  151. //! distance for text from background
  152. EGDS_TEXT_DISTANCE_X,
  153. //! distance for text from background
  154. EGDS_TEXT_DISTANCE_Y,
  155. //! distance for text in the title bar, from the left of the window rect
  156. EGDS_TITLEBARTEXT_DISTANCE_X,
  157. //! distance for text in the title bar, from the top of the window rect
  158. EGDS_TITLEBARTEXT_DISTANCE_Y,
  159. //! free space in a messagebox between borders and contents on all sides
  160. EGDS_MESSAGE_BOX_GAP_SPACE,
  161. //! minimal space to reserve for messagebox text-width
  162. EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH,
  163. //! maximal space to reserve for messagebox text-width
  164. EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH,
  165. //! minimal space to reserve for messagebox text-height
  166. EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
  167. //! maximal space to reserve for messagebox text-height
  168. EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
  169. //! pixels to move an unscaled button image to the right when a button is pressed and the unpressed image looks identical
  170. EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X,
  171. //! pixels to move an unscaled button image down when a button is pressed and the unpressed image looks identical
  172. EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y,
  173. //! pixels to move the button text to the right when a button is pressed
  174. EGDS_BUTTON_PRESSED_TEXT_OFFSET_X,
  175. //! pixels to move the button text down when a button is pressed
  176. EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y,
  177. //! pixels to move an unscaled button sprite to the right when a button is pressed
  178. EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X,
  179. //! pixels to move an unscaled button sprite down when a button is pressed
  180. EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y,
  181. //! this value is not used, it only specifies the amount of default sizes
  182. //! available.
  183. EGDS_COUNT
  184. };
  185. //! Names for default skin sizes
  186. const c8 *const GUISkinSizeNames[EGDS_COUNT + 1] = {
  187. "ScrollBarSize",
  188. "MenuHeight",
  189. "WindowButtonWidth",
  190. "CheckBoxWidth",
  191. "MessageBoxWidth",
  192. "MessageBoxHeight",
  193. "ButtonWidth",
  194. "ButtonHeight",
  195. "TextDistanceX",
  196. "TextDistanceY",
  197. "TitleBarTextX",
  198. "TitleBarTextY",
  199. "MessageBoxGapSpace",
  200. "MessageBoxMinTextWidth",
  201. "MessageBoxMaxTextWidth",
  202. "MessageBoxMinTextHeight",
  203. "MessageBoxMaxTextHeight",
  204. "ButtonPressedImageOffsetX",
  205. "ButtonPressedImageOffsetY",
  206. "ButtonPressedTextOffsetX",
  207. "ButtonPressedTextOffsetY",
  208. "ButtonPressedSpriteOffsetX",
  209. "ButtonPressedSpriteOffsetY",
  210. 0,
  211. };
  212. enum EGUI_DEFAULT_TEXT
  213. {
  214. //! Text for the OK button on a message box
  215. EGDT_MSG_BOX_OK = 0,
  216. //! Text for the Cancel button on a message box
  217. EGDT_MSG_BOX_CANCEL,
  218. //! Text for the Yes button on a message box
  219. EGDT_MSG_BOX_YES,
  220. //! Text for the No button on a message box
  221. EGDT_MSG_BOX_NO,
  222. //! Tooltip text for window close button
  223. EGDT_WINDOW_CLOSE,
  224. //! Tooltip text for window maximize button
  225. EGDT_WINDOW_MAXIMIZE,
  226. //! Tooltip text for window minimize button
  227. EGDT_WINDOW_MINIMIZE,
  228. //! Tooltip text for window restore button
  229. EGDT_WINDOW_RESTORE,
  230. //! this value is not used, it only specifies the number of default texts
  231. EGDT_COUNT
  232. };
  233. //! Names for default skin sizes
  234. const c8 *const GUISkinTextNames[EGDT_COUNT + 1] = {
  235. "MessageBoxOkay",
  236. "MessageBoxCancel",
  237. "MessageBoxYes",
  238. "MessageBoxNo",
  239. "WindowButtonClose",
  240. "WindowButtonMaximize",
  241. "WindowButtonMinimize",
  242. "WindowButtonRestore",
  243. 0,
  244. };
  245. //! Customizable symbols for GUI
  246. enum EGUI_DEFAULT_ICON
  247. {
  248. //! maximize window button
  249. EGDI_WINDOW_MAXIMIZE = 0,
  250. //! restore window button
  251. EGDI_WINDOW_RESTORE,
  252. //! close window button
  253. EGDI_WINDOW_CLOSE,
  254. //! minimize window button
  255. EGDI_WINDOW_MINIMIZE,
  256. //! resize icon for bottom right corner of a window
  257. EGDI_WINDOW_RESIZE,
  258. //! scroll bar up button
  259. EGDI_CURSOR_UP,
  260. //! scroll bar down button
  261. EGDI_CURSOR_DOWN,
  262. //! scroll bar left button
  263. EGDI_CURSOR_LEFT,
  264. //! scroll bar right button
  265. EGDI_CURSOR_RIGHT,
  266. //! icon for menu children
  267. EGDI_MENU_MORE,
  268. //! tick for checkbox
  269. EGDI_CHECK_BOX_CHECKED,
  270. //! down arrow for dropdown menus
  271. EGDI_DROP_DOWN,
  272. //! smaller up arrow
  273. EGDI_SMALL_CURSOR_UP,
  274. //! smaller down arrow
  275. EGDI_SMALL_CURSOR_DOWN,
  276. //! selection dot in a radio button
  277. EGDI_RADIO_BUTTON_CHECKED,
  278. //! << icon indicating there is more content to the left
  279. EGDI_MORE_LEFT,
  280. //! >> icon indicating that there is more content to the right
  281. EGDI_MORE_RIGHT,
  282. //! icon indicating that there is more content above
  283. EGDI_MORE_UP,
  284. //! icon indicating that there is more content below
  285. EGDI_MORE_DOWN,
  286. //! plus icon for trees
  287. EGDI_EXPAND,
  288. //! minus icon for trees
  289. EGDI_COLLAPSE,
  290. //! file icon for file selection
  291. EGDI_FILE,
  292. //! folder icon for file selection
  293. EGDI_DIRECTORY,
  294. //! value not used, it only specifies the number of icons
  295. EGDI_COUNT
  296. };
  297. const c8 *const GUISkinIconNames[EGDI_COUNT + 1] = {
  298. "windowMaximize",
  299. "windowRestore",
  300. "windowClose",
  301. "windowMinimize",
  302. "windowResize",
  303. "cursorUp",
  304. "cursorDown",
  305. "cursorLeft",
  306. "cursorRight",
  307. "menuMore",
  308. "checkBoxChecked",
  309. "dropDown",
  310. "smallCursorUp",
  311. "smallCursorDown",
  312. "radioButtonChecked",
  313. "moreLeft",
  314. "moreRight",
  315. "moreUp",
  316. "moreDown",
  317. "expand",
  318. "collapse",
  319. "file",
  320. "directory",
  321. 0,
  322. };
  323. // Customizable fonts
  324. enum EGUI_DEFAULT_FONT
  325. {
  326. //! For static text, edit boxes, lists and most other places
  327. EGDF_DEFAULT = 0,
  328. //! Font for buttons
  329. EGDF_BUTTON,
  330. //! Font for window title bars
  331. EGDF_WINDOW,
  332. //! Font for menu items
  333. EGDF_MENU,
  334. //! Font for tooltips
  335. EGDF_TOOLTIP,
  336. //! this value is not used, it only specifies the amount of default fonts
  337. //! available.
  338. EGDF_COUNT
  339. };
  340. const c8 *const GUISkinFontNames[EGDF_COUNT + 1] = {
  341. "defaultFont",
  342. "buttonFont",
  343. "windowFont",
  344. "menuFont",
  345. "tooltipFont",
  346. 0,
  347. };
  348. //! A skin modifies the look of the GUI elements.
  349. class IGUISkin : virtual public IReferenceCounted
  350. {
  351. public:
  352. //! returns default color
  353. virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
  354. //! sets a default color
  355. virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
  356. //! returns size for the given size type
  357. virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
  358. //! Returns a default text.
  359. /** For example for Message box button captions:
  360. "OK", "Cancel", "Yes", "No" and so on. */
  361. virtual const wchar_t *getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
  362. //! Sets a default text.
  363. /** For example for Message box button captions:
  364. "OK", "Cancel", "Yes", "No" and so on. */
  365. virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t *newText) = 0;
  366. //! sets a default size
  367. virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
  368. //! returns the default font
  369. virtual IGUIFont *getFont(EGUI_DEFAULT_FONT which = EGDF_DEFAULT) const = 0;
  370. //! sets a default font
  371. virtual void setFont(IGUIFont *font, EGUI_DEFAULT_FONT which = EGDF_DEFAULT) = 0;
  372. //! returns the sprite bank
  373. virtual IGUISpriteBank *getSpriteBank() const = 0;
  374. //! sets the sprite bank
  375. virtual void setSpriteBank(IGUISpriteBank *bank) = 0;
  376. //! Returns a default icon
  377. /** Returns the sprite index within the sprite bank */
  378. virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
  379. //! Sets a default icon
  380. /** Sets the sprite index used for drawing icons like arrows,
  381. close buttons and ticks in checkboxes
  382. \param icon: Enum specifying which icon to change
  383. \param index: The sprite index used to draw this icon */
  384. virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
  385. //! draws a standard 3d button pane
  386. /** Used for drawing for example buttons in normal state.
  387. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  388. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  389. \param element: Pointer to the element which wishes to draw this. This parameter
  390. is usually not used by IGUISkin, but can be used for example by more complex
  391. implementations to find out how to draw the part exactly.
  392. \param rect: Defining area where to draw.
  393. \param clip: Clip area. */
  394. virtual void draw3DButtonPaneStandard(IGUIElement *element,
  395. const core::rect<s32> &rect,
  396. const core::rect<s32> *clip = 0) = 0;
  397. //! draws a pressed 3d button pane
  398. /** Used for drawing for example buttons in pressed state.
  399. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  400. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  401. \param element: Pointer to the element which wishes to draw this. This parameter
  402. is usually not used by IGUISkin, but can be used for example by more complex
  403. implementations to find out how to draw the part exactly.
  404. \param rect: Defining area where to draw.
  405. \param clip: Clip area. */
  406. virtual void draw3DButtonPanePressed(IGUIElement *element,
  407. const core::rect<s32> &rect,
  408. const core::rect<s32> *clip = 0) = 0;
  409. //! draws a sunken 3d pane
  410. /** Used for drawing the background of edit, combo or check boxes.
  411. \param element: Pointer to the element which wishes to draw this. This parameter
  412. is usually not used by IGUISkin, but can be used for example by more complex
  413. implementations to find out how to draw the part exactly.
  414. \param bgcolor: Background color.
  415. \param flat: Specifies if the sunken pane should be flat or displayed as sunken
  416. deep into the ground.
  417. \param fillBackGround: Specifies if the background should be filled with the background
  418. color or not be drawn at all.
  419. \param rect: Defining area where to draw.
  420. \param clip: Clip area. */
  421. virtual void draw3DSunkenPane(IGUIElement *element,
  422. video::SColor bgcolor, bool flat, bool fillBackGround,
  423. const core::rect<s32> &rect,
  424. const core::rect<s32> *clip = 0) = 0;
  425. //! draws a window background
  426. /** Used for drawing the background of dialogs and windows.
  427. \param element: Pointer to the element which wishes to draw this. This parameter
  428. is usually not used by IGUISkin, but can be used for example by more complex
  429. implementations to find out how to draw the part exactly.
  430. \param titleBarColor: Title color.
  431. \param drawTitleBar: True to enable title drawing.
  432. \param rect: Defining area where to draw.
  433. \param clip: Clip area.
  434. \param checkClientArea: When set to non-null the function will not draw anything,
  435. but will instead return the clientArea which can be used for drawing by the calling window.
  436. That is the area without borders and without titlebar.
  437. \return Returns rect where it would be good to draw title bar text. This will
  438. work even when checkClientArea is set to a non-null value.*/
  439. virtual core::rect<s32> draw3DWindowBackground(IGUIElement *element,
  440. bool drawTitleBar, video::SColor titleBarColor,
  441. const core::rect<s32> &rect,
  442. const core::rect<s32> *clip = 0,
  443. core::rect<s32> *checkClientArea = 0) = 0;
  444. //! draws a standard 3d menu pane
  445. /** Used for drawing for menus and context menus.
  446. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  447. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  448. \param element: Pointer to the element which wishes to draw this. This parameter
  449. is usually not used by IGUISkin, but can be used for example by more complex
  450. implementations to find out how to draw the part exactly.
  451. \param rect: Defining area where to draw.
  452. \param clip: Clip area. */
  453. virtual void draw3DMenuPane(IGUIElement *element,
  454. const core::rect<s32> &rect,
  455. const core::rect<s32> *clip = 0) = 0;
  456. //! draws a standard 3d tool bar
  457. /** Used for drawing for toolbars and menus.
  458. \param element: Pointer to the element which wishes to draw this. This parameter
  459. is usually not used by IGUISkin, but can be used for example by more complex
  460. implementations to find out how to draw the part exactly.
  461. \param rect: Defining area where to draw.
  462. \param clip: Clip area. */
  463. virtual void draw3DToolBar(IGUIElement *element,
  464. const core::rect<s32> &rect,
  465. const core::rect<s32> *clip = 0) = 0;
  466. //! draws a tab button
  467. /** Used for drawing for tab buttons on top of tabs.
  468. \param element: Pointer to the element which wishes to draw this. This parameter
  469. is usually not used by IGUISkin, but can be used for example by more complex
  470. implementations to find out how to draw the part exactly.
  471. \param active: Specifies if the tab is currently active.
  472. \param rect: Defining area where to draw.
  473. \param clip: Clip area.
  474. \param alignment Alignment of GUI element. */
  475. virtual void draw3DTabButton(IGUIElement *element, bool active,
  476. const core::rect<s32> &rect, const core::rect<s32> *clip = 0, gui::EGUI_ALIGNMENT alignment = EGUIA_UPPERLEFT) = 0;
  477. //! draws a tab control body
  478. /** \param element: Pointer to the element which wishes to draw this. This parameter
  479. is usually not used by IGUISkin, but can be used for example by more complex
  480. implementations to find out how to draw the part exactly.
  481. \param border: Specifies if the border should be drawn.
  482. \param background: Specifies if the background should be drawn.
  483. \param rect: Defining area where to draw.
  484. \param clip: Clip area.
  485. \param tabHeight Height of tab.
  486. \param alignment Alignment of GUI element. */
  487. virtual void draw3DTabBody(IGUIElement *element, bool border, bool background,
  488. const core::rect<s32> &rect, const core::rect<s32> *clip = 0, s32 tabHeight = -1, gui::EGUI_ALIGNMENT alignment = EGUIA_UPPERLEFT) = 0;
  489. //! draws an icon, usually from the skin's sprite bank
  490. /** \param element: Pointer to the element which wishes to draw this icon.
  491. This parameter is usually not used by IGUISkin, but can be used for example
  492. by more complex implementations to find out how to draw the part exactly.
  493. \param icon: Specifies the icon to be drawn.
  494. \param position: The position to draw the icon
  495. \param starttime: The time at the start of the animation
  496. \param currenttime: The present time, used to calculate the frame number
  497. \param loop: Whether the animation should loop or not
  498. \param clip: Clip area. */
  499. virtual void drawIcon(IGUIElement *element, EGUI_DEFAULT_ICON icon,
  500. const core::position2di position, u32 starttime = 0, u32 currenttime = 0,
  501. bool loop = false, const core::rect<s32> *clip = 0) = 0;
  502. //! draws a 2d rectangle.
  503. /** \param element: Pointer to the element which wishes to draw this icon.
  504. This parameter is usually not used by IGUISkin, but can be used for example
  505. by more complex implementations to find out how to draw the part exactly.
  506. \param color: Color of the rectangle to draw. The alpha component specifies how
  507. transparent the rectangle will be.
  508. \param pos: Position of the rectangle.
  509. \param clip: Pointer to rectangle against which the rectangle will be clipped.
  510. If the pointer is null, no clipping will be performed. */
  511. virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color,
  512. const core::rect<s32> &pos, const core::rect<s32> *clip = 0) = 0;
  513. //! get the type of this skin
  514. virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
  515. };
  516. } // end namespace gui
  517. } // end namespace irr