Merge pull request #199 from aganm/nk_combo_fix

nuklear.h: fix nk_combo return type wrongly changed to nk_bool
This commit is contained in:
dumblob 2020-10-07 11:59:17 +02:00 committed by GitHub
commit d2550448f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 45 deletions

View File

@ -3492,14 +3492,14 @@ NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint of
* COMBOBOX
*
* ============================================================================= */
NK_API nk_bool nk_combo(struct nk_context*, const char **items, int count, nk_bool selected, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox(struct nk_context*, const char **items, int count, nk_bool *selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size);
NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size);
/* =============================================================================
*
* ABSTRACT COMBOBOX
@ -28213,9 +28213,9 @@ nk_color_picker(struct nk_context *ctx, struct nk_colorf color,
* COMBO
*
* ===============================================================*/
NK_INTERN int
NK_INTERN nk_bool
nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
struct nk_vec2 size, int is_clicked, struct nk_rect header)
struct nk_vec2 size, nk_bool is_clicked, struct nk_rect header)
{
struct nk_window *popup;
int is_open = 0;
@ -28856,9 +28856,9 @@ NK_API void nk_combo_close(struct nk_context *ctx)
{
nk_contextual_close(ctx);
}
NK_API nk_bool
NK_API int
nk_combo(struct nk_context *ctx, const char **items, int count,
nk_bool selected, int item_height, struct nk_vec2 size)
int selected, int item_height, struct nk_vec2 size)
{
int i = 0;
int max_height;
@ -28886,9 +28886,9 @@ nk_combo(struct nk_context *ctx, const char **items, int count,
}
return selected;
}
NK_API nk_bool
NK_API int
nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator, nk_bool selected, int count, int item_height, struct nk_vec2 size)
int separator, int selected, int count, int item_height, struct nk_vec2 size)
{
int i;
int max_height;
@ -28935,15 +28935,15 @@ nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separa
}
return selected;
}
NK_API nk_bool
NK_API int
nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros,
nk_bool selected, int count, int item_height, struct nk_vec2 size)
int selected, int count, int item_height, struct nk_vec2 size)
{
return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);
}
NK_API nk_bool
NK_API int
nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**),
void *userdata, nk_bool selected, int count, int item_height, struct nk_vec2 size)
void *userdata, int selected, int count, int item_height, struct nk_vec2 size)
{
int i;
int max_height;
@ -28976,19 +28976,19 @@ nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const c
}
NK_API void
nk_combobox(struct nk_context *ctx, const char **items, int count,
nk_bool *selected, int item_height, struct nk_vec2 size)
int *selected, int item_height, struct nk_vec2 size)
{
*selected = nk_combo(ctx, items, count, *selected, item_height, size);
}
NK_API void
nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
nk_bool *selected, int count, int item_height, struct nk_vec2 size)
int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);
}
NK_API void
nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator,nk_bool *selected, int count, int item_height, struct nk_vec2 size)
int separator, int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
*selected, count, item_height, size);
@ -28996,7 +28996,7 @@ nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_sep
NK_API void
nk_combobox_callback(struct nk_context *ctx,
void(*item_getter)(void* data, int id, const char **out_text),
void *userdata, nk_bool *selected, int count, int item_height, struct nk_vec2 size)
void *userdata, int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);
}
@ -29170,6 +29170,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// - [yy]: Minor version with non-breaking API and library changes
/// - [zz]: Bug fix version with no direct changes to API
///
/// - 2020/10/07 (4.06.0) - Fix nk_combo return type wrongly changed to nk_bool
/// - 2020/09/05 (4.05.0) - Use the nk_font_atlas allocator for stb_truetype memory management.
/// - 2020/09/04 (4.04.1) - Replace every boolean int by nk_bool
/// - 2020/09/04 (4.04.0) - Add nk_bool with NK_INCLUDE_STANDARD_BOOL

View File

@ -1,6 +1,6 @@
{
"name": "nuklear",
"version": "4.05.0",
"version": "4.06.0",
"repo": "Immediate-Mode-UI/Nuklear",
"description": "A small ANSI C gui toolkit",
"keywords": ["gl", "ui", "toolkit"],

View File

@ -8,6 +8,7 @@
/// - [yy]: Minor version with non-breaking API and library changes
/// - [zz]: Bug fix version with no direct changes to API
///
/// - 2020/10/07 (4.06.0) - Fix nk_combo return type wrongly changed to nk_bool
/// - 2020/09/05 (4.05.0) - Use the nk_font_atlas allocator for stb_truetype memory management.
/// - 2020/09/04 (4.04.1) - Replace every boolean int by nk_bool
/// - 2020/09/04 (4.04.0) - Add nk_bool with NK_INCLUDE_STANDARD_BOOL

View File

@ -3271,14 +3271,14 @@ NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint of
* COMBOBOX
*
* ============================================================================= */
NK_API nk_bool nk_combo(struct nk_context*, const char **items, int count, nk_bool selected, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API nk_bool nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, nk_bool selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox(struct nk_context*, const char **items, int count, nk_bool *selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, nk_bool *selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size);
NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int *selected, int count, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size);
/* =============================================================================
*
* ABSTRACT COMBOBOX

View File

@ -6,9 +6,9 @@
* COMBO
*
* ===============================================================*/
NK_INTERN int
NK_INTERN nk_bool
nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
struct nk_vec2 size, int is_clicked, struct nk_rect header)
struct nk_vec2 size, nk_bool is_clicked, struct nk_rect header)
{
struct nk_window *popup;
int is_open = 0;
@ -649,9 +649,9 @@ NK_API void nk_combo_close(struct nk_context *ctx)
{
nk_contextual_close(ctx);
}
NK_API nk_bool
NK_API int
nk_combo(struct nk_context *ctx, const char **items, int count,
nk_bool selected, int item_height, struct nk_vec2 size)
int selected, int item_height, struct nk_vec2 size)
{
int i = 0;
int max_height;
@ -679,9 +679,9 @@ nk_combo(struct nk_context *ctx, const char **items, int count,
}
return selected;
}
NK_API nk_bool
NK_API int
nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator, nk_bool selected, int count, int item_height, struct nk_vec2 size)
int separator, int selected, int count, int item_height, struct nk_vec2 size)
{
int i;
int max_height;
@ -728,15 +728,15 @@ nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separa
}
return selected;
}
NK_API nk_bool
NK_API int
nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros,
nk_bool selected, int count, int item_height, struct nk_vec2 size)
int selected, int count, int item_height, struct nk_vec2 size)
{
return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);
}
NK_API nk_bool
NK_API int
nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**),
void *userdata, nk_bool selected, int count, int item_height, struct nk_vec2 size)
void *userdata, int selected, int count, int item_height, struct nk_vec2 size)
{
int i;
int max_height;
@ -769,19 +769,19 @@ nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const c
}
NK_API void
nk_combobox(struct nk_context *ctx, const char **items, int count,
nk_bool *selected, int item_height, struct nk_vec2 size)
int *selected, int item_height, struct nk_vec2 size)
{
*selected = nk_combo(ctx, items, count, *selected, item_height, size);
}
NK_API void
nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
nk_bool *selected, int count, int item_height, struct nk_vec2 size)
int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);
}
NK_API void
nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator,nk_bool *selected, int count, int item_height, struct nk_vec2 size)
int separator, int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
*selected, count, item_height, size);
@ -789,7 +789,7 @@ nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_sep
NK_API void
nk_combobox_callback(struct nk_context *ctx,
void(*item_getter)(void* data, int id, const char **out_text),
void *userdata, nk_bool *selected, int count, int item_height, struct nk_vec2 size)
void *userdata, int *selected, int count, int item_height, struct nk_vec2 size)
{
*selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);
}