1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef DEMO_TABLE_H
30 #define DEMO_TABLE_H
31
32 #include <ui/ui.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 void application_startup(UiEvent *event,
void *userdata);
39
40 typedef struct MainWindow {
41 UiModel *model;
42 UiList *data;
43
44 UiList *indices;
45 UiString *columnname;
46 } MainWindow;
47
48 typedef struct TableRow {
49 char **columns;
50 size_t capacity;
51 } TableRow;
52
53 void update_indices(MainWindow *wdata);
54 void add_column(UiEvent *event,
void *userdata);
55 void remove_column(UiEvent *event,
void *userdata);
56 void add_row(UiEvent *event,
void *userdata);
57
58 void* row_get_data(UiList *list,
void *elm,
int row,
int col,
void *userdata, UiBool *freeResult);
59 UiBool row_save(UiList *list,
void *elm,
int row,
int col, UiCellValue *value,
void *userdata);
60
61 void row_set(TableRow *row,
int index,
const char *value);
62 char* row_get(TableRow *row,
int index);
63
64 void print_table_data(MainWindow *wdata);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif
71
72