Advertisement
Guest User

Untitled

a guest
Sep 1st, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6.  
  7. #pragma once
  8. #ifndef GWEN_SKIN_H
  9. #define GWEN_SKIN_H
  10.  
  11. #include "Gwen/BaseRender.h"
  12. #include "Gwen/Font.h"
  13.  
  14. namespace Gwen
  15. {
  16. namespace Controls
  17. {
  18. class Base;
  19. }
  20.  
  21. namespace Skin
  22. {
  23. namespace Symbol
  24. {
  25. const unsigned char None = 0;
  26. const unsigned char ArrowRight = 1;
  27. const unsigned char Check = 2;
  28. const unsigned char Dot = 3;
  29. }
  30.  
  31. class GWEN_EXPORT Base
  32. {
  33. public:
  34.  
  35. Base()
  36. {
  37. m_DefaultFont.facename = L"Arial";
  38. m_DefaultFont.size = 10.0f;
  39. m_Render = NULL;
  40. }
  41.  
  42. virtual ~Base()
  43. {
  44. ReleaseFont( &m_DefaultFont );
  45. }
  46.  
  47. virtual void ReleaseFont( Gwen::Font* fnt )
  48. {
  49. if ( !fnt ) return;
  50. if ( !m_Render ) return;
  51.  
  52. m_Render->FreeFont( fnt );
  53. }
  54.  
  55. virtual void DrawButton( Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ){}
  56. virtual void DrawTabButton( Controls::Base* control, bool bActive, int dir ){}
  57. virtual void DrawTabControl( Controls::Base* control ){}
  58. virtual void DrawTabTitleBar( Controls::Base* control ){}
  59.  
  60.  
  61. virtual void DrawMenuItem( Controls::Base* control, bool bSubmenuOpen, bool bChecked ){}
  62. virtual void DrawMenuStrip( Controls::Base* control ){}
  63. virtual void DrawMenu( Controls::Base* control, bool bPaddingDisabled ){}
  64. virtual void DrawMenuRightArrow( Controls::Base* control ){}
  65.  
  66. virtual void DrawRadioButton(Controls::Base* control, bool bSelected, bool bDepressed){}
  67. virtual void DrawCheckBox( Controls::Base* control, bool bSelected, bool bDepressed ){}
  68. virtual void DrawGroupBox( Controls::Base* control, int textStart, int textHeight, int textWidth ){}
  69. virtual void DrawTextBox( Controls::Base* control ){}
  70.  
  71. virtual void DrawWindow( Controls::Base* control, int topHeight, bool inFocus ){}
  72. virtual void DrawWindowCloseButton( Gwen::Controls::Base* control, bool bDepressed, bool bHovered, bool bDisabled ){}
  73.  
  74. virtual void DrawHighlight( Controls::Base* control ){}
  75. virtual void DrawStatusBar( Controls::Base* control ){}
  76.  
  77. virtual void DrawShadow( Controls::Base* control ){}
  78. virtual void DrawScrollBarBar( Controls::Base* control, bool bDepressed, bool isHovered, bool isHorizontal ){}
  79. virtual void DrawScrollBar( Controls::Base* control, bool isHorizontal, bool bDepressed ){}
  80. virtual void DrawScrollButton( Controls::Base* control, int iDirection, bool bDepressed, bool bHovered, bool bDisabled ){}
  81. virtual void DrawProgressBar( Controls::Base* control, bool isHorizontal, float progress){}
  82.  
  83. virtual void DrawListBox( Controls::Base* control ){}
  84. virtual void DrawListBoxLine( Controls::Base* control, bool bSelected, bool bEven ){}
  85.  
  86. virtual void DrawSlider( Controls::Base* control, bool bIsHorizontal, int numNotches, int barSize ){}
  87. virtual void DrawSlideButton( Gwen::Controls::Base* control, bool bDepressed, bool bHorizontal ){}
  88.  
  89. virtual void DrawComboBox( Controls::Base* control, bool bIsDown, bool bIsMenuOpen ){}
  90. virtual void DrawComboDownArrow( Gwen::Controls::Base* control, bool bHovered, bool bDown, bool bOpen, bool bDisabled ){}
  91. virtual void DrawKeyboardHighlight( Controls::Base* control, const Gwen::Rect& rect, int offset ){}
  92. virtual void DrawToolTip( Controls::Base* control ){}
  93.  
  94. virtual void DrawNumericUpDownButton( Controls::Base* control, bool bDepressed, bool bUp ){}
  95.  
  96. virtual void DrawTreeButton( Controls::Base* control, bool bOpen ){}
  97. virtual void DrawTreeControl( Controls::Base* control ){}
  98. virtual void DrawTreeNode( Controls::Base* ctrl, bool bOpen, bool bSelected, int iLabelHeight, int iLabelWidth, int iHalfWay, int iLastBranch, bool bIsRoot ){}
  99.  
  100. virtual void DrawPropertyRow( Controls::Base* control, int iWidth, bool bBeingEdited, bool bHovered ){}
  101. virtual void DrawPropertyTreeNode( Controls::Base* control, int BorderLeft, int BorderTop ){}
  102. virtual void DrawColorDisplay( Controls::Base* control, Gwen::Color color ){}
  103. virtual void DrawModalControl( Controls::Base* control ){}
  104. virtual void DrawMenuDivider( Controls::Base* control ){}
  105.  
  106. virtual void DrawCategoryHolder( Controls::Base* ctrl ){}
  107. virtual void DrawCategoryInner( Controls::Base* ctrl, bool bCollapsed ){}
  108.  
  109.  
  110. virtual void SetRender( Gwen::Renderer::Base* renderer )
  111. {
  112. m_Render = renderer;
  113. }
  114. virtual Gwen::Renderer::Base* GetRender()
  115. {
  116. return m_Render;
  117. }
  118.  
  119. virtual void DrawArrowDown( Gwen::Rect rect ){}
  120. virtual void DrawArrowUp( Gwen::Rect rect ){}
  121. virtual void DrawArrowLeft( Gwen::Rect rect ){}
  122. virtual void DrawArrowRight( Gwen::Rect rect ){}
  123. virtual void DrawCheck( Gwen::Rect rect ){}
  124.  
  125.  
  126. struct
  127. {
  128. struct
  129. {
  130. Gwen::Color TitleActive;
  131. Gwen::Color TitleInactive;
  132.  
  133. } Window;
  134.  
  135. struct
  136. {
  137. Gwen::Color Default;
  138. Gwen::Color Bright;
  139. Gwen::Color Dark;
  140. Gwen::Color Highlight;
  141.  
  142. } Label;
  143.  
  144. struct
  145. {
  146. Gwen::Color Lines;
  147. Gwen::Color Normal;
  148. Gwen::Color Hover;
  149. Gwen::Color Selected;
  150.  
  151. } Tree;
  152.  
  153. struct
  154. {
  155. Gwen::Color Line_Normal;
  156. Gwen::Color Line_Selected;
  157. Gwen::Color Line_Hover;
  158. Gwen::Color Column_Normal;
  159. Gwen::Color Column_Selected;
  160. Gwen::Color Column_Hover;
  161. Gwen::Color Label_Normal;
  162. Gwen::Color Label_Selected;
  163. Gwen::Color Label_Hover;
  164. Gwen::Color Border;
  165. Gwen::Color Title;
  166.  
  167. } Properties;
  168.  
  169. struct
  170. {
  171. Gwen::Color Normal;
  172. Gwen::Color Hover;
  173. Gwen::Color Down;
  174. Gwen::Color Disabled;
  175.  
  176. } Button;
  177.  
  178. struct
  179. {
  180. struct
  181. {
  182. Gwen::Color Normal;
  183. Gwen::Color Hover;
  184. Gwen::Color Down;
  185. Gwen::Color Disabled;
  186. } Active;
  187.  
  188. struct
  189. {
  190. Gwen::Color Normal;
  191. Gwen::Color Hover;
  192. Gwen::Color Down;
  193. Gwen::Color Disabled;
  194. } Inactive;
  195.  
  196. } Tab;
  197.  
  198. struct
  199. {
  200. Gwen::Color Header;
  201. Gwen::Color Header_Closed;
  202.  
  203. struct
  204. {
  205. Gwen::Color Text;
  206. Gwen::Color Text_Hover;
  207. Gwen::Color Text_Selected;
  208. Gwen::Color Button;
  209. Gwen::Color Button_Hover;
  210. Gwen::Color Button_Selected;
  211. } Line;
  212.  
  213. struct
  214. {
  215. Gwen::Color Text;
  216. Gwen::Color Text_Hover;
  217. Gwen::Color Text_Selected;
  218. Gwen::Color Button;
  219. Gwen::Color Button_Hover;
  220. Gwen::Color Button_Selected;
  221. } LineAlt;
  222.  
  223. } Category;
  224.  
  225. Gwen::Color ModalBackground;
  226. Gwen::Color TooltipText;
  227.  
  228. } Colors;
  229.  
  230.  
  231. public:
  232.  
  233. virtual Gwen::Font* GetDefaultFont()
  234. {
  235. return &m_DefaultFont;
  236. }
  237.  
  238. virtual void SetDefaultFont( const Gwen::UnicodeString& strFacename, float fSize = 10.0f )
  239. {
  240. m_DefaultFont.facename = strFacename;
  241. m_DefaultFont.size = fSize;
  242. }
  243.  
  244. protected:
  245.  
  246. Gwen::Font m_DefaultFont;
  247. Gwen::Renderer::Base* m_Render;
  248.  
  249. };
  250. };
  251. }
  252. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement