UNIXworkcode

1 /* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 * 4 * Copyright 2025 Olaf Wintermann. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #ifndef UIC_WRAPPER_H 30 #define UIC_WRAPPER_H 31 32 #include "../ui/toolkit.h" 33 #include "../ui/list.h" 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 UIEXPORT UiContext* ui_object_get_context(UiObject *obj); 40 UIEXPORT void* ui_object_get_windowdata(UiObject *obj); 41 UIEXPORT void ui_object_set_windowdata(UiObject *obj, void *windowdata); 42 43 UIEXPORT void* ui_list_get_data(UiList *list); 44 UIEXPORT void* ui_list_get_iter(UiList *list); 45 UIEXPORT void ui_list_set_iter(UiList *list, void *iter); 46 47 UIEXPORT UiSubList* ui_sublist_new(void); 48 UIEXPORT void ui_sublist_set_value(UiSubList *sublist, UiList *value); 49 UIEXPORT void ui_sublist_set_varname(UiSubList *sublist, const char *varname); 50 UIEXPORT void ui_sublist_set_header(UiSubList *sublist, const char *header); 51 UIEXPORT void ui_sublist_set_separator(UiSubList *sublist, UiBool separator); 52 UIEXPORT void ui_sublist_set_userdata(UiSubList *sublist, void *userdata); 53 UIEXPORT void ui_sublist_free(UiSubList *sublist); 54 55 UIEXPORT UiList* ui_srclist_new(UiContext *ctx, const char *name); 56 UIEXPORT void ui_srclist_add(UiList *list, UiSubList *item); 57 UIEXPORT void ui_srclist_insert(UiList *list, int index, UiSubList *item); 58 UIEXPORT void ui_srclist_remove(UiList *list, int index); 59 UIEXPORT void ui_srclist_swap(UiList *list, int i1, int i2); 60 UIEXPORT void ui_srclist_clear(UiList *list); 61 UIEXPORT int ui_srclist_size(UiList *list); 62 UIEXPORT void ui_srclist_generate_sublist_num_data(UiList *list); 63 64 UIEXPORT UiList* ui_sublist_event_get_list(UiSubListEventData *event); 65 UIEXPORT int ui_sublist_event_get_sublist_index(UiSubListEventData *event); 66 UIEXPORT int ui_sublist_event_get_row_index(UiSubListEventData *event); 67 UIEXPORT void* ui_sublist_event_get_row_data(UiSubListEventData *event); 68 UIEXPORT void* ui_sublist_event_get_sublist_userdata(UiSubListEventData *event); 69 UIEXPORT void* ui_sublist_event_get_event_data(UiSubListEventData *event); 70 71 UIEXPORT UiObject* ui_event_get_obj(UiEvent *event); 72 UIEXPORT void* ui_event_get_document(UiEvent *event); 73 UIEXPORT void* ui_event_get_windowdata(UiEvent *event); 74 UIEXPORT void* ui_event_get_eventdata(UiEvent *event); 75 UIEXPORT int ui_event_get_eventdatatype(UiEvent *event); 76 UIEXPORT int ui_event_get_int(UiEvent *event); 77 UIEXPORT int ui_event_get_set(UiEvent *event); 78 79 UIEXPORT UiListSelection* ui_list_get_selection_allocated(UiList *list); 80 UIEXPORT int ui_list_selection_get_count(UiListSelection *sel); 81 UIEXPORT int* ui_list_selection_get_rows(UiListSelection *sel); 82 UIEXPORT void ui_list_set_selected_indices(UiList *list, int *indices, int num); 83 UIEXPORT void ui_list_selection_free(UiListSelection *sel); 84 85 UIEXPORT int ui_filelist_count(UiFileList *flist); 86 UIEXPORT char* ui_filelist_get(UiFileList *flist, int index); 87 88 UIEXPORT void ui_textstyle_set_bold(UiTextStyle *style, UiBool set); 89 UIEXPORT void ui_textstyle_set_underline(UiTextStyle *style, UiBool set); 90 UIEXPORT void ui_textstyle_set_italic(UiTextStyle *style, UiBool set); 91 UIEXPORT void ui_textstyle_set_color(UiTextStyle *style, int r, int g, int b); 92 UIEXPORT void ui_textstyle_enable_color(UiTextStyle *style, UiBool enable); 93 94 UIEXPORT UiBool ui_cell_value_is_string(UiCellValue *value); 95 UIEXPORT UiBool ui_cell_value_is_int(UiCellValue *value); 96 UIEXPORT const char* ui_cell_value_get_string(UiCellValue *value); 97 UIEXPORT int64_t ui_cell_value_get_int(UiCellValue *value); 98 99 100 #ifdef __cplusplus 101 } 102 #endif 103 104 #endif /* UIC_WRAPPER_H */ 105 106