ui/ui/toolkit.h

changeset 26
40d6af793c1a
parent 21
3060a5a1d5fd
child 27
c254ed644edf
equal deleted inserted replaced
25:915131bc3233 26:40d6af793c1a
155 155
156 typedef struct UiStr UiStr; 156 typedef struct UiStr UiStr;
157 157
158 typedef struct UiFileList UiFileList; 158 typedef struct UiFileList UiFileList;
159 159
160 typedef struct UiListSelection UiListSelection;
161
160 /* begin opaque types */ 162 /* begin opaque types */
161 typedef struct UiContext UiContext; 163 typedef struct UiContext UiContext;
162 typedef struct UiContainer UiContainer; 164 typedef struct UiContainer UiContainer;
163 165
164 typedef struct UiIcon UiIcon; 166 typedef struct UiIcon UiIcon;
327 /* iterator changes after first() next() and get() */ 329 /* iterator changes after first() next() and get() */
328 void *iter; 330 void *iter;
329 /* private - implementation dependent */ 331 /* private - implementation dependent */
330 void *data; 332 void *data;
331 333
332 /* binding function */ 334 /* binding functions */
333 void (*update)(UiList *list, int i); 335 void (*update)(UiList *list, int i);
336 UiListSelection (*getselection)(UiList *list);
334 /* binding object */ 337 /* binding object */
335 void *obj; 338 void *obj;
336 339
337 /* list of observers */ 340 /* list of observers */
338 UiObserver *observers; 341 UiObserver *observers;
342 };
343
344
345 struct UiListSelection {
346 /*
347 * number of selected items
348 */
349 int count;
350
351 /*
352 * indices of selected rows
353 */
354 int *rows;
339 }; 355 };
340 356
341 struct UiRange { 357 struct UiRange {
342 double (*get)(UiRange *range); 358 double (*get)(UiRange *range);
343 void (*set)(UiRange *range, double value); 359 void (*set)(UiRange *range, double value);
460 UIEXPORT void ui_list_prepend(UiList *list, void *data); 476 UIEXPORT void ui_list_prepend(UiList *list, void *data);
461 UIEXPORT void ui_list_clear(UiList *list); 477 UIEXPORT void ui_list_clear(UiList *list);
462 UIEXPORT void ui_list_addobsv(UiList *list, ui_callback f, void *data); 478 UIEXPORT void ui_list_addobsv(UiList *list, ui_callback f, void *data);
463 UIEXPORT void ui_list_notify(UiList *list); 479 UIEXPORT void ui_list_notify(UiList *list);
464 480
481 UIEXPORT UiListSelection ui_list_getselection(UiList *list);
482
465 UIEXPORT UiFileList ui_filelist_copy(UiFileList list); 483 UIEXPORT UiFileList ui_filelist_copy(UiFileList list);
466 UIEXPORT void ui_filelist_free(UiFileList list); 484 UIEXPORT void ui_filelist_free(UiFileList list);
467 485
468 UIEXPORT void ui_clipboard_set(char *str); 486 UIEXPORT void ui_clipboard_set(char *str);
469 UIEXPORT char* ui_clipboard_get(); 487 UIEXPORT char* ui_clipboard_get();
475 UIEXPORT void ui_set_show_all(UIWIDGET widget, int value); 493 UIEXPORT void ui_set_show_all(UIWIDGET widget, int value);
476 UIEXPORT void ui_set_visible(UIWIDGET widget, int visible); 494 UIEXPORT void ui_set_visible(UIWIDGET widget, int visible);
477 495
478 496
479 497
480 498 UIEXPORT void ui_listselection_free(UiListSelection selection);
481 499
482 UIEXPORT UiIcon* ui_icon(const char* name, size_t size); 500 UIEXPORT UiIcon* ui_icon(const char* name, size_t size);
483 UIEXPORT UiIcon* ui_imageicon(const char* file); 501 UIEXPORT UiIcon* ui_imageicon(const char* file);
484 UIEXPORT void ui_icon_free(UiIcon* icon); 502 UIEXPORT void ui_icon_free(UiIcon* icon);
485 503

mercurial