1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2014 Olaf Wintermann. All rights reserved. |
4 * Copyright 2017 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
35 |
35 |
36 #ifdef __cplusplus |
36 #ifdef __cplusplus |
37 extern "C" { |
37 extern "C" { |
38 #endif |
38 #endif |
39 |
39 |
40 typedef struct UiTableView { |
40 typedef struct UiListView { |
41 GtkWidget *widget; |
41 UiContext *ctx; |
42 UiListPtr *list; |
42 GtkWidget *widget; |
43 UiModelInfo *modelinfo; |
43 UiVar *var; |
44 } UiTableView; |
44 UiModelInfo *modelinfo; |
|
45 } UiListView; |
45 |
46 |
46 typedef struct UiTreeEventData { |
47 typedef struct UiTreeEventData { |
47 UiObject *obj; |
48 UiObject *obj; |
48 ui_callback activate; |
49 ui_callback activate; |
49 ui_callback selection; |
50 ui_callback selection; |
50 void *userdata; |
51 void *userdata; |
51 } UiTreeEventData; |
52 } UiTreeEventData; |
52 |
53 |
53 void* ui_strmodel_getvalue(void *elm, int column); |
54 void* ui_strmodel_getvalue(void *elm, int column); |
54 |
55 |
55 UIWIDGET ui_listview_var(UiObject *obj, UiListPtr *list, ui_model_getvalue_f getvalue, ui_callback f, void *udata); |
56 UIWIDGET ui_listview_var(UiObject *obj, UiVar *var, ui_model_getvalue_f getvalue, ui_callback f, void *udata); |
56 UIWIDGET ui_table_var(UiObject *obj, UiListPtr *list, UiModelInfo *modelinfo); |
57 UIWIDGET ui_table_var(UiObject *obj, UiVar *var, UiModelInfo *modelinfo); |
57 |
58 |
58 void ui_listview_update(UiEvent *event, UiTableView *view); |
59 void ui_listview_update(UiList *list, int i); |
|
60 void ui_listview_destroy(GtkWidget *w, UiListView *v); |
|
61 |
59 void ui_listview_activate_event( |
62 void ui_listview_activate_event( |
60 GtkTreeView *tree_view, |
63 GtkTreeView *tree_view, |
61 GtkTreePath *path, |
64 GtkTreePath *path, |
62 GtkTreeViewColumn *column, |
65 GtkTreeViewColumn *column, |
63 UiTreeEventData *event); |
66 UiTreeEventData *event); |
67 UiListSelection* ui_listview_selection( |
70 UiListSelection* ui_listview_selection( |
68 GtkTreeSelection *selection, |
71 GtkTreeSelection *selection, |
69 UiTreeEventData *event); |
72 UiTreeEventData *event); |
70 int ui_tree_path_list_index(GtkTreePath *path); |
73 int ui_tree_path_list_index(GtkTreePath *path); |
71 |
74 |
72 UIWIDGET ui_combobox_var(UiObject *obj, UiListPtr *list, ui_model_getvalue_f getvalue, ui_callback f, void *udata); |
75 UIWIDGET ui_combobox_var(UiObject *obj, UiVar *var, ui_model_getvalue_f getvalue, ui_callback f, void *udata); |
73 GtkWidget* ui_create_combobox(UiObject *obj, UiListModel *model, ui_callback f, void *udata); |
76 GtkWidget* ui_create_combobox(UiObject *obj, UiListModel *model, ui_callback f, void *udata); |
74 void ui_combobox_change_event(GtkComboBox *widget, UiEventData *e); |
77 void ui_combobox_change_event(GtkComboBox *widget, UiEventData *e); |
75 void ui_combobox_update(UiEvent *event, void *combobox); |
78 void ui_combobox_modelupdate(UiList *list, int i); |
76 |
79 |
77 #ifdef __cplusplus |
80 #ifdef __cplusplus |
78 } |
81 } |
79 #endif |
82 #endif |
80 |
83 |