Changes file structure; experiments with better string; Search init in file list

This commit is contained in:
2026-02-11 16:47:43 +02:00
parent dbe46fbdfd
commit dfc3071702
26 changed files with 3577 additions and 59 deletions
+2
View File
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build
+6 -2
View File
@@ -2,6 +2,8 @@ add_executable(zbbs-client-tui)
set_property(TARGET zbbs-client-tui PROPERTY C_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(
(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR
(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
@@ -38,14 +40,16 @@ target_sources(zbbs-client-tui
${M_HEADERS}
)
add_subdirectory(ui-widget-core)
add_subdirectory(widget_core)
add_subdirectory(widget)
add_subdirectory(modals)
add_subdirectory(lib)
target_link_libraries(zbbs-client-tui
PRIVATE
ui-widget-core
widget_core
widget
modals
bstring
${CURSES_LIBRARIES}
)
+1
View File
@@ -0,0 +1 @@
add_subdirectory(bstring)
+13
View File
@@ -0,0 +1,13 @@
add_library(bstring STATIC)
file(GLOB M_HEADERS "*.h")
file(GLOB M_SOURCES "*.c")
target_sources(bstring
PRIVATE
${M_SOURCES}
PUBLIC
FILE_SET HEADERS
FILES
${M_HEADERS}
)
File diff suppressed because it is too large Load Diff
+321
View File
@@ -0,0 +1,321 @@
/*
* This source file is part of the bstring string library. This code was
* written by Paul Hsieh in 2002-2015, and is covered by the BSD open source
* license and the GPL. Refer to the accompanying documentation for details
* on usage and license.
*/
/*
* bstrlib.h
*
* This file is the interface for the core bstring functions.
*/
#ifndef BSTRLIB_INCLUDE
#define BSTRLIB_INCLUDE
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#if !defined (BSTRLIB_VSNP_OK) && !defined (BSTRLIB_NOVSNP)
# if defined (__TURBOC__) && !defined (__BORLANDC__)
# define BSTRLIB_NOVSNP
# endif
#endif
#define BSTR_ERR (-1)
#define BSTR_OK (0)
#define BSTR_BS_BUFF_LENGTH_GET (0)
typedef struct tagbstring * bstring;
typedef const struct tagbstring * const_bstring;
/* Version */
#define BSTR_VER_MAJOR 1
#define BSTR_VER_MINOR 0
#define BSTR_VER_UPDATE 0
/* Copy functions */
#define cstr2bstr bfromcstr
extern bstring bfromcstr (const char * str);
extern bstring bfromcstralloc (int mlen, const char * str);
extern bstring bfromcstrrangealloc (int minl, int maxl, const char* str);
extern bstring blk2bstr (const void * blk, int len);
extern char * bstr2cstr (const_bstring s, char z);
extern int bcstrfree (char * s);
extern bstring bstrcpy (const_bstring b1);
extern int bassign (bstring a, const_bstring b);
extern int bassignmidstr (bstring a, const_bstring b, int left, int len);
extern int bassigncstr (bstring a, const char * str);
extern int bassignblk (bstring a, const void * s, int len);
/* Destroy function */
extern int bdestroy (bstring b);
/* Space allocation hinting functions */
extern int balloc (bstring s, int len);
extern int ballocmin (bstring b, int len);
/* Substring extraction */
extern bstring bmidstr (const_bstring b, int left, int len);
/* Various standard manipulations */
extern int bconcat (bstring b0, const_bstring b1);
extern int bconchar (bstring b0, char c);
extern int bcatcstr (bstring b, const char * s);
extern int bcatblk (bstring b, const void * s, int len);
extern int binsert (bstring s1, int pos, const_bstring s2, unsigned char fill);
extern int binsertblk (bstring s1, int pos, const void * s2, int len, unsigned char fill);
extern int binsertch (bstring s1, int pos, int len, unsigned char fill);
extern int breplace (bstring b1, int pos, int len, const_bstring b2, unsigned char fill);
extern int bdelete (bstring s1, int pos, int len);
extern int bsetstr (bstring b0, int pos, const_bstring b1, unsigned char fill);
extern int btrunc (bstring b, int n);
/* Scan/search functions */
extern int bstricmp (const_bstring b0, const_bstring b1);
extern int bstrnicmp (const_bstring b0, const_bstring b1, int n);
extern int biseqcaseless (const_bstring b0, const_bstring b1);
extern int biseqcaselessblk (const_bstring b, const void * blk, int len);
extern int bisstemeqcaselessblk (const_bstring b0, const void * blk, int len);
extern int biseq (const_bstring b0, const_bstring b1);
extern int biseqblk (const_bstring b, const void * blk, int len);
extern int bisstemeqblk (const_bstring b0, const void * blk, int len);
extern int biseqcstr (const_bstring b, const char * s);
extern int biseqcstrcaseless (const_bstring b, const char * s);
extern int bstrcmp (const_bstring b0, const_bstring b1);
extern int bstrncmp (const_bstring b0, const_bstring b1, int n);
extern int binstr (const_bstring s1, int pos, const_bstring s2);
extern int binstrr (const_bstring s1, int pos, const_bstring s2);
extern int binstrcaseless (const_bstring s1, int pos, const_bstring s2);
extern int binstrrcaseless (const_bstring s1, int pos, const_bstring s2);
extern int bstrchrp (const_bstring b, int c, int pos);
extern int bstrrchrp (const_bstring b, int c, int pos);
#define bstrchr(b,c) bstrchrp ((b), (c), 0)
#define bstrrchr(b,c) bstrrchrp ((b), (c), blength(b)-1)
extern int binchr (const_bstring b0, int pos, const_bstring b1);
extern int binchrr (const_bstring b0, int pos, const_bstring b1);
extern int bninchr (const_bstring b0, int pos, const_bstring b1);
extern int bninchrr (const_bstring b0, int pos, const_bstring b1);
extern int bfindreplace (bstring b, const_bstring find, const_bstring repl, int pos);
extern int bfindreplacecaseless (bstring b, const_bstring find, const_bstring repl, int pos);
/* List of string container functions */
struct bstrList {
int qty, mlen;
bstring * entry;
};
extern struct bstrList * bstrListCreate (void);
extern int bstrListDestroy (struct bstrList * sl);
extern int bstrListAlloc (struct bstrList * sl, int msz);
extern int bstrListAllocMin (struct bstrList * sl, int msz);
/* String split and join functions */
extern struct bstrList * bsplit (const_bstring str, unsigned char splitChar);
extern struct bstrList * bsplits (const_bstring str, const_bstring splitStr);
extern struct bstrList * bsplitstr (const_bstring str, const_bstring splitStr);
extern bstring bjoin (const struct bstrList * bl, const_bstring sep);
extern bstring bjoinblk (const struct bstrList * bl, const void * s, int len);
extern int bsplitcb (const_bstring str, unsigned char splitChar, int pos,
int (* cb) (void * parm, int ofs, int len), void * parm);
extern int bsplitscb (const_bstring str, const_bstring splitStr, int pos,
int (* cb) (void * parm, int ofs, int len), void * parm);
extern int bsplitstrcb (const_bstring str, const_bstring splitStr, int pos,
int (* cb) (void * parm, int ofs, int len), void * parm);
/* Miscellaneous functions */
extern int bpattern (bstring b, int len);
extern int btoupper (bstring b);
extern int btolower (bstring b);
extern int bltrimws (bstring b);
extern int brtrimws (bstring b);
extern int btrimws (bstring b);
#if !defined (BSTRLIB_NOVSNP)
extern bstring bformat (const char * fmt, ...);
extern int bformata (bstring b, const char * fmt, ...);
extern int bassignformat (bstring b, const char * fmt, ...);
extern int bvcformata (bstring b, int count, const char * fmt, va_list arglist);
#define bvformata(ret, b, fmt, lastarg) { \
bstring bstrtmp_b = (b); \
const char * bstrtmp_fmt = (fmt); \
int bstrtmp_r = BSTR_ERR, bstrtmp_sz = 16; \
for (;;) { \
va_list bstrtmp_arglist; \
va_start (bstrtmp_arglist, lastarg); \
bstrtmp_r = bvcformata (bstrtmp_b, bstrtmp_sz, bstrtmp_fmt, bstrtmp_arglist); \
va_end (bstrtmp_arglist); \
if (bstrtmp_r >= 0) { /* Everything went ok */ \
bstrtmp_r = BSTR_OK; \
break; \
} else if (-bstrtmp_r <= bstrtmp_sz) { /* A real error? */ \
bstrtmp_r = BSTR_ERR; \
break; \
} \
bstrtmp_sz = -bstrtmp_r; /* Doubled or target size */ \
} \
ret = bstrtmp_r; \
}
#endif
typedef int (*bNgetc) (void *parm);
typedef size_t (* bNread) (void *buff, size_t elsize, size_t nelem, void *parm);
/* Input functions */
extern bstring bgets (bNgetc getcPtr, void * parm, char terminator);
extern bstring bread (bNread readPtr, void * parm);
extern int bgetsa (bstring b, bNgetc getcPtr, void * parm, char terminator);
extern int bassigngets (bstring b, bNgetc getcPtr, void * parm, char terminator);
extern int breada (bstring b, bNread readPtr, void * parm);
/* Stream functions */
extern struct bStream * bsopen (bNread readPtr, void * parm);
extern void * bsclose (struct bStream * s);
extern int bsbufflength (struct bStream * s, int sz);
extern int bsreadln (bstring b, struct bStream * s, char terminator);
extern int bsreadlns (bstring r, struct bStream * s, const_bstring term);
extern int bsread (bstring b, struct bStream * s, int n);
extern int bsreadlna (bstring b, struct bStream * s, char terminator);
extern int bsreadlnsa (bstring r, struct bStream * s, const_bstring term);
extern int bsreada (bstring b, struct bStream * s, int n);
extern int bsunread (struct bStream * s, const_bstring b);
extern int bspeek (bstring r, const struct bStream * s);
extern int bssplitscb (struct bStream * s, const_bstring splitStr,
int (* cb) (void * parm, int ofs, const_bstring entry), void * parm);
extern int bssplitstrcb (struct bStream * s, const_bstring splitStr,
int (* cb) (void * parm, int ofs, const_bstring entry), void * parm);
extern int bseof (const struct bStream * s);
struct tagbstring {
int mlen;
int slen;
unsigned char * data;
};
/* Accessor macros */
#define blengthe(b, e) (((b) == (void *)0 || (b)->slen < 0) ? (int)(e) : ((b)->slen))
#define blength(b) (blengthe ((b), 0))
#define bdataofse(b, o, e) (((b) == (void *)0 || (b)->data == (void*)0) ? (char *)(e) : ((char *)(b)->data) + (o))
#define bdataofs(b, o) (bdataofse ((b), (o), (void *)0))
#define bdatae(b, e) (bdataofse (b, 0, e))
#define bdata(b) (bdataofs (b, 0))
#define bchare(b, p, e) ((((unsigned)(p)) < (unsigned)blength(b)) ? ((b)->data[(p)]) : (e))
#define bchar(b, p) bchare ((b), (p), '\0')
/* Static constant string initialization macro */
#define bsStaticMlen(q,m) {(m), (int) sizeof(q)-1, (unsigned char *) ("" q "")}
#if defined(_MSC_VER)
# define bsStatic(q) bsStaticMlen(q,-32)
#endif
#ifndef bsStatic
# define bsStatic(q) bsStaticMlen(q,-__LINE__)
#endif
/* Static constant block parameter pair */
#define bsStaticBlkParms(q) ((void *)("" q "")), ((int) sizeof(q)-1)
#define bcatStatic(b,s) ((bcatblk)((b), bsStaticBlkParms(s)))
#define bfromStatic(s) ((blk2bstr)(bsStaticBlkParms(s)))
#define bassignStatic(b,s) ((bassignblk)((b), bsStaticBlkParms(s)))
#define binsertStatic(b,p,s,f) ((binsertblk)((b), (p), bsStaticBlkParms(s), (f)))
#define bjoinStatic(b,s) ((bjoinblk)((b), bsStaticBlkParms(s)))
#define biseqStatic(b,s) ((biseqblk)((b), bsStaticBlkParms(s)))
#define bisstemeqStatic(b,s) ((bisstemeqblk)((b), bsStaticBlkParms(s)))
#define biseqcaselessStatic(b,s) ((biseqcaselessblk)((b), bsStaticBlkParms(s)))
#define bisstemeqcaselessStatic(b,s) ((bisstemeqcaselessblk)((b), bsStaticBlkParms(s)))
/* Reference building macros */
#define cstr2tbstr btfromcstr
#define btfromcstr(t,s) { \
(t).data = (unsigned char *) (s); \
(t).slen = ((t).data) ? ((int) (strlen) ((char *)(t).data)) : 0; \
(t).mlen = -1; \
}
#define blk2tbstr(t,s,l) { \
(t).data = (unsigned char *) (s); \
(t).slen = l; \
(t).mlen = -1; \
}
#define btfromblk(t,s,l) blk2tbstr(t,s,l)
#define bmid2tbstr(t,b,p,l) { \
const_bstring bstrtmp_s = (b); \
if (bstrtmp_s && bstrtmp_s->data && bstrtmp_s->slen >= 0) { \
int bstrtmp_left = (p); \
int bstrtmp_len = (l); \
if (bstrtmp_left < 0) { \
bstrtmp_len += bstrtmp_left; \
bstrtmp_left = 0; \
} \
if (bstrtmp_len > bstrtmp_s->slen - bstrtmp_left) \
bstrtmp_len = bstrtmp_s->slen - bstrtmp_left; \
if (bstrtmp_len <= 0) { \
(t).data = (unsigned char *)""; \
(t).slen = 0; \
} else { \
(t).data = bstrtmp_s->data + bstrtmp_left; \
(t).slen = bstrtmp_len; \
} \
} else { \
(t).data = (unsigned char *)""; \
(t).slen = 0; \
} \
(t).mlen = -__LINE__; \
}
#define btfromblkltrimws(t,s,l) { \
int bstrtmp_idx = 0, bstrtmp_len = (l); \
unsigned char * bstrtmp_s = (s); \
if (bstrtmp_s && bstrtmp_len >= 0) { \
for (; bstrtmp_idx < bstrtmp_len; bstrtmp_idx++) { \
if (!isspace (bstrtmp_s[bstrtmp_idx])) break; \
} \
} \
(t).data = bstrtmp_s + bstrtmp_idx; \
(t).slen = bstrtmp_len - bstrtmp_idx; \
(t).mlen = -__LINE__; \
}
#define btfromblkrtrimws(t,s,l) { \
int bstrtmp_len = (l) - 1; \
unsigned char * bstrtmp_s = (s); \
if (bstrtmp_s && bstrtmp_len >= 0) { \
for (; bstrtmp_len >= 0; bstrtmp_len--) { \
if (!isspace (bstrtmp_s[bstrtmp_len])) break; \
} \
} \
(t).data = bstrtmp_s; \
(t).slen = bstrtmp_len + 1; \
(t).mlen = -__LINE__; \
}
#define btfromblktrimws(t,s,l) { \
int bstrtmp_idx = 0, bstrtmp_len = (l) - 1; \
unsigned char * bstrtmp_s = (s); \
if (bstrtmp_s && bstrtmp_len >= 0) { \
for (; bstrtmp_idx <= bstrtmp_len; bstrtmp_idx++) { \
if (!isspace (bstrtmp_s[bstrtmp_idx])) break; \
} \
for (; bstrtmp_len >= bstrtmp_idx; bstrtmp_len--) { \
if (!isspace (bstrtmp_s[bstrtmp_len])) break; \
} \
} \
(t).data = bstrtmp_s + bstrtmp_idx; \
(t).slen = bstrtmp_len + 1 - bstrtmp_idx; \
(t).mlen = -__LINE__; \
}
/* Write protection macros */
#define bwriteprotect(t) { if ((t).mlen >= 0) (t).mlen = -1; }
#define bwriteallow(t) { if ((t).mlen == -1) (t).mlen = (t).slen + ((t).slen == 0); }
#define biswriteprotected(t) ((t).mlen <= 0)
#ifdef __cplusplus
}
#endif
#endif
+9
View File
@@ -11,6 +11,7 @@
#include "connection.h"
#include "main.h"
#include "file_list.h"
#include "query.h"
#include <widget.h>
@@ -61,6 +62,7 @@ int main(int argc, char **argv) {
int32_t process_user_input(app_t *app, callback_args_t *d_args) {
int32_t c;
ui_file_list_t *fui = (ui_file_list_t *) app->query_args->file_list_ui;
c = wgetch(app->win);
switch (c) {
case KEY_F(9):
@@ -72,6 +74,13 @@ int32_t process_user_input(app_t *app, callback_args_t *d_args) {
app->query_args->state = S_UPLOAD_FILE_SELECT;
break;
}
case 's':
case 'S':
if (!app->modal.is_initiated && !fui->active_search) {
fui->active_search = true;
draw_file_list(fui);
return OK;
}
default:
d_args->data = (void *)&c;
app->active_callback(d_args);
+3 -2
View File
@@ -3,7 +3,7 @@ add_library(modals STATIC)
file(GLOB M_HEADERS "*.h")
file(GLOB M_SOURCES "*.c")
target_link_libraries(modals PRIVATE widget ui-widget-core)
target_link_libraries(modals PRIVATE widget widget_core bstring)
target_sources(modals
PRIVATE
@@ -15,4 +15,5 @@ target_sources(modals
)
target_include_directories(modals PRIVATE "../widget")
target_include_directories(modals PRIVATE "../ui-widget-core")
target_include_directories(modals PRIVATE "../widget_core")
target_include_directories(modals PRIVATE "../lib/")
+1 -1
View File
@@ -21,7 +21,7 @@
#include "main.h"
#include "server.h"
#include "app.h"
#include "draw-modal.h"
#include "draw_modal.h"
#include "types.h"
static void wait_side(query_args_t *q_args);
+4 -2
View File
@@ -16,7 +16,9 @@ target_sources(widget
target_link_libraries(widget
PRIVATE
ui-widget-core
bstring
widget_core
)
target_include_directories(widget PRIVATE "../ui-widget-core")
target_include_directories(widget PRIVATE "../widget_core")
target_include_directories(widget PRIVATE "../lib/")
+2 -1
View File
@@ -5,7 +5,8 @@
#include "../common.h"
#include "dialogue.h"
#include <ncurses.h>
#include <ui-widget-core.h>
#include <widget_core.h>
#include <bstrlib.h>
typedef enum {
modal_color_pair = 3,
+1 -1
View File
@@ -4,7 +4,7 @@
#include <string.h>
#include "app.h"
#include <ui-widget-core.h>
#include <widget_core.h>
#include "button.h"
button_t *init_button(WINDOW **win, widget_t *w_parent, char *label) {
+1 -1
View File
@@ -2,7 +2,7 @@
#define BUTTON_H
#include "../main.h"
#include <ui-widget-core.h>
#include <widget_core.h>
#include <stdint.h>
typedef struct {
+1 -1
View File
@@ -5,7 +5,7 @@
#include "group.h"
#include <ncurses.h>
#include <stdint.h>
#include <ui-widget-core.h>
#include <widget_core.h>
enum g_type { g_content, g_action };
+50 -26
View File
@@ -2,6 +2,7 @@
#include "../file_processor.h"
#include "../fs.h"
#include "app.h"
#include <bstrlib.h>
#include <ncurses.h>
#include <stdbool.h>
#include <stddef.h>
@@ -19,6 +20,17 @@ void file_list_cb(callback_args_t *args) {
int32_t key = *((int32_t *)args->data);
char query[256];
int32_t q_len = 0;
if (fui->active_search) {
if (key == KEY_BACKSPACE || key == KEY_DL) {
if (blength(fui->search_key)) {
btrunc(fui->search_key, blength(fui->search_key) - 1);
}
} else {
bconchar(fui->search_key, key);
}
draw_file_list(fui);
return;
}
switch (key) {
case KEY_DOWN:
if (fui->current_idx < fui->current_count - 1) {
@@ -54,18 +66,20 @@ void file_list_cb(callback_args_t *args) {
}
ui_file_list_t *init_file_list(WINDOW **win, WINDOW *const *info_win) {
ui_file_list_t *fl_ui = malloc(sizeof(ui_file_list_t));
init_widget(&(fl_ui->w), NULL, win, "");
WINDOW *parent_win = *(fl_ui->w.parent_win);
fl_ui->current_idx = 0;
fl_ui->current_page = 1;
fl_ui->pages = 1;
fl_ui->current_count = 0;
fl_ui->full_count = 0;
fl_ui->activate_last = false;
fl_ui->info_win = info_win;
fl_ui->max_lines = getmaxy(parent_win) - 3; /* 2+1 (bottom info line) */
return fl_ui;
ui_file_list_t *fui = malloc(sizeof(ui_file_list_t));
init_widget(&(fui->w), NULL, win, "");
WINDOW *parent_win = *(fui->w.parent_win);
fui->current_idx = 0;
fui->current_page = 1;
fui->pages = 1;
fui->current_count = 0;
fui->full_count = 0;
fui->activate_last = false;
fui->info_win = info_win;
fui->max_lines = getmaxy(parent_win) - 3; /* 2+1 (bottom info line) */
fui->active_search = false;
fui->search_key = bfromcstrrangealloc(12, 64, "");
return fui;
}
void reset_file_list(ui_file_list_t *fl_ui) {
@@ -77,26 +91,26 @@ void reset_file_list(ui_file_list_t *fl_ui) {
fl_ui->activate_last = false;
}
void draw_file_list(ui_file_list_t *fl_ui) {
void draw_file_list(ui_file_list_t *fui) {
int32_t sz_y, sz_x;
int32_t p_y, p_x;
WINDOW *parent_win = *(fl_ui->w.parent_win);
WINDOW *parent_win = *(fui->w.parent_win);
getmaxyx(parent_win, sz_y, sz_x);
int32_t sz_y_f = sz_y - 2; /* TODO: можно заменить на поле max_lines */
p_y = 1;
p_x = 1;
fl_item_t *el = *(fl_ui->start);
fl_item_t *active_el = *(fl_ui->start);
fl_item_t *el = *(fui->start);
fl_item_t *active_el = *(fui->start);
int32_t cur_el_idx = 0;
curs_set(false);
if (fl_ui->activate_last) {
fl_ui->current_idx = fl_ui->current_count - 1;
fl_ui->activate_last = false;
if (fui->activate_last) {
fui->current_idx = fui->current_count - 1;
fui->activate_last = false;
}
if (fl_ui->current_idx + 1 >= sz_y_f) {
p_y -= fl_ui->current_idx - sz_y_f + 2;
if (fui->current_idx + 1 >= sz_y_f) {
p_y -= fui->current_idx - sz_y_f + 2;
}
do {
@@ -105,14 +119,14 @@ void draw_file_list(ui_file_list_t *fl_ui) {
cur_el_idx++;
continue;
}
if (cur_el_idx == fl_ui->current_idx) {
if (cur_el_idx == fui->current_idx) {
wattrset(parent_win, A_BOLD | A_REVERSE);
active_el = el;
}
p_x = 1;
mvwprintw(parent_win, p_y, p_x, "%s%n", el->name, &p_x);
mvwprintw(parent_win, p_y, p_x + 1, "%*s", sz_x - p_x, "");
if (cur_el_idx == fl_ui->current_idx) {
if (cur_el_idx == fui->current_idx) {
wattroff(parent_win, A_BOLD | A_REVERSE);
}
p_y++;
@@ -128,21 +142,31 @@ void draw_file_list(ui_file_list_t *fl_ui) {
int32_t p_len;
p_x = 1;
sprintf(p_info, "page: %u/%u files: %u left: %u%n", fl_ui->current_page,
fl_ui->pages, fl_ui->current_count, fl_ui->full_count, &p_len);
if (fui->active_search) {
sprintf(p_info, "[search]: %s_%n", fui->search_key->data, &p_len);
} else {
sprintf(p_info, "page: %u/%u files: %u left: %u%n", fui->current_page,
fui->pages, fui->current_count, fui->full_count, &p_len);
}
uint32_t l_pad = (sz_x - p_len) / 2;
wattrset(parent_win, A_BOLD);
if (fui->active_search) {
mvwprintw(parent_win, p_y, p_x, "%s%*s", p_info, sz_x - p_len, "");
} else {
mvwprintw(parent_win, p_y, p_x, "%*s%s%*s", l_pad, "", p_info, l_pad, "");
}
wattroff(parent_win, A_BOLD);
/* draw file info */
p_y = 1;
p_x = 1;
WINDOW *i_win = *fl_ui->info_win;
WINDOW *i_win = *fui->info_win;
wclear(i_win);
/* Write to the right side the information about the file */
char size_text[64];
size_to_text(active_el->size, size_text);
+5 -2
View File
@@ -1,7 +1,8 @@
#ifndef FILE_LIST_H
#define FILE_LIST_H
#include <ui-widget-core.h>
#include <bstrlib.h>
#include <stdint.h>
#include <widget_core.h>
typedef struct {
widget_t w;
@@ -14,7 +15,9 @@ typedef struct {
uint32_t current_page;
uint32_t max_lines;
WINDOW *const *info_win;
uint32_t activate_last : 1;
bstring search_key;
bool activate_last;
bool active_search;
} ui_file_list_t;
void draw_file_list(ui_file_list_t *fl_ui);
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef FS_FILE_LIST_H
#define FS_FILE_LIST_H
#include <ui-widget-core.h>
#include <widget_core.h>
#include <ncurses.h>
#include <stdint.h>
#include <sys/types.h>
+1 -1
View File
@@ -2,7 +2,7 @@
#define GROUP_H
#include <stdint.h>
#include <ui-widget-core.h>
#include <widget_core.h>
enum g_direction {
horizontal,
+1 -1
View File
@@ -4,7 +4,7 @@
#include <string.h>
#include "app.h"
#include <ui-widget-core.h>
#include <widget_core.h>
#include "input.h"
input_t *init_input(WINDOW **win, widget_t *w_parent, char *label,
+1 -1
View File
@@ -2,7 +2,7 @@
#define INPUT_H
#include "../main.h"
#include <ui-widget-core.h>
#include <widget_core.h>
#include <stdint.h>
typedef struct {
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef PROGRESS_BAR_H
#define PROGRESS_BAR_H
#include <ui-widget-core.h>
#include <widget_core.h>
typedef struct {
widget_t w;
uint32_t procent;
@@ -1,9 +1,9 @@
add_library(ui-widget-core STATIC)
add_library(widget_core STATIC)
file(GLOB M_HEADERS "*.h")
file(GLOB M_SOURCES "*.c")
target_sources(ui-widget-core
target_sources(widget_core
PRIVATE
${M_SOURCES}
PUBLIC
@@ -1,4 +1,4 @@
#include "ui-widget-core.h"
#include "widget_core.h"
#include "../main.h"
#include <ncurses.h>
#include <stdint.h>