You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1186 lines
46KB

  1. /*
  2. Blendish - Blender 2.5 UI based theming functions for NanoVG
  3. Copyright (c) 2014 Leonard Ritter <leonard.ritter@duangle.com>
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. */
  20. #ifndef BLENDISH_H
  21. #define BLENDISH_H
  22. #include <stddef.h>
  23. #include <nanovg.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /*
  28. Revision 6 (2014-09-21)
  29. Summary
  30. -------
  31. Blendish is a small collection of drawing functions for NanoVG, designed to
  32. replicate the look of the Blender 2.5+ User Interface. You can use these
  33. functions to theme your UI library. Several metric constants for faithful
  34. reproduction are also included.
  35. Blendish supports the original Blender icon sheet; As the licensing of Blenders
  36. icons is unclear, they are not included in Blendishes repository, but a SVG
  37. template, "icons_template.svg" is provided, which you can use to build your own
  38. icon sheet.
  39. To use icons, you must first load the icon sheet using one of the
  40. nvgCreateImage*() functions and then pass the image handle to bndSetIconImage();
  41. otherwise, no icons will be drawn. See bndSetIconImage() for more information.
  42. Blendish will not render text until a suitable UI font has been passed to
  43. bndSetFont() has been called. See bndSetFont() for more information.
  44. Drawbacks
  45. ---------
  46. There is no support for varying dpi resolutions yet. The library is hardcoded
  47. to the equivalent of 72 dpi in the Blender system settings.
  48. Support for label truncation is missing. Text rendering breaks when widgets are
  49. too short to contain their labels.
  50. Usage
  51. -----
  52. To use this header file in implementation mode, define BLENDISH_IMPLEMENTATION
  53. before including blendish.h, otherwise the file will be in header-only mode.
  54. */
  55. // you can override this from the outside to pick
  56. // the export level you need
  57. #ifndef BND_EXPORT
  58. #define BND_EXPORT
  59. #endif
  60. // if that typedef is provided elsewhere, you may define
  61. // BLENDISH_NO_NVG_TYPEDEFS before including the header.
  62. #ifndef BLENDISH_NO_NVG_TYPEDEFS
  63. typedef struct NVGcontext NVGcontext;
  64. typedef struct NVGcolor NVGcolor;
  65. typedef struct NVGglyphPosition NVGglyphPosition;
  66. #endif
  67. // describes the theme used to draw a single widget or widget box;
  68. // these values correspond to the same values that can be retrieved from
  69. // the Theme panel in the Blender preferences
  70. typedef struct BNDwidgetTheme {
  71. // color of widget box outline
  72. NVGcolor outlineColor;
  73. // color of widget item (meaning changes depending on class)
  74. NVGcolor itemColor;
  75. // fill color of widget box
  76. NVGcolor innerColor;
  77. // fill color of widget box when active
  78. NVGcolor innerSelectedColor;
  79. // color of text label
  80. NVGcolor textColor;
  81. // color of text label when active
  82. NVGcolor textSelectedColor;
  83. // delta modifier for upper part of gradient (-100 to 100)
  84. int shadeTop;
  85. // delta modifier for lower part of gradient (-100 to 100)
  86. int shadeDown;
  87. } BNDwidgetTheme;
  88. // describes the theme used to draw nodes
  89. typedef struct BNDnodeTheme {
  90. // inner color of selected node (and downarrow)
  91. NVGcolor nodeSelectedColor;
  92. // outline of wires
  93. NVGcolor wiresColor;
  94. // color of text label when active
  95. NVGcolor textSelectedColor;
  96. // inner color of active node (and dragged wire)
  97. NVGcolor activeNodeColor;
  98. // color of selected wire
  99. NVGcolor wireSelectColor;
  100. // color of background of node
  101. NVGcolor nodeBackdropColor;
  102. // how much a noodle curves (0 to 10)
  103. int noodleCurving;
  104. } BNDnodeTheme;
  105. // describes the theme used to draw widgets
  106. typedef struct BNDtheme {
  107. // the background color of panels and windows
  108. NVGcolor backgroundColor;
  109. // theme for labels
  110. BNDwidgetTheme regularTheme;
  111. // theme for tool buttons
  112. BNDwidgetTheme toolTheme;
  113. // theme for radio buttons
  114. BNDwidgetTheme radioTheme;
  115. // theme for text fields
  116. BNDwidgetTheme textFieldTheme;
  117. // theme for option buttons (checkboxes)
  118. BNDwidgetTheme optionTheme;
  119. // theme for choice buttons (comboboxes)
  120. // Blender calls them "menu buttons"
  121. BNDwidgetTheme choiceTheme;
  122. // theme for number fields
  123. BNDwidgetTheme numberFieldTheme;
  124. // theme for slider controls
  125. BNDwidgetTheme sliderTheme;
  126. // theme for scrollbars
  127. BNDwidgetTheme scrollBarTheme;
  128. // theme for tooltips
  129. BNDwidgetTheme tooltipTheme;
  130. // theme for menu backgrounds
  131. BNDwidgetTheme menuTheme;
  132. // theme for menu items
  133. BNDwidgetTheme menuItemTheme;
  134. // theme for nodes
  135. BNDnodeTheme nodeTheme;
  136. } BNDtheme;
  137. // how text on a control is aligned
  138. typedef enum BNDtextAlignment {
  139. BND_LEFT = 0,
  140. BND_CENTER,
  141. } BNDtextAlignment;
  142. // states altering the styling of a widget
  143. typedef enum BNDwidgetState {
  144. // not interacting
  145. BND_DEFAULT = 0,
  146. // the mouse is hovering over the control
  147. BND_HOVER,
  148. // the widget is activated (pressed) or in an active state (toggled)
  149. BND_ACTIVE
  150. } BNDwidgetState;
  151. // flags indicating which corners are sharp (for grouping widgets)
  152. typedef enum BNDcornerFlags {
  153. // all corners are round
  154. BND_CORNER_NONE = 0,
  155. // sharp top left corner
  156. BND_CORNER_TOP_LEFT = 1,
  157. // sharp top right corner
  158. BND_CORNER_TOP_RIGHT = 2,
  159. // sharp bottom right corner
  160. BND_CORNER_DOWN_RIGHT = 4,
  161. // sharp bottom left corner
  162. BND_CORNER_DOWN_LEFT = 8,
  163. // all corners are sharp;
  164. // you can invert a set of flags using ^= BND_CORNER_ALL
  165. BND_CORNER_ALL = 0xF,
  166. // top border is sharp
  167. BND_CORNER_TOP = 3,
  168. // bottom border is sharp
  169. BND_CORNER_DOWN = 0xC,
  170. // left border is sharp
  171. BND_CORNER_LEFT = 9,
  172. // right border is sharp
  173. BND_CORNER_RIGHT = 6
  174. } BNDcornerFlags;
  175. // build an icon ID from two coordinates into the icon sheet, where
  176. // (0,0) designates the upper-leftmost icon, (1,0) the one right next to it,
  177. // and so on.
  178. #define BND_ICONID(x,y) ((x)|((y)<<8))
  179. // alpha of disabled widget groups
  180. // can be used in conjunction with nvgGlobalAlpha()
  181. #define BND_DISABLED_ALPHA 0.5
  182. // default widget height
  183. #define BND_WIDGET_HEIGHT 21
  184. // default toolbutton width (if icon only)
  185. #define BND_TOOL_WIDTH 20
  186. // default radius of node ports
  187. #define BND_NODE_PORT_RADIUS 5
  188. // top margin of node content
  189. #define BND_NODE_MARGIN_TOP 25
  190. // bottom margin of node content
  191. #define BND_NODE_MARGIN_DOWN 5
  192. // left and right margin of node content
  193. #define BND_NODE_MARGIN_SIDE 10
  194. // height of node title bar
  195. #define BND_NODE_TITLE_HEIGHT 20
  196. // width of node title arrow click area
  197. #define BND_NODE_ARROW_AREA_WIDTH 20
  198. // size of splitter corner click area
  199. #define BND_SPLITTER_AREA_SIZE 12
  200. // width of vertical scrollbar
  201. #define BND_SCROLLBAR_WIDTH 13
  202. // height of horizontal scrollbar
  203. #define BND_SCROLLBAR_HEIGHT 14
  204. // default vertical spacing
  205. #define BND_VSPACING 1
  206. // default vertical spacing between groups
  207. #define BND_VSPACING_GROUP 8
  208. // default horizontal spacing
  209. #define BND_HSPACING 8
  210. // default text size
  211. #define BND_LABEL_FONT_SIZE 13
  212. // default text padding in inner box
  213. #define BND_PAD_LEFT 8
  214. #define BND_PAD_RIGHT 8
  215. // label: value separator string
  216. #define BND_LABEL_SEPARATOR ": "
  217. // alpha intensity of transparent items (0xa4)
  218. #define BND_TRANSPARENT_ALPHA 0.9
  219. // shade intensity of beveled panels
  220. #define BND_BEVEL_SHADE 30
  221. // shade intensity of beveled insets
  222. #define BND_INSET_BEVEL_SHADE 30
  223. // shade intensity of hovered inner boxes
  224. #define BND_HOVER_SHADE 15
  225. // shade intensity of splitter bevels
  226. #define BND_SPLITTER_SHADE 100
  227. // width of icon sheet
  228. #define BND_ICON_SHEET_WIDTH 602
  229. // height of icon sheet
  230. #define BND_ICON_SHEET_HEIGHT 640
  231. // gridsize of icon sheet in both dimensions
  232. #define BND_ICON_SHEET_GRID 21
  233. // offset of first icon tile relative to left border
  234. #define BND_ICON_SHEET_OFFSET_X 5
  235. // offset of first icon tile relative to top border
  236. #define BND_ICON_SHEET_OFFSET_Y 10
  237. // resolution of single icon
  238. #define BND_ICON_SHEET_RES 16
  239. // size of number field arrow
  240. #define BND_NUMBER_ARROW_SIZE 4
  241. // default text color
  242. #define BND_COLOR_TEXT {{{ 0,0,0,1 }}}
  243. // default highlighted text color
  244. #define BND_COLOR_TEXT_SELECTED {{{ 1,1,1,1 }}}
  245. // radius of tool button
  246. #define BND_TOOL_RADIUS 4
  247. // radius of option button
  248. #define BND_OPTION_RADIUS 4
  249. // width of option button checkbox
  250. #define BND_OPTION_WIDTH 14
  251. // height of option button checkbox
  252. #define BND_OPTION_HEIGHT 15
  253. // radius of text field
  254. #define BND_TEXT_RADIUS 4
  255. // radius of number button
  256. #define BND_NUMBER_RADIUS 10
  257. // radius of menu popup
  258. #define BND_MENU_RADIUS 3
  259. // feather of menu popup shadow
  260. #define BND_SHADOW_FEATHER 12
  261. // alpha of menu popup shadow
  262. #define BND_SHADOW_ALPHA 0.5
  263. // radius of scrollbar
  264. #define BND_SCROLLBAR_RADIUS 7
  265. // shade intensity of active scrollbar
  266. #define BND_SCROLLBAR_ACTIVE_SHADE 15
  267. // max glyphs for position testing
  268. #define BND_MAX_GLYPHS 1024
  269. // max rows for position testing
  270. #define BND_MAX_ROWS 32
  271. // text distance from bottom
  272. #define BND_TEXT_PAD_DOWN 7
  273. // stroke width of wire outline
  274. #define BND_NODE_WIRE_OUTLINE_WIDTH 4
  275. // stroke width of wire
  276. #define BND_NODE_WIRE_WIDTH 2
  277. // radius of node box
  278. #define BND_NODE_RADIUS 8
  279. // feather of node title text
  280. #define BND_NODE_TITLE_FEATHER 1
  281. // size of node title arrow
  282. #define BND_NODE_ARROW_SIZE 9
  283. typedef enum BNDicon {
  284. BND_ICON_NONE = BND_ICONID(0,29),
  285. BND_ICON_QUESTION = BND_ICONID(1,29),
  286. BND_ICON_ERROR = BND_ICONID(2,29),
  287. BND_ICON_CANCEL = BND_ICONID(3,29),
  288. BND_ICON_TRIA_RIGHT = BND_ICONID(4,29),
  289. BND_ICON_TRIA_DOWN = BND_ICONID(5,29),
  290. BND_ICON_TRIA_LEFT = BND_ICONID(6,29),
  291. BND_ICON_TRIA_UP = BND_ICONID(7,29),
  292. BND_ICON_ARROW_LEFTRIGHT = BND_ICONID(8,29),
  293. BND_ICON_PLUS = BND_ICONID(9,29),
  294. BND_ICON_DISCLOSURE_TRI_DOWN = BND_ICONID(10,29),
  295. BND_ICON_DISCLOSURE_TRI_RIGHT = BND_ICONID(11,29),
  296. BND_ICON_RADIOBUT_OFF = BND_ICONID(12,29),
  297. BND_ICON_RADIOBUT_ON = BND_ICONID(13,29),
  298. BND_ICON_MENU_PANEL = BND_ICONID(14,29),
  299. BND_ICON_BLENDER = BND_ICONID(15,29),
  300. BND_ICON_GRIP = BND_ICONID(16,29),
  301. BND_ICON_DOT = BND_ICONID(17,29),
  302. BND_ICON_COLLAPSEMENU = BND_ICONID(18,29),
  303. BND_ICON_X = BND_ICONID(19,29),
  304. BND_ICON_GO_LEFT = BND_ICONID(21,29),
  305. BND_ICON_PLUG = BND_ICONID(22,29),
  306. BND_ICON_UI = BND_ICONID(23,29),
  307. BND_ICON_NODE = BND_ICONID(24,29),
  308. BND_ICON_NODE_SEL = BND_ICONID(25,29),
  309. BND_ICON_FULLSCREEN = BND_ICONID(0,28),
  310. BND_ICON_SPLITSCREEN = BND_ICONID(1,28),
  311. BND_ICON_RIGHTARROW_THIN = BND_ICONID(2,28),
  312. BND_ICON_BORDERMOVE = BND_ICONID(3,28),
  313. BND_ICON_VIEWZOOM = BND_ICONID(4,28),
  314. BND_ICON_ZOOMIN = BND_ICONID(5,28),
  315. BND_ICON_ZOOMOUT = BND_ICONID(6,28),
  316. BND_ICON_PANEL_CLOSE = BND_ICONID(7,28),
  317. BND_ICON_COPY_ID = BND_ICONID(8,28),
  318. BND_ICON_EYEDROPPER = BND_ICONID(9,28),
  319. BND_ICON_LINK_AREA = BND_ICONID(10,28),
  320. BND_ICON_AUTO = BND_ICONID(11,28),
  321. BND_ICON_CHECKBOX_DEHLT = BND_ICONID(12,28),
  322. BND_ICON_CHECKBOX_HLT = BND_ICONID(13,28),
  323. BND_ICON_UNLOCKED = BND_ICONID(14,28),
  324. BND_ICON_LOCKED = BND_ICONID(15,28),
  325. BND_ICON_UNPINNED = BND_ICONID(16,28),
  326. BND_ICON_PINNED = BND_ICONID(17,28),
  327. BND_ICON_SCREEN_BACK = BND_ICONID(18,28),
  328. BND_ICON_RIGHTARROW = BND_ICONID(19,28),
  329. BND_ICON_DOWNARROW_HLT = BND_ICONID(20,28),
  330. BND_ICON_DOTSUP = BND_ICONID(21,28),
  331. BND_ICON_DOTSDOWN = BND_ICONID(22,28),
  332. BND_ICON_LINK = BND_ICONID(23,28),
  333. BND_ICON_INLINK = BND_ICONID(24,28),
  334. BND_ICON_PLUGIN = BND_ICONID(25,28),
  335. BND_ICON_HELP = BND_ICONID(0,27),
  336. BND_ICON_GHOST_ENABLED = BND_ICONID(1,27),
  337. BND_ICON_COLOR = BND_ICONID(2,27),
  338. BND_ICON_LINKED = BND_ICONID(3,27),
  339. BND_ICON_UNLINKED = BND_ICONID(4,27),
  340. BND_ICON_HAND = BND_ICONID(5,27),
  341. BND_ICON_ZOOM_ALL = BND_ICONID(6,27),
  342. BND_ICON_ZOOM_SELECTED = BND_ICONID(7,27),
  343. BND_ICON_ZOOM_PREVIOUS = BND_ICONID(8,27),
  344. BND_ICON_ZOOM_IN = BND_ICONID(9,27),
  345. BND_ICON_ZOOM_OUT = BND_ICONID(10,27),
  346. BND_ICON_RENDER_REGION = BND_ICONID(11,27),
  347. BND_ICON_BORDER_RECT = BND_ICONID(12,27),
  348. BND_ICON_BORDER_LASSO = BND_ICONID(13,27),
  349. BND_ICON_FREEZE = BND_ICONID(14,27),
  350. BND_ICON_STYLUS_PRESSURE = BND_ICONID(15,27),
  351. BND_ICON_GHOST_DISABLED = BND_ICONID(16,27),
  352. BND_ICON_NEW = BND_ICONID(17,27),
  353. BND_ICON_FILE_TICK = BND_ICONID(18,27),
  354. BND_ICON_QUIT = BND_ICONID(19,27),
  355. BND_ICON_URL = BND_ICONID(20,27),
  356. BND_ICON_RECOVER_LAST = BND_ICONID(21,27),
  357. BND_ICON_FULLSCREEN_ENTER = BND_ICONID(23,27),
  358. BND_ICON_FULLSCREEN_EXIT = BND_ICONID(24,27),
  359. BND_ICON_BLANK1 = BND_ICONID(25,27),
  360. BND_ICON_LAMP = BND_ICONID(0,26),
  361. BND_ICON_MATERIAL = BND_ICONID(1,26),
  362. BND_ICON_TEXTURE = BND_ICONID(2,26),
  363. BND_ICON_ANIM = BND_ICONID(3,26),
  364. BND_ICON_WORLD = BND_ICONID(4,26),
  365. BND_ICON_SCENE = BND_ICONID(5,26),
  366. BND_ICON_EDIT = BND_ICONID(6,26),
  367. BND_ICON_GAME = BND_ICONID(7,26),
  368. BND_ICON_RADIO = BND_ICONID(8,26),
  369. BND_ICON_SCRIPT = BND_ICONID(9,26),
  370. BND_ICON_PARTICLES = BND_ICONID(10,26),
  371. BND_ICON_PHYSICS = BND_ICONID(11,26),
  372. BND_ICON_SPEAKER = BND_ICONID(12,26),
  373. BND_ICON_TEXTURE_SHADED = BND_ICONID(13,26),
  374. BND_ICON_VIEW3D = BND_ICONID(0,25),
  375. BND_ICON_IPO = BND_ICONID(1,25),
  376. BND_ICON_OOPS = BND_ICONID(2,25),
  377. BND_ICON_BUTS = BND_ICONID(3,25),
  378. BND_ICON_FILESEL = BND_ICONID(4,25),
  379. BND_ICON_IMAGE_COL = BND_ICONID(5,25),
  380. BND_ICON_INFO = BND_ICONID(6,25),
  381. BND_ICON_SEQUENCE = BND_ICONID(7,25),
  382. BND_ICON_TEXT = BND_ICONID(8,25),
  383. BND_ICON_IMASEL = BND_ICONID(9,25),
  384. BND_ICON_SOUND = BND_ICONID(10,25),
  385. BND_ICON_ACTION = BND_ICONID(11,25),
  386. BND_ICON_NLA = BND_ICONID(12,25),
  387. BND_ICON_SCRIPTWIN = BND_ICONID(13,25),
  388. BND_ICON_TIME = BND_ICONID(14,25),
  389. BND_ICON_NODETREE = BND_ICONID(15,25),
  390. BND_ICON_LOGIC = BND_ICONID(16,25),
  391. BND_ICON_CONSOLE = BND_ICONID(17,25),
  392. BND_ICON_PREFERENCES = BND_ICONID(18,25),
  393. BND_ICON_CLIP = BND_ICONID(19,25),
  394. BND_ICON_ASSET_MANAGER = BND_ICONID(20,25),
  395. BND_ICON_OBJECT_DATAMODE = BND_ICONID(0,24),
  396. BND_ICON_EDITMODE_HLT = BND_ICONID(1,24),
  397. BND_ICON_FACESEL_HLT = BND_ICONID(2,24),
  398. BND_ICON_VPAINT_HLT = BND_ICONID(3,24),
  399. BND_ICON_TPAINT_HLT = BND_ICONID(4,24),
  400. BND_ICON_WPAINT_HLT = BND_ICONID(5,24),
  401. BND_ICON_SCULPTMODE_HLT = BND_ICONID(6,24),
  402. BND_ICON_POSE_HLT = BND_ICONID(7,24),
  403. BND_ICON_PARTICLEMODE = BND_ICONID(8,24),
  404. BND_ICON_LIGHTPAINT = BND_ICONID(9,24),
  405. BND_ICON_SCENE_DATA = BND_ICONID(0,23),
  406. BND_ICON_RENDERLAYERS = BND_ICONID(1,23),
  407. BND_ICON_WORLD_DATA = BND_ICONID(2,23),
  408. BND_ICON_OBJECT_DATA = BND_ICONID(3,23),
  409. BND_ICON_MESH_DATA = BND_ICONID(4,23),
  410. BND_ICON_CURVE_DATA = BND_ICONID(5,23),
  411. BND_ICON_META_DATA = BND_ICONID(6,23),
  412. BND_ICON_LATTICE_DATA = BND_ICONID(7,23),
  413. BND_ICON_LAMP_DATA = BND_ICONID(8,23),
  414. BND_ICON_MATERIAL_DATA = BND_ICONID(9,23),
  415. BND_ICON_TEXTURE_DATA = BND_ICONID(10,23),
  416. BND_ICON_ANIM_DATA = BND_ICONID(11,23),
  417. BND_ICON_CAMERA_DATA = BND_ICONID(12,23),
  418. BND_ICON_PARTICLE_DATA = BND_ICONID(13,23),
  419. BND_ICON_LIBRARY_DATA_DIRECT = BND_ICONID(14,23),
  420. BND_ICON_GROUP = BND_ICONID(15,23),
  421. BND_ICON_ARMATURE_DATA = BND_ICONID(16,23),
  422. BND_ICON_POSE_DATA = BND_ICONID(17,23),
  423. BND_ICON_BONE_DATA = BND_ICONID(18,23),
  424. BND_ICON_CONSTRAINT = BND_ICONID(19,23),
  425. BND_ICON_SHAPEKEY_DATA = BND_ICONID(20,23),
  426. BND_ICON_CONSTRAINT_BONE = BND_ICONID(21,23),
  427. BND_ICON_CAMERA_STEREO = BND_ICONID(22,23),
  428. BND_ICON_PACKAGE = BND_ICONID(23,23),
  429. BND_ICON_UGLYPACKAGE = BND_ICONID(24,23),
  430. BND_ICON_BRUSH_DATA = BND_ICONID(0,22),
  431. BND_ICON_IMAGE_DATA = BND_ICONID(1,22),
  432. BND_ICON_FILE = BND_ICONID(2,22),
  433. BND_ICON_FCURVE = BND_ICONID(3,22),
  434. BND_ICON_FONT_DATA = BND_ICONID(4,22),
  435. BND_ICON_RENDER_RESULT = BND_ICONID(5,22),
  436. BND_ICON_SURFACE_DATA = BND_ICONID(6,22),
  437. BND_ICON_EMPTY_DATA = BND_ICONID(7,22),
  438. BND_ICON_SETTINGS = BND_ICONID(8,22),
  439. BND_ICON_RENDER_ANIMATION = BND_ICONID(9,22),
  440. BND_ICON_RENDER_STILL = BND_ICONID(10,22),
  441. BND_ICON_BOIDS = BND_ICONID(12,22),
  442. BND_ICON_STRANDS = BND_ICONID(13,22),
  443. BND_ICON_LIBRARY_DATA_INDIRECT = BND_ICONID(14,22),
  444. BND_ICON_GREASEPENCIL = BND_ICONID(15,22),
  445. BND_ICON_LINE_DATA = BND_ICONID(16,22),
  446. BND_ICON_GROUP_BONE = BND_ICONID(18,22),
  447. BND_ICON_GROUP_VERTEX = BND_ICONID(19,22),
  448. BND_ICON_GROUP_VCOL = BND_ICONID(20,22),
  449. BND_ICON_GROUP_UVS = BND_ICONID(21,22),
  450. BND_ICON_RNA = BND_ICONID(24,22),
  451. BND_ICON_RNA_ADD = BND_ICONID(25,22),
  452. BND_ICON_OUTLINER_OB_EMPTY = BND_ICONID(0,20),
  453. BND_ICON_OUTLINER_OB_MESH = BND_ICONID(1,20),
  454. BND_ICON_OUTLINER_OB_CURVE = BND_ICONID(2,20),
  455. BND_ICON_OUTLINER_OB_LATTICE = BND_ICONID(3,20),
  456. BND_ICON_OUTLINER_OB_META = BND_ICONID(4,20),
  457. BND_ICON_OUTLINER_OB_LAMP = BND_ICONID(5,20),
  458. BND_ICON_OUTLINER_OB_CAMERA = BND_ICONID(6,20),
  459. BND_ICON_OUTLINER_OB_ARMATURE = BND_ICONID(7,20),
  460. BND_ICON_OUTLINER_OB_FONT = BND_ICONID(8,20),
  461. BND_ICON_OUTLINER_OB_SURFACE = BND_ICONID(9,20),
  462. BND_ICON_OUTLINER_OB_SPEAKER = BND_ICONID(10,20),
  463. BND_ICON_RESTRICT_VIEW_OFF = BND_ICONID(19,20),
  464. BND_ICON_RESTRICT_VIEW_ON = BND_ICONID(20,20),
  465. BND_ICON_RESTRICT_SELECT_OFF = BND_ICONID(21,20),
  466. BND_ICON_RESTRICT_SELECT_ON = BND_ICONID(22,20),
  467. BND_ICON_RESTRICT_RENDER_OFF = BND_ICONID(23,20),
  468. BND_ICON_RESTRICT_RENDER_ON = BND_ICONID(24,20),
  469. BND_ICON_OUTLINER_DATA_EMPTY = BND_ICONID(0,19),
  470. BND_ICON_OUTLINER_DATA_MESH = BND_ICONID(1,19),
  471. BND_ICON_OUTLINER_DATA_CURVE = BND_ICONID(2,19),
  472. BND_ICON_OUTLINER_DATA_LATTICE = BND_ICONID(3,19),
  473. BND_ICON_OUTLINER_DATA_META = BND_ICONID(4,19),
  474. BND_ICON_OUTLINER_DATA_LAMP = BND_ICONID(5,19),
  475. BND_ICON_OUTLINER_DATA_CAMERA = BND_ICONID(6,19),
  476. BND_ICON_OUTLINER_DATA_ARMATURE = BND_ICONID(7,19),
  477. BND_ICON_OUTLINER_DATA_FONT = BND_ICONID(8,19),
  478. BND_ICON_OUTLINER_DATA_SURFACE = BND_ICONID(9,19),
  479. BND_ICON_OUTLINER_DATA_SPEAKER = BND_ICONID(10,19),
  480. BND_ICON_OUTLINER_DATA_POSE = BND_ICONID(11,19),
  481. BND_ICON_MESH_PLANE = BND_ICONID(0,18),
  482. BND_ICON_MESH_CUBE = BND_ICONID(1,18),
  483. BND_ICON_MESH_CIRCLE = BND_ICONID(2,18),
  484. BND_ICON_MESH_UVSPHERE = BND_ICONID(3,18),
  485. BND_ICON_MESH_ICOSPHERE = BND_ICONID(4,18),
  486. BND_ICON_MESH_GRID = BND_ICONID(5,18),
  487. BND_ICON_MESH_MONKEY = BND_ICONID(6,18),
  488. BND_ICON_MESH_CYLINDER = BND_ICONID(7,18),
  489. BND_ICON_MESH_TORUS = BND_ICONID(8,18),
  490. BND_ICON_MESH_CONE = BND_ICONID(9,18),
  491. BND_ICON_LAMP_POINT = BND_ICONID(12,18),
  492. BND_ICON_LAMP_SUN = BND_ICONID(13,18),
  493. BND_ICON_LAMP_SPOT = BND_ICONID(14,18),
  494. BND_ICON_LAMP_HEMI = BND_ICONID(15,18),
  495. BND_ICON_LAMP_AREA = BND_ICONID(16,18),
  496. BND_ICON_META_EMPTY = BND_ICONID(19,18),
  497. BND_ICON_META_PLANE = BND_ICONID(20,18),
  498. BND_ICON_META_CUBE = BND_ICONID(21,18),
  499. BND_ICON_META_BALL = BND_ICONID(22,18),
  500. BND_ICON_META_ELLIPSOID = BND_ICONID(23,18),
  501. BND_ICON_META_CAPSULE = BND_ICONID(24,18),
  502. BND_ICON_SURFACE_NCURVE = BND_ICONID(0,17),
  503. BND_ICON_SURFACE_NCIRCLE = BND_ICONID(1,17),
  504. BND_ICON_SURFACE_NSURFACE = BND_ICONID(2,17),
  505. BND_ICON_SURFACE_NCYLINDER = BND_ICONID(3,17),
  506. BND_ICON_SURFACE_NSPHERE = BND_ICONID(4,17),
  507. BND_ICON_SURFACE_NTORUS = BND_ICONID(5,17),
  508. BND_ICON_CURVE_BEZCURVE = BND_ICONID(9,17),
  509. BND_ICON_CURVE_BEZCIRCLE = BND_ICONID(10,17),
  510. BND_ICON_CURVE_NCURVE = BND_ICONID(11,17),
  511. BND_ICON_CURVE_NCIRCLE = BND_ICONID(12,17),
  512. BND_ICON_CURVE_PATH = BND_ICONID(13,17),
  513. BND_ICON_COLOR_RED = BND_ICONID(19,17),
  514. BND_ICON_COLOR_GREEN = BND_ICONID(20,17),
  515. BND_ICON_COLOR_BLUE = BND_ICONID(21,17),
  516. BND_ICON_FORCE_FORCE = BND_ICONID(0,16),
  517. BND_ICON_FORCE_WIND = BND_ICONID(1,16),
  518. BND_ICON_FORCE_VORTEX = BND_ICONID(2,16),
  519. BND_ICON_FORCE_MAGNETIC = BND_ICONID(3,16),
  520. BND_ICON_FORCE_HARMONIC = BND_ICONID(4,16),
  521. BND_ICON_FORCE_CHARGE = BND_ICONID(5,16),
  522. BND_ICON_FORCE_LENNARDJONES = BND_ICONID(6,16),
  523. BND_ICON_FORCE_TEXTURE = BND_ICONID(7,16),
  524. BND_ICON_FORCE_CURVE = BND_ICONID(8,16),
  525. BND_ICON_FORCE_BOID = BND_ICONID(9,16),
  526. BND_ICON_FORCE_TURBULENCE = BND_ICONID(10,16),
  527. BND_ICON_FORCE_DRAG = BND_ICONID(11,16),
  528. BND_ICON_FORCE_SMOKEFLOW = BND_ICONID(12,16),
  529. BND_ICON_MODIFIER = BND_ICONID(0,12),
  530. BND_ICON_MOD_WAVE = BND_ICONID(1,12),
  531. BND_ICON_MOD_BUILD = BND_ICONID(2,12),
  532. BND_ICON_MOD_DECIM = BND_ICONID(3,12),
  533. BND_ICON_MOD_MIRROR = BND_ICONID(4,12),
  534. BND_ICON_MOD_SOFT = BND_ICONID(5,12),
  535. BND_ICON_MOD_SUBSURF = BND_ICONID(6,12),
  536. BND_ICON_HOOK = BND_ICONID(7,12),
  537. BND_ICON_MOD_PHYSICS = BND_ICONID(8,12),
  538. BND_ICON_MOD_PARTICLES = BND_ICONID(9,12),
  539. BND_ICON_MOD_BOOLEAN = BND_ICONID(10,12),
  540. BND_ICON_MOD_EDGESPLIT = BND_ICONID(11,12),
  541. BND_ICON_MOD_ARRAY = BND_ICONID(12,12),
  542. BND_ICON_MOD_UVPROJECT = BND_ICONID(13,12),
  543. BND_ICON_MOD_DISPLACE = BND_ICONID(14,12),
  544. BND_ICON_MOD_CURVE = BND_ICONID(15,12),
  545. BND_ICON_MOD_LATTICE = BND_ICONID(16,12),
  546. BND_ICON_CONSTRAINT_DATA = BND_ICONID(17,12),
  547. BND_ICON_MOD_ARMATURE = BND_ICONID(18,12),
  548. BND_ICON_MOD_SHRINKWRAP = BND_ICONID(19,12),
  549. BND_ICON_MOD_CAST = BND_ICONID(20,12),
  550. BND_ICON_MOD_MESHDEFORM = BND_ICONID(21,12),
  551. BND_ICON_MOD_BEVEL = BND_ICONID(22,12),
  552. BND_ICON_MOD_SMOOTH = BND_ICONID(23,12),
  553. BND_ICON_MOD_SIMPLEDEFORM = BND_ICONID(24,12),
  554. BND_ICON_MOD_MASK = BND_ICONID(25,12),
  555. BND_ICON_MOD_CLOTH = BND_ICONID(0,11),
  556. BND_ICON_MOD_EXPLODE = BND_ICONID(1,11),
  557. BND_ICON_MOD_FLUIDSIM = BND_ICONID(2,11),
  558. BND_ICON_MOD_MULTIRES = BND_ICONID(3,11),
  559. BND_ICON_MOD_SMOKE = BND_ICONID(4,11),
  560. BND_ICON_MOD_SOLIDIFY = BND_ICONID(5,11),
  561. BND_ICON_MOD_SCREW = BND_ICONID(6,11),
  562. BND_ICON_MOD_VERTEX_WEIGHT = BND_ICONID(7,11),
  563. BND_ICON_MOD_DYNAMICPAINT = BND_ICONID(8,11),
  564. BND_ICON_MOD_REMESH = BND_ICONID(9,11),
  565. BND_ICON_MOD_OCEAN = BND_ICONID(10,11),
  566. BND_ICON_MOD_WARP = BND_ICONID(11,11),
  567. BND_ICON_MOD_SKIN = BND_ICONID(12,11),
  568. BND_ICON_MOD_TRIANGULATE = BND_ICONID(13,11),
  569. BND_ICON_MOD_WIREFRAME = BND_ICONID(14,11),
  570. BND_ICON_REC = BND_ICONID(0,10),
  571. BND_ICON_PLAY = BND_ICONID(1,10),
  572. BND_ICON_FF = BND_ICONID(2,10),
  573. BND_ICON_REW = BND_ICONID(3,10),
  574. BND_ICON_PAUSE = BND_ICONID(4,10),
  575. BND_ICON_PREV_KEYFRAME = BND_ICONID(5,10),
  576. BND_ICON_NEXT_KEYFRAME = BND_ICONID(6,10),
  577. BND_ICON_PLAY_AUDIO = BND_ICONID(7,10),
  578. BND_ICON_PLAY_REVERSE = BND_ICONID(8,10),
  579. BND_ICON_PREVIEW_RANGE = BND_ICONID(9,10),
  580. BND_ICON_ACTION_TWEAK = BND_ICONID(10,10),
  581. BND_ICON_PMARKER_ACT = BND_ICONID(11,10),
  582. BND_ICON_PMARKER_SEL = BND_ICONID(12,10),
  583. BND_ICON_PMARKER = BND_ICONID(13,10),
  584. BND_ICON_MARKER_HLT = BND_ICONID(14,10),
  585. BND_ICON_MARKER = BND_ICONID(15,10),
  586. BND_ICON_SPACE2 = BND_ICONID(16,10),
  587. BND_ICON_SPACE3 = BND_ICONID(17,10),
  588. BND_ICON_KEYINGSET = BND_ICONID(18,10),
  589. BND_ICON_KEY_DEHLT = BND_ICONID(19,10),
  590. BND_ICON_KEY_HLT = BND_ICONID(20,10),
  591. BND_ICON_MUTE_IPO_OFF = BND_ICONID(21,10),
  592. BND_ICON_MUTE_IPO_ON = BND_ICONID(22,10),
  593. BND_ICON_VISIBLE_IPO_OFF = BND_ICONID(23,10),
  594. BND_ICON_VISIBLE_IPO_ON = BND_ICONID(24,10),
  595. BND_ICON_DRIVER = BND_ICONID(25,10),
  596. BND_ICON_SOLO_OFF = BND_ICONID(0,9),
  597. BND_ICON_SOLO_ON = BND_ICONID(1,9),
  598. BND_ICON_FRAME_PREV = BND_ICONID(2,9),
  599. BND_ICON_FRAME_NEXT = BND_ICONID(3,9),
  600. BND_ICON_NLA_PUSHDOWN = BND_ICONID(4,9),
  601. BND_ICON_IPO_CONSTANT = BND_ICONID(5,9),
  602. BND_ICON_IPO_LINEAR = BND_ICONID(6,9),
  603. BND_ICON_IPO_BEZIER = BND_ICONID(7,9),
  604. BND_ICON_IPO_SINE = BND_ICONID(8,9),
  605. BND_ICON_IPO_QUAD = BND_ICONID(9,9),
  606. BND_ICON_IPO_CUBIC = BND_ICONID(10,9),
  607. BND_ICON_IPO_QUART = BND_ICONID(11,9),
  608. BND_ICON_IPO_QUINT = BND_ICONID(12,9),
  609. BND_ICON_IPO_EXPO = BND_ICONID(13,9),
  610. BND_ICON_IPO_CIRC = BND_ICONID(14,9),
  611. BND_ICON_IPO_BOUNCE = BND_ICONID(15,9),
  612. BND_ICON_IPO_ELASTIC = BND_ICONID(16,9),
  613. BND_ICON_IPO_BACK = BND_ICONID(17,9),
  614. BND_ICON_IPO_EASE_IN = BND_ICONID(18,9),
  615. BND_ICON_IPO_EASE_OUT = BND_ICONID(19,9),
  616. BND_ICON_IPO_EASE_IN_OUT = BND_ICONID(20,9),
  617. BND_ICON_VERTEXSEL = BND_ICONID(0,8),
  618. BND_ICON_EDGESEL = BND_ICONID(1,8),
  619. BND_ICON_FACESEL = BND_ICONID(2,8),
  620. BND_ICON_LOOPSEL = BND_ICONID(3,8),
  621. BND_ICON_ROTATE = BND_ICONID(5,8),
  622. BND_ICON_CURSOR = BND_ICONID(6,8),
  623. BND_ICON_ROTATECOLLECTION = BND_ICONID(7,8),
  624. BND_ICON_ROTATECENTER = BND_ICONID(8,8),
  625. BND_ICON_ROTACTIVE = BND_ICONID(9,8),
  626. BND_ICON_ALIGN = BND_ICONID(10,8),
  627. BND_ICON_SMOOTHCURVE = BND_ICONID(12,8),
  628. BND_ICON_SPHERECURVE = BND_ICONID(13,8),
  629. BND_ICON_ROOTCURVE = BND_ICONID(14,8),
  630. BND_ICON_SHARPCURVE = BND_ICONID(15,8),
  631. BND_ICON_LINCURVE = BND_ICONID(16,8),
  632. BND_ICON_NOCURVE = BND_ICONID(17,8),
  633. BND_ICON_RNDCURVE = BND_ICONID(18,8),
  634. BND_ICON_PROP_OFF = BND_ICONID(19,8),
  635. BND_ICON_PROP_ON = BND_ICONID(20,8),
  636. BND_ICON_PROP_CON = BND_ICONID(21,8),
  637. BND_ICON_SCULPT_DYNTOPO = BND_ICONID(22,8),
  638. BND_ICON_PARTICLE_POINT = BND_ICONID(23,8),
  639. BND_ICON_PARTICLE_TIP = BND_ICONID(24,8),
  640. BND_ICON_PARTICLE_PATH = BND_ICONID(25,8),
  641. BND_ICON_MAN_TRANS = BND_ICONID(0,7),
  642. BND_ICON_MAN_ROT = BND_ICONID(1,7),
  643. BND_ICON_MAN_SCALE = BND_ICONID(2,7),
  644. BND_ICON_MANIPUL = BND_ICONID(3,7),
  645. BND_ICON_SNAP_OFF = BND_ICONID(4,7),
  646. BND_ICON_SNAP_ON = BND_ICONID(5,7),
  647. BND_ICON_SNAP_NORMAL = BND_ICONID(6,7),
  648. BND_ICON_SNAP_INCREMENT = BND_ICONID(7,7),
  649. BND_ICON_SNAP_VERTEX = BND_ICONID(8,7),
  650. BND_ICON_SNAP_EDGE = BND_ICONID(9,7),
  651. BND_ICON_SNAP_FACE = BND_ICONID(10,7),
  652. BND_ICON_SNAP_VOLUME = BND_ICONID(11,7),
  653. BND_ICON_STICKY_UVS_LOC = BND_ICONID(13,7),
  654. BND_ICON_STICKY_UVS_DISABLE = BND_ICONID(14,7),
  655. BND_ICON_STICKY_UVS_VERT = BND_ICONID(15,7),
  656. BND_ICON_CLIPUV_DEHLT = BND_ICONID(16,7),
  657. BND_ICON_CLIPUV_HLT = BND_ICONID(17,7),
  658. BND_ICON_SNAP_PEEL_OBJECT = BND_ICONID(18,7),
  659. BND_ICON_GRID = BND_ICONID(19,7),
  660. BND_ICON_PASTEDOWN = BND_ICONID(0,6),
  661. BND_ICON_COPYDOWN = BND_ICONID(1,6),
  662. BND_ICON_PASTEFLIPUP = BND_ICONID(2,6),
  663. BND_ICON_PASTEFLIPDOWN = BND_ICONID(3,6),
  664. BND_ICON_SNAP_SURFACE = BND_ICONID(8,6),
  665. BND_ICON_AUTOMERGE_ON = BND_ICONID(9,6),
  666. BND_ICON_AUTOMERGE_OFF = BND_ICONID(10,6),
  667. BND_ICON_RETOPO = BND_ICONID(11,6),
  668. BND_ICON_UV_VERTEXSEL = BND_ICONID(12,6),
  669. BND_ICON_UV_EDGESEL = BND_ICONID(13,6),
  670. BND_ICON_UV_FACESEL = BND_ICONID(14,6),
  671. BND_ICON_UV_ISLANDSEL = BND_ICONID(15,6),
  672. BND_ICON_UV_SYNC_SELECT = BND_ICONID(16,6),
  673. BND_ICON_BBOX = BND_ICONID(0,5),
  674. BND_ICON_WIRE = BND_ICONID(1,5),
  675. BND_ICON_SOLID = BND_ICONID(2,5),
  676. BND_ICON_SMOOTH = BND_ICONID(3,5),
  677. BND_ICON_POTATO = BND_ICONID(4,5),
  678. BND_ICON_ORTHO = BND_ICONID(6,5),
  679. BND_ICON_LOCKVIEW_OFF = BND_ICONID(9,5),
  680. BND_ICON_LOCKVIEW_ON = BND_ICONID(10,5),
  681. BND_ICON_AXIS_SIDE = BND_ICONID(12,5),
  682. BND_ICON_AXIS_FRONT = BND_ICONID(13,5),
  683. BND_ICON_AXIS_TOP = BND_ICONID(14,5),
  684. BND_ICON_NDOF_DOM = BND_ICONID(15,5),
  685. BND_ICON_NDOF_TURN = BND_ICONID(16,5),
  686. BND_ICON_NDOF_FLY = BND_ICONID(17,5),
  687. BND_ICON_NDOF_TRANS = BND_ICONID(18,5),
  688. BND_ICON_LAYER_USED = BND_ICONID(19,5),
  689. BND_ICON_LAYER_ACTIVE = BND_ICONID(20,5),
  690. BND_ICON_SORTALPHA = BND_ICONID(0,3),
  691. BND_ICON_SORTBYEXT = BND_ICONID(1,3),
  692. BND_ICON_SORTTIME = BND_ICONID(2,3),
  693. BND_ICON_SORTSIZE = BND_ICONID(3,3),
  694. BND_ICON_LONGDISPLAY = BND_ICONID(4,3),
  695. BND_ICON_SHORTDISPLAY = BND_ICONID(5,3),
  696. BND_ICON_GHOST = BND_ICONID(6,3),
  697. BND_ICON_IMGDISPLAY = BND_ICONID(7,3),
  698. BND_ICON_SAVE_AS = BND_ICONID(8,3),
  699. BND_ICON_SAVE_COPY = BND_ICONID(9,3),
  700. BND_ICON_BOOKMARKS = BND_ICONID(10,3),
  701. BND_ICON_FONTPREVIEW = BND_ICONID(11,3),
  702. BND_ICON_FILTER = BND_ICONID(12,3),
  703. BND_ICON_NEWFOLDER = BND_ICONID(13,3),
  704. BND_ICON_OPEN_RECENT = BND_ICONID(14,3),
  705. BND_ICON_FILE_PARENT = BND_ICONID(15,3),
  706. BND_ICON_FILE_REFRESH = BND_ICONID(16,3),
  707. BND_ICON_FILE_FOLDER = BND_ICONID(17,3),
  708. BND_ICON_FILE_BLANK = BND_ICONID(18,3),
  709. BND_ICON_FILE_BLEND = BND_ICONID(19,3),
  710. BND_ICON_FILE_IMAGE = BND_ICONID(20,3),
  711. BND_ICON_FILE_MOVIE = BND_ICONID(21,3),
  712. BND_ICON_FILE_SCRIPT = BND_ICONID(22,3),
  713. BND_ICON_FILE_SOUND = BND_ICONID(23,3),
  714. BND_ICON_FILE_FONT = BND_ICONID(24,3),
  715. BND_ICON_FILE_TEXT = BND_ICONID(25,3),
  716. BND_ICON_RECOVER_AUTO = BND_ICONID(0,2),
  717. BND_ICON_SAVE_PREFS = BND_ICONID(1,2),
  718. BND_ICON_LINK_BLEND = BND_ICONID(2,2),
  719. BND_ICON_APPEND_BLEND = BND_ICONID(3,2),
  720. BND_ICON_IMPORT = BND_ICONID(4,2),
  721. BND_ICON_EXPORT = BND_ICONID(5,2),
  722. BND_ICON_EXTERNAL_DATA = BND_ICONID(6,2),
  723. BND_ICON_LOAD_FACTORY = BND_ICONID(7,2),
  724. BND_ICON_LOOP_BACK = BND_ICONID(13,2),
  725. BND_ICON_LOOP_FORWARDS = BND_ICONID(14,2),
  726. BND_ICON_BACK = BND_ICONID(15,2),
  727. BND_ICON_FORWARD = BND_ICONID(16,2),
  728. BND_ICON_FILE_BACKUP = BND_ICONID(24,2),
  729. BND_ICON_DISK_DRIVE = BND_ICONID(25,2),
  730. BND_ICON_MATPLANE = BND_ICONID(0,1),
  731. BND_ICON_MATSPHERE = BND_ICONID(1,1),
  732. BND_ICON_MATCUBE = BND_ICONID(2,1),
  733. BND_ICON_MONKEY = BND_ICONID(3,1),
  734. BND_ICON_HAIR = BND_ICONID(4,1),
  735. BND_ICON_ALIASED = BND_ICONID(5,1),
  736. BND_ICON_ANTIALIASED = BND_ICONID(6,1),
  737. BND_ICON_MAT_SPHERE_SKY = BND_ICONID(7,1),
  738. BND_ICON_WORDWRAP_OFF = BND_ICONID(12,1),
  739. BND_ICON_WORDWRAP_ON = BND_ICONID(13,1),
  740. BND_ICON_SYNTAX_OFF = BND_ICONID(14,1),
  741. BND_ICON_SYNTAX_ON = BND_ICONID(15,1),
  742. BND_ICON_LINENUMBERS_OFF = BND_ICONID(16,1),
  743. BND_ICON_LINENUMBERS_ON = BND_ICONID(17,1),
  744. BND_ICON_SCRIPTPLUGINS = BND_ICONID(18,1),
  745. BND_ICON_SEQ_SEQUENCER = BND_ICONID(0,0),
  746. BND_ICON_SEQ_PREVIEW = BND_ICONID(1,0),
  747. BND_ICON_SEQ_LUMA_WAVEFORM = BND_ICONID(2,0),
  748. BND_ICON_SEQ_CHROMA_SCOPE = BND_ICONID(3,0),
  749. BND_ICON_SEQ_HISTOGRAM = BND_ICONID(4,0),
  750. BND_ICON_SEQ_SPLITVIEW = BND_ICONID(5,0),
  751. BND_ICON_IMAGE_RGB = BND_ICONID(9,0),
  752. BND_ICON_IMAGE_RGB_ALPHA = BND_ICONID(10,0),
  753. BND_ICON_IMAGE_ALPHA = BND_ICONID(11,0),
  754. BND_ICON_IMAGE_ZDEPTH = BND_ICONID(12,0),
  755. BND_ICON_IMAGEFILE = BND_ICONID(13,0),
  756. } BNDicon;
  757. ////////////////////////////////////////////////////////////////////////////////
  758. // set the current theme all widgets will be drawn with.
  759. // the default Blender 2.6 theme is set by default.
  760. BND_EXPORT void bndSetTheme(BNDtheme theme);
  761. // Returns the currently set theme
  762. BND_EXPORT const BNDtheme *bndGetTheme();
  763. // designates an image handle as returned by nvgCreateImage*() as the themes'
  764. // icon sheet. The icon sheet format must be compatible to Blender 2.6's icon
  765. // sheet; the order of icons does not matter.
  766. // A valid icon sheet is e.g. shown at
  767. // http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Add_an_icon
  768. BND_EXPORT void bndSetIconImage(int image);
  769. // designates an image handle as returned by nvgCreateFont*() as the themes'
  770. // UI font. Blender's original UI font Droid Sans is perfectly suited and
  771. // available here:
  772. // https://svn.blender.org/svnroot/bf-blender/trunk/blender/release/datafiles/fonts/
  773. BND_EXPORT void bndSetFont(int font);
  774. ////////////////////////////////////////////////////////////////////////////////
  775. // High Level Functions
  776. // --------------------
  777. // Use these functions to draw themed widgets with your NVGcontext.
  778. // Draw a label with its lower left origin at (x,y) and size of (w,h).
  779. // if iconid >= 0, an icon will be added to the widget
  780. // if label is not NULL, a label will be added to the widget
  781. // widget looks best when height is BND_WIDGET_HEIGHT
  782. BND_EXPORT void bndLabel(NVGcontext *ctx,
  783. float x, float y, float w, float h, int iconid, const char *label);
  784. // Draw a tool button with its lower left origin at (x,y) and size of (w,h),
  785. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  786. // the widgets current UI state.
  787. // if iconid >= 0, an icon will be added to the widget
  788. // if label is not NULL, a label will be added to the widget
  789. // widget looks best when height is BND_WIDGET_HEIGHT
  790. BND_EXPORT void bndToolButton(NVGcontext *ctx,
  791. float x, float y, float w, float h, int flags, BNDwidgetState state,
  792. int iconid, const char *label);
  793. // Draw a radio button with its lower left origin at (x,y) and size of (w,h),
  794. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  795. // the widgets current UI state.
  796. // if iconid >= 0, an icon will be added to the widget
  797. // if label is not NULL, a label will be added to the widget
  798. // widget looks best when height is BND_WIDGET_HEIGHT
  799. BND_EXPORT void bndRadioButton(NVGcontext *ctx,
  800. float x, float y, float w, float h, int flags, BNDwidgetState state,
  801. int iconid, const char *label);
  802. // Calculate the corresponding text position for given coordinates px/py
  803. // in a text field.
  804. // See bndTextField for more info.
  805. BND_EXPORT int bndTextFieldTextPosition(NVGcontext *ctx, float x, float y, float w, float h,
  806. int iconid, const char *text, int px, int py);
  807. // Draw a text field with its lower left origin at (x,y) and size of (w,h),
  808. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  809. // the widgets current UI state.
  810. // if iconid >= 0, an icon will be added to the widget
  811. // if text is not NULL, text will be printed to the widget
  812. // cbegin must be >= 0 and <= strlen(text) and denotes the beginning of the caret
  813. // cend must be >= cbegin and <= strlen(text) and denotes the end of the caret
  814. // if cend < cbegin, then no caret will be drawn
  815. // widget looks best when height is BND_WIDGET_HEIGHT
  816. BND_EXPORT void bndTextField(NVGcontext *ctx,
  817. float x, float y, float w, float h, int flags, BNDwidgetState state,
  818. int iconid, const char *text, int cbegin, int cend);
  819. // Draw an option button with its lower left origin at (x,y) and size of (w,h),
  820. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  821. // the widgets current UI state.
  822. // if label is not NULL, a label will be added to the widget
  823. // widget looks best when height is BND_WIDGET_HEIGHT
  824. BND_EXPORT void bndOptionButton(NVGcontext *ctx,
  825. float x, float y, float w, float h, BNDwidgetState state,
  826. const char *label);
  827. // Draw a choice button with its lower left origin at (x,y) and size of (w,h),
  828. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  829. // the widgets current UI state.
  830. // if iconid >= 0, an icon will be added to the widget
  831. // if label is not NULL, a label will be added to the widget
  832. // widget looks best when height is BND_WIDGET_HEIGHT
  833. BND_EXPORT void bndChoiceButton(NVGcontext *ctx,
  834. float x, float y, float w, float h, int flags, BNDwidgetState state,
  835. int iconid, const char *label);
  836. // Draw a color button with its lower left origin at (x,y) and size of (w,h),
  837. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  838. // the widgets current UI state.
  839. // widget looks best when height is BND_WIDGET_HEIGHT
  840. BND_EXPORT void bndColorButton(NVGcontext *ctx,
  841. float x, float y, float w, float h, int flags, NVGcolor color);
  842. // Draw a number field with its lower left origin at (x,y) and size of (w,h),
  843. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  844. // the widgets current UI state.
  845. // if label is not NULL, a label will be added to the widget
  846. // if value is not NULL, a value will be added to the widget, along with
  847. // a ":" separator
  848. // widget looks best when height is BND_WIDGET_HEIGHT
  849. BND_EXPORT void bndNumberField(NVGcontext *ctx,
  850. float x, float y, float w, float h, int flags, BNDwidgetState state,
  851. const char *label, const char *value);
  852. // Draw slider control with its lower left origin at (x,y) and size of (w,h),
  853. // where flags is one or multiple flags from BNDcornerFlags and state denotes
  854. // the widgets current UI state.
  855. // progress must be in the range 0..1 and controls the size of the slider bar
  856. // if label is not NULL, a label will be added to the widget
  857. // if value is not NULL, a value will be added to the widget, along with
  858. // a ":" separator
  859. // widget looks best when height is BND_WIDGET_HEIGHT
  860. BND_EXPORT void bndSlider(NVGcontext *ctx,
  861. float x, float y, float w, float h, int flags, BNDwidgetState state,
  862. float progress, const char *label, const char *value);
  863. // Draw scrollbar with its lower left origin at (x,y) and size of (w,h),
  864. // where state denotes the widgets current UI state.
  865. // offset is in the range 0..1 and controls the position of the scroll handle
  866. // size is in the range 0..1 and controls the size of the scroll handle
  867. // horizontal widget looks best when height is BND_SCROLLBAR_HEIGHT,
  868. // vertical looks best when width is BND_SCROLLBAR_WIDTH
  869. BND_EXPORT void bndScrollBar(NVGcontext *ctx,
  870. float x, float y, float w, float h, BNDwidgetState state,
  871. float offset, float size);
  872. // Draw a menu background with its lower left origin at (x,y) and size of (w,h),
  873. // where flags is one or multiple flags from BNDcornerFlags.
  874. BND_EXPORT void bndMenuBackground(NVGcontext *ctx,
  875. float x, float y, float w, float h, int flags);
  876. // Draw a menu label with its lower left origin at (x,y) and size of (w,h).
  877. // if iconid >= 0, an icon will be added to the widget
  878. // if label is not NULL, a label will be added to the widget
  879. // widget looks best when height is BND_WIDGET_HEIGHT
  880. BND_EXPORT void bndMenuLabel(NVGcontext *ctx,
  881. float x, float y, float w, float h, int iconid, const char *label);
  882. // Draw a menu item with its lower left origin at (x,y) and size of (w,h),
  883. // where state denotes the widgets current UI state.
  884. // if iconid >= 0, an icon will be added to the widget
  885. // if label is not NULL, a label will be added to the widget
  886. // widget looks best when height is BND_WIDGET_HEIGHT
  887. BND_EXPORT void bndMenuItem(NVGcontext *ctx,
  888. float x, float y, float w, float h, BNDwidgetState state,
  889. int iconid, const char *label);
  890. // Draw a tooltip background with its lower left origin at (x,y) and size of (w,h)
  891. BND_EXPORT void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, float h);
  892. // Draw a node port at the given position filled with the given color
  893. BND_EXPORT void bndNodePort(NVGcontext *ctx, float x, float y, BNDwidgetState state,
  894. NVGcolor color);
  895. // Draw a node wire originating at (x0,y0) and floating to (x1,y1), with
  896. // a colored gradient based on the states state0 and state1:
  897. // BND_DEFAULT: default wire color
  898. // BND_HOVER: selected wire color
  899. // BND_ACTIVE: dragged wire color
  900. BND_EXPORT void bndNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1,
  901. BNDwidgetState state0, BNDwidgetState state1);
  902. // Draw a node wire originating at (x0,y0) and floating to (x1,y1), with
  903. // a colored gradient based on the two colors color0 and color1
  904. BND_EXPORT void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1,
  905. NVGcolor color0, NVGcolor color1);
  906. // Draw a node background with its upper left origin at (x,y) and size of (w,h)
  907. // where titleColor provides the base color for the title bar
  908. BND_EXPORT void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h,
  909. BNDwidgetState state, int iconid, const char *label, NVGcolor titleColor);
  910. // Draw a window with the upper right and lower left splitter widgets into
  911. // the rectangle at origin (x,y) and size (w, h)
  912. BND_EXPORT void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h);
  913. // Draw the join area overlay stencil into the rectangle
  914. // at origin (x,y) and size (w,h)
  915. // vertical is 0 or 1 and designates the arrow orientation,
  916. // mirror is 0 or 1 and flips the arrow side
  917. BND_EXPORT void bndJoinAreaOverlay(NVGcontext *ctx, float x, float y, float w, float h,
  918. int vertical, int mirror);
  919. ////////////////////////////////////////////////////////////////////////////////
  920. // Estimator Functions
  921. // -------------------
  922. // Use these functions to estimate sizes for widgets with your NVGcontext.
  923. // returns the ideal width for a label with given icon and text
  924. BND_EXPORT float bndLabelWidth(NVGcontext *ctx, int iconid, const char *label);
  925. // returns the height for a label with given icon, text and width; this
  926. // function is primarily useful in conjunction with multiline labels and textboxes
  927. BND_EXPORT float bndLabelHeight(NVGcontext *ctx, int iconid, const char *label,
  928. float width);
  929. ////////////////////////////////////////////////////////////////////////////////
  930. // Low Level Functions
  931. // -------------------
  932. // these are part of the implementation detail and can be used to theme
  933. // new kinds of controls in a similar fashion.
  934. // make color transparent using the default alpha value
  935. BND_EXPORT NVGcolor bndTransparent(NVGcolor color);
  936. // offset a color by a given integer delta in the range -100 to 100
  937. BND_EXPORT NVGcolor bndOffsetColor(NVGcolor color, int delta);
  938. // assigns radius r to the four entries of array radiuses depending on whether
  939. // the corner is marked as sharp or not; see BNDcornerFlags for possible
  940. // flag values.
  941. BND_EXPORT void bndSelectCorners(float *radiuses, float r, int flags);
  942. // computes the upper and lower gradient colors for the inner box from a widget
  943. // theme and the widgets state. If flipActive is set and the state is
  944. // BND_ACTIVE, the upper and lower colors will be swapped.
  945. BND_EXPORT void bndInnerColors(NVGcolor *shade_top, NVGcolor *shade_down,
  946. const BNDwidgetTheme *theme, BNDwidgetState state, int flipActive);
  947. // computes the text color for a widget label from a widget theme and the
  948. // widgets state.
  949. BND_EXPORT NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState state);
  950. // computes the bounds of the scrollbar handle from the scrollbar size
  951. // and the handles offset and size.
  952. // offset is in the range 0..1 and defines the position of the scroll handle
  953. // size is in the range 0..1 and defines the size of the scroll handle
  954. BND_EXPORT void bndScrollHandleRect(float *x, float *y, float *w, float *h,
  955. float offset, float size);
  956. // Add a rounded box path at position (x,y) with size (w,h) and a separate
  957. // radius for each corner listed in clockwise order, so that cr0 = top left,
  958. // cr1 = top right, cr2 = bottom right, cr3 = bottom left;
  959. // this is a low level drawing function: the path must be stroked or filled
  960. // to become visible.
  961. BND_EXPORT void bndRoundedBox(NVGcontext *ctx, float x, float y, float w, float h,
  962. float cr0, float cr1, float cr2, float cr3);
  963. // Draw a flat panel without any decorations at position (x,y) with size (w,h)
  964. // and fills it with backgroundColor
  965. BND_EXPORT void bndBackground(NVGcontext *ctx, float x, float y, float w, float h);
  966. // Draw a beveled border at position (x,y) with size (w,h) shaded with
  967. // lighter and darker versions of backgroundColor
  968. BND_EXPORT void bndBevel(NVGcontext *ctx, float x, float y, float w, float h);
  969. // Draw a lower inset for a rounded box at position (x,y) with size (w,h)
  970. // that gives the impression the surface has been pushed in.
  971. // cr2 and cr3 contain the radiuses of the bottom right and bottom left
  972. // corners of the rounded box.
  973. BND_EXPORT void bndBevelInset(NVGcontext *ctx, float x, float y, float w, float h,
  974. float cr2, float cr3);
  975. // Draw an icon with (x,y) as its upper left coordinate; the iconid selects
  976. // the icon from the sheet; use the BND_ICONID macro to build icon IDs.
  977. BND_EXPORT void bndIcon(NVGcontext *ctx, float x, float y, int iconid);
  978. // Draw a drop shadow around the rounded box at (x,y) with size (w,h) and
  979. // radius r, with feather as its maximum range in pixels.
  980. // No shadow will be painted inside the rounded box.
  981. BND_EXPORT void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h,
  982. float r, float feather, float alpha);
  983. // Draw the inner part of a widget box, with a gradient from shade_top to
  984. // shade_down. If h>w, the gradient will be horizontal instead of
  985. // vertical.
  986. BND_EXPORT void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h,
  987. float cr0, float cr1, float cr2, float cr3,
  988. NVGcolor shade_top, NVGcolor shade_down);
  989. // Draw the outline part of a widget box with the given color
  990. BND_EXPORT void bndOutlineBox(NVGcontext *ctx, float x, float y, float w, float h,
  991. float cr0, float cr1, float cr2, float cr3, NVGcolor color);
  992. // Draw an optional icon specified by <iconid> and an optional label with
  993. // given alignment (BNDtextAlignment), fontsize and color within a widget box.
  994. // if iconid is >= 0, an icon will be drawn and the labels remaining space
  995. // will be adjusted.
  996. // if label is not NULL, it will be drawn with the specified alignment, fontsize
  997. // and color.
  998. // if value is not NULL, label and value will be drawn with a ":" separator
  999. // inbetween.
  1000. BND_EXPORT void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h,
  1001. int iconid, NVGcolor color, int align, float fontsize, const char *label,
  1002. const char *value);
  1003. // Draw an optional icon specified by <iconid> and an optional label with
  1004. // given alignment (BNDtextAlignment), fontsize and color within a node title bar
  1005. // if iconid is >= 0, an icon will be drawn
  1006. // if label is not NULL, it will be drawn with the specified alignment, fontsize
  1007. // and color.
  1008. BND_EXPORT void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h,
  1009. int iconid, NVGcolor color, NVGcolor shadowColor, int align,
  1010. float fontsize, const char *label);
  1011. // Calculate the corresponding text position for given coordinates px/py
  1012. // in an iconLabel.
  1013. // See bndIconLabelCaret for more info.
  1014. BND_EXPORT int bndIconLabelTextPosition(NVGcontext *ctx, float x, float y, float w, float h,
  1015. int iconid, float fontsize, const char *label, int px, int py);
  1016. // Draw an optional icon specified by <iconid>, an optional label and
  1017. // a caret with given fontsize and color within a widget box.
  1018. // if iconid is >= 0, an icon will be drawn and the labels remaining space
  1019. // will be adjusted.
  1020. // if label is not NULL, it will be drawn with the specified alignment, fontsize
  1021. // and color.
  1022. // cbegin must be >= 0 and <= strlen(text) and denotes the beginning of the caret
  1023. // cend must be >= cbegin and <= strlen(text) and denotes the end of the caret
  1024. // if cend < cbegin, then no caret will be drawn
  1025. BND_EXPORT void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h,
  1026. int iconid, NVGcolor color, float fontsize, const char *label,
  1027. NVGcolor caretcolor, int cbegin, int cend);
  1028. // Draw a checkmark for an option box with the given upper left coordinates
  1029. // (ox,oy) with the specified color.
  1030. BND_EXPORT void bndCheck(NVGcontext *ctx, float ox, float oy, NVGcolor color);
  1031. // Draw a horizontal arrow for a number field with its center at (x,y) and
  1032. // size s; if s is negative, the arrow points to the left.
  1033. BND_EXPORT void bndArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color);
  1034. // Draw an up/down arrow for a choice box with its center at (x,y) and size s
  1035. BND_EXPORT void bndUpDownArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color);
  1036. // Draw a node down-arrow with its tip at (x,y) and size s
  1037. BND_EXPORT void bndNodeArrowDown(NVGcontext *ctx, float x, float y, float s, NVGcolor color);
  1038. // return the color of a node wire based on state
  1039. // BND_HOVER indicates selected state,
  1040. // BND_ACTIVE indicates dragged state
  1041. BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState state);
  1042. #ifdef __cplusplus
  1043. };
  1044. #endif
  1045. #endif // BLENDISH_H