Gui Skin.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /******************************************************************************/
  2. #if EE_PRIVATE
  3. #define DEFAULT_FONT_FROM_CUSTOM_SKIN 0
  4. #endif
  5. /******************************************************************************/
  6. struct GuiSkin
  7. {
  8. struct Button
  9. {
  10. Color normal_color, pushed_color, disabled_color, pushed_disabled_color;
  11. Flt text_size, text_padd;
  12. PanelImagePtr normal, pushed, disabled, pushed_disabled;
  13. TextStylePtr text_style;
  14. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  15. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  16. void reset(); Button() {reset();} // reset to default values
  17. };
  18. STRUCT(ButtonImage , Button) // 'Button' with an 'Image' on top
  19. //{
  20. ImagePtr image;
  21. Color image_color;
  22. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  23. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  24. void reset(); ButtonImage() {reset();} // reset to default values
  25. };
  26. struct CheckBox
  27. {
  28. Color normal_color, disabled_color;
  29. PanelImagePtr off, on, multi; // these could be 'ImagePtr' however 'PanelImagePtr' is used to allow padding (for example needed for shadow/glow)
  30. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  31. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  32. void reset(); CheckBox() {reset();} // reset to default values
  33. };
  34. struct Menu
  35. {
  36. Color normal_color, check_color, sub_menu_color;
  37. Flt padding, list_elm_height;
  38. PanelPtr normal;
  39. ImagePtr check, sub_menu;
  40. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  41. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  42. void reset(); Menu() {reset();} // reset to default values
  43. };
  44. STRUCT(ComboBox , ButtonImage) // 'image' is used as the side arrow
  45. //{
  46. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  47. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  48. void reset(); ComboBox() {reset();} // reset to default values
  49. };
  50. struct Desc
  51. {
  52. Color normal_color;
  53. Flt padding;
  54. PanelPtr normal;
  55. TextStylePtr text_style;
  56. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  57. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  58. void reset(); Desc() {reset();} // reset to default values
  59. };
  60. struct IMM // Input Method Manager
  61. {
  62. Color normal_color;
  63. Flt padding;
  64. PanelPtr normal;
  65. TextStylePtr text_style;
  66. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  67. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  68. void reset(); IMM() {reset();} // reset to default values
  69. };
  70. struct List
  71. {
  72. Color cursor_color, highlight_color, selection_color;
  73. PanelImagePtr cursor, highlight, selection;
  74. TextStylePtr text_style;
  75. Button column;
  76. ImagePtr resize_column;
  77. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  78. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  79. void reset(); List() {reset();} // reset to default values
  80. };
  81. struct MenuBar
  82. {
  83. Color background_color, highlight_color;
  84. Flt bar_height, text_size, text_padd;
  85. PanelImagePtr background, highlight;
  86. TextStylePtr text_style;
  87. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  88. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  89. void reset(); MenuBar() {reset();} // reset to default values
  90. };
  91. struct Progress
  92. {
  93. Bool draw_progress_partial; // draw progress as partial, default=false
  94. Color background_color, progress_color;
  95. Flt text_size;
  96. PanelImagePtr background, progress;
  97. TextStylePtr text_style;
  98. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  99. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  100. void reset(); Progress() {reset();} // reset to default values
  101. };
  102. struct Property
  103. {
  104. ButtonImage value;
  105. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  106. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  107. void reset(); Property() {reset();} // reset to default values
  108. };
  109. struct Region
  110. {
  111. Color normal_color;
  112. PanelPtr normal;
  113. ButtonImage view;
  114. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  115. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  116. void reset(); Region() {reset();} // reset to default values
  117. };
  118. struct SlideBar
  119. {
  120. Color background_color;
  121. PanelImagePtr background;
  122. ButtonImage left, center, right;
  123. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  124. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  125. void reset(); SlideBar() {reset();} // reset to default values
  126. };
  127. struct Slider
  128. {
  129. Bool draw_progress_partial; // draw progress as partial, default=false
  130. Color background_color, progress_color, slider_color;
  131. Flt background_shrink;
  132. PanelImagePtr background, progress, slider; // 'slider' could be 'ImagePtr' however 'PanelImagePtr' is used to allow padding (for example needed for shadow/glow)
  133. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  134. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  135. void reset(); Slider() {reset();} // reset to default values
  136. };
  137. struct Tab
  138. {
  139. Button left, horizontal, right, top, vertical, bottom,
  140. top_left, top_right, bottom_left, bottom_right;
  141. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  142. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  143. void reset(); Tab() {reset();} // reset to default values
  144. };
  145. struct Text
  146. {
  147. TextStylePtr text_style;
  148. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  149. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  150. void reset(); Text() {reset();} // reset to default values
  151. };
  152. struct TextLine
  153. {
  154. Color normal_panel_color, normal_text_color, disabled_panel_color, disabled_text_color, rect_color;
  155. Flt text_size;
  156. PanelImagePtr normal, disabled;
  157. TextStylePtr text_style;
  158. ImagePtr find_image;
  159. ButtonImage clear;
  160. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  161. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  162. void reset(); TextLine() {reset();} // reset to default values
  163. };
  164. struct Window
  165. {
  166. Color normal_color, active_color;
  167. Flt text_size, text_padd;
  168. Vec2 button_offset;
  169. PanelPtr normal, active, normal_no_bar, active_no_bar;
  170. TextStylePtr normal_text_style, active_text_style;
  171. ButtonImage minimize, maximize, close;
  172. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  173. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  174. void reset(); Window() {reset();} // reset to default values
  175. };
  176. Color background_color,
  177. border_color, // affects 'GuiImage', 'Property', 'Viewport'
  178. mouse_highlight_color, // affects 'Button', 'CheckBox', 'ComboBox', 'SlideBar', 'Slider', 'Tabs'
  179. keyboard_highlight_color; // affects 'Button', 'CheckBox', 'ComboBox', 'Region', 'SlideBar', 'Slider', 'TextBox', 'TextLine'
  180. FontPtr font;
  181. TextStylePtr text_style;
  182. Button button;
  183. CheckBox checkbox;
  184. Menu menu;
  185. ComboBox combobox;
  186. Desc desc;
  187. IMM imm;
  188. List list;
  189. MenuBar menubar;
  190. Progress progress;
  191. Property property;
  192. Region region;
  193. SlideBar slidebar;
  194. Slider slider;
  195. Tab tab;
  196. Text text;
  197. TextLine textline;
  198. Window window;
  199. // io
  200. Bool save(C Str &name)C; // save, false on fail
  201. Bool load(C Str &name) ; // load, false on fail
  202. Bool save(File &f, CChar *path=null)C; // save to file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  203. Bool load(File &f, CChar *path=null) ; // load from file, 'path'=path at which resource is located (this is needed so that the sub-resources can be accessed with relative path), false on fail
  204. void reset(); GuiSkin() {reset();} // reset to default values
  205. }extern
  206. EmptyGuiSkin;
  207. /******************************************************************************/
  208. DECLARE_CACHE(GuiSkin, GuiSkins, GuiSkinPtr); // 'GuiSkins' cache storing 'GuiSkin' objects which can be accessed by 'GuiSkinPtr' pointer
  209. /******************************************************************************/