1 2 // Copyright Mateusz Muszyński 2019. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.nuklear.bindstatic; 8 9 version(BindNuklear_Static): 10 11 import bindbc.nuklear.types; 12 13 version (NK_ALL) 14 { 15 version = NK_INCLUDE_FIXED_TYPES; 16 version = NK_INCLUDE_DEFAULT_ALLOCATOR; 17 version = NK_INCLUDE_STANDARD_IO; 18 version = NK_INCLUDE_STANDARD_VARARGS; 19 version = NK_INCLUDE_VERTEX_BUFFER_OUTPUT; 20 version = NK_INCLUDE_FONT_BAKING; 21 version = NK_INCLUDE_DEFAULT_FONT; 22 version = NK_INCLUDE_COMMAND_USERDATA; 23 version = NK_BUTTON_TRIGGER_ON_RELEASE; 24 version = NK_ZERO_COMMAND_MEMORY; 25 version = NK_UINT_DRAW_INDEX; 26 } 27 28 version(NK_INCLUDE_STANDARD_VARARGS) { 29 import core.stdc.stdarg; 30 } 31 32 extern(C) @nogc nothrow { 33 version(NK_INCLUDE_DEFAULT_ALLOCATOR) { 34 int nk_init_default(nk_context*, const(nk_user_font)*); 35 } 36 int nk_init_fixed(nk_context*, void* memory, nk_size size, const(nk_user_font)*); 37 int nk_init(nk_context*, nk_allocator*, const(nk_user_font)*); 38 int nk_init_custom(nk_context*, nk_buffer* cmds, nk_buffer* pool, const(nk_user_font)*); 39 void nk_clear(nk_context*); 40 void nk_free(nk_context*); 41 version(NK_INCLUDE_COMMAND_USERDATA) { 42 void nk_set_user_data(nk_context*, nk_handle handle); 43 } 44 void nk_input_begin(nk_context*); 45 void nk_input_motion(nk_context*, int x, int y); 46 void nk_input_key(nk_context*, nk_keys, int down); 47 void nk_input_button(nk_context*, nk_buttons, int x, int y, int down); 48 void nk_input_scroll(nk_context*, nk_vec2 val); 49 void nk_input_char(nk_context*, char); 50 void nk_input_glyph(nk_context*, const(char)*); 51 void nk_input_unicode(nk_context*, nk_rune); 52 void nk_input_end(nk_context*); 53 const(nk_command)* nk__begin(nk_context*); 54 const(nk_command)* nk__next(nk_context*, const(nk_command)*); 55 version(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) { 56 nk_flags nk_convert(nk_context*, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, const(nk_convert_config)*); 57 const(nk_draw_command)* nk__draw_begin(const(nk_context)*, const(nk_buffer)*); 58 const(nk_draw_command)* nk__draw_end(const(nk_context)*, const(nk_buffer)*); 59 const(nk_draw_command)* nk__draw_next(const(nk_draw_command)*, const(nk_buffer)*, const(nk_context)*); 60 } 61 int nk_begin(nk_context* ctx, const(char)* title, nk_rect bounds, nk_flags flags); 62 int nk_begin_titled(nk_context* ctx, const(char)* name, const(char)* title, nk_rect bounds, nk_flags flags); 63 void nk_end(nk_context* ctx); 64 nk_window* nk_window_find(nk_context* ctx, const(char)* name); 65 nk_rect nk_window_get_bounds(const(nk_context)* ctx); 66 nk_vec2 nk_window_get_position(const(nk_context)* ctx); 67 nk_vec2 nk_window_get_size(const(nk_context)*); 68 float nk_window_get_width(const(nk_context)*); 69 float nk_window_get_height(const(nk_context)*); 70 nk_panel* nk_window_get_panel(nk_context*); 71 nk_rect nk_window_get_content_region(nk_context*); 72 nk_vec2 nk_window_get_content_region_min(nk_context*); 73 nk_vec2 nk_window_get_content_region_max(nk_context*); 74 nk_vec2 nk_window_get_content_region_size(nk_context*); 75 nk_command_buffer* nk_window_get_canvas(nk_context*); 76 void nk_window_get_scroll(nk_context*, nk_uint* offset_x, nk_uint* offset_y); // 4.01.0 77 int nk_window_has_focus(const(nk_context)*); 78 int nk_window_is_hovered(nk_context*); 79 int nk_window_is_collapsed(nk_context* ctx, const(char)* name); 80 int nk_window_is_closed(nk_context*, const(char)*); 81 int nk_window_is_hidden(nk_context*, const(char)*); 82 int nk_window_is_active(nk_context*, const(char)*); 83 int nk_window_is_any_hovered(nk_context*); 84 int nk_item_is_any_active(nk_context*); 85 void nk_window_set_bounds(nk_context*, const(char)* name, nk_rect bounds); 86 void nk_window_set_position(nk_context*, const(char)* name, nk_vec2 pos); 87 void nk_window_set_size(nk_context*, const(char)* name, nk_vec2); 88 void nk_window_set_focus(nk_context*, const(char)* name); 89 void nk_window_set_scroll(nk_context*, nk_uint offset_x, nk_uint offset_y); // 4.01.0 90 void nk_window_close(nk_context* ctx, const(char)* name); 91 void nk_window_collapse(nk_context*, const(char)* name, nk_collapse_states state); 92 void nk_window_collapse_if(nk_context*, const(char)* name, nk_collapse_states, int cond); 93 void nk_window_show(nk_context*, const(char)* name, nk_show_states); 94 void nk_window_show_if(nk_context*, const(char)* name, nk_show_states, int cond); 95 void nk_layout_set_min_row_height(nk_context*, float height); 96 void nk_layout_reset_min_row_height(nk_context*); 97 nk_rect nk_layout_widget_bounds(nk_context*); 98 float nk_layout_ratio_from_pixel(nk_context*, float pixel_width); 99 void nk_layout_row_dynamic(nk_context* ctx, float height, int cols); 100 void nk_layout_row_static(nk_context* ctx, float height, int item_width, int cols); 101 void nk_layout_row_begin(nk_context* ctx, nk_layout_format fmt, float row_height, int cols); 102 void nk_layout_row_push(nk_context*, float value); 103 void nk_layout_row_end(nk_context*); 104 void nk_layout_row(nk_context*, nk_layout_format, float height, int cols, const(float)* ratio); 105 void nk_layout_row_template_begin(nk_context*, float row_height); 106 void nk_layout_row_template_push_dynamic(nk_context*); 107 void nk_layout_row_template_push_variable(nk_context*, float min_width); 108 void nk_layout_row_template_push_static(nk_context*, float width); 109 void nk_layout_row_template_end(nk_context*); 110 void nk_layout_space_begin(nk_context*, nk_layout_format, float height, int widget_count); 111 void nk_layout_space_push(nk_context*, nk_rect bounds); 112 void nk_layout_space_end(nk_context*); 113 nk_rect nk_layout_space_bounds(nk_context*); 114 nk_vec2 nk_layout_space_to_screen(nk_context*, nk_vec2); 115 nk_vec2 nk_layout_space_to_local(nk_context*, nk_vec2); 116 nk_rect nk_layout_space_rect_to_screen(nk_context*, nk_rect); 117 nk_rect nk_layout_space_rect_to_local(nk_context*, nk_rect); 118 int nk_group_begin(nk_context*, const(char)* title, nk_flags); 119 int nk_group_begin_titled(nk_context*, const(char)* name, const(char)* title, nk_flags); 120 void nk_group_end(nk_context*); 121 int nk_group_scrolled_offset_begin(nk_context*, nk_uint* x_offset, nk_uint* y_offset, const(char)* title, nk_flags flags); 122 int nk_group_scrolled_begin(nk_context*, nk_scroll* off, const(char)* title, nk_flags); 123 void nk_group_scrolled_end(nk_context*); 124 void nk_group_get_scroll(nk_context*, const(char)* id, nk_uint *x_offset, nk_uint *y_offset); // 4.01.0 125 void nk_group_set_scroll(nk_context*, const(char)* id, nk_uint x_offset, nk_uint y_offset); // 4.01.0 126 int nk_tree_push_hashed(nk_context*, nk_tree_type, const(char)* title, nk_collapse_states initial_state, const(char)* hash, int len, int seed); 127 int nk_tree_image_push_hashed(nk_context*, nk_tree_type, nk_image, const(char)* title, nk_collapse_states initial_state, const(char)* hash, int len, int seed); 128 void nk_tree_pop(nk_context*); 129 int nk_tree_state_push(nk_context*, nk_tree_type, const(char)* title, nk_collapse_states* state); 130 int nk_tree_state_image_push(nk_context*, nk_tree_type, nk_image, const(char)* title, nk_collapse_states* state); 131 void nk_tree_state_pop(nk_context*); 132 int nk_tree_element_push_hashed(nk_context*, nk_tree_type, const(char)* title, nk_collapse_states initial_state, int* selected, const(char)* hash, int len, int seed); 133 int nk_tree_element_image_push_hashed(nk_context*, nk_tree_type, nk_image, const(char)* title, nk_collapse_states initial_state, int* selected, const(char)* hash, int len, int seed); 134 void nk_tree_element_pop(nk_context*); 135 int nk_list_view_begin(nk_context*, nk_list_view* out_, const(char)* id, nk_flags, int row_height, int row_count); 136 void nk_list_view_end(nk_list_view*); 137 nk_widget_layout_states nk_widget(nk_rect*, const(nk_context)*); 138 nk_widget_layout_states nk_widget_fitting(nk_rect*, nk_context*, nk_vec2); 139 nk_rect nk_widget_bounds(nk_context*); 140 nk_vec2 nk_widget_position(nk_context*); 141 nk_vec2 nk_widget_size(nk_context*); 142 float nk_widget_width(nk_context*); 143 float nk_widget_height(nk_context*); 144 int nk_widget_is_hovered(nk_context*); 145 int nk_widget_is_mouse_clicked(nk_context*, nk_buttons); 146 int nk_widget_has_mouse_click_down(nk_context*, nk_buttons, int down); 147 void nk_spacing(nk_context*, int cols); 148 void nk_text(nk_context*, const(char)*, int, nk_flags); 149 void nk_text_colored(nk_context*, const(char)*, int, nk_flags, nk_color); 150 void nk_text_wrap(nk_context*, const(char)*, int); 151 void nk_text_wrap_colored(nk_context*, const(char)*, int, nk_color); 152 void nk_label(nk_context*, const(char)*, nk_flags align__); 153 void nk_label_colored(nk_context*, const(char)*, nk_flags align__, nk_color); 154 void nk_label_wrap(nk_context*, const(char)*); 155 void nk_label_colored_wrap(nk_context*, const(char)*, nk_color); 156 pragma(mangle, "nk_image") 157 void nk_image_(nk_context*, nk_image); 158 void nk_image_color(nk_context*, nk_image, nk_color); 159 version(NK_INCLUDE_STANDARD_VARARGS) { 160 void nk_labelf(nk_context*, nk_flags, const(char)*, ...); 161 void nk_labelf_colored(nk_context*, nk_flags, nk_color, const(char)*, ...); 162 void nk_labelf_wrap(nk_context*, const(char)*, ...); 163 void nk_labelf_colored_wrap(nk_context*, nk_color, const(char)*, ...); 164 void nk_labelfv(nk_context*, nk_flags, const(char)*, va_list); 165 void nk_labelfv_colored(nk_context*, nk_flags, nk_color, const(char)*, va_list); 166 void nk_labelfv_wrap(nk_context*, const(char)*, va_list); 167 void nk_labelfv_colored_wrap(nk_context*, nk_color, const(char)*, va_list); 168 void nk_value_bool(nk_context*, const(char)* prefix, int); 169 void nk_value_int(nk_context*, const(char)* prefix, int); 170 void nk_value_uint(nk_context*, const(char)* prefix, uint); 171 void nk_value_float(nk_context*, const(char)* prefix, float); 172 void nk_value_color_byte(nk_context*, const(char)* prefix, nk_color); 173 void nk_value_color_float(nk_context*, const(char)* prefix, nk_color); 174 void nk_value_color_hex(nk_context*, const(char)* prefix, nk_color); 175 } 176 int nk_button_text(nk_context*, const(char)* title, int len); 177 int nk_button_label(nk_context*, const(char)* title); 178 int nk_button_color(nk_context*, nk_color); 179 int nk_button_symbol(nk_context*, nk_symbol_type); 180 int nk_button_image(nk_context*, nk_image img); 181 int nk_button_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags text_alignment); 182 int nk_button_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_ment); 183 int nk_button_image_label(nk_context*, nk_image img, const(char)*, nk_flags text_alignment); 184 int nk_button_image_text(nk_context*, nk_image img, const(char)*, int, nk_flags align_ment); 185 int nk_button_text_styled(nk_context*, const(nk_style_button)*, const(char)* title, int len); 186 int nk_button_label_styled(nk_context*, const(nk_style_button)*, const(char)* title); 187 int nk_button_symbol_styled(nk_context*, const(nk_style_button)*, nk_symbol_type); 188 int nk_button_image_styled(nk_context*, const(nk_style_button)*, nk_image img); 189 int nk_button_symbol_text_styled(nk_context*, const(nk_style_button)*, nk_symbol_type, const(char)*, int, nk_flags align_ment); 190 int nk_button_symbol_label_styled(nk_context* ctx, const(nk_style_button)* style, nk_symbol_type symbol, const(char)* title, nk_flags align_); 191 int nk_button_image_label_styled(nk_context*, const(nk_style_button)*, nk_image img, const(char)*, nk_flags text_alignment); 192 int nk_button_image_text_styled(nk_context*, const(nk_style_button)*, nk_image img, const(char)*, int, nk_flags align_ment); 193 void nk_button_set_behavior(nk_context*, nk_button_behavior); 194 int nk_button_push_behavior(nk_context*, nk_button_behavior); 195 int nk_button_pop_behavior(nk_context*); 196 int nk_check_label(nk_context*, const(char)*, int active); 197 int nk_check_text(nk_context*, const(char)*, int, int active); 198 uint nk_check_flags_label(nk_context*, const(char)*, uint flags, uint value); 199 uint nk_check_flags_text(nk_context*, const(char)*, int, uint flags, uint value); 200 int nk_checkbox_label(nk_context*, const(char)*, int* active); 201 int nk_checkbox_text(nk_context*, const(char)*, int, int* active); 202 int nk_checkbox_flags_label(nk_context*, const(char)*, uint* flags, uint value); 203 int nk_checkbox_flags_text(nk_context*, const(char)*, int, uint* flags, uint value); 204 int nk_radio_label(nk_context*, const(char)*, int* active); 205 int nk_radio_text(nk_context*, const(char)*, int, int* active); 206 int nk_option_label(nk_context*, const(char)*, int active); 207 int nk_option_text(nk_context*, const(char)*, int, int active); 208 int nk_selectable_label(nk_context*, const(char)*, nk_flags align_, int* value); 209 int nk_selectable_text(nk_context*, const(char)*, int, nk_flags align_, int* value); 210 int nk_selectable_image_label(nk_context*, nk_image, const(char)*, nk_flags align_, int* value); 211 int nk_selectable_image_text(nk_context*, nk_image, const(char)*, int, nk_flags align_, int* value); 212 int nk_selectable_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags align_, int* value); 213 int nk_selectable_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_, int* value); 214 int nk_select_label(nk_context*, const(char)*, nk_flags align_, int value); 215 int nk_select_text(nk_context*, const(char)*, int, nk_flags align_, int value); 216 int nk_select_image_label(nk_context*, nk_image, const(char)*, nk_flags align_, int value); 217 int nk_select_image_text(nk_context*, nk_image, const(char)*, int, nk_flags align_, int value); 218 int nk_select_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags align_, int value); 219 int nk_select_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_, int value); 220 float nk_slide_float(nk_context*, float min, float val, float max, float step); 221 int nk_slide_int(nk_context*, int min, int val, int max, int step); 222 int nk_slider_float(nk_context*, float min, float* val, float max, float step); 223 int nk_slider_int(nk_context*, int min, int* val, int max, int step); 224 int nk_progress(nk_context*, nk_size* cur, nk_size max, int modifyable); 225 nk_size nk_prog(nk_context*, nk_size cur, nk_size max, int modifyable); 226 nk_colorf nk_color_picker(nk_context*, nk_colorf, nk_color_format); 227 int nk_color_pick(nk_context*, nk_colorf*, nk_color_format); 228 void nk_property_int(nk_context*, const(char)* name, int min, int* val, int max, int step, float inc_per_pixel); 229 void nk_property_float(nk_context*, const(char)* name, float min, float* val, float max, float step, float inc_per_pixel); 230 void nk_property_double(nk_context*, const(char)* name, double min, double* val, double max, double step, float inc_per_pixel); 231 int nk_propertyi(nk_context*, const(char)* name, int min, int val, int max, int step, float inc_per_pixel); 232 float nk_propertyf(nk_context*, const(char)* name, float min, float val, float max, float step, float inc_per_pixel); 233 double nk_propertyd(nk_context*, const(char)* name, double min, double val, double max, double step, float inc_per_pixel); 234 nk_flags nk_edit_string(nk_context*, nk_flags, char* buffer, int* len, int max, nk_plugin_filter); 235 nk_flags nk_edit_string_zero_terminated(nk_context*, nk_flags, char* buffer, int max, nk_plugin_filter); 236 nk_flags nk_edit_buffer(nk_context*, nk_flags, nk_text_edit*, nk_plugin_filter); 237 void nk_edit_focus(nk_context*, nk_flags flags); 238 void nk_edit_unfocus(nk_context*); 239 int nk_chart_begin(nk_context*, nk_chart_type, int num, float min, float max); 240 int nk_chart_begin_colored(nk_context*, nk_chart_type, nk_color, nk_color active, int num, float min, float max); 241 void nk_chart_add_slot(nk_context* ctx, const(nk_chart_type), int count, float min_value, float max_value); 242 void nk_chart_add_slot_colored(nk_context* ctx, const(nk_chart_type), nk_color, nk_color active, int count, float min_value, float max_value); 243 nk_flags nk_chart_push(nk_context*, float); 244 nk_flags nk_chart_push_slot(nk_context*, float, int); 245 void nk_chart_end(nk_context*); 246 void nk_plot(nk_context*, nk_chart_type, const(float)* values, int count, int offset); 247 void nk_plot_function(nk_context*, nk_chart_type, void *userdata, float function(void* user, int index), int count, int offset); 248 int nk_popup_begin(nk_context*, nk_popup_type, const(char)*, nk_flags, nk_rect bounds); 249 void nk_popup_close(nk_context*); 250 void nk_popup_end(nk_context*); 251 void nk_popup_get_scroll(nk_context*, nk_uint *offset_x, nk_uint *offset_y); // 4.01.0 252 void nk_popup_set_scroll(nk_context*, nk_uint offset_x, nk_uint offset_y); // 4.01.0 253 int nk_combo(nk_context*, const(char)** items, int count, int selected, int item_height, nk_vec2 size); 254 int nk_combo_separator(nk_context*, const(char)* items_separated_by_separator, int separator, int selected, int count, int item_height, nk_vec2 size); 255 int nk_combo_string(nk_context*, const(char)* items_separated_by_zeros, int selected, int count, int item_height, nk_vec2 size); 256 int nk_combo_callback(nk_context*, void function(void*, int, const(char) **), void *userdata, int selected, int count, int item_height, nk_vec2 size); 257 void nk_combobox(nk_context*, const(char)** items, int count, int* selected, int item_height, nk_vec2 size); 258 void nk_combobox_string(nk_context*, const(char)* items_separated_by_zeros, int* selected, int count, int item_height, nk_vec2 size); 259 void nk_combobox_separator(nk_context*, const(char)* items_separated_by_separator, int separator, int* selected, int count, int item_height, nk_vec2 size); 260 void nk_combobox_callback(nk_context*, void function(void*, int, const(char) **), void*, int *selected, int count, int item_height, nk_vec2 size); 261 int nk_combo_begin_text(nk_context*, const(char)* selected, int, nk_vec2 size); 262 int nk_combo_begin_label(nk_context*, const(char)* selected, nk_vec2 size); 263 int nk_combo_begin_color(nk_context*, nk_color color, nk_vec2 size); 264 int nk_combo_begin_symbol(nk_context*, nk_symbol_type, nk_vec2 size); 265 int nk_combo_begin_symbol_label(nk_context*, const(char)* selected, nk_symbol_type, nk_vec2 size); 266 int nk_combo_begin_symbol_text(nk_context*, const(char)* selected, int, nk_symbol_type, nk_vec2 size); 267 int nk_combo_begin_image(nk_context*, nk_image img, nk_vec2 size); 268 int nk_combo_begin_image_label(nk_context*, const(char)* selected, nk_image, nk_vec2 size); 269 int nk_combo_begin_image_text(nk_context*, const(char)* selected, int, nk_image, nk_vec2 size); 270 int nk_combo_item_label(nk_context*, const(char)*, nk_flags align_ment); 271 int nk_combo_item_text(nk_context*, const(char)*, int, nk_flags align_ment); 272 int nk_combo_item_image_label(nk_context*, nk_image, const(char)*, nk_flags align_ment); 273 int nk_combo_item_image_text(nk_context*, nk_image, const(char)*, int, nk_flags align_ment); 274 int nk_combo_item_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags align_ment); 275 int nk_combo_item_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_ment); 276 void nk_combo_close(nk_context*); 277 void nk_combo_end(nk_context*); 278 int nk_contextual_begin(nk_context*, nk_flags, nk_vec2, nk_rect trigger_bounds); 279 int nk_contextual_item_text(nk_context*, const(char)*, int, nk_flags align_); 280 int nk_contextual_item_label(nk_context*, const(char)*, nk_flags align_); 281 int nk_contextual_item_image_label(nk_context*, nk_image, const(char)*, nk_flags align_ment); 282 int nk_contextual_item_image_text(nk_context*, nk_image, const(char)*, int len, nk_flags align_ment); 283 int nk_contextual_item_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags align_ment); 284 int nk_contextual_item_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_ment); 285 void nk_contextual_close(nk_context*); 286 void nk_contextual_end(nk_context*); 287 void nk_tooltip(nk_context*, const(char)*); 288 version(NK_INCLUDE_STANDARD_VARARGS) { 289 void nk_tooltipf(nk_context*, const(char)*, ...); 290 void nk_tooltipfv(nk_context*, const(char)*, va_list); 291 } 292 int nk_tooltip_begin(nk_context*, float width); 293 void nk_tooltip_end(nk_context*); 294 void nk_menubar_begin(nk_context*); 295 void nk_menubar_end(nk_context*); 296 int nk_menu_begin_text(nk_context*, const(char)* title, int title_len, nk_flags align_, nk_vec2 size); 297 int nk_menu_begin_label(nk_context*, const(char)*, nk_flags align_, nk_vec2 size); 298 int nk_menu_begin_image(nk_context*, const(char)*, nk_image, nk_vec2 size); 299 int nk_menu_begin_image_text(nk_context*, const(char)*, int, nk_flags align_, nk_image, nk_vec2 size); 300 int nk_menu_begin_image_label(nk_context*, const(char)*, nk_flags align_, nk_image, nk_vec2 size); 301 int nk_menu_begin_symbol(nk_context*, const(char)*, nk_symbol_type, nk_vec2 size); 302 int nk_menu_begin_symbol_text(nk_context*, const(char)*, int, nk_flags align_, nk_symbol_type, nk_vec2 size); 303 int nk_menu_begin_symbol_label(nk_context*, const(char)*, nk_flags align_, nk_symbol_type, nk_vec2 size); 304 int nk_menu_item_text(nk_context*, const(char)*, int, nk_flags align_); 305 int nk_menu_item_label(nk_context*, const(char)*, nk_flags align_ment); 306 int nk_menu_item_image_label(nk_context*, nk_image, const(char)*, nk_flags align_ment); 307 int nk_menu_item_image_text(nk_context*, nk_image, const(char)*, int len, nk_flags align_ment); 308 int nk_menu_item_symbol_text(nk_context*, nk_symbol_type, const(char)*, int, nk_flags align_ment); 309 int nk_menu_item_symbol_label(nk_context*, nk_symbol_type, const(char)*, nk_flags align_ment); 310 void nk_menu_close(nk_context*); 311 void nk_menu_end(nk_context*); 312 void nk_style_default(nk_context*); 313 void nk_style_from_table(nk_context*, const(nk_color)*); 314 void nk_style_load_cursor(nk_context*, nk_style_cursor, const(nk_cursor)*); 315 void nk_style_load_all_cursors(nk_context*, nk_cursor*); 316 const(char)* nk_style_get_color_by_name(nk_style_colors); 317 void nk_style_set_font(nk_context*, const(nk_user_font)*); 318 int nk_style_set_cursor(nk_context*, nk_style_cursor); 319 void nk_style_show_cursor(nk_context*); 320 void nk_style_hide_cursor(nk_context*); 321 int nk_style_push_font(nk_context*, const(nk_user_font)*); 322 int nk_style_push_float(nk_context*, float*, float); 323 int nk_style_push_vec2(nk_context*, nk_vec2*, nk_vec2); 324 int nk_style_push_style_item(nk_context*, nk_style_item*, nk_style_item); 325 int nk_style_push_flags(nk_context*, nk_flags*, nk_flags); 326 int nk_style_push_color(nk_context*, nk_color*, nk_color); 327 int nk_style_pop_font(nk_context*); 328 int nk_style_pop_float(nk_context*); 329 int nk_style_pop_vec2(nk_context*); 330 int nk_style_pop_style_item(nk_context*); 331 int nk_style_pop_flags(nk_context*); 332 int nk_style_pop_color(nk_context*); 333 nk_color nk_rgb(int r, int g, int b); 334 nk_color nk_rgb_iv(const(int)* rgb); 335 nk_color nk_rgb_bv(const(nk_byte)* rgb); 336 nk_color nk_rgb_f(float r, float g, float b); 337 nk_color nk_rgb_fv(const(float)* rgb); 338 nk_color nk_rgb_cf(nk_colorf c); 339 nk_color nk_rgb_hex(const(char)* rgb); 340 nk_color nk_rgba(int r, int g, int b, int a); 341 nk_color nk_rgba_u32(nk_uint); 342 nk_color nk_rgba_iv(const(int)* rgba); 343 nk_color nk_rgba_bv(const(nk_byte)* rgba); 344 nk_color nk_rgba_f(float r, float g, float b, float a); 345 nk_color nk_rgba_fv(const(float)* rgba); 346 nk_color nk_rgba_cf(nk_colorf c); 347 nk_color nk_rgba_hex(const(char)* rgb); 348 nk_colorf nk_hsva_colorf(float h, float s, float v, float a); 349 nk_colorf nk_hsva_colorfv(float* c); 350 void nk_colorf_hsva_f(float* out_h, float* out_s, float* out_v, float* out_a, nk_colorf in_); 351 void nk_colorf_hsva_fv(float* hsva, nk_colorf in_); 352 nk_color nk_hsv(int h, int s, int v); 353 nk_color nk_hsv_iv(const(int)* hsv); 354 nk_color nk_hsv_bv(const(nk_byte)* hsv); 355 nk_color nk_hsv_f(float h, float s, float v); 356 nk_color nk_hsv_fv(const(float)* hsv); 357 nk_color nk_hsva(int h, int s, int v, int a); 358 nk_color nk_hsva_iv(const(int)* hsva); 359 nk_color nk_hsva_bv(const(nk_byte)* hsva); 360 nk_color nk_hsva_f(float h, float s, float v, float a); 361 nk_color nk_hsva_fv(const(float)* hsva); 362 void nk_color_f(float* r, float* g, float* b, float* a, nk_color); 363 void nk_color_fv(float* rgba_out, nk_color); 364 nk_colorf nk_color_cf(nk_color); 365 void nk_color_d(double* r, double* g, double* b, double* a, nk_color); 366 void nk_color_dv(double* rgba_out, nk_color); 367 nk_uint nk_color_u32(nk_color); 368 void nk_color_hex_rgba(char* output, nk_color); 369 void nk_color_hex_rgb(char* output, nk_color); 370 void nk_color_hsv_i(int* out_h, int* out_s, int* out_v, nk_color); 371 void nk_color_hsv_b(nk_byte* out_h, nk_byte* out_s, nk_byte* out_v, nk_color); 372 void nk_color_hsv_iv(int* hsv_out, nk_color); 373 void nk_color_hsv_bv(nk_byte* hsv_out, nk_color); 374 void nk_color_hsv_f(float* out_h, float* out_s, float* out_v, nk_color); 375 void nk_color_hsv_fv(float* hsv_out, nk_color); 376 void nk_color_hsva_i(int* h, int* s, int* v, int* a, nk_color); 377 void nk_color_hsva_b(nk_byte* h, nk_byte* s, nk_byte* v, nk_byte* a, nk_color); 378 void nk_color_hsva_iv(int* hsva_out, nk_color); 379 void nk_color_hsva_bv(nk_byte* hsva_out, nk_color); 380 void nk_color_hsva_f(float* out_h, float* out_s, float* out_v, float* out_a, nk_color); 381 void nk_color_hsva_fv(float* hsva_out, nk_color); 382 nk_handle nk_handle_ptr(void*); 383 nk_handle nk_handle_id(int); 384 nk_image nk_image_handle(nk_handle); 385 nk_image nk_image_ptr(void*); 386 nk_image nk_image_id(int); 387 int nk_image_is_subimage(const(nk_image)* img); 388 nk_image nk_subimage_ptr(void*, ushort w, ushort h, nk_rect sub_region); 389 nk_image nk_subimage_id(int, ushort w, ushort h, nk_rect sub_region); 390 nk_image nk_subimage_handle(nk_handle, ushort w, ushort h, nk_rect sub_region); 391 nk_hash nk_murmur_hash(const(void)* key, int len, nk_hash seed); 392 void nk_triangle_from_direction(nk_vec2* result, nk_rect r, float pad_x, float pad_y, nk_heading); 393 pragma(mangle, "nk_vec2") 394 nk_vec2 nk_vec2_(float x, float y); 395 pragma(mangle, "nk_vec2i") 396 nk_vec2 nk_vec2i_(int x, int y); 397 nk_vec2 nk_vec2v(const(float)* xy); 398 nk_vec2 nk_vec2iv(const(int)* xy); 399 nk_rect nk_get_null_rect(); 400 pragma(mangle, "nk_rect") 401 nk_rect nk_rect_(float x, float y, float w, float h); 402 nk_rect nk_recti(int x, int y, int w, int h); 403 nk_rect nk_recta(nk_vec2 pos, nk_vec2 size); 404 nk_rect nk_rectv(const(float)* xywh); 405 nk_rect nk_rectiv(const(int)* xywh); 406 nk_vec2 nk_rect_pos(nk_rect); 407 nk_vec2 nk_rect_size(nk_rect); 408 int nk_strlen(const(char)* str); 409 int nk_stricmp(const(char)* s1, const(char)* s2); 410 int nk_stricmpn(const(char)* s1, const(char)* s2, int n); 411 int nk_strtoi(const(char)* str, const(char)** endptr); 412 float nk_strtof(const(char)* str, const(char)** endptr); 413 double nk_strtod(const(char)* str, const(char)** endptr); 414 int nk_strfilter(const(char)* text, const(char)* regexp); 415 int nk_strmatch_fuzzy_string(const(char)* str, const(char)* pattern, int* out_score); 416 int nk_strmatch_fuzzy_text(const(char)* txt, int txt_len, const(char)* pattern, int* out_score); 417 int nk_utf_decode(const(char)*, nk_rune*, int); 418 int nk_utf_encode(nk_rune, char*, int); 419 int nk_utf_len(const(char)*, int byte_len); 420 const(char)* nk_utf_at(const(char)* buffer, int length, int index, nk_rune* unicode, int* len); 421 version(NK_INCLUDE_FONT_BAKING) { 422 const(nk_rune)* nk_font_default_glyph_ranges(); 423 const(nk_rune)* nk_font_chinese_glyph_ranges(); 424 const(nk_rune)* nk_font_cyrillic_glyph_ranges(); 425 const(nk_rune)* nk_font_korean_glyph_ranges(); 426 version(NK_INCLUDE_DEFAULT_ALLOCATOR) { 427 void nk_font_atlas_init_default(nk_font_atlas*); 428 } 429 void nk_font_atlas_init(nk_font_atlas*, nk_allocator*); 430 void nk_font_atlas_init_custom(nk_font_atlas*, nk_allocator* persistent, nk_allocator* transient); 431 void nk_font_atlas_begin(nk_font_atlas*); 432 pragma(mangle, "nk_font_config") 433 nk_font_config nk_font_config_(float pixel_height); 434 nk_font* nk_font_atlas_add(nk_font_atlas*, const(nk_font_config)*); 435 version(NK_INCLUDE_DEFAULT_FONT) { 436 nk_font* nk_font_atlas_add_default(nk_font_atlas*, float height, const(nk_font_config)*); 437 } 438 nk_font* nk_font_atlas_add_from_memory(nk_font_atlas* atlas, void* memory, nk_size size, float height, const(nk_font_config)* config); 439 version(NK_INCLUDE_STANDARD_IO) { 440 nk_font* nk_font_atlas_add_from_file(nk_font_atlas* atlas, const(char)* file_path, float height, const(nk_font_config)*); 441 } 442 nk_font* nk_font_atlas_add_compressed(nk_font_atlas*, void* memory, nk_size size, float height, const(nk_font_config)*); 443 nk_font* nk_font_atlas_add_compressed_base85(nk_font_atlas*, const(char)* data, float height, const(nk_font_config)* config); 444 const(void)* nk_font_atlas_bake(nk_font_atlas*, int* width, int* height, nk_font_atlas_format); 445 void nk_font_atlas_end(nk_font_atlas*, nk_handle tex, nk_draw_null_texture*); 446 const(nk_font_glyph)* nk_font_find_glyph(nk_font*, nk_rune unicode); 447 void nk_font_atlas_cleanup(nk_font_atlas* atlas); 448 void nk_font_atlas_clear(nk_font_atlas*); 449 } 450 version(NK_INCLUDE_DEFAULT_ALLOCATOR) { 451 void nk_buffer_init_default(nk_buffer*); 452 } 453 void nk_buffer_init(nk_buffer*, const(nk_allocator)*, nk_size size); 454 void nk_buffer_init_fixed(nk_buffer*, void* memory, nk_size size); 455 void nk_buffer_info(nk_memory_status*, nk_buffer*); 456 void nk_buffer_push(nk_buffer*, nk_buffer_allocation_type type, const(void)* memory, nk_size size, nk_size align_); 457 void nk_buffer_mark(nk_buffer*, nk_buffer_allocation_type type); 458 void nk_buffer_reset(nk_buffer*, nk_buffer_allocation_type type); 459 void nk_buffer_clear(nk_buffer*); 460 void nk_buffer_free(nk_buffer*); 461 void* nk_buffer_memory(nk_buffer*); 462 const(void)* nk_buffer_memory_const(const(nk_buffer)*); 463 nk_size nk_buffer_total(nk_buffer*); 464 version(NK_INCLUDE_DEFAULT_ALLOCATOR) { 465 void nk_str_init_default(nk_str*); 466 } 467 void nk_str_init(nk_str*, const(nk_allocator)*, nk_size size); 468 void nk_str_init_fixed(nk_str*, void* memory, nk_size size); 469 void nk_str_clear(nk_str*); 470 void nk_str_free(nk_str*); 471 int nk_str_append_text_char(nk_str*, const(char)*, int); 472 int nk_str_append_str_char(nk_str*, const(char)*); 473 int nk_str_append_text_utf8(nk_str*, const(char)*, int); 474 int nk_str_append_str_utf8(nk_str*, const(char)*); 475 int nk_str_append_text_runes(nk_str*, const(nk_rune)*, int); 476 int nk_str_append_str_runes(nk_str*, const(nk_rune)*); 477 int nk_str_insert_at_char(nk_str*, int pos, const(char)*, int); 478 int nk_str_insert_at_rune(nk_str*, int pos, const(char)*, int); 479 int nk_str_insert_text_char(nk_str*, int pos, const(char)*, int); 480 int nk_str_insert_str_char(nk_str*, int pos, const(char)*); 481 int nk_str_insert_text_utf8(nk_str*, int pos, const(char)*, int); 482 int nk_str_insert_str_utf8(nk_str*, int pos, const(char)*); 483 int nk_str_insert_text_runes(nk_str*, int pos, const(nk_rune)*, int); 484 int nk_str_insert_str_runes(nk_str*, int pos, const(nk_rune)*); 485 void nk_str_remove_chars(nk_str*, int len); 486 void nk_str_remove_runes(nk_str* str, int len); 487 void nk_str_delete_chars(nk_str*, int pos, int len); 488 void nk_str_delete_runes(nk_str*, int pos, int len); 489 char* nk_str_at_char(nk_str*, int pos); 490 char* nk_str_at_rune(nk_str*, int pos, nk_rune* unicode, int* len); 491 nk_rune nk_str_rune_at(const(nk_str)*, int pos); 492 const(char)* nk_str_at_char_const(const(nk_str)*, int pos); 493 const(char)* nk_str_at_const(const(nk_str)*, int pos, nk_rune* unicode, int* len); 494 char* nk_str_get(nk_str*); 495 const(char)* nk_str_get_const(const(nk_str)*); 496 int nk_str_len(nk_str*); 497 int nk_str_len_char(nk_str*); 498 int nk_filter_default(const(nk_text_edit)*, nk_rune unicode); 499 int nk_filter_ascii(const(nk_text_edit)*, nk_rune unicode); 500 int nk_filter_float(const(nk_text_edit)*, nk_rune unicode); 501 int nk_filter_decimal(const(nk_text_edit)*, nk_rune unicode); 502 int nk_filter_hex(const(nk_text_edit)*, nk_rune unicode); 503 int nk_filter_oct(const(nk_text_edit)*, nk_rune unicode); 504 int nk_filter_binary(const(nk_text_edit)*, nk_rune unicode); 505 506 auto nk_filter_default_fptr = &nk_filter_default; 507 auto nk_filter_ascii_fptr = &nk_filter_ascii; 508 auto nk_filter_float_fptr = &nk_filter_float; 509 auto nk_filter_decimal_fptr = &nk_filter_decimal; 510 auto nk_filter_hex_fptr = &nk_filter_hex; 511 auto nk_filter_oct_fptr = &nk_filter_oct; 512 auto nk_filter_binary_fptr = &nk_filter_binary; 513 514 version(NK_INCLUDE_DEFAULT_ALLOCATOR) { 515 void nk_textedit_init_default(nk_text_edit*); 516 } 517 void nk_textedit_init(nk_text_edit*, nk_allocator*, nk_size size); 518 void nk_textedit_init_fixed(nk_text_edit*, void* memory, nk_size size); 519 void nk_textedit_free(nk_text_edit*); 520 void nk_textedit_text(nk_text_edit*, const(char)*, int total_len); 521 void nk_textedit_delete(nk_text_edit*, int where, int len); 522 void nk_textedit_delete_selection(nk_text_edit*); 523 void nk_textedit_select_all(nk_text_edit*); 524 int nk_textedit_cut(nk_text_edit*); 525 int nk_textedit_paste(nk_text_edit*, const(char)*, int len); 526 void nk_textedit_undo(nk_text_edit*); 527 void nk_textedit_redo(nk_text_edit*); 528 void nk_stroke_line(nk_command_buffer* b, float x0, float y0, float x1, float y1, float line_thickness, nk_color); 529 void nk_stroke_curve(nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, nk_color); 530 void nk_stroke_rect(nk_command_buffer*, nk_rect, float rounding, float line_thickness, nk_color); 531 void nk_stroke_circle(nk_command_buffer*, nk_rect, float line_thickness, nk_color); 532 void nk_stroke_arc(nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, nk_color); 533 void nk_stroke_triangle(nk_command_buffer*, float, float, float, float, float, float, float line_thichness, nk_color); 534 void nk_stroke_polyline(nk_command_buffer*, float* points, int point_count, float line_thickness, nk_color col); 535 void nk_stroke_polygon(nk_command_buffer*, float*, int point_count, float line_thickness, nk_color); 536 void nk_fill_rect(nk_command_buffer*, nk_rect, float rounding, nk_color); 537 void nk_fill_rect_multi_color(nk_command_buffer*, nk_rect, nk_color left, nk_color top, nk_color right, nk_color bottom); 538 void nk_fill_circle(nk_command_buffer*, nk_rect, nk_color); 539 void nk_fill_arc(nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, nk_color); 540 void nk_fill_triangle(nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, nk_color); 541 void nk_fill_polygon(nk_command_buffer*, float*, int point_count, nk_color); 542 void nk_draw_image(nk_command_buffer*, nk_rect, const(nk_image)*, nk_color); 543 void nk_draw_text(nk_command_buffer*, nk_rect, const(char)* text, int len, const(nk_user_font)*, nk_color, nk_color); 544 void nk_push_scissor(nk_command_buffer*, nk_rect); 545 void nk_push_custom(nk_command_buffer*, nk_rect, nk_command_custom_callback, nk_handle usr); 546 int nk_input_has_mouse_click(const(nk_input)*, nk_buttons); 547 int nk_input_has_mouse_click_in_rect(const(nk_input)*, nk_buttons, nk_rect); 548 int nk_input_has_mouse_click_down_in_rect(const(nk_input)*, nk_buttons, nk_rect, int down); 549 int nk_input_is_mouse_click_in_rect(const(nk_input)*, nk_buttons, nk_rect); 550 int nk_input_is_mouse_click_down_in_rect(const(nk_input)* i, nk_buttons id, nk_rect b, int down); 551 int nk_input_any_mouse_click_in_rect(const(nk_input)*, nk_rect); 552 int nk_input_is_mouse_prev_hovering_rect(const(nk_input)*, nk_rect); 553 int nk_input_is_mouse_hovering_rect(const(nk_input)*, nk_rect); 554 int nk_input_mouse_clicked(const(nk_input)*, nk_buttons, nk_rect); 555 int nk_input_is_mouse_down(const(nk_input)*, nk_buttons); 556 int nk_input_is_mouse_pressed(const(nk_input)*, nk_buttons); 557 int nk_input_is_mouse_released(const(nk_input)*, nk_buttons); 558 int nk_input_is_key_pressed(const(nk_input)*, nk_keys); 559 int nk_input_is_key_released(const(nk_input)*, nk_keys); 560 int nk_input_is_key_down(const(nk_input)*, nk_keys); 561 version(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) { 562 void nk_draw_list_init(nk_draw_list*); 563 void nk_draw_list_setup(nk_draw_list*, const(nk_convert_config)*, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, nk_anti_aliasing line_aa, nk_anti_aliasing shape_aa); 564 const(nk_draw_command)* nk__draw_list_begin(const(nk_draw_list)*, const(nk_buffer)*); 565 const(nk_draw_command)* nk__draw_list_next(const(nk_draw_command)*, const(nk_buffer)*, const(nk_draw_list)*); 566 const(nk_draw_command)* nk__draw_list_end(const(nk_draw_list)*, const(nk_buffer)*); 567 void nk_draw_list_path_clear(nk_draw_list*); 568 void nk_draw_list_path_line_to(nk_draw_list*, nk_vec2 pos); 569 void nk_draw_list_path_arc_to_fast(nk_draw_list*, nk_vec2 center, float radius, int a_min, int a_max); 570 void nk_draw_list_path_arc_to(nk_draw_list*, nk_vec2 center, float radius, float a_min, float a_max, uint segments); 571 void nk_draw_list_path_rect_to(nk_draw_list*, nk_vec2 a, nk_vec2 b, float rounding); 572 void nk_draw_list_path_curve_to(nk_draw_list*, nk_vec2 p2, nk_vec2 p3, nk_vec2 p4, uint num_segments); 573 void nk_draw_list_path_fill(nk_draw_list*, nk_color); 574 void nk_draw_list_path_stroke(nk_draw_list*, nk_color, nk_draw_list_stroke closed, float thickness); 575 void nk_draw_list_stroke_line(nk_draw_list*, nk_vec2 a, nk_vec2 b, nk_color, float thickness); 576 void nk_draw_list_stroke_rect(nk_draw_list*, nk_rect rect, nk_color, float rounding, float thickness); 577 void nk_draw_list_stroke_triangle(nk_draw_list*, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color, float thickness); 578 void nk_draw_list_stroke_circle(nk_draw_list*, nk_vec2 center, float radius, nk_color, uint segs, float thickness); 579 void nk_draw_list_stroke_curve(nk_draw_list*, nk_vec2 p0, nk_vec2 cp0, nk_vec2 cp1, nk_vec2 p1, nk_color, uint segments, float thickness); 580 void nk_draw_list_stroke_poly_line(nk_draw_list*, const(nk_vec2)* pnts, const(uint) cnt, nk_color, nk_draw_list_stroke, float thickness, nk_anti_aliasing); 581 void nk_draw_list_fill_rect(nk_draw_list*, nk_rect rect, nk_color, float rounding); 582 void nk_draw_list_fill_rect_multi_color(nk_draw_list*, nk_rect rect, nk_color left, nk_color top, nk_color right, nk_color bottom); 583 void nk_draw_list_fill_triangle(nk_draw_list*, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color); 584 void nk_draw_list_fill_circle(nk_draw_list*, nk_vec2 center, float radius, nk_color col, uint segs); 585 void nk_draw_list_fill_poly_convex(nk_draw_list*, const(nk_vec2)* points, const(uint) count, nk_color, nk_anti_aliasing); 586 void nk_draw_list_add_image(nk_draw_list*, nk_image texture, nk_rect rect, nk_color); 587 void nk_draw_list_add_text(nk_draw_list*, const(nk_user_font)*, nk_rect, const(char)* text, int len, float font_height, nk_color); 588 version(NK_INCLUDE_COMMAND_USERDATA) { 589 void nk_draw_list_push_userdata(nk_draw_list*, nk_handle userdata); 590 } 591 } 592 nk_style_item nk_style_item_image(nk_image img); 593 nk_style_item nk_style_item_color(nk_color); 594 nk_style_item nk_style_item_hide(); 595 }