Changeset dc5c303 in mainline for uspace/lib/ui/private
- Timestamp:
- 2023-12-28T13:59:23Z (2 years ago)
- Children:
- 6b66de6b
- Parents:
- 42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
- git-committer:
- GitHub <noreply@…> (2023-12-28 13:59:23)
- Location:
- uspace/lib/ui/private
- Files:
-
- 1 added
- 12 edited
- 1 moved
-
entry.h (modified) (1 diff)
-
filelist.h (modified) (1 diff)
-
list.h (modified) (1 diff)
-
menu.h (modified) (5 diffs)
-
menubar.h (modified) (2 diffs)
-
menudd.h (moved) (moved from kernel/generic/include/symtab_lookup.h ) (2 diffs)
-
menuentry.h (modified) (2 diffs)
-
promptdialog.h (modified) (1 diff)
-
resource.h (modified) (2 diffs)
-
scrollbar.h (modified) (4 diffs)
-
selectdialog.h (added)
-
ui.h (modified) (1 diff)
-
wdecor.h (modified) (5 diffs)
-
window.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/private/entry.h
r42c2e65 rdc5c303 92 92 } ui_entry_geom_t; 93 93 94 extern errno_t ui_entry_insert_str(ui_entry_t *, const char *);95 94 extern ui_evclaim_t ui_entry_key_press_ctrl(ui_entry_t *, kbd_event_t *); 96 95 extern ui_evclaim_t ui_entry_key_press_shift(ui_entry_t *, kbd_event_t *); -
uspace/lib/ui/private/filelist.h
r42c2e65 rdc5c303 103 103 104 104 extern bool ui_file_list_is_active(ui_file_list_t *); 105 extern void ui_file_list_entry_de lete(ui_file_list_entry_t *);105 extern void ui_file_list_entry_destroy(ui_file_list_entry_t *); 106 106 extern void ui_file_list_clear_entries(ui_file_list_t *); 107 107 extern errno_t ui_file_list_sort(ui_file_list_t *); -
uspace/lib/ui/private/list.h
r42c2e65 rdc5c303 136 136 extern int ui_list_entry_ptr_cmp(const void *, const void *); 137 137 extern size_t ui_list_entry_get_idx(ui_list_entry_t *); 138 extern void ui_list_entry_destroy(ui_list_entry_t *); 138 139 139 140 #endif -
uspace/lib/ui/private/menu.h
r42c2e65 rdc5c303 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 41 41 #include <gfx/coord.h> 42 42 #include <stdbool.h> 43 #include <types/common.h> 43 44 #include <types/ui/menu.h> 44 45 #include <types/ui/resource.h> … … 49 50 */ 50 51 struct ui_menu { 51 /** Containing menu bar */ 52 struct ui_menu_bar *mbar; 53 /** Link to @c bar->menus */ 54 link_t lmenus; 52 /** Parent window */ 53 struct ui_window *parent; 55 54 /** Caption */ 56 55 char *caption; … … 67 66 /** Menu entries (ui_menu_entry_t) */ 68 67 list_t entries; 68 /** Callbacks */ 69 struct ui_menu_cb *cb; 70 /** Callback argument */ 71 void *arg; 69 72 }; 70 73 … … 86 89 extern void ui_menu_up(ui_menu_t *); 87 90 extern void ui_menu_down(ui_menu_t *); 91 extern void ui_menu_left(ui_menu_t *, sysarg_t); 92 extern void ui_menu_right(ui_menu_t *, sysarg_t); 93 extern void ui_menu_close_req(ui_menu_t *); 94 extern void ui_menu_press_accel(ui_menu_t *, char32_t, sysarg_t); 88 95 89 96 #endif -
uspace/lib/ui/private/menubar.h
r42c2e65 rdc5c303 42 42 #include <stdbool.h> 43 43 #include <types/common.h> 44 #include <types/ui/menu.h>45 44 #include <types/ui/menubar.h> 45 #include <types/ui/menudd.h> 46 46 47 47 /** Actual structure of menu bar. … … 60 60 /** Menu bar is active */ 61 61 bool active; 62 /** Selected menu or @c NULL */63 struct ui_menu *selected;64 /** List of menu s (ui_menu_t) */65 list_t menu s;62 /** Selected menu drop-down or @c NULL */ 63 struct ui_menu_dd *selected; 64 /** List of menu drop-downs (ui_menu_dd_t) */ 65 list_t menudds; 66 66 }; 67 67 68 extern void ui_menu_bar_select(ui_menu_bar_t *, ui_menu_t *, bool, sysarg_t); 68 extern void ui_menu_bar_select(ui_menu_bar_t *, ui_menu_dd_t *, bool, sysarg_t); 69 extern void ui_menu_bar_select_sysmenu(ui_menu_bar_t *, bool, sysarg_t); 69 70 extern void ui_menu_bar_left(ui_menu_bar_t *, sysarg_t); 70 71 extern void ui_menu_bar_right(ui_menu_bar_t *, sysarg_t); 71 72 extern ui_evclaim_t ui_menu_bar_key_press_unmod(ui_menu_bar_t *, kbd_event_t *); 72 extern void ui_menu_bar_entry_rect(ui_menu_bar_t *, ui_menu_t *, gfx_rect_t *); 73 extern void ui_menu_bar_entry_rect(ui_menu_bar_t *, ui_menu_dd_t *, 74 gfx_rect_t *); 73 75 74 76 #endif -
uspace/lib/ui/private/menudd.h
r42c2e65 rdc5c303 1 1 /* 2 * Copyright (c) 20 05 Ondrej Palkovsky2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup kernel_generic29 /** @addtogroup libui 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file Menu drop-down structure 34 * 33 35 */ 34 36 35 #ifndef KERN_SYMTAB_LOOKUP_H_36 #define KERN_SYMTAB_LOOKUP_H_37 #ifndef _UI_PRIVATE_MENUDD_H 38 #define _UI_PRIVATE_MENUDD_H 37 39 38 #include <typedefs.h> 40 #include <adt/list.h> 41 #include <gfx/coord.h> 42 #include <stdbool.h> 43 #include <types/ui/menudd.h> 44 #include <types/ui/resource.h> 39 45 40 #define MAX_SYMBOL_NAME 64 41 42 struct symtab_entry { 43 uint64_t address_le; 44 char symbol_name[MAX_SYMBOL_NAME]; 46 /** Actual structure of menu drop-down. 47 * 48 * This is private to libui. 49 */ 50 struct ui_menu_dd { 51 /** Containing menu bar */ 52 struct ui_menu_bar *mbar; 53 /** Link to @c bar->menudds */ 54 link_t lmenudds; 55 /** Caption */ 56 char *caption; 57 /** Popup window or @c NULL if drop-down is not currently open */ 58 struct ui_popup *popup; 59 /** Actual menu */ 60 struct ui_menu *menu; 45 61 }; 46 47 extern errno_t symtab_name_lookup(uintptr_t, const char **, uintptr_t *);48 extern const char *symtab_fmt_name_lookup(uintptr_t);49 extern errno_t symtab_addr_lookup(const char *, uintptr_t *);50 51 #ifdef CONFIG_SYMTAB52 53 /** Symtable linked together by build process54 *55 */56 extern struct symtab_entry symbol_table[];57 58 #endif /* CONFIG_SYMTAB */59 62 60 63 #endif -
uspace/lib/ui/private/menuentry.h
r42c2e65 rdc5c303 1 1 /* 2 * Copyright (c) 202 1Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 53 53 /** Callbacks */ 54 54 ui_menu_entry_cb_t cb; 55 /** This entry is disabled */ 56 bool disabled; 55 57 /** This entry is a separator entry */ 56 58 bool separator; -
uspace/lib/ui/private/promptdialog.h
r42c2e65 rdc5c303 45 45 /** Dialog window */ 46 46 struct ui_window *window; 47 /** File nameentry */47 /** Text entry */ 48 48 struct ui_entry *ename; 49 49 /** OK button */ -
uspace/lib/ui/private/resource.h
r42c2e65 rdc5c303 79 79 /** Window text color */ 80 80 gfx_color_t *wnd_text_color; 81 /** Disabled text color */ 82 gfx_color_t *wnd_dis_text_color; 81 83 /** Window text highlight color */ 82 84 gfx_color_t *wnd_text_hgl_color; … … 116 118 gfx_color_t *entry_sel_text_bg_color; 117 119 118 /** Scrollbar t hrough color */119 gfx_color_t *sbar_t hrough_color;120 /** Scrollbar active t hrough color */121 gfx_color_t *sbar_act_t hrough_color;120 /** Scrollbar trough color */ 121 gfx_color_t *sbar_trough_color; 122 /** Scrollbar active trough color */ 123 gfx_color_t *sbar_act_trough_color; 122 124 123 125 /** Expose callback or @c NULL */ -
uspace/lib/ui/private/scrollbar.h
r42c2e65 rdc5c303 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 69 69 /** Thumb is currently held down */ 70 70 bool thumb_held; 71 /** Up through is currently held down */72 bool up _through_held;73 /** Pointer is inside up through */74 bool up _through_inside;75 /** Down through is currently held down */76 bool down_through_held;77 /** Pointer is inside down through */78 bool down_through_inside;71 /** Upper trough is currently held down */ 72 bool upper_trough_held; 73 /** Pointer is inside upper trough */ 74 bool upper_trough_inside; 75 /** Lower trough is currently held down */ 76 bool lower_trough_held; 77 /** Pointer is inside lower trough */ 78 bool lower_trough_inside; 79 79 /** Position where thumb was pressed */ 80 80 gfx_coord2_t press_pos; … … 83 83 /** Thumb position */ 84 84 gfx_coord_t pos; 85 /** Last cursor position (when t hrough is held) */85 /** Last cursor position (when trough is held) */ 86 86 gfx_coord2_t last_curs_pos; 87 87 }; … … 94 94 /** Up button rectangle */ 95 95 gfx_rect_t up_btn_rect; 96 /** T hrough rectangle */97 gfx_rect_t t hrough_rect;98 /** Up through rectangle */99 gfx_rect_t up _through_rect;96 /** Trough rectangle */ 97 gfx_rect_t trough_rect; 98 /** Upper trough rectangle */ 99 gfx_rect_t upper_trough_rect; 100 100 /** Thumb rectangle */ 101 101 gfx_rect_t thumb_rect; 102 /** Down through rectangle */103 gfx_rect_t down_through_rect;102 /** Lower trough rectangle */ 103 gfx_rect_t lower_trough_rect; 104 104 /** Down button rectangle */ 105 105 gfx_rect_t down_btn_rect; -
uspace/lib/ui/private/ui.h
r42c2e65 rdc5c303 61 61 /** Output owned by UI, clean up when destroying UI */ 62 62 bool myoutput; 63 /** @c true iff UI is suspended */ 64 bool suspended; 63 65 /** @c true if terminating */ 64 66 bool quit; -
uspace/lib/ui/private/wdecor.h
r42c2e65 rdc5c303 41 41 #include <io/pos_event.h> 42 42 #include <stdbool.h> 43 #include <types/common.h> 43 44 #include <types/ui/cursor.h> 44 45 #include <types/ui/wdecor.h> … … 65 66 /** Window is maximized */ 66 67 bool maximized; 68 /** System menu handle is active */ 69 bool sysmenu_hdl_active; 67 70 /** Minimize button */ 68 71 struct ui_pbutton *btn_min; … … 82 85 /** Title bar rectangle */ 83 86 gfx_rect_t title_bar_rect; 87 /** System menu handle rectangle */ 88 gfx_rect_t sysmenu_hdl_rect; 84 89 /** Window caption rectangle */ 85 90 gfx_rect_t caption_rect; … … 94 99 } ui_wdecor_geom_t; 95 100 101 extern void ui_wdecor_sysmenu_open(ui_wdecor_t *, sysarg_t); 102 extern void ui_wdecor_sysmenu_left(ui_wdecor_t *, sysarg_t); 103 extern void ui_wdecor_sysmenu_right(ui_wdecor_t *, sysarg_t); 104 extern void ui_wdecor_sysmenu_accel(ui_wdecor_t *, char32_t, sysarg_t); 96 105 extern void ui_wdecor_minimize(ui_wdecor_t *); 97 106 extern void ui_wdecor_maximize(ui_wdecor_t *); … … 103 112 extern void ui_wdecor_set_cursor(ui_wdecor_t *, ui_stock_cursor_t); 104 113 extern void ui_wdecor_get_geom(ui_wdecor_t *, ui_wdecor_geom_t *); 114 extern errno_t ui_wdecor_sysmenu_hdl_paint_gfx(ui_wdecor_t *, gfx_rect_t *); 115 extern errno_t ui_wdecor_sysmenu_hdl_paint_text(ui_wdecor_t *, gfx_rect_t *); 116 extern errno_t ui_wdecor_sysmenu_hdl_paint(ui_wdecor_t *, gfx_rect_t *); 105 117 extern void ui_wdecor_frame_pos_event(ui_wdecor_t *, pos_event_t *); 106 118 extern ui_wdecor_rsztype_t ui_wdecor_get_rsztype(ui_wdecor_t *, -
uspace/lib/ui/private/window.h
r42c2e65 rdc5c303 47 47 #include <memgfx/memgc.h> 48 48 #include <memgfx/xlategc.h> 49 #include <types/common.h> 49 50 #include <types/ui/cursor.h> 50 51 #include <types/ui/window.h> … … 93 94 /** Window decoration */ 94 95 struct ui_wdecor *wdecor; 96 /** System menu */ 97 struct ui_menu *sysmenu; 98 /** System menu restore entry */ 99 struct ui_menu_entry *sysmenu_restore; 100 /** System menu minimize entry */ 101 struct ui_menu_entry *sysmenu_minimize; 102 /** System menu maximize entry */ 103 struct ui_menu_entry *sysmenu_maximize; 104 /** Menu bar */ 105 struct ui_menu_bar *mbar; 95 106 /** Top-level control in the application area */ 96 107 struct ui_control *control; … … 112 123 113 124 extern display_stock_cursor_t wnd_dcursor_from_cursor(ui_stock_cursor_t); 125 extern void ui_window_send_sysmenu(ui_window_t *, sysarg_t); 114 126 extern void ui_window_send_minimize(ui_window_t *); 115 127 extern void ui_window_send_maximize(ui_window_t *);
Note:
See TracChangeset
for help on using the changeset viewer.
