Changeset 54ddb59 in mainline for uspace/app/nav/types/panel.h


Ignore:
Timestamp:
2022-06-20T13:10:08Z (22 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
52214a2
Parents:
453f9645
git-author:
Jiri Svoboda <jiri@…> (2022-06-19 18:09:49)
git-committer:
Jiri Svoboda <jiri@…> (2022-06-20 13:10:08)
Message:

Base navigator panel on UI file list

Free scrollbar!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/types/panel.h

    r453f9645 r54ddb59  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2022 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3737#define TYPES_PANEL_H
    3838
    39 #include <adt/list.h>
    4039#include <gfx/color.h>
    4140#include <gfx/coord.h>
    42 #include <ipc/loc.h>
     41#include <ui/filelist.h>
    4342#include <ui/window.h>
    4443#include <stdint.h>
    45 
    46 /** Panel entry attributes */
    47 typedef struct {
    48         /** File name */
    49         const char *name;
    50         /** File size */
    51         uint64_t size;
    52         /** @c true iff entry is a directory */
    53         bool isdir;
    54         /** Service number for service special entries */
    55         service_id_t svc;
    56 } panel_entry_attr_t;
    57 
    58 /** Panel entry */
    59 typedef struct {
    60         /** Containing panel */
    61         struct panel *panel;
    62         /** Link to @c panel->entries */
    63         link_t lentries;
    64         /** File name */
    65         char *name;
    66         /** File size */
    67         uint64_t size;
    68         /** @c true iff entry is a directory */
    69         bool isdir;
    70         /** Service number for service special entries */
    71         service_id_t svc;
    72 } panel_entry_t;
    7344
    7445/** Navigator panel
     
    9566        gfx_color_t *color;
    9667
    97         /** Panel cursor color */
    98         gfx_color_t *curs_color;
    99 
    10068        /** Active border color */
    10169        gfx_color_t *act_border_color;
    102 
    103         /** Directory-type entry color */
    104         gfx_color_t *dir_color;
    105 
    106         /** Service-type entry color */
    107         gfx_color_t *svc_color;
    108 
    109         /** Panel entries (list of panel_entry_t) */
    110         list_t entries;
    111 
    112         /** Number of entries */
    113         size_t entries_cnt;
    114 
    115         /** First entry of current page */
    116         panel_entry_t *page;
    117 
    118         /** Index of first entry of current page */
    119         size_t page_idx;
    120 
    121         /** Cursor position */
    122         panel_entry_t *cursor;
    123 
    124         /** Index of entry under cursor */
    125         size_t cursor_idx;
    12670
    12771        /** @c true iff the panel is active */
    12872        bool active;
    12973
    130         /** Directory */
    131         char *dir;
     74        /** File list */
     75        ui_file_list_t *flist;
    13276} panel_t;
    13377
Note: See TracChangeset for help on using the changeset viewer.