Changeset dc5c303 in mainline for uspace/lib/ui/private


Ignore:
Timestamp:
2023-12-28T13:59:23Z (2 years ago)
Author:
GitHub <noreply@…>
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)
Message:

Merge branch 'master' into topic/packet-capture

Location:
uspace/lib/ui/private
Files:
1 added
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/private/entry.h

    r42c2e65 rdc5c303  
    9292} ui_entry_geom_t;
    9393
    94 extern errno_t ui_entry_insert_str(ui_entry_t *, const char *);
    9594extern ui_evclaim_t ui_entry_key_press_ctrl(ui_entry_t *, kbd_event_t *);
    9695extern ui_evclaim_t ui_entry_key_press_shift(ui_entry_t *, kbd_event_t *);
  • uspace/lib/ui/private/filelist.h

    r42c2e65 rdc5c303  
    103103
    104104extern bool ui_file_list_is_active(ui_file_list_t *);
    105 extern void ui_file_list_entry_delete(ui_file_list_entry_t *);
     105extern void ui_file_list_entry_destroy(ui_file_list_entry_t *);
    106106extern void ui_file_list_clear_entries(ui_file_list_t *);
    107107extern errno_t ui_file_list_sort(ui_file_list_t *);
  • uspace/lib/ui/private/list.h

    r42c2e65 rdc5c303  
    136136extern int ui_list_entry_ptr_cmp(const void *, const void *);
    137137extern size_t ui_list_entry_get_idx(ui_list_entry_t *);
     138extern void ui_list_entry_destroy(ui_list_entry_t *);
    138139
    139140#endif
  • uspace/lib/ui/private/menu.h

    r42c2e65 rdc5c303  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4141#include <gfx/coord.h>
    4242#include <stdbool.h>
     43#include <types/common.h>
    4344#include <types/ui/menu.h>
    4445#include <types/ui/resource.h>
     
    4950 */
    5051struct 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;
    5554        /** Caption */
    5655        char *caption;
     
    6766        /** Menu entries (ui_menu_entry_t) */
    6867        list_t entries;
     68        /** Callbacks */
     69        struct ui_menu_cb *cb;
     70        /** Callback argument */
     71        void *arg;
    6972};
    7073
     
    8689extern void ui_menu_up(ui_menu_t *);
    8790extern void ui_menu_down(ui_menu_t *);
     91extern void ui_menu_left(ui_menu_t *, sysarg_t);
     92extern void ui_menu_right(ui_menu_t *, sysarg_t);
     93extern void ui_menu_close_req(ui_menu_t *);
     94extern void ui_menu_press_accel(ui_menu_t *, char32_t, sysarg_t);
    8895
    8996#endif
  • uspace/lib/ui/private/menubar.h

    r42c2e65 rdc5c303  
    4242#include <stdbool.h>
    4343#include <types/common.h>
    44 #include <types/ui/menu.h>
    4544#include <types/ui/menubar.h>
     45#include <types/ui/menudd.h>
    4646
    4747/** Actual structure of menu bar.
     
    6060        /** Menu bar is active */
    6161        bool active;
    62         /** Selected menu or @c NULL */
    63         struct ui_menu *selected;
    64         /** List of menus (ui_menu_t) */
    65         list_t menus;
     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;
    6666};
    6767
    68 extern void ui_menu_bar_select(ui_menu_bar_t *, ui_menu_t *, bool, sysarg_t);
     68extern void ui_menu_bar_select(ui_menu_bar_t *, ui_menu_dd_t *, bool, sysarg_t);
     69extern void ui_menu_bar_select_sysmenu(ui_menu_bar_t *, bool, sysarg_t);
    6970extern void ui_menu_bar_left(ui_menu_bar_t *, sysarg_t);
    7071extern void ui_menu_bar_right(ui_menu_bar_t *, sysarg_t);
    7172extern 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 *);
     73extern void ui_menu_bar_entry_rect(ui_menu_bar_t *, ui_menu_dd_t *,
     74    gfx_rect_t *);
    7375
    7476#endif
  • uspace/lib/ui/private/menudd.h

    r42c2e65 rdc5c303  
    11/*
    2  * Copyright (c) 2005 Ondrej Palkovsky
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup kernel_generic
     29/** @addtogroup libui
    3030 * @{
    3131 */
    32 /** @file
     32/**
     33 * @file Menu drop-down structure
     34 *
    3335 */
    3436
    35 #ifndef KERN_SYMTAB_LOOKUP_H_
    36 #define KERN_SYMTAB_LOOKUP_H_
     37#ifndef _UI_PRIVATE_MENUDD_H
     38#define _UI_PRIVATE_MENUDD_H
    3739
    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>
    3945
    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 */
     50struct 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;
    4561};
    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_SYMTAB
    52 
    53 /** Symtable linked together by build process
    54  *
    55  */
    56 extern struct symtab_entry symbol_table[];
    57 
    58 #endif /* CONFIG_SYMTAB */
    5962
    6063#endif
  • uspace/lib/ui/private/menuentry.h

    r42c2e65 rdc5c303  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    5353        /** Callbacks */
    5454        ui_menu_entry_cb_t cb;
     55        /** This entry is disabled */
     56        bool disabled;
    5557        /** This entry is a separator entry */
    5658        bool separator;
  • uspace/lib/ui/private/promptdialog.h

    r42c2e65 rdc5c303  
    4545        /** Dialog window */
    4646        struct ui_window *window;
    47         /** File name entry */
     47        /** Text entry */
    4848        struct ui_entry *ename;
    4949        /** OK button */
  • uspace/lib/ui/private/resource.h

    r42c2e65 rdc5c303  
    7979        /** Window text color */
    8080        gfx_color_t *wnd_text_color;
     81        /** Disabled text color */
     82        gfx_color_t *wnd_dis_text_color;
    8183        /** Window text highlight color */
    8284        gfx_color_t *wnd_text_hgl_color;
     
    116118        gfx_color_t *entry_sel_text_bg_color;
    117119
    118         /** Scrollbar through color */
    119         gfx_color_t *sbar_through_color;
    120         /** Scrollbar active through color */
    121         gfx_color_t *sbar_act_through_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;
    122124
    123125        /** Expose callback or @c NULL */
  • uspace/lib/ui/private/scrollbar.h

    r42c2e65 rdc5c303  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    6969        /** Thumb is currently held down */
    7070        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;
    7979        /** Position where thumb was pressed */
    8080        gfx_coord2_t press_pos;
     
    8383        /** Thumb position */
    8484        gfx_coord_t pos;
    85         /** Last cursor position (when through is held) */
     85        /** Last cursor position (when trough is held) */
    8686        gfx_coord2_t last_curs_pos;
    8787};
     
    9494        /** Up button rectangle */
    9595        gfx_rect_t up_btn_rect;
    96         /** Through rectangle */
    97         gfx_rect_t through_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;
    100100        /** Thumb rectangle */
    101101        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;
    104104        /** Down button rectangle */
    105105        gfx_rect_t down_btn_rect;
  • uspace/lib/ui/private/ui.h

    r42c2e65 rdc5c303  
    6161        /** Output owned by UI, clean up when destroying UI */
    6262        bool myoutput;
     63        /** @c true iff UI is suspended */
     64        bool suspended;
    6365        /** @c true if terminating */
    6466        bool quit;
  • uspace/lib/ui/private/wdecor.h

    r42c2e65 rdc5c303  
    4141#include <io/pos_event.h>
    4242#include <stdbool.h>
     43#include <types/common.h>
    4344#include <types/ui/cursor.h>
    4445#include <types/ui/wdecor.h>
     
    6566        /** Window is maximized */
    6667        bool maximized;
     68        /** System menu handle is active */
     69        bool sysmenu_hdl_active;
    6770        /** Minimize button */
    6871        struct ui_pbutton *btn_min;
     
    8285        /** Title bar rectangle */
    8386        gfx_rect_t title_bar_rect;
     87        /** System menu handle rectangle */
     88        gfx_rect_t sysmenu_hdl_rect;
    8489        /** Window caption rectangle */
    8590        gfx_rect_t caption_rect;
     
    9499} ui_wdecor_geom_t;
    95100
     101extern void ui_wdecor_sysmenu_open(ui_wdecor_t *, sysarg_t);
     102extern void ui_wdecor_sysmenu_left(ui_wdecor_t *, sysarg_t);
     103extern void ui_wdecor_sysmenu_right(ui_wdecor_t *, sysarg_t);
     104extern void ui_wdecor_sysmenu_accel(ui_wdecor_t *, char32_t, sysarg_t);
    96105extern void ui_wdecor_minimize(ui_wdecor_t *);
    97106extern void ui_wdecor_maximize(ui_wdecor_t *);
     
    103112extern void ui_wdecor_set_cursor(ui_wdecor_t *, ui_stock_cursor_t);
    104113extern void ui_wdecor_get_geom(ui_wdecor_t *, ui_wdecor_geom_t *);
     114extern errno_t ui_wdecor_sysmenu_hdl_paint_gfx(ui_wdecor_t *, gfx_rect_t *);
     115extern errno_t ui_wdecor_sysmenu_hdl_paint_text(ui_wdecor_t *, gfx_rect_t *);
     116extern errno_t ui_wdecor_sysmenu_hdl_paint(ui_wdecor_t *, gfx_rect_t *);
    105117extern void ui_wdecor_frame_pos_event(ui_wdecor_t *, pos_event_t *);
    106118extern ui_wdecor_rsztype_t ui_wdecor_get_rsztype(ui_wdecor_t *,
  • uspace/lib/ui/private/window.h

    r42c2e65 rdc5c303  
    4747#include <memgfx/memgc.h>
    4848#include <memgfx/xlategc.h>
     49#include <types/common.h>
    4950#include <types/ui/cursor.h>
    5051#include <types/ui/window.h>
     
    9394        /** Window decoration */
    9495        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;
    95106        /** Top-level control in the application area */
    96107        struct ui_control *control;
     
    112123
    113124extern display_stock_cursor_t wnd_dcursor_from_cursor(ui_stock_cursor_t);
     125extern void ui_window_send_sysmenu(ui_window_t *, sysarg_t);
    114126extern void ui_window_send_minimize(ui_window_t *);
    115127extern void ui_window_send_maximize(ui_window_t *);
Note: See TracChangeset for help on using the changeset viewer.