windef.h 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465
  1. /** @file
  2. * Header file for GUI engine interfaces and structures.
  3. *
  4. * @author mandy.wu 2010/12/06 (Add duplicate controls' core struct)
  5. * @author tzungming.lin 2011/03/21 (Icon rotation support)
  6. * @version 0.1
  7. */
  8. #ifndef _WINDEF_H
  9. #define _WINDEF_H
  10. #include "gui_eng/stddefs.h"
  11. #define ICON_ID_INVALID (-1) /**< Invalid icon ID. */
  12. #define STRING_ID_INVALID (-1) /**< Invalid string ID. */
  13. #define DISABLED_LAST (0x77)
  14. #define ICON_LAST (0x7FFF) /**< Indicate the last element of icon ID list. */
  15. #define STRING_LAST (0x7FFFFFFF) /**< Indicate the last element of string list. */
  16. #define GEL_IGNORE_CHAR (0x11) /**< Code that is ignored while parsing a string. */
  17. #define GEL_AA_ANCHOR_LAST (0xFF) /**< Indicate the last element of start indices of AA groups. */
  18. #define INVILID_BLOCKID (0) /* */
  19. /* State */
  20. #define WIN_ACTIVE (1 << 0)
  21. #define WIN_NORMAL (1 << 1)
  22. #define STATE_NORMAL (1 << 0)
  23. #define STATE_FOCUSED (1 << 1)
  24. #define STATE_DISABLED (1 << 2)
  25. #define STATE_CLICKED (1 << 3)
  26. #define STATE_INVISIBLE (1 << 4)
  27. #define STATE_MAX (4)
  28. /* Styles for Menu/Popup */
  29. /* Gray levels of Anti-aliasing for vector font support */
  30. #define WS_AA_LEVEL_NONE (0) // Do not apply AA on 8bpp region.
  31. #define WS_AA_LEVEL_4 (1) // Use last (4-2) grayscale colors of palette.
  32. #define WS_AA_LEVEL_8 (1 << 1) // Use last (8-2) grayscale colors of palette.
  33. #define WS_AA_LEVEL_FULL (1 << 2) // Use full 256 color of palette.
  34. #define WS_AA_DISABLED (1 << 3) // Force AA to be disabled on all kind of region.
  35. #define WS_AA_MASK (0x0000000F)
  36. /* Number of groups of gray level colors for 8bpp anti-aliasing - 5-8 bits */
  37. #define WS_AA_GROUP_NUM_MASK (0x000000F0)
  38. /* Common Styles - 0~20 bits*/
  39. /* Grouped control direction */
  40. #define CS_CTR_V (1) // Vitical
  41. #define CS_CTR_H (1 << 1) // Horizontal
  42. /* Icon style */
  43. #define CS_SIDE_V (1 << 2) // Side icon virtical repeat
  44. #define CS_SIDE_H (1 << 3) // Side icon horizontal repeat
  45. #define CS_PIC_REPEAT (0x10 << 0) // Icon style: repeat
  46. #define CS_PIC_MIRROR (0x10 << 1) // Icon style: rot mirror
  47. #define CS_PIC_FLIP (0x10 << 2) // Icon style: rot flip
  48. /* Text alignment in horizontal */
  49. #define CS_FONT_LEFT (0x10 << 3) // Text align: left in horizontal
  50. #define CS_FONT_CENTER (0x100 << 0) // Text align: center in horizontal
  51. #define CS_FONT_RIGHT (0x100 << 1) // Text align: right in horizontal
  52. #define CS_FONT_CP_DIR (0x100 << 2) // Text align: codepage display direction
  53. /* Text alignment in vertical */
  54. #define CS_FONT_V_TOP (0x100 << 3) // Text align: top in vertical
  55. #define CS_FONT_V_CENTER (0x1000 << 0) // Text align: center in vertical
  56. #define CS_FONT_V_BOTTOM (0x1000 << 1) // Text align: bottom in vertical
  57. /* Text style */
  58. #define CS_FONT_MARQUEE (0x1000 << 2) // Text style: marquee
  59. #define CS_DYN_STRING_NATIVE (0x1000 << 3)
  60. #define CS_DYN_STRING_EPG (0x10000 << 0)
  61. #define CS_DYN_STRING_UTF8 (0x10000 << 1)
  62. #define CS_DYN_STRING_UTF16_LE (0x10000 << 2)
  63. #define CS_DYN_STRING_UTF16_BE (0x10000 << 3)
  64. #define CS_DYN_STRING_UNICODE (CS_DYN_STRING_UTF8|CS_DYN_STRING_UTF16_LE|CS_DYN_STRING_UTF16_BE)
  65. #define CS_MARQUEE_STYLE_BITS (0xF0000000)
  66. #define CS_TEXT_STYLE_BOLD (0x100000)
  67. #define CS_TEXT_STYLE_ITALIC (0x100000 << 1)
  68. #define CS_AA_GROUP_IDX_MASK (0x0F000000) // Indicate the group index of AA.
  69. #define CS_SHADOW (0x10000000 << 0)
  70. /* Widget styles - 16bits */
  71. /* CLASS_BACKGROUND */
  72. #define S_BG_COLOR (0x1)
  73. #define S_BG_PICTURE (0x1 << 1)
  74. #define S_BG_MIX (0x1 << 2)
  75. /* CLASS_ICON */
  76. #define S_ICON_H_LEFT (0x1)
  77. #define S_ICON_H_CENTER (0x1 << 1)
  78. #define S_ICON_H_RIGHT (0x1 << 2)
  79. #define S_ICON_V_TOP (0x1 << 3)
  80. #define S_ICON_V_CENTER (0x10)
  81. #define S_ICON_V_BOTTOM (0x10 << 1)
  82. #define S_ICON_ALL_ALIGN (0x3F) //(S_ICON_H_LEFT | S_ICON_H_CENTER | S_ICON_H_RIGHT | S_ICON_V_TOP | S_ICON_V_CENTER | S_ICON_V_BOTTOM)
  83. #define S_ICON_ROTATE_90 (0x10 << 2)
  84. #define S_ICON_ROTATE_180 (0x10 << 3)
  85. #define S_ICON_ROTATE_270 (0x100)
  86. #define S_ICON_ROTATE_ALL (0x1C0) // (S_ICON_ROTATE_90 | S_ICON_ROTATE_180 | S_ICON_ROTATE_270)
  87. #define S_ICON_MULTI_LINE_MODE (0x1000)
  88. /* CLASS_TEXT */
  89. #define S_TXT_MULTI (0x1)
  90. #define S_TXT_EBK (0x1 << 1)
  91. #define S_TXT_EPG_DAILY (0X1 << 2)
  92. #define S_TXT_END_NO_POINT (0x10)
  93. #define S_TXT_END_3_POINT (0x20)
  94. #define S_TXT_END_NOT_ENOUGH (0x30)
  95. #define S_TXT_END_MASK (0x00000030)
  96. /* CLASS_ANIMATION */
  97. #define S_ANIM_SWITCH (0X1)
  98. #define S_ANIM_STRETCH (0X1 << 1)
  99. #define S_ANIM_BLEND (0X1 << 2)
  100. #define S_ANIM_REPEAT (0X1 << 3)
  101. #define S_ANIM_SWITCH_PIC (0X1 << 4)
  102. /* CLASS_BORDER */
  103. /* CLASS_BUTTON/ CLASS_BUTTON_GROUP*/
  104. #define S_BTN_TEXT (0x1)
  105. #define S_BTN_ICON (0x1 << 1)
  106. #define S_BTN_MIX (0x1 << 2)
  107. #define S_BTNG_ROLLBACK (0x1 << 3)
  108. #define S_BTNG_ONEBYONE (0x10)
  109. #define S_BTNG_ACTIVE_MODE (0x10 << 1)
  110. #define S_BTNG_PAGE_MODE (0x10 << 2)
  111. /* Text style of each state of CLASS_BUTTON_GROUP */
  112. #define S_BTNG_NORMAL_BOLD (0x100)
  113. #define S_BTNG_NORMAL_ITALIC (0x100 << 1)
  114. #define S_BTNG_FOCUS_BOLD (0x100 << 2)
  115. #define S_BTNG_FOCUS_ITALIC (0x100 << 3)
  116. #define S_BTNG_CLICK_BOLD (0x1000)
  117. #define S_BTNG_CLICK_ITALIC (0x1000 << 1)
  118. #define S_BTNG_DISABLE_BOLD (0x1000 << 2)
  119. #define S_BTNG_DISABLE_ITALIC (0x1000 << 3)
  120. /* CLASS_LISTVIEW */
  121. #define S_LIST_ROLLBACK (0x1)
  122. #define S_LIST_ONEBYONE (0x1 << 1)
  123. #define S_LIST_ACTIVE_MODE (0x1 << 2)
  124. #define S_LIST_PAGE_MODE (0x1 << 3)
  125. /* Text style of each state of CLASS_LISTVIEW */
  126. #define S_LIST_NORMAL_BOLD (0x10)
  127. #define S_LIST_NORMAL_ITALIC (0x10 << 1)
  128. #define S_LIST_FOCUS_BOLD (0x10 << 2)
  129. #define S_LIST_FOCUS_ITALIC (0x10 << 3)
  130. #define S_LIST_CLICK_BOLD (0x100)
  131. #define S_LIST_CLICK_ITALIC (0x100 << 1)
  132. #define S_LIST_DISABLE_BOLD (0x100 << 2)
  133. #define S_LIST_DISABLE_ITALIC (0x100 << 3)
  134. /* CLASS_COMBO */
  135. #define S_COMBO_NUMBER (0x1) /* Item numbers */
  136. #define S_COMBO_STRING_ID (0x1 << 1) /* Static assigned strings */
  137. #define S_COMBO_TEXT (0x1 << 2) /* Dynamic assigned strings */
  138. #define S_COMBO_SCROLL_LOCK (0x1 << 3)
  139. #define S_COMBO_ROLLBACK (0x10)
  140. /* CLASS_PROGRESS */
  141. #define S_PROG_BASIC (0x1)
  142. #define S_PROG_PICTURE (0x1 << 1)
  143. #define S_PROG_FILL_BLOCKS (0x1 << 2)
  144. #define S_PROG_FILL_CONTINOUS (0x1 << 3)
  145. #define S_PROG_ROLLBACK (0x10)
  146. #define S_PROG_DISPLAY_NULL (0x10 << 1)
  147. #define S_PROG_DISPLAY_VALUE (0x10 << 2)
  148. #define S_PROG_DISPLAY_PERCENT (0x10 << 3)
  149. /* CLASS_SCROLL */
  150. #define S_SCROLL_BASIC (0x1)
  151. #define S_SCROLL_PICTURE (0x1 << 1)
  152. #define S_SCROLL_SLIDER (0x1 << 2)
  153. /* CLASS_EDIT */
  154. #define S_EDIT_HIDE_DIGITS (0x1)
  155. #define S_EDIT_UNDER_LINE (0x1 << 1)
  156. #define S_EDIT_DISP_MODE (0x1 << 2)
  157. #define S_EDIT_CURSOR_TWINKLE (0x1 << 3)
  158. #define CS_SHOW_STR_BORDER (0x1 << 0)
  159. #define CS_SHOW_ITEM_BORDER (0x1 << 1)
  160. /* Popup style */
  161. typedef enum {
  162. NO_CAPTURE,
  163. CAPTURE = WIN_ACTIVE
  164. }pop_up_state_t;
  165. /** Return values of GEL APIs. */
  166. typedef enum {
  167. /** Invalid parameter type in GEL_Get/SetParam(). */
  168. GUI_PARAMTYPE = -7,
  169. /** Invalid pixel format. */
  170. GUI_FORMAT = -6,
  171. /** Error related to initialization. */
  172. GUI_INIT = -5,
  173. /** Unexpective NULL pointer. */
  174. GUI_NULL = -4,
  175. /** Invalid input argument. */
  176. GUI_INVARG = -3,
  177. /** Error occurs at memory allocation. */
  178. GUI_MEMALLOC = -2,
  179. /** Error occurs. */
  180. GUI_FAILURE = -1,
  181. /** No error occurs. */
  182. GUI_SUCCESS = 0,
  183. /** Invalid input area or coordinates. */
  184. GUI_AREA,
  185. /** Enabled region is overlap with others. */
  186. GUI_REGION_OVERLAP,
  187. /**
  188. * Special used for CLASS_BUTTON_GROUP, CLASS_LISTVIEW and CLASS_COMBO to
  189. * indicate the selected index is disabled.
  190. */
  191. GUI_ITEMDISABLE
  192. } GUIResult_e;
  193. /** Class type enumeration. */
  194. typedef enum {
  195. CLASS_WINDOW = 0, /**< Menu */
  196. CLASS_POPUP, /**< Popup menu */
  197. CLASS_BACKGROUND, /**< Background */
  198. CLASS_ICON, /**< Icon */
  199. CLASS_TEXT, /**< Text box */
  200. CLASS_ANIMATION, /**< Animation */
  201. CLASS_BORDER, /**< Border */
  202. CLASS_BUTTON, /**< Button */
  203. CLASS_BUTTON_GROUP, /**< Button group */
  204. CLASS_LISTVIEW, /**< Listview */
  205. CLASS_PROGRESS, /**< Progress bar*/
  206. CLASS_SCROLL, /**< Scroll bar*/
  207. CLASS_COMBO, /**< Combo box */
  208. CLASS_EDIT /**< Edit box */
  209. } ClassType_e;
  210. /** Five states of GUI control. */
  211. typedef enum {
  212. NORMAL_STATE = STATE_NORMAL, /**< */
  213. FOCUS_STATE = STATE_FOCUSED, /**< */
  214. DISABLED_STATE = STATE_DISABLED, /**< */
  215. CLICK_STATE = STATE_CLICKED, /**< */
  216. INVISIBLE_STATE = STATE_INVISIBLE /**< */
  217. } State_e;
  218. /** Horizontal and vertical alignment. */
  219. typedef enum {
  220. /* Basic alignemnt, do not use them */
  221. _V_TOP = 10,
  222. _V_CENTER = 20,
  223. _V_BOTTOM = 30,
  224. _H_LEFT = 1,
  225. _H_CENTER = 2,
  226. _H_RIGHT = 3,
  227. /************************************/
  228. TOP_LEFT = _V_TOP + _H_LEFT, /**< Vertical TOP and horizontal LEFT */
  229. TOP_CENTER = _V_TOP + _H_CENTER, /**< Vertical TOP and horizontal CENTER */
  230. TOP_RIGHT = _V_TOP + _H_RIGHT, /**< Vertical TOP and horizontal RIGHT */
  231. MID_LEFT = _V_CENTER + _H_LEFT, /**< Vertical MIDDLE and horizontal LEFT */
  232. MID_CENTER = _V_CENTER + _H_CENTER, /**< Vertical MIDDLE and horizontal CENTER */
  233. MID_RIGHT = _V_CENTER + _H_RIGHT, /**< Vertical MIDDLE and horizontal RIGHT */
  234. BOTTOM_LEFT = _V_BOTTOM + _H_LEFT, /**< Vertical BOTTOM and horizontal LEFT */
  235. BOTTOM_CENTER = _V_BOTTOM + _H_CENTER, /**< Vertical BOTTOM and horizontal CENTER */
  236. BOTTOM_RIGHT = _V_BOTTOM + _H_RIGHT /**< Vertical BOTTOM and horizontal RIGHT */
  237. } Alignment_e;
  238. /**
  239. * Window Messages used by GEL_SendMsg().<br>
  240. * <b>Note:</b> The third parameter of GEL_SendMsg() is only applicable for WM_KEYDOWN.
  241. * Please fill 0 otherwise.
  242. */
  243. typedef enum _window_message {
  244. /* Do nothing. */
  245. WM_NULL = 0,
  246. /*
  247. * Attention: Following 3 window messages are not applicable for AP to use!!
  248. */
  249. WM_CREATE,
  250. WM_DESTROY,
  251. WM_RESTORE_BG,
  252. /** Paint a widget according to the current attributes setting. */
  253. WM_PAINT,
  254. WM_SETNORMAL, /**< Change state to NORMAL and repaint control. */
  255. WM_SETFOCUS, /**< Change state to FOCUSED and repaint control. */
  256. WM_SETCLICK, /**< Change state to CLICKED and repaint control. */
  257. WM_SETDISABLE, /**< Change state to DISABLED and repaint control. */
  258. WM_SETINVISIBLE,/**< Change state to INVISIBLE and repaint control. */
  259. /**
  260. * Change the selected item to the previous one. If roll back style is enabled, it
  261. * would roll back to the last item if it is currently focused at first one.<br>
  262. * Support control types:<br>
  263. * <i>CLASS_BUTTON_GROUP, CLASS_COMBO, CLASS_LISTVIEW, CLASS_PROGRESS,
  264. * CLASS_SCROLL, CLASS_TEXT with S_TXT_MULTI style.</i>
  265. */
  266. WM_SELECT_PREV,
  267. /**
  268. * Change the selected item to the next one. If roll back style is enabled, it
  269. * would roll back to the first item if it is currently focused at last one.<br>
  270. * Support control types:<br>
  271. * <i>CLASS_BUTTON_GROUP, CLASS_COMBO, CLASS_LISTVIEW, CLASS_PROGRESS,
  272. * CLASS_SCROLL, CLASS_TEXT with S_TXT_MULTI style.</i>
  273. */
  274. WM_SELECT_NEXT,
  275. /**
  276. * Switch to the previous page. If ROLLBACK style is enabled, it would
  277. * roll back to the last page if it is currently focused at first page.<br>
  278. * Support control types:<br>
  279. * <i>CLASS_BUTTON_GROUP, CLASS_LISTVIEW.</i>
  280. */
  281. WM_PAGE_UP,
  282. /**
  283. * Switch to the next page. If ROLLBACK style is enabled, it would
  284. * roll back to the first page if it is currently focused at last page.<br>
  285. * Support control types:<br>
  286. * <i>CLASS_BUTTON_GROUP, CLASS_LISTVIEW.</i>
  287. */
  288. WM_PAGE_DOWN,
  289. /**
  290. * Performs the key down effect on <i>CLASS_EDIT</i>. It must catches a key value
  291. * at the third parameter in the GEL_SendMsg().<br>
  292. * Support key values: Please refer to #input_key_t.
  293. */
  294. WM_KEYDOWN,
  295. /*
  296. * Performs Editbox cursor twinkling
  297. */
  298. WM_TWINKLE,
  299. /* For update the block id */
  300. WM_UPDATE,
  301. WM_ROLL_PREV,
  302. WM_ROLL_NEXT,
  303. WM_MARQUEE,
  304. /* Countinue change A vaule of widget color space to make the shadow effect*/
  305. WM_SHADOW,
  306. /* Preserved message. */
  307. WM_RESERVE,
  308. /* Indicate the count of all the window messages. */
  309. WM_MSG_MAX
  310. } window_message_t;
  311. /** Enumeration of parameter types used for GEL_SetParam() or GEL_GetParam(). */
  312. typedef enum _param_type {
  313. PARAM_SETNORMAL = 0, /**< <b>Description:</b> Modify the current state of a control to be NORMAL. */
  314. PARAM_SETFOCUSED, /**< <b>Description:</b> Modify the current state of a control to be FOCUSED. */
  315. PARAM_SETDISABLED, /**< <b>Description:</b> Modify the current state of a control to be DISABLED. */
  316. PARAM_SETCLICKED, /**< <b>Description:</b> Modify the current state of a control to be CLICKED. */
  317. PARAM_SETINVISIBLE, /**< <b>Description:</b> Modify the current state of a control to be INVISIBLE. */
  318. /**
  319. * <b>Description:</b> Get the current state of target control.<br>
  320. * <b>Type:</b> #State_e*
  321. */
  322. PARAM_STATE,
  323. /**
  324. * <b>Description:</b> Get the absolute area of target widget. That is, x and y coordinate, width and height.<br>
  325. * <b>Type:</b> RECT*
  326. */
  327. PARAM_AREA,
  328. /**
  329. * <b>Description:</b> Get the relative area of target widget to the menu it belongs to. That is, x and y coordinate, width and height.<br>
  330. * <b>Type:</b> RECT*
  331. */
  332. PARAM_REL_AREA,
  333. /**
  334. * <b>Description:</b> Get the text area of target widget.<br>
  335. * <b>Type:</b> RECT*
  336. */
  337. PARAM_TEXT_AREA,
  338. /**
  339. * <b>Description:</b> Get the area of current focused item.<br>
  340. * <b>Support:</b> CLASS_LISTVIEW, CLASS_BUTTON_GROUP<br>
  341. * <b>Type:</b> RECT*
  342. */
  343. PARAM_ITEM_AREA,
  344. /**
  345. * <b>Description:</b> Access the FPS of desired animation control.<br>
  346. * <b>Support:</b> CLASS_ANIMATION<br>
  347. * <b>Type:</b> INT32*
  348. */
  349. PARAM_ANIM_FPS,
  350. /**
  351. * <b>Description:</b> Access first index attribute. Nagative value is legal, but it must be larger than -(page_count - 1).
  352. * That is, the legal range of first index is [-(page_count-1),total_count-1].<br>
  353. * <b>Support:</b> CLASS_LISTVIEW, CLASS_BUTTON_GROUP<br>
  354. * <b>Type:</b> INT32*
  355. */
  356. PARAM_FIRST_INDEX,
  357. /**
  358. * <b>Description:</b> Access current index attribute. The legal range of current index is [0,total_count].<br>
  359. * <b>Support:</b> CLASS_LISTVIEW, CLASS_BUTTON_GROUP, CLASS_COMBO, CLASS_EDIT<br>
  360. * <b>Type:</b> INT32*
  361. */
  362. PARAM_CURRENT_INDEX,
  363. /**
  364. * <b>Description:</b> Access clicked index of buttongroup or listview. The legal range of current index is [0,total_count].<br>
  365. * <b>Support:</b> CLASS_LISTVIEW, CLASS_BUTTON_GROUP<br>
  366. * <b>Type:</b> INT32*
  367. */
  368. PARAM_CLICK_INDEX,
  369. /**
  370. * <b>Description:</b> Access first can be focused index of listview. The legal range of current index is [0,total_count].<br>
  371. * <b>Support:</b> CLASS_LISTVIEW<br>
  372. * <b>Type:</b> INT32*
  373. */
  374. PARAM_FIRST_CAN_BE_FOCUS_INDEX,
  375. /**
  376. * <b>Description:</b> Access last can be focused index of listview. The legal range of current index is [0,total_count].<br>
  377. * <b>Support:</b> CLASS_LISTVIEW<br>
  378. * <b>Type:</b> INT32*
  379. */
  380. PARAM_LAST_CAN_BE_FOCUS_INDEX,
  381. /**
  382. * <b>Description:</b> Access page count attribute.<br>
  383. * <b>Support:</b> CLASS_SCROLL, CLASS_LISTVIEW, CLASS_BUTTON_GROUP, CLASS_COMBO<br>
  384. * <b>Type:</b> INT32*
  385. */
  386. PARAM_PAGE_COUNT,
  387. /**
  388. * <b>Description:</b> Access total count attribute.<br>
  389. * <b>Support:</b> CLASS_SCROLL, CLASS_LISTVIEW, CLASS_BUTTON_GROUP, CLASS_COMBO<br>
  390. * <b>Type:</b> INT32*
  391. */
  392. PARAM_TOTAL_COUNT,
  393. /*************************************************/
  394. /**
  395. * <b>Description:</b> Access minimum value.<br>
  396. * <b>Support:</b> CLASS_PROGRESS<br>
  397. * <b>Type:</b> INT32*
  398. */
  399. PARAM_MIN_VALUE,
  400. /**
  401. * <b>Description:</b> Access maximum value attribute.<br>
  402. * <b>Support:</b> CLASS_PROGRESS<br>
  403. * <b>Type:</b> INT32*
  404. */
  405. PARAM_MAX_VALUE,
  406. /**
  407. * <b>Description:</b> Access current value attribute of progress bar or scroll bar.
  408. * Negative value is illegal in CLASS_SCROLL.<br>
  409. * <b>Support:</b> CLASS_PROGRESS, CLASS_SCROLL<br>
  410. * <b>Type:</b> INT32*
  411. */
  412. PARAM_CURRENT_VALUE,
  413. /**
  414. * <b>Description:</b> Access step value attribute of progress bar.<br>
  415. * <b>Support:</b> CLASS_PROGRESS<br>
  416. * <b>Type:</b> INT32*
  417. */
  418. PARAM_STEP_VALUE,
  419. /*************************************************/
  420. /**
  421. * <b>Description:</b> Access dynamic string (list).
  422. * - Add STRING_LAST at the end of the dynamic string list. Here is an example
  423. * of setting STRING_LAST:<br>
  424. * memcpy(dynStr[last], &string_last, sizeof(STRING_LAST));
  425. * - AP must keeps dynamic string list, please make sure that the list
  426. * should not be released or falsified unexpectedly.
  427. *
  428. * <b>Support:</b> CLASS_TEXT, CLASS_LISTVIEW, CLASS_COMBO<br>
  429. * <b>Type:</b> UINT8* for CLASS_TEXT. UINT8** for CLASS_LISTVIEW and CLASS_COMBO.
  430. */
  431. PARAM_DYNAMIC_STRING,
  432. /**
  433. * <b>Description:</b> Access static string ID.
  434. * - Add STRING_LAST at the end of the string ID list.
  435. * - Please make sure that each string ID must not be larger than maximum
  436. * language count of your UI project.
  437. * - AP must keeps static string ID list, please make sure that the list
  438. * should not be released or falsified unexpectedly.
  439. *
  440. * <b>Support:</b> CLASS_BUTTON, CLASS_BUTTON_GROUP, CLASS_LISTVIEW, CLASS_TEXT, CLASS_COMBO<br>
  441. * <b>Type:</b> String_id_t** for CLASS_COMBO and CLASS_LISTVIEW (reference to a list of String_id_t*)
  442. * String_id_t* otherwise. (reference to a String_id_t)
  443. */
  444. PARAM_STATIC_STRING,
  445. /**
  446. * <b>Description:</b> Fix width of each character displayed on OSD. It would not be applied if
  447. * such value is 0. The range is expected to be [0,255]<br>
  448. * <b>Support:</b> CLASS_BUTTON, CLASS_BUTTON_GROUP, CLASS_COMBO, CLASS_EDIT,
  449. * CLASS_LISTVIEW, CLASS_PROG, CLASS_TEXT<br>
  450. * <b>Type:</b> INT32*
  451. */
  452. PARAM_FIX_CHAR_WIDTH,
  453. /**
  454. * <b>Description:</b> Access foreground icon ID.<br>
  455. * <b>Support:</b> CLASS_BUTTON, CLASS_BUTTON_GROUP, CLASS_ANIMATION<br>
  456. * <b>Type:</b> INT16*
  457. * Note: CLASS_BUTTON would regart input parameter as a pointer to an icon id,
  458. * but CLASS_BUTTON_GROUP/CLASS_ANIMATION would regart it as a dynamic array of icon ids.
  459. */
  460. PARAM_ICON_ID,
  461. PARAM_FOCUSED_ICON_ID,
  462. PARAM_FOCUSED_ICON,
  463. /**
  464. * <b>Description:</b> Access foreground icon ID of each state.<br>
  465. * Support: CLASS_ICON <br>
  466. * <b>type:</b> icon_info_t*
  467. */
  468. PARAM_ICON_INFO,
  469. /**
  470. * <b>Description:</b> Access both vertical and horizontal alignment of an icon widget.<br>
  471. * <b>Support:</b> CLASS_ICON<br>
  472. * <b>Type:</b> Alignment_e*
  473. */
  474. PARAM_ICON_ALIGNMENT,
  475. /**
  476. * <b>Description:</b> Access both vertical and horizontal alignment of text widget.<br>
  477. * <b>Support:</b> Which has text alignment(only for setting)<br>
  478. * <b>Type:</b> Alignment_e*
  479. */
  480. PARAM_TEXT_ALIGNMENT,
  481. /**
  482. * <b>Description:</b> Get the current text of EditBox.<br>
  483. * <b>Support:</b> CLASS_EDIT<br>
  484. * <b>Type:</b> UINT8*
  485. */
  486. PARAM_CURRENT_TEXT,
  487. /**
  488. * <b>Description:</b> Access the pattern text of EditBox. The length of pattern should NOT be changed.<br>
  489. * <b>Support:</b> CLASS_EDIT <br>
  490. * <b>Type:</b> UINT8*
  491. */
  492. PARAM_PATTERN_TEXT,
  493. /**
  494. * <b>Description:</b> Get the max number of digit of a EditBox.<br>
  495. * <b>Support:</b> CLASS_EDIT <br>
  496. * <b>Type:</b> INT32*
  497. */
  498. PARAM_MAX_DIGIT,
  499. /**
  500. * <b>Description:</b> Enable/disable display mode of EditBox.<br>
  501. * <b>Support:</b> CLASS_EDIT <br>
  502. * <b>Type:</b> BOOLEAN*, set TRUE to enable the display mode, FALSE otherwise.
  503. */
  504. PARAM_DISPLAY_MODE,
  505. /**
  506. * <b>Description:</b> Set specific item to be enable.
  507. * Input paramter is the index of target item.
  508. * The legal range of input index is [0,total_count]<br>
  509. * <b>Support:</b> CLASS_BUTTON_GROUP, CLASS_LISTVIEW <br>
  510. * <b>Type:</b> INT32* , the index of target item.
  511. */
  512. PARAM_ITEM_ENABLE,
  513. /**
  514. * <b>Description:</b> Set specific item to be disable.
  515. * Input paramter is the index of target item.
  516. * The legal range of input index is [0,total_count]<br>
  517. * <b>Support:</b> CLASS_BUTTON_GROUP, CLASS_LISTVIEW<br>
  518. * <b>Type:</b> INT32* , the index of target item.
  519. */
  520. PARAM_ITEM_DISABLE,
  521. /**
  522. * <b>Description:</b> Enable active mode or not.<br>
  523. * <b>Support:</b> CLASS_BUTTON_GROUP, CLASS_LISTVIEW <br>
  524. * <b>Type:</b> BOOLEAN*
  525. */
  526. PARAM_ACTIVE_MODE,
  527. /**
  528. * <b>Description:</b> Enable active mode or not.<br>
  529. * <b>Support:</b> CLASS_BUTTON_GROUP, CLASS_LISTVIEW <br>
  530. * <b>Type:</b> BOOLEAN*
  531. */
  532. PARAM_PAGE_MODE,
  533. /**
  534. * <b>Description:</b> Set current line of a multiline-style text box.<br>
  535. * <b>Support:</b> CLASS_TEXT <br>
  536. * <b>Type:</b> INT32*
  537. */
  538. PARAM_CURRENT_LINE,
  539. /**
  540. * <b>Description:</b> Set step lines of a multiline-style text box.<br>
  541. * <b>Support:</b> CLASS_TEXT <br>
  542. * <b>Type:</b> INT32*
  543. */
  544. PARAM_STEP_LINES,
  545. /**
  546. * <b>Description:</b> Get total lines of a multiline-style text box.<br>
  547. * <b>Support:</b> CLASS_TEXT<br>
  548. * <b>Type:</b> INT32*
  549. */
  550. PARAM_TOTAL_LINES,
  551. /**
  552. * <b>Description:</b> Get page lines of a multiline-style text box.<br>
  553. * <b>Support:</b> CLASS_TEXT <br>
  554. * <b>Type:</b> INT32*
  555. */
  556. PARAM_PAGE_LINES,
  557. /**
  558. * <b>Description:</b> Get lines positions of a multiline-style text box.<br>
  559. * <b>Support:</b> CLASS_TEXT <br>
  560. * <b>Type:</b> UINT8***
  561. */
  562. PARAM_LINES_POSITION,
  563. /**
  564. * <b>Description:</b> Access the fixed line height of a multiline-style text box.
  565. * It would not be applied if such value is set to be 0.
  566. * The range of input value is expected to be [0,255].<br>
  567. * <b>Support:</b> CLASS_TEXT <br>
  568. * <b>Type:</b> INT32*
  569. */
  570. PARAM_FIX_LINE_HEIGHT,
  571. /**
  572. * <b>Description:</b> Get the string width according to current state of widget.<br>
  573. * <b>Support:</b> CLASS_TEXT<br>
  574. * <b>Type:</b> INT32*
  575. */
  576. PARAM_STRING_WIDTH,
  577. /**
  578. * <b>Description:</b> Get the string height according to current state of widget.<br>
  579. * <b>Support:</b> CLASS_TEXT<br>
  580. * <b>Type:</b> INT32*
  581. */
  582. PARAM_STRING_HEIGHT,
  583. /**
  584. * <b>Description:</b> Get the string height according to current state of widget.<br>
  585. * <b>Support:</b> CLASS_TEXT<br>
  586. * <b>Type:</b> GEL_TextEndStyle_e*
  587. */
  588. PARAM_END_STYLE,
  589. /**
  590. * <b>Description:</b> Access foreground text color of related widgets.<br>
  591. * <b>Support:</b> CLASS_BUTTON, CLASS_BUTTON_GROUP, CLASS_COMBO, CLASS_EDIT, CLASS_LISTVIEW, CLASS_PROGRESS, CLASS_TEXT<br>
  592. * <b>Type:</b> text_color_info_t* for SET, #text_color_info_t** for GET
  593. */
  594. PARAM_FGTEXT_COLOR,
  595. /**
  596. * <b>Description:</b> Access background color of all kinds of widget except CLASS_ANIMATION, CLASS_BORDER and CLASS_ICON.<br>
  597. * <b>Type:</b> color_info_t* for SET, #color_info_t** for GET
  598. */
  599. PARAM_BGCOLOR,
  600. /*************************************************/
  601. /* Ebook Related Parameter Types */
  602. /*************************************************/
  603. /**
  604. * <b>Description:</b> Access the single string buffer size. This value is assigned by user. Default is 0.<br>
  605. * <b>Support:</b> CLASS_TEXT with S_TXT_EBK.<br>
  606. * <b>Type:</b> INT32* (in byte)
  607. */
  608. PARAM_EBK_BUF_SIZE,
  609. /**
  610. * <b>Description:</b> Get the current page displayed at this textbox.<br>
  611. * <b>Support:</b> CLASS_TEXT with S_TXT_EBK.<br>
  612. * <b>Type:</b> INT32*
  613. */
  614. PARAM_EBK_CURRENT_PAGE,
  615. /**
  616. * <b>Description:</b> Get the total page of this textbox.<br>
  617. * <b>Support:</b> CLASS_TEXT with S_TXT_EBK.<br>
  618. * <b>Type:</b> INT32*
  619. */
  620. PARAM_EBK_TOTAL_PAGES,
  621. /**
  622. * <b>Description:</b> Set/Get the index of AA group.<br>
  623. * <b>Support:</b> All kinds of control except CLASS_WINDOW and CLASS_POPUP.
  624. * <b>Type:</b> INT32*, but the valid range of input is [0,14].
  625. */
  626. PARAM_AA_GROUP_IDX,
  627. /**
  628. * <b>Description:</b> Set/Get the number of level of gray scale colors for AA.<br>
  629. * <b>Support:</b> CLASS_WINDOW or CLASS_POPUP
  630. * <b>Type:</b> FONT_AA_Level_e*
  631. */
  632. PARAM_WIN_AA_LEVEL,
  633. #if 0
  634. /**
  635. * <b>Description:</b> Set/Get the number of groups of gray level colors for AA.<br>
  636. * <b>Support:</b> CLASS_WINDOW or CLASS_POPUP
  637. * <b>Type:</b> INT32*, but the legal range is [0,15].
  638. */
  639. PARAM_WIN_AA_GROUP_NUM,
  640. #else
  641. /**
  642. * <b>Description:</b> Set the start indices of each AA group, put GEL_AA_ANCHOR_LAST at the end
  643. * so that engine can.<br>
  644. * <b>Support:</b> CLASS_WINDOW or CLASS_POPUP
  645. * <b>Type:</b> INT32*, list of start indices.
  646. */
  647. PARAM_WIN_AA_ANCHORS,
  648. #endif
  649. /**
  650. * <b>Description:</b> Enable/Disable AA on target menu.<br>
  651. * <b>Support:</b> CLASS_WINDOW or CLASS_POPUP
  652. * <b>Type:</b> BOOLEAN*
  653. */
  654. PARAM_WIN_AA_ENABLE,
  655. /*
  656. * <b>Description:</b> Set particular Style of the widget.<br>
  657. */
  658. PARAM_PARTICULAR_SYSTLE,
  659. /*
  660. * <b>Description:</b> Set enter multi-line mode.<br>
  661. */
  662. PARAM_ENTER_MULTI_LINE,
  663. /*
  664. * <b>Description:</b> Set one line count of multi-line mode <br>
  665. */
  666. PARAM_LINE_BLOCK_NUM,
  667. /*
  668. * <b>Description:</b> Set current block index multi-line mode .<br>
  669. */
  670. PARAM_CURRENT_BLOCK_INDEX,
  671. /*
  672. * <b>Description:</b>Release the line blocks of multi-line mode.<br>
  673. */
  674. PARAM_FREE_LINE_BLOCK,
  675. /**
  676. * <b>Description:</b> Set textbox ebook unkown char.<br>
  677. * <b>Support:</b> CLASS_TEXT only ebook.<br>
  678. * <b>Type:</b> UINT16*
  679. */
  680. PARAM_UNKNOWN_CHAR,
  681. /**
  682. * <b>Description:</b> Set textbox ebook show ellipsis at last line
  683. if total line is big than page line.<br>
  684. * <b>Support:</b> CLASS_TEXT multi-line.<br>
  685. * <b>Type:</b> UINT8*
  686. */
  687. PARAM_SHOW_ELLIPSIS,
  688. /**
  689. * <b>Description:</b> Set string char space in the widget.<br>
  690. * <b>Support:</b> Current only support edit.<br>
  691. * <b>Type:</b> UINT16*
  692. */
  693. PARAM_CHAR_SPACE,
  694. /**
  695. * <b>Description:</b> Set the widget to make shadow effect.<br>
  696. * <b>Support:</b> Current only support board.<br>
  697. * <b>Type:</b> UINT8*
  698. */
  699. PARAM_SHADOW,
  700. /**
  701. * <b>Description:</b> Set the widget max alpha value for shadow effect.<br>
  702. * <b>Support:</b> Current only support board.<br>
  703. * <b>Type:</b> UINT8*
  704. */
  705. PARAM_MAX_ALPHA,
  706. /**
  707. * <b>Description:</b> Set the widget min alpha value.<br>
  708. * <b>Support:</b> Current only support board.<br>
  709. * <b>Type:</b> UINT8*
  710. */
  711. PARAM_MIN_ALPHA,
  712. /**
  713. * <b>Description:</b> Set the widget alpha change step for shadow effect.<br>
  714. * <b>Support:</b> Current only support board.<br>
  715. * <b>Type:</b> UINT8*
  716. */
  717. PARAM_ALPHA_STEP,
  718. /**
  719. * <b>Description:</b> Set button group item space in the widget.<br>
  720. * <b>Support:</b> Current only support button group.<br>
  721. * <b>Type:</b> UINT16*
  722. */
  723. PARAM_ITEM_SPACE,
  724. /**
  725. * <b>Description:</b> Set button group , listview, text, button , edit control
  726. * focused state string border .<br>
  727. * <b>Type:</b> UINT8*
  728. */
  729. PARAM_FOCUSED_STR_BORDER,
  730. /**
  731. * <b>Description:</b> Set button group , listview, text, button , edit control
  732. * focused state item border .<br>
  733. * <b>Type:</b> UINT8*
  734. */
  735. PARAM_FOCUSED_BORDER,
  736. PARAM_ROLL_STATE,
  737. /*
  738. * Preserved parameter type. It is not used.
  739. */
  740. PARAM_PRESERVE,
  741. /* Specify the last element of ParamType_e. Not a valid parameter type. */
  742. PARAM_MAX
  743. } ParamType_e;
  744. typedef enum
  745. {
  746. ROLL_NULL,
  747. ROLL_PREV,
  748. ROLL_NEXT,
  749. }RollType;
  750. /* Object types */
  751. typedef enum {
  752. OBJ_PEN = 0,
  753. OBJ_BRUSH,
  754. } obj_type_t;
  755. /* Brush Styles */
  756. typedef enum {
  757. BS_SOLID = 0,
  758. BS_NULL
  759. }brush_style_t;
  760. /* Pen Styles */
  761. typedef enum {
  762. PS_SOLID = 0,
  763. PS_NULL
  764. }pen_style_t;
  765. /* GDI object hdr */
  766. typedef struct {
  767. obj_type_t type; /* object type */
  768. BOOLEAN stockobj; /* TRUE if stock (unallocated) object */
  769. } GDIOBJHDR;
  770. typedef struct {
  771. GDIOBJHDR hdr;
  772. pen_style_t style; /* pen style*/
  773. Color_t color; /* pen color*/
  774. INT32 width;
  775. } PENOBJ;
  776. typedef struct {
  777. GDIOBJHDR hdr;
  778. brush_style_t style; /* brush style */
  779. Color_t color; /* brush color */
  780. } BRUSHOBJ;
  781. struct hgdiobj {
  782. GDIOBJHDR hdr; /* all gdi object start with this hdr*/
  783. };
  784. /* Different types of object types */
  785. typedef struct hgdiobj *obj_ptr;
  786. typedef struct hgdiobj *brush_ptr;
  787. typedef struct hgdiobj *pen_ptr;
  788. /* Handle to window */
  789. typedef struct hwnd *HWND;
  790. typedef struct hdc *HDC;
  791. typedef struct _win_control_struct_t_ WinControl_t;
  792. typedef struct _win_control_struct_ex_t_ WinControlEx_t;
  793. typedef INT32 (*WNDPROC)(HWND hwin, window_message_t mesg, UINT32 dWinFlags, UINT32 dKeyInput);
  794. typedef struct _shadow_param
  795. {
  796. UINT8 max_alpha;
  797. UINT8 min_alpha;
  798. UINT8 alpha_step;
  799. UINT16 timer_accumulator;
  800. }shadow_param;
  801. typedef struct _WNDCLASS {
  802. LIST link; /* microwin*/
  803. UINT32 style;
  804. WNDPROC wind_proc;
  805. ClassType_e type;
  806. } WNDCLASS, *PWNDCLASS;
  807. struct hwnd {
  808. WNDCLASS *class_ptr; /* window class*/
  809. HWND parent; /* parent object */
  810. HWND child; /* child object */
  811. HWND next; /* next obj in a control list */
  812. HWND prev; /* prev obj in a control list */
  813. HWND focus; /* focused obj in a control list */
  814. HWND focus_border; /* focused item border*/
  815. HDC owndc;
  816. UINT8 *tempAddr; /* The addr of the temp buffer */
  817. RECT tempSurfPos; /* The pos of tempSurf to be drawn on OSD. */
  818. UINT8 *marqTempBgAddr; /* To save marquee bg during rendering control on rgn buf. */
  819. INT16 ctrlOffsetX; /* Used for rendering control to a region buffer */
  820. INT16 ctrlOffsetY; /* Used for rendering control to a region buffer */
  821. INT16 scaledWidth; /* Desired width */
  822. INT16 scaledHeight; /* Desired height */
  823. WinControl_t *control;
  824. PALENTRY *pDynPal; /* Dynamic assigned palette to the handle */
  825. INT32 sdBlitId; /* blit id */
  826. UINT32 status; /* window had WM_PAINT PostMessage*/
  827. void *pDefaultWinCtl; /* Pointer to the default win control struct */
  828. INT32 *pBlockID; /* pointer to its block ids */
  829. UINT8 char_space; /* Color of select character */
  830. UINT32 showBorder; /* Show focused border */
  831. UINT32 uiBlockNum;
  832. LIST regionLink; /* linking all controls belong to one region */
  833. shadow_param shadow; /* shadow effect parameter */
  834. UINT8 isFlipHoriz;
  835. };
  836. /* Device Context */
  837. struct hdc {
  838. RegionHandle_t region_handle; /* region handle index*/
  839. HWND hwnd; /* associated window*/
  840. Color_t fgColor; /* foreground color */
  841. Color_t bgColor; /* text background color*/
  842. INT32 bgMode; /* background mode, not used now */
  843. BRUSHOBJ *brush; /* current brush*/
  844. PENOBJ *pen; /* current pen*/
  845. UiLANGName_t privateLang; /* language info */
  846. };
  847. /* Window and Controls common data structure */
  848. struct _win_control_struct_t_ {
  849. HWND handle; /* Dynamic generated handle */
  850. ClassType_e type; /* Type of the widget */
  851. UINT32 c_style; /* Common styles of the widget */
  852. UINT16 p_style; /* Particular styles of the widget */
  853. UINT16 state; /* States of the widget */
  854. struct
  855. {
  856. UINT8 normal_font_style;
  857. UINT8 focus_font_style;
  858. UINT8 click_font_style;
  859. UINT8 disable_font_style;
  860. } win_control_str_style_t;
  861. INT16 x; /* X coordinate of the widget */
  862. INT16 y; /* Y coordinate of the widget */
  863. UINT16 width; /* Width of a rectangular area to be drawn */
  864. UINT16 height; /* Height of a rectangular area to be drawn */
  865. UINT32 region; /* Region index */
  866. void *param; /* Pointer to its specific params */
  867. void *subparam; /* Pointer to its child control list */
  868. };
  869. /* Extented version of Window and Controls common data structure */
  870. struct _win_control_struct_ex_t_ {
  871. HWND handle; /* Dynamic generated handle */
  872. ClassType_e type; /* Type of the widget */
  873. UINT32 c_style; /* Common styles of the widget */
  874. UINT16 p_style; /* Particular styles of the widget */
  875. UINT16 state; /* States of the widget */
  876. struct
  877. {
  878. UINT8 normal_font_style;
  879. UINT8 focus_font_style;
  880. UINT8 click_font_style;
  881. UINT8 disable_font_style;
  882. } win_control_str_style_t;
  883. INT16 x; /* X coordinate of the widget */
  884. INT16 y; /* Y coordinate of the widget */
  885. UINT16 width; /* Width of a rectangular area to be drawn */
  886. UINT16 height; /* Height of a rectangular area to be drawn */
  887. UINT32 region; /* Region index */
  888. void *param; /* Pointer to its specific params */
  889. void *subparam; /* Pointer to its child control list */
  890. struct
  891. {
  892. FONTSize_t normal_font_size;
  893. FONTSize_t focus_font_size;
  894. FONTSize_t click_font_size;
  895. FONTSize_t disable_font_size;
  896. } win_control_font_size_t;
  897. };
  898. /* Applet */
  899. typedef struct _STRUCT_APPLET {
  900. UINT16 focused_item; /* The focused child widget */
  901. UINT16 no_of_controls; /* Number of the child widgets */
  902. WinControl_t *control_list; /* Point to a child control list */
  903. } STRUCT_APPLET;
  904. /* Common core structure */
  905. typedef struct _icon_info_t_ {
  906. INT16 normal_id; /* The icon for STATE_NORMAL */
  907. INT16 focused_id; /* The icon for STATE_FOCUSED */
  908. INT16 clicked_id; /* The icon for STATE_CLICKED */
  909. INT16 disabled_id; /* The icon for STATE_DISABLED */
  910. } icon_info_t;
  911. typedef struct _color_info_t_ {
  912. Color_t normal_color; /* The color for STATE_NORMAL */
  913. Color_t focused_color; /* The color for STATE_FOCUSED */
  914. Color_t clicked_color; /* The color for STATE_CLICKED */
  915. Color_t disabled_color; /* The color for STATE_DISABLED */
  916. } color_info_t;
  917. typedef struct _text_color_info_t_ {
  918. UINT8 normal_color; /* The index of the region palette for STATE_NORMAL */
  919. UINT8 focused_color; /* The index of the region palette for STATE_FOCUSED */
  920. UINT8 clicked_color; /* The index of the region palette for STATE_CLICKED */
  921. UINT8 disabled_color; /* The index of the region palette for STATE_DISABLED */
  922. } text_color_info_t;
  923. typedef struct _marquee_info_t_ {
  924. RECT string_area; /* Indicate current displayed area to the whole string buffer */
  925. RECT bg_area; /* Indicate the string displayed area to a hdc */
  926. RECT bgScale_area; /* */
  927. RECT circle_area; /* The second half src rect for GEL_MARQUEE_CIRCLE */
  928. UINT8 *fg_data; /* Pointer to capture whole foreground text */
  929. UINT8 *bg_data; /* Pointer to capture the background */
  930. UINT16 interval; /* Update interval to record how long to update once */
  931. UINT16 timer_accumulator; /* Accumulate timer update times for the animation control */
  932. const PALENTRY *pMarqPal; /* Palette for anti-aliased marquee on16/32 bit region. */
  933. BOOL isL2Rstr;
  934. #ifdef CONFIG_FONT_ENGINE_HARFBUZZ
  935. UINT8 bFgColor; /* The index value of text filling color. */
  936. UINT8 bBgColor; /* The index value of text bg color. */
  937. #endif
  938. } marquee_info_t;
  939. /* CLASS_BACKGROUND */
  940. typedef struct _background_t {
  941. color_info_t *color; /* background color */
  942. icon_info_t *icon; /* background bitmap id */
  943. } bg_t;
  944. /* CLASS_ICON */
  945. typedef struct _icon_t {
  946. icon_info_t *icon;
  947. IMAGEHDR image[STATE_MAX];
  948. UINT32 line_num;
  949. UINT32 block_index;
  950. } icon_t;
  951. #define PARTIALCODE_LENGH 2048
  952. /* CLASS_TEXT */
  953. typedef struct _text_box_single_line_t {
  954. INT32 lang_name; /* Language to be shown for the text box */
  955. color_info_t *bg_color; /* Background of the text box */
  956. text_color_info_t *text_color; /* Text color */
  957. RECT text_pos; /* Text position */
  958. String_id_t string_id; /* Static string */
  959. UINT8 *string; /* Dynamic assigned string*/
  960. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  961. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  962. UINT32 line_num;
  963. UINT32 block_index;
  964. } text_box_t;
  965. typedef struct _text_box_ebook_t {
  966. UINT16 *pFcpOffset; /* FCP table that stores byte offset of each FCP related to text file */
  967. UINT16 *pBufOffset;
  968. UINT32 dBufSize; /* String buffer size decided by AP */
  969. UINT32 dBufNum; /* Total buffer number of this ebook text file */
  970. UINT32 dCurrentPage; /* Current rendered page number */
  971. UINT32 dTotalLines; /* Accumulated total lines of string buffers sent by AP */
  972. UINT16 wReservWidth;
  973. UINT8 bSync;
  974. UINT16 unknownChar; /* text unknown char */
  975. BOOLEAN bReady; /* Indicate that WM_SELECT_NEXT/PREV had been done */
  976. struct {
  977. UINT8 pPartialCode[PARTIALCODE_LENGH]; /* The front part of an incomplete code. */
  978. UINT32 bCodeLength; /* The actual length of this incomplete code. */
  979. } stCodeFragment;
  980. } text_box_ebk_t;
  981. typedef struct
  982. {
  983. UINT16 usTotalLine;
  984. UINT16 usPageLine;
  985. UINT16 usCurrLine;
  986. UINT16 usDrwaLine;//witch line has draw.
  987. UINT32 usCurrCharOffset;
  988. UINT16 usReservWidth; /* input the reserved width of the first line, and output the width of last line */
  989. void* TxtInfo;
  990. } pgrhInfo_t, *PPgrhInfo_t;
  991. typedef struct _text_box_dyn_info_t {
  992. UINT16 wStepLines; /**< Step of line index while scrolling. */
  993. UINT8 bFixLineHeight; /**< Fix line height setting. */
  994. UINT8 bMaxLineHeight; /**< Max line height. */
  995. UINT8 bMaxBaseDist; /**< Max distance from top of a glyph to baseline. */
  996. UINT8 bShowEllipsis;
  997. pgrhInfo_t stPgrhInfo;
  998. } text_box_dyn_t;
  999. typedef struct _text_box_multi_line_t {
  1000. text_box_t *text_info; /* Text info */
  1001. text_box_ebk_t *ebk_info; /* Information about ebook */
  1002. text_box_dyn_t *dyn_info; /**< Dynamically created attributes. */
  1003. UINT8 line_spacing; /* Spacing between lines */
  1004. } text_box_multi_t;
  1005. /* CLASS_ANIMATION */
  1006. typedef struct _animation_into_t {
  1007. INT16 icon_id; /* The icon id */
  1008. UINT16 total_frame_count; /* Total frame count of the animation */
  1009. UINT16 fps; /* Frame per second of the animation (must be 1~30) */
  1010. UINT16 current_frame_count; /* Total frame count of the animation */
  1011. UINT16 interval; /* Update interval to record how long to update once */
  1012. UINT16 timer_accumulator; /* Accumulate timer update times for the animation control */
  1013. void *pBufSurf; /* Buffer that restore a frame while performing animation */
  1014. INT16 *icon_list; /* The switch icon list */
  1015. } anim_info_t;
  1016. typedef struct _animation_switch_t {
  1017. anim_info_t *anim_info; /* Pointer to a anim_info_t */
  1018. UINT16 frame_width; /* Width per frame */
  1019. UINT16 frame_height; /* Height per frame */
  1020. UINT16 frame_num; /* Number of frames in the icon to be switched */
  1021. UINT16 frame_index; /* 0 as default. Index of current focused frame in the icon */
  1022. } anim_switch_t;
  1023. typedef struct _animation_stretch_t {
  1024. anim_info_t *anim_info; /* Pointer to a anim_info_t */
  1025. RECT initial_size; /* Initial size of an icon animation */
  1026. RECT target_size; /* Target size of an icon animation */
  1027. } anim_stretch_t;
  1028. typedef struct _animation_blend_t {
  1029. anim_info_t *anim_info; /* Pointer to a anim_info_t */
  1030. UINT8 initial_alpha_value; /* Initial alpha value from 0 ~ 255 */
  1031. UINT8 target_alpha_value; /* Target alpha value from 0 ~ 255 */
  1032. } anim_blend_t;
  1033. /* CLASS_BORDER */
  1034. typedef struct _border_t {
  1035. color_info_t *color; /* Border color */
  1036. icon_info_t *icon; /* Icon for the angles */
  1037. UINT16 thickness; /* Border thickness */
  1038. } border_t;
  1039. /* CLASS_BUTTON */
  1040. typedef struct _button_text_t {
  1041. RECT btn_pos; /* Position of the button */
  1042. color_info_t *bg_color; /* Background color */
  1043. icon_info_t *bg_icon; /* Background icon */
  1044. UINT16 side_size; /* Size of a single side icon */
  1045. UINT8 bFixCharWidth;
  1046. text_color_info_t *text_color; /* Foreground text color */
  1047. RECT text_pos; /* Position of foreground text */
  1048. String_id_t string_id; /* Foreground text */
  1049. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1050. IMAGEHDR image[STATE_MAX];
  1051. } btn_text_t;
  1052. typedef struct _button_icon_t {
  1053. RECT btn_pos; /* Position of the button */
  1054. color_info_t *bg_color; /* Background color */
  1055. icon_info_t *bg_icon; /* Background icon */
  1056. UINT16 side_size; /* Size of a single side icon */
  1057. INT16 fg_icon_id; /* Foreground icon */
  1058. IMAGEHDR image[STATE_MAX];
  1059. } btn_icon_t;
  1060. typedef struct _button_mix_t {
  1061. RECT btn_pos; /* Position of the button */
  1062. color_info_t *bg_color; /* Background color */
  1063. icon_info_t *bg_icon; /* Background icon */
  1064. UINT16 side_size; /* Size of a single side icon */
  1065. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1066. text_color_info_t *text_color; /* Foreground text color */
  1067. String_id_t string_id; /* Foreground text */
  1068. INT16 fg_icon_id; /* Foreground icon */
  1069. RECT fg_text_pos; /* Position of the foreground text */
  1070. RECT fg_icon_pos; /* Position of the foreground icon */
  1071. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1072. IMAGEHDR image[STATE_MAX];
  1073. } btn_mix_t;
  1074. /* CLASS_BUTTON_GROUP */
  1075. typedef struct _button_group_text_t {
  1076. color_info_t *bg_color; /* Background color */
  1077. icon_info_t *bg_icon; /* Background icon for buttons */
  1078. UINT16 side_size; /* Size of a single side icon */
  1079. RECT first_item_pos; /* Position of the first item */
  1080. RECT text_pos; /* Position of the foreground of the first item of normal state. */
  1081. INT16 focus_text_offset; /* Offset related to text_pos for focused item */
  1082. text_color_info_t *text_color; /* Foreground string color */
  1083. String_id_t *string_id; /* Foreground string list for buttons */
  1084. UINT16 space; /* Space between buttons */
  1085. UINT16 page_count; /* Buttons count per page */
  1086. UINT16 total_count; /* Total buttons count */
  1087. INT16 first_index; /* First button index */
  1088. INT16 btn_index; /* Focused button index */
  1089. INT16 btn_clicked_index; /* Clicked button index */
  1090. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1091. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1092. UINT8 *disabled_list; /* List to indicate disabled items */
  1093. IMAGEHDR image[STATE_MAX];
  1094. } btng_text_t;
  1095. typedef struct _button_group_icon_t {
  1096. color_info_t *bg_color; /* Background color */
  1097. icon_info_t *bg_icon; /* Background icon for buttons */
  1098. UINT16 side_size; /* Size of a single side icon */
  1099. RECT first_item_pos; /* Position of the first item */
  1100. INT16 *fg_icon_id; /* Foreground icon list for buttons */
  1101. UINT16 space; /* Space between buttons */
  1102. UINT16 page_count; /* Buttons count per page */
  1103. UINT16 total_count; /* Total buttons count */
  1104. INT16 first_index; /* First button index */
  1105. INT16 btn_index; /* Focused button index */
  1106. INT16 btn_clicked_index; /* Clicked button index */
  1107. UINT8 *disabled_list; /* List to indicate disabled items */
  1108. INT8 roll_type; /* roll type */
  1109. INT16 offset; /* offset when do roll */
  1110. INT16 *focused_icon_id; /* Foreground Focused icon list for buttons */
  1111. UINT32 interval;
  1112. IMAGEHDR image[STATE_MAX];
  1113. } btng_icon_t;
  1114. typedef struct _button_group_mix_t {
  1115. color_info_t *bg_color; /* Background color */
  1116. icon_info_t *bg_icon; /* Background icon for buttons */
  1117. UINT16 side_size; /* Size of a single side icon */
  1118. RECT first_item_pos; /* Position of the first item */
  1119. text_color_info_t *text_color; /* Foreground string color */
  1120. String_id_t *string_id; /* Foreground string list for buttons */
  1121. INT16 *fg_icon_id; /* Foreground icon list for buttons */
  1122. RECT fg_text_pos; /* Position of the foreground text */
  1123. RECT fg_icon_pos; /* Position of the foreground icon */
  1124. UINT16 space; /* Space between buttons */
  1125. UINT16 page_count; /* Buttons count per page */
  1126. UINT16 total_count; /* Total buttons count */
  1127. INT16 first_index; /* First button index */
  1128. INT16 btn_index; /* Focused button index */
  1129. INT16 btn_clicked_index; /* Clicked button index */
  1130. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1131. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1132. UINT8 *disabled_list; /* List to indicate disabled items */
  1133. INT8 roll_type; /* roll type */
  1134. INT16 offset; /* offset when do roll */
  1135. INT16 *focused_icon_id; /* Foreground Focused icon list for buttons */
  1136. UINT32 interval;
  1137. IMAGEHDR image[STATE_MAX];
  1138. } btng_mix_t;
  1139. /* CLASS_LISTVIEW */
  1140. typedef struct _listview_color_t {
  1141. Color_t bg_color_odd; /* Background color for odd items */
  1142. Color_t bg_color_even; /* Background color for even items */
  1143. Color_t focus_color; /* Background color for the focused item */
  1144. Color_t click_color; /* Background color for the clicked item */
  1145. } list_color_t;
  1146. typedef struct _listview_t {
  1147. list_color_t *color; /* Color information */
  1148. INT16 focus_icon; /* An icon to show on the focused item */
  1149. INT16 click_icon; /* An icon to show on the clicked item */
  1150. UINT16 side_size; /* Size of a single side icon */
  1151. RECT first_item_pos; /* Position of the first item */
  1152. RECT focus_color_pos; /* Pos of the rect on the focused item */
  1153. RECT focus_icon_pos; /* Pos of the icon on the focused item */
  1154. RECT text_pos; /* Pos of the foreground text of unfocused items */
  1155. INT16 focus_text_offset; /* Offset related to text_pos for focused item */
  1156. text_color_info_t *text_color; /* Fg text color */
  1157. String_id_t *string_id; /* Static string list */
  1158. UINT8 **string; /* Dynamic string list */
  1159. UINT16 space; /* Space between lists */
  1160. UINT16 page_count; /* List count per page */
  1161. UINT16 total_count; /* Total list count */
  1162. INT16 first_index; /* First list index */
  1163. INT16 list_index; /* Focused list index */
  1164. INT16 list_clicked_index; /* Clicked button index */
  1165. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1166. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1167. UINT8* disabled_list; /* List to indicate disabled items */
  1168. IMAGEHDR image[STATE_MAX];
  1169. } listview_t;
  1170. /* CLASS_PROGRESS */
  1171. typedef struct _progress_bar_color_t {
  1172. Color_t focus_fill_color;
  1173. Color_t focus_clear_color;
  1174. Color_t disable_fill_color;
  1175. Color_t disable_clear_color;
  1176. Color_t normal_fill_color;
  1177. Color_t normal_clear_color;
  1178. Color_t click_fill_color;
  1179. Color_t click_clear_color;
  1180. } prog_color_t;
  1181. typedef struct _progress_bar_icon_t {
  1182. INT16 focus_fill_id;
  1183. INT16 focus_clear_id;
  1184. INT16 disable_fill_id;
  1185. INT16 disable_clear_id;
  1186. INT16 normal_fill_id;
  1187. INT16 normal_clear_id;
  1188. INT16 click_fill_id;
  1189. INT16 click_clear_id;
  1190. } prog_icon_t;
  1191. /* Structure progress bar */
  1192. typedef struct _progress_bar_basic_t {
  1193. RECT bar_pos; /* Position of the progress bar */
  1194. INT16 max_value; /* Maximum setting value */
  1195. INT16 min_value; /* Minimum setting value */
  1196. INT16 value; /* Current value */
  1197. INT16 step_value; /* Change value for a step */
  1198. prog_color_t *bar_color; /* Color of a progress bar */
  1199. UINT8 block_thickness; /* Block thickness if PROG_FILL_BLOCKS */
  1200. UINT8 block_gap; /* Block gap if PROG_FILL_BLOCKS */
  1201. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1202. text_color_info_t *text_color; /* Color of the displayed text */
  1203. RECT text_pos; /* Position of the displayed text */
  1204. } prog_basic_t;
  1205. typedef struct _progress_bar_picture_t {
  1206. RECT bar_pos; /* Position of the progress bar */
  1207. INT16 max_value; /* Maximum setting value */
  1208. INT16 min_value; /* Minimum setting value */
  1209. INT16 value; /* Current value */
  1210. INT16 step_value; /* Change value for a step */
  1211. prog_icon_t *bar_icon; /* Icon of a progress bar */
  1212. UINT16 side_size; /* Size of a single side icon */
  1213. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1214. text_color_info_t *text_color; /* Color of the displayed text */
  1215. RECT text_pos; /* Position of the display text */
  1216. } prog_pic_t;
  1217. /* CLASS_SCROLL */
  1218. typedef struct _scroll_bar_basic_t {
  1219. RECT bar_pos; /* Position of the scroll bar */
  1220. INT16 total_count; /* Total items */
  1221. INT16 page_count; /* Items count per page */
  1222. INT16 value; /* Current value */
  1223. INT16 slider_size; /* H: slider width, V: slider height */
  1224. prog_color_t *bar_color; /* Color of a scroll bar */
  1225. } scroll_basic_t;
  1226. typedef struct _scroll_bar_picture_t {
  1227. RECT bar_pos; /* Position of the scroll bar */
  1228. INT16 total_count; /* Total items */
  1229. INT16 page_count; /* Items count per page */
  1230. INT16 value; /* Current value */
  1231. INT16 slider_size; /* H: slider width, V: slider height */
  1232. prog_icon_t *bar_icon; /* Icon of a scroll bar */
  1233. UINT16 side_size; /* Size of a single side icon */
  1234. } scroll_pic_t;
  1235. /* CLASS_COMBO */
  1236. typedef struct _combo_box_t {
  1237. RECT combo_pos; /* Position of the combo box */
  1238. color_info_t *bg_color; /* Background color */
  1239. icon_info_t *bg_icon; /* Background icon */
  1240. UINT16 side_size; /* Size of a single side icon */
  1241. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1242. text_color_info_t *text_color; /* Foreground text color */
  1243. RECT text_pos; /* Position of foreground text */
  1244. INT16 total_count; /* Total item count */
  1245. INT16 combo_index; /* Focused item index */
  1246. marquee_info_t *marquee_info; /* If CS_FONT_MARQUEE is enabled, point to a marquee_info_t struct */
  1247. String_id_t *string_id; /* Static string id list */
  1248. UINT8 **string; /* Foreground string */
  1249. IMAGEHDR image[STATE_MAX];
  1250. } combo_t;
  1251. //<cursor_gunking>
  1252. typedef struct _twinkling_info_t_ {
  1253. RECT cursorSize; /* Size for EditBox cursor*/
  1254. UINT8 *twinkling_app_back; /* Pointer to capture region buffer background(appear) */
  1255. UINT8 *twinkling_dis_back; /* Pointer to capture region buffer background(disappear) */
  1256. INT16 timer_accumulator; /* accumulator for cursor twinkling*/
  1257. } twinkling_info_t;
  1258. //</cursor_gunking>
  1259. //<cursor_gunking>
  1260. #define OSD 0x0
  1261. #define RGN 0x1
  1262. //</cursor_gunking>
  1263. /* CLASS_EDIT */
  1264. typedef struct _edit_box_t {
  1265. RECT edit_pos; /* Position of the edit box */
  1266. color_info_t *bg_color; /* Background color */
  1267. icon_info_t *bg_icon; /* Background icon */
  1268. text_color_info_t *text_color; /* Text color */
  1269. RECT text_pos; /* Position of foreground text */
  1270. UINT16 side_size; /* Size of a single side icon */
  1271. UINT8 bFixCharWidth; /* Fix width of each character displayed on screen */
  1272. UINT8 *text; /* Current text */
  1273. UINT8 *pattern_text; /* Text of pattern */
  1274. INT16 seek_pointer; /* Current index that cursor points at */
  1275. UINT8 max_digit; /* Max number of digits */
  1276. UINT8 hide_character; /* Character to be drawn if style is S_EDIT_HIDE_DIGITS */
  1277. INT8 default_char; /* Default character */
  1278. Color_t cursor_color; /* Color of cursor */
  1279. UINT8 select_char_color; /* Color of select character */
  1280. //<cursor_gunking>
  1281. //twinkling_info_t *twinkling_info_OSD;
  1282. //twinkling_info_t *twinkling_info_RGN;
  1283. twinkling_info_t *twinkling_info[2];
  1284. //</cursor_gunking>
  1285. IMAGEHDR image[STATE_MAX];
  1286. } edit_t;
  1287. #endif