gx_window.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /**************************************************************************/
  2. /* */
  3. /* Copyright (c) Microsoft Corporation. All rights reserved. */
  4. /* */
  5. /* This software is licensed under the Microsoft Software License */
  6. /* Terms for Microsoft Azure RTOS. Full text of the license can be */
  7. /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
  8. /* and in the root directory of this software. */
  9. /* */
  10. /**************************************************************************/
  11. /**************************************************************************/
  12. /**************************************************************************/
  13. /** */
  14. /** GUIX Component */
  15. /** */
  16. /** Window Management (Window) */
  17. /** */
  18. /**************************************************************************/
  19. /**************************************************************************/
  20. /**************************************************************************/
  21. /* */
  22. /* COMPONENT DEFINITION RELEASE */
  23. /* */
  24. /* gx_window.h PORTABLE C */
  25. /* 6.0 */
  26. /* AUTHOR */
  27. /* */
  28. /* Kenneth Maxwell, Microsoft Corporation */
  29. /* */
  30. /* DESCRIPTION */
  31. /* */
  32. /* This file defines the GUIX window management component, */
  33. /* including all data types and external references. It is assumed */
  34. /* that gx_api.h and gx_port.h have already been included. */
  35. /* */
  36. /* RELEASE HISTORY */
  37. /* */
  38. /* DATE NAME DESCRIPTION */
  39. /* */
  40. /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
  41. /* */
  42. /**************************************************************************/
  43. #ifndef GX_WINDOW_H
  44. #define GX_WINDOW_H
  45. #define LIST_CHILD_ID_START 4096
  46. #define GX_SNAP_TIMER 1000
  47. #define GX_FLICK_TIMER 1001
  48. /* Define vertical list management function prototypes. */
  49. UINT _gx_horizontal_list_children_position(GX_HORIZONTAL_LIST *list);
  50. UINT _gx_horizontal_list_create(GX_HORIZONTAL_LIST *horizontal_list, GX_CONST GX_CHAR *name,
  51. GX_WIDGET *parent, INT total_columns,
  52. VOID (*callback)(GX_HORIZONTAL_LIST *, GX_WIDGET *, INT),
  53. ULONG style, USHORT horizontal_list_id, GX_CONST GX_RECTANGLE *size);
  54. UINT _gx_horizontal_list_event_process(GX_HORIZONTAL_LIST *list, GX_EVENT *event_ptr);
  55. VOID _gx_horizontal_list_left_wrap(GX_HORIZONTAL_LIST *list);
  56. UINT _gx_horizontal_list_page_index_set(GX_HORIZONTAL_LIST *list, INT index);
  57. VOID _gx_horizontal_list_right_wrap(GX_HORIZONTAL_LIST *list);
  58. UINT _gx_horizontal_list_selected_index_get(GX_HORIZONTAL_LIST *horizontal_list, INT *return_index);
  59. UINT _gx_horizontal_list_selected_widget_get(GX_HORIZONTAL_LIST *horizontal_list, GX_WIDGET **return_list_entry);
  60. UINT _gx_horizontal_list_selected_set(GX_HORIZONTAL_LIST *horizontal_list, INT entry);
  61. VOID _gx_horizontal_list_selected_visible(GX_HORIZONTAL_LIST *list, GX_WIDGET *child);
  62. VOID _gx_horizontal_list_scroll(GX_HORIZONTAL_LIST *list, INT amount);
  63. VOID _gx_horizontal_list_scroll_info_get(GX_WINDOW *win, ULONG style, GX_SCROLL_INFO *info);
  64. VOID _gx_horizontal_list_slide_back_check(GX_HORIZONTAL_LIST *list);
  65. UINT _gx_horizontal_list_total_columns_set(GX_HORIZONTAL_LIST *list, INT count);
  66. UINT _gx_popup_list_event_process(GX_POPUP_LIST *popup_list, GX_EVENT *event_ptr);
  67. UINT _gx_vertical_list_children_position(GX_VERTICAL_LIST *list);
  68. UINT _gx_vertical_list_create(GX_VERTICAL_LIST *vertical_list, GX_CONST GX_CHAR *name,
  69. GX_WIDGET *parent, INT total_rows,
  70. VOID (*callback)(GX_VERTICAL_LIST *, GX_WIDGET *, INT),
  71. ULONG style, USHORT vertical_list_id, GX_CONST GX_RECTANGLE *size);
  72. UINT _gx_vertical_list_event_process(GX_VERTICAL_LIST *list, GX_EVENT *event_ptr);
  73. VOID _gx_vertical_list_down_wrap(GX_VERTICAL_LIST *list);
  74. UINT _gx_vertical_list_page_index_set(GX_VERTICAL_LIST *list, INT index);
  75. UINT _gx_vertical_list_selected_index_get(GX_VERTICAL_LIST *vertical_list, INT *return_index);
  76. UINT _gx_vertical_list_selected_widget_get(GX_VERTICAL_LIST *vertical_list, GX_WIDGET **return_list_entry);
  77. UINT _gx_vertical_list_selected_set(GX_VERTICAL_LIST *vertical_list, INT index);
  78. VOID _gx_vertical_list_selected_visible(GX_VERTICAL_LIST *list, GX_WIDGET *child);
  79. VOID _gx_vertical_list_scroll(GX_VERTICAL_LIST *list, INT amount);
  80. VOID _gx_vertical_list_scroll_info_get(GX_VERTICAL_LIST *list, ULONG style, GX_SCROLL_INFO *info);
  81. VOID _gx_vertical_list_slide_back_check(GX_VERTICAL_LIST *list);
  82. UINT _gx_vertical_list_total_rows_set(GX_VERTICAL_LIST *list, INT count);
  83. VOID _gx_vertical_list_up_wrap(GX_VERTICAL_LIST *list);
  84. /* Define window management function prototypes. */
  85. VOID _gx_window_background_draw(GX_WINDOW *win);
  86. VOID _gx_window_border_draw(GX_WINDOW *win, GX_COLOR fill_color);
  87. UINT _gx_window_client_scroll(GX_WINDOW *window, GX_VALUE x_scroll, GX_VALUE y_scroll);
  88. UINT _gx_window_client_height_get(GX_WINDOW *window, GX_VALUE *return_height);
  89. UINT _gx_window_client_width_get(GX_WINDOW *window, GX_VALUE *return_width);
  90. UINT _gx_window_close(GX_WINDOW *window);
  91. UINT _gx_window_create(GX_WINDOW *window, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  92. ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size);
  93. VOID _gx_window_draw(GX_WINDOW *window);
  94. UINT _gx_window_event_process(GX_WINDOW *window, GX_EVENT *event_ptr);
  95. UINT _gx_window_execute(GX_WINDOW *window, ULONG *return_ptr);
  96. UINT _gx_window_root_create(GX_WINDOW_ROOT *root_window, GX_CONST GX_CHAR *name, GX_CANVAS *canvas,
  97. ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size);
  98. UINT _gx_window_root_delete(GX_WINDOW_ROOT *root_window);
  99. UINT _gx_window_root_find(GX_WIDGET *widget, GX_WINDOW_ROOT **return_root_window);
  100. UINT _gx_window_root_event_process(GX_WINDOW_ROOT *root, GX_EVENT *event_ptr);
  101. UINT _gx_window_scroll(GX_WINDOW *window, GX_VALUE x_scroll, GX_VALUE y_scroll);
  102. UINT _gx_window_scroll_info_get(GX_WINDOW *window, ULONG type, GX_SCROLL_INFO *return_scroll_info);
  103. UINT _gx_window_scrollbar_find(GX_WINDOW *window, USHORT type, GX_SCROLLBAR **return_scrollbar);
  104. VOID _gx_window_view_update_detect(GX_WINDOW *win);
  105. UINT _gx_window_wallpaper_get(GX_WINDOW *window, GX_RESOURCE_ID *return_wallpaper_id);
  106. UINT _gx_window_wallpaper_set(GX_WINDOW *window, GX_RESOURCE_ID wallpaper_id, GX_BOOL tile);
  107. /* Define error checking shells for API services. These are only referenced by the
  108. application. */
  109. UINT _gxe_window_client_scroll(GX_WINDOW *window, GX_VALUE x_scroll, GX_VALUE y_scroll);
  110. UINT _gxe_window_client_height_get(GX_WINDOW *window, GX_VALUE *return_height);
  111. UINT _gxe_window_client_width_get(GX_WINDOW *window, GX_VALUE *return_width);
  112. UINT _gxe_window_close(GX_WINDOW *window);
  113. UINT _gxe_window_create(GX_WINDOW *window, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
  114. ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size, UINT window_control_block_size);
  115. UINT _gxe_window_event_process(GX_WINDOW *window, GX_EVENT *event_ptr);
  116. UINT _gxe_window_execute(GX_WINDOW *window, ULONG *return_ptr);
  117. UINT _gxe_window_root_find(GX_WIDGET *widget, GX_WINDOW_ROOT **return_root_window);
  118. UINT _gxe_window_scroll_info_get(GX_WINDOW *window, ULONG type, GX_SCROLL_INFO *return_scroll_info);
  119. UINT _gxe_window_scrollbar_find(GX_WINDOW *window, USHORT type, GX_SCROLLBAR **return_scrollbar);
  120. UINT _gxe_window_wallpaper_get(GX_WINDOW *window, GX_RESOURCE_ID *return_wallpaper_id);
  121. UINT _gxe_window_wallpaper_set(GX_WINDOW *window, GX_RESOURCE_ID wallpaper_id, GX_BOOL tile);
  122. UINT _gxe_horizontal_list_children_position(GX_HORIZONTAL_LIST *list);
  123. UINT _gxe_horizontal_list_create(GX_HORIZONTAL_LIST *horizontal_list,
  124. GX_CONST GX_CHAR *name,
  125. GX_WIDGET *parent, INT total_rows,
  126. VOID (*callback)(GX_HORIZONTAL_LIST *, GX_WIDGET *, INT),
  127. ULONG style, USHORT horizontal_list_id,
  128. GX_CONST GX_RECTANGLE *size,
  129. UINT horizontal_list_control_block_size);
  130. UINT _gxe_horizontal_list_event_process(GX_HORIZONTAL_LIST *list, GX_EVENT *event_ptr);
  131. UINT _gxe_horizontal_list_selected_index_get(GX_HORIZONTAL_LIST *horizontal_list, INT *return_index);
  132. UINT _gxe_horizontal_list_selected_set(GX_HORIZONTAL_LIST *horizontal_list, INT index);
  133. UINT _gxe_horizontal_list_selected_widget_get(GX_HORIZONTAL_LIST *horizontal_list, GX_WIDGET **return_list_entry);
  134. UINT _gxe_horizontal_list_total_columns_set(GX_HORIZONTAL_LIST *list, INT count);
  135. UINT _gxe_horizontal_list_page_index_set(GX_HORIZONTAL_LIST *vertical_list, INT index);
  136. UINT _gxe_vertical_list_children_position(GX_VERTICAL_LIST *list);
  137. UINT _gxe_vertical_list_create(GX_VERTICAL_LIST *vertical_list, GX_CONST GX_CHAR *name,
  138. GX_WIDGET *parent, INT total_rows,
  139. VOID (*callback)(GX_VERTICAL_LIST *, GX_WIDGET *, INT),
  140. ULONG style, USHORT vertical_list_id, GX_CONST GX_RECTANGLE *size,
  141. UINT vertical_list_control_block_size);
  142. UINT _gxe_vertical_list_event_process(GX_VERTICAL_LIST *list, GX_EVENT *event_ptr);
  143. UINT _gxe_vertical_list_selected_set(GX_VERTICAL_LIST *vertical_list, INT index);
  144. UINT _gxe_vertical_list_selected_index_get(GX_VERTICAL_LIST *vertical_list, INT *return_index);
  145. UINT _gxe_vertical_list_selected_widget_get(GX_VERTICAL_LIST *vertical_list, GX_WIDGET **return_list_entry);
  146. UINT _gxe_vertical_list_total_rows_set(GX_VERTICAL_LIST *list, INT count);
  147. UINT _gxe_vertical_list_page_index_set(GX_VERTICAL_LIST *horizontal_list, INT list_entry);
  148. UINT _gxe_window_root_create(GX_WINDOW_ROOT *root_window, GX_CONST GX_CHAR *name,
  149. GX_CANVAS *canvas, ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size, UINT root_window_control_block_size);
  150. UINT _gxe_window_root_delete(GX_WINDOW_ROOT *root_window);
  151. UINT _gxe_window_root_event_process(GX_WINDOW_ROOT *root, GX_EVENT *event_ptr);
  152. #endif