diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/Context.html b/Context.html new file mode 100644 index 000000000..62f973358 --- /dev/null +++ b/Context.html @@ -0,0 +1,141 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

Contexts are the main entry point and the majestro of nuklear and contain all required state.

+

They are used for window, memory, input, style, stack, commands and time management and need to be passed into all nuklear GUI specific functions.

+

+Usage

+

To use a context it first has to be initialized which can be achieved by calling one of either nk_init_default, nk_init_fixed, nk_init, nk_init_custom. Each takes in a font handle and a specific way of handling memory. Memory control hereby ranges from standard library to just specifying a fixed sized block of memory which nuklear has to manage itself from.

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
// [...]
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+ +

+Reference

+ + + + + + + + + + + + + + + + + +
Function Description
nk_init_default Initializes context with standard library memory allocation (malloc,free)
nk_init_fixed Initializes context from single fixed size memory block
nk_init Initializes context with memory allocator callbacks for alloc and free
nk_init_custom Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
nk_clear Called at the end of the frame to reset and prepare the context for the next frame
nk_free Shutdown and free all memory allocated inside the context
nk_set_user_data Utility function to pass user data to draw command
+
+
+
+ + + + diff --git a/Drawing.html b/Drawing.html new file mode 100644 index 000000000..988d45ab1 --- /dev/null +++ b/Drawing.html @@ -0,0 +1,340 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

This library was designed to be render backend agnostic so it does not draw anything to screen.

+

=============================================================================

+
                            DRAWING
+

=============================================================================

+

This library was designed to be render backend agnostic so it does not draw anything to screen directly. Instead all drawn shapes, widgets are made of, are buffered into memory and make up a command queue. Each frame therefore fills the command buffer with draw commands that then need to be executed by the user and his own render backend. After that the command buffer needs to be cleared and a new frame can be started. It is probably important to note that the command buffer is the main drawing API and the optional vertex buffer API only takes this format and converts it into a hardware accessible format.

+

+Usage

+

To draw all draw commands accumulated over a frame you need your own render backend able to draw a number of 2D primitives. This includes at least filled and stroked rectangles, circles, text, lines, triangles and scissors. As soon as this criterion is met you can iterate over each draw command and execute each draw command in a interpreter like fashion:

+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case //...:
+
//[...]
+
}
+
}
+
#define nk_foreach(c, ctx)
Iterates over each draw command inside the context draw command list.
Definition: nuklear.h:1031
+
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+

In program flow context draw commands need to be executed after input has been gathered and the complete UI with windows and their contained widgets have been executed and before calling nk_clear which frees all previously allocated draw commands.

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
Event evt;
+ +
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
[...]
+
}
+
}
+
nk_input_end(&ctx);
+
//
+
// [...]
+
//
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case ...:
+
// [...]
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+ +

You probably noticed that you have to draw all of the UI each frame which is quite wasteful. While the actual UI updating loop is quite fast rendering without actually needing it is not. So there are multiple things you could do.

+

First is only update on input. This of course is only an option if your application only depends on the UI and does not require any outside calculations. If you actually only update on input make sure to update the UI two times each frame and call nk_clear directly after the first pass and only draw in the second pass. In addition it is recommended to also add additional timers to make sure the UI is not drawn more than a fixed number of frames per second.

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
// [...wait for input ]
+
// [...do two UI passes ...]
+
do_ui(...)
+
nk_clear(&ctx);
+
do_ui(...)
+
//
+
// draw
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case ...:
+
//[...]
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+

The second probably more applicable trick is to only draw if anything changed. It is not really useful for applications with continuous draw loop but quite useful for desktop applications. To actually get nuklear to only draw on changes you first have to define NK_ZERO_COMMAND_MEMORY and allocate a memory buffer that will store each unique drawing output. After each frame you compare the draw command memory inside the library with your allocated buffer by memcmp. If memcmp detects differences you have to copy the command buffer into the allocated buffer and then draw like usual (this example uses fixed memory but you could use dynamically allocated memory).

+
//[... other defines ...]
+
#define NK_ZERO_COMMAND_MEMORY
+
#include "nuklear.h"
+
//
+
// setup context
+
struct nk_context ctx;
+
void *last = calloc(1,64*1024);
+
void *buf = calloc(1,64*1024);
+
nk_init_fixed(&ctx, buf, 64*1024);
+
//
+
// loop
+
while (1) {
+
// [...input...]
+
// [...ui...]
+
void *cmds = nk_buffer_memory(&ctx.memory);
+
if (memcmp(cmds, last, ctx.memory.allocated)) {
+
memcpy(last,cmds,ctx.memory.allocated);
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case ...:
+
// [...]
+
}
+
}
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
main API and documentation file
+
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
+

Finally while using draw commands makes sense for higher abstracted platforms like X11 and Win32 or drawing libraries it is often desirable to use graphics hardware directly. Therefore it is possible to just define NK_INCLUDE_VERTEX_BUFFER_OUTPUT which includes optional vertex output. To access the vertex output you first have to convert all draw commands into vertexes by calling nk_convert which takes in your preferred vertex format. After successfully converting all draw commands just iterate over and execute all vertex draw commands:

+
// fill configuration
+
struct your_vertex
+
{
+
float pos[2]; // important to keep it to 2 floats
+
float uv[2];
+
unsigned char col[4];
+
};
+
struct nk_convert_config cfg = {};
+
static const struct nk_draw_vertex_layout_element vertex_layout[] = {
+
{NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)},
+
{NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)},
+
{NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)},
+
{NK_VERTEX_LAYOUT_END}
+
};
+
cfg.shape_AA = NK_ANTI_ALIASING_ON;
+
cfg.line_AA = NK_ANTI_ALIASING_ON;
+
cfg.vertex_layout = vertex_layout;
+
cfg.vertex_size = sizeof(struct your_vertex);
+
cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex);
+ + + +
cfg.global_alpha = 1.0f;
+
cfg.tex_null = dev->tex_null;
+
//
+
// setup buffers and convert
+
struct nk_buffer cmds, verts, idx;
+
nk_buffer_init_default(&cmds);
+
nk_buffer_init_default(&verts);
+
nk_buffer_init_default(&idx);
+
nk_convert(&ctx, &cmds, &verts, &idx, &cfg);
+
//
+
// draw
+
nk_draw_foreach(cmd, &ctx, &cmds) {
+
if (!cmd->elem_count) continue;
+
//[...]
+
}
+
nk_buffer_free(&cms);
+
nk_buffer_free(&verts);
+
nk_buffer_free(&idx);
+ + +
enum nk_anti_aliasing shape_AA
!< line anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:981
+
enum nk_anti_aliasing line_AA
!< global alpha value
Definition: nuklear.h:980
+
nk_size vertex_alignment
!< sizeof one vertex for vertex packing
Definition: nuklear.h:988
+
nk_size vertex_size
!< describes the vertex output format and packing
Definition: nuklear.h:987
+
const struct nk_draw_vertex_layout_element * vertex_layout
!< handle to texture with a white pixel for shape drawing
Definition: nuklear.h:986
+
unsigned arc_segment_count
!< number of segments used for circles: default to 22
Definition: nuklear.h:983
+
unsigned circle_segment_count
!< shape anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:982
+
unsigned curve_segment_count
!< number of segments used for arcs: default to 22
Definition: nuklear.h:984
+
struct nk_draw_null_texture tex_null
!< number of segments used for curves: default to 22
Definition: nuklear.h:985
+

+Reference

+ + + + + + + + + + + + + + + + + + + +
Function Description
nk__begin Returns the first draw command in the context draw command list to be drawn
nk__next Increments the draw command iterator to the next command inside the context draw command list
nk_foreach Iterates over each draw command inside the context draw command list
nk_convert Converts from the abstract draw commands list into a hardware accessible vertex format
nk_draw_begin Returns the first vertex command in the context vertex draw list to be executed
nk__draw_next Increments the vertex command iterator to the next command inside the context vertex command list
nk__draw_end Returns the end of the vertex draw list
nk_draw_foreach Iterates over each vertex draw command inside the vertex draw list
+

This library was designed to be render backend agnostic so it does not draw anything to screen.

+

Instead all drawn shapes, widgets are made of, are buffered into memory and make up a command queue. Each frame therefore fills the command buffer with draw commands that then need to be executed by the user and his own render backend. After that the command buffer needs to be cleared and a new frame can be started. It is probably important to note that the command buffer is the main drawing API and the optional vertex buffer API only takes this format and converts it into a hardware accessible format.

+

To use the command queue to draw your own widgets you can access the command buffer of each window by calling nk_window_get_canvas after previously having called nk_begin:

+
void draw_red_rectangle_widget(struct nk_context *ctx)
+
{
+
struct nk_command_buffer *canvas;
+
struct nk_input *input = &ctx->input;
+
canvas = nk_window_get_canvas(ctx);
+
+
struct nk_rect space;
+ +
state = nk_widget(&space, ctx);
+
if (!state) return;
+
+
if (state != NK_WIDGET_ROM)
+
update_your_widget_by_user_input(...);
+
nk_fill_rect(canvas, space, 0, nk_rgb(255,0,0));
+
}
+
+
if (nk_begin(...)) {
+
nk_layout_row_dynamic(ctx, 25, 1);
+
draw_red_rectangle_widget(ctx);
+
}
+
nk_end(..)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API struct nk_command_buffer * nk_window_get_canvas(const struct nk_context *ctx)
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+
NK_API void nk_end(struct nk_context *ctx)
+ + + +

Important to know if you want to create your own widgets is the nk_widget call. It allocates space on the panel reserved for this widget to be used, but also returns the state of the widget space. If your widget is not seen and does not have to be updated it is '0' and you can just return. If it only has to be drawn the state will be NK_WIDGET_ROM otherwise you can do both update and draw your widget. The reason for separating is to only draw and update what is actually necessary which is crucial for performance.

+
+
+
+ + + + diff --git a/Font.html b/Font.html new file mode 100644 index 000000000..12ae8a773 --- /dev/null +++ b/Font.html @@ -0,0 +1,188 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

Font handling in this library was designed to be quite customizable and lets you decide what you want to use and what you want to provide.

+

There are three different ways to use the font atlas. The first two will use your font handling scheme and only requires essential data to run nuklear. The next slightly more advanced features is font handling with vertex buffer output. Finally the most complex API wise is using nuklear's font baking API.

+

+Using your own implementation without vertex buffer output

+

So first up the easiest way to do font handling is by just providing a nk_user_font struct which only requires the height in pixel of the used font and a callback to calculate the width of a string. This way of handling fonts is best fitted for using the normal draw shape command API where you do all the text drawing yourself and the library does not require any kind of deeper knowledge about which font handling mechanism you use. IMPORTANT: the nk_user_font pointer provided to nuklear has to persist over the complete life time! I know this sucks but it is currently the only way to switch between fonts.

+
float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
+
{
+
your_font_type *type = handle.ptr;
+
float text_width = ...;
+
return text_width;
+
}
+
+
struct nk_user_font font;
+
font.userdata.ptr = &your_font_class_or_struct;
+
font.height = your_font_height;
+
font.width = your_text_width_calculation;
+
+
struct nk_context ctx;
+
nk_init_default(&ctx, &font);
+ + + +

+Using your own implementation with vertex buffer output

+

While the first approach works fine if you don't want to use the optional vertex buffer output it is not enough if you do. To get font handling working for these cases you have to provide two additional parameters inside the nk_user_font. First a texture atlas handle used to draw text as subimages of a bigger font atlas texture and a callback to query a character's glyph information (offset, size, ...). So it is still possible to provide your own font and use the vertex buffer output.

+
float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
+
{
+
your_font_type *type = handle.ptr;
+
float text_width = ...;
+
return text_width;
+
}
+
void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
+
{
+
your_font_type *type = handle.ptr;
+
glyph.width = ...;
+
glyph.height = ...;
+
glyph.xadvance = ...;
+
glyph.uv[0].x = ...;
+
glyph.uv[0].y = ...;
+
glyph.uv[1].x = ...;
+
glyph.uv[1].y = ...;
+
glyph.offset.x = ...;
+
glyph.offset.y = ...;
+
}
+
+
struct nk_user_font font;
+
font.userdata.ptr = &your_font_class_or_struct;
+
font.height = your_font_height;
+
font.width = your_text_width_calculation;
+
font.query = query_your_font_glyph;
+
font.texture.id = your_font_texture;
+
+
struct nk_context ctx;
+
nk_init_default(&ctx, &font);
+

+Nuklear font baker

+

The final approach if you do not have a font handling functionality or don't want to use it in this library is by using the optional font baker. The font baker APIs can be used to create a font plus font atlas texture and can be used with or without the vertex buffer output.

+

It still uses the nk_user_font struct and the two different approaches previously stated still work. The font baker is not located inside nk_context like all other systems since it can be understood as more of an extension to nuklear and does not really depend on any nk_context state.

+

Font baker need to be initialized first by one of the nk_font_atlas_init_xxx functions. If you don't care about memory just call the default version nk_font_atlas_init_default which will allocate all memory from the standard library. If you want to control memory allocation but you don't care if the allocated memory is temporary and therefore can be freed directly after the baking process is over or permanent you can call nk_font_atlas_init.

+

After successfully initializing the font baker you can add Truetype(.ttf) fonts from different sources like memory or from file by calling one of the nk_font_atlas_add_xxx. functions. Adding font will permanently store each font, font config and ttf memory block(!) inside the font atlas and allows to reuse the font atlas. If you don't want to reuse the font baker by for example adding additional fonts you can call nk_font_atlas_cleanup after the baking process is over (after calling nk_font_atlas_end).

+

As soon as you added all fonts you wanted you can now start the baking process for every selected glyph to image by calling nk_font_atlas_bake. The baking process returns image memory, width and height which can be used to either create your own image object or upload it to any graphics library. No matter which case you finally have to call nk_font_atlas_end which will free all temporary memory including the font atlas image so make sure you created our texture beforehand. nk_font_atlas_end requires a handle to your font texture or object and optionally fills a struct nk_draw_null_texture which can be used for the optional vertex output. If you don't want it just set the argument to NULL.

+

At this point you are done and if you don't want to reuse the font atlas you can call nk_font_atlas_cleanup to free all truetype blobs and configuration memory. Finally if you don't use the font atlas and any of it's fonts anymore you need to call nk_font_atlas_clear to free all memory still being used.

+
struct nk_font_atlas atlas;
+
nk_font_atlas_init_default(&atlas);
+
nk_font_atlas_begin(&atlas);
+
nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, 0);
+
nk_font *font2 = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font2.ttf", 16, 0);
+
const void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_RGBA32);
+
nk_font_atlas_end(&atlas, nk_handle_id(texture), 0);
+
+
struct nk_context ctx;
+
nk_init_default(&ctx, &font->handle);
+
while (1) {
+
+
}
+
nk_font_atlas_clear(&atlas);
+

The font baker API is probably the most complex API inside this library and I would suggest reading some of my examples example/ to get a grip on how to use the font atlas. There are a number of details I left out. For example how to merge fonts, configure a font with nk_font_config to use other languages, use another texture coordinate format and a lot more:

+
struct nk_font_config cfg = nk_font_config(font_pixel_height);
+
cfg.merge_mode = nk_false or nk_true;
+
cfg.range = nk_font_korean_glyph_ranges();
+
cfg.coord_type = NK_COORD_PIXEL;
+
nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, &cfg);
+
+
+
+ + + + diff --git a/Groups.html b/Groups.html new file mode 100644 index 000000000..43b0ed289 --- /dev/null +++ b/Groups.html @@ -0,0 +1,193 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

=============================================================================

+
                            GROUP
+

=============================================================================

+

Groups are basically windows inside windows. They allow to subdivide space in a window to layout widgets as a group. Almost all more complex widget layouting requirements can be solved using groups and basic layouting fuctionality. Groups just like windows are identified by an unique name and internally keep track of scrollbar offsets by default. However additional versions are provided to directly manage the scrollbar.

+

+Usage

+

To create a group you have to call one of the three nk_group_begin_xxx functions to start group declarations and nk_group_end at the end. Furthermore it is required to check the return value of nk_group_begin_xxx and only process widgets inside the window if the value is not 0. Nesting groups is possible and even encouraged since many layouting schemes can only be achieved by nesting. Groups, unlike windows, need nk_group_end to be only called if the corresponding nk_group_begin_xxx call does not return 0:

+
if (nk_group_begin_xxx(ctx, ...) {
+
// [... widgets ...]
+ +
}
+
NK_API void nk_group_end(struct nk_context *)
+

In the grand concept groups can be called after starting a window with nk_begin_xxx and before calling nk_end:

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
// Input
+
Event evt;
+ +
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
nk_input_xxx(...);
+
}
+
}
+
nk_input_end(&ctx);
+
//
+
// Window
+
if (nk_begin_xxx(...) {
+
// [...widgets...]
+ +
if (nk_group_begin_xxx(ctx, ...) {
+
//[... widgets ...]
+ +
}
+
}
+
nk_end(ctx);
+
//
+
// Draw
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case ...:
+
// [...]
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
#define nk_foreach(c, ctx)
Iterates over each draw command inside the context draw command list.
Definition: nuklear.h:1031
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+
NK_API void nk_end(struct nk_context *ctx)
+
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ +

+Reference

+ + + + + + + + + + + + + + + + + + + +
Function Description
nk_group_begin Start a new group with internal scrollbar handling
nk_group_begin_titled Start a new group with separated name and title and internal scrollbar handling
nk_group_end Ends a group. Should only be called if nk_group_begin returned non-zero
nk_group_scrolled_offset_begin Start a new group with manual separated handling of scrollbar x- and y-offset
nk_group_scrolled_begin Start a new group with manual scrollbar handling
nk_group_scrolled_end Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero
nk_group_get_scroll Gets the scroll offset for the given group
nk_group_set_scroll Sets the scroll offset for the given group
+
+
+
+ + + + diff --git a/Input.html b/Input.html new file mode 100644 index 000000000..7633079aa --- /dev/null +++ b/Input.html @@ -0,0 +1,165 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

The input API is responsible for holding the current input state composed of mouse, key and text input states.

+

It is worth noting that no direct OS or window handling is done in nuklear. Instead all input state has to be provided by platform specific code. This on one hand expects more work from the user and complicates usage but on the other hand provides simple abstraction over a big number of platforms, libraries and other already provided functionality.

+
+
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
// [...]
+
}
+
} nk_input_end(&ctx);
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+

+Usage

+

Input state needs to be provided to nuklear by first calling nk_input_begin which resets internal state like delta mouse position and button transitions. After nk_input_begin all current input state needs to be provided. This includes mouse motion, button and key pressed and released, text input and scrolling. Both event- or state-based input handling are supported by this API and should work without problems. Finally after all input state has been mirrored nk_input_end needs to be called to finish input process.

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
Event evt;
+ +
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
// [...]
+
}
+
}
+
nk_input_end(&ctx);
+
// [...]
+
nk_clear(&ctx);
+
} nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+ +

+Reference

+ + + + + + + + + + + + + + + + + + + + + +
Function Description
nk_input_begin Begins the input mirroring process. Needs to be called before all other nk_input_xxx calls
nk_input_motion Mirrors mouse cursor position
nk_input_key Mirrors key state with either pressed or released
nk_input_button Mirrors mouse button state with either pressed or released
nk_input_scroll Mirrors mouse scroll values
nk_input_char Adds a single ASCII text character into an internal text buffer
nk_input_glyph Adds a single multi-byte UTF-8 character into an internal text buffer
nk_input_unicode Adds a single unicode rune into an internal text buffer
nk_input_end Ends the input mirroring process by calculating state changes. Don't call any nk_input_xxx function referenced above after this call
+
+
+
+ + + + diff --git a/Layouting.html b/Layouting.html new file mode 100644 index 000000000..aa7bdc558 --- /dev/null +++ b/Layouting.html @@ -0,0 +1,217 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

Layouting in general describes placing widget inside a window with position and size.

+

While in this particular implementation there are five different APIs for layouting each with different trade offs between control and ease of use.
+
+

+

All layouting methods in this library are based around the concept of a row. A row has a height the window content grows by and a number of columns and each layouting method specifies how each widget is placed inside the row. After a row has been allocated by calling a layouting functions and then filled with widgets will advance an internal pointer over the allocated row.
+
+

+

To actually define a layout you just call the appropriate layouting function and each subsequent widget call will place the widget as specified. Important here is that if you define more widgets then columns defined inside the layout functions it will allocate the next row without you having to make another layouting
+
+ call.

+

Biggest limitation with using all these APIs outside the nk_layout_space_xxx API is that you have to define the row height for each. However the row height often depends on the height of the font.
+
+

+

To fix that internally nuklear uses a minimum row height that is set to the height plus padding of currently active font and overwrites the row height value if zero.
+
+

+

If you manually want to change the minimum row height then use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to reset it back to be derived from font height.
+
+

+

Also if you change the font in nuklear it will automatically change the minimum row height for you and. This means if you change the font but still want a minimum row height smaller than the font you have to repush your value.
+
+

+

For actually more advanced UI I would even recommend using the nk_layout_space_xxx layouting method in combination with a cassowary constraint solver (there are some versions on github with permissive license model) to take over all control over widget layouting yourself. However for quick and dirty layouting using all the other layouting functions should be fine.

+

+Usage

+
    +
  1. nk_layout_row_dynamic
    +
    + The easiest layouting function is nk_layout_row_dynamic. It provides each widgets with same horizontal space inside the row and dynamically grows if the owning window grows in width. So the number of columns dictates the size of each widget dynamically by formula:

    +

    ```c widget_width = (window_width - padding - spacing) * (1/column_count) ```

    +

    Just like all other layouting APIs if you define more widget than columns this library will allocate a new row and keep all layouting parameters previously defined.

    +

    ```c if (nk_begin_xxx(...) { // first row with height: 30 composed of two widgets nk_layout_row_dynamic(&ctx, 30, 2); nk_widget(...); nk_widget(...); // // second row with same parameter as defined above nk_widget(...); nk_widget(...); // // third row uses 0 for height which will use auto layouting nk_layout_row_dynamic(&ctx, 0, 2); nk_widget(...); nk_widget(...); } nk_end(...); ```

    +
  2. +
  3. nk_layout_row_static
    +
    + Another easy layouting function is nk_layout_row_static. It provides each widget with same horizontal pixel width inside the row and does not grow if the owning window scales smaller or bigger.

    +

    ```c if (nk_begin_xxx(...) { // first row with height: 30 composed of two widgets with width: 80 nk_layout_row_static(&ctx, 30, 80, 2); nk_widget(...); nk_widget(...); // // second row with same parameter as defined above nk_widget(...); nk_widget(...); // // third row uses 0 for height which will use auto layouting nk_layout_row_static(&ctx, 0, 80, 2); nk_widget(...); nk_widget(...); } nk_end(...); ```

    +
  4. +
  5. nk_layout_row_xxx
    +
    + A little bit more advanced layouting API are functions nk_layout_row_begin, nk_layout_row_push and nk_layout_row_end. They allow to directly specify each column pixel or window ratio in a row. It supports either directly setting per column pixel width or widget window ratio but not both. Furthermore it is a immediate mode API so each value is directly pushed before calling a widget. Therefore the layout is not automatically repeating like the last two layouting functions.

    +

    ```c if (nk_begin_xxx(...) { // first row with height: 25 composed of two widgets with width 60 and 40 nk_layout_row_begin(ctx, NK_STATIC, 25, 2); nk_layout_row_push(ctx, 60); nk_widget(...); nk_layout_row_push(ctx, 40); nk_widget(...); nk_layout_row_end(ctx); // // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75 nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2); nk_layout_row_push(ctx, 0.25f); nk_widget(...); nk_layout_row_push(ctx, 0.75f); nk_widget(...); nk_layout_row_end(ctx); // // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75 nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2); nk_layout_row_push(ctx, 0.25f); nk_widget(...); nk_layout_row_push(ctx, 0.75f); nk_widget(...); nk_layout_row_end(ctx); } nk_end(...); ```

    +
  6. +
  7. nk_layout_row
    +
    + The array counterpart to API nk_layout_row_xxx is the single nk_layout_row functions. Instead of pushing either pixel or window ratio for every widget it allows to define it by array. The trade of for less control is that nk_layout_row is automatically repeating. Otherwise the behavior is the same.

    +

    ```c if (nk_begin_xxx(...) { // two rows with height: 30 composed of two widgets with width 60 and 40 const float ratio[] = {60,40}; nk_layout_row(ctx, NK_STATIC, 30, 2, ratio); nk_widget(...); nk_widget(...); nk_widget(...); nk_widget(...); // // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75 const float ratio[] = {0.25, 0.75}; nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); nk_widget(...); nk_widget(...); nk_widget(...); nk_widget(...); // // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75 const float ratio[] = {0.25, 0.75}; nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); nk_widget(...); nk_widget(...); nk_widget(...); nk_widget(...); } nk_end(...); ```

    +
  8. +
  9. nk_layout_row_template_xxx
    +
    + The most complex and second most flexible API is a simplified flexbox version without line wrapping and weights for dynamic widgets. It is an immediate mode API but unlike nk_layout_row_xxx it has auto repeat behavior and needs to be called before calling the templated widgets. The row template layout has three different per widget size specifier. The first one is the nk_layout_row_template_push_static with fixed widget pixel width. They do not grow if the row grows and will always stay the same. The second size specifier is nk_layout_row_template_push_variable which defines a minimum widget size but it also can grow if more space is available not taken by other widgets. Finally there are dynamic widgets with nk_layout_row_template_push_dynamic which are completely flexible and unlike variable widgets can even shrink to zero if not enough space is provided.

    +

    ```c if (nk_begin_xxx(...) { // two rows with height: 30 composed of three widgets nk_layout_row_template_begin(ctx, 30); nk_layout_row_template_push_dynamic(ctx); nk_layout_row_template_push_variable(ctx, 80); nk_layout_row_template_push_static(ctx, 80); nk_layout_row_template_end(ctx); // // first row nk_widget(...); // dynamic widget can go to zero if not enough space nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space nk_widget(...); // static widget with fixed 80 pixel width // // second row same layout nk_widget(...); nk_widget(...); nk_widget(...); } nk_end(...); ```

    +
  10. +
  11. nk_layout_space_xxx
    +
    + Finally the most flexible API directly allows you to place widgets inside the window. The space layout API is an immediate mode API which does not support row auto repeat and directly sets position and size of a widget. Position and size hereby can be either specified as ratio of allocated space or allocated space local position and pixel size. Since this API is quite powerful there are a number of utility functions to get the available space and convert between local allocated space and screen space.

    +

    ```c if (nk_begin_xxx(...) { // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX); nk_layout_space_push(ctx, nk_rect(0,0,150,200)); nk_widget(...); nk_layout_space_push(ctx, nk_rect(200,200,100,200)); nk_widget(...); nk_layout_space_end(ctx); // // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX); nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1)); nk_widget(...); nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1)); nk_widget(...); } nk_end(...); ```

    +
  12. +
+

+Reference

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function Description
nk_layout_set_min_row_height Set the currently used minimum row height to a specified value
nk_layout_reset_min_row_height Resets the currently used minimum row height to font height
nk_layout_widget_bounds Calculates current width a static layout row can fit inside a window
nk_layout_ratio_from_pixel Utility functions to calculate window ratio from pixel size
nk_layout_row_dynamic Current layout is divided into n same sized growing columns
nk_layout_row_static Current layout is divided into n same fixed sized columns
nk_layout_row_begin Starts a new row with given height and number of columns
nk_layout_row_push Pushes another column with given size or window ratio
nk_layout_row_end Finished previously started row
nk_layout_row Specifies row columns in array as either window ratio or size
nk_layout_row_template_begin Begins the row template declaration
nk_layout_row_template_push_dynamic Adds a dynamic column that dynamically grows and can go to zero if not enough space
nk_layout_row_template_push_variable Adds a variable column that dynamically grows but does not shrink below specified pixel width
nk_layout_row_template_push_static Adds a static column that does not grow and will always have the same size
nk_layout_row_template_end Marks the end of the row template
nk_layout_space_begin Begins a new layouting space that allows to specify each widgets position and size
nk_layout_space_push Pushes position and size of the next widget in own coordinate space either as pixel or ratio
nk_layout_space_end Marks the end of the layouting space
nk_layout_space_bounds Callable after nk_layout_space_begin and returns total space allocated
nk_layout_space_to_screen Converts vector from nk_layout_space coordinate space into screen space
nk_layout_space_to_local Converts vector from screen space into nk_layout_space coordinates
nk_layout_space_rect_to_screen Converts rectangle from nk_layout_space coordinate space into screen space
nk_layout_space_rect_to_local Converts rectangle from screen space into nk_layout_space coordinates
+
+
+
+ + + + diff --git a/Memory.html b/Memory.html new file mode 100644 index 000000000..2a856367e --- /dev/null +++ b/Memory.html @@ -0,0 +1,117 @@ + + + + + + + +Nuklear: Buffer + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Buffer
+
+
+

==============================================================

+
                    MEMORY BUFFER
+

===============================================================

+

A basic (double)-buffer with linear allocation and resetting as only freeing policy. The buffer's main purpose is to control all memory management inside the GUI toolkit and still leave memory control as much as possible in the hand of the user while also making sure the library is easy to use if not as much control is needed. In general all memory inside this library can be provided from the user in three different ways.

+

The first way and the one providing most control is by just passing a fixed size memory block. In this case all control lies in the hand of the user since he can exactly control where the memory comes from and how much memory the library should consume. Of course using the fixed size API removes the ability to automatically resize a buffer if not enough memory is provided so you have to take over the resizing. While being a fixed sized buffer sounds quite limiting, it is very effective in this library since the actual memory consumption is quite stable and has a fixed upper bound for a lot of cases.

+

If you don't want to think about how much memory the library should allocate at all time or have a very dynamic UI with unpredictable memory consumption habits but still want control over memory allocation you can use the dynamic allocator based API. The allocator consists of two callbacks for allocating and freeing memory and optional userdata so you can plugin your own allocator.

+

The final and easiest way can be used by defining NK_INCLUDE_DEFAULT_ALLOCATOR which uses the standard library memory allocation functions malloc and free and takes over complete control over memory in this library.

+
+
+
+ + + + diff --git a/Properties.html b/Properties.html new file mode 100644 index 000000000..aadc7fca3 --- /dev/null +++ b/Properties.html @@ -0,0 +1,243 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

Properties are the main value modification widgets in Nuklear.

+

Changing a value can be achieved by dragging, adding/removing incremental steps on button click or by directly typing a number.

+

+Usage

+

Each property requires a unique name for identification that is also used for displaying a label. If you want to use the same name multiple times make sure add a '#' before your name. The '#' will not be shown but will generate a unique ID. Each property also takes in a minimum and maximum value. If you want to make use of the complete number range of a type just use the provided type limits from limits.h. For example INT_MIN and INT_MAX for nk_property_int and nk_propertyi. In additional each property takes in a increment value that will be added or subtracted if either the increment decrement button is clicked. Finally there is a value for increment per pixel dragged that is added or subtracted from the value.

+
int value = 0;
+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
// Input
+
Event evt;
+ +
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
nk_input_xxx(...);
+
}
+
}
+
nk_input_end(&ctx);
+
//
+
// Window
+
if (nk_begin_xxx(...) {
+
// Property
+ +
nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1);
+
}
+
nk_end(ctx);
+
//
+
// Draw
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
switch (cmd->type) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case ...:
+
// [...]
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
#define nk_foreach(c, ctx)
Iterates over each draw command inside the context draw command list.
Definition: nuklear.h:1031
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+
NK_API void nk_end(struct nk_context *ctx)
+
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ +

+Reference

+ + + + + + + + + + + + + + + +
Function Description
nk_property_int Integer property directly modifying a passed in value
nk_property_float Float property directly modifying a passed in value
nk_property_double Double property directly modifying a passed in value
nk_propertyi Integer property returning the modified int value
nk_propertyf Float property returning the modified float value
nk_propertyd Double property returning the modified double value
+

+# nk_property_int

+

Integer property directly modifying a passed in value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
+
+ + + + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling a layouting function
Parameters
+ + +
[in]name
+
+
+
String used both as a label as well as a unique identifier
Parameters
+ + +
[in]min
+
+
+
Minimum value not allowed to be underflown
Parameters
+ + +
[in]val
+
+
+
Integer pointer to be modified
Parameters
+ + +
[in]max
+
+
+
Maximum value not allowed to be overflown
Parameters
+ + +
[in]step
+
+
+
Increment added and subtracted on increment and decrement button
Parameters
+ + +
[in]inc_per_pixel
+
+
+
Value per pixel added or subtracted on dragging
+
+
+
+ + + + diff --git a/Stack.html b/Stack.html new file mode 100644 index 000000000..44706afbe --- /dev/null +++ b/Stack.html @@ -0,0 +1,120 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

+Stack

+

The style modifier stack can be used to temporarily change a property inside nk_style. For example if you want a special red button you can temporarily push the old button color onto a stack draw the button with a red color and then you just pop the old color back from the stack:

nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0)));
+nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0)));
+nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0)));
+nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2));
+
+nk_button(...);
+
+nk_style_pop_style_item(ctx);
+nk_style_pop_style_item(ctx);
+nk_style_pop_style_item(ctx);
+nk_style_pop_vec2(ctx);
+

Nuklear has a stack for style_items, float properties, vector properties, flags, colors, fonts and for button_behavior. Each has it's own fixed size stack which can be changed at compile time.

+
+
+
+ + + + diff --git a/Text.html b/Text.html new file mode 100644 index 000000000..771d39656 --- /dev/null +++ b/Text.html @@ -0,0 +1,117 @@ + + + + + + + +Nuklear: Editor + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Editor
+
+
+

===============================================================

+
                 TEXT EDITOR
+

===============================================================

+

Editing text in this library is handled by either nk_edit_string or nk_edit_buffer. But like almost everything in this library there are multiple ways of doing it and a balance between control and ease of use with memory as well as functionality controlled by flags.

+

This library generally allows three different levels of memory control: First of is the most basic way of just providing a simple char array with string length. This method is probably the easiest way of handling simple user text input. Main upside is complete control over memory while the biggest downside in comparison with the other two approaches is missing undo/redo.

+

For UIs that require undo/redo the second way was created. It is based on a fixed size nk_text_edit struct, which has an internal undo/redo stack. This is mainly useful if you want something more like a text editor but don't want to have a dynamically growing buffer.

+

The final way is using a dynamically growing nk_text_edit struct, which has both a default version if you don't care where memory comes from and an allocator version if you do. While the text editor is quite powerful for its complexity I would not recommend editing gigabytes of data with it. It is rather designed for uses cases which make sense for a GUI library not for an full blown text editor.

+
+
+
+ + + + diff --git a/Tree.html b/Tree.html new file mode 100644 index 000000000..b136dcd56 --- /dev/null +++ b/Tree.html @@ -0,0 +1,165 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

=============================================================================

+
                            TREE
+

=============================================================================

+

Trees represent two different concept. First the concept of a collapsible UI section that can be either in a hidden or visible state. They allow the UI user to selectively minimize the current set of visible UI to comprehend. The second concept are tree widgets for visual UI representation of trees.
+
+

+

Trees thereby can be nested for tree representations and multiple nested collapsible UI sections. All trees are started by calling of the nk_tree_xxx_push_tree functions and ended by calling one of the nk_tree_xxx_pop_xxx() functions. Each starting functions takes a title label and optionally an image to be displayed and the initial collapse state from the nk_collapse_states section.
+
+

+

The runtime state of the tree is either stored outside the library by the caller or inside which requires a unique ID. The unique ID can either be generated automatically from __FILE__ and __LINE__ with function nk_tree_push, by __FILE__ and a user provided ID generated for example by loop index with function nk_tree_push_id or completely provided from outside by user with function nk_tree_push_hashed.

+

+Usage

+

To create a tree you have to call one of the seven nk_tree_xxx_push_xxx functions to start a collapsible UI section and nk_tree_xxx_pop to mark the end. Each starting function will either return false(0) if the tree is collapsed or hidden and therefore does not need to be filled with content or true(1) if visible and required to be filled.

+

!!! Note The tree header does not require and layouting function and instead calculates a auto height based on the currently used font size

+

The tree ending functions only need to be called if the tree content is actually visible. So make sure the tree push function is guarded by if and the pop call is only taken if the tree is visible.

+
if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) {
+ +
nk_widget(...);
+ +
}
+
NK_API void nk_tree_pop(struct nk_context *)
Definition: nuklear_tree.c:190
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
#define nk_tree_push(ctx, type, title, state)
Definition: nuklear.h:2879
+

+Reference

+ + + + + + + + + + + + + + + + + + + + + + + +
Function Description
nk_tree_push Start a collapsible UI section with internal state management
nk_tree_push_id Start a collapsible UI section with internal state management callable in a look
nk_tree_push_hashed Start a collapsible UI section with internal state management with full control over internal unique ID use to store state
nk_tree_image_push Start a collapsible UI section with image and label header
nk_tree_image_push_id Start a collapsible UI section with image and label header and internal state management callable in a look
nk_tree_image_push_hashed Start a collapsible UI section with image and label header and internal state management with full control over internal unique ID use to store state
nk_tree_pop Ends a collapsible UI section
nk_tree_state_push Start a collapsible UI section with external state management
nk_tree_state_image_push Start a collapsible UI section with image and label header and external state management
nk_tree_state_pop Ends a collapsabale UI section
+

+nk_tree_type

+ + + + + + + +
Flag Description
NK_TREE_NODE Highlighted tree header to mark a collapsible UI section
NK_TREE_TAB Non-highlighted tree header closer to tree representations
+
+
+
+ + + + diff --git a/Window.html b/Window.html new file mode 100644 index 000000000..56e146f4f --- /dev/null +++ b/Window.html @@ -0,0 +1,221 @@ + + + + + + + +Nuklear: $title + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+

=============================================================================

+
                            WINDOW
+

=============================================================================

+

Windows are the main persistent state used inside nuklear and are life time controlled by simply "retouching" (i.e. calling) each window each frame. All widgets inside nuklear can only be added inside the function pair nk_begin_xxx and nk_end. Calling any widgets outside these two functions will result in an assert in debug or no state change in release mode.
+
+

+

Each window holds frame persistent state like position, size, flags, state tables, and some garbage collected internal persistent widget state. Each window is linked into a window stack list which determines the drawing and overlapping order. The topmost window thereby is the currently active window.
+
+

+

To change window position inside the stack occurs either automatically by user input by being clicked on or programmatically by calling nk_window_focus. Windows by default are visible unless explicitly being defined with flag NK_WINDOW_HIDDEN, the user clicked the close button on windows with flag NK_WINDOW_CLOSABLE or if a window was explicitly hidden by calling nk_window_show. To explicitly close and destroy a window call nk_window_close.
+
+

+

+Usage

+

To create and keep a window you have to call one of the two nk_begin_xxx functions to start window declarations and nk_end at the end. Furthermore it is recommended to check the return value of nk_begin_xxx and only process widgets inside the window if the value is not 0. Either way you have to call nk_end at the end of window declarations. Furthermore, do not attempt to nest nk_begin_xxx calls which will hopefully result in an assert or if not in a segmentation fault.

+
if (nk_begin_xxx(...) {
+
// [... widgets ...]
+
}
+
nk_end(ctx);
+
NK_API void nk_end(struct nk_context *ctx)
+

In the grand concept window and widget declarations need to occur after input handling and before drawing to screen. Not doing so can result in higher latency or at worst invalid behavior. Furthermore make sure that nk_clear is called at the end of the frame. While nuklear's default platform backends already call nk_clear for you if you write your own backend not calling nk_clear can cause asserts or even worse undefined behavior.

+
struct nk_context ctx;
+
nk_init_xxx(&ctx, ...);
+
while (1) {
+
Event evt;
+ +
while (GetEvent(&evt)) {
+
if (evt.type == MOUSE_MOVE)
+
nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+
else if (evt.type == [...]) {
+
nk_input_xxx(...);
+
}
+
}
+
nk_input_end(&ctx);
+
+
if (nk_begin_xxx(...) {
+
//[...]
+
}
+
nk_end(ctx);
+
+
const struct nk_command *cmd = 0;
+
nk_foreach(cmd, &ctx) {
+
case NK_COMMAND_LINE:
+
your_draw_line_function(...)
+
break;
+
case NK_COMMAND_RECT
+
your_draw_rect_function(...)
+
break;
+
case //...:
+
//[...]
+
}
+
nk_clear(&ctx);
+
}
+
nk_free(&ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
#define nk_foreach(c, ctx)
Iterates over each draw command inside the context draw command list.
Definition: nuklear.h:1031
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ +

+Reference

+ + + + + + + + + +
Function Description
nk_begin Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
nk_begin_titled Extended window start with separated title and identifier to allow multiple windows with same name but not title
nk_end Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup
+

nk_window_find | Finds and returns the window with give name nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window. nk_window_get_position | Returns the position of the currently processed window nk_window_get_size | Returns the size with width and height of the currently processed window nk_window_get_width | Returns the width of the currently processed window nk_window_get_height | Returns the height of the currently processed window nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets nk_window_get_scroll | Gets the scroll offset of the current window nk_window_has_focus | Returns if the currently processed window is currently active nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed nk_window_is_closed | Returns if the currently processed window was closed nk_window_is_hidden | Returns if the currently processed window was hidden nk_window_is_active | Same as nk_window_has_focus for some reason nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse nk_window_is_any_hovered | Return if any window currently hovered nk_item_is_any_active | Returns if any window or widgets is currently hovered or active

+

nk_window_set_bounds | Updates position and size of the currently processed window nk_window_set_position | Updates position of the currently process window nk_window_set_size | Updates the size of the currently processed window nk_window_set_focus | Set the currently processed window as active window nk_window_set_scroll | Sets the scroll offset of the current window

+

nk_window_close | Closes the window with given window name which deletes the window at the end of the frame nk_window_collapse | Collapses the window with given window name nk_window_collapse_if | Collapses the window with given window name if the given condition was met nk_window_show | Hides a visible or reshows a hidden window nk_window_show_if | Hides/shows a window depending on condition

+

+nk_panel_flags

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Flag Description
NK_WINDOW_BORDER Draws a border around the window to visually separate window from the background
NK_WINDOW_MOVABLE The movable flag indicates that a window can be moved by user input or by dragging the window header
NK_WINDOW_SCALABLE The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window
NK_WINDOW_CLOSABLE Adds a closable icon into the header
NK_WINDOW_MINIMIZABLE Adds a minimize icon into the header
NK_WINDOW_NO_SCROLLBAR Removes the scrollbar from the window
NK_WINDOW_TITLE Forces a header at the top at the window showing the title
NK_WINDOW_SCROLL_AUTO_HIDE Automatically hides the window scrollbar if no user interaction: also requires delta time in nk_context to be set each frame
NK_WINDOW_BACKGROUND Always keep window in the background
NK_WINDOW_SCALE_LEFT Puts window scaler in the left-bottom corner instead right-bottom
NK_WINDOW_NO_INPUT Prevents window of scaling, moving or getting focus
+

+nk_collapse_states

+ + + + + + + +
State Description
NK_MINIMIZED UI section is collapsed and not visible until maximized
NK_MAXIMIZED UI section is extended and visible until minimized
+
+
+
+ + + + diff --git a/annotated.html b/annotated.html new file mode 100644 index 000000000..202016da3 --- /dev/null +++ b/annotated.html @@ -0,0 +1,216 @@ + + + + + + + +Nuklear: Data Structures + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Cnk_allocator
 Cnk_buffer
 Cnk_buffer_marker
 Cnk_chart
 Cnk_chart_slot
 Cnk_clipboard
 Cnk_color
 Cnk_colorf
 Cnk_commandCommand base and header of every command inside the buffer
 Cnk_command_arc
 Cnk_command_arc_filled
 Cnk_command_buffer
 Cnk_command_circle
 Cnk_command_circle_filled
 Cnk_command_curve
 Cnk_command_custom
 Cnk_command_image
 Cnk_command_line
 Cnk_command_polygon
 Cnk_command_polygon_filled
 Cnk_command_polyline
 Cnk_command_rect
 Cnk_command_rect_filled
 Cnk_command_rect_multi_color
 Cnk_command_scissor
 Cnk_command_text
 Cnk_command_triangle
 Cnk_command_triangle_filled
 Cnk_configuration_stacks
 Cnk_context
 Cnk_convert_config
 Cnk_cursor
 Cnk_draw_null_texture
 Cnk_edit_state
 Cnk_handle
 Cnk_image
 Cnk_input
 Cnk_key
 Cnk_keyboard
 Cnk_list_view
 Cnk_memory
 Cnk_memory_status
 Cnk_menu_state
 Cnk_mouse
 Cnk_mouse_button
 Cnk_nine_slice
 Cnk_page
 Cnk_page_data
 Cnk_page_element
 Cnk_panel
 Cnk_pool
 Cnk_popup_buffer
 Cnk_popup_state
 Cnk_property
 Cnk_property_state
 Cnk_property_variant
 Cnk_rect
 Cnk_recti
 Cnk_row_layout
 Cnk_scroll
 Cnk_str==============================================================
 Cnk_style
 Cnk_style_button
 Cnk_style_chart
 Cnk_style_combo
 Cnk_style_edit
 Cnk_style_item
 Cnk_style_item_data
 Cnk_style_knob
 Cnk_style_progress
 Cnk_style_property
 Cnk_style_scrollbar
 Cnk_style_selectable
 Cnk_style_slider
 Cnk_style_tab
 Cnk_style_text
 Cnk_style_toggle
 Cnk_style_window
 Cnk_style_window_header
 Cnk_table
 Cnk_text
 Cnk_text_edit
 Cnk_text_edit_row
 Cnk_text_find
 Cnk_text_undo_record
 Cnk_text_undo_state
 Cnk_user_font
 Cnk_vec2
 Cnk_vec2i
 Cnk_window
 Cstbrp_context
 Cstbrp_node
 Cstbrp_rect
 Cstbtt__bitmap
 Cstbtt__buf
 Cstbtt_aligned_quad
 Cstbtt_bakedchar
 Cstbtt_fontinfo
 Cstbtt_kerningentry
 Cstbtt_pack_context
 Cstbtt_pack_range
 Cstbtt_packedchar
 Cstbtt_vertex
+
+
+
+ + + + diff --git a/annotated_dup.js b/annotated_dup.js new file mode 100644 index 000000000..58480cdc3 --- /dev/null +++ b/annotated_dup.js @@ -0,0 +1,106 @@ +var annotated_dup = +[ + [ "nk_allocator", "structnk__allocator.html", "structnk__allocator" ], + [ "nk_buffer", "structnk__buffer.html", "structnk__buffer" ], + [ "nk_buffer_marker", "structnk__buffer__marker.html", "structnk__buffer__marker" ], + [ "nk_chart", "structnk__chart.html", "structnk__chart" ], + [ "nk_chart_slot", "structnk__chart__slot.html", "structnk__chart__slot" ], + [ "nk_clipboard", "structnk__clipboard.html", "structnk__clipboard" ], + [ "nk_color", "structnk__color.html", "structnk__color" ], + [ "nk_colorf", "structnk__colorf.html", "structnk__colorf" ], + [ "nk_command", "structnk__command.html", "structnk__command" ], + [ "nk_command_arc", "structnk__command__arc.html", "structnk__command__arc" ], + [ "nk_command_arc_filled", "structnk__command__arc__filled.html", "structnk__command__arc__filled" ], + [ "nk_command_buffer", "structnk__command__buffer.html", "structnk__command__buffer" ], + [ "nk_command_circle", "structnk__command__circle.html", "structnk__command__circle" ], + [ "nk_command_circle_filled", "structnk__command__circle__filled.html", "structnk__command__circle__filled" ], + [ "nk_command_curve", "structnk__command__curve.html", "structnk__command__curve" ], + [ "nk_command_custom", "structnk__command__custom.html", "structnk__command__custom" ], + [ "nk_command_image", "structnk__command__image.html", "structnk__command__image" ], + [ "nk_command_line", "structnk__command__line.html", "structnk__command__line" ], + [ "nk_command_polygon", "structnk__command__polygon.html", "structnk__command__polygon" ], + [ "nk_command_polygon_filled", "structnk__command__polygon__filled.html", "structnk__command__polygon__filled" ], + [ "nk_command_polyline", "structnk__command__polyline.html", "structnk__command__polyline" ], + [ "nk_command_rect", "structnk__command__rect.html", "structnk__command__rect" ], + [ "nk_command_rect_filled", "structnk__command__rect__filled.html", "structnk__command__rect__filled" ], + [ "nk_command_rect_multi_color", "structnk__command__rect__multi__color.html", "structnk__command__rect__multi__color" ], + [ "nk_command_scissor", "structnk__command__scissor.html", "structnk__command__scissor" ], + [ "nk_command_text", "structnk__command__text.html", "structnk__command__text" ], + [ "nk_command_triangle", "structnk__command__triangle.html", "structnk__command__triangle" ], + [ "nk_command_triangle_filled", "structnk__command__triangle__filled.html", "structnk__command__triangle__filled" ], + [ "nk_configuration_stacks", "structnk__configuration__stacks.html", "structnk__configuration__stacks" ], + [ "nk_context", "structnk__context.html", "structnk__context" ], + [ "nk_convert_config", "structnk__convert__config.html", "structnk__convert__config" ], + [ "nk_cursor", "structnk__cursor.html", "structnk__cursor" ], + [ "nk_draw_null_texture", "structnk__draw__null__texture.html", "structnk__draw__null__texture" ], + [ "nk_edit_state", "structnk__edit__state.html", "structnk__edit__state" ], + [ "nk_handle", "unionnk__handle.html", "unionnk__handle" ], + [ "nk_image", "structnk__image.html", "structnk__image" ], + [ "nk_input", "structnk__input.html", "structnk__input" ], + [ "nk_key", "structnk__key.html", "structnk__key" ], + [ "nk_keyboard", "structnk__keyboard.html", "structnk__keyboard" ], + [ "nk_list_view", "structnk__list__view.html", "structnk__list__view" ], + [ "nk_memory", "structnk__memory.html", "structnk__memory" ], + [ "nk_memory_status", "structnk__memory__status.html", "structnk__memory__status" ], + [ "nk_menu_state", "structnk__menu__state.html", "structnk__menu__state" ], + [ "nk_mouse", "structnk__mouse.html", "structnk__mouse" ], + [ "nk_mouse_button", "structnk__mouse__button.html", "structnk__mouse__button" ], + [ "nk_nine_slice", "structnk__nine__slice.html", "structnk__nine__slice" ], + [ "nk_page", "structnk__page.html", "structnk__page" ], + [ "nk_page_data", "unionnk__page__data.html", "unionnk__page__data" ], + [ "nk_page_element", "structnk__page__element.html", "structnk__page__element" ], + [ "nk_panel", "structnk__panel.html", "structnk__panel" ], + [ "nk_pool", "structnk__pool.html", "structnk__pool" ], + [ "nk_popup_buffer", "structnk__popup__buffer.html", "structnk__popup__buffer" ], + [ "nk_popup_state", "structnk__popup__state.html", "structnk__popup__state" ], + [ "nk_property", "unionnk__property.html", "unionnk__property" ], + [ "nk_property_state", "structnk__property__state.html", "structnk__property__state" ], + [ "nk_property_variant", "structnk__property__variant.html", "structnk__property__variant" ], + [ "nk_rect", "structnk__rect.html", "structnk__rect" ], + [ "nk_recti", "structnk__recti.html", "structnk__recti" ], + [ "nk_row_layout", "structnk__row__layout.html", "structnk__row__layout" ], + [ "nk_scroll", "structnk__scroll.html", "structnk__scroll" ], + [ "nk_str", "structnk__str.html", "structnk__str" ], + [ "nk_style", "structnk__style.html", "structnk__style" ], + [ "nk_style_button", "structnk__style__button.html", "structnk__style__button" ], + [ "nk_style_chart", "structnk__style__chart.html", "structnk__style__chart" ], + [ "nk_style_combo", "structnk__style__combo.html", "structnk__style__combo" ], + [ "nk_style_edit", "structnk__style__edit.html", "structnk__style__edit" ], + [ "nk_style_item", "structnk__style__item.html", "structnk__style__item" ], + [ "nk_style_item_data", "unionnk__style__item__data.html", "unionnk__style__item__data" ], + [ "nk_style_knob", "structnk__style__knob.html", "structnk__style__knob" ], + [ "nk_style_progress", "structnk__style__progress.html", "structnk__style__progress" ], + [ "nk_style_property", "structnk__style__property.html", "structnk__style__property" ], + [ "nk_style_scrollbar", "structnk__style__scrollbar.html", "structnk__style__scrollbar" ], + [ "nk_style_selectable", "structnk__style__selectable.html", "structnk__style__selectable" ], + [ "nk_style_slider", "structnk__style__slider.html", "structnk__style__slider" ], + [ "nk_style_tab", "structnk__style__tab.html", "structnk__style__tab" ], + [ "nk_style_text", "structnk__style__text.html", "structnk__style__text" ], + [ "nk_style_toggle", "structnk__style__toggle.html", "structnk__style__toggle" ], + [ "nk_style_window", "structnk__style__window.html", "structnk__style__window" ], + [ "nk_style_window_header", "structnk__style__window__header.html", "structnk__style__window__header" ], + [ "nk_table", "structnk__table.html", "structnk__table" ], + [ "nk_text", "structnk__text.html", "structnk__text" ], + [ "nk_text_edit", "structnk__text__edit.html", "structnk__text__edit" ], + [ "nk_text_edit_row", "structnk__text__edit__row.html", "structnk__text__edit__row" ], + [ "nk_text_find", "structnk__text__find.html", "structnk__text__find" ], + [ "nk_text_undo_record", "structnk__text__undo__record.html", "structnk__text__undo__record" ], + [ "nk_text_undo_state", "structnk__text__undo__state.html", "structnk__text__undo__state" ], + [ "nk_user_font", "structnk__user__font.html", "structnk__user__font" ], + [ "nk_vec2", "structnk__vec2.html", "structnk__vec2" ], + [ "nk_vec2i", "structnk__vec2i.html", "structnk__vec2i" ], + [ "nk_window", "structnk__window.html", "structnk__window" ], + [ "stbrp_context", "structstbrp__context.html", "structstbrp__context" ], + [ "stbrp_node", "structstbrp__node.html", "structstbrp__node" ], + [ "stbrp_rect", "structstbrp__rect.html", "structstbrp__rect" ], + [ "stbtt__bitmap", "structstbtt____bitmap.html", "structstbtt____bitmap" ], + [ "stbtt__buf", "structstbtt____buf.html", "structstbtt____buf" ], + [ "stbtt_aligned_quad", "structstbtt__aligned__quad.html", "structstbtt__aligned__quad" ], + [ "stbtt_bakedchar", "structstbtt__bakedchar.html", "structstbtt__bakedchar" ], + [ "stbtt_fontinfo", "structstbtt__fontinfo.html", "structstbtt__fontinfo" ], + [ "stbtt_kerningentry", "structstbtt__kerningentry.html", "structstbtt__kerningentry" ], + [ "stbtt_pack_context", "structstbtt__pack__context.html", "structstbtt__pack__context" ], + [ "stbtt_pack_range", "structstbtt__pack__range.html", "structstbtt__pack__range" ], + [ "stbtt_packedchar", "structstbtt__packedchar.html", "structstbtt__packedchar" ], + [ "stbtt_vertex", "structstbtt__vertex.html", "structstbtt__vertex" ] +]; \ No newline at end of file diff --git a/bc_s.png b/bc_s.png new file mode 100644 index 000000000..224b29aa9 Binary files /dev/null and b/bc_s.png differ diff --git a/bdwn.png b/bdwn.png new file mode 100644 index 000000000..940a0b950 Binary files /dev/null and b/bdwn.png differ diff --git a/build_8py_source.html b/build_8py_source.html new file mode 100644 index 000000000..cb56e6e05 --- /dev/null +++ b/build_8py_source.html @@ -0,0 +1,279 @@ + + + + + + + +Nuklear: src/build.py Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
build.py
+
+
+
1 
+
2 import fnmatch
+
3 import os.path
+
4 import sys
+
5 import re
+
6 
+
7 def print_help():
+
8  print(
+
9 """usage: python single_header_packer.py --macro <macro> [--intro <files>] --extern <files> --pub <files> --priv1 <files> --priv2 <files> [--outro <files>]
+
10 
+
11  where <files> can be a comma-separated list of files. e.g. --priv *.c,inc/*.h
+
12  or a space separated list encapsulated in quotes. e.g. --priv1 "file.c file2.c file3.c"
+
13 
+
14  The 'extern' files are placed between 'priv1' and 'priv2'.
+
15 
+
16  The resulting code is packed as follows:
+
17 
+
18  /*
+
19  [intro file contents]
+
20  */
+
21 
+
22  #ifndef <macro>_SINGLE_HEADER
+
23  #define <macro>_SINGLE_HEADER
+
24  [public header file contents]
+
25  #endif /* <macro>_SINGLE_HEADER */
+
26 
+
27  #ifdef <macro>_IMPLEMENTATION
+
28  [private header and source file contents]
+
29  #endif /* <macro>_IMPLEMENTATION */
+
30 
+
31  /*
+
32  [outro file contents]
+
33  */""")
+
34 
+
35 def parse_files(arg):
+
36  files = []
+
37  paths = re.split(r'[,\s]', arg)
+
38 
+
39  for path in paths:
+
40  if "*" in path:
+
41  # Wildcard
+
42  d = os.path.dirname(path)
+
43  if d == "": d = "."
+
44  if d == " ": continue
+
45  if not os.path.exists(d):
+
46  print(d + " does not exist.")
+
47  exit()
+
48 
+
49  wildcard = os.path.basename(path)
+
50  unsorted = []
+
51  for file in os.listdir(d):
+
52  if fnmatch.fnmatch(file, wildcard):
+
53  unsorted.append(os.path.join(d, file))
+
54  unsorted.sort()
+
55  files.extend(unsorted)
+
56 
+
57  else:
+
58  # Regular file
+
59  if not os.path.exists(path):
+
60  print(path + " does not exist.")
+
61  exit()
+
62  elif os.path.isdir(path):
+
63  print(path + " is a directory. Expected a file name.")
+
64  exit()
+
65  else:
+
66  files.append(path)
+
67 
+
68  return files;
+
69 
+
70 def omit_includes(str, files):
+
71  for file in files:
+
72  fname = os.path.basename(file)
+
73  if ".h" in file:
+
74  str = str.replace("#include \"" + fname + "\"", "");
+
75  str = str.replace("#include <" + fname + ">", "");
+
76  return str
+
77 
+
78 def fix_comments(str):
+
79  return re.sub(r"//(.*)(\n|$)", "/* \\1 */\\2", str)
+
80 
+
81 # Main start
+
82 # ==========
+
83 
+
84 if len(sys.argv) < 2:
+
85  print_help()
+
86  exit()
+
87 
+
88 intro_files = []
+
89 pub_files = []
+
90 priv_files1 = []
+
91 outro_files2 = []
+
92 extern_files = []
+
93 cur_arg = 1
+
94 macro = ""
+
95 
+
96 # Parse args
+
97 # ----------
+
98 while cur_arg < len(sys.argv):
+
99  if sys.argv[cur_arg] == "--help":
+
100  print_help()
+
101  exit()
+
102  elif sys.argv[cur_arg] == "--macro":
+
103  cur_arg += 1
+
104  macro = sys.argv[cur_arg]
+
105  elif sys.argv[cur_arg] == "--intro":
+
106  cur_arg += 1
+
107  intro_files = parse_files(sys.argv[cur_arg])
+
108  elif sys.argv[cur_arg] == "--pub":
+
109  cur_arg += 1
+
110  pub_files = parse_files(sys.argv[cur_arg])
+
111  elif sys.argv[cur_arg] == "--priv1":
+
112  cur_arg += 1
+
113  priv_files1 = parse_files(sys.argv[cur_arg])
+
114  elif sys.argv[cur_arg] == "--priv2":
+
115  cur_arg += 1
+
116  priv_files2 = parse_files(sys.argv[cur_arg])
+
117  elif sys.argv[cur_arg] == "--extern":
+
118  cur_arg += 1
+
119  extern_files = parse_files(sys.argv[cur_arg])
+
120  elif sys.argv[cur_arg] == "--outro":
+
121  cur_arg += 1
+
122  outro_files = parse_files(sys.argv[cur_arg])
+
123  else:
+
124  print("Unknown argument " + sys.argv[cur_arg])
+
125 
+
126  cur_arg += 1
+
127 
+
128 if macro == "":
+
129  print("Option --macro <macro> is mandatory")
+
130  exit()
+
131 
+
132 # Print concatenated output
+
133 # -------------------------
+
134 print("/*")
+
135 for f in intro_files:
+
136  sys.stdout.write(open(f, 'r').read())
+
137 print("*/")
+
138 
+
139 # print("\n#ifndef " + macro + "_SINGLE_HEADER");
+
140 # print("#define " + macro + "_SINGLE_HEADER");
+
141 print("#ifndef NK_SINGLE_FILE");
+
142 print(" #define NK_SINGLE_FILE");
+
143 print("#endif");
+
144 print("");
+
145 
+
146 for f in pub_files:
+
147  sys.stdout.write(open(f, 'r').read())
+
148 # print("#endif /* " + macro + "_SINGLE_HEADER */");
+
149 
+
150 print("\n#ifdef " + macro + "_IMPLEMENTATION");
+
151 print("");
+
152 
+
153 for f in priv_files1:
+
154  print(omit_includes(open(f, 'r').read(),
+
155  pub_files + priv_files1 + priv_files2 + extern_files))
+
156 for f in extern_files:
+
157  print(fix_comments(open(f, 'r').read()))
+
158 
+
159 for f in priv_files2:
+
160  print(omit_includes(open(f, 'r').read(),
+
161  pub_files + priv_files1 + priv_files2 + extern_files))
+
162 
+
163 print("#endif /* " + macro + "_IMPLEMENTATION */");
+
164 
+
165 print("\n/*")
+
166 for f in outro_files:
+
167  sys.stdout.write(open(f, 'r').read())
+
168 print("*/\n")
+
169 
+
+
+ + + + diff --git a/classes.html b/classes.html new file mode 100644 index 000000000..a42d65c46 --- /dev/null +++ b/classes.html @@ -0,0 +1,118 @@ + + + + + + + +Nuklear: Data Structure Index + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Data Structure Index
+
+
+
N | S
+ +
+
+ + + + diff --git a/closed.png b/closed.png new file mode 100644 index 000000000..98cc2c909 Binary files /dev/null and b/closed.png differ diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 000000000..22defa54d --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,117 @@ + + + + + + + +Nuklear: src Directory Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
src Directory Reference
+
+
+ + + + + +

+Files

file  nuklear.h [code]
 main API and documentation file
 
+
+
+ + + + diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/dir_68267d1309a1af8e8297ef4c3efbcdba.js new file mode 100644 index 000000000..5a6d00a15 --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -0,0 +1,50 @@ +var dir_68267d1309a1af8e8297ef4c3efbcdba = +[ + [ "build.py", "build_8py_source.html", null ], + [ "nuklear.h", "nuklear_8h.html", "nuklear_8h" ], + [ "nuklear_9slice.c", "nuklear__9slice_8c_source.html", null ], + [ "nuklear_buffer.c", "nuklear__buffer_8c_source.html", null ], + [ "nuklear_button.c", "nuklear__button_8c_source.html", null ], + [ "nuklear_chart.c", "nuklear__chart_8c_source.html", null ], + [ "nuklear_color.c", "nuklear__color_8c_source.html", null ], + [ "nuklear_color_picker.c", "nuklear__color__picker_8c_source.html", null ], + [ "nuklear_combo.c", "nuklear__combo_8c_source.html", null ], + [ "nuklear_context.c", "nuklear__context_8c_source.html", null ], + [ "nuklear_contextual.c", "nuklear__contextual_8c_source.html", null ], + [ "nuklear_draw.c", "nuklear__draw_8c_source.html", null ], + [ "nuklear_edit.c", "nuklear__edit_8c_source.html", null ], + [ "nuklear_font.c", "nuklear__font_8c_source.html", null ], + [ "nuklear_group.c", "nuklear__group_8c_source.html", null ], + [ "nuklear_image.c", "nuklear__image_8c_source.html", null ], + [ "nuklear_input.c", "nuklear__input_8c_source.html", null ], + [ "nuklear_internal.h", "nuklear__internal_8h_source.html", null ], + [ "nuklear_knob.c", "nuklear__knob_8c_source.html", null ], + [ "nuklear_layout.c", "nuklear__layout_8c_source.html", null ], + [ "nuklear_list_view.c", "nuklear__list__view_8c_source.html", null ], + [ "nuklear_math.c", "nuklear__math_8c_source.html", null ], + [ "nuklear_menu.c", "nuklear__menu_8c_source.html", null ], + [ "nuklear_page_element.c", "nuklear__page__element_8c_source.html", null ], + [ "nuklear_panel.c", "nuklear__panel_8c_source.html", null ], + [ "nuklear_pool.c", "nuklear__pool_8c_source.html", null ], + [ "nuklear_popup.c", "nuklear__popup_8c_source.html", null ], + [ "nuklear_progress.c", "nuklear__progress_8c_source.html", null ], + [ "nuklear_property.c", "nuklear__property_8c_source.html", null ], + [ "nuklear_scrollbar.c", "nuklear__scrollbar_8c_source.html", null ], + [ "nuklear_selectable.c", "nuklear__selectable_8c_source.html", null ], + [ "nuklear_slider.c", "nuklear__slider_8c_source.html", null ], + [ "nuklear_string.c", "nuklear__string_8c_source.html", null ], + [ "nuklear_style.c", "nuklear__style_8c_source.html", null ], + [ "nuklear_table.c", "nuklear__table_8c_source.html", null ], + [ "nuklear_text.c", "nuklear__text_8c_source.html", null ], + [ "nuklear_text_editor.c", "nuklear__text__editor_8c_source.html", null ], + [ "nuklear_toggle.c", "nuklear__toggle_8c_source.html", null ], + [ "nuklear_tooltip.c", "nuklear__tooltip_8c_source.html", null ], + [ "nuklear_tree.c", "nuklear__tree_8c_source.html", null ], + [ "nuklear_utf8.c", "nuklear__utf8_8c_source.html", null ], + [ "nuklear_util.c", "nuklear__util_8c_source.html", null ], + [ "nuklear_vertex.c", "nuklear__vertex_8c_source.html", null ], + [ "nuklear_widget.c", "nuklear__widget_8c_source.html", null ], + [ "nuklear_window.c", "nuklear__window_8c_source.html", null ], + [ "stb_rect_pack.h", "stb__rect__pack_8h_source.html", null ], + [ "stb_truetype.h", "stb__truetype_8h_source.html", null ] +]; \ No newline at end of file diff --git a/doc.png b/doc.png new file mode 100644 index 000000000..17edabff9 Binary files /dev/null and b/doc.png differ diff --git a/doxygen-awesome.css b/doxygen-awesome.css new file mode 100644 index 000000000..c2f41142f --- /dev/null +++ b/doxygen-awesome.css @@ -0,0 +1,2681 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +html { + /* primary theme color. This will affect the entire websites color scheme: links, arrows, labels, ... */ + --primary-color: #1779c4; + --primary-dark-color: #335c80; + --primary-light-color: #70b1e9; + + /* page base colors */ + --page-background-color: #ffffff; + --page-foreground-color: #2f4153; + --page-secondary-foreground-color: #6f7e8e; + + /* color for all separators on the website: hr, borders, ... */ + --separator-color: #dedede; + + /* border radius for all rounded components. Will affect many components, like dropdowns, memitems, codeblocks, ... */ + --border-radius-large: 8px; + --border-radius-small: 4px; + --border-radius-medium: 6px; + + /* default spacings. Most components reference these values for spacing, to provide uniform spacing on the page. */ + --spacing-small: 5px; + --spacing-medium: 10px; + --spacing-large: 16px; + + /* default box shadow used for raising an element above the normal content. Used in dropdowns, search result, ... */ + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); + + --odd-color: rgba(0,0,0,.028); + + /* font-families. will affect all text on the website + * font-family: the normal font for text, headlines, menus + * font-family-monospace: used for preformatted text in memtitle, code, fragments + */ + --font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif; + --font-family-monospace: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + + /* font sizes */ + --page-font-size: 15.6px; + --navigation-font-size: 14.4px; + --toc-font-size: 13.4px; + --code-font-size: 14px; /* affects code, fragment */ + --title-font-size: 22px; + + /* content text properties. These only affect the page content, not the navigation or any other ui elements */ + --content-line-height: 27px; + /* The content is centered and constraint in it's width. To make the content fill the whole page, set the variable to auto.*/ + --content-maxwidth: 1050px; + --table-line-height: 24px; + --toc-sticky-top: var(--spacing-medium); + --toc-width: 200px; + --toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 85px); + + /* colors for various content boxes: @warning, @note, @deprecated @bug */ + --warning-color: #faf3d8; + --warning-color-dark: #f3a600; + --warning-color-darker: #5f4204; + --note-color: #e4f3ff; + --note-color-dark: #1879C4; + --note-color-darker: #274a5c; + --todo-color: #e4dafd; + --todo-color-dark: #5b2bdd; + --todo-color-darker: #2a0d72; + --deprecated-color: #ecf0f3; + --deprecated-color-dark: #5b6269; + --deprecated-color-darker: #43454a; + --bug-color: #f8d1cc; + --bug-color-dark: #b61825; + --bug-color-darker: #75070f; + --invariant-color: #d8f1e3; + --invariant-color-dark: #44b86f; + --invariant-color-darker: #265532; + + /* blockquote colors */ + --blockquote-background: #f8f9fa; + --blockquote-foreground: #636568; + + /* table colors */ + --tablehead-background: #f1f1f1; + --tablehead-foreground: var(--page-foreground-color); + + /* menu-display: block | none + * Visibility of the top navigation on screens >= 768px. On smaller screen the menu is always visible. + * `GENERATE_TREEVIEW` MUST be enabled! + */ + --menu-display: block; + + --menu-focus-foreground: var(--page-background-color); + --menu-focus-background: var(--primary-color); + --menu-selected-background: rgba(0,0,0,.05); + + + --header-background: var(--page-background-color); + --header-foreground: var(--page-foreground-color); + + /* searchbar colors */ + --searchbar-background: var(--side-nav-background); + --searchbar-foreground: var(--page-foreground-color); + + /* searchbar size + * (`searchbar-width` is only applied on screens >= 768px. + * on smaller screens the searchbar will always fill the entire screen width) */ + --searchbar-height: 33px; + --searchbar-width: 210px; + --searchbar-border-radius: var(--searchbar-height); + + /* code block colors */ + --code-background: #f5f5f5; + --code-foreground: var(--page-foreground-color); + + /* fragment colors */ + --fragment-background: #F8F9FA; + --fragment-foreground: #37474F; + --fragment-keyword: #bb6bb2; + --fragment-keywordtype: #8258b3; + --fragment-keywordflow: #d67c3b; + --fragment-token: #438a59; + --fragment-comment: #969696; + --fragment-link: #5383d6; + --fragment-preprocessor: #46aaa5; + --fragment-linenumber-color: #797979; + --fragment-linenumber-background: #f4f4f5; + --fragment-linenumber-border: #e3e5e7; + --fragment-lineheight: 20px; + + /* sidebar navigation (treeview) colors */ + --side-nav-background: #fbfbfb; + --side-nav-foreground: var(--page-foreground-color); + --side-nav-arrow-opacity: 0; + --side-nav-arrow-hover-opacity: 0.9; + + --toc-background: var(--side-nav-background); + --toc-foreground: var(--side-nav-foreground); + + /* height of an item in any tree / collapsible table */ + --tree-item-height: 30px; + + --memname-font-size: var(--code-font-size); + --memtitle-font-size: 18px; + + --webkit-scrollbar-size: 7px; + --webkit-scrollbar-padding: 4px; + --webkit-scrollbar-color: var(--separator-color); + + --animation-duration: .12s +} + +@media screen and (max-width: 767px) { + html { + --page-font-size: 16px; + --navigation-font-size: 16px; + --toc-font-size: 15px; + --code-font-size: 15px; /* affects code, fragment */ + --title-font-size: 22px; + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.35); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; + } +} + +/* dark mode variables are defined twice, to support both the dark-mode without and with doxygen-awesome-darkmode-toggle.js */ +html.dark-mode { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.30); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; +} + +body { + color: var(--page-foreground-color); + background-color: var(--page-background-color); + font-size: var(--page-font-size); +} + +body, table, div, p, dl, #nav-tree .label, .title, +.sm-dox a, .sm-dox a:hover, .sm-dox a:focus, #projectname, +.SelectItem, #MSearchField, .navpath li.navelem a, +.navpath li.navelem a:hover, p.reference, p.definition, div.toc li, div.toc h3 { + font-family: var(--font-family); +} + +h1, h2, h3, h4, h5 { + margin-top: 1em; + font-weight: 600; + line-height: initial; +} + +p, div, table, dl, p.reference, p.definition { + font-size: var(--page-font-size); +} + +p.reference, p.definition { + color: var(--page-secondary-foreground-color); +} + +a:link, a:visited, a:hover, a:focus, a:active { + color: var(--primary-color) !important; + font-weight: 500; + background: none; +} + +a.anchor { + scroll-margin-top: var(--spacing-large); + display: block; +} + +/* + Title and top navigation + */ + +#top { + background: var(--header-background); + border-bottom: 1px solid var(--separator-color); +} + +@media screen and (min-width: 768px) { + #top { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + } +} + +#main-nav { + flex-grow: 5; + padding: var(--spacing-small) var(--spacing-medium); +} + +#titlearea { + width: auto; + padding: var(--spacing-medium) var(--spacing-large); + background: none; + color: var(--header-foreground); + border-bottom: none; +} + +@media screen and (max-width: 767px) { + #titlearea { + padding-bottom: var(--spacing-small); + } +} + +#titlearea table tbody tr { + height: auto !important; +} + +#projectname { + font-size: var(--title-font-size); + font-weight: 600; +} + +#projectnumber { + font-family: inherit; + font-size: 60%; +} + +#projectbrief { + font-family: inherit; + font-size: 80%; +} + +#projectlogo { + vertical-align: middle; +} + +#projectlogo img { + max-height: calc(var(--title-font-size) * 2); + margin-right: var(--spacing-small); +} + +.sm-dox, .tabs, .tabs2, .tabs3 { + background: none; + padding: 0; +} + +.tabs, .tabs2, .tabs3 { + border-bottom: 1px solid var(--separator-color); + margin-bottom: -1px; +} + +.main-menu-btn-icon, .main-menu-btn-icon:before, .main-menu-btn-icon:after { + background: var(--page-secondary-foreground-color); +} + +@media screen and (max-width: 767px) { + .sm-dox a span.sub-arrow { + background: var(--code-background); + } + + #main-menu a.has-submenu span.sub-arrow { + color: var(--page-secondary-foreground-color); + border-radius: var(--border-radius-medium); + } + + #main-menu a.has-submenu:hover span.sub-arrow { + color: var(--page-foreground-color); + } +} + +@media screen and (min-width: 768px) { + .sm-dox li, .tablist li { + display: var(--menu-display); + } + + .sm-dox a span.sub-arrow { + border-color: var(--header-foreground) transparent transparent transparent; + } + + .sm-dox a:hover span.sub-arrow { + border-color: var(--menu-focus-foreground) transparent transparent transparent; + } + + .sm-dox ul a span.sub-arrow { + border-color: transparent transparent transparent var(--page-foreground-color); + } + + .sm-dox ul a:hover span.sub-arrow { + border-color: transparent transparent transparent var(--menu-focus-foreground); + } +} + +.sm-dox ul { + background: var(--page-background-color); + box-shadow: var(--box-shadow); + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium) !important; + padding: var(--spacing-small); + animation: ease-out 150ms slideInMenu; +} + +@keyframes slideInMenu { + from { + opacity: 0; + transform: translate(0px, -2px); + } + + to { + opacity: 1; + transform: translate(0px, 0px); + } +} + +.sm-dox ul a { + color: var(--page-foreground-color) !important; + background: var(--page-background-color); + font-size: var(--navigation-font-size); +} + +.sm-dox>li>ul:after { + border-bottom-color: var(--page-background-color) !important; +} + +.sm-dox>li>ul:before { + border-bottom-color: var(--separator-color) !important; +} + +.sm-dox ul a:hover, .sm-dox ul a:active, .sm-dox ul a:focus { + font-size: var(--navigation-font-size) !important; + color: var(--menu-focus-foreground) !important; + text-shadow: none; + background-color: var(--menu-focus-background); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a, .sm-dox a:focus, .tablist li, .tablist li a, .tablist li.current a { + text-shadow: none; + background: transparent; + background-image: none !important; + color: var(--header-foreground) !important; + font-weight: normal; + font-size: var(--navigation-font-size); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a:focus { + outline: auto; +} + +.sm-dox a:hover, .sm-dox a:active, .tablist li a:hover { + text-shadow: none; + font-weight: normal; + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; + border-radius: var(--border-radius-small) !important; + font-size: var(--navigation-font-size); +} + +.tablist li.current { + border-radius: var(--border-radius-small); + background: var(--menu-selected-background); +} + +.tablist li { + margin: var(--spacing-small) 0 var(--spacing-small) var(--spacing-small); +} + +.tablist a { + padding: 0 var(--spacing-large); +} + + +/* + Search box + */ + +#MSearchBox { + height: var(--searchbar-height); + background: var(--searchbar-background); + border-radius: var(--searchbar-border-radius); + border: 1px solid var(--separator-color); + overflow: hidden; + width: var(--searchbar-width); + position: relative; + box-shadow: none; + display: block; + margin-top: 0; +} + +/* until Doxygen 1.9.4 */ +.left img#MSearchSelect { + left: 0; + user-select: none; + padding-left: 8px; +} + +/* Doxygen 1.9.5 */ +.left span#MSearchSelect { + left: 0; + user-select: none; + margin-left: 8px; + padding: 0; +} + +.left #MSearchSelect[src$=".png"] { + padding-left: 0 +} + +.SelectionMark { + user-select: none; +} + +.tabs .left #MSearchSelect { + padding-left: 0; +} + +.tabs #MSearchBox { + position: absolute; + right: var(--spacing-medium); +} + +@media screen and (max-width: 767px) { + .tabs #MSearchBox { + position: relative; + right: 0; + margin-left: var(--spacing-medium); + margin-top: 0; + } +} + +#MSearchSelectWindow, #MSearchResultsWindow { + z-index: 9999; +} + +#MSearchBox.MSearchBoxActive { + border-color: var(--primary-color); + box-shadow: inset 0 0 0 1px var(--primary-color); +} + +#main-menu > li:last-child { + margin-right: 0; +} + +@media screen and (max-width: 767px) { + #main-menu > li:last-child { + height: 50px; + } +} + +#MSearchField { + font-size: var(--navigation-font-size); + height: calc(var(--searchbar-height) - 2px); + background: transparent; + width: calc(var(--searchbar-width) - 64px); +} + +.MSearchBoxActive #MSearchField { + color: var(--searchbar-foreground); +} + +#MSearchSelect { + top: calc(calc(var(--searchbar-height) / 2) - 11px); +} + +#MSearchBox span.left, #MSearchBox span.right { + background: none; + background-image: none; +} + +#MSearchBox span.right { + padding-top: calc(calc(var(--searchbar-height) / 2) - 12px); + position: absolute; + right: var(--spacing-small); +} + +.tabs #MSearchBox span.right { + top: calc(calc(var(--searchbar-height) / 2) - 12px); +} + +@keyframes slideInSearchResults { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } +} + +#MSearchResultsWindow { + left: auto !important; + right: var(--spacing-medium); + border-radius: var(--border-radius-large); + border: 1px solid var(--separator-color); + transform: translate(0, 20px); + box-shadow: var(--box-shadow); + animation: ease-out 280ms slideInSearchResults; + background: var(--page-background-color); +} + +iframe#MSearchResults { + margin: 4px; +} + +iframe { + color-scheme: normal; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) iframe#MSearchResults { + filter: invert() hue-rotate(180deg); + } +} + +html.dark-mode iframe#MSearchResults { + filter: invert() hue-rotate(180deg); +} + +#MSearchResults .SRPage { + background-color: transparent; +} + +#MSearchResults .SRPage .SREntry { + font-size: 10pt; + padding: var(--spacing-small) var(--spacing-medium); +} + +#MSearchSelectWindow { + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + box-shadow: var(--box-shadow); + background: var(--page-background-color); + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); +} + +#MSearchSelectWindow a.SelectItem { + font-size: var(--navigation-font-size); + line-height: var(--content-line-height); + margin: 0 var(--spacing-small); + border-radius: var(--border-radius-small); + color: var(--page-foreground-color) !important; + font-weight: normal; +} + +#MSearchSelectWindow a.SelectItem:hover { + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; +} + +@media screen and (max-width: 767px) { + #MSearchBox { + margin-top: var(--spacing-medium); + margin-bottom: var(--spacing-medium); + width: calc(100vw - 30px); + } + + #main-menu > li:last-child { + float: none !important; + } + + #MSearchField { + width: calc(100vw - 110px); + } + + @keyframes slideInSearchResultsMobile { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } + } + + #MSearchResultsWindow { + left: var(--spacing-medium) !important; + right: var(--spacing-medium); + overflow: auto; + transform: translate(0, 20px); + animation: ease-out 280ms slideInSearchResultsMobile; + width: auto !important; + } + + /* + * Overwrites for fixing the searchbox on mobile in doxygen 1.9.2 + */ + label.main-menu-btn ~ #searchBoxPos1 { + top: 3px !important; + right: 6px !important; + left: 45px; + display: flex; + } + + label.main-menu-btn ~ #searchBoxPos1 > #MSearchBox { + margin-top: 0; + margin-bottom: 0; + flex-grow: 2; + float: left; + } +} + +/* + Tree view + */ + +#side-nav { + padding: 0 !important; + background: var(--side-nav-background); + min-width: 8px; + max-width: 50vw; +} + +@media screen and (max-width: 767px) { + #side-nav { + display: none; + } + + #doc-content { + margin-left: 0 !important; + } +} + +#nav-tree { + background: transparent; + margin-right: 1px; +} + +#nav-tree .label { + font-size: var(--navigation-font-size); +} + +#nav-tree .item { + height: var(--tree-item-height); + line-height: var(--tree-item-height); + overflow: hidden; + text-overflow: ellipsis; +} + +#nav-tree .item > a:focus { + outline: none; +} + +#nav-sync { + bottom: 12px; + right: 12px; + top: auto !important; + user-select: none; +} + +#nav-tree .selected { + text-shadow: none; + background-image: none; + background-color: transparent; + position: relative; + color: var(--primary-color) !important; + font-weight: 500; +} + +#nav-tree .selected::after { + content: ""; + position: absolute; + top: 1px; + bottom: 1px; + left: 0; + width: 4px; + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + background: var(--primary-color); +} + + +#nav-tree a { + color: var(--side-nav-foreground) !important; + font-weight: normal; +} + +#nav-tree a:focus { + outline-style: auto; +} + +#nav-tree .arrow { + opacity: var(--side-nav-arrow-opacity); + background: none; +} + +.arrow { + color: inherit; + cursor: pointer; + font-size: 45%; + vertical-align: middle; + margin-right: 2px; + font-family: serif; + height: auto; + text-align: right; +} + +#nav-tree div.item:hover .arrow, #nav-tree a:focus .arrow { + opacity: var(--side-nav-arrow-hover-opacity); +} + +#nav-tree .selected a { + color: var(--primary-color) !important; + font-weight: bolder; + font-weight: 600; +} + +.ui-resizable-e { + width: 4px; + background: transparent; + box-shadow: inset -1px 0 0 0 var(--separator-color); +} + +/* + Contents + */ + +div.header { + border-bottom: 1px solid var(--separator-color); + background-color: var(--page-background-color); + background-image: none; +} + +@media screen and (min-width: 1000px) { + #doc-content > div > div.contents, + .PageDoc > div.contents { + display: flex; + flex-direction: row-reverse; + flex-wrap: nowrap; + align-items: flex-start; + } + + div.contents .textblock { + min-width: 200px; + flex-grow: 1; + } +} + +div.contents, div.header .title, div.header .summary { + max-width: var(--content-maxwidth); +} + +div.contents, div.header .title { + line-height: initial; + margin: calc(var(--spacing-medium) + .2em) auto var(--spacing-medium) auto; +} + +div.header .summary { + margin: var(--spacing-medium) auto 0 auto; +} + +div.headertitle { + padding: 0; +} + +div.header .title { + font-weight: 600; + font-size: 225%; + padding: var(--spacing-medium) var(--spacing-large); + word-break: break-word; +} + +div.header .summary { + width: auto; + display: block; + float: none; + padding: 0 var(--spacing-large); +} + +td.memSeparator { + border-color: var(--separator-color); +} + +span.mlabel { + background: var(--primary-color); + border: none; + padding: 4px 9px; + border-radius: 12px; + margin-right: var(--spacing-medium); +} + +span.mlabel:last-of-type { + margin-right: 2px; +} + +div.contents { + padding: 0 var(--spacing-large); +} + +div.contents p, div.contents li { + line-height: var(--content-line-height); +} + +div.contents div.dyncontent { + margin: var(--spacing-medium) 0; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) div.contents div.dyncontent img, + html:not(.light-mode) div.contents center img, + html:not(.light-mode) div.contents > table img, + html:not(.light-mode) div.contents div.dyncontent iframe, + html:not(.light-mode) div.contents center iframe, + html:not(.light-mode) div.contents table iframe, + html:not(.light-mode) div.contents .dotgraph iframe { + filter: brightness(89%) hue-rotate(180deg) invert(); + } +} + +html.dark-mode div.contents div.dyncontent img, +html.dark-mode div.contents center img, +html.dark-mode div.contents > table img, +html.dark-mode div.contents div.dyncontent iframe, +html.dark-mode div.contents center iframe, +html.dark-mode div.contents table iframe, +html.dark-mode div.contents .dotgraph iframe + { + filter: brightness(89%) hue-rotate(180deg) invert(); +} + +h2.groupheader { + border-bottom: 0px; + color: var(--page-foreground-color); + box-shadow: + 100px 0 var(--page-background-color), + -100px 0 var(--page-background-color), + 100px 0.75px var(--separator-color), + -100px 0.75px var(--separator-color), + 500px 0 var(--page-background-color), + -500px 0 var(--page-background-color), + 500px 0.75px var(--separator-color), + -500px 0.75px var(--separator-color), + 900px 0 var(--page-background-color), + -900px 0 var(--page-background-color), + 900px 0.75px var(--separator-color), + -900px 0.75px var(--separator-color), + 1400px 0 var(--page-background-color), + -1400px 0 var(--page-background-color), + 1400px 0.75px var(--separator-color), + -1400px 0.75px var(--separator-color), + 1900px 0 var(--page-background-color), + -1900px 0 var(--page-background-color), + 1900px 0.75px var(--separator-color), + -1900px 0.75px var(--separator-color); +} + +blockquote { + margin: 0 var(--spacing-medium) 0 var(--spacing-medium); + padding: var(--spacing-small) var(--spacing-large); + background: var(--blockquote-background); + color: var(--blockquote-foreground); + border-left: 0; + overflow: visible; + border-radius: var(--border-radius-medium); + overflow: visible; + position: relative; +} + +blockquote::before, blockquote::after { + font-weight: bold; + font-family: serif; + font-size: 360%; + opacity: .15; + position: absolute; +} + +blockquote::before { + content: "“"; + left: -10px; + top: 4px; +} + +blockquote::after { + content: "”"; + right: -8px; + bottom: -25px; +} + +blockquote p { + margin: var(--spacing-small) 0 var(--spacing-medium) 0; +} +.paramname, .paramname em { + font-weight: 600; + color: var(--primary-dark-color); +} + +.paramname > code { + border: 0; +} + +table.params .paramname { + font-weight: 600; + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + padding-right: var(--spacing-small); + line-height: var(--table-line-height); +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--primary-light-color); +} + +.alphachar a { + color: var(--page-foreground-color); +} + +.dotgraph { + max-width: 100%; + overflow-x: scroll; +} + +.dotgraph .caption { + position: sticky; + left: 0; +} + +/* Wrap Graphviz graphs with the `interactive_dotgraph` class if `INTERACTIVE_SVG = YES` */ +.interactive_dotgraph .dotgraph iframe { + max-width: 100%; +} + +/* + Table of Contents + */ + +div.contents .toc { + max-height: var(--toc-max-height); + min-width: var(--toc-width); + border: 0; + border-left: 1px solid var(--separator-color); + border-radius: 0; + background-color: var(--page-background-color); + box-shadow: none; + position: sticky; + top: var(--toc-sticky-top); + padding: 0 var(--spacing-large); + margin: var(--spacing-small) 0 var(--spacing-large) var(--spacing-large); +} + +div.toc h3 { + color: var(--toc-foreground); + font-size: var(--navigation-font-size); + margin: var(--spacing-large) 0 var(--spacing-medium) 0; +} + +div.toc li { + padding: 0; + background: none; + line-height: var(--toc-font-size); + margin: var(--toc-font-size) 0 0 0; +} + +div.toc li::before { + display: none; +} + +div.toc ul { + margin-top: 0 +} + +div.toc li a { + font-size: var(--toc-font-size); + color: var(--page-foreground-color) !important; + text-decoration: none; +} + +div.toc li a:hover, div.toc li a.active { + color: var(--primary-color) !important; +} + +div.toc li a.aboveActive { + color: var(--page-secondary-foreground-color) !important; +} + + +@media screen and (max-width: 999px) { + div.contents .toc { + max-height: 45vh; + float: none; + width: auto; + margin: 0 0 var(--spacing-medium) 0; + position: relative; + top: 0; + position: relative; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + background-color: var(--toc-background); + box-shadow: var(--box-shadow); + } + + div.contents .toc.interactive { + max-height: calc(var(--navigation-font-size) + 2 * var(--spacing-large)); + overflow: hidden; + } + + div.contents .toc > h3 { + -webkit-tap-highlight-color: transparent; + cursor: pointer; + position: sticky; + top: 0; + background-color: var(--toc-background); + margin: 0; + padding: var(--spacing-large) 0; + display: block; + } + + div.contents .toc.interactive > h3::before { + content: ""; + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + display: inline-block; + margin-right: var(--spacing-small); + margin-bottom: calc(var(--navigation-font-size) / 4); + transform: rotate(-90deg); + transition: transform var(--animation-duration) ease-out; + } + + div.contents .toc.interactive.open > h3::before { + transform: rotate(0deg); + } + + div.contents .toc.interactive.open { + max-height: 45vh; + overflow: auto; + transition: max-height 0.2s ease-in-out; + } + + div.contents .toc a, div.contents .toc a.active { + color: var(--primary-color) !important; + } + + div.contents .toc a:hover { + text-decoration: underline; + } +} + +/* + Code & Fragments + */ + +code, div.fragment, pre.fragment { + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + overflow: hidden; +} + +code { + display: inline; + background: var(--code-background); + color: var(--code-foreground); + padding: 2px 6px; +} + +div.fragment, pre.fragment { + margin: var(--spacing-medium) 0; + padding: calc(var(--spacing-large) - (var(--spacing-large) / 6)) var(--spacing-large); + background: var(--fragment-background); + color: var(--fragment-foreground); + overflow-x: auto; +} + +@media screen and (max-width: 767px) { + div.fragment, pre.fragment { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; + } + + .contents > div.fragment, + .textblock > div.fragment, + .textblock > pre.fragment, + .textblock > .tabbed > ul > li > div.fragment, + .textblock > .tabbed > ul > li > pre.fragment, + .contents > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > pre.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + border-radius: 0; + border-left: 0; + } + + .textblock li > .fragment, + .textblock li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + } + + .memdoc li > .fragment, + .memdoc li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + } + + .textblock ul, .memdoc ul { + overflow: initial; + } + + .memdoc > div.fragment, + .memdoc > pre.fragment, + dl dd > div.fragment, + dl dd pre.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > div.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > pre.fragment, + dl dd > .doxygen-awesome-fragment-wrapper > div.fragment, + dl dd .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + border-radius: 0; + border-left: 0; + } +} + +code, code a, pre.fragment, div.fragment, div.fragment .line, div.fragment span, div.fragment .line a, div.fragment .line span { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size) !important; +} + +div.line:after { + margin-right: var(--spacing-medium); +} + +div.fragment .line, pre.fragment { + white-space: pre; + word-wrap: initial; + line-height: var(--fragment-lineheight); +} + +div.fragment span.keyword { + color: var(--fragment-keyword); +} + +div.fragment span.keywordtype { + color: var(--fragment-keywordtype); +} + +div.fragment span.keywordflow { + color: var(--fragment-keywordflow); +} + +div.fragment span.stringliteral { + color: var(--fragment-token) +} + +div.fragment span.comment { + color: var(--fragment-comment); +} + +div.fragment a.code { + color: var(--fragment-link) !important; +} + +div.fragment span.preprocessor { + color: var(--fragment-preprocessor); +} + +div.fragment span.lineno { + display: inline-block; + width: 27px; + border-right: none; + background: var(--fragment-linenumber-background); + color: var(--fragment-linenumber-color); +} + +div.fragment span.lineno a { + background: none; + color: var(--fragment-link) !important; +} + +div.fragment > .line:first-child .lineno { + box-shadow: -999999px 0px 0 999999px var(--fragment-linenumber-background), -999998px 0px 0 999999px var(--fragment-linenumber-border); + background-color: var(--fragment-linenumber-background) !important; +} + +div.line { + border-radius: var(--border-radius-small); +} + +div.line.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +/* + dl warning, attention, note, deprecated, bug, ... + */ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.note, dl.deprecated, dl.bug, dl.invariant, dl.pre, dl.post, dl.todo, dl.remark { + padding: var(--spacing-medium); + margin: var(--spacing-medium) 0; + color: var(--page-background-color); + overflow: hidden; + margin-left: 0; + border-radius: var(--border-radius-small); +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention { + background: var(--warning-color); + border-left: 8px solid var(--warning-color-dark); + color: var(--warning-color-darker); +} + +dl.warning dt, dl.attention dt { + color: var(--warning-color-dark); +} + +dl.note, dl.remark { + background: var(--note-color); + border-left: 8px solid var(--note-color-dark); + color: var(--note-color-darker); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-dark); +} + +dl.todo { + background: var(--todo-color); + border-left: 8px solid var(--todo-color-dark); + color: var(--todo-color-darker); +} + +dl.todo dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug { + background: var(--bug-color); + border-left: 8px solid var(--bug-color-dark); + color: var(--bug-color-darker); +} + +dl.bug dt a { + color: var(--bug-color-dark) !important; +} + +dl.deprecated { + background: var(--deprecated-color); + border-left: 8px solid var(--deprecated-color-dark); + color: var(--deprecated-color-darker); +} + +dl.deprecated dt a { + color: var(--deprecated-color-dark) !important; +} + +dl.section dd, dl.bug dd, dl.deprecated dd, dl.todo dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color); + border-left: 8px solid var(--invariant-color-dark); + color: var(--invariant-color-darker); +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-dark); +} + +/* + memitem + */ + +div.memdoc, div.memproto, h2.memtitle { + box-shadow: none; + background-image: none; + border: none; +} + +div.memdoc { + padding: 0 var(--spacing-medium); + background: var(--page-background-color); +} + +h2.memtitle, div.memitem { + border: 1px solid var(--separator-color); + box-shadow: var(--box-shadow); +} + +h2.memtitle { + box-shadow: 0px var(--spacing-medium) 0 -1px var(--fragment-background), var(--box-shadow); +} + +div.memitem { + transition: none; +} + +div.memproto, h2.memtitle { + background: var(--fragment-background); +} + +h2.memtitle { + font-weight: 500; + font-size: var(--memtitle-font-size); + font-family: var(--font-family-monospace); + border-bottom: none; + border-top-left-radius: var(--border-radius-medium); + border-top-right-radius: var(--border-radius-medium); + word-break: break-all; + position: relative; +} + +h2.memtitle:after { + content: ""; + display: block; + background: var(--fragment-background); + height: var(--spacing-medium); + bottom: calc(0px - var(--spacing-medium)); + left: 0; + right: -14px; + position: absolute; + border-top-right-radius: var(--border-radius-medium); +} + +h2.memtitle > span.permalink { + font-size: inherit; +} + +h2.memtitle > span.permalink > a { + text-decoration: none; + padding-left: 3px; + margin-right: -4px; + user-select: none; + display: inline-block; + margin-top: -6px; +} + +h2.memtitle > span.permalink > a:hover { + color: var(--primary-dark-color) !important; +} + +a:target + h2.memtitle, a:target + h2.memtitle + div.memitem { + border-color: var(--primary-light-color); +} + +div.memitem { + border-top-right-radius: var(--border-radius-medium); + border-bottom-right-radius: var(--border-radius-medium); + border-bottom-left-radius: var(--border-radius-medium); + overflow: hidden; + display: block !important; +} + +div.memdoc { + border-radius: 0; +} + +div.memproto { + border-radius: 0 var(--border-radius-small) 0 0; + overflow: auto; + border-bottom: 1px solid var(--separator-color); + padding: var(--spacing-medium); + margin-bottom: -1px; +} + +div.memtitle { + border-top-right-radius: var(--border-radius-medium); + border-top-left-radius: var(--border-radius-medium); +} + +div.memproto table.memname { + font-family: var(--font-family-monospace); + color: var(--page-foreground-color); + font-size: var(--memname-font-size); + text-shadow: none; +} + +div.memproto div.memtemplate { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--memname-font-size); + margin-left: 2px; + text-shadow: none; +} + +table.mlabels, table.mlabels > tbody { + display: block; +} + +td.mlabels-left { + width: auto; +} + +td.mlabels-right { + margin-top: 3px; + position: sticky; + left: 0; +} + +table.mlabels > tbody > tr:first-child { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.memname, .memitem span.mlabels { + margin: 0 +} + +/* + reflist + */ + +dl.reflist { + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-medium); + border: 1px solid var(--separator-color); + overflow: hidden; + padding: 0; +} + + +dl.reflist dt, dl.reflist dd { + box-shadow: none; + text-shadow: none; + background-image: none; + border: none; + padding: 12px; +} + + +dl.reflist dt { + font-weight: 500; + border-radius: 0; + background: var(--code-background); + border-bottom: 1px solid var(--separator-color); + color: var(--page-foreground-color) +} + + +dl.reflist dd { + background: none; +} + +/* + Table + */ + +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname), +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: inline-block; + max-width: 100%; +} + +.contents > table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname):not(.classindex) { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); +} + +table.fieldtable, +table.markdownTable tbody, +table.doxtable tbody { + border: none; + margin: var(--spacing-medium) 0; + box-shadow: 0 0 0 1px var(--separator-color); + border-radius: var(--border-radius-small); +} + +table.markdownTable, table.doxtable, table.fieldtable { + padding: 1px; +} + +table.doxtable caption { + display: block; +} + +table.fieldtable { + border-collapse: collapse; + width: 100%; +} + +th.markdownTableHeadLeft, +th.markdownTableHeadRight, +th.markdownTableHeadCenter, +th.markdownTableHeadNone, +table.doxtable th { + background: var(--tablehead-background); + color: var(--tablehead-foreground); + font-weight: 600; + font-size: var(--page-font-size); +} + +th.markdownTableHeadLeft:first-child, +th.markdownTableHeadRight:first-child, +th.markdownTableHeadCenter:first-child, +th.markdownTableHeadNone:first-child, +table.doxtable tr th:first-child { + border-top-left-radius: var(--border-radius-small); +} + +th.markdownTableHeadLeft:last-child, +th.markdownTableHeadRight:last-child, +th.markdownTableHeadCenter:last-child, +th.markdownTableHeadNone:last-child, +table.doxtable tr th:last-child { + border-top-right-radius: var(--border-radius-small); +} + +table.markdownTable td, +table.markdownTable th, +table.fieldtable td, +table.fieldtable th, +table.doxtable td, +table.doxtable th { + border: 1px solid var(--separator-color); + padding: var(--spacing-small) var(--spacing-medium); +} + +table.markdownTable td:last-child, +table.markdownTable th:last-child, +table.fieldtable td:last-child, +table.fieldtable th:last-child, +table.doxtable td:last-child, +table.doxtable th:last-child { + border-right: none; +} + +table.markdownTable td:first-child, +table.markdownTable th:first-child, +table.fieldtable td:first-child, +table.fieldtable th:first-child, +table.doxtable td:first-child, +table.doxtable th:first-child { + border-left: none; +} + +table.markdownTable tr:first-child td, +table.markdownTable tr:first-child th, +table.fieldtable tr:first-child td, +table.fieldtable tr:first-child th, +table.doxtable tr:first-child td, +table.doxtable tr:first-child th { + border-top: none; +} + +table.markdownTable tr:last-child td, +table.markdownTable tr:last-child th, +table.fieldtable tr:last-child td, +table.fieldtable tr:last-child th, +table.doxtable tr:last-child td, +table.doxtable tr:last-child th { + border-bottom: none; +} + +table.markdownTable tr, table.doxtable tr { + border-bottom: 1px solid var(--separator-color); +} + +table.markdownTable tr:last-child, table.doxtable tr:last-child { + border-bottom: none; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) { + display: block; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: table; + width: 100%; +} + +table.fieldtable th { + font-size: var(--page-font-size); + font-weight: 600; + background-image: none; + background-color: var(--tablehead-background); + color: var(--tablehead-foreground); +} + +table.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit, .fieldtable td.fielddoc, .fieldtable th { + border-bottom: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); +} + +table.fieldtable tr:last-child td:first-child { + border-bottom-left-radius: var(--border-radius-small); +} + +table.fieldtable tr:last-child td:last-child { + border-bottom-right-radius: var(--border-radius-small); +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +table.memberdecls { + display: block; + -webkit-tap-highlight-color: transparent; +} + +table.memberdecls tr[class^='memitem'] { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); +} + +table.memberdecls tr[class^='memitem'] .memTemplParams { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + color: var(--primary-dark-color); + white-space: normal; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memItemRight, +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight, +table.memberdecls .memTemplParams { + transition: none; + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + background-color: var(--fragment-background); +} + +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight { + padding-top: 2px; +} + +table.memberdecls .memTemplParams { + border-bottom: 0; + border-left: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + padding-bottom: var(--spacing-small); +} + +table.memberdecls .memTemplItemLeft { + border-radius: 0 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + border-top: 0; +} + +table.memberdecls .memTemplItemRight { + border-radius: 0 0 var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-left: 0; + border-top: 0; +} + +table.memberdecls .memItemLeft { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + padding-left: var(--spacing-medium); + padding-right: 0; +} + +table.memberdecls .memItemRight { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-right: var(--spacing-medium); + padding-left: 0; + +} + +table.memberdecls .mdescLeft, table.memberdecls .mdescRight { + background: none; + color: var(--page-foreground-color); + padding: var(--spacing-small) 0; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memTemplItemLeft { + padding-right: var(--spacing-medium); +} + +table.memberdecls .memSeparator { + background: var(--page-background-color); + height: var(--spacing-large); + border: 0; + transition: none; +} + +table.memberdecls .groupheader { + margin-bottom: var(--spacing-large); +} + +table.memberdecls .inherit_header td { + padding: 0 0 var(--spacing-medium) 0; + text-indent: -12px; + color: var(--page-secondary-foreground-color); +} + +table.memberdecls img[src="closed.png"], +table.memberdecls img[src="open.png"], +div.dynheader img[src="open.png"], +div.dynheader img[src="closed.png"] { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + margin-top: 8px; + display: block; + float: left; + margin-left: -10px; + transition: transform var(--animation-duration) ease-out; +} + +table.memberdecls img { + margin-right: 10px; +} + +table.memberdecls img[src="closed.png"], +div.dynheader img[src="closed.png"] { + transform: rotate(-90deg); + +} + +.compoundTemplParams { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--code-font-size); +} + +@media screen and (max-width: 767px) { + + table.memberdecls .memItemLeft, + table.memberdecls .memItemRight, + table.memberdecls .mdescLeft, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemLeft, + table.memberdecls .memTemplItemRight, + table.memberdecls .memTemplParams { + display: block; + text-align: left; + padding-left: var(--spacing-large); + margin: 0 calc(0px - var(--spacing-large)) 0 calc(0px - var(--spacing-large)); + border-right: none; + border-left: none; + border-radius: 0; + white-space: normal; + } + + table.memberdecls .memItemLeft, + table.memberdecls .mdescLeft, + table.memberdecls .memTemplItemLeft { + border-bottom: 0; + padding-bottom: 0; + } + + table.memberdecls .memTemplItemLeft { + padding-top: 0; + } + + table.memberdecls .mdescLeft { + margin-bottom: calc(0px - var(--page-font-size)); + } + + table.memberdecls .memItemRight, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemRight { + border-top: 0; + padding-top: 0; + padding-right: var(--spacing-large); + overflow-x: auto; + } + + table.memberdecls tr[class^='memitem']:not(.inherit) { + display: block; + width: calc(100vw - 2 * var(--spacing-large)); + } + + table.memberdecls .mdescRight { + color: var(--page-foreground-color); + } + + table.memberdecls tr.inherit { + visibility: hidden; + } + + table.memberdecls tr[style="display: table-row;"] { + display: block !important; + visibility: visible; + width: calc(100vw - 2 * var(--spacing-large)); + animation: fade .5s; + } + + @keyframes fade { + 0% { + opacity: 0; + max-height: 0; + } + + 100% { + opacity: 1; + max-height: 200px; + } + } +} + + +/* + Horizontal Rule + */ + +hr { + margin-top: var(--spacing-large); + margin-bottom: var(--spacing-large); + height: 1px; + background-color: var(--separator-color); + border: 0; +} + +.contents hr { + box-shadow: 100px 0 var(--separator-color), + -100px 0 var(--separator-color), + 500px 0 var(--separator-color), + -500px 0 var(--separator-color), + 900px 0 var(--separator-color), + -900px 0 var(--separator-color), + 1400px 0 var(--separator-color), + -1400px 0 var(--separator-color), + 1900px 0 var(--separator-color), + -1900px 0 var(--separator-color); +} + +.contents img, .contents .center, .contents center, .contents div.image object { + max-width: 100%; + overflow: auto; +} + +@media screen and (max-width: 767px) { + .contents .dyncontent > .center, .contents > center { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); + } +} + +/* + Directories + */ +div.directory { + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + width: auto; +} + +table.directory { + font-family: var(--font-family); + font-size: var(--page-font-size); + font-weight: normal; + width: 100%; +} + +table.directory td.entry, table.directory td.desc { + padding: calc(var(--spacing-small) / 2) var(--spacing-small); + line-height: var(--table-line-height); +} + +table.directory tr.even td:last-child { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; +} + +table.directory tr.even td:first-child { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); +} + +table.directory tr.even:last-child td:last-child { + border-radius: 0 var(--border-radius-small) 0 0; +} + +table.directory tr.even:last-child td:first-child { + border-radius: var(--border-radius-small) 0 0 0; +} + +table.directory td.desc { + min-width: 250px; +} + +table.directory tr.even { + background-color: var(--odd-color); +} + +table.directory tr.odd { + background-color: transparent; +} + +.icona { + width: auto; + height: auto; + margin: 0 var(--spacing-small); +} + +.icon { + background: var(--primary-color); + border-radius: var(--border-radius-small); + font-size: var(--page-font-size); + padding: calc(var(--page-font-size) / 5); + line-height: var(--page-font-size); + transform: scale(0.8); + height: auto; + width: var(--page-font-size); + user-select: none; +} + +.iconfopen, .icondoc, .iconfclosed { + background-position: center; + margin-bottom: 0; + height: var(--table-line-height); +} + +.icondoc { + filter: saturate(0.2); +} + +@media screen and (max-width: 767px) { + div.directory { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) .iconfopen, html:not(.light-mode) .iconfclosed { + filter: hue-rotate(180deg) invert(); + } +} + +html.dark-mode .iconfopen, html.dark-mode .iconfclosed { + filter: hue-rotate(180deg) invert(); +} + +/* + Class list + */ + +.classindex dl.odd { + background: var(--odd-color); + border-radius: var(--border-radius-small); +} + +.classindex dl.even { + background-color: transparent; +} + +/* + Class Index Doxygen 1.8 +*/ + +table.classindex { + margin-left: 0; + margin-right: 0; + width: 100%; +} + +table.classindex table div.ah { + background-image: none; + background-color: initial; + border-color: var(--separator-color); + color: var(--page-foreground-color); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-large); + padding: var(--spacing-small); +} + +div.qindex { + background-color: var(--odd-color); + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + padding: var(--spacing-small) 0; +} + +/* + Footer and nav-path + */ + +#nav-path { + width: 100%; +} + +#nav-path ul { + background-image: none; + background: var(--page-background-color); + border: none; + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + border-bottom: 0; + box-shadow: 0 0.75px 0 var(--separator-color); + font-size: var(--navigation-font-size); +} + +img.footer { + width: 60px; +} + +.navpath li.footer { + color: var(--page-secondary-foreground-color); +} + +address.footer { + color: var(--page-secondary-foreground-color); + margin-bottom: var(--spacing-large); +} + +#nav-path li.navelem { + background-image: none; + display: flex; + align-items: center; +} + +.navpath li.navelem a { + text-shadow: none; + display: inline-block; + color: var(--primary-color) !important; +} + +.navpath li.navelem b { + color: var(--primary-dark-color); + font-weight: 500; +} + +li.navelem { + padding: 0; + margin-left: -8px; +} + +li.navelem:first-child { + margin-left: var(--spacing-large); +} + +li.navelem:first-child:before { + display: none; +} + +#nav-path li.navelem:after { + content: ''; + border: 5px solid var(--page-background-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(4.2); + z-index: 10; + margin-left: 6px; +} + +#nav-path li.navelem:before { + content: ''; + border: 5px solid var(--separator-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(3.2); + margin-right: var(--spacing-small); +} + +.navpath li.navelem a:hover { + color: var(--primary-color); +} + +/* + Scrollbars for Webkit +*/ + +#nav-tree::-webkit-scrollbar, +div.fragment::-webkit-scrollbar, +pre.fragment::-webkit-scrollbar, +div.memproto::-webkit-scrollbar, +.contents center::-webkit-scrollbar, +.contents .center::-webkit-scrollbar, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar, +div.contents .toc::-webkit-scrollbar, +.contents .dotgraph::-webkit-scrollbar, +.contents .tabs-overview-container::-webkit-scrollbar { + background: transparent; + width: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + height: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); +} + +#nav-tree::-webkit-scrollbar-thumb, +div.fragment::-webkit-scrollbar-thumb, +pre.fragment::-webkit-scrollbar-thumb, +div.memproto::-webkit-scrollbar-thumb, +.contents center::-webkit-scrollbar-thumb, +.contents .center::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-thumb, +div.contents .toc::-webkit-scrollbar-thumb, +.contents .dotgraph::-webkit-scrollbar-thumb, +.contents .tabs-overview-container::-webkit-scrollbar-thumb { + background-color: transparent; + border: var(--webkit-scrollbar-padding) solid transparent; + border-radius: calc(var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + background-clip: padding-box; +} + +#nav-tree:hover::-webkit-scrollbar-thumb, +div.fragment:hover::-webkit-scrollbar-thumb, +pre.fragment:hover::-webkit-scrollbar-thumb, +div.memproto:hover::-webkit-scrollbar-thumb, +.contents center:hover::-webkit-scrollbar-thumb, +.contents .center:hover::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody:hover::-webkit-scrollbar-thumb, +div.contents .toc:hover::-webkit-scrollbar-thumb, +.contents .dotgraph:hover::-webkit-scrollbar-thumb, +.contents .tabs-overview-container:hover::-webkit-scrollbar-thumb { + background-color: var(--webkit-scrollbar-color); +} + +#nav-tree::-webkit-scrollbar-track, +div.fragment::-webkit-scrollbar-track, +pre.fragment::-webkit-scrollbar-track, +div.memproto::-webkit-scrollbar-track, +.contents center::-webkit-scrollbar-track, +.contents .center::-webkit-scrollbar-track, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-track, +div.contents .toc::-webkit-scrollbar-track, +.contents .dotgraph::-webkit-scrollbar-track, +.contents .tabs-overview-container::-webkit-scrollbar-track { + background: transparent; +} + +#nav-tree::-webkit-scrollbar-corner { + background-color: var(--side-nav-background); +} + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc { + overflow-x: auto; + overflow-x: overlay; +} + +#nav-tree { + overflow-x: auto; + overflow-y: auto; + overflow-y: overlay; +} + +/* + Scrollbars for Firefox +*/ + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc, +.contents .dotgraph, +.contents .tabs-overview-container { + scrollbar-width: thin; +} + +/* + Optional Dark mode toggle button +*/ + +doxygen-awesome-dark-mode-toggle { + display: inline-block; + margin: 0 0 0 var(--spacing-small); + padding: 0; + width: var(--searchbar-height); + height: var(--searchbar-height); + background: none; + border: none; + border-radius: var(--searchbar-height); + vertical-align: middle; + text-align: center; + line-height: var(--searchbar-height); + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + user-select: none; + cursor: pointer; +} + +doxygen-awesome-dark-mode-toggle > svg { + transition: transform var(--animation-duration) ease-in-out; +} + +doxygen-awesome-dark-mode-toggle:active > svg { + transform: scale(.5); +} + +doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.03); +} + +html.dark-mode doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.18); +} + +/* + Optional fragment copy button +*/ +.doxygen-awesome-fragment-wrapper { + position: relative; +} + +doxygen-awesome-fragment-copy-button { + opacity: 0; + background: var(--fragment-background); + width: 28px; + height: 28px; + position: absolute; + right: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + top: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + border: 1px solid var(--fragment-foreground); + cursor: pointer; + border-radius: var(--border-radius-small); + display: flex; + justify-content: center; + align-items: center; +} + +.doxygen-awesome-fragment-wrapper:hover doxygen-awesome-fragment-copy-button, doxygen-awesome-fragment-copy-button.success { + opacity: .28; +} + +doxygen-awesome-fragment-copy-button:hover, doxygen-awesome-fragment-copy-button.success { + opacity: 1 !important; +} + +doxygen-awesome-fragment-copy-button:active:not([class~=success]) svg { + transform: scale(.91); +} + +doxygen-awesome-fragment-copy-button svg { + fill: var(--fragment-foreground); + width: 18px; + height: 18px; +} + +doxygen-awesome-fragment-copy-button.success svg { + fill: rgb(14, 168, 14); +} + +doxygen-awesome-fragment-copy-button.success { + border-color: rgb(14, 168, 14); +} + +@media screen and (max-width: 767px) { + .textblock > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .textblock li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + dl dd > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button { + right: 0; + } +} + +/* + Optional paragraph link button +*/ + +a.anchorlink { + font-size: 90%; + margin-left: var(--spacing-small); + color: var(--page-foreground-color) !important; + text-decoration: none; + opacity: .15; + display: none; + transition: opacity var(--animation-duration) ease-in-out, color var(--animation-duration) ease-in-out; +} + +a.anchorlink svg { + fill: var(--page-foreground-color); +} + +h3 a.anchorlink svg, h4 a.anchorlink svg { + margin-bottom: -3px; + margin-top: -4px; +} + +a.anchorlink:hover { + opacity: .45; +} + +h2:hover a.anchorlink, h1:hover a.anchorlink, h3:hover a.anchorlink, h4:hover a.anchorlink { + display: inline-block; +} + +/* + Optional tab feature +*/ + +.tabbed > ul { + padding-inline-start: 0px; + margin: 0; + padding: var(--spacing-small) 0; +} + +.tabbed > ul > li { + display: none; +} + +.tabbed > ul > li.selected { + display: block; +} + +.tabs-overview-container { + overflow-x: auto; + display: block; + overflow-y: visible; +} + +.tabs-overview { + border-bottom: 1px solid var(--separator-color); + display: flex; + flex-direction: row; +} + +@media screen and (max-width: 767px) { + .tabs-overview-container { + margin: 0 calc(0px - var(--spacing-large)); + } + .tabs-overview { + padding: 0 var(--spacing-large) + } +} + +.tabs-overview button.tab-button { + color: var(--page-foreground-color); + margin: 0; + border: none; + background: transparent; + padding: calc(var(--spacing-large) / 2) 0; + display: inline-block; + font-size: var(--page-font-size); + cursor: pointer; + box-shadow: 0 1px 0 0 var(--separator-color); + position: relative; + + -webkit-tap-highlight-color: transparent; +} + +.tabs-overview button.tab-button .tab-title::before { + display: block; + content: attr(title); + font-weight: 600; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.tabs-overview button.tab-button .tab-title { + float: left; + white-space: nowrap; + font-weight: normal; + padding: calc(var(--spacing-large) / 2) var(--spacing-large); + border-radius: var(--border-radius-medium); + transition: background-color var(--animation-duration) ease-in-out, font-weight var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button:not(:last-child) .tab-title { + box-shadow: 8px 0 0 -7px var(--separator-color); +} + +.tabs-overview button.tab-button:hover .tab-title { + background: var(--separator-color); + box-shadow: none; +} + +.tabs-overview button.tab-button.active .tab-title { + font-weight: 600; +} + +.tabs-overview button.tab-button::after { + content: ''; + display: block; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 0; + width: 0%; + margin: 0 auto; + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + background-color: var(--primary-color); + transition: width var(--animation-duration) ease-in-out, height var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button.active::after { + width: 100%; + box-sizing: border-box; + height: 3px; +} + + +/* + Navigation Buttons +*/ + +.section_buttons:not(:empty) { + margin-top: calc(var(--spacing-large) * 3); +} + +.section_buttons table.markdownTable { + display: block; + width: 100%; +} + +.section_buttons table.markdownTable tbody { + display: table !important; + width: 100%; + box-shadow: none; + border-spacing: 10px; +} + +.section_buttons table.markdownTable td { + padding: 0; +} + +.section_buttons table.markdownTable th { + display: none; +} + +.section_buttons table.markdownTable tr.markdownTableHead { + border: none; +} + +.section_buttons tr th, .section_buttons tr td { + background: none; + border: none; + padding: var(--spacing-large) 0 var(--spacing-small); +} + +.section_buttons a { + display: inline-block; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + color: var(--page-secondary-foreground-color) !important; + text-decoration: none; + transition: color var(--animation-duration) ease-in-out, background-color var(--animation-duration) ease-in-out; +} + +.section_buttons a:hover { + color: var(--page-foreground-color) !important; + background-color: var(--odd-color); +} + +.section_buttons tr td.markdownTableBodyLeft a { + padding: var(--spacing-medium) var(--spacing-large) var(--spacing-medium) calc(var(--spacing-large) / 2); +} + +.section_buttons tr td.markdownTableBodyRight a { + padding: var(--spacing-medium) calc(var(--spacing-large) / 2) var(--spacing-medium) var(--spacing-large); +} + +.section_buttons tr td.markdownTableBodyLeft a::before, +.section_buttons tr td.markdownTableBodyRight a::after { + color: var(--page-secondary-foreground-color) !important; + display: inline-block; + transition: color .08s ease-in-out, transform .09s ease-in-out; +} + +.section_buttons tr td.markdownTableBodyLeft a::before { + content: '〈'; + padding-right: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyRight a::after { + content: '〉'; + padding-left: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyLeft a:hover::before { + color: var(--page-foreground-color) !important; + transform: translateX(-3px); +} + +.section_buttons tr td.markdownTableBodyRight a:hover::after { + color: var(--page-foreground-color) !important; + transform: translateX(3px); +} + +@media screen and (max-width: 450px) { + .section_buttons a { + width: 100%; + box-sizing: border-box; + } + + .section_buttons tr td:nth-of-type(1).markdownTableBodyLeft a { + border-radius: var(--border-radius-medium) 0 0 var(--border-radius-medium); + border-right: none; + } + + .section_buttons tr td:nth-of-type(2).markdownTableBodyRight a { + border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0; + } +} diff --git a/doxygen.css b/doxygen.css new file mode 100644 index 000000000..ffbff0224 --- /dev/null +++ b/doxygen.css @@ -0,0 +1,1793 @@ +/* The standard CSS for doxygen 1.9.1 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +p.reference, p.definition { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + border-right: 1px solid #A3B4D7; + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: #A0A0A0; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.odd { + background-color: #F8F9FC; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +.contents a.qindexHL:visited { + color: #FFFFFF; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #FFFFFF; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +blockquote.DocNodeRTL { + border-left: 0; + border-right: 2px solid #9CAFD4; + margin: 0 4px 0 24px; + padding: 0 16px 0 12px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #E2E8F2; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #DFE5F1; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + +} + +.overload { + font-family: "courier new",courier,monospace; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.section.DocNodeRTL { + margin-right: 0px; + padding-right: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.note.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.deprecated.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.todo.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.test.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.bug.DocNodeRTL { + margin-left: 0; + padding-left: 0; + border-left: 0; + margin-right: -7px; + padding-right: 3px; + border-right: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +.PageDocRTL-title div.toc { + float: left !important; + text-align: right; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +.PageDocRTL-title div.toc li { + background-position-x: right !important; + padding-left: 0 !important; + padding-right: 10px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +.PageDocRTL-title div.toc li.level1 { + margin-left: 0 !important; + margin-right: 0; +} + +.PageDocRTL-title div.toc li.level2 { + margin-left: 0 !important; + margin-right: 15px; +} + +.PageDocRTL-title div.toc li.level3 { + margin-left: 0 !important; + margin-right: 30px; +} + +.PageDocRTL-title div.toc li.level4 { + margin-left: 0 !important; + margin-right: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #FFFFFF; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #FFFFFF; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +.DocNodeRTL { + text-align: right; + direction: rtl; +} + +.DocNodeLTR { + text-align: left; + direction: ltr; +} + +table.DocNodeRTL { + width: auto; + margin-right: 0; + margin-left: auto; +} + +table.DocNodeLTR { + width: auto; + margin-right: auto; + margin-left: 0; +} + +tt, code, kbd, samp +{ + display: inline-block; + direction:ltr; +} +/* @end */ + +u { + text-decoration: underline; +} + diff --git a/doxygen.svg b/doxygen.svg new file mode 100644 index 000000000..d42dad52d --- /dev/null +++ b/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynsections.js b/dynsections.js new file mode 100644 index 000000000..88f2c27e6 --- /dev/null +++ b/dynsections.js @@ -0,0 +1,128 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +Nuklear: File List + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+
[detail level 12]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  src
 build.py
 nuklear.hMain API and documentation file
 nuklear_9slice.c
 nuklear_buffer.c
 nuklear_button.c
 nuklear_chart.c
 nuklear_color.c
 nuklear_color_picker.c
 nuklear_combo.c
 nuklear_context.c
 nuklear_contextual.c
 nuklear_draw.c
 nuklear_edit.c
 nuklear_font.c
 nuklear_group.c
 nuklear_image.c
 nuklear_input.c
 nuklear_internal.h
 nuklear_knob.c
 nuklear_layout.c
 nuklear_list_view.c
 nuklear_math.c
 nuklear_menu.c
 nuklear_page_element.c
 nuklear_panel.c
 nuklear_pool.c
 nuklear_popup.c
 nuklear_progress.c
 nuklear_property.c
 nuklear_scrollbar.c
 nuklear_selectable.c
 nuklear_slider.c
 nuklear_string.c
 nuklear_style.c
 nuklear_table.c
 nuklear_text.c
 nuklear_text_editor.c
 nuklear_toggle.c
 nuklear_tooltip.c
 nuklear_tree.c
 nuklear_utf8.c
 nuklear_util.c
 nuklear_vertex.c
 nuklear_widget.c
 nuklear_window.c
 stb_rect_pack.h
 stb_truetype.h
+
+
+
+ + + + diff --git a/files_dup.js b/files_dup.js new file mode 100644 index 000000000..c3b39c499 --- /dev/null +++ b/files_dup.js @@ -0,0 +1,4 @@ +var files_dup = +[ + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] +]; \ No newline at end of file diff --git a/folderclosed.png b/folderclosed.png new file mode 100644 index 000000000..bb8ab35ed Binary files /dev/null and b/folderclosed.png differ diff --git a/folderopen.png b/folderopen.png new file mode 100644 index 000000000..d6c7f676a Binary files /dev/null and b/folderopen.png differ diff --git a/functions.html b/functions.html new file mode 100644 index 000000000..7bb037117 --- /dev/null +++ b/functions.html @@ -0,0 +1,176 @@ + + + + + + + +Nuklear: Data Fields + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
+
+
+ + + + diff --git a/functions_vars.html b/functions_vars.html new file mode 100644 index 000000000..0db492116 --- /dev/null +++ b/functions_vars.html @@ -0,0 +1,176 @@ + + + + + + + +Nuklear: Data Fields - Variables + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/globals.html b/globals.html new file mode 100644 index 000000000..c6c273803 --- /dev/null +++ b/globals.html @@ -0,0 +1,505 @@ + + + + + + + +Nuklear: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+ +

- n -

+
+
+ + + + diff --git a/globals_defs.html b/globals_defs.html new file mode 100644 index 000000000..ce1a9504d --- /dev/null +++ b/globals_defs.html @@ -0,0 +1,131 @@ + + + + + + + +Nuklear: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/globals_enum.html b/globals_enum.html new file mode 100644 index 000000000..b67d8628c --- /dev/null +++ b/globals_enum.html @@ -0,0 +1,119 @@ + + + + + + + +Nuklear: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/globals_eval.html b/globals_eval.html new file mode 100644 index 000000000..0558e6ced --- /dev/null +++ b/globals_eval.html @@ -0,0 +1,170 @@ + + + + + + + +Nuklear: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/globals_func.html b/globals_func.html new file mode 100644 index 000000000..c0fdf5a60 --- /dev/null +++ b/globals_func.html @@ -0,0 +1,406 @@ + + + + + + + +Nuklear: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+  + +

- n -

+
+
+ + + + diff --git a/graph_legend.dot b/graph_legend.dot new file mode 100644 index 000000000..4d6ac8c61 --- /dev/null +++ b/graph_legend.dot @@ -0,0 +1,23 @@ +digraph "Graph Legend" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node9 [shape="box",label="Inherited",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",fillcolor="grey75",style="filled" fontcolor="black"]; + Node10 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node10 [shape="box",label="PublicBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; + Node11 -> Node10 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node11 [shape="box",label="Truncated",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="red"]; + Node13 -> Node9 [dir="back",color="darkgreen",fontsize="10",style="solid",fontname="Helvetica"]; + Node13 [shape="box",label="ProtectedBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; + Node14 -> Node9 [dir="back",color="firebrick4",fontsize="10",style="solid",fontname="Helvetica"]; + Node14 [shape="box",label="PrivateBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; + Node15 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node15 [shape="box",label="Undocumented",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="grey75"]; + Node16 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node16 [shape="box",label="Templ< int >",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; + Node17 -> Node16 [dir="back",color="orange",fontsize="10",style="dashed",label="< int >",fontname="Helvetica"]; + Node17 [shape="box",label="Templ< T >",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; + Node18 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label="m_usedClass",fontname="Helvetica"]; + Node18 [shape="box",label="Used",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black"]; +} diff --git a/graph_legend.html b/graph_legend.html new file mode 100644 index 000000000..1c03ce604 --- /dev/null +++ b/graph_legend.html @@ -0,0 +1,169 @@ + + + + + + + +Nuklear: Graph Legend + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Graph Legend
+
+
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

/*! Invisible class because of truncation */
+
class Invisible { };
+
+
/*! Truncated class, inheritance relation is hidden */
+
class Truncated : public Invisible { };
+
+
/* Class not documented with doxygen comments */
+
class Undocumented { };
+
+
/*! Class that is inherited using public inheritance */
+
class PublicBase : public Truncated { };
+
+
/*! A template class */
+
template<class T> class Templ { };
+
+
/*! Class that is inherited using protected inheritance */
+
class ProtectedBase { };
+
+
/*! Class that is inherited using private inheritance */
+
class PrivateBase { };
+
+
/*! Class that is used by the Inherited class */
+
class Used { };
+
+
/*! Super class that inherits a number of other classes */
+
class Inherited : public PublicBase,
+
protected ProtectedBase,
+
private PrivateBase,
+
public Undocumented,
+
public Templ<int>
+
{
+
private:
+
Used *m_usedClass;
+
};
+

This will result in the following graph:

+

The boxes in the above graph have the following meaning:

+
    +
  • +A filled gray box represents the struct or class for which the graph is generated.
  • +
  • +A box with a black border denotes a documented struct or class.
  • +
  • +A box with a gray border denotes an undocumented struct or class.
  • +
  • +A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
  • +
+

The arrows have the following meaning:

+
    +
  • +A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • +
  • +A dark green arrow is used for protected inheritance.
  • +
  • +A dark red arrow is used for private inheritance.
  • +
  • +A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
  • +
  • +A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.
  • +
+
+
+ + + + diff --git a/index.html b/index.html new file mode 100644 index 000000000..26958e1e0 --- /dev/null +++ b/index.html @@ -0,0 +1,360 @@ + + + + + + + +Nuklear: Nuklear + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Nuklear
+
+
+

+

+Contents

+
    +
  1. About section
  2. +
  3. Highlights section
  4. +
  5. Features section
  6. +
  7. Usage section
      +
    1. Flags section
    2. +
    3. Constants section
    4. +
    5. Dependencies section
    6. +
    +
  8. +
  9. Example section
  10. +
  11. API section
      +
    1. Context section
    2. +
    3. Input section
    4. +
    5. Drawing section
    6. +
    7. Window section
    8. +
    9. Layouting section
    10. +
    11. Groups section
    12. +
    13. Tree section
    14. +
    15. Properties section
    16. +
    +
  12. +
  13. License section
  14. +
  15. Changelog section
  16. +
  17. Gallery section
  18. +
  19. Credits section
  20. +
+

+About

+

This is a minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default renderbackend or OS window and input handling but instead provides a very modular library approach by using simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends it only focuses on the actual UI.

+

+Highlights

+
    +
  • Graphical user interface toolkit
  • +
  • Single header library
  • +
  • Written in C89 (a.k.a. ANSI C or ISO C90)
  • +
  • Small codebase (~18kLOC)
  • +
  • Focus on portability, efficiency and simplicity
  • +
  • No dependencies (not even the standard library if not wanted)
  • +
  • Fully skinnable and customizable
  • +
  • Low memory footprint with total memory control if needed or wanted
  • +
  • UTF-8 support
  • +
  • No global or hidden state
  • +
  • Customizable library modules (you can compile and use only what you need)
  • +
  • Optional font baker and vertex buffer output
  • +
  • Code available on github
  • +
+

+Features

+
    +
  • Absolutely no platform dependent code
  • +
  • Memory management control ranging from/to
      +
    • Ease of use by allocating everything from standard library
    • +
    • Control every byte of memory inside the library
    • +
    +
  • +
  • Font handling control ranging from/to
      +
    • Use your own font implementation for everything
    • +
    • Use this libraries internal font baking and handling API
    • +
    +
  • +
  • Drawing output control ranging from/to
      +
    • Simple shapes for more high level APIs which already have drawing capabilities
    • +
    • Hardware accessible anti-aliased vertex buffer output
    • +
    +
  • +
  • Customizable colors and properties ranging from/to
      +
    • Simple changes to color by filling a simple color table
    • +
    • Complete control with ability to use skinning to decorate widgets
    • +
    +
  • +
  • Bendable UI library with widget ranging from/to
      +
    • Basic widgets like buttons, checkboxes, slider, ...
    • +
    • Advanced widget like abstract comboboxes, contextual menus,...
    • +
    +
  • +
  • Compile time configuration to only compile what you need
      +
    • Subset which can be used if you do not want to link or use the standard library
    • +
    +
  • +
  • Can be easily modified to only update on user input instead of frame updates
  • +
+

+Usage

+

This library is self contained in one single header file and can be used either in header only mode or in implementation mode. The header only mode is used by default when included and allows including this header in other headers and does not contain the actual implementation.
+
+

+

The implementation mode requires to define the preprocessor macro NK_IMPLEMENTATION in one .c/.cpp file before #including this file, e.g.:

+
#define NK_IMPLEMENTATION
+
#include "nuklear.h"
+

Also optionally define the symbols listed in the section "OPTIONAL DEFINES" below in header and implementation mode if you want to use additional functionality or need more control over the library.

+

!!! WARNING Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions.

+

+Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Flag Description
NK_PRIVATE If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
NK_INCLUDE_FIXED_TYPES If defined it will include header <stdint.h> for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
NK_INCLUDE_DEFAULT_ALLOCATOR If defined it will include header <stdlib.h> and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
NK_INCLUDE_STANDARD_IO If defined it will include header <stdio.h> and provide additional functions depending on file loading.
NK_INCLUDE_STANDARD_VARARGS If defined it will include header <stdarg.h> and provide additional functions depending on file loading.
NK_INCLUDE_STANDARD_BOOL If defined it will include header <stdbool.h> for nk_bool otherwise nuklear defines nk_bool as int.
NK_INCLUDE_VERTEX_BUFFER_OUTPUT Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,...
NK_INCLUDE_FONT_BAKING Defining this adds stb_truetype and stb_rect_pack implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it.
NK_INCLUDE_DEFAULT_FONT Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font
NK_INCLUDE_COMMAND_USERDATA Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures.
NK_BUTTON_TRIGGER_ON_RELEASE Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released.
NK_ZERO_COMMAND_MEMORY Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame.
NK_UINT_DRAW_INDEX Defining this will set the size of vertex index elements when using NK_VERTEX_BUFFER_OUTPUT to 32bit instead of the default of 16bit
NK_KEYSTATE_BASED_INPUT Define this if your backend uses key state for each frame rather than key press/release events
+

!!! WARNING The following flags will pull in the standard C library:

    +
  • NK_INCLUDE_DEFAULT_ALLOCATOR
  • +
  • NK_INCLUDE_STANDARD_IO
  • +
  • NK_INCLUDE_STANDARD_VARARGS
  • +
+

!!! WARNING The following flags if defined need to be defined for both header and implementation:

    +
  • NK_INCLUDE_FIXED_TYPES
  • +
  • NK_INCLUDE_DEFAULT_ALLOCATOR
  • +
  • NK_INCLUDE_STANDARD_VARARGS
  • +
  • NK_INCLUDE_STANDARD_BOOL
  • +
  • NK_INCLUDE_VERTEX_BUFFER_OUTPUT
  • +
  • NK_INCLUDE_FONT_BAKING
  • +
  • NK_INCLUDE_DEFAULT_FONT
  • +
  • NK_INCLUDE_STANDARD_VARARGS
  • +
  • NK_INCLUDE_COMMAND_USERDATA
  • +
  • NK_UINT_DRAW_INDEX
  • +
+

+Constants

+ + + + + + + + + +
Define Description
NK_BUFFER_DEFAULT_INITIAL_SIZE Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
NK_MAX_NUMBER_BUFFER Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
NK_INPUT_MAX Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
+

!!! WARNING The following constants if defined need to be defined for both header and implementation:

    +
  • NK_MAX_NUMBER_BUFFER
  • +
  • NK_BUFFER_DEFAULT_INITIAL_SIZE
  • +
  • NK_INPUT_MAX
  • +
+

+Dependencies

+ + + + + + + + + + + + + + + + + + + + + +
Function Description
NK_ASSERT If you don't define this, nuklear will use <assert.h> with assert().
NK_MEMSET You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
NK_MEMCPY You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
NK_INV_SQRT You can define this to your own inverse sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version.
NK_SIN You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation.
NK_COS You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation.
NK_STRTOD You can define this to strtod or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
NK_DTOA You can define this to dtoa or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
NK_VSNPRINTF If you define NK_INCLUDE_STANDARD_VARARGS as well as NK_INCLUDE_STANDARD_IO and want to be safe define this to vsnprintf on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if vsnprintf is available it will define it to vsnprintf directly. If not defined and if you have older versions of C or C++ it will be defined to vsprintf which is unsafe.
+

!!! WARNING The following dependencies will pull in the standard C library if not redefined:

    +
  • NK_ASSERT
  • +
+

!!! WARNING The following dependencies if defined need to be defined for both header and implementation:

    +
  • NK_ASSERT
  • +
+

!!! WARNING The following dependencies if defined need to be defined only for the implementation part:

    +
  • NK_MEMSET
  • +
  • NK_MEMCPY
  • +
  • NK_SQRT
  • +
  • NK_SIN
  • +
  • NK_COS
  • +
  • NK_STRTOD
  • +
  • NK_DTOA
  • +
  • NK_VSNPRINTF
  • +
+

+Example

+
// init gui state
+
enum {EASY, HARD};
+
static int op = EASY;
+
static float value = 0.6f;
+
static int i = 20;
+
struct nk_context ctx;
+
+
nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
+
if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
+
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
+
// fixed widget pixel width
+
nk_layout_row_static(&ctx, 30, 80, 1);
+
if (nk_button_label(&ctx, "button")) {
+
// event handling
+
}
+
+
// fixed widget window ratio width
+
nk_layout_row_dynamic(&ctx, 30, 2);
+
if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
+
if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
+
+
// custom widget pixel width
+
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
+
{
+
nk_layout_row_push(&ctx, 50);
+
nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
+
nk_layout_row_push(&ctx, 110);
+
nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
+
}
+ +
}
+
nk_end(&ctx);
+
NK_API void nk_layout_row_end(struct nk_context *)
Finished previously started row.
+
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
Starts a new dynamic or fixed row with given height and columns.
+
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
+
NK_API void nk_layout_row_push(struct nk_context *, float value)
\breif Specifies either window ratio or width of a single column
+
NK_API void nk_end(struct nk_context *ctx)
+
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.
+ + +

+

+API

+
+
+
+ + + + diff --git a/jquery.js b/jquery.js new file mode 100644 index 000000000..103c32d79 --- /dev/null +++ b/jquery.js @@ -0,0 +1,35 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element +},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/nav_f.png b/nav_f.png new file mode 100644 index 000000000..72a58a529 Binary files /dev/null and b/nav_f.png differ diff --git a/nav_g.png b/nav_g.png new file mode 100644 index 000000000..2093a237a Binary files /dev/null and b/nav_g.png differ diff --git a/nav_h.png b/nav_h.png new file mode 100644 index 000000000..33389b101 Binary files /dev/null and b/nav_h.png differ diff --git a/navtree.css b/navtree.css new file mode 100644 index 000000000..33341a67d --- /dev/null +++ b/navtree.css @@ -0,0 +1,146 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:#fff; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + background-color: #FAFAFF; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: 250px; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:url("splitbar.png"); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/navtree.js b/navtree.js new file mode 100644 index 000000000..1e272d31d --- /dev/null +++ b/navtree.js @@ -0,0 +1,546 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func,show) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, false); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, showRoot) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, showRoot); + }, showRoot); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + $('#nav-sync').css('top','30px'); + } else { + $('#nav-sync').css('top','5px'); + } + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + },true); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + },true); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +Nuklear: src/nuklear.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nuklear.h File Reference
+
+
+ +

main API and documentation file +More...

+
+This graph shows which files directly or indirectly include this file:
+
+
+
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Structures

struct  nk_color
 
struct  nk_colorf
 
struct  nk_vec2
 
struct  nk_vec2i
 
struct  nk_rect
 
struct  nk_recti
 
union  nk_handle
 
struct  nk_image
 
struct  nk_nine_slice
 
struct  nk_cursor
 
struct  nk_scroll
 
struct  nk_allocator
 
struct  nk_draw_null_texture
 
struct  nk_convert_config
 
struct  nk_list_view
 
struct  nk_user_font
 
struct  nk_memory_status
 
struct  nk_buffer_marker
 
struct  nk_memory
 
struct  nk_buffer
 
struct  nk_str
 ============================================================== More...
 
struct  nk_clipboard
 
struct  nk_text_undo_record
 
struct  nk_text_undo_state
 
struct  nk_text_edit
 
struct  nk_command
 command base and header of every command inside the buffer More...
 
struct  nk_command_scissor
 
struct  nk_command_line
 
struct  nk_command_curve
 
struct  nk_command_rect
 
struct  nk_command_rect_filled
 
struct  nk_command_rect_multi_color
 
struct  nk_command_triangle
 
struct  nk_command_triangle_filled
 
struct  nk_command_circle
 
struct  nk_command_circle_filled
 
struct  nk_command_arc
 
struct  nk_command_arc_filled
 
struct  nk_command_polygon
 
struct  nk_command_polygon_filled
 
struct  nk_command_polyline
 
struct  nk_command_image
 
struct  nk_command_custom
 
struct  nk_command_text
 
struct  nk_command_buffer
 
struct  nk_mouse_button
 
struct  nk_mouse
 
struct  nk_key
 
struct  nk_keyboard
 
struct  nk_input
 
union  nk_style_item_data
 
struct  nk_style_item
 
struct  nk_style_text
 
struct  nk_style_button
 
struct  nk_style_toggle
 
struct  nk_style_selectable
 
struct  nk_style_slider
 
struct  nk_style_knob
 
struct  nk_style_progress
 
struct  nk_style_scrollbar
 
struct  nk_style_edit
 
struct  nk_style_property
 
struct  nk_style_chart
 
struct  nk_style_combo
 
struct  nk_style_tab
 
struct  nk_style_window_header
 
struct  nk_style_window
 
struct  nk_style
 
struct  nk_chart_slot
 
struct  nk_chart
 
struct  nk_row_layout
 
struct  nk_popup_buffer
 
struct  nk_menu_state
 
struct  nk_panel
 
struct  nk_popup_state
 
struct  nk_edit_state
 
struct  nk_property_state
 
struct  nk_window
 
struct  nk_configuration_stacks
 
struct  nk_table
 
union  nk_page_data
 
struct  nk_page_element
 
struct  nk_page
 
struct  nk_pool
 
struct  nk_context
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

+#define NK_UNDEFINED   (-1.0f)
 
+#define NK_UTF_INVALID   0xFFFD
 internal invalid utf8 rune
 
+#define NK_UTF_SIZE   4
 describes the number of bytes a glyph consists of
 
+#define NK_INPUT_MAX   16
 
+#define NK_MAX_NUMBER_BUFFER   64
 
+#define NK_SCROLLBAR_HIDING_TIMEOUT   4.0f
 
+#define NK_API   extern
 
+#define NK_LIB   extern
 
+#define NK_INTERN   static
 
+#define NK_STORAGE   static
 
+#define NK_GLOBAL   static
 
+#define NK_FLAG(x)   (1 << (x))
 
+#define NK_STRINGIFY(x)   #x
 
+#define NK_MACRO_STRINGIFY(x)   NK_STRINGIFY(x)
 
+#define NK_STRING_JOIN_IMMEDIATE(arg1, arg2)   arg1 ## arg2
 
+#define NK_STRING_JOIN_DELAY(arg1, arg2)   NK_STRING_JOIN_IMMEDIATE(arg1, arg2)
 
+#define NK_STRING_JOIN(arg1, arg2)   NK_STRING_JOIN_DELAY(arg1, arg2)
 
+#define NK_UNIQUE_NAME(name)   NK_STRING_JOIN(name,__LINE__)
 
+#define NK_STATIC_ASSERT(exp)   typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
 
+#define NK_FILE_LINE   __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
 
+#define NK_MIN(a, b)   ((a) < (b) ? (a) : (b))
 
+#define NK_MAX(a, b)   ((a) < (b) ? (b) : (a))
 
+#define NK_CLAMP(i, v, x)   (NK_MAX(NK_MIN(v,x), i))
 
+#define NK_INT8   signed char
 
+#define NK_UINT8   unsigned char
 
+#define NK_INT16   signed short
 
+#define NK_UINT16   unsigned short
 
+#define NK_INT32   signed int
 
+#define NK_UINT32   unsigned int
 
+#define NK_SIZE_TYPE   unsigned long
 
+#define NK_POINTER_TYPE   unsigned long
 
+#define NK_BOOL   int
 could be char, use int for drop-in replacement backwards compatibility
 
#define nk_foreach(c, ctx)   for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
 Iterates over each draw command inside the context draw command list. More...
 
#define nk_tree_push(ctx, type, title, state)   nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
 
#define nk_tree_push_id(ctx, type, title, state, id)   nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
 
#define nk_tree_image_push(ctx, type, img, title, state)   nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
 
#define nk_tree_image_push_id(ctx, type, img, title, state, id)   nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
 
+#define nk_tree_element_push(ctx, type, title, state, sel)   nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
 
+#define nk_tree_element_push_id(ctx, type, title, state, sel, id)   nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
 
+#define NK_WIDGET_DISABLED_FACTOR   0.5f
 
+#define NK_STRTOD   nk_strtod
 
+#define NK_TEXTEDIT_UNDOSTATECOUNT   99
 
+#define NK_TEXTEDIT_UNDOCHARCOUNT   999
 
+#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS   16
 
+#define NK_CHART_MAX_SLOT   4
 
+#define NK_WINDOW_MAX_NAME   64
 
+#define NK_BUTTON_BEHAVIOR_STACK_SIZE   8
 
+#define NK_FONT_STACK_SIZE   8
 
+#define NK_STYLE_ITEM_STACK_SIZE   16
 
+#define NK_FLOAT_STACK_SIZE   32
 
+#define NK_VECTOR_STACK_SIZE   16
 
+#define NK_FLAGS_STACK_SIZE   32
 
+#define NK_COLOR_STACK_SIZE   32
 
#define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)
 
#define NK_CONFIG_STACK(type, size)
 
+#define nk_float   float
 
+#define NK_VALUE_PAGE_CAPACITY    (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
 
+#define NK_PI   3.141592654f
 
+#define NK_PI_HALF   1.570796326f
 
+#define NK_UTF_INVALID   0xFFFD
 internal invalid utf8 rune
 
+#define NK_MAX_FLOAT_PRECISION   2
 
+#define NK_UNUSED(x)   ((void)(x))
 
+#define NK_SATURATE(x)   (NK_MAX(0, NK_MIN(1.0f, x)))
 
+#define NK_LEN(a)   (sizeof(a)/sizeof(a)[0])
 
+#define NK_ABS(a)   (((a) < 0) ? -(a) : (a))
 
+#define NK_BETWEEN(x, a, b)   ((a) <= (x) && (x) < (b))
 
+#define NK_INBOX(px, py, x, y, w, h)    (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
 
#define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1)
 
+#define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)    (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
 
+#define nk_vec2_sub(a, b)   nk_vec2((a).x - (b).x, (a).y - (b).y)
 
+#define nk_vec2_add(a, b)   nk_vec2((a).x + (b).x, (a).y + (b).y)
 
+#define nk_vec2_len_sqr(a)   ((a).x*(a).x+(a).y*(a).y)
 
+#define nk_vec2_muls(a, t)   nk_vec2((a).x * (t), (a).y * (t))
 
+#define nk_ptr_add(t, p, i)   ((t*)((void*)((nk_byte*)(p) + (i))))
 
+#define nk_ptr_add_const(t, p, i)   ((const t*)((const void*)((const nk_byte*)(p) + (i))))
 
+#define nk_zero_struct(s)   nk_zero(&s, sizeof(s))
 
+#define NK_UINT_TO_PTR(x)   ((void*)&((char*)0)[x])
 
+#define NK_PTR_TO_UINT(x)   ((nk_size)(((char*)x)-(char*)0))
 
+#define NK_ALIGN_PTR(x, mask)    (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
 
+#define NK_ALIGN_PTR_BACK(x, mask)    (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
 
+#define NK_OFFSETOF(st, m)   ((nk_ptr)&(((st*)0)->m))
 
+#define NK_ALIGNOF(t)   NK_OFFSETOF(struct {char c; t _h;}, _h)
 
+#define NK_CONTAINER_OF(ptr, type, member)    (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Typedefs

+typedef NK_INT8 nk_char
 
+typedef NK_UINT8 nk_uchar
 
+typedef NK_UINT8 nk_byte
 
+typedef NK_INT16 nk_short
 
+typedef NK_UINT16 nk_ushort
 
+typedef NK_INT32 nk_int
 
+typedef NK_UINT32 nk_uint
 
+typedef NK_SIZE_TYPE nk_size
 
+typedef NK_POINTER_TYPE nk_ptr
 
+typedef NK_BOOL nk_bool
 
+typedef nk_uint nk_hash
 
+typedef nk_uint nk_flags
 
+typedef nk_uint nk_rune
 
+typedef char nk_glyph[NK_UTF_SIZE]
 
+typedef void *(* nk_plugin_alloc) (nk_handle, void *old, nk_size)
 
+typedef void(* nk_plugin_free) (nk_handle, void *old)
 
+typedef nk_bool(* nk_plugin_filter) (const struct nk_text_edit *, nk_rune unicode)
 
+typedef void(* nk_plugin_paste) (nk_handle, struct nk_text_edit *)
 
+typedef void(* nk_plugin_copy) (nk_handle, const char *, int len)
 
+typedef float(* nk_text_width_f) (nk_handle, float h, const char *, int len)
 
+typedef void(* nk_query_font_glyph_f) (nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
 
+typedef void(* nk_command_custom_callback) (void *canvas, short x, short y, unsigned short w, unsigned short h, nk_handle callback_data)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Enumerations

enum  { nk_false +, nk_true + }
 
enum  nk_heading { NK_UP +, NK_RIGHT +, NK_DOWN +, NK_LEFT + }
 
enum  nk_button_behavior { NK_BUTTON_DEFAULT +, NK_BUTTON_REPEATER + }
 
enum  nk_modify { NK_FIXED = nk_false +, NK_MODIFIABLE = nk_true + }
 
enum  nk_orientation { NK_VERTICAL +, NK_HORIZONTAL + }
 
enum  nk_collapse_states { NK_MINIMIZED = nk_false +, NK_MAXIMIZED = nk_true + }
 
enum  nk_show_states { NK_HIDDEN = nk_false +, NK_SHOWN = nk_true + }
 
enum  nk_chart_type { NK_CHART_LINES +, NK_CHART_COLUMN +, NK_CHART_MAX + }
 
enum  nk_chart_event { NK_CHART_HOVERING = 0x01 +, NK_CHART_CLICKED = 0x02 + }
 
enum  nk_color_format { NK_RGB +, NK_RGBA + }
 
enum  nk_popup_type { NK_POPUP_STATIC +, NK_POPUP_DYNAMIC + }
 
enum  nk_layout_format { NK_DYNAMIC +, NK_STATIC + }
 
enum  nk_tree_type { NK_TREE_NODE +, NK_TREE_TAB + }
 
enum  nk_symbol_type {
+  NK_SYMBOL_NONE +, NK_SYMBOL_X +, NK_SYMBOL_UNDERSCORE +, NK_SYMBOL_CIRCLE_SOLID +,
+  NK_SYMBOL_CIRCLE_OUTLINE +, NK_SYMBOL_RECT_SOLID +, NK_SYMBOL_RECT_OUTLINE +, NK_SYMBOL_TRIANGLE_UP +,
+  NK_SYMBOL_TRIANGLE_DOWN +, NK_SYMBOL_TRIANGLE_LEFT +, NK_SYMBOL_TRIANGLE_RIGHT +, NK_SYMBOL_PLUS +,
+  NK_SYMBOL_MINUS +, NK_SYMBOL_TRIANGLE_UP_OUTLINE +, NK_SYMBOL_TRIANGLE_DOWN_OUTLINE +, NK_SYMBOL_TRIANGLE_LEFT_OUTLINE +,
+  NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE +, NK_SYMBOL_MAX +
+ }
 
enum  nk_keys {
+  NK_KEY_NONE +, NK_KEY_SHIFT +, NK_KEY_CTRL +, NK_KEY_DEL +,
+  NK_KEY_ENTER +, NK_KEY_TAB +, NK_KEY_BACKSPACE +, NK_KEY_COPY +,
+  NK_KEY_CUT +, NK_KEY_PASTE +, NK_KEY_UP +, NK_KEY_DOWN +,
+  NK_KEY_LEFT +, NK_KEY_RIGHT +, NK_KEY_TEXT_INSERT_MODE +, NK_KEY_TEXT_REPLACE_MODE +,
+  NK_KEY_TEXT_RESET_MODE +, NK_KEY_TEXT_LINE_START +, NK_KEY_TEXT_LINE_END +, NK_KEY_TEXT_START +,
+  NK_KEY_TEXT_END +, NK_KEY_TEXT_UNDO +, NK_KEY_TEXT_REDO +, NK_KEY_TEXT_SELECT_ALL +,
+  NK_KEY_TEXT_WORD_LEFT +, NK_KEY_TEXT_WORD_RIGHT +, NK_KEY_SCROLL_START +, NK_KEY_SCROLL_END +,
+  NK_KEY_SCROLL_DOWN +, NK_KEY_SCROLL_UP +, NK_KEY_MAX +
+ }
 
enum  nk_buttons {
+  NK_BUTTON_LEFT +, NK_BUTTON_MIDDLE +, NK_BUTTON_RIGHT +, NK_BUTTON_DOUBLE +,
+  NK_BUTTON_MAX +
+ }
 
enum  nk_anti_aliasing { NK_ANTI_ALIASING_OFF +, NK_ANTI_ALIASING_ON + }
 
enum  nk_convert_result {
+  NK_CONVERT_SUCCESS = 0 +, NK_CONVERT_INVALID_PARAM = 1 +, NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1) +, NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2) +,
+  NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3) +
+ }
 
enum  nk_panel_flags {
+  NK_WINDOW_BORDER = NK_FLAG(0) +, NK_WINDOW_MOVABLE = NK_FLAG(1) +, NK_WINDOW_SCALABLE = NK_FLAG(2) +, NK_WINDOW_CLOSABLE = NK_FLAG(3) +,
+  NK_WINDOW_MINIMIZABLE = NK_FLAG(4) +, NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5) +, NK_WINDOW_TITLE = NK_FLAG(6) +, NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7) +,
+  NK_WINDOW_BACKGROUND = NK_FLAG(8) +, NK_WINDOW_SCALE_LEFT = NK_FLAG(9) +, NK_WINDOW_NO_INPUT = NK_FLAG(10) +
+ }
 
enum  nk_widget_align {
+  NK_WIDGET_ALIGN_LEFT = 0x01 +, NK_WIDGET_ALIGN_CENTERED = 0x02 +, NK_WIDGET_ALIGN_RIGHT = 0x04 +, NK_WIDGET_ALIGN_TOP = 0x08 +,
+  NK_WIDGET_ALIGN_MIDDLE = 0x10 +, NK_WIDGET_ALIGN_BOTTOM = 0x20 +
+ }
 
enum  nk_widget_alignment { NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT +, NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED +, NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT + }
 
enum  nk_widget_layout_states { NK_WIDGET_INVALID +, NK_WIDGET_VALID +, NK_WIDGET_ROM +, NK_WIDGET_DISABLED + }
 
enum  nk_widget_states {
+  NK_WIDGET_STATE_MODIFIED = NK_FLAG(1) +, NK_WIDGET_STATE_INACTIVE = NK_FLAG(2) +, NK_WIDGET_STATE_ENTERED = NK_FLAG(3) +, NK_WIDGET_STATE_HOVER = NK_FLAG(4) +,
+  NK_WIDGET_STATE_ACTIVED = NK_FLAG(5) +, NK_WIDGET_STATE_LEFT = NK_FLAG(6) +, NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED +, NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED +
+ }
 
enum  nk_text_align {
+  NK_TEXT_ALIGN_LEFT = 0x01 +, NK_TEXT_ALIGN_CENTERED = 0x02 +, NK_TEXT_ALIGN_RIGHT = 0x04 +, NK_TEXT_ALIGN_TOP = 0x08 +,
+  NK_TEXT_ALIGN_MIDDLE = 0x10 +, NK_TEXT_ALIGN_BOTTOM = 0x20 +
+ }
 
enum  nk_text_alignment { NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT +, NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED +, NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT + }
 
enum  nk_edit_flags {
+  NK_EDIT_DEFAULT = 0 +, NK_EDIT_READ_ONLY = NK_FLAG(0) +, NK_EDIT_AUTO_SELECT = NK_FLAG(1) +, NK_EDIT_SIG_ENTER = NK_FLAG(2) +,
+  NK_EDIT_ALLOW_TAB = NK_FLAG(3) +, NK_EDIT_NO_CURSOR = NK_FLAG(4) +, NK_EDIT_SELECTABLE = NK_FLAG(5) +, NK_EDIT_CLIPBOARD = NK_FLAG(6) +,
+  NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7) +, NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8) +, NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9) +, NK_EDIT_MULTILINE = NK_FLAG(10) +,
+  NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11) +
+ }
 
enum  nk_edit_types { NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE +, NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD +, NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD +, NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD + }
 
enum  nk_edit_events {
+  NK_EDIT_ACTIVE = NK_FLAG(0) +, NK_EDIT_INACTIVE = NK_FLAG(1) +, NK_EDIT_ACTIVATED = NK_FLAG(2) +, NK_EDIT_DEACTIVATED = NK_FLAG(3) +,
+  NK_EDIT_COMMITED = NK_FLAG(4) +
+ }
 
enum  nk_style_colors {
+  NK_COLOR_TEXT +, NK_COLOR_WINDOW +, NK_COLOR_HEADER +, NK_COLOR_BORDER +,
+  NK_COLOR_BUTTON +, NK_COLOR_BUTTON_HOVER +, NK_COLOR_BUTTON_ACTIVE +, NK_COLOR_TOGGLE +,
+  NK_COLOR_TOGGLE_HOVER +, NK_COLOR_TOGGLE_CURSOR +, NK_COLOR_SELECT +, NK_COLOR_SELECT_ACTIVE +,
+  NK_COLOR_SLIDER +, NK_COLOR_SLIDER_CURSOR +, NK_COLOR_SLIDER_CURSOR_HOVER +, NK_COLOR_SLIDER_CURSOR_ACTIVE +,
+  NK_COLOR_PROPERTY +, NK_COLOR_EDIT +, NK_COLOR_EDIT_CURSOR +, NK_COLOR_COMBO +,
+  NK_COLOR_CHART +, NK_COLOR_CHART_COLOR +, NK_COLOR_CHART_COLOR_HIGHLIGHT +, NK_COLOR_SCROLLBAR +,
+  NK_COLOR_SCROLLBAR_CURSOR +, NK_COLOR_SCROLLBAR_CURSOR_HOVER +, NK_COLOR_SCROLLBAR_CURSOR_ACTIVE +, NK_COLOR_TAB_HEADER +,
+  NK_COLOR_KNOB +, NK_COLOR_KNOB_CURSOR +, NK_COLOR_KNOB_CURSOR_HOVER +, NK_COLOR_KNOB_CURSOR_ACTIVE +,
+  NK_COLOR_COUNT +
+ }
 
enum  nk_style_cursor {
+  NK_CURSOR_ARROW +, NK_CURSOR_TEXT +, NK_CURSOR_MOVE +, NK_CURSOR_RESIZE_VERTICAL +,
+  NK_CURSOR_RESIZE_HORIZONTAL +, NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT +, NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT +, NK_CURSOR_COUNT +
+ }
 
enum  nk_allocation_type { NK_BUFFER_FIXED +, NK_BUFFER_DYNAMIC + }
 
enum  nk_buffer_allocation_type { NK_BUFFER_FRONT +, NK_BUFFER_BACK +, NK_BUFFER_MAX + }
 
enum  nk_text_edit_type { NK_TEXT_EDIT_SINGLE_LINE +, NK_TEXT_EDIT_MULTI_LINE + }
 
enum  nk_text_edit_mode { NK_TEXT_EDIT_MODE_VIEW +, NK_TEXT_EDIT_MODE_INSERT +, NK_TEXT_EDIT_MODE_REPLACE + }
 
enum  nk_command_type {
+  NK_COMMAND_NOP +, NK_COMMAND_SCISSOR +, NK_COMMAND_LINE +, NK_COMMAND_CURVE +,
+  NK_COMMAND_RECT +, NK_COMMAND_RECT_FILLED +, NK_COMMAND_RECT_MULTI_COLOR +, NK_COMMAND_CIRCLE +,
+  NK_COMMAND_CIRCLE_FILLED +, NK_COMMAND_ARC +, NK_COMMAND_ARC_FILLED +, NK_COMMAND_TRIANGLE +,
+  NK_COMMAND_TRIANGLE_FILLED +, NK_COMMAND_POLYGON +, NK_COMMAND_POLYGON_FILLED +, NK_COMMAND_POLYLINE +,
+  NK_COMMAND_TEXT +, NK_COMMAND_IMAGE +, NK_COMMAND_CUSTOM +
+ }
 
enum  nk_command_clipping { NK_CLIPPING_OFF = nk_false +, NK_CLIPPING_ON = nk_true + }
 
enum  nk_style_item_type { NK_STYLE_ITEM_COLOR +, NK_STYLE_ITEM_IMAGE +, NK_STYLE_ITEM_NINE_SLICE + }
 
enum  nk_style_header_align { NK_HEADER_LEFT +, NK_HEADER_RIGHT + }
 
enum  nk_panel_type {
+  NK_PANEL_NONE = 0 +, NK_PANEL_WINDOW = NK_FLAG(0) +, NK_PANEL_GROUP = NK_FLAG(1) +, NK_PANEL_POPUP = NK_FLAG(2) +,
+  NK_PANEL_CONTEXTUAL = NK_FLAG(4) +, NK_PANEL_COMBO = NK_FLAG(5) +, NK_PANEL_MENU = NK_FLAG(6) +, NK_PANEL_TOOLTIP = NK_FLAG(7) +
+ }
 
enum  nk_panel_set { NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP +, NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP +, NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP + }
 
enum  nk_panel_row_layout_type {
+  NK_LAYOUT_DYNAMIC_FIXED = 0 +, NK_LAYOUT_DYNAMIC_ROW +, NK_LAYOUT_DYNAMIC_FREE +, NK_LAYOUT_DYNAMIC +,
+  NK_LAYOUT_STATIC_FIXED +, NK_LAYOUT_STATIC_ROW +, NK_LAYOUT_STATIC_FREE +, NK_LAYOUT_STATIC +,
+  NK_LAYOUT_TEMPLATE +, NK_LAYOUT_COUNT +
+ }
 
enum  nk_window_flags {
+  NK_WINDOW_PRIVATE = NK_FLAG(11) +, NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE +, NK_WINDOW_ROM = NK_FLAG(12) +, NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT +,
+  NK_WINDOW_HIDDEN = NK_FLAG(13) +, NK_WINDOW_CLOSED = NK_FLAG(14) +, NK_WINDOW_MINIMIZED = NK_FLAG(15) +, NK_WINDOW_REMOVE_ROM = NK_FLAG(16) +
+ }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

NK_STATIC_ASSERT (sizeof(nk_short)==2)
 
NK_STATIC_ASSERT (sizeof(nk_ushort)==2)
 
NK_STATIC_ASSERT (sizeof(nk_uint)==4)
 
NK_STATIC_ASSERT (sizeof(nk_int)==4)
 
NK_STATIC_ASSERT (sizeof(nk_byte)==1)
 
NK_STATIC_ASSERT (sizeof(nk_flags) >=4)
 
NK_STATIC_ASSERT (sizeof(nk_size) >=sizeof(void *))
 
NK_STATIC_ASSERT (sizeof(nk_ptr) >=sizeof(void *))
 
NK_STATIC_ASSERT (sizeof(nk_bool) >=2)
 
NK_API nk_bool nk_init_fixed (struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
 
NK_API nk_bool nk_init (struct nk_context *, const struct nk_allocator *, const struct nk_user_font *)
 
NK_API nk_bool nk_init_custom (struct nk_context *, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *)
 Initializes a nk_context struct from two different either fixed or growing buffers. More...
 
NK_API void nk_clear (struct nk_context *)
 Resets the context state at the end of the frame. More...
 
NK_API void nk_free (struct nk_context *)
 Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed. More...
 
NK_API void nk_input_begin (struct nk_context *)
 Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movement as well as key state transitions. More...
 
NK_API void nk_input_motion (struct nk_context *, int x, int y)
 Mirrors current mouse position to nuklear. More...
 
NK_API void nk_input_key (struct nk_context *, enum nk_keys, nk_bool down)
 Mirrors the state of a specific key to nuklear. More...
 
NK_API void nk_input_button (struct nk_context *, enum nk_buttons, int x, int y, nk_bool down)
 Mirrors the state of a specific mouse button to nuklear. More...
 
NK_API void nk_input_scroll (struct nk_context *, struct nk_vec2 val)
 Copies the last mouse scroll value to nuklear. More...
 
NK_API void nk_input_char (struct nk_context *, char)
 Copies a single ASCII character into an internal text buffer. More...
 
NK_API void nk_input_glyph (struct nk_context *, const nk_glyph)
 Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer. More...
 
NK_API void nk_input_unicode (struct nk_context *, nk_rune)
 Converts a unicode rune into UTF-8 and copies the result into an internal text buffer. More...
 
NK_API void nk_input_end (struct nk_context *)
 End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not grabbed indefinitely. More...
 
NK_API const struct nk_commandnk__begin (struct nk_context *)
 Returns a draw command list iterator to iterate all draw commands accumulated over one frame. More...
 
NK_API const struct nk_commandnk__next (struct nk_context *, const struct nk_command *)
 Returns draw command pointer pointing to the next command inside the draw command list. More...
 
NK_API nk_bool nk_begin (struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
 
NK_API nk_bool nk_begin_titled (struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags)
 
NK_API void nk_end (struct nk_context *ctx)
 
NK_API struct nk_windownk_window_find (const struct nk_context *ctx, const char *name)
 
NK_API struct nk_rect nk_window_get_bounds (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_window_get_position (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_window_get_size (const struct nk_context *ctx)
 
NK_API float nk_window_get_width (const struct nk_context *ctx)
 nk_window_get_width More...
 
NK_API float nk_window_get_height (const struct nk_context *ctx)
 
NK_API struct nk_panelnk_window_get_panel (const struct nk_context *ctx)
 
NK_API struct nk_rect nk_window_get_content_region (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_window_get_content_region_min (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_window_get_content_region_max (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_window_get_content_region_size (const struct nk_context *ctx)
 
NK_API struct nk_command_buffernk_window_get_canvas (const struct nk_context *ctx)
 
NK_API void nk_window_get_scroll (const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
 
NK_API nk_bool nk_window_has_focus (const struct nk_context *ctx)
 
NK_API nk_bool nk_window_is_hovered (const struct nk_context *ctx)
 
NK_API nk_bool nk_window_is_collapsed (const struct nk_context *ctx, const char *name)
 
NK_API nk_bool nk_window_is_closed (const struct nk_context *ctx, const char *name)
 
NK_API nk_bool nk_window_is_hidden (const struct nk_context *ctx, const char *name)
 
NK_API nk_bool nk_window_is_active (const struct nk_context *ctx, const char *name)
 
NK_API nk_bool nk_window_is_any_hovered (const struct nk_context *ctx)
 
NK_API nk_bool nk_item_is_any_active (const struct nk_context *ctx)
 
NK_API void nk_window_set_bounds (struct nk_context *ctx, const char *name, struct nk_rect bounds)
 
NK_API void nk_window_set_position (struct nk_context *ctx, const char *name, struct nk_vec2 pos)
 
NK_API void nk_window_set_size (struct nk_context *ctx, const char *name, struct nk_vec2 size)
 
NK_API void nk_window_set_focus (struct nk_context *ctx, const char *name)
 
NK_API void nk_window_set_scroll (struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
 
NK_API void nk_window_close (struct nk_context *ctx, const char *name)
 
NK_API void nk_window_collapse (struct nk_context *ctx, const char *name, enum nk_collapse_states state)
 
NK_API void nk_window_collapse_if (struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond)
 
NK_API void nk_window_show (struct nk_context *ctx, const char *name, enum nk_show_states state)
 
NK_API void nk_window_show_if (struct nk_context *ctx, const char *name, enum nk_show_states state, int cond)
 
NK_API void nk_rule_horizontal (struct nk_context *ctx, struct nk_color color, nk_bool rounding)
 
NK_API void nk_layout_set_min_row_height (struct nk_context *, float height)
 Sets the currently used minimum row height. More...
 
NK_API void nk_layout_reset_min_row_height (struct nk_context *)
 Reset the currently used minimum row height back to font_height + text_padding + padding More...
 
NK_API struct nk_rect nk_layout_widget_bounds (const struct nk_context *ctx)
 Returns the width of the next row allocate by one of the layouting functions. More...
 
NK_API float nk_layout_ratio_from_pixel (const struct nk_context *ctx, float pixel_width)
 Utility functions to calculate window ratio from pixel size. More...
 
NK_API void nk_layout_row_dynamic (struct nk_context *ctx, float height, int cols)
 Sets current row layout to share horizontal space between @cols number of widgets evenly. More...
 
NK_API void nk_layout_row_static (struct nk_context *ctx, float height, int item_width, int cols)
 Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size. More...
 
NK_API void nk_layout_row_begin (struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
 Starts a new dynamic or fixed row with given height and columns. More...
 
NK_API void nk_layout_row_push (struct nk_context *, float value)
 \breif Specifies either window ratio or width of a single column More...
 
NK_API void nk_layout_row_end (struct nk_context *)
 Finished previously started row. More...
 
NK_API void nk_layout_row (struct nk_context *, enum nk_layout_format, float height, int cols, const float *ratio)
 Specifies row columns in array as either window ratio or size. More...
 
NK_API void nk_layout_row_template_begin (struct nk_context *, float row_height)
 
NK_API void nk_layout_row_template_push_dynamic (struct nk_context *)
 
NK_API void nk_layout_row_template_push_variable (struct nk_context *, float min_width)
 
NK_API void nk_layout_row_template_push_static (struct nk_context *, float width)
 
NK_API void nk_layout_row_template_end (struct nk_context *)
 
NK_API void nk_layout_space_begin (struct nk_context *, enum nk_layout_format, float height, int widget_count)
 
NK_API void nk_layout_space_push (struct nk_context *, struct nk_rect bounds)
 
NK_API void nk_layout_space_end (struct nk_context *)
 
NK_API struct nk_rect nk_layout_space_bounds (const struct nk_context *ctx)
 
NK_API struct nk_vec2 nk_layout_space_to_screen (const struct nk_context *ctx, struct nk_vec2 vec)
 
NK_API struct nk_vec2 nk_layout_space_to_local (const struct nk_context *ctx, struct nk_vec2 vec)
 
NK_API struct nk_rect nk_layout_space_rect_to_screen (const struct nk_context *ctx, struct nk_rect bounds)
 
NK_API struct nk_rect nk_layout_space_rect_to_local (const struct nk_context *ctx, struct nk_rect bounds)
 
NK_API void nk_spacer (struct nk_context *ctx)
 
NK_API nk_bool nk_group_begin (struct nk_context *, const char *title, nk_flags)
 Starts a new widget group. More...
 
NK_API nk_bool nk_group_begin_titled (struct nk_context *, const char *name, const char *title, nk_flags)
 Starts a new widget group. More...
 
NK_API void nk_group_end (struct nk_context *)
 
NK_API nk_bool nk_group_scrolled_offset_begin (struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
 
NK_API nk_bool nk_group_scrolled_begin (struct nk_context *, struct nk_scroll *off, const char *title, nk_flags)
 
NK_API void nk_group_scrolled_end (struct nk_context *)
 
NK_API void nk_group_get_scroll (struct nk_context *, const char *id, nk_uint *x_offset, nk_uint *y_offset)
 
NK_API void nk_group_set_scroll (struct nk_context *, const char *id, nk_uint x_offset, nk_uint y_offset)
 
NK_API nk_bool nk_tree_push_hashed (struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
 
NK_API nk_bool nk_tree_image_push_hashed (struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
 
NK_API void nk_tree_pop (struct nk_context *)
 
NK_API nk_bool nk_tree_state_push (struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states *state)
 
NK_API nk_bool nk_tree_state_image_push (struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state)
 
NK_API void nk_tree_state_pop (struct nk_context *)
 
+NK_API nk_bool nk_tree_element_push_hashed (struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len, int seed)
 
+NK_API nk_bool nk_tree_element_image_push_hashed (struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len, int seed)
 
+NK_API void nk_tree_element_pop (struct nk_context *)
 
+NK_API nk_bool nk_list_view_begin (struct nk_context *, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count)
 
+NK_API void nk_list_view_end (struct nk_list_view *)
 
+NK_API enum nk_widget_layout_states nk_widget (struct nk_rect *, const struct nk_context *)
 
+NK_API enum nk_widget_layout_states nk_widget_fitting (struct nk_rect *, const struct nk_context *, struct nk_vec2)
 
+NK_API struct nk_rect nk_widget_bounds (const struct nk_context *)
 
+NK_API struct nk_vec2 nk_widget_position (const struct nk_context *)
 
+NK_API struct nk_vec2 nk_widget_size (const struct nk_context *)
 
+NK_API float nk_widget_width (const struct nk_context *)
 
+NK_API float nk_widget_height (const struct nk_context *)
 
+NK_API nk_bool nk_widget_is_hovered (const struct nk_context *)
 
+NK_API nk_bool nk_widget_is_mouse_clicked (const struct nk_context *, enum nk_buttons)
 
+NK_API nk_bool nk_widget_has_mouse_click_down (const struct nk_context *, enum nk_buttons, nk_bool down)
 
+NK_API void nk_spacing (struct nk_context *, int cols)
 
+NK_API void nk_widget_disable_begin (struct nk_context *ctx)
 
+NK_API void nk_widget_disable_end (struct nk_context *ctx)
 
+NK_API void nk_text (struct nk_context *, const char *, int, nk_flags)
 
+NK_API void nk_text_colored (struct nk_context *, const char *, int, nk_flags, struct nk_color)
 
+NK_API void nk_text_wrap (struct nk_context *, const char *, int)
 
+NK_API void nk_text_wrap_colored (struct nk_context *, const char *, int, struct nk_color)
 
+NK_API void nk_label (struct nk_context *, const char *, nk_flags align)
 
+NK_API void nk_label_colored (struct nk_context *, const char *, nk_flags align, struct nk_color)
 
+NK_API void nk_label_wrap (struct nk_context *, const char *)
 
+NK_API void nk_label_colored_wrap (struct nk_context *, const char *, struct nk_color)
 
+NK_API void nk_image (struct nk_context *, struct nk_image)
 
+NK_API void nk_image_color (struct nk_context *, struct nk_image, struct nk_color)
 
+NK_API nk_bool nk_button_text (struct nk_context *, const char *title, int len)
 
+NK_API nk_bool nk_button_label (struct nk_context *, const char *title)
 
+NK_API nk_bool nk_button_color (struct nk_context *, struct nk_color)
 
+NK_API nk_bool nk_button_symbol (struct nk_context *, enum nk_symbol_type)
 
+NK_API nk_bool nk_button_image (struct nk_context *, struct nk_image img)
 
+NK_API nk_bool nk_button_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags text_alignment)
 
+NK_API nk_bool nk_button_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_button_image_label (struct nk_context *, struct nk_image img, const char *, nk_flags text_alignment)
 
+NK_API nk_bool nk_button_image_text (struct nk_context *, struct nk_image img, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_button_text_styled (struct nk_context *, const struct nk_style_button *, const char *title, int len)
 
+NK_API nk_bool nk_button_label_styled (struct nk_context *, const struct nk_style_button *, const char *title)
 
+NK_API nk_bool nk_button_symbol_styled (struct nk_context *, const struct nk_style_button *, enum nk_symbol_type)
 
+NK_API nk_bool nk_button_image_styled (struct nk_context *, const struct nk_style_button *, struct nk_image img)
 
+NK_API nk_bool nk_button_symbol_text_styled (struct nk_context *, const struct nk_style_button *, enum nk_symbol_type, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_button_symbol_label_styled (struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align)
 
+NK_API nk_bool nk_button_image_label_styled (struct nk_context *, const struct nk_style_button *, struct nk_image img, const char *, nk_flags text_alignment)
 
+NK_API nk_bool nk_button_image_text_styled (struct nk_context *, const struct nk_style_button *, struct nk_image img, const char *, int, nk_flags alignment)
 
+NK_API void nk_button_set_behavior (struct nk_context *, enum nk_button_behavior)
 
+NK_API nk_bool nk_button_push_behavior (struct nk_context *, enum nk_button_behavior)
 
+NK_API nk_bool nk_button_pop_behavior (struct nk_context *)
 
+NK_API nk_bool nk_check_label (struct nk_context *, const char *, nk_bool active)
 
+NK_API nk_bool nk_check_text (struct nk_context *, const char *, int, nk_bool active)
 
+NK_API nk_bool nk_check_text_align (struct nk_context *, const char *, int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API unsigned nk_check_flags_label (struct nk_context *, const char *, unsigned int flags, unsigned int value)
 
+NK_API unsigned nk_check_flags_text (struct nk_context *, const char *, int, unsigned int flags, unsigned int value)
 
+NK_API nk_bool nk_checkbox_label (struct nk_context *, const char *, nk_bool *active)
 
+NK_API nk_bool nk_checkbox_label_align (struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_checkbox_text (struct nk_context *, const char *, int, nk_bool *active)
 
+NK_API nk_bool nk_checkbox_text_align (struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_checkbox_flags_label (struct nk_context *, const char *, unsigned int *flags, unsigned int value)
 
+NK_API nk_bool nk_checkbox_flags_text (struct nk_context *, const char *, int, unsigned int *flags, unsigned int value)
 
+NK_API nk_bool nk_radio_label (struct nk_context *, const char *, nk_bool *active)
 
+NK_API nk_bool nk_radio_label_align (struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_radio_text (struct nk_context *, const char *, int, nk_bool *active)
 
+NK_API nk_bool nk_radio_text_align (struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_option_label (struct nk_context *, const char *, nk_bool active)
 
+NK_API nk_bool nk_option_label_align (struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_option_text (struct nk_context *, const char *, int, nk_bool active)
 
+NK_API nk_bool nk_option_text_align (struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment)
 
+NK_API nk_bool nk_selectable_label (struct nk_context *, const char *, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_selectable_text (struct nk_context *, const char *, int, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_selectable_image_label (struct nk_context *, struct nk_image, const char *, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_selectable_image_text (struct nk_context *, struct nk_image, const char *, int, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_selectable_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_selectable_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags align, nk_bool *value)
 
+NK_API nk_bool nk_select_label (struct nk_context *, const char *, nk_flags align, nk_bool value)
 
+NK_API nk_bool nk_select_text (struct nk_context *, const char *, int, nk_flags align, nk_bool value)
 
+NK_API nk_bool nk_select_image_label (struct nk_context *, struct nk_image, const char *, nk_flags align, nk_bool value)
 
+NK_API nk_bool nk_select_image_text (struct nk_context *, struct nk_image, const char *, int, nk_flags align, nk_bool value)
 
+NK_API nk_bool nk_select_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags align, nk_bool value)
 
+NK_API nk_bool nk_select_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags align, nk_bool value)
 
+NK_API float nk_slide_float (struct nk_context *, float min, float val, float max, float step)
 
+NK_API int nk_slide_int (struct nk_context *, int min, int val, int max, int step)
 
+NK_API nk_bool nk_slider_float (struct nk_context *, float min, float *val, float max, float step)
 
+NK_API nk_bool nk_slider_int (struct nk_context *, int min, int *val, int max, int step)
 
+NK_API nk_bool nk_knob_float (struct nk_context *, float min, float *val, float max, float step, enum nk_heading zero_direction, float dead_zone_degrees)
 
+NK_API nk_bool nk_knob_int (struct nk_context *, int min, int *val, int max, int step, enum nk_heading zero_direction, float dead_zone_degrees)
 
+NK_API nk_bool nk_progress (struct nk_context *, nk_size *cur, nk_size max, nk_bool modifyable)
 
+NK_API nk_size nk_prog (struct nk_context *, nk_size cur, nk_size max, nk_bool modifyable)
 
+NK_API struct nk_colorf nk_color_picker (struct nk_context *, struct nk_colorf, enum nk_color_format)
 
+NK_API nk_bool nk_color_pick (struct nk_context *, struct nk_colorf *, enum nk_color_format)
 
+NK_API void nk_property_int (struct nk_context *, const char *name, int min, int *val, int max, int step, float inc_per_pixel)
 
NK_API void nk_property_float (struct nk_context *, const char *name, float min, float *val, float max, float step, float inc_per_pixel)
 
NK_API void nk_property_double (struct nk_context *, const char *name, double min, double *val, double max, double step, float inc_per_pixel)
 
NK_API int nk_propertyi (struct nk_context *, const char *name, int min, int val, int max, int step, float inc_per_pixel)
 
NK_API float nk_propertyf (struct nk_context *, const char *name, float min, float val, float max, float step, float inc_per_pixel)
 
NK_API double nk_propertyd (struct nk_context *, const char *name, double min, double val, double max, double step, float inc_per_pixel)
 
+NK_API nk_flags nk_edit_string (struct nk_context *, nk_flags, char *buffer, int *len, int max, nk_plugin_filter)
 
+NK_API nk_flags nk_edit_string_zero_terminated (struct nk_context *, nk_flags, char *buffer, int max, nk_plugin_filter)
 
+NK_API nk_flags nk_edit_buffer (struct nk_context *, nk_flags, struct nk_text_edit *, nk_plugin_filter)
 
+NK_API void nk_edit_focus (struct nk_context *, nk_flags flags)
 
+NK_API void nk_edit_unfocus (struct nk_context *)
 
+NK_API nk_bool nk_chart_begin (struct nk_context *, enum nk_chart_type, int num, float min, float max)
 
+NK_API nk_bool nk_chart_begin_colored (struct nk_context *, enum nk_chart_type, struct nk_color, struct nk_color active, int num, float min, float max)
 
+NK_API void nk_chart_add_slot (struct nk_context *ctx, const enum nk_chart_type, int count, float min_value, float max_value)
 
+NK_API void nk_chart_add_slot_colored (struct nk_context *ctx, const enum nk_chart_type, struct nk_color, struct nk_color active, int count, float min_value, float max_value)
 
+NK_API nk_flags nk_chart_push (struct nk_context *, float)
 
+NK_API nk_flags nk_chart_push_slot (struct nk_context *, float, int)
 
+NK_API void nk_chart_end (struct nk_context *)
 
+NK_API void nk_plot (struct nk_context *, enum nk_chart_type, const float *values, int count, int offset)
 
+NK_API void nk_plot_function (struct nk_context *, enum nk_chart_type, void *userdata, float(*value_getter)(void *user, int index), int count, int offset)
 
+NK_API nk_bool nk_popup_begin (struct nk_context *, enum nk_popup_type, const char *, nk_flags, struct nk_rect bounds)
 
+NK_API void nk_popup_close (struct nk_context *)
 
+NK_API void nk_popup_end (struct nk_context *)
 
+NK_API void nk_popup_get_scroll (const struct nk_context *, nk_uint *offset_x, nk_uint *offset_y)
 
+NK_API void nk_popup_set_scroll (struct nk_context *, nk_uint offset_x, nk_uint offset_y)
 
+NK_API int nk_combo (struct nk_context *, const char *const *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 *const *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)
 
+NK_API nk_bool nk_combo_begin_text (struct nk_context *, const char *selected, int, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_label (struct nk_context *, const char *selected, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_color (struct nk_context *, struct nk_color color, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_symbol (struct nk_context *, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_symbol_label (struct nk_context *, const char *selected, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_symbol_text (struct nk_context *, const char *selected, int, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_image (struct nk_context *, struct nk_image img, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_image_label (struct nk_context *, const char *selected, struct nk_image, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_begin_image_text (struct nk_context *, const char *selected, int, struct nk_image, struct nk_vec2 size)
 
+NK_API nk_bool nk_combo_item_label (struct nk_context *, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_combo_item_text (struct nk_context *, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_combo_item_image_label (struct nk_context *, struct nk_image, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_combo_item_image_text (struct nk_context *, struct nk_image, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_combo_item_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_combo_item_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags alignment)
 
+NK_API void nk_combo_close (struct nk_context *)
 
+NK_API void nk_combo_end (struct nk_context *)
 
+NK_API nk_bool nk_contextual_begin (struct nk_context *, nk_flags, struct nk_vec2, struct nk_rect trigger_bounds)
 
+NK_API nk_bool nk_contextual_item_text (struct nk_context *, const char *, int, nk_flags align)
 
+NK_API nk_bool nk_contextual_item_label (struct nk_context *, const char *, nk_flags align)
 
+NK_API nk_bool nk_contextual_item_image_label (struct nk_context *, struct nk_image, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_contextual_item_image_text (struct nk_context *, struct nk_image, const char *, int len, nk_flags alignment)
 
+NK_API nk_bool nk_contextual_item_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_contextual_item_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags alignment)
 
+NK_API void nk_contextual_close (struct nk_context *)
 
+NK_API void nk_contextual_end (struct nk_context *)
 
+NK_API void nk_tooltip (struct nk_context *, const char *)
 
+NK_API nk_bool nk_tooltip_begin (struct nk_context *, float width)
 
+NK_API void nk_tooltip_end (struct nk_context *)
 
+NK_API void nk_menubar_begin (struct nk_context *)
 
+NK_API void nk_menubar_end (struct nk_context *)
 
+NK_API nk_bool nk_menu_begin_text (struct nk_context *, const char *title, int title_len, nk_flags align, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_label (struct nk_context *, const char *, nk_flags align, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_image (struct nk_context *, const char *, struct nk_image, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_image_text (struct nk_context *, const char *, int, nk_flags align, struct nk_image, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_image_label (struct nk_context *, const char *, nk_flags align, struct nk_image, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_symbol (struct nk_context *, const char *, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_symbol_text (struct nk_context *, const char *, int, nk_flags align, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_begin_symbol_label (struct nk_context *, const char *, nk_flags align, enum nk_symbol_type, struct nk_vec2 size)
 
+NK_API nk_bool nk_menu_item_text (struct nk_context *, const char *, int, nk_flags align)
 
+NK_API nk_bool nk_menu_item_label (struct nk_context *, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_menu_item_image_label (struct nk_context *, struct nk_image, const char *, nk_flags alignment)
 
+NK_API nk_bool nk_menu_item_image_text (struct nk_context *, struct nk_image, const char *, int len, nk_flags alignment)
 
+NK_API nk_bool nk_menu_item_symbol_text (struct nk_context *, enum nk_symbol_type, const char *, int, nk_flags alignment)
 
+NK_API nk_bool nk_menu_item_symbol_label (struct nk_context *, enum nk_symbol_type, const char *, nk_flags alignment)
 
+NK_API void nk_menu_close (struct nk_context *)
 
+NK_API void nk_menu_end (struct nk_context *)
 
+NK_API void nk_style_default (struct nk_context *)
 
+NK_API void nk_style_from_table (struct nk_context *, const struct nk_color *)
 
+NK_API void nk_style_load_cursor (struct nk_context *, enum nk_style_cursor, const struct nk_cursor *)
 
+NK_API void nk_style_load_all_cursors (struct nk_context *, const struct nk_cursor *)
 
+NK_API const char * nk_style_get_color_by_name (enum nk_style_colors)
 
+NK_API void nk_style_set_font (struct nk_context *, const struct nk_user_font *)
 
+NK_API nk_bool nk_style_set_cursor (struct nk_context *, enum nk_style_cursor)
 
+NK_API void nk_style_show_cursor (struct nk_context *)
 
+NK_API void nk_style_hide_cursor (struct nk_context *)
 
+NK_API nk_bool nk_style_push_font (struct nk_context *, const struct nk_user_font *)
 
+NK_API nk_bool nk_style_push_float (struct nk_context *, float *, float)
 
+NK_API nk_bool nk_style_push_vec2 (struct nk_context *, struct nk_vec2 *, struct nk_vec2)
 
+NK_API nk_bool nk_style_push_style_item (struct nk_context *, struct nk_style_item *, struct nk_style_item)
 
+NK_API nk_bool nk_style_push_flags (struct nk_context *, nk_flags *, nk_flags)
 
+NK_API nk_bool nk_style_push_color (struct nk_context *, struct nk_color *, struct nk_color)
 
+NK_API nk_bool nk_style_pop_font (struct nk_context *)
 
+NK_API nk_bool nk_style_pop_float (struct nk_context *)
 
+NK_API nk_bool nk_style_pop_vec2 (struct nk_context *)
 
+NK_API nk_bool nk_style_pop_style_item (struct nk_context *)
 
+NK_API nk_bool nk_style_pop_flags (struct nk_context *)
 
+NK_API nk_bool nk_style_pop_color (struct nk_context *)
 
+NK_API struct nk_color nk_rgb (int r, int g, int b)
 
+NK_API struct nk_color nk_rgb_iv (const int *rgb)
 
+NK_API struct nk_color nk_rgb_bv (const nk_byte *rgb)
 
+NK_API struct nk_color nk_rgb_f (float r, float g, float b)
 
+NK_API struct nk_color nk_rgb_fv (const float *rgb)
 
+NK_API struct nk_color nk_rgb_cf (struct nk_colorf c)
 
+NK_API struct nk_color nk_rgb_hex (const char *rgb)
 
+NK_API struct nk_color nk_rgb_factor (struct nk_color col, float factor)
 
+NK_API struct nk_color nk_rgba (int r, int g, int b, int a)
 
+NK_API struct nk_color nk_rgba_u32 (nk_uint)
 
+NK_API struct nk_color nk_rgba_iv (const int *rgba)
 
+NK_API struct nk_color nk_rgba_bv (const nk_byte *rgba)
 
+NK_API struct nk_color nk_rgba_f (float r, float g, float b, float a)
 
+NK_API struct nk_color nk_rgba_fv (const float *rgba)
 
+NK_API struct nk_color nk_rgba_cf (struct nk_colorf c)
 
+NK_API struct nk_color nk_rgba_hex (const char *rgb)
 
+NK_API struct nk_colorf nk_hsva_colorf (float h, float s, float v, float a)
 
+NK_API struct nk_colorf nk_hsva_colorfv (const float *c)
 
+NK_API void nk_colorf_hsva_f (float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in)
 
+NK_API void nk_colorf_hsva_fv (float *hsva, struct nk_colorf in)
 
+NK_API struct nk_color nk_hsv (int h, int s, int v)
 
+NK_API struct nk_color nk_hsv_iv (const int *hsv)
 
+NK_API struct nk_color nk_hsv_bv (const nk_byte *hsv)
 
+NK_API struct nk_color nk_hsv_f (float h, float s, float v)
 
+NK_API struct nk_color nk_hsv_fv (const float *hsv)
 
+NK_API struct nk_color nk_hsva (int h, int s, int v, int a)
 
+NK_API struct nk_color nk_hsva_iv (const int *hsva)
 
+NK_API struct nk_color nk_hsva_bv (const nk_byte *hsva)
 
+NK_API struct nk_color nk_hsva_f (float h, float s, float v, float a)
 
+NK_API struct nk_color nk_hsva_fv (const float *hsva)
 
+NK_API void nk_color_f (float *r, float *g, float *b, float *a, struct nk_color)
 
+NK_API void nk_color_fv (float *rgba_out, struct nk_color)
 
+NK_API struct nk_colorf nk_color_cf (struct nk_color)
 
+NK_API void nk_color_d (double *r, double *g, double *b, double *a, struct nk_color)
 
+NK_API void nk_color_dv (double *rgba_out, struct nk_color)
 
+NK_API nk_uint nk_color_u32 (struct nk_color)
 
+NK_API void nk_color_hex_rgba (char *output, struct nk_color)
 
+NK_API void nk_color_hex_rgb (char *output, struct nk_color)
 
+NK_API void nk_color_hsv_i (int *out_h, int *out_s, int *out_v, struct nk_color)
 
+NK_API void nk_color_hsv_b (nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color)
 
+NK_API void nk_color_hsv_iv (int *hsv_out, struct nk_color)
 
+NK_API void nk_color_hsv_bv (nk_byte *hsv_out, struct nk_color)
 
+NK_API void nk_color_hsv_f (float *out_h, float *out_s, float *out_v, struct nk_color)
 
+NK_API void nk_color_hsv_fv (float *hsv_out, struct nk_color)
 
+NK_API void nk_color_hsva_i (int *h, int *s, int *v, int *a, struct nk_color)
 
+NK_API void nk_color_hsva_b (nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color)
 
+NK_API void nk_color_hsva_iv (int *hsva_out, struct nk_color)
 
+NK_API void nk_color_hsva_bv (nk_byte *hsva_out, struct nk_color)
 
+NK_API void nk_color_hsva_f (float *out_h, float *out_s, float *out_v, float *out_a, struct nk_color)
 
+NK_API void nk_color_hsva_fv (float *hsva_out, struct nk_color)
 
+NK_API nk_handle nk_handle_ptr (void *)
 
+NK_API nk_handle nk_handle_id (int)
 
+NK_API struct nk_image nk_image_handle (nk_handle)
 
+NK_API struct nk_image nk_image_ptr (void *)
 
+NK_API struct nk_image nk_image_id (int)
 
+NK_API nk_bool nk_image_is_subimage (const struct nk_image *img)
 
+NK_API struct nk_image nk_subimage_ptr (void *, nk_ushort w, nk_ushort h, struct nk_rect sub_region)
 
+NK_API struct nk_image nk_subimage_id (int, nk_ushort w, nk_ushort h, struct nk_rect sub_region)
 
+NK_API struct nk_image nk_subimage_handle (nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region)
 
+NK_API struct nk_nine_slice nk_nine_slice_handle (nk_handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API struct nk_nine_slice nk_nine_slice_ptr (void *, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API struct nk_nine_slice nk_nine_slice_id (int, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API int nk_nine_slice_is_sub9slice (const struct nk_nine_slice *img)
 
+NK_API struct nk_nine_slice nk_sub9slice_ptr (void *, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API struct nk_nine_slice nk_sub9slice_id (int, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API struct nk_nine_slice nk_sub9slice_handle (nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
 
+NK_API nk_hash nk_murmur_hash (const void *key, int len, nk_hash seed)
 
+NK_API void nk_triangle_from_direction (struct nk_vec2 *result, struct nk_rect r, float pad_x, float pad_y, enum nk_heading)
 
+NK_API struct nk_vec2 nk_vec2 (float x, float y)
 
+NK_API struct nk_vec2 nk_vec2i (int x, int y)
 
+NK_API struct nk_vec2 nk_vec2v (const float *xy)
 
+NK_API struct nk_vec2 nk_vec2iv (const int *xy)
 
+NK_API struct nk_rect nk_get_null_rect (void)
 
+NK_API struct nk_rect nk_rect (float x, float y, float w, float h)
 
+NK_API struct nk_rect nk_recti (int x, int y, int w, int h)
 
+NK_API struct nk_rect nk_recta (struct nk_vec2 pos, struct nk_vec2 size)
 
+NK_API struct nk_rect nk_rectv (const float *xywh)
 
+NK_API struct nk_rect nk_rectiv (const int *xywh)
 
+NK_API struct nk_vec2 nk_rect_pos (struct nk_rect)
 
+NK_API struct nk_vec2 nk_rect_size (struct nk_rect)
 
+NK_API int nk_strlen (const char *str)
 
+NK_API int nk_stricmp (const char *s1, const char *s2)
 
+NK_API int nk_stricmpn (const char *s1, const char *s2, int n)
 
+NK_API int nk_strtoi (const char *str, char **endptr)
 
+NK_API float nk_strtof (const char *str, char **endptr)
 
+NK_API double nk_strtod (const char *str, char **endptr)
 
+NK_API int nk_strfilter (const char *text, const char *regexp)
 
+NK_API int nk_strmatch_fuzzy_string (char const *str, char const *pattern, int *out_score)
 
+NK_API int nk_strmatch_fuzzy_text (const char *txt, int txt_len, const char *pattern, int *out_score)
 
+NK_API int nk_utf_decode (const char *, nk_rune *, int)
 
+NK_API int nk_utf_encode (nk_rune, char *, int)
 
+NK_API int nk_utf_len (const char *, int byte_len)
 
+NK_API const char * nk_utf_at (const char *buffer, int length, int index, nk_rune *unicode, int *len)
 
+NK_API void nk_buffer_init (struct nk_buffer *, const struct nk_allocator *, nk_size size)
 
+NK_API void nk_buffer_init_fixed (struct nk_buffer *, void *memory, nk_size size)
 
+NK_API void nk_buffer_info (struct nk_memory_status *, const struct nk_buffer *)
 
+NK_API void nk_buffer_push (struct nk_buffer *, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align)
 
+NK_API void nk_buffer_mark (struct nk_buffer *, enum nk_buffer_allocation_type type)
 
+NK_API void nk_buffer_reset (struct nk_buffer *, enum nk_buffer_allocation_type type)
 
+NK_API void nk_buffer_clear (struct nk_buffer *)
 
+NK_API void nk_buffer_free (struct nk_buffer *)
 
+NK_API void * nk_buffer_memory (struct nk_buffer *)
 
+NK_API const void * nk_buffer_memory_const (const struct nk_buffer *)
 
+NK_API nk_size nk_buffer_total (const struct nk_buffer *)
 
+NK_API void nk_str_init (struct nk_str *, const struct nk_allocator *, nk_size size)
 
+NK_API void nk_str_init_fixed (struct nk_str *, void *memory, nk_size size)
 
+NK_API void nk_str_clear (struct nk_str *)
 
+NK_API void nk_str_free (struct nk_str *)
 
+NK_API int nk_str_append_text_char (struct nk_str *, const char *, int)
 
+NK_API int nk_str_append_str_char (struct nk_str *, const char *)
 
+NK_API int nk_str_append_text_utf8 (struct nk_str *, const char *, int)
 
+NK_API int nk_str_append_str_utf8 (struct nk_str *, const char *)
 
+NK_API int nk_str_append_text_runes (struct nk_str *, const nk_rune *, int)
 
+NK_API int nk_str_append_str_runes (struct nk_str *, const nk_rune *)
 
+NK_API int nk_str_insert_at_char (struct nk_str *, int pos, const char *, int)
 
+NK_API int nk_str_insert_at_rune (struct nk_str *, int pos, const char *, int)
 
+NK_API int nk_str_insert_text_char (struct nk_str *, int pos, const char *, int)
 
+NK_API int nk_str_insert_str_char (struct nk_str *, int pos, const char *)
 
+NK_API int nk_str_insert_text_utf8 (struct nk_str *, int pos, const char *, int)
 
+NK_API int nk_str_insert_str_utf8 (struct nk_str *, int pos, const char *)
 
+NK_API int nk_str_insert_text_runes (struct nk_str *, int pos, const nk_rune *, int)
 
+NK_API int nk_str_insert_str_runes (struct nk_str *, int pos, const nk_rune *)
 
+NK_API void nk_str_remove_chars (struct nk_str *, int len)
 
+NK_API void nk_str_remove_runes (struct nk_str *str, int len)
 
+NK_API void nk_str_delete_chars (struct nk_str *, int pos, int len)
 
+NK_API void nk_str_delete_runes (struct nk_str *, int pos, int len)
 
+NK_API char * nk_str_at_char (struct nk_str *, int pos)
 
+NK_API char * nk_str_at_rune (struct nk_str *, int pos, nk_rune *unicode, int *len)
 
+NK_API nk_rune nk_str_rune_at (const struct nk_str *, int pos)
 
+NK_API const char * nk_str_at_char_const (const struct nk_str *, int pos)
 
+NK_API const char * nk_str_at_const (const struct nk_str *, int pos, nk_rune *unicode, int *len)
 
+NK_API char * nk_str_get (struct nk_str *)
 
+NK_API const char * nk_str_get_const (const struct nk_str *)
 
+NK_API int nk_str_len (const struct nk_str *)
 
+NK_API int nk_str_len_char (const struct nk_str *)
 
+NK_API nk_bool nk_filter_default (const struct nk_text_edit *, nk_rune unicode)
 filter function
 
+NK_API nk_bool nk_filter_ascii (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API nk_bool nk_filter_float (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API nk_bool nk_filter_decimal (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API nk_bool nk_filter_hex (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API nk_bool nk_filter_oct (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API nk_bool nk_filter_binary (const struct nk_text_edit *, nk_rune unicode)
 
+NK_API void nk_textedit_init (struct nk_text_edit *, const struct nk_allocator *, nk_size size)
 text editor
 
+NK_API void nk_textedit_init_fixed (struct nk_text_edit *, void *memory, nk_size size)
 
+NK_API void nk_textedit_free (struct nk_text_edit *)
 
+NK_API void nk_textedit_text (struct nk_text_edit *, const char *, int total_len)
 
+NK_API void nk_textedit_delete (struct nk_text_edit *, int where, int len)
 
+NK_API void nk_textedit_delete_selection (struct nk_text_edit *)
 
+NK_API void nk_textedit_select_all (struct nk_text_edit *)
 
+NK_API nk_bool nk_textedit_cut (struct nk_text_edit *)
 
+NK_API nk_bool nk_textedit_paste (struct nk_text_edit *, char const *, int len)
 
+NK_API void nk_textedit_undo (struct nk_text_edit *)
 
+NK_API void nk_textedit_redo (struct nk_text_edit *)
 
+NK_API void nk_stroke_line (struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
 shape outlines
 
+NK_API void nk_stroke_curve (struct nk_command_buffer *, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color)
 
+NK_API void nk_stroke_rect (struct nk_command_buffer *, struct nk_rect, float rounding, float line_thickness, struct nk_color)
 
+NK_API void nk_stroke_circle (struct nk_command_buffer *, struct nk_rect, float line_thickness, struct nk_color)
 
+NK_API void nk_stroke_arc (struct nk_command_buffer *, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color)
 
+NK_API void nk_stroke_triangle (struct nk_command_buffer *, float, float, float, float, float, float, float line_thichness, struct nk_color)
 
+NK_API void nk_stroke_polyline (struct nk_command_buffer *, const float *points, int point_count, float line_thickness, struct nk_color col)
 
+NK_API void nk_stroke_polygon (struct nk_command_buffer *, const float *points, int point_count, float line_thickness, struct nk_color)
 
+NK_API void nk_fill_rect (struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
 filled shades
 
+NK_API void nk_fill_rect_multi_color (struct nk_command_buffer *, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom)
 
+NK_API void nk_fill_circle (struct nk_command_buffer *, struct nk_rect, struct nk_color)
 
+NK_API void nk_fill_arc (struct nk_command_buffer *, float cx, float cy, float radius, float a_min, float a_max, struct nk_color)
 
+NK_API void nk_fill_triangle (struct nk_command_buffer *, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color)
 
+NK_API void nk_fill_polygon (struct nk_command_buffer *, const float *points, int point_count, struct nk_color)
 
+NK_API void nk_draw_image (struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
 misc
 
+NK_API void nk_draw_nine_slice (struct nk_command_buffer *, struct nk_rect, const struct nk_nine_slice *, struct nk_color)
 
+NK_API void nk_draw_text (struct nk_command_buffer *, struct nk_rect, const char *text, int len, const struct nk_user_font *, struct nk_color, struct nk_color)
 
+NK_API void nk_push_scissor (struct nk_command_buffer *, struct nk_rect)
 
+NK_API void nk_push_custom (struct nk_command_buffer *, struct nk_rect, nk_command_custom_callback, nk_handle usr)
 
+NK_API nk_bool nk_input_has_mouse_click (const struct nk_input *, enum nk_buttons)
 
+NK_API nk_bool nk_input_has_mouse_click_in_rect (const struct nk_input *, enum nk_buttons, struct nk_rect)
 
+NK_API nk_bool nk_input_has_mouse_click_in_button_rect (const struct nk_input *, enum nk_buttons, struct nk_rect)
 
+NK_API nk_bool nk_input_has_mouse_click_down_in_rect (const struct nk_input *, enum nk_buttons, struct nk_rect, nk_bool down)
 
+NK_API nk_bool nk_input_is_mouse_click_in_rect (const struct nk_input *, enum nk_buttons, struct nk_rect)
 
+NK_API nk_bool nk_input_is_mouse_click_down_in_rect (const struct nk_input *i, enum nk_buttons id, struct nk_rect b, nk_bool down)
 
+NK_API nk_bool nk_input_any_mouse_click_in_rect (const struct nk_input *, struct nk_rect)
 
+NK_API nk_bool nk_input_is_mouse_prev_hovering_rect (const struct nk_input *, struct nk_rect)
 
+NK_API nk_bool nk_input_is_mouse_hovering_rect (const struct nk_input *, struct nk_rect)
 
+NK_API nk_bool nk_input_mouse_clicked (const struct nk_input *, enum nk_buttons, struct nk_rect)
 
+NK_API nk_bool nk_input_is_mouse_down (const struct nk_input *, enum nk_buttons)
 
+NK_API nk_bool nk_input_is_mouse_pressed (const struct nk_input *, enum nk_buttons)
 
+NK_API nk_bool nk_input_is_mouse_released (const struct nk_input *, enum nk_buttons)
 
+NK_API nk_bool nk_input_is_key_pressed (const struct nk_input *, enum nk_keys)
 
+NK_API nk_bool nk_input_is_key_released (const struct nk_input *, enum nk_keys)
 
+NK_API nk_bool nk_input_is_key_down (const struct nk_input *, enum nk_keys)
 
+NK_API struct nk_style_item nk_style_item_color (struct nk_color)
 
+NK_API struct nk_style_item nk_style_item_image (struct nk_image img)
 
+NK_API struct nk_style_item nk_style_item_nine_slice (struct nk_nine_slice slice)
 
+NK_API struct nk_style_item nk_style_item_hide (void)
 
NK_CONFIGURATION_STACK_TYPE (struct nk, style_item, style_item)
 
NK_CONFIGURATION_STACK_TYPE (nk, float, float)
 
NK_CONFIGURATION_STACK_TYPE (struct nk, vec2, vec2)
 
NK_CONFIGURATION_STACK_TYPE (nk, flags, flags)
 
NK_CONFIGURATION_STACK_TYPE (struct nk, color, color)
 
NK_CONFIGURATION_STACK_TYPE (const struct nk, user_font, user_font *)
 
NK_CONFIGURATION_STACK_TYPE (enum nk, button_behavior, button_behavior)
 
NK_CONFIG_STACK (style_item, NK_STYLE_ITEM_STACK_SIZE)
 
NK_CONFIG_STACK (float, NK_FLOAT_STACK_SIZE)
 
NK_CONFIG_STACK (vec2, NK_VECTOR_STACK_SIZE)
 
NK_CONFIG_STACK (flags, NK_FLAGS_STACK_SIZE)
 
NK_CONFIG_STACK (color, NK_COLOR_STACK_SIZE)
 
NK_CONFIG_STACK (user_font, NK_FONT_STACK_SIZE)
 
NK_CONFIG_STACK (button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE)
 
+

Detailed Description

+

main API and documentation file

+ +

Definition in file nuklear.h.

+

Macro Definition Documentation

+ +

◆ NK_CONFIG_STACK

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define NK_CONFIG_STACK( type,
 size 
)
+
+Value:
struct nk_config_stack_##type {\
+
int head;\
+
struct nk_config_stack_##type##_element elements[size];\
+
}
+
+

Definition at line 5628 of file nuklear.h.

+ +
+
+ +

◆ NK_CONFIGURATION_STACK_TYPE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define NK_CONFIGURATION_STACK_TYPE( prefix,
 name,
 type 
)
+
+Value:
struct nk_config_stack_##name##_element {\
+
prefix##_##type *address;\
+
prefix##_##type old_value;\
+
}
+
+

Definition at line 5623 of file nuklear.h.

+ +
+
+ +

◆ nk_foreach

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define nk_foreach( c,
 ctx 
)   for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
+
+ +

Iterates over each draw command inside the context draw command list.

+
#define nk_foreach(c, ctx)
+
Parameters
+ + + +
[in]ctx| Must point to an previously initialized nk_context struct at the end of a frame
[in]cmd| Command pointer initialized to NULL
+
+
+ +

Definition at line 1031 of file nuklear.h.

+ +
+
+ +

◆ NK_INTERSECT

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define NK_INTERSECT( x0,
 y0,
 w0,
 h0,
 x1,
 y1,
 w1,
 h1 
)
+
+Value:
((x1 < (x0 + w0)) && (x0 < (x1 + w1)) && \
+
(y1 < (y0 + h0)) && (y0 < (y1 + h1)))
+
+

Definition at line 5760 of file nuklear.h.

+ +
+
+ +

◆ nk_tree_image_push

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define nk_tree_image_push( ctx,
 type,
 img,
 title,
 state 
)   nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+
+

+# nk_tree_image_push

+

Start a collapsible UI section with image and label header !!!

Warning
To keep track of the runtime tree collapsible state this function uses defines __FILE__ and __LINE__ to generate a unique ID. If you want to call this function in a loop please use nk_tree_image_push_id or nk_tree_image_push_hashed instead.
+
#define nk_tree_image_push(ctx, type, img, title, state)
+
+ + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]img
+
+
+
Image to display inside the header on the left of the label
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 2944 of file nuklear.h.

+ +
+
+ +

◆ nk_tree_image_push_id

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define nk_tree_image_push_id( ctx,
 type,
 img,
 title,
 state,
 id 
)   nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+
+

+# nk_tree_image_push_id

+

Start a collapsible UI section with image and label header and internal state management callable in a look

+
#define nk_tree_image_push_id(ctx, type, img, title, state, id)
+
+ + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]img
+
+
+
Image to display inside the header on the left of the label
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
Parameters
+ + +
[in]id
+
+
+
Loop counter index if this function is called in a loop
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 2966 of file nuklear.h.

+ +
+
+ +

◆ nk_tree_push

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define nk_tree_push( ctx,
 type,
 title,
 state 
)   nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+
+

+# nk_tree_push

+

Starts a collapsible UI section with internal state management !!!

Warning
To keep track of the runtime tree collapsible state this function uses defines __FILE__ and __LINE__ to generate a unique ID. If you want to call this function in a loop please use nk_tree_push_id or nk_tree_push_hashed instead.
+
#define nk_tree_push(ctx, type, title, state)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 2879 of file nuklear.h.

+ +
+
+ +

◆ nk_tree_push_id

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define nk_tree_push_id( ctx,
 type,
 title,
 state,
 id 
)   nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+
+

+# nk_tree_push_id

+

Starts a collapsible UI section with internal state management callable in a look

#define nk_tree_push_id(ctx, type, title, state, id)
+
+ + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
Parameters
+ + +
[in]id
+
+
+
Loop counter index if this function is called in a loop
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 2898 of file nuklear.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ nk_edit_events

+ +
+
+ + + + +
enum nk_edit_events
+
+ + + + + +
Enumerator
NK_EDIT_INACTIVE 

!< edit widget is currently being modified

+
NK_EDIT_ACTIVATED 

!< edit widget is not active and is not being modified

+
NK_EDIT_DEACTIVATED 

!< edit widget went from state inactive to state active

+
NK_EDIT_COMMITED 

!< edit widget went from state active to state inactive

+
+ +

Definition at line 3501 of file nuklear.h.

+ +
+
+ +

◆ nk_widget_layout_states

+ +
+
+ + + + +
enum nk_widget_layout_states
+
+ + + + + +
Enumerator
NK_WIDGET_INVALID 

The widget cannot be seen and is completely out of view.

+
NK_WIDGET_VALID 

The widget is completely inside the window and can be updated and drawn.

+
NK_WIDGET_ROM 

The widget is partially visible and cannot be updated.

+
NK_WIDGET_DISABLED 

The widget is manually disabled and acts like NK_WIDGET_ROM.

+
+ +

Definition at line 3081 of file nuklear.h.

+ +
+
+ +

◆ nk_widget_states

+ +
+
+ + + + +
enum nk_widget_states
+
+ + + + + + + +
Enumerator
NK_WIDGET_STATE_ENTERED 

!< widget is neither active nor hovered

+
NK_WIDGET_STATE_HOVER 

!< widget has been hovered on the current frame

+
NK_WIDGET_STATE_ACTIVED 

!< widget is being hovered

+
NK_WIDGET_STATE_LEFT 

!< widget is currently activated

+
NK_WIDGET_STATE_HOVERED 

!< widget is from this frame on not hovered anymore

+
NK_WIDGET_STATE_ACTIVE 

!< widget is being hovered

+
+ +

Definition at line 3087 of file nuklear.h.

+ +
+
+ +

◆ nk_window_flags

+ +
+
+ + + + +
enum nk_window_flags
+
+ + + + + + + + +
Enumerator
NK_WINDOW_DYNAMIC 

special window type growing up in height while being filled to a certain maximum height

+
NK_WINDOW_ROM 

sets window widgets into a read only mode and does not allow input changes

+
NK_WINDOW_NOT_INTERACTIVE 

prevents all interaction caused by input to either window or widgets inside

+
NK_WINDOW_HIDDEN 

Hides window and stops any window interaction and drawing.

+
NK_WINDOW_CLOSED 

Directly closes and frees the window at the end of the frame.

+
NK_WINDOW_MINIMIZED 

marks the window as minimized

+
NK_WINDOW_REMOVE_ROM 

Removes read only mode at the end of the window.

+
+ +

Definition at line 5489 of file nuklear.h.

+ +
+
+

Function Documentation

+ +

◆ nk__begin()

+ +
+
+ + + + + + + + +
NK_API const struct nk_command* nk__begin (struct nk_contextctx)
+
+ +

Returns a draw command list iterator to iterate all draw commands accumulated over one frame.

+
const struct nk_command* nk__begin(struct nk_context*);
+
NK_API const struct nk_command * nk__begin(struct nk_context *)
Returns a draw command list iterator to iterate all draw commands accumulated over one frame.
+
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ +
Parameters
+ + +
[in]ctx| must point to an previously initialized nk_context struct at the end of a frame
+
+
+
Returns
draw command pointer pointing to the first command inside the draw command list
+ +

Definition at line 310 of file nuklear_context.c.

+ +

References nk_context::build, and nk_buffer::memory.

+ +
+
+ +

◆ nk__next()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API const struct nk_command* nk__next (struct nk_contextctx,
const struct nk_commandcmd 
)
+
+ +

Returns draw command pointer pointing to the next command inside the draw command list.

+
const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
+
NK_API const struct nk_command * nk__next(struct nk_context *, const struct nk_command *)
Returns draw command pointer pointing to the next command inside the draw command list.
+
Parameters
+ + + +
[in]ctx| Must point to an previously initialized nk_context struct at the end of a frame
[in]cmd| Must point to an previously a draw command either returned by nk__begin or nk__next
+
+
+
Returns
draw command pointer pointing to the next command inside the draw command list
+ +

Definition at line 332 of file nuklear_context.c.

+ +

References nk_buffer::allocated, and nk_buffer::memory.

+ +
+
+ +

◆ nk_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_begin (struct nk_contextctx,
const char * title,
struct nk_rect bounds,
nk_flags flags 
)
+
+

+# nk_begin

+

Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed

+
nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
+
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
+ +
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]title
+
+
+
Window title and identifier. Needs to be persistent over frames to identify the window
Parameters
+ + +
[in]bounds
+
+
+
Initial position and window size. However if you do not define NK_WINDOW_SCALABLE or NK_WINDOW_MOVABLE you can set window position and size every frame
Parameters
+ + +
[in]flags
+
+
+
Window flags defined in the nk_panel_flags section with a number of different window behaviors
+
Returns
true(1) if the window can be filled up with widgets from this point until nk_end or false(0) otherwise for example if minimized
+ +

Definition at line 136 of file nuklear_window.c.

+ +

References nk_begin_titled().

+ +
+
+ +

◆ nk_begin_titled()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_begin_titled (struct nk_contextctx,
const char * name,
const char * title,
struct nk_rect bounds,
nk_flags flags 
)
+
+

+# nk_begin_titled

+

Extended window start with separated title and identifier to allow multiple windows with same title but not name

+
nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
+
NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags)
+
+ + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Window identifier. Needs to be persistent over frames to identify the window
Parameters
+ + +
[in]title
+
+
+
Window title displayed inside header if flag NK_WINDOW_TITLE or either NK_WINDOW_CLOSABLE or NK_WINDOW_MINIMIZED was set
Parameters
+ + +
[in]bounds
+
+
+
Initial position and window size. However if you do not define NK_WINDOW_SCALABLE or NK_WINDOW_MOVABLE you can set window position and size every frame
Parameters
+ + +
[in]flags
+
+
+
Window flags defined in the nk_panel_flags section with a number of different window behaviors
+
Returns
true(1) if the window can be filled up with widgets from this point until nk_end or false(0) otherwise for example if minimized
+ +

Definition at line 142 of file nuklear_window.c.

+ +

References nk_user_font::width.

+ +

Referenced by nk_begin().

+ +
+
+ +

◆ nk_clear()

+ +
+
+ + + + + + + + +
NK_API void nk_clear (struct nk_contextctx)
+
+ +

Resets the context state at the end of the frame.

+

This includes mostly garbage collector tasks like removing windows or table not called and therefore used anymore.

+
void nk_clear(struct nk_context *ctx);
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+
Parameters
+ + +
[in]ctxMust point to a previously initialized nk_context struct
+
+
+ +

Definition at line 110 of file nuklear_context.c.

+ +
+
+ +

◆ nk_end()

+ +
+
+ + + + + + + + +
NK_API void nk_end (struct nk_contextctx)
+
+

+# nk_end

+

Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup. All widget calls after this functions will result in asserts or no state changes

+
void nk_end(struct nk_context *ctx);
+
NK_API void nk_end(struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+ +

Definition at line 297 of file nuklear_window.c.

+ +
+
+ +

◆ nk_free()

+ +
+
+ + + + + + + + +
NK_API void nk_free (struct nk_contextctx)
+
+ +

Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.

+
void nk_free(struct nk_context *ctx);
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
Parameters
+ + +
[in]ctxMust point to a previously initialized nk_context struct
+
+
+ +

Definition at line 88 of file nuklear_context.c.

+ +
+
+ +

◆ nk_group_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_group_begin (struct nk_contextctx,
const char * title,
nk_flags flags 
)
+
+ +

Starts a new widget group.

+

Requires a previous layouting function to specify a pos/size.

nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags);
+
NK_API nk_bool nk_group_begin(struct nk_context *, const char *title, nk_flags)
Starts a new widget group.
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]title
+
+
+
Must be an unique identifier for this group that is also used for the group header
Parameters
+ + +
[in]flags
+
+
+
Window flags defined in the nk_panel_flags section with a number of different group behaviors
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 160 of file nuklear_group.c.

+ +

References nk_group_begin_titled().

+ +
+
+ +

◆ nk_group_begin_titled()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_group_begin_titled (struct nk_contextctx,
const char * name,
const char * title,
nk_flags flags 
)
+
+ +

Starts a new widget group.

+

Requires a previous layouting function to specify a pos/size.

nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+
NK_API nk_bool nk_group_begin_titled(struct nk_context *, const char *name, const char *title, nk_flags)
Starts a new widget group.
+
Parameters
+ + + + + +
[in]ctx| Must point to an previously initialized nk_context struct
[in]id| Must be an unique identifier for this group
[in]title| Group header title
[in]flags| Window flags defined in the nk_panel_flags section with a number of different group behaviors
+
+
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 127 of file nuklear_group.c.

+ +

Referenced by nk_group_begin().

+ +
+
+ +

◆ nk_group_end()

+ +
+
+ + + + + + + + +
NK_API void nk_group_end (struct nk_contextctx)
+
+

+# nk_group_end

+

Ends a widget group

void nk_group_end(struct nk_context*);
+
NK_API void nk_group_end(struct nk_context *)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+ +

Definition at line 165 of file nuklear_group.c.

+ +

References nk_group_scrolled_end().

+ +
+
+ +

◆ nk_group_get_scroll()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_group_get_scroll (struct nk_contextctx,
const char * id,
nk_uint * x_offset,
nk_uint * y_offset 
)
+
+

+# nk_group_get_scroll

+

Gets the scroll position of the given group.

void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset);
+
NK_API void nk_group_get_scroll(struct nk_context *, const char *id, nk_uint *x_offset, nk_uint *y_offset)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]id
+
+
+
The id of the group to get the scroll position of
Parameters
+ + +
[in]x_offset
+
+
+
A pointer to the x offset output (or NULL to ignore)
Parameters
+ + +
[in]y_offset
+
+
+
A pointer to the y offset output (or NULL to ignore)
+ +

Definition at line 170 of file nuklear_group.c.

+ +
+
+ +

◆ nk_group_scrolled_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_group_scrolled_begin (struct nk_contextctx,
struct nk_scrolloff,
const char * title,
nk_flags flags 
)
+
+

+# nk_group_scrolled_begin

+

Starts a new widget group. requires a previous layouting function to specify a size. Does not keep track of scrollbar.

nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+
NK_API nk_bool nk_group_scrolled_begin(struct nk_context *, struct nk_scroll *off, const char *title, nk_flags)
+ +
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]off
+
+
+
Both x- and y- scroll offset. Allows for manual scrollbar control
Parameters
+ + +
[in]title
+
+
+
Window unique group title used to both identify and display in the group header
Parameters
+ + +
[in]flags
+
+
+
Window flags from nk_panel_flags section
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 121 of file nuklear_group.c.

+ +

References nk_group_scrolled_offset_begin().

+ +
+
+ +

◆ nk_group_scrolled_end()

+ +
+
+ + + + + + + + +
NK_API void nk_group_scrolled_end (struct nk_contextctx)
+
+

+# nk_group_scrolled_end

+

Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin.

+
NK_API void nk_group_scrolled_end(struct nk_context *)
Definition: nuklear_group.c:59
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+ +

Definition at line 59 of file nuklear_group.c.

+ +

Referenced by nk_group_end().

+ +
+
+ +

◆ nk_group_scrolled_offset_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_group_scrolled_offset_begin (struct nk_contextctx,
nk_uint * x_offset,
nk_uint * y_offset,
const char * title,
nk_flags flags 
)
+
+

+# nk_group_scrolled_offset_begin

+

starts a new widget group. requires a previous layouting function to specify a size. Does not keep track of scrollbar.

nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+
NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
Definition: nuklear_group.c:10
+
+ + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]x_offset
+
+
+
Scrollbar x-offset to offset all widgets inside the group horizontally.
Parameters
+ + +
[in]y_offset
+
+
+
Scrollbar y-offset to offset all widgets inside the group vertically
Parameters
+ + +
[in]title
+
+
+
Window unique group title used to both identify and display in the group header
Parameters
+ + +
[in]flags
+
+
+
Window flags from the nk_panel_flags section
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 10 of file nuklear_group.c.

+ +

Referenced by nk_group_scrolled_begin().

+ +
+
+ +

◆ nk_group_set_scroll()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_group_set_scroll (struct nk_contextctx,
const char * id,
nk_uint x_offset,
nk_uint y_offset 
)
+
+

+# nk_group_set_scroll

+

Sets the scroll position of the given group.

void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset);
+
NK_API void nk_group_set_scroll(struct nk_context *, const char *id, nk_uint x_offset, nk_uint y_offset)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]id
+
+
+
The id of the group to scroll
Parameters
+ + +
[in]x_offset
+
+
+
The x offset to scroll to
Parameters
+ + +
[in]y_offset
+
+
+
The y offset to scroll to
+ +

Definition at line 205 of file nuklear_group.c.

+ +
+
+ +

◆ nk_init()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_init (struct nk_contextctx,
const struct nk_allocatoralloc,
const struct nk_user_fontfont 
)
+
+

+nk_init

+

Initializes a nk_context struct with memory allocation callbacks for nuklear to allocate memory from. Used internally for nk_init_default and provides a kitchen sink allocation interface to nuklear. Can be useful for cases like monitoring memory consumption.

+
nk_bool nk_init(struct nk_context *ctx, const struct nk_allocator *alloc, const struct nk_user_font *font);
+
NK_API nk_bool nk_init(struct nk_context *, const struct nk_allocator *, const struct nk_user_font *)
+ + +
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an either stack or heap allocated nk_context struct
Parameters
+ + +
[in]alloc
+
+
+
Must point to a previously allocated memory allocator
Parameters
+ + +
[in]font
+
+
+
Must point to a previously initialized font handle for more info look at font documentation
+
Returns
either false(0) on failure or true(1) on success.
+ +

Definition at line 66 of file nuklear_context.c.

+ +
+
+ +

◆ nk_init_custom()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_init_custom (struct nk_contextctx,
struct nk_buffercmds,
struct nk_bufferpool,
const struct nk_user_fontfont 
)
+
+ +

Initializes a nk_context struct from two different either fixed or growing buffers.

+

The first buffer is for allocating draw commands while the second buffer is used for allocating windows, panels and state tables.

+
nk_bool nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
+
NK_API nk_bool nk_init_custom(struct nk_context *, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *)
Initializes a nk_context struct from two different either fixed or growing buffers.
+ +
Parameters
+ + + + + +
[in]ctxMust point to an either stack or heap allocated nk_context struct
[in]cmdsMust point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
[in]poolMust point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
[in]fontMust point to a previously initialized font handle for more info look at font documentation
+
+
+
Returns
either false(0) on failure or true(1) on success.
+ +

Definition at line 45 of file nuklear_context.c.

+ +

References nk_buffer::type.

+ +
+
+ +

◆ nk_init_fixed()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_init_fixed (struct nk_contextctx,
void * memory,
nk_size size,
const struct nk_user_fontfont 
)
+
+

+nk_init_fixed

+

Initializes a nk_context struct from single fixed size memory block Should be used if you want complete control over nuklear's memory management. Especially recommended for system with little memory or systems with virtual memory. For the later case you can just allocate for example 16MB of virtual memory and only the required amount of memory will actually be committed.

+
nk_bool nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
+
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
+

!!! Warning make sure the passed memory block is aligned correctly for nk_draw_commands.

+ + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an either stack or heap allocated nk_context struct
Parameters
+ + +
[in]memory
+
+
+
Must point to a previously allocated memory block
Parameters
+ + +
[in]size
+
+
+
Must contain the total size of memory
Parameters
+ + +
[in]font
+
+
+
Must point to a previously initialized font handle for more info look at font documentation
+
Returns
either false(0) on failure or true(1) on success.
+ +

Definition at line 34 of file nuklear_context.c.

+ +
+
+ +

◆ nk_input_begin()

+ +
+
+ + + + + + + + +
NK_API void nk_input_begin (struct nk_contextctx)
+
+ +

Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movement as well as key state transitions.

+
void nk_input_begin(struct nk_context*);
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
Parameters
+ + +
[in]ctxMust point to a previously initialized nk_context struct
+
+
+ +

Definition at line 10 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_button()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_input_button (struct nk_contextctx,
enum nk_buttons,
int x,
int y,
nk_bool down 
)
+
+ +

Mirrors the state of a specific mouse button to nuklear.

+
void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, nk_bool down);
+
NK_API void nk_input_button(struct nk_context *, enum nk_buttons, int x, int y, nk_bool down)
Mirrors the state of a specific mouse button to nuklear.
Definition: nuklear_input.c:72
+
Parameters
+ + + + + + +
[in]ctxMust point to a previously initialized nk_context struct
[in]btnMust be any value specified in enum nk_buttons that needs to be mirrored
[in]xMust contain an integer describing mouse cursor x-position on click up/down
[in]yMust contain an integer describing mouse cursor y-position on click up/down
[in]downMust be 0 for key is up and 1 for key is down
+
+
+ +

Definition at line 72 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_char()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_input_char (struct nk_contextctx,
char c 
)
+
+ +

Copies a single ASCII character into an internal text buffer.

+

This is basically a helper function to quickly push ASCII characters into nuklear.

+
Note
Stores up to NK_INPUT_MAX bytes between nk_input_begin and nk_input_end.
+
void nk_input_char(struct nk_context *ctx, char c);
+
NK_API void nk_input_char(struct nk_context *, char)
Copies a single ASCII character into an internal text buffer.
+
Parameters
+ + + +
[in]ctx| Must point to a previously initialized nk_context struct
[in]c| Must be a single ASCII character preferable one that can be printed
+
+
+ +

Definition at line 125 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_end()

+ +
+
+ + + + + + + + +
NK_API void nk_input_end (struct nk_contextctx)
+
+ +

End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not grabbed indefinitely.

+
void nk_input_end(struct nk_context *ctx);
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
Parameters
+ + +
[in]ctx| Must point to a previously initialized nk_context struct
+
+
+ +

Definition at line 30 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_glyph()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_input_glyph (struct nk_contextctx,
const nk_glyph 
)
+
+ +

Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.

+
Note
Stores up to NK_INPUT_MAX bytes between nk_input_begin and nk_input_end.
+
void nk_input_glyph(struct nk_context *ctx, const nk_glyph g);
+
NK_API void nk_input_glyph(struct nk_context *, const nk_glyph)
Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.
+
Parameters
+ + + +
[in]ctx| Must point to a previously initialized nk_context struct
[in]g| UTF-32 unicode codepoint
+
+
+ +

Definition at line 107 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_key()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_input_key (struct nk_contextctx,
enum nk_keys,
nk_bool down 
)
+
+ +

Mirrors the state of a specific key to nuklear.

+
void nk_input_key(struct nk_context*, enum nk_keys key, nk_bool down);
+
NK_API void nk_input_key(struct nk_context *, enum nk_keys, nk_bool down)
Mirrors the state of a specific key to nuklear.
Definition: nuklear_input.c:57
+
Parameters
+ + + + +
[in]ctxMust point to a previously initialized nk_context struct
[in]keyMust be any value specified in enum nk_keys that needs to be mirrored
[in]downMust be 0 for key is up and 1 for key is down
+
+
+ +

Definition at line 57 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_motion()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_input_motion (struct nk_contextctx,
int x,
int y 
)
+
+ +

Mirrors current mouse position to nuklear.

+
void nk_input_motion(struct nk_context *ctx, int x, int y);
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
Parameters
+ + + + +
[in]ctxMust point to a previously initialized nk_context struct
[in]xMust hold an integer describing the current mouse cursor x-position
[in]yMust hold an integer describing the current mouse cursor y-position
+
+
+ +

Definition at line 45 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_scroll()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_input_scroll (struct nk_contextctx,
struct nk_vec2 val 
)
+
+ +

Copies the last mouse scroll value to nuklear.

+

Is generally a scroll value. So does not have to come from mouse and could also originate from balls, tracks, linear guide rails, or other programs.

+
void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val);
+
NK_API void nk_input_scroll(struct nk_context *, struct nk_vec2 val)
Copies the last mouse scroll value to nuklear.
Definition: nuklear_input.c:99
+ +
Parameters
+ + + +
[in]ctx| Must point to a previously initialized nk_context struct
[in]val| vector with both X- as well as Y-scroll value
+
+
+ +

Definition at line 99 of file nuklear_input.c.

+ +
+
+ +

◆ nk_input_unicode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_input_unicode (struct nk_contextctx,
nk_rune unicode 
)
+
+ +

Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.

+
Note
Stores up to NK_INPUT_MAX bytes between nk_input_begin and nk_input_end.
+
void nk_input_unicode(struct nk_context*, nk_rune rune);
+
NK_API void nk_input_unicode(struct nk_context *, nk_rune)
Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.
+
Parameters
+ + + +
[in]ctx| Must point to a previously initialized nk_context struct
[in]rune| UTF-32 unicode codepoint
+
+
+ +

Definition at line 134 of file nuklear_input.c.

+ +
+
+ +

◆ nk_item_is_any_active()

+ +
+
+ + + + + + + + +
NK_API nk_bool nk_item_is_any_active (const struct nk_contextctx)
+
+

+# nk_item_is_any_active

+
Returns
if the any window is being hovered or any widget is currently active. Can be used to decide if input should be processed by UI or your specific input handling. Example could be UI and 3D camera to move inside a 3D space.
+
NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
true(1) if any window is hovered or any item is active or false(0) otherwise
+ +

Definition at line 473 of file nuklear_window.c.

+ +

References nk_window_is_any_hovered().

+ +
+
+ +

◆ nk_layout_ratio_from_pixel()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API float nk_layout_ratio_from_pixel (const struct nk_contextctx,
float pixel_width 
)
+
+ +

Utility functions to calculate window ratio from pixel size.

+
float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
+
NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width)
Utility functions to calculate window ratio from pixel size.
+
Parameters
+ + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]pixel| Pixel_width to convert to window ratio
+
+
+
Returns
nk_rect with both position and size of the next row
+ +

Definition at line 137 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_reset_min_row_height()

+ +
+
+ + + + + + + + +
NK_API void nk_layout_reset_min_row_height (struct nk_contextctx)
+
+ +

Reset the currently used minimum row height back to font_height + text_padding + padding

+
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+
Parameters
+ + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
+
+
+ +

Definition at line 26 of file nuklear_layout.c.

+ +

References nk_user_font::height.

+ +
+
+ +

◆ nk_layout_row()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row (struct nk_contextctx,
enum nk_layout_format,
float height,
int cols,
const float * ratio 
)
+
+ +

Specifies row columns in array as either window ratio or size.

+
void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
+
NK_API void nk_layout_row(struct nk_context *, enum nk_layout_format, float height, int cols, const float *ratio)
Specifies row columns in array as either window ratio or size.
+
Parameters
+ + + + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]fmt| Either NK_DYNAMIC for window ratio or NK_STATIC for fixed size columns
[in]height| Holds height of each widget in row or zero for auto layouting
[in]columns| Number of widget inside row
+
+
+ +

Definition at line 229 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_begin (struct nk_contextctx,
enum nk_layout_format fmt,
float row_height,
int cols 
)
+
+ +

Starts a new dynamic or fixed row with given height and columns.

+
void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
+
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
Starts a new dynamic or fixed row with given height and columns.
+
Parameters
+ + + + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]fmt| either NK_DYNAMIC for window ratio or NK_STATIC for fixed size columns
[in]height| holds height of each widget in row or zero for auto layouting
[in]columns| Number of widget inside row
+
+
+ +

Definition at line 157 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_dynamic()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_dynamic (struct nk_contextctx,
float height,
int cols 
)
+
+ +

Sets current row layout to share horizontal space between @cols number of widgets evenly.

+

Once called all subsequent widget calls greater than @cols will allocate a new row with same layout.

+
void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
Parameters
+ + + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]height| Holds height of each widget in row or zero for auto layouting
[in]columns| Number of widget inside row
+
+
+ +

Definition at line 147 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_end()

+ +
+
+ + + + + + + + +
NK_API void nk_layout_row_end (struct nk_contextctx)
+
+ +

Finished previously started row.

+
+
NK_API void nk_layout_row_end(struct nk_context *)
Finished previously started row.
+
Parameters
+ + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
+
+
+ +

Definition at line 209 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_push()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_push (struct nk_contextctx,
float value 
)
+
+ +

\breif Specifies either window ratio or width of a single column

+
void nk_layout_row_push(struct nk_context*, float value);
+
NK_API void nk_layout_row_push(struct nk_context *, float value)
\breif Specifies either window ratio or width of a single column
+
Parameters
+ + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]value| either a window ratio or fixed width depending on @fmt in previous nk_layout_row_begin call
+
+
+ +

Definition at line 183 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_static()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_static (struct nk_contextctx,
float height,
int item_width,
int cols 
)
+
+ +

Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.

+

Once called all subsequent widget calls greater than @cols will allocate a new row with same layout.

+
void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
+
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.
+
Parameters
+ + + + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]height| Holds height of each widget in row or zero for auto layouting
[in]width| Holds pixel width of each widget in the row
[in]columns| Number of widget inside row
+
+
+ +

Definition at line 152 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_template_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_template_begin (struct nk_contextctx,
float row_height 
)
+
+

+# nk_layout_row_template_begin

+

Begins the row template declaration

void nk_layout_row_template_begin(struct nk_context*, float row_height);
+
NK_API void nk_layout_row_template_begin(struct nk_context *, float row_height)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
Parameters
+ + +
[in]height
+
+
+
Holds height of each widget in row or zero for auto layouting
+ +

Definition at line 268 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_template_end()

+ +
+
+ + + + + + + + +
NK_API void nk_layout_row_template_end (struct nk_contextctx)
+
+

+# nk_layout_row_template_end

+

Marks the end of the row template

+
NK_API void nk_layout_row_template_end(struct nk_context *)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
+ +

Definition at line 355 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_template_push_dynamic()

+ +
+
+ + + + + + + + +
NK_API void nk_layout_row_template_push_dynamic (struct nk_contextctx)
+
+

+# nk_layout_row_template_push_dynamic

+

Adds a dynamic column that dynamically grows and can go to zero if not enough space

+
NK_API void nk_layout_row_template_push_dynamic(struct nk_context *)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
Parameters
+ + +
[in]height
+
+
+
Holds height of each widget in row or zero for auto layouting
+ +

Definition at line 295 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_template_push_static()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_template_push_static (struct nk_contextctx,
float width 
)
+
+

+# nk_layout_row_template_push_static

+

Adds a static column that does not grow and will always have the same size

+
NK_API void nk_layout_row_template_push_static(struct nk_context *, float width)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
Parameters
+ + +
[in]width
+
+
+
Holds the absolute pixel width value the next column must be
+ +

Definition at line 335 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_row_template_push_variable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_row_template_push_variable (struct nk_contextctx,
float min_width 
)
+
+

+# nk_layout_row_template_push_variable

+

Adds a variable column that dynamically grows but does not shrink below specified pixel width

void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
+
NK_API void nk_layout_row_template_push_variable(struct nk_context *, float min_width)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
Parameters
+ + +
[in]width
+
+
+
Holds the minimum pixel width the next column must always be
+ +

Definition at line 315 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_set_min_row_height()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_set_min_row_height (struct nk_contextctx,
float height 
)
+
+ +

Sets the currently used minimum row height.

+

!!!

Warning
The passed height needs to include both your preferred row height as well as padding. No internal padding is added.
+
void nk_layout_set_min_row_height(struct nk_context*, float height);
+
NK_API void nk_layout_set_min_row_height(struct nk_context *, float height)
Sets the currently used minimum row height.
+
Parameters
+ + + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
[in]height| New minimum row height to be used for auto generating the row height
+
+
+ +

Definition at line 10 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_begin()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_space_begin (struct nk_contextctx,
enum nk_layout_format,
float height,
int widget_count 
)
+
+

+# nk_layout_space_begin

+

Begins a new layouting space that allows to specify each widgets position and size.

void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
+
NK_API void nk_layout_space_begin(struct nk_context *, enum nk_layout_format, float height, int widget_count)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_begin_xxx
Parameters
+ + +
[in]fmt
+
+
+
Either NK_DYNAMIC for window ratio or NK_STATIC for fixed size columns
Parameters
+ + +
[in]height
+
+
+
Holds height of each widget in row or zero for auto layouting
Parameters
+ + +
[in]columns
+
+
+
Number of widgets inside row
+ +

Definition at line 406 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_bounds()

+ +
+
+ + + + + + + + +
NK_API struct nk_rect nk_layout_space_bounds (const struct nk_contextctx)
+
+

+# nk_layout_space_bounds

+

Utility function to calculate total space allocated for nk_layout_space

+
NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
+
Returns
nk_rect holding the total space allocated
+ +

Definition at line 465 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_end()

+ +
+
+ + + + + + + + +
NK_API void nk_layout_space_end (struct nk_contextctx)
+
+

+# nk_layout_space_end

+

Marks the end of the layout space

+
NK_API void nk_layout_space_end(struct nk_context *)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
+ +

Definition at line 431 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_push()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_layout_space_push (struct nk_contextctx,
struct nk_rect bounds 
)
+
+

+# nk_layout_space_push

+

Pushes position and size of the next widget in own coordinate space either as pixel or ratio

void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds);
+
NK_API void nk_layout_space_push(struct nk_context *, struct nk_rect bounds)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
Parameters
+ + +
[in]bounds
+
+
+
Position and size in laoyut space local coordinates
+ +

Definition at line 450 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_rect_to_local()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API struct nk_rect nk_layout_space_rect_to_local (const struct nk_contextctx,
struct nk_rect bounds 
)
+
+

+# nk_layout_space_rect_to_local

+

Converts rectangle from layout space into screen space

+
NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
Parameters
+ + +
[in]bounds
+
+
+
Rectangle to convert from layout space into screen space
+
Returns
transformed nk_rect in layout space coordinates
+ +

Definition at line 551 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_rect_to_screen()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API struct nk_rect nk_layout_space_rect_to_screen (const struct nk_contextctx,
struct nk_rect bounds 
)
+
+

+# nk_layout_space_rect_to_screen

+

Converts rectangle from screen space into layout space

+
NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
Parameters
+ + +
[in]bounds
+
+
+
Rectangle to convert from layout space into screen space
+
Returns
transformed nk_rect in screen space coordinates
+ +

Definition at line 535 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_to_local()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API struct nk_vec2 nk_layout_space_to_local (const struct nk_contextctx,
struct nk_vec2 vec 
)
+
+

+# nk_layout_space_to_local

+

Converts vector from layout space into screen space

+
NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
Parameters
+ + +
[in]vec
+
+
+
Position to convert from screen space into layout coordinate space
+
Returns
transformed nk_vec2 in layout space coordinates
+ +

Definition at line 519 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_space_to_screen()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API struct nk_vec2 nk_layout_space_to_screen (const struct nk_contextctx,
struct nk_vec2 vec 
)
+
+

+# nk_layout_space_to_screen

+

Converts vector from nk_layout_space coordinate space into screen space

+
NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 vec)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
Parameters
+ + +
[in]vec
+
+
+
Position to convert from layout space into screen coordinate space
+
Returns
transformed nk_vec2 in screen space coordinates
+ +

Definition at line 503 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_layout_widget_bounds()

+ +
+
+ + + + + + + + +
NK_API struct nk_rect nk_layout_widget_bounds (const struct nk_contextctx)
+
+ +

Returns the width of the next row allocate by one of the layouting functions.

+
+
NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx)
Returns the width of the next row allocate by one of the layouting functions.
+
Parameters
+ + +
[in]ctx| Must point to an previously initialized nk_context struct after call nk_begin_xxx
+
+
+
Returns
nk_rect with both position and size of the next row
+ +

Definition at line 484 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_property_double()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_property_double (struct nk_contextctx,
const char * name,
double min,
double * val,
double max,
double step,
float inc_per_pixel 
)
+
+

+# nk_property_double

+

Double property directly modifying a passed in value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel);
+
NK_API void nk_property_double(struct nk_context *, const char *name, double min, double *val, double max, double step, float inc_per_pixel)
+
+ + + + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling a layouting function
Parameters
+ + +
[in]name
+
+
+
String used both as a label as well as a unique identifier
Parameters
+ + +
[in]min
+
+
+
Minimum value not allowed to be underflown
Parameters
+ + +
[in]val
+
+
+
Double pointer to be modified
Parameters
+ + +
[in]max
+
+
+
Maximum value not allowed to be overflown
Parameters
+ + +
[in]step
+
+
+
Increment added and subtracted on increment and decrement button
Parameters
+ + +
[in]inc_per_pixel
+
+
+
Value per pixel added or subtracted on dragging
+ +

Definition at line 454 of file nuklear_property.c.

+ +
+
+ +

◆ nk_property_float()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_property_float (struct nk_contextctx,
const char * name,
float min,
float * val,
float max,
float step,
float inc_per_pixel 
)
+
+

+# nk_property_float

+

Float property directly modifying a passed in value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
+
NK_API void nk_property_float(struct nk_context *, const char *name, float min, float *val, float max, float step, float inc_per_pixel)
+
+ + + + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling a layouting function
Parameters
+ + +
[in]name
+
+
+
String used both as a label as well as a unique identifier
Parameters
+ + +
[in]min
+
+
+
Minimum value not allowed to be underflown
Parameters
+ + +
[in]val
+
+
+
Float pointer to be modified
Parameters
+ + +
[in]max
+
+
+
Maximum value not allowed to be overflown
Parameters
+ + +
[in]step
+
+
+
Increment added and subtracted on increment and decrement button
Parameters
+ + +
[in]inc_per_pixel
+
+
+
Value per pixel added or subtracted on dragging
+ +

Definition at line 440 of file nuklear_property.c.

+ +
+
+ +

◆ nk_propertyd()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API double nk_propertyd (struct nk_contextctx,
const char * name,
double min,
double val,
double max,
double step,
float inc_per_pixel 
)
+
+

+# nk_propertyd

+

Float property modifying a passed in value and returning the new value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel);
+
NK_API double nk_propertyd(struct nk_context *, const char *name, double min, double val, double max, double step, float inc_per_pixel)
+
Parameters
+ + + + + + + + +
[in]ctxMust point to an previously initialized nk_context struct after calling a layouting function
[in]nameString used both as a label as well as a unique identifier
[in]minMinimum value not allowed to be underflown
[in]valCurrent double value to be modified and returned
[in]maxMaximum value not allowed to be overflown
[in]stepIncrement added and subtracted on increment and decrement button
[in]inc_per_pixelValue per pixel added or subtracted on dragging
+
+
+
Returns
the new modified double value
+ +

Definition at line 496 of file nuklear_property.c.

+ +
+
+ +

◆ nk_propertyf()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API float nk_propertyf (struct nk_contextctx,
const char * name,
float min,
float val,
float max,
float step,
float inc_per_pixel 
)
+
+

+# nk_propertyf

+

Float property modifying a passed in value and returning the new value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel);
+
NK_API float nk_propertyf(struct nk_context *, const char *name, float min, float val, float max, float step, float inc_per_pixel)
+
Parameters
+ + + + + + + + +
[in]ctxMust point to an previously initialized nk_context struct after calling a layouting function
[in]nameString used both as a label as well as a unique identifier
[in]minMinimum value not allowed to be underflown
[in]valCurrent float value to be modified and returned
[in]maxMaximum value not allowed to be overflown
[in]stepIncrement added and subtracted on increment and decrement button
[in]inc_per_pixelValue per pixel added or subtracted on dragging
+
+
+
Returns
the new modified float value
+ +

Definition at line 482 of file nuklear_property.c.

+ +
+
+ +

◆ nk_propertyi()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API int nk_propertyi (struct nk_contextctx,
const char * name,
int min,
int val,
int max,
int step,
float inc_per_pixel 
)
+
+

+# nk_propertyi

+

Integer property modifying a passed in value and returning the new value !!!

Warning
To generate a unique property ID using the same label make sure to insert a # at the beginning. It will not be shown but guarantees correct behavior.
+
int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel);
+
NK_API int nk_propertyi(struct nk_context *, const char *name, int min, int val, int max, int step, float inc_per_pixel)
+
Parameters
+ + + + + + + + +
[in]ctxMust point to an previously initialized nk_context struct after calling a layouting function
[in]nameString used both as a label as well as a unique identifier
[in]minMinimum value not allowed to be underflown
[in]valCurrent integer value to be modified and returned
[in]maxMaximum value not allowed to be overflown
[in]stepIncrement added and subtracted on increment and decrement button
[in]inc_per_pixelValue per pixel added or subtracted on dragging
+
+
+
Returns
the new modified integer value
+ +

Definition at line 468 of file nuklear_property.c.

+ +
+
+ +

◆ nk_rule_horizontal()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_rule_horizontal (struct nk_contextctx,
struct nk_color color,
nk_bool rounding 
)
+
+

+# nk_window_show_if

+

Line for visual separation. Draws a line with thickness determined by the current row height.

void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, NK_BOOL rounding)
+
NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
+
#define NK_BOOL
could be char, use int for drop-in replacement backwards compatibility
Definition: nuklear.h:192
+ +
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]color
+
+
+
Color of the horizontal line
Parameters
+ + +
[in]rounding
+
+
+
Whether or not to make the line round
+ +

Definition at line 673 of file nuklear_window.c.

+ +
+
+ +

◆ nk_spacer()

+ +
+
+ + + + + + + + +
NK_API void nk_spacer (struct nk_contextctx)
+
+

+# nk_spacer

+

Spacer is a dummy widget that consumes space as usual but doesn't draw anything

void nk_spacer(struct nk_context* );
+
NK_API void nk_spacer(struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after call nk_layout_space_begin
+ +

Definition at line 764 of file nuklear_layout.c.

+ +
+
+ +

◆ nk_tree_image_push_hashed()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_tree_image_push_hashed (struct nk_contextctx,
enum nk_tree_type,
struct nk_image img,
const char * title,
enum nk_collapse_states initial_state,
const char * hash,
int len,
int seed 
)
+
+

+# nk_tree_image_push_hashed

+

Start a collapsible UI section with internal state management with full control over internal unique ID used to store state

nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+
NK_API nk_bool nk_tree_image_push_hashed(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:183
+ +
+ + + + + + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]img
+
+
+
Image to display inside the header on the left of the label
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
Parameters
+ + +
[in]hash
+
+
+
Memory block or string to generate the ID from
Parameters
+ + +
[in]len
+
+
+
Size of passed memory block or string in hash
Parameters
+ + +
[in]seed
+
+
+
Seeding value if this function is called in a loop or default to 0
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 183 of file nuklear_tree.c.

+ +
+
+ +

◆ nk_tree_pop()

+ +
+
+ + + + + + + + +
NK_API void nk_tree_pop (struct nk_contextctx)
+
+

+# nk_tree_pop

+

Ends a collapsabale UI section

void nk_tree_pop(struct nk_context*);
+
NK_API void nk_tree_pop(struct nk_context *)
Definition: nuklear_tree.c:190
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx
+ +

Definition at line 190 of file nuklear_tree.c.

+ +

References nk_tree_state_pop().

+ +
+
+ +

◆ nk_tree_push_hashed()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_tree_push_hashed (struct nk_contextctx,
enum nk_tree_type,
const char * title,
enum nk_collapse_states initial_state,
const char * hash,
int len,
int seed 
)
+
+

+# nk_tree_push_hashed

+

Start a collapsible UI section with internal state management with full control over internal unique ID used to store state

nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+
NK_API nk_bool nk_tree_push_hashed(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:176
+
+ + + + + + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Initial tree state value out of nk_collapse_states
Parameters
+ + +
[in]hash
+
+
+
Memory block or string to generate the ID from
Parameters
+ + +
[in]len
+
+
+
Size of passed memory block or string in hash
Parameters
+ + +
[in]seed
+
+
+
Seeding value if this function is called in a loop or default to 0
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 176 of file nuklear_tree.c.

+ +
+
+ +

◆ nk_tree_state_image_push()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_tree_state_image_push (struct nk_contextctx,
enum nk_tree_type,
struct nk_image img,
const char * title,
enum nk_collapse_states * state 
)
+
+

+# nk_tree_state_image_push

+

Start a collapsible UI section with image and label header and external state management

nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
+
NK_API nk_bool nk_tree_state_image_push(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:151
+
+ + + + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx
Parameters
+ + +
[in]img
+
+
+
Image to display inside the header on the left of the label
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Persistent state to update
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 151 of file nuklear_tree.c.

+ +
+
+ +

◆ nk_tree_state_pop()

+ +
+
+ + + + + + + + +
NK_API void nk_tree_state_pop (struct nk_contextctx)
+
+

+# nk_tree_state_pop

+

Ends a collapsabale UI section

+
NK_API void nk_tree_state_pop(struct nk_context *)
Definition: nuklear_tree.c:157
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx
+ +

Definition at line 157 of file nuklear_tree.c.

+ +

Referenced by nk_tree_pop().

+ +
+
+ +

◆ nk_tree_state_push()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_tree_state_push (struct nk_contextctx,
enum nk_tree_type,
const char * title,
enum nk_collapse_states * state 
)
+
+

+# nk_tree_state_push

+

Start a collapsible UI section with external state management

nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
+
NK_API nk_bool nk_tree_state_push(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:145
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx
Parameters
+ + +
[in]type
+
+
+
Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
Parameters
+ + +
[in]title
+
+
+
Label printed in the tree header
Parameters
+ + +
[in]state
+
+
+
Persistent state to update
+
Returns
true(1) if visible and fillable with widgets or false(0) otherwise
+ +

Definition at line 145 of file nuklear_tree.c.

+ +
+
+ +

◆ nk_window_close()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_window_close (struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_close

+

Closes a window and marks it for being freed at the end of the frame

void nk_window_close(struct nk_context *ctx, const char *name);
+
NK_API void nk_window_close(struct nk_context *ctx, const char *name)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to close
+ +

Definition at line 549 of file nuklear_window.c.

+ +

References NK_WINDOW_CLOSED, nk_window_find(), and NK_WINDOW_HIDDEN.

+ +
+
+ +

◆ nk_window_collapse()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_collapse (struct nk_contextctx,
const char * name,
enum nk_collapse_states state 
)
+
+

+# nk_window_collapse

+

Updates collapse state of a window with given name

void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
+
NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to close
Parameters
+ + +
[in]state
+
+
+
value out of nk_collapse_states section
+ +

Definition at line 603 of file nuklear_window.c.

+ +

Referenced by nk_window_collapse_if().

+ +
+
+ +

◆ nk_window_collapse_if()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_collapse_if (struct nk_contextctx,
const char * name,
enum nk_collapse_states state,
int cond 
)
+
+

+# nk_window_collapse_if

+

Updates collapse state of a window with given name if given condition is met

void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
+
NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to either collapse or maximize
Parameters
+ + +
[in]state
+
+
+
value out of nk_collapse_states section the window should be put into
Parameters
+ + +
[in]cond
+
+
+
condition that has to be met to actually commit the collapse state change
+ +

Definition at line 621 of file nuklear_window.c.

+ +

References nk_window_collapse().

+ +
+
+ +

◆ nk_window_find()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API struct nk_window* nk_window_find (const struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_find

+

Finds and returns a window from passed name

+
struct nk_window *nk_window_find(struct nk_context *ctx, const char *name);
+
NK_API struct nk_window * nk_window_find(const struct nk_context *ctx, const char *name)
+ +
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Window identifier
+
Returns
a nk_window struct pointing to the identified window or NULL if no window with the given name was found
+ +

Definition at line 540 of file nuklear_window.c.

+ +

Referenced by nk_window_close(), nk_window_set_bounds(), nk_window_set_position(), and nk_window_set_size().

+ +
+
+ +

◆ nk_window_get_bounds()

+ +
+
+ + + + + + + + +
NK_API struct nk_rect nk_window_get_bounds (const struct nk_contextctx)
+
+

+# nk_window_get_bounds

+
Returns
a rectangle with screen position and size of the currently processed window
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
+
NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
a nk_rect struct with window upper left window position and size
+ +

Definition at line 314 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_canvas()

+ +
+
+ + + + + + + + +
NK_API struct nk_command_buffer* nk_window_get_canvas (const struct nk_contextctx)
+
+

+# nk_window_get_canvas

+
Returns
the draw command buffer. Can be used to draw custom widgets !!!
+
Warning
Only call this function between calls nk_begin_xxx and nk_end !!!
+
+Do not keep the returned command buffer pointer around it is only valid until nk_end
+
+
NK_API struct nk_command_buffer * nk_window_get_canvas(const struct nk_context *ctx)
+ +
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
a pointer to window internal nk_command_buffer struct used as drawing canvas. Can be used to do custom drawing.
+ +

Definition at line 391 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_content_region()

+ +
+
+ + + + + + + + +
NK_API struct nk_rect nk_window_get_content_region (const struct nk_contextctx)
+
+

+# nk_window_get_content_region

+
Returns
the position and size of the currently visible and non-clipped space inside the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
+
NK_API struct nk_rect nk_window_get_content_region(const struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
nk_rect struct with screen position and size (no scrollbar offset) of the visible space inside the current window
+ +

Definition at line 354 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_content_region_max()

+ +
+
+ + + + + + + + +
NK_API struct nk_vec2 nk_window_get_content_region_max (const struct nk_contextctx)
+
+

+# nk_window_get_content_region_max

+
Returns
the lower right screen position of the currently visible and non-clipped space inside the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
+
NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
nk_vec2 struct with lower right screen position (no scrollbar offset) of the visible space inside the current window
+ +

Definition at line 371 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_content_region_min()

+ +
+
+ + + + + + + + +
NK_API struct nk_vec2 nk_window_get_content_region_min (const struct nk_contextctx)
+
+

+# nk_window_get_content_region_min

+
Returns
the upper left position of the currently visible and non-clipped space inside the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
+
NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+

returns nk_vec2 struct with upper left screen position (no scrollbar offset) of the visible space inside the current window

+ +

Definition at line 362 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_content_region_size()

+ +
+
+ + + + + + + + +
NK_API struct nk_vec2 nk_window_get_content_region_size (const struct nk_contextctx)
+
+

+# nk_window_get_content_region_size

+
Returns
the size of the currently visible and non-clipped space inside the currently processed window
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
+
NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx)
+
+ + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
nk_vec2 struct with size the visible space inside the current window
+ +

Definition at line 381 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_height()

+ +
+
+ + + + + + + + +
NK_API float nk_window_get_height (const struct nk_contextctx)
+
+

+# nk_window_get_height

+
Returns
the height of the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
float nk_window_get_height(const struct nk_context *ctx);
+
NK_API float nk_window_get_height(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
the current window height
+ +

Definition at line 347 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_panel()

+ +
+
+ + + + + + + + +
NK_API struct nk_panel* nk_window_get_panel (const struct nk_contextctx)
+
+

+# nk_window_get_panel

+
Returns
the underlying panel which contains all processing state of the current window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end !!!
+
+Do not keep the returned panel pointer around, it is only valid until nk_end
+
NK_API struct nk_panel * nk_window_get_panel(const struct nk_context *ctx)
+ +
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
a pointer to window internal nk_panel state.
+ +

Definition at line 400 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_position()

+ +
+
+ + + + + + + + +
NK_API struct nk_vec2 nk_window_get_position (const struct nk_contextctx)
+
+

+# nk_window_get_position

+
Returns
the position of the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
+
NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
a nk_vec2 struct with window upper left position
+ +

Definition at line 322 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_scroll()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_get_scroll (const struct nk_contextctx,
nk_uint * offset_x,
nk_uint * offset_y 
)
+
+

+# nk_window_get_scroll

+

Gets the scroll offset for the current window !!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
void nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y);
+
NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]offset_x
+
+
+
A pointer to the x offset output (or NULL to ignore)
Parameters
+ + +
[in]offset_y
+
+
+
A pointer to the y offset output (or NULL to ignore)
+ +

Definition at line 408 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_size()

+ +
+
+ + + + + + + + +
NK_API struct nk_vec2 nk_window_get_size (const struct nk_contextctx)
+
+

+# nk_window_get_size

+
Returns
the size with width and height of the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
+
NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
a nk_vec2 struct with window width and height
+ +

Definition at line 330 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_get_width()

+ +
+
+ + + + + + + + +
NK_API float nk_window_get_width (const struct nk_contextctx)
+
+ +

nk_window_get_width

+
Returns
the width of the currently processed window.
+

!!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
float nk_window_get_width(const struct nk_context *ctx);
+
NK_API float nk_window_get_width(const struct nk_context *ctx)
nk_window_get_width
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
the current window width
+ +

Definition at line 339 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_has_focus()

+ +
+
+ + + + + + + + +
NK_API nk_bool nk_window_has_focus (const struct nk_contextctx)
+
+

+# nk_window_has_focus

+
Returns
if the currently processed window is currently active !!!
+
Warning
Only call this function between calls nk_begin_xxx and nk_end
nk_bool nk_window_has_focus(const struct nk_context *ctx);
+
NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
false(0) if current window is not active or true(1) if it is
+ +

Definition at line 422 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_is_active()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_window_is_active (const struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_is_active

+

Same as nk_window_has_focus for some reason

nk_bool nk_window_is_active(struct nk_context *ctx, const char *name);
+
NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char *name)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of window you want to check if it is active
+
Returns
true(1) if current window is active or false(0) window not found or not active
+ +

Definition at line 525 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_is_any_hovered()

+ +
+
+ + + + + + + + +
NK_API nk_bool nk_window_is_any_hovered (const struct nk_contextctx)
+
+

+# nk_window_is_any_hovered

+
Returns
if the any window is being hovered
+
NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
true(1) if any window is hovered or false(0) otherwise
+ +

Definition at line 446 of file nuklear_window.c.

+ +

References NK_WINDOW_HIDDEN.

+ +

Referenced by nk_item_is_any_active().

+ +
+
+ +

◆ nk_window_is_closed()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_window_is_closed (const struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_is_closed

+
Returns
if the window with given name was closed by calling nk_close
nk_bool nk_window_is_closed(struct nk_context *ctx, const char *name);
+
NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char *name)
+
+ + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of window you want to check if it is closed
+
Returns
true(1) if current window was closed or false(0) window not found or not closed
+ +

Definition at line 495 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_is_collapsed()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_window_is_collapsed (const struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_is_collapsed

+
Returns
if the window with given name is currently minimized/collapsed
nk_bool nk_window_is_collapsed(struct nk_context *ctx, const char *name);
+
NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name)
+
+ + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of window you want to check if it is collapsed
+
Returns
true(1) if current window is minimized and false(0) if window not found or is not minimized
+ +

Definition at line 480 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_is_hidden()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API nk_bool nk_window_is_hidden (const struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_is_hidden

+
Returns
if the window with given name is hidden
nk_bool nk_window_is_hidden(struct nk_context *ctx, const char *name);
+
NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char *name)
+
+ + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of window you want to check if it is hidden
+
Returns
true(1) if current window is hidden or false(0) window not found or visible
+ +

Definition at line 510 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_is_hovered()

+ +
+
+ + + + + + + + +
NK_API nk_bool nk_window_is_hovered (const struct nk_contextctx)
+
+

+# nk_window_is_hovered

+

Return if the current window is being hovered !!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
nk_bool nk_window_is_hovered(struct nk_context *ctx);
+
NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx)
+
+ + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
+
Returns
true(1) if current window is hovered or false(0) otherwise
+ +

Definition at line 431 of file nuklear_window.c.

+ +

References NK_WINDOW_HIDDEN, and NK_WINDOW_MINIMIZED.

+ +
+
+ +

◆ nk_window_set_bounds()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_set_bounds (struct nk_contextctx,
const char * name,
struct nk_rect bounds 
)
+
+

+# nk_window_set_bounds

+

Updates position and size of window with passed in name

void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
+
NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to modify both position and size
Parameters
+ + +
[in]bounds
+
+
+
Must point to a nk_rect struct with the new position and size
+ +

Definition at line 562 of file nuklear_window.c.

+ +

References nk_window_find().

+ +
+
+ +

◆ nk_window_set_focus()

+ +
+
+ + + + + + + + + + + + + + + + + + +
NK_API void nk_window_set_focus (struct nk_contextctx,
const char * name 
)
+
+

+# nk_window_set_focus

+

Sets the window with given name as active

void nk_window_set_focus(struct nk_context*, const char *name);
+
NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name)
+
+ + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to set focus on
+ +

Definition at line 655 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_set_position()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_set_position (struct nk_contextctx,
const char * name,
struct nk_vec2 pos 
)
+
+

+# nk_window_set_position

+

Updates position of window with passed name

void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
+
NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to modify both position
Parameters
+ + +
[in]pos
+
+
+
Must point to a nk_vec2 struct with the new position
+ +

Definition at line 573 of file nuklear_window.c.

+ +

References nk_window_find().

+ +
+
+ +

◆ nk_window_set_scroll()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_set_scroll (struct nk_contextctx,
nk_uint offset_x,
nk_uint offset_y 
)
+
+

+# nk_window_set_scroll

+

Sets the scroll offset for the current window !!!

Warning
Only call this function between calls nk_begin_xxx and nk_end
+
void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y);
+
NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]offset_x
+
+
+
The x offset to scroll to
Parameters
+ + +
[in]offset_y
+
+
+
The y offset to scroll to
+ +

Definition at line 591 of file nuklear_window.c.

+ +
+
+ +

◆ nk_window_set_size()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_set_size (struct nk_contextctx,
const char * name,
struct nk_vec2 size 
)
+
+

+# nk_window_set_size

+

Updates size of window with passed in name

void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
+
NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to modify both window size
Parameters
+ + +
[in]size
+
+
+
Must point to a nk_vec2 struct with new window size
+ +

Definition at line 582 of file nuklear_window.c.

+ +

References nk_window_find().

+ +
+
+ +

◆ nk_window_show()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_show (struct nk_contextctx,
const char * name,
enum nk_show_states state 
)
+
+

+# nk_window_show

+

updates visibility state of a window with given name

void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
+
NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state)
+
+ + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to either collapse or maximize
Parameters
+ + +
[in]state
+
+
+
state with either visible or hidden to modify the window with
+ +

Definition at line 629 of file nuklear_window.c.

+ +

Referenced by nk_window_show_if().

+ +
+
+ +

◆ nk_window_show_if()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NK_API void nk_window_show_if (struct nk_contextctx,
const char * name,
enum nk_show_states state,
int cond 
)
+
+

+# nk_window_show_if

+

Updates visibility state of a window with given name if a given condition is met

void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
+
NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond)
+
+ + + + + + + + + + +
Parameter Description
Parameters
+ + +
[in]ctx
+
+
+
Must point to an previously initialized nk_context struct
Parameters
+ + +
[in]name
+
+
+
Identifier of the window to either hide or show
Parameters
+ + +
[in]state
+
+
+
state with either visible or hidden to modify the window with
Parameters
+ + +
[in]cond
+
+
+
condition that has to be met to actually commit the visibility state change
+ +

Definition at line 646 of file nuklear_window.c.

+ +

References nk_window_show().

+ +
+
+
+
+ + + + diff --git a/nuklear_8h.js b/nuklear_8h.js new file mode 100644 index 000000000..454836ba8 --- /dev/null +++ b/nuklear_8h.js @@ -0,0 +1,1026 @@ +var nuklear_8h = +[ + [ "nk_color", "structnk__color.html", "structnk__color" ], + [ "nk_colorf", "structnk__colorf.html", "structnk__colorf" ], + [ "nk_vec2", "structnk__vec2.html", "structnk__vec2" ], + [ "nk_vec2i", "structnk__vec2i.html", "structnk__vec2i" ], + [ "nk_rect", "structnk__rect.html", "structnk__rect" ], + [ "nk_recti", "structnk__recti.html", "structnk__recti" ], + [ "nk_handle", "unionnk__handle.html", "unionnk__handle" ], + [ "nk_image", "structnk__image.html", "structnk__image" ], + [ "nk_nine_slice", "structnk__nine__slice.html", "structnk__nine__slice" ], + [ "nk_cursor", "structnk__cursor.html", "structnk__cursor" ], + [ "nk_scroll", "structnk__scroll.html", "structnk__scroll" ], + [ "nk_allocator", "structnk__allocator.html", "structnk__allocator" ], + [ "nk_draw_null_texture", "structnk__draw__null__texture.html", "structnk__draw__null__texture" ], + [ "nk_convert_config", "structnk__convert__config.html", "structnk__convert__config" ], + [ "nk_list_view", "structnk__list__view.html", "structnk__list__view" ], + [ "nk_user_font", "structnk__user__font.html", "structnk__user__font" ], + [ "nk_memory_status", "structnk__memory__status.html", "structnk__memory__status" ], + [ "nk_buffer_marker", "structnk__buffer__marker.html", "structnk__buffer__marker" ], + [ "nk_memory", "structnk__memory.html", "structnk__memory" ], + [ "nk_buffer", "structnk__buffer.html", "structnk__buffer" ], + [ "nk_str", "structnk__str.html", "structnk__str" ], + [ "nk_clipboard", "structnk__clipboard.html", "structnk__clipboard" ], + [ "nk_text_undo_record", "structnk__text__undo__record.html", "structnk__text__undo__record" ], + [ "nk_text_undo_state", "structnk__text__undo__state.html", "structnk__text__undo__state" ], + [ "nk_text_edit", "structnk__text__edit.html", "structnk__text__edit" ], + [ "nk_command", "structnk__command.html", "structnk__command" ], + [ "nk_command_scissor", "structnk__command__scissor.html", "structnk__command__scissor" ], + [ "nk_command_line", "structnk__command__line.html", "structnk__command__line" ], + [ "nk_command_curve", "structnk__command__curve.html", "structnk__command__curve" ], + [ "nk_command_rect", "structnk__command__rect.html", "structnk__command__rect" ], + [ "nk_command_rect_filled", "structnk__command__rect__filled.html", "structnk__command__rect__filled" ], + [ "nk_command_rect_multi_color", "structnk__command__rect__multi__color.html", "structnk__command__rect__multi__color" ], + [ "nk_command_triangle", "structnk__command__triangle.html", "structnk__command__triangle" ], + [ "nk_command_triangle_filled", "structnk__command__triangle__filled.html", "structnk__command__triangle__filled" ], + [ "nk_command_circle", "structnk__command__circle.html", "structnk__command__circle" ], + [ "nk_command_circle_filled", "structnk__command__circle__filled.html", "structnk__command__circle__filled" ], + [ "nk_command_arc", "structnk__command__arc.html", "structnk__command__arc" ], + [ "nk_command_arc_filled", "structnk__command__arc__filled.html", "structnk__command__arc__filled" ], + [ "nk_command_polygon", "structnk__command__polygon.html", "structnk__command__polygon" ], + [ "nk_command_polygon_filled", "structnk__command__polygon__filled.html", "structnk__command__polygon__filled" ], + [ "nk_command_polyline", "structnk__command__polyline.html", "structnk__command__polyline" ], + [ "nk_command_image", "structnk__command__image.html", "structnk__command__image" ], + [ "nk_command_custom", "structnk__command__custom.html", "structnk__command__custom" ], + [ "nk_command_text", "structnk__command__text.html", "structnk__command__text" ], + [ "nk_command_buffer", "structnk__command__buffer.html", "structnk__command__buffer" ], + [ "nk_mouse_button", "structnk__mouse__button.html", "structnk__mouse__button" ], + [ "nk_mouse", "structnk__mouse.html", "structnk__mouse" ], + [ "nk_key", "structnk__key.html", "structnk__key" ], + [ "nk_keyboard", "structnk__keyboard.html", "structnk__keyboard" ], + [ "nk_input", "structnk__input.html", "structnk__input" ], + [ "nk_style_item_data", "unionnk__style__item__data.html", "unionnk__style__item__data" ], + [ "nk_style_item", "structnk__style__item.html", "structnk__style__item" ], + [ "nk_style_text", "structnk__style__text.html", "structnk__style__text" ], + [ "nk_style_button", "structnk__style__button.html", "structnk__style__button" ], + [ "nk_style_toggle", "structnk__style__toggle.html", "structnk__style__toggle" ], + [ "nk_style_selectable", "structnk__style__selectable.html", "structnk__style__selectable" ], + [ "nk_style_slider", "structnk__style__slider.html", "structnk__style__slider" ], + [ "nk_style_knob", "structnk__style__knob.html", "structnk__style__knob" ], + [ "nk_style_progress", "structnk__style__progress.html", "structnk__style__progress" ], + [ "nk_style_scrollbar", "structnk__style__scrollbar.html", "structnk__style__scrollbar" ], + [ "nk_style_edit", "structnk__style__edit.html", "structnk__style__edit" ], + [ "nk_style_property", "structnk__style__property.html", "structnk__style__property" ], + [ "nk_style_chart", "structnk__style__chart.html", "structnk__style__chart" ], + [ "nk_style_combo", "structnk__style__combo.html", "structnk__style__combo" ], + [ "nk_style_tab", "structnk__style__tab.html", "structnk__style__tab" ], + [ "nk_style_window_header", "structnk__style__window__header.html", "structnk__style__window__header" ], + [ "nk_style_window", "structnk__style__window.html", "structnk__style__window" ], + [ "nk_style", "structnk__style.html", "structnk__style" ], + [ "nk_chart_slot", "structnk__chart__slot.html", "structnk__chart__slot" ], + [ "nk_chart", "structnk__chart.html", "structnk__chart" ], + [ "nk_row_layout", "structnk__row__layout.html", "structnk__row__layout" ], + [ "nk_popup_buffer", "structnk__popup__buffer.html", "structnk__popup__buffer" ], + [ "nk_menu_state", "structnk__menu__state.html", "structnk__menu__state" ], + [ "nk_panel", "structnk__panel.html", "structnk__panel" ], + [ "nk_popup_state", "structnk__popup__state.html", "structnk__popup__state" ], + [ "nk_edit_state", "structnk__edit__state.html", "structnk__edit__state" ], + [ "nk_property_state", "structnk__property__state.html", "structnk__property__state" ], + [ "nk_window", "structnk__window.html", "structnk__window" ], + [ "nk_configuration_stacks", "structnk__configuration__stacks.html", "structnk__configuration__stacks" ], + [ "nk_table", "structnk__table.html", "structnk__table" ], + [ "nk_page_data", "unionnk__page__data.html", "unionnk__page__data" ], + [ "nk_page_element", "structnk__page__element.html", "structnk__page__element" ], + [ "nk_page", "structnk__page.html", "structnk__page" ], + [ "nk_pool", "structnk__pool.html", "structnk__pool" ], + [ "nk_context", "structnk__context.html", "structnk__context" ], + [ "NK_ABS", "nuklear_8h.html#a4dd62c825b47f8f40071b93660a1edcc", null ], + [ "NK_ALIGN_PTR", "nuklear_8h.html#a57b79575bed3fd38030a35c1c10b513d", null ], + [ "NK_ALIGN_PTR_BACK", "nuklear_8h.html#a943b4ba00a1fd4fe4f0cfe621864fe18", null ], + [ "NK_ALIGNOF", "nuklear_8h.html#a19e43345ea32635c4238feb30ac228ef", null ], + [ "NK_API", "nuklear_8h.html#a0cf1c39d0b118a76a84147c7f510e54e", null ], + [ "NK_BETWEEN", "nuklear_8h.html#ac21944fc6ffac114c9f621e0e74f1f55", null ], + [ "NK_BOOL", "nuklear_8h.html#a3d22f7496565fb07532fa0c473894915", null ], + [ "NK_BUTTON_BEHAVIOR_STACK_SIZE", "nuklear_8h.html#a6928fff50ec88d27a9a52fb379930056", null ], + [ "NK_CHART_MAX_SLOT", "nuklear_8h.html#acb2e713edfb3e50211b1fd67d38529be", null ], + [ "NK_CLAMP", "nuklear_8h.html#a2fc614d220caad6d666ac774fea375a6", null ], + [ "NK_COLOR_STACK_SIZE", "nuklear_8h.html#a959e086f7329d240acf4d7a9a573ae2a", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a7feae091805565d91fc6de7e178e7a91", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#a48357bce8aec950a5c369048e1e0a2cb", null ], + [ "NK_CONTAINER_OF", "nuklear_8h.html#a12bf1783aa0f939e9ce0a3e264b6b8ec", null ], + [ "NK_CONTAINS", "nuklear_8h.html#ac455f505fdfc0daea736348404d1d6cd", null ], + [ "NK_FILE_LINE", "nuklear_8h.html#a2d47188d74f9ef34c8c09440b9b9bf7a", null ], + [ "NK_FLAG", "nuklear_8h.html#a0d5869278202c39399f87f1a4649a94e", null ], + [ "NK_FLAGS_STACK_SIZE", "nuklear_8h.html#a37682b0422174bafe64762dafbb00b22", null ], + [ "nk_float", "nuklear_8h.html#a1cd209d82ccb234e314c5087f916c6c6", null ], + [ "NK_FLOAT_STACK_SIZE", "nuklear_8h.html#ae282f36a59cb1a9a9f07e3f5143da040", null ], + [ "NK_FONT_STACK_SIZE", "nuklear_8h.html#a81b9e1dc584e6261bd20722c6d95b6cc", null ], + [ "nk_foreach", "nuklear_8h.html#aaca7101364db82c0f03401fafd2c66a6", null ], + [ "NK_GLOBAL", "nuklear_8h.html#aa3655215952e357785b2c9a3f8a22424", null ], + [ "NK_INBOX", "nuklear_8h.html#a942ea30b1823921903a111fb4809c2aa", null ], + [ "NK_INPUT_MAX", "nuklear_8h.html#a6e69058f808cd9f9af5c1b357dfdde57", null ], + [ "NK_INT16", "nuklear_8h.html#a4bdd84c5b6143055092ab83ba3990ce0", null ], + [ "NK_INT32", "nuklear_8h.html#a8ece075da641af11e3de241f49d9307d", null ], + [ "NK_INT8", "nuklear_8h.html#acee6ab8a4a3d37c68891b1f33a7a36a7", null ], + [ "NK_INTERN", "nuklear_8h.html#a786295e733711f79f02c6cc2491973a1", null ], + [ "NK_INTERSECT", "nuklear_8h.html#af933ff1a4201fa858cbf687b1c43898d", null ], + [ "NK_LEN", "nuklear_8h.html#a3e7ee8dc3081c876dd5a944bd6658f22", null ], + [ "NK_LIB", "nuklear_8h.html#a33240834bfef08bc9fd26dc11f4d7b94", null ], + [ "NK_MACRO_STRINGIFY", "nuklear_8h.html#aa6119f2ea20663c14a3f966a7c97eb75", null ], + [ "NK_MAX", "nuklear_8h.html#acfa6ef70423b6fbe76e0c8ab57dd11e1", null ], + [ "NK_MAX_FLOAT_PRECISION", "nuklear_8h.html#ae29e16c9c5a79bd09ffc1f9860290f64", null ], + [ "NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS", "nuklear_8h.html#a84cf276eb1ea1d22a51706df4d2c5e28", null ], + [ "NK_MAX_NUMBER_BUFFER", "nuklear_8h.html#ad77efd6e24a599928777c715d0b2792b", null ], + [ "NK_MIN", "nuklear_8h.html#abfee423cb3606f3f48d8ef0de78f6ba4", null ], + [ "NK_OFFSETOF", "nuklear_8h.html#a37d9757386670253d897bc641d391941", null ], + [ "NK_PI", "nuklear_8h.html#ae20e26813b4025e5b07dda4655754d9d", null ], + [ "NK_PI_HALF", "nuklear_8h.html#ac6312610fad318365ba05e9cbaa7ff9e", null ], + [ "NK_POINTER_TYPE", "nuklear_8h.html#a543e7f28016171fb78bd1c6456a5bfab", null ], + [ "nk_ptr_add", "nuklear_8h.html#acd9f4ff40c5f7751e323ba1296771a6f", null ], + [ "nk_ptr_add_const", "nuklear_8h.html#aa07cd2ac64302b17b7a576aac8166c01", null ], + [ "NK_PTR_TO_UINT", "nuklear_8h.html#a7fa159b98659f1008433e85d85adf9ad", null ], + [ "NK_SATURATE", "nuklear_8h.html#a7aa8c4212cf53bd7871642b3af018502", null ], + [ "NK_SCROLLBAR_HIDING_TIMEOUT", "nuklear_8h.html#a309d9b8d0c26b6b1a61d3358ebddebd5", null ], + [ "NK_SIZE_TYPE", "nuklear_8h.html#ab29c155ec7db4d21a14a9cd95aa66cec", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a4e987494cc3b9b2bef6fcf22ccfc223e", null ], + [ "NK_STORAGE", "nuklear_8h.html#a14977065f380ffb30b714375d0f528e3", null ], + [ "NK_STRING_JOIN", "nuklear_8h.html#adbafb2874feb9a1aa96b5f1eb38c5c73", null ], + [ "NK_STRING_JOIN_DELAY", "nuklear_8h.html#a1970117bd65c4add237e567c6a8247f3", null ], + [ "NK_STRING_JOIN_IMMEDIATE", "nuklear_8h.html#a7456085e5da0c84f3354280908bcb9fc", null ], + [ "NK_STRINGIFY", "nuklear_8h.html#a75c47bb80d4ac7d0967df31f52ec13bf", null ], + [ "NK_STRTOD", "nuklear_8h.html#aa02c25cdf6f8d309ec716bdda4abd4a0", null ], + [ "NK_STYLE_ITEM_STACK_SIZE", "nuklear_8h.html#a8b5fdefc66263cf18e6d45d0d7f3e7b8", null ], + [ "NK_TEXTEDIT_UNDOCHARCOUNT", "nuklear_8h.html#a34eae5515d7d360bb243d6928f323cb6", null ], + [ "NK_TEXTEDIT_UNDOSTATECOUNT", "nuklear_8h.html#a473dfa38f3ce823a5368c892ab7b13fc", null ], + [ "nk_tree_element_push", "nuklear_8h.html#a27bb44a9cbe810246989bd10867b7979", null ], + [ "nk_tree_element_push_id", "nuklear_8h.html#adea6a6e3de7cf354b5db07b84af4d639", null ], + [ "nk_tree_image_push", "nuklear_8h.html#a51eaeff03e299744c9bd2ad096183425", null ], + [ "nk_tree_image_push_id", "nuklear_8h.html#a369a7855c556b4f77c23a7114c70b9d1", null ], + [ "nk_tree_push", "nuklear_8h.html#aa53e8d85086bd6cf126ccca1aa18b2d8", null ], + [ "nk_tree_push_id", "nuklear_8h.html#a9b006635928fac2b54c5f822f9312927", null ], + [ "NK_UINT16", "nuklear_8h.html#ac17634bc18b9601cce836ddf67f38736", null ], + [ "NK_UINT32", "nuklear_8h.html#a7e3e395721b325ef8f16469d4b07fbb9", null ], + [ "NK_UINT8", "nuklear_8h.html#a21e397019d36e596da72a7a6d1c52777", null ], + [ "NK_UINT_TO_PTR", "nuklear_8h.html#ae8cf89f96049f4aac6d29710a5f93eb1", null ], + [ "NK_UNDEFINED", "nuklear_8h.html#a163704545fa132ad552377dfd3594a6e", null ], + [ "NK_UNIQUE_NAME", "nuklear_8h.html#af7a0405dfe73988826add769a916abc6", null ], + [ "NK_UNUSED", "nuklear_8h.html#ad8c5561de2409142c67df067e195116d", null ], + [ "NK_UTF_INVALID", "nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6", null ], + [ "NK_UTF_INVALID", "nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6", null ], + [ "NK_UTF_SIZE", "nuklear_8h.html#a5751d22e6e68d2bf104010d6422bd28e", null ], + [ "NK_VALUE_PAGE_CAPACITY", "nuklear_8h.html#a8dc0d705f81317352b98df20a6481b52", null ], + [ "nk_vec2_add", "nuklear_8h.html#a17887fa5f4f9949c05fd21bd01a35b55", null ], + [ "nk_vec2_len_sqr", "nuklear_8h.html#ac5fbcfe230496e0a63e3fbee3d652327", null ], + [ "nk_vec2_muls", "nuklear_8h.html#a8eec8264c8154989fbbd31fd2f707bfe", null ], + [ "nk_vec2_sub", "nuklear_8h.html#a9c6b0653139966d085d21179db601a8a", null ], + [ "NK_VECTOR_STACK_SIZE", "nuklear_8h.html#a024e8035e4d387f012a84ec9006f2628", null ], + [ "NK_WIDGET_DISABLED_FACTOR", "nuklear_8h.html#aa8b73b15dc9958d0334cfab81ca5cd73", null ], + [ "NK_WINDOW_MAX_NAME", "nuklear_8h.html#ae8c2d8ba66b02fdd1c64137904c83372", null ], + [ "nk_zero_struct", "nuklear_8h.html#a72ce978e23459b85944027c102885b6d", null ], + [ "nk_bool", "nuklear_8h.html#a2322feace91bf83046a9f8c4ea466a56", null ], + [ "nk_byte", "nuklear_8h.html#a1a0ad76219a407f92601a49b44507ecb", null ], + [ "nk_char", "nuklear_8h.html#a0b5348ac549a4ba5421e290437a26db7", null ], + [ "nk_command_custom_callback", "nuklear_8h.html#a31909395d6066c8b4a31d1a371816a37", null ], + [ "nk_flags", "nuklear_8h.html#a19e0e2f6db4862891d9801de3c3da323", null ], + [ "nk_glyph", "nuklear_8h.html#a40b1a210baedac2026915cbe062288a4", null ], + [ "nk_hash", "nuklear_8h.html#a2123e2728db7d1f136b57d6528a0d757", null ], + [ "nk_int", "nuklear_8h.html#ae56f5fdb43500135b1d2db67cb11846e", null ], + [ "nk_plugin_alloc", "nuklear_8h.html#adfbbdf36c71cbe9f11c87fda00126cb0", null ], + [ "nk_plugin_copy", "nuklear_8h.html#a01c2d0f210146bddb18fd3f4a5a9ec86", null ], + [ "nk_plugin_filter", "nuklear_8h.html#acebdd59214a43249d7a18968eab0f9b0", null ], + [ "nk_plugin_free", "nuklear_8h.html#aa6efffb60b73f429d5d4cce5a6fd4045", null ], + [ "nk_plugin_paste", "nuklear_8h.html#a5c2f97ddb60956a8743b9f0a8cc5e813", null ], + [ "nk_ptr", "nuklear_8h.html#a3a91f39efee3a017faa9cfe50c5e9326", null ], + [ "nk_query_font_glyph_f", "nuklear_8h.html#aba6d9a1b588f61fec2a5b99016fa98ef", null ], + [ "nk_rune", "nuklear_8h.html#a7261077b5093b020a11ec7a06e0aa762", null ], + [ "nk_short", "nuklear_8h.html#a466646ced428ddf4962c98c2d53e68f2", null ], + [ "nk_size", "nuklear_8h.html#a84c0fc50dec5501be327b33d41d9010c", null ], + [ "nk_text_width_f", "nuklear_8h.html#a980ba414f6e3d6490236a688e7b51b1a", null ], + [ "nk_uchar", "nuklear_8h.html#af6b973e19a153e4f552e65906a4ab96b", null ], + [ "nk_uint", "nuklear_8h.html#a951b598a3101b6d2a55d22ac39f57919", null ], + [ "nk_ushort", "nuklear_8h.html#ad6257675c042a7b667691e0ee0415016", null ], + [ "nk_allocation_type", "nuklear_8h.html#aa988e58afebdfa0bbd380ed643f913ec", [ + [ "NK_BUFFER_FIXED", "nuklear_8h.html#aa988e58afebdfa0bbd380ed643f913eca1ca1e63534fd997bc4d3fd41edcf02f7", null ], + [ "NK_BUFFER_DYNAMIC", "nuklear_8h.html#aa988e58afebdfa0bbd380ed643f913ecad4f10412aaa3e6e8fc0f46dabf198371", null ] + ] ], + [ "nk_anti_aliasing", "nuklear_8h.html#a9b070460af54cd26421eb7d000956f38", [ + [ "NK_ANTI_ALIASING_OFF", "nuklear_8h.html#a9b070460af54cd26421eb7d000956f38a48558f269080d955312d11e283deffa1", null ], + [ "NK_ANTI_ALIASING_ON", "nuklear_8h.html#a9b070460af54cd26421eb7d000956f38a427cab30457c4303aece29c6fd290ab4", null ] + ] ], + [ "nk_buffer_allocation_type", "nuklear_8h.html#add31ad7a49e91bcf491614a4739108c1", [ + [ "NK_BUFFER_FRONT", "nuklear_8h.html#add31ad7a49e91bcf491614a4739108c1af5e76755145141d692e030c69c995d50", null ], + [ "NK_BUFFER_BACK", "nuklear_8h.html#add31ad7a49e91bcf491614a4739108c1a684e4256eb704e424e8fadc35ad2afed", null ], + [ "NK_BUFFER_MAX", "nuklear_8h.html#add31ad7a49e91bcf491614a4739108c1ab0dfe51211ba806cb36a3a6b1f3e76bd", null ] + ] ], + [ "nk_button_behavior", "nuklear_8h.html#aa9c50dd424dfcd57bab32dea3505ea26", [ + [ "NK_BUTTON_DEFAULT", "nuklear_8h.html#aa9c50dd424dfcd57bab32dea3505ea26a5227fe8d8cb1107e691484990dec118e", null ], + [ "NK_BUTTON_REPEATER", "nuklear_8h.html#aa9c50dd424dfcd57bab32dea3505ea26af4f39f9c1f9ff27cde1b3f98d10b980a", null ] + ] ], + [ "nk_buttons", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556e", [ + [ "NK_BUTTON_LEFT", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556ea52cb33fda5becfc578a3a78daa478c0d", null ], + [ "NK_BUTTON_MIDDLE", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556ea6c7c52ef62bccea7a0bf225217a5cf61", null ], + [ "NK_BUTTON_RIGHT", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556eac288cadf552c69e132323167734ca91f", null ], + [ "NK_BUTTON_DOUBLE", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556ea59c1777d8dd33e133e75c81d94c2642e", null ], + [ "NK_BUTTON_MAX", "nuklear_8h.html#a393c070a7578ce148c1d341d412d556eaac3699df21301900b13e7408b75be8dd", null ] + ] ], + [ "nk_chart_event", "nuklear_8h.html#a26a432ff0df91b1b247654711f897c20", [ + [ "NK_CHART_HOVERING", "nuklear_8h.html#a26a432ff0df91b1b247654711f897c20a773ecdd5148d87bfd176385be85263b9", null ], + [ "NK_CHART_CLICKED", "nuklear_8h.html#a26a432ff0df91b1b247654711f897c20accd379100b2f54cdbf86ae23a64b505f", null ] + ] ], + [ "nk_chart_type", "nuklear_8h.html#a2685f2dbd5f80f76cbaebd524a12b7ef", [ + [ "NK_CHART_LINES", "nuklear_8h.html#a2685f2dbd5f80f76cbaebd524a12b7efaaabff6795e2a2c715d3995a9638ddf8f", null ], + [ "NK_CHART_COLUMN", "nuklear_8h.html#a2685f2dbd5f80f76cbaebd524a12b7efa33c6a39491e6191aaf4f7c1a5106e4bb", null ], + [ "NK_CHART_MAX", "nuklear_8h.html#a2685f2dbd5f80f76cbaebd524a12b7efac44e7e4cd0f68827db328e8c2b6f37e3", null ] + ] ], + [ "nk_collapse_states", "nuklear_8h.html#a89d858e4f002184cbb5dcc4cb36ed41a", [ + [ "NK_MINIMIZED", "nuklear_8h.html#a89d858e4f002184cbb5dcc4cb36ed41aa0af8c0c6481f8b31284ecfbea67159d5", null ], + [ "NK_MAXIMIZED", "nuklear_8h.html#a89d858e4f002184cbb5dcc4cb36ed41aa309d5a2d49342944ee991750a105eca3", null ] + ] ], + [ "nk_color_format", "nuklear_8h.html#a7b9007b552e768babe6e1225636ca3cf", [ + [ "NK_RGB", "nuklear_8h.html#a7b9007b552e768babe6e1225636ca3cfa4a4154dd01a18102cd57eb348b45cffb", null ], + [ "NK_RGBA", "nuklear_8h.html#a7b9007b552e768babe6e1225636ca3cfa4bab84b34b67fc7adf5856bb74e9ed98", null ] + ] ], + [ "nk_command_clipping", "nuklear_8h.html#a6eba1ca5ad678ecfb064790d1155bafb", [ + [ "NK_CLIPPING_OFF", "nuklear_8h.html#a6eba1ca5ad678ecfb064790d1155bafba3a26fdade21e793bc43a9ce61c95b7b7", null ], + [ "NK_CLIPPING_ON", "nuklear_8h.html#a6eba1ca5ad678ecfb064790d1155bafbadf71cbc6ac49980db0f673d047492eca", null ] + ] ], + [ "nk_command_type", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accda", [ + [ "NK_COMMAND_NOP", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa7bff8157ab818ae7aa3c01200bf5ea7c", null ], + [ "NK_COMMAND_SCISSOR", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa1cd77102f8b2d7001a772cf5b9b9da61", null ], + [ "NK_COMMAND_LINE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaacff2bba6677cf473da54f816561058be", null ], + [ "NK_COMMAND_CURVE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa871098e7b3aac8f1204f0a193a2c1fcf", null ], + [ "NK_COMMAND_RECT", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa57515445dae5d76f1a775ac53f83ad3d", null ], + [ "NK_COMMAND_RECT_FILLED", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa04c9615be995abd0725b4dd13bb4dbab", null ], + [ "NK_COMMAND_RECT_MULTI_COLOR", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaaeabbd5ab505a0d7c7a6d42d4ff0d460f", null ], + [ "NK_COMMAND_CIRCLE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa874ae74e65bf367ed0923d8e9a849bf7", null ], + [ "NK_COMMAND_CIRCLE_FILLED", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaae52cb8ae43e50b7baf7be864879fa130", null ], + [ "NK_COMMAND_ARC", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa40702b3daaa79b4940b71f8d96f08dd5", null ], + [ "NK_COMMAND_ARC_FILLED", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaaeee848da340676ce2fe1b7599c8a37ea", null ], + [ "NK_COMMAND_TRIANGLE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa958fde3df1172f7d1bc4731db0cbbe43", null ], + [ "NK_COMMAND_TRIANGLE_FILLED", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa43b20980928451bb24f00a4faf3d611d", null ], + [ "NK_COMMAND_POLYGON", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa73ebb748766bbe0f6db6b21d43b044bf", null ], + [ "NK_COMMAND_POLYGON_FILLED", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa3ce41c33f45558207e6b9659b1b12d5d", null ], + [ "NK_COMMAND_POLYLINE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa150edbfb66dbd8b3230a043490c1cdf7", null ], + [ "NK_COMMAND_TEXT", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaaa15b21f23cfa435d9236e63c99ac9738", null ], + [ "NK_COMMAND_IMAGE", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa9155939bb1dc8d530a42e1689cd9daa4", null ], + [ "NK_COMMAND_CUSTOM", "nuklear_8h.html#ac22c9697f5a0310b11c61832f62accdaa83e3692080c1e9377ad7b542e2e07988", null ] + ] ], + [ "nk_convert_result", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1d", [ + [ "NK_CONVERT_SUCCESS", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1da64fa86598a519c35855d1d76d2a1cdf1", null ], + [ "NK_CONVERT_INVALID_PARAM", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1dadc262590bac1250e96d5aad50dca06a8", null ], + [ "NK_CONVERT_COMMAND_BUFFER_FULL", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1da013270866a9d3b6713d93000ba3734a5", null ], + [ "NK_CONVERT_VERTEX_BUFFER_FULL", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1da213e5b54041936005a619355547f1b02", null ], + [ "NK_CONVERT_ELEMENT_BUFFER_FULL", "nuklear_8h.html#a1a2db9e0fb4ccb344756b3bb8a75af1daf0018a116e1934a27d6de5cc651e148b", null ] + ] ], + [ "nk_edit_events", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737", [ + [ "NK_EDIT_ACTIVE", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737aafefdda6cf844d4c0e2b2d19b0987567", null ], + [ "NK_EDIT_INACTIVE", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737a15b71573eb3cb988dcf77ba090e80c6b", null ], + [ "NK_EDIT_ACTIVATED", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abe7aa005cc1df810a8d99d335e5b2e21", null ], + [ "NK_EDIT_DEACTIVATED", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737aa72e5bf401897ea75f2eaed14b4d1b97", null ], + [ "NK_EDIT_COMMITED", "nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abdd1da5f55b6213f935e8333840ee3d1", null ] + ] ], + [ "nk_edit_flags", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39f", [ + [ "NK_EDIT_DEFAULT", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fae1b4e076c42e881ccd59a0166145646b", null ], + [ "NK_EDIT_READ_ONLY", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fa7d107fdbb0ae002a9bfa76ca1d9131c4", null ], + [ "NK_EDIT_AUTO_SELECT", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39faa9d0fa6fb8c0b7b3b1c45cbd2242ed59", null ], + [ "NK_EDIT_SIG_ENTER", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fa7cd208dd545e5a781a014b67bc759935", null ], + [ "NK_EDIT_ALLOW_TAB", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fac85d9f4f4bbf0fc9a47361d2ddc936f5", null ], + [ "NK_EDIT_NO_CURSOR", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fabe5f257dbb9ae59cad1c01a0cfaeebf5", null ], + [ "NK_EDIT_SELECTABLE", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fab680d3c9811207b0e49c5e230740c1f4", null ], + [ "NK_EDIT_CLIPBOARD", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fab1456615e0772403fcc5671b74c639fb", null ], + [ "NK_EDIT_CTRL_ENTER_NEWLINE", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fafeefaddb12e2960a83d34f68fc7e6ff5", null ], + [ "NK_EDIT_NO_HORIZONTAL_SCROLL", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fa39dfca9149b04cbedbcb6d57f1427f34", null ], + [ "NK_EDIT_ALWAYS_INSERT_MODE", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fa5826bb3680c08af582e2aca76b66e6d6", null ], + [ "NK_EDIT_MULTILINE", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39fa3233d2af05b7011732ab2144d9f8124d", null ], + [ "NK_EDIT_GOTO_END_ON_ACTIVATE", "nuklear_8h.html#a17e5268c1547761902668de4cd2cc39faebbe7d976c1c23aeaa8b039fb1852f99", null ] + ] ], + [ "nk_edit_types", "nuklear_8h.html#aa524b298f903252c817ad8394c20ce70", [ + [ "NK_EDIT_SIMPLE", "nuklear_8h.html#aa524b298f903252c817ad8394c20ce70a4b0df531abb9dd7d2747fdb11d1a1975", null ], + [ "NK_EDIT_FIELD", "nuklear_8h.html#aa524b298f903252c817ad8394c20ce70a5fd950721752cc974450a249e68dec7e", null ], + [ "NK_EDIT_BOX", "nuklear_8h.html#aa524b298f903252c817ad8394c20ce70ae6204e3bf4541085b049b0c7161bd6b4", null ], + [ "NK_EDIT_EDITOR", "nuklear_8h.html#aa524b298f903252c817ad8394c20ce70a76bce9f07b0f34adc5af82cc4ff5435d", null ] + ] ], + [ "nk_heading", "nuklear_8h.html#afd6ff285e349f36ae902eb2dfc25a7eb", [ + [ "NK_UP", "nuklear_8h.html#afd6ff285e349f36ae902eb2dfc25a7eba91008410b8dd7e896da16ccd54ba6a77", null ], + [ "NK_RIGHT", "nuklear_8h.html#afd6ff285e349f36ae902eb2dfc25a7eba45ed51235cb004bb195c0ba0ade8d435", null ], + [ "NK_DOWN", "nuklear_8h.html#afd6ff285e349f36ae902eb2dfc25a7eba86313336083e6ddcc803ad2d517f9d32", null ], + [ "NK_LEFT", "nuklear_8h.html#afd6ff285e349f36ae902eb2dfc25a7ebaa205d14cc798c688b90b41c66f0b4882", null ] + ] ], + [ "nk_keys", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933", [ + [ "NK_KEY_NONE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a5d832b5f3b188f2c36faee1608621974", null ], + [ "NK_KEY_SHIFT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a9d349327bd915993d64f897741e68841", null ], + [ "NK_KEY_CTRL", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a62d425474d4d76278a17cdd0a59f08b7", null ], + [ "NK_KEY_DEL", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a54a1c4f4897ac1d70e9eea62ccf8549f", null ], + [ "NK_KEY_ENTER", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933aaa67f1778f843e04c690212894aa1268", null ], + [ "NK_KEY_TAB", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a8c946a5105ad1a70fb00cadb5c3223ae", null ], + [ "NK_KEY_BACKSPACE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933abe53b14065504e7045af9a3836006e5e", null ], + [ "NK_KEY_COPY", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a746f074120b9168d0e89f041d48c3a33", null ], + [ "NK_KEY_CUT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933ada1e9b53010979d9548656cf00ed1b7a", null ], + [ "NK_KEY_PASTE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a969f21dafee88b495a6902aad42b3b83", null ], + [ "NK_KEY_UP", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a3a73ba272f5585fbba524f6f3c250e9a", null ], + [ "NK_KEY_DOWN", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933acc515075eedc2a6f115945b729451257", null ], + [ "NK_KEY_LEFT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a0651bfaeeb4f62ae0fe4d7f945f4a1df", null ], + [ "NK_KEY_RIGHT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a865452f137d7d73d7035773b98101bff", null ], + [ "NK_KEY_TEXT_INSERT_MODE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a72442dc4b3771d24d77599dc6551b9fe", null ], + [ "NK_KEY_TEXT_REPLACE_MODE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a15f8e0ac8fbba0662d4e44fb5d1a0432", null ], + [ "NK_KEY_TEXT_RESET_MODE", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a53eb22dadc361f36b565cef0ef11b794", null ], + [ "NK_KEY_TEXT_LINE_START", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a6970c44b6f67b9b6e35a7cc62fbbb766", null ], + [ "NK_KEY_TEXT_LINE_END", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a9f282ee36d2b8a9d615c29b20b15f641", null ], + [ "NK_KEY_TEXT_START", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933af0b7bb2341355d6ba073b9dc0c991196", null ], + [ "NK_KEY_TEXT_END", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a3d502901f4276ff4c69a19a46887d14a", null ], + [ "NK_KEY_TEXT_UNDO", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a45bca51196fd956360d0cb65bce2e4c3", null ], + [ "NK_KEY_TEXT_REDO", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a366c0b208d846d4abdb525b8fab0a9a2", null ], + [ "NK_KEY_TEXT_SELECT_ALL", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a09369dae576f438cf1caf97e00250692", null ], + [ "NK_KEY_TEXT_WORD_LEFT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a11895d831c5c06fe195fba32c98f7c9b", null ], + [ "NK_KEY_TEXT_WORD_RIGHT", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933ab8f204f5d241b3069c90308cfff0fa95", null ], + [ "NK_KEY_SCROLL_START", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933aea078409500ea7e356ee9000e261ba8c", null ], + [ "NK_KEY_SCROLL_END", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a61ca74c04e0b6faa6aceb28b9441c655", null ], + [ "NK_KEY_SCROLL_DOWN", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933acb67fb261446c0115a7e0c73f5a2e8b2", null ], + [ "NK_KEY_SCROLL_UP", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a748153b3a52dfed936fa006aec05352c", null ], + [ "NK_KEY_MAX", "nuklear_8h.html#a167b9acb4687d274e2553658a4a70933a6375e27bbfaa7223347a27dc18be51d3", null ] + ] ], + [ "nk_layout_format", "nuklear_8h.html#ae422966b8d24f5c93821b10c3d6b6fed", [ + [ "NK_DYNAMIC", "nuklear_8h.html#ae422966b8d24f5c93821b10c3d6b6feda227ad6e8423013cffbc1c0f914f17b31", null ], + [ "NK_STATIC", "nuklear_8h.html#ae422966b8d24f5c93821b10c3d6b6feda7c62b7d29becc07b765d6ba95f3e1fdb", null ] + ] ], + [ "nk_modify", "nuklear_8h.html#a5f5cee8b5ae8f16ce8ed0739701d545b", [ + [ "NK_FIXED", "nuklear_8h.html#a5f5cee8b5ae8f16ce8ed0739701d545ba76a46f9337ad3dca6a1f520ee3a9528c", null ], + [ "NK_MODIFIABLE", "nuklear_8h.html#a5f5cee8b5ae8f16ce8ed0739701d545ba9b01d44d9702cd7cee2575fb7d1e955e", null ] + ] ], + [ "nk_orientation", "nuklear_8h.html#aef228607f7fae25b13c062f993f14dc0", [ + [ "NK_VERTICAL", "nuklear_8h.html#aef228607f7fae25b13c062f993f14dc0a46d7200635006f3e49325e9378c83bc3", null ], + [ "NK_HORIZONTAL", "nuklear_8h.html#aef228607f7fae25b13c062f993f14dc0a7a05bd35cbf6d92bfeb8214371d37dc8", null ] + ] ], + [ "nk_panel_flags", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23", [ + [ "NK_WINDOW_BORDER", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a6d678de1a6818c34de7d1483cff699cb", null ], + [ "NK_WINDOW_MOVABLE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a32265a72e0420a23696610536a904aba", null ], + [ "NK_WINDOW_SCALABLE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a16f2c73fdc851ef1c4a7dd0055ef2134", null ], + [ "NK_WINDOW_CLOSABLE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a6ba2fd6e79aa10a976910b32a026c424", null ], + [ "NK_WINDOW_MINIMIZABLE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a4014cec7ff9405d3674d4ee5dfe2a32c", null ], + [ "NK_WINDOW_NO_SCROLLBAR", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23ada9398dfcd775901185ff33897d9f02d", null ], + [ "NK_WINDOW_TITLE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a0fe32a5f60de95463729029610eb46ca", null ], + [ "NK_WINDOW_SCROLL_AUTO_HIDE", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23af98d05ad6daa03f5422ec790534cb803", null ], + [ "NK_WINDOW_BACKGROUND", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23aca020dc01b5b74631c21cef7e08e1bf6", null ], + [ "NK_WINDOW_SCALE_LEFT", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23a2edbab4086123841649f40f144afe3f1", null ], + [ "NK_WINDOW_NO_INPUT", "nuklear_8h.html#ad6cf7578e17f3b2e7f45847d3e011a23acd708b60717c15760ab5492f3f341ebf", null ] + ] ], + [ "nk_panel_row_layout_type", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476", [ + [ "NK_LAYOUT_DYNAMIC_FIXED", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476abc75fbf38e512b6eab013a0aa3a64022", null ], + [ "NK_LAYOUT_DYNAMIC_ROW", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476a7821a5aefea932c31debdd1cfa21a834", null ], + [ "NK_LAYOUT_DYNAMIC_FREE", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476aea403d8a039298e44d63f50807b5157a", null ], + [ "NK_LAYOUT_DYNAMIC", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476a4722651c9ae5dc8465062804d68b1723", null ], + [ "NK_LAYOUT_STATIC_FIXED", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476affe4d7e46404e98e787d8e59f97321c2", null ], + [ "NK_LAYOUT_STATIC_ROW", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476aa195a710bef51a99656f067eabf461a7", null ], + [ "NK_LAYOUT_STATIC_FREE", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476abb29019b3ce94ae8f9e23de5758b8ca8", null ], + [ "NK_LAYOUT_STATIC", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476aaaa58ca16a6a17b6cbbae19def3901f4", null ], + [ "NK_LAYOUT_TEMPLATE", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476aca89dac67742734d031c29563b7fe63f", null ], + [ "NK_LAYOUT_COUNT", "nuklear_8h.html#a1bf6dfb8e793214e8bda8282721e2476a61f1f200aeb16f06442cf504e1737865", null ] + ] ], + [ "nk_panel_set", "nuklear_8h.html#aea8cf647e5a370a618a9ac7a4d80411a", [ + [ "NK_PANEL_SET_NONBLOCK", "nuklear_8h.html#aea8cf647e5a370a618a9ac7a4d80411aa24d3ce4d51b5fbe4f73c384760b5a991", null ], + [ "NK_PANEL_SET_POPUP", "nuklear_8h.html#aea8cf647e5a370a618a9ac7a4d80411aa00bb576354b8a334448a235bc84b459e", null ], + [ "NK_PANEL_SET_SUB", "nuklear_8h.html#aea8cf647e5a370a618a9ac7a4d80411aaa68d008dea244b55170c6b0f9d968ce4", null ] + ] ], + [ "nk_panel_type", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99", [ + [ "NK_PANEL_NONE", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99a22542f714c0f8d2217bb57bbb3aba918", null ], + [ "NK_PANEL_WINDOW", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99a2fccadc0d5855179d7012c00c004f2d2", null ], + [ "NK_PANEL_GROUP", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99aa0dd5a92cfeac9765a6537f3c1770a7b", null ], + [ "NK_PANEL_POPUP", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99a819e528bbfc558fd381dcef1bcfddae6", null ], + [ "NK_PANEL_CONTEXTUAL", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99a9797fda466976bffb80e0645130b3c5a", null ], + [ "NK_PANEL_COMBO", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99ab2f343813be7b425348d23b6fe204002", null ], + [ "NK_PANEL_MENU", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99ad9933f9b24c8eb3031712db5ab965d8e", null ], + [ "NK_PANEL_TOOLTIP", "nuklear_8h.html#ae2eaaeccb136c68814c17bbc71496b99aab6b08a044d32bd38bcaa2a9702d30ee", null ] + ] ], + [ "nk_popup_type", "nuklear_8h.html#ac5627e02531959e5f533a335ec329aec", [ + [ "NK_POPUP_STATIC", "nuklear_8h.html#ac5627e02531959e5f533a335ec329aecae7f60ddc0373fc780a23f1237275ecb9", null ], + [ "NK_POPUP_DYNAMIC", "nuklear_8h.html#ac5627e02531959e5f533a335ec329aecac39fbe570a2eccb66aad2b6973a21703", null ] + ] ], + [ "nk_show_states", "nuklear_8h.html#a3d0a7a873a771b7e053c4cf4496a88bb", [ + [ "NK_HIDDEN", "nuklear_8h.html#a3d0a7a873a771b7e053c4cf4496a88bba2e6a31f3879c280612b783582d179ff4", null ], + [ "NK_SHOWN", "nuklear_8h.html#a3d0a7a873a771b7e053c4cf4496a88bba65924613130127b23f144c42f476ddb7", null ] + ] ], + [ "nk_style_colors", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161", [ + [ "NK_COLOR_TEXT", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a2f36d3eba001c675f5b7eb94e44ff2d4", null ], + [ "NK_COLOR_WINDOW", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ad221c1b39833c89a4c37a3da1f73f785", null ], + [ "NK_COLOR_HEADER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a0b192021081d0a4f8a5ef329e19f36d6", null ], + [ "NK_COLOR_BORDER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ae42f0ba7d97c60c452cdc7093b9eee27", null ], + [ "NK_COLOR_BUTTON", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a5b22b341a14d6a0324605b471d20969d", null ], + [ "NK_COLOR_BUTTON_HOVER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ab173308b206984899aa02dce61f44e9d", null ], + [ "NK_COLOR_BUTTON_ACTIVE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a2fb5f94cbcd096c249e3a0e3acf9ea70", null ], + [ "NK_COLOR_TOGGLE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ae5d2435d19423ee4fb20ed8faa51a1ad", null ], + [ "NK_COLOR_TOGGLE_HOVER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161abcae36ea068105b31175734933dcaeb8", null ], + [ "NK_COLOR_TOGGLE_CURSOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a441a45eea762c656de3ee7d6e0a61b5d", null ], + [ "NK_COLOR_SELECT", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a3b1ee79c9586e82eaf1b46c6051d4899", null ], + [ "NK_COLOR_SELECT_ACTIVE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a286e03a30ad696ff64640bdc8cc3711b", null ], + [ "NK_COLOR_SLIDER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a8529b9faa9e450f34141867229a8a719", null ], + [ "NK_COLOR_SLIDER_CURSOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161af2d4858292e66e455b25d3b248995e8f", null ], + [ "NK_COLOR_SLIDER_CURSOR_HOVER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a6279261029666155973a862f4be0fe79", null ], + [ "NK_COLOR_SLIDER_CURSOR_ACTIVE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a1ae7bf41e5166b517592fd840c434d8b", null ], + [ "NK_COLOR_PROPERTY", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161afa44feac74b1234d75f984425423b544", null ], + [ "NK_COLOR_EDIT", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a87b7f15c7cb236055c2a7e69d2945a0f", null ], + [ "NK_COLOR_EDIT_CURSOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a20bcaf87295c5e5fa44bb9fc9c83b2ac", null ], + [ "NK_COLOR_COMBO", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ad9c5066d520f604ad34c349d3567ab90", null ], + [ "NK_COLOR_CHART", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a0ceeefbfbc06204127a7b4be4dcd484c", null ], + [ "NK_COLOR_CHART_COLOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a6376776df957c4c26a0007d3f0dd18bb", null ], + [ "NK_COLOR_CHART_COLOR_HIGHLIGHT", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a632224b447ca31e63db05826e4ad46ee", null ], + [ "NK_COLOR_SCROLLBAR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a790d2f6f723d69d23c6a7cc62ddc322d", null ], + [ "NK_COLOR_SCROLLBAR_CURSOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a5b1cdb5e6b1f9c849df4632d73d62379", null ], + [ "NK_COLOR_SCROLLBAR_CURSOR_HOVER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161ad0e0ad8e654bd5c0cfbab8b966bad468", null ], + [ "NK_COLOR_SCROLLBAR_CURSOR_ACTIVE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a1694ec892c6b2345dba85abaa874e727", null ], + [ "NK_COLOR_TAB_HEADER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161aea2bcf29a559080b503f4eccf9d88d24", null ], + [ "NK_COLOR_KNOB", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161af86a2ed10b348de8cc5c33c434e6bc5f", null ], + [ "NK_COLOR_KNOB_CURSOR", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161af993691b6b9afb2a4db60c94baa74121", null ], + [ "NK_COLOR_KNOB_CURSOR_HOVER", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a26a0a89515638e716fae7c7aa53db225", null ], + [ "NK_COLOR_KNOB_CURSOR_ACTIVE", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161a90cd7753314bc7769f2059245301589d", null ], + [ "NK_COLOR_COUNT", "nuklear_8h.html#a7cdf9f502e402b2d60e42c0fdcf0c161aae5c4487d2fe4af0767d81a210f8e6ef", null ] + ] ], + [ "nk_style_cursor", "nuklear_8h.html#ac83d70db962be55fde890e491d190213", [ + [ "NK_CURSOR_ARROW", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a89dbd37c4540e666b7269c949c11f04e", null ], + [ "NK_CURSOR_TEXT", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a36fd76a6ebe3b0c55c12dd4026290762", null ], + [ "NK_CURSOR_MOVE", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a481b359797e109ca901b29643811ec8a", null ], + [ "NK_CURSOR_RESIZE_VERTICAL", "nuklear_8h.html#ac83d70db962be55fde890e491d190213abb96952ba9c43e9a39e780bb995b3f59", null ], + [ "NK_CURSOR_RESIZE_HORIZONTAL", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a6c7a00e59659e52a1e357a413d41b8de", null ], + [ "NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a5f7963620fc8ea2d04441e910200be8a", null ], + [ "NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a4fab99e73ceae9e7b8f11b2d0ec9fd00", null ], + [ "NK_CURSOR_COUNT", "nuklear_8h.html#ac83d70db962be55fde890e491d190213a87299462a55125531df5f9aa8c99fadf", null ] + ] ], + [ "nk_style_header_align", "nuklear_8h.html#ae05e44870132244e24e5f5139f74186e", [ + [ "NK_HEADER_LEFT", "nuklear_8h.html#ae05e44870132244e24e5f5139f74186eaf660d10a5a418309d3788a5f0584ef7a", null ], + [ "NK_HEADER_RIGHT", "nuklear_8h.html#ae05e44870132244e24e5f5139f74186ea2ce35e075d3d2ab86c05ab168b6ae74a", null ] + ] ], + [ "nk_style_item_type", "nuklear_8h.html#a3674d18d76a677a8315f60351fad473c", [ + [ "NK_STYLE_ITEM_COLOR", "nuklear_8h.html#a3674d18d76a677a8315f60351fad473cae42a515ace4e1d4f945bdd3075766ba8", null ], + [ "NK_STYLE_ITEM_IMAGE", "nuklear_8h.html#a3674d18d76a677a8315f60351fad473cae34b2ee0e98db35ab72572d6a6630cc9", null ], + [ "NK_STYLE_ITEM_NINE_SLICE", "nuklear_8h.html#a3674d18d76a677a8315f60351fad473cac390a695739679329aacd7148b25da4c", null ] + ] ], + [ "nk_symbol_type", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07", [ + [ "NK_SYMBOL_NONE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a40c84b7960913c339d4247d1faf913d1", null ], + [ "NK_SYMBOL_X", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a11d59de4598648de8e814cbb3dbab964", null ], + [ "NK_SYMBOL_UNDERSCORE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a52b195c420c8fd28e2a9880a7eb8ee03", null ], + [ "NK_SYMBOL_CIRCLE_SOLID", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a51c45e0a90fe59ecaebf6029b524c357", null ], + [ "NK_SYMBOL_CIRCLE_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a54b0520a3511078556846a0852219cb2", null ], + [ "NK_SYMBOL_RECT_SOLID", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a8aa3f954b7643a7c7db28fd9ccaed87c", null ], + [ "NK_SYMBOL_RECT_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a63686ab1692815bc6f3e4a968f456a64", null ], + [ "NK_SYMBOL_TRIANGLE_UP", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a3df2cb135f4a6d6d2009f00c2066df7f", null ], + [ "NK_SYMBOL_TRIANGLE_DOWN", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a5df1821644f6c76d699b0b0a1eb56ba8", null ], + [ "NK_SYMBOL_TRIANGLE_LEFT", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a481aa43e24735690c725852a0848f4a5", null ], + [ "NK_SYMBOL_TRIANGLE_RIGHT", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07aa6cea800a8202fc26e39dcc716b63873", null ], + [ "NK_SYMBOL_PLUS", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07afed98324dd220757ff29da9984451752", null ], + [ "NK_SYMBOL_MINUS", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a7968748b0dcb896873b559c17780bc09", null ], + [ "NK_SYMBOL_TRIANGLE_UP_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a0f7d3d73b435f2935cf61455ba934c0b", null ], + [ "NK_SYMBOL_TRIANGLE_DOWN_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07ad031738bcb7b04d4238f2bb819728412", null ], + [ "NK_SYMBOL_TRIANGLE_LEFT_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07ac84f842cf9823219b6146aefd3381091", null ], + [ "NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a4da471175b1ec60b2d768335adbf2b6a", null ], + [ "NK_SYMBOL_MAX", "nuklear_8h.html#a29b4aaa400d0ce28aea3c8c9c372ac07a087c57fa8ab96401955dc30c77b90fe5", null ] + ] ], + [ "nk_text_align", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549b", [ + [ "NK_TEXT_ALIGN_LEFT", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549baf3ff4b63d6e35b624bd87a04e896d770", null ], + [ "NK_TEXT_ALIGN_CENTERED", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549ba77a36ff71bfa8630c598de89fa261d7b", null ], + [ "NK_TEXT_ALIGN_RIGHT", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549ba9ed50c4c7c649cc1bf39a4fc41272a8a", null ], + [ "NK_TEXT_ALIGN_TOP", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549baaf2e5fcd6ef41f5141d6151f6fb6708e", null ], + [ "NK_TEXT_ALIGN_MIDDLE", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549ba494a17dc7b36c4528a6dc4ef1cbb549a", null ], + [ "NK_TEXT_ALIGN_BOTTOM", "nuklear_8h.html#a999a7efc02dbdbfda518e7b545f2549ba190f6ea5a7653cda223e3dd3c5a9f380", null ] + ] ], + [ "nk_text_alignment", "nuklear_8h.html#a70a1cc2d1b1a6cca965d6327eac77fa1", [ + [ "NK_TEXT_LEFT", "nuklear_8h.html#a70a1cc2d1b1a6cca965d6327eac77fa1ad797cd5b70bd19e4d8581802b84d5dae", null ], + [ "NK_TEXT_CENTERED", "nuklear_8h.html#a70a1cc2d1b1a6cca965d6327eac77fa1a18e7e9b732626f052fc4b60f2eb0ad54", null ], + [ "NK_TEXT_RIGHT", "nuklear_8h.html#a70a1cc2d1b1a6cca965d6327eac77fa1aac15c829df62dbc6f36b2b267a26011d", null ] + ] ], + [ "nk_text_edit_mode", "nuklear_8h.html#aa389401ff66da17b0344b4154c880712", [ + [ "NK_TEXT_EDIT_MODE_VIEW", "nuklear_8h.html#aa389401ff66da17b0344b4154c880712a10c86f8a564b2743e910276db1e98fb1", null ], + [ "NK_TEXT_EDIT_MODE_INSERT", "nuklear_8h.html#aa389401ff66da17b0344b4154c880712af670d5dba24cb33cf704ed2105353d6c", null ], + [ "NK_TEXT_EDIT_MODE_REPLACE", "nuklear_8h.html#aa389401ff66da17b0344b4154c880712a9acb57fbc1dfcb64cbd6f4f6c40e363e", null ] + ] ], + [ "nk_text_edit_type", "nuklear_8h.html#a3fbf10b15017199ec106cba3279d6ef3", [ + [ "NK_TEXT_EDIT_SINGLE_LINE", "nuklear_8h.html#a3fbf10b15017199ec106cba3279d6ef3a5724b546fcd4798cdfbaa5c67be85fa1", null ], + [ "NK_TEXT_EDIT_MULTI_LINE", "nuklear_8h.html#a3fbf10b15017199ec106cba3279d6ef3af801fed083deb3766108ad0e164f8e72", null ] + ] ], + [ "nk_tree_type", "nuklear_8h.html#a62e1e9d7fe274eb72e36046fe4845def", [ + [ "NK_TREE_NODE", "nuklear_8h.html#a62e1e9d7fe274eb72e36046fe4845defa3b415eae29fed5cf771ea487d7fb98a0", null ], + [ "NK_TREE_TAB", "nuklear_8h.html#a62e1e9d7fe274eb72e36046fe4845defa3f7d8892e00401ef14cc38bd6ecaaf70", null ] + ] ], + [ "nk_widget_align", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41", [ + [ "NK_WIDGET_ALIGN_LEFT", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41a879fab516258fb44875915220e2037ad", null ], + [ "NK_WIDGET_ALIGN_CENTERED", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41a446f6e91e65829cbebf3dbe1dc223ac1", null ], + [ "NK_WIDGET_ALIGN_RIGHT", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41a3472bea4c30af0349709410b2dfd1e2e", null ], + [ "NK_WIDGET_ALIGN_TOP", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41ac31cbfc3040db37dc0bc6ad59a8a6b64", null ], + [ "NK_WIDGET_ALIGN_MIDDLE", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41a14789f9ec8ea60a7c92882300d4a474a", null ], + [ "NK_WIDGET_ALIGN_BOTTOM", "nuklear_8h.html#abaaad4bbf5dea37cba6c8c9558823e41ac8b1a1a8c824bd671f8188e91c92d48b", null ] + ] ], + [ "nk_widget_alignment", "nuklear_8h.html#a87c7c88544c6ae4560d77d08868ccc8e", [ + [ "NK_WIDGET_LEFT", "nuklear_8h.html#a87c7c88544c6ae4560d77d08868ccc8eab41609401a6f887affd539d1e3dc2087", null ], + [ "NK_WIDGET_CENTERED", "nuklear_8h.html#a87c7c88544c6ae4560d77d08868ccc8ea39cafb88f0023639e8f0046a7103c7eb", null ], + [ "NK_WIDGET_RIGHT", "nuklear_8h.html#a87c7c88544c6ae4560d77d08868ccc8ea060a4f94aab917fff6a35e71cbabdf2d", null ] + ] ], + [ "nk_widget_layout_states", "nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1", [ + [ "NK_WIDGET_INVALID", "nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1ad5f813542df282f73abddd1f7bdda45c", null ], + [ "NK_WIDGET_VALID", "nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a7f6fe5dc8fe1861be8501688439fc6a5", null ], + [ "NK_WIDGET_ROM", "nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a557df3c02dd4ccb5463d5c416791f8b1", null ], + [ "NK_WIDGET_DISABLED", "nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a41d0b2a9298cdfbc00b7edfd8e4d2b80", null ] + ] ], + [ "nk_widget_states", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943ec", [ + [ "NK_WIDGET_STATE_MODIFIED", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca072ac66c9dd1b9cd1c8ccd46da5941aa", null ], + [ "NK_WIDGET_STATE_INACTIVE", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecadfc39d6da18e7af7ccb810e48be426d4", null ], + [ "NK_WIDGET_STATE_ENTERED", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca65255dbe033baa60268dc401e4648be4", null ], + [ "NK_WIDGET_STATE_HOVER", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca87f536ff0af612d2ac85e586780208f9", null ], + [ "NK_WIDGET_STATE_ACTIVED", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca50500d1a5679bdcea512b954f2166861", null ], + [ "NK_WIDGET_STATE_LEFT", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca2fb9071f1785d3bd24e5b2d3c54fadc6", null ], + [ "NK_WIDGET_STATE_HOVERED", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecacce4016e3b9a1f21434caa9180d3e71a", null ], + [ "NK_WIDGET_STATE_ACTIVE", "nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecac98cceb386b40c1fd53c0e3767981d72", null ] + ] ], + [ "nk_window_flags", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcb", [ + [ "NK_WINDOW_PRIVATE", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba0031c084693a77de6b8e665e78eb55ca", null ], + [ "NK_WINDOW_DYNAMIC", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaab90ee2238b18042d986c5c2021d44e8", null ], + [ "NK_WINDOW_ROM", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba8aef178528a755ee12bd36d5a4e41837", null ], + [ "NK_WINDOW_NOT_INTERACTIVE", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba9c4699c1a5cd1c98ef0ce61a735a222b", null ], + [ "NK_WINDOW_HIDDEN", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba81992755e35fb91f927d8bd2713dc863", null ], + [ "NK_WINDOW_CLOSED", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba3be8a8e7e04ad6ab437896166ebcbc4f", null ], + [ "NK_WINDOW_MINIMIZED", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba47f192dacded1a121d2cc1310b6e8744", null ], + [ "NK_WINDOW_REMOVE_ROM", "nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaf208ef2afefe375192c16346807ffdbc", null ] + ] ], + [ "nk__begin", "nuklear_8h.html#a842e2f7d16d53f2625c3e41fecb79fa6", null ], + [ "nk__next", "nuklear_8h.html#add3ee7ed9a05770277443ccd001c1031", null ], + [ "nk_begin", "nuklear_8h.html#aafe58ef289cad9c8cd7f5419fabe7cdd", null ], + [ "nk_begin_titled", "nuklear_8h.html#aabf02f938d9da8ac02cd0b972f2e0260", null ], + [ "nk_buffer_clear", "nuklear_8h.html#ae41c81197cb280e39c2fe1f93a7dabbf", null ], + [ "nk_buffer_free", "nuklear_8h.html#a76918331ebca046f20ded27001aa05e0", null ], + [ "nk_buffer_info", "nuklear_8h.html#a23a59c9f8c7f43a24e8fa266ae0258fa", null ], + [ "nk_buffer_init", "nuklear_8h.html#a7bb47c1db075efcf2ec0fb228806be42", null ], + [ "nk_buffer_init_fixed", "nuklear_8h.html#a819d8cae45cc556d98f925bb7b392a2c", null ], + [ "nk_buffer_mark", "nuklear_8h.html#a0db65c583a472981860bdb7d619fa070", null ], + [ "nk_buffer_memory", "nuklear_8h.html#a36eb4f43d429d2122529b0c02a363205", null ], + [ "nk_buffer_memory_const", "nuklear_8h.html#add9321bcbebcf1e7c84b39e67fe3f5da", null ], + [ "nk_buffer_push", "nuklear_8h.html#a46c3cee419a806839aa8e1e4f1b0aa50", null ], + [ "nk_buffer_reset", "nuklear_8h.html#a7d8b3cb1fd3e1ee115e7dfaaa9828262", null ], + [ "nk_buffer_total", "nuklear_8h.html#a5825fdf3e612ea67e65eea0877363c94", null ], + [ "nk_button_color", "nuklear_8h.html#a7e8b35ea496e6b7de637152f1c171826", null ], + [ "nk_button_image", "nuklear_8h.html#ad7f02cc8940a827d1bf089b3404ab70a", null ], + [ "nk_button_image_label", "nuklear_8h.html#a4e4cbb1e4c8f8c3e63a337582c067116", null ], + [ "nk_button_image_label_styled", "nuklear_8h.html#a3a0c15ee0fd6abd9631d5e1521940518", null ], + [ "nk_button_image_styled", "nuklear_8h.html#a32d49b67f4de4eadc3e55b7468ebca84", null ], + [ "nk_button_image_text", "nuklear_8h.html#adfa9e510f5730715592f40317cfae969", null ], + [ "nk_button_image_text_styled", "nuklear_8h.html#af42ba2b5928558ff23f4e6ad905a6a81", null ], + [ "nk_button_label", "nuklear_8h.html#a93726b0eade6a7b26224490a3d817300", null ], + [ "nk_button_label_styled", "nuklear_8h.html#a27ba787cb1d086d024b40fdcf22041c9", null ], + [ "nk_button_pop_behavior", "nuklear_8h.html#a5e9e37000f7189a9c1ada69befa2e78f", null ], + [ "nk_button_push_behavior", "nuklear_8h.html#a1e4674a97bc59d6af2ce115da99c393a", null ], + [ "nk_button_set_behavior", "nuklear_8h.html#a4acac59763becc0abfafc2616e68ff59", null ], + [ "nk_button_symbol", "nuklear_8h.html#ae28e919192542ce5f7dbe91422c5f504", null ], + [ "nk_button_symbol_label", "nuklear_8h.html#a9653c86365ddd10f102838bab2fae112", null ], + [ "nk_button_symbol_label_styled", "nuklear_8h.html#a5e576d1497ea68ae57bba4b97dd80f92", null ], + [ "nk_button_symbol_styled", "nuklear_8h.html#a72f5e15ae25503923f33292117003f18", null ], + [ "nk_button_symbol_text", "nuklear_8h.html#a03d790060aa59fe7728a509e92228005", null ], + [ "nk_button_symbol_text_styled", "nuklear_8h.html#a0840b7147641563ee4560e50f31121fc", null ], + [ "nk_button_text", "nuklear_8h.html#a241446b63863d08e92cf1f95cf3e3b0d", null ], + [ "nk_button_text_styled", "nuklear_8h.html#ad2a4eac5446fc76193070c178c6016ca", null ], + [ "nk_chart_add_slot", "nuklear_8h.html#a7a43fddfec9868abda6ecbf52685f55c", null ], + [ "nk_chart_add_slot_colored", "nuklear_8h.html#acd0992526a26b2355520c56947efd2a3", null ], + [ "nk_chart_begin", "nuklear_8h.html#a273ef5f6f075de19145b8fe5cba283a2", null ], + [ "nk_chart_begin_colored", "nuklear_8h.html#ae96371c1eac50f5f03acc7b1daef3b21", null ], + [ "nk_chart_end", "nuklear_8h.html#a2efa52bbb66a0e5c09dbcb227d669ca4", null ], + [ "nk_chart_push", "nuklear_8h.html#a42be0b2ecbdf8caf50628db189f75f28", null ], + [ "nk_chart_push_slot", "nuklear_8h.html#a98fbd96df83a0ab4b5d0db8c7bdd4a30", null ], + [ "nk_check_flags_label", "nuklear_8h.html#a9d68fd1b32ff8b0ba54ca6fd91b1e813", null ], + [ "nk_check_flags_text", "nuklear_8h.html#a1e926bad11a187321934b1b1be28056a", null ], + [ "nk_check_label", "nuklear_8h.html#a33b60968c13dd265dcef105f5408e689", null ], + [ "nk_check_text", "nuklear_8h.html#af7d4d78f7a8c6f93e72a64d6d823139f", null ], + [ "nk_check_text_align", "nuklear_8h.html#a2a49d9cc8549c296d7e73dae47928f13", null ], + [ "nk_checkbox_flags_label", "nuklear_8h.html#ad46dbf1509058659b713f91147cb45f1", null ], + [ "nk_checkbox_flags_text", "nuklear_8h.html#a61e5cf2e45090bdfe04e2cbe5098187e", null ], + [ "nk_checkbox_label", "nuklear_8h.html#a43285fa0db1466ddac3a5556dc017458", null ], + [ "nk_checkbox_label_align", "nuklear_8h.html#ae604c90a0ac9351bcc6c3e2f52587cdc", null ], + [ "nk_checkbox_text", "nuklear_8h.html#aba92a31434fa672ba58f14f8ff575366", null ], + [ "nk_checkbox_text_align", "nuklear_8h.html#acf57ccecbbc9d0ef192a65cfa4301baa", null ], + [ "nk_clear", "nuklear_8h.html#ade3301f0a92370be1b4beac7eceac279", null ], + [ "nk_color_cf", "nuklear_8h.html#a975e62862b74e683efa9f5cf003db73a", null ], + [ "nk_color_d", "nuklear_8h.html#ab5c35cfd971255bb5dba53f708288bf1", null ], + [ "nk_color_dv", "nuklear_8h.html#a1043e227c04a859285a954131298370e", null ], + [ "nk_color_f", "nuklear_8h.html#a68efed70954e554bc3f0228e9ee39d70", null ], + [ "nk_color_fv", "nuklear_8h.html#ab6a56e0295e101f5a5f9731e4ca95b7a", null ], + [ "nk_color_hex_rgb", "nuklear_8h.html#a68afcc2b91bbfe835a8aaabd54b60079", null ], + [ "nk_color_hex_rgba", "nuklear_8h.html#acfe25d03648eff50510f167c9775b5f1", null ], + [ "nk_color_hsv_b", "nuklear_8h.html#a18c8de5ae33f0a5fc698dd804c1ed4fc", null ], + [ "nk_color_hsv_bv", "nuklear_8h.html#a611c2364b7b2df02c742d112973744b6", null ], + [ "nk_color_hsv_f", "nuklear_8h.html#a19cfde0cb7dd084788edb35d0e3a6457", null ], + [ "nk_color_hsv_fv", "nuklear_8h.html#a0035b405f190e917193b27c913ce781c", null ], + [ "nk_color_hsv_i", "nuklear_8h.html#ace33b6f1d63a00180f4204aba9b38854", null ], + [ "nk_color_hsv_iv", "nuklear_8h.html#a685970ce9130230a555f5b6914c16497", null ], + [ "nk_color_hsva_b", "nuklear_8h.html#ac9fb6539c53daf89ed00d01cdb4b27c4", null ], + [ "nk_color_hsva_bv", "nuklear_8h.html#a953ed7cecb2f20bd8e952c741fca37ae", null ], + [ "nk_color_hsva_f", "nuklear_8h.html#aee4b456f6923dce64b9a1715fde06a73", null ], + [ "nk_color_hsva_fv", "nuklear_8h.html#ad150252402fb6b55daa90a10fa51be3f", null ], + [ "nk_color_hsva_i", "nuklear_8h.html#a638a14c5a9f1f73276ea38609266922f", null ], + [ "nk_color_hsva_iv", "nuklear_8h.html#ad8080466fb72ecb9603124894be790f4", null ], + [ "nk_color_pick", "nuklear_8h.html#a787d27613b18157619d0d2f6ad404686", null ], + [ "nk_color_picker", "nuklear_8h.html#aaaf371b403f0c1c62ba6c59df6bf6943", null ], + [ "nk_color_u32", "nuklear_8h.html#a0e4100c5c5dd9ffaa984ae4eb1b97149", null ], + [ "nk_colorf_hsva_f", "nuklear_8h.html#a52556eebd92d782cbc1eb86621f33ba3", null ], + [ "nk_colorf_hsva_fv", "nuklear_8h.html#ac96104c35d678707ee2ce60427e2e681", null ], + [ "nk_combo", "nuklear_8h.html#ae7c898def142ff2d476ae1a261fa009d", null ], + [ "nk_combo_begin_color", "nuklear_8h.html#aaa5cdfa960b782d4907d952e4eea7633", null ], + [ "nk_combo_begin_image", "nuklear_8h.html#a7d5ead79eae7d8c1a294dc70f646b1cd", null ], + [ "nk_combo_begin_image_label", "nuklear_8h.html#aa54ed039bbd8a3ca38a1de392dd2048f", null ], + [ "nk_combo_begin_image_text", "nuklear_8h.html#a7c1892a72a190b10b804cf158782368c", null ], + [ "nk_combo_begin_label", "nuklear_8h.html#a726c19c41eeea34a962e652b46416e53", null ], + [ "nk_combo_begin_symbol", "nuklear_8h.html#a12ec021507d675db50b04f4b54c01bdc", null ], + [ "nk_combo_begin_symbol_label", "nuklear_8h.html#aebbc3c79d0d2705aa7846cb06166c079", null ], + [ "nk_combo_begin_symbol_text", "nuklear_8h.html#a739124d3edac76028a0535d3f0e0211a", null ], + [ "nk_combo_begin_text", "nuklear_8h.html#a64e9faa7729511cc94dfb9bbe1569950", null ], + [ "nk_combo_callback", "nuklear_8h.html#ae2e4e39d043a668eb9663ddb4c8ec4f3", null ], + [ "nk_combo_close", "nuklear_8h.html#a9c5dfe1b32b88b7c4ce5d08afbd306f2", null ], + [ "nk_combo_end", "nuklear_8h.html#a7b7ff99a69e953f41d4856ea45c6c668", null ], + [ "nk_combo_item_image_label", "nuklear_8h.html#a69cb8b540b019146ed0bc162eb0964f9", null ], + [ "nk_combo_item_image_text", "nuklear_8h.html#a7d0549ab1cd3dc69c41f84bd633b26ea", null ], + [ "nk_combo_item_label", "nuklear_8h.html#aef33d9c86c5ba88792a7b6bcf64282ea", null ], + [ "nk_combo_item_symbol_label", "nuklear_8h.html#ad102ab34310aa8c5a870d0688558291b", null ], + [ "nk_combo_item_symbol_text", "nuklear_8h.html#a6616e3293b6e71e141e602d5f33f9371", null ], + [ "nk_combo_item_text", "nuklear_8h.html#a00cb988e734da500c1a161d6ac99838b", null ], + [ "nk_combo_separator", "nuklear_8h.html#a21063595c5e17abcce2f73350481adf7", null ], + [ "nk_combo_string", "nuklear_8h.html#a65fc8957f4e1ff4124f1525f504e5d4e", null ], + [ "nk_combobox", "nuklear_8h.html#a5fcca4256ccc7d8dbe5fa29fa718053d", null ], + [ "nk_combobox_callback", "nuklear_8h.html#a9bbb19e02bd798ce7a5520b74cfda128", null ], + [ "nk_combobox_separator", "nuklear_8h.html#a0dcad58b89ef18455eb1a1dace822bda", null ], + [ "nk_combobox_string", "nuklear_8h.html#a8315ccff332b2adcb729eb3dccad0746", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a6488055b5a12f5c4b5187fef473cfd9e", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a12142f67efc32948b988b8d66db0d9be", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#ac27dd4287a96b84d688e765b0a024f3a", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#ab87ec49dc086dfdaa9853a7716cd83c4", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a77667baf645a8f4a64e57f91ef95964f", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a1e563ce15b1edf28a94540fb4bcc8901", null ], + [ "NK_CONFIG_STACK", "nuklear_8h.html#a4a8700aa0c98e3bb8df6a291f70acefe", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#a70b0e638cd1b5f14afc5071d48da8b53", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#a51e161e98e30c8e2f58c63678fb766d5", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#a6e00afac7125baedc3c500fe2c449575", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#a8c10cfe996b602d6b8bd982d96779528", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#ad44f26de43b46544451ddf80b622bb0f", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#ac102621f9b54e9c5b9810f7ca97edac2", null ], + [ "NK_CONFIGURATION_STACK_TYPE", "nuklear_8h.html#ad1402d1854020ced53fa97b56f19f656", null ], + [ "nk_contextual_begin", "nuklear_8h.html#a97246f4b003ca240b47180ac58378f45", null ], + [ "nk_contextual_close", "nuklear_8h.html#a1c873df91a4f73a12c46a98eb20b7dde", null ], + [ "nk_contextual_end", "nuklear_8h.html#af5e8797acc6f53ab0c92f1bfeb8f1fff", null ], + [ "nk_contextual_item_image_label", "nuklear_8h.html#aaf66e97cc094d4a11e49d42da5781a7f", null ], + [ "nk_contextual_item_image_text", "nuklear_8h.html#af5de669f8a5a91cd0c5cfbf9a0d36bce", null ], + [ "nk_contextual_item_label", "nuklear_8h.html#a2339d04849a6e93a97f79c4e90322940", null ], + [ "nk_contextual_item_symbol_label", "nuklear_8h.html#acdda253e15b5a6f00009eaff270f3fd4", null ], + [ "nk_contextual_item_symbol_text", "nuklear_8h.html#ab46a133fd690dc82c8f0482deff28439", null ], + [ "nk_contextual_item_text", "nuklear_8h.html#a6707eda5f77fa23c7311e2f77fdfe099", null ], + [ "nk_draw_image", "nuklear_8h.html#a322678fb670fa1d061dbed321ee38d1b", null ], + [ "nk_draw_nine_slice", "nuklear_8h.html#abe707b3dca1a49bde1ecc438bb67b0ff", null ], + [ "nk_draw_text", "nuklear_8h.html#ae7e2c5bd7a1f0bc58255a56124624f13", null ], + [ "nk_edit_buffer", "nuklear_8h.html#ae6816f7cb3c5e94e8e72f5c8b2361d40", null ], + [ "nk_edit_focus", "nuklear_8h.html#a28848c36650db842f3d63c009a69080a", null ], + [ "nk_edit_string", "nuklear_8h.html#aa73614356dce792165b45b864330d3bb", null ], + [ "nk_edit_string_zero_terminated", "nuklear_8h.html#a20bb7ae7a0107032388e790e7df0a50a", null ], + [ "nk_edit_unfocus", "nuklear_8h.html#a61899849916dd24ebcd6e5b6eb05a326", null ], + [ "nk_end", "nuklear_8h.html#ae0ade48c4c8df72456b9d97ab3d195e3", null ], + [ "nk_fill_arc", "nuklear_8h.html#af1ae9cb7e039f7779a2f612006a119a7", null ], + [ "nk_fill_circle", "nuklear_8h.html#ae0cfbd590eb690b6e18403e5d3d86795", null ], + [ "nk_fill_polygon", "nuklear_8h.html#a1f960a379311c51746879f16660bfe94", null ], + [ "nk_fill_rect", "nuklear_8h.html#a63407f682d240622d8b025d7911596fb", null ], + [ "nk_fill_rect_multi_color", "nuklear_8h.html#a3b0db817feaf680c82249f8563c38358", null ], + [ "nk_fill_triangle", "nuklear_8h.html#ab2d4fcfee9d421f2f6dc28f6aeece451", null ], + [ "nk_filter_ascii", "nuklear_8h.html#a166306e12c2e8be2c22de9fdefde3df1", null ], + [ "nk_filter_binary", "nuklear_8h.html#ab38d24a69f80db8c3f3e9407d571031c", null ], + [ "nk_filter_decimal", "nuklear_8h.html#a76c9ae143882182e3ba23eb14912c741", null ], + [ "nk_filter_default", "nuklear_8h.html#a826f79e651ee0e905ca0857886d2848a", null ], + [ "nk_filter_float", "nuklear_8h.html#a807632279c444ad11141cd39eabcecac", null ], + [ "nk_filter_hex", "nuklear_8h.html#a37cc3b57ea7bfa872109624de2ae6be8", null ], + [ "nk_filter_oct", "nuklear_8h.html#ab7b09513573d8e4b8c2ee17eb5429886", null ], + [ "nk_free", "nuklear_8h.html#a06772e194320fa99524681fd32df85e9", null ], + [ "nk_get_null_rect", "nuklear_8h.html#a1328ac299d79a0db11e894296bcd3fed", null ], + [ "nk_group_begin", "nuklear_8h.html#a09a50849fef9426cf7a9ad9960b1486a", null ], + [ "nk_group_begin_titled", "nuklear_8h.html#aa8ab5670480005694241e37b188d8e06", null ], + [ "nk_group_end", "nuklear_8h.html#ae0e5210696cae430a9e9b79e1f76cee5", null ], + [ "nk_group_get_scroll", "nuklear_8h.html#a4cdbee562347fba0fae90b8250274d96", null ], + [ "nk_group_scrolled_begin", "nuklear_8h.html#af17d78936039c79f6fe91a4c70d253e2", null ], + [ "nk_group_scrolled_end", "nuklear_8h.html#a4552d30d3265ccff7c82232da3cea657", null ], + [ "nk_group_scrolled_offset_begin", "nuklear_8h.html#a6adb72deb66e2714d654c8d57bd277b5", null ], + [ "nk_group_set_scroll", "nuklear_8h.html#ab26b83016c296e5ed1f4c6dc79bd5cd1", null ], + [ "nk_handle_id", "nuklear_8h.html#a7a89274b3912560cb7c1784d533440cc", null ], + [ "nk_handle_ptr", "nuklear_8h.html#a0db995c77370c7baefcc1bfdce8ad77e", null ], + [ "nk_hsv", "nuklear_8h.html#a1d2a8a11620a18a98d11f5d94c3c0e01", null ], + [ "nk_hsv_bv", "nuklear_8h.html#a23de26fb9860c287656c59ad94533568", null ], + [ "nk_hsv_f", "nuklear_8h.html#a9a1ca7ed1c820b7ca2e4aa053a569d73", null ], + [ "nk_hsv_fv", "nuklear_8h.html#a4cb5f12d10a5e22ec90e31fa9e46592e", null ], + [ "nk_hsv_iv", "nuklear_8h.html#a13a9d0deb48d154003a3a2e1dc25c5bb", null ], + [ "nk_hsva", "nuklear_8h.html#aae2ba6e515c22956bb7630aeb416cde7", null ], + [ "nk_hsva_bv", "nuklear_8h.html#a3079f6db2642387b44e61db50bdade8c", null ], + [ "nk_hsva_colorf", "nuklear_8h.html#afeb2180a51a196009082db663c8b5a01", null ], + [ "nk_hsva_colorfv", "nuklear_8h.html#a5cfeaf29536ebc3633fe5db8afd89065", null ], + [ "nk_hsva_f", "nuklear_8h.html#a9ea3d31de946bf5276108132a08afe0f", null ], + [ "nk_hsva_fv", "nuklear_8h.html#a6dc036fc7a15d9f46037ed1ac344021f", null ], + [ "nk_hsva_iv", "nuklear_8h.html#a05fd9e28c949cdefbde33b50cb6c4559", null ], + [ "nk_image", "nuklear_8h.html#a129ae5059b4990224a2710ea0aeec845", null ], + [ "nk_image_color", "nuklear_8h.html#a94b6059f113fbe4bb910774b634bdc4d", null ], + [ "nk_image_handle", "nuklear_8h.html#a0e95d46b210b539f0cb80feb73665a98", null ], + [ "nk_image_id", "nuklear_8h.html#a879f7731e885e0081cc1413a9d40c291", null ], + [ "nk_image_is_subimage", "nuklear_8h.html#a1f8bcd2385cd0fc03a99e4b625942915", null ], + [ "nk_image_ptr", "nuklear_8h.html#a73fbb6316b266c15accf35c5acaf8c76", null ], + [ "nk_init", "nuklear_8h.html#ab5c6cdd02a560dbcbdb5bd54ed753b2c", null ], + [ "nk_init_custom", "nuklear_8h.html#a4122ba85b642a16b61268932b1fed694", null ], + [ "nk_init_fixed", "nuklear_8h.html#a27a65e767320f4d72cee9c3175153b56", null ], + [ "nk_input_any_mouse_click_in_rect", "nuklear_8h.html#af1484a300a49f584a8388f11515e0473", null ], + [ "nk_input_begin", "nuklear_8h.html#a1dd51949401094f71d10429d45779d53", null ], + [ "nk_input_button", "nuklear_8h.html#ab25cec61c5c9d134f1516f1f30f6eec6", null ], + [ "nk_input_char", "nuklear_8h.html#ab9d1ed53c659bd03c8c1c9fc2d9b212f", null ], + [ "nk_input_end", "nuklear_8h.html#a15c0d237b6bb2f5195a09e259fd7b375", null ], + [ "nk_input_glyph", "nuklear_8h.html#af1d13fdae700f9c0dcd6b683701b71ba", null ], + [ "nk_input_has_mouse_click", "nuklear_8h.html#a788e5f1063b7148a10e121dd8ae0e461", null ], + [ "nk_input_has_mouse_click_down_in_rect", "nuklear_8h.html#a9f1600e451871e1b927599a6306b2b91", null ], + [ "nk_input_has_mouse_click_in_button_rect", "nuklear_8h.html#a86f84206a982c4e8fb67164a7caa0b70", null ], + [ "nk_input_has_mouse_click_in_rect", "nuklear_8h.html#a6a5cfa828a82a4fcbf15c02b2d02c054", null ], + [ "nk_input_is_key_down", "nuklear_8h.html#aeea5fdcc063efd72502f1988ebc93310", null ], + [ "nk_input_is_key_pressed", "nuklear_8h.html#ab0136311fb19cdf02f0dd0413b4d952c", null ], + [ "nk_input_is_key_released", "nuklear_8h.html#a92b63768c6cf384f7bb7c9b4c39786b1", null ], + [ "nk_input_is_mouse_click_down_in_rect", "nuklear_8h.html#a338422a9d3e5b67367768773f01d513b", null ], + [ "nk_input_is_mouse_click_in_rect", "nuklear_8h.html#a409aa8f56ed1e2a41432b4c0547eb6d1", null ], + [ "nk_input_is_mouse_down", "nuklear_8h.html#a4c14a639d3349ead90cf4b3350427c8a", null ], + [ "nk_input_is_mouse_hovering_rect", "nuklear_8h.html#ac56c0672676b9693e853ed506d06be82", null ], + [ "nk_input_is_mouse_pressed", "nuklear_8h.html#a65fb87a68de87c8e6d501d7fecc27c77", null ], + [ "nk_input_is_mouse_prev_hovering_rect", "nuklear_8h.html#a4f699465216edbfb982aa237dc37a2f9", null ], + [ "nk_input_is_mouse_released", "nuklear_8h.html#a3e728a5d3b0b6485f0ee99c305be41ff", null ], + [ "nk_input_key", "nuklear_8h.html#a5d73e825488390b84483762d1265eb43", null ], + [ "nk_input_motion", "nuklear_8h.html#acdbdc5795b24d36875281cf3cac671fe", null ], + [ "nk_input_mouse_clicked", "nuklear_8h.html#a18a802432f2c2007017838c049d4d3d2", null ], + [ "nk_input_scroll", "nuklear_8h.html#abfc42a2f22d2f4404305ec8a82429290", null ], + [ "nk_input_unicode", "nuklear_8h.html#a576737a9d5fd115e5007f99c5c8aa4cd", null ], + [ "nk_item_is_any_active", "nuklear_8h.html#a562be2c0a03cb227be14ea82b4b517d7", null ], + [ "nk_knob_float", "nuklear_8h.html#af723d43f0d4690f5da4f1cb7f4a98f7a", null ], + [ "nk_knob_int", "nuklear_8h.html#aee53860005e2f351413fdfdbd8aad3a3", null ], + [ "nk_label", "nuklear_8h.html#a73291c38de9253ba3c7abf1fa85b6aef", null ], + [ "nk_label_colored", "nuklear_8h.html#ae09361103f463c086bb5b958160f3972", null ], + [ "nk_label_colored_wrap", "nuklear_8h.html#a47e622e214db35a67032206f6ec1c87f", null ], + [ "nk_label_wrap", "nuklear_8h.html#ae6a333ac659fec101ec368e205ffedd5", null ], + [ "nk_layout_ratio_from_pixel", "nuklear_8h.html#ab638c3eb41863167e6d63782f1b03da5", null ], + [ "nk_layout_reset_min_row_height", "nuklear_8h.html#a89484639fccf5ad9d7a3bd7a4c6f61c4", null ], + [ "nk_layout_row", "nuklear_8h.html#a2cff6f5c2a9078eb768ac753b63a5c31", null ], + [ "nk_layout_row_begin", "nuklear_8h.html#aa6fa7480529cb74d07dd28c9c26d6549", null ], + [ "nk_layout_row_dynamic", "nuklear_8h.html#a76e65dc775c0bd5efaa3c8f38f96823f", null ], + [ "nk_layout_row_end", "nuklear_8h.html#a14c7337d52877793ae04968e75f2c21f", null ], + [ "nk_layout_row_push", "nuklear_8h.html#ab6fb149f7829d6c5f7361c93f26066aa", null ], + [ "nk_layout_row_static", "nuklear_8h.html#af8176018717fa81e62969ca5830414e3", null ], + [ "nk_layout_row_template_begin", "nuklear_8h.html#ab4d9ca7699d2c14a607d743224519c09", null ], + [ "nk_layout_row_template_end", "nuklear_8h.html#a85583ce3aa0054fc050bb165fc580462", null ], + [ "nk_layout_row_template_push_dynamic", "nuklear_8h.html#a47e464949ca9a44f483d327edb99e51b", null ], + [ "nk_layout_row_template_push_static", "nuklear_8h.html#a6836529c6d66e638eee38ba3da0d4d56", null ], + [ "nk_layout_row_template_push_variable", "nuklear_8h.html#ae89deb176b082dbbf6fec568bc21a860", null ], + [ "nk_layout_set_min_row_height", "nuklear_8h.html#aa0f2bd54b2ca26744dc1d019c10824c4", null ], + [ "nk_layout_space_begin", "nuklear_8h.html#ace378fd581870e7045334ca5a7cd8f2e", null ], + [ "nk_layout_space_bounds", "nuklear_8h.html#acf7221ac37ad8e7054a89b54f0278405", null ], + [ "nk_layout_space_end", "nuklear_8h.html#a2231e266013063456f3b20f882a9831e", null ], + [ "nk_layout_space_push", "nuklear_8h.html#aafd65bb1d45bb98e147ec1d76173242e", null ], + [ "nk_layout_space_rect_to_local", "nuklear_8h.html#a936ad1078428b94f079d22f7f6691950", null ], + [ "nk_layout_space_rect_to_screen", "nuklear_8h.html#ab7ed4576104cc5d0e2d3b91094772e86", null ], + [ "nk_layout_space_to_local", "nuklear_8h.html#a4f05d86822b6809dc276645517151895", null ], + [ "nk_layout_space_to_screen", "nuklear_8h.html#a3bf8ed829f20eeee39b9fb6f734ff9ce", null ], + [ "nk_layout_widget_bounds", "nuklear_8h.html#ab781f44009d6c85898ab8484a1d09797", null ], + [ "nk_list_view_begin", "nuklear_8h.html#a9d67fe90c0cf2a86a3d206e93a2ed1e3", null ], + [ "nk_list_view_end", "nuklear_8h.html#a6b8f5891638e304993e6369143511d62", null ], + [ "nk_menu_begin_image", "nuklear_8h.html#a9c41df71f8db42e73ea069168ef3d14a", null ], + [ "nk_menu_begin_image_label", "nuklear_8h.html#adebec74138730d3458f6b5c48605cefe", null ], + [ "nk_menu_begin_image_text", "nuklear_8h.html#aa59674a4eeeb2d4de013e76d19c3754b", null ], + [ "nk_menu_begin_label", "nuklear_8h.html#a139faa61c73c798154089f44eb8f1b64", null ], + [ "nk_menu_begin_symbol", "nuklear_8h.html#a0fed07a86f47bc413960940499cc800b", null ], + [ "nk_menu_begin_symbol_label", "nuklear_8h.html#a1920a264eb25fd88b8f2167de59fec69", null ], + [ "nk_menu_begin_symbol_text", "nuklear_8h.html#a402330ce5b05b51d0caed2e5a0ddb097", null ], + [ "nk_menu_begin_text", "nuklear_8h.html#a1c37ebaaee11176ce8a22b8c4a9d8911", null ], + [ "nk_menu_close", "nuklear_8h.html#a0efd01e3d08efcd45ea67e9b57e84866", null ], + [ "nk_menu_end", "nuklear_8h.html#a1626921e2c208e0541f9dab2b1700982", null ], + [ "nk_menu_item_image_label", "nuklear_8h.html#affc80bd8479ff7e9213381c07dcd56f7", null ], + [ "nk_menu_item_image_text", "nuklear_8h.html#a6bb4bc84b61ed405f5e35f1fbcf7523b", null ], + [ "nk_menu_item_label", "nuklear_8h.html#ab60d0f47fdf2af0a16e06fc11a9e2a6c", null ], + [ "nk_menu_item_symbol_label", "nuklear_8h.html#a06451a2b3bd7e5d3ee2ecc111c890bc1", null ], + [ "nk_menu_item_symbol_text", "nuklear_8h.html#a9f1686b4d72c035d1ed50e8aa7304c78", null ], + [ "nk_menu_item_text", "nuklear_8h.html#ac43ed0abf1741aeb89abbeab503832b5", null ], + [ "nk_menubar_begin", "nuklear_8h.html#a862190c48da2bfe8b5928cc382ed6259", null ], + [ "nk_menubar_end", "nuklear_8h.html#a6ebc192523c16fe4ac2af17870277ba4", null ], + [ "nk_murmur_hash", "nuklear_8h.html#a38dbd51520d95d932cf3502bc2a02b1f", null ], + [ "nk_nine_slice_handle", "nuklear_8h.html#a6264ae687751f3fb9ac2e4ce38474dfd", null ], + [ "nk_nine_slice_id", "nuklear_8h.html#ad368f864e4f1372516ad5413fffd73d5", null ], + [ "nk_nine_slice_is_sub9slice", "nuklear_8h.html#a10f7a4384ade31f491daaf021744d147", null ], + [ "nk_nine_slice_ptr", "nuklear_8h.html#acc19746c28f9dedd8420eb2ebc322123", null ], + [ "nk_option_label", "nuklear_8h.html#a4019baad5e48984f5e55ea7e2cae913c", null ], + [ "nk_option_label_align", "nuklear_8h.html#a8ad7d2628f606ee81710719bfe22d536", null ], + [ "nk_option_text", "nuklear_8h.html#ae9771870f575b4ce242f8a12709c3a1a", null ], + [ "nk_option_text_align", "nuklear_8h.html#ade246a7eb8f58a370e8f63001c6475e2", null ], + [ "nk_plot", "nuklear_8h.html#abb28132e59f4a9308d7ef8f1527e7dda", null ], + [ "nk_plot_function", "nuklear_8h.html#a1d7d965cd95276e0ebd5522a9832d94e", null ], + [ "nk_popup_begin", "nuklear_8h.html#ad0fd0c54761e0e3dfb651f76021f4bb0", null ], + [ "nk_popup_close", "nuklear_8h.html#a41e7fc64da20965326d0df437c551614", null ], + [ "nk_popup_end", "nuklear_8h.html#a25e6ba55c04c4cf982d5bc5e59fc68d1", null ], + [ "nk_popup_get_scroll", "nuklear_8h.html#a78602b0e1f91e1313237c6162ecc64e9", null ], + [ "nk_popup_set_scroll", "nuklear_8h.html#a1a1826b80e6ab43f3ca4cff8fbec6d97", null ], + [ "nk_prog", "nuklear_8h.html#a0184f8286d3a022ba7e62654d2a5f4e7", null ], + [ "nk_progress", "nuklear_8h.html#a579c75aabb35c05424c877d0e2dc7404", null ], + [ "nk_property_double", "nuklear_8h.html#a6078e0bd051eadbaab18f5acea38e516", null ], + [ "nk_property_float", "nuklear_8h.html#a2ad0b76d6b0b29ba37ca1777953d4f89", null ], + [ "nk_property_int", "nuklear_8h.html#a0af81623df7daa4f5f3eccb75beb2b26", null ], + [ "nk_propertyd", "nuklear_8h.html#ac5840ee35a5f6fcb30a086cf72afd991", null ], + [ "nk_propertyf", "nuklear_8h.html#a2030121357983cfabd73fadb997dbf04", null ], + [ "nk_propertyi", "nuklear_8h.html#af079769a8700d947492b8b08977eeca2", null ], + [ "nk_push_custom", "nuklear_8h.html#a995356c4ab32b29a089061e029899625", null ], + [ "nk_push_scissor", "nuklear_8h.html#aa209fbe9aa3cf9a77c76b6352ae5762a", null ], + [ "nk_radio_label", "nuklear_8h.html#a75af0e7e2d7244a1278463180d70482a", null ], + [ "nk_radio_label_align", "nuklear_8h.html#aeb6c2d22336e66bc64d5b09acba45713", null ], + [ "nk_radio_text", "nuklear_8h.html#a9d0b1fd1ad925204274c1e80ec1bdc1b", null ], + [ "nk_radio_text_align", "nuklear_8h.html#a5ecc7c3c4a70df1fbd6b310d83d601bf", null ], + [ "nk_rect", "nuklear_8h.html#aedba0cd2ec170c1f95f3396953982bc1", null ], + [ "nk_rect_pos", "nuklear_8h.html#a1fb750b2453769a4d7148affaeca03a4", null ], + [ "nk_rect_size", "nuklear_8h.html#ab3d2e89c4df50366d57cae6643d42f4b", null ], + [ "nk_recta", "nuklear_8h.html#a719d14af657abbf56ba9f361ea9be393", null ], + [ "nk_recti", "nuklear_8h.html#a71e022707f88468450eaa4167136d7be", null ], + [ "nk_rectiv", "nuklear_8h.html#a6c6d2aeb6b6028cf967b546e8c2c9577", null ], + [ "nk_rectv", "nuklear_8h.html#abb70e8cc94ec8aeb7a5433783a7b710a", null ], + [ "nk_rgb", "nuklear_8h.html#a0624ae1d6500b0a2941274f1a99d144d", null ], + [ "nk_rgb_bv", "nuklear_8h.html#a2cd7a6e22864639d1fcdfafc7eaa15d4", null ], + [ "nk_rgb_cf", "nuklear_8h.html#a33e4fee67ffafbb8914865af2bba647d", null ], + [ "nk_rgb_f", "nuklear_8h.html#a35b5f63980ba256bcf7cc1b920f82592", null ], + [ "nk_rgb_factor", "nuklear_8h.html#a4c47530bd93f266a36e910cdbd5dce65", null ], + [ "nk_rgb_fv", "nuklear_8h.html#a25e21fa9f1bc1f525bbacf8a307df980", null ], + [ "nk_rgb_hex", "nuklear_8h.html#a26a946787416afc3cadd710e91011a59", null ], + [ "nk_rgb_iv", "nuklear_8h.html#ac4d34bec4ba0395b2a7bd7155aa5fb86", null ], + [ "nk_rgba", "nuklear_8h.html#aee4378e8b9ef0ef3cef4c1346d7f3aae", null ], + [ "nk_rgba_bv", "nuklear_8h.html#a8d04ddba6467910774e0f943b5f44890", null ], + [ "nk_rgba_cf", "nuklear_8h.html#ad3c340ca519475afffe345355e84946d", null ], + [ "nk_rgba_f", "nuklear_8h.html#a033c313d691c2d9675679c7aa204aa9f", null ], + [ "nk_rgba_fv", "nuklear_8h.html#af932ecac27831b542d14620aa6bcfd70", null ], + [ "nk_rgba_hex", "nuklear_8h.html#a189a77bf108c81811bc2d62ff6bf4d36", null ], + [ "nk_rgba_iv", "nuklear_8h.html#a2cf5bf56601145c066b0d318e1f06689", null ], + [ "nk_rgba_u32", "nuklear_8h.html#ab1a7fb55f9c0884f51d4d6ee1ec3a4e9", null ], + [ "nk_rule_horizontal", "nuklear_8h.html#a21f6b2b4f799375a50b7382be96d397f", null ], + [ "nk_select_image_label", "nuklear_8h.html#a0eb8f2805087435fee7d922c704a99ac", null ], + [ "nk_select_image_text", "nuklear_8h.html#ae321ae5f69e1b9ce65514f7f8f9d12ee", null ], + [ "nk_select_label", "nuklear_8h.html#a6394d1055abf21e5b89c64ea0c8bbf7d", null ], + [ "nk_select_symbol_label", "nuklear_8h.html#a2d14dab9591043e6652f41f7e3239267", null ], + [ "nk_select_symbol_text", "nuklear_8h.html#aed39496fbab80298283b299e37e7b3b2", null ], + [ "nk_select_text", "nuklear_8h.html#aeb12049c7f19b09f9b29a2b0417dfbce", null ], + [ "nk_selectable_image_label", "nuklear_8h.html#a58f2706bfae7ee6ab9a2e19de51010b1", null ], + [ "nk_selectable_image_text", "nuklear_8h.html#a54c0cbf2829c2a613fc6c5b7c40f8fa0", null ], + [ "nk_selectable_label", "nuklear_8h.html#aa1a52f70129fe8ddd01e187eb3f40f88", null ], + [ "nk_selectable_symbol_label", "nuklear_8h.html#a444c13c748d575ffe88d0bd15428d451", null ], + [ "nk_selectable_symbol_text", "nuklear_8h.html#a9d080c39c35a3cbb330ccd3350a8d04a", null ], + [ "nk_selectable_text", "nuklear_8h.html#a8cb591346008b176d3a2880a7d7c58d9", null ], + [ "nk_slide_float", "nuklear_8h.html#a6431e096f95838b2d3a39ac169b3eb23", null ], + [ "nk_slide_int", "nuklear_8h.html#a13a947d9d1b4955ff48d9eebcb8ae24d", null ], + [ "nk_slider_float", "nuklear_8h.html#ab2e9352aa7b3354e8b46a81188661516", null ], + [ "nk_slider_int", "nuklear_8h.html#afa5f71af6c9d2848d0b8d28143b878e7", null ], + [ "nk_spacer", "nuklear_8h.html#a197cb17338c3c973765558f0ddeb9fc0", null ], + [ "nk_spacing", "nuklear_8h.html#a700cbd24d7c654b1ea5b6c5b9a5f18a4", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#ad5cca181a71fc01b55052d8dbf9e906f", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#aa1c42d0da307b485c03c1acaf3b1e409", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#aae7b05f3cf18360e381ee1843dc3467f", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a3fb1867d0d2e58f0f0ef1d80e98e935e", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#ab1f48f040dbbeea6a6d17a36d9717423", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a49e166590e90da8c114b03c7c8dc978c", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a3f2a3997ca2bab93154ae3decddb4a3b", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a76803e81e7819bce85c5d77490ed5513", null ], + [ "NK_STATIC_ASSERT", "nuklear_8h.html#a3ad416d5af6fec2c3d9bc2e593bd4133", null ], + [ "nk_str_append_str_char", "nuklear_8h.html#a67be2a3091dcc782a2fe8e60af48789e", null ], + [ "nk_str_append_str_runes", "nuklear_8h.html#a538bd5a9a884f1476eefff359e549c20", null ], + [ "nk_str_append_str_utf8", "nuklear_8h.html#a2c284670625294b8a0390a0a37260f6e", null ], + [ "nk_str_append_text_char", "nuklear_8h.html#ac538f98df24b7c452c31f8b9b4cb84cb", null ], + [ "nk_str_append_text_runes", "nuklear_8h.html#a9bbf28ce8bcfe8b1e2d3bcb9ae7ad0e5", null ], + [ "nk_str_append_text_utf8", "nuklear_8h.html#a52ac2a215fc5af4a1f289c0044314527", null ], + [ "nk_str_at_char", "nuklear_8h.html#ac4aaf68c250f84412bac70bb2918af8d", null ], + [ "nk_str_at_char_const", "nuklear_8h.html#af739fb3f4eb9fe381aeb6c1d15f2ec54", null ], + [ "nk_str_at_const", "nuklear_8h.html#aa82d436d802850106cba924e2e36e014", null ], + [ "nk_str_at_rune", "nuklear_8h.html#a1cfb851ed92fb40c58d17c7cb3ccb665", null ], + [ "nk_str_clear", "nuklear_8h.html#ab9d2c499eec5660fa620cfd5af6aa511", null ], + [ "nk_str_delete_chars", "nuklear_8h.html#a6d7bbb83e38204ff2a46290ce3a7f507", null ], + [ "nk_str_delete_runes", "nuklear_8h.html#a08621f10e2880c7e9154e753d99f9cd8", null ], + [ "nk_str_free", "nuklear_8h.html#a04662530a2da72abf0a5592208f11d1f", null ], + [ "nk_str_get", "nuklear_8h.html#a3a7cef826810891bded14bf4c04cffaf", null ], + [ "nk_str_get_const", "nuklear_8h.html#acdd5e3b917845b4ddaab13684ffd65fc", null ], + [ "nk_str_init", "nuklear_8h.html#a4e8cb9bd5773443642626e8f15760ec8", null ], + [ "nk_str_init_fixed", "nuklear_8h.html#a579bd7d86c6c8b578b7a9047662ac4a7", null ], + [ "nk_str_insert_at_char", "nuklear_8h.html#a290ac7c33aefd9c398eeceacd3940c4d", null ], + [ "nk_str_insert_at_rune", "nuklear_8h.html#a7b7df9d432d38acfc704ba2e0c2f79ed", null ], + [ "nk_str_insert_str_char", "nuklear_8h.html#a86b6ea2d0b7f7ce1e1cd12366bf7a727", null ], + [ "nk_str_insert_str_runes", "nuklear_8h.html#a6eef89c3a7829f89db5e61bf0d945c13", null ], + [ "nk_str_insert_str_utf8", "nuklear_8h.html#a9849188982faf4d9a306c062bbdd73ef", null ], + [ "nk_str_insert_text_char", "nuklear_8h.html#acfe30495010d8a06192b006b094cbbe5", null ], + [ "nk_str_insert_text_runes", "nuklear_8h.html#a969471e9b00506bd8b19433169376190", null ], + [ "nk_str_insert_text_utf8", "nuklear_8h.html#a7b8f5d52ee319c9cfda6bc231e1569e8", null ], + [ "nk_str_len", "nuklear_8h.html#a1e7d1bb9999417db77cd668eb188f6e5", null ], + [ "nk_str_len_char", "nuklear_8h.html#a9e237857b886ad3cacaf557702ff72ce", null ], + [ "nk_str_remove_chars", "nuklear_8h.html#ae172901e88dec191a460e0ed3ac48918", null ], + [ "nk_str_remove_runes", "nuklear_8h.html#a2b95327a01ddfd9c63d1f2e1eb585025", null ], + [ "nk_str_rune_at", "nuklear_8h.html#aebae5d78c31061a08db967eee8ea02b8", null ], + [ "nk_strfilter", "nuklear_8h.html#a4507d2be43d5a55d4e6158be9d688363", null ], + [ "nk_stricmp", "nuklear_8h.html#a66f69855d430d9abd6b025be53f62689", null ], + [ "nk_stricmpn", "nuklear_8h.html#af770adcc4831845ae44c103c7c55e22b", null ], + [ "nk_strlen", "nuklear_8h.html#a7592a780dfecdd00ec083c6cea840843", null ], + [ "nk_strmatch_fuzzy_string", "nuklear_8h.html#a91a762116b53e2b77621531f9b55e71c", null ], + [ "nk_strmatch_fuzzy_text", "nuklear_8h.html#ada7403c9dfba288006483be6276c692b", null ], + [ "nk_stroke_arc", "nuklear_8h.html#a720a5b136e3d0969429b68f2767acc8b", null ], + [ "nk_stroke_circle", "nuklear_8h.html#a56cab66c2d12f25717fb5be7bda1de4c", null ], + [ "nk_stroke_curve", "nuklear_8h.html#aa2669f50087c675d5734516f34f2684f", null ], + [ "nk_stroke_line", "nuklear_8h.html#a5f48f521429154981803612ee2c80850", null ], + [ "nk_stroke_polygon", "nuklear_8h.html#a1cbea03c6d2e785c2361809087e1a4c6", null ], + [ "nk_stroke_polyline", "nuklear_8h.html#a2443782bdfd613b9a7b8199128ea0a79", null ], + [ "nk_stroke_rect", "nuklear_8h.html#a0a9a438b0bc3c80cf11a7d2789b3a002", null ], + [ "nk_stroke_triangle", "nuklear_8h.html#a789c2ec58a82e2cc3e3cd28363068a76", null ], + [ "nk_strtod", "nuklear_8h.html#a6e16dc3d442972c56c157d47a9c08fd8", null ], + [ "nk_strtof", "nuklear_8h.html#a866a44fc8b3098973d708ad0d0e99a53", null ], + [ "nk_strtoi", "nuklear_8h.html#ae8a8001cc25412e9a5447c8ff5c3bccc", null ], + [ "nk_style_default", "nuklear_8h.html#a712c99c2b4d02724e0276d497a46b1ef", null ], + [ "nk_style_from_table", "nuklear_8h.html#ac9a062889ac3a6a9b79937c89a713a8c", null ], + [ "nk_style_get_color_by_name", "nuklear_8h.html#ac09e19728c297c0b8b727731433a1978", null ], + [ "nk_style_hide_cursor", "nuklear_8h.html#aa8f8bd65aff9fefbe9a6220bcac4e491", null ], + [ "nk_style_item_color", "nuklear_8h.html#ad75505d72c6aa666e36aa20fcfd9f939", null ], + [ "nk_style_item_hide", "nuklear_8h.html#aee75f4fa28851ee1d95d98b8fcbb86ab", null ], + [ "nk_style_item_image", "nuklear_8h.html#a1de0362610f6087ea11f0d9a4ada16e4", null ], + [ "nk_style_item_nine_slice", "nuklear_8h.html#a6bf1f336dde45f3fc04447920454b1de", null ], + [ "nk_style_load_all_cursors", "nuklear_8h.html#a4141c996579134a73edb4c0a7676adc0", null ], + [ "nk_style_load_cursor", "nuklear_8h.html#a680921fc4d820ff9c914e360e3bd2900", null ], + [ "nk_style_pop_color", "nuklear_8h.html#a3e02ee1aa35e7acb84ff6c0a27809e97", null ], + [ "nk_style_pop_flags", "nuklear_8h.html#a03df09727d881542e3a3be4e191321bc", null ], + [ "nk_style_pop_float", "nuklear_8h.html#af972043ab67e73362ca2662fbb58d094", null ], + [ "nk_style_pop_font", "nuklear_8h.html#acd62c932daa63abd15ccb8b9879c688c", null ], + [ "nk_style_pop_style_item", "nuklear_8h.html#a42a10c7e384e6bc32f2b3e4398dd6638", null ], + [ "nk_style_pop_vec2", "nuklear_8h.html#acc54cd06a9eb0aa46f6ac9f914da2a6b", null ], + [ "nk_style_push_color", "nuklear_8h.html#ace2918f5488c0a3d7399840e7a4a0f6d", null ], + [ "nk_style_push_flags", "nuklear_8h.html#a1329779262e6e40038c0461fe531e62a", null ], + [ "nk_style_push_float", "nuklear_8h.html#af466bc005f360373b1f1ab92ca93191d", null ], + [ "nk_style_push_font", "nuklear_8h.html#a087f4e4d1f9518386f08617ec686ad2b", null ], + [ "nk_style_push_style_item", "nuklear_8h.html#a17b90546361290d5dda2f4294cc9ec07", null ], + [ "nk_style_push_vec2", "nuklear_8h.html#a860bb0ed470bcef76217b2bdee7e00a9", null ], + [ "nk_style_set_cursor", "nuklear_8h.html#afab5d5407a559a12235c92102e0dce55", null ], + [ "nk_style_set_font", "nuklear_8h.html#afcfc666c2baa72a6898c45dfdc3a0afe", null ], + [ "nk_style_show_cursor", "nuklear_8h.html#a3ae2be1253f7110b18846ede2a309bf1", null ], + [ "nk_sub9slice_handle", "nuklear_8h.html#a7b84411100e9df26da8491ad6aacbc25", null ], + [ "nk_sub9slice_id", "nuklear_8h.html#ab36da038b9ed366b0395c3c2181f63ac", null ], + [ "nk_sub9slice_ptr", "nuklear_8h.html#a14cd76267df3ce62eb3aa68c76448a7b", null ], + [ "nk_subimage_handle", "nuklear_8h.html#a2eb987b027d9662187bd3389267cc93a", null ], + [ "nk_subimage_id", "nuklear_8h.html#a2955c0c0cb6d5d6ba45feffb977fb166", null ], + [ "nk_subimage_ptr", "nuklear_8h.html#a7698164aefcc24e86041c68b9024e0bd", null ], + [ "nk_text", "nuklear_8h.html#a57bfd9d22209fd879f1495ae4d71888d", null ], + [ "nk_text_colored", "nuklear_8h.html#ac179bc1be9734a74e5f03b5eb4aa1365", null ], + [ "nk_text_wrap", "nuklear_8h.html#a97df80a2e281e6ccf991df5cde41a685", null ], + [ "nk_text_wrap_colored", "nuklear_8h.html#a2b51947c8fbe4c2c4c66883e40619ad6", null ], + [ "nk_textedit_cut", "nuklear_8h.html#ae13ea884e8d5af7240fab864b02b3d92", null ], + [ "nk_textedit_delete", "nuklear_8h.html#a4745ee1241890713ed6318f79a7d7a0a", null ], + [ "nk_textedit_delete_selection", "nuklear_8h.html#ac1c4cd67c4acd5ea69b86543d37d99ea", null ], + [ "nk_textedit_free", "nuklear_8h.html#adc5cbad6810a9e287386e4c23d094230", null ], + [ "nk_textedit_init", "nuklear_8h.html#af93216fccd3c3f84ed133a6fb08561e1", null ], + [ "nk_textedit_init_fixed", "nuklear_8h.html#ac6954fed72ab50bb3102c52311cee542", null ], + [ "nk_textedit_paste", "nuklear_8h.html#ab889b2952dfaef0ae546028cf635e376", null ], + [ "nk_textedit_redo", "nuklear_8h.html#a8e1595e5d78d22ef8d783e340459f5f6", null ], + [ "nk_textedit_select_all", "nuklear_8h.html#a94a6548940e73424846ee3822af131ac", null ], + [ "nk_textedit_text", "nuklear_8h.html#aa3eaca693d3adfa790f3400331adc01b", null ], + [ "nk_textedit_undo", "nuklear_8h.html#ae49b3d9e75b9964f3ff6fb704638d1fc", null ], + [ "nk_tooltip", "nuklear_8h.html#a79bfb6bb49909bb58ad6ba481389b25e", null ], + [ "nk_tooltip_begin", "nuklear_8h.html#a256a48030da38eab5644dfa546523f16", null ], + [ "nk_tooltip_end", "nuklear_8h.html#aa08e22e4dd8afcca4e4b91e4e17cac77", null ], + [ "nk_tree_element_image_push_hashed", "nuklear_8h.html#a825779ad923f9688a579a7d5aba1dbd2", null ], + [ "nk_tree_element_pop", "nuklear_8h.html#a673c474e65a7c9da0f475d171485d532", null ], + [ "nk_tree_element_push_hashed", "nuklear_8h.html#af2f1d84b7e2a6fcc4f21032d0088ef22", null ], + [ "nk_tree_image_push_hashed", "nuklear_8h.html#a42cc204c4350de1acc2e652a0a486bcf", null ], + [ "nk_tree_pop", "nuklear_8h.html#a05362d2293e86def0f3ba6d312276a9a", null ], + [ "nk_tree_push_hashed", "nuklear_8h.html#a99112ed97e24a0d53c0060f7d6dc8cc0", null ], + [ "nk_tree_state_image_push", "nuklear_8h.html#a6bb8e2faf97d70d1a40db1201671780f", null ], + [ "nk_tree_state_pop", "nuklear_8h.html#ab654dd3881863a7ae992db45a071d77f", null ], + [ "nk_tree_state_push", "nuklear_8h.html#a976a55dc27c8169dc1a99f7d13088be8", null ], + [ "nk_triangle_from_direction", "nuklear_8h.html#ae904fc8564ae2580e170d717a5e019ac", null ], + [ "nk_utf_at", "nuklear_8h.html#a3516900bf2886a3ef322d5d15f0e1d43", null ], + [ "nk_utf_decode", "nuklear_8h.html#a4a1dffda91834bddc9d58031fc8c0d6f", null ], + [ "nk_utf_encode", "nuklear_8h.html#a3eb47df986e2f45edf26a2cb6ce11391", null ], + [ "nk_utf_len", "nuklear_8h.html#a1cbe35c2e44e5d5d97f0d6944a451d6f", null ], + [ "nk_vec2", "nuklear_8h.html#a941b2f79e575807bdd0e4b6aef1fb19f", null ], + [ "nk_vec2i", "nuklear_8h.html#ac05fe77e80b309cd8799eefd8dd600b4", null ], + [ "nk_vec2iv", "nuklear_8h.html#a185be7fd542171bace91d65cb0fde29f", null ], + [ "nk_vec2v", "nuklear_8h.html#a6d697ec9236acdffa48a0cbb5e4e541e", null ], + [ "nk_widget", "nuklear_8h.html#aaf68e0bbf0fd4724bf647d3e96b7d4a8", null ], + [ "nk_widget_bounds", "nuklear_8h.html#afb374e3c8c76aaaa5fcf47174e1304df", null ], + [ "nk_widget_disable_begin", "nuklear_8h.html#a185d2bec87ea94cfc878ca3a25a339bc", null ], + [ "nk_widget_disable_end", "nuklear_8h.html#ada9397ce8a6242cba21dbcbbc63846f2", null ], + [ "nk_widget_fitting", "nuklear_8h.html#a3664569d0816ea4163c1a803a4831f09", null ], + [ "nk_widget_has_mouse_click_down", "nuklear_8h.html#a36763a52ed456f5741907af6d6256e14", null ], + [ "nk_widget_height", "nuklear_8h.html#a38ee42eabd27275f4205277a692cd384", null ], + [ "nk_widget_is_hovered", "nuklear_8h.html#a0ee60d58ed718471832090ec1236a11c", null ], + [ "nk_widget_is_mouse_clicked", "nuklear_8h.html#a2d6e89321804a3765d3496adb89f3e75", null ], + [ "nk_widget_position", "nuklear_8h.html#ad8a30e3b70d446f62a71ccbb29961378", null ], + [ "nk_widget_size", "nuklear_8h.html#a479fef53d65b543878d986208c9e18ea", null ], + [ "nk_widget_width", "nuklear_8h.html#a5524b5c930b2d761bdcb9340b1e927e6", null ], + [ "nk_window_close", "nuklear_8h.html#a17d99544eee290e0d79e5d3eb1cdac03", null ], + [ "nk_window_collapse", "nuklear_8h.html#a7fc3d426db189e2e0a4557e80135601e", null ], + [ "nk_window_collapse_if", "nuklear_8h.html#a35eb1ef534da74f5b1a6cfd873aad40e", null ], + [ "nk_window_find", "nuklear_8h.html#afa03f5e650448bc8b23d21191622a89f", null ], + [ "nk_window_get_bounds", "nuklear_8h.html#a953e4260d75945c20995971ba0454806", null ], + [ "nk_window_get_canvas", "nuklear_8h.html#a767970d6ba82bde35cc90851d4077dd1", null ], + [ "nk_window_get_content_region", "nuklear_8h.html#ad32015c0b7b53e4df428d7b8e123e18e", null ], + [ "nk_window_get_content_region_max", "nuklear_8h.html#a0c121dd2f61a58534da0a1c5de756f85", null ], + [ "nk_window_get_content_region_min", "nuklear_8h.html#ab9869953c48593e9e85de6bbb3b8e9e5", null ], + [ "nk_window_get_content_region_size", "nuklear_8h.html#a69e94ee039dd5a69831aaef36a24b520", null ], + [ "nk_window_get_height", "nuklear_8h.html#aa62210de969d101d5d79ba600fe9ff33", null ], + [ "nk_window_get_panel", "nuklear_8h.html#a983290e0e285e1366aee0af6ba0ed4e7", null ], + [ "nk_window_get_position", "nuklear_8h.html#aef2af65486366fb8f4a36166b4dc9c41", null ], + [ "nk_window_get_scroll", "nuklear_8h.html#a6aa450a42ad526df04edeedd1db8348a", null ], + [ "nk_window_get_size", "nuklear_8h.html#a45b8d37fe77e0042ebf5b58e1b253217", null ], + [ "nk_window_get_width", "nuklear_8h.html#abc629faa5b527aea0c5b3f4b6a233883", null ], + [ "nk_window_has_focus", "nuklear_8h.html#a87d7636e4f8ad8fff456a7291d63549b", null ], + [ "nk_window_is_active", "nuklear_8h.html#a4aea66b4db514df19651e03b26eaacee", null ], + [ "nk_window_is_any_hovered", "nuklear_8h.html#a5922a25b765837062d0ded6bb8369041", null ], + [ "nk_window_is_closed", "nuklear_8h.html#ad8e62bbe0e9db9d84e83f494ab750c26", null ], + [ "nk_window_is_collapsed", "nuklear_8h.html#a759513017e5bca51e13be0268d41f510", null ], + [ "nk_window_is_hidden", "nuklear_8h.html#a5ba38e6da74e5a1f82453c1215ccd138", null ], + [ "nk_window_is_hovered", "nuklear_8h.html#a324553b9e3c4450764a208454ac71454", null ], + [ "nk_window_set_bounds", "nuklear_8h.html#a953db327dad500d512deee42378816ac", null ], + [ "nk_window_set_focus", "nuklear_8h.html#a55f290b12d04ce2b8de2229cf0c9540a", null ], + [ "nk_window_set_position", "nuklear_8h.html#a6de7d1d2c130ab249964b71a4626b1aa", null ], + [ "nk_window_set_scroll", "nuklear_8h.html#a43344b5de927f1e705cbf6eca17c7314", null ], + [ "nk_window_set_size", "nuklear_8h.html#ab19652cd191237bf2723f235a14385f5", null ], + [ "nk_window_show", "nuklear_8h.html#a73ed9654303545bca9b8e4d6a5454363", null ], + [ "nk_window_show_if", "nuklear_8h.html#aa1eaa64d0de02f059163fc502386ce1b", null ] +]; \ No newline at end of file diff --git a/nuklear_8h__dep__incl.dot b/nuklear_8h__dep__incl.dot new file mode 100644 index 000000000..0c0b9b970 --- /dev/null +++ b/nuklear_8h__dep__incl.dot @@ -0,0 +1,91 @@ +digraph "src/nuklear.h" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="src/nuklear.h",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip="main API and documentation file"]; + Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node2 [label="src/nuklear_9slice.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__9slice_8c_source.html",tooltip=" "]; + Node1 -> Node3 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node3 [label="src/nuklear_buffer.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__buffer_8c_source.html",tooltip=" "]; + Node1 -> Node4 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node4 [label="src/nuklear_chart.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__chart_8c_source.html",tooltip=" "]; + Node1 -> Node5 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node5 [label="src/nuklear_button.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__button_8c_source.html",tooltip=" "]; + Node1 -> Node6 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node6 [label="src/nuklear_color.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__color_8c_source.html",tooltip=" "]; + Node1 -> Node7 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node7 [label="src/nuklear_color_picker.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__color__picker_8c_source.html",tooltip=" "]; + Node1 -> Node8 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node8 [label="src/nuklear_context.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__context_8c_source.html",tooltip=" "]; + Node1 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node9 [label="src/nuklear_contextual.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__contextual_8c_source.html",tooltip=" "]; + Node1 -> Node10 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node10 [label="src/nuklear_combo.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__combo_8c_source.html",tooltip=" "]; + Node1 -> Node11 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node11 [label="src/nuklear_draw.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__draw_8c_source.html",tooltip=" "]; + Node1 -> Node12 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node12 [label="src/nuklear_edit.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__edit_8c_source.html",tooltip=" "]; + Node1 -> Node13 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node13 [label="src/nuklear_group.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__group_8c_source.html",tooltip=" "]; + Node1 -> Node14 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node14 [label="src/nuklear_font.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__font_8c_source.html",tooltip=" "]; + Node1 -> Node15 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node15 [label="src/nuklear_image.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__image_8c_source.html",tooltip=" "]; + Node1 -> Node16 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node16 [label="src/nuklear_input.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__input_8c_source.html",tooltip=" "]; + Node1 -> Node17 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node17 [label="src/nuklear_knob.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__knob_8c_source.html",tooltip=" "]; + Node1 -> Node18 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node18 [label="src/nuklear_list_view.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__list__view_8c_source.html",tooltip=" "]; + Node1 -> Node19 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node19 [label="src/nuklear_layout.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__layout_8c_source.html",tooltip=" "]; + Node1 -> Node20 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node20 [label="src/nuklear_math.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__math_8c_source.html",tooltip=" "]; + Node1 -> Node21 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node21 [label="src/nuklear_page_element.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__page__element_8c_source.html",tooltip=" "]; + Node1 -> Node22 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node22 [label="src/nuklear_menu.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__menu_8c_source.html",tooltip=" "]; + Node1 -> Node23 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node23 [label="src/nuklear_panel.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__panel_8c_source.html",tooltip=" "]; + Node1 -> Node24 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node24 [label="src/nuklear_pool.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__pool_8c_source.html",tooltip=" "]; + Node1 -> Node25 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node25 [label="src/nuklear_popup.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__popup_8c_source.html",tooltip=" "]; + Node1 -> Node26 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node26 [label="src/nuklear_progress.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__progress_8c_source.html",tooltip=" "]; + Node1 -> Node27 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node27 [label="src/nuklear_property.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__property_8c_source.html",tooltip=" "]; + Node1 -> Node28 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node28 [label="src/nuklear_selectable.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__selectable_8c_source.html",tooltip=" "]; + Node1 -> Node29 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node29 [label="src/nuklear_slider.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__slider_8c_source.html",tooltip=" "]; + Node1 -> Node30 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node30 [label="src/nuklear_string.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__string_8c_source.html",tooltip=" "]; + Node1 -> Node31 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node31 [label="src/nuklear_table.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__table_8c_source.html",tooltip=" "]; + Node1 -> Node32 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node32 [label="src/nuklear_style.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__style_8c_source.html",tooltip=" "]; + Node1 -> Node33 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node33 [label="src/nuklear_text.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__text_8c_source.html",tooltip=" "]; + Node1 -> Node34 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node34 [label="src/nuklear_toggle.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__toggle_8c_source.html",tooltip=" "]; + Node1 -> Node35 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node35 [label="src/nuklear_scrollbar.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__scrollbar_8c_source.html",tooltip=" "]; + Node1 -> Node36 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node36 [label="src/nuklear_text_editor.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__text__editor_8c_source.html",tooltip=" "]; + Node1 -> Node37 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node37 [label="src/nuklear_tooltip.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__tooltip_8c_source.html",tooltip=" "]; + Node1 -> Node38 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node38 [label="src/nuklear_utf8.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__utf8_8c_source.html",tooltip=" "]; + Node1 -> Node39 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node39 [label="src/nuklear_tree.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__tree_8c_source.html",tooltip=" "]; + Node1 -> Node40 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node40 [label="src/nuklear_util.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__util_8c_source.html",tooltip=" "]; + Node1 -> Node41 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node41 [label="src/nuklear_vertex.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__vertex_8c_source.html",tooltip=" "]; + Node1 -> Node42 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node42 [label="src/nuklear_widget.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__widget_8c_source.html",tooltip=" "]; + Node1 -> Node43 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; + Node43 [label="src/nuklear_window.c",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$nuklear__window_8c_source.html",tooltip=" "]; +} diff --git a/nuklear_8h_source.html b/nuklear_8h_source.html new file mode 100644 index 000000000..a406c259c --- /dev/null +++ b/nuklear_8h_source.html @@ -0,0 +1,3218 @@ + + + + + + + +Nuklear: src/nuklear.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear.h
+
+
+Go to the documentation of this file.
1 
+
6 #ifndef NK_NUKLEAR_H_
+
7 #define NK_NUKLEAR_H_
+
8 
+
9 #ifdef __cplusplus
+
10 extern "C" {
+
11 #endif
+
12 /*
+
13  * ==============================================================
+
14  *
+
15  * CONSTANTS
+
16  *
+
17  * ===============================================================
+
18  */
+
19 
+
20 #define NK_UNDEFINED (-1.0f)
+
21 #define NK_UTF_INVALID 0xFFFD
+
22 #define NK_UTF_SIZE 4
+
23 #ifndef NK_INPUT_MAX
+
24  #define NK_INPUT_MAX 16
+
25 #endif
+
26 #ifndef NK_MAX_NUMBER_BUFFER
+
27  #define NK_MAX_NUMBER_BUFFER 64
+
28 #endif
+
29 #ifndef NK_SCROLLBAR_HIDING_TIMEOUT
+
30  #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
+
31 #endif
+
32 /*
+
33  * ==============================================================
+
34  *
+
35  * HELPER
+
36  *
+
37  * ===============================================================
+
38  */
+
39 
+
40 #ifndef NK_API
+
41  #ifdef NK_PRIVATE
+
42  #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L))
+
43  #define NK_API static inline
+
44  #elif defined(__cplusplus)
+
45  #define NK_API static inline
+
46  #else
+
47  #define NK_API static
+
48  #endif
+
49  #else
+
50  #define NK_API extern
+
51  #endif
+
52 #endif
+
53 #ifndef NK_LIB
+
54  #ifdef NK_SINGLE_FILE
+
55  #define NK_LIB static
+
56  #else
+
57  #define NK_LIB extern
+
58  #endif
+
59 #endif
+
60 
+
61 #define NK_INTERN static
+
62 #define NK_STORAGE static
+
63 #define NK_GLOBAL static
+
64 
+
65 #define NK_FLAG(x) (1 << (x))
+
66 #define NK_STRINGIFY(x) #x
+
67 #define NK_MACRO_STRINGIFY(x) NK_STRINGIFY(x)
+
68 #define NK_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
+
69 #define NK_STRING_JOIN_DELAY(arg1, arg2) NK_STRING_JOIN_IMMEDIATE(arg1, arg2)
+
70 #define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2)
+
71 
+
72 #ifdef _MSC_VER
+
73  #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
+
74 #else
+
75  #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
+
76 #endif
+
77 
+
78 #ifndef NK_STATIC_ASSERT
+
79  #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
+
80 #endif
+
81 
+
82 #ifndef NK_FILE_LINE
+
83 #ifdef _MSC_VER
+
84  #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
+
85 #else
+
86  #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
+
87 #endif
+
88 #endif
+
89 
+
90 #define NK_MIN(a,b) ((a) < (b) ? (a) : (b))
+
91 #define NK_MAX(a,b) ((a) < (b) ? (b) : (a))
+
92 #define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i))
+
93 
+
94 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
95  #include <stdarg.h>
+
96  #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
+
97  #include <sal.h>
+
98  #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
+
99  #else
+
100  #define NK_PRINTF_FORMAT_STRING
+
101  #endif
+
102  #if defined(__GNUC__)
+
103  #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1)))
+
104  #define NK_PRINTF_VALIST_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, 0)))
+
105  #else
+
106  #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
+
107  #define NK_PRINTF_VALIST_FUNC(fmtargnumber)
+
108  #endif
+
109 #endif
+
110 
+
111 /*
+
112  * ===============================================================
+
113  *
+
114  * BASIC
+
115  *
+
116  * ===============================================================
+
117  */
+
118  #ifdef NK_INCLUDE_FIXED_TYPES
+
119  #include <stdint.h>
+
120  #define NK_INT8 int8_t
+
121  #define NK_UINT8 uint8_t
+
122  #define NK_INT16 int16_t
+
123  #define NK_UINT16 uint16_t
+
124  #define NK_INT32 int32_t
+
125  #define NK_UINT32 uint32_t
+
126  #define NK_SIZE_TYPE uintptr_t
+
127  #define NK_POINTER_TYPE uintptr_t
+
128 #else
+
129  #ifndef NK_INT8
+
130  #define NK_INT8 signed char
+
131  #endif
+
132  #ifndef NK_UINT8
+
133  #define NK_UINT8 unsigned char
+
134  #endif
+
135  #ifndef NK_INT16
+
136  #define NK_INT16 signed short
+
137  #endif
+
138  #ifndef NK_UINT16
+
139  #define NK_UINT16 unsigned short
+
140  #endif
+
141  #ifndef NK_INT32
+
142  #if defined(_MSC_VER)
+
143  #define NK_INT32 __int32
+
144  #else
+
145  #define NK_INT32 signed int
+
146  #endif
+
147  #endif
+
148  #ifndef NK_UINT32
+
149  #if defined(_MSC_VER)
+
150  #define NK_UINT32 unsigned __int32
+
151  #else
+
152  #define NK_UINT32 unsigned int
+
153  #endif
+
154  #endif
+
155  #ifndef NK_SIZE_TYPE
+
156  #if defined(_WIN64) && defined(_MSC_VER)
+
157  #define NK_SIZE_TYPE unsigned __int64
+
158  #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
+
159  #define NK_SIZE_TYPE unsigned __int32
+
160  #elif defined(__GNUC__) || defined(__clang__)
+
161  #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
+
162  #define NK_SIZE_TYPE unsigned long
+
163  #else
+
164  #define NK_SIZE_TYPE unsigned int
+
165  #endif
+
166  #else
+
167  #define NK_SIZE_TYPE unsigned long
+
168  #endif
+
169  #endif
+
170  #ifndef NK_POINTER_TYPE
+
171  #if defined(_WIN64) && defined(_MSC_VER)
+
172  #define NK_POINTER_TYPE unsigned __int64
+
173  #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
+
174  #define NK_POINTER_TYPE unsigned __int32
+
175  #elif defined(__GNUC__) || defined(__clang__)
+
176  #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__)
+
177  #define NK_POINTER_TYPE unsigned long
+
178  #else
+
179  #define NK_POINTER_TYPE unsigned int
+
180  #endif
+
181  #else
+
182  #define NK_POINTER_TYPE unsigned long
+
183  #endif
+
184  #endif
+
185 #endif
+
186 
+
187 #ifndef NK_BOOL
+
188  #ifdef NK_INCLUDE_STANDARD_BOOL
+
189  #include <stdbool.h>
+
190  #define NK_BOOL bool
+
191  #else
+
192  #define NK_BOOL int
+
193  #endif
+
194 #endif
+
195 
+
196 typedef NK_INT8 nk_char;
+
197 typedef NK_UINT8 nk_uchar;
+
198 typedef NK_UINT8 nk_byte;
+
199 typedef NK_INT16 nk_short;
+
200 typedef NK_UINT16 nk_ushort;
+
201 typedef NK_INT32 nk_int;
+
202 typedef NK_UINT32 nk_uint;
+
203 typedef NK_SIZE_TYPE nk_size;
+
204 typedef NK_POINTER_TYPE nk_ptr;
+
205 typedef NK_BOOL nk_bool;
+
206 
+
207 typedef nk_uint nk_hash;
+
208 typedef nk_uint nk_flags;
+
209 typedef nk_uint nk_rune;
+
210 
+
211 /* Make sure correct type size:
+
212  * This will fire with a negative subscript error if the type sizes
+
213  * are set incorrectly by the compiler, and compile out if not */
+
214 NK_STATIC_ASSERT(sizeof(nk_short) == 2);
+
215 NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
+
216 NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
+
217 NK_STATIC_ASSERT(sizeof(nk_int) == 4);
+
218 NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
+
219 NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
+
220 NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
+
221 NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
+
222 NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
+
223 #ifdef NK_INCLUDE_STANDARD_BOOL
+
224 NK_STATIC_ASSERT(sizeof(nk_bool) == sizeof(bool));
+
225 #else
+
226 NK_STATIC_ASSERT(sizeof(nk_bool) >= 2);
+
227 #endif
+
228 
+
229 /* ============================================================================
+
230  *
+
231  * API
+
232  *
+
233  * =========================================================================== */
+
234 struct nk_buffer;
+
235 struct nk_allocator;
+
236 struct nk_command_buffer;
+
237 struct nk_draw_command;
+
238 struct nk_convert_config;
+
239 struct nk_style_item;
+
240 struct nk_text_edit;
+
241 struct nk_draw_list;
+
242 struct nk_user_font;
+
243 struct nk_panel;
+
244 struct nk_context;
+
245 struct nk_draw_vertex_layout_element;
+
246 struct nk_style_button;
+
247 struct nk_style_toggle;
+
248 struct nk_style_selectable;
+
249 struct nk_style_slide;
+
250 struct nk_style_progress;
+
251 struct nk_style_scrollbar;
+
252 struct nk_style_edit;
+
253 struct nk_style_property;
+
254 struct nk_style_chart;
+
255 struct nk_style_combo;
+
256 struct nk_style_tab;
+ +
258 struct nk_style_window;
+
259 
+
260 enum {nk_false, nk_true};
+
261 struct nk_color {nk_byte r,g,b,a;};
+
262 struct nk_colorf {float r,g,b,a;};
+
263 struct nk_vec2 {float x,y;};
+
264 struct nk_vec2i {short x, y;};
+
265 struct nk_rect {float x,y,w,h;};
+
266 struct nk_recti {short x,y,w,h;};
+
267 typedef char nk_glyph[NK_UTF_SIZE];
+
268 typedef union {void *ptr; int id;} nk_handle;
+
269 struct nk_image {nk_handle handle; nk_ushort w, h; nk_ushort region[4];};
+
270 struct nk_nine_slice {struct nk_image img; nk_ushort l, t, r, b;};
+
271 struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;};
+
272 struct nk_scroll {nk_uint x, y;};
+
273 
+
274 enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
+
275 enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
+
276 enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
+
277 enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL};
+
278 enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true};
+
279 enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true};
+
280 enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX};
+
281 enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02};
+
282 enum nk_color_format {NK_RGB, NK_RGBA};
+
283 enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC};
+
284 enum nk_layout_format {NK_DYNAMIC, NK_STATIC};
+
285 enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB};
+
286 
+
287 typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size);
+
288 typedef void (*nk_plugin_free)(nk_handle, void *old);
+
289 typedef nk_bool(*nk_plugin_filter)(const struct nk_text_edit*, nk_rune unicode);
+
290 typedef void(*nk_plugin_paste)(nk_handle, struct nk_text_edit*);
+
291 typedef void(*nk_plugin_copy)(nk_handle, const char*, int len);
+
292 
+
293 struct nk_allocator {
+
294  nk_handle userdata;
+
295  nk_plugin_alloc alloc;
+
296  nk_plugin_free free;
+
297 };
+
298 enum nk_symbol_type {
+
299  NK_SYMBOL_NONE,
+
300  NK_SYMBOL_X,
+
301  NK_SYMBOL_UNDERSCORE,
+
302  NK_SYMBOL_CIRCLE_SOLID,
+
303  NK_SYMBOL_CIRCLE_OUTLINE,
+
304  NK_SYMBOL_RECT_SOLID,
+
305  NK_SYMBOL_RECT_OUTLINE,
+
306  NK_SYMBOL_TRIANGLE_UP,
+
307  NK_SYMBOL_TRIANGLE_DOWN,
+
308  NK_SYMBOL_TRIANGLE_LEFT,
+
309  NK_SYMBOL_TRIANGLE_RIGHT,
+
310  NK_SYMBOL_PLUS,
+
311  NK_SYMBOL_MINUS,
+
312  NK_SYMBOL_TRIANGLE_UP_OUTLINE,
+
313  NK_SYMBOL_TRIANGLE_DOWN_OUTLINE,
+
314  NK_SYMBOL_TRIANGLE_LEFT_OUTLINE,
+
315  NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE,
+
316  NK_SYMBOL_MAX
+
317 };
+
318 /* =============================================================================
+
319  *
+
320  * CONTEXT
+
321  *
+
322  * =============================================================================*/
+
358 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
359 
+
376 NK_API nk_bool nk_init_default(struct nk_context*, const struct nk_user_font*);
+
377 #endif
+
402 NK_API nk_bool nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
+
403 
+
422 NK_API nk_bool nk_init(struct nk_context*, const struct nk_allocator*, const struct nk_user_font*);
+
423 
+
442 NK_API nk_bool nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
+
443 
+
457 NK_API void nk_clear(struct nk_context*);
+
458 
+
469 NK_API void nk_free(struct nk_context*);
+
470 
+
471 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
483 NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
+
484 #endif
+
485 /* =============================================================================
+
486  *
+
487  * INPUT
+
488  *
+
489  * =============================================================================*/
+
554 enum nk_keys {
+
555  NK_KEY_NONE,
+
556  NK_KEY_SHIFT,
+
557  NK_KEY_CTRL,
+
558  NK_KEY_DEL,
+
559  NK_KEY_ENTER,
+
560  NK_KEY_TAB,
+
561  NK_KEY_BACKSPACE,
+
562  NK_KEY_COPY,
+
563  NK_KEY_CUT,
+
564  NK_KEY_PASTE,
+
565  NK_KEY_UP,
+
566  NK_KEY_DOWN,
+
567  NK_KEY_LEFT,
+
568  NK_KEY_RIGHT,
+
569  /* Shortcuts: text field */
+
570  NK_KEY_TEXT_INSERT_MODE,
+
571  NK_KEY_TEXT_REPLACE_MODE,
+
572  NK_KEY_TEXT_RESET_MODE,
+
573  NK_KEY_TEXT_LINE_START,
+
574  NK_KEY_TEXT_LINE_END,
+
575  NK_KEY_TEXT_START,
+
576  NK_KEY_TEXT_END,
+
577  NK_KEY_TEXT_UNDO,
+
578  NK_KEY_TEXT_REDO,
+
579  NK_KEY_TEXT_SELECT_ALL,
+
580  NK_KEY_TEXT_WORD_LEFT,
+
581  NK_KEY_TEXT_WORD_RIGHT,
+
582  /* Shortcuts: scrollbar */
+
583  NK_KEY_SCROLL_START,
+
584  NK_KEY_SCROLL_END,
+
585  NK_KEY_SCROLL_DOWN,
+
586  NK_KEY_SCROLL_UP,
+
587  NK_KEY_MAX
+
588 };
+
589 enum nk_buttons {
+
590  NK_BUTTON_LEFT,
+
591  NK_BUTTON_MIDDLE,
+
592  NK_BUTTON_RIGHT,
+
593  NK_BUTTON_DOUBLE,
+
594  NK_BUTTON_MAX
+
595 };
+
596 
+
608 NK_API void nk_input_begin(struct nk_context*);
+
609 
+
622 NK_API void nk_input_motion(struct nk_context*, int x, int y);
+
623 
+
636 NK_API void nk_input_key(struct nk_context*, enum nk_keys, nk_bool down);
+
637 
+
652 NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, nk_bool down);
+
653 
+
668 NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val);
+
669 
+
687 NK_API void nk_input_char(struct nk_context*, char);
+
688 
+
703 NK_API void nk_input_glyph(struct nk_context*, const nk_glyph);
+
704 
+
720 NK_API void nk_input_unicode(struct nk_context*, nk_rune);
+
721 
+
733 NK_API void nk_input_end(struct nk_context*);
+
734 
+
966 enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
+
967 enum nk_convert_result {
+
968  NK_CONVERT_SUCCESS = 0,
+
969  NK_CONVERT_INVALID_PARAM = 1,
+
970  NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
+
971  NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
+
972  NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
+
973 };
+ +
975  nk_handle texture;
+
976  struct nk_vec2 uv;
+
977 };
+ +
979  float global_alpha;
+
980  enum nk_anti_aliasing line_AA;
+
981  enum nk_anti_aliasing shape_AA;
+ +
983  unsigned arc_segment_count;
+ + +
986  const struct nk_draw_vertex_layout_element *vertex_layout;
+
987  nk_size vertex_size;
+ +
989 };
+
990 
+
1004 NK_API const struct nk_command* nk__begin(struct nk_context*);
+
1005 
+
1019 NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
+
1020 
+
1031 #define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
+
1032 
+
1033 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
1034 
+
1064 NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
+
1065 
+
1079 NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
+
1080 
+
1098 NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*);
+
1099 
+
1117 NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
+
1118 
+
1134 #define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
+
1135 #endif
+
1136 
+
1284 enum nk_panel_flags {
+
1285  NK_WINDOW_BORDER = NK_FLAG(0),
+
1286  NK_WINDOW_MOVABLE = NK_FLAG(1),
+
1287  NK_WINDOW_SCALABLE = NK_FLAG(2),
+
1288  NK_WINDOW_CLOSABLE = NK_FLAG(3),
+
1289  NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
+
1290  NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
+
1291  NK_WINDOW_TITLE = NK_FLAG(6),
+
1292  NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
+
1293  NK_WINDOW_BACKGROUND = NK_FLAG(8),
+
1294  NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
+
1295  NK_WINDOW_NO_INPUT = NK_FLAG(10)
+
1296 };
+
1297 
+
1318 NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
+
1319 
+
1341 NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
+
1342 
+
1357 NK_API void nk_end(struct nk_context *ctx);
+
1358 
+
1375 NK_API struct nk_window *nk_window_find(const struct nk_context *ctx, const char *name);
+
1376 
+
1394 NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
+
1395 
+
1413 NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
+
1414 
+
1432 NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
+
1433 
+
1450 NK_API float nk_window_get_width(const struct nk_context *ctx);
+
1451 
+
1469 NK_API float nk_window_get_height(const struct nk_context* ctx);
+
1470 
+
1490 NK_API struct nk_panel* nk_window_get_panel(const struct nk_context* ctx);
+
1491 
+
1512 NK_API struct nk_rect nk_window_get_content_region(const struct nk_context* ctx);
+
1513 
+
1534 NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx);
+
1535 
+
1556 NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx);
+
1557 
+
1577 NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx);
+
1578 
+
1598 NK_API struct nk_command_buffer* nk_window_get_canvas(const struct nk_context* ctx);
+
1599 
+
1617 NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y);
+
1618 
+
1635 NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx);
+
1636 
+
1653 NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx);
+
1654 
+
1671 NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name);
+
1672 
+
1688 NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char* name);
+
1689 
+
1705 NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char* name);
+
1706 
+
1721 NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char* name);
+
1722 
+
1736 NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx);
+
1737 
+
1754 NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx);
+
1755 
+
1770 NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds);
+
1771 
+
1786 NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos);
+
1787 
+
1802 NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size);
+
1803 
+
1817 NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name);
+
1818 
+
1836 NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y);
+
1837 
+
1851 NK_API void nk_window_close(struct nk_context *ctx, const char *name);
+
1852 
+
1867 NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state);
+
1868 
+
1884 NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond);
+
1885 
+
1899 NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state);
+
1900 
+
1916 NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond);
+
1917 
+
1931 NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding);
+
1932 
+
1933 /* =============================================================================
+
1934  *
+
1935  * LAYOUT
+
1936  *
+
1937  * =============================================================================*/
+
2206 enum nk_widget_align {
+
2207  NK_WIDGET_ALIGN_LEFT = 0x01,
+
2208  NK_WIDGET_ALIGN_CENTERED = 0x02,
+
2209  NK_WIDGET_ALIGN_RIGHT = 0x04,
+
2210  NK_WIDGET_ALIGN_TOP = 0x08,
+
2211  NK_WIDGET_ALIGN_MIDDLE = 0x10,
+
2212  NK_WIDGET_ALIGN_BOTTOM = 0x20
+
2213 };
+
2214 enum nk_widget_alignment {
+
2215  NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT,
+
2216  NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED,
+
2217  NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT
+
2218 };
+
2219 
+
2233 NK_API void nk_layout_set_min_row_height(struct nk_context*, float height);
+
2234 
+
2243 NK_API void nk_layout_reset_min_row_height(struct nk_context*);
+
2244 
+
2257 NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx);
+
2258 
+
2272 NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width);
+
2273 
+
2288 NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
+
2289 
+
2305 NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
+
2306 
+
2320 NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
+
2321 
+
2333 NK_API void nk_layout_row_push(struct nk_context*, float value);
+
2334 
+
2345 NK_API void nk_layout_row_end(struct nk_context*);
+
2346 
+
2360 NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
+
2361 
+
2374 NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height);
+
2375 
+
2388 NK_API void nk_layout_row_template_push_dynamic(struct nk_context*);
+
2389 
+
2402 NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
+
2403 
+
2416 NK_API void nk_layout_row_template_push_static(struct nk_context*, float width);
+
2417 
+
2429 NK_API void nk_layout_row_template_end(struct nk_context*);
+
2430 
+
2445 NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
+
2446 
+
2459 NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
+
2460 
+
2472 NK_API void nk_layout_space_end(struct nk_context*);
+
2473 
+
2487 NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx);
+
2488 
+
2503 NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context* ctx, struct nk_vec2 vec);
+
2504 
+
2519 NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec);
+
2520 
+
2535 NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds);
+
2536 
+
2551 NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds);
+
2552 
+
2565 NK_API void nk_spacer(struct nk_context *ctx);
+
2566 
+
2567 
+
2672 NK_API nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags);
+
2673 
+
2687 NK_API nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+
2688 
+
2700 NK_API void nk_group_end(struct nk_context*);
+
2701 
+
2720 NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+
2721 
+
2739 NK_API nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+
2740 
+
2752 NK_API void nk_group_scrolled_end(struct nk_context*);
+
2753 
+
2768 NK_API void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset);
+
2769 
+
2784 NK_API void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset);
+
2785 
+
2879 #define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+
2880 
+
2898 #define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+
2899 
+
2920 NK_API nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+
2921 
+
2944 #define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+
2945 
+
2966 #define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+
2967 
+
2989 NK_API nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+
2990 
+
3002 NK_API void nk_tree_pop(struct nk_context*);
+
3003 
+
3020 NK_API nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
+
3021 
+
3039 NK_API nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
+
3040 
+
3052 NK_API void nk_tree_state_pop(struct nk_context*);
+
3053 
+
3054 #define nk_tree_element_push(ctx, type, title, state, sel) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+
3055 #define nk_tree_element_push_id(ctx, type, title, state, sel, id) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+
3056 NK_API nk_bool nk_tree_element_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len, int seed);
+
3057 NK_API nk_bool nk_tree_element_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, nk_bool *selected, const char *hash, int len,int seed);
+
3058 NK_API void nk_tree_element_pop(struct nk_context*);
+
3059 
+
3060 /* =============================================================================
+
3061  *
+
3062  * LIST VIEW
+
3063  *
+
3064  * ============================================================================= */
+ +
3066 /* public: */
+
3067  int begin, end, count;
+
3068 /* private: */
+
3069  int total_height;
+
3070  struct nk_context *ctx;
+
3071  nk_uint *scroll_pointer;
+
3072  nk_uint scroll_value;
+
3073 };
+
3074 NK_API nk_bool nk_list_view_begin(struct nk_context*, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count);
+
3075 NK_API void nk_list_view_end(struct nk_list_view*);
+
3076 /* =============================================================================
+
3077  *
+
3078  * WIDGET
+
3079  *
+
3080  * ============================================================================= */
+ + + + + +
3086 };
+ +
3088  NK_WIDGET_STATE_MODIFIED = NK_FLAG(1),
+
3089  NK_WIDGET_STATE_INACTIVE = NK_FLAG(2),
+ +
3091  NK_WIDGET_STATE_HOVER = NK_FLAG(4),
+ +
3093  NK_WIDGET_STATE_LEFT = NK_FLAG(6),
+
3094  NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED,
+
3095  NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED
+
3096 };
+
3097 NK_API enum nk_widget_layout_states nk_widget(struct nk_rect*, const struct nk_context*);
+
3098 NK_API enum nk_widget_layout_states nk_widget_fitting(struct nk_rect*, const struct nk_context*, struct nk_vec2);
+
3099 NK_API struct nk_rect nk_widget_bounds(const struct nk_context*);
+
3100 NK_API struct nk_vec2 nk_widget_position(const struct nk_context*);
+
3101 NK_API struct nk_vec2 nk_widget_size(const struct nk_context*);
+
3102 NK_API float nk_widget_width(const struct nk_context*);
+
3103 NK_API float nk_widget_height(const struct nk_context*);
+
3104 NK_API nk_bool nk_widget_is_hovered(const struct nk_context*);
+
3105 NK_API nk_bool nk_widget_is_mouse_clicked(const struct nk_context*, enum nk_buttons);
+
3106 NK_API nk_bool nk_widget_has_mouse_click_down(const struct nk_context*, enum nk_buttons, nk_bool down);
+
3107 NK_API void nk_spacing(struct nk_context*, int cols);
+
3108 NK_API void nk_widget_disable_begin(struct nk_context* ctx);
+
3109 NK_API void nk_widget_disable_end(struct nk_context* ctx);
+
3110 /* =============================================================================
+
3111  *
+
3112  * TEXT
+
3113  *
+
3114  * ============================================================================= */
+
3115 enum nk_text_align {
+
3116  NK_TEXT_ALIGN_LEFT = 0x01,
+
3117  NK_TEXT_ALIGN_CENTERED = 0x02,
+
3118  NK_TEXT_ALIGN_RIGHT = 0x04,
+
3119  NK_TEXT_ALIGN_TOP = 0x08,
+
3120  NK_TEXT_ALIGN_MIDDLE = 0x10,
+
3121  NK_TEXT_ALIGN_BOTTOM = 0x20
+
3122 };
+
3123 enum nk_text_alignment {
+
3124  NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT,
+
3125  NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED,
+
3126  NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT
+
3127 };
+
3128 NK_API void nk_text(struct nk_context*, const char*, int, nk_flags);
+
3129 NK_API void nk_text_colored(struct nk_context*, const char*, int, nk_flags, struct nk_color);
+
3130 NK_API void nk_text_wrap(struct nk_context*, const char*, int);
+
3131 NK_API void nk_text_wrap_colored(struct nk_context*, const char*, int, struct nk_color);
+
3132 NK_API void nk_label(struct nk_context*, const char*, nk_flags align);
+
3133 NK_API void nk_label_colored(struct nk_context*, const char*, nk_flags align, struct nk_color);
+
3134 NK_API void nk_label_wrap(struct nk_context*, const char*);
+
3135 NK_API void nk_label_colored_wrap(struct nk_context*, const char*, struct nk_color);
+
3136 NK_API void nk_image(struct nk_context*, struct nk_image);
+
3137 NK_API void nk_image_color(struct nk_context*, struct nk_image, struct nk_color);
+
3138 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
3139 NK_API void nk_labelf(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(3);
+
3140 NK_API void nk_labelf_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(4);
+
3141 NK_API void nk_labelf_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(2);
+
3142 NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(3);
+
3143 NK_API void nk_labelfv(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
+
3144 NK_API void nk_labelfv_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(4);
+
3145 NK_API void nk_labelfv_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
+
3146 NK_API void nk_labelfv_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
+
3147 NK_API void nk_value_bool(struct nk_context*, const char *prefix, int);
+
3148 NK_API void nk_value_int(struct nk_context*, const char *prefix, int);
+
3149 NK_API void nk_value_uint(struct nk_context*, const char *prefix, unsigned int);
+
3150 NK_API void nk_value_float(struct nk_context*, const char *prefix, float);
+
3151 NK_API void nk_value_color_byte(struct nk_context*, const char *prefix, struct nk_color);
+
3152 NK_API void nk_value_color_float(struct nk_context*, const char *prefix, struct nk_color);
+
3153 NK_API void nk_value_color_hex(struct nk_context*, const char *prefix, struct nk_color);
+
3154 #endif
+
3155 /* =============================================================================
+
3156  *
+
3157  * BUTTON
+
3158  *
+
3159  * ============================================================================= */
+
3160 NK_API nk_bool nk_button_text(struct nk_context*, const char *title, int len);
+
3161 NK_API nk_bool nk_button_label(struct nk_context*, const char *title);
+
3162 NK_API nk_bool nk_button_color(struct nk_context*, struct nk_color);
+
3163 NK_API nk_bool nk_button_symbol(struct nk_context*, enum nk_symbol_type);
+
3164 NK_API nk_bool nk_button_image(struct nk_context*, struct nk_image img);
+
3165 NK_API nk_bool nk_button_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags text_alignment);
+
3166 NK_API nk_bool nk_button_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
+
3167 NK_API nk_bool nk_button_image_label(struct nk_context*, struct nk_image img, const char*, nk_flags text_alignment);
+
3168 NK_API nk_bool nk_button_image_text(struct nk_context*, struct nk_image img, const char*, int, nk_flags alignment);
+
3169 NK_API nk_bool nk_button_text_styled(struct nk_context*, const struct nk_style_button*, const char *title, int len);
+
3170 NK_API nk_bool nk_button_label_styled(struct nk_context*, const struct nk_style_button*, const char *title);
+
3171 NK_API nk_bool nk_button_symbol_styled(struct nk_context*, const struct nk_style_button*, enum nk_symbol_type);
+
3172 NK_API nk_bool nk_button_image_styled(struct nk_context*, const struct nk_style_button*, struct nk_image img);
+
3173 NK_API nk_bool nk_button_symbol_text_styled(struct nk_context*,const struct nk_style_button*, enum nk_symbol_type, const char*, int, nk_flags alignment);
+
3174 NK_API nk_bool nk_button_symbol_label_styled(struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align);
+
3175 NK_API nk_bool nk_button_image_label_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, nk_flags text_alignment);
+
3176 NK_API nk_bool nk_button_image_text_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, int, nk_flags alignment);
+
3177 NK_API void nk_button_set_behavior(struct nk_context*, enum nk_button_behavior);
+
3178 NK_API nk_bool nk_button_push_behavior(struct nk_context*, enum nk_button_behavior);
+
3179 NK_API nk_bool nk_button_pop_behavior(struct nk_context*);
+
3180 /* =============================================================================
+
3181  *
+
3182  * CHECKBOX
+
3183  *
+
3184  * ============================================================================= */
+
3185 NK_API nk_bool nk_check_label(struct nk_context*, const char*, nk_bool active);
+
3186 NK_API nk_bool nk_check_text(struct nk_context*, const char*, int, nk_bool active);
+
3187 NK_API nk_bool nk_check_text_align(struct nk_context*, const char*, int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
+
3188 NK_API unsigned nk_check_flags_label(struct nk_context*, const char*, unsigned int flags, unsigned int value);
+
3189 NK_API unsigned nk_check_flags_text(struct nk_context*, const char*, int, unsigned int flags, unsigned int value);
+
3190 NK_API nk_bool nk_checkbox_label(struct nk_context*, const char*, nk_bool *active);
+
3191 NK_API nk_bool nk_checkbox_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
+
3192 NK_API nk_bool nk_checkbox_text(struct nk_context*, const char*, int, nk_bool *active);
+
3193 NK_API nk_bool nk_checkbox_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
+
3194 NK_API nk_bool nk_checkbox_flags_label(struct nk_context*, const char*, unsigned int *flags, unsigned int value);
+
3195 NK_API nk_bool nk_checkbox_flags_text(struct nk_context*, const char*, int, unsigned int *flags, unsigned int value);
+
3196 /* =============================================================================
+
3197  *
+
3198  * RADIO BUTTON
+
3199  *
+
3200  * ============================================================================= */
+
3201 NK_API nk_bool nk_radio_label(struct nk_context*, const char*, nk_bool *active);
+
3202 NK_API nk_bool nk_radio_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
+
3203 NK_API nk_bool nk_radio_text(struct nk_context*, const char*, int, nk_bool *active);
+
3204 NK_API nk_bool nk_radio_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment);
+
3205 NK_API nk_bool nk_option_label(struct nk_context*, const char*, nk_bool active);
+
3206 NK_API nk_bool nk_option_label_align(struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment);
+
3207 NK_API nk_bool nk_option_text(struct nk_context*, const char*, int, nk_bool active);
+
3208 NK_API nk_bool nk_option_text_align(struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment);
+
3209 /* =============================================================================
+
3210  *
+
3211  * SELECTABLE
+
3212  *
+
3213  * ============================================================================= */
+
3214 NK_API nk_bool nk_selectable_label(struct nk_context*, const char*, nk_flags align, nk_bool *value);
+
3215 NK_API nk_bool nk_selectable_text(struct nk_context*, const char*, int, nk_flags align, nk_bool *value);
+
3216 NK_API nk_bool nk_selectable_image_label(struct nk_context*,struct nk_image, const char*, nk_flags align, nk_bool *value);
+
3217 NK_API nk_bool nk_selectable_image_text(struct nk_context*,struct nk_image, const char*, int, nk_flags align, nk_bool *value);
+
3218 NK_API nk_bool nk_selectable_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, nk_bool *value);
+
3219 NK_API nk_bool nk_selectable_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, nk_bool *value);
+
3220 
+
3221 NK_API nk_bool nk_select_label(struct nk_context*, const char*, nk_flags align, nk_bool value);
+
3222 NK_API nk_bool nk_select_text(struct nk_context*, const char*, int, nk_flags align, nk_bool value);
+
3223 NK_API nk_bool nk_select_image_label(struct nk_context*, struct nk_image,const char*, nk_flags align, nk_bool value);
+
3224 NK_API nk_bool nk_select_image_text(struct nk_context*, struct nk_image,const char*, int, nk_flags align, nk_bool value);
+
3225 NK_API nk_bool nk_select_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, nk_bool value);
+
3226 NK_API nk_bool nk_select_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, nk_bool value);
+
3227 
+
3228 /* =============================================================================
+
3229  *
+
3230  * SLIDER
+
3231  *
+
3232  * ============================================================================= */
+
3233 NK_API float nk_slide_float(struct nk_context*, float min, float val, float max, float step);
+
3234 NK_API int nk_slide_int(struct nk_context*, int min, int val, int max, int step);
+
3235 NK_API nk_bool nk_slider_float(struct nk_context*, float min, float *val, float max, float step);
+
3236 NK_API nk_bool nk_slider_int(struct nk_context*, int min, int *val, int max, int step);
+
3237 
+
3238 /* =============================================================================
+
3239  *
+
3240  * KNOB
+
3241  *
+
3242  * ============================================================================= */
+
3243 NK_API nk_bool nk_knob_float(struct nk_context*, float min, float *val, float max, float step, enum nk_heading zero_direction, float dead_zone_degrees);
+
3244 NK_API nk_bool nk_knob_int(struct nk_context*, int min, int *val, int max, int step, enum nk_heading zero_direction, float dead_zone_degrees);
+
3245 
+
3246 /* =============================================================================
+
3247  *
+
3248  * PROGRESSBAR
+
3249  *
+
3250  * ============================================================================= */
+
3251 NK_API nk_bool nk_progress(struct nk_context*, nk_size *cur, nk_size max, nk_bool modifyable);
+
3252 NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, nk_bool modifyable);
+
3253 
+
3254 /* =============================================================================
+
3255  *
+
3256  * COLOR PICKER
+
3257  *
+
3258  * ============================================================================= */
+
3259 NK_API struct nk_colorf nk_color_picker(struct nk_context*, struct nk_colorf, enum nk_color_format);
+
3260 NK_API nk_bool nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_color_format);
+
3261 /* =============================================================================
+
3262  *
+
3263  * PROPERTIES
+
3264  *
+
3265  * =============================================================================*/
+
3358 NK_API void nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
+
3359 
+
3381 NK_API void nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
+
3382 
+
3404 NK_API void nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel);
+
3405 
+
3427 NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel);
+
3428 
+
3450 NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel);
+
3451 
+
3473 NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel);
+
3474 
+
3475 /* =============================================================================
+
3476  *
+
3477  * TEXT EDIT
+
3478  *
+
3479  * ============================================================================= */
+
3480 enum nk_edit_flags {
+
3481  NK_EDIT_DEFAULT = 0,
+
3482  NK_EDIT_READ_ONLY = NK_FLAG(0),
+
3483  NK_EDIT_AUTO_SELECT = NK_FLAG(1),
+
3484  NK_EDIT_SIG_ENTER = NK_FLAG(2),
+
3485  NK_EDIT_ALLOW_TAB = NK_FLAG(3),
+
3486  NK_EDIT_NO_CURSOR = NK_FLAG(4),
+
3487  NK_EDIT_SELECTABLE = NK_FLAG(5),
+
3488  NK_EDIT_CLIPBOARD = NK_FLAG(6),
+
3489  NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7),
+
3490  NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8),
+
3491  NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9),
+
3492  NK_EDIT_MULTILINE = NK_FLAG(10),
+
3493  NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11)
+
3494 };
+
3495 enum nk_edit_types {
+
3496  NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE,
+
3497  NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD,
+
3498  NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD,
+
3499  NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD
+
3500 };
+ +
3502  NK_EDIT_ACTIVE = NK_FLAG(0),
+
3503  NK_EDIT_INACTIVE = NK_FLAG(1),
+
3504  NK_EDIT_ACTIVATED = NK_FLAG(2),
+
3505  NK_EDIT_DEACTIVATED = NK_FLAG(3),
+
3506  NK_EDIT_COMMITED = NK_FLAG(4)
+
3507 };
+
3508 NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter);
+
3509 NK_API nk_flags nk_edit_string_zero_terminated(struct nk_context*, nk_flags, char *buffer, int max, nk_plugin_filter);
+
3510 NK_API nk_flags nk_edit_buffer(struct nk_context*, nk_flags, struct nk_text_edit*, nk_plugin_filter);
+
3511 NK_API void nk_edit_focus(struct nk_context*, nk_flags flags);
+
3512 NK_API void nk_edit_unfocus(struct nk_context*);
+
3513 /* =============================================================================
+
3514  *
+
3515  * CHART
+
3516  *
+
3517  * ============================================================================= */
+
3518 NK_API nk_bool nk_chart_begin(struct nk_context*, enum nk_chart_type, int num, float min, float max);
+
3519 NK_API nk_bool nk_chart_begin_colored(struct nk_context*, enum nk_chart_type, struct nk_color, struct nk_color active, int num, float min, float max);
+
3520 NK_API void nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type, int count, float min_value, float max_value);
+
3521 NK_API void nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type, struct nk_color, struct nk_color active, int count, float min_value, float max_value);
+
3522 NK_API nk_flags nk_chart_push(struct nk_context*, float);
+
3523 NK_API nk_flags nk_chart_push_slot(struct nk_context*, float, int);
+
3524 NK_API void nk_chart_end(struct nk_context*);
+
3525 NK_API void nk_plot(struct nk_context*, enum nk_chart_type, const float *values, int count, int offset);
+
3526 NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userdata, float(*value_getter)(void* user, int index), int count, int offset);
+
3527 /* =============================================================================
+
3528  *
+
3529  * POPUP
+
3530  *
+
3531  * ============================================================================= */
+
3532 NK_API nk_bool nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds);
+
3533 NK_API void nk_popup_close(struct nk_context*);
+
3534 NK_API void nk_popup_end(struct nk_context*);
+
3535 NK_API void nk_popup_get_scroll(const struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
+
3536 NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y);
+
3537 /* =============================================================================
+
3538  *
+
3539  * COMBOBOX
+
3540  *
+
3541  * ============================================================================= */
+
3542 NK_API int nk_combo(struct nk_context*, const char *const *items, int count, int selected, int item_height, struct nk_vec2 size);
+
3543 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);
+
3544 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);
+
3545 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);
+
3546 NK_API void nk_combobox(struct nk_context*, const char *const *items, int count, int *selected, int item_height, struct nk_vec2 size);
+
3547 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);
+
3548 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);
+
3549 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);
+
3550 /* =============================================================================
+
3551  *
+
3552  * ABSTRACT COMBOBOX
+
3553  *
+
3554  * ============================================================================= */
+
3555 NK_API nk_bool nk_combo_begin_text(struct nk_context*, const char *selected, int, struct nk_vec2 size);
+
3556 NK_API nk_bool nk_combo_begin_label(struct nk_context*, const char *selected, struct nk_vec2 size);
+
3557 NK_API nk_bool nk_combo_begin_color(struct nk_context*, struct nk_color color, struct nk_vec2 size);
+
3558 NK_API nk_bool nk_combo_begin_symbol(struct nk_context*, enum nk_symbol_type, struct nk_vec2 size);
+
3559 NK_API nk_bool nk_combo_begin_symbol_label(struct nk_context*, const char *selected, enum nk_symbol_type, struct nk_vec2 size);
+
3560 NK_API nk_bool nk_combo_begin_symbol_text(struct nk_context*, const char *selected, int, enum nk_symbol_type, struct nk_vec2 size);
+
3561 NK_API nk_bool nk_combo_begin_image(struct nk_context*, struct nk_image img, struct nk_vec2 size);
+
3562 NK_API nk_bool nk_combo_begin_image_label(struct nk_context*, const char *selected, struct nk_image, struct nk_vec2 size);
+
3563 NK_API nk_bool nk_combo_begin_image_text(struct nk_context*, const char *selected, int, struct nk_image, struct nk_vec2 size);
+
3564 NK_API nk_bool nk_combo_item_label(struct nk_context*, const char*, nk_flags alignment);
+
3565 NK_API nk_bool nk_combo_item_text(struct nk_context*, const char*,int, nk_flags alignment);
+
3566 NK_API nk_bool nk_combo_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
+
3567 NK_API nk_bool nk_combo_item_image_text(struct nk_context*, struct nk_image, const char*, int,nk_flags alignment);
+
3568 NK_API nk_bool nk_combo_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
+
3569 NK_API nk_bool nk_combo_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
+
3570 NK_API void nk_combo_close(struct nk_context*);
+
3571 NK_API void nk_combo_end(struct nk_context*);
+
3572 /* =============================================================================
+
3573  *
+
3574  * CONTEXTUAL
+
3575  *
+
3576  * ============================================================================= */
+
3577 NK_API nk_bool nk_contextual_begin(struct nk_context*, nk_flags, struct nk_vec2, struct nk_rect trigger_bounds);
+
3578 NK_API nk_bool nk_contextual_item_text(struct nk_context*, const char*, int,nk_flags align);
+
3579 NK_API nk_bool nk_contextual_item_label(struct nk_context*, const char*, nk_flags align);
+
3580 NK_API nk_bool nk_contextual_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
+
3581 NK_API nk_bool nk_contextual_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
+
3582 NK_API nk_bool nk_contextual_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
+
3583 NK_API nk_bool nk_contextual_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
+
3584 NK_API void nk_contextual_close(struct nk_context*);
+
3585 NK_API void nk_contextual_end(struct nk_context*);
+
3586 /* =============================================================================
+
3587  *
+
3588  * TOOLTIP
+
3589  *
+
3590  * ============================================================================= */
+
3591 NK_API void nk_tooltip(struct nk_context*, const char*);
+
3592 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
3593 NK_API void nk_tooltipf(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(2);
+
3594 NK_API void nk_tooltipfv(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
+
3595 #endif
+
3596 NK_API nk_bool nk_tooltip_begin(struct nk_context*, float width);
+
3597 NK_API void nk_tooltip_end(struct nk_context*);
+
3598 /* =============================================================================
+
3599  *
+
3600  * MENU
+
3601  *
+
3602  * ============================================================================= */
+
3603 NK_API void nk_menubar_begin(struct nk_context*);
+
3604 NK_API void nk_menubar_end(struct nk_context*);
+
3605 NK_API nk_bool nk_menu_begin_text(struct nk_context*, const char* title, int title_len, nk_flags align, struct nk_vec2 size);
+
3606 NK_API nk_bool nk_menu_begin_label(struct nk_context*, const char*, nk_flags align, struct nk_vec2 size);
+
3607 NK_API nk_bool nk_menu_begin_image(struct nk_context*, const char*, struct nk_image, struct nk_vec2 size);
+
3608 NK_API nk_bool nk_menu_begin_image_text(struct nk_context*, const char*, int,nk_flags align,struct nk_image, struct nk_vec2 size);
+
3609 NK_API nk_bool nk_menu_begin_image_label(struct nk_context*, const char*, nk_flags align,struct nk_image, struct nk_vec2 size);
+
3610 NK_API nk_bool nk_menu_begin_symbol(struct nk_context*, const char*, enum nk_symbol_type, struct nk_vec2 size);
+
3611 NK_API nk_bool nk_menu_begin_symbol_text(struct nk_context*, const char*, int,nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
+
3612 NK_API nk_bool nk_menu_begin_symbol_label(struct nk_context*, const char*, nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
+
3613 NK_API nk_bool nk_menu_item_text(struct nk_context*, const char*, int,nk_flags align);
+
3614 NK_API nk_bool nk_menu_item_label(struct nk_context*, const char*, nk_flags alignment);
+
3615 NK_API nk_bool nk_menu_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
+
3616 NK_API nk_bool nk_menu_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
+
3617 NK_API nk_bool nk_menu_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
+
3618 NK_API nk_bool nk_menu_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
+
3619 NK_API void nk_menu_close(struct nk_context*);
+
3620 NK_API void nk_menu_end(struct nk_context*);
+
3621 /* =============================================================================
+
3622  *
+
3623  * STYLE
+
3624  *
+
3625  * ============================================================================= */
+
3626 
+
3627 #define NK_WIDGET_DISABLED_FACTOR 0.5f
+
3628 
+
3629 enum nk_style_colors {
+
3630  NK_COLOR_TEXT,
+
3631  NK_COLOR_WINDOW,
+
3632  NK_COLOR_HEADER,
+
3633  NK_COLOR_BORDER,
+
3634  NK_COLOR_BUTTON,
+
3635  NK_COLOR_BUTTON_HOVER,
+
3636  NK_COLOR_BUTTON_ACTIVE,
+
3637  NK_COLOR_TOGGLE,
+
3638  NK_COLOR_TOGGLE_HOVER,
+
3639  NK_COLOR_TOGGLE_CURSOR,
+
3640  NK_COLOR_SELECT,
+
3641  NK_COLOR_SELECT_ACTIVE,
+
3642  NK_COLOR_SLIDER,
+
3643  NK_COLOR_SLIDER_CURSOR,
+
3644  NK_COLOR_SLIDER_CURSOR_HOVER,
+
3645  NK_COLOR_SLIDER_CURSOR_ACTIVE,
+
3646  NK_COLOR_PROPERTY,
+
3647  NK_COLOR_EDIT,
+
3648  NK_COLOR_EDIT_CURSOR,
+
3649  NK_COLOR_COMBO,
+
3650  NK_COLOR_CHART,
+
3651  NK_COLOR_CHART_COLOR,
+
3652  NK_COLOR_CHART_COLOR_HIGHLIGHT,
+
3653  NK_COLOR_SCROLLBAR,
+
3654  NK_COLOR_SCROLLBAR_CURSOR,
+
3655  NK_COLOR_SCROLLBAR_CURSOR_HOVER,
+
3656  NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,
+
3657  NK_COLOR_TAB_HEADER,
+
3658  NK_COLOR_KNOB,
+
3659  NK_COLOR_KNOB_CURSOR,
+
3660  NK_COLOR_KNOB_CURSOR_HOVER,
+
3661  NK_COLOR_KNOB_CURSOR_ACTIVE,
+
3662  NK_COLOR_COUNT
+
3663 };
+
3664 enum nk_style_cursor {
+
3665  NK_CURSOR_ARROW,
+
3666  NK_CURSOR_TEXT,
+
3667  NK_CURSOR_MOVE,
+
3668  NK_CURSOR_RESIZE_VERTICAL,
+
3669  NK_CURSOR_RESIZE_HORIZONTAL,
+
3670  NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT,
+
3671  NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT,
+
3672  NK_CURSOR_COUNT
+
3673 };
+
3674 NK_API void nk_style_default(struct nk_context*);
+
3675 NK_API void nk_style_from_table(struct nk_context*, const struct nk_color*);
+
3676 NK_API void nk_style_load_cursor(struct nk_context*, enum nk_style_cursor, const struct nk_cursor*);
+
3677 NK_API void nk_style_load_all_cursors(struct nk_context*, const struct nk_cursor*);
+
3678 NK_API const char* nk_style_get_color_by_name(enum nk_style_colors);
+
3679 NK_API void nk_style_set_font(struct nk_context*, const struct nk_user_font*);
+
3680 NK_API nk_bool nk_style_set_cursor(struct nk_context*, enum nk_style_cursor);
+
3681 NK_API void nk_style_show_cursor(struct nk_context*);
+
3682 NK_API void nk_style_hide_cursor(struct nk_context*);
+
3683 
+
3684 NK_API nk_bool nk_style_push_font(struct nk_context*, const struct nk_user_font*);
+
3685 NK_API nk_bool nk_style_push_float(struct nk_context*, float*, float);
+
3686 NK_API nk_bool nk_style_push_vec2(struct nk_context*, struct nk_vec2*, struct nk_vec2);
+
3687 NK_API nk_bool nk_style_push_style_item(struct nk_context*, struct nk_style_item*, struct nk_style_item);
+
3688 NK_API nk_bool nk_style_push_flags(struct nk_context*, nk_flags*, nk_flags);
+
3689 NK_API nk_bool nk_style_push_color(struct nk_context*, struct nk_color*, struct nk_color);
+
3690 
+
3691 NK_API nk_bool nk_style_pop_font(struct nk_context*);
+
3692 NK_API nk_bool nk_style_pop_float(struct nk_context*);
+
3693 NK_API nk_bool nk_style_pop_vec2(struct nk_context*);
+
3694 NK_API nk_bool nk_style_pop_style_item(struct nk_context*);
+
3695 NK_API nk_bool nk_style_pop_flags(struct nk_context*);
+
3696 NK_API nk_bool nk_style_pop_color(struct nk_context*);
+
3697 /* =============================================================================
+
3698  *
+
3699  * COLOR
+
3700  *
+
3701  * ============================================================================= */
+
3702 NK_API struct nk_color nk_rgb(int r, int g, int b);
+
3703 NK_API struct nk_color nk_rgb_iv(const int *rgb);
+
3704 NK_API struct nk_color nk_rgb_bv(const nk_byte* rgb);
+
3705 NK_API struct nk_color nk_rgb_f(float r, float g, float b);
+
3706 NK_API struct nk_color nk_rgb_fv(const float *rgb);
+
3707 NK_API struct nk_color nk_rgb_cf(struct nk_colorf c);
+
3708 NK_API struct nk_color nk_rgb_hex(const char *rgb);
+
3709 NK_API struct nk_color nk_rgb_factor(struct nk_color col, float factor);
+
3710 
+
3711 NK_API struct nk_color nk_rgba(int r, int g, int b, int a);
+
3712 NK_API struct nk_color nk_rgba_u32(nk_uint);
+
3713 NK_API struct nk_color nk_rgba_iv(const int *rgba);
+
3714 NK_API struct nk_color nk_rgba_bv(const nk_byte *rgba);
+
3715 NK_API struct nk_color nk_rgba_f(float r, float g, float b, float a);
+
3716 NK_API struct nk_color nk_rgba_fv(const float *rgba);
+
3717 NK_API struct nk_color nk_rgba_cf(struct nk_colorf c);
+
3718 NK_API struct nk_color nk_rgba_hex(const char *rgb);
+
3719 
+
3720 NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
+
3721 NK_API struct nk_colorf nk_hsva_colorfv(const float *c);
+
3722 NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in);
+
3723 NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in);
+
3724 
+
3725 NK_API struct nk_color nk_hsv(int h, int s, int v);
+
3726 NK_API struct nk_color nk_hsv_iv(const int *hsv);
+
3727 NK_API struct nk_color nk_hsv_bv(const nk_byte *hsv);
+
3728 NK_API struct nk_color nk_hsv_f(float h, float s, float v);
+
3729 NK_API struct nk_color nk_hsv_fv(const float *hsv);
+
3730 
+
3731 NK_API struct nk_color nk_hsva(int h, int s, int v, int a);
+
3732 NK_API struct nk_color nk_hsva_iv(const int *hsva);
+
3733 NK_API struct nk_color nk_hsva_bv(const nk_byte *hsva);
+
3734 NK_API struct nk_color nk_hsva_f(float h, float s, float v, float a);
+
3735 NK_API struct nk_color nk_hsva_fv(const float *hsva);
+
3736 
+
3737 /* color (conversion nuklear --> user) */
+
3738 NK_API void nk_color_f(float *r, float *g, float *b, float *a, struct nk_color);
+
3739 NK_API void nk_color_fv(float *rgba_out, struct nk_color);
+
3740 NK_API struct nk_colorf nk_color_cf(struct nk_color);
+
3741 NK_API void nk_color_d(double *r, double *g, double *b, double *a, struct nk_color);
+
3742 NK_API void nk_color_dv(double *rgba_out, struct nk_color);
+
3743 
+
3744 NK_API nk_uint nk_color_u32(struct nk_color);
+
3745 NK_API void nk_color_hex_rgba(char *output, struct nk_color);
+
3746 NK_API void nk_color_hex_rgb(char *output, struct nk_color);
+
3747 
+
3748 NK_API void nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color);
+
3749 NK_API void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color);
+
3750 NK_API void nk_color_hsv_iv(int *hsv_out, struct nk_color);
+
3751 NK_API void nk_color_hsv_bv(nk_byte *hsv_out, struct nk_color);
+
3752 NK_API void nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color);
+
3753 NK_API void nk_color_hsv_fv(float *hsv_out, struct nk_color);
+
3754 
+
3755 NK_API void nk_color_hsva_i(int *h, int *s, int *v, int *a, struct nk_color);
+
3756 NK_API void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color);
+
3757 NK_API void nk_color_hsva_iv(int *hsva_out, struct nk_color);
+
3758 NK_API void nk_color_hsva_bv(nk_byte *hsva_out, struct nk_color);
+
3759 NK_API void nk_color_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_color);
+
3760 NK_API void nk_color_hsva_fv(float *hsva_out, struct nk_color);
+
3761 /* =============================================================================
+
3762  *
+
3763  * IMAGE
+
3764  *
+
3765  * ============================================================================= */
+
3766 NK_API nk_handle nk_handle_ptr(void*);
+
3767 NK_API nk_handle nk_handle_id(int);
+
3768 NK_API struct nk_image nk_image_handle(nk_handle);
+
3769 NK_API struct nk_image nk_image_ptr(void*);
+
3770 NK_API struct nk_image nk_image_id(int);
+
3771 NK_API nk_bool nk_image_is_subimage(const struct nk_image* img);
+
3772 NK_API struct nk_image nk_subimage_ptr(void*, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
+
3773 NK_API struct nk_image nk_subimage_id(int, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
+
3774 NK_API struct nk_image nk_subimage_handle(nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region);
+
3775 /* =============================================================================
+
3776  *
+
3777  * 9-SLICE
+
3778  *
+
3779  * ============================================================================= */
+
3780 NK_API struct nk_nine_slice nk_nine_slice_handle(nk_handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3781 NK_API struct nk_nine_slice nk_nine_slice_ptr(void*, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3782 NK_API struct nk_nine_slice nk_nine_slice_id(int, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3783 NK_API int nk_nine_slice_is_sub9slice(const struct nk_nine_slice* img);
+
3784 NK_API struct nk_nine_slice nk_sub9slice_ptr(void*, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3785 NK_API struct nk_nine_slice nk_sub9slice_id(int, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3786 NK_API struct nk_nine_slice nk_sub9slice_handle(nk_handle, nk_ushort w, nk_ushort h, struct nk_rect sub_region, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b);
+
3787 /* =============================================================================
+
3788  *
+
3789  * MATH
+
3790  *
+
3791  * ============================================================================= */
+
3792 NK_API nk_hash nk_murmur_hash(const void *key, int len, nk_hash seed);
+
3793 NK_API void nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r, float pad_x, float pad_y, enum nk_heading);
+
3794 
+
3795 NK_API struct nk_vec2 nk_vec2(float x, float y);
+
3796 NK_API struct nk_vec2 nk_vec2i(int x, int y);
+
3797 NK_API struct nk_vec2 nk_vec2v(const float *xy);
+
3798 NK_API struct nk_vec2 nk_vec2iv(const int *xy);
+
3799 
+
3800 NK_API struct nk_rect nk_get_null_rect(void);
+
3801 NK_API struct nk_rect nk_rect(float x, float y, float w, float h);
+
3802 NK_API struct nk_rect nk_recti(int x, int y, int w, int h);
+
3803 NK_API struct nk_rect nk_recta(struct nk_vec2 pos, struct nk_vec2 size);
+
3804 NK_API struct nk_rect nk_rectv(const float *xywh);
+
3805 NK_API struct nk_rect nk_rectiv(const int *xywh);
+
3806 NK_API struct nk_vec2 nk_rect_pos(struct nk_rect);
+
3807 NK_API struct nk_vec2 nk_rect_size(struct nk_rect);
+
3808 /* =============================================================================
+
3809  *
+
3810  * STRING
+
3811  *
+
3812  * ============================================================================= */
+
3813 NK_API int nk_strlen(const char *str);
+
3814 NK_API int nk_stricmp(const char *s1, const char *s2);
+
3815 NK_API int nk_stricmpn(const char *s1, const char *s2, int n);
+
3816 NK_API int nk_strtoi(const char *str, char **endptr);
+
3817 NK_API float nk_strtof(const char *str, char **endptr);
+
3818 #ifndef NK_STRTOD
+
3819 #define NK_STRTOD nk_strtod
+
3820 NK_API double nk_strtod(const char *str, char **endptr);
+
3821 #endif
+
3822 NK_API int nk_strfilter(const char *text, const char *regexp);
+
3823 NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score);
+
3824 NK_API int nk_strmatch_fuzzy_text(const char *txt, int txt_len, const char *pattern, int *out_score);
+
3825 /* =============================================================================
+
3826  *
+
3827  * UTF-8
+
3828  *
+
3829  * ============================================================================= */
+
3830 NK_API int nk_utf_decode(const char*, nk_rune*, int);
+
3831 NK_API int nk_utf_encode(nk_rune, char*, int);
+
3832 NK_API int nk_utf_len(const char*, int byte_len);
+
3833 NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune *unicode, int *len);
+
3834 /* ===============================================================
+
3835  *
+
3836  * FONT
+
3837  *
+
3838  * ===============================================================*/
+
3991 struct nk_user_font_glyph;
+
3992 typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len);
+
3993 typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height,
+
3994  struct nk_user_font_glyph *glyph,
+
3995  nk_rune codepoint, nk_rune next_codepoint);
+
3996 
+
3997 #if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
+
3998 struct nk_user_font_glyph {
+
3999  struct nk_vec2 uv[2];
+
4000  struct nk_vec2 offset;
+
4001  float width, height;
+
4002  float xadvance;
+
4003 };
+
4004 #endif
+
4005 
+ +
4007  nk_handle userdata;
+
4008  float height;
+
4009  nk_text_width_f width;
+
4010 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
4011  nk_query_font_glyph_f query;
+
4012  nk_handle texture;
+
4013 #endif
+
4014 };
+
4015 
+
4016 #ifdef NK_INCLUDE_FONT_BAKING
+
4017 enum nk_font_coord_type {
+
4018  NK_COORD_UV,
+
4019  NK_COORD_PIXEL
+
4020 };
+
4021 
+
4022 struct nk_font;
+
4023 struct nk_baked_font {
+
4024  float height;
+
4025  float ascent;
+
4026  float descent;
+
4027  nk_rune glyph_offset;
+
4028  nk_rune glyph_count;
+
4029  const nk_rune *ranges;
+
4030 };
+
4031 
+
4032 struct nk_font_config {
+
4033  struct nk_font_config *next;
+
4034  void *ttf_blob;
+
4035  nk_size ttf_size;
+
4037  unsigned char ttf_data_owned_by_atlas;
+
4038  unsigned char merge_mode;
+
4039  unsigned char pixel_snap;
+
4040  unsigned char oversample_v, oversample_h;
+
4041  unsigned char padding[3];
+
4042 
+
4043  float size;
+
4044  enum nk_font_coord_type coord_type;
+
4045  struct nk_vec2 spacing;
+
4046  const nk_rune *range;
+
4047  struct nk_baked_font *font;
+
4048  nk_rune fallback_glyph;
+
4049  struct nk_font_config *n;
+
4050  struct nk_font_config *p;
+
4051 };
+
4052 
+
4053 struct nk_font_glyph {
+
4054  nk_rune codepoint;
+
4055  float xadvance;
+
4056  float x0, y0, x1, y1, w, h;
+
4057  float u0, v0, u1, v1;
+
4058 };
+
4059 
+
4060 struct nk_font {
+
4061  struct nk_font *next;
+
4062  struct nk_user_font handle;
+
4063  struct nk_baked_font info;
+
4064  float scale;
+
4065  struct nk_font_glyph *glyphs;
+
4066  const struct nk_font_glyph *fallback;
+
4067  nk_rune fallback_codepoint;
+
4068  nk_handle texture;
+
4069  struct nk_font_config *config;
+
4070 };
+
4071 
+
4072 enum nk_font_atlas_format {
+
4073  NK_FONT_ATLAS_ALPHA8,
+
4074  NK_FONT_ATLAS_RGBA32
+
4075 };
+
4076 
+
4077 struct nk_font_atlas {
+
4078  void *pixel;
+
4079  int tex_width;
+
4080  int tex_height;
+
4081 
+
4082  struct nk_allocator permanent;
+
4083  struct nk_allocator temporary;
+
4084 
+
4085  struct nk_recti custom;
+
4086  struct nk_cursor cursors[NK_CURSOR_COUNT];
+
4087 
+
4088  int glyph_count;
+
4089  struct nk_font_glyph *glyphs;
+
4090  struct nk_font *default_font;
+
4091  struct nk_font *fonts;
+
4092  struct nk_font_config *config;
+
4093  int font_num;
+
4094 };
+
4095 
+
4097 NK_API const nk_rune *nk_font_default_glyph_ranges(void);
+
4098 NK_API const nk_rune *nk_font_chinese_glyph_ranges(void);
+
4099 NK_API const nk_rune *nk_font_cyrillic_glyph_ranges(void);
+
4100 NK_API const nk_rune *nk_font_korean_glyph_ranges(void);
+
4101 
+
4102 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
4103 NK_API void nk_font_atlas_init_default(struct nk_font_atlas*);
+
4104 #endif
+
4105 NK_API void nk_font_atlas_init(struct nk_font_atlas*, const struct nk_allocator*);
+
4106 NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, const struct nk_allocator *persistent, const struct nk_allocator *transient);
+
4107 NK_API void nk_font_atlas_begin(struct nk_font_atlas*);
+
4108 NK_API struct nk_font_config nk_font_config(float pixel_height);
+
4109 NK_API struct nk_font *nk_font_atlas_add(struct nk_font_atlas*, const struct nk_font_config*);
+
4110 #ifdef NK_INCLUDE_DEFAULT_FONT
+
4111 NK_API struct nk_font* nk_font_atlas_add_default(struct nk_font_atlas*, float height, const struct nk_font_config*);
+
4112 #endif
+
4113 NK_API struct nk_font* nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, nk_size size, float height, const struct nk_font_config *config);
+
4114 #ifdef NK_INCLUDE_STANDARD_IO
+
4115 NK_API struct nk_font* nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path, float height, const struct nk_font_config*);
+
4116 #endif
+
4117 NK_API struct nk_font *nk_font_atlas_add_compressed(struct nk_font_atlas*, void *memory, nk_size size, float height, const struct nk_font_config*);
+
4118 NK_API struct nk_font* nk_font_atlas_add_compressed_base85(struct nk_font_atlas*, const char *data, float height, const struct nk_font_config *config);
+
4119 NK_API const void* nk_font_atlas_bake(struct nk_font_atlas*, int *width, int *height, enum nk_font_atlas_format);
+
4120 NK_API void nk_font_atlas_end(struct nk_font_atlas*, nk_handle tex, struct nk_draw_null_texture*);
+
4121 NK_API const struct nk_font_glyph* nk_font_find_glyph(const struct nk_font*, nk_rune unicode);
+
4122 NK_API void nk_font_atlas_cleanup(struct nk_font_atlas *atlas);
+
4123 NK_API void nk_font_atlas_clear(struct nk_font_atlas*);
+
4124 
+
4125 #endif
+
4126 
+ +
4164  void *memory;
+
4165  unsigned int type;
+
4166  nk_size size;
+
4167  nk_size allocated;
+
4168  nk_size needed;
+
4169  nk_size calls;
+
4170 };
+
4171 
+
4172 enum nk_allocation_type {
+
4173  NK_BUFFER_FIXED,
+
4174  NK_BUFFER_DYNAMIC
+
4175 };
+
4176 
+
4177 enum nk_buffer_allocation_type {
+
4178  NK_BUFFER_FRONT,
+
4179  NK_BUFFER_BACK,
+
4180  NK_BUFFER_MAX
+
4181 };
+
4182 
+ +
4184  nk_bool active;
+
4185  nk_size offset;
+
4186 };
+
4187 
+
4188 struct nk_memory {void *ptr;nk_size size;};
+
4189 struct nk_buffer {
+
4190  struct nk_buffer_marker marker[NK_BUFFER_MAX];
+
4191  struct nk_allocator pool;
+
4192  enum nk_allocation_type type;
+
4193  struct nk_memory memory;
+
4194  float grow_factor;
+
4195  nk_size allocated;
+
4196  nk_size needed;
+
4197  nk_size calls;
+
4198  nk_size size;
+
4199 };
+
4200 
+
4201 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
4202 NK_API void nk_buffer_init_default(struct nk_buffer*);
+
4203 #endif
+
4204 NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size);
+
4205 NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size);
+
4206 NK_API void nk_buffer_info(struct nk_memory_status*, const struct nk_buffer*);
+
4207 NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align);
+
4208 NK_API void nk_buffer_mark(struct nk_buffer*, enum nk_buffer_allocation_type type);
+
4209 NK_API void nk_buffer_reset(struct nk_buffer*, enum nk_buffer_allocation_type type);
+
4210 NK_API void nk_buffer_clear(struct nk_buffer*);
+
4211 NK_API void nk_buffer_free(struct nk_buffer*);
+
4212 NK_API void *nk_buffer_memory(struct nk_buffer*);
+
4213 NK_API const void *nk_buffer_memory_const(const struct nk_buffer*);
+
4214 NK_API nk_size nk_buffer_total(const struct nk_buffer*);
+
4215 
+
4226 struct nk_str {
+
4227  struct nk_buffer buffer;
+
4228  int len;
+
4229 };
+
4230 
+
4231 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
4232 NK_API void nk_str_init_default(struct nk_str*);
+
4233 #endif
+
4234 NK_API void nk_str_init(struct nk_str*, const struct nk_allocator*, nk_size size);
+
4235 NK_API void nk_str_init_fixed(struct nk_str*, void *memory, nk_size size);
+
4236 NK_API void nk_str_clear(struct nk_str*);
+
4237 NK_API void nk_str_free(struct nk_str*);
+
4238 
+
4239 NK_API int nk_str_append_text_char(struct nk_str*, const char*, int);
+
4240 NK_API int nk_str_append_str_char(struct nk_str*, const char*);
+
4241 NK_API int nk_str_append_text_utf8(struct nk_str*, const char*, int);
+
4242 NK_API int nk_str_append_str_utf8(struct nk_str*, const char*);
+
4243 NK_API int nk_str_append_text_runes(struct nk_str*, const nk_rune*, int);
+
4244 NK_API int nk_str_append_str_runes(struct nk_str*, const nk_rune*);
+
4245 
+
4246 NK_API int nk_str_insert_at_char(struct nk_str*, int pos, const char*, int);
+
4247 NK_API int nk_str_insert_at_rune(struct nk_str*, int pos, const char*, int);
+
4248 
+
4249 NK_API int nk_str_insert_text_char(struct nk_str*, int pos, const char*, int);
+
4250 NK_API int nk_str_insert_str_char(struct nk_str*, int pos, const char*);
+
4251 NK_API int nk_str_insert_text_utf8(struct nk_str*, int pos, const char*, int);
+
4252 NK_API int nk_str_insert_str_utf8(struct nk_str*, int pos, const char*);
+
4253 NK_API int nk_str_insert_text_runes(struct nk_str*, int pos, const nk_rune*, int);
+
4254 NK_API int nk_str_insert_str_runes(struct nk_str*, int pos, const nk_rune*);
+
4255 
+
4256 NK_API void nk_str_remove_chars(struct nk_str*, int len);
+
4257 NK_API void nk_str_remove_runes(struct nk_str *str, int len);
+
4258 NK_API void nk_str_delete_chars(struct nk_str*, int pos, int len);
+
4259 NK_API void nk_str_delete_runes(struct nk_str*, int pos, int len);
+
4260 
+
4261 NK_API char *nk_str_at_char(struct nk_str*, int pos);
+
4262 NK_API char *nk_str_at_rune(struct nk_str*, int pos, nk_rune *unicode, int *len);
+
4263 NK_API nk_rune nk_str_rune_at(const struct nk_str*, int pos);
+
4264 NK_API const char *nk_str_at_char_const(const struct nk_str*, int pos);
+
4265 NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unicode, int *len);
+
4266 
+
4267 NK_API char *nk_str_get(struct nk_str*);
+
4268 NK_API const char *nk_str_get_const(const struct nk_str*);
+
4269 NK_API int nk_str_len(const struct nk_str*);
+
4270 NK_API int nk_str_len_char(const struct nk_str*);
+
4271 
+
4303 #ifndef NK_TEXTEDIT_UNDOSTATECOUNT
+
4304 #define NK_TEXTEDIT_UNDOSTATECOUNT 99
+
4305 #endif
+
4306 
+
4307 #ifndef NK_TEXTEDIT_UNDOCHARCOUNT
+
4308 #define NK_TEXTEDIT_UNDOCHARCOUNT 999
+
4309 #endif
+
4310 
+
4311 struct nk_text_edit;
+ +
4313  nk_handle userdata;
+
4314  nk_plugin_paste paste;
+
4315  nk_plugin_copy copy;
+
4316 };
+
4317 
+ +
4319  int where;
+
4320  short insert_length;
+
4321  short delete_length;
+
4322  short char_storage;
+
4323 };
+
4324 
+ +
4326  struct nk_text_undo_record undo_rec[NK_TEXTEDIT_UNDOSTATECOUNT];
+
4327  nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT];
+
4328  short undo_point;
+
4329  short redo_point;
+
4330  short undo_char_point;
+
4331  short redo_char_point;
+
4332 };
+
4333 
+
4334 enum nk_text_edit_type {
+
4335  NK_TEXT_EDIT_SINGLE_LINE,
+
4336  NK_TEXT_EDIT_MULTI_LINE
+
4337 };
+
4338 
+
4339 enum nk_text_edit_mode {
+
4340  NK_TEXT_EDIT_MODE_VIEW,
+
4341  NK_TEXT_EDIT_MODE_INSERT,
+
4342  NK_TEXT_EDIT_MODE_REPLACE
+
4343 };
+
4344 
+ +
4346  struct nk_clipboard clip;
+
4347  struct nk_str string;
+
4348  nk_plugin_filter filter;
+
4349  struct nk_vec2 scrollbar;
+
4350 
+
4351  int cursor;
+
4352  int select_start;
+
4353  int select_end;
+
4354  unsigned char mode;
+
4355  unsigned char cursor_at_end_of_line;
+
4356  unsigned char initialized;
+
4357  unsigned char has_preferred_x;
+
4358  unsigned char single_line;
+
4359  unsigned char active;
+
4360  unsigned char padding1;
+
4361  float preferred_x;
+
4362  struct nk_text_undo_state undo;
+
4363 };
+
4364 
+
4366 NK_API nk_bool nk_filter_default(const struct nk_text_edit*, nk_rune unicode);
+
4367 NK_API nk_bool nk_filter_ascii(const struct nk_text_edit*, nk_rune unicode);
+
4368 NK_API nk_bool nk_filter_float(const struct nk_text_edit*, nk_rune unicode);
+
4369 NK_API nk_bool nk_filter_decimal(const struct nk_text_edit*, nk_rune unicode);
+
4370 NK_API nk_bool nk_filter_hex(const struct nk_text_edit*, nk_rune unicode);
+
4371 NK_API nk_bool nk_filter_oct(const struct nk_text_edit*, nk_rune unicode);
+
4372 NK_API nk_bool nk_filter_binary(const struct nk_text_edit*, nk_rune unicode);
+
4373 
+
4375 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
4376 NK_API void nk_textedit_init_default(struct nk_text_edit*);
+
4377 #endif
+
4378 NK_API void nk_textedit_init(struct nk_text_edit*, const struct nk_allocator*, nk_size size);
+
4379 NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size);
+
4380 NK_API void nk_textedit_free(struct nk_text_edit*);
+
4381 NK_API void nk_textedit_text(struct nk_text_edit*, const char*, int total_len);
+
4382 NK_API void nk_textedit_delete(struct nk_text_edit*, int where, int len);
+
4383 NK_API void nk_textedit_delete_selection(struct nk_text_edit*);
+
4384 NK_API void nk_textedit_select_all(struct nk_text_edit*);
+
4385 NK_API nk_bool nk_textedit_cut(struct nk_text_edit*);
+
4386 NK_API nk_bool nk_textedit_paste(struct nk_text_edit*, char const*, int len);
+
4387 NK_API void nk_textedit_undo(struct nk_text_edit*);
+
4388 NK_API void nk_textedit_redo(struct nk_text_edit*);
+
4389 
+
4390 /* ===============================================================
+
4391  *
+
4392  * DRAWING
+
4393  *
+
4394  * ===============================================================*/
+
4444 enum nk_command_type {
+
4445  NK_COMMAND_NOP,
+
4446  NK_COMMAND_SCISSOR,
+
4447  NK_COMMAND_LINE,
+
4448  NK_COMMAND_CURVE,
+
4449  NK_COMMAND_RECT,
+
4450  NK_COMMAND_RECT_FILLED,
+
4451  NK_COMMAND_RECT_MULTI_COLOR,
+
4452  NK_COMMAND_CIRCLE,
+
4453  NK_COMMAND_CIRCLE_FILLED,
+
4454  NK_COMMAND_ARC,
+
4455  NK_COMMAND_ARC_FILLED,
+
4456  NK_COMMAND_TRIANGLE,
+
4457  NK_COMMAND_TRIANGLE_FILLED,
+
4458  NK_COMMAND_POLYGON,
+
4459  NK_COMMAND_POLYGON_FILLED,
+
4460  NK_COMMAND_POLYLINE,
+
4461  NK_COMMAND_TEXT,
+
4462  NK_COMMAND_IMAGE,
+
4463  NK_COMMAND_CUSTOM
+
4464 };
+
4465 
+
4467 struct nk_command {
+
4468  enum nk_command_type type;
+
4469  nk_size next;
+
4470 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
4471  nk_handle userdata;
+
4472 #endif
+
4473 };
+
4474 
+ +
4476  struct nk_command header;
+
4477  short x, y;
+
4478  unsigned short w, h;
+
4479 };
+
4480 
+ +
4482  struct nk_command header;
+
4483  unsigned short line_thickness;
+
4484  struct nk_vec2i begin;
+
4485  struct nk_vec2i end;
+
4486  struct nk_color color;
+
4487 };
+
4488 
+ +
4490  struct nk_command header;
+
4491  unsigned short line_thickness;
+
4492  struct nk_vec2i begin;
+
4493  struct nk_vec2i end;
+
4494  struct nk_vec2i ctrl[2];
+
4495  struct nk_color color;
+
4496 };
+
4497 
+ +
4499  struct nk_command header;
+
4500  unsigned short rounding;
+
4501  unsigned short line_thickness;
+
4502  short x, y;
+
4503  unsigned short w, h;
+
4504  struct nk_color color;
+
4505 };
+
4506 
+ +
4508  struct nk_command header;
+
4509  unsigned short rounding;
+
4510  short x, y;
+
4511  unsigned short w, h;
+
4512  struct nk_color color;
+
4513 };
+
4514 
+ +
4516  struct nk_command header;
+
4517  short x, y;
+
4518  unsigned short w, h;
+
4519  struct nk_color left;
+
4520  struct nk_color top;
+
4521  struct nk_color bottom;
+
4522  struct nk_color right;
+
4523 };
+
4524 
+ +
4526  struct nk_command header;
+
4527  unsigned short line_thickness;
+
4528  struct nk_vec2i a;
+
4529  struct nk_vec2i b;
+
4530  struct nk_vec2i c;
+
4531  struct nk_color color;
+
4532 };
+
4533 
+ +
4535  struct nk_command header;
+
4536  struct nk_vec2i a;
+
4537  struct nk_vec2i b;
+
4538  struct nk_vec2i c;
+
4539  struct nk_color color;
+
4540 };
+
4541 
+ +
4543  struct nk_command header;
+
4544  short x, y;
+
4545  unsigned short line_thickness;
+
4546  unsigned short w, h;
+
4547  struct nk_color color;
+
4548 };
+
4549 
+ +
4551  struct nk_command header;
+
4552  short x, y;
+
4553  unsigned short w, h;
+
4554  struct nk_color color;
+
4555 };
+
4556 
+ +
4558  struct nk_command header;
+
4559  short cx, cy;
+
4560  unsigned short r;
+
4561  unsigned short line_thickness;
+
4562  float a[2];
+
4563  struct nk_color color;
+
4564 };
+
4565 
+ +
4567  struct nk_command header;
+
4568  short cx, cy;
+
4569  unsigned short r;
+
4570  float a[2];
+
4571  struct nk_color color;
+
4572 };
+
4573 
+ +
4575  struct nk_command header;
+
4576  struct nk_color color;
+
4577  unsigned short line_thickness;
+
4578  unsigned short point_count;
+
4579  struct nk_vec2i points[1];
+
4580 };
+
4581 
+ +
4583  struct nk_command header;
+
4584  struct nk_color color;
+
4585  unsigned short point_count;
+
4586  struct nk_vec2i points[1];
+
4587 };
+
4588 
+ +
4590  struct nk_command header;
+
4591  struct nk_color color;
+
4592  unsigned short line_thickness;
+
4593  unsigned short point_count;
+
4594  struct nk_vec2i points[1];
+
4595 };
+
4596 
+ +
4598  struct nk_command header;
+
4599  short x, y;
+
4600  unsigned short w, h;
+
4601  struct nk_image img;
+
4602  struct nk_color col;
+
4603 };
+
4604 
+
4605 typedef void (*nk_command_custom_callback)(void *canvas, short x,short y,
+
4606  unsigned short w, unsigned short h, nk_handle callback_data);
+ +
4608  struct nk_command header;
+
4609  short x, y;
+
4610  unsigned short w, h;
+
4611  nk_handle callback_data;
+
4612  nk_command_custom_callback callback;
+
4613 };
+
4614 
+ +
4616  struct nk_command header;
+
4617  const struct nk_user_font *font;
+
4618  struct nk_color background;
+
4619  struct nk_color foreground;
+
4620  short x, y;
+
4621  unsigned short w, h;
+
4622  float height;
+
4623  int length;
+
4624  char string[1];
+
4625 };
+
4626 
+
4627 enum nk_command_clipping {
+
4628  NK_CLIPPING_OFF = nk_false,
+
4629  NK_CLIPPING_ON = nk_true
+
4630 };
+
4631 
+ +
4633  struct nk_buffer *base;
+
4634  struct nk_rect clip;
+
4635  int use_clipping;
+
4636  nk_handle userdata;
+
4637  nk_size begin, end, last;
+
4638 };
+
4639 
+
4641 NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color);
+
4642 NK_API void nk_stroke_curve(struct nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color);
+
4643 NK_API void nk_stroke_rect(struct nk_command_buffer*, struct nk_rect, float rounding, float line_thickness, struct nk_color);
+
4644 NK_API void nk_stroke_circle(struct nk_command_buffer*, struct nk_rect, float line_thickness, struct nk_color);
+
4645 NK_API void nk_stroke_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color);
+
4646 NK_API void nk_stroke_triangle(struct nk_command_buffer*, float, float, float, float, float, float, float line_thichness, struct nk_color);
+
4647 NK_API void nk_stroke_polyline(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color col);
+
4648 NK_API void nk_stroke_polygon(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color);
+
4649 
+
4651 NK_API void nk_fill_rect(struct nk_command_buffer*, struct nk_rect, float rounding, struct nk_color);
+
4652 NK_API void nk_fill_rect_multi_color(struct nk_command_buffer*, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
+
4653 NK_API void nk_fill_circle(struct nk_command_buffer*, struct nk_rect, struct nk_color);
+
4654 NK_API void nk_fill_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, struct nk_color);
+
4655 NK_API void nk_fill_triangle(struct nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color);
+
4656 NK_API void nk_fill_polygon(struct nk_command_buffer*, const float *points, int point_count, struct nk_color);
+
4657 
+
4659 NK_API void nk_draw_image(struct nk_command_buffer*, struct nk_rect, const struct nk_image*, struct nk_color);
+
4660 NK_API void nk_draw_nine_slice(struct nk_command_buffer*, struct nk_rect, const struct nk_nine_slice*, struct nk_color);
+
4661 NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color);
+
4662 NK_API void nk_push_scissor(struct nk_command_buffer*, struct nk_rect);
+
4663 NK_API void nk_push_custom(struct nk_command_buffer*, struct nk_rect, nk_command_custom_callback, nk_handle usr);
+
4664 
+
4665 /* ===============================================================
+
4666  *
+
4667  * INPUT
+
4668  *
+
4669  * ===============================================================*/
+ +
4671  nk_bool down;
+
4672  unsigned int clicked;
+
4673  struct nk_vec2 clicked_pos;
+
4674 };
+
4675 struct nk_mouse {
+
4676  struct nk_mouse_button buttons[NK_BUTTON_MAX];
+
4677  struct nk_vec2 pos;
+
4678 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+
4679  struct nk_vec2 down_pos;
+
4680 #endif
+
4681  struct nk_vec2 prev;
+
4682  struct nk_vec2 delta;
+
4683  struct nk_vec2 scroll_delta;
+
4684  unsigned char grab;
+
4685  unsigned char grabbed;
+
4686  unsigned char ungrab;
+
4687 };
+
4688 
+
4689 struct nk_key {
+
4690  nk_bool down;
+
4691  unsigned int clicked;
+
4692 };
+
4693 struct nk_keyboard {
+
4694  struct nk_key keys[NK_KEY_MAX];
+
4695  char text[NK_INPUT_MAX];
+
4696  int text_len;
+
4697 };
+
4698 
+
4699 struct nk_input {
+
4700  struct nk_keyboard keyboard;
+
4701  struct nk_mouse mouse;
+
4702 };
+
4703 
+
4704 NK_API nk_bool nk_input_has_mouse_click(const struct nk_input*, enum nk_buttons);
+
4705 NK_API nk_bool nk_input_has_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
+
4706 NK_API nk_bool nk_input_has_mouse_click_in_button_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
+
4707 NK_API nk_bool nk_input_has_mouse_click_down_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect, nk_bool down);
+
4708 NK_API nk_bool nk_input_is_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
+
4709 NK_API nk_bool nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, struct nk_rect b, nk_bool down);
+
4710 NK_API nk_bool nk_input_any_mouse_click_in_rect(const struct nk_input*, struct nk_rect);
+
4711 NK_API nk_bool nk_input_is_mouse_prev_hovering_rect(const struct nk_input*, struct nk_rect);
+
4712 NK_API nk_bool nk_input_is_mouse_hovering_rect(const struct nk_input*, struct nk_rect);
+
4713 NK_API nk_bool nk_input_mouse_clicked(const struct nk_input*, enum nk_buttons, struct nk_rect);
+
4714 NK_API nk_bool nk_input_is_mouse_down(const struct nk_input*, enum nk_buttons);
+
4715 NK_API nk_bool nk_input_is_mouse_pressed(const struct nk_input*, enum nk_buttons);
+
4716 NK_API nk_bool nk_input_is_mouse_released(const struct nk_input*, enum nk_buttons);
+
4717 NK_API nk_bool nk_input_is_key_pressed(const struct nk_input*, enum nk_keys);
+
4718 NK_API nk_bool nk_input_is_key_released(const struct nk_input*, enum nk_keys);
+
4719 NK_API nk_bool nk_input_is_key_down(const struct nk_input*, enum nk_keys);
+
4720 
+
4721 /* ===============================================================
+
4722  *
+
4723  * DRAW LIST
+
4724  *
+
4725  * ===============================================================*/
+
4726 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
4743 #ifdef NK_UINT_DRAW_INDEX
+
4744 typedef nk_uint nk_draw_index;
+
4745 #else
+
4746 typedef nk_ushort nk_draw_index;
+
4747 #endif
+
4748 enum nk_draw_list_stroke {
+
4749  NK_STROKE_OPEN = nk_false, /***< build up path has no connection back to the beginning */
+
4750  NK_STROKE_CLOSED = nk_true /***< build up path has a connection back to the beginning */
+
4751 };
+
4752 
+
4753 enum nk_draw_vertex_layout_attribute {
+
4754  NK_VERTEX_POSITION,
+
4755  NK_VERTEX_COLOR,
+
4756  NK_VERTEX_TEXCOORD,
+
4757  NK_VERTEX_ATTRIBUTE_COUNT
+
4758 };
+
4759 
+
4760 enum nk_draw_vertex_layout_format {
+
4761  NK_FORMAT_SCHAR,
+
4762  NK_FORMAT_SSHORT,
+
4763  NK_FORMAT_SINT,
+
4764  NK_FORMAT_UCHAR,
+
4765  NK_FORMAT_USHORT,
+
4766  NK_FORMAT_UINT,
+
4767  NK_FORMAT_FLOAT,
+
4768  NK_FORMAT_DOUBLE,
+
4769 
+
4770 NK_FORMAT_COLOR_BEGIN,
+
4771  NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
+
4772  NK_FORMAT_R16G15B16,
+
4773  NK_FORMAT_R32G32B32,
+
4774 
+
4775  NK_FORMAT_R8G8B8A8,
+
4776  NK_FORMAT_B8G8R8A8,
+
4777  NK_FORMAT_R16G15B16A16,
+
4778  NK_FORMAT_R32G32B32A32,
+
4779  NK_FORMAT_R32G32B32A32_FLOAT,
+
4780  NK_FORMAT_R32G32B32A32_DOUBLE,
+
4781 
+
4782  NK_FORMAT_RGB32,
+
4783  NK_FORMAT_RGBA32,
+
4784 NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
+
4785  NK_FORMAT_COUNT
+
4786 };
+
4787 
+
4788 #define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0
+
4789 struct nk_draw_vertex_layout_element {
+
4790  enum nk_draw_vertex_layout_attribute attribute;
+
4791  enum nk_draw_vertex_layout_format format;
+
4792  nk_size offset;
+
4793 };
+
4794 
+
4795 struct nk_draw_command {
+
4796  unsigned int elem_count;
+
4797  struct nk_rect clip_rect;
+
4798  nk_handle texture;
+
4799 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
4800  nk_handle userdata;
+
4801 #endif
+
4802 };
+
4803 
+
4804 struct nk_draw_list {
+
4805  struct nk_rect clip_rect;
+
4806  struct nk_vec2 circle_vtx[12];
+
4807  struct nk_convert_config config;
+
4808 
+
4809  struct nk_buffer *buffer;
+
4810  struct nk_buffer *vertices;
+
4811  struct nk_buffer *elements;
+
4812 
+
4813  unsigned int element_count;
+
4814  unsigned int vertex_count;
+
4815  unsigned int cmd_count;
+
4816  nk_size cmd_offset;
+
4817 
+
4818  unsigned int path_count;
+
4819  unsigned int path_offset;
+
4820 
+
4821  enum nk_anti_aliasing line_AA;
+
4822  enum nk_anti_aliasing shape_AA;
+
4823 
+
4824 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
4825  nk_handle userdata;
+
4826 #endif
+
4827 };
+
4828 
+
4829 /* draw list */
+
4830 NK_API void nk_draw_list_init(struct nk_draw_list*);
+
4831 NK_API void nk_draw_list_setup(struct nk_draw_list*, const struct nk_convert_config*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, enum nk_anti_aliasing line_aa,enum nk_anti_aliasing shape_aa);
+
4832 
+
4833 /* drawing */
+
4834 #define nk_draw_list_foreach(cmd, can, b) for((cmd)=nk__draw_list_begin(can, b); (cmd)!=0; (cmd)=nk__draw_list_next(cmd, b, can))
+
4835 NK_API const struct nk_draw_command* nk__draw_list_begin(const struct nk_draw_list*, const struct nk_buffer*);
+
4836 NK_API const struct nk_draw_command* nk__draw_list_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_draw_list*);
+
4837 NK_API const struct nk_draw_command* nk__draw_list_end(const struct nk_draw_list*, const struct nk_buffer*);
+
4838 
+
4839 /* path */
+
4840 NK_API void nk_draw_list_path_clear(struct nk_draw_list*);
+
4841 NK_API void nk_draw_list_path_line_to(struct nk_draw_list*, struct nk_vec2 pos);
+
4842 NK_API void nk_draw_list_path_arc_to_fast(struct nk_draw_list*, struct nk_vec2 center, float radius, int a_min, int a_max);
+
4843 NK_API void nk_draw_list_path_arc_to(struct nk_draw_list*, struct nk_vec2 center, float radius, float a_min, float a_max, unsigned int segments);
+
4844 NK_API void nk_draw_list_path_rect_to(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, float rounding);
+
4845 NK_API void nk_draw_list_path_curve_to(struct nk_draw_list*, struct nk_vec2 p2, struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments);
+
4846 NK_API void nk_draw_list_path_fill(struct nk_draw_list*, struct nk_color);
+
4847 NK_API void nk_draw_list_path_stroke(struct nk_draw_list*, struct nk_color, enum nk_draw_list_stroke closed, float thickness);
+
4848 
+
4849 /* stroke */
+
4850 NK_API void nk_draw_list_stroke_line(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_color, float thickness);
+
4851 NK_API void nk_draw_list_stroke_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding, float thickness);
+
4852 NK_API void nk_draw_list_stroke_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color, float thickness);
+
4853 NK_API void nk_draw_list_stroke_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color, unsigned int segs, float thickness);
+
4854 NK_API void nk_draw_list_stroke_curve(struct nk_draw_list*, struct nk_vec2 p0, struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1, struct nk_color, unsigned int segments, float thickness);
+
4855 NK_API void nk_draw_list_stroke_poly_line(struct nk_draw_list*, const struct nk_vec2 *pnts, const unsigned int cnt, struct nk_color, enum nk_draw_list_stroke, float thickness, enum nk_anti_aliasing);
+
4856 
+
4857 /* fill */
+
4858 NK_API void nk_draw_list_fill_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding);
+
4859 NK_API void nk_draw_list_fill_rect_multi_color(struct nk_draw_list*, struct nk_rect rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
+
4860 NK_API void nk_draw_list_fill_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color);
+
4861 NK_API void nk_draw_list_fill_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color col, unsigned int segs);
+
4862 NK_API void nk_draw_list_fill_poly_convex(struct nk_draw_list*, const struct nk_vec2 *points, const unsigned int count, struct nk_color, enum nk_anti_aliasing);
+
4863 
+
4864 /* misc */
+
4865 NK_API void nk_draw_list_add_image(struct nk_draw_list*, struct nk_image texture, struct nk_rect rect, struct nk_color);
+
4866 NK_API void nk_draw_list_add_text(struct nk_draw_list*, const struct nk_user_font*, struct nk_rect, const char *text, int len, float font_height, struct nk_color);
+
4867 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
4868 NK_API void nk_draw_list_push_userdata(struct nk_draw_list*, nk_handle userdata);
+
4869 #endif
+
4870 
+
4871 #endif
+
4872 
+
4873 /* ===============================================================
+
4874  *
+
4875  * GUI
+
4876  *
+
4877  * ===============================================================*/
+
4878 enum nk_style_item_type {
+
4879  NK_STYLE_ITEM_COLOR,
+
4880  NK_STYLE_ITEM_IMAGE,
+
4881  NK_STYLE_ITEM_NINE_SLICE
+
4882 };
+
4883 
+ +
4885  struct nk_color color;
+
4886  struct nk_image image;
+
4887  struct nk_nine_slice slice;
+
4888 };
+
4889 
+ +
4891  enum nk_style_item_type type;
+
4892  union nk_style_item_data data;
+
4893 };
+
4894 
+ +
4896  struct nk_color color;
+
4897  struct nk_vec2 padding;
+
4898  float color_factor;
+
4899  float disabled_factor;
+
4900 };
+
4901 
+ +
4903  /* background */
+
4904  struct nk_style_item normal;
+
4905  struct nk_style_item hover;
+
4906  struct nk_style_item active;
+
4907  struct nk_color border_color;
+
4908  float color_factor_background;
+
4909 
+
4910  /* text */
+
4911  struct nk_color text_background;
+
4912  struct nk_color text_normal;
+
4913  struct nk_color text_hover;
+
4914  struct nk_color text_active;
+
4915  nk_flags text_alignment;
+
4916  float color_factor_text;
+
4917 
+
4918  /* properties */
+
4919  float border;
+
4920  float rounding;
+
4921  struct nk_vec2 padding;
+
4922  struct nk_vec2 image_padding;
+
4923  struct nk_vec2 touch_padding;
+
4924  float disabled_factor;
+
4925 
+
4926  /* optional user callbacks */
+
4927  nk_handle userdata;
+
4928  void(*draw_begin)(struct nk_command_buffer*, nk_handle userdata);
+
4929  void(*draw_end)(struct nk_command_buffer*, nk_handle userdata);
+
4930 };
+
4931 
+ +
4933  /* background */
+
4934  struct nk_style_item normal;
+
4935  struct nk_style_item hover;
+
4936  struct nk_style_item active;
+
4937  struct nk_color border_color;
+
4938 
+
4939  /* cursor */
+
4940  struct nk_style_item cursor_normal;
+
4941  struct nk_style_item cursor_hover;
+
4942 
+
4943  /* text */
+
4944  struct nk_color text_normal;
+
4945  struct nk_color text_hover;
+
4946  struct nk_color text_active;
+
4947  struct nk_color text_background;
+
4948  nk_flags text_alignment;
+
4949 
+
4950  /* properties */
+
4951  struct nk_vec2 padding;
+
4952  struct nk_vec2 touch_padding;
+
4953  float spacing;
+
4954  float border;
+
4955  float color_factor;
+
4956  float disabled_factor;
+
4957 
+
4958  /* optional user callbacks */
+
4959  nk_handle userdata;
+
4960  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
4961  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
4962 };
+
4963 
+ +
4965  /* background (inactive) */
+
4966  struct nk_style_item normal;
+
4967  struct nk_style_item hover;
+
4968  struct nk_style_item pressed;
+
4969 
+
4970  /* background (active) */
+
4971  struct nk_style_item normal_active;
+
4972  struct nk_style_item hover_active;
+
4973  struct nk_style_item pressed_active;
+
4974 
+
4975  /* text color (inactive) */
+
4976  struct nk_color text_normal;
+
4977  struct nk_color text_hover;
+
4978  struct nk_color text_pressed;
+
4979 
+
4980  /* text color (active) */
+
4981  struct nk_color text_normal_active;
+
4982  struct nk_color text_hover_active;
+
4983  struct nk_color text_pressed_active;
+
4984  struct nk_color text_background;
+
4985  nk_flags text_alignment;
+
4986 
+
4987  /* properties */
+
4988  float rounding;
+
4989  struct nk_vec2 padding;
+
4990  struct nk_vec2 touch_padding;
+
4991  struct nk_vec2 image_padding;
+
4992  float color_factor;
+
4993  float disabled_factor;
+
4994 
+
4995  /* optional user callbacks */
+
4996  nk_handle userdata;
+
4997  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
4998  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
4999 };
+
5000 
+ +
5002  /* background */
+
5003  struct nk_style_item normal;
+
5004  struct nk_style_item hover;
+
5005  struct nk_style_item active;
+
5006  struct nk_color border_color;
+
5007 
+
5008  /* background bar */
+
5009  struct nk_color bar_normal;
+
5010  struct nk_color bar_hover;
+
5011  struct nk_color bar_active;
+
5012  struct nk_color bar_filled;
+
5013 
+
5014  /* cursor */
+
5015  struct nk_style_item cursor_normal;
+
5016  struct nk_style_item cursor_hover;
+
5017  struct nk_style_item cursor_active;
+
5018 
+
5019  /* properties */
+
5020  float border;
+
5021  float rounding;
+
5022  float bar_height;
+
5023  struct nk_vec2 padding;
+
5024  struct nk_vec2 spacing;
+
5025  struct nk_vec2 cursor_size;
+
5026  float color_factor;
+
5027  float disabled_factor;
+
5028 
+
5029  /* optional buttons */
+
5030  int show_buttons;
+
5031  struct nk_style_button inc_button;
+
5032  struct nk_style_button dec_button;
+
5033  enum nk_symbol_type inc_symbol;
+
5034  enum nk_symbol_type dec_symbol;
+
5035 
+
5036  /* optional user callbacks */
+
5037  nk_handle userdata;
+
5038  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
5039  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
5040 };
+
5041 
+ +
5043  /* background */
+
5044  struct nk_style_item normal;
+
5045  struct nk_style_item hover;
+
5046  struct nk_style_item active;
+
5047  struct nk_color border_color;
+
5048 
+
5049  /* knob */
+
5050  struct nk_color knob_normal;
+
5051  struct nk_color knob_hover;
+
5052  struct nk_color knob_active;
+
5053  struct nk_color knob_border_color;
+
5054 
+
5055  /* cursor */
+
5056  struct nk_color cursor_normal;
+
5057  struct nk_color cursor_hover;
+
5058  struct nk_color cursor_active;
+
5059 
+
5060  /* properties */
+
5061  float border;
+
5062  float knob_border;
+
5063  struct nk_vec2 padding;
+
5064  struct nk_vec2 spacing;
+
5065  float cursor_width;
+
5066  float color_factor;
+
5067  float disabled_factor;
+
5068 
+
5069  /* optional user callbacks */
+
5070  nk_handle userdata;
+
5071  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
5072  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
5073 };
+
5074 
+ +
5076  /* background */
+
5077  struct nk_style_item normal;
+
5078  struct nk_style_item hover;
+
5079  struct nk_style_item active;
+
5080  struct nk_color border_color;
+
5081 
+
5082  /* cursor */
+
5083  struct nk_style_item cursor_normal;
+
5084  struct nk_style_item cursor_hover;
+
5085  struct nk_style_item cursor_active;
+
5086  struct nk_color cursor_border_color;
+
5087 
+
5088  /* properties */
+
5089  float rounding;
+
5090  float border;
+
5091  float cursor_border;
+
5092  float cursor_rounding;
+
5093  struct nk_vec2 padding;
+
5094  float color_factor;
+
5095  float disabled_factor;
+
5096 
+
5097  /* optional user callbacks */
+
5098  nk_handle userdata;
+
5099  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
5100  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
5101 };
+
5102 
+ +
5104  /* background */
+
5105  struct nk_style_item normal;
+
5106  struct nk_style_item hover;
+
5107  struct nk_style_item active;
+
5108  struct nk_color border_color;
+
5109 
+
5110  /* cursor */
+
5111  struct nk_style_item cursor_normal;
+
5112  struct nk_style_item cursor_hover;
+
5113  struct nk_style_item cursor_active;
+
5114  struct nk_color cursor_border_color;
+
5115 
+
5116  /* properties */
+
5117  float border;
+
5118  float rounding;
+
5119  float border_cursor;
+
5120  float rounding_cursor;
+
5121  struct nk_vec2 padding;
+
5122  float color_factor;
+
5123  float disabled_factor;
+
5124 
+
5125  /* optional buttons */
+
5126  int show_buttons;
+
5127  struct nk_style_button inc_button;
+
5128  struct nk_style_button dec_button;
+
5129  enum nk_symbol_type inc_symbol;
+
5130  enum nk_symbol_type dec_symbol;
+
5131 
+
5132  /* optional user callbacks */
+
5133  nk_handle userdata;
+
5134  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
5135  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
5136 };
+
5137 
+ +
5139  /* background */
+
5140  struct nk_style_item normal;
+
5141  struct nk_style_item hover;
+
5142  struct nk_style_item active;
+
5143  struct nk_color border_color;
+
5144  struct nk_style_scrollbar scrollbar;
+
5145 
+
5146  /* cursor */
+
5147  struct nk_color cursor_normal;
+
5148  struct nk_color cursor_hover;
+
5149  struct nk_color cursor_text_normal;
+
5150  struct nk_color cursor_text_hover;
+
5151 
+
5152  /* text (unselected) */
+
5153  struct nk_color text_normal;
+
5154  struct nk_color text_hover;
+
5155  struct nk_color text_active;
+
5156 
+
5157  /* text (selected) */
+
5158  struct nk_color selected_normal;
+
5159  struct nk_color selected_hover;
+
5160  struct nk_color selected_text_normal;
+
5161  struct nk_color selected_text_hover;
+
5162 
+
5163  /* properties */
+
5164  float border;
+
5165  float rounding;
+
5166  float cursor_size;
+
5167  struct nk_vec2 scrollbar_size;
+
5168  struct nk_vec2 padding;
+
5169  float row_padding;
+
5170  float color_factor;
+
5171  float disabled_factor;
+
5172 };
+
5173 
+ +
5175  /* background */
+
5176  struct nk_style_item normal;
+
5177  struct nk_style_item hover;
+
5178  struct nk_style_item active;
+
5179  struct nk_color border_color;
+
5180 
+
5181  /* text */
+
5182  struct nk_color label_normal;
+
5183  struct nk_color label_hover;
+
5184  struct nk_color label_active;
+
5185 
+
5186  /* symbols */
+
5187  enum nk_symbol_type sym_left;
+
5188  enum nk_symbol_type sym_right;
+
5189 
+
5190  /* properties */
+
5191  float border;
+
5192  float rounding;
+
5193  struct nk_vec2 padding;
+
5194  float color_factor;
+
5195  float disabled_factor;
+
5196 
+
5197  struct nk_style_edit edit;
+
5198  struct nk_style_button inc_button;
+
5199  struct nk_style_button dec_button;
+
5200 
+
5201  /* optional user callbacks */
+
5202  nk_handle userdata;
+
5203  void(*draw_begin)(struct nk_command_buffer*, nk_handle);
+
5204  void(*draw_end)(struct nk_command_buffer*, nk_handle);
+
5205 };
+
5206 
+ +
5208  /* colors */
+
5209  struct nk_style_item background;
+
5210  struct nk_color border_color;
+
5211  struct nk_color selected_color;
+
5212  struct nk_color color;
+
5213 
+
5214  /* properties */
+
5215  float border;
+
5216  float rounding;
+
5217  struct nk_vec2 padding;
+
5218  float color_factor;
+
5219  float disabled_factor;
+
5220  nk_bool show_markers;
+
5221 };
+
5222 
+ +
5224  /* background */
+
5225  struct nk_style_item normal;
+
5226  struct nk_style_item hover;
+
5227  struct nk_style_item active;
+
5228  struct nk_color border_color;
+
5229 
+
5230  /* label */
+
5231  struct nk_color label_normal;
+
5232  struct nk_color label_hover;
+
5233  struct nk_color label_active;
+
5234 
+
5235  /* symbol */
+
5236  struct nk_color symbol_normal;
+
5237  struct nk_color symbol_hover;
+
5238  struct nk_color symbol_active;
+
5239 
+
5240  /* button */
+
5241  struct nk_style_button button;
+
5242  enum nk_symbol_type sym_normal;
+
5243  enum nk_symbol_type sym_hover;
+
5244  enum nk_symbol_type sym_active;
+
5245 
+
5246  /* properties */
+
5247  float border;
+
5248  float rounding;
+
5249  struct nk_vec2 content_padding;
+
5250  struct nk_vec2 button_padding;
+
5251  struct nk_vec2 spacing;
+
5252  float color_factor;
+
5253  float disabled_factor;
+
5254 };
+
5255 
+ +
5257  /* background */
+
5258  struct nk_style_item background;
+
5259  struct nk_color border_color;
+
5260  struct nk_color text;
+
5261 
+
5262  /* button */
+
5263  struct nk_style_button tab_maximize_button;
+
5264  struct nk_style_button tab_minimize_button;
+
5265  struct nk_style_button node_maximize_button;
+
5266  struct nk_style_button node_minimize_button;
+
5267  enum nk_symbol_type sym_minimize;
+
5268  enum nk_symbol_type sym_maximize;
+
5269 
+
5270  /* properties */
+
5271  float border;
+
5272  float rounding;
+
5273  float indent;
+
5274  struct nk_vec2 padding;
+
5275  struct nk_vec2 spacing;
+
5276  float color_factor;
+
5277  float disabled_factor;
+
5278 };
+
5279 
+
5280 enum nk_style_header_align {
+
5281  NK_HEADER_LEFT,
+
5282  NK_HEADER_RIGHT
+
5283 };
+ +
5285  /* background */
+
5286  struct nk_style_item normal;
+
5287  struct nk_style_item hover;
+
5288  struct nk_style_item active;
+
5289 
+
5290  /* button */
+
5291  struct nk_style_button close_button;
+
5292  struct nk_style_button minimize_button;
+
5293  enum nk_symbol_type close_symbol;
+
5294  enum nk_symbol_type minimize_symbol;
+
5295  enum nk_symbol_type maximize_symbol;
+
5296 
+
5297  /* title */
+
5298  struct nk_color label_normal;
+
5299  struct nk_color label_hover;
+
5300  struct nk_color label_active;
+
5301 
+
5302  /* properties */
+
5303  enum nk_style_header_align align;
+
5304  struct nk_vec2 padding;
+
5305  struct nk_vec2 label_padding;
+
5306  struct nk_vec2 spacing;
+
5307 };
+
5308 
+ +
5310  struct nk_style_window_header header;
+
5311  struct nk_style_item fixed_background;
+
5312  struct nk_color background;
+
5313 
+
5314  struct nk_color border_color;
+
5315  struct nk_color popup_border_color;
+
5316  struct nk_color combo_border_color;
+
5317  struct nk_color contextual_border_color;
+
5318  struct nk_color menu_border_color;
+
5319  struct nk_color group_border_color;
+
5320  struct nk_color tooltip_border_color;
+
5321  struct nk_style_item scaler;
+
5322 
+
5323  float border;
+
5324  float combo_border;
+
5325  float contextual_border;
+
5326  float menu_border;
+
5327  float group_border;
+
5328  float tooltip_border;
+
5329  float popup_border;
+
5330  float min_row_height_padding;
+
5331 
+
5332  float rounding;
+
5333  struct nk_vec2 spacing;
+
5334  struct nk_vec2 scrollbar_size;
+
5335  struct nk_vec2 min_size;
+
5336 
+
5337  struct nk_vec2 padding;
+
5338  struct nk_vec2 group_padding;
+
5339  struct nk_vec2 popup_padding;
+
5340  struct nk_vec2 combo_padding;
+
5341  struct nk_vec2 contextual_padding;
+
5342  struct nk_vec2 menu_padding;
+
5343  struct nk_vec2 tooltip_padding;
+
5344 };
+
5345 
+
5346 struct nk_style {
+
5347  const struct nk_user_font *font;
+
5348  const struct nk_cursor *cursors[NK_CURSOR_COUNT];
+
5349  const struct nk_cursor *cursor_active;
+
5350  struct nk_cursor *cursor_last;
+
5351  int cursor_visible;
+
5352 
+
5353  struct nk_style_text text;
+
5354  struct nk_style_button button;
+
5355  struct nk_style_button contextual_button;
+
5356  struct nk_style_button menu_button;
+
5357  struct nk_style_toggle option;
+
5358  struct nk_style_toggle checkbox;
+
5359  struct nk_style_selectable selectable;
+
5360  struct nk_style_slider slider;
+
5361  struct nk_style_knob knob;
+
5362  struct nk_style_progress progress;
+
5363  struct nk_style_property property;
+
5364  struct nk_style_edit edit;
+
5365  struct nk_style_chart chart;
+
5366  struct nk_style_scrollbar scrollh;
+
5367  struct nk_style_scrollbar scrollv;
+
5368  struct nk_style_tab tab;
+
5369  struct nk_style_combo combo;
+
5370  struct nk_style_window window;
+
5371 };
+
5372 
+
5373 NK_API struct nk_style_item nk_style_item_color(struct nk_color);
+
5374 NK_API struct nk_style_item nk_style_item_image(struct nk_image img);
+
5375 NK_API struct nk_style_item nk_style_item_nine_slice(struct nk_nine_slice slice);
+
5376 NK_API struct nk_style_item nk_style_item_hide(void);
+
5377 
+
5378 /*==============================================================
+
5379  * PANEL
+
5380  * =============================================================*/
+
5381 #ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS
+
5382 #define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16
+
5383 #endif
+
5384 #ifndef NK_CHART_MAX_SLOT
+
5385 #define NK_CHART_MAX_SLOT 4
+
5386 #endif
+
5387 
+
5388 enum nk_panel_type {
+
5389  NK_PANEL_NONE = 0,
+
5390  NK_PANEL_WINDOW = NK_FLAG(0),
+
5391  NK_PANEL_GROUP = NK_FLAG(1),
+
5392  NK_PANEL_POPUP = NK_FLAG(2),
+
5393  NK_PANEL_CONTEXTUAL = NK_FLAG(4),
+
5394  NK_PANEL_COMBO = NK_FLAG(5),
+
5395  NK_PANEL_MENU = NK_FLAG(6),
+
5396  NK_PANEL_TOOLTIP = NK_FLAG(7)
+
5397 };
+
5398 enum nk_panel_set {
+
5399  NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP,
+
5400  NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP,
+
5401  NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP
+
5402 };
+
5403 
+ +
5405  enum nk_chart_type type;
+
5406  struct nk_color color;
+
5407  struct nk_color highlight;
+
5408  float min, max, range;
+
5409  int count;
+
5410  struct nk_vec2 last;
+
5411  int index;
+
5412  nk_bool show_markers;
+
5413 };
+
5414 
+
5415 struct nk_chart {
+
5416  int slot;
+
5417  float x, y, w, h;
+
5418  struct nk_chart_slot slots[NK_CHART_MAX_SLOT];
+
5419 };
+
5420 
+
5421 enum nk_panel_row_layout_type {
+
5422  NK_LAYOUT_DYNAMIC_FIXED = 0,
+
5423  NK_LAYOUT_DYNAMIC_ROW,
+
5424  NK_LAYOUT_DYNAMIC_FREE,
+
5425  NK_LAYOUT_DYNAMIC,
+
5426  NK_LAYOUT_STATIC_FIXED,
+
5427  NK_LAYOUT_STATIC_ROW,
+
5428  NK_LAYOUT_STATIC_FREE,
+
5429  NK_LAYOUT_STATIC,
+
5430  NK_LAYOUT_TEMPLATE,
+
5431  NK_LAYOUT_COUNT
+
5432 };
+ +
5434  enum nk_panel_row_layout_type type;
+
5435  int index;
+
5436  float height;
+
5437  float min_height;
+
5438  int columns;
+
5439  const float *ratio;
+
5440  float item_width;
+
5441  float item_height;
+
5442  float item_offset;
+
5443  float filled;
+
5444  struct nk_rect item;
+
5445  int tree_depth;
+
5446  float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS];
+
5447 };
+
5448 
+ +
5450  nk_size begin;
+
5451  nk_size parent;
+
5452  nk_size last;
+
5453  nk_size end;
+
5454  nk_bool active;
+
5455 };
+
5456 
+ +
5458  float x, y, w, h;
+
5459  struct nk_scroll offset;
+
5460 };
+
5461 
+
5462 struct nk_panel {
+
5463  enum nk_panel_type type;
+
5464  nk_flags flags;
+
5465  struct nk_rect bounds;
+
5466  nk_uint *offset_x;
+
5467  nk_uint *offset_y;
+
5468  float at_x, at_y, max_x;
+
5469  float footer_height;
+
5470  float header_height;
+
5471  float border;
+
5472  unsigned int has_scrolling;
+
5473  struct nk_rect clip;
+
5474  struct nk_menu_state menu;
+
5475  struct nk_row_layout row;
+
5476  struct nk_chart chart;
+
5477  struct nk_command_buffer *buffer;
+
5478  struct nk_panel *parent;
+
5479 };
+
5480 
+
5481 /*==============================================================
+
5482  * WINDOW
+
5483  * =============================================================*/
+
5484 #ifndef NK_WINDOW_MAX_NAME
+
5485 #define NK_WINDOW_MAX_NAME 64
+
5486 #endif
+
5487 
+
5488 struct nk_table;
+ +
5490  NK_WINDOW_PRIVATE = NK_FLAG(11),
+
5491  NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE,
+
5492  NK_WINDOW_ROM = NK_FLAG(12),
+ +
5494  NK_WINDOW_HIDDEN = NK_FLAG(13),
+
5495  NK_WINDOW_CLOSED = NK_FLAG(14),
+
5496  NK_WINDOW_MINIMIZED = NK_FLAG(15),
+
5497  NK_WINDOW_REMOVE_ROM = NK_FLAG(16)
+
5498 };
+
5499 
+ +
5501  struct nk_window *win;
+
5502  enum nk_panel_type type;
+
5503  struct nk_popup_buffer buf;
+
5504  nk_hash name;
+
5505  nk_bool active;
+
5506  unsigned combo_count;
+
5507  unsigned con_count, con_old;
+
5508  unsigned active_con;
+
5509  struct nk_rect header;
+
5510 };
+
5511 
+ +
5513  nk_hash name;
+
5514  unsigned int seq;
+
5515  unsigned int old;
+
5516  int active, prev;
+
5517  int cursor;
+
5518  int sel_start;
+
5519  int sel_end;
+
5520  struct nk_scroll scrollbar;
+
5521  unsigned char mode;
+
5522  unsigned char single_line;
+
5523 };
+
5524 
+ +
5526  int active, prev;
+
5527  char buffer[NK_MAX_NUMBER_BUFFER];
+
5528  int length;
+
5529  int cursor;
+
5530  int select_start;
+
5531  int select_end;
+
5532  nk_hash name;
+
5533  unsigned int seq;
+
5534  unsigned int old;
+
5535  int state;
+
5536 };
+
5537 
+
5538 struct nk_window {
+
5539  unsigned int seq;
+
5540  nk_hash name;
+
5541  char name_string[NK_WINDOW_MAX_NAME];
+
5542  nk_flags flags;
+
5543 
+
5544  struct nk_rect bounds;
+
5545  struct nk_scroll scrollbar;
+
5546  struct nk_command_buffer buffer;
+
5547  struct nk_panel *layout;
+
5548  float scrollbar_hiding_timer;
+
5549 
+
5550  /* persistent widget state */
+
5551  struct nk_property_state property;
+
5552  struct nk_popup_state popup;
+
5553  struct nk_edit_state edit;
+
5554  unsigned int scrolled;
+
5555  nk_bool widgets_disabled;
+
5556 
+
5557  struct nk_table *tables;
+
5558  unsigned int table_count;
+
5559 
+
5560  /* window list hooks */
+
5561  struct nk_window *next;
+
5562  struct nk_window *prev;
+
5563  struct nk_window *parent;
+
5564 };
+
5565 
+
5566 /*==============================================================
+
5567  * STACK
+
5568  * =============================================================*/
+
5595 #ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE
+
5596 #define NK_BUTTON_BEHAVIOR_STACK_SIZE 8
+
5597 #endif
+
5598 
+
5599 #ifndef NK_FONT_STACK_SIZE
+
5600 #define NK_FONT_STACK_SIZE 8
+
5601 #endif
+
5602 
+
5603 #ifndef NK_STYLE_ITEM_STACK_SIZE
+
5604 #define NK_STYLE_ITEM_STACK_SIZE 16
+
5605 #endif
+
5606 
+
5607 #ifndef NK_FLOAT_STACK_SIZE
+
5608 #define NK_FLOAT_STACK_SIZE 32
+
5609 #endif
+
5610 
+
5611 #ifndef NK_VECTOR_STACK_SIZE
+
5612 #define NK_VECTOR_STACK_SIZE 16
+
5613 #endif
+
5614 
+
5615 #ifndef NK_FLAGS_STACK_SIZE
+
5616 #define NK_FLAGS_STACK_SIZE 32
+
5617 #endif
+
5618 
+
5619 #ifndef NK_COLOR_STACK_SIZE
+
5620 #define NK_COLOR_STACK_SIZE 32
+
5621 #endif
+
5622 
+
5623 #define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\
+
5624  struct nk_config_stack_##name##_element {\
+
5625  prefix##_##type *address;\
+
5626  prefix##_##type old_value;\
+
5627  }
+
5628 #define NK_CONFIG_STACK(type,size)\
+
5629  struct nk_config_stack_##type {\
+
5630  int head;\
+
5631  struct nk_config_stack_##type##_element elements[size];\
+
5632  }
+
5633 
+
5634 #define nk_float float
+
5635 NK_CONFIGURATION_STACK_TYPE(struct nk, style_item, style_item);
+
5636 NK_CONFIGURATION_STACK_TYPE(nk ,float, float);
+
5637 NK_CONFIGURATION_STACK_TYPE(struct nk, vec2, vec2);
+
5638 NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags);
+
5639 NK_CONFIGURATION_STACK_TYPE(struct nk, color, color);
+
5640 NK_CONFIGURATION_STACK_TYPE(const struct nk, user_font, user_font*);
+
5641 NK_CONFIGURATION_STACK_TYPE(enum nk, button_behavior, button_behavior);
+
5642 
+
5643 NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE);
+
5644 NK_CONFIG_STACK(float, NK_FLOAT_STACK_SIZE);
+
5645 NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE);
+
5646 NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE);
+
5647 NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE);
+
5648 NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE);
+
5649 NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE);
+
5650 
+ +
5652  struct nk_config_stack_style_item style_items;
+
5653  struct nk_config_stack_float floats;
+
5654  struct nk_config_stack_vec2 vectors;
+
5655  struct nk_config_stack_flags flags;
+
5656  struct nk_config_stack_color colors;
+
5657  struct nk_config_stack_user_font fonts;
+
5658  struct nk_config_stack_button_behavior button_behaviors;
+
5659 };
+
5660 
+
5661 /*==============================================================
+
5662  * CONTEXT
+
5663  * =============================================================*/
+
5664 #define NK_VALUE_PAGE_CAPACITY \
+
5665  (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
+
5666 
+
5667 struct nk_table {
+
5668  unsigned int seq;
+
5669  unsigned int size;
+
5670  nk_hash keys[NK_VALUE_PAGE_CAPACITY];
+
5671  nk_uint values[NK_VALUE_PAGE_CAPACITY];
+
5672  struct nk_table *next, *prev;
+
5673 };
+
5674 
+ +
5676  struct nk_table tbl;
+
5677  struct nk_panel pan;
+
5678  struct nk_window win;
+
5679 };
+
5680 
+ +
5682  union nk_page_data data;
+
5683  struct nk_page_element *next;
+
5684  struct nk_page_element *prev;
+
5685 };
+
5686 
+
5687 struct nk_page {
+
5688  unsigned int size;
+
5689  struct nk_page *next;
+
5690  struct nk_page_element win[1];
+
5691 };
+
5692 
+
5693 struct nk_pool {
+
5694  struct nk_allocator alloc;
+
5695  enum nk_allocation_type type;
+
5696  unsigned int page_count;
+
5697  struct nk_page *pages;
+
5698  struct nk_page_element *freelist;
+
5699  unsigned capacity;
+
5700  nk_size size;
+
5701  nk_size cap;
+
5702 };
+
5703 
+
5704 struct nk_context {
+
5705 /* public: can be accessed freely */
+
5706  struct nk_input input;
+
5707  struct nk_style style;
+
5708  struct nk_buffer memory;
+
5709  struct nk_clipboard clip;
+
5710  nk_flags last_widget_state;
+
5711  enum nk_button_behavior button_behavior;
+
5712  struct nk_configuration_stacks stacks;
+
5713  float delta_time_seconds;
+
5714 
+
5715 /* private:
+
5716  should only be accessed if you
+
5717  know what you are doing */
+
5718 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
5719  struct nk_draw_list draw_list;
+
5720 #endif
+
5721 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
5722  nk_handle userdata;
+
5723 #endif
+
5728  struct nk_text_edit text_edit;
+
5730  struct nk_command_buffer overlay;
+
5731 
+
5733  int build;
+
5734  int use_pool;
+
5735  struct nk_pool pool;
+
5736  struct nk_window *begin;
+
5737  struct nk_window *end;
+
5738  struct nk_window *active;
+
5739  struct nk_window *current;
+
5740  struct nk_page_element *freelist;
+
5741  unsigned int count;
+
5742  unsigned int seq;
+
5743 };
+
5744 
+
5745 /* ==============================================================
+
5746  * MATH
+
5747  * =============================================================== */
+
5748 #define NK_PI 3.141592654f
+
5749 #define NK_PI_HALF 1.570796326f
+
5750 #define NK_UTF_INVALID 0xFFFD
+
5751 #define NK_MAX_FLOAT_PRECISION 2
+
5752 
+
5753 #define NK_UNUSED(x) ((void)(x))
+
5754 #define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x)))
+
5755 #define NK_LEN(a) (sizeof(a)/sizeof(a)[0])
+
5756 #define NK_ABS(a) (((a) < 0) ? -(a) : (a))
+
5757 #define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b))
+
5758 #define NK_INBOX(px, py, x, y, w, h)\
+
5759  (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
+
5760 #define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \
+
5761  ((x1 < (x0 + w0)) && (x0 < (x1 + w1)) && \
+
5762  (y1 < (y0 + h0)) && (y0 < (y1 + h1)))
+
5763 #define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\
+
5764  (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
+
5765 
+
5766 #define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y)
+
5767 #define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y)
+
5768 #define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y)
+
5769 #define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t))
+
5770 
+
5771 #define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i))))
+
5772 #define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i))))
+
5773 #define nk_zero_struct(s) nk_zero(&s, sizeof(s))
+
5774 
+
5775 /* ==============================================================
+
5776  * ALIGNMENT
+
5777  * =============================================================== */
+
5778 /* Pointer to Integer type conversion for pointer alignment */
+
5779 #if defined(__PTRDIFF_TYPE__) /* This case should work for GCC*/
+
5780 # define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x))
+
5781 # define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
+
5782 #elif !defined(__GNUC__) /* works for compilers other than LLVM */
+
5783 # define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x])
+
5784 # define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
+
5785 #elif defined(NK_USE_FIXED_TYPES) /* used if we have <stdint.h> */
+
5786 # define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
+
5787 # define NK_PTR_TO_UINT(x) ((uintptr_t)(x))
+
5788 #else /* generates warning but works */
+
5789 # define NK_UINT_TO_PTR(x) ((void*)(x))
+
5790 # define NK_PTR_TO_UINT(x) ((nk_size)(x))
+
5791 #endif
+
5792 
+
5793 #define NK_ALIGN_PTR(x, mask)\
+
5794  (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
+
5795 #define NK_ALIGN_PTR_BACK(x, mask)\
+
5796  (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
+
5797 
+
5798 #if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)) && !defined(EMSCRIPTEN)
+
5799 #define NK_OFFSETOF(st,m) (__builtin_offsetof(st,m))
+
5800 #else
+
5801 #define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m))
+
5802 #endif
+
5803 
+
5804 #ifdef __cplusplus
+
5805 }
+
5806 #endif
+
5807 
+
5808 #ifdef __cplusplus
+
5809 template<typename T> struct nk_alignof;
+
5810 template<typename T, int size_diff> struct nk_helper{enum {value = size_diff};};
+
5811 template<typename T> struct nk_helper<T,0>{enum {value = nk_alignof<T>::value};};
+
5812 template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
+
5813  diff = sizeof(Big) - sizeof(T), value = nk_helper<Big, diff>::value};};
+
5814 #define NK_ALIGNOF(t) (nk_alignof<t>::value)
+
5815 #else
+
5816 #define NK_ALIGNOF(t) NK_OFFSETOF(struct {char c; t _h;}, _h)
+
5817 #endif
+
5818 
+
5819 #define NK_CONTAINER_OF(ptr,type,member)\
+
5820  (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
+
5821 
+
5822 
+
5823 
+
5824 #endif /* NK_NUKLEAR_H_ */
+
NK_API void nk_tree_pop(struct nk_context *)
Definition: nuklear_tree.c:190
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API nk_bool nk_group_begin(struct nk_context *, const char *title, nk_flags)
Starts a new widget group.
+
NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx)
+
NK_API void nk_layout_row_end(struct nk_context *)
Finished previously started row.
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_window_close(struct nk_context *ctx, const char *name)
+
NK_API void nk_spacer(struct nk_context *ctx)
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
NK_API float nk_propertyf(struct nk_context *, const char *name, float min, float val, float max, float step, float inc_per_pixel)
+
NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
+
NK_API void nk_layout_space_end(struct nk_context *)
+
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
+
NK_API void nk_property_float(struct nk_context *, const char *name, float min, float *val, float max, float step, float inc_per_pixel)
+
nk_window_flags
Definition: nuklear.h:5489
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
@ NK_WINDOW_NOT_INTERACTIVE
prevents all interaction caused by input to either window or widgets inside
Definition: nuklear.h:5493
+
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
Definition: nuklear.h:5491
+
@ NK_WINDOW_REMOVE_ROM
Removes read only mode at the end of the window.
Definition: nuklear.h:5497
+
NK_API void nk_layout_row(struct nk_context *, enum nk_layout_format, float height, int cols, const float *ratio)
Specifies row columns in array as either window ratio or size.
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx)
+
NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond)
+
NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 vec)
+
#define NK_BOOL
could be char, use int for drop-in replacement backwards compatibility
Definition: nuklear.h:192
+
NK_API nk_bool nk_init_custom(struct nk_context *, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *)
Initializes a nk_context struct from two different either fixed or growing buffers.
+
NK_API nk_bool nk_tree_image_push_hashed(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:183
+
NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+
NK_API void nk_group_scrolled_end(struct nk_context *)
Definition: nuklear_group.c:59
+
NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx)
+
NK_API void nk_layout_row_template_push_dynamic(struct nk_context *)
+
NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char *name)
+
NK_API void nk_group_get_scroll(struct nk_context *, const char *id, nk_uint *x_offset, nk_uint *y_offset)
+
NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec)
+
NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name)
+
NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx)
+
#define NK_UTF_SIZE
describes the number of bytes a glyph consists of
Definition: nuklear.h:22
+
NK_API void nk_input_unicode(struct nk_context *, nk_rune)
Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.
+
NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char *name)
+
NK_API void nk_input_key(struct nk_context *, enum nk_keys, nk_bool down)
Mirrors the state of a specific key to nuklear.
Definition: nuklear_input.c:57
+
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
Definition: nuklear_draw.c:89
+
NK_API void nk_property_double(struct nk_context *, const char *name, double min, double *val, double max, double step, float inc_per_pixel)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API void nk_layout_row_template_push_static(struct nk_context *, float width)
+
NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx)
+
NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+
NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
Definition: nuklear_group.c:10
+
NK_API nk_bool nk_tree_state_image_push(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:151
+
NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos)
+
NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state)
+
NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name)
+
NK_API struct nk_command_buffer * nk_window_get_canvas(const struct nk_context *ctx)
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state)
+
NK_API nk_bool nk_filter_default(const struct nk_text_edit *, nk_rune unicode)
filter function
Definition: nuklear_edit.c:10
+
NK_API const struct nk_command * nk__begin(struct nk_context *)
Returns a draw command list iterator to iterate all draw commands accumulated over one frame.
+
NK_API void nk_layout_row_template_end(struct nk_context *)
+
NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx)
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+
nk_widget_states
Definition: nuklear.h:3087
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds)
+
NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds)
+
NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx)
+
NK_API nk_bool nk_tree_state_push(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:145
+
NK_API struct nk_panel * nk_window_get_panel(const struct nk_context *ctx)
+
NK_API nk_bool nk_tree_push_hashed(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:176
+
NK_API void nk_layout_set_min_row_height(struct nk_context *, float height)
Sets the currently used minimum row height.
+
NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond)
+
NK_API float nk_window_get_height(const struct nk_context *ctx)
+
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
Starts a new dynamic or fixed row with given height and columns.
+
NK_API nk_bool nk_group_begin_titled(struct nk_context *, const char *name, const char *title, nk_flags)
Starts a new widget group.
+
NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags)
+
NK_API void nk_layout_space_push(struct nk_context *, struct nk_rect bounds)
+
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
+
NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size)
+
NK_API void nk_input_button(struct nk_context *, enum nk_buttons, int x, int y, nk_bool down)
Mirrors the state of a specific mouse button to nuklear.
Definition: nuklear_input.c:72
+
NK_API void nk_group_set_scroll(struct nk_context *, const char *id, nk_uint x_offset, nk_uint y_offset)
+
NK_API void nk_layout_row_template_begin(struct nk_context *, float row_height)
+
NK_API nk_bool nk_init(struct nk_context *, const struct nk_allocator *, const struct nk_user_font *)
+
NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width)
Utility functions to calculate window ratio from pixel size.
+
NK_API void nk_tree_state_pop(struct nk_context *)
Definition: nuklear_tree.c:157
+
NK_API void nk_layout_row_push(struct nk_context *, float value)
\breif Specifies either window ratio or width of a single column
+
NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx)
Returns the width of the next row allocate by one of the layouting functions.
+
NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds)
+
NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx)
+
NK_API void nk_input_char(struct nk_context *, char)
Copies a single ASCII character into an internal text buffer.
+
NK_API float nk_window_get_width(const struct nk_context *ctx)
nk_window_get_width
+
NK_API void nk_input_scroll(struct nk_context *, struct nk_vec2 val)
Copies the last mouse scroll value to nuklear.
Definition: nuklear_input.c:99
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+
@ NK_WIDGET_VALID
The widget is completely inside the window and can be updated and drawn.
Definition: nuklear.h:3083
+
@ NK_WIDGET_INVALID
The widget cannot be seen and is completely out of view.
Definition: nuklear.h:3082
+
NK_API double nk_propertyd(struct nk_context *, const char *name, double min, double val, double max, double step, float inc_per_pixel)
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_layout_space_begin(struct nk_context *, enum nk_layout_format, float height, int widget_count)
+
NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx)
+
NK_API struct nk_rect nk_window_get_content_region(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char *name)
+
NK_API const struct nk_command * nk__next(struct nk_context *, const struct nk_command *)
Returns draw command pointer pointing to the next command inside the draw command list.
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+
NK_API void nk_end(struct nk_context *ctx)
+
NK_API void nk_group_end(struct nk_context *)
+
NK_API void nk_layout_row_template_push_variable(struct nk_context *, float min_width)
+
NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx)
+
nk_edit_events
Definition: nuklear.h:3501
+
@ NK_EDIT_INACTIVE
!< edit widget is currently being modified
Definition: nuklear.h:3503
+
@ NK_EDIT_DEACTIVATED
!< edit widget went from state inactive to state active
Definition: nuklear.h:3505
+
@ NK_EDIT_COMMITED
!< edit widget went from state active to state inactive
Definition: nuklear.h:3506
+
@ NK_EDIT_ACTIVATED
!< edit widget is not active and is not being modified
Definition: nuklear.h:3504
+
NK_API int nk_propertyi(struct nk_context *, const char *name, int min, int val, int max, int step, float inc_per_pixel)
+
NK_API nk_bool nk_group_scrolled_begin(struct nk_context *, struct nk_scroll *off, const char *title, nk_flags)
+
NK_API void nk_input_glyph(struct nk_context *, const nk_glyph)
Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.
+
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.
+
NK_API void nk_textedit_init(struct nk_text_edit *, const struct nk_allocator *, nk_size size)
text editor
+
NK_API struct nk_window * nk_window_find(const struct nk_context *ctx, const char *name)
+ + + +
struct nk_allocator pool
!< buffer marker to free a buffer to a certain offset
Definition: nuklear.h:4191
+
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
enum nk_allocation_type type
!< allocator callback for dynamic buffers
Definition: nuklear.h:4192
+
nk_size needed
!< total amount of memory allocated
Definition: nuklear.h:4196
+
nk_size size
!< number of allocation calls
Definition: nuklear.h:4198
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+
float grow_factor
!< memory and size of the current memory block
Definition: nuklear.h:4194
+
nk_size calls
!< totally consumed memory given that enough memory is present
Definition: nuklear.h:4197
+ + + + + + + + + + + + + + + + + + + + + + + + +
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ + +
int build
windows
Definition: nuklear.h:5733
+
struct nk_text_edit text_edit
text editor objects are quite big because of an internal undo/redo stack.
Definition: nuklear.h:5728
+
struct nk_command_buffer overlay
draw buffer used for overlay drawing operation like cursor
Definition: nuklear.h:5730
+ +
enum nk_anti_aliasing shape_AA
!< line anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:981
+
enum nk_anti_aliasing line_AA
!< global alpha value
Definition: nuklear.h:980
+
nk_size vertex_alignment
!< sizeof one vertex for vertex packing
Definition: nuklear.h:988
+
nk_size vertex_size
!< describes the vertex output format and packing
Definition: nuklear.h:987
+
const struct nk_draw_vertex_layout_element * vertex_layout
!< handle to texture with a white pixel for shape drawing
Definition: nuklear.h:986
+
unsigned arc_segment_count
!< number of segments used for circles: default to 22
Definition: nuklear.h:983
+
unsigned circle_segment_count
!< shape anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:982
+
unsigned curve_segment_count
!< number of segments used for arcs: default to 22
Definition: nuklear.h:984
+
struct nk_draw_null_texture tex_null
!< number of segments used for curves: default to 22
Definition: nuklear.h:985
+ + +
struct nk_vec2 uv
!< texture handle to a texture with a white pixel
Definition: nuklear.h:976
+ + + + + + + + + + + + + + + + + + + + + + + +
==============================================================
Definition: nuklear.h:4226
+ + + + + + + + + + + + + + + + + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + + + + + +
+
+ + + + diff --git a/nuklear__9slice_8c_source.html b/nuklear__9slice_8c_source.html new file mode 100644 index 000000000..0a4aef03d --- /dev/null +++ b/nuklear__9slice_8c_source.html @@ -0,0 +1,221 @@ + + + + + + + +Nuklear: src/nuklear_9slice.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_9slice.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * 9-SLICE
+
7  *
+
8  * ===============================================================*/
+
9 NK_API struct nk_nine_slice
+
10 nk_sub9slice_ptr(void *ptr, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
11 {
+
12  struct nk_nine_slice s;
+
13  struct nk_image *i = &s.img;
+
14  nk_zero(&s, sizeof(s));
+
15  i->handle.ptr = ptr;
+
16  i->w = w; i->h = h;
+
17  i->region[0] = (nk_ushort)rgn.x;
+
18  i->region[1] = (nk_ushort)rgn.y;
+
19  i->region[2] = (nk_ushort)rgn.w;
+
20  i->region[3] = (nk_ushort)rgn.h;
+
21  s.l = l; s.t = t; s.r = r; s.b = b;
+
22  return s;
+
23 }
+
24 NK_API struct nk_nine_slice
+
25 nk_sub9slice_id(int id, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
26 {
+
27  struct nk_nine_slice s;
+
28  struct nk_image *i = &s.img;
+
29  nk_zero(&s, sizeof(s));
+
30  i->handle.id = id;
+
31  i->w = w; i->h = h;
+
32  i->region[0] = (nk_ushort)rgn.x;
+
33  i->region[1] = (nk_ushort)rgn.y;
+
34  i->region[2] = (nk_ushort)rgn.w;
+
35  i->region[3] = (nk_ushort)rgn.h;
+
36  s.l = l; s.t = t; s.r = r; s.b = b;
+
37  return s;
+
38 }
+
39 NK_API struct nk_nine_slice
+
40 nk_sub9slice_handle(nk_handle handle, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
41 {
+
42  struct nk_nine_slice s;
+
43  struct nk_image *i = &s.img;
+
44  nk_zero(&s, sizeof(s));
+
45  i->handle = handle;
+
46  i->w = w; i->h = h;
+
47  i->region[0] = (nk_ushort)rgn.x;
+
48  i->region[1] = (nk_ushort)rgn.y;
+
49  i->region[2] = (nk_ushort)rgn.w;
+
50  i->region[3] = (nk_ushort)rgn.h;
+
51  s.l = l; s.t = t; s.r = r; s.b = b;
+
52  return s;
+
53 }
+
54 NK_API struct nk_nine_slice
+
55 nk_nine_slice_handle(nk_handle handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
56 {
+
57  struct nk_nine_slice s;
+
58  struct nk_image *i = &s.img;
+
59  nk_zero(&s, sizeof(s));
+
60  i->handle = handle;
+
61  i->w = 0; i->h = 0;
+
62  i->region[0] = 0;
+
63  i->region[1] = 0;
+
64  i->region[2] = 0;
+
65  i->region[3] = 0;
+
66  s.l = l; s.t = t; s.r = r; s.b = b;
+
67  return s;
+
68 }
+
69 NK_API struct nk_nine_slice
+
70 nk_nine_slice_ptr(void *ptr, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
71 {
+
72  struct nk_nine_slice s;
+
73  struct nk_image *i = &s.img;
+
74  nk_zero(&s, sizeof(s));
+
75  NK_ASSERT(ptr);
+
76  i->handle.ptr = ptr;
+
77  i->w = 0; i->h = 0;
+
78  i->region[0] = 0;
+
79  i->region[1] = 0;
+
80  i->region[2] = 0;
+
81  i->region[3] = 0;
+
82  s.l = l; s.t = t; s.r = r; s.b = b;
+
83  return s;
+
84 }
+
85 NK_API struct nk_nine_slice
+
86 nk_nine_slice_id(int id, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
+
87 {
+
88  struct nk_nine_slice s;
+
89  struct nk_image *i = &s.img;
+
90  nk_zero(&s, sizeof(s));
+
91  i->handle.id = id;
+
92  i->w = 0; i->h = 0;
+
93  i->region[0] = 0;
+
94  i->region[1] = 0;
+
95  i->region[2] = 0;
+
96  i->region[3] = 0;
+
97  s.l = l; s.t = t; s.r = r; s.b = b;
+
98  return s;
+
99 }
+
100 NK_API int
+
101 nk_nine_slice_is_sub9slice(const struct nk_nine_slice* slice)
+
102 {
+
103  NK_ASSERT(slice);
+
104  return !(slice->img.w == 0 && slice->img.h == 0);
+
105 }
+
106 
+
main API and documentation file
+ + + + +
+
+ + + + diff --git a/nuklear__buffer_8c_source.html b/nuklear__buffer_8c_source.html new file mode 100644 index 000000000..8d891aa4f --- /dev/null +++ b/nuklear__buffer_8c_source.html @@ -0,0 +1,399 @@ + + + + + + + +Nuklear: src/nuklear_buffer.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_buffer.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * BUFFER
+
7  *
+
8  * ===============================================================*/
+
9 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
10 NK_LIB void*
+
11 nk_malloc(nk_handle unused, void *old,nk_size size)
+
12 {
+
13  NK_UNUSED(unused);
+
14  NK_UNUSED(old);
+
15  return malloc(size);
+
16 }
+
17 NK_LIB void
+
18 nk_mfree(nk_handle unused, void *ptr)
+
19 {
+
20  NK_UNUSED(unused);
+
21  free(ptr);
+
22 }
+
23 NK_API void
+
24 nk_buffer_init_default(struct nk_buffer *buffer)
+
25 {
+
26  struct nk_allocator alloc;
+
27  alloc.userdata.ptr = 0;
+
28  alloc.alloc = nk_malloc;
+
29  alloc.free = nk_mfree;
+
30  nk_buffer_init(buffer, &alloc, NK_BUFFER_DEFAULT_INITIAL_SIZE);
+
31 }
+
32 #endif
+
33 
+
34 NK_API void
+
35 nk_buffer_init(struct nk_buffer *b, const struct nk_allocator *a,
+
36  nk_size initial_size)
+
37 {
+
38  NK_ASSERT(b);
+
39  NK_ASSERT(a);
+
40  NK_ASSERT(initial_size);
+
41  if (!b || !a || !initial_size) return;
+
42 
+
43  nk_zero(b, sizeof(*b));
+
44  b->type = NK_BUFFER_DYNAMIC;
+
45  b->memory.ptr = a->alloc(a->userdata,0, initial_size);
+
46  b->memory.size = initial_size;
+
47  b->size = initial_size;
+
48  b->grow_factor = 2.0f;
+
49  b->pool = *a;
+
50 }
+
51 NK_API void
+
52 nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size)
+
53 {
+
54  NK_ASSERT(b);
+
55  NK_ASSERT(m);
+
56  NK_ASSERT(size);
+
57  if (!b || !m || !size) return;
+
58 
+
59  nk_zero(b, sizeof(*b));
+
60  b->type = NK_BUFFER_FIXED;
+
61  b->memory.ptr = m;
+
62  b->memory.size = size;
+
63  b->size = size;
+
64 }
+
65 NK_LIB void*
+
66 nk_buffer_align(void *unaligned,
+
67  nk_size align, nk_size *alignment,
+
68  enum nk_buffer_allocation_type type)
+
69 {
+
70  void *memory = 0;
+
71  switch (type) {
+
72  default:
+
73  case NK_BUFFER_MAX:
+
74  case NK_BUFFER_FRONT:
+
75  if (align) {
+
76  memory = NK_ALIGN_PTR(unaligned, align);
+
77  *alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
+
78  } else {
+
79  memory = unaligned;
+
80  *alignment = 0;
+
81  }
+
82  break;
+
83  case NK_BUFFER_BACK:
+
84  if (align) {
+
85  memory = NK_ALIGN_PTR_BACK(unaligned, align);
+
86  *alignment = (nk_size)((nk_byte*)unaligned - (nk_byte*)memory);
+
87  } else {
+
88  memory = unaligned;
+
89  *alignment = 0;
+
90  }
+
91  break;
+
92  }
+
93  return memory;
+
94 }
+
95 NK_LIB void*
+
96 nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size)
+
97 {
+
98  void *temp;
+
99  nk_size buffer_size;
+
100 
+
101  NK_ASSERT(b);
+
102  NK_ASSERT(size);
+
103  if (!b || !size || !b->pool.alloc || !b->pool.free)
+
104  return 0;
+
105 
+
106  buffer_size = b->memory.size;
+
107  temp = b->pool.alloc(b->pool.userdata, b->memory.ptr, capacity);
+
108  NK_ASSERT(temp);
+
109  if (!temp) return 0;
+
110 
+
111  *size = capacity;
+
112  if (temp != b->memory.ptr) {
+
113  NK_MEMCPY(temp, b->memory.ptr, buffer_size);
+
114  b->pool.free(b->pool.userdata, b->memory.ptr);
+
115  }
+
116 
+
117  if (b->size == buffer_size) {
+
118  /* no back buffer so just set correct size */
+
119  b->size = capacity;
+
120  return temp;
+
121  } else {
+
122  /* copy back buffer to the end of the new buffer */
+
123  void *dst, *src;
+
124  nk_size back_size;
+
125  back_size = buffer_size - b->size;
+
126  dst = nk_ptr_add(void, temp, capacity - back_size);
+
127  src = nk_ptr_add(void, temp, b->size);
+
128  NK_MEMCPY(dst, src, back_size);
+
129  b->size = capacity - back_size;
+
130  }
+
131  return temp;
+
132 }
+
133 NK_LIB void*
+
134 nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
+
135  nk_size size, nk_size align)
+
136 {
+
137  int full;
+
138  nk_size alignment;
+
139  void *unaligned;
+
140  void *memory;
+
141 
+
142  NK_ASSERT(b);
+
143  NK_ASSERT(size);
+
144  if (!b || !size) return 0;
+
145  b->needed += size;
+
146 
+
147  /* calculate total size with needed alignment + size */
+
148  if (type == NK_BUFFER_FRONT)
+
149  unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated);
+
150  else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size);
+
151  memory = nk_buffer_align(unaligned, align, &alignment, type);
+
152 
+
153  /* check if buffer has enough memory*/
+
154  if (type == NK_BUFFER_FRONT)
+
155  full = ((b->allocated + size + alignment) > b->size);
+
156  else full = ((b->size - NK_MIN(b->size,(size + alignment))) <= b->allocated);
+
157 
+
158  if (full) {
+
159  nk_size capacity;
+
160  if (b->type != NK_BUFFER_DYNAMIC)
+
161  return 0;
+
162  NK_ASSERT(b->pool.alloc && b->pool.free);
+
163  if (b->type != NK_BUFFER_DYNAMIC || !b->pool.alloc || !b->pool.free)
+
164  return 0;
+
165 
+
166  /* buffer is full so allocate bigger buffer if dynamic */
+
167  capacity = (nk_size)((float)b->memory.size * b->grow_factor);
+
168  capacity = NK_MAX(capacity, nk_round_up_pow2((nk_uint)(b->allocated + size)));
+
169  b->memory.ptr = nk_buffer_realloc(b, capacity, &b->memory.size);
+
170  if (!b->memory.ptr) return 0;
+
171 
+
172  /* align newly allocated pointer */
+
173  if (type == NK_BUFFER_FRONT)
+
174  unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated);
+
175  else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size);
+
176  memory = nk_buffer_align(unaligned, align, &alignment, type);
+
177  }
+
178  if (type == NK_BUFFER_FRONT)
+
179  b->allocated += size + alignment;
+
180  else b->size -= (size + alignment);
+
181  b->needed += alignment;
+
182  b->calls++;
+
183  return memory;
+
184 }
+
185 NK_API void
+
186 nk_buffer_push(struct nk_buffer *b, enum nk_buffer_allocation_type type,
+
187  const void *memory, nk_size size, nk_size align)
+
188 {
+
189  void *mem = nk_buffer_alloc(b, type, size, align);
+
190  if (!mem) return;
+
191  NK_MEMCPY(mem, memory, size);
+
192 }
+
193 NK_API void
+
194 nk_buffer_mark(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
+
195 {
+
196  NK_ASSERT(buffer);
+
197  if (!buffer) return;
+
198  buffer->marker[type].active = nk_true;
+
199  if (type == NK_BUFFER_BACK)
+
200  buffer->marker[type].offset = buffer->size;
+
201  else buffer->marker[type].offset = buffer->allocated;
+
202 }
+
203 NK_API void
+
204 nk_buffer_reset(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
+
205 {
+
206  NK_ASSERT(buffer);
+
207  if (!buffer) return;
+
208  if (type == NK_BUFFER_BACK) {
+
209  /* reset back buffer either back to marker or empty */
+
210  buffer->needed -= (buffer->memory.size - buffer->marker[type].offset);
+
211  if (buffer->marker[type].active)
+
212  buffer->size = buffer->marker[type].offset;
+
213  else buffer->size = buffer->memory.size;
+
214  buffer->marker[type].active = nk_false;
+
215  } else {
+
216  /* reset front buffer either back to back marker or empty */
+
217  buffer->needed -= (buffer->allocated - buffer->marker[type].offset);
+
218  if (buffer->marker[type].active)
+
219  buffer->allocated = buffer->marker[type].offset;
+
220  else buffer->allocated = 0;
+
221  buffer->marker[type].active = nk_false;
+
222  }
+
223 }
+
224 NK_API void
+
225 nk_buffer_clear(struct nk_buffer *b)
+
226 {
+
227  NK_ASSERT(b);
+
228  if (!b) return;
+
229  b->allocated = 0;
+
230  b->size = b->memory.size;
+
231  b->calls = 0;
+
232  b->needed = 0;
+
233 }
+
234 NK_API void
+
235 nk_buffer_free(struct nk_buffer *b)
+
236 {
+
237  NK_ASSERT(b);
+
238  if (!b || !b->memory.ptr) return;
+
239  if (b->type == NK_BUFFER_FIXED) return;
+
240  if (!b->pool.free) return;
+
241  NK_ASSERT(b->pool.free);
+
242  b->pool.free(b->pool.userdata, b->memory.ptr);
+
243 }
+
244 NK_API void
+
245 nk_buffer_info(struct nk_memory_status *s, const struct nk_buffer *b)
+
246 {
+
247  NK_ASSERT(b);
+
248  NK_ASSERT(s);
+
249  if (!s || !b) return;
+
250  s->allocated = b->allocated;
+
251  s->size = b->memory.size;
+
252  s->needed = b->needed;
+
253  s->memory = b->memory.ptr;
+
254  s->calls = b->calls;
+
255 }
+
256 NK_API void*
+
257 nk_buffer_memory(struct nk_buffer *buffer)
+
258 {
+
259  NK_ASSERT(buffer);
+
260  if (!buffer) return 0;
+
261  return buffer->memory.ptr;
+
262 }
+
263 NK_API const void*
+
264 nk_buffer_memory_const(const struct nk_buffer *buffer)
+
265 {
+
266  NK_ASSERT(buffer);
+
267  if (!buffer) return 0;
+
268  return buffer->memory.ptr;
+
269 }
+
270 NK_API nk_size
+
271 nk_buffer_total(const struct nk_buffer *buffer)
+
272 {
+
273  NK_ASSERT(buffer);
+
274  if (!buffer) return 0;
+
275  return buffer->memory.size;
+
276 }
+
main API and documentation file
+ + +
struct nk_allocator pool
!< buffer marker to free a buffer to a certain offset
Definition: nuklear.h:4191
+
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
enum nk_allocation_type type
!< allocator callback for dynamic buffers
Definition: nuklear.h:4192
+
nk_size needed
!< total amount of memory allocated
Definition: nuklear.h:4196
+
nk_size size
!< number of allocation calls
Definition: nuklear.h:4198
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+
float grow_factor
!< memory and size of the current memory block
Definition: nuklear.h:4194
+
nk_size calls
!< totally consumed memory given that enough memory is present
Definition: nuklear.h:4197
+ + +
+
+ + + + diff --git a/nuklear__button_8c_source.html b/nuklear__button_8c_source.html new file mode 100644 index 000000000..86ed7e14f --- /dev/null +++ b/nuklear__button_8c_source.html @@ -0,0 +1,829 @@ + + + + + + + +Nuklear: src/nuklear_button.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_button.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * BUTTON
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type,
+
11  struct nk_rect content, struct nk_color background, struct nk_color foreground,
+
12  float border_width, const struct nk_user_font *font)
+
13 {
+
14  switch (type) {
+
15  case NK_SYMBOL_X:
+
16  case NK_SYMBOL_UNDERSCORE:
+
17  case NK_SYMBOL_PLUS:
+
18  case NK_SYMBOL_MINUS: {
+
19  /* single character text symbol */
+
20  const char *X = (type == NK_SYMBOL_X) ? "x":
+
21  (type == NK_SYMBOL_UNDERSCORE) ? "_":
+
22  (type == NK_SYMBOL_PLUS) ? "+": "-";
+
23  struct nk_text text;
+
24  text.padding = nk_vec2(0,0);
+
25  text.background = background;
+
26  text.text = foreground;
+
27  nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font);
+
28  } break;
+
29  case NK_SYMBOL_CIRCLE_SOLID:
+
30  case NK_SYMBOL_CIRCLE_OUTLINE:
+
31  case NK_SYMBOL_RECT_SOLID:
+
32  case NK_SYMBOL_RECT_OUTLINE: {
+
33  /* simple empty/filled shapes */
+
34  if (type == NK_SYMBOL_RECT_SOLID || type == NK_SYMBOL_RECT_OUTLINE) {
+
35  nk_fill_rect(out, content, 0, foreground);
+
36  if (type == NK_SYMBOL_RECT_OUTLINE)
+
37  nk_fill_rect(out, nk_shrink_rect(content, border_width), 0, background);
+
38  } else {
+
39  nk_fill_circle(out, content, foreground);
+
40  if (type == NK_SYMBOL_CIRCLE_OUTLINE)
+
41  nk_fill_circle(out, nk_shrink_rect(content, 1), background);
+
42  }
+
43  } break;
+
44  case NK_SYMBOL_TRIANGLE_UP:
+
45  case NK_SYMBOL_TRIANGLE_DOWN:
+
46  case NK_SYMBOL_TRIANGLE_LEFT:
+
47  case NK_SYMBOL_TRIANGLE_RIGHT: {
+
48  enum nk_heading heading;
+
49  struct nk_vec2 points[3];
+
50  heading = (type == NK_SYMBOL_TRIANGLE_RIGHT) ? NK_RIGHT :
+
51  (type == NK_SYMBOL_TRIANGLE_LEFT) ? NK_LEFT:
+
52  (type == NK_SYMBOL_TRIANGLE_UP) ? NK_UP: NK_DOWN;
+
53  nk_triangle_from_direction(points, content, 0, 0, heading);
+
54  nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y,
+
55  points[2].x, points[2].y, foreground);
+
56  } break;
+
57  case NK_SYMBOL_TRIANGLE_UP_OUTLINE:
+
58  case NK_SYMBOL_TRIANGLE_DOWN_OUTLINE:
+
59  case NK_SYMBOL_TRIANGLE_LEFT_OUTLINE:
+
60  case NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE: {
+
61  enum nk_heading heading;
+
62  struct nk_vec2 points[3];
+
63  heading = (type == NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE) ? NK_RIGHT :
+
64  (type == NK_SYMBOL_TRIANGLE_LEFT_OUTLINE) ? NK_LEFT:
+
65  (type == NK_SYMBOL_TRIANGLE_UP_OUTLINE) ? NK_UP: NK_DOWN;
+
66  nk_triangle_from_direction(points, content, 0, 0, heading);
+
67  nk_stroke_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y,
+
68  points[2].x, points[2].y, border_width, foreground);
+
69  } break;
+
70  default:
+
71  case NK_SYMBOL_NONE:
+
72  case NK_SYMBOL_MAX: break;
+
73  }
+
74 }
+
75 NK_LIB nk_bool
+
76 nk_button_behavior(nk_flags *state, struct nk_rect r,
+
77  const struct nk_input *i, enum nk_button_behavior behavior)
+
78 {
+
79  int ret = 0;
+
80  nk_widget_state_reset(state);
+
81  if (!i) return 0;
+
82  if (nk_input_is_mouse_hovering_rect(i, r)) {
+
83  *state = NK_WIDGET_STATE_HOVERED;
+
84  if (nk_input_is_mouse_down(i, NK_BUTTON_LEFT))
+
85  *state = NK_WIDGET_STATE_ACTIVE;
+
86  if (nk_input_has_mouse_click_in_button_rect(i, NK_BUTTON_LEFT, r)) {
+
87  ret = (behavior != NK_BUTTON_DEFAULT) ?
+
88  nk_input_is_mouse_down(i, NK_BUTTON_LEFT):
+
89 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+
90  nk_input_is_mouse_released(i, NK_BUTTON_LEFT);
+
91 #else
+
92  nk_input_is_mouse_pressed(i, NK_BUTTON_LEFT);
+
93 #endif
+
94  }
+
95  }
+
96  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(i, r))
+
97  *state |= NK_WIDGET_STATE_ENTERED;
+
98  else if (nk_input_is_mouse_prev_hovering_rect(i, r))
+
99  *state |= NK_WIDGET_STATE_LEFT;
+
100  return ret;
+
101 }
+
102 NK_LIB const struct nk_style_item*
+
103 nk_draw_button(struct nk_command_buffer *out,
+
104  const struct nk_rect *bounds, nk_flags state,
+
105  const struct nk_style_button *style)
+
106 {
+
107  const struct nk_style_item *background;
+
108  if (state & NK_WIDGET_STATE_HOVER)
+
109  background = &style->hover;
+
110  else if (state & NK_WIDGET_STATE_ACTIVED)
+
111  background = &style->active;
+
112  else background = &style->normal;
+
113 
+
114  switch (background->type) {
+
115  case NK_STYLE_ITEM_IMAGE:
+
116  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor_background));
+
117  break;
+
118  case NK_STYLE_ITEM_NINE_SLICE:
+
119  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor_background));
+
120  break;
+
121  case NK_STYLE_ITEM_COLOR:
+
122  nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor_background));
+
123  nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor_background));
+
124  break;
+
125  }
+
126  return background;
+
127 }
+
128 NK_LIB nk_bool
+
129 nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r,
+
130  const struct nk_style_button *style, const struct nk_input *in,
+
131  enum nk_button_behavior behavior, struct nk_rect *content)
+
132 {
+
133  struct nk_rect bounds;
+
134  NK_ASSERT(style);
+
135  NK_ASSERT(state);
+
136  NK_ASSERT(out);
+
137  if (!out || !style)
+
138  return nk_false;
+
139 
+
140  /* calculate button content space */
+
141  content->x = r.x + style->padding.x + style->border + style->rounding;
+
142  content->y = r.y + style->padding.y + style->border + style->rounding;
+
143  content->w = r.w - (2 * (style->padding.x + style->border + style->rounding));
+
144  content->h = r.h - (2 * (style->padding.y + style->border + style->rounding));
+
145 
+
146  /* execute button behavior */
+
147  bounds.x = r.x - style->touch_padding.x;
+
148  bounds.y = r.y - style->touch_padding.y;
+
149  bounds.w = r.w + 2 * style->touch_padding.x;
+
150  bounds.h = r.h + 2 * style->touch_padding.y;
+
151  return nk_button_behavior(state, bounds, in, behavior);
+
152 }
+
153 NK_LIB void
+
154 nk_draw_button_text(struct nk_command_buffer *out,
+
155  const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state,
+
156  const struct nk_style_button *style, const char *txt, int len,
+
157  nk_flags text_alignment, const struct nk_user_font *font)
+
158 {
+
159  struct nk_text text;
+
160  const struct nk_style_item *background;
+
161  background = nk_draw_button(out, bounds, state, style);
+
162 
+
163  /* select correct colors/images */
+
164  if (background->type == NK_STYLE_ITEM_COLOR)
+
165  text.background = background->data.color;
+
166  else text.background = style->text_background;
+
167  if (state & NK_WIDGET_STATE_HOVER)
+
168  text.text = style->text_hover;
+
169  else if (state & NK_WIDGET_STATE_ACTIVED)
+
170  text.text = style->text_active;
+
171  else text.text = style->text_normal;
+
172 
+
173  text.text = nk_rgb_factor(text.text, style->color_factor_text);
+
174 
+
175  text.padding = nk_vec2(0,0);
+
176  nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
+
177 }
+
178 NK_LIB nk_bool
+
179 nk_do_button_text(nk_flags *state,
+
180  struct nk_command_buffer *out, struct nk_rect bounds,
+
181  const char *string, int len, nk_flags align, enum nk_button_behavior behavior,
+
182  const struct nk_style_button *style, const struct nk_input *in,
+
183  const struct nk_user_font *font)
+
184 {
+
185  struct nk_rect content;
+
186  int ret = nk_false;
+
187 
+
188  NK_ASSERT(state);
+
189  NK_ASSERT(style);
+
190  NK_ASSERT(out);
+
191  NK_ASSERT(string);
+
192  NK_ASSERT(font);
+
193  if (!out || !style || !font || !string)
+
194  return nk_false;
+
195 
+
196  ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+
197  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
198  nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
+
199  if (style->draw_end) style->draw_end(out, style->userdata);
+
200  return ret;
+
201 }
+
202 NK_LIB void
+
203 nk_draw_button_symbol(struct nk_command_buffer *out,
+
204  const struct nk_rect *bounds, const struct nk_rect *content,
+
205  nk_flags state, const struct nk_style_button *style,
+
206  enum nk_symbol_type type, const struct nk_user_font *font)
+
207 {
+
208  struct nk_color sym, bg;
+
209  const struct nk_style_item *background;
+
210 
+
211  /* select correct colors/images */
+
212  background = nk_draw_button(out, bounds, state, style);
+
213  if (background->type == NK_STYLE_ITEM_COLOR)
+
214  bg = background->data.color;
+
215  else bg = style->text_background;
+
216 
+
217  if (state & NK_WIDGET_STATE_HOVER)
+
218  sym = style->text_hover;
+
219  else if (state & NK_WIDGET_STATE_ACTIVED)
+
220  sym = style->text_active;
+
221  else sym = style->text_normal;
+
222 
+
223  sym = nk_rgb_factor(sym, style->color_factor_text);
+
224  nk_draw_symbol(out, type, *content, bg, sym, 1, font);
+
225 }
+
226 NK_LIB nk_bool
+
227 nk_do_button_symbol(nk_flags *state,
+
228  struct nk_command_buffer *out, struct nk_rect bounds,
+
229  enum nk_symbol_type symbol, enum nk_button_behavior behavior,
+
230  const struct nk_style_button *style, const struct nk_input *in,
+
231  const struct nk_user_font *font)
+
232 {
+
233  int ret;
+
234  struct nk_rect content;
+
235 
+
236  NK_ASSERT(state);
+
237  NK_ASSERT(style);
+
238  NK_ASSERT(font);
+
239  NK_ASSERT(out);
+
240  if (!out || !style || !font || !state)
+
241  return nk_false;
+
242 
+
243  ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+
244  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
245  nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
+
246  if (style->draw_end) style->draw_end(out, style->userdata);
+
247  return ret;
+
248 }
+
249 NK_LIB void
+
250 nk_draw_button_image(struct nk_command_buffer *out,
+
251  const struct nk_rect *bounds, const struct nk_rect *content,
+
252  nk_flags state, const struct nk_style_button *style, const struct nk_image *img)
+
253 {
+
254  nk_draw_button(out, bounds, state, style);
+
255  nk_draw_image(out, *content, img, nk_rgb_factor(nk_white, style->color_factor_background));
+
256 }
+
257 NK_LIB nk_bool
+
258 nk_do_button_image(nk_flags *state,
+
259  struct nk_command_buffer *out, struct nk_rect bounds,
+
260  struct nk_image img, enum nk_button_behavior b,
+
261  const struct nk_style_button *style, const struct nk_input *in)
+
262 {
+
263  int ret;
+
264  struct nk_rect content;
+
265 
+
266  NK_ASSERT(state);
+
267  NK_ASSERT(style);
+
268  NK_ASSERT(out);
+
269  if (!out || !style || !state)
+
270  return nk_false;
+
271 
+
272  ret = nk_do_button(state, out, bounds, style, in, b, &content);
+
273  content.x += style->image_padding.x;
+
274  content.y += style->image_padding.y;
+
275  content.w -= 2 * style->image_padding.x;
+
276  content.h -= 2 * style->image_padding.y;
+
277 
+
278  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
279  nk_draw_button_image(out, &bounds, &content, *state, style, &img);
+
280  if (style->draw_end) style->draw_end(out, style->userdata);
+
281  return ret;
+
282 }
+
283 NK_LIB void
+
284 nk_draw_button_text_symbol(struct nk_command_buffer *out,
+
285  const struct nk_rect *bounds, const struct nk_rect *label,
+
286  const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style,
+
287  const char *str, int len, enum nk_symbol_type type,
+
288  const struct nk_user_font *font)
+
289 {
+
290  struct nk_color sym;
+
291  struct nk_text text;
+
292  const struct nk_style_item *background;
+
293 
+
294  /* select correct background colors/images */
+
295  background = nk_draw_button(out, bounds, state, style);
+
296  if (background->type == NK_STYLE_ITEM_COLOR)
+
297  text.background = background->data.color;
+
298  else text.background = style->text_background;
+
299 
+
300  /* select correct text colors */
+
301  if (state & NK_WIDGET_STATE_HOVER) {
+
302  sym = style->text_hover;
+
303  text.text = style->text_hover;
+
304  } else if (state & NK_WIDGET_STATE_ACTIVED) {
+
305  sym = style->text_active;
+
306  text.text = style->text_active;
+
307  } else {
+
308  sym = style->text_normal;
+
309  text.text = style->text_normal;
+
310  }
+
311 
+
312  sym = nk_rgb_factor(sym, style->color_factor_text);
+
313  text.text = nk_rgb_factor(text.text, style->color_factor_text);
+
314  text.padding = nk_vec2(0,0);
+
315  nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font);
+
316  nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
+
317 }
+
318 NK_LIB nk_bool
+
319 nk_do_button_text_symbol(nk_flags *state,
+
320  struct nk_command_buffer *out, struct nk_rect bounds,
+
321  enum nk_symbol_type symbol, const char *str, int len, nk_flags align,
+
322  enum nk_button_behavior behavior, const struct nk_style_button *style,
+
323  const struct nk_user_font *font, const struct nk_input *in)
+
324 {
+
325  int ret;
+
326  struct nk_rect tri = {0,0,0,0};
+
327  struct nk_rect content;
+
328 
+
329  NK_ASSERT(style);
+
330  NK_ASSERT(out);
+
331  NK_ASSERT(font);
+
332  if (!out || !style || !font)
+
333  return nk_false;
+
334 
+
335  ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+
336  tri.y = content.y + (content.h/2) - font->height/2;
+
337  tri.w = font->height; tri.h = font->height;
+
338  if (align & NK_TEXT_ALIGN_LEFT) {
+
339  tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w);
+
340  tri.x = NK_MAX(tri.x, 0);
+
341  } else tri.x = content.x + 2 * style->padding.x;
+
342 
+
343  /* draw button */
+
344  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
345  nk_draw_button_text_symbol(out, &bounds, &content, &tri,
+
346  *state, style, str, len, symbol, font);
+
347  if (style->draw_end) style->draw_end(out, style->userdata);
+
348  return ret;
+
349 }
+
350 NK_LIB void
+
351 nk_draw_button_text_image(struct nk_command_buffer *out,
+
352  const struct nk_rect *bounds, const struct nk_rect *label,
+
353  const struct nk_rect *image, nk_flags state, const struct nk_style_button *style,
+
354  const char *str, int len, const struct nk_user_font *font,
+
355  const struct nk_image *img)
+
356 {
+
357  struct nk_text text;
+
358  const struct nk_style_item *background;
+
359  background = nk_draw_button(out, bounds, state, style);
+
360 
+
361  /* select correct colors */
+
362  if (background->type == NK_STYLE_ITEM_COLOR)
+
363  text.background = background->data.color;
+
364  else text.background = style->text_background;
+
365  if (state & NK_WIDGET_STATE_HOVER)
+
366  text.text = style->text_hover;
+
367  else if (state & NK_WIDGET_STATE_ACTIVED)
+
368  text.text = style->text_active;
+
369  else text.text = style->text_normal;
+
370 
+
371  text.text = nk_rgb_factor(text.text, style->color_factor_text);
+
372  text.padding = nk_vec2(0, 0);
+
373  nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
+
374  nk_draw_image(out, *image, img, nk_rgb_factor(nk_white, style->color_factor_background));
+
375 }
+
376 NK_LIB nk_bool
+
377 nk_do_button_text_image(nk_flags *state,
+
378  struct nk_command_buffer *out, struct nk_rect bounds,
+
379  struct nk_image img, const char* str, int len, nk_flags align,
+
380  enum nk_button_behavior behavior, const struct nk_style_button *style,
+
381  const struct nk_user_font *font, const struct nk_input *in)
+
382 {
+
383  int ret;
+
384  struct nk_rect icon;
+
385  struct nk_rect content;
+
386 
+
387  NK_ASSERT(style);
+
388  NK_ASSERT(state);
+
389  NK_ASSERT(font);
+
390  NK_ASSERT(out);
+
391  if (!out || !font || !style || !str)
+
392  return nk_false;
+
393 
+
394  ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+
395  icon.y = bounds.y + style->padding.y;
+
396  icon.w = icon.h = bounds.h - 2 * style->padding.y;
+
397  if (align & NK_TEXT_ALIGN_LEFT) {
+
398  icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+
399  icon.x = NK_MAX(icon.x, 0);
+
400  } else icon.x = bounds.x + 2 * style->padding.x;
+
401 
+
402  icon.x += style->image_padding.x;
+
403  icon.y += style->image_padding.y;
+
404  icon.w -= 2 * style->image_padding.x;
+
405  icon.h -= 2 * style->image_padding.y;
+
406 
+
407  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
408  nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
+
409  if (style->draw_end) style->draw_end(out, style->userdata);
+
410  return ret;
+
411 }
+
412 NK_API void
+
413 nk_button_set_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
+
414 {
+
415  NK_ASSERT(ctx);
+
416  if (!ctx) return;
+
417  ctx->button_behavior = behavior;
+
418 }
+
419 NK_API nk_bool
+
420 nk_button_push_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
+
421 {
+
422  struct nk_config_stack_button_behavior *button_stack;
+
423  struct nk_config_stack_button_behavior_element *element;
+
424 
+
425  NK_ASSERT(ctx);
+
426  if (!ctx) return 0;
+
427 
+
428  button_stack = &ctx->stacks.button_behaviors;
+
429  NK_ASSERT(button_stack->head < (int)NK_LEN(button_stack->elements));
+
430  if (button_stack->head >= (int)NK_LEN(button_stack->elements))
+
431  return 0;
+
432 
+
433  element = &button_stack->elements[button_stack->head++];
+
434  element->address = &ctx->button_behavior;
+
435  element->old_value = ctx->button_behavior;
+
436  ctx->button_behavior = behavior;
+
437  return 1;
+
438 }
+
439 NK_API nk_bool
+
440 nk_button_pop_behavior(struct nk_context *ctx)
+
441 {
+
442  struct nk_config_stack_button_behavior *button_stack;
+
443  struct nk_config_stack_button_behavior_element *element;
+
444 
+
445  NK_ASSERT(ctx);
+
446  if (!ctx) return 0;
+
447 
+
448  button_stack = &ctx->stacks.button_behaviors;
+
449  NK_ASSERT(button_stack->head > 0);
+
450  if (button_stack->head < 1)
+
451  return 0;
+
452 
+
453  element = &button_stack->elements[--button_stack->head];
+
454  *element->address = element->old_value;
+
455  return 1;
+
456 }
+
457 NK_API nk_bool
+
458 nk_button_text_styled(struct nk_context *ctx,
+
459  const struct nk_style_button *style, const char *title, int len)
+
460 {
+
461  struct nk_window *win;
+
462  struct nk_panel *layout;
+
463  const struct nk_input *in;
+
464 
+
465  struct nk_rect bounds;
+
466  enum nk_widget_layout_states state;
+
467 
+
468  NK_ASSERT(ctx);
+
469  NK_ASSERT(style);
+
470  NK_ASSERT(ctx->current);
+
471  NK_ASSERT(ctx->current->layout);
+
472  if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0;
+
473 
+
474  win = ctx->current;
+
475  layout = win->layout;
+
476  state = nk_widget(&bounds, ctx);
+
477 
+
478  if (!state) return 0;
+
479  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
480  return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
+
481  title, len, style->text_alignment, ctx->button_behavior,
+
482  style, in, ctx->style.font);
+
483 }
+
484 NK_API nk_bool
+
485 nk_button_text(struct nk_context *ctx, const char *title, int len)
+
486 {
+
487  NK_ASSERT(ctx);
+
488  if (!ctx) return 0;
+
489  return nk_button_text_styled(ctx, &ctx->style.button, title, len);
+
490 }
+
491 NK_API nk_bool nk_button_label_styled(struct nk_context *ctx,
+
492  const struct nk_style_button *style, const char *title)
+
493 {
+
494  return nk_button_text_styled(ctx, style, title, nk_strlen(title));
+
495 }
+
496 NK_API nk_bool nk_button_label(struct nk_context *ctx, const char *title)
+
497 {
+
498  return nk_button_text(ctx, title, nk_strlen(title));
+
499 }
+
500 NK_API nk_bool
+
501 nk_button_color(struct nk_context *ctx, struct nk_color color)
+
502 {
+
503  struct nk_window *win;
+
504  struct nk_panel *layout;
+
505  const struct nk_input *in;
+
506  struct nk_style_button button;
+
507 
+
508  int ret = 0;
+
509  struct nk_rect bounds;
+
510  struct nk_rect content;
+
511  enum nk_widget_layout_states state;
+
512 
+
513  NK_ASSERT(ctx);
+
514  NK_ASSERT(ctx->current);
+
515  NK_ASSERT(ctx->current->layout);
+
516  if (!ctx || !ctx->current || !ctx->current->layout)
+
517  return 0;
+
518 
+
519  win = ctx->current;
+
520  layout = win->layout;
+
521 
+
522  state = nk_widget(&bounds, ctx);
+
523  if (!state) return 0;
+
524  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
525 
+
526  button = ctx->style.button;
+
527  button.normal = nk_style_item_color(color);
+
528  button.hover = nk_style_item_color(color);
+
529  button.active = nk_style_item_color(color);
+
530  ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds,
+
531  &button, in, ctx->button_behavior, &content);
+
532  nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
+
533  return ret;
+
534 }
+
535 NK_API nk_bool
+
536 nk_button_symbol_styled(struct nk_context *ctx,
+
537  const struct nk_style_button *style, enum nk_symbol_type symbol)
+
538 {
+
539  struct nk_window *win;
+
540  struct nk_panel *layout;
+
541  const struct nk_input *in;
+
542 
+
543  struct nk_rect bounds;
+
544  enum nk_widget_layout_states state;
+
545 
+
546  NK_ASSERT(ctx);
+
547  NK_ASSERT(ctx->current);
+
548  NK_ASSERT(ctx->current->layout);
+
549  if (!ctx || !ctx->current || !ctx->current->layout)
+
550  return 0;
+
551 
+
552  win = ctx->current;
+
553  layout = win->layout;
+
554  state = nk_widget(&bounds, ctx);
+
555  if (!state) return 0;
+
556  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
557  return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+
558  symbol, ctx->button_behavior, style, in, ctx->style.font);
+
559 }
+
560 NK_API nk_bool
+
561 nk_button_symbol(struct nk_context *ctx, enum nk_symbol_type symbol)
+
562 {
+
563  NK_ASSERT(ctx);
+
564  if (!ctx) return 0;
+
565  return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
+
566 }
+
567 NK_API nk_bool
+
568 nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style,
+
569  struct nk_image img)
+
570 {
+
571  struct nk_window *win;
+
572  struct nk_panel *layout;
+
573  const struct nk_input *in;
+
574 
+
575  struct nk_rect bounds;
+
576  enum nk_widget_layout_states state;
+
577 
+
578  NK_ASSERT(ctx);
+
579  NK_ASSERT(ctx->current);
+
580  NK_ASSERT(ctx->current->layout);
+
581  if (!ctx || !ctx->current || !ctx->current->layout)
+
582  return 0;
+
583 
+
584  win = ctx->current;
+
585  layout = win->layout;
+
586 
+
587  state = nk_widget(&bounds, ctx);
+
588  if (!state) return 0;
+
589  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
590  return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds,
+
591  img, ctx->button_behavior, style, in);
+
592 }
+
593 NK_API nk_bool
+
594 nk_button_image(struct nk_context *ctx, struct nk_image img)
+
595 {
+
596  NK_ASSERT(ctx);
+
597  if (!ctx) return 0;
+
598  return nk_button_image_styled(ctx, &ctx->style.button, img);
+
599 }
+
600 NK_API nk_bool
+
601 nk_button_symbol_text_styled(struct nk_context *ctx,
+
602  const struct nk_style_button *style, enum nk_symbol_type symbol,
+
603  const char *text, int len, nk_flags align)
+
604 {
+
605  struct nk_window *win;
+
606  struct nk_panel *layout;
+
607  const struct nk_input *in;
+
608 
+
609  struct nk_rect bounds;
+
610  enum nk_widget_layout_states state;
+
611 
+
612  NK_ASSERT(ctx);
+
613  NK_ASSERT(ctx->current);
+
614  NK_ASSERT(ctx->current->layout);
+
615  if (!ctx || !ctx->current || !ctx->current->layout)
+
616  return 0;
+
617 
+
618  win = ctx->current;
+
619  layout = win->layout;
+
620 
+
621  state = nk_widget(&bounds, ctx);
+
622  if (!state) return 0;
+
623  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
624  return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+
625  symbol, text, len, align, ctx->button_behavior,
+
626  style, ctx->style.font, in);
+
627 }
+
628 NK_API nk_bool
+
629 nk_button_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
+
630  const char* text, int len, nk_flags align)
+
631 {
+
632  NK_ASSERT(ctx);
+
633  if (!ctx) return 0;
+
634  return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
+
635 }
+
636 NK_API nk_bool nk_button_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
+
637  const char *label, nk_flags align)
+
638 {
+
639  return nk_button_symbol_text(ctx, symbol, label, nk_strlen(label), align);
+
640 }
+
641 NK_API nk_bool nk_button_symbol_label_styled(struct nk_context *ctx,
+
642  const struct nk_style_button *style, enum nk_symbol_type symbol,
+
643  const char *title, nk_flags align)
+
644 {
+
645  return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align);
+
646 }
+
647 NK_API nk_bool
+
648 nk_button_image_text_styled(struct nk_context *ctx,
+
649  const struct nk_style_button *style, struct nk_image img, const char *text,
+
650  int len, nk_flags align)
+
651 {
+
652  struct nk_window *win;
+
653  struct nk_panel *layout;
+
654  const struct nk_input *in;
+
655 
+
656  struct nk_rect bounds;
+
657  enum nk_widget_layout_states state;
+
658 
+
659  NK_ASSERT(ctx);
+
660  NK_ASSERT(ctx->current);
+
661  NK_ASSERT(ctx->current->layout);
+
662  if (!ctx || !ctx->current || !ctx->current->layout)
+
663  return 0;
+
664 
+
665  win = ctx->current;
+
666  layout = win->layout;
+
667 
+
668  state = nk_widget(&bounds, ctx);
+
669  if (!state) return 0;
+
670  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
671  return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
+
672  bounds, img, text, len, align, ctx->button_behavior,
+
673  style, ctx->style.font, in);
+
674 }
+
675 NK_API nk_bool
+
676 nk_button_image_text(struct nk_context *ctx, struct nk_image img,
+
677  const char *text, int len, nk_flags align)
+
678 {
+
679  return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
+
680 }
+
681 NK_API nk_bool nk_button_image_label(struct nk_context *ctx, struct nk_image img,
+
682  const char *label, nk_flags align)
+
683 {
+
684  return nk_button_image_text(ctx, img, label, nk_strlen(label), align);
+
685 }
+
686 NK_API nk_bool nk_button_image_label_styled(struct nk_context *ctx,
+
687  const struct nk_style_button *style, struct nk_image img,
+
688  const char *label, nk_flags text_alignment)
+
689 {
+
690  return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment);
+
691 }
+
692 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + + + + +
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__chart_8c_source.html b/nuklear__chart_8c_source.html new file mode 100644 index 000000000..4a6cc361f --- /dev/null +++ b/nuklear__chart_8c_source.html @@ -0,0 +1,463 @@ + + + + + + + +Nuklear: src/nuklear_chart.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_chart.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * CHART
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
+
11  struct nk_color color, struct nk_color highlight,
+
12  int count, float min_value, float max_value)
+
13 {
+
14  struct nk_window *win;
+
15  struct nk_chart *chart;
+
16  const struct nk_style *config;
+
17  const struct nk_style_chart *style;
+
18 
+
19  const struct nk_style_item *background;
+
20  struct nk_rect bounds = {0, 0, 0, 0};
+
21 
+
22  NK_ASSERT(ctx);
+
23  NK_ASSERT(ctx->current);
+
24  NK_ASSERT(ctx->current->layout);
+
25 
+
26  if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+
27  if (!nk_widget(&bounds, ctx)) {
+
28  chart = &ctx->current->layout->chart;
+
29  nk_zero(chart, sizeof(*chart));
+
30  return 0;
+
31  }
+
32 
+
33  win = ctx->current;
+
34  config = &ctx->style;
+
35  chart = &win->layout->chart;
+
36  style = &config->chart;
+
37 
+
38  /* setup basic generic chart */
+
39  nk_zero(chart, sizeof(*chart));
+
40  chart->x = bounds.x + style->padding.x;
+
41  chart->y = bounds.y + style->padding.y;
+
42  chart->w = bounds.w - 2 * style->padding.x;
+
43  chart->h = bounds.h - 2 * style->padding.y;
+
44  chart->w = NK_MAX(chart->w, 2 * style->padding.x);
+
45  chart->h = NK_MAX(chart->h, 2 * style->padding.y);
+
46 
+
47  /* add first slot into chart */
+
48  {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
+
49  slot->type = type;
+
50  slot->count = count;
+
51  slot->color = nk_rgb_factor(color, style->color_factor);
+
52  slot->highlight = highlight;
+
53  slot->min = NK_MIN(min_value, max_value);
+
54  slot->max = NK_MAX(min_value, max_value);
+
55  slot->range = slot->max - slot->min;
+
56  slot->show_markers = style->show_markers;}
+
57 
+
58  /* draw chart background */
+
59  background = &style->background;
+
60 
+
61  switch(background->type) {
+
62  case NK_STYLE_ITEM_IMAGE:
+
63  nk_draw_image(&win->buffer, bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
64  break;
+
65  case NK_STYLE_ITEM_NINE_SLICE:
+
66  nk_draw_nine_slice(&win->buffer, bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
67  break;
+
68  case NK_STYLE_ITEM_COLOR:
+
69  nk_fill_rect(&win->buffer, bounds, style->rounding, nk_rgb_factor(style->border_color, style->color_factor));
+
70  nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
+
71  style->rounding, nk_rgb_factor(style->background.data.color, style->color_factor));
+
72  break;
+
73  }
+
74  return 1;
+
75 }
+
76 NK_API nk_bool
+
77 nk_chart_begin(struct nk_context *ctx, const enum nk_chart_type type,
+
78  int count, float min_value, float max_value)
+
79 {
+
80  return nk_chart_begin_colored(ctx, type, ctx->style.chart.color,
+
81  ctx->style.chart.selected_color, count, min_value, max_value);
+
82 }
+
83 NK_API void
+
84 nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
+
85  struct nk_color color, struct nk_color highlight,
+
86  int count, float min_value, float max_value)
+
87 {
+
88  const struct nk_style_chart* style;
+
89 
+
90  NK_ASSERT(ctx);
+
91  NK_ASSERT(ctx->current);
+
92  NK_ASSERT(ctx->current->layout);
+
93  NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
+
94  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
95  if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
+
96 
+
97  style = &ctx->style.chart;
+
98 
+
99  /* add another slot into the graph */
+
100  {struct nk_chart *chart = &ctx->current->layout->chart;
+
101  struct nk_chart_slot *slot = &chart->slots[chart->slot++];
+
102  slot->type = type;
+
103  slot->count = count;
+
104  slot->color = nk_rgb_factor(color, style->color_factor);
+
105  slot->highlight = highlight;
+
106  slot->min = NK_MIN(min_value, max_value);
+
107  slot->max = NK_MAX(min_value, max_value);
+
108  slot->range = slot->max - slot->min;
+
109  slot->show_markers = style->show_markers;}
+
110 }
+
111 NK_API void
+
112 nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type,
+
113  int count, float min_value, float max_value)
+
114 {
+
115  nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color,
+
116  ctx->style.chart.selected_color, count, min_value, max_value);
+
117 }
+
118 NK_INTERN nk_flags
+
119 nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
+
120  struct nk_chart *g, float value, int slot)
+
121 {
+
122  struct nk_panel *layout = win->layout;
+
123  const struct nk_input *i = ctx->current->widgets_disabled ? 0 : &ctx->input;
+
124  struct nk_command_buffer *out = &win->buffer;
+
125 
+
126  nk_flags ret = 0;
+
127  struct nk_vec2 cur;
+
128  struct nk_rect bounds;
+
129  struct nk_color color;
+
130  float step;
+
131  float range;
+
132  float ratio;
+
133 
+
134  NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+
135  step = g->w / (float)g->slots[slot].count;
+
136  range = g->slots[slot].max - g->slots[slot].min;
+
137  ratio = (value - g->slots[slot].min) / range;
+
138 
+
139  if (g->slots[slot].index == 0) {
+
140  /* first data point does not have a connection */
+
141  g->slots[slot].last.x = g->x;
+
142  g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h;
+
143 
+
144  bounds.x = g->slots[slot].last.x - 2;
+
145  bounds.y = g->slots[slot].last.y - 2;
+
146  bounds.w = bounds.h = 4;
+
147 
+
148  color = g->slots[slot].color;
+
149  if (!(layout->flags & NK_WINDOW_ROM) && i &&
+
150  NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
+
151  ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0;
+
152  ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down &&
+
153  i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+
154  color = g->slots[slot].highlight;
+
155  }
+
156  if (g->slots[slot].show_markers) {
+
157  nk_fill_rect(out, bounds, 0, color);
+
158  }
+
159  g->slots[slot].index += 1;
+
160  return ret;
+
161  }
+
162 
+
163  /* draw a line between the last data point and the new one */
+
164  color = g->slots[slot].color;
+
165  cur.x = g->x + (float)(step * (float)g->slots[slot].index);
+
166  cur.y = (g->y + g->h) - (ratio * (float)g->h);
+
167  nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color);
+
168 
+
169  bounds.x = cur.x - 3;
+
170  bounds.y = cur.y - 3;
+
171  bounds.w = bounds.h = 6;
+
172 
+
173  /* user selection of current data point */
+
174  if (!(layout->flags & NK_WINDOW_ROM)) {
+
175  if (nk_input_is_mouse_hovering_rect(i, bounds)) {
+
176  ret = NK_CHART_HOVERING;
+
177  ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down &&
+
178  i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+
179  color = g->slots[slot].highlight;
+
180  }
+
181  }
+
182  if (g->slots[slot].show_markers) {
+
183  nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
+
184  }
+
185 
+
186  /* save current data point position */
+
187  g->slots[slot].last.x = cur.x;
+
188  g->slots[slot].last.y = cur.y;
+
189  g->slots[slot].index += 1;
+
190  return ret;
+
191 }
+
192 NK_INTERN nk_flags
+
193 nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win,
+
194  struct nk_chart *chart, float value, int slot)
+
195 {
+
196  struct nk_command_buffer *out = &win->buffer;
+
197  const struct nk_input *in = ctx->current->widgets_disabled ? 0 : &ctx->input;
+
198  struct nk_panel *layout = win->layout;
+
199 
+
200  float ratio;
+
201  nk_flags ret = 0;
+
202  struct nk_color color;
+
203  struct nk_rect item = {0,0,0,0};
+
204 
+
205  NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+
206  if (chart->slots[slot].index >= chart->slots[slot].count)
+
207  return nk_false;
+
208  if (chart->slots[slot].count) {
+
209  float padding = (float)(chart->slots[slot].count-1);
+
210  item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
+
211  }
+
212 
+
213  /* calculate bounds of current bar chart entry */
+
214  color = chart->slots[slot].color;;
+
215  item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
+
216  if (value >= 0) {
+
217  ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
+
218  item.y = (chart->y + chart->h) - chart->h * ratio;
+
219  } else {
+
220  ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
+
221  item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h;
+
222  }
+
223  item.x = chart->x + ((float)chart->slots[slot].index * item.w);
+
224  item.x = item.x + ((float)chart->slots[slot].index);
+
225 
+
226  /* user chart bar selection */
+
227  if (!(layout->flags & NK_WINDOW_ROM) && in &&
+
228  NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) {
+
229  ret = NK_CHART_HOVERING;
+
230  ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down &&
+
231  in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+
232  color = chart->slots[slot].highlight;
+
233  }
+
234  nk_fill_rect(out, item, 0, color);
+
235  chart->slots[slot].index += 1;
+
236  return ret;
+
237 }
+
238 NK_API nk_flags
+
239 nk_chart_push_slot(struct nk_context *ctx, float value, int slot)
+
240 {
+
241  nk_flags flags;
+
242  struct nk_window *win;
+
243 
+
244  NK_ASSERT(ctx);
+
245  NK_ASSERT(ctx->current);
+
246  NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+
247  NK_ASSERT(slot < ctx->current->layout->chart.slot);
+
248  if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false;
+
249  if (slot >= ctx->current->layout->chart.slot) return nk_false;
+
250 
+
251  win = ctx->current;
+
252  if (win->layout->chart.slot < slot) return nk_false;
+
253  switch (win->layout->chart.slots[slot].type) {
+
254  case NK_CHART_LINES:
+
255  flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
+
256  case NK_CHART_COLUMN:
+
257  flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;
+
258  default:
+
259  case NK_CHART_MAX:
+
260  flags = 0;
+
261  }
+
262  return flags;
+
263 }
+
264 NK_API nk_flags
+
265 nk_chart_push(struct nk_context *ctx, float value)
+
266 {
+
267  return nk_chart_push_slot(ctx, value, 0);
+
268 }
+
269 NK_API void
+
270 nk_chart_end(struct nk_context *ctx)
+
271 {
+
272  struct nk_window *win;
+
273  struct nk_chart *chart;
+
274 
+
275  NK_ASSERT(ctx);
+
276  NK_ASSERT(ctx->current);
+
277  if (!ctx || !ctx->current)
+
278  return;
+
279 
+
280  win = ctx->current;
+
281  chart = &win->layout->chart;
+
282  NK_MEMSET(chart, 0, sizeof(*chart));
+
283  return;
+
284 }
+
285 NK_API void
+
286 nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values,
+
287  int count, int offset)
+
288 {
+
289  int i = 0;
+
290  float min_value;
+
291  float max_value;
+
292 
+
293  NK_ASSERT(ctx);
+
294  NK_ASSERT(values);
+
295  if (!ctx || !values || !count) return;
+
296 
+
297  min_value = values[offset];
+
298  max_value = values[offset];
+
299  for (i = 0; i < count; ++i) {
+
300  min_value = NK_MIN(values[i + offset], min_value);
+
301  max_value = NK_MAX(values[i + offset], max_value);
+
302  }
+
303 
+
304  if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
+
305  for (i = 0; i < count; ++i)
+
306  nk_chart_push(ctx, values[i + offset]);
+
307  nk_chart_end(ctx);
+
308  }
+
309 }
+
310 NK_API void
+
311 nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata,
+
312  float(*value_getter)(void* user, int index), int count, int offset)
+
313 {
+
314  int i = 0;
+
315  float min_value;
+
316  float max_value;
+
317 
+
318  NK_ASSERT(ctx);
+
319  NK_ASSERT(value_getter);
+
320  if (!ctx || !value_getter || !count) return;
+
321 
+
322  max_value = min_value = value_getter(userdata, offset);
+
323  for (i = 0; i < count; ++i) {
+
324  float value = value_getter(userdata, i + offset);
+
325  min_value = NK_MIN(value, min_value);
+
326  max_value = NK_MAX(value, max_value);
+
327  }
+
328 
+
329  if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
+
330  for (i = 0; i < count; ++i)
+
331  nk_chart_push(ctx, value_getter(userdata, i + offset));
+
332  nk_chart_end(ctx);
+
333  }
+
334 }
+
335 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
Definition: nuklear_draw.c:89
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+ + + + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__color_8c_source.html b/nuklear__color_8c_source.html new file mode 100644 index 000000000..862c0255f --- /dev/null +++ b/nuklear__color_8c_source.html @@ -0,0 +1,536 @@ + + + + + + + +Nuklear: src/nuklear_color.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_color.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * COLOR
+
7  *
+
8  * ===============================================================*/
+
9 NK_INTERN int
+
10 nk_parse_hex(const char *p, int length)
+
11 {
+
12  int i = 0;
+
13  int len = 0;
+
14  while (len < length) {
+
15  i <<= 4;
+
16  if (p[len] >= 'a' && p[len] <= 'f')
+
17  i += ((p[len] - 'a') + 10);
+
18  else if (p[len] >= 'A' && p[len] <= 'F')
+
19  i += ((p[len] - 'A') + 10);
+
20  else i += (p[len] - '0');
+
21  len++;
+
22  }
+
23  return i;
+
24 }
+
25 NK_API struct nk_color
+
26 nk_rgb_factor(struct nk_color col, float factor)
+
27 {
+
28  if (factor == 1.0f)
+
29  return col;
+
30  col.r = (nk_byte)(col.r * factor);
+
31  col.g = (nk_byte)(col.g * factor);
+
32  col.b = (nk_byte)(col.b * factor);
+
33  return col;
+
34 }
+
35 NK_API struct nk_color
+
36 nk_rgba(int r, int g, int b, int a)
+
37 {
+
38  struct nk_color ret;
+
39  ret.r = (nk_byte)NK_CLAMP(0, r, 255);
+
40  ret.g = (nk_byte)NK_CLAMP(0, g, 255);
+
41  ret.b = (nk_byte)NK_CLAMP(0, b, 255);
+
42  ret.a = (nk_byte)NK_CLAMP(0, a, 255);
+
43  return ret;
+
44 }
+
45 NK_API struct nk_color
+
46 nk_rgb_hex(const char *rgb)
+
47 {
+
48  struct nk_color col;
+
49  const char *c = rgb;
+
50  if (*c == '#') c++;
+
51  col.r = (nk_byte)nk_parse_hex(c, 2);
+
52  col.g = (nk_byte)nk_parse_hex(c+2, 2);
+
53  col.b = (nk_byte)nk_parse_hex(c+4, 2);
+
54  col.a = 255;
+
55  return col;
+
56 }
+
57 NK_API struct nk_color
+
58 nk_rgba_hex(const char *rgb)
+
59 {
+
60  struct nk_color col;
+
61  const char *c = rgb;
+
62  if (*c == '#') c++;
+
63  col.r = (nk_byte)nk_parse_hex(c, 2);
+
64  col.g = (nk_byte)nk_parse_hex(c+2, 2);
+
65  col.b = (nk_byte)nk_parse_hex(c+4, 2);
+
66  col.a = (nk_byte)nk_parse_hex(c+6, 2);
+
67  return col;
+
68 }
+
69 NK_API void
+
70 nk_color_hex_rgba(char *output, struct nk_color col)
+
71 {
+
72  #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i))
+
73  output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4);
+
74  output[1] = (char)NK_TO_HEX((col.r & 0x0F));
+
75  output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4);
+
76  output[3] = (char)NK_TO_HEX((col.g & 0x0F));
+
77  output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4);
+
78  output[5] = (char)NK_TO_HEX((col.b & 0x0F));
+
79  output[6] = (char)NK_TO_HEX((col.a & 0xF0) >> 4);
+
80  output[7] = (char)NK_TO_HEX((col.a & 0x0F));
+
81  output[8] = '\0';
+
82  #undef NK_TO_HEX
+
83 }
+
84 NK_API void
+
85 nk_color_hex_rgb(char *output, struct nk_color col)
+
86 {
+
87  #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i))
+
88  output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4);
+
89  output[1] = (char)NK_TO_HEX((col.r & 0x0F));
+
90  output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4);
+
91  output[3] = (char)NK_TO_HEX((col.g & 0x0F));
+
92  output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4);
+
93  output[5] = (char)NK_TO_HEX((col.b & 0x0F));
+
94  output[6] = '\0';
+
95  #undef NK_TO_HEX
+
96 }
+
97 NK_API struct nk_color
+
98 nk_rgba_iv(const int *c)
+
99 {
+
100  return nk_rgba(c[0], c[1], c[2], c[3]);
+
101 }
+
102 NK_API struct nk_color
+
103 nk_rgba_bv(const nk_byte *c)
+
104 {
+
105  return nk_rgba(c[0], c[1], c[2], c[3]);
+
106 }
+
107 NK_API struct nk_color
+
108 nk_rgb(int r, int g, int b)
+
109 {
+
110  struct nk_color ret;
+
111  ret.r = (nk_byte)NK_CLAMP(0, r, 255);
+
112  ret.g = (nk_byte)NK_CLAMP(0, g, 255);
+
113  ret.b = (nk_byte)NK_CLAMP(0, b, 255);
+
114  ret.a = (nk_byte)255;
+
115  return ret;
+
116 }
+
117 NK_API struct nk_color
+
118 nk_rgb_iv(const int *c)
+
119 {
+
120  return nk_rgb(c[0], c[1], c[2]);
+
121 }
+
122 NK_API struct nk_color
+
123 nk_rgb_bv(const nk_byte* c)
+
124 {
+
125  return nk_rgb(c[0], c[1], c[2]);
+
126 }
+
127 NK_API struct nk_color
+
128 nk_rgba_u32(nk_uint in)
+
129 {
+
130  struct nk_color ret;
+
131  ret.r = (in & 0xFF);
+
132  ret.g = ((in >> 8) & 0xFF);
+
133  ret.b = ((in >> 16) & 0xFF);
+
134  ret.a = (nk_byte)((in >> 24) & 0xFF);
+
135  return ret;
+
136 }
+
137 NK_API struct nk_color
+
138 nk_rgba_f(float r, float g, float b, float a)
+
139 {
+
140  struct nk_color ret;
+
141  ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f);
+
142  ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f);
+
143  ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f);
+
144  ret.a = (nk_byte)(NK_SATURATE(a) * 255.0f);
+
145  return ret;
+
146 }
+
147 NK_API struct nk_color
+
148 nk_rgba_fv(const float *c)
+
149 {
+
150  return nk_rgba_f(c[0], c[1], c[2], c[3]);
+
151 }
+
152 NK_API struct nk_color
+
153 nk_rgba_cf(struct nk_colorf c)
+
154 {
+
155  return nk_rgba_f(c.r, c.g, c.b, c.a);
+
156 }
+
157 NK_API struct nk_color
+
158 nk_rgb_f(float r, float g, float b)
+
159 {
+
160  struct nk_color ret;
+
161  ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f);
+
162  ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f);
+
163  ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f);
+
164  ret.a = 255;
+
165  return ret;
+
166 }
+
167 NK_API struct nk_color
+
168 nk_rgb_fv(const float *c)
+
169 {
+
170  return nk_rgb_f(c[0], c[1], c[2]);
+
171 }
+
172 NK_API struct nk_color
+
173 nk_rgb_cf(struct nk_colorf c)
+
174 {
+
175  return nk_rgb_f(c.r, c.g, c.b);
+
176 }
+
177 NK_API struct nk_color
+
178 nk_hsv(int h, int s, int v)
+
179 {
+
180  return nk_hsva(h, s, v, 255);
+
181 }
+
182 NK_API struct nk_color
+
183 nk_hsv_iv(const int *c)
+
184 {
+
185  return nk_hsv(c[0], c[1], c[2]);
+
186 }
+
187 NK_API struct nk_color
+
188 nk_hsv_bv(const nk_byte *c)
+
189 {
+
190  return nk_hsv(c[0], c[1], c[2]);
+
191 }
+
192 NK_API struct nk_color
+
193 nk_hsv_f(float h, float s, float v)
+
194 {
+
195  return nk_hsva_f(h, s, v, 1.0f);
+
196 }
+
197 NK_API struct nk_color
+
198 nk_hsv_fv(const float *c)
+
199 {
+
200  return nk_hsv_f(c[0], c[1], c[2]);
+
201 }
+
202 NK_API struct nk_color
+
203 nk_hsva(int h, int s, int v, int a)
+
204 {
+
205  float hf = ((float)NK_CLAMP(0, h, 255)) / 255.0f;
+
206  float sf = ((float)NK_CLAMP(0, s, 255)) / 255.0f;
+
207  float vf = ((float)NK_CLAMP(0, v, 255)) / 255.0f;
+
208  float af = ((float)NK_CLAMP(0, a, 255)) / 255.0f;
+
209  return nk_hsva_f(hf, sf, vf, af);
+
210 }
+
211 NK_API struct nk_color
+
212 nk_hsva_iv(const int *c)
+
213 {
+
214  return nk_hsva(c[0], c[1], c[2], c[3]);
+
215 }
+
216 NK_API struct nk_color
+
217 nk_hsva_bv(const nk_byte *c)
+
218 {
+
219  return nk_hsva(c[0], c[1], c[2], c[3]);
+
220 }
+
221 NK_API struct nk_colorf
+
222 nk_hsva_colorf(float h, float s, float v, float a)
+
223 {
+
224  int i;
+
225  float p, q, t, f;
+
226  struct nk_colorf out = {0,0,0,0};
+
227  if (s <= 0.0f) {
+
228  out.r = v; out.g = v; out.b = v; out.a = a;
+
229  return out;
+
230  }
+
231  h = h / (60.0f/360.0f);
+
232  i = (int)h;
+
233  f = h - (float)i;
+
234  p = v * (1.0f - s);
+
235  q = v * (1.0f - (s * f));
+
236  t = v * (1.0f - s * (1.0f - f));
+
237 
+
238  switch (i) {
+
239  case 0: default: out.r = v; out.g = t; out.b = p; break;
+
240  case 1: out.r = q; out.g = v; out.b = p; break;
+
241  case 2: out.r = p; out.g = v; out.b = t; break;
+
242  case 3: out.r = p; out.g = q; out.b = v; break;
+
243  case 4: out.r = t; out.g = p; out.b = v; break;
+
244  case 5: out.r = v; out.g = p; out.b = q; break;}
+
245  out.a = a;
+
246  return out;
+
247 }
+
248 NK_API struct nk_colorf
+
249 nk_hsva_colorfv(const float *c)
+
250 {
+
251  return nk_hsva_colorf(c[0], c[1], c[2], c[3]);
+
252 }
+
253 NK_API struct nk_color
+
254 nk_hsva_f(float h, float s, float v, float a)
+
255 {
+
256  struct nk_colorf c = nk_hsva_colorf(h, s, v, a);
+
257  return nk_rgba_f(c.r, c.g, c.b, c.a);
+
258 }
+
259 NK_API struct nk_color
+
260 nk_hsva_fv(const float *c)
+
261 {
+
262  return nk_hsva_f(c[0], c[1], c[2], c[3]);
+
263 }
+
264 NK_API nk_uint
+
265 nk_color_u32(struct nk_color in)
+
266 {
+
267  nk_uint out = (nk_uint)in.r;
+
268  out |= ((nk_uint)in.g << 8);
+
269  out |= ((nk_uint)in.b << 16);
+
270  out |= ((nk_uint)in.a << 24);
+
271  return out;
+
272 }
+
273 NK_API void
+
274 nk_color_f(float *r, float *g, float *b, float *a, struct nk_color in)
+
275 {
+
276  NK_STORAGE const float s = 1.0f/255.0f;
+
277  *r = (float)in.r * s;
+
278  *g = (float)in.g * s;
+
279  *b = (float)in.b * s;
+
280  *a = (float)in.a * s;
+
281 }
+
282 NK_API void
+
283 nk_color_fv(float *c, struct nk_color in)
+
284 {
+
285  nk_color_f(&c[0], &c[1], &c[2], &c[3], in);
+
286 }
+
287 NK_API struct nk_colorf
+
288 nk_color_cf(struct nk_color in)
+
289 {
+
290  struct nk_colorf o;
+
291  nk_color_f(&o.r, &o.g, &o.b, &o.a, in);
+
292  return o;
+
293 }
+
294 NK_API void
+
295 nk_color_d(double *r, double *g, double *b, double *a, struct nk_color in)
+
296 {
+
297  NK_STORAGE const double s = 1.0/255.0;
+
298  *r = (double)in.r * s;
+
299  *g = (double)in.g * s;
+
300  *b = (double)in.b * s;
+
301  *a = (double)in.a * s;
+
302 }
+
303 NK_API void
+
304 nk_color_dv(double *c, struct nk_color in)
+
305 {
+
306  nk_color_d(&c[0], &c[1], &c[2], &c[3], in);
+
307 }
+
308 NK_API void
+
309 nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color in)
+
310 {
+
311  float a;
+
312  nk_color_hsva_f(out_h, out_s, out_v, &a, in);
+
313 }
+
314 NK_API void
+
315 nk_color_hsv_fv(float *out, struct nk_color in)
+
316 {
+
317  float a;
+
318  nk_color_hsva_f(&out[0], &out[1], &out[2], &a, in);
+
319 }
+
320 NK_API void
+
321 nk_colorf_hsva_f(float *out_h, float *out_s,
+
322  float *out_v, float *out_a, struct nk_colorf in)
+
323 {
+
324  float chroma;
+
325  float K = 0.0f;
+
326  if (in.g < in.b) {
+
327  const float t = in.g; in.g = in.b; in.b = t;
+
328  K = -1.f;
+
329  }
+
330  if (in.r < in.g) {
+
331  const float t = in.r; in.r = in.g; in.g = t;
+
332  K = -2.f/6.0f - K;
+
333  }
+
334  chroma = in.r - ((in.g < in.b) ? in.g: in.b);
+
335  *out_h = NK_ABS(K + (in.g - in.b)/(6.0f * chroma + 1e-20f));
+
336  *out_s = chroma / (in.r + 1e-20f);
+
337  *out_v = in.r;
+
338  *out_a = in.a;
+
339 
+
340 }
+
341 NK_API void
+
342 nk_colorf_hsva_fv(float *hsva, struct nk_colorf in)
+
343 {
+
344  nk_colorf_hsva_f(&hsva[0], &hsva[1], &hsva[2], &hsva[3], in);
+
345 }
+
346 NK_API void
+
347 nk_color_hsva_f(float *out_h, float *out_s,
+
348  float *out_v, float *out_a, struct nk_color in)
+
349 {
+
350  struct nk_colorf col;
+
351  nk_color_f(&col.r,&col.g,&col.b,&col.a, in);
+
352  nk_colorf_hsva_f(out_h, out_s, out_v, out_a, col);
+
353 }
+
354 NK_API void
+
355 nk_color_hsva_fv(float *out, struct nk_color in)
+
356 {
+
357  nk_color_hsva_f(&out[0], &out[1], &out[2], &out[3], in);
+
358 }
+
359 NK_API void
+
360 nk_color_hsva_i(int *out_h, int *out_s, int *out_v,
+
361  int *out_a, struct nk_color in)
+
362 {
+
363  float h,s,v,a;
+
364  nk_color_hsva_f(&h, &s, &v, &a, in);
+
365  *out_h = (nk_byte)(h * 255.0f);
+
366  *out_s = (nk_byte)(s * 255.0f);
+
367  *out_v = (nk_byte)(v * 255.0f);
+
368  *out_a = (nk_byte)(a * 255.0f);
+
369 }
+
370 NK_API void
+
371 nk_color_hsva_iv(int *out, struct nk_color in)
+
372 {
+
373  nk_color_hsva_i(&out[0], &out[1], &out[2], &out[3], in);
+
374 }
+
375 NK_API void
+
376 nk_color_hsva_bv(nk_byte *out, struct nk_color in)
+
377 {
+
378  int tmp[4];
+
379  nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
+
380  out[0] = (nk_byte)tmp[0];
+
381  out[1] = (nk_byte)tmp[1];
+
382  out[2] = (nk_byte)tmp[2];
+
383  out[3] = (nk_byte)tmp[3];
+
384 }
+
385 NK_API void
+
386 nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color in)
+
387 {
+
388  int tmp[4];
+
389  nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
+
390  *h = (nk_byte)tmp[0];
+
391  *s = (nk_byte)tmp[1];
+
392  *v = (nk_byte)tmp[2];
+
393  *a = (nk_byte)tmp[3];
+
394 }
+
395 NK_API void
+
396 nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color in)
+
397 {
+
398  int a;
+
399  nk_color_hsva_i(out_h, out_s, out_v, &a, in);
+
400 }
+
401 NK_API void
+
402 nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color in)
+
403 {
+
404  int tmp[4];
+
405  nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
+
406  *out_h = (nk_byte)tmp[0];
+
407  *out_s = (nk_byte)tmp[1];
+
408  *out_v = (nk_byte)tmp[2];
+
409 }
+
410 NK_API void
+
411 nk_color_hsv_iv(int *out, struct nk_color in)
+
412 {
+
413  nk_color_hsv_i(&out[0], &out[1], &out[2], in);
+
414 }
+
415 NK_API void
+
416 nk_color_hsv_bv(nk_byte *out, struct nk_color in)
+
417 {
+
418  int tmp[4];
+
419  nk_color_hsv_i(&tmp[0], &tmp[1], &tmp[2], in);
+
420  out[0] = (nk_byte)tmp[0];
+
421  out[1] = (nk_byte)tmp[1];
+
422  out[2] = (nk_byte)tmp[2];
+
423 }
+
main API and documentation file
+ + +
+
+ + + + diff --git a/nuklear__color__picker_8c_source.html b/nuklear__color__picker_8c_source.html new file mode 100644 index 000000000..5c473ae6d --- /dev/null +++ b/nuklear__color__picker_8c_source.html @@ -0,0 +1,334 @@ + + + + + + + +Nuklear: src/nuklear_color_picker.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_color_picker.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * COLOR PICKER
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB nk_bool
+
10 nk_color_picker_behavior(nk_flags *state,
+
11  const struct nk_rect *bounds, const struct nk_rect *matrix,
+
12  const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
+
13  struct nk_colorf *color, const struct nk_input *in)
+
14 {
+
15  float hsva[4];
+
16  nk_bool value_changed = 0;
+
17  nk_bool hsv_changed = 0;
+
18 
+
19  NK_ASSERT(state);
+
20  NK_ASSERT(matrix);
+
21  NK_ASSERT(hue_bar);
+
22  NK_ASSERT(color);
+
23 
+
24  /* color matrix */
+
25  nk_colorf_hsva_fv(hsva, *color);
+
26  if (nk_button_behavior(state, *matrix, in, NK_BUTTON_REPEATER)) {
+
27  hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1));
+
28  hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1));
+
29  value_changed = hsv_changed = 1;
+
30  }
+
31  /* hue bar */
+
32  if (nk_button_behavior(state, *hue_bar, in, NK_BUTTON_REPEATER)) {
+
33  hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1));
+
34  value_changed = hsv_changed = 1;
+
35  }
+
36  /* alpha bar */
+
37  if (alpha_bar) {
+
38  if (nk_button_behavior(state, *alpha_bar, in, NK_BUTTON_REPEATER)) {
+
39  hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1));
+
40  value_changed = 1;
+
41  }
+
42  }
+
43  nk_widget_state_reset(state);
+
44  if (hsv_changed) {
+
45  *color = nk_hsva_colorfv(hsva);
+
46  *state = NK_WIDGET_STATE_ACTIVE;
+
47  }
+
48  if (value_changed) {
+
49  color->a = hsva[3];
+
50  *state = NK_WIDGET_STATE_ACTIVE;
+
51  }
+
52  /* set color picker widget state */
+
53  if (nk_input_is_mouse_hovering_rect(in, *bounds))
+
54  *state = NK_WIDGET_STATE_HOVERED;
+
55  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds))
+
56  *state |= NK_WIDGET_STATE_ENTERED;
+
57  else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds))
+
58  *state |= NK_WIDGET_STATE_LEFT;
+
59  return value_changed;
+
60 }
+
61 NK_LIB void
+
62 nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix,
+
63  const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
+
64  struct nk_colorf col)
+
65 {
+
66  NK_STORAGE const struct nk_color black = {0,0,0,255};
+
67  NK_STORAGE const struct nk_color white = {255, 255, 255, 255};
+
68  NK_STORAGE const struct nk_color black_trans = {0,0,0,0};
+
69 
+
70  const float crosshair_size = 7.0f;
+
71  struct nk_color temp;
+
72  float hsva[4];
+
73  float line_y;
+
74  int i;
+
75 
+
76  NK_ASSERT(o);
+
77  NK_ASSERT(matrix);
+
78  NK_ASSERT(hue_bar);
+
79 
+
80  /* draw hue bar */
+
81  nk_colorf_hsva_fv(hsva, col);
+
82  for (i = 0; i < 6; ++i) {
+
83  NK_GLOBAL const struct nk_color hue_colors[] = {
+
84  {255, 0, 0, 255}, {255,255,0,255}, {0,255,0,255}, {0, 255,255,255},
+
85  {0,0,255,255}, {255, 0, 255, 255}, {255, 0, 0, 255}
+
86  };
+
87  nk_fill_rect_multi_color(o,
+
88  nk_rect(hue_bar->x, hue_bar->y + (float)i * (hue_bar->h/6.0f) + 0.5f,
+
89  hue_bar->w, (hue_bar->h/6.0f) + 0.5f), hue_colors[i], hue_colors[i],
+
90  hue_colors[i+1], hue_colors[i+1]);
+
91  }
+
92  line_y = (float)(int)(hue_bar->y + hsva[0] * matrix->h + 0.5f);
+
93  nk_stroke_line(o, hue_bar->x-1, line_y, hue_bar->x + hue_bar->w + 2,
+
94  line_y, 1, nk_rgb(255,255,255));
+
95 
+
96  /* draw alpha bar */
+
97  if (alpha_bar) {
+
98  float alpha = NK_SATURATE(col.a);
+
99  line_y = (float)(int)(alpha_bar->y + (1.0f - alpha) * matrix->h + 0.5f);
+
100 
+
101  nk_fill_rect_multi_color(o, *alpha_bar, white, white, black, black);
+
102  nk_stroke_line(o, alpha_bar->x-1, line_y, alpha_bar->x + alpha_bar->w + 2,
+
103  line_y, 1, nk_rgb(255,255,255));
+
104  }
+
105 
+
106  /* draw color matrix */
+
107  temp = nk_hsv_f(hsva[0], 1.0f, 1.0f);
+
108  nk_fill_rect_multi_color(o, *matrix, white, temp, temp, white);
+
109  nk_fill_rect_multi_color(o, *matrix, black_trans, black_trans, black, black);
+
110 
+
111  /* draw cross-hair */
+
112  {struct nk_vec2 p; float S = hsva[1]; float V = hsva[2];
+
113  p.x = (float)(int)(matrix->x + S * matrix->w);
+
114  p.y = (float)(int)(matrix->y + (1.0f - V) * matrix->h);
+
115  nk_stroke_line(o, p.x - crosshair_size, p.y, p.x-2, p.y, 1.0f, white);
+
116  nk_stroke_line(o, p.x + crosshair_size + 1, p.y, p.x+3, p.y, 1.0f, white);
+
117  nk_stroke_line(o, p.x, p.y + crosshair_size + 1, p.x, p.y+3, 1.0f, white);
+
118  nk_stroke_line(o, p.x, p.y - crosshair_size, p.x, p.y-2, 1.0f, white);}
+
119 }
+
120 NK_LIB nk_bool
+
121 nk_do_color_picker(nk_flags *state,
+
122  struct nk_command_buffer *out, struct nk_colorf *col,
+
123  enum nk_color_format fmt, struct nk_rect bounds,
+
124  struct nk_vec2 padding, const struct nk_input *in,
+
125  const struct nk_user_font *font)
+
126 {
+
127  int ret = 0;
+
128  struct nk_rect matrix;
+
129  struct nk_rect hue_bar;
+
130  struct nk_rect alpha_bar;
+
131  float bar_w;
+
132 
+
133  NK_ASSERT(out);
+
134  NK_ASSERT(col);
+
135  NK_ASSERT(state);
+
136  NK_ASSERT(font);
+
137  if (!out || !col || !state || !font)
+
138  return ret;
+
139 
+
140  bar_w = font->height;
+
141  bounds.x += padding.x;
+
142  bounds.y += padding.x;
+
143  bounds.w -= 2 * padding.x;
+
144  bounds.h -= 2 * padding.y;
+
145 
+
146  matrix.x = bounds.x;
+
147  matrix.y = bounds.y;
+
148  matrix.h = bounds.h;
+
149  matrix.w = bounds.w - (3 * padding.x + 2 * bar_w);
+
150 
+
151  hue_bar.w = bar_w;
+
152  hue_bar.y = bounds.y;
+
153  hue_bar.h = matrix.h;
+
154  hue_bar.x = matrix.x + matrix.w + padding.x;
+
155 
+
156  alpha_bar.x = hue_bar.x + hue_bar.w + padding.x;
+
157  alpha_bar.y = bounds.y;
+
158  alpha_bar.w = bar_w;
+
159  alpha_bar.h = matrix.h;
+
160 
+
161  ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar,
+
162  (fmt == NK_RGBA) ? &alpha_bar:0, col, in);
+
163  nk_draw_color_picker(out, &matrix, &hue_bar, (fmt == NK_RGBA) ? &alpha_bar:0, *col);
+
164  return ret;
+
165 }
+
166 NK_API nk_bool
+
167 nk_color_pick(struct nk_context * ctx, struct nk_colorf *color,
+
168  enum nk_color_format fmt)
+
169 {
+
170  struct nk_window *win;
+
171  struct nk_panel *layout;
+
172  const struct nk_style *config;
+
173  const struct nk_input *in;
+
174 
+
175  enum nk_widget_layout_states state;
+
176  struct nk_rect bounds;
+
177 
+
178  NK_ASSERT(ctx);
+
179  NK_ASSERT(color);
+
180  NK_ASSERT(ctx->current);
+
181  NK_ASSERT(ctx->current->layout);
+
182  if (!ctx || !ctx->current || !ctx->current->layout || !color)
+
183  return 0;
+
184 
+
185  win = ctx->current;
+
186  config = &ctx->style;
+
187  layout = win->layout;
+
188  state = nk_widget(&bounds, ctx);
+
189  if (!state) return 0;
+
190  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
191  return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds,
+
192  nk_vec2(0,0), in, config->font);
+
193 }
+
194 NK_API struct nk_colorf
+
195 nk_color_picker(struct nk_context *ctx, struct nk_colorf color,
+
196  enum nk_color_format fmt)
+
197 {
+
198  nk_color_pick(ctx, &color, fmt);
+
199  return color;
+
200 }
+
201 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
Definition: nuklear_draw.c:89
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + + +
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__combo_8c_source.html b/nuklear__combo_8c_source.html new file mode 100644 index 000000000..05f53fd48 --- /dev/null +++ b/nuklear__combo_8c_source.html @@ -0,0 +1,978 @@ + + + + + + + +Nuklear: src/nuklear_combo.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_combo.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * COMBO
+
7  *
+
8  * ===============================================================*/
+
9 NK_INTERN nk_bool
+
10 nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
+
11  struct nk_vec2 size, nk_bool is_clicked, struct nk_rect header)
+
12 {
+
13  struct nk_window *popup;
+
14  int is_open = 0;
+
15  int is_active = 0;
+
16  struct nk_rect body;
+
17  nk_hash hash;
+
18 
+
19  NK_ASSERT(ctx);
+
20  NK_ASSERT(ctx->current);
+
21  NK_ASSERT(ctx->current->layout);
+
22  if (!ctx || !ctx->current || !ctx->current->layout)
+
23  return 0;
+
24 
+
25  popup = win->popup.win;
+
26  body.x = header.x;
+
27  body.w = size.x;
+
28  body.y = header.y + header.h-ctx->style.window.combo_border;
+
29  body.h = size.y;
+
30 
+
31  hash = win->popup.combo_count++;
+
32  is_open = (popup) ? nk_true:nk_false;
+
33  is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_COMBO);
+
34  if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
+
35  (!is_open && !is_active && !is_clicked)) return 0;
+
36  if (!nk_nonblock_begin(ctx, 0, body,
+
37  (is_clicked && is_open)?nk_rect(0,0,0,0):header, NK_PANEL_COMBO)) return 0;
+
38 
+
39  win->popup.type = NK_PANEL_COMBO;
+
40  win->popup.name = hash;
+
41  return 1;
+
42 }
+
43 NK_API nk_bool
+
44 nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
+
45  struct nk_vec2 size)
+
46 {
+
47  const struct nk_input *in;
+
48  struct nk_window *win;
+
49  struct nk_style *style;
+
50 
+ +
52  int is_clicked = nk_false;
+
53  struct nk_rect header;
+
54  const struct nk_style_item *background;
+
55  struct nk_text text;
+
56 
+
57  NK_ASSERT(ctx);
+
58  NK_ASSERT(selected);
+
59  NK_ASSERT(ctx->current);
+
60  NK_ASSERT(ctx->current->layout);
+
61  if (!ctx || !ctx->current || !ctx->current->layout || !selected)
+
62  return 0;
+
63 
+
64  win = ctx->current;
+
65  style = &ctx->style;
+
66  s = nk_widget(&header, ctx);
+
67  if (s == NK_WIDGET_INVALID)
+
68  return 0;
+
69 
+
70  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
71  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
72  is_clicked = nk_true;
+
73 
+
74  /* draw combo box header background and border */
+
75  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
+
76  background = &style->combo.active;
+
77  text.text = style->combo.label_active;
+
78  } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
+
79  background = &style->combo.hover;
+
80  text.text = style->combo.label_hover;
+
81  } else {
+
82  background = &style->combo.normal;
+
83  text.text = style->combo.label_normal;
+
84  }
+
85 
+
86  text.text = nk_rgb_factor(text.text, style->combo.color_factor);
+
87 
+
88  switch(background->type) {
+
89  case NK_STYLE_ITEM_IMAGE:
+
90  text.background = nk_rgba(0, 0, 0, 0);
+
91  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
92  break;
+
93  case NK_STYLE_ITEM_NINE_SLICE:
+
94  text.background = nk_rgba(0, 0, 0, 0);
+
95  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
96  break;
+
97  case NK_STYLE_ITEM_COLOR:
+
98  text.background = background->data.color;
+
99  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
100  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
101  break;
+
102  }
+
103  {
+
104  /* print currently selected text item */
+
105  struct nk_rect label;
+
106  struct nk_rect button;
+
107  struct nk_rect content;
+
108  int draw_button_symbol;
+
109 
+
110  enum nk_symbol_type sym;
+
111  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
112  sym = style->combo.sym_hover;
+
113  else if (is_clicked)
+
114  sym = style->combo.sym_active;
+
115  else
+
116  sym = style->combo.sym_normal;
+
117 
+
118  /* represents whether or not the combo's button symbol should be drawn */
+
119  draw_button_symbol = sym != NK_SYMBOL_NONE;
+
120 
+
121  /* calculate button */
+
122  button.w = header.h - 2 * style->combo.button_padding.y;
+
123  button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
+
124  button.y = header.y + style->combo.button_padding.y;
+
125  button.h = button.w;
+
126 
+
127  content.x = button.x + style->combo.button.padding.x;
+
128  content.y = button.y + style->combo.button.padding.y;
+
129  content.w = button.w - 2 * style->combo.button.padding.x;
+
130  content.h = button.h - 2 * style->combo.button.padding.y;
+
131 
+
132  /* draw selected label */
+
133  text.padding = nk_vec2(0,0);
+
134  label.x = header.x + style->combo.content_padding.x;
+
135  label.y = header.y + style->combo.content_padding.y;
+
136  label.h = header.h - 2 * style->combo.content_padding.y;
+
137  if (draw_button_symbol)
+
138  label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;
+
139  else
+
140  label.w = header.w - 2 * style->combo.content_padding.x;
+
141  nk_widget_text(&win->buffer, label, selected, len, &text,
+
142  NK_TEXT_LEFT, ctx->style.font);
+
143 
+
144  /* draw open/close button */
+
145  if (draw_button_symbol)
+
146  nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
+
147  &ctx->style.combo.button, sym, style->font);
+
148  }
+
149  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
150 }
+
151 NK_API nk_bool
+
152 nk_combo_begin_label(struct nk_context *ctx, const char *selected, struct nk_vec2 size)
+
153 {
+
154  return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size);
+
155 }
+
156 NK_API nk_bool
+
157 nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_vec2 size)
+
158 {
+
159  struct nk_window *win;
+
160  struct nk_style *style;
+
161  const struct nk_input *in;
+
162 
+
163  struct nk_rect header;
+
164  int is_clicked = nk_false;
+ +
166  const struct nk_style_item *background;
+
167 
+
168  NK_ASSERT(ctx);
+
169  NK_ASSERT(ctx->current);
+
170  NK_ASSERT(ctx->current->layout);
+
171  if (!ctx || !ctx->current || !ctx->current->layout)
+
172  return 0;
+
173 
+
174  win = ctx->current;
+
175  style = &ctx->style;
+
176  s = nk_widget(&header, ctx);
+
177  if (s == NK_WIDGET_INVALID)
+
178  return 0;
+
179 
+
180  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
181  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
182  is_clicked = nk_true;
+
183 
+
184  /* draw combo box header background and border */
+
185  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED)
+
186  background = &style->combo.active;
+
187  else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
188  background = &style->combo.hover;
+
189  else background = &style->combo.normal;
+
190 
+
191  switch(background->type) {
+
192  case NK_STYLE_ITEM_IMAGE:
+
193  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
194  break;
+
195  case NK_STYLE_ITEM_NINE_SLICE:
+
196  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
197  break;
+
198  case NK_STYLE_ITEM_COLOR:
+
199  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
200  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
201  break;
+
202  }
+
203  {
+
204  struct nk_rect content;
+
205  struct nk_rect button;
+
206  struct nk_rect bounds;
+
207  int draw_button_symbol;
+
208 
+
209  enum nk_symbol_type sym;
+
210  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
211  sym = style->combo.sym_hover;
+
212  else if (is_clicked)
+
213  sym = style->combo.sym_active;
+
214  else sym = style->combo.sym_normal;
+
215 
+
216  /* represents whether or not the combo's button symbol should be drawn */
+
217  draw_button_symbol = sym != NK_SYMBOL_NONE;
+
218 
+
219  /* calculate button */
+
220  button.w = header.h - 2 * style->combo.button_padding.y;
+
221  button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
+
222  button.y = header.y + style->combo.button_padding.y;
+
223  button.h = button.w;
+
224 
+
225  content.x = button.x + style->combo.button.padding.x;
+
226  content.y = button.y + style->combo.button.padding.y;
+
227  content.w = button.w - 2 * style->combo.button.padding.x;
+
228  content.h = button.h - 2 * style->combo.button.padding.y;
+
229 
+
230  /* draw color */
+
231  bounds.h = header.h - 4 * style->combo.content_padding.y;
+
232  bounds.y = header.y + 2 * style->combo.content_padding.y;
+
233  bounds.x = header.x + 2 * style->combo.content_padding.x;
+
234  if (draw_button_symbol)
+
235  bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
+
236  else
+
237  bounds.w = header.w - 4 * style->combo.content_padding.x;
+
238  nk_fill_rect(&win->buffer, bounds, 0, nk_rgb_factor(color, style->combo.color_factor));
+
239 
+
240  /* draw open/close button */
+
241  if (draw_button_symbol)
+
242  nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
+
243  &ctx->style.combo.button, sym, style->font);
+
244  }
+
245  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
246 }
+
247 NK_API nk_bool
+
248 nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct nk_vec2 size)
+
249 {
+
250  struct nk_window *win;
+
251  struct nk_style *style;
+
252  const struct nk_input *in;
+
253 
+
254  struct nk_rect header;
+
255  int is_clicked = nk_false;
+ +
257  const struct nk_style_item *background;
+
258  struct nk_color sym_background;
+
259  struct nk_color symbol_color;
+
260 
+
261  NK_ASSERT(ctx);
+
262  NK_ASSERT(ctx->current);
+
263  NK_ASSERT(ctx->current->layout);
+
264  if (!ctx || !ctx->current || !ctx->current->layout)
+
265  return 0;
+
266 
+
267  win = ctx->current;
+
268  style = &ctx->style;
+
269  s = nk_widget(&header, ctx);
+
270  if (s == NK_WIDGET_INVALID)
+
271  return 0;
+
272 
+
273  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
274  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
275  is_clicked = nk_true;
+
276 
+
277  /* draw combo box header background and border */
+
278  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
+
279  background = &style->combo.active;
+
280  symbol_color = style->combo.symbol_active;
+
281  } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
+
282  background = &style->combo.hover;
+
283  symbol_color = style->combo.symbol_hover;
+
284  } else {
+
285  background = &style->combo.normal;
+
286  symbol_color = style->combo.symbol_hover;
+
287  }
+
288 
+
289  symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor);
+
290 
+
291  switch(background->type) {
+
292  case NK_STYLE_ITEM_IMAGE:
+
293  sym_background = nk_rgba(0, 0, 0, 0);
+
294  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
295  break;
+
296  case NK_STYLE_ITEM_NINE_SLICE:
+
297  sym_background = nk_rgba(0, 0, 0, 0);
+
298  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
299  break;
+
300  case NK_STYLE_ITEM_COLOR:
+
301  sym_background = background->data.color;
+
302  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
303  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
304  break;
+
305  }
+
306  {
+
307  struct nk_rect bounds = {0,0,0,0};
+
308  struct nk_rect content;
+
309  struct nk_rect button;
+
310 
+
311  enum nk_symbol_type sym;
+
312  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
313  sym = style->combo.sym_hover;
+
314  else if (is_clicked)
+
315  sym = style->combo.sym_active;
+
316  else sym = style->combo.sym_normal;
+
317 
+
318  /* calculate button */
+
319  button.w = header.h - 2 * style->combo.button_padding.y;
+
320  button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
+
321  button.y = header.y + style->combo.button_padding.y;
+
322  button.h = button.w;
+
323 
+
324  content.x = button.x + style->combo.button.padding.x;
+
325  content.y = button.y + style->combo.button.padding.y;
+
326  content.w = button.w - 2 * style->combo.button.padding.x;
+
327  content.h = button.h - 2 * style->combo.button.padding.y;
+
328 
+
329  /* draw symbol */
+
330  bounds.h = header.h - 2 * style->combo.content_padding.y;
+
331  bounds.y = header.y + style->combo.content_padding.y;
+
332  bounds.x = header.x + style->combo.content_padding.x;
+
333  bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
+
334  nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color,
+
335  1.0f, style->font);
+
336 
+
337  /* draw open/close button */
+
338  nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
+
339  &ctx->style.combo.button, sym, style->font);
+
340  }
+
341  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
342 }
+
343 NK_API nk_bool
+
344 nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len,
+
345  enum nk_symbol_type symbol, struct nk_vec2 size)
+
346 {
+
347  struct nk_window *win;
+
348  struct nk_style *style;
+
349  struct nk_input *in;
+
350 
+
351  struct nk_rect header;
+
352  int is_clicked = nk_false;
+ +
354  const struct nk_style_item *background;
+
355  struct nk_color symbol_color;
+
356  struct nk_text text;
+
357 
+
358  NK_ASSERT(ctx);
+
359  NK_ASSERT(ctx->current);
+
360  NK_ASSERT(ctx->current->layout);
+
361  if (!ctx || !ctx->current || !ctx->current->layout)
+
362  return 0;
+
363 
+
364  win = ctx->current;
+
365  style = &ctx->style;
+
366  s = nk_widget(&header, ctx);
+
367  if (!s) return 0;
+
368 
+
369  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
370  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
371  is_clicked = nk_true;
+
372 
+
373  /* draw combo box header background and border */
+
374  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
+
375  background = &style->combo.active;
+
376  symbol_color = style->combo.symbol_active;
+
377  text.text = style->combo.label_active;
+
378  } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
+
379  background = &style->combo.hover;
+
380  symbol_color = style->combo.symbol_hover;
+
381  text.text = style->combo.label_hover;
+
382  } else {
+
383  background = &style->combo.normal;
+
384  symbol_color = style->combo.symbol_normal;
+
385  text.text = style->combo.label_normal;
+
386  }
+
387 
+
388  text.text = nk_rgb_factor(text.text, style->combo.color_factor);
+
389  symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor);
+
390 
+
391  switch(background->type) {
+
392  case NK_STYLE_ITEM_IMAGE:
+
393  text.background = nk_rgba(0, 0, 0, 0);
+
394  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
395  break;
+
396  case NK_STYLE_ITEM_NINE_SLICE:
+
397  text.background = nk_rgba(0, 0, 0, 0);
+
398  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
399  break;
+
400  case NK_STYLE_ITEM_COLOR:
+
401  text.background = background->data.color;
+
402  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
403  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
404  break;
+
405  }
+
406  {
+
407  struct nk_rect content;
+
408  struct nk_rect button;
+
409  struct nk_rect label;
+
410  struct nk_rect image;
+
411 
+
412  enum nk_symbol_type sym;
+
413  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
414  sym = style->combo.sym_hover;
+
415  else if (is_clicked)
+
416  sym = style->combo.sym_active;
+
417  else sym = style->combo.sym_normal;
+
418 
+
419  /* calculate button */
+
420  button.w = header.h - 2 * style->combo.button_padding.y;
+
421  button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
+
422  button.y = header.y + style->combo.button_padding.y;
+
423  button.h = button.w;
+
424 
+
425  content.x = button.x + style->combo.button.padding.x;
+
426  content.y = button.y + style->combo.button.padding.y;
+
427  content.w = button.w - 2 * style->combo.button.padding.x;
+
428  content.h = button.h - 2 * style->combo.button.padding.y;
+
429  nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
+
430  &ctx->style.combo.button, sym, style->font);
+
431 
+
432  /* draw symbol */
+
433  image.x = header.x + style->combo.content_padding.x;
+
434  image.y = header.y + style->combo.content_padding.y;
+
435  image.h = header.h - 2 * style->combo.content_padding.y;
+
436  image.w = image.h;
+
437  nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color,
+
438  1.0f, style->font);
+
439 
+
440  /* draw label */
+
441  text.padding = nk_vec2(0,0);
+
442  label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
+
443  label.y = header.y + style->combo.content_padding.y;
+
444  label.w = (button.x - style->combo.content_padding.x) - label.x;
+
445  label.h = header.h - 2 * style->combo.content_padding.y;
+
446  nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
+
447  }
+
448  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
449 }
+
450 NK_API nk_bool
+
451 nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 size)
+
452 {
+
453  struct nk_window *win;
+
454  struct nk_style *style;
+
455  const struct nk_input *in;
+
456 
+
457  struct nk_rect header;
+
458  int is_clicked = nk_false;
+ +
460  const struct nk_style_item *background;
+
461 
+
462  NK_ASSERT(ctx);
+
463  NK_ASSERT(ctx->current);
+
464  NK_ASSERT(ctx->current->layout);
+
465  if (!ctx || !ctx->current || !ctx->current->layout)
+
466  return 0;
+
467 
+
468  win = ctx->current;
+
469  style = &ctx->style;
+
470  s = nk_widget(&header, ctx);
+
471  if (s == NK_WIDGET_INVALID)
+
472  return 0;
+
473 
+
474  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
475  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
476  is_clicked = nk_true;
+
477 
+
478  /* draw combo box header background and border */
+
479  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED)
+
480  background = &style->combo.active;
+
481  else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
482  background = &style->combo.hover;
+
483  else background = &style->combo.normal;
+
484 
+
485  switch (background->type) {
+
486  case NK_STYLE_ITEM_IMAGE:
+
487  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
488  break;
+
489  case NK_STYLE_ITEM_NINE_SLICE:
+
490  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
491  break;
+
492  case NK_STYLE_ITEM_COLOR:
+
493  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
494  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
495  break;
+
496  }
+
497  {
+
498  struct nk_rect bounds = {0,0,0,0};
+
499  struct nk_rect content;
+
500  struct nk_rect button;
+
501  int draw_button_symbol;
+
502 
+
503  enum nk_symbol_type sym;
+
504  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
505  sym = style->combo.sym_hover;
+
506  else if (is_clicked)
+
507  sym = style->combo.sym_active;
+
508  else sym = style->combo.sym_normal;
+
509 
+
510  /* represents whether or not the combo's button symbol should be drawn */
+
511  draw_button_symbol = sym != NK_SYMBOL_NONE;
+
512 
+
513  /* calculate button */
+
514  button.w = header.h - 2 * style->combo.button_padding.y;
+
515  button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
+
516  button.y = header.y + style->combo.button_padding.y;
+
517  button.h = button.w;
+
518 
+
519  content.x = button.x + style->combo.button.padding.x;
+
520  content.y = button.y + style->combo.button.padding.y;
+
521  content.w = button.w - 2 * style->combo.button.padding.x;
+
522  content.h = button.h - 2 * style->combo.button.padding.y;
+
523 
+
524  /* draw image */
+
525  bounds.h = header.h - 2 * style->combo.content_padding.y;
+
526  bounds.y = header.y + style->combo.content_padding.y;
+
527  bounds.x = header.x + style->combo.content_padding.x;
+
528  if (draw_button_symbol)
+
529  bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
+
530  else
+
531  bounds.w = header.w - 2 * style->combo.content_padding.x;
+
532  nk_draw_image(&win->buffer, bounds, &img, nk_rgb_factor(nk_white, style->combo.color_factor));
+
533 
+
534  /* draw open/close button */
+
535  if (draw_button_symbol)
+
536  nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
+
537  &ctx->style.combo.button, sym, style->font);
+
538  }
+
539  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
540 }
+
541 NK_API nk_bool
+
542 nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len,
+
543  struct nk_image img, struct nk_vec2 size)
+
544 {
+
545  struct nk_window *win;
+
546  struct nk_style *style;
+
547  struct nk_input *in;
+
548 
+
549  struct nk_rect header;
+
550  int is_clicked = nk_false;
+ +
552  const struct nk_style_item *background;
+
553  struct nk_text text;
+
554 
+
555  NK_ASSERT(ctx);
+
556  NK_ASSERT(ctx->current);
+
557  NK_ASSERT(ctx->current->layout);
+
558  if (!ctx || !ctx->current || !ctx->current->layout)
+
559  return 0;
+
560 
+
561  win = ctx->current;
+
562  style = &ctx->style;
+
563  s = nk_widget(&header, ctx);
+
564  if (!s) return 0;
+
565 
+
566  in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
+
567  if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
+
568  is_clicked = nk_true;
+
569 
+
570  /* draw combo box header background and border */
+
571  if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
+
572  background = &style->combo.active;
+
573  text.text = style->combo.label_active;
+
574  } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
+
575  background = &style->combo.hover;
+
576  text.text = style->combo.label_hover;
+
577  } else {
+
578  background = &style->combo.normal;
+
579  text.text = style->combo.label_normal;
+
580  }
+
581 
+
582  text.text = nk_rgb_factor(text.text, style->combo.color_factor);
+
583 
+
584  switch(background->type) {
+
585  case NK_STYLE_ITEM_IMAGE:
+
586  text.background = nk_rgba(0, 0, 0, 0);
+
587  nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
+
588  break;
+
589  case NK_STYLE_ITEM_NINE_SLICE:
+
590  text.background = nk_rgba(0, 0, 0, 0);
+
591  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
+
592  break;
+
593  case NK_STYLE_ITEM_COLOR:
+
594  text.background = background->data.color;
+
595  nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
+
596  nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
+
597  break;
+
598  }
+
599  {
+
600  struct nk_rect content;
+
601  struct nk_rect button;
+
602  struct nk_rect label;
+
603  struct nk_rect image;
+
604  int draw_button_symbol;
+
605 
+
606  enum nk_symbol_type sym;
+
607  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
608  sym = style->combo.sym_hover;
+
609  else if (is_clicked)
+
610  sym = style->combo.sym_active;
+
611  else sym = style->combo.sym_normal;
+
612 
+
613  /* represents whether or not the combo's button symbol should be drawn */
+
614  draw_button_symbol = sym != NK_SYMBOL_NONE;
+
615 
+
616  /* calculate button */
+
617  button.w = header.h - 2 * style->combo.button_padding.y;
+
618  button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
+
619  button.y = header.y + style->combo.button_padding.y;
+
620  button.h = button.w;
+
621 
+
622  content.x = button.x + style->combo.button.padding.x;
+
623  content.y = button.y + style->combo.button.padding.y;
+
624  content.w = button.w - 2 * style->combo.button.padding.x;
+
625  content.h = button.h - 2 * style->combo.button.padding.y;
+
626  if (draw_button_symbol)
+
627  nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
+
628  &ctx->style.combo.button, sym, style->font);
+
629 
+
630  /* draw image */
+
631  image.x = header.x + style->combo.content_padding.x;
+
632  image.y = header.y + style->combo.content_padding.y;
+
633  image.h = header.h - 2 * style->combo.content_padding.y;
+
634  image.w = image.h;
+
635  nk_draw_image(&win->buffer, image, &img, nk_rgb_factor(nk_white, style->combo.color_factor));
+
636 
+
637  /* draw label */
+
638  text.padding = nk_vec2(0,0);
+
639  label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
+
640  label.y = header.y + style->combo.content_padding.y;
+
641  label.h = header.h - 2 * style->combo.content_padding.y;
+
642  if (draw_button_symbol)
+
643  label.w = (button.x - style->combo.content_padding.x) - label.x;
+
644  else
+
645  label.w = (header.x + header.w - style->combo.content_padding.x) - label.x;
+
646  nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
+
647  }
+
648  return nk_combo_begin(ctx, win, size, is_clicked, header);
+
649 }
+
650 NK_API nk_bool
+
651 nk_combo_begin_symbol_label(struct nk_context *ctx,
+
652  const char *selected, enum nk_symbol_type type, struct nk_vec2 size)
+
653 {
+
654  return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size);
+
655 }
+
656 NK_API nk_bool
+
657 nk_combo_begin_image_label(struct nk_context *ctx,
+
658  const char *selected, struct nk_image img, struct nk_vec2 size)
+
659 {
+
660  return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size);
+
661 }
+
662 NK_API nk_bool
+
663 nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
+
664 {
+
665  return nk_contextual_item_text(ctx, text, len, align);
+
666 }
+
667 NK_API nk_bool
+
668 nk_combo_item_label(struct nk_context *ctx, const char *label, nk_flags align)
+
669 {
+
670  return nk_contextual_item_label(ctx, label, align);
+
671 }
+
672 NK_API nk_bool
+
673 nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text,
+
674  int len, nk_flags alignment)
+
675 {
+
676  return nk_contextual_item_image_text(ctx, img, text, len, alignment);
+
677 }
+
678 NK_API nk_bool
+
679 nk_combo_item_image_label(struct nk_context *ctx, struct nk_image img,
+
680  const char *text, nk_flags alignment)
+
681 {
+
682  return nk_contextual_item_image_label(ctx, img, text, alignment);
+
683 }
+
684 NK_API nk_bool
+
685 nk_combo_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+
686  const char *text, int len, nk_flags alignment)
+
687 {
+
688  return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);
+
689 }
+
690 NK_API nk_bool
+
691 nk_combo_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+
692  const char *label, nk_flags alignment)
+
693 {
+
694  return nk_contextual_item_symbol_label(ctx, sym, label, alignment);
+
695 }
+
696 NK_API void nk_combo_end(struct nk_context *ctx)
+
697 {
+
698  nk_contextual_end(ctx);
+
699 }
+
700 NK_API void nk_combo_close(struct nk_context *ctx)
+
701 {
+
702  nk_contextual_close(ctx);
+
703 }
+
704 NK_API int
+
705 nk_combo(struct nk_context *ctx, const char *const *items, int count,
+
706  int selected, int item_height, struct nk_vec2 size)
+
707 {
+
708  int i = 0;
+
709  int max_height;
+
710  struct nk_vec2 item_spacing;
+
711  struct nk_vec2 window_padding;
+
712 
+
713  NK_ASSERT(ctx);
+
714  NK_ASSERT(items);
+
715  NK_ASSERT(ctx->current);
+
716  if (!ctx || !items ||!count)
+
717  return selected;
+
718 
+
719  item_spacing = ctx->style.window.spacing;
+
720  window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
+
721  max_height = count * item_height + count * (int)item_spacing.y;
+
722  max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
+
723  size.y = NK_MIN(size.y, (float)max_height);
+
724  if (nk_combo_begin_label(ctx, items[selected], size)) {
+
725  nk_layout_row_dynamic(ctx, (float)item_height, 1);
+
726  for (i = 0; i < count; ++i) {
+
727  if (nk_combo_item_label(ctx, items[i], NK_TEXT_LEFT))
+
728  selected = i;
+
729  }
+
730  nk_combo_end(ctx);
+
731  }
+
732  return selected;
+
733 }
+
734 NK_API int
+
735 nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
+
736  int separator, int selected, int count, int item_height, struct nk_vec2 size)
+
737 {
+
738  int i;
+
739  int max_height;
+
740  struct nk_vec2 item_spacing;
+
741  struct nk_vec2 window_padding;
+
742  const char *current_item;
+
743  const char *iter;
+
744  int length = 0;
+
745 
+
746  NK_ASSERT(ctx);
+
747  NK_ASSERT(items_separated_by_separator);
+
748  if (!ctx || !items_separated_by_separator)
+
749  return selected;
+
750 
+
751  /* calculate popup window */
+
752  item_spacing = ctx->style.window.spacing;
+
753  window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
+
754  max_height = count * item_height + count * (int)item_spacing.y;
+
755  max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
+
756  size.y = NK_MIN(size.y, (float)max_height);
+
757 
+
758  /* find selected item */
+
759  current_item = items_separated_by_separator;
+
760  for (i = 0; i < count; ++i) {
+
761  iter = current_item;
+
762  while (*iter && *iter != separator) iter++;
+
763  length = (int)(iter - current_item);
+
764  if (i == selected) break;
+
765  current_item = iter + 1;
+
766  }
+
767 
+
768  if (nk_combo_begin_text(ctx, current_item, length, size)) {
+
769  current_item = items_separated_by_separator;
+
770  nk_layout_row_dynamic(ctx, (float)item_height, 1);
+
771  for (i = 0; i < count; ++i) {
+
772  iter = current_item;
+
773  while (*iter && *iter != separator) iter++;
+
774  length = (int)(iter - current_item);
+
775  if (nk_combo_item_text(ctx, current_item, length, NK_TEXT_LEFT))
+
776  selected = i;
+
777  current_item = current_item + length + 1;
+
778  }
+
779  nk_combo_end(ctx);
+
780  }
+
781  return selected;
+
782 }
+
783 NK_API int
+
784 nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros,
+
785  int selected, int count, int item_height, struct nk_vec2 size)
+
786 {
+
787  return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);
+
788 }
+
789 NK_API int
+
790 nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**),
+
791  void *userdata, int selected, int count, int item_height, struct nk_vec2 size)
+
792 {
+
793  int i;
+
794  int max_height;
+
795  struct nk_vec2 item_spacing;
+
796  struct nk_vec2 window_padding;
+
797  const char *item;
+
798 
+
799  NK_ASSERT(ctx);
+
800  NK_ASSERT(item_getter);
+
801  if (!ctx || !item_getter)
+
802  return selected;
+
803 
+
804  /* calculate popup window */
+
805  item_spacing = ctx->style.window.spacing;
+
806  window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
+
807  max_height = count * item_height + count * (int)item_spacing.y;
+
808  max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
+
809  size.y = NK_MIN(size.y, (float)max_height);
+
810 
+
811  item_getter(userdata, selected, &item);
+
812  if (nk_combo_begin_label(ctx, item, size)) {
+
813  nk_layout_row_dynamic(ctx, (float)item_height, 1);
+
814  for (i = 0; i < count; ++i) {
+
815  item_getter(userdata, i, &item);
+
816  if (nk_combo_item_label(ctx, item, NK_TEXT_LEFT))
+
817  selected = i;
+
818  }
+
819  nk_combo_end(ctx);
+
820  } return selected;
+
821 }
+
822 NK_API void
+
823 nk_combobox(struct nk_context *ctx, const char *const *items, int count,
+
824  int *selected, int item_height, struct nk_vec2 size)
+
825 {
+
826  *selected = nk_combo(ctx, items, count, *selected, item_height, size);
+
827 }
+
828 NK_API void
+
829 nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
+
830  int *selected, int count, int item_height, struct nk_vec2 size)
+
831 {
+
832  *selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);
+
833 }
+
834 NK_API void
+
835 nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
+
836  int separator, int *selected, int count, int item_height, struct nk_vec2 size)
+
837 {
+
838  *selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
+
839  *selected, count, item_height, size);
+
840 }
+
841 NK_API void
+
842 nk_combobox_callback(struct nk_context *ctx,
+
843  void(*item_getter)(void* data, int id, const char **out_text),
+
844  void *userdata, int *selected, int count, int item_height, struct nk_vec2 size)
+
845 {
+
846  *selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);
+
847 }
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+
@ NK_WIDGET_INVALID
The widget cannot be seen and is completely out of view.
Definition: nuklear.h:3082
+ + + + + + + + + + +
+
+ + + + diff --git a/nuklear__context_8c_source.html b/nuklear__context_8c_source.html new file mode 100644 index 000000000..3ee6f653d --- /dev/null +++ b/nuklear__context_8c_source.html @@ -0,0 +1,487 @@ + + + + + + + +Nuklear: src/nuklear_context.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_context.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * CONTEXT
+
7  *
+
8  * ===============================================================*/
+
9 NK_INTERN void
+
10 nk_setup(struct nk_context *ctx, const struct nk_user_font *font)
+
11 {
+
12  NK_ASSERT(ctx);
+
13  if (!ctx) return;
+
14  nk_zero_struct(*ctx);
+
15  nk_style_default(ctx);
+
16  ctx->seq = 1;
+
17  if (font) ctx->style.font = font;
+
18 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
19  nk_draw_list_init(&ctx->draw_list);
+
20 #endif
+
21 }
+
22 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
23 NK_API nk_bool
+
24 nk_init_default(struct nk_context *ctx, const struct nk_user_font *font)
+
25 {
+
26  struct nk_allocator alloc;
+
27  alloc.userdata.ptr = 0;
+
28  alloc.alloc = nk_malloc;
+
29  alloc.free = nk_mfree;
+
30  return nk_init(ctx, &alloc, font);
+
31 }
+
32 #endif
+
33 NK_API nk_bool
+
34 nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size,
+
35  const struct nk_user_font *font)
+
36 {
+
37  NK_ASSERT(memory);
+
38  if (!memory) return 0;
+
39  nk_setup(ctx, font);
+
40  nk_buffer_init_fixed(&ctx->memory, memory, size);
+
41  ctx->use_pool = nk_false;
+
42  return 1;
+
43 }
+
44 NK_API nk_bool
+
45 nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds,
+
46  struct nk_buffer *pool, const struct nk_user_font *font)
+
47 {
+
48  NK_ASSERT(cmds);
+
49  NK_ASSERT(pool);
+
50  if (!cmds || !pool) return 0;
+
51 
+
52  nk_setup(ctx, font);
+
53  ctx->memory = *cmds;
+
54  if (pool->type == NK_BUFFER_FIXED) {
+
55  /* take memory from buffer and alloc fixed pool */
+
56  nk_pool_init_fixed(&ctx->pool, pool->memory.ptr, pool->memory.size);
+
57  } else {
+
58  /* create dynamic pool from buffer allocator */
+
59  struct nk_allocator *alloc = &pool->pool;
+
60  nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
+
61  }
+
62  ctx->use_pool = nk_true;
+
63  return 1;
+
64 }
+
65 NK_API nk_bool
+
66 nk_init(struct nk_context *ctx, const struct nk_allocator *alloc,
+
67  const struct nk_user_font *font)
+
68 {
+
69  NK_ASSERT(alloc);
+
70  if (!alloc) return 0;
+
71  nk_setup(ctx, font);
+
72  nk_buffer_init(&ctx->memory, alloc, NK_DEFAULT_COMMAND_BUFFER_SIZE);
+
73  nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
+
74  ctx->use_pool = nk_true;
+
75  return 1;
+
76 }
+
77 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
78 NK_API void
+
79 nk_set_user_data(struct nk_context *ctx, nk_handle handle)
+
80 {
+
81  if (!ctx) return;
+
82  ctx->userdata = handle;
+
83  if (ctx->current)
+
84  ctx->current->buffer.userdata = handle;
+
85 }
+
86 #endif
+
87 NK_API void
+
88 nk_free(struct nk_context *ctx)
+
89 {
+
90  NK_ASSERT(ctx);
+
91  if (!ctx) return;
+
92  nk_buffer_free(&ctx->memory);
+
93  if (ctx->use_pool)
+
94  nk_pool_free(&ctx->pool);
+
95 
+
96  nk_zero(&ctx->input, sizeof(ctx->input));
+
97  nk_zero(&ctx->style, sizeof(ctx->style));
+
98  nk_zero(&ctx->memory, sizeof(ctx->memory));
+
99 
+
100  ctx->seq = 0;
+
101  ctx->build = 0;
+
102  ctx->begin = 0;
+
103  ctx->end = 0;
+
104  ctx->active = 0;
+
105  ctx->current = 0;
+
106  ctx->freelist = 0;
+
107  ctx->count = 0;
+
108 }
+
109 NK_API void
+
110 nk_clear(struct nk_context *ctx)
+
111 {
+
112  struct nk_window *iter;
+
113  struct nk_window *next;
+
114  NK_ASSERT(ctx);
+
115 
+
116  if (!ctx) return;
+
117  if (ctx->use_pool)
+
118  nk_buffer_clear(&ctx->memory);
+
119  else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT);
+
120 
+
121  ctx->build = 0;
+
122  ctx->memory.calls = 0;
+
123  ctx->last_widget_state = 0;
+
124  ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
+
125  NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay));
+
126 
+
127  /* garbage collector */
+
128  iter = ctx->begin;
+
129  while (iter) {
+
130  /* make sure valid minimized windows do not get removed */
+
131  if ((iter->flags & NK_WINDOW_MINIMIZED) &&
+
132  !(iter->flags & NK_WINDOW_CLOSED) &&
+
133  iter->seq == ctx->seq) {
+
134  iter = iter->next;
+
135  continue;
+
136  }
+
137  /* remove hotness from hidden or closed windows*/
+
138  if (((iter->flags & NK_WINDOW_HIDDEN) ||
+
139  (iter->flags & NK_WINDOW_CLOSED)) &&
+
140  iter == ctx->active) {
+
141  ctx->active = iter->prev;
+
142  ctx->end = iter->prev;
+
143  if (!ctx->end)
+
144  ctx->begin = 0;
+
145  if (ctx->active)
+
146  ctx->active->flags &= ~(unsigned)NK_WINDOW_ROM;
+
147  }
+
148  /* free unused popup windows */
+
149  if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
+
150  nk_free_window(ctx, iter->popup.win);
+
151  iter->popup.win = 0;
+
152  }
+
153  /* remove unused window state tables */
+
154  {struct nk_table *n, *it = iter->tables;
+
155  while (it) {
+
156  n = it->next;
+
157  if (it->seq != ctx->seq) {
+
158  nk_remove_table(iter, it);
+
159  nk_zero(it, sizeof(union nk_page_data));
+
160  nk_free_table(ctx, it);
+
161  if (it == iter->tables)
+
162  iter->tables = n;
+
163  } it = n;
+
164  }}
+
165  /* window itself is not used anymore so free */
+
166  if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) {
+
167  next = iter->next;
+
168  nk_remove_window(ctx, iter);
+
169  nk_free_window(ctx, iter);
+
170  iter = next;
+
171  } else iter = iter->next;
+
172  }
+
173  ctx->seq++;
+
174 }
+
175 NK_LIB void
+
176 nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+
177 {
+
178  NK_ASSERT(ctx);
+
179  NK_ASSERT(buffer);
+
180  if (!ctx || !buffer) return;
+
181  buffer->begin = ctx->memory.allocated;
+
182  buffer->end = buffer->begin;
+
183  buffer->last = buffer->begin;
+
184  buffer->clip = nk_null_rect;
+
185 }
+
186 NK_LIB void
+
187 nk_start(struct nk_context *ctx, struct nk_window *win)
+
188 {
+
189  NK_ASSERT(ctx);
+
190  NK_ASSERT(win);
+
191  nk_start_buffer(ctx, &win->buffer);
+
192 }
+
193 NK_LIB void
+
194 nk_start_popup(struct nk_context *ctx, struct nk_window *win)
+
195 {
+
196  struct nk_popup_buffer *buf;
+
197  NK_ASSERT(ctx);
+
198  NK_ASSERT(win);
+
199  if (!ctx || !win) return;
+
200 
+
201  /* save buffer fill state for popup */
+
202  buf = &win->popup.buf;
+
203  buf->begin = win->buffer.end;
+
204  buf->end = win->buffer.end;
+
205  buf->parent = win->buffer.last;
+
206  buf->last = buf->begin;
+
207  buf->active = nk_true;
+
208 }
+
209 NK_LIB void
+
210 nk_finish_popup(struct nk_context *ctx, struct nk_window *win)
+
211 {
+
212  struct nk_popup_buffer *buf;
+
213  NK_ASSERT(ctx);
+
214  NK_ASSERT(win);
+
215  if (!ctx || !win) return;
+
216 
+
217  buf = &win->popup.buf;
+
218  buf->last = win->buffer.last;
+
219  buf->end = win->buffer.end;
+
220 }
+
221 NK_LIB void
+
222 nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+
223 {
+
224  NK_ASSERT(ctx);
+
225  NK_ASSERT(buffer);
+
226  if (!ctx || !buffer) return;
+
227  buffer->end = ctx->memory.allocated;
+
228 }
+
229 NK_LIB void
+
230 nk_finish(struct nk_context *ctx, struct nk_window *win)
+
231 {
+
232  struct nk_popup_buffer *buf;
+
233  struct nk_command *parent_last;
+
234  void *memory;
+
235 
+
236  NK_ASSERT(ctx);
+
237  NK_ASSERT(win);
+
238  if (!ctx || !win) return;
+
239  nk_finish_buffer(ctx, &win->buffer);
+
240  if (!win->popup.buf.active) return;
+
241 
+
242  buf = &win->popup.buf;
+
243  memory = ctx->memory.memory.ptr;
+
244  parent_last = nk_ptr_add(struct nk_command, memory, buf->parent);
+
245  parent_last->next = buf->end;
+
246 }
+
247 NK_LIB void
+
248 nk_build(struct nk_context *ctx)
+
249 {
+
250  struct nk_window *it = 0;
+
251  struct nk_command *cmd = 0;
+
252  nk_byte *buffer = 0;
+
253 
+
254  /* draw cursor overlay */
+
255  if (!ctx->style.cursor_active)
+
256  ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
+
257  if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
+
258  struct nk_rect mouse_bounds;
+
259  const struct nk_cursor *cursor = ctx->style.cursor_active;
+
260  nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF);
+
261  nk_start_buffer(ctx, &ctx->overlay);
+
262 
+
263  mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
+
264  mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
+
265  mouse_bounds.w = cursor->size.x;
+
266  mouse_bounds.h = cursor->size.y;
+
267 
+
268  nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white);
+
269  nk_finish_buffer(ctx, &ctx->overlay);
+
270  }
+
271  /* build one big draw command list out of all window buffers */
+
272  it = ctx->begin;
+
273  buffer = (nk_byte*)ctx->memory.memory.ptr;
+
274  while (it != 0) {
+
275  struct nk_window *next = it->next;
+
276  if (it->buffer.last == it->buffer.begin || (it->flags & NK_WINDOW_HIDDEN)||
+
277  it->seq != ctx->seq)
+
278  goto cont;
+
279 
+
280  cmd = nk_ptr_add(struct nk_command, buffer, it->buffer.last);
+
281  while (next && ((next->buffer.last == next->buffer.begin) ||
+
282  (next->flags & NK_WINDOW_HIDDEN) || next->seq != ctx->seq))
+
283  next = next->next; /* skip empty command buffers */
+
284 
+
285  if (next) cmd->next = next->buffer.begin;
+
286  cont: it = next;
+
287  }
+
288  /* append all popup draw commands into lists */
+
289  it = ctx->begin;
+
290  while (it != 0) {
+
291  struct nk_window *next = it->next;
+
292  struct nk_popup_buffer *buf;
+
293  if (!it->popup.buf.active)
+
294  goto skip;
+
295 
+
296  buf = &it->popup.buf;
+
297  cmd->next = buf->begin;
+
298  cmd = nk_ptr_add(struct nk_command, buffer, buf->last);
+
299  buf->active = nk_false;
+
300  skip: it = next;
+
301  }
+
302  if (cmd) {
+
303  /* append overlay commands */
+
304  if (ctx->overlay.end != ctx->overlay.begin)
+
305  cmd->next = ctx->overlay.begin;
+
306  else cmd->next = ctx->memory.allocated;
+
307  }
+
308 }
+
309 NK_API const struct nk_command*
+
310 nk__begin(struct nk_context *ctx)
+
311 {
+
312  struct nk_window *iter;
+
313  nk_byte *buffer;
+
314  NK_ASSERT(ctx);
+
315  if (!ctx) return 0;
+
316  if (!ctx->count) return 0;
+
317 
+
318  buffer = (nk_byte*)ctx->memory.memory.ptr;
+
319  if (!ctx->build) {
+
320  nk_build(ctx);
+
321  ctx->build = nk_true;
+
322  }
+
323  iter = ctx->begin;
+
324  while (iter && ((iter->buffer.begin == iter->buffer.end) ||
+
325  (iter->flags & NK_WINDOW_HIDDEN) || iter->seq != ctx->seq))
+
326  iter = iter->next;
+
327  if (!iter) return 0;
+
328  return nk_ptr_add_const(struct nk_command, buffer, iter->buffer.begin);
+
329 }
+
330 
+
331 NK_API const struct nk_command*
+
332 nk__next(struct nk_context *ctx, const struct nk_command *cmd)
+
333 {
+
334  nk_byte *buffer;
+
335  const struct nk_command *next;
+
336  NK_ASSERT(ctx);
+
337  if (!ctx || !cmd || !ctx->count) return 0;
+
338  if (cmd->next >= ctx->memory.allocated) return 0;
+
339  buffer = (nk_byte*)ctx->memory.memory.ptr;
+
340  next = nk_ptr_add_const(struct nk_command, buffer, cmd->next);
+
341  return next;
+
342 }
+
343 
+
344 
+
main API and documentation file
+
NK_API void nk_free(struct nk_context *)
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed.
+
NK_API nk_bool nk_init_fixed(struct nk_context *, void *memory, nk_size size, const struct nk_user_font *)
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API nk_bool nk_init_custom(struct nk_context *, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *)
Initializes a nk_context struct from two different either fixed or growing buffers.
+
NK_API const struct nk_command * nk__begin(struct nk_context *)
Returns a draw command list iterator to iterate all draw commands accumulated over one frame.
+
NK_API nk_bool nk_init(struct nk_context *, const struct nk_allocator *, const struct nk_user_font *)
+
NK_API const struct nk_command * nk__next(struct nk_context *, const struct nk_command *)
Returns draw command pointer pointing to the next command inside the draw command list.
+
NK_API void nk_clear(struct nk_context *)
Resets the context state at the end of the frame.
+ + +
struct nk_allocator pool
!< buffer marker to free a buffer to a certain offset
Definition: nuklear.h:4191
+
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
enum nk_allocation_type type
!< allocator callback for dynamic buffers
Definition: nuklear.h:4192
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+
nk_size calls
!< totally consumed memory given that enough memory is present
Definition: nuklear.h:4197
+ +
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ +
int build
windows
Definition: nuklear.h:5733
+
struct nk_command_buffer overlay
draw buffer used for overlay drawing operation like cursor
Definition: nuklear.h:5730
+ + + + + + + + +
+
+ + + + diff --git a/nuklear__contextual_8c_source.html b/nuklear__contextual_8c_source.html new file mode 100644 index 000000000..cc39af64a --- /dev/null +++ b/nuklear__contextual_8c_source.html @@ -0,0 +1,350 @@ + + + + + + + +Nuklear: src/nuklear_contextual.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_contextual.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * CONTEXTUAL
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
+
11  struct nk_rect trigger_bounds)
+
12 {
+
13  struct nk_window *win;
+
14  struct nk_window *popup;
+
15  struct nk_rect body;
+
16  struct nk_input* in;
+
17 
+
18  NK_STORAGE const struct nk_rect null_rect = {-1,-1,0,0};
+
19  int is_clicked = 0;
+
20  int is_open = 0;
+
21  int ret = 0;
+
22 
+
23  NK_ASSERT(ctx);
+
24  NK_ASSERT(ctx->current);
+
25  NK_ASSERT(ctx->current->layout);
+
26  if (!ctx || !ctx->current || !ctx->current->layout)
+
27  return 0;
+
28 
+
29  win = ctx->current;
+
30  ++win->popup.con_count;
+
31  if (ctx->current != ctx->active)
+
32  return 0;
+
33 
+
34  /* check if currently active contextual is active */
+
35  popup = win->popup.win;
+
36  is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL);
+
37  in = win->widgets_disabled ? 0 : &ctx->input;
+
38  if (in) {
+
39  is_clicked = nk_input_mouse_clicked(in, NK_BUTTON_RIGHT, trigger_bounds);
+
40  if (win->popup.active_con && win->popup.con_count != win->popup.active_con)
+
41  return 0;
+
42  if (!is_open && win->popup.active_con)
+
43  win->popup.active_con = 0;
+
44  if ((!is_open && !is_clicked))
+
45  return 0;
+
46 
+
47  /* calculate contextual position on click */
+
48  win->popup.active_con = win->popup.con_count;
+
49  if (is_clicked) {
+
50  body.x = in->mouse.pos.x;
+
51  body.y = in->mouse.pos.y;
+
52  } else {
+
53  body.x = popup->bounds.x;
+
54  body.y = popup->bounds.y;
+
55  }
+
56 
+
57  body.w = size.x;
+
58  body.h = size.y;
+
59 
+
60  /* start nonblocking contextual popup */
+
61  ret = nk_nonblock_begin(ctx, flags | NK_WINDOW_NO_SCROLLBAR, body,
+
62  null_rect, NK_PANEL_CONTEXTUAL);
+
63  if (ret) win->popup.type = NK_PANEL_CONTEXTUAL;
+
64  else {
+
65  win->popup.active_con = 0;
+
66  win->popup.type = NK_PANEL_NONE;
+
67  if (win->popup.win)
+
68  win->popup.win->flags = 0;
+
69  }
+
70  }
+
71  return ret;
+
72 }
+
73 NK_API nk_bool
+
74 nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
+
75  nk_flags alignment)
+
76 {
+
77  struct nk_window *win;
+
78  const struct nk_input *in;
+
79  const struct nk_style *style;
+
80 
+
81  struct nk_rect bounds;
+
82  enum nk_widget_layout_states state;
+
83 
+
84  NK_ASSERT(ctx);
+
85  NK_ASSERT(ctx->current);
+
86  NK_ASSERT(ctx->current->layout);
+
87  if (!ctx || !ctx->current || !ctx->current->layout)
+
88  return 0;
+
89 
+
90  win = ctx->current;
+
91  style = &ctx->style;
+
92  state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+
93  if (!state) return nk_false;
+
94 
+
95  in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
96  if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
+
97  text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
+
98  nk_contextual_close(ctx);
+
99  return nk_true;
+
100  }
+
101  return nk_false;
+
102 }
+
103 NK_API nk_bool
+
104 nk_contextual_item_label(struct nk_context *ctx, const char *label, nk_flags align)
+
105 {
+
106  return nk_contextual_item_text(ctx, label, nk_strlen(label), align);
+
107 }
+
108 NK_API nk_bool
+
109 nk_contextual_item_image_text(struct nk_context *ctx, struct nk_image img,
+
110  const char *text, int len, nk_flags align)
+
111 {
+
112  struct nk_window *win;
+
113  const struct nk_input *in;
+
114  const struct nk_style *style;
+
115 
+
116  struct nk_rect bounds;
+
117  enum nk_widget_layout_states state;
+
118 
+
119  NK_ASSERT(ctx);
+
120  NK_ASSERT(ctx->current);
+
121  NK_ASSERT(ctx->current->layout);
+
122  if (!ctx || !ctx->current || !ctx->current->layout)
+
123  return 0;
+
124 
+
125  win = ctx->current;
+
126  style = &ctx->style;
+
127  state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+
128  if (!state) return nk_false;
+
129 
+
130  in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
131  if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds,
+
132  img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
+
133  nk_contextual_close(ctx);
+
134  return nk_true;
+
135  }
+
136  return nk_false;
+
137 }
+
138 NK_API nk_bool
+
139 nk_contextual_item_image_label(struct nk_context *ctx, struct nk_image img,
+
140  const char *label, nk_flags align)
+
141 {
+
142  return nk_contextual_item_image_text(ctx, img, label, nk_strlen(label), align);
+
143 }
+
144 NK_API nk_bool
+
145 nk_contextual_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
+
146  const char *text, int len, nk_flags align)
+
147 {
+
148  struct nk_window *win;
+
149  const struct nk_input *in;
+
150  const struct nk_style *style;
+
151 
+
152  struct nk_rect bounds;
+
153  enum nk_widget_layout_states state;
+
154 
+
155  NK_ASSERT(ctx);
+
156  NK_ASSERT(ctx->current);
+
157  NK_ASSERT(ctx->current->layout);
+
158  if (!ctx || !ctx->current || !ctx->current->layout)
+
159  return 0;
+
160 
+
161  win = ctx->current;
+
162  style = &ctx->style;
+
163  state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+
164  if (!state) return nk_false;
+
165 
+
166  in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
167  if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+
168  symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
+
169  nk_contextual_close(ctx);
+
170  return nk_true;
+
171  }
+
172  return nk_false;
+
173 }
+
174 NK_API nk_bool
+
175 nk_contextual_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
+
176  const char *text, nk_flags align)
+
177 {
+
178  return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align);
+
179 }
+
180 NK_API void
+
181 nk_contextual_close(struct nk_context *ctx)
+
182 {
+
183  NK_ASSERT(ctx);
+
184  NK_ASSERT(ctx->current);
+
185  NK_ASSERT(ctx->current->layout);
+
186  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
187  nk_popup_close(ctx);
+
188 }
+
189 NK_API void
+
190 nk_contextual_end(struct nk_context *ctx)
+
191 {
+
192  struct nk_window *popup;
+
193  struct nk_panel *panel;
+
194  NK_ASSERT(ctx);
+
195  NK_ASSERT(ctx->current);
+
196  if (!ctx || !ctx->current) return;
+
197 
+
198  popup = ctx->current;
+
199  panel = popup->layout;
+
200  NK_ASSERT(popup->parent);
+
201  NK_ASSERT((int)panel->type & (int)NK_PANEL_SET_POPUP);
+
202  if (panel->flags & NK_WINDOW_DYNAMIC) {
+
203  /* Close behavior
+
204  This is a bit of a hack solution since we do not know before we end our popup
+
205  how big it will be. We therefore do not directly know when a
+
206  click outside the non-blocking popup must close it at that direct frame.
+
207  Instead it will be closed in the next frame.*/
+
208  struct nk_rect body = {0,0,0,0};
+
209  if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
+
210  struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
+
211  body = panel->bounds;
+
212  body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height);
+
213  body.h = (panel->bounds.y + panel->bounds.h) - body.y;
+
214  }
+
215  {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
+
216  int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
+
217  if (pressed && in_body)
+
218  popup->flags |= NK_WINDOW_HIDDEN;
+
219  }
+
220  }
+
221  if (popup->flags & NK_WINDOW_HIDDEN)
+
222  popup->seq = 0;
+
223  nk_popup_end(ctx);
+
224  return;
+
225 }
+
226 
+
main API and documentation file
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
Definition: nuklear.h:5491
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + +
+
+ + + + diff --git a/nuklear__draw_8c_source.html b/nuklear__draw_8c_source.html new file mode 100644 index 000000000..a76125621 --- /dev/null +++ b/nuklear__draw_8c_source.html @@ -0,0 +1,702 @@ + + + + + + + +Nuklear: src/nuklear_draw.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_draw.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ==============================================================
+
5  *
+
6  * DRAW
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_command_buffer_init(struct nk_command_buffer *cb,
+
11  struct nk_buffer *b, enum nk_command_clipping clip)
+
12 {
+
13  NK_ASSERT(cb);
+
14  NK_ASSERT(b);
+
15  if (!cb || !b) return;
+
16  cb->base = b;
+
17  cb->use_clipping = (int)clip;
+
18  cb->begin = b->allocated;
+
19  cb->end = b->allocated;
+
20  cb->last = b->allocated;
+
21 }
+
22 NK_LIB void
+
23 nk_command_buffer_reset(struct nk_command_buffer *b)
+
24 {
+
25  NK_ASSERT(b);
+
26  if (!b) return;
+
27  b->begin = 0;
+
28  b->end = 0;
+
29  b->last = 0;
+
30  b->clip = nk_null_rect;
+
31 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
32  b->userdata.ptr = 0;
+
33 #endif
+
34 }
+
35 NK_LIB void*
+
36 nk_command_buffer_push(struct nk_command_buffer* b,
+
37  enum nk_command_type t, nk_size size)
+
38 {
+
39  NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_command);
+
40  struct nk_command *cmd;
+
41  nk_size alignment;
+
42  void *unaligned;
+
43  void *memory;
+
44 
+
45  NK_ASSERT(b);
+
46  NK_ASSERT(b->base);
+
47  if (!b) return 0;
+
48  cmd = (struct nk_command*)nk_buffer_alloc(b->base,NK_BUFFER_FRONT,size,align);
+
49  if (!cmd) return 0;
+
50 
+
51  /* make sure the offset to the next command is aligned */
+
52  b->last = (nk_size)((nk_byte*)cmd - (nk_byte*)b->base->memory.ptr);
+
53  unaligned = (nk_byte*)cmd + size;
+
54  memory = NK_ALIGN_PTR(unaligned, align);
+
55  alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
+
56 #ifdef NK_ZERO_COMMAND_MEMORY
+
57  NK_MEMSET(cmd, 0, size + alignment);
+
58 #endif
+
59 
+
60  cmd->type = t;
+
61  cmd->next = b->base->allocated + alignment;
+
62 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
63  cmd->userdata = b->userdata;
+
64 #endif
+
65  b->end = cmd->next;
+
66  return cmd;
+
67 }
+
68 NK_API void
+
69 nk_push_scissor(struct nk_command_buffer *b, struct nk_rect r)
+
70 {
+
71  struct nk_command_scissor *cmd;
+
72  NK_ASSERT(b);
+
73  if (!b) return;
+
74 
+
75  b->clip.x = r.x;
+
76  b->clip.y = r.y;
+
77  b->clip.w = r.w;
+
78  b->clip.h = r.h;
+
79  cmd = (struct nk_command_scissor*)
+
80  nk_command_buffer_push(b, NK_COMMAND_SCISSOR, sizeof(*cmd));
+
81 
+
82  if (!cmd) return;
+
83  cmd->x = (short)r.x;
+
84  cmd->y = (short)r.y;
+
85  cmd->w = (unsigned short)NK_MAX(0, r.w);
+
86  cmd->h = (unsigned short)NK_MAX(0, r.h);
+
87 }
+
88 NK_API void
+
89 nk_stroke_line(struct nk_command_buffer *b, float x0, float y0,
+
90  float x1, float y1, float line_thickness, struct nk_color c)
+
91 {
+
92  struct nk_command_line *cmd;
+
93  NK_ASSERT(b);
+
94  if (!b || line_thickness <= 0) return;
+
95  cmd = (struct nk_command_line*)
+
96  nk_command_buffer_push(b, NK_COMMAND_LINE, sizeof(*cmd));
+
97  if (!cmd) return;
+
98  cmd->line_thickness = (unsigned short)line_thickness;
+
99  cmd->begin.x = (short)x0;
+
100  cmd->begin.y = (short)y0;
+
101  cmd->end.x = (short)x1;
+
102  cmd->end.y = (short)y1;
+
103  cmd->color = c;
+
104 }
+
105 NK_API void
+
106 nk_stroke_curve(struct nk_command_buffer *b, float ax, float ay,
+
107  float ctrl0x, float ctrl0y, float ctrl1x, float ctrl1y,
+
108  float bx, float by, float line_thickness, struct nk_color col)
+
109 {
+
110  struct nk_command_curve *cmd;
+
111  NK_ASSERT(b);
+
112  if (!b || col.a == 0 || line_thickness <= 0) return;
+
113 
+
114  cmd = (struct nk_command_curve*)
+
115  nk_command_buffer_push(b, NK_COMMAND_CURVE, sizeof(*cmd));
+
116  if (!cmd) return;
+
117  cmd->line_thickness = (unsigned short)line_thickness;
+
118  cmd->begin.x = (short)ax;
+
119  cmd->begin.y = (short)ay;
+
120  cmd->ctrl[0].x = (short)ctrl0x;
+
121  cmd->ctrl[0].y = (short)ctrl0y;
+
122  cmd->ctrl[1].x = (short)ctrl1x;
+
123  cmd->ctrl[1].y = (short)ctrl1y;
+
124  cmd->end.x = (short)bx;
+
125  cmd->end.y = (short)by;
+
126  cmd->color = col;
+
127 }
+
128 NK_API void
+
129 nk_stroke_rect(struct nk_command_buffer *b, struct nk_rect rect,
+
130  float rounding, float line_thickness, struct nk_color c)
+
131 {
+
132  struct nk_command_rect *cmd;
+
133  NK_ASSERT(b);
+
134  if (!b || c.a == 0 || rect.w == 0 || rect.h == 0 || line_thickness <= 0) return;
+
135  if (b->use_clipping) {
+
136  const struct nk_rect *clip = &b->clip;
+
137  if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
+
138  clip->x, clip->y, clip->w, clip->h)) return;
+
139  }
+
140  cmd = (struct nk_command_rect*)
+
141  nk_command_buffer_push(b, NK_COMMAND_RECT, sizeof(*cmd));
+
142  if (!cmd) return;
+
143  cmd->rounding = (unsigned short)rounding;
+
144  cmd->line_thickness = (unsigned short)line_thickness;
+
145  cmd->x = (short)rect.x;
+
146  cmd->y = (short)rect.y;
+
147  cmd->w = (unsigned short)NK_MAX(0, rect.w);
+
148  cmd->h = (unsigned short)NK_MAX(0, rect.h);
+
149  cmd->color = c;
+
150 }
+
151 NK_API void
+
152 nk_fill_rect(struct nk_command_buffer *b, struct nk_rect rect,
+
153  float rounding, struct nk_color c)
+
154 {
+
155  struct nk_command_rect_filled *cmd;
+
156  NK_ASSERT(b);
+
157  if (!b || c.a == 0 || rect.w == 0 || rect.h == 0) return;
+
158  if (b->use_clipping) {
+
159  const struct nk_rect *clip = &b->clip;
+
160  if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
+
161  clip->x, clip->y, clip->w, clip->h)) return;
+
162  }
+
163 
+
164  cmd = (struct nk_command_rect_filled*)
+
165  nk_command_buffer_push(b, NK_COMMAND_RECT_FILLED, sizeof(*cmd));
+
166  if (!cmd) return;
+
167  cmd->rounding = (unsigned short)rounding;
+
168  cmd->x = (short)rect.x;
+
169  cmd->y = (short)rect.y;
+
170  cmd->w = (unsigned short)NK_MAX(0, rect.w);
+
171  cmd->h = (unsigned short)NK_MAX(0, rect.h);
+
172  cmd->color = c;
+
173 }
+
174 NK_API void
+
175 nk_fill_rect_multi_color(struct nk_command_buffer *b, struct nk_rect rect,
+
176  struct nk_color left, struct nk_color top, struct nk_color right,
+
177  struct nk_color bottom)
+
178 {
+
179  struct nk_command_rect_multi_color *cmd;
+
180  NK_ASSERT(b);
+
181  if (!b || rect.w == 0 || rect.h == 0) return;
+
182  if (b->use_clipping) {
+
183  const struct nk_rect *clip = &b->clip;
+
184  if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
+
185  clip->x, clip->y, clip->w, clip->h)) return;
+
186  }
+
187 
+
188  cmd = (struct nk_command_rect_multi_color*)
+
189  nk_command_buffer_push(b, NK_COMMAND_RECT_MULTI_COLOR, sizeof(*cmd));
+
190  if (!cmd) return;
+
191  cmd->x = (short)rect.x;
+
192  cmd->y = (short)rect.y;
+
193  cmd->w = (unsigned short)NK_MAX(0, rect.w);
+
194  cmd->h = (unsigned short)NK_MAX(0, rect.h);
+
195  cmd->left = left;
+
196  cmd->top = top;
+
197  cmd->right = right;
+
198  cmd->bottom = bottom;
+
199 }
+
200 NK_API void
+
201 nk_stroke_circle(struct nk_command_buffer *b, struct nk_rect r,
+
202  float line_thickness, struct nk_color c)
+
203 {
+
204  struct nk_command_circle *cmd;
+
205  if (!b || r.w == 0 || r.h == 0 || line_thickness <= 0) return;
+
206  if (b->use_clipping) {
+
207  const struct nk_rect *clip = &b->clip;
+
208  if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h))
+
209  return;
+
210  }
+
211 
+
212  cmd = (struct nk_command_circle*)
+
213  nk_command_buffer_push(b, NK_COMMAND_CIRCLE, sizeof(*cmd));
+
214  if (!cmd) return;
+
215  cmd->line_thickness = (unsigned short)line_thickness;
+
216  cmd->x = (short)r.x;
+
217  cmd->y = (short)r.y;
+
218  cmd->w = (unsigned short)NK_MAX(r.w, 0);
+
219  cmd->h = (unsigned short)NK_MAX(r.h, 0);
+
220  cmd->color = c;
+
221 }
+
222 NK_API void
+
223 nk_fill_circle(struct nk_command_buffer *b, struct nk_rect r, struct nk_color c)
+
224 {
+
225  struct nk_command_circle_filled *cmd;
+
226  NK_ASSERT(b);
+
227  if (!b || c.a == 0 || r.w == 0 || r.h == 0) return;
+
228  if (b->use_clipping) {
+
229  const struct nk_rect *clip = &b->clip;
+
230  if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h))
+
231  return;
+
232  }
+
233 
+
234  cmd = (struct nk_command_circle_filled*)
+
235  nk_command_buffer_push(b, NK_COMMAND_CIRCLE_FILLED, sizeof(*cmd));
+
236  if (!cmd) return;
+
237  cmd->x = (short)r.x;
+
238  cmd->y = (short)r.y;
+
239  cmd->w = (unsigned short)NK_MAX(r.w, 0);
+
240  cmd->h = (unsigned short)NK_MAX(r.h, 0);
+
241  cmd->color = c;
+
242 }
+
243 NK_API void
+
244 nk_stroke_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
+
245  float a_min, float a_max, float line_thickness, struct nk_color c)
+
246 {
+
247  struct nk_command_arc *cmd;
+
248  if (!b || c.a == 0 || line_thickness <= 0) return;
+
249  cmd = (struct nk_command_arc*)
+
250  nk_command_buffer_push(b, NK_COMMAND_ARC, sizeof(*cmd));
+
251  if (!cmd) return;
+
252  cmd->line_thickness = (unsigned short)line_thickness;
+
253  cmd->cx = (short)cx;
+
254  cmd->cy = (short)cy;
+
255  cmd->r = (unsigned short)radius;
+
256  cmd->a[0] = a_min;
+
257  cmd->a[1] = a_max;
+
258  cmd->color = c;
+
259 }
+
260 NK_API void
+
261 nk_fill_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
+
262  float a_min, float a_max, struct nk_color c)
+
263 {
+
264  struct nk_command_arc_filled *cmd;
+
265  NK_ASSERT(b);
+
266  if (!b || c.a == 0) return;
+
267  cmd = (struct nk_command_arc_filled*)
+
268  nk_command_buffer_push(b, NK_COMMAND_ARC_FILLED, sizeof(*cmd));
+
269  if (!cmd) return;
+
270  cmd->cx = (short)cx;
+
271  cmd->cy = (short)cy;
+
272  cmd->r = (unsigned short)radius;
+
273  cmd->a[0] = a_min;
+
274  cmd->a[1] = a_max;
+
275  cmd->color = c;
+
276 }
+
277 NK_API void
+
278 nk_stroke_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
+
279  float y1, float x2, float y2, float line_thickness, struct nk_color c)
+
280 {
+
281  struct nk_command_triangle *cmd;
+
282  NK_ASSERT(b);
+
283  if (!b || c.a == 0 || line_thickness <= 0) return;
+
284  if (b->use_clipping) {
+
285  const struct nk_rect *clip = &b->clip;
+
286  if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) &&
+
287  !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) &&
+
288  !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h))
+
289  return;
+
290  }
+
291 
+
292  cmd = (struct nk_command_triangle*)
+
293  nk_command_buffer_push(b, NK_COMMAND_TRIANGLE, sizeof(*cmd));
+
294  if (!cmd) return;
+
295  cmd->line_thickness = (unsigned short)line_thickness;
+
296  cmd->a.x = (short)x0;
+
297  cmd->a.y = (short)y0;
+
298  cmd->b.x = (short)x1;
+
299  cmd->b.y = (short)y1;
+
300  cmd->c.x = (short)x2;
+
301  cmd->c.y = (short)y2;
+
302  cmd->color = c;
+
303 }
+
304 NK_API void
+
305 nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
+
306  float y1, float x2, float y2, struct nk_color c)
+
307 {
+
308  struct nk_command_triangle_filled *cmd;
+
309  NK_ASSERT(b);
+
310  if (!b || c.a == 0) return;
+
311  if (!b) return;
+
312  if (b->use_clipping) {
+
313  const struct nk_rect *clip = &b->clip;
+
314  if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) &&
+
315  !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) &&
+
316  !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h))
+
317  return;
+
318  }
+
319 
+
320  cmd = (struct nk_command_triangle_filled*)
+
321  nk_command_buffer_push(b, NK_COMMAND_TRIANGLE_FILLED, sizeof(*cmd));
+
322  if (!cmd) return;
+
323  cmd->a.x = (short)x0;
+
324  cmd->a.y = (short)y0;
+
325  cmd->b.x = (short)x1;
+
326  cmd->b.y = (short)y1;
+
327  cmd->c.x = (short)x2;
+
328  cmd->c.y = (short)y2;
+
329  cmd->color = c;
+
330 }
+
331 NK_API void
+
332 nk_stroke_polygon(struct nk_command_buffer *b, const float *points, int point_count,
+
333  float line_thickness, struct nk_color col)
+
334 {
+
335  int i;
+
336  nk_size size = 0;
+
337  struct nk_command_polygon *cmd;
+
338 
+
339  NK_ASSERT(b);
+
340  if (!b || col.a == 0 || line_thickness <= 0) return;
+
341  size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
+
342  cmd = (struct nk_command_polygon*) nk_command_buffer_push(b, NK_COMMAND_POLYGON, size);
+
343  if (!cmd) return;
+
344  cmd->color = col;
+
345  cmd->line_thickness = (unsigned short)line_thickness;
+
346  cmd->point_count = (unsigned short)point_count;
+
347  for (i = 0; i < point_count; ++i) {
+
348  cmd->points[i].x = (short)points[i*2];
+
349  cmd->points[i].y = (short)points[i*2+1];
+
350  }
+
351 }
+
352 NK_API void
+
353 nk_fill_polygon(struct nk_command_buffer *b, const float *points, int point_count,
+
354  struct nk_color col)
+
355 {
+
356  int i;
+
357  nk_size size = 0;
+
358  struct nk_command_polygon_filled *cmd;
+
359 
+
360  NK_ASSERT(b);
+
361  if (!b || col.a == 0) return;
+
362  size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
+
363  cmd = (struct nk_command_polygon_filled*)
+
364  nk_command_buffer_push(b, NK_COMMAND_POLYGON_FILLED, size);
+
365  if (!cmd) return;
+
366  cmd->color = col;
+
367  cmd->point_count = (unsigned short)point_count;
+
368  for (i = 0; i < point_count; ++i) {
+
369  cmd->points[i].x = (short)points[i*2+0];
+
370  cmd->points[i].y = (short)points[i*2+1];
+
371  }
+
372 }
+
373 NK_API void
+
374 nk_stroke_polyline(struct nk_command_buffer *b, const float *points, int point_count,
+
375  float line_thickness, struct nk_color col)
+
376 {
+
377  int i;
+
378  nk_size size = 0;
+
379  struct nk_command_polyline *cmd;
+
380 
+
381  NK_ASSERT(b);
+
382  if (!b || col.a == 0 || line_thickness <= 0) return;
+
383  size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
+
384  cmd = (struct nk_command_polyline*) nk_command_buffer_push(b, NK_COMMAND_POLYLINE, size);
+
385  if (!cmd) return;
+
386  cmd->color = col;
+
387  cmd->point_count = (unsigned short)point_count;
+
388  cmd->line_thickness = (unsigned short)line_thickness;
+
389  for (i = 0; i < point_count; ++i) {
+
390  cmd->points[i].x = (short)points[i*2];
+
391  cmd->points[i].y = (short)points[i*2+1];
+
392  }
+
393 }
+
394 NK_API void
+ +
396  const struct nk_image *img, struct nk_color col)
+
397 {
+
398  struct nk_command_image *cmd;
+
399  NK_ASSERT(b);
+
400  if (!b) return;
+
401  if (b->use_clipping) {
+
402  const struct nk_rect *c = &b->clip;
+
403  if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
+
404  return;
+
405  }
+
406 
+
407  cmd = (struct nk_command_image*)
+
408  nk_command_buffer_push(b, NK_COMMAND_IMAGE, sizeof(*cmd));
+
409  if (!cmd) return;
+
410  cmd->x = (short)r.x;
+
411  cmd->y = (short)r.y;
+
412  cmd->w = (unsigned short)NK_MAX(0, r.w);
+
413  cmd->h = (unsigned short)NK_MAX(0, r.h);
+
414  cmd->img = *img;
+
415  cmd->col = col;
+
416 }
+
417 NK_API void
+
418 nk_draw_nine_slice(struct nk_command_buffer *b, struct nk_rect r,
+
419  const struct nk_nine_slice *slc, struct nk_color col)
+
420 {
+
421  struct nk_image img;
+
422  const struct nk_image *slcimg = (const struct nk_image*)slc;
+
423  nk_ushort rgnX, rgnY, rgnW, rgnH;
+
424  rgnX = slcimg->region[0];
+
425  rgnY = slcimg->region[1];
+
426  rgnW = slcimg->region[2];
+
427  rgnH = slcimg->region[3];
+
428 
+
429  /* top-left */
+
430  img.handle = slcimg->handle;
+
431  img.w = slcimg->w;
+
432  img.h = slcimg->h;
+
433  img.region[0] = rgnX;
+
434  img.region[1] = rgnY;
+
435  img.region[2] = slc->l;
+
436  img.region[3] = slc->t;
+
437 
+
438  nk_draw_image(b,
+
439  nk_rect(r.x, r.y, (float)slc->l, (float)slc->t),
+
440  &img, col);
+
441 
+
442 #define IMG_RGN(x, y, w, h) img.region[0] = (nk_ushort)(x); img.region[1] = (nk_ushort)(y); img.region[2] = (nk_ushort)(w); img.region[3] = (nk_ushort)(h);
+
443 
+
444  /* top-center */
+
445  IMG_RGN(rgnX + slc->l, rgnY, rgnW - slc->l - slc->r, slc->t);
+
446  nk_draw_image(b,
+
447  nk_rect(r.x + (float)slc->l, r.y, (float)(r.w - slc->l - slc->r), (float)slc->t),
+
448  &img, col);
+
449 
+
450  /* top-right */
+
451  IMG_RGN(rgnX + rgnW - slc->r, rgnY, slc->r, slc->t);
+
452  nk_draw_image(b,
+
453  nk_rect(r.x + r.w - (float)slc->r, r.y, (float)slc->r, (float)slc->t),
+
454  &img, col);
+
455 
+
456  /* center-left */
+
457  IMG_RGN(rgnX, rgnY + slc->t, slc->l, rgnH - slc->t - slc->b);
+
458  nk_draw_image(b,
+
459  nk_rect(r.x, r.y + (float)slc->t, (float)slc->l, (float)(r.h - slc->t - slc->b)),
+
460  &img, col);
+
461 
+
462  /* center */
+
463  IMG_RGN(rgnX + slc->l, rgnY + slc->t, rgnW - slc->l - slc->r, rgnH - slc->t - slc->b);
+
464  nk_draw_image(b,
+
465  nk_rect(r.x + (float)slc->l, r.y + (float)slc->t, (float)(r.w - slc->l - slc->r), (float)(r.h - slc->t - slc->b)),
+
466  &img, col);
+
467 
+
468  /* center-right */
+
469  IMG_RGN(rgnX + rgnW - slc->r, rgnY + slc->t, slc->r, rgnH - slc->t - slc->b);
+
470  nk_draw_image(b,
+
471  nk_rect(r.x + r.w - (float)slc->r, r.y + (float)slc->t, (float)slc->r, (float)(r.h - slc->t - slc->b)),
+
472  &img, col);
+
473 
+
474  /* bottom-left */
+
475  IMG_RGN(rgnX, rgnY + rgnH - slc->b, slc->l, slc->b);
+
476  nk_draw_image(b,
+
477  nk_rect(r.x, r.y + r.h - (float)slc->b, (float)slc->l, (float)slc->b),
+
478  &img, col);
+
479 
+
480  /* bottom-center */
+
481  IMG_RGN(rgnX + slc->l, rgnY + rgnH - slc->b, rgnW - slc->l - slc->r, slc->b);
+
482  nk_draw_image(b,
+
483  nk_rect(r.x + (float)slc->l, r.y + r.h - (float)slc->b, (float)(r.w - slc->l - slc->r), (float)slc->b),
+
484  &img, col);
+
485 
+
486  /* bottom-right */
+
487  IMG_RGN(rgnX + rgnW - slc->r, rgnY + rgnH - slc->b, slc->r, slc->b);
+
488  nk_draw_image(b,
+
489  nk_rect(r.x + r.w - (float)slc->r, r.y + r.h - (float)slc->b, (float)slc->r, (float)slc->b),
+
490  &img, col);
+
491 
+
492 #undef IMG_RGN
+
493 }
+
494 NK_API void
+
495 nk_push_custom(struct nk_command_buffer *b, struct nk_rect r,
+
496  nk_command_custom_callback cb, nk_handle usr)
+
497 {
+
498  struct nk_command_custom *cmd;
+
499  NK_ASSERT(b);
+
500  if (!b) return;
+
501  if (b->use_clipping) {
+
502  const struct nk_rect *c = &b->clip;
+
503  if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
+
504  return;
+
505  }
+
506 
+
507  cmd = (struct nk_command_custom*)
+
508  nk_command_buffer_push(b, NK_COMMAND_CUSTOM, sizeof(*cmd));
+
509  if (!cmd) return;
+
510  cmd->x = (short)r.x;
+
511  cmd->y = (short)r.y;
+
512  cmd->w = (unsigned short)NK_MAX(0, r.w);
+
513  cmd->h = (unsigned short)NK_MAX(0, r.h);
+
514  cmd->callback_data = usr;
+
515  cmd->callback = cb;
+
516 }
+
517 NK_API void
+
518 nk_draw_text(struct nk_command_buffer *b, struct nk_rect r,
+
519  const char *string, int length, const struct nk_user_font *font,
+
520  struct nk_color bg, struct nk_color fg)
+
521 {
+
522  float text_width = 0;
+
523  struct nk_command_text *cmd;
+
524 
+
525  NK_ASSERT(b);
+
526  NK_ASSERT(font);
+
527  if (!b || !string || !length || (bg.a == 0 && fg.a == 0)) return;
+
528  if (b->use_clipping) {
+
529  const struct nk_rect *c = &b->clip;
+
530  if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
+
531  return;
+
532  }
+
533 
+
534  /* make sure text fits inside bounds */
+
535  text_width = font->width(font->userdata, font->height, string, length);
+
536  if (text_width > r.w){
+
537  int glyphs = 0;
+
538  float txt_width = (float)text_width;
+
539  length = nk_text_clamp(font, string, length, r.w, &glyphs, &txt_width, 0,0);
+
540  }
+
541 
+
542  if (!length) return;
+
543  cmd = (struct nk_command_text*)
+
544  nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1));
+
545  if (!cmd) return;
+
546  cmd->x = (short)r.x;
+
547  cmd->y = (short)r.y;
+
548  cmd->w = (unsigned short)r.w;
+
549  cmd->h = (unsigned short)r.h;
+
550  cmd->background = bg;
+
551  cmd->foreground = fg;
+
552  cmd->font = font;
+
553  cmd->length = length;
+
554  cmd->height = font->height;
+
555  NK_MEMCPY(cmd->string, string, (nk_size)length);
+
556  cmd->string[length] = '\0';
+
557 }
+
main API and documentation file
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
Definition: nuklear_draw.c:89
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+ +
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+ + + + + + + + + + + + + + + + + + + + +
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ +
+
+ + + + diff --git a/nuklear__edit_8c_source.html b/nuklear__edit_8c_source.html new file mode 100644 index 000000000..60035e146 --- /dev/null +++ b/nuklear__edit_8c_source.html @@ -0,0 +1,973 @@ + + + + + + + +Nuklear: src/nuklear_edit.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_edit.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * FILTER
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_filter_default(const struct nk_text_edit *box, nk_rune unicode)
+
11 {
+
12  NK_UNUSED(unicode);
+
13  NK_UNUSED(box);
+
14  return nk_true;
+
15 }
+
16 NK_API nk_bool
+
17 nk_filter_ascii(const struct nk_text_edit *box, nk_rune unicode)
+
18 {
+
19  NK_UNUSED(box);
+
20  if (unicode > 128) return nk_false;
+
21  else return nk_true;
+
22 }
+
23 NK_API nk_bool
+
24 nk_filter_float(const struct nk_text_edit *box, nk_rune unicode)
+
25 {
+
26  NK_UNUSED(box);
+
27  if ((unicode < '0' || unicode > '9') && unicode != '.' && unicode != '-')
+
28  return nk_false;
+
29  else return nk_true;
+
30 }
+
31 NK_API nk_bool
+
32 nk_filter_decimal(const struct nk_text_edit *box, nk_rune unicode)
+
33 {
+
34  NK_UNUSED(box);
+
35  if ((unicode < '0' || unicode > '9') && unicode != '-')
+
36  return nk_false;
+
37  else return nk_true;
+
38 }
+
39 NK_API nk_bool
+
40 nk_filter_hex(const struct nk_text_edit *box, nk_rune unicode)
+
41 {
+
42  NK_UNUSED(box);
+
43  if ((unicode < '0' || unicode > '9') &&
+
44  (unicode < 'a' || unicode > 'f') &&
+
45  (unicode < 'A' || unicode > 'F'))
+
46  return nk_false;
+
47  else return nk_true;
+
48 }
+
49 NK_API nk_bool
+
50 nk_filter_oct(const struct nk_text_edit *box, nk_rune unicode)
+
51 {
+
52  NK_UNUSED(box);
+
53  if (unicode < '0' || unicode > '7')
+
54  return nk_false;
+
55  else return nk_true;
+
56 }
+
57 NK_API nk_bool
+
58 nk_filter_binary(const struct nk_text_edit *box, nk_rune unicode)
+
59 {
+
60  NK_UNUSED(box);
+
61  if (unicode != '0' && unicode != '1')
+
62  return nk_false;
+
63  else return nk_true;
+
64 }
+
65 
+
66 /* ===============================================================
+
67  *
+
68  * EDIT
+
69  *
+
70  * ===============================================================*/
+
71 NK_LIB void
+
72 nk_edit_draw_text(struct nk_command_buffer *out,
+
73  const struct nk_style_edit *style, float pos_x, float pos_y,
+
74  float x_offset, const char *text, int byte_len, float row_height,
+
75  const struct nk_user_font *font, struct nk_color background,
+
76  struct nk_color foreground, nk_bool is_selected)
+
77 {
+
78  NK_ASSERT(out);
+
79  NK_ASSERT(font);
+
80  NK_ASSERT(style);
+
81  if (!text || !byte_len || !out || !style) return;
+
82 
+
83  {int glyph_len = 0;
+
84  nk_rune unicode = 0;
+
85  int text_len = 0;
+
86  float line_width = 0;
+
87  float glyph_width;
+
88  const char *line = text;
+
89  float line_offset = 0;
+
90  int line_count = 0;
+
91 
+
92  struct nk_text txt;
+
93  txt.padding = nk_vec2(0,0);
+
94  txt.background = background;
+
95  txt.text = foreground;
+
96 
+
97  foreground = nk_rgb_factor(foreground, style->color_factor);
+
98  background = nk_rgb_factor(background, style->color_factor);
+
99 
+
100  glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
+
101  if (!glyph_len) return;
+
102  while ((text_len < byte_len) && glyph_len)
+
103  {
+
104  if (unicode == '\n') {
+
105  /* new line separator so draw previous line */
+
106  struct nk_rect label;
+
107  label.y = pos_y + line_offset;
+
108  label.h = row_height;
+
109  label.w = line_width;
+
110  label.x = pos_x;
+
111  if (!line_count)
+
112  label.x += x_offset;
+
113 
+
114  if (is_selected) /* selection needs to draw different background color */
+
115  nk_fill_rect(out, label, 0, background);
+
116  nk_widget_text(out, label, line, (int)((text + text_len) - line),
+
117  &txt, NK_TEXT_CENTERED, font);
+
118 
+
119  text_len++;
+
120  line_count++;
+
121  line_width = 0;
+
122  line = text + text_len;
+
123  line_offset += row_height;
+
124  glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
+
125  continue;
+
126  }
+
127  if (unicode == '\r') {
+
128  text_len++;
+
129  glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
+
130  continue;
+
131  }
+
132  glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
+
133  line_width += (float)glyph_width;
+
134  text_len += glyph_len;
+
135  glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
+
136  continue;
+
137  }
+
138  if (line_width > 0) {
+
139  /* draw last line */
+
140  struct nk_rect label;
+
141  label.y = pos_y + line_offset;
+
142  label.h = row_height;
+
143  label.w = line_width;
+
144  label.x = pos_x;
+
145  if (!line_count)
+
146  label.x += x_offset;
+
147 
+
148  if (is_selected)
+
149  nk_fill_rect(out, label, 0, background);
+
150  nk_widget_text(out, label, line, (int)((text + text_len) - line),
+
151  &txt, NK_TEXT_LEFT, font);
+
152  }}
+
153 }
+
154 NK_LIB nk_flags
+
155 nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
+
156  struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter,
+
157  struct nk_text_edit *edit, const struct nk_style_edit *style,
+
158  struct nk_input *in, const struct nk_user_font *font)
+
159 {
+
160  struct nk_rect area;
+
161  nk_flags ret = 0;
+
162  float row_height;
+
163  char prev_state = 0;
+
164  char is_hovered = 0;
+
165  char select_all = 0;
+
166  char cursor_follow = 0;
+
167  struct nk_rect old_clip;
+
168  struct nk_rect clip;
+
169 
+
170  NK_ASSERT(state);
+
171  NK_ASSERT(out);
+
172  NK_ASSERT(style);
+
173  if (!state || !out || !style)
+
174  return ret;
+
175 
+
176  /* visible text area calculation */
+
177  area.x = bounds.x + style->padding.x + style->border;
+
178  area.y = bounds.y + style->padding.y + style->border;
+
179  area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
+
180  area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
+
181  if (flags & NK_EDIT_MULTILINE)
+
182  area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
+
183  row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;
+
184 
+
185  /* calculate clipping rectangle */
+
186  old_clip = out->clip;
+
187  nk_unify(&clip, &old_clip, area.x, area.y, area.x + area.w, area.y + area.h);
+
188 
+
189  /* update edit state */
+
190  prev_state = (char)edit->active;
+
191  is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds);
+
192  if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) {
+
193  edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y,
+
194  bounds.x, bounds.y, bounds.w, bounds.h);
+
195  }
+
196 
+
197  /* (de)activate text editor */
+
198  if (!prev_state && edit->active) {
+
199  const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
+
200  NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
+
201  /* keep scroll position when re-activating edit widget */
+
202  struct nk_vec2 oldscrollbar = edit->scrollbar;
+
203  nk_textedit_clear_state(edit, type, filter);
+
204  edit->scrollbar = oldscrollbar;
+
205  if (flags & NK_EDIT_AUTO_SELECT)
+
206  select_all = nk_true;
+
207  if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
+
208  edit->cursor = edit->string.len;
+
209  in = 0;
+
210  }
+
211  } else if (!edit->active) edit->mode = NK_TEXT_EDIT_MODE_VIEW;
+
212  if (flags & NK_EDIT_READ_ONLY)
+
213  edit->mode = NK_TEXT_EDIT_MODE_VIEW;
+
214  else if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
+
215  edit->mode = NK_TEXT_EDIT_MODE_INSERT;
+
216 
+
217  ret = (edit->active) ? NK_EDIT_ACTIVE: NK_EDIT_INACTIVE;
+
218  if (prev_state != edit->active)
+
219  ret |= (edit->active) ? NK_EDIT_ACTIVATED: NK_EDIT_DEACTIVATED;
+
220 
+
221  /* handle user input */
+
222  if (edit->active && in)
+
223  {
+
224  int shift_mod = in->keyboard.keys[NK_KEY_SHIFT].down;
+
225  const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x;
+
226  const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y;
+
227 
+
228  /* mouse click handler */
+
229  is_hovered = (char)nk_input_is_mouse_hovering_rect(in, area);
+
230  if (select_all) {
+
231  nk_textedit_select_all(edit);
+
232  } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
+
233  in->mouse.buttons[NK_BUTTON_LEFT].clicked) {
+
234  nk_textedit_click(edit, mouse_x, mouse_y, font, row_height);
+
235  } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
+
236  (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) {
+
237  nk_textedit_drag(edit, mouse_x, mouse_y, font, row_height);
+
238  cursor_follow = nk_true;
+
239  } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked &&
+
240  in->mouse.buttons[NK_BUTTON_RIGHT].down) {
+
241  nk_textedit_key(edit, NK_KEY_TEXT_WORD_LEFT, nk_false, font, row_height);
+
242  nk_textedit_key(edit, NK_KEY_TEXT_WORD_RIGHT, nk_true, font, row_height);
+
243  cursor_follow = nk_true;
+
244  }
+
245 
+
246  {int i; /* keyboard input */
+
247  int old_mode = edit->mode;
+
248  for (i = 0; i < NK_KEY_MAX; ++i) {
+
249  if (i == NK_KEY_ENTER || i == NK_KEY_TAB) continue; /* special case */
+
250  if (nk_input_is_key_pressed(in, (enum nk_keys)i)) {
+
251  nk_textedit_key(edit, (enum nk_keys)i, shift_mod, font, row_height);
+
252  cursor_follow = nk_true;
+
253  }
+
254  }
+
255  if (old_mode != edit->mode) {
+
256  in->keyboard.text_len = 0;
+
257  }}
+
258 
+
259  /* text input */
+
260  edit->filter = filter;
+
261  if (in->keyboard.text_len) {
+
262  nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len);
+
263  cursor_follow = nk_true;
+
264  in->keyboard.text_len = 0;
+
265  }
+
266 
+
267  /* enter key handler */
+
268  if (nk_input_is_key_pressed(in, NK_KEY_ENTER)) {
+
269  cursor_follow = nk_true;
+
270  if (flags & NK_EDIT_CTRL_ENTER_NEWLINE && shift_mod)
+
271  nk_textedit_text(edit, "\n", 1);
+
272  else if (flags & NK_EDIT_SIG_ENTER)
+
273  ret |= NK_EDIT_COMMITED;
+
274  else nk_textedit_text(edit, "\n", 1);
+
275  }
+
276 
+
277  /* cut & copy handler */
+
278  {int copy= nk_input_is_key_pressed(in, NK_KEY_COPY);
+
279  int cut = nk_input_is_key_pressed(in, NK_KEY_CUT);
+
280  if ((copy || cut) && (flags & NK_EDIT_CLIPBOARD))
+
281  {
+
282  int glyph_len;
+
283  nk_rune unicode;
+
284  const char *text;
+
285  int b = edit->select_start;
+
286  int e = edit->select_end;
+
287 
+
288  int begin = NK_MIN(b, e);
+
289  int end = NK_MAX(b, e);
+
290  text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len);
+
291  if (edit->clip.copy)
+
292  edit->clip.copy(edit->clip.userdata, text, end - begin);
+
293  if (cut && !(flags & NK_EDIT_READ_ONLY)){
+
294  nk_textedit_cut(edit);
+
295  cursor_follow = nk_true;
+
296  }
+
297  }}
+
298 
+
299  /* paste handler */
+
300  {int paste = nk_input_is_key_pressed(in, NK_KEY_PASTE);
+
301  if (paste && (flags & NK_EDIT_CLIPBOARD) && edit->clip.paste) {
+
302  edit->clip.paste(edit->clip.userdata, edit);
+
303  cursor_follow = nk_true;
+
304  }}
+
305 
+
306  /* tab handler */
+
307  {int tab = nk_input_is_key_pressed(in, NK_KEY_TAB);
+
308  if (tab && (flags & NK_EDIT_ALLOW_TAB)) {
+
309  nk_textedit_text(edit, " ", 4);
+
310  cursor_follow = nk_true;
+
311  }}
+
312  }
+
313 
+
314  /* set widget state */
+
315  if (edit->active)
+
316  *state = NK_WIDGET_STATE_ACTIVE;
+
317  else nk_widget_state_reset(state);
+
318 
+
319  if (is_hovered)
+
320  *state |= NK_WIDGET_STATE_HOVERED;
+
321 
+
322  /* DRAW EDIT */
+
323  {const char *text = nk_str_get_const(&edit->string);
+
324  int len = nk_str_len_char(&edit->string);
+
325 
+
326  {/* select background colors/images */
+
327  const struct nk_style_item *background;
+
328  if (*state & NK_WIDGET_STATE_ACTIVED)
+
329  background = &style->active;
+
330  else if (*state & NK_WIDGET_STATE_HOVER)
+
331  background = &style->hover;
+
332  else background = &style->normal;
+
333 
+
334  /* draw background frame */
+
335  switch(background->type) {
+
336  case NK_STYLE_ITEM_IMAGE:
+
337  nk_draw_image(out, bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
338  break;
+
339  case NK_STYLE_ITEM_NINE_SLICE:
+
340  nk_draw_nine_slice(out, bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
341  break;
+
342  case NK_STYLE_ITEM_COLOR:
+
343  nk_fill_rect(out, bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor));
+
344  nk_stroke_rect(out, bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor));
+
345  break;
+
346  }}
+
347 
+
348 
+
349  area.w = NK_MAX(0, area.w - style->cursor_size);
+
350  if (edit->active)
+
351  {
+
352  int total_lines = 1;
+
353  struct nk_vec2 text_size = nk_vec2(0,0);
+
354 
+
355  /* text pointer positions */
+
356  const char *cursor_ptr = 0;
+
357  const char *select_begin_ptr = 0;
+
358  const char *select_end_ptr = 0;
+
359 
+
360  /* 2D pixel positions */
+
361  struct nk_vec2 cursor_pos = nk_vec2(0,0);
+
362  struct nk_vec2 selection_offset_start = nk_vec2(0,0);
+
363  struct nk_vec2 selection_offset_end = nk_vec2(0,0);
+
364 
+
365  int selection_begin = NK_MIN(edit->select_start, edit->select_end);
+
366  int selection_end = NK_MAX(edit->select_start, edit->select_end);
+
367 
+
368  /* calculate total line count + total space + cursor/selection position */
+
369  float line_width = 0.0f;
+
370  if (text && len)
+
371  {
+
372  /* utf8 encoding */
+
373  float glyph_width;
+
374  int glyph_len = 0;
+
375  nk_rune unicode = 0;
+
376  int text_len = 0;
+
377  int glyphs = 0;
+
378  int row_begin = 0;
+
379 
+
380  glyph_len = nk_utf_decode(text, &unicode, len);
+
381  glyph_width = font->width(font->userdata, font->height, text, glyph_len);
+
382  line_width = 0;
+
383 
+
384  /* iterate all lines */
+
385  while ((text_len < len) && glyph_len)
+
386  {
+
387  /* set cursor 2D position and line */
+
388  if (!cursor_ptr && glyphs == edit->cursor)
+
389  {
+
390  int glyph_offset;
+
391  struct nk_vec2 out_offset;
+
392  struct nk_vec2 row_size;
+
393  const char *remaining;
+
394 
+
395  /* calculate 2d position */
+
396  cursor_pos.y = (float)(total_lines-1) * row_height;
+
397  row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+
398  text_len-row_begin, row_height, &remaining,
+
399  &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+
400  cursor_pos.x = row_size.x;
+
401  cursor_ptr = text + text_len;
+
402  }
+
403 
+
404  /* set start selection 2D position and line */
+
405  if (!select_begin_ptr && edit->select_start != edit->select_end &&
+
406  glyphs == selection_begin)
+
407  {
+
408  int glyph_offset;
+
409  struct nk_vec2 out_offset;
+
410  struct nk_vec2 row_size;
+
411  const char *remaining;
+
412 
+
413  /* calculate 2d position */
+
414  selection_offset_start.y = (float)(NK_MAX(total_lines-1,0)) * row_height;
+
415  row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+
416  text_len-row_begin, row_height, &remaining,
+
417  &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+
418  selection_offset_start.x = row_size.x;
+
419  select_begin_ptr = text + text_len;
+
420  }
+
421 
+
422  /* set end selection 2D position and line */
+
423  if (!select_end_ptr && edit->select_start != edit->select_end &&
+
424  glyphs == selection_end)
+
425  {
+
426  int glyph_offset;
+
427  struct nk_vec2 out_offset;
+
428  struct nk_vec2 row_size;
+
429  const char *remaining;
+
430 
+
431  /* calculate 2d position */
+
432  selection_offset_end.y = (float)(total_lines-1) * row_height;
+
433  row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+
434  text_len-row_begin, row_height, &remaining,
+
435  &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+
436  selection_offset_end.x = row_size.x;
+
437  select_end_ptr = text + text_len;
+
438  }
+
439  if (unicode == '\n') {
+
440  text_size.x = NK_MAX(text_size.x, line_width);
+
441  total_lines++;
+
442  line_width = 0;
+
443  text_len++;
+
444  glyphs++;
+
445  row_begin = text_len;
+
446  glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
+
447  glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
+
448  continue;
+
449  }
+
450 
+
451  glyphs++;
+
452  text_len += glyph_len;
+
453  line_width += (float)glyph_width;
+
454 
+
455  glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
+
456  glyph_width = font->width(font->userdata, font->height,
+
457  text+text_len, glyph_len);
+
458  continue;
+
459  }
+
460  text_size.y = (float)total_lines * row_height;
+
461 
+
462  /* handle case when cursor is at end of text buffer */
+
463  if (!cursor_ptr && edit->cursor == edit->string.len) {
+
464  cursor_pos.x = line_width;
+
465  cursor_pos.y = text_size.y - row_height;
+
466  }
+
467  }
+
468  {
+
469  /* scrollbar */
+
470  if (cursor_follow)
+
471  {
+
472  /* update scrollbar to follow cursor */
+
473  if (!(flags & NK_EDIT_NO_HORIZONTAL_SCROLL)) {
+
474  /* horizontal scroll */
+
475  const float scroll_increment = area.w * 0.25f;
+
476  if (cursor_pos.x < edit->scrollbar.x)
+
477  edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment);
+
478  if (cursor_pos.x >= edit->scrollbar.x + area.w)
+
479  edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - area.w + scroll_increment);
+
480  } else edit->scrollbar.x = 0;
+
481 
+
482  if (flags & NK_EDIT_MULTILINE) {
+
483  /* vertical scroll */
+
484  if (cursor_pos.y < edit->scrollbar.y)
+
485  edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height);
+
486  if (cursor_pos.y >= edit->scrollbar.y + row_height)
+
487  edit->scrollbar.y = edit->scrollbar.y + row_height;
+
488  } else edit->scrollbar.y = 0;
+
489  }
+
490 
+
491  /* scrollbar widget */
+
492  if (flags & NK_EDIT_MULTILINE)
+
493  {
+
494  nk_flags ws;
+
495  struct nk_rect scroll;
+
496  float scroll_target;
+
497  float scroll_offset;
+
498  float scroll_step;
+
499  float scroll_inc;
+
500 
+
501  scroll = area;
+
502  scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
+
503  scroll.w = style->scrollbar_size.x;
+
504 
+
505  scroll_offset = edit->scrollbar.y;
+
506  scroll_step = scroll.h * 0.10f;
+
507  scroll_inc = scroll.h * 0.01f;
+
508  scroll_target = text_size.y;
+
509  edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0,
+
510  scroll_offset, scroll_target, scroll_step, scroll_inc,
+
511  &style->scrollbar, in, font);
+
512  }
+
513  }
+
514 
+
515  /* draw text */
+
516  {struct nk_color background_color;
+
517  struct nk_color text_color;
+
518  struct nk_color sel_background_color;
+
519  struct nk_color sel_text_color;
+
520  struct nk_color cursor_color;
+
521  struct nk_color cursor_text_color;
+
522  const struct nk_style_item *background;
+
523  nk_push_scissor(out, clip);
+
524 
+
525  /* select correct colors to draw */
+
526  if (*state & NK_WIDGET_STATE_ACTIVED) {
+
527  background = &style->active;
+
528  text_color = style->text_active;
+
529  sel_text_color = style->selected_text_hover;
+
530  sel_background_color = style->selected_hover;
+
531  cursor_color = style->cursor_hover;
+
532  cursor_text_color = style->cursor_text_hover;
+
533  } else if (*state & NK_WIDGET_STATE_HOVER) {
+
534  background = &style->hover;
+
535  text_color = style->text_hover;
+
536  sel_text_color = style->selected_text_hover;
+
537  sel_background_color = style->selected_hover;
+
538  cursor_text_color = style->cursor_text_hover;
+
539  cursor_color = style->cursor_hover;
+
540  } else {
+
541  background = &style->normal;
+
542  text_color = style->text_normal;
+
543  sel_text_color = style->selected_text_normal;
+
544  sel_background_color = style->selected_normal;
+
545  cursor_color = style->cursor_normal;
+
546  cursor_text_color = style->cursor_text_normal;
+
547  }
+
548  if (background->type == NK_STYLE_ITEM_IMAGE)
+
549  background_color = nk_rgba(0,0,0,0);
+
550  else
+
551  background_color = background->data.color;
+
552 
+
553  cursor_color = nk_rgb_factor(cursor_color, style->color_factor);
+
554  cursor_text_color = nk_rgb_factor(cursor_text_color, style->color_factor);
+
555 
+
556  if (edit->select_start == edit->select_end) {
+
557  /* no selection so just draw the complete text */
+
558  const char *begin = nk_str_get_const(&edit->string);
+
559  int l = nk_str_len_char(&edit->string);
+
560  nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+
561  area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
+
562  background_color, text_color, nk_false);
+
563  } else {
+
564  /* edit has selection so draw 1-3 text chunks */
+
565  if (edit->select_start != edit->select_end && selection_begin > 0){
+
566  /* draw unselected text before selection */
+
567  const char *begin = nk_str_get_const(&edit->string);
+
568  NK_ASSERT(select_begin_ptr);
+
569  nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+
570  area.y - edit->scrollbar.y, 0, begin, (int)(select_begin_ptr - begin),
+
571  row_height, font, background_color, text_color, nk_false);
+
572  }
+
573  if (edit->select_start != edit->select_end) {
+
574  /* draw selected text */
+
575  NK_ASSERT(select_begin_ptr);
+
576  if (!select_end_ptr) {
+
577  const char *begin = nk_str_get_const(&edit->string);
+
578  select_end_ptr = begin + nk_str_len_char(&edit->string);
+
579  }
+
580  nk_edit_draw_text(out, style,
+
581  area.x - edit->scrollbar.x,
+
582  area.y + selection_offset_start.y - edit->scrollbar.y,
+
583  selection_offset_start.x,
+
584  select_begin_ptr, (int)(select_end_ptr - select_begin_ptr),
+
585  row_height, font, sel_background_color, sel_text_color, nk_true);
+
586  }
+
587  if ((edit->select_start != edit->select_end &&
+
588  selection_end < edit->string.len))
+
589  {
+
590  /* draw unselected text after selected text */
+
591  const char *begin = select_end_ptr;
+
592  const char *end = nk_str_get_const(&edit->string) +
+
593  nk_str_len_char(&edit->string);
+
594  NK_ASSERT(select_end_ptr);
+
595  nk_edit_draw_text(out, style,
+
596  area.x - edit->scrollbar.x,
+
597  area.y + selection_offset_end.y - edit->scrollbar.y,
+
598  selection_offset_end.x,
+
599  begin, (int)(end - begin), row_height, font,
+
600  background_color, text_color, nk_true);
+
601  }
+
602  }
+
603 
+
604  /* cursor */
+
605  if (edit->select_start == edit->select_end)
+
606  {
+
607  if (edit->cursor >= nk_str_len(&edit->string) ||
+
608  (cursor_ptr && *cursor_ptr == '\n')) {
+
609  /* draw cursor at end of line */
+
610  struct nk_rect cursor;
+
611  cursor.w = style->cursor_size;
+
612  cursor.h = font->height;
+
613  cursor.x = area.x + cursor_pos.x - edit->scrollbar.x;
+
614  cursor.y = area.y + cursor_pos.y + row_height/2.0f - cursor.h/2.0f;
+
615  cursor.y -= edit->scrollbar.y;
+
616  nk_fill_rect(out, cursor, 0, cursor_color);
+
617  } else {
+
618  /* draw cursor inside text */
+
619  int glyph_len;
+
620  struct nk_rect label;
+
621  struct nk_text txt;
+
622 
+
623  nk_rune unicode;
+
624  NK_ASSERT(cursor_ptr);
+
625  glyph_len = nk_utf_decode(cursor_ptr, &unicode, 4);
+
626 
+
627  label.x = area.x + cursor_pos.x - edit->scrollbar.x;
+
628  label.y = area.y + cursor_pos.y - edit->scrollbar.y;
+
629  label.w = font->width(font->userdata, font->height, cursor_ptr, glyph_len);
+
630  label.h = row_height;
+
631 
+
632  txt.padding = nk_vec2(0,0);
+
633  txt.background = cursor_color;;
+
634  txt.text = cursor_text_color;
+
635  nk_fill_rect(out, label, 0, cursor_color);
+
636  nk_widget_text(out, label, cursor_ptr, glyph_len, &txt, NK_TEXT_LEFT, font);
+
637  }
+
638  }}
+
639  } else {
+
640  /* not active so just draw text */
+
641  int l = nk_str_len_char(&edit->string);
+
642  const char *begin = nk_str_get_const(&edit->string);
+
643 
+
644  const struct nk_style_item *background;
+
645  struct nk_color background_color;
+
646  struct nk_color text_color;
+
647  nk_push_scissor(out, clip);
+
648  if (*state & NK_WIDGET_STATE_ACTIVED) {
+
649  background = &style->active;
+
650  text_color = style->text_active;
+
651  } else if (*state & NK_WIDGET_STATE_HOVER) {
+
652  background = &style->hover;
+
653  text_color = style->text_hover;
+
654  } else {
+
655  background = &style->normal;
+
656  text_color = style->text_normal;
+
657  }
+
658  if (background->type == NK_STYLE_ITEM_IMAGE)
+
659  background_color = nk_rgba(0,0,0,0);
+
660  else
+
661  background_color = background->data.color;
+
662 
+
663  background_color = nk_rgb_factor(background_color, style->color_factor);
+
664  text_color = nk_rgb_factor(text_color, style->color_factor);
+
665 
+
666  nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+
667  area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
+
668  background_color, text_color, nk_false);
+
669  }
+
670  nk_push_scissor(out, old_clip);}
+
671  return ret;
+
672 }
+
673 NK_API void
+
674 nk_edit_focus(struct nk_context *ctx, nk_flags flags)
+
675 {
+
676  nk_hash hash;
+
677  struct nk_window *win;
+
678 
+
679  NK_ASSERT(ctx);
+
680  NK_ASSERT(ctx->current);
+
681  if (!ctx || !ctx->current) return;
+
682 
+
683  win = ctx->current;
+
684  hash = win->edit.seq;
+
685  win->edit.active = nk_true;
+
686  win->edit.name = hash;
+
687  if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
+
688  win->edit.mode = NK_TEXT_EDIT_MODE_INSERT;
+
689 }
+
690 NK_API void
+
691 nk_edit_unfocus(struct nk_context *ctx)
+
692 {
+
693  struct nk_window *win;
+
694  NK_ASSERT(ctx);
+
695  NK_ASSERT(ctx->current);
+
696  if (!ctx || !ctx->current) return;
+
697 
+
698  win = ctx->current;
+
699  win->edit.active = nk_false;
+
700  win->edit.name = 0;
+
701 }
+
702 NK_API nk_flags
+
703 nk_edit_string(struct nk_context *ctx, nk_flags flags,
+
704  char *memory, int *len, int max, nk_plugin_filter filter)
+
705 {
+
706  nk_hash hash;
+
707  nk_flags state;
+
708  struct nk_text_edit *edit;
+
709  struct nk_window *win;
+
710 
+
711  NK_ASSERT(ctx);
+
712  NK_ASSERT(memory);
+
713  NK_ASSERT(len);
+
714  if (!ctx || !memory || !len)
+
715  return 0;
+
716 
+
717  filter = (!filter) ? nk_filter_default: filter;
+
718  win = ctx->current;
+
719  hash = win->edit.seq;
+
720  edit = &ctx->text_edit;
+
721  nk_textedit_clear_state(&ctx->text_edit, (flags & NK_EDIT_MULTILINE)?
+
722  NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE, filter);
+
723 
+
724  if (win->edit.active && hash == win->edit.name) {
+
725  if (flags & NK_EDIT_NO_CURSOR)
+
726  edit->cursor = nk_utf_len(memory, *len);
+
727  else edit->cursor = win->edit.cursor;
+
728  if (!(flags & NK_EDIT_SELECTABLE)) {
+
729  edit->select_start = win->edit.cursor;
+
730  edit->select_end = win->edit.cursor;
+
731  } else {
+
732  edit->select_start = win->edit.sel_start;
+
733  edit->select_end = win->edit.sel_end;
+
734  }
+
735  edit->mode = win->edit.mode;
+
736  edit->scrollbar.x = (float)win->edit.scrollbar.x;
+
737  edit->scrollbar.y = (float)win->edit.scrollbar.y;
+
738  edit->active = nk_true;
+
739  } else edit->active = nk_false;
+
740 
+
741  max = NK_MAX(1, max);
+
742  *len = NK_MIN(*len, max-1);
+
743  nk_str_init_fixed(&edit->string, memory, (nk_size)max);
+
744  edit->string.buffer.allocated = (nk_size)*len;
+
745  edit->string.len = nk_utf_len(memory, *len);
+
746  state = nk_edit_buffer(ctx, flags, edit, filter);
+
747  *len = (int)edit->string.buffer.allocated;
+
748 
+
749  if (edit->active) {
+
750  win->edit.cursor = edit->cursor;
+
751  win->edit.sel_start = edit->select_start;
+
752  win->edit.sel_end = edit->select_end;
+
753  win->edit.mode = edit->mode;
+
754  win->edit.scrollbar.x = (nk_uint)edit->scrollbar.x;
+
755  win->edit.scrollbar.y = (nk_uint)edit->scrollbar.y;
+
756  } return state;
+
757 }
+
758 NK_API nk_flags
+
759 nk_edit_buffer(struct nk_context *ctx, nk_flags flags,
+
760  struct nk_text_edit *edit, nk_plugin_filter filter)
+
761 {
+
762  struct nk_window *win;
+
763  struct nk_style *style;
+
764  struct nk_input *in;
+
765 
+
766  enum nk_widget_layout_states state;
+
767  struct nk_rect bounds;
+
768 
+
769  nk_flags ret_flags = 0;
+
770  unsigned char prev_state;
+
771  nk_hash hash;
+
772 
+
773  /* make sure correct values */
+
774  NK_ASSERT(ctx);
+
775  NK_ASSERT(edit);
+
776  NK_ASSERT(ctx->current);
+
777  NK_ASSERT(ctx->current->layout);
+
778  if (!ctx || !ctx->current || !ctx->current->layout)
+
779  return 0;
+
780 
+
781  win = ctx->current;
+
782  style = &ctx->style;
+
783  state = nk_widget(&bounds, ctx);
+
784  if (!state) return state;
+
785  else if (state == NK_WIDGET_DISABLED)
+
786  flags |= NK_EDIT_READ_ONLY;
+
787  in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
788 
+
789  /* check if edit is currently hot item */
+
790  hash = win->edit.seq++;
+
791  if (win->edit.active && hash == win->edit.name) {
+
792  if (flags & NK_EDIT_NO_CURSOR)
+
793  edit->cursor = edit->string.len;
+
794  if (!(flags & NK_EDIT_SELECTABLE)) {
+
795  edit->select_start = edit->cursor;
+
796  edit->select_end = edit->cursor;
+
797  }
+
798  if (flags & NK_EDIT_CLIPBOARD)
+
799  edit->clip = ctx->clip;
+
800  edit->active = (unsigned char)win->edit.active;
+
801  } else edit->active = nk_false;
+
802  edit->mode = win->edit.mode;
+
803 
+
804  filter = (!filter) ? nk_filter_default: filter;
+
805  prev_state = (unsigned char)edit->active;
+
806  in = (flags & NK_EDIT_READ_ONLY) ? 0: in;
+
807  ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
+
808  filter, edit, &style->edit, in, style->font);
+
809 
+
810  if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+
811  ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
+
812  if (edit->active && prev_state != edit->active) {
+
813  /* current edit is now hot */
+
814  win->edit.active = nk_true;
+
815  win->edit.name = hash;
+
816  } else if (prev_state && !edit->active) {
+
817  /* current edit is now cold */
+
818  win->edit.active = nk_false;
+
819  } return ret_flags;
+
820 }
+
821 NK_API nk_flags
+
822 nk_edit_string_zero_terminated(struct nk_context *ctx, nk_flags flags,
+
823  char *buffer, int max, nk_plugin_filter filter)
+
824 {
+
825  nk_flags result;
+
826  int len = nk_strlen(buffer);
+
827  result = nk_edit_string(ctx, flags, buffer, &len, max, filter);
+
828  buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0';
+
829  return result;
+
830 }
+
831 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API nk_bool nk_filter_default(const struct nk_text_edit *, nk_rune unicode)
filter function
Definition: nuklear_edit.c:10
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_EDIT_INACTIVE
!< edit widget is currently being modified
Definition: nuklear.h:3503
+
@ NK_EDIT_DEACTIVATED
!< edit widget went from state inactive to state active
Definition: nuklear.h:3505
+
@ NK_EDIT_COMMITED
!< edit widget went from state active to state inactive
Definition: nuklear.h:3506
+
@ NK_EDIT_ACTIVATED
!< edit widget is not active and is not being modified
Definition: nuklear.h:3504
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+ + + +
struct nk_text_edit text_edit
text editor objects are quite big because of an internal undo/redo stack.
Definition: nuklear.h:5728
+ + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__font_8c_source.html b/nuklear__font_8c_source.html new file mode 100644 index 000000000..b69fcc481 --- /dev/null +++ b/nuklear__font_8c_source.html @@ -0,0 +1,1498 @@ + + + + + + + +Nuklear: src/nuklear_font.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_font.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 #ifdef NK_INCLUDE_FONT_BAKING
+
5 /* -------------------------------------------------------------
+
6  *
+
7  * RECT PACK
+
8  *
+
9  * --------------------------------------------------------------*/
+
10 
+
11 #include "stb_rect_pack.h"
+
12 
+
13 /*
+
14  * ==============================================================
+
15  *
+
16  * TRUETYPE
+
17  *
+
18  * ===============================================================
+
19  */
+
20 #define STBTT_MAX_OVERSAMPLE 8
+
21 #include "stb_truetype.h"
+
22 
+
23 /* -------------------------------------------------------------
+
24  *
+
25  * FONT BAKING
+
26  *
+
27  * --------------------------------------------------------------*/
+
28 struct nk_font_bake_data {
+
29  struct stbtt_fontinfo info;
+
30  struct stbrp_rect *rects;
+
31  stbtt_pack_range *ranges;
+
32  nk_rune range_count;
+
33 };
+
34 
+
35 struct nk_font_baker {
+
36  struct nk_allocator alloc;
+
37  struct stbtt_pack_context spc;
+
38  struct nk_font_bake_data *build;
+
39  stbtt_packedchar *packed_chars;
+
40  struct stbrp_rect *rects;
+
41  stbtt_pack_range *ranges;
+
42 };
+
43 
+
44 NK_GLOBAL const nk_size nk_rect_align = NK_ALIGNOF(struct stbrp_rect);
+
45 NK_GLOBAL const nk_size nk_range_align = NK_ALIGNOF(stbtt_pack_range);
+
46 NK_GLOBAL const nk_size nk_char_align = NK_ALIGNOF(stbtt_packedchar);
+
47 NK_GLOBAL const nk_size nk_build_align = NK_ALIGNOF(struct nk_font_bake_data);
+
48 NK_GLOBAL const nk_size nk_baker_align = NK_ALIGNOF(struct nk_font_baker);
+
49 
+
50 NK_INTERN int
+
51 nk_range_count(const nk_rune *range)
+
52 {
+
53  const nk_rune *iter = range;
+
54  NK_ASSERT(range);
+
55  if (!range) return 0;
+
56  while (*(iter++) != 0);
+
57  return (iter == range) ? 0 : (int)((iter - range)/2);
+
58 }
+
59 NK_INTERN int
+
60 nk_range_glyph_count(const nk_rune *range, int count)
+
61 {
+
62  int i = 0;
+
63  int total_glyphs = 0;
+
64  for (i = 0; i < count; ++i) {
+
65  int diff;
+
66  nk_rune f = range[(i*2)+0];
+
67  nk_rune t = range[(i*2)+1];
+
68  NK_ASSERT(t >= f);
+
69  diff = (int)((t - f) + 1);
+
70  total_glyphs += diff;
+
71  }
+
72  return total_glyphs;
+
73 }
+
74 NK_API const nk_rune*
+
75 nk_font_default_glyph_ranges(void)
+
76 {
+
77  NK_STORAGE const nk_rune ranges[] = {0x0020, 0x00FF, 0};
+
78  return ranges;
+
79 }
+
80 NK_API const nk_rune*
+
81 nk_font_chinese_glyph_ranges(void)
+
82 {
+
83  NK_STORAGE const nk_rune ranges[] = {
+
84  0x0020, 0x00FF,
+
85  0x3000, 0x30FF,
+
86  0x31F0, 0x31FF,
+
87  0xFF00, 0xFFEF,
+
88  0x4E00, 0x9FAF,
+
89  0
+
90  };
+
91  return ranges;
+
92 }
+
93 NK_API const nk_rune*
+
94 nk_font_cyrillic_glyph_ranges(void)
+
95 {
+
96  NK_STORAGE const nk_rune ranges[] = {
+
97  0x0020, 0x00FF,
+
98  0x0400, 0x052F,
+
99  0x2DE0, 0x2DFF,
+
100  0xA640, 0xA69F,
+
101  0
+
102  };
+
103  return ranges;
+
104 }
+
105 NK_API const nk_rune*
+
106 nk_font_korean_glyph_ranges(void)
+
107 {
+
108  NK_STORAGE const nk_rune ranges[] = {
+
109  0x0020, 0x00FF,
+
110  0x3131, 0x3163,
+
111  0xAC00, 0xD79D,
+
112  0
+
113  };
+
114  return ranges;
+
115 }
+
116 NK_INTERN void
+
117 nk_font_baker_memory(nk_size *temp, int *glyph_count,
+
118  struct nk_font_config *config_list, int count)
+
119 {
+
120  int range_count = 0;
+
121  int total_range_count = 0;
+
122  struct nk_font_config *iter, *i;
+
123 
+
124  NK_ASSERT(config_list);
+
125  NK_ASSERT(glyph_count);
+
126  if (!config_list) {
+
127  *temp = 0;
+
128  *glyph_count = 0;
+
129  return;
+
130  }
+
131  *glyph_count = 0;
+
132  for (iter = config_list; iter; iter = iter->next) {
+
133  i = iter;
+
134  do {if (!i->range) iter->range = nk_font_default_glyph_ranges();
+
135  range_count = nk_range_count(i->range);
+
136  total_range_count += range_count;
+
137  *glyph_count += nk_range_glyph_count(i->range, range_count);
+
138  } while ((i = i->n) != iter);
+
139  }
+
140  *temp = (nk_size)*glyph_count * sizeof(struct stbrp_rect);
+
141  *temp += (nk_size)total_range_count * sizeof(stbtt_pack_range);
+
142  *temp += (nk_size)*glyph_count * sizeof(stbtt_packedchar);
+
143  *temp += (nk_size)count * sizeof(struct nk_font_bake_data);
+
144  *temp += sizeof(struct nk_font_baker);
+
145  *temp += nk_rect_align + nk_range_align + nk_char_align;
+
146  *temp += nk_build_align + nk_baker_align;
+
147 }
+
148 NK_INTERN struct nk_font_baker*
+
149 nk_font_baker(void *memory, int glyph_count, int count, const struct nk_allocator *alloc)
+
150 {
+
151  struct nk_font_baker *baker;
+
152  if (!memory) return 0;
+
153  /* setup baker inside a memory block */
+
154  baker = (struct nk_font_baker*)NK_ALIGN_PTR(memory, nk_baker_align);
+
155  baker->build = (struct nk_font_bake_data*)NK_ALIGN_PTR((baker + 1), nk_build_align);
+
156  baker->packed_chars = (stbtt_packedchar*)NK_ALIGN_PTR((baker->build + count), nk_char_align);
+
157  baker->rects = (struct stbrp_rect*)NK_ALIGN_PTR((baker->packed_chars + glyph_count), nk_rect_align);
+
158  baker->ranges = (stbtt_pack_range*)NK_ALIGN_PTR((baker->rects + glyph_count), nk_range_align);
+
159  baker->alloc = *alloc;
+
160  return baker;
+
161 }
+
162 NK_INTERN int
+
163 nk_font_bake_pack(struct nk_font_baker *baker,
+
164  nk_size *image_memory, int *width, int *height, struct nk_recti *custom,
+
165  const struct nk_font_config *config_list, int count,
+
166  const struct nk_allocator *alloc)
+
167 {
+
168  NK_STORAGE const nk_size max_height = 1024 * 32;
+
169  const struct nk_font_config *config_iter, *it;
+
170  int total_glyph_count = 0;
+
171  int total_range_count = 0;
+
172  int range_count = 0;
+
173  int i = 0;
+
174 
+
175  NK_ASSERT(image_memory);
+
176  NK_ASSERT(width);
+
177  NK_ASSERT(height);
+
178  NK_ASSERT(config_list);
+
179  NK_ASSERT(count);
+
180  NK_ASSERT(alloc);
+
181 
+
182  if (!image_memory || !width || !height || !config_list || !count) return nk_false;
+
183  for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
+
184  it = config_iter;
+
185  do {range_count = nk_range_count(it->range);
+
186  total_range_count += range_count;
+
187  total_glyph_count += nk_range_glyph_count(it->range, range_count);
+
188  } while ((it = it->n) != config_iter);
+
189  }
+
190  /* setup font baker from temporary memory */
+
191  for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
+
192  it = config_iter;
+
193  do {
+
194  struct stbtt_fontinfo *font_info = &baker->build[i++].info;
+
195  font_info->userdata = (void*)alloc;
+
196 
+
197  if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0)))
+
198  return nk_false;
+
199  } while ((it = it->n) != config_iter);
+
200  }
+
201  *height = 0;
+
202  *width = (total_glyph_count > 1000) ? 1024 : 512;
+
203  stbtt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, (void*)alloc);
+
204  {
+
205  int input_i = 0;
+
206  int range_n = 0;
+
207  int rect_n = 0;
+
208  int char_n = 0;
+
209 
+
210  if (custom) {
+
211  /* pack custom user data first so it will be in the upper left corner*/
+
212  struct stbrp_rect custom_space;
+
213  nk_zero(&custom_space, sizeof(custom_space));
+
214  custom_space.w = (stbrp_coord)(custom->w);
+
215  custom_space.h = (stbrp_coord)(custom->h);
+
216 
+
217  stbtt_PackSetOversampling(&baker->spc, 1, 1);
+
218  stbrp_pack_rects((struct stbrp_context*)baker->spc.pack_info, &custom_space, 1);
+
219  *height = NK_MAX(*height, (int)(custom_space.y + custom_space.h));
+
220 
+
221  custom->x = (short)custom_space.x;
+
222  custom->y = (short)custom_space.y;
+
223  custom->w = (short)custom_space.w;
+
224  custom->h = (short)custom_space.h;
+
225  }
+
226 
+
227  /* first font pass: pack all glyphs */
+
228  for (input_i = 0, config_iter = config_list; input_i < count && config_iter;
+
229  config_iter = config_iter->next) {
+
230  it = config_iter;
+
231  do {int n = 0;
+
232  int glyph_count;
+
233  const nk_rune *in_range;
+
234  const struct nk_font_config *cfg = it;
+
235  struct nk_font_bake_data *tmp = &baker->build[input_i++];
+
236 
+
237  /* count glyphs + ranges in current font */
+
238  glyph_count = 0; range_count = 0;
+
239  for (in_range = cfg->range; in_range[0] && in_range[1]; in_range += 2) {
+
240  glyph_count += (int)(in_range[1] - in_range[0]) + 1;
+
241  range_count++;
+
242  }
+
243 
+
244  /* setup ranges */
+
245  tmp->ranges = baker->ranges + range_n;
+
246  tmp->range_count = (nk_rune)range_count;
+
247  range_n += range_count;
+
248  for (i = 0; i < range_count; ++i) {
+
249  in_range = &cfg->range[i * 2];
+
250  tmp->ranges[i].font_size = cfg->size;
+
251  tmp->ranges[i].first_unicode_codepoint_in_range = (int)in_range[0];
+
252  tmp->ranges[i].num_chars = (int)(in_range[1]- in_range[0]) + 1;
+
253  tmp->ranges[i].chardata_for_range = baker->packed_chars + char_n;
+
254  char_n += tmp->ranges[i].num_chars;
+
255  }
+
256 
+
257  /* pack */
+
258  tmp->rects = baker->rects + rect_n;
+
259  rect_n += glyph_count;
+
260  stbtt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
+
261  n = stbtt_PackFontRangesGatherRects(&baker->spc, &tmp->info,
+
262  tmp->ranges, (int)tmp->range_count, tmp->rects);
+
263  stbrp_pack_rects((struct stbrp_context*)baker->spc.pack_info, tmp->rects, (int)n);
+
264 
+
265  /* texture height */
+
266  for (i = 0; i < n; ++i) {
+
267  if (tmp->rects[i].was_packed)
+
268  *height = NK_MAX(*height, tmp->rects[i].y + tmp->rects[i].h);
+
269  }
+
270  } while ((it = it->n) != config_iter);
+
271  }
+
272  NK_ASSERT(rect_n == total_glyph_count);
+
273  NK_ASSERT(char_n == total_glyph_count);
+
274  NK_ASSERT(range_n == total_range_count);
+
275  }
+
276  *height = (int)nk_round_up_pow2((nk_uint)*height);
+
277  *image_memory = (nk_size)(*width) * (nk_size)(*height);
+
278  return nk_true;
+
279 }
+
280 NK_INTERN void
+
281 nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int height,
+
282  struct nk_font_glyph *glyphs, int glyphs_count,
+
283  const struct nk_font_config *config_list, int font_count)
+
284 {
+
285  int input_i = 0;
+
286  nk_rune glyph_n = 0;
+
287  const struct nk_font_config *config_iter;
+
288  const struct nk_font_config *it;
+
289 
+
290  NK_ASSERT(image_memory);
+
291  NK_ASSERT(width);
+
292  NK_ASSERT(height);
+
293  NK_ASSERT(config_list);
+
294  NK_ASSERT(baker);
+
295  NK_ASSERT(font_count);
+
296  NK_ASSERT(glyphs_count);
+
297  if (!image_memory || !width || !height || !config_list ||
+
298  !font_count || !glyphs || !glyphs_count)
+
299  return;
+
300 
+
301  /* second font pass: render glyphs */
+
302  nk_zero(image_memory, (nk_size)((nk_size)width * (nk_size)height));
+
303  baker->spc.pixels = (unsigned char*)image_memory;
+
304  baker->spc.height = (int)height;
+
305  for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
+
306  config_iter = config_iter->next) {
+
307  it = config_iter;
+
308  do {const struct nk_font_config *cfg = it;
+
309  struct nk_font_bake_data *tmp = &baker->build[input_i++];
+
310  stbtt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
+
311  stbtt_PackFontRangesRenderIntoRects(&baker->spc, &tmp->info, tmp->ranges, (int)tmp->range_count, tmp->rects);
+
312  } while ((it = it->n) != config_iter);
+
313  } stbtt_PackEnd(&baker->spc);
+
314 
+
315  /* third pass: setup font and glyphs */
+
316  for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
+
317  config_iter = config_iter->next) {
+
318  it = config_iter;
+
319  do {nk_size i = 0;
+
320  int char_idx = 0;
+
321  nk_rune glyph_count = 0;
+
322  const struct nk_font_config *cfg = it;
+
323  struct nk_font_bake_data *tmp = &baker->build[input_i++];
+
324  struct nk_baked_font *dst_font = cfg->font;
+
325 
+
326  float font_scale = stbtt_ScaleForPixelHeight(&tmp->info, cfg->size);
+
327  int unscaled_ascent, unscaled_descent, unscaled_line_gap;
+
328  stbtt_GetFontVMetrics(&tmp->info, &unscaled_ascent, &unscaled_descent,
+
329  &unscaled_line_gap);
+
330 
+
331  /* fill baked font */
+
332  if (!cfg->merge_mode) {
+
333  dst_font->ranges = cfg->range;
+
334  dst_font->height = cfg->size;
+
335  dst_font->ascent = ((float)unscaled_ascent * font_scale);
+
336  dst_font->descent = ((float)unscaled_descent * font_scale);
+
337  dst_font->glyph_offset = glyph_n;
+
338  /*
+
339  Need to zero this, or it will carry over from a previous
+
340  bake, and cause a segfault when accessing glyphs[].
+
341  */
+
342  dst_font->glyph_count = 0;
+
343  }
+
344 
+
345  /* fill own baked font glyph array */
+
346  for (i = 0; i < tmp->range_count; ++i) {
+
347  stbtt_pack_range *range = &tmp->ranges[i];
+
348  for (char_idx = 0; char_idx < range->num_chars; char_idx++)
+
349  {
+
350  nk_rune codepoint = 0;
+
351  float dummy_x = 0, dummy_y = 0;
+ +
353  struct nk_font_glyph *glyph;
+
354 
+
355  /* query glyph bounds from stb_truetype */
+
356  const stbtt_packedchar *pc = &range->chardata_for_range[char_idx];
+
357  codepoint = (nk_rune)(range->first_unicode_codepoint_in_range + char_idx);
+
358  stbtt_GetPackedQuad(range->chardata_for_range, (int)width,
+
359  (int)height, char_idx, &dummy_x, &dummy_y, &q, 0);
+
360 
+
361  /* fill own glyph type with data */
+
362  glyph = &glyphs[dst_font->glyph_offset + dst_font->glyph_count + (unsigned int)glyph_count];
+
363  glyph->codepoint = codepoint;
+
364  glyph->x0 = q.x0; glyph->y0 = q.y0;
+
365  glyph->x1 = q.x1; glyph->y1 = q.y1;
+
366  glyph->y0 += (dst_font->ascent + 0.5f);
+
367  glyph->y1 += (dst_font->ascent + 0.5f);
+
368  glyph->w = glyph->x1 - glyph->x0 + 0.5f;
+
369  glyph->h = glyph->y1 - glyph->y0;
+
370 
+
371  if (cfg->coord_type == NK_COORD_PIXEL) {
+
372  glyph->u0 = q.s0 * (float)width;
+
373  glyph->v0 = q.t0 * (float)height;
+
374  glyph->u1 = q.s1 * (float)width;
+
375  glyph->v1 = q.t1 * (float)height;
+
376  } else {
+
377  glyph->u0 = q.s0;
+
378  glyph->v0 = q.t0;
+
379  glyph->u1 = q.s1;
+
380  glyph->v1 = q.t1;
+
381  }
+
382  glyph->xadvance = (pc->xadvance + cfg->spacing.x);
+
383  if (cfg->pixel_snap)
+
384  glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f);
+
385  glyph_count++;
+
386  }
+
387  }
+
388  dst_font->glyph_count += glyph_count;
+
389  glyph_n += glyph_count;
+
390  } while ((it = it->n) != config_iter);
+
391  }
+
392 }
+
393 NK_INTERN void
+
394 nk_font_bake_custom_data(void *img_memory, int img_width, int img_height,
+
395  struct nk_recti img_dst, const char *texture_data_mask, int tex_width,
+
396  int tex_height, char white, char black)
+
397 {
+
398  nk_byte *pixels;
+
399  int y = 0;
+
400  int x = 0;
+
401  int n = 0;
+
402 
+
403  NK_ASSERT(img_memory);
+
404  NK_ASSERT(img_width);
+
405  NK_ASSERT(img_height);
+
406  NK_ASSERT(texture_data_mask);
+
407  NK_UNUSED(tex_height);
+
408  if (!img_memory || !img_width || !img_height || !texture_data_mask)
+
409  return;
+
410 
+
411  pixels = (nk_byte*)img_memory;
+
412  for (y = 0, n = 0; y < tex_height; ++y) {
+
413  for (x = 0; x < tex_width; ++x, ++n) {
+
414  const int off0 = ((img_dst.x + x) + (img_dst.y + y) * img_width);
+
415  const int off1 = off0 + 1 + tex_width;
+
416  pixels[off0] = (texture_data_mask[n] == white) ? 0xFF : 0x00;
+
417  pixels[off1] = (texture_data_mask[n] == black) ? 0xFF : 0x00;
+
418  }
+
419  }
+
420 }
+
421 NK_INTERN void
+
422 nk_font_bake_convert(void *out_memory, int img_width, int img_height,
+
423  const void *in_memory)
+
424 {
+
425  int n = 0;
+
426  nk_rune *dst;
+
427  const nk_byte *src;
+
428 
+
429  NK_ASSERT(out_memory);
+
430  NK_ASSERT(in_memory);
+
431  NK_ASSERT(img_width);
+
432  NK_ASSERT(img_height);
+
433  if (!out_memory || !in_memory || !img_height || !img_width) return;
+
434 
+
435  dst = (nk_rune*)out_memory;
+
436  src = (const nk_byte*)in_memory;
+
437  for (n = (int)(img_width * img_height); n > 0; n--)
+
438  *dst++ = ((nk_rune)(*src++) << 24) | 0x00FFFFFF;
+
439 }
+
440 
+
441 /* -------------------------------------------------------------
+
442  *
+
443  * FONT
+
444  *
+
445  * --------------------------------------------------------------*/
+
446 NK_INTERN float
+
447 nk_font_text_width(nk_handle handle, float height, const char *text, int len)
+
448 {
+
449  nk_rune unicode;
+
450  int text_len = 0;
+
451  float text_width = 0;
+
452  int glyph_len = 0;
+
453  float scale = 0;
+
454 
+
455  struct nk_font *font = (struct nk_font*)handle.ptr;
+
456  NK_ASSERT(font);
+
457  NK_ASSERT(font->glyphs);
+
458  if (!font || !text || !len)
+
459  return 0;
+
460 
+
461  scale = height/font->info.height;
+
462  glyph_len = text_len = nk_utf_decode(text, &unicode, (int)len);
+
463  if (!glyph_len) return 0;
+
464  while (text_len <= (int)len && glyph_len) {
+
465  const struct nk_font_glyph *g;
+
466  if (unicode == NK_UTF_INVALID) break;
+
467 
+
468  /* query currently drawn glyph information */
+
469  g = nk_font_find_glyph(font, unicode);
+
470  text_width += g->xadvance * scale;
+
471 
+
472  /* offset next glyph */
+
473  glyph_len = nk_utf_decode(text + text_len, &unicode, (int)len - text_len);
+
474  text_len += glyph_len;
+
475  }
+
476  return text_width;
+
477 }
+
478 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
479 NK_INTERN void
+
480 nk_font_query_font_glyph(nk_handle handle, float height,
+
481  struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
+
482 {
+
483  float scale;
+
484  const struct nk_font_glyph *g;
+
485  struct nk_font *font;
+
486 
+
487  NK_ASSERT(glyph);
+
488  NK_UNUSED(next_codepoint);
+
489 
+
490  font = (struct nk_font*)handle.ptr;
+
491  NK_ASSERT(font);
+
492  NK_ASSERT(font->glyphs);
+
493  if (!font || !glyph)
+
494  return;
+
495 
+
496  scale = height/font->info.height;
+
497  g = nk_font_find_glyph(font, codepoint);
+
498  glyph->width = (g->x1 - g->x0) * scale;
+
499  glyph->height = (g->y1 - g->y0) * scale;
+
500  glyph->offset = nk_vec2(g->x0 * scale, g->y0 * scale);
+
501  glyph->xadvance = (g->xadvance * scale);
+
502  glyph->uv[0] = nk_vec2(g->u0, g->v0);
+
503  glyph->uv[1] = nk_vec2(g->u1, g->v1);
+
504 }
+
505 #endif
+
506 NK_API const struct nk_font_glyph*
+
507 nk_font_find_glyph(const struct nk_font *font, nk_rune unicode)
+
508 {
+
509  int i = 0;
+
510  int count;
+
511  int total_glyphs = 0;
+
512  const struct nk_font_glyph *glyph = 0;
+
513  const struct nk_font_config *iter = 0;
+
514 
+
515  NK_ASSERT(font);
+
516  NK_ASSERT(font->glyphs);
+
517  NK_ASSERT(font->info.ranges);
+
518  if (!font || !font->glyphs) return 0;
+
519 
+
520  glyph = font->fallback;
+
521  iter = font->config;
+
522  do {count = nk_range_count(iter->range);
+
523  for (i = 0; i < count; ++i) {
+
524  nk_rune f = iter->range[(i*2)+0];
+
525  nk_rune t = iter->range[(i*2)+1];
+
526  int diff = (int)((t - f) + 1);
+
527  if (unicode >= f && unicode <= t)
+
528  return &font->glyphs[((nk_rune)total_glyphs + (unicode - f))];
+
529  total_glyphs += diff;
+
530  }
+
531  } while ((iter = iter->n) != font->config);
+
532  return glyph;
+
533 }
+
534 NK_INTERN void
+
535 nk_font_init(struct nk_font *font, float pixel_height,
+
536  nk_rune fallback_codepoint, struct nk_font_glyph *glyphs,
+
537  const struct nk_baked_font *baked_font, nk_handle atlas)
+
538 {
+
539  struct nk_baked_font baked;
+
540  NK_ASSERT(font);
+
541  NK_ASSERT(glyphs);
+
542  NK_ASSERT(baked_font);
+
543  if (!font || !glyphs || !baked_font)
+
544  return;
+
545 
+
546  baked = *baked_font;
+
547  font->fallback = 0;
+
548  font->info = baked;
+
549  font->scale = (float)pixel_height / (float)font->info.height;
+
550  font->glyphs = &glyphs[baked_font->glyph_offset];
+
551  font->texture = atlas;
+
552  font->fallback_codepoint = fallback_codepoint;
+
553  font->fallback = nk_font_find_glyph(font, fallback_codepoint);
+
554 
+
555  font->handle.height = font->info.height * font->scale;
+
556  font->handle.width = nk_font_text_width;
+
557  font->handle.userdata.ptr = font;
+
558 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
559  font->handle.query = nk_font_query_font_glyph;
+
560  font->handle.texture = font->texture;
+
561 #endif
+
562 }
+
563 
+
564 /* ---------------------------------------------------------------------------
+
565  *
+
566  * DEFAULT FONT
+
567  *
+
568  * ProggyClean.ttf
+
569  * Copyright (c) 2004, 2005 Tristan Grimmer
+
570  * MIT license https://github.com/bluescan/proggyfonts/blob/master/LICENSE
+
571  * Download and more information at https://github.com/bluescan/proggyfonts
+
572  *-----------------------------------------------------------------------------*/
+
573 #ifdef __clang__
+
574 #pragma clang diagnostic push
+
575 #pragma clang diagnostic ignored "-Woverlength-strings"
+
576 #elif defined(__GNUC__) || defined(__GNUG__)
+
577 #pragma GCC diagnostic push
+
578 #pragma GCC diagnostic ignored "-Woverlength-strings"
+
579 #endif
+
580 
+
581 #ifdef NK_INCLUDE_DEFAULT_FONT
+
582 
+
583 NK_GLOBAL const char nk_proggy_clean_ttf_compressed_data_base85[11980+1] =
+
584  "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/"
+
585  "2*>]b(MC;$jPfY.;h^`IWM9<Lh2TlS+f-s$o6Q<BWH`YiU.xfLq$N;$0iR/GX:U(jcW2p/W*q?-qmnUCI;jHSAiFWM.R*kU@C=GH?a9wp8f$e.-4^Qg1)Q-GL(lf(r/7GrRgwV%MS=C#"
+
586  "`8ND>Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1<q-UE31#^-V'8IRUo7Qf./L>=Ke$$'5F%)]0^#0X@U.a<r:QLtFsLcL6##lOj)#.Y5<-R&KgLwqJfLgN&;Q?gI^#DY2uL"
+
587  "i@^rMl9t=cWq6##weg>$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;-<nLENhvx>-VsM.M0rJfLH2eTM`*oJMHRC`N"
+
588  "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`&#0j@'DbG&#^$PG.Ll+DNa<XCMKEV*N)LN/N"
+
589  "*b=%Q6pia-Xg8I$<MR&,VdJe$<(7G;Ckl'&hF;;$<_=X(b.RS%%)###MPBuuE1V:v&cX&#2m#(&cV]`k9OhLMbn%s$G2,B$BfD3X*sp5#l,$R#]x_X1xKX%b5U*[r5iMfUo9U`N99hG)"
+
590  "tm+/Us9pG)XPu`<0s-)WTt(gCRxIg(%6sfh=ktMKn3j)<6<b5Sk_/0(^]AaN#(p/L>&VZ>1i%h1S9u5o@YaaW$e+b<TWFn/Z:Oh(Cx2$lNEoN^e)#CFY@@I;BOQ*sRwZtZxRcU7uW6CX"
+
591  "ow0i(?$Q[cjOd[P4d)]>ROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc."
+
592  "x]Ip.PH^'/aqUO/$1WxLoW0[iLA<QT;5HKD+@qQ'NQ(3_PLhE48R.qAPSwQ0/WK?Z,[x?-J;jQTWA0X@KJ(_Y8N-:/M74:/-ZpKrUss?d#dZq]DAbkU*JqkL+nwX@@47`5>w=4h(9.`G"
+
593  "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?G<Nald$qs]@]L<J7bR*>gv:[7MI2k).'2($5FNP&EQ(,)"
+
594  "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#"
+
595  "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM"
+
596  "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0<q-]L_?^)1vw'.,MRsqVr.L;aN&#/EgJ)PBc[-f>+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu"
+
597  "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/"
+
598  "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[K<L"
+
599  "%a2E-grWVM3@2=-k22tL]4$##6We'8UJCKE[d_=%wI;'6X-GsLX4j^SgJ$##R*w,vP3wK#iiW&#*h^D&R?jp7+/u&#(AP##XU8c$fSYW-J95_-Dp[g9wcO&#M-h1OcJlc-*vpw0xUX&#"
+
600  "OQFKNX@QI'IoPp7nb,QU//MQ&ZDkKP)X<WSVL(68uVl&#c'[0#(s1X&xm$Y%B7*K:eDA323j998GXbA#pwMs-jgD$9QISB-A_(aN4xoFM^@C58D0+Q+q3n0#3U1InDjF682-SjMXJK)("
+
601  "h$hxua_K]ul92%'BOU&#BRRh-slg8KDlr:%L71Ka:.A;%YULjDPmL<LYs8i#XwJOYaKPKc1h:'9Ke,g)b),78=I39B;xiY$bgGw-&.Zi9InXDuYa%G*f2Bq7mn9^#p1vv%#(Wi-;/Z5h"
+
602  "o;#2:;%d&#x9v68C5g?ntX0X)pT`;%pB3q7mgGN)3%(P8nTd5L7GeA-GL@+%J3u2:(Yf>et`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO"
+
603  "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J<j$UpK<Q4a1]MupW^-"
+
604  "sj_$%[HK%'F####QRZJ::Y3EGl4'@%FkiAOg#p[##O`gukTfBHagL<LHw%q&OV0##F=6/:chIm0@eCP8X]:kFI%hl8hgO@RcBhS-@Qb$%+m=hPDLg*%K8ln(wcf3/'DW-$.lR?n[nCH-"
+
605  "eXOONTJlh:.RYF%3'p6sq:UIMA945&^HFS87@$EP2iG<-lCO$%c`uKGD3rC$x0BL8aFn--`ke%#HMP'vh1/R&O_J9'um,.<tx[@%wsJk&bUT2`0uMv7gg#qp/ij.L56'hl;.s5CUrxjO"
+
606  "M7-##.l+Au'A&O:-T72L]P`&=;ctp'XScX*rU.>-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%"
+
607  "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$M<Jnq79VsJW/mWS*PUiq76;]/NM_>hLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]"
+
608  "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et"
+
609  "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$<M-SGZ':+Q_k+uvOSLiEo(<aD/K<CCc`'Lx>'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:"
+
610  "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VB<HFF*qL("
+
611  "$/V,;(kXZejWO`<[5?\?ewY(*9=%wDc;,u<'9t3W-(H1th3+G]ucQ]kLs7df($/*JL]@*t7Bu_G3_7mp7<iaQjO@.kLg;x3B0lqp7Hf,^Ze7-##@/c58Mo(3;knp0%)A7?-W+eI'o8)b<"
+
612  "nKnw'Ho8C=Y>pqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<<aG/1N$#FX$0V5Y6x'aErI3I$7x%E`v<-BY,)%-?Psf*l?%C3.mM(=/M0:JxG'?"
+
613  "7WhH%o'a<-80g0NBxoO(GH<dM]n.+%q@jH?f.UsJ2Ggs&4<-e47&Kl+f//9@`b+?.TeN_&B8Ss?v;^Trk;f#YvJkl&w$]>-+k?'(<S:68tq*WoDfZu';mM?8X[ma8W%*`-=;D.(nc7/;"
+
614  ")g:T1=^J$&BRV(-lTmNB6xqB[@0*o.erM*<SWF]u2=st-*(6v>^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M"
+
615  "D?@f&1'BW-)Ju<L25gl8uhVm1hL$##*8###'A3/LkKW+(^rWX?5W_8g)a(m&K8P>#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX("
+
616  "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs"
+
617  "bIu)'Z,*[>br5fX^:FPAWr-m2KgL<LUN098kTF&#lvo58=/vjDo;.;)Ka*hLR#/k=rKbxuV`>Q_nN6'8uTG&#1T5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q"
+
618  "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aeg<Z'<$#4H)6,>e0jT6'N#(q%.O=?2S]u*(m<-"
+
619  "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i"
+
620  "sZ88+dKQ)W6>J%CL<KE>`.d*(B`-n8D9oK<Up]c$X$(,)M8Zt7/[rdkqTgl-0cuGMv'?>-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P&#9r+$%CE=68>K8r0=dSC%%(@p7"
+
621  ".m7jilQ02'0-VWAg<a/''3u.=4L$Y)6k/K:_[3=&jvL<L0C/2'v:^;-DIBW,B4E68:kZ;%?8(Q8BH=kO65BW?xSG&#@uU,DS*,?.+(o(#1vCS8#CHF>TlGW'b)Tq7VT9q^*^$$.:&N@@"
+
622  "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*"
+
623  "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u"
+
624  "@-W$U%VEQ/,,>>#)D<h#`)h0:<Q6909ua+&VU%n2:cG3FJ-%@Bj-DgLr`Hw&HAKjKjseK</xKT*)B,N9X3]krc12t'pgTV(Lv-tL[xg_%=M_q7a^x?7Ubd>#%8cY#YZ?=,`Wdxu/ae&#"
+
625  "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$s<Eh#c&)q.MXI%#v9ROa5FZO%sF7q7Nwb&#ptUJ:aqJe$Sl68%.D###EC><?-aF&#RNQv>o8lKN%5/$(vdfq7+ebA#"
+
626  "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(<c`Q8N)jEIF*+?P2a8g%)$q]o2aH8C&<SibC/q,(e:v;-b#6[$NtDZ84Je2KNvB#$P5?tQ3nt(0"
+
627  "d=j.LQf./Ll33+(;q3L-w=8dX$#WF&uIJ@-bfI>%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoF&#4DoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8"
+
628  "6e%B/:=>)N4xeW.*wft-;$'58-ESqr<b?UI(_%@[P46>#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#"
+
629  "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjL<Lni;''X.`$#8+1GD"
+
630  ":k$YUWsbn8ogh6rxZ2Z9]%nd+>V#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#<NEdtg(n'=S1A(Q1/I&4([%dM`,Iu'1:_hL>SfD07&6D<fp8dHM7/g+"
+
631  "tlPN9J*rKaPct&?'uBCem^jn%9_K)<,C5K3s=5g&GmJb*[SYq7K;TRLGCsM-$$;S%:Y@r7AK0pprpL<Lrh,q7e/%KWK:50I^+m'vi`3?%Zp+<-d+$L-Sv:@.o19n$s0&39;kn;S%BSq*"
+
632  "$3WoJSCLweV[aZ'MQIjO<7;X-X;&+dMLvu#^UsGEC9WEc[X(wI7#2.(F0jV*eZf<-Qv3J-c+J5AlrB#$p(H68LvEA'q3n0#m,[`*8Ft)FcYgEud]CWfm68,(aLA$@EFTgLXoBq/UPlp7"
+
633  ":d[/;r_ix=:TF`S5H-b<LI&HY(K=h#)]Lk$K14lVfm:x$H<3^Ql<M`$OhapBnkup'D#L$Pb_`N*g]2e;X/Dtg,bsj&K#2[-:iYr'_wgH)NUIR8a1n#S?Yej'h8^58UbZd+^FKD*T@;6A"
+
634  "7aQC[K8d-(v6GI$x:T<&'Gp5Uf>@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-<aN((^7('#Z0wK#5GX@7"
+
635  "u][`*S^43933A4rl][`*O4CgLEl]v$1Q3AeF37dbXk,.)vj#x'd`;qgbQR%FW,2(?LO=s%Sc68%NP'##Aotl8x=BE#j1UD([3$M(]UI2LX3RpKN@;/#f'f/&_mt&F)XdF<9t4)Qa.*kT"
+
636  "LwQ'(TTB9.xH'>#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5<N?)NBS)QN*_I,?&)2'IM%L3I)X((e/dl2&8'<M"
+
637  ":^#M*Q+[T.Xri.LYS3v%fF`68h;b-X[/En'CR.q7E)p'/kle2HM,u;^%OKC-N+Ll%F9CF<Nf'^#t2L,;27W:0O@6##U6W7:$rJfLWHj$#)woqBefIZ.PK<b*t7ed;p*_m;4ExK#h@&]>"
+
638  "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%"
+
639  "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;"
+
640  "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmL<LD)F^%[tC'8;+9E#C$g%#5Y>q9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:"
+
641  "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3<n-&%H%b<FDj2M<hH=&Eh<2Len$b*aTX=-8QxN)k11IM1c^j%"
+
642  "9s<L<NFSo)B?+<-(GxsF,^-Eh@$4dXhN$+#rxK8'je'D7k`e;)2pYwPA'_p9&@^18ml1^[@g4t*[JOa*[=Qp7(qJ_oOL^('7fB&Hq-:sf,sNj8xq^>$U4O]GKx'm9)b@p7YsvK3w^YR-"
+
643  "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*"
+
644  "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdF<TddF<9Ah-6&9tWoDlh]&1SpGMq>Ti1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IX<N+T+0MlMBPQ*Vj>SsD<U4JHY"
+
645  "8kD2)2fU/M#$e.)T4,_=8hLim[&);?UkK'-x?'(:siIfL<$pFM`i<?%W(mGDHM%>iWP,##P`%/L<eXi:@Z9C.7o=@(pXdAO/NLQ8lPl+HPOQa8wD8=^GlPa8TKI1CjhsCTSLJM'/Wl>-"
+
646  "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n<bhPmUkMw>%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL<LoNs'6,'85`"
+
647  "0?t/'_U59@]ddF<#LdF<eWdF<OuN/45rY<-L@&#+fm>69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdF<gR@2L=FNU-<b[(9c/ML3m;Z[$oF3g)GAWqpARc=<ROu7cL5l;-[A]%/"
+
648  "+fsd;l#SafT/f*W]0=O'$(Tb<[)*@e775R-:Yob%g*>l*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj"
+
649  "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#<IGe;__.thjZl<%w(Wk2xmp4Q@I#I9,DF]u7-P=.-_:YJ]aS@V"
+
650  "?6*C()dOp7:WL,b&3Rg/.cmM9&r^>$(>.Z-I&J(Q0Hd5Q%7Co-b`-c<N(6r@ip+AurK<m86QIth*#v;-OBqi+L7wDE-Ir8K['m+DDSLwK&/.?-V%U_%3:qKNu$_b*B-kp7NaD'QdWQPK"
+
651  "Yq[@>P)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8<FfNkgg^oIbah*#8/Qt$F&:K*-(N/'+1vMB,u()-a.VUU*#[e%gAAO(S>WlA2);Sa"
+
652  ">gXm8YB`1d@K#n]76-a$U,mF<fX]idqd)<3,]J7JmW4`6]uks=4-72L(jEk+:bJ0M^q-8Dm_Z?0olP1C9Sa&H[d&c$ooQUj]Exd*3ZM@-WGW2%s',B-_M%>%Ul:#/'xoFM9QX-$.QN'>"
+
653  "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B</R90;eZ]%Ncq;-Tl]#F>2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I"
+
654  "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1<Vc52=u`3^o-n1'g4v58Hj&6_t7$##?M)c<$bgQ_'SY((-xkA#"
+
655  "Y(,p'H9rIVY-b,'%bCPF7.J<Up^,(dU1VY*5#WkTU>h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-u<Hp,3@e^9UB1J+ak9-TN/mhKPg+AJYd$"
+
656  "MlvAF_jCK*.O-^(63adMT->W%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)"
+
657  "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo"
+
658  "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P"
+
659  "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*<h`e-GI7)?OK2A.d7_c)?wQ5AS@DL3r#7fSkgl6-++D:'A,uq7SvlB$pcpH'q3n0#_%dY#xCpr-l<F0NR@-##FEV6NTF6##$l84N1w?AO>'IAO"
+
660  "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#"
+
661  ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T<XoIB&hx=T1PcDaB&;HH+-AFr?(m9HZV)FKS8JCw;SD=6[^/DZUL`EUDf]GGlG&>"
+
662  "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#<xU?#@.i?#D:%@#HF7@#LRI@#P_[@#Tkn@#Xw*A#]-=A#a9OA#"
+
663  "d<F&#*;G##.GY##2Sl##6`($#:l:$#>xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4&#3^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4"
+
664  "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#"
+
665  "/QHC#3^ZC#7jmC#;v)D#?,<D#C8ND#GDaD#KPsD#O]/E#g1A5#KA*1#gC17#MGd;#8(02#L-d3#rWM4#Hga1#,<w0#T.j<#O#'2#CYN1#qa^:#_4m3#o@/=#eG8=#t8J5#`+78#4uI-#"
+
666  "m3B2#SB[8#Q0@8#i[*9#iOn8#1Nm;#^sN9#qh<9#:=x-#P;K2#$%X9#bC+.#Rg;<#mN=.#MTF.#RZO.#2?)4#Y#(/#[)1/#b;L/#dAU/#0Sv;#lY$0#n`-0#sf60#(F24#wrH0#%/e0#"
+
667  "TmD<#%JSMFove:CTBEXI:<eh2g)B,3h2^G3i;#d3jD>)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP"
+
668  "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp"
+
669  "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#";
+
670 
+
671 #endif /* NK_INCLUDE_DEFAULT_FONT */
+
672 
+
673 #define NK_CURSOR_DATA_W 90
+
674 #define NK_CURSOR_DATA_H 27
+
675 NK_GLOBAL const char nk_custom_cursor_data[NK_CURSOR_DATA_W * NK_CURSOR_DATA_H + 1] =
+
676 {
+
677  "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX"
+
678  "..- -X.....X- X.X - X.X -X.....X - X.....X"
+
679  "--- -XXX.XXX- X...X - X...X -X....X - X....X"
+
680  "X - X.X - X.....X - X.....X -X...X - X...X"
+
681  "XX - X.X -X.......X- X.......X -X..X.X - X.X..X"
+
682  "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X"
+
683  "X..X - X.X - X.X - X.X -XX X.X - X.X XX"
+
684  "X...X - X.X - X.X - XX X.X XX - X.X - X.X "
+
685  "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X "
+
686  "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X "
+
687  "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X "
+
688  "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X "
+
689  "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X "
+
690  "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X "
+
691  "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X "
+
692  "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X "
+
693  "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX "
+
694  "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------"
+
695  "X.X X..X - -X.......X- X.......X - XX XX - "
+
696  "XX X..X - - X.....X - X.....X - X.X X.X - "
+
697  " X..X - X...X - X...X - X..X X..X - "
+
698  " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - "
+
699  "------------ - X - X -X.....................X- "
+
700  " ----------------------------------- X...XXXXXXXXXXXXX...X - "
+
701  " - X..X X..X - "
+
702  " - X.X X.X - "
+
703  " - XX XX - "
+
704 };
+
705 
+
706 #ifdef __clang__
+
707 #pragma clang diagnostic pop
+
708 #elif defined(__GNUC__) || defined(__GNUG__)
+
709 #pragma GCC diagnostic pop
+
710 #endif
+
711 
+
712 NK_GLOBAL unsigned char *nk__barrier;
+
713 NK_GLOBAL unsigned char *nk__barrier2;
+
714 NK_GLOBAL unsigned char *nk__barrier3;
+
715 NK_GLOBAL unsigned char *nk__barrier4;
+
716 NK_GLOBAL unsigned char *nk__dout;
+
717 
+
718 NK_INTERN unsigned int
+
719 nk_decompress_length(unsigned char *input)
+
720 {
+
721  return (unsigned int)((input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]);
+
722 }
+
723 NK_INTERN void
+
724 nk__match(unsigned char *data, unsigned int length)
+
725 {
+
726  /* INVERSE of memmove... write each byte before copying the next...*/
+
727  NK_ASSERT (nk__dout + length <= nk__barrier);
+
728  if (nk__dout + length > nk__barrier) { nk__dout += length; return; }
+
729  if (data < nk__barrier4) { nk__dout = nk__barrier+1; return; }
+
730  while (length--) *nk__dout++ = *data++;
+
731 }
+
732 NK_INTERN void
+
733 nk__lit(unsigned char *data, unsigned int length)
+
734 {
+
735  NK_ASSERT (nk__dout + length <= nk__barrier);
+
736  if (nk__dout + length > nk__barrier) { nk__dout += length; return; }
+
737  if (data < nk__barrier2) { nk__dout = nk__barrier+1; return; }
+
738  NK_MEMCPY(nk__dout, data, length);
+
739  nk__dout += length;
+
740 }
+
741 NK_INTERN unsigned char*
+
742 nk_decompress_token(unsigned char *i)
+
743 {
+
744  #define nk__in2(x) ((i[x] << 8) + i[(x)+1])
+
745  #define nk__in3(x) ((i[x] << 16) + nk__in2((x)+1))
+
746  #define nk__in4(x) ((i[x] << 24) + nk__in3((x)+1))
+
747 
+
748  if (*i >= 0x20) { /* use fewer if's for cases that expand small */
+
749  if (*i >= 0x80) nk__match(nk__dout-i[1]-1, (unsigned int)i[0] - 0x80 + 1), i += 2;
+
750  else if (*i >= 0x40) nk__match(nk__dout-(nk__in2(0) - 0x4000 + 1), (unsigned int)i[2]+1), i += 3;
+
751  else /* *i >= 0x20 */ nk__lit(i+1, (unsigned int)i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
+
752  } else { /* more ifs for cases that expand large, since overhead is amortized */
+
753  if (*i >= 0x18) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x180000 + 1), (unsigned int)i[3]+1), i += 4;
+
754  else if (*i >= 0x10) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x100000 + 1), (unsigned int)nk__in2(3)+1), i += 5;
+
755  else if (*i >= 0x08) nk__lit(i+2, (unsigned int)nk__in2(0) - 0x0800 + 1), i += 2 + (nk__in2(0) - 0x0800 + 1);
+
756  else if (*i == 0x07) nk__lit(i+3, (unsigned int)nk__in2(1) + 1), i += 3 + (nk__in2(1) + 1);
+
757  else if (*i == 0x06) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), i[4]+1u), i += 5;
+
758  else if (*i == 0x04) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), (unsigned int)nk__in2(4)+1u), i += 6;
+
759  }
+
760  return i;
+
761 }
+
762 NK_INTERN unsigned int
+
763 nk_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
+
764 {
+
765  const unsigned long ADLER_MOD = 65521;
+
766  unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
+
767  unsigned long blocklen, i;
+
768 
+
769  blocklen = buflen % 5552;
+
770  while (buflen) {
+
771  for (i=0; i + 7 < blocklen; i += 8) {
+
772  s1 += buffer[0]; s2 += s1;
+
773  s1 += buffer[1]; s2 += s1;
+
774  s1 += buffer[2]; s2 += s1;
+
775  s1 += buffer[3]; s2 += s1;
+
776  s1 += buffer[4]; s2 += s1;
+
777  s1 += buffer[5]; s2 += s1;
+
778  s1 += buffer[6]; s2 += s1;
+
779  s1 += buffer[7]; s2 += s1;
+
780  buffer += 8;
+
781  }
+
782  for (; i < blocklen; ++i) {
+
783  s1 += *buffer++; s2 += s1;
+
784  }
+
785 
+
786  s1 %= ADLER_MOD; s2 %= ADLER_MOD;
+
787  buflen -= (unsigned int)blocklen;
+
788  blocklen = 5552;
+
789  }
+
790  return (unsigned int)(s2 << 16) + (unsigned int)s1;
+
791 }
+
792 NK_INTERN unsigned int
+
793 nk_decompress(unsigned char *output, unsigned char *i, unsigned int length)
+
794 {
+
795  unsigned int olen;
+
796  if (nk__in4(0) != 0x57bC0000) return 0;
+
797  if (nk__in4(4) != 0) return 0; /* error! stream is > 4GB */
+
798  olen = nk_decompress_length(i);
+
799  nk__barrier2 = i;
+
800  nk__barrier3 = i+length;
+
801  nk__barrier = output + olen;
+
802  nk__barrier4 = output;
+
803  i += 16;
+
804 
+
805  nk__dout = output;
+
806  for (;;) {
+
807  unsigned char *old_i = i;
+
808  i = nk_decompress_token(i);
+
809  if (i == old_i) {
+
810  if (*i == 0x05 && i[1] == 0xfa) {
+
811  NK_ASSERT(nk__dout == output + olen);
+
812  if (nk__dout != output + olen) return 0;
+
813  if (nk_adler32(1, output, olen) != (unsigned int) nk__in4(2))
+
814  return 0;
+
815  return olen;
+
816  } else {
+
817  NK_ASSERT(0); /* NOTREACHED */
+
818  return 0;
+
819  }
+
820  }
+
821  NK_ASSERT(nk__dout <= output + olen);
+
822  if (nk__dout > output + olen)
+
823  return 0;
+
824  }
+
825 }
+
826 NK_INTERN unsigned int
+
827 nk_decode_85_byte(char c)
+
828 {
+
829  return (unsigned int)((c >= '\\') ? c-36 : c-35);
+
830 }
+
831 NK_INTERN void
+
832 nk_decode_85(unsigned char* dst, const unsigned char* src)
+
833 {
+
834  while (*src)
+
835  {
+
836  unsigned int tmp =
+
837  nk_decode_85_byte((char)src[0]) +
+
838  85 * (nk_decode_85_byte((char)src[1]) +
+
839  85 * (nk_decode_85_byte((char)src[2]) +
+
840  85 * (nk_decode_85_byte((char)src[3]) +
+
841  85 * nk_decode_85_byte((char)src[4]))));
+
842 
+
843  /* we can't assume little-endianess. */
+
844  dst[0] = (unsigned char)((tmp >> 0) & 0xFF);
+
845  dst[1] = (unsigned char)((tmp >> 8) & 0xFF);
+
846  dst[2] = (unsigned char)((tmp >> 16) & 0xFF);
+
847  dst[3] = (unsigned char)((tmp >> 24) & 0xFF);
+
848 
+
849  src += 5;
+
850  dst += 4;
+
851  }
+
852 }
+
853 
+
854 /* -------------------------------------------------------------
+
855  *
+
856  * FONT ATLAS
+
857  *
+
858  * --------------------------------------------------------------*/
+
859 NK_API struct nk_font_config
+
860 nk_font_config(float pixel_height)
+
861 {
+
862  struct nk_font_config cfg;
+
863  nk_zero_struct(cfg);
+
864  cfg.ttf_blob = 0;
+
865  cfg.ttf_size = 0;
+
866  cfg.ttf_data_owned_by_atlas = 0;
+
867  cfg.size = pixel_height;
+
868  cfg.oversample_h = 3;
+
869  cfg.oversample_v = 1;
+
870  cfg.pixel_snap = 0;
+
871  cfg.coord_type = NK_COORD_UV;
+
872  cfg.spacing = nk_vec2(0,0);
+
873  cfg.range = nk_font_default_glyph_ranges();
+
874  cfg.merge_mode = 0;
+
875  cfg.fallback_glyph = '?';
+
876  cfg.font = 0;
+
877  cfg.n = 0;
+
878  return cfg;
+
879 }
+
880 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
881 NK_API void
+
882 nk_font_atlas_init_default(struct nk_font_atlas *atlas)
+
883 {
+
884  NK_ASSERT(atlas);
+
885  if (!atlas) return;
+
886  nk_zero_struct(*atlas);
+
887  atlas->temporary.userdata.ptr = 0;
+
888  atlas->temporary.alloc = nk_malloc;
+
889  atlas->temporary.free = nk_mfree;
+
890  atlas->permanent.userdata.ptr = 0;
+
891  atlas->permanent.alloc = nk_malloc;
+
892  atlas->permanent.free = nk_mfree;
+
893 }
+
894 #endif
+
895 NK_API void
+
896 nk_font_atlas_init(struct nk_font_atlas *atlas, const struct nk_allocator *alloc)
+
897 {
+
898  NK_ASSERT(atlas);
+
899  NK_ASSERT(alloc);
+
900  if (!atlas || !alloc) return;
+
901  nk_zero_struct(*atlas);
+
902  atlas->permanent = *alloc;
+
903  atlas->temporary = *alloc;
+
904 }
+
905 NK_API void
+
906 nk_font_atlas_init_custom(struct nk_font_atlas *atlas,
+
907  const struct nk_allocator *permanent, const struct nk_allocator *temporary)
+
908 {
+
909  NK_ASSERT(atlas);
+
910  NK_ASSERT(permanent);
+
911  NK_ASSERT(temporary);
+
912  if (!atlas || !permanent || !temporary) return;
+
913  nk_zero_struct(*atlas);
+
914  atlas->permanent = *permanent;
+
915  atlas->temporary = *temporary;
+
916 }
+
917 NK_API void
+
918 nk_font_atlas_begin(struct nk_font_atlas *atlas)
+
919 {
+
920  NK_ASSERT(atlas);
+
921  NK_ASSERT(atlas->temporary.alloc && atlas->temporary.free);
+
922  NK_ASSERT(atlas->permanent.alloc && atlas->permanent.free);
+
923  if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free ||
+
924  !atlas->temporary.alloc || !atlas->temporary.free) return;
+
925  if (atlas->glyphs) {
+
926  atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
+
927  atlas->glyphs = 0;
+
928  }
+
929  if (atlas->pixel) {
+
930  atlas->permanent.free(atlas->permanent.userdata, atlas->pixel);
+
931  atlas->pixel = 0;
+
932  }
+
933 }
+
934 NK_API struct nk_font*
+
935 nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *config)
+
936 {
+
937  struct nk_font *font = 0;
+
938  struct nk_font_config *cfg;
+
939 
+
940  NK_ASSERT(atlas);
+
941  NK_ASSERT(atlas->permanent.alloc);
+
942  NK_ASSERT(atlas->permanent.free);
+
943  NK_ASSERT(atlas->temporary.alloc);
+
944  NK_ASSERT(atlas->temporary.free);
+
945 
+
946  NK_ASSERT(config);
+
947  NK_ASSERT(config->ttf_blob);
+
948  NK_ASSERT(config->ttf_size);
+
949  NK_ASSERT(config->size > 0.0f);
+
950 
+
951  if (!atlas || !config || !config->ttf_blob || !config->ttf_size || config->size <= 0.0f||
+
952  !atlas->permanent.alloc || !atlas->permanent.free ||
+
953  !atlas->temporary.alloc || !atlas->temporary.free)
+
954  return 0;
+
955 
+
956  /* allocate font config */
+
957  cfg = (struct nk_font_config*)
+
958  atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font_config));
+
959  NK_MEMCPY(cfg, config, sizeof(*config));
+
960  cfg->n = cfg;
+
961  cfg->p = cfg;
+
962 
+
963  if (!config->merge_mode) {
+
964  /* insert font config into list */
+
965  if (!atlas->config) {
+
966  atlas->config = cfg;
+
967  cfg->next = 0;
+
968  } else {
+
969  struct nk_font_config *i = atlas->config;
+
970  while (i->next) i = i->next;
+
971  i->next = cfg;
+
972  cfg->next = 0;
+
973  }
+
974  /* allocate new font */
+
975  font = (struct nk_font*)
+
976  atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font));
+
977  NK_ASSERT(font);
+
978  nk_zero(font, sizeof(*font));
+
979  if (!font) return 0;
+
980  font->config = cfg;
+
981 
+
982  /* insert font into list */
+
983  if (!atlas->fonts) {
+
984  atlas->fonts = font;
+
985  font->next = 0;
+
986  } else {
+
987  struct nk_font *i = atlas->fonts;
+
988  while (i->next) i = i->next;
+
989  i->next = font;
+
990  font->next = 0;
+
991  }
+
992  cfg->font = &font->info;
+
993  } else {
+
994  /* extend previously added font */
+
995  struct nk_font *f = 0;
+
996  struct nk_font_config *c = 0;
+
997  NK_ASSERT(atlas->font_num);
+
998  f = atlas->fonts;
+
999  c = f->config;
+
1000  cfg->font = &f->info;
+
1001 
+
1002  cfg->n = c;
+
1003  cfg->p = c->p;
+
1004  c->p->n = cfg;
+
1005  c->p = cfg;
+
1006  }
+
1007  /* create own copy of .TTF font blob */
+
1008  if (!config->ttf_data_owned_by_atlas) {
+
1009  cfg->ttf_blob = atlas->permanent.alloc(atlas->permanent.userdata,0, cfg->ttf_size);
+
1010  NK_ASSERT(cfg->ttf_blob);
+
1011  if (!cfg->ttf_blob) {
+
1012  atlas->font_num++;
+
1013  return 0;
+
1014  }
+
1015  NK_MEMCPY(cfg->ttf_blob, config->ttf_blob, cfg->ttf_size);
+
1016  cfg->ttf_data_owned_by_atlas = 1;
+
1017  }
+
1018  atlas->font_num++;
+
1019  return font;
+
1020 }
+
1021 NK_API struct nk_font*
+
1022 nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory,
+
1023  nk_size size, float height, const struct nk_font_config *config)
+
1024 {
+
1025  struct nk_font_config cfg;
+
1026  NK_ASSERT(memory);
+
1027  NK_ASSERT(size);
+
1028 
+
1029  NK_ASSERT(atlas);
+
1030  NK_ASSERT(atlas->temporary.alloc);
+
1031  NK_ASSERT(atlas->temporary.free);
+
1032  NK_ASSERT(atlas->permanent.alloc);
+
1033  NK_ASSERT(atlas->permanent.free);
+
1034  if (!atlas || !atlas->temporary.alloc || !atlas->temporary.free || !memory || !size ||
+
1035  !atlas->permanent.alloc || !atlas->permanent.free)
+
1036  return 0;
+
1037 
+
1038  cfg = (config) ? *config: nk_font_config(height);
+
1039  cfg.ttf_blob = memory;
+
1040  cfg.ttf_size = size;
+
1041  cfg.size = height;
+
1042  cfg.ttf_data_owned_by_atlas = 0;
+
1043  return nk_font_atlas_add(atlas, &cfg);
+
1044 }
+
1045 #ifdef NK_INCLUDE_STANDARD_IO
+
1046 NK_API struct nk_font*
+
1047 nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path,
+
1048  float height, const struct nk_font_config *config)
+
1049 {
+
1050  nk_size size;
+
1051  char *memory;
+
1052  struct nk_font_config cfg;
+
1053 
+
1054  NK_ASSERT(atlas);
+
1055  NK_ASSERT(atlas->temporary.alloc);
+
1056  NK_ASSERT(atlas->temporary.free);
+
1057  NK_ASSERT(atlas->permanent.alloc);
+
1058  NK_ASSERT(atlas->permanent.free);
+
1059 
+
1060  if (!atlas || !file_path) return 0;
+
1061  memory = nk_file_load(file_path, &size, &atlas->permanent);
+
1062  if (!memory) return 0;
+
1063 
+
1064  cfg = (config) ? *config: nk_font_config(height);
+
1065  cfg.ttf_blob = memory;
+
1066  cfg.ttf_size = size;
+
1067  cfg.size = height;
+
1068  cfg.ttf_data_owned_by_atlas = 1;
+
1069  return nk_font_atlas_add(atlas, &cfg);
+
1070 }
+
1071 #endif
+
1072 NK_API struct nk_font*
+
1073 nk_font_atlas_add_compressed(struct nk_font_atlas *atlas,
+
1074  void *compressed_data, nk_size compressed_size, float height,
+
1075  const struct nk_font_config *config)
+
1076 {
+
1077  unsigned int decompressed_size;
+
1078  void *decompressed_data;
+
1079  struct nk_font_config cfg;
+
1080 
+
1081  NK_ASSERT(atlas);
+
1082  NK_ASSERT(atlas->temporary.alloc);
+
1083  NK_ASSERT(atlas->temporary.free);
+
1084  NK_ASSERT(atlas->permanent.alloc);
+
1085  NK_ASSERT(atlas->permanent.free);
+
1086 
+
1087  NK_ASSERT(compressed_data);
+
1088  NK_ASSERT(compressed_size);
+
1089  if (!atlas || !compressed_data || !atlas->temporary.alloc || !atlas->temporary.free ||
+
1090  !atlas->permanent.alloc || !atlas->permanent.free)
+
1091  return 0;
+
1092 
+
1093  decompressed_size = nk_decompress_length((unsigned char*)compressed_data);
+
1094  decompressed_data = atlas->permanent.alloc(atlas->permanent.userdata,0,decompressed_size);
+
1095  NK_ASSERT(decompressed_data);
+
1096  if (!decompressed_data) return 0;
+
1097  nk_decompress((unsigned char*)decompressed_data, (unsigned char*)compressed_data,
+
1098  (unsigned int)compressed_size);
+
1099 
+
1100  cfg = (config) ? *config: nk_font_config(height);
+
1101  cfg.ttf_blob = decompressed_data;
+
1102  cfg.ttf_size = decompressed_size;
+
1103  cfg.size = height;
+
1104  cfg.ttf_data_owned_by_atlas = 1;
+
1105  return nk_font_atlas_add(atlas, &cfg);
+
1106 }
+
1107 NK_API struct nk_font*
+
1108 nk_font_atlas_add_compressed_base85(struct nk_font_atlas *atlas,
+
1109  const char *data_base85, float height, const struct nk_font_config *config)
+
1110 {
+
1111  int compressed_size;
+
1112  void *compressed_data;
+
1113  struct nk_font *font;
+
1114 
+
1115  NK_ASSERT(atlas);
+
1116  NK_ASSERT(atlas->temporary.alloc);
+
1117  NK_ASSERT(atlas->temporary.free);
+
1118  NK_ASSERT(atlas->permanent.alloc);
+
1119  NK_ASSERT(atlas->permanent.free);
+
1120 
+
1121  NK_ASSERT(data_base85);
+
1122  if (!atlas || !data_base85 || !atlas->temporary.alloc || !atlas->temporary.free ||
+
1123  !atlas->permanent.alloc || !atlas->permanent.free)
+
1124  return 0;
+
1125 
+
1126  compressed_size = (((int)nk_strlen(data_base85) + 4) / 5) * 4;
+
1127  compressed_data = atlas->temporary.alloc(atlas->temporary.userdata,0, (nk_size)compressed_size);
+
1128  NK_ASSERT(compressed_data);
+
1129  if (!compressed_data) return 0;
+
1130  nk_decode_85((unsigned char*)compressed_data, (const unsigned char*)data_base85);
+
1131  font = nk_font_atlas_add_compressed(atlas, compressed_data,
+
1132  (nk_size)compressed_size, height, config);
+
1133  atlas->temporary.free(atlas->temporary.userdata, compressed_data);
+
1134  return font;
+
1135 }
+
1136 
+
1137 #ifdef NK_INCLUDE_DEFAULT_FONT
+
1138 NK_API struct nk_font*
+
1139 nk_font_atlas_add_default(struct nk_font_atlas *atlas,
+
1140  float pixel_height, const struct nk_font_config *config)
+
1141 {
+
1142  NK_ASSERT(atlas);
+
1143  NK_ASSERT(atlas->temporary.alloc);
+
1144  NK_ASSERT(atlas->temporary.free);
+
1145  NK_ASSERT(atlas->permanent.alloc);
+
1146  NK_ASSERT(atlas->permanent.free);
+
1147  return nk_font_atlas_add_compressed_base85(atlas,
+
1148  nk_proggy_clean_ttf_compressed_data_base85, pixel_height, config);
+
1149 }
+
1150 #endif
+
1151 NK_API const void*
+
1152 nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height,
+
1153  enum nk_font_atlas_format fmt)
+
1154 {
+
1155  int i = 0;
+
1156  void *tmp = 0;
+
1157  nk_size tmp_size, img_size;
+
1158  struct nk_font *font_iter;
+
1159  struct nk_font_baker *baker;
+
1160 
+
1161  NK_ASSERT(atlas);
+
1162  NK_ASSERT(atlas->temporary.alloc);
+
1163  NK_ASSERT(atlas->temporary.free);
+
1164  NK_ASSERT(atlas->permanent.alloc);
+
1165  NK_ASSERT(atlas->permanent.free);
+
1166 
+
1167  NK_ASSERT(width);
+
1168  NK_ASSERT(height);
+
1169  if (!atlas || !width || !height ||
+
1170  !atlas->temporary.alloc || !atlas->temporary.free ||
+
1171  !atlas->permanent.alloc || !atlas->permanent.free)
+
1172  return 0;
+
1173 
+
1174 #ifdef NK_INCLUDE_DEFAULT_FONT
+
1175  /* no font added so just use default font */
+
1176  if (!atlas->font_num)
+
1177  atlas->default_font = nk_font_atlas_add_default(atlas, 13.0f, 0);
+
1178 #endif
+
1179  NK_ASSERT(atlas->font_num);
+
1180  if (!atlas->font_num) return 0;
+
1181 
+
1182  /* allocate temporary baker memory required for the baking process */
+
1183  nk_font_baker_memory(&tmp_size, &atlas->glyph_count, atlas->config, atlas->font_num);
+
1184  tmp = atlas->temporary.alloc(atlas->temporary.userdata,0, tmp_size);
+
1185  NK_ASSERT(tmp);
+
1186  if (!tmp) goto failed;
+
1187  NK_MEMSET(tmp,0,tmp_size);
+
1188 
+
1189  /* allocate glyph memory for all fonts */
+
1190  baker = nk_font_baker(tmp, atlas->glyph_count, atlas->font_num, &atlas->temporary);
+
1191  atlas->glyphs = (struct nk_font_glyph*)atlas->permanent.alloc(
+
1192  atlas->permanent.userdata,0, sizeof(struct nk_font_glyph)*(nk_size)atlas->glyph_count);
+
1193  NK_ASSERT(atlas->glyphs);
+
1194  if (!atlas->glyphs)
+
1195  goto failed;
+
1196 
+
1197  /* pack all glyphs into a tight fit space */
+
1198  atlas->custom.w = (NK_CURSOR_DATA_W*2)+1;
+
1199  atlas->custom.h = NK_CURSOR_DATA_H + 1;
+
1200  if (!nk_font_bake_pack(baker, &img_size, width, height, &atlas->custom,
+
1201  atlas->config, atlas->font_num, &atlas->temporary))
+
1202  goto failed;
+
1203 
+
1204  /* allocate memory for the baked image font atlas */
+
1205  atlas->pixel = atlas->temporary.alloc(atlas->temporary.userdata,0, img_size);
+
1206  NK_ASSERT(atlas->pixel);
+
1207  if (!atlas->pixel)
+
1208  goto failed;
+
1209 
+
1210  /* bake glyphs and custom white pixel into image */
+
1211  nk_font_bake(baker, atlas->pixel, *width, *height,
+
1212  atlas->glyphs, atlas->glyph_count, atlas->config, atlas->font_num);
+
1213  nk_font_bake_custom_data(atlas->pixel, *width, *height, atlas->custom,
+
1214  nk_custom_cursor_data, NK_CURSOR_DATA_W, NK_CURSOR_DATA_H, '.', 'X');
+
1215 
+
1216  if (fmt == NK_FONT_ATLAS_RGBA32) {
+
1217  /* convert alpha8 image into rgba32 image */
+
1218  void *img_rgba = atlas->temporary.alloc(atlas->temporary.userdata,0,
+
1219  (nk_size)(*width * *height * 4));
+
1220  NK_ASSERT(img_rgba);
+
1221  if (!img_rgba) goto failed;
+
1222  nk_font_bake_convert(img_rgba, *width, *height, atlas->pixel);
+
1223  atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
+
1224  atlas->pixel = img_rgba;
+
1225  }
+
1226  atlas->tex_width = *width;
+
1227  atlas->tex_height = *height;
+
1228 
+
1229  /* initialize each font */
+
1230  for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
+
1231  struct nk_font *font = font_iter;
+
1232  struct nk_font_config *config = font->config;
+
1233  nk_font_init(font, config->size, config->fallback_glyph, atlas->glyphs,
+
1234  config->font, nk_handle_ptr(0));
+
1235  }
+
1236 
+
1237  /* initialize each cursor */
+
1238  {NK_STORAGE const struct nk_vec2 nk_cursor_data[NK_CURSOR_COUNT][3] = {
+
1239  /* Pos Size Offset */
+
1240  {{ 0, 3}, {12,19}, { 0, 0}},
+
1241  {{13, 0}, { 7,16}, { 4, 8}},
+
1242  {{31, 0}, {23,23}, {11,11}},
+
1243  {{21, 0}, { 9, 23}, { 5,11}},
+
1244  {{55,18}, {23, 9}, {11, 5}},
+
1245  {{73, 0}, {17,17}, { 9, 9}},
+
1246  {{55, 0}, {17,17}, { 9, 9}}
+
1247  };
+
1248  for (i = 0; i < NK_CURSOR_COUNT; ++i) {
+
1249  struct nk_cursor *cursor = &atlas->cursors[i];
+
1250  cursor->img.w = (unsigned short)*width;
+
1251  cursor->img.h = (unsigned short)*height;
+
1252  cursor->img.region[0] = (unsigned short)(atlas->custom.x + nk_cursor_data[i][0].x);
+
1253  cursor->img.region[1] = (unsigned short)(atlas->custom.y + nk_cursor_data[i][0].y);
+
1254  cursor->img.region[2] = (unsigned short)nk_cursor_data[i][1].x;
+
1255  cursor->img.region[3] = (unsigned short)nk_cursor_data[i][1].y;
+
1256  cursor->size = nk_cursor_data[i][1];
+
1257  cursor->offset = nk_cursor_data[i][2];
+
1258  }}
+
1259  /* free temporary memory */
+
1260  atlas->temporary.free(atlas->temporary.userdata, tmp);
+
1261  return atlas->pixel;
+
1262 
+
1263 failed:
+
1264  /* error so cleanup all memory */
+
1265  if (tmp) atlas->temporary.free(atlas->temporary.userdata, tmp);
+
1266  if (atlas->glyphs) {
+
1267  atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
+
1268  atlas->glyphs = 0;
+
1269  }
+
1270  if (atlas->pixel) {
+
1271  atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
+
1272  atlas->pixel = 0;
+
1273  }
+
1274  return 0;
+
1275 }
+
1276 NK_API void
+
1277 nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
+
1278  struct nk_draw_null_texture *tex_null)
+
1279 {
+
1280  int i = 0;
+
1281  struct nk_font *font_iter;
+
1282  NK_ASSERT(atlas);
+
1283  if (!atlas) {
+
1284  if (!tex_null) return;
+
1285  tex_null->texture = texture;
+
1286  tex_null->uv = nk_vec2(0.5f,0.5f);
+
1287  }
+
1288  if (tex_null) {
+
1289  tex_null->texture = texture;
+
1290  tex_null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
+
1291  tex_null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
+
1292  }
+
1293  for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
+
1294  font_iter->texture = texture;
+
1295 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
1296  font_iter->handle.texture = texture;
+
1297 #endif
+
1298  }
+
1299  for (i = 0; i < NK_CURSOR_COUNT; ++i)
+
1300  atlas->cursors[i].img.handle = texture;
+
1301 
+
1302  atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
+
1303  atlas->pixel = 0;
+
1304  atlas->tex_width = 0;
+
1305  atlas->tex_height = 0;
+
1306  atlas->custom.x = 0;
+
1307  atlas->custom.y = 0;
+
1308  atlas->custom.w = 0;
+
1309  atlas->custom.h = 0;
+
1310 }
+
1311 NK_API void
+
1312 nk_font_atlas_cleanup(struct nk_font_atlas *atlas)
+
1313 {
+
1314  NK_ASSERT(atlas);
+
1315  NK_ASSERT(atlas->temporary.alloc);
+
1316  NK_ASSERT(atlas->temporary.free);
+
1317  NK_ASSERT(atlas->permanent.alloc);
+
1318  NK_ASSERT(atlas->permanent.free);
+
1319  if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
+
1320  if (atlas->config) {
+
1321  struct nk_font_config *iter;
+
1322  for (iter = atlas->config; iter; iter = iter->next) {
+
1323  struct nk_font_config *i;
+
1324  for (i = iter->n; i != iter; i = i->n) {
+
1325  atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
+
1326  i->ttf_blob = 0;
+
1327  }
+
1328  atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
+
1329  iter->ttf_blob = 0;
+
1330  }
+
1331  }
+
1332 }
+
1333 NK_API void
+
1334 nk_font_atlas_clear(struct nk_font_atlas *atlas)
+
1335 {
+
1336  NK_ASSERT(atlas);
+
1337  NK_ASSERT(atlas->temporary.alloc);
+
1338  NK_ASSERT(atlas->temporary.free);
+
1339  NK_ASSERT(atlas->permanent.alloc);
+
1340  NK_ASSERT(atlas->permanent.free);
+
1341  if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
+
1342 
+
1343  if (atlas->config) {
+
1344  struct nk_font_config *iter, *next;
+
1345  for (iter = atlas->config; iter; iter = next) {
+
1346  struct nk_font_config *i, *n;
+
1347  for (i = iter->n; i != iter; i = n) {
+
1348  n = i->n;
+
1349  if (i->ttf_blob)
+
1350  atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
+
1351  atlas->permanent.free(atlas->permanent.userdata, i);
+
1352  }
+
1353  next = iter->next;
+
1354  if (i->ttf_blob)
+
1355  atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
+
1356  atlas->permanent.free(atlas->permanent.userdata, iter);
+
1357  }
+
1358  atlas->config = 0;
+
1359  }
+
1360  if (atlas->fonts) {
+
1361  struct nk_font *iter, *next;
+
1362  for (iter = atlas->fonts; iter; iter = next) {
+
1363  next = iter->next;
+
1364  atlas->permanent.free(atlas->permanent.userdata, iter);
+
1365  }
+
1366  atlas->fonts = 0;
+
1367  }
+
1368  if (atlas->glyphs)
+
1369  atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
+
1370  nk_zero_struct(*atlas);
+
1371 }
+
1372 #endif
+
main API and documentation file
+
#define NK_UTF_INVALID
internal invalid utf8 rune
Definition: nuklear.h:5750
+ + + +
struct nk_vec2 uv
!< texture handle to a texture with a white pixel
Definition: nuklear.h:976
+ + + + + + + + + + +
+
+ + + + diff --git a/nuklear__group_8c_source.html b/nuklear__group_8c_source.html new file mode 100644 index 000000000..553aaa58e --- /dev/null +++ b/nuklear__group_8c_source.html @@ -0,0 +1,365 @@ + + + + + + + +Nuklear: src/nuklear_group.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_group.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * GROUP
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+ +
11  nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
+
12 {
+
13  struct nk_rect bounds;
+
14  struct nk_window panel;
+
15  struct nk_window *win;
+
16 
+
17  win = ctx->current;
+
18  nk_panel_alloc_space(&bounds, ctx);
+
19  {const struct nk_rect *c = &win->layout->clip;
+
20  if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) &&
+
21  !(flags & NK_WINDOW_MOVABLE)) {
+
22  return 0;
+
23  }}
+
24  if (win->flags & NK_WINDOW_ROM)
+
25  flags |= NK_WINDOW_ROM;
+
26 
+
27  /* initialize a fake window to create the panel from */
+
28  nk_zero(&panel, sizeof(panel));
+
29  panel.bounds = bounds;
+
30  panel.flags = flags;
+
31  panel.scrollbar.x = *x_offset;
+
32  panel.scrollbar.y = *y_offset;
+
33  panel.buffer = win->buffer;
+
34  panel.layout = (struct nk_panel*)nk_create_panel(ctx);
+
35  ctx->current = &panel;
+
36  nk_panel_begin(ctx, (flags & NK_WINDOW_TITLE) ? title: 0, NK_PANEL_GROUP);
+
37 
+
38  win->buffer = panel.buffer;
+
39  win->buffer.clip = panel.layout->clip;
+
40  panel.layout->offset_x = x_offset;
+
41  panel.layout->offset_y = y_offset;
+
42  panel.layout->parent = win->layout;
+
43  win->layout = panel.layout;
+
44 
+
45  ctx->current = win;
+
46  if ((panel.layout->flags & NK_WINDOW_CLOSED) ||
+
47  (panel.layout->flags & NK_WINDOW_MINIMIZED))
+
48  {
+
49  nk_flags f = panel.layout->flags;
+ +
51  if (f & NK_WINDOW_CLOSED)
+
52  return NK_WINDOW_CLOSED;
+
53  if (f & NK_WINDOW_MINIMIZED)
+
54  return NK_WINDOW_MINIMIZED;
+
55  }
+
56  return 1;
+
57 }
+
58 NK_API void
+ +
60 {
+
61  struct nk_window *win;
+
62  struct nk_panel *parent;
+
63  struct nk_panel *g;
+
64 
+
65  struct nk_rect clip;
+
66  struct nk_window pan;
+
67  struct nk_vec2 panel_padding;
+
68 
+
69  NK_ASSERT(ctx);
+
70  NK_ASSERT(ctx->current);
+
71  if (!ctx || !ctx->current)
+
72  return;
+
73 
+
74  /* make sure nk_group_begin was called correctly */
+
75  NK_ASSERT(ctx->current);
+
76  win = ctx->current;
+
77  NK_ASSERT(win->layout);
+
78  g = win->layout;
+
79  NK_ASSERT(g->parent);
+
80  parent = g->parent;
+
81 
+
82  /* dummy window */
+
83  nk_zero_struct(pan);
+
84  panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP);
+
85  pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h);
+
86  pan.bounds.x = g->bounds.x - panel_padding.x;
+
87  pan.bounds.w = g->bounds.w + 2 * panel_padding.x;
+
88  pan.bounds.h = g->bounds.h + g->header_height + g->menu.h;
+
89  if (g->flags & NK_WINDOW_BORDER) {
+
90  pan.bounds.x -= g->border;
+
91  pan.bounds.y -= g->border;
+
92  pan.bounds.w += 2*g->border;
+
93  pan.bounds.h += 2*g->border;
+
94  }
+
95  if (!(g->flags & NK_WINDOW_NO_SCROLLBAR)) {
+
96  pan.bounds.w += ctx->style.window.scrollbar_size.x;
+
97  pan.bounds.h += ctx->style.window.scrollbar_size.y;
+
98  }
+
99  pan.scrollbar.x = *g->offset_x;
+
100  pan.scrollbar.y = *g->offset_y;
+
101  pan.flags = g->flags;
+
102  pan.buffer = win->buffer;
+
103  pan.layout = g;
+
104  pan.parent = win;
+
105  ctx->current = &pan;
+
106 
+
107  /* make sure group has correct clipping rectangle */
+
108  nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y,
+
109  pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x);
+
110  nk_push_scissor(&pan.buffer, clip);
+
111  nk_end(ctx);
+
112 
+
113  win->buffer = pan.buffer;
+
114  nk_push_scissor(&win->buffer, parent->clip);
+
115  ctx->current = win;
+
116  win->layout = parent;
+
117  g->bounds = pan.bounds;
+
118  return;
+
119 }
+
120 NK_API nk_bool
+ +
122  struct nk_scroll *scroll, const char *title, nk_flags flags)
+
123 {
+
124  return nk_group_scrolled_offset_begin(ctx, &scroll->x, &scroll->y, title, flags);
+
125 }
+
126 NK_API nk_bool
+
127 nk_group_begin_titled(struct nk_context *ctx, const char *id,
+
128  const char *title, nk_flags flags)
+
129 {
+
130  int id_len;
+
131  nk_hash id_hash;
+
132  struct nk_window *win;
+
133  nk_uint *x_offset;
+
134  nk_uint *y_offset;
+
135 
+
136  NK_ASSERT(ctx);
+
137  NK_ASSERT(id);
+
138  NK_ASSERT(ctx->current);
+
139  NK_ASSERT(ctx->current->layout);
+
140  if (!ctx || !ctx->current || !ctx->current->layout || !id)
+
141  return 0;
+
142 
+
143  /* find persistent group scrollbar value */
+
144  win = ctx->current;
+
145  id_len = (int)nk_strlen(id);
+
146  id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+
147  x_offset = nk_find_value(win, id_hash);
+
148  if (!x_offset) {
+
149  x_offset = nk_add_value(ctx, win, id_hash, 0);
+
150  y_offset = nk_add_value(ctx, win, id_hash+1, 0);
+
151 
+
152  NK_ASSERT(x_offset);
+
153  NK_ASSERT(y_offset);
+
154  if (!x_offset || !y_offset) return 0;
+
155  *x_offset = *y_offset = 0;
+
156  } else y_offset = nk_find_value(win, id_hash+1);
+
157  return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
+
158 }
+
159 NK_API nk_bool
+
160 nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags)
+
161 {
+
162  return nk_group_begin_titled(ctx, title, title, flags);
+
163 }
+
164 NK_API void
+ +
166 {
+ +
168 }
+
169 NK_API void
+
170 nk_group_get_scroll(struct nk_context *ctx, const char *id, nk_uint *x_offset, nk_uint *y_offset)
+
171 {
+
172  int id_len;
+
173  nk_hash id_hash;
+
174  struct nk_window *win;
+
175  nk_uint *x_offset_ptr;
+
176  nk_uint *y_offset_ptr;
+
177 
+
178  NK_ASSERT(ctx);
+
179  NK_ASSERT(id);
+
180  NK_ASSERT(ctx->current);
+
181  NK_ASSERT(ctx->current->layout);
+
182  if (!ctx || !ctx->current || !ctx->current->layout || !id)
+
183  return;
+
184 
+
185  /* find persistent group scrollbar value */
+
186  win = ctx->current;
+
187  id_len = (int)nk_strlen(id);
+
188  id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+
189  x_offset_ptr = nk_find_value(win, id_hash);
+
190  if (!x_offset_ptr) {
+
191  x_offset_ptr = nk_add_value(ctx, win, id_hash, 0);
+
192  y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0);
+
193 
+
194  NK_ASSERT(x_offset_ptr);
+
195  NK_ASSERT(y_offset_ptr);
+
196  if (!x_offset_ptr || !y_offset_ptr) return;
+
197  *x_offset_ptr = *y_offset_ptr = 0;
+
198  } else y_offset_ptr = nk_find_value(win, id_hash+1);
+
199  if (x_offset)
+
200  *x_offset = *x_offset_ptr;
+
201  if (y_offset)
+
202  *y_offset = *y_offset_ptr;
+
203 }
+
204 NK_API void
+
205 nk_group_set_scroll(struct nk_context *ctx, const char *id, nk_uint x_offset, nk_uint y_offset)
+
206 {
+
207  int id_len;
+
208  nk_hash id_hash;
+
209  struct nk_window *win;
+
210  nk_uint *x_offset_ptr;
+
211  nk_uint *y_offset_ptr;
+
212 
+
213  NK_ASSERT(ctx);
+
214  NK_ASSERT(id);
+
215  NK_ASSERT(ctx->current);
+
216  NK_ASSERT(ctx->current->layout);
+
217  if (!ctx || !ctx->current || !ctx->current->layout || !id)
+
218  return;
+
219 
+
220  /* find persistent group scrollbar value */
+
221  win = ctx->current;
+
222  id_len = (int)nk_strlen(id);
+
223  id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+
224  x_offset_ptr = nk_find_value(win, id_hash);
+
225  if (!x_offset_ptr) {
+
226  x_offset_ptr = nk_add_value(ctx, win, id_hash, 0);
+
227  y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0);
+
228 
+
229  NK_ASSERT(x_offset_ptr);
+
230  NK_ASSERT(y_offset_ptr);
+
231  if (!x_offset_ptr || !y_offset_ptr) return;
+
232  *x_offset_ptr = *y_offset_ptr = 0;
+
233  } else y_offset_ptr = nk_find_value(win, id_hash+1);
+
234  *x_offset_ptr = x_offset;
+
235  *y_offset_ptr = y_offset;
+
236 }
+
main API and documentation file
+
NK_API nk_bool nk_group_begin(struct nk_context *, const char *title, nk_flags)
Starts a new widget group.
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_group_scrolled_end(struct nk_context *)
Definition: nuklear_group.c:59
+
NK_API void nk_group_get_scroll(struct nk_context *, const char *id, nk_uint *x_offset, nk_uint *y_offset)
+
NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
Definition: nuklear_group.c:10
+
NK_API nk_bool nk_group_begin_titled(struct nk_context *, const char *name, const char *title, nk_flags)
Starts a new widget group.
+
NK_API void nk_group_set_scroll(struct nk_context *, const char *id, nk_uint x_offset, nk_uint y_offset)
+
NK_API void nk_end(struct nk_context *ctx)
+
NK_API void nk_group_end(struct nk_context *)
+
NK_API nk_bool nk_group_scrolled_begin(struct nk_context *, struct nk_scroll *off, const char *title, nk_flags)
+ + + + + + +
+
+ + + + diff --git a/nuklear__image_8c_source.html b/nuklear__image_8c_source.html new file mode 100644 index 000000000..3f1de6fe6 --- /dev/null +++ b/nuklear__image_8c_source.html @@ -0,0 +1,257 @@ + + + + + + + +Nuklear: src/nuklear_image.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_image.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * IMAGE
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_handle
+
10 nk_handle_ptr(void *ptr)
+
11 {
+
12  nk_handle handle = {0};
+
13  handle.ptr = ptr;
+
14  return handle;
+
15 }
+
16 NK_API nk_handle
+
17 nk_handle_id(int id)
+
18 {
+
19  nk_handle handle;
+
20  nk_zero_struct(handle);
+
21  handle.id = id;
+
22  return handle;
+
23 }
+
24 NK_API struct nk_image
+
25 nk_subimage_ptr(void *ptr, nk_ushort w, nk_ushort h, struct nk_rect r)
+
26 {
+
27  struct nk_image s;
+
28  nk_zero(&s, sizeof(s));
+
29  s.handle.ptr = ptr;
+
30  s.w = w; s.h = h;
+
31  s.region[0] = (nk_ushort)r.x;
+
32  s.region[1] = (nk_ushort)r.y;
+
33  s.region[2] = (nk_ushort)r.w;
+
34  s.region[3] = (nk_ushort)r.h;
+
35  return s;
+
36 }
+
37 NK_API struct nk_image
+
38 nk_subimage_id(int id, nk_ushort w, nk_ushort h, struct nk_rect r)
+
39 {
+
40  struct nk_image s;
+
41  nk_zero(&s, sizeof(s));
+
42  s.handle.id = id;
+
43  s.w = w; s.h = h;
+
44  s.region[0] = (nk_ushort)r.x;
+
45  s.region[1] = (nk_ushort)r.y;
+
46  s.region[2] = (nk_ushort)r.w;
+
47  s.region[3] = (nk_ushort)r.h;
+
48  return s;
+
49 }
+
50 NK_API struct nk_image
+
51 nk_subimage_handle(nk_handle handle, nk_ushort w, nk_ushort h, struct nk_rect r)
+
52 {
+
53  struct nk_image s;
+
54  nk_zero(&s, sizeof(s));
+
55  s.handle = handle;
+
56  s.w = w; s.h = h;
+
57  s.region[0] = (nk_ushort)r.x;
+
58  s.region[1] = (nk_ushort)r.y;
+
59  s.region[2] = (nk_ushort)r.w;
+
60  s.region[3] = (nk_ushort)r.h;
+
61  return s;
+
62 }
+
63 NK_API struct nk_image
+
64 nk_image_handle(nk_handle handle)
+
65 {
+
66  struct nk_image s;
+
67  nk_zero(&s, sizeof(s));
+
68  s.handle = handle;
+
69  s.w = 0; s.h = 0;
+
70  s.region[0] = 0;
+
71  s.region[1] = 0;
+
72  s.region[2] = 0;
+
73  s.region[3] = 0;
+
74  return s;
+
75 }
+
76 NK_API struct nk_image
+
77 nk_image_ptr(void *ptr)
+
78 {
+
79  struct nk_image s;
+
80  nk_zero(&s, sizeof(s));
+
81  NK_ASSERT(ptr);
+
82  s.handle.ptr = ptr;
+
83  s.w = 0; s.h = 0;
+
84  s.region[0] = 0;
+
85  s.region[1] = 0;
+
86  s.region[2] = 0;
+
87  s.region[3] = 0;
+
88  return s;
+
89 }
+
90 NK_API struct nk_image
+
91 nk_image_id(int id)
+
92 {
+
93  struct nk_image s;
+
94  nk_zero(&s, sizeof(s));
+
95  s.handle.id = id;
+
96  s.w = 0; s.h = 0;
+
97  s.region[0] = 0;
+
98  s.region[1] = 0;
+
99  s.region[2] = 0;
+
100  s.region[3] = 0;
+
101  return s;
+
102 }
+
103 NK_API nk_bool
+
104 nk_image_is_subimage(const struct nk_image* img)
+
105 {
+
106  NK_ASSERT(img);
+
107  return !(img->w == 0 && img->h == 0);
+
108 }
+
109 NK_API void
+
110 nk_image(struct nk_context *ctx, struct nk_image img)
+
111 {
+
112  struct nk_window *win;
+
113  struct nk_rect bounds;
+
114 
+
115  NK_ASSERT(ctx);
+
116  NK_ASSERT(ctx->current);
+
117  NK_ASSERT(ctx->current->layout);
+
118  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
119 
+
120  win = ctx->current;
+
121  if (!nk_widget(&bounds, ctx)) return;
+
122  nk_draw_image(&win->buffer, bounds, &img, nk_white);
+
123 }
+
124 NK_API void
+
125 nk_image_color(struct nk_context *ctx, struct nk_image img, struct nk_color col)
+
126 {
+
127  struct nk_window *win;
+
128  struct nk_rect bounds;
+
129 
+
130  NK_ASSERT(ctx);
+
131  NK_ASSERT(ctx->current);
+
132  NK_ASSERT(ctx->current->layout);
+
133  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
134 
+
135  win = ctx->current;
+
136  if (!nk_widget(&bounds, ctx)) return;
+
137  nk_draw_image(&win->buffer, bounds, &img, col);
+
138 }
+
139 
+
main API and documentation file
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+ + + + + + +
+
+ + + + diff --git a/nuklear__input_8c_source.html b/nuklear__input_8c_source.html new file mode 100644 index 000000000..1ee302f03 --- /dev/null +++ b/nuklear__input_8c_source.html @@ -0,0 +1,411 @@ + + + + + + + +Nuklear: src/nuklear_input.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_input.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * INPUT
+
7  *
+
8  * ===============================================================*/
+
9 NK_API void
+ +
11 {
+
12  int i;
+
13  struct nk_input *in;
+
14  NK_ASSERT(ctx);
+
15  if (!ctx) return;
+
16  in = &ctx->input;
+
17  for (i = 0; i < NK_BUTTON_MAX; ++i)
+
18  in->mouse.buttons[i].clicked = 0;
+
19 
+
20  in->keyboard.text_len = 0;
+
21  in->mouse.scroll_delta = nk_vec2(0,0);
+
22  in->mouse.prev.x = in->mouse.pos.x;
+
23  in->mouse.prev.y = in->mouse.pos.y;
+
24  in->mouse.delta.x = 0;
+
25  in->mouse.delta.y = 0;
+
26  for (i = 0; i < NK_KEY_MAX; i++)
+
27  in->keyboard.keys[i].clicked = 0;
+
28 }
+
29 NK_API void
+ +
31 {
+
32  struct nk_input *in;
+
33  NK_ASSERT(ctx);
+
34  if (!ctx) return;
+
35  in = &ctx->input;
+
36  if (in->mouse.grab)
+
37  in->mouse.grab = 0;
+
38  if (in->mouse.ungrab) {
+
39  in->mouse.grabbed = 0;
+
40  in->mouse.ungrab = 0;
+
41  in->mouse.grab = 0;
+
42  }
+
43 }
+
44 NK_API void
+
45 nk_input_motion(struct nk_context *ctx, int x, int y)
+
46 {
+
47  struct nk_input *in;
+
48  NK_ASSERT(ctx);
+
49  if (!ctx) return;
+
50  in = &ctx->input;
+
51  in->mouse.pos.x = (float)x;
+
52  in->mouse.pos.y = (float)y;
+
53  in->mouse.delta.x = in->mouse.pos.x - in->mouse.prev.x;
+
54  in->mouse.delta.y = in->mouse.pos.y - in->mouse.prev.y;
+
55 }
+
56 NK_API void
+
57 nk_input_key(struct nk_context *ctx, enum nk_keys key, nk_bool down)
+
58 {
+
59  struct nk_input *in;
+
60  NK_ASSERT(ctx);
+
61  if (!ctx) return;
+
62  in = &ctx->input;
+
63 #ifdef NK_KEYSTATE_BASED_INPUT
+
64  if (in->keyboard.keys[key].down != down)
+
65  in->keyboard.keys[key].clicked++;
+
66 #else
+
67  in->keyboard.keys[key].clicked++;
+
68 #endif
+
69  in->keyboard.keys[key].down = down;
+
70 }
+
71 NK_API void
+
72 nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, nk_bool down)
+
73 {
+
74  struct nk_mouse_button *btn;
+
75  struct nk_input *in;
+
76  NK_ASSERT(ctx);
+
77  if (!ctx) return;
+
78  in = &ctx->input;
+
79  if (in->mouse.buttons[id].down == down) return;
+
80 
+
81  btn = &in->mouse.buttons[id];
+
82  btn->clicked_pos.x = (float)x;
+
83  btn->clicked_pos.y = (float)y;
+
84  btn->down = down;
+
85  btn->clicked++;
+
86 
+
87  /* Fix Click-Drag for touch events. */
+
88  in->mouse.delta.x = 0;
+
89  in->mouse.delta.y = 0;
+
90 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+
91  if (down == 1 && id == NK_BUTTON_LEFT)
+
92  {
+
93  in->mouse.down_pos.x = btn->clicked_pos.x;
+
94  in->mouse.down_pos.y = btn->clicked_pos.y;
+
95  }
+
96 #endif
+
97 }
+
98 NK_API void
+
99 nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val)
+
100 {
+
101  NK_ASSERT(ctx);
+
102  if (!ctx) return;
+
103  ctx->input.mouse.scroll_delta.x += val.x;
+
104  ctx->input.mouse.scroll_delta.y += val.y;
+
105 }
+
106 NK_API void
+
107 nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
+
108 {
+
109  int len = 0;
+
110  nk_rune unicode;
+
111  struct nk_input *in;
+
112 
+
113  NK_ASSERT(ctx);
+
114  if (!ctx) return;
+
115  in = &ctx->input;
+
116 
+
117  len = nk_utf_decode(glyph, &unicode, NK_UTF_SIZE);
+
118  if (len && ((in->keyboard.text_len + len) < NK_INPUT_MAX)) {
+
119  nk_utf_encode(unicode, &in->keyboard.text[in->keyboard.text_len],
+
120  NK_INPUT_MAX - in->keyboard.text_len);
+
121  in->keyboard.text_len += len;
+
122  }
+
123 }
+
124 NK_API void
+
125 nk_input_char(struct nk_context *ctx, char c)
+
126 {
+
127  nk_glyph glyph;
+
128  NK_ASSERT(ctx);
+
129  if (!ctx) return;
+
130  glyph[0] = c;
+
131  nk_input_glyph(ctx, glyph);
+
132 }
+
133 NK_API void
+
134 nk_input_unicode(struct nk_context *ctx, nk_rune unicode)
+
135 {
+
136  nk_glyph rune;
+
137  NK_ASSERT(ctx);
+
138  if (!ctx) return;
+
139  nk_utf_encode(unicode, rune, NK_UTF_SIZE);
+
140  nk_input_glyph(ctx, rune);
+
141 }
+
142 NK_API nk_bool
+
143 nk_input_has_mouse_click(const struct nk_input *i, enum nk_buttons id)
+
144 {
+
145  const struct nk_mouse_button *btn;
+
146  if (!i) return nk_false;
+
147  btn = &i->mouse.buttons[id];
+
148  return (btn->clicked && btn->down == nk_false) ? nk_true : nk_false;
+
149 }
+
150 NK_API nk_bool
+
151 nk_input_has_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
+
152  struct nk_rect b)
+
153 {
+
154  const struct nk_mouse_button *btn;
+
155  if (!i) return nk_false;
+
156  btn = &i->mouse.buttons[id];
+
157  if (!NK_INBOX(btn->clicked_pos.x,btn->clicked_pos.y,b.x,b.y,b.w,b.h))
+
158  return nk_false;
+
159  return nk_true;
+
160 }
+
161 NK_API nk_bool
+
162 nk_input_has_mouse_click_in_button_rect(const struct nk_input *i, enum nk_buttons id,
+
163  struct nk_rect b)
+
164 {
+
165  const struct nk_mouse_button *btn;
+
166  if (!i) return nk_false;
+
167  btn = &i->mouse.buttons[id];
+
168 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+
169  if (!NK_INBOX(btn->clicked_pos.x,btn->clicked_pos.y,b.x,b.y,b.w,b.h)
+
170  || !NK_INBOX(i->mouse.down_pos.x,i->mouse.down_pos.y,b.x,b.y,b.w,b.h))
+
171 #else
+
172  if (!NK_INBOX(btn->clicked_pos.x,btn->clicked_pos.y,b.x,b.y,b.w,b.h))
+
173 #endif
+
174  return nk_false;
+
175  return nk_true;
+
176 }
+
177 NK_API nk_bool
+
178 nk_input_has_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
+
179  struct nk_rect b, nk_bool down)
+
180 {
+
181  const struct nk_mouse_button *btn;
+
182  if (!i) return nk_false;
+
183  btn = &i->mouse.buttons[id];
+
184  return nk_input_has_mouse_click_in_rect(i, id, b) && (btn->down == down);
+
185 }
+
186 NK_API nk_bool
+
187 nk_input_is_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
+
188  struct nk_rect b)
+
189 {
+
190  const struct nk_mouse_button *btn;
+
191  if (!i) return nk_false;
+
192  btn = &i->mouse.buttons[id];
+
193  return (nk_input_has_mouse_click_down_in_rect(i, id, b, nk_false) &&
+
194  btn->clicked) ? nk_true : nk_false;
+
195 }
+
196 NK_API nk_bool
+
197 nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
+
198  struct nk_rect b, nk_bool down)
+
199 {
+
200  const struct nk_mouse_button *btn;
+
201  if (!i) return nk_false;
+
202  btn = &i->mouse.buttons[id];
+
203  return (nk_input_has_mouse_click_down_in_rect(i, id, b, down) &&
+
204  btn->clicked) ? nk_true : nk_false;
+
205 }
+
206 NK_API nk_bool
+
207 nk_input_any_mouse_click_in_rect(const struct nk_input *in, struct nk_rect b)
+
208 {
+
209  int i, down = 0;
+
210  for (i = 0; i < NK_BUTTON_MAX; ++i)
+
211  down = down || nk_input_is_mouse_click_in_rect(in, (enum nk_buttons)i, b);
+
212  return down;
+
213 }
+
214 NK_API nk_bool
+
215 nk_input_is_mouse_hovering_rect(const struct nk_input *i, struct nk_rect rect)
+
216 {
+
217  if (!i) return nk_false;
+
218  return NK_INBOX(i->mouse.pos.x, i->mouse.pos.y, rect.x, rect.y, rect.w, rect.h);
+
219 }
+
220 NK_API nk_bool
+
221 nk_input_is_mouse_prev_hovering_rect(const struct nk_input *i, struct nk_rect rect)
+
222 {
+
223  if (!i) return nk_false;
+
224  return NK_INBOX(i->mouse.prev.x, i->mouse.prev.y, rect.x, rect.y, rect.w, rect.h);
+
225 }
+
226 NK_API nk_bool
+
227 nk_input_mouse_clicked(const struct nk_input *i, enum nk_buttons id, struct nk_rect rect)
+
228 {
+
229  if (!i) return nk_false;
+
230  if (!nk_input_is_mouse_hovering_rect(i, rect)) return nk_false;
+
231  return nk_input_is_mouse_click_in_rect(i, id, rect);
+
232 }
+
233 NK_API nk_bool
+
234 nk_input_is_mouse_down(const struct nk_input *i, enum nk_buttons id)
+
235 {
+
236  if (!i) return nk_false;
+
237  return i->mouse.buttons[id].down;
+
238 }
+
239 NK_API nk_bool
+
240 nk_input_is_mouse_pressed(const struct nk_input *i, enum nk_buttons id)
+
241 {
+
242  const struct nk_mouse_button *b;
+
243  if (!i) return nk_false;
+
244  b = &i->mouse.buttons[id];
+
245  if (b->down && b->clicked)
+
246  return nk_true;
+
247  return nk_false;
+
248 }
+
249 NK_API nk_bool
+
250 nk_input_is_mouse_released(const struct nk_input *i, enum nk_buttons id)
+
251 {
+
252  if (!i) return nk_false;
+
253  return (!i->mouse.buttons[id].down && i->mouse.buttons[id].clicked);
+
254 }
+
255 NK_API nk_bool
+
256 nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key)
+
257 {
+
258  const struct nk_key *k;
+
259  if (!i) return nk_false;
+
260  k = &i->keyboard.keys[key];
+
261  if ((k->down && k->clicked) || (!k->down && k->clicked >= 2))
+
262  return nk_true;
+
263  return nk_false;
+
264 }
+
265 NK_API nk_bool
+
266 nk_input_is_key_released(const struct nk_input *i, enum nk_keys key)
+
267 {
+
268  const struct nk_key *k;
+
269  if (!i) return nk_false;
+
270  k = &i->keyboard.keys[key];
+
271  if ((!k->down && k->clicked) || (k->down && k->clicked >= 2))
+
272  return nk_true;
+
273  return nk_false;
+
274 }
+
275 NK_API nk_bool
+
276 nk_input_is_key_down(const struct nk_input *i, enum nk_keys key)
+
277 {
+
278  const struct nk_key *k;
+
279  if (!i) return nk_false;
+
280  k = &i->keyboard.keys[key];
+
281  if (k->down) return nk_true;
+
282  return nk_false;
+
283 }
+
284 
+
main API and documentation file
+
NK_API void nk_input_end(struct nk_context *)
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not g...
Definition: nuklear_input.c:30
+
NK_API void nk_input_begin(struct nk_context *)
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movem...
Definition: nuklear_input.c:10
+
#define NK_UTF_SIZE
describes the number of bytes a glyph consists of
Definition: nuklear.h:22
+
NK_API void nk_input_unicode(struct nk_context *, nk_rune)
Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.
+
NK_API void nk_input_key(struct nk_context *, enum nk_keys, nk_bool down)
Mirrors the state of a specific key to nuklear.
Definition: nuklear_input.c:57
+
NK_API void nk_input_button(struct nk_context *, enum nk_buttons, int x, int y, nk_bool down)
Mirrors the state of a specific mouse button to nuklear.
Definition: nuklear_input.c:72
+
NK_API void nk_input_char(struct nk_context *, char)
Copies a single ASCII character into an internal text buffer.
+
NK_API void nk_input_scroll(struct nk_context *, struct nk_vec2 val)
Copies the last mouse scroll value to nuklear.
Definition: nuklear_input.c:99
+
NK_API void nk_input_motion(struct nk_context *, int x, int y)
Mirrors current mouse position to nuklear.
Definition: nuklear_input.c:45
+
NK_API void nk_input_glyph(struct nk_context *, const nk_glyph)
Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.
+ + + + + + +
+
+ + + + diff --git a/nuklear__internal_8h_source.html b/nuklear__internal_8h_source.html new file mode 100644 index 000000000..554188ee4 --- /dev/null +++ b/nuklear__internal_8h_source.html @@ -0,0 +1,509 @@ + + + + + + + +Nuklear: src/nuklear_internal.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_internal.h
+
+
+
1 #ifndef NK_INTERNAL_H
+
2 #define NK_INTERNAL_H
+
3 
+
4 #ifndef NK_POOL_DEFAULT_CAPACITY
+
5 #define NK_POOL_DEFAULT_CAPACITY 16
+
6 #endif
+
7 
+
8 #ifndef NK_DEFAULT_COMMAND_BUFFER_SIZE
+
9 #define NK_DEFAULT_COMMAND_BUFFER_SIZE (4*1024)
+
10 #endif
+
11 
+
12 #ifndef NK_BUFFER_DEFAULT_INITIAL_SIZE
+
13 #define NK_BUFFER_DEFAULT_INITIAL_SIZE (4*1024)
+
14 #endif
+
15 
+
16 /* standard library headers */
+
17 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
18 #include <stdlib.h> /* malloc, free */
+
19 #endif
+
20 #ifdef NK_INCLUDE_STANDARD_IO
+
21 #include <stdio.h> /* fopen, fclose,... */
+
22 #endif
+
23 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
24 #include <stdarg.h> /* valist, va_start, va_end, ... */
+
25 #endif
+
26 #ifndef NK_ASSERT
+
27 #include <assert.h>
+
28 #define NK_ASSERT(expr) assert(expr)
+
29 #endif
+
30 
+
31 #define NK_DEFAULT (-1)
+
32 
+
33 #ifndef NK_VSNPRINTF
+
34 /* If your compiler does support `vsnprintf` I would highly recommend
+
35  * defining this to vsnprintf instead since `vsprintf` is basically
+
36  * unbelievable unsafe and should *NEVER* be used. But I have to support
+
37  * it since C89 only provides this unsafe version. */
+
38  #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) ||\
+
39  (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
+
40  (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) ||\
+
41  (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) ||\
+
42  defined(_ISOC99_SOURCE) || defined(_BSD_SOURCE)
+
43  #define NK_VSNPRINTF(s,n,f,a) vsnprintf(s,n,f,a)
+
44  #else
+
45  #define NK_VSNPRINTF(s,n,f,a) vsprintf(s,f,a)
+
46  #endif
+
47 #endif
+
48 
+
49 #define NK_SCHAR_MIN (-127)
+
50 #define NK_SCHAR_MAX 127
+
51 #define NK_UCHAR_MIN 0
+
52 #define NK_UCHAR_MAX 256
+
53 #define NK_SSHORT_MIN (-32767)
+
54 #define NK_SSHORT_MAX 32767
+
55 #define NK_USHORT_MIN 0
+
56 #define NK_USHORT_MAX 65535
+
57 #define NK_SINT_MIN (-2147483647)
+
58 #define NK_SINT_MAX 2147483647
+
59 #define NK_UINT_MIN 0
+
60 #define NK_UINT_MAX 4294967295u
+
61 
+
62 /* Make sure correct type size:
+
63  * This will fire with a negative subscript error if the type sizes
+
64  * are set incorrectly by the compiler, and compile out if not */
+
65 NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
+
66 NK_STATIC_ASSERT(sizeof(nk_ptr) == sizeof(void*));
+
67 NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
+
68 NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
+
69 NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
+
70 NK_STATIC_ASSERT(sizeof(nk_short) == 2);
+
71 NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
+
72 NK_STATIC_ASSERT(sizeof(nk_int) == 4);
+
73 NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
+
74 #ifdef NK_INCLUDE_STANDARD_BOOL
+
75 NK_STATIC_ASSERT(sizeof(nk_bool) == sizeof(bool));
+
76 #else
+
77 NK_STATIC_ASSERT(sizeof(nk_bool) == 4);
+
78 #endif
+
79 
+
80 NK_GLOBAL const struct nk_rect nk_null_rect = {-8192.0f, -8192.0f, 16384, 16384};
+
81 #define NK_FLOAT_PRECISION 0.00000000000001
+
82 
+
83 NK_GLOBAL const struct nk_color nk_red = {255,0,0,255};
+
84 NK_GLOBAL const struct nk_color nk_green = {0,255,0,255};
+
85 NK_GLOBAL const struct nk_color nk_blue = {0,0,255,255};
+
86 NK_GLOBAL const struct nk_color nk_white = {255,255,255,255};
+
87 NK_GLOBAL const struct nk_color nk_black = {0,0,0,255};
+
88 NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
+
89 
+
90 /* widget */
+
91 #define nk_widget_state_reset(s)\
+
92  if ((*(s)) & NK_WIDGET_STATE_MODIFIED)\
+
93  (*(s)) = NK_WIDGET_STATE_INACTIVE|NK_WIDGET_STATE_MODIFIED;\
+
94  else (*(s)) = NK_WIDGET_STATE_INACTIVE;
+
95 
+
96 /* math */
+
97 #ifndef NK_INV_SQRT
+
98 NK_LIB float nk_inv_sqrt(float n);
+
99 #endif
+
100 #ifndef NK_SIN
+
101 NK_LIB float nk_sin(float x);
+
102 #endif
+
103 #ifndef NK_COS
+
104 NK_LIB float nk_cos(float x);
+
105 #endif
+
106 #ifndef NK_ATAN
+
107 NK_LIB float nk_atan(float x);
+
108 #endif
+
109 #ifndef NK_ATAN2
+
110 NK_LIB float nk_atan2(float y, float x);
+
111 #endif
+
112 NK_LIB nk_uint nk_round_up_pow2(nk_uint v);
+
113 NK_LIB struct nk_rect nk_shrink_rect(struct nk_rect r, float amount);
+
114 NK_LIB struct nk_rect nk_pad_rect(struct nk_rect r, struct nk_vec2 pad);
+
115 NK_LIB void nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0, float x1, float y1);
+
116 NK_LIB double nk_pow(double x, int n);
+
117 NK_LIB int nk_ifloord(double x);
+
118 NK_LIB int nk_ifloorf(float x);
+
119 NK_LIB int nk_iceilf(float x);
+
120 NK_LIB int nk_log10(double n);
+
121 NK_LIB float nk_roundf(float x);
+
122 
+
123 /* util */
+
124 enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE};
+
125 NK_LIB nk_bool nk_is_lower(int c);
+
126 NK_LIB nk_bool nk_is_upper(int c);
+
127 NK_LIB int nk_to_upper(int c);
+
128 NK_LIB int nk_to_lower(int c);
+
129 
+
130 #ifndef NK_MEMCPY
+
131 NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
+
132 #endif
+
133 #ifndef NK_MEMSET
+
134 NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
+
135 #endif
+
136 NK_LIB void nk_zero(void *ptr, nk_size size);
+
137 NK_LIB char *nk_itoa(char *s, long n);
+
138 NK_LIB int nk_string_float_limit(char *string, int prec);
+
139 #ifndef NK_DTOA
+
140 NK_LIB char *nk_dtoa(char *s, double n);
+
141 #endif
+
142 NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
+
143 NK_LIB struct nk_vec2 nk_text_calculate_text_bounds(const struct nk_user_font *font, const char *begin, int byte_len, float row_height, const char **remaining, struct nk_vec2 *out_offset, int *glyphs, int op);
+
144 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
145 NK_LIB int nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args);
+
146 #endif
+
147 #ifdef NK_INCLUDE_STANDARD_IO
+
148 NK_LIB char *nk_file_load(const char* path, nk_size* siz, const struct nk_allocator *alloc);
+
149 #endif
+
150 
+
151 /* buffer */
+
152 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
153 NK_LIB void* nk_malloc(nk_handle unused, void *old,nk_size size);
+
154 NK_LIB void nk_mfree(nk_handle unused, void *ptr);
+
155 #endif
+
156 NK_LIB void* nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment, enum nk_buffer_allocation_type type);
+
157 NK_LIB void* nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type, nk_size size, nk_size align);
+
158 NK_LIB void* nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size);
+
159 
+
160 /* draw */
+
161 NK_LIB void nk_command_buffer_init(struct nk_command_buffer *cb, struct nk_buffer *b, enum nk_command_clipping clip);
+
162 NK_LIB void nk_command_buffer_reset(struct nk_command_buffer *b);
+
163 NK_LIB void* nk_command_buffer_push(struct nk_command_buffer* b, enum nk_command_type t, nk_size size);
+
164 NK_LIB void nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type, struct nk_rect content, struct nk_color background, struct nk_color foreground, float border_width, const struct nk_user_font *font);
+
165 
+
166 /* buffering */
+
167 NK_LIB void nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *b);
+
168 NK_LIB void nk_start(struct nk_context *ctx, struct nk_window *win);
+
169 NK_LIB void nk_start_popup(struct nk_context *ctx, struct nk_window *win);
+
170 NK_LIB void nk_finish_popup(struct nk_context *ctx, struct nk_window*);
+
171 NK_LIB void nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *b);
+
172 NK_LIB void nk_finish(struct nk_context *ctx, struct nk_window *w);
+
173 NK_LIB void nk_build(struct nk_context *ctx);
+
174 
+
175 /* text editor */
+
176 NK_LIB void nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type, nk_plugin_filter filter);
+
177 NK_LIB void nk_textedit_click(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height);
+
178 NK_LIB void nk_textedit_drag(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height);
+
179 NK_LIB void nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod, const struct nk_user_font *font, float row_height);
+
180 
+
181 /* window */
+
182 enum nk_window_insert_location {
+
183  NK_INSERT_BACK, /* inserts window into the back of list (front of screen) */
+
184  NK_INSERT_FRONT /* inserts window into the front of list (back of screen) */
+
185 };
+
186 NK_LIB void *nk_create_window(struct nk_context *ctx);
+
187 NK_LIB void nk_remove_window(struct nk_context*, struct nk_window*);
+
188 NK_LIB void nk_free_window(struct nk_context *ctx, struct nk_window *win);
+
189 NK_LIB struct nk_window *nk_find_window(const struct nk_context *ctx, nk_hash hash, const char *name);
+
190 NK_LIB void nk_insert_window(struct nk_context *ctx, struct nk_window *win, enum nk_window_insert_location loc);
+
191 
+
192 /* pool */
+
193 NK_LIB void nk_pool_init(struct nk_pool *pool, const struct nk_allocator *alloc, unsigned int capacity);
+
194 NK_LIB void nk_pool_free(struct nk_pool *pool);
+
195 NK_LIB void nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size);
+
196 NK_LIB struct nk_page_element *nk_pool_alloc(struct nk_pool *pool);
+
197 
+
198 /* page-element */
+
199 NK_LIB struct nk_page_element* nk_create_page_element(struct nk_context *ctx);
+
200 NK_LIB void nk_link_page_element_into_freelist(struct nk_context *ctx, struct nk_page_element *elem);
+
201 NK_LIB void nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem);
+
202 
+
203 /* table */
+
204 NK_LIB struct nk_table* nk_create_table(struct nk_context *ctx);
+
205 NK_LIB void nk_remove_table(struct nk_window *win, struct nk_table *tbl);
+
206 NK_LIB void nk_free_table(struct nk_context *ctx, struct nk_table *tbl);
+
207 NK_LIB void nk_push_table(struct nk_window *win, struct nk_table *tbl);
+
208 NK_LIB nk_uint *nk_add_value(struct nk_context *ctx, struct nk_window *win, nk_hash name, nk_uint value);
+
209 NK_LIB nk_uint *nk_find_value(const struct nk_window *win, nk_hash name);
+
210 
+
211 /* panel */
+
212 NK_LIB void *nk_create_panel(struct nk_context *ctx);
+
213 NK_LIB void nk_free_panel(struct nk_context*, struct nk_panel *pan);
+
214 NK_LIB nk_bool nk_panel_has_header(nk_flags flags, const char *title);
+
215 NK_LIB struct nk_vec2 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type);
+
216 NK_LIB float nk_panel_get_border(const struct nk_style *style, nk_flags flags, enum nk_panel_type type);
+
217 NK_LIB struct nk_color nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type);
+
218 NK_LIB nk_bool nk_panel_is_sub(enum nk_panel_type type);
+
219 NK_LIB nk_bool nk_panel_is_nonblock(enum nk_panel_type type);
+
220 NK_LIB nk_bool nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type);
+
221 NK_LIB void nk_panel_end(struct nk_context *ctx);
+
222 
+
223 /* layout */
+
224 NK_LIB float nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type, float total_space, int columns);
+
225 NK_LIB void nk_panel_layout(const struct nk_context *ctx, struct nk_window *win, float height, int cols);
+
226 NK_LIB void nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, float height, int cols, int width);
+
227 NK_LIB void nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win);
+
228 NK_LIB void nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_window *win, int modify);
+
229 NK_LIB void nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx);
+
230 NK_LIB void nk_layout_peek(struct nk_rect *bounds, const struct nk_context *ctx);
+
231 
+
232 /* popup */
+
233 NK_LIB nk_bool nk_nonblock_begin(struct nk_context *ctx, nk_flags flags, struct nk_rect body, struct nk_rect header, enum nk_panel_type panel_type);
+
234 
+
235 /* text */
+
236 struct nk_text {
+
237  struct nk_vec2 padding;
+
238  struct nk_color background;
+
239  struct nk_color text;
+
240 };
+
241 NK_LIB void nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, nk_flags a, const struct nk_user_font *f);
+
242 NK_LIB void nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, const struct nk_user_font *f);
+
243 
+
244 /* button */
+
245 NK_LIB nk_bool nk_button_behavior(nk_flags *state, struct nk_rect r, const struct nk_input *i, enum nk_button_behavior behavior);
+
246 NK_LIB const struct nk_style_item* nk_draw_button(struct nk_command_buffer *out, const struct nk_rect *bounds, nk_flags state, const struct nk_style_button *style);
+
247 NK_LIB nk_bool nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, const struct nk_style_button *style, const struct nk_input *in, enum nk_button_behavior behavior, struct nk_rect *content);
+
248 NK_LIB void nk_draw_button_text(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const char *txt, int len, nk_flags text_alignment, const struct nk_user_font *font);
+
249 NK_LIB nk_bool nk_do_button_text(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *string, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
+
250 NK_LIB void nk_draw_button_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, enum nk_symbol_type type, const struct nk_user_font *font);
+
251 NK_LIB nk_bool nk_do_button_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
+
252 NK_LIB void nk_draw_button_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const struct nk_image *img);
+
253 NK_LIB nk_bool nk_do_button_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, enum nk_button_behavior b, const struct nk_style_button *style, const struct nk_input *in);
+
254 NK_LIB void nk_draw_button_text_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, const char *str, int len, enum nk_symbol_type type, const struct nk_user_font *font);
+
255 NK_LIB nk_bool nk_do_button_text_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, const char *str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
+
256 NK_LIB void nk_draw_button_text_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, const char *str, int len, const struct nk_user_font *font, const struct nk_image *img);
+
257 NK_LIB nk_bool nk_do_button_text_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, const char* str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
+
258 
+
259 /* toggle */
+
260 enum nk_toggle_type {
+
261  NK_TOGGLE_CHECK,
+
262  NK_TOGGLE_OPTION
+
263 };
+
264 NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active);
+
265 NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
+
266 NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
+
267 NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment);
+
268 
+
269 /* progress */
+
270 NK_LIB nk_size nk_progress_behavior(nk_flags *state, struct nk_input *in, struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, nk_bool modifiable);
+
271 NK_LIB void nk_draw_progress(struct nk_command_buffer *out, nk_flags state, const struct nk_style_progress *style, const struct nk_rect *bounds, const struct nk_rect *scursor, nk_size value, nk_size max);
+
272 NK_LIB nk_size nk_do_progress(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_size value, nk_size max, nk_bool modifiable, const struct nk_style_progress *style, struct nk_input *in);
+
273 
+
274 /* slider */
+
275 NK_LIB float nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor, struct nk_rect *visual_cursor, struct nk_input *in, struct nk_rect bounds, float slider_min, float slider_max, float slider_value, float slider_step, float slider_steps);
+
276 NK_LIB void nk_draw_slider(struct nk_command_buffer *out, nk_flags state, const struct nk_style_slider *style, const struct nk_rect *bounds, const struct nk_rect *visual_cursor, float min, float value, float max);
+
277 NK_LIB float nk_do_slider(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, float min, float val, float max, float step, const struct nk_style_slider *style, struct nk_input *in, const struct nk_user_font *font);
+
278 
+
279 /* scrollbar */
+
280 NK_LIB float nk_scrollbar_behavior(nk_flags *state, struct nk_input *in, int has_scrolling, const struct nk_rect *scroll, const struct nk_rect *cursor, const struct nk_rect *empty0, const struct nk_rect *empty1, float scroll_offset, float target, float scroll_step, enum nk_orientation o);
+
281 NK_LIB void nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state, const struct nk_style_scrollbar *style, const struct nk_rect *bounds, const struct nk_rect *scroll);
+
282 NK_LIB float nk_do_scrollbarv(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
+
283 NK_LIB float nk_do_scrollbarh(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
+
284 
+
285 /* selectable */
+
286 NK_LIB void nk_draw_selectable(struct nk_command_buffer *out, nk_flags state, const struct nk_style_selectable *style, nk_bool active, const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, const char *string, int len, nk_flags align, const struct nk_user_font *font);
+
287 NK_LIB nk_bool nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
+
288 NK_LIB nk_bool nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value, const struct nk_image *img, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
+
289 
+
290 /* edit */
+
291 NK_LIB void nk_edit_draw_text(struct nk_command_buffer *out, const struct nk_style_edit *style, float pos_x, float pos_y, float x_offset, const char *text, int byte_len, float row_height, const struct nk_user_font *font, struct nk_color background, struct nk_color foreground, nk_bool is_selected);
+
292 NK_LIB nk_flags nk_do_edit(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter, struct nk_text_edit *edit, const struct nk_style_edit *style, struct nk_input *in, const struct nk_user_font *font);
+
293 
+
294 /* color-picker */
+
295 NK_LIB nk_bool nk_color_picker_behavior(nk_flags *state, const struct nk_rect *bounds, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf *color, const struct nk_input *in);
+
296 NK_LIB void nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf col);
+
297 NK_LIB nk_bool nk_do_color_picker(nk_flags *state, struct nk_command_buffer *out, struct nk_colorf *col, enum nk_color_format fmt, struct nk_rect bounds, struct nk_vec2 padding, const struct nk_input *in, const struct nk_user_font *font);
+
298 
+
299 /* property */
+
300 enum nk_property_status {
+
301  NK_PROPERTY_DEFAULT,
+
302  NK_PROPERTY_EDIT,
+
303  NK_PROPERTY_DRAG
+
304 };
+
305 enum nk_property_filter {
+
306  NK_FILTER_INT,
+
307  NK_FILTER_FLOAT
+
308 };
+
309 enum nk_property_kind {
+
310  NK_PROPERTY_INT,
+
311  NK_PROPERTY_FLOAT,
+
312  NK_PROPERTY_DOUBLE
+
313 };
+
314 union nk_property {
+
315  int i;
+
316  float f;
+
317  double d;
+
318 };
+ +
320  enum nk_property_kind kind;
+
321  union nk_property value;
+
322  union nk_property min_value;
+
323  union nk_property max_value;
+
324  union nk_property step;
+
325 };
+
326 NK_LIB struct nk_property_variant nk_property_variant_int(int value, int min_value, int max_value, int step);
+
327 NK_LIB struct nk_property_variant nk_property_variant_float(float value, float min_value, float max_value, float step);
+
328 NK_LIB struct nk_property_variant nk_property_variant_double(double value, double min_value, double max_value, double step);
+
329 
+
330 NK_LIB void nk_drag_behavior(nk_flags *state, const struct nk_input *in, struct nk_rect drag, struct nk_property_variant *variant, float inc_per_pixel);
+
331 NK_LIB void nk_property_behavior(nk_flags *ws, const struct nk_input *in, struct nk_rect property, struct nk_rect label, struct nk_rect edit, struct nk_rect empty, int *state, struct nk_property_variant *variant, float inc_per_pixel);
+
332 NK_LIB void nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, const char *name, int len, const struct nk_user_font *font);
+
333 NK_LIB void nk_do_property(nk_flags *ws, struct nk_command_buffer *out, struct nk_rect property, const char *name, struct nk_property_variant *variant, float inc_per_pixel, char *buffer, int *len, int *state, int *cursor, int *select_begin, int *select_end, const struct nk_style_property *style, enum nk_property_filter filter, struct nk_input *in, const struct nk_user_font *font, struct nk_text_edit *text_edit, enum nk_button_behavior behavior);
+
334 NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant, float inc_per_pixel, const enum nk_property_filter filter);
+
335 
+
336 #ifdef NK_INCLUDE_FONT_BAKING
+
337 
+
343 #ifndef NK_NO_STB_RECT_PACK_IMPLEMENTATION
+
344 #define STB_RECT_PACK_IMPLEMENTATION
+
345 #endif /* NK_NO_STB_RECT_PACK_IMPLEMENTATION */
+
346 
+
352 #ifndef NK_NO_STB_TRUETYPE_IMPLEMENTATION
+
353 #define STB_TRUETYPE_IMPLEMENTATION
+
354 #endif /* NK_NO_STB_TRUETYPE_IMPLEMENTATION */
+
355 
+
356 /* Allow consumer to define own STBTT_malloc/STBTT_free, and use the font atlas' allocator otherwise */
+
357 #ifndef STBTT_malloc
+
358 static void*
+
359 nk_stbtt_malloc(nk_size size, void *user_data) {
+
360  struct nk_allocator *alloc = (struct nk_allocator *) user_data;
+
361  return alloc->alloc(alloc->userdata, 0, size);
+
362 }
+
363 
+
364 static void
+
365 nk_stbtt_free(void *ptr, void *user_data) {
+
366  struct nk_allocator *alloc = (struct nk_allocator *) user_data;
+
367  alloc->free(alloc->userdata, ptr);
+
368 }
+
369 
+
370 #define STBTT_malloc(x,u) nk_stbtt_malloc(x,u)
+
371 #define STBTT_free(x,u) nk_stbtt_free(x,u)
+
372 
+
373 #endif /* STBTT_malloc */
+
374 
+
375 #endif /* NK_INCLUDE_FONT_BAKING */
+
376 
+
377 #endif
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__knob_8c_source.html b/nuklear__knob_8c_source.html new file mode 100644 index 000000000..ae9b0fd99 --- /dev/null +++ b/nuklear__knob_8c_source.html @@ -0,0 +1,384 @@ + + + + + + + +Nuklear: src/nuklear_knob.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_knob.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * KNOB
+
7  *
+
8  * ===============================================================*/
+
9 
+
10 NK_LIB float
+
11 nk_knob_behavior(nk_flags *state, struct nk_input *in,
+
12  struct nk_rect bounds, float knob_min, float knob_max, float knob_value,
+
13  float knob_step, float knob_steps,
+
14  enum nk_heading zero_direction, float dead_zone_percent)
+
15 {
+
16  struct nk_vec2 origin;
+
17  float angle = 0.0f;
+
18  origin.x = bounds.x + (bounds.w / 2);
+
19  origin.y = bounds.y + (bounds.h / 2);
+
20 
+
21  nk_widget_state_reset(state);
+
22 
+
23  /* handle click and drag input */
+
24  if(in &&
+
25  in->mouse.buttons[NK_BUTTON_LEFT].down &&
+
26  nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, bounds, nk_true)){
+
27  /* calculate angle from origin and rotate */
+
28  const float direction_rads[4] = {
+
29  NK_PI * 2.5f, /* 90 NK_UP */
+
30  NK_PI * 2.0f, /* 0 NK_RIGHT */
+
31  NK_PI * 1.5f, /* 270 NK_DOWN */
+
32  NK_PI, /* 180 NK_LEFT */
+
33  };
+
34  *state = NK_WIDGET_STATE_ACTIVE;
+
35 
+
36  angle = NK_ATAN2(in->mouse.pos.y - origin.y, in->mouse.pos.x - origin.x) + direction_rads[zero_direction];
+
37  angle -= (angle > NK_PI * 2) ? NK_PI * 3 : NK_PI;
+
38 
+
39  /* account for dead space applied when drawing */
+
40  angle *= 1.0f / (1.0f - dead_zone_percent);
+
41  angle = NK_CLAMP(-NK_PI, angle, NK_PI);
+
42 
+
43  /* convert -pi -> pi range to 0.0 -> 1.0 */
+
44  angle = (angle + NK_PI) / (NK_PI * 2);
+
45 
+
46  /* click to closest step */
+
47  knob_value = knob_min + ( (int)(angle * knob_steps + (knob_step / 2)) ) * knob_step;
+
48  knob_value = NK_CLAMP(knob_min, knob_value, knob_max);
+
49  }
+
50 
+
51  /* knob widget state */
+
52  if (nk_input_is_mouse_hovering_rect(in, bounds)){
+
53  *state = NK_WIDGET_STATE_HOVERED;
+
54  if (in) {
+
55  /* handle scroll and arrow inputs */
+
56  if (in->mouse.scroll_delta.y > 0 ||
+
57  (in->keyboard.keys[NK_KEY_UP].down && in->keyboard.keys[NK_KEY_UP].clicked))
+
58  knob_value += knob_step;
+
59 
+
60  if (in->mouse.scroll_delta.y < 0 ||
+
61  (in->keyboard.keys[NK_KEY_DOWN].down && in->keyboard.keys[NK_KEY_DOWN].clicked))
+
62  knob_value -= knob_step;
+
63  }
+
64  knob_value = NK_CLAMP(knob_min, knob_value, knob_max);
+
65  }
+
66  if (*state & NK_WIDGET_STATE_HOVER &&
+
67  !nk_input_is_mouse_prev_hovering_rect(in, bounds))
+
68  *state |= NK_WIDGET_STATE_ENTERED;
+
69  else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
+
70  *state |= NK_WIDGET_STATE_LEFT;
+
71 
+
72  return knob_value;
+
73 }
+
74 NK_LIB void
+
75 nk_draw_knob(struct nk_command_buffer *out, nk_flags state,
+
76  const struct nk_style_knob *style, const struct nk_rect *bounds, float min, float value, float max,
+
77  enum nk_heading zero_direction, float dead_zone_percent)
+
78 {
+
79  const struct nk_style_item *background;
+
80  struct nk_color knob_color, cursor;
+
81 
+
82  NK_UNUSED(min);
+
83  NK_UNUSED(max);
+
84  NK_UNUSED(value);
+
85 
+
86  if (state & NK_WIDGET_STATE_ACTIVED) {
+
87  background = &style->active;
+
88  knob_color = style->knob_active;
+
89  cursor = style->cursor_active;
+
90  } else if (state & NK_WIDGET_STATE_HOVER) {
+
91  background = &style->hover;
+
92  knob_color = style->knob_hover;
+
93  cursor = style->cursor_hover;
+
94  } else {
+
95  background = &style->normal;
+
96  knob_color = style->knob_normal;
+
97  cursor = style->cursor_normal;
+
98  }
+
99 
+
100  /* draw background */
+
101  switch(background->type) {
+
102  case NK_STYLE_ITEM_IMAGE:
+
103  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
104  break;
+
105  case NK_STYLE_ITEM_NINE_SLICE:
+
106  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
107  break;
+
108  case NK_STYLE_ITEM_COLOR:
+
109  nk_fill_rect(out, *bounds, 0, nk_rgb_factor(background->data.color, style->color_factor));
+
110  nk_stroke_rect(out, *bounds, 0, style->border, nk_rgb_factor(style->border_color, style->color_factor));
+
111  break;
+
112  }
+
113 
+
114  /* draw knob */
+
115  nk_fill_circle(out, *bounds, nk_rgb_factor(knob_color, style->color_factor));
+
116  if(style->knob_border > 0){
+
117  struct nk_rect border_bounds = *bounds;
+
118  border_bounds.x += style->knob_border / 2;
+
119  border_bounds.y += style->knob_border / 2;
+
120  border_bounds.w -= style->knob_border;
+
121  border_bounds.h -= style->knob_border;
+
122  nk_stroke_circle(out, border_bounds, style->knob_border, nk_rgb_factor(style->knob_border_color, style->color_factor));
+
123  }
+
124  { /* calculate cursor line cords */
+
125  float half_circle_size = (bounds->w / 2);
+
126  float angle = (value - min) / (max - min);
+
127  float alive_zone = 1.0f - dead_zone_percent;
+
128  struct nk_vec2 cursor_start, cursor_end;
+
129  const float direction_rads[4] = {
+
130  NK_PI * 1.5f, /* 90 NK_UP */
+
131  0.0f, /* 0 NK_RIGHT */
+
132  NK_PI * 0.5f, /* 270 NK_DOWN */
+
133  NK_PI, /* 180 NK_LEFT */
+
134  };
+
135  /* calculate + apply dead zone */
+
136  angle = (angle * alive_zone) + (dead_zone_percent / 2);
+
137 
+
138  /* percentage 0.0 -> 1.0 to radians, rads are 0.0 to (2*pi) NOT -pi to pi */
+
139  angle *= NK_PI * 2;
+
140 
+
141  /* apply zero angle */
+
142  angle += direction_rads[zero_direction];
+
143  if(angle > NK_PI * 2)
+
144  angle -= NK_PI * 2;
+
145 
+
146  cursor_start.x = bounds->x + half_circle_size + (angle > NK_PI);
+
147  cursor_start.y = bounds->y + half_circle_size + (angle < NK_PI_HALF || angle > (NK_PI * 1.5f));
+
148 
+
149  cursor_end.x = cursor_start.x + (half_circle_size * NK_COS(angle));
+
150  cursor_end.y = cursor_start.y + (half_circle_size * NK_SIN(angle));
+
151 
+
152  /* cut off half of the cursor */
+
153  cursor_start.x = (cursor_start.x + cursor_end.x) / 2;
+
154  cursor_start.y = (cursor_start.y + cursor_end.y) / 2;
+
155 
+
156  /* draw cursor */
+
157  nk_stroke_line(out, cursor_start.x, cursor_start.y, cursor_end.x, cursor_end.y, 2, nk_rgb_factor(cursor, style->color_factor));
+
158  }
+
159 }
+
160 NK_LIB float
+
161 nk_do_knob(nk_flags *state,
+
162  struct nk_command_buffer *out, struct nk_rect bounds,
+
163  float min, float val, float max, float step,
+
164  enum nk_heading zero_direction, float dead_zone_percent,
+
165  const struct nk_style_knob *style, struct nk_input *in)
+
166 {
+
167  float knob_range;
+
168  float knob_min;
+
169  float knob_max;
+
170  float knob_value;
+
171  float knob_steps;
+
172 
+
173  NK_ASSERT(style);
+
174  NK_ASSERT(out);
+
175  if (!out || !style)
+
176  return 0;
+
177 
+
178  /* remove padding from knob bounds */
+
179  bounds.y = bounds.y + style->padding.y;
+
180  bounds.x = bounds.x + style->padding.x;
+
181  bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
+
182  bounds.w = NK_MAX(bounds.w, 2*style->padding.x);
+
183  bounds.w -= 2 * style->padding.x;
+
184  bounds.h -= 2 * style->padding.y;
+
185  if(bounds.h < bounds.w){
+
186  bounds.x += (bounds.w - bounds.h) / 2;
+
187  bounds.w = bounds.h;
+
188  }
+
189 
+
190  /* make sure the provided values are correct */
+
191  knob_max = NK_MAX(min, max);
+
192  knob_min = NK_MIN(min, max);
+
193  knob_value = NK_CLAMP(knob_min, val, knob_max);
+
194  knob_range = knob_max - knob_min;
+
195  knob_steps = knob_range / step;
+
196 
+
197  knob_value = nk_knob_behavior(state, in, bounds, knob_min, knob_max, knob_value, step, knob_steps, zero_direction, dead_zone_percent);
+
198 
+
199  /* draw knob */
+
200  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
201  nk_draw_knob(out, *state, style, &bounds, knob_min, knob_value, knob_max, zero_direction, dead_zone_percent);
+
202  if (style->draw_end) style->draw_end(out, style->userdata);
+
203  return knob_value;
+
204 }
+
205 NK_API nk_bool
+
206 nk_knob_float(struct nk_context *ctx, float min_value, float *value, float max_value,
+
207  float value_step, enum nk_heading zero_direction, float dead_zone_degrees)
+
208 {
+
209  struct nk_window *win;
+
210  struct nk_panel *layout;
+
211  struct nk_input *in;
+
212  const struct nk_style *style;
+
213 
+
214  int ret = 0;
+
215  float old_value;
+
216  struct nk_rect bounds;
+
217  enum nk_widget_layout_states state;
+
218 
+
219  NK_ASSERT(ctx);
+
220  NK_ASSERT(ctx->current);
+
221  NK_ASSERT(ctx->current->layout);
+
222  NK_ASSERT(value);
+
223  NK_ASSERT(NK_BETWEEN(dead_zone_degrees, 0.0f, 360.0f));
+
224  if (!ctx || !ctx->current || !ctx->current->layout || !value)
+
225  return ret;
+
226 
+
227  win = ctx->current;
+
228  style = &ctx->style;
+
229  layout = win->layout;
+
230 
+
231  state = nk_widget(&bounds, ctx);
+
232  if (!state) return ret;
+
233  in = (state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
234 
+
235  old_value = *value;
+
236  *value = nk_do_knob(&ctx->last_widget_state, &win->buffer, bounds, min_value,
+
237  old_value, max_value, value_step, zero_direction, dead_zone_degrees / 360.0f, &style->knob, in);
+
238 
+
239  return (old_value > *value || old_value < *value);
+
240 }
+
241 NK_API nk_bool
+
242 nk_knob_int(struct nk_context *ctx, int min, int *val, int max, int step,
+
243  enum nk_heading zero_direction, float dead_zone_degrees)
+
244 {
+
245  int ret;
+
246  float value = (float)*val;
+
247  ret = nk_knob_float(ctx, (float)min, &value, (float)max, (float)step, zero_direction, dead_zone_degrees);
+
248  *val = (int)value;
+
249  return ret;
+
250 }
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color)
shape outlines
Definition: nuklear_draw.c:89
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+ + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__layout_8c_source.html b/nuklear__layout_8c_source.html new file mode 100644 index 000000000..25894dc1c --- /dev/null +++ b/nuklear__layout_8c_source.html @@ -0,0 +1,918 @@ + + + + + + + +Nuklear: src/nuklear_layout.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_layout.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * LAYOUT
+
7  *
+
8  * ===============================================================*/
+
9 NK_API void
+
10 nk_layout_set_min_row_height(struct nk_context *ctx, float height)
+
11 {
+
12  struct nk_window *win;
+
13  struct nk_panel *layout;
+
14 
+
15  NK_ASSERT(ctx);
+
16  NK_ASSERT(ctx->current);
+
17  NK_ASSERT(ctx->current->layout);
+
18  if (!ctx || !ctx->current || !ctx->current->layout)
+
19  return;
+
20 
+
21  win = ctx->current;
+
22  layout = win->layout;
+
23  layout->row.min_height = height;
+
24 }
+
25 NK_API void
+ +
27 {
+
28  struct nk_window *win;
+
29  struct nk_panel *layout;
+
30 
+
31  NK_ASSERT(ctx);
+
32  NK_ASSERT(ctx->current);
+
33  NK_ASSERT(ctx->current->layout);
+
34  if (!ctx || !ctx->current || !ctx->current->layout)
+
35  return;
+
36 
+
37  win = ctx->current;
+
38  layout = win->layout;
+
39  layout->row.min_height = ctx->style.font->height;
+
40  layout->row.min_height += ctx->style.text.padding.y*2;
+
41  layout->row.min_height += ctx->style.window.min_row_height_padding*2;
+
42 }
+
43 NK_LIB float
+
44 nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type,
+
45  float total_space, int columns)
+
46 {
+
47  float panel_spacing;
+
48  float panel_space;
+
49 
+
50  struct nk_vec2 spacing;
+
51 
+
52  NK_UNUSED(type);
+
53 
+
54  spacing = style->window.spacing;
+
55 
+
56  /* calculate the usable panel space */
+
57  panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
+
58  panel_space = total_space - panel_spacing;
+
59  return panel_space;
+
60 }
+
61 NK_LIB void
+
62 nk_panel_layout(const struct nk_context *ctx, struct nk_window *win,
+
63  float height, int cols)
+
64 {
+
65  struct nk_panel *layout;
+
66  const struct nk_style *style;
+
67  struct nk_command_buffer *out;
+
68 
+
69  struct nk_vec2 item_spacing;
+
70  struct nk_color color;
+
71 
+
72  NK_ASSERT(ctx);
+
73  NK_ASSERT(ctx->current);
+
74  NK_ASSERT(ctx->current->layout);
+
75  if (!ctx || !ctx->current || !ctx->current->layout)
+
76  return;
+
77 
+
78  /* prefetch some configuration data */
+
79  layout = win->layout;
+
80  style = &ctx->style;
+
81  out = &win->buffer;
+
82  color = style->window.background;
+
83  item_spacing = style->window.spacing;
+
84 
+
85  /* if one of these triggers you forgot to add an `if` condition around either
+
86  a window, group, popup, combobox or contextual menu `begin` and `end` block.
+
87  Example:
+
88  if (nk_begin(...) {...} nk_end(...); or
+
89  if (nk_group_begin(...) { nk_group_end(...);} */
+
90  NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
+
91  NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
+
92  NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
+
93 
+
94  /* update the current row and set the current row layout */
+
95  layout->row.index = 0;
+
96  layout->at_y += layout->row.height;
+
97  layout->row.columns = cols;
+
98  if (height == 0.0f)
+
99  layout->row.height = NK_MAX(height, layout->row.min_height) + item_spacing.y;
+
100  else layout->row.height = height + item_spacing.y;
+
101 
+
102  layout->row.item_offset = 0;
+
103  if (layout->flags & NK_WINDOW_DYNAMIC) {
+
104  /* draw background for dynamic panels */
+
105  struct nk_rect background;
+
106  background.x = win->bounds.x;
+
107  background.w = win->bounds.w;
+
108  background.y = layout->at_y - 1.0f;
+
109  background.h = layout->row.height + 1.0f;
+
110  nk_fill_rect(out, background, 0, color);
+
111  }
+
112 }
+
113 NK_LIB void
+
114 nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt,
+
115  float height, int cols, int width)
+
116 {
+
117  /* update the current row and set the current row layout */
+
118  struct nk_window *win;
+
119  NK_ASSERT(ctx);
+
120  NK_ASSERT(ctx->current);
+
121  NK_ASSERT(ctx->current->layout);
+
122  if (!ctx || !ctx->current || !ctx->current->layout)
+
123  return;
+
124 
+
125  win = ctx->current;
+
126  nk_panel_layout(ctx, win, height, cols);
+
127  if (fmt == NK_DYNAMIC)
+
128  win->layout->row.type = NK_LAYOUT_DYNAMIC_FIXED;
+
129  else win->layout->row.type = NK_LAYOUT_STATIC_FIXED;
+
130 
+
131  win->layout->row.ratio = 0;
+
132  win->layout->row.filled = 0;
+
133  win->layout->row.item_offset = 0;
+
134  win->layout->row.item_width = (float)width;
+
135 }
+
136 NK_API float
+
137 nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width)
+
138 {
+
139  struct nk_window *win;
+
140  NK_ASSERT(ctx);
+
141  NK_ASSERT(pixel_width);
+
142  if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+
143  win = ctx->current;
+
144  return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f);
+
145 }
+
146 NK_API void
+
147 nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
+
148 {
+
149  nk_row_layout(ctx, NK_DYNAMIC, height, cols, 0);
+
150 }
+
151 NK_API void
+
152 nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
+
153 {
+
154  nk_row_layout(ctx, NK_STATIC, height, cols, item_width);
+
155 }
+
156 NK_API void
+
157 nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt,
+
158  float row_height, int cols)
+
159 {
+
160  struct nk_window *win;
+
161  struct nk_panel *layout;
+
162 
+
163  NK_ASSERT(ctx);
+
164  NK_ASSERT(ctx->current);
+
165  NK_ASSERT(ctx->current->layout);
+
166  if (!ctx || !ctx->current || !ctx->current->layout)
+
167  return;
+
168 
+
169  win = ctx->current;
+
170  layout = win->layout;
+
171  nk_panel_layout(ctx, win, row_height, cols);
+
172  if (fmt == NK_DYNAMIC)
+
173  layout->row.type = NK_LAYOUT_DYNAMIC_ROW;
+
174  else layout->row.type = NK_LAYOUT_STATIC_ROW;
+
175 
+
176  layout->row.ratio = 0;
+
177  layout->row.filled = 0;
+
178  layout->row.item_width = 0;
+
179  layout->row.item_offset = 0;
+
180  layout->row.columns = cols;
+
181 }
+
182 NK_API void
+
183 nk_layout_row_push(struct nk_context *ctx, float ratio_or_width)
+
184 {
+
185  struct nk_window *win;
+
186  struct nk_panel *layout;
+
187 
+
188  NK_ASSERT(ctx);
+
189  NK_ASSERT(ctx->current);
+
190  NK_ASSERT(ctx->current->layout);
+
191  if (!ctx || !ctx->current || !ctx->current->layout)
+
192  return;
+
193 
+
194  win = ctx->current;
+
195  layout = win->layout;
+
196  NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
+
197  if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
+
198  return;
+
199 
+
200  if (layout->row.type == NK_LAYOUT_DYNAMIC_ROW) {
+
201  float ratio = ratio_or_width;
+
202  if ((ratio + layout->row.filled) > 1.0f) return;
+
203  if (ratio > 0.0f)
+
204  layout->row.item_width = NK_SATURATE(ratio);
+
205  else layout->row.item_width = 1.0f - layout->row.filled;
+
206  } else layout->row.item_width = ratio_or_width;
+
207 }
+
208 NK_API void
+ +
210 {
+
211  struct nk_window *win;
+
212  struct nk_panel *layout;
+
213 
+
214  NK_ASSERT(ctx);
+
215  NK_ASSERT(ctx->current);
+
216  NK_ASSERT(ctx->current->layout);
+
217  if (!ctx || !ctx->current || !ctx->current->layout)
+
218  return;
+
219 
+
220  win = ctx->current;
+
221  layout = win->layout;
+
222  NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
+
223  if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
+
224  return;
+
225  layout->row.item_width = 0;
+
226  layout->row.item_offset = 0;
+
227 }
+
228 NK_API void
+
229 nk_layout_row(struct nk_context *ctx, enum nk_layout_format fmt,
+
230  float height, int cols, const float *ratio)
+
231 {
+
232  int i;
+
233  int n_undef = 0;
+
234  struct nk_window *win;
+
235  struct nk_panel *layout;
+
236 
+
237  NK_ASSERT(ctx);
+
238  NK_ASSERT(ctx->current);
+
239  NK_ASSERT(ctx->current->layout);
+
240  if (!ctx || !ctx->current || !ctx->current->layout)
+
241  return;
+
242 
+
243  win = ctx->current;
+
244  layout = win->layout;
+
245  nk_panel_layout(ctx, win, height, cols);
+
246  if (fmt == NK_DYNAMIC) {
+
247  /* calculate width of undefined widget ratios */
+
248  float r = 0;
+
249  layout->row.ratio = ratio;
+
250  for (i = 0; i < cols; ++i) {
+
251  if (ratio[i] < 0.0f)
+
252  n_undef++;
+
253  else r += ratio[i];
+
254  }
+
255  r = NK_SATURATE(1.0f - r);
+
256  layout->row.type = NK_LAYOUT_DYNAMIC;
+
257  layout->row.item_width = (r > 0 && n_undef > 0) ? (r / (float)n_undef):0;
+
258  } else {
+
259  layout->row.ratio = ratio;
+
260  layout->row.type = NK_LAYOUT_STATIC;
+
261  layout->row.item_width = 0;
+
262  layout->row.item_offset = 0;
+
263  }
+
264  layout->row.item_offset = 0;
+
265  layout->row.filled = 0;
+
266 }
+
267 NK_API void
+
268 nk_layout_row_template_begin(struct nk_context *ctx, float height)
+
269 {
+
270  struct nk_window *win;
+
271  struct nk_panel *layout;
+
272 
+
273  NK_ASSERT(ctx);
+
274  NK_ASSERT(ctx->current);
+
275  NK_ASSERT(ctx->current->layout);
+
276  if (!ctx || !ctx->current || !ctx->current->layout)
+
277  return;
+
278 
+
279  win = ctx->current;
+
280  layout = win->layout;
+
281  nk_panel_layout(ctx, win, height, 1);
+
282  layout->row.type = NK_LAYOUT_TEMPLATE;
+
283  layout->row.columns = 0;
+
284  layout->row.ratio = 0;
+
285  layout->row.item_width = 0;
+
286  layout->row.item_height = 0;
+
287  layout->row.item_offset = 0;
+
288  layout->row.filled = 0;
+
289  layout->row.item.x = 0;
+
290  layout->row.item.y = 0;
+
291  layout->row.item.w = 0;
+
292  layout->row.item.h = 0;
+
293 }
+
294 NK_API void
+ +
296 {
+
297  struct nk_window *win;
+
298  struct nk_panel *layout;
+
299 
+
300  NK_ASSERT(ctx);
+
301  NK_ASSERT(ctx->current);
+
302  NK_ASSERT(ctx->current->layout);
+
303  if (!ctx || !ctx->current || !ctx->current->layout)
+
304  return;
+
305 
+
306  win = ctx->current;
+
307  layout = win->layout;
+
308  NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+
309  NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+
310  if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+
311  if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+
312  layout->row.templates[layout->row.columns++] = -1.0f;
+
313 }
+
314 NK_API void
+ +
316 {
+
317  struct nk_window *win;
+
318  struct nk_panel *layout;
+
319 
+
320  NK_ASSERT(ctx);
+
321  NK_ASSERT(ctx->current);
+
322  NK_ASSERT(ctx->current->layout);
+
323  if (!ctx || !ctx->current || !ctx->current->layout)
+
324  return;
+
325 
+
326  win = ctx->current;
+
327  layout = win->layout;
+
328  NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+
329  NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+
330  if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+
331  if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+
332  layout->row.templates[layout->row.columns++] = -min_width;
+
333 }
+
334 NK_API void
+ +
336 {
+
337  struct nk_window *win;
+
338  struct nk_panel *layout;
+
339 
+
340  NK_ASSERT(ctx);
+
341  NK_ASSERT(ctx->current);
+
342  NK_ASSERT(ctx->current->layout);
+
343  if (!ctx || !ctx->current || !ctx->current->layout)
+
344  return;
+
345 
+
346  win = ctx->current;
+
347  layout = win->layout;
+
348  NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+
349  NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+
350  if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+
351  if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+
352  layout->row.templates[layout->row.columns++] = width;
+
353 }
+
354 NK_API void
+ +
356 {
+
357  struct nk_window *win;
+
358  struct nk_panel *layout;
+
359 
+
360  int i = 0;
+
361  int variable_count = 0;
+
362  int min_variable_count = 0;
+
363  float min_fixed_width = 0.0f;
+
364  float total_fixed_width = 0.0f;
+
365  float max_variable_width = 0.0f;
+
366 
+
367  NK_ASSERT(ctx);
+
368  NK_ASSERT(ctx->current);
+
369  NK_ASSERT(ctx->current->layout);
+
370  if (!ctx || !ctx->current || !ctx->current->layout)
+
371  return;
+
372 
+
373  win = ctx->current;
+
374  layout = win->layout;
+
375  NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+
376  if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+
377  for (i = 0; i < layout->row.columns; ++i) {
+
378  float width = layout->row.templates[i];
+
379  if (width >= 0.0f) {
+
380  total_fixed_width += width;
+
381  min_fixed_width += width;
+
382  } else if (width < -1.0f) {
+
383  width = -width;
+
384  total_fixed_width += width;
+
385  max_variable_width = NK_MAX(max_variable_width, width);
+
386  variable_count++;
+
387  } else {
+
388  min_variable_count++;
+
389  variable_count++;
+
390  }
+
391  }
+
392  if (variable_count) {
+
393  float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
+
394  layout->bounds.w, layout->row.columns);
+
395  float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count;
+
396  int enough_space = var_width >= max_variable_width;
+
397  if (!enough_space)
+
398  var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count;
+
399  for (i = 0; i < layout->row.columns; ++i) {
+
400  float *width = &layout->row.templates[i];
+
401  *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width;
+
402  }
+
403  }
+
404 }
+
405 NK_API void
+
406 nk_layout_space_begin(struct nk_context *ctx, enum nk_layout_format fmt,
+
407  float height, int widget_count)
+
408 {
+
409  struct nk_window *win;
+
410  struct nk_panel *layout;
+
411 
+
412  NK_ASSERT(ctx);
+
413  NK_ASSERT(ctx->current);
+
414  NK_ASSERT(ctx->current->layout);
+
415  if (!ctx || !ctx->current || !ctx->current->layout)
+
416  return;
+
417 
+
418  win = ctx->current;
+
419  layout = win->layout;
+
420  nk_panel_layout(ctx, win, height, widget_count);
+
421  if (fmt == NK_STATIC)
+
422  layout->row.type = NK_LAYOUT_STATIC_FREE;
+
423  else layout->row.type = NK_LAYOUT_DYNAMIC_FREE;
+
424 
+
425  layout->row.ratio = 0;
+
426  layout->row.filled = 0;
+
427  layout->row.item_width = 0;
+
428  layout->row.item_offset = 0;
+
429 }
+
430 NK_API void
+ +
432 {
+
433  struct nk_window *win;
+
434  struct nk_panel *layout;
+
435 
+
436  NK_ASSERT(ctx);
+
437  NK_ASSERT(ctx->current);
+
438  NK_ASSERT(ctx->current->layout);
+
439  if (!ctx || !ctx->current || !ctx->current->layout)
+
440  return;
+
441 
+
442  win = ctx->current;
+
443  layout = win->layout;
+
444  layout->row.item_width = 0;
+
445  layout->row.item_height = 0;
+
446  layout->row.item_offset = 0;
+
447  nk_zero(&layout->row.item, sizeof(layout->row.item));
+
448 }
+
449 NK_API void
+
450 nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect)
+
451 {
+
452  struct nk_window *win;
+
453  struct nk_panel *layout;
+
454 
+
455  NK_ASSERT(ctx);
+
456  NK_ASSERT(ctx->current);
+
457  NK_ASSERT(ctx->current->layout);
+
458  if (!ctx || !ctx->current || !ctx->current->layout)
+
459  return;
+
460 
+
461  win = ctx->current;
+
462  layout = win->layout;
+
463  layout->row.item = rect;
+
464 }
+
465 NK_API struct nk_rect
+
466 nk_layout_space_bounds(const struct nk_context *ctx)
+
467 {
+
468  struct nk_rect ret;
+
469  struct nk_window *win;
+
470  struct nk_panel *layout;
+
471 
+
472  NK_ASSERT(ctx);
+
473  NK_ASSERT(ctx->current);
+
474  NK_ASSERT(ctx->current->layout);
+
475  win = ctx->current;
+
476  layout = win->layout;
+
477 
+
478  ret.x = layout->clip.x;
+
479  ret.y = layout->clip.y;
+
480  ret.w = layout->clip.w;
+
481  ret.h = layout->row.height;
+
482  return ret;
+
483 }
+
484 NK_API struct nk_rect
+
485 nk_layout_widget_bounds(const struct nk_context *ctx)
+
486 {
+
487  struct nk_rect ret;
+
488  struct nk_window *win;
+
489  struct nk_panel *layout;
+
490 
+
491  NK_ASSERT(ctx);
+
492  NK_ASSERT(ctx->current);
+
493  NK_ASSERT(ctx->current->layout);
+
494  win = ctx->current;
+
495  layout = win->layout;
+
496 
+
497  ret.x = layout->at_x;
+
498  ret.y = layout->at_y;
+
499  ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0);
+
500  ret.h = layout->row.height;
+
501  return ret;
+
502 }
+
503 NK_API struct nk_vec2
+
504 nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 ret)
+
505 {
+
506  struct nk_window *win;
+
507  struct nk_panel *layout;
+
508 
+
509  NK_ASSERT(ctx);
+
510  NK_ASSERT(ctx->current);
+
511  NK_ASSERT(ctx->current->layout);
+
512  win = ctx->current;
+
513  layout = win->layout;
+
514 
+
515  ret.x += layout->at_x - (float)*layout->offset_x;
+
516  ret.y += layout->at_y - (float)*layout->offset_y;
+
517  return ret;
+
518 }
+
519 NK_API struct nk_vec2
+
520 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 ret)
+
521 {
+
522  struct nk_window *win;
+
523  struct nk_panel *layout;
+
524 
+
525  NK_ASSERT(ctx);
+
526  NK_ASSERT(ctx->current);
+
527  NK_ASSERT(ctx->current->layout);
+
528  win = ctx->current;
+
529  layout = win->layout;
+
530 
+
531  ret.x += -layout->at_x + (float)*layout->offset_x;
+
532  ret.y += -layout->at_y + (float)*layout->offset_y;
+
533  return ret;
+
534 }
+
535 NK_API struct nk_rect
+
536 nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect ret)
+
537 {
+
538  struct nk_window *win;
+
539  struct nk_panel *layout;
+
540 
+
541  NK_ASSERT(ctx);
+
542  NK_ASSERT(ctx->current);
+
543  NK_ASSERT(ctx->current->layout);
+
544  win = ctx->current;
+
545  layout = win->layout;
+
546 
+
547  ret.x += layout->at_x - (float)*layout->offset_x;
+
548  ret.y += layout->at_y - (float)*layout->offset_y;
+
549  return ret;
+
550 }
+
551 NK_API struct nk_rect
+
552 nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect ret)
+
553 {
+
554  struct nk_window *win;
+
555  struct nk_panel *layout;
+
556 
+
557  NK_ASSERT(ctx);
+
558  NK_ASSERT(ctx->current);
+
559  NK_ASSERT(ctx->current->layout);
+
560  win = ctx->current;
+
561  layout = win->layout;
+
562 
+
563  ret.x += -layout->at_x + (float)*layout->offset_x;
+
564  ret.y += -layout->at_y + (float)*layout->offset_y;
+
565  return ret;
+
566 }
+
567 NK_LIB void
+
568 nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win)
+
569 {
+
570  struct nk_panel *layout = win->layout;
+
571  struct nk_vec2 spacing = ctx->style.window.spacing;
+
572  const float row_height = layout->row.height - spacing.y;
+
573  nk_panel_layout(ctx, win, row_height, layout->row.columns);
+
574 }
+
575 NK_LIB void
+
576 nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
+
577  struct nk_window *win, int modify)
+
578 {
+
579  struct nk_panel *layout;
+
580  const struct nk_style *style;
+
581 
+
582  struct nk_vec2 spacing;
+
583 
+
584  float item_offset = 0;
+
585  float item_width = 0;
+
586  float item_spacing = 0;
+
587  float panel_space = 0;
+
588 
+
589  NK_ASSERT(ctx);
+
590  NK_ASSERT(ctx->current);
+
591  NK_ASSERT(ctx->current->layout);
+
592  if (!ctx || !ctx->current || !ctx->current->layout)
+
593  return;
+
594 
+
595  win = ctx->current;
+
596  layout = win->layout;
+
597  style = &ctx->style;
+
598  NK_ASSERT(bounds);
+
599 
+
600  spacing = style->window.spacing;
+
601  panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
+
602  layout->bounds.w, layout->row.columns);
+
603 
+
604  #define NK_FRAC(x) (x - (float)(int)nk_roundf(x)) /* will be used to remove fookin gaps */
+
605  /* calculate the width of one item inside the current layout space */
+
606  switch (layout->row.type) {
+
607  case NK_LAYOUT_DYNAMIC_FIXED: {
+
608  /* scaling fixed size widgets item width */
+
609  float w = NK_MAX(1.0f,panel_space) / (float)layout->row.columns;
+
610  item_offset = (float)layout->row.index * w;
+
611  item_width = w + NK_FRAC(item_offset);
+
612  item_spacing = (float)layout->row.index * spacing.x;
+
613  } break;
+
614  case NK_LAYOUT_DYNAMIC_ROW: {
+
615  /* scaling single ratio widget width */
+
616  float w = layout->row.item_width * panel_space;
+
617  item_offset = layout->row.item_offset;
+
618  item_width = w + NK_FRAC(item_offset);
+
619  item_spacing = 0;
+
620 
+
621  if (modify) {
+
622  layout->row.item_offset += w + spacing.x;
+
623  layout->row.filled += layout->row.item_width;
+
624  layout->row.index = 0;
+
625  }
+
626  } break;
+
627  case NK_LAYOUT_DYNAMIC_FREE: {
+
628  /* panel width depended free widget placing */
+
629  bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x);
+
630  bounds->x -= (float)*layout->offset_x;
+
631  bounds->y = layout->at_y + (layout->row.height * layout->row.item.y);
+
632  bounds->y -= (float)*layout->offset_y;
+
633  bounds->w = layout->bounds.w * layout->row.item.w + NK_FRAC(bounds->x);
+
634  bounds->h = layout->row.height * layout->row.item.h + NK_FRAC(bounds->y);
+
635  return;
+
636  }
+
637  case NK_LAYOUT_DYNAMIC: {
+
638  /* scaling arrays of panel width ratios for every widget */
+
639  float ratio, w;
+
640  NK_ASSERT(layout->row.ratio);
+
641  ratio = (layout->row.ratio[layout->row.index] < 0) ?
+
642  layout->row.item_width : layout->row.ratio[layout->row.index];
+
643 
+
644  w = (ratio * panel_space);
+
645  item_spacing = (float)layout->row.index * spacing.x;
+
646  item_offset = layout->row.item_offset;
+
647  item_width = w + NK_FRAC(item_offset);
+
648 
+
649  if (modify) {
+
650  layout->row.item_offset += w;
+
651  layout->row.filled += ratio;
+
652  }
+
653  } break;
+
654  case NK_LAYOUT_STATIC_FIXED: {
+
655  /* non-scaling fixed widgets item width */
+
656  item_width = layout->row.item_width;
+
657  item_offset = (float)layout->row.index * item_width;
+
658  item_spacing = (float)layout->row.index * spacing.x;
+
659  } break;
+
660  case NK_LAYOUT_STATIC_ROW: {
+
661  /* scaling single ratio widget width */
+
662  item_width = layout->row.item_width;
+
663  item_offset = layout->row.item_offset;
+
664  item_spacing = (float)layout->row.index * spacing.x;
+
665  if (modify) layout->row.item_offset += item_width;
+
666  } break;
+
667  case NK_LAYOUT_STATIC_FREE: {
+
668  /* free widget placing */
+
669  bounds->x = layout->at_x + layout->row.item.x;
+
670  bounds->w = layout->row.item.w;
+
671  if (((bounds->x + bounds->w) > layout->max_x) && modify)
+
672  layout->max_x = (bounds->x + bounds->w);
+
673  bounds->x -= (float)*layout->offset_x;
+
674  bounds->y = layout->at_y + layout->row.item.y;
+
675  bounds->y -= (float)*layout->offset_y;
+
676  bounds->h = layout->row.item.h;
+
677  return;
+
678  }
+
679  case NK_LAYOUT_STATIC: {
+
680  /* non-scaling array of panel pixel width for every widget */
+
681  item_spacing = (float)layout->row.index * spacing.x;
+
682  item_width = layout->row.ratio[layout->row.index];
+
683  item_offset = layout->row.item_offset;
+
684  if (modify) layout->row.item_offset += item_width;
+
685  } break;
+
686  case NK_LAYOUT_TEMPLATE: {
+
687  /* stretchy row layout with combined dynamic/static widget width*/
+
688  float w;
+
689  NK_ASSERT(layout->row.index < layout->row.columns);
+
690  NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+
691  w = layout->row.templates[layout->row.index];
+
692  item_offset = layout->row.item_offset;
+
693  item_width = w + NK_FRAC(item_offset);
+
694  item_spacing = (float)layout->row.index * spacing.x;
+
695  if (modify) layout->row.item_offset += w;
+
696  } break;
+
697  #undef NK_FRAC
+
698  default: NK_ASSERT(0); break;
+
699  };
+
700 
+
701  /* set the bounds of the newly allocated widget */
+
702  bounds->w = item_width;
+
703  bounds->h = layout->row.height - spacing.y;
+
704  bounds->y = layout->at_y - (float)*layout->offset_y;
+
705  bounds->x = layout->at_x + item_offset + item_spacing;
+
706  if (((bounds->x + bounds->w) > layout->max_x) && modify)
+
707  layout->max_x = bounds->x + bounds->w;
+
708  bounds->x -= (float)*layout->offset_x;
+
709 }
+
710 NK_LIB void
+
711 nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx)
+
712 {
+
713  struct nk_window *win;
+
714  struct nk_panel *layout;
+
715 
+
716  NK_ASSERT(ctx);
+
717  NK_ASSERT(ctx->current);
+
718  NK_ASSERT(ctx->current->layout);
+
719  if (!ctx || !ctx->current || !ctx->current->layout)
+
720  return;
+
721 
+
722  /* check if the end of the row has been hit and begin new row if so */
+
723  win = ctx->current;
+
724  layout = win->layout;
+
725  if (layout->row.index >= layout->row.columns)
+
726  nk_panel_alloc_row(ctx, win);
+
727 
+
728  /* calculate widget position and size */
+
729  nk_layout_widget_space(bounds, ctx, win, nk_true);
+
730  layout->row.index++;
+
731 }
+
732 NK_LIB void
+
733 nk_layout_peek(struct nk_rect *bounds, const struct nk_context *ctx)
+
734 {
+
735  float y;
+
736  int index;
+
737  struct nk_window *win;
+
738  struct nk_panel *layout;
+
739 
+
740  NK_ASSERT(ctx);
+
741  NK_ASSERT(ctx->current);
+
742  NK_ASSERT(ctx->current->layout);
+
743  if (!ctx || !ctx->current || !ctx->current->layout) {
+
744  *bounds = nk_rect(0,0,0,0);
+
745  return;
+
746  }
+
747 
+
748  win = ctx->current;
+
749  layout = win->layout;
+
750  y = layout->at_y;
+
751  index = layout->row.index;
+
752  if (layout->row.index >= layout->row.columns) {
+
753  layout->at_y += layout->row.height;
+
754  layout->row.index = 0;
+
755  }
+
756  nk_layout_widget_space(bounds, ctx, win, nk_false);
+
757  if (!layout->row.index) {
+
758  bounds->x -= layout->row.item_offset;
+
759  }
+
760  layout->at_y = y;
+
761  layout->row.index = index;
+
762 }
+
763 NK_API void
+
764 nk_spacer(struct nk_context *ctx )
+
765 {
+
766  struct nk_rect dummy_rect = { 0, 0, 0, 0 };
+
767  nk_panel_alloc_space( &dummy_rect, ctx );
+
768 }
+
main API and documentation file
+
NK_API void nk_layout_row_end(struct nk_context *)
Finished previously started row.
+
NK_API void nk_spacer(struct nk_context *ctx)
+
NK_API void nk_layout_space_end(struct nk_context *)
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
Definition: nuklear.h:5491
+
NK_API void nk_layout_row(struct nk_context *, enum nk_layout_format, float height, int cols, const float *ratio)
Specifies row columns in array as either window ratio or size.
+
NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 vec)
+
NK_API void nk_layout_row_template_push_dynamic(struct nk_context *)
+
NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API void nk_layout_row_template_push_static(struct nk_context *, float width)
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
NK_API void nk_layout_row_template_end(struct nk_context *)
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+
NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds)
+
NK_API void nk_layout_set_min_row_height(struct nk_context *, float height)
Sets the currently used minimum row height.
+
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols)
Starts a new dynamic or fixed row with given height and columns.
+
NK_API void nk_layout_space_push(struct nk_context *, struct nk_rect bounds)
+
NK_API void nk_layout_row_template_begin(struct nk_context *, float row_height)
+
NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width)
Utility functions to calculate window ratio from pixel size.
+
NK_API void nk_layout_row_push(struct nk_context *, float value)
\breif Specifies either window ratio or width of a single column
+
NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx)
Returns the width of the next row allocate by one of the layouting functions.
+
NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds)
+
NK_API void nk_layout_space_begin(struct nk_context *, enum nk_layout_format, float height, int widget_count)
+
NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx)
+
NK_API void nk_layout_row_template_push_variable(struct nk_context *, float min_width)
+
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
Sets current row layout to fill @cols number of widgets in row with same @item_width horizontal size.
+ + + + + + + +
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__list__view_8c_source.html b/nuklear__list__view_8c_source.html new file mode 100644 index 000000000..3937a88f6 --- /dev/null +++ b/nuklear__list__view_8c_source.html @@ -0,0 +1,201 @@ + + + + + + + +Nuklear: src/nuklear_list_view.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_list_view.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * LIST VIEW
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view,
+
11  const char *title, nk_flags flags, int row_height, int row_count)
+
12 {
+
13  int title_len;
+
14  nk_hash title_hash;
+
15  nk_uint *x_offset;
+
16  nk_uint *y_offset;
+
17 
+
18  int result;
+
19  struct nk_window *win;
+
20  struct nk_panel *layout;
+
21  const struct nk_style *style;
+
22  struct nk_vec2 item_spacing;
+
23 
+
24  NK_ASSERT(ctx);
+
25  NK_ASSERT(view);
+
26  NK_ASSERT(title);
+
27  if (!ctx || !view || !title) return 0;
+
28 
+
29  win = ctx->current;
+
30  style = &ctx->style;
+
31  item_spacing = style->window.spacing;
+
32  row_height += NK_MAX(0, (int)item_spacing.y);
+
33 
+
34  /* find persistent list view scrollbar offset */
+
35  title_len = (int)nk_strlen(title);
+
36  title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
+
37  x_offset = nk_find_value(win, title_hash);
+
38  if (!x_offset) {
+
39  x_offset = nk_add_value(ctx, win, title_hash, 0);
+
40  y_offset = nk_add_value(ctx, win, title_hash+1, 0);
+
41 
+
42  NK_ASSERT(x_offset);
+
43  NK_ASSERT(y_offset);
+
44  if (!x_offset || !y_offset) return 0;
+
45  *x_offset = *y_offset = 0;
+
46  } else y_offset = nk_find_value(win, title_hash+1);
+
47  view->scroll_value = *y_offset;
+
48  view->scroll_pointer = y_offset;
+
49 
+
50  *y_offset = 0;
+
51  result = nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
+
52  win = ctx->current;
+
53  layout = win->layout;
+
54 
+
55  view->total_height = row_height * NK_MAX(row_count,1);
+
56  view->begin = (int)NK_MAX(((float)view->scroll_value / (float)row_height), 0.0f);
+
57  view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height),0);
+
58  view->count = NK_MIN(view->count, row_count - view->begin);
+
59  view->end = view->begin + view->count;
+
60  view->ctx = ctx;
+
61  return result;
+
62 }
+
63 NK_API void
+
64 nk_list_view_end(struct nk_list_view *view)
+
65 {
+
66  struct nk_context *ctx;
+
67  struct nk_window *win;
+
68  struct nk_panel *layout;
+
69 
+
70  NK_ASSERT(view);
+
71  NK_ASSERT(view->ctx);
+
72  NK_ASSERT(view->scroll_pointer);
+
73  if (!view || !view->ctx) return;
+
74 
+
75  ctx = view->ctx;
+
76  win = ctx->current;
+
77  layout = win->layout;
+
78  layout->at_y = layout->bounds.y + (float)view->total_height;
+
79  *view->scroll_pointer = *view->scroll_pointer + view->scroll_value;
+
80  nk_group_end(view->ctx);
+
81 }
+
82 
+
main API and documentation file
+
NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
Definition: nuklear_group.c:10
+
NK_API void nk_group_end(struct nk_context *)
+ + + + + + +
+
+ + + + diff --git a/nuklear__math_8c_source.html b/nuklear__math_8c_source.html new file mode 100644 index 000000000..ca75d9661 --- /dev/null +++ b/nuklear__math_8c_source.html @@ -0,0 +1,443 @@ + + + + + + + +Nuklear: src/nuklear_math.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_math.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * MATH
+
7  *
+
8  * ===============================================================*/
+
9 /*/// ### Math
+
36 */
+
37 #ifndef NK_INV_SQRT
+
38 #define NK_INV_SQRT nk_inv_sqrt
+
39 NK_LIB float
+
40 nk_inv_sqrt(float n)
+
41 {
+
42  float x2;
+
43  const float threehalfs = 1.5f;
+
44  union {nk_uint i; float f;} conv = {0};
+
45  conv.f = n;
+
46  x2 = n * 0.5f;
+
47  conv.i = 0x5f375A84 - (conv.i >> 1);
+
48  conv.f = conv.f * (threehalfs - (x2 * conv.f * conv.f));
+
49  return conv.f;
+
50 }
+
51 #endif
+
52 #ifndef NK_SIN
+
53 #define NK_SIN nk_sin
+
54 NK_LIB float
+
55 nk_sin(float x)
+
56 {
+
57  NK_STORAGE const float a0 = +1.91059300966915117e-31f;
+
58  NK_STORAGE const float a1 = +1.00086760103908896f;
+
59  NK_STORAGE const float a2 = -1.21276126894734565e-2f;
+
60  NK_STORAGE const float a3 = -1.38078780785773762e-1f;
+
61  NK_STORAGE const float a4 = -2.67353392911981221e-2f;
+
62  NK_STORAGE const float a5 = +2.08026600266304389e-2f;
+
63  NK_STORAGE const float a6 = -3.03996055049204407e-3f;
+
64  NK_STORAGE const float a7 = +1.38235642404333740e-4f;
+
65  return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
+
66 }
+
67 #endif
+
68 #ifndef NK_COS
+
69 #define NK_COS nk_cos
+
70 NK_LIB float
+
71 nk_cos(float x)
+
72 {
+
73  /* New implementation. Also generated using lolremez. */
+
74  /* Old version significantly deviated from expected results. */
+
75  NK_STORAGE const float a0 = 9.9995999154986614e-1f;
+
76  NK_STORAGE const float a1 = 1.2548995793001028e-3f;
+
77  NK_STORAGE const float a2 = -5.0648546280678015e-1f;
+
78  NK_STORAGE const float a3 = 1.2942246466519995e-2f;
+
79  NK_STORAGE const float a4 = 2.8668384702547972e-2f;
+
80  NK_STORAGE const float a5 = 7.3726485210586547e-3f;
+
81  NK_STORAGE const float a6 = -3.8510875386947414e-3f;
+
82  NK_STORAGE const float a7 = 4.7196604604366623e-4f;
+
83  NK_STORAGE const float a8 = -1.8776444013090451e-5f;
+
84  return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*(a7 + x*a8)))))));
+
85 }
+
86 #endif
+
87 #ifndef NK_ATAN
+
88 #define NK_ATAN nk_atan
+
89 NK_LIB float
+
90 nk_atan(float x)
+
91 {
+
92  /* ./lolremez --progress --float -d 9 -r "0:pi*2" "atan(x)" */
+
93  float u = -1.0989005e-05f;
+
94  NK_ASSERT(x >= 0.0f && "TODO support negative floats");
+
95  u = u * x + 0.00034117949f;
+
96  u = u * x + -0.0044932296f;
+
97  u = u * x + 0.032596264f;
+
98  u = u * x + -0.14088021f;
+
99  u = u * x + 0.36040401f;
+
100  u = u * x + -0.47017866f;
+
101  u = u * x + 0.00050198776f;
+
102  u = u * x + 1.0077682f;
+
103  u = u * x + -0.0004765437f;
+
104  return u;
+
105 }
+
106 #endif
+
107 #ifndef NK_ATAN2
+
108 #define NK_ATAN2 nk_atan2
+
109 NK_LIB float
+
110 nk_atan2(float y, float x)
+
111 {
+
112  float ax = NK_ABS(x),
+
113  ay = NK_ABS(y);
+
114  /* 0 = +y +x 1 = -y +x
+
115  2 = +y -x 3 = -y -x */
+
116  nk_uint signs = (y < 0) | ((x < 0) << 1);
+
117 
+
118  float a;
+
119  if(y == 0.0 && x == 0.0) return 0.0f;
+
120  a = (ay > ax)
+
121  ? NK_PI_HALF - NK_ATAN(ax / ay)
+
122  : NK_ATAN(ay / ax);
+
123 
+
124  switch(signs){
+
125  case 0: return a;
+
126  case 1: return -a;
+
127  case 2: return -a + NK_PI;
+
128  case 3: return a - NK_PI;
+
129  }
+
130  return 0.0f; /* prevents warning */
+
131 }
+
132 #endif
+
133 NK_LIB nk_uint
+
134 nk_round_up_pow2(nk_uint v)
+
135 {
+
136  v--;
+
137  v |= v >> 1;
+
138  v |= v >> 2;
+
139  v |= v >> 4;
+
140  v |= v >> 8;
+
141  v |= v >> 16;
+
142  v++;
+
143  return v;
+
144 }
+
145 NK_LIB double
+
146 nk_pow(double x, int n)
+
147 {
+
148  /* check the sign of n */
+
149  double r = 1;
+
150  int plus = n >= 0;
+
151  n = (plus) ? n : -n;
+
152  while (n > 0) {
+
153  if ((n & 1) == 1)
+
154  r *= x;
+
155  n /= 2;
+
156  x *= x;
+
157  }
+
158  return plus ? r : 1.0 / r;
+
159 }
+
160 NK_LIB int
+
161 nk_ifloord(double x)
+
162 {
+
163  x = (double)((int)x - ((x < 0.0) ? 1 : 0));
+
164  return (int)x;
+
165 }
+
166 NK_LIB int
+
167 nk_ifloorf(float x)
+
168 {
+
169  x = (float)((int)x - ((x < 0.0f) ? 1 : 0));
+
170  return (int)x;
+
171 }
+
172 NK_LIB int
+
173 nk_iceilf(float x)
+
174 {
+
175  if (x >= 0) {
+
176  int i = (int)x;
+
177  return (x > i) ? i+1: i;
+
178  } else {
+
179  int t = (int)x;
+
180  float r = x - (float)t;
+
181  return (r > 0.0f) ? t+1: t;
+
182  }
+
183 }
+
184 NK_LIB int
+
185 nk_log10(double n)
+
186 {
+
187  int neg;
+
188  int ret;
+
189  int exp = 0;
+
190 
+
191  neg = (n < 0) ? 1 : 0;
+
192  ret = (neg) ? (int)-n : (int)n;
+
193  while ((ret / 10) > 0) {
+
194  ret /= 10;
+
195  exp++;
+
196  }
+
197  if (neg) exp = -exp;
+
198  return exp;
+
199 }
+
200 NK_LIB float
+
201 nk_roundf(float x)
+
202 {
+
203  return (x >= 0.0f) ? (float)nk_ifloorf(x + 0.5f) : (float)nk_iceilf(x - 0.5f);
+
204 }
+
205 NK_API struct nk_rect
+
206 nk_get_null_rect(void)
+
207 {
+
208  return nk_null_rect;
+
209 }
+
210 NK_API struct nk_rect
+
211 nk_rect(float x, float y, float w, float h)
+
212 {
+
213  struct nk_rect r;
+
214  r.x = x; r.y = y;
+
215  r.w = w; r.h = h;
+
216  return r;
+
217 }
+
218 NK_API struct nk_rect
+
219 nk_recti(int x, int y, int w, int h)
+
220 {
+
221  struct nk_rect r;
+
222  r.x = (float)x;
+
223  r.y = (float)y;
+
224  r.w = (float)w;
+
225  r.h = (float)h;
+
226  return r;
+
227 }
+
228 NK_API struct nk_rect
+
229 nk_recta(struct nk_vec2 pos, struct nk_vec2 size)
+
230 {
+
231  return nk_rect(pos.x, pos.y, size.x, size.y);
+
232 }
+
233 NK_API struct nk_rect
+
234 nk_rectv(const float *r)
+
235 {
+
236  return nk_rect(r[0], r[1], r[2], r[3]);
+
237 }
+
238 NK_API struct nk_rect
+
239 nk_rectiv(const int *r)
+
240 {
+
241  return nk_recti(r[0], r[1], r[2], r[3]);
+
242 }
+
243 NK_API struct nk_vec2
+
244 nk_rect_pos(struct nk_rect r)
+
245 {
+
246  struct nk_vec2 ret;
+
247  ret.x = r.x; ret.y = r.y;
+
248  return ret;
+
249 }
+
250 NK_API struct nk_vec2
+
251 nk_rect_size(struct nk_rect r)
+
252 {
+
253  struct nk_vec2 ret;
+
254  ret.x = r.w; ret.y = r.h;
+
255  return ret;
+
256 }
+
257 NK_LIB struct nk_rect
+
258 nk_shrink_rect(struct nk_rect r, float amount)
+
259 {
+
260  struct nk_rect res;
+
261  r.w = NK_MAX(r.w, 2 * amount);
+
262  r.h = NK_MAX(r.h, 2 * amount);
+
263  res.x = r.x + amount;
+
264  res.y = r.y + amount;
+
265  res.w = r.w - 2 * amount;
+
266  res.h = r.h - 2 * amount;
+
267  return res;
+
268 }
+
269 NK_LIB struct nk_rect
+
270 nk_pad_rect(struct nk_rect r, struct nk_vec2 pad)
+
271 {
+
272  r.w = NK_MAX(r.w, 2 * pad.x);
+
273  r.h = NK_MAX(r.h, 2 * pad.y);
+
274  r.x += pad.x; r.y += pad.y;
+
275  r.w -= 2 * pad.x;
+
276  r.h -= 2 * pad.y;
+
277  return r;
+
278 }
+
279 NK_API struct nk_vec2
+
280 nk_vec2(float x, float y)
+
281 {
+
282  struct nk_vec2 ret;
+
283  ret.x = x; ret.y = y;
+
284  return ret;
+
285 }
+
286 NK_API struct nk_vec2
+
287 nk_vec2i(int x, int y)
+
288 {
+
289  struct nk_vec2 ret;
+
290  ret.x = (float)x;
+
291  ret.y = (float)y;
+
292  return ret;
+
293 }
+
294 NK_API struct nk_vec2
+
295 nk_vec2v(const float *v)
+
296 {
+
297  return nk_vec2(v[0], v[1]);
+
298 }
+
299 NK_API struct nk_vec2
+
300 nk_vec2iv(const int *v)
+
301 {
+
302  return nk_vec2i(v[0], v[1]);
+
303 }
+
304 NK_LIB void
+
305 nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0,
+
306  float x1, float y1)
+
307 {
+
308  NK_ASSERT(a);
+
309  NK_ASSERT(clip);
+
310  clip->x = NK_MAX(a->x, x0);
+
311  clip->y = NK_MAX(a->y, y0);
+
312  clip->w = NK_MIN(a->x + a->w, x1) - clip->x;
+
313  clip->h = NK_MIN(a->y + a->h, y1) - clip->y;
+
314  clip->w = NK_MAX(0, clip->w);
+
315  clip->h = NK_MAX(0, clip->h);
+
316 }
+
317 
+
318 NK_API void
+
319 nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r,
+
320  float pad_x, float pad_y, enum nk_heading direction)
+
321 {
+
322  float w_half, h_half;
+
323  NK_ASSERT(result);
+
324 
+
325  r.w = NK_MAX(2 * pad_x, r.w);
+
326  r.h = NK_MAX(2 * pad_y, r.h);
+
327  r.w = r.w - 2 * pad_x;
+
328  r.h = r.h - 2 * pad_y;
+
329 
+
330  r.x = r.x + pad_x;
+
331  r.y = r.y + pad_y;
+
332 
+
333  w_half = r.w / 2.0f;
+
334  h_half = r.h / 2.0f;
+
335 
+
336  if (direction == NK_UP) {
+
337  result[0] = nk_vec2(r.x + w_half, r.y);
+
338  result[1] = nk_vec2(r.x + r.w, r.y + r.h);
+
339  result[2] = nk_vec2(r.x, r.y + r.h);
+
340  } else if (direction == NK_RIGHT) {
+
341  result[0] = nk_vec2(r.x, r.y);
+
342  result[1] = nk_vec2(r.x + r.w, r.y + h_half);
+
343  result[2] = nk_vec2(r.x, r.y + r.h);
+
344  } else if (direction == NK_DOWN) {
+
345  result[0] = nk_vec2(r.x, r.y);
+
346  result[1] = nk_vec2(r.x + r.w, r.y);
+
347  result[2] = nk_vec2(r.x + w_half, r.y + r.h);
+
348  } else {
+
349  result[0] = nk_vec2(r.x, r.y + h_half);
+
350  result[1] = nk_vec2(r.x + r.w, r.y);
+
351  result[2] = nk_vec2(r.x + r.w, r.y + r.h);
+
352  }
+
353 }
+
354 
+
main API and documentation file
+ + + + +
+
+ + + + diff --git a/nuklear__menu_8c_source.html b/nuklear__menu_8c_source.html new file mode 100644 index 000000000..4d95470d3 --- /dev/null +++ b/nuklear__menu_8c_source.html @@ -0,0 +1,421 @@ + + + + + + + +Nuklear: src/nuklear_menu.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_menu.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * MENU
+
7  *
+
8  * ===============================================================*/
+
9 NK_API void
+
10 nk_menubar_begin(struct nk_context *ctx)
+
11 {
+
12  struct nk_panel *layout;
+
13  NK_ASSERT(ctx);
+
14  NK_ASSERT(ctx->current);
+
15  NK_ASSERT(ctx->current->layout);
+
16  if (!ctx || !ctx->current || !ctx->current->layout)
+
17  return;
+
18 
+
19  layout = ctx->current->layout;
+
20  NK_ASSERT(layout->at_y == layout->bounds.y);
+
21  /* if this assert triggers you allocated space between nk_begin and nk_menubar_begin.
+
22  If you want a menubar the first nuklear function after `nk_begin` has to be a
+
23  `nk_menubar_begin` call. Inside the menubar you then have to allocate space for
+
24  widgets (also supports multiple rows).
+
25  Example:
+
26  if (nk_begin(...)) {
+
27  nk_menubar_begin(...);
+
28  nk_layout_xxxx(...);
+
29  nk_button(...);
+
30  nk_layout_xxxx(...);
+
31  nk_button(...);
+
32  nk_menubar_end(...);
+
33  }
+
34  nk_end(...);
+
35  */
+
36  if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
+
37  return;
+
38 
+
39  layout->menu.x = layout->at_x;
+
40  layout->menu.y = layout->at_y + layout->row.height;
+
41  layout->menu.w = layout->bounds.w;
+
42  layout->menu.offset.x = *layout->offset_x;
+
43  layout->menu.offset.y = *layout->offset_y;
+
44  *layout->offset_y = 0;
+
45 }
+
46 NK_API void
+
47 nk_menubar_end(struct nk_context *ctx)
+
48 {
+
49  struct nk_window *win;
+
50  struct nk_panel *layout;
+
51  struct nk_command_buffer *out;
+
52 
+
53  NK_ASSERT(ctx);
+
54  NK_ASSERT(ctx->current);
+
55  NK_ASSERT(ctx->current->layout);
+
56  if (!ctx || !ctx->current || !ctx->current->layout)
+
57  return;
+
58 
+
59  win = ctx->current;
+
60  out = &win->buffer;
+
61  layout = win->layout;
+
62  if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
+
63  return;
+
64 
+
65  layout->menu.h = layout->at_y - layout->menu.y;
+
66  layout->menu.h += layout->row.height + ctx->style.window.spacing.y;
+
67 
+
68  layout->bounds.y += layout->menu.h;
+
69  layout->bounds.h -= layout->menu.h;
+
70 
+
71  *layout->offset_x = layout->menu.offset.x;
+
72  *layout->offset_y = layout->menu.offset.y;
+
73  layout->at_y = layout->bounds.y - layout->row.height;
+
74 
+
75  layout->clip.y = layout->bounds.y;
+
76  layout->clip.h = layout->bounds.h;
+
77  nk_push_scissor(out, layout->clip);
+
78 }
+
79 NK_INTERN int
+
80 nk_menu_begin(struct nk_context *ctx, struct nk_window *win,
+
81  const char *id, int is_clicked, struct nk_rect header, struct nk_vec2 size)
+
82 {
+
83  int is_open = 0;
+
84  int is_active = 0;
+
85  struct nk_rect body;
+
86  struct nk_window *popup;
+
87  nk_hash hash = nk_murmur_hash(id, (int)nk_strlen(id), NK_PANEL_MENU);
+
88 
+
89  NK_ASSERT(ctx);
+
90  NK_ASSERT(ctx->current);
+
91  NK_ASSERT(ctx->current->layout);
+
92  if (!ctx || !ctx->current || !ctx->current->layout)
+
93  return 0;
+
94 
+
95  body.x = header.x;
+
96  body.w = size.x;
+
97  body.y = header.y + header.h;
+
98  body.h = size.y;
+
99 
+
100  popup = win->popup.win;
+
101  is_open = popup ? nk_true : nk_false;
+
102  is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_MENU);
+
103  if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
+
104  (!is_open && !is_active && !is_clicked)) return 0;
+
105  if (!nk_nonblock_begin(ctx, NK_WINDOW_NO_SCROLLBAR, body, header, NK_PANEL_MENU))
+
106  return 0;
+
107 
+
108  win->popup.type = NK_PANEL_MENU;
+
109  win->popup.name = hash;
+
110  return 1;
+
111 }
+
112 NK_API nk_bool
+
113 nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
+
114  nk_flags align, struct nk_vec2 size)
+
115 {
+
116  struct nk_window *win;
+
117  const struct nk_input *in;
+
118  struct nk_rect header;
+
119  int is_clicked = nk_false;
+
120  nk_flags state;
+
121 
+
122  NK_ASSERT(ctx);
+
123  NK_ASSERT(ctx->current);
+
124  NK_ASSERT(ctx->current->layout);
+
125  if (!ctx || !ctx->current || !ctx->current->layout)
+
126  return 0;
+
127 
+
128  win = ctx->current;
+
129  state = nk_widget(&header, ctx);
+
130  if (!state) return 0;
+
131  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
132  if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header,
+
133  title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
+
134  is_clicked = nk_true;
+
135  return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+
136 }
+
137 NK_API nk_bool nk_menu_begin_label(struct nk_context *ctx,
+
138  const char *text, nk_flags align, struct nk_vec2 size)
+
139 {
+
140  return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size);
+
141 }
+
142 NK_API nk_bool
+
143 nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img,
+
144  struct nk_vec2 size)
+
145 {
+
146  struct nk_window *win;
+
147  struct nk_rect header;
+
148  const struct nk_input *in;
+
149  int is_clicked = nk_false;
+
150  nk_flags state;
+
151 
+
152  NK_ASSERT(ctx);
+
153  NK_ASSERT(ctx->current);
+
154  NK_ASSERT(ctx->current->layout);
+
155  if (!ctx || !ctx->current || !ctx->current->layout)
+
156  return 0;
+
157 
+
158  win = ctx->current;
+
159  state = nk_widget(&header, ctx);
+
160  if (!state) return 0;
+
161  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
162  if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header,
+
163  img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in))
+
164  is_clicked = nk_true;
+
165  return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+
166 }
+
167 NK_API nk_bool
+
168 nk_menu_begin_symbol(struct nk_context *ctx, const char *id,
+
169  enum nk_symbol_type sym, struct nk_vec2 size)
+
170 {
+
171  struct nk_window *win;
+
172  const struct nk_input *in;
+
173  struct nk_rect header;
+
174  int is_clicked = nk_false;
+
175  nk_flags state;
+
176 
+
177  NK_ASSERT(ctx);
+
178  NK_ASSERT(ctx->current);
+
179  NK_ASSERT(ctx->current->layout);
+
180  if (!ctx || !ctx->current || !ctx->current->layout)
+
181  return 0;
+
182 
+
183  win = ctx->current;
+
184  state = nk_widget(&header, ctx);
+
185  if (!state) return 0;
+
186  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
187  if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header,
+
188  sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
+
189  is_clicked = nk_true;
+
190  return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+
191 }
+
192 NK_API nk_bool
+
193 nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len,
+
194  nk_flags align, struct nk_image img, struct nk_vec2 size)
+
195 {
+
196  struct nk_window *win;
+
197  struct nk_rect header;
+
198  const struct nk_input *in;
+
199  int is_clicked = nk_false;
+
200  nk_flags state;
+
201 
+
202  NK_ASSERT(ctx);
+
203  NK_ASSERT(ctx->current);
+
204  NK_ASSERT(ctx->current->layout);
+
205  if (!ctx || !ctx->current || !ctx->current->layout)
+
206  return 0;
+
207 
+
208  win = ctx->current;
+
209  state = nk_widget(&header, ctx);
+
210  if (!state) return 0;
+
211  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
212  if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
+
213  header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
+
214  ctx->style.font, in))
+
215  is_clicked = nk_true;
+
216  return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+
217 }
+
218 NK_API nk_bool
+
219 nk_menu_begin_image_label(struct nk_context *ctx,
+
220  const char *title, nk_flags align, struct nk_image img, struct nk_vec2 size)
+
221 {
+
222  return nk_menu_begin_image_text(ctx, title, nk_strlen(title), align, img, size);
+
223 }
+
224 NK_API nk_bool
+
225 nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len,
+
226  nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size)
+
227 {
+
228  struct nk_window *win;
+
229  struct nk_rect header;
+
230  const struct nk_input *in;
+
231  int is_clicked = nk_false;
+
232  nk_flags state;
+
233 
+
234  NK_ASSERT(ctx);
+
235  NK_ASSERT(ctx->current);
+
236  NK_ASSERT(ctx->current->layout);
+
237  if (!ctx || !ctx->current || !ctx->current->layout)
+
238  return 0;
+
239 
+
240  win = ctx->current;
+
241  state = nk_widget(&header, ctx);
+
242  if (!state) return 0;
+
243 
+
244  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
245  if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer,
+
246  header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
+
247  ctx->style.font, in)) is_clicked = nk_true;
+
248  return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+
249 }
+
250 NK_API nk_bool
+
251 nk_menu_begin_symbol_label(struct nk_context *ctx,
+
252  const char *title, nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size )
+
253 {
+
254  return nk_menu_begin_symbol_text(ctx, title, nk_strlen(title), align,sym,size);
+
255 }
+
256 NK_API nk_bool
+
257 nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align)
+
258 {
+
259  return nk_contextual_item_text(ctx, title, len, align);
+
260 }
+
261 NK_API nk_bool
+
262 nk_menu_item_label(struct nk_context *ctx, const char *label, nk_flags align)
+
263 {
+
264  return nk_contextual_item_label(ctx, label, align);
+
265 }
+
266 NK_API nk_bool
+
267 nk_menu_item_image_label(struct nk_context *ctx, struct nk_image img,
+
268  const char *label, nk_flags align)
+
269 {
+
270  return nk_contextual_item_image_label(ctx, img, label, align);
+
271 }
+
272 NK_API nk_bool
+
273 nk_menu_item_image_text(struct nk_context *ctx, struct nk_image img,
+
274  const char *text, int len, nk_flags align)
+
275 {
+
276  return nk_contextual_item_image_text(ctx, img, text, len, align);
+
277 }
+
278 NK_API nk_bool nk_menu_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+
279  const char *text, int len, nk_flags align)
+
280 {
+
281  return nk_contextual_item_symbol_text(ctx, sym, text, len, align);
+
282 }
+
283 NK_API nk_bool nk_menu_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+
284  const char *label, nk_flags align)
+
285 {
+
286  return nk_contextual_item_symbol_label(ctx, sym, label, align);
+
287 }
+
288 NK_API void nk_menu_close(struct nk_context *ctx)
+
289 {
+
290  nk_contextual_close(ctx);
+
291 }
+
292 NK_API void
+
293 nk_menu_end(struct nk_context *ctx)
+
294 {
+
295  nk_contextual_end(ctx);
+
296 }
+
297 
+
main API and documentation file
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + +
+
+ + + + diff --git a/nuklear__page__element_8c_source.html b/nuklear__page__element_8c_source.html new file mode 100644 index 000000000..7e45cea8a --- /dev/null +++ b/nuklear__page__element_8c_source.html @@ -0,0 +1,177 @@ + + + + + + + +Nuklear: src/nuklear_page_element.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_page_element.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * PAGE ELEMENT
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB struct nk_page_element*
+
10 nk_create_page_element(struct nk_context *ctx)
+
11 {
+
12  struct nk_page_element *elem;
+
13  if (ctx->freelist) {
+
14  /* unlink page element from free list */
+
15  elem = ctx->freelist;
+
16  ctx->freelist = elem->next;
+
17  } else if (ctx->use_pool) {
+
18  /* allocate page element from memory pool */
+
19  elem = nk_pool_alloc(&ctx->pool);
+
20  NK_ASSERT(elem);
+
21  if (!elem) return 0;
+
22  } else {
+
23  /* allocate new page element from back of fixed size memory buffer */
+
24  NK_STORAGE const nk_size size = sizeof(struct nk_page_element);
+
25  NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element);
+
26  elem = (struct nk_page_element*)nk_buffer_alloc(&ctx->memory, NK_BUFFER_BACK, size, align);
+
27  NK_ASSERT(elem);
+
28  if (!elem) return 0;
+
29  }
+
30  nk_zero_struct(*elem);
+
31  elem->next = 0;
+
32  elem->prev = 0;
+
33  return elem;
+
34 }
+
35 NK_LIB void
+
36 nk_link_page_element_into_freelist(struct nk_context *ctx,
+
37  struct nk_page_element *elem)
+
38 {
+
39  /* link table into freelist */
+
40  if (!ctx->freelist) {
+
41  ctx->freelist = elem;
+
42  } else {
+
43  elem->next = ctx->freelist;
+
44  ctx->freelist = elem;
+
45  }
+
46 }
+
47 NK_LIB void
+
48 nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem)
+
49 {
+
50  /* we have a pool so just add to free list */
+
51  if (ctx->use_pool) {
+
52  nk_link_page_element_into_freelist(ctx, elem);
+
53  return;
+
54  }
+
55  /* if possible remove last element from back of fixed memory buffer */
+
56  {void *elem_end = (void*)(elem + 1);
+
57  void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size;
+
58  if (elem_end == buffer_end)
+
59  ctx->memory.size -= sizeof(struct nk_page_element);
+
60  else nk_link_page_element_into_freelist(ctx, elem);}
+
61 }
+
62 
+
main API and documentation file
+
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
nk_size size
!< number of allocation calls
Definition: nuklear.h:4198
+ + +
+
+ + + + diff --git a/nuklear__panel_8c_source.html b/nuklear__panel_8c_source.html new file mode 100644 index 000000000..7f87e69f0 --- /dev/null +++ b/nuklear__panel_8c_source.html @@ -0,0 +1,758 @@ + + + + + + + +Nuklear: src/nuklear_panel.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_panel.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * PANEL
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void*
+
10 nk_create_panel(struct nk_context *ctx)
+
11 {
+
12  struct nk_page_element *elem;
+
13  elem = nk_create_page_element(ctx);
+
14  if (!elem) return 0;
+
15  nk_zero_struct(*elem);
+
16  return &elem->data.pan;
+
17 }
+
18 NK_LIB void
+
19 nk_free_panel(struct nk_context *ctx, struct nk_panel *pan)
+
20 {
+
21  union nk_page_data *pd = NK_CONTAINER_OF(pan, union nk_page_data, pan);
+
22  struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+
23  nk_free_page_element(ctx, pe);
+
24 }
+
25 NK_LIB nk_bool
+
26 nk_panel_has_header(nk_flags flags, const char *title)
+
27 {
+
28  nk_bool active = 0;
+
29  active = (flags & (NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE));
+
30  active = active || (flags & NK_WINDOW_TITLE);
+
31  active = active && !(flags & NK_WINDOW_HIDDEN) && title;
+
32  return active;
+
33 }
+
34 NK_LIB struct nk_vec2
+
35 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type)
+
36 {
+
37  switch (type) {
+
38  default:
+
39  case NK_PANEL_WINDOW: return style->window.padding;
+
40  case NK_PANEL_GROUP: return style->window.group_padding;
+
41  case NK_PANEL_POPUP: return style->window.popup_padding;
+
42  case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding;
+
43  case NK_PANEL_COMBO: return style->window.combo_padding;
+
44  case NK_PANEL_MENU: return style->window.menu_padding;
+
45  case NK_PANEL_TOOLTIP: return style->window.menu_padding;}
+
46 }
+
47 NK_LIB float
+
48 nk_panel_get_border(const struct nk_style *style, nk_flags flags,
+
49  enum nk_panel_type type)
+
50 {
+
51  if (flags & NK_WINDOW_BORDER) {
+
52  switch (type) {
+
53  default:
+
54  case NK_PANEL_WINDOW: return style->window.border;
+
55  case NK_PANEL_GROUP: return style->window.group_border;
+
56  case NK_PANEL_POPUP: return style->window.popup_border;
+
57  case NK_PANEL_CONTEXTUAL: return style->window.contextual_border;
+
58  case NK_PANEL_COMBO: return style->window.combo_border;
+
59  case NK_PANEL_MENU: return style->window.menu_border;
+
60  case NK_PANEL_TOOLTIP: return style->window.menu_border;
+
61  }} else return 0;
+
62 }
+
63 NK_LIB struct nk_color
+
64 nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type)
+
65 {
+
66  switch (type) {
+
67  default:
+
68  case NK_PANEL_WINDOW: return style->window.border_color;
+
69  case NK_PANEL_GROUP: return style->window.group_border_color;
+
70  case NK_PANEL_POPUP: return style->window.popup_border_color;
+
71  case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color;
+
72  case NK_PANEL_COMBO: return style->window.combo_border_color;
+
73  case NK_PANEL_MENU: return style->window.menu_border_color;
+
74  case NK_PANEL_TOOLTIP: return style->window.menu_border_color;}
+
75 }
+
76 NK_LIB nk_bool
+
77 nk_panel_is_sub(enum nk_panel_type type)
+
78 {
+
79  return ((int)type & (int)NK_PANEL_SET_SUB)?1:0;
+
80 }
+
81 NK_LIB nk_bool
+
82 nk_panel_is_nonblock(enum nk_panel_type type)
+
83 {
+
84  return ((int)type & (int)NK_PANEL_SET_NONBLOCK)?1:0;
+
85 }
+
86 NK_LIB nk_bool
+
87 nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type)
+
88 {
+
89  struct nk_input *in;
+
90  struct nk_window *win;
+
91  struct nk_panel *layout;
+
92  struct nk_command_buffer *out;
+
93  const struct nk_style *style;
+
94  const struct nk_user_font *font;
+
95 
+
96  struct nk_vec2 scrollbar_size;
+
97  struct nk_vec2 panel_padding;
+
98 
+
99  NK_ASSERT(ctx);
+
100  NK_ASSERT(ctx->current);
+
101  NK_ASSERT(ctx->current->layout);
+
102  if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+
103  nk_zero(ctx->current->layout, sizeof(*ctx->current->layout));
+
104  if ((ctx->current->flags & NK_WINDOW_HIDDEN) || (ctx->current->flags & NK_WINDOW_CLOSED)) {
+
105  nk_zero(ctx->current->layout, sizeof(struct nk_panel));
+
106  ctx->current->layout->type = panel_type;
+
107  return 0;
+
108  }
+
109  /* pull state into local stack */
+
110  style = &ctx->style;
+
111  font = style->font;
+
112  win = ctx->current;
+
113  layout = win->layout;
+
114  out = &win->buffer;
+
115  in = (win->flags & NK_WINDOW_NO_INPUT) ? 0: &ctx->input;
+
116 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
117  win->buffer.userdata = ctx->userdata;
+
118 #endif
+
119  /* pull style configuration into local stack */
+
120  scrollbar_size = style->window.scrollbar_size;
+
121  panel_padding = nk_panel_get_padding(style, panel_type);
+
122 
+
123  /* window movement */
+
124  if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
+
125  nk_bool left_mouse_down;
+
126  unsigned int left_mouse_clicked;
+
127  int left_mouse_click_in_cursor;
+
128 
+
129  /* calculate draggable window space */
+
130  struct nk_rect header;
+
131  header.x = win->bounds.x;
+
132  header.y = win->bounds.y;
+
133  header.w = win->bounds.w;
+
134  if (nk_panel_has_header(win->flags, title)) {
+
135  header.h = font->height + 2.0f * style->window.header.padding.y;
+
136  header.h += 2.0f * style->window.header.label_padding.y;
+
137  } else header.h = panel_padding.y;
+
138 
+
139  /* window movement by dragging */
+
140  left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+
141  left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
+
142  left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
+
143  NK_BUTTON_LEFT, header, nk_true);
+
144  if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
+
145  win->bounds.x = win->bounds.x + in->mouse.delta.x;
+
146  win->bounds.y = win->bounds.y + in->mouse.delta.y;
+
147  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
+
148  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y;
+
149  ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE];
+
150  }
+
151  }
+
152 
+
153  /* setup panel */
+
154  layout->type = panel_type;
+
155  layout->flags = win->flags;
+
156  layout->bounds = win->bounds;
+
157  layout->bounds.x += panel_padding.x;
+
158  layout->bounds.w -= 2*panel_padding.x;
+
159  if (win->flags & NK_WINDOW_BORDER) {
+
160  layout->border = nk_panel_get_border(style, win->flags, panel_type);
+
161  layout->bounds = nk_shrink_rect(layout->bounds, layout->border);
+
162  } else layout->border = 0;
+
163  layout->at_y = layout->bounds.y;
+
164  layout->at_x = layout->bounds.x;
+
165  layout->max_x = 0;
+
166  layout->header_height = 0;
+
167  layout->footer_height = 0;
+ +
169  layout->row.index = 0;
+
170  layout->row.columns = 0;
+
171  layout->row.ratio = 0;
+
172  layout->row.item_width = 0;
+
173  layout->row.tree_depth = 0;
+
174  layout->row.height = panel_padding.y;
+
175  layout->has_scrolling = nk_true;
+
176  if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
+
177  layout->bounds.w -= scrollbar_size.x;
+
178  if (!nk_panel_is_nonblock(panel_type)) {
+
179  layout->footer_height = 0;
+
180  if (!(win->flags & NK_WINDOW_NO_SCROLLBAR) || win->flags & NK_WINDOW_SCALABLE)
+
181  layout->footer_height = scrollbar_size.y;
+
182  layout->bounds.h -= layout->footer_height;
+
183  }
+
184 
+
185  /* panel header */
+
186  if (nk_panel_has_header(win->flags, title))
+
187  {
+
188  struct nk_text text;
+
189  struct nk_rect header;
+
190  const struct nk_style_item *background = 0;
+
191 
+
192  /* calculate header bounds */
+
193  header.x = win->bounds.x;
+
194  header.y = win->bounds.y;
+
195  header.w = win->bounds.w;
+
196  header.h = font->height + 2.0f * style->window.header.padding.y;
+
197  header.h += (2.0f * style->window.header.label_padding.y);
+
198 
+
199  /* shrink panel by header */
+
200  layout->header_height = header.h;
+
201  layout->bounds.y += header.h;
+
202  layout->bounds.h -= header.h;
+
203  layout->at_y += header.h;
+
204 
+
205  /* select correct header background and text color */
+
206  if (ctx->active == win) {
+
207  background = &style->window.header.active;
+
208  text.text = style->window.header.label_active;
+
209  } else if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) {
+
210  background = &style->window.header.hover;
+
211  text.text = style->window.header.label_hover;
+
212  } else {
+
213  background = &style->window.header.normal;
+
214  text.text = style->window.header.label_normal;
+
215  }
+
216 
+
217  /* draw header background */
+
218  header.h += 1.0f;
+
219 
+
220  switch(background->type) {
+
221  case NK_STYLE_ITEM_IMAGE:
+
222  text.background = nk_rgba(0,0,0,0);
+
223  nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
+
224  break;
+
225  case NK_STYLE_ITEM_NINE_SLICE:
+
226  text.background = nk_rgba(0, 0, 0, 0);
+
227  nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white);
+
228  break;
+
229  case NK_STYLE_ITEM_COLOR:
+
230  text.background = background->data.color;
+
231  nk_fill_rect(out, header, 0, background->data.color);
+
232  break;
+
233  }
+
234 
+
235  /* window close button */
+
236  {struct nk_rect button;
+
237  button.y = header.y + style->window.header.padding.y;
+
238  button.h = header.h - 2 * style->window.header.padding.y;
+
239  button.w = button.h;
+
240  if (win->flags & NK_WINDOW_CLOSABLE) {
+
241  nk_flags ws = 0;
+
242  if (style->window.header.align == NK_HEADER_RIGHT) {
+
243  button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
+
244  header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
+
245  } else {
+
246  button.x = header.x + style->window.header.padding.x;
+
247  header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
+
248  }
+
249 
+
250  if (nk_do_button_symbol(&ws, &win->buffer, button,
+
251  style->window.header.close_symbol, NK_BUTTON_DEFAULT,
+
252  &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
+
253  {
+
254  layout->flags |= NK_WINDOW_HIDDEN;
+
255  layout->flags &= (nk_flags)~NK_WINDOW_MINIMIZED;
+
256  }
+
257  }
+
258 
+
259  /* window minimize button */
+
260  if (win->flags & NK_WINDOW_MINIMIZABLE) {
+
261  nk_flags ws = 0;
+
262  if (style->window.header.align == NK_HEADER_RIGHT) {
+
263  button.x = (header.w + header.x) - button.w;
+
264  if (!(win->flags & NK_WINDOW_CLOSABLE)) {
+
265  button.x -= style->window.header.padding.x;
+
266  header.w -= style->window.header.padding.x;
+
267  }
+
268  header.w -= button.w + style->window.header.spacing.x;
+
269  } else {
+
270  button.x = header.x;
+
271  header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
+
272  }
+
273  if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)?
+
274  style->window.header.maximize_symbol: style->window.header.minimize_symbol,
+
275  NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
+
276  layout->flags = (layout->flags & NK_WINDOW_MINIMIZED) ?
+
277  layout->flags & (nk_flags)~NK_WINDOW_MINIMIZED:
+
278  layout->flags | NK_WINDOW_MINIMIZED;
+
279  }}
+
280 
+
281  {/* window header title */
+
282  int text_len = nk_strlen(title);
+
283  struct nk_rect label = {0,0,0,0};
+
284  float t = font->width(font->userdata, font->height, title, text_len);
+
285  text.padding = nk_vec2(0,0);
+
286 
+
287  label.x = header.x + style->window.header.padding.x;
+
288  label.x += style->window.header.label_padding.x;
+
289  label.y = header.y + style->window.header.label_padding.y;
+
290  label.h = font->height + 2 * style->window.header.label_padding.y;
+
291  label.w = t + 2 * style->window.header.spacing.x;
+
292  label.w = NK_CLAMP(0, label.w, header.x + header.w - label.x);
+
293  nk_widget_text(out, label, (const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
+
294  }
+
295 
+
296  /* draw window background */
+
297  if (!(layout->flags & NK_WINDOW_MINIMIZED) && !(layout->flags & NK_WINDOW_DYNAMIC)) {
+
298  struct nk_rect body;
+
299  body.x = win->bounds.x;
+
300  body.w = win->bounds.w;
+
301  body.y = (win->bounds.y + layout->header_height);
+
302  body.h = (win->bounds.h - layout->header_height);
+
303 
+
304  switch(style->window.fixed_background.type) {
+
305  case NK_STYLE_ITEM_IMAGE:
+
306  nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white);
+
307  break;
+
308  case NK_STYLE_ITEM_NINE_SLICE:
+
309  nk_draw_nine_slice(out, body, &style->window.fixed_background.data.slice, nk_white);
+
310  break;
+
311  case NK_STYLE_ITEM_COLOR:
+
312  nk_fill_rect(out, body, style->window.rounding, style->window.fixed_background.data.color);
+
313  break;
+
314  }
+
315  }
+
316 
+
317  /* set clipping rectangle */
+
318  {struct nk_rect clip;
+
319  layout->clip = layout->bounds;
+
320  nk_unify(&clip, &win->buffer.clip, layout->clip.x, layout->clip.y,
+
321  layout->clip.x + layout->clip.w, layout->clip.y + layout->clip.h);
+
322  nk_push_scissor(out, clip);
+
323  layout->clip = clip;}
+
324  return !(layout->flags & NK_WINDOW_HIDDEN) && !(layout->flags & NK_WINDOW_MINIMIZED);
+
325 }
+
326 NK_LIB void
+
327 nk_panel_end(struct nk_context *ctx)
+
328 {
+
329  struct nk_input *in;
+
330  struct nk_window *window;
+
331  struct nk_panel *layout;
+
332  const struct nk_style *style;
+
333  struct nk_command_buffer *out;
+
334 
+
335  struct nk_vec2 scrollbar_size;
+
336  struct nk_vec2 panel_padding;
+
337 
+
338  NK_ASSERT(ctx);
+
339  NK_ASSERT(ctx->current);
+
340  NK_ASSERT(ctx->current->layout);
+
341  if (!ctx || !ctx->current || !ctx->current->layout)
+
342  return;
+
343 
+
344  window = ctx->current;
+
345  layout = window->layout;
+
346  style = &ctx->style;
+
347  out = &window->buffer;
+
348  in = (layout->flags & NK_WINDOW_ROM || layout->flags & NK_WINDOW_NO_INPUT) ? 0 :&ctx->input;
+
349  if (!nk_panel_is_sub(layout->type))
+
350  nk_push_scissor(out, nk_null_rect);
+
351 
+
352  /* cache configuration data */
+
353  scrollbar_size = style->window.scrollbar_size;
+
354  panel_padding = nk_panel_get_padding(style, layout->type);
+
355 
+
356  /* update the current cursor Y-position to point over the last added widget */
+
357  layout->at_y += layout->row.height;
+
358 
+
359  /* dynamic panels */
+
360  if (layout->flags & NK_WINDOW_DYNAMIC && !(layout->flags & NK_WINDOW_MINIMIZED))
+
361  {
+
362  /* update panel height to fit dynamic growth */
+
363  struct nk_rect empty_space;
+
364  if (layout->at_y < (layout->bounds.y + layout->bounds.h))
+
365  layout->bounds.h = layout->at_y - layout->bounds.y;
+
366 
+
367  /* fill top empty space */
+
368  empty_space.x = window->bounds.x;
+
369  empty_space.y = layout->bounds.y;
+
370  empty_space.h = panel_padding.y;
+
371  empty_space.w = window->bounds.w;
+
372  nk_fill_rect(out, empty_space, 0, style->window.background);
+
373 
+
374  /* fill left empty space */
+
375  empty_space.x = window->bounds.x;
+
376  empty_space.y = layout->bounds.y;
+
377  empty_space.w = panel_padding.x + layout->border;
+
378  empty_space.h = layout->bounds.h;
+
379  nk_fill_rect(out, empty_space, 0, style->window.background);
+
380 
+
381  /* fill right empty space */
+
382  empty_space.x = layout->bounds.x + layout->bounds.w;
+
383  empty_space.y = layout->bounds.y;
+
384  empty_space.w = panel_padding.x + layout->border;
+
385  empty_space.h = layout->bounds.h;
+
386  if (*layout->offset_y == 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR))
+
387  empty_space.w += scrollbar_size.x;
+
388  nk_fill_rect(out, empty_space, 0, style->window.background);
+
389 
+
390  /* fill bottom empty space */
+
391  if (layout->footer_height > 0) {
+
392  empty_space.x = window->bounds.x;
+
393  empty_space.y = layout->bounds.y + layout->bounds.h;
+
394  empty_space.w = window->bounds.w;
+
395  empty_space.h = layout->footer_height;
+
396  nk_fill_rect(out, empty_space, 0, style->window.background);
+
397  }
+
398  }
+
399 
+
400  /* scrollbars */
+
401  if (!(layout->flags & NK_WINDOW_NO_SCROLLBAR) &&
+
402  !(layout->flags & NK_WINDOW_MINIMIZED) &&
+
403  window->scrollbar_hiding_timer < NK_SCROLLBAR_HIDING_TIMEOUT)
+
404  {
+
405  struct nk_rect scroll;
+
406  int scroll_has_scrolling;
+
407  float scroll_target;
+
408  float scroll_offset;
+
409  float scroll_step;
+
410  float scroll_inc;
+
411 
+
412  /* mouse wheel scrolling */
+
413  if (nk_panel_is_sub(layout->type))
+
414  {
+
415  /* sub-window mouse wheel scrolling */
+
416  struct nk_window *root_window = window;
+
417  struct nk_panel *root_panel = window->layout;
+
418  while (root_panel->parent)
+
419  root_panel = root_panel->parent;
+
420  while (root_window->parent)
+
421  root_window = root_window->parent;
+
422 
+
423  /* only allow scrolling if parent window is active */
+
424  scroll_has_scrolling = 0;
+
425  if ((root_window == ctx->active) && layout->has_scrolling) {
+
426  /* and panel is being hovered and inside clip rect*/
+
427  if (nk_input_is_mouse_hovering_rect(in, layout->bounds) &&
+
428  NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h,
+
429  root_panel->clip.x, root_panel->clip.y, root_panel->clip.w, root_panel->clip.h))
+
430  {
+
431  /* deactivate all parent scrolling */
+
432  root_panel = window->layout;
+
433  while (root_panel->parent) {
+
434  root_panel->has_scrolling = nk_false;
+
435  root_panel = root_panel->parent;
+
436  }
+
437  root_panel->has_scrolling = nk_false;
+
438  scroll_has_scrolling = nk_true;
+
439  }
+
440  }
+
441  } else if (!nk_panel_is_sub(layout->type)) {
+
442  /* window mouse wheel scrolling */
+
443  scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling;
+
444  if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling)
+
445  window->scrolled = nk_true;
+
446  else window->scrolled = nk_false;
+
447  } else scroll_has_scrolling = nk_false;
+
448 
+
449  {
+
450  /* vertical scrollbar */
+
451  nk_flags state = 0;
+
452  scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
+
453  scroll.y = layout->bounds.y;
+
454  scroll.w = scrollbar_size.x;
+
455  scroll.h = layout->bounds.h;
+
456 
+
457  scroll_offset = (float)*layout->offset_y;
+
458  scroll_step = scroll.h * 0.10f;
+
459  scroll_inc = scroll.h * 0.01f;
+
460  scroll_target = (float)(int)(layout->at_y - scroll.y);
+
461  scroll_offset = nk_do_scrollbarv(&state, out, scroll, scroll_has_scrolling,
+
462  scroll_offset, scroll_target, scroll_step, scroll_inc,
+
463  &ctx->style.scrollv, in, style->font);
+
464  *layout->offset_y = (nk_uint)scroll_offset;
+
465  if (in && scroll_has_scrolling)
+
466  in->mouse.scroll_delta.y = 0;
+
467  }
+
468  {
+
469  /* horizontal scrollbar */
+
470  nk_flags state = 0;
+
471  scroll.x = layout->bounds.x;
+
472  scroll.y = layout->bounds.y + layout->bounds.h;
+
473  scroll.w = layout->bounds.w;
+
474  scroll.h = scrollbar_size.y;
+
475 
+
476  scroll_offset = (float)*layout->offset_x;
+
477  scroll_target = (float)(int)(layout->max_x - scroll.x);
+
478  scroll_step = layout->max_x * 0.05f;
+
479  scroll_inc = layout->max_x * 0.005f;
+
480  scroll_offset = nk_do_scrollbarh(&state, out, scroll, scroll_has_scrolling,
+
481  scroll_offset, scroll_target, scroll_step, scroll_inc,
+
482  &ctx->style.scrollh, in, style->font);
+
483  *layout->offset_x = (nk_uint)scroll_offset;
+
484  }
+
485  }
+
486 
+
487  /* hide scroll if no user input */
+
488  if (window->flags & NK_WINDOW_SCROLL_AUTO_HIDE) {
+
489  int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0;
+
490  int is_window_hovered = nk_window_is_hovered(ctx);
+
491  int any_item_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
+
492  if ((!has_input && is_window_hovered) || (!is_window_hovered && !any_item_active))
+
493  window->scrollbar_hiding_timer += ctx->delta_time_seconds;
+
494  else window->scrollbar_hiding_timer = 0;
+
495  } else window->scrollbar_hiding_timer = 0;
+
496 
+
497  /* window border */
+
498  if (layout->flags & NK_WINDOW_BORDER)
+
499  {
+
500  struct nk_color border_color = nk_panel_get_border_color(style, layout->type);
+
501  const float padding_y = (layout->flags & NK_WINDOW_MINIMIZED)
+
502  ? (style->window.border + window->bounds.y + layout->header_height)
+
503  : ((layout->flags & NK_WINDOW_DYNAMIC)
+
504  ? (layout->bounds.y + layout->bounds.h + layout->footer_height)
+
505  : (window->bounds.y + window->bounds.h));
+
506  struct nk_rect b = window->bounds;
+
507  b.h = padding_y - window->bounds.y;
+
508  nk_stroke_rect(out, b, style->window.rounding, layout->border, border_color);
+
509  }
+
510 
+
511  /* scaler */
+
512  if ((layout->flags & NK_WINDOW_SCALABLE) && in && !(layout->flags & NK_WINDOW_MINIMIZED))
+
513  {
+
514  /* calculate scaler bounds */
+
515  struct nk_rect scaler;
+
516  scaler.w = scrollbar_size.x;
+
517  scaler.h = scrollbar_size.y;
+
518  scaler.y = layout->bounds.y + layout->bounds.h;
+
519  if (layout->flags & NK_WINDOW_SCALE_LEFT)
+
520  scaler.x = layout->bounds.x - panel_padding.x * 0.5f;
+
521  else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
+
522  if (layout->flags & NK_WINDOW_NO_SCROLLBAR)
+
523  scaler.x -= scaler.w;
+
524 
+
525  /* draw scaler */
+
526  {const struct nk_style_item *item = &style->window.scaler;
+
527  if (item->type == NK_STYLE_ITEM_IMAGE)
+
528  nk_draw_image(out, scaler, &item->data.image, nk_white);
+
529  else {
+
530  if (layout->flags & NK_WINDOW_SCALE_LEFT) {
+
531  nk_fill_triangle(out, scaler.x, scaler.y, scaler.x,
+
532  scaler.y + scaler.h, scaler.x + scaler.w,
+
533  scaler.y + scaler.h, item->data.color);
+
534  } else {
+
535  nk_fill_triangle(out, scaler.x + scaler.w, scaler.y, scaler.x + scaler.w,
+
536  scaler.y + scaler.h, scaler.x, scaler.y + scaler.h, item->data.color);
+
537  }
+
538  }}
+
539 
+
540  /* do window scaling */
+
541  if (!(window->flags & NK_WINDOW_ROM)) {
+
542  struct nk_vec2 window_size = style->window.min_size;
+
543  int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+
544  int left_mouse_click_in_scaler = nk_input_has_mouse_click_down_in_rect(in,
+
545  NK_BUTTON_LEFT, scaler, nk_true);
+
546 
+
547  if (left_mouse_down && left_mouse_click_in_scaler) {
+
548  float delta_x = in->mouse.delta.x;
+
549  if (layout->flags & NK_WINDOW_SCALE_LEFT) {
+
550  delta_x = -delta_x;
+
551  window->bounds.x += in->mouse.delta.x;
+
552  }
+
553  /* dragging in x-direction */
+
554  if (window->bounds.w + delta_x >= window_size.x) {
+
555  if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
+
556  window->bounds.w = window->bounds.w + delta_x;
+
557  scaler.x += in->mouse.delta.x;
+
558  }
+
559  }
+
560  /* dragging in y-direction (only possible if static window) */
+
561  if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
+
562  if (window_size.y < window->bounds.h + in->mouse.delta.y) {
+
563  if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
+
564  window->bounds.h = window->bounds.h + in->mouse.delta.y;
+
565  scaler.y += in->mouse.delta.y;
+
566  }
+
567  }
+
568  }
+
569  ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
+
570  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f;
+
571  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f;
+
572  }
+
573  }
+
574  }
+
575  if (!nk_panel_is_sub(layout->type)) {
+
576  /* window is hidden so clear command buffer */
+
577  if (layout->flags & NK_WINDOW_HIDDEN)
+
578  nk_command_buffer_reset(&window->buffer);
+
579  /* window is visible and not tab */
+
580  else nk_finish(ctx, window);
+
581  }
+
582 
+
583  /* NK_WINDOW_REMOVE_ROM flag was set so remove NK_WINDOW_ROM */
+
584  if (layout->flags & NK_WINDOW_REMOVE_ROM) {
+
585  layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
586  layout->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
+
587  }
+
588  window->flags = layout->flags;
+
589 
+
590  /* property garbage collector */
+
591  if (window->property.active && window->property.old != window->property.seq &&
+
592  window->property.active == window->property.prev) {
+
593  nk_zero(&window->property, sizeof(window->property));
+
594  } else {
+
595  window->property.old = window->property.seq;
+
596  window->property.prev = window->property.active;
+
597  window->property.seq = 0;
+
598  }
+
599  /* edit garbage collector */
+
600  if (window->edit.active && window->edit.old != window->edit.seq &&
+
601  window->edit.active == window->edit.prev) {
+
602  nk_zero(&window->edit, sizeof(window->edit));
+
603  } else {
+
604  window->edit.old = window->edit.seq;
+
605  window->edit.prev = window->edit.active;
+
606  window->edit.seq = 0;
+
607  }
+
608  /* contextual garbage collector */
+
609  if (window->popup.active_con && window->popup.con_old != window->popup.con_count) {
+
610  window->popup.con_count = 0;
+
611  window->popup.con_old = 0;
+
612  window->popup.active_con = 0;
+
613  } else {
+
614  window->popup.con_old = window->popup.con_count;
+
615  window->popup.con_count = 0;
+
616  }
+
617  window->popup.combo_count = 0;
+
618  /* helper to make sure you have a 'nk_tree_push' for every 'nk_tree_pop' */
+
619  NK_ASSERT(!layout->row.tree_depth);
+
620 }
+
621 
+
main API and documentation file
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
Definition: nuklear.h:5491
+
@ NK_WINDOW_REMOVE_ROM
Removes read only mode at the end of the window.
Definition: nuklear.h:5497
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+ + + + + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + + +
+
+ + + + diff --git a/nuklear__pool_8c_source.html b/nuklear__pool_8c_source.html new file mode 100644 index 000000000..f0c1593e5 --- /dev/null +++ b/nuklear__pool_8c_source.html @@ -0,0 +1,181 @@ + + + + + + + +Nuklear: src/nuklear_pool.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_pool.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * POOL
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_pool_init(struct nk_pool *pool, const struct nk_allocator *alloc,
+
11  unsigned int capacity)
+
12 {
+
13  NK_ASSERT(capacity >= 1);
+
14  nk_zero(pool, sizeof(*pool));
+
15  pool->alloc = *alloc;
+
16  pool->capacity = capacity;
+
17  pool->type = NK_BUFFER_DYNAMIC;
+
18  pool->pages = 0;
+
19 }
+
20 NK_LIB void
+
21 nk_pool_free(struct nk_pool *pool)
+
22 {
+
23  struct nk_page *iter;
+
24  if (!pool) return;
+
25  iter = pool->pages;
+
26  if (pool->type == NK_BUFFER_FIXED) return;
+
27  while (iter) {
+
28  struct nk_page *next = iter->next;
+
29  pool->alloc.free(pool->alloc.userdata, iter);
+
30  iter = next;
+
31  }
+
32 }
+
33 NK_LIB void
+
34 nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
+
35 {
+
36  nk_zero(pool, sizeof(*pool));
+
37  NK_ASSERT(size >= sizeof(struct nk_page));
+
38  if (size < sizeof(struct nk_page)) return;
+
39  /* first nk_page_element is embedded in nk_page, additional elements follow in adjacent space */
+
40  pool->capacity = (unsigned)(1 + (size - sizeof(struct nk_page)) / sizeof(struct nk_page_element));
+
41  pool->pages = (struct nk_page*)memory;
+
42  pool->type = NK_BUFFER_FIXED;
+
43  pool->size = size;
+
44 }
+
45 NK_LIB struct nk_page_element*
+
46 nk_pool_alloc(struct nk_pool *pool)
+
47 {
+
48  if (!pool->pages || pool->pages->size >= pool->capacity) {
+
49  /* allocate new page */
+
50  struct nk_page *page;
+
51  if (pool->type == NK_BUFFER_FIXED) {
+
52  NK_ASSERT(pool->pages);
+
53  if (!pool->pages) return 0;
+
54  NK_ASSERT(pool->pages->size < pool->capacity);
+
55  return 0;
+
56  } else {
+
57  nk_size size = sizeof(struct nk_page);
+
58  size += (pool->capacity - 1) * sizeof(struct nk_page_element);
+
59  page = (struct nk_page*)pool->alloc.alloc(pool->alloc.userdata,0, size);
+
60  page->next = pool->pages;
+
61  pool->pages = page;
+
62  page->size = 0;
+
63  }
+
64  } return &pool->pages->win[pool->pages->size++];
+
65 }
+
66 
+
main API and documentation file
+ + + + +
+
+ + + + diff --git a/nuklear__popup_8c_source.html b/nuklear__popup_8c_source.html new file mode 100644 index 000000000..98c446c44 --- /dev/null +++ b/nuklear__popup_8c_source.html @@ -0,0 +1,384 @@ + + + + + + + +Nuklear: src/nuklear_popup.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_popup.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * POPUP
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type,
+
11  const char *title, nk_flags flags, struct nk_rect rect)
+
12 {
+
13  struct nk_window *popup;
+
14  struct nk_window *win;
+
15  struct nk_panel *panel;
+
16 
+
17  int title_len;
+
18  nk_hash title_hash;
+
19  nk_size allocated;
+
20 
+
21  NK_ASSERT(ctx);
+
22  NK_ASSERT(title);
+
23  NK_ASSERT(ctx->current);
+
24  NK_ASSERT(ctx->current->layout);
+
25  if (!ctx || !ctx->current || !ctx->current->layout)
+
26  return 0;
+
27 
+
28  win = ctx->current;
+
29  panel = win->layout;
+
30  NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP) && "popups are not allowed to have popups");
+
31  (void)panel;
+
32  title_len = (int)nk_strlen(title);
+
33  title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP);
+
34 
+
35  popup = win->popup.win;
+
36  if (!popup) {
+
37  popup = (struct nk_window*)nk_create_window(ctx);
+
38  popup->parent = win;
+
39  win->popup.win = popup;
+
40  win->popup.active = 0;
+
41  win->popup.type = NK_PANEL_POPUP;
+
42  }
+
43 
+
44  /* make sure we have correct popup */
+
45  if (win->popup.name != title_hash) {
+
46  if (!win->popup.active) {
+
47  nk_zero(popup, sizeof(*popup));
+
48  win->popup.name = title_hash;
+
49  win->popup.active = 1;
+
50  win->popup.type = NK_PANEL_POPUP;
+
51  } else return 0;
+
52  }
+
53 
+
54  /* popup position is local to window */
+
55  ctx->current = popup;
+
56  rect.x += win->layout->clip.x;
+
57  rect.y += win->layout->clip.y;
+
58 
+
59  /* setup popup data */
+
60  popup->parent = win;
+
61  popup->bounds = rect;
+
62  popup->seq = ctx->seq;
+
63  popup->layout = (struct nk_panel*)nk_create_panel(ctx);
+
64  popup->flags = flags;
+
65  popup->flags |= NK_WINDOW_BORDER;
+
66  if (type == NK_POPUP_DYNAMIC)
+
67  popup->flags |= NK_WINDOW_DYNAMIC;
+
68 
+
69  popup->buffer = win->buffer;
+
70  nk_start_popup(ctx, win);
+
71  allocated = ctx->memory.allocated;
+
72  nk_push_scissor(&popup->buffer, nk_null_rect);
+
73 
+
74  if (nk_panel_begin(ctx, title, NK_PANEL_POPUP)) {
+
75  /* popup is running therefore invalidate parent panels */
+
76  struct nk_panel *root;
+
77  root = win->layout;
+
78  while (root) {
+
79  root->flags |= NK_WINDOW_ROM;
+
80  root->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
+
81  root = root->parent;
+
82  }
+
83  win->popup.active = 1;
+
84  popup->layout->offset_x = &popup->scrollbar.x;
+
85  popup->layout->offset_y = &popup->scrollbar.y;
+
86  popup->layout->parent = win->layout;
+
87  return 1;
+
88  } else {
+
89  /* popup was closed/is invalid so cleanup */
+
90  struct nk_panel *root;
+
91  root = win->layout;
+
92  while (root) {
+
93  root->flags |= NK_WINDOW_REMOVE_ROM;
+
94  root = root->parent;
+
95  }
+
96  win->popup.buf.active = 0;
+
97  win->popup.active = 0;
+
98  ctx->memory.allocated = allocated;
+
99  ctx->current = win;
+
100  nk_free_panel(ctx, popup->layout);
+
101  popup->layout = 0;
+
102  return 0;
+
103  }
+
104 }
+
105 NK_LIB nk_bool
+
106 nk_nonblock_begin(struct nk_context *ctx,
+
107  nk_flags flags, struct nk_rect body, struct nk_rect header,
+
108  enum nk_panel_type panel_type)
+
109 {
+
110  struct nk_window *popup;
+
111  struct nk_window *win;
+
112  struct nk_panel *panel;
+
113  int is_active = nk_true;
+
114 
+
115  NK_ASSERT(ctx);
+
116  NK_ASSERT(ctx->current);
+
117  NK_ASSERT(ctx->current->layout);
+
118  if (!ctx || !ctx->current || !ctx->current->layout)
+
119  return 0;
+
120 
+
121  /* popups cannot have popups */
+
122  win = ctx->current;
+
123  panel = win->layout;
+
124  NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP));
+
125  (void)panel;
+
126  popup = win->popup.win;
+
127  if (!popup) {
+
128  /* create window for nonblocking popup */
+
129  popup = (struct nk_window*)nk_create_window(ctx);
+
130  popup->parent = win;
+
131  win->popup.win = popup;
+
132  win->popup.type = panel_type;
+
133  nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON);
+
134  } else {
+
135  /* close the popup if user pressed outside or in the header */
+
136  int pressed, in_body, in_header;
+
137 #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+
138  pressed = nk_input_is_mouse_released(&ctx->input, NK_BUTTON_LEFT);
+
139 #else
+
140  pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
+
141 #endif
+
142  in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
+
143  in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
+
144  if (pressed && (!in_body || in_header))
+
145  is_active = nk_false;
+
146  }
+
147  win->popup.header = header;
+
148 
+
149  if (!is_active) {
+
150  /* remove read only mode from all parent panels */
+
151  struct nk_panel *root = win->layout;
+
152  while (root) {
+
153  root->flags |= NK_WINDOW_REMOVE_ROM;
+
154  root = root->parent;
+
155  }
+
156  return is_active;
+
157  }
+
158  popup->bounds = body;
+
159  popup->parent = win;
+
160  popup->layout = (struct nk_panel*)nk_create_panel(ctx);
+
161  popup->flags = flags;
+
162  popup->flags |= NK_WINDOW_BORDER;
+
163  popup->flags |= NK_WINDOW_DYNAMIC;
+
164  popup->seq = ctx->seq;
+
165  win->popup.active = 1;
+
166  NK_ASSERT(popup->layout);
+
167 
+
168  nk_start_popup(ctx, win);
+
169  popup->buffer = win->buffer;
+
170  nk_push_scissor(&popup->buffer, nk_null_rect);
+
171  ctx->current = popup;
+
172 
+
173  nk_panel_begin(ctx, 0, panel_type);
+
174  win->buffer = popup->buffer;
+
175  popup->layout->parent = win->layout;
+
176  popup->layout->offset_x = &popup->scrollbar.x;
+
177  popup->layout->offset_y = &popup->scrollbar.y;
+
178 
+
179  /* set read only mode to all parent panels */
+
180  {struct nk_panel *root;
+
181  root = win->layout;
+
182  while (root) {
+
183  root->flags |= NK_WINDOW_ROM;
+
184  root = root->parent;
+
185  }}
+
186  return is_active;
+
187 }
+
188 NK_API void
+
189 nk_popup_close(struct nk_context *ctx)
+
190 {
+
191  struct nk_window *popup;
+
192  NK_ASSERT(ctx);
+
193  if (!ctx || !ctx->current) return;
+
194 
+
195  popup = ctx->current;
+
196  NK_ASSERT(popup->parent);
+
197  NK_ASSERT((int)popup->layout->type & (int)NK_PANEL_SET_POPUP);
+
198  popup->flags |= NK_WINDOW_HIDDEN;
+
199 }
+
200 NK_API void
+
201 nk_popup_end(struct nk_context *ctx)
+
202 {
+
203  struct nk_window *win;
+
204  struct nk_window *popup;
+
205 
+
206  NK_ASSERT(ctx);
+
207  NK_ASSERT(ctx->current);
+
208  NK_ASSERT(ctx->current->layout);
+
209  if (!ctx || !ctx->current || !ctx->current->layout)
+
210  return;
+
211 
+
212  popup = ctx->current;
+
213  if (!popup->parent) return;
+
214  win = popup->parent;
+
215  if (popup->flags & NK_WINDOW_HIDDEN) {
+
216  struct nk_panel *root;
+
217  root = win->layout;
+
218  while (root) {
+
219  root->flags |= NK_WINDOW_REMOVE_ROM;
+
220  root = root->parent;
+
221  }
+
222  win->popup.active = 0;
+
223  }
+
224  nk_push_scissor(&popup->buffer, nk_null_rect);
+
225  nk_end(ctx);
+
226 
+
227  win->buffer = popup->buffer;
+
228  nk_finish_popup(ctx, win);
+
229  ctx->current = win;
+
230  nk_push_scissor(&win->buffer, win->layout->clip);
+
231 }
+
232 NK_API void
+
233 nk_popup_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+
234 {
+
235  struct nk_window *popup;
+
236 
+
237  NK_ASSERT(ctx);
+
238  NK_ASSERT(ctx->current);
+
239  NK_ASSERT(ctx->current->layout);
+
240  if (!ctx || !ctx->current || !ctx->current->layout)
+
241  return;
+
242 
+
243  popup = ctx->current;
+
244  if (offset_x)
+
245  *offset_x = popup->scrollbar.x;
+
246  if (offset_y)
+
247  *offset_y = popup->scrollbar.y;
+
248 }
+
249 NK_API void
+
250 nk_popup_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+
251 {
+
252  struct nk_window *popup;
+
253 
+
254  NK_ASSERT(ctx);
+
255  NK_ASSERT(ctx->current);
+
256  NK_ASSERT(ctx->current->layout);
+
257  if (!ctx || !ctx->current || !ctx->current->layout)
+
258  return;
+
259 
+
260  popup = ctx->current;
+
261  popup->scrollbar.x = offset_x;
+
262  popup->scrollbar.y = offset_y;
+
263 }
+
main API and documentation file
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
@ NK_WINDOW_DYNAMIC
special window type growing up in height while being filled to a certain maximum height
Definition: nuklear.h:5491
+
@ NK_WINDOW_REMOVE_ROM
Removes read only mode at the end of the window.
Definition: nuklear.h:5497
+
NK_API void nk_end(struct nk_context *ctx)
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+ + + + +
+
+ + + + diff --git a/nuklear__progress_8c_source.html b/nuklear__progress_8c_source.html new file mode 100644 index 000000000..49185d469 --- /dev/null +++ b/nuklear__progress_8c_source.html @@ -0,0 +1,291 @@ + + + + + + + +Nuklear: src/nuklear_progress.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_progress.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * PROGRESS
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB nk_size
+
10 nk_progress_behavior(nk_flags *state, struct nk_input *in,
+
11  struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, nk_bool modifiable)
+
12 {
+
13  int left_mouse_down = 0;
+
14  int left_mouse_click_in_cursor = 0;
+
15 
+
16  nk_widget_state_reset(state);
+
17  if (!in || !modifiable) return value;
+
18  left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+
19  left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
+
20  NK_BUTTON_LEFT, cursor, nk_true);
+
21  if (nk_input_is_mouse_hovering_rect(in, r))
+
22  *state = NK_WIDGET_STATE_HOVERED;
+
23 
+
24  if (in && left_mouse_down && left_mouse_click_in_cursor) {
+
25  if (left_mouse_down && left_mouse_click_in_cursor) {
+
26  float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w;
+
27  value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max);
+
28  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f;
+
29  *state |= NK_WIDGET_STATE_ACTIVE;
+
30  }
+
31  }
+
32  /* set progressbar widget state */
+
33  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r))
+
34  *state |= NK_WIDGET_STATE_ENTERED;
+
35  else if (nk_input_is_mouse_prev_hovering_rect(in, r))
+
36  *state |= NK_WIDGET_STATE_LEFT;
+
37  return value;
+
38 }
+
39 NK_LIB void
+
40 nk_draw_progress(struct nk_command_buffer *out, nk_flags state,
+
41  const struct nk_style_progress *style, const struct nk_rect *bounds,
+
42  const struct nk_rect *scursor, nk_size value, nk_size max)
+
43 {
+
44  const struct nk_style_item *background;
+
45  const struct nk_style_item *cursor;
+
46 
+
47  NK_UNUSED(max);
+
48  NK_UNUSED(value);
+
49 
+
50  /* select correct colors/images to draw */
+
51  if (state & NK_WIDGET_STATE_ACTIVED) {
+
52  background = &style->active;
+
53  cursor = &style->cursor_active;
+
54  } else if (state & NK_WIDGET_STATE_HOVER){
+
55  background = &style->hover;
+
56  cursor = &style->cursor_hover;
+
57  } else {
+
58  background = &style->normal;
+
59  cursor = &style->cursor_normal;
+
60  }
+
61 
+
62  /* draw background */
+
63  switch(background->type) {
+
64  case NK_STYLE_ITEM_IMAGE:
+
65  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
66  break;
+
67  case NK_STYLE_ITEM_NINE_SLICE:
+
68  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
69  break;
+
70  case NK_STYLE_ITEM_COLOR:
+
71  nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor));
+
72  nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor));
+
73  break;
+
74  }
+
75 
+
76  /* draw cursor */
+
77  switch(cursor->type) {
+
78  case NK_STYLE_ITEM_IMAGE:
+
79  nk_draw_image(out, *scursor, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
80  break;
+
81  case NK_STYLE_ITEM_NINE_SLICE:
+
82  nk_draw_nine_slice(out, *scursor, &cursor->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
83  break;
+
84  case NK_STYLE_ITEM_COLOR:
+
85  nk_fill_rect(out, *scursor, style->rounding, nk_rgb_factor(cursor->data.color, style->color_factor));
+
86  nk_stroke_rect(out, *scursor, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor));
+
87  break;
+
88  }
+
89 }
+
90 NK_LIB nk_size
+
91 nk_do_progress(nk_flags *state,
+
92  struct nk_command_buffer *out, struct nk_rect bounds,
+
93  nk_size value, nk_size max, nk_bool modifiable,
+
94  const struct nk_style_progress *style, struct nk_input *in)
+
95 {
+
96  float prog_scale;
+
97  nk_size prog_value;
+
98  struct nk_rect cursor;
+
99 
+
100  NK_ASSERT(style);
+
101  NK_ASSERT(out);
+
102  if (!out || !style) return 0;
+
103 
+
104  /* calculate progressbar cursor */
+
105  cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border);
+
106  cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border);
+
107  cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border));
+
108  prog_scale = (float)value / (float)max;
+
109 
+
110  /* update progressbar */
+
111  prog_value = NK_MIN(value, max);
+
112  prog_value = nk_progress_behavior(state, in, bounds, cursor,max, prog_value, modifiable);
+
113  cursor.w = cursor.w * prog_scale;
+
114 
+
115  /* draw progressbar */
+
116  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
117  nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
+
118  if (style->draw_end) style->draw_end(out, style->userdata);
+
119  return prog_value;
+
120 }
+
121 NK_API nk_bool
+
122 nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, nk_bool is_modifyable)
+
123 {
+
124  struct nk_window *win;
+
125  struct nk_panel *layout;
+
126  const struct nk_style *style;
+
127  struct nk_input *in;
+
128 
+
129  struct nk_rect bounds;
+
130  enum nk_widget_layout_states state;
+
131  nk_size old_value;
+
132 
+
133  NK_ASSERT(ctx);
+
134  NK_ASSERT(cur);
+
135  NK_ASSERT(ctx->current);
+
136  NK_ASSERT(ctx->current->layout);
+
137  if (!ctx || !ctx->current || !ctx->current->layout || !cur)
+
138  return 0;
+
139 
+
140  win = ctx->current;
+
141  style = &ctx->style;
+
142  layout = win->layout;
+
143  state = nk_widget(&bounds, ctx);
+
144  if (!state) return 0;
+
145 
+
146  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
147  old_value = *cur;
+
148  *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds,
+
149  *cur, max, is_modifyable, &style->progress, in);
+
150  return (*cur != old_value);
+
151 }
+
152 NK_API nk_size
+
153 nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, nk_bool modifyable)
+
154 {
+
155  nk_progress(ctx, &cur, max, modifyable);
+
156  return cur;
+
157 }
+
158 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + + + +
+
+ + + + diff --git a/nuklear__property_8c_source.html b/nuklear__property_8c_source.html new file mode 100644 index 000000000..e4b1fa8cb --- /dev/null +++ b/nuklear__property_8c_source.html @@ -0,0 +1,658 @@ + + + + + + + +Nuklear: src/nuklear_property.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_property.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * PROPERTY
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_drag_behavior(nk_flags *state, const struct nk_input *in,
+
11  struct nk_rect drag, struct nk_property_variant *variant,
+
12  float inc_per_pixel)
+
13 {
+
14  int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+
15  int left_mouse_click_in_cursor = in &&
+
16  nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true);
+
17 
+
18  nk_widget_state_reset(state);
+
19  if (nk_input_is_mouse_hovering_rect(in, drag))
+
20  *state = NK_WIDGET_STATE_HOVERED;
+
21 
+
22  if (left_mouse_down && left_mouse_click_in_cursor) {
+
23  float delta, pixels;
+
24  pixels = in->mouse.delta.x;
+
25  delta = pixels * inc_per_pixel;
+
26  switch (variant->kind) {
+
27  default: break;
+
28  case NK_PROPERTY_INT:
+
29  variant->value.i = variant->value.i + (int)delta;
+
30  variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
+
31  break;
+
32  case NK_PROPERTY_FLOAT:
+
33  variant->value.f = variant->value.f + (float)delta;
+
34  variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
+
35  break;
+
36  case NK_PROPERTY_DOUBLE:
+
37  variant->value.d = variant->value.d + (double)delta;
+
38  variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
+
39  break;
+
40  }
+
41  *state = NK_WIDGET_STATE_ACTIVE;
+
42  }
+
43  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag))
+
44  *state |= NK_WIDGET_STATE_ENTERED;
+
45  else if (nk_input_is_mouse_prev_hovering_rect(in, drag))
+
46  *state |= NK_WIDGET_STATE_LEFT;
+
47 }
+
48 NK_LIB void
+
49 nk_property_behavior(nk_flags *ws, const struct nk_input *in,
+
50  struct nk_rect property, struct nk_rect label, struct nk_rect edit,
+
51  struct nk_rect empty, int *state, struct nk_property_variant *variant,
+
52  float inc_per_pixel)
+
53 {
+
54  nk_widget_state_reset(ws);
+
55  if (in && *state == NK_PROPERTY_DEFAULT) {
+
56  if (nk_button_behavior(ws, edit, in, NK_BUTTON_DEFAULT))
+
57  *state = NK_PROPERTY_EDIT;
+
58  else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, label, nk_true))
+
59  *state = NK_PROPERTY_DRAG;
+
60  else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, empty, nk_true))
+
61  *state = NK_PROPERTY_DRAG;
+
62  }
+
63  if (*state == NK_PROPERTY_DRAG) {
+
64  nk_drag_behavior(ws, in, property, variant, inc_per_pixel);
+
65  if (!(*ws & NK_WIDGET_STATE_ACTIVED)) *state = NK_PROPERTY_DEFAULT;
+
66  }
+
67 }
+
68 NK_LIB void
+
69 nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style,
+
70  const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state,
+
71  const char *name, int len, const struct nk_user_font *font)
+
72 {
+
73  struct nk_text text;
+
74  const struct nk_style_item *background;
+
75 
+
76  /* select correct background and text color */
+
77  if (state & NK_WIDGET_STATE_ACTIVED) {
+
78  background = &style->active;
+
79  text.text = style->label_active;
+
80  } else if (state & NK_WIDGET_STATE_HOVER) {
+
81  background = &style->hover;
+
82  text.text = style->label_hover;
+
83  } else {
+
84  background = &style->normal;
+
85  text.text = style->label_normal;
+
86  }
+
87 
+
88  text.text = nk_rgb_factor(text.text, style->color_factor);
+
89 
+
90  /* draw background */
+
91  switch(background->type) {
+
92  case NK_STYLE_ITEM_IMAGE:
+
93  text.background = nk_rgba(0, 0, 0, 0);
+
94  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
95  break;
+
96  case NK_STYLE_ITEM_NINE_SLICE:
+
97  text.background = nk_rgba(0, 0, 0, 0);
+
98  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
99  break;
+
100  case NK_STYLE_ITEM_COLOR:
+
101  text.background = background->data.color;
+
102  nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor));
+
103  nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(background->data.color, style->color_factor));
+
104  break;
+
105  }
+
106 
+
107  /* draw label */
+
108  text.padding = nk_vec2(0,0);
+
109  if (name && name[0] != '#') {
+
110  nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
+
111  }
+
112 }
+
113 NK_LIB void
+
114 nk_do_property(nk_flags *ws,
+
115  struct nk_command_buffer *out, struct nk_rect property,
+
116  const char *name, struct nk_property_variant *variant,
+
117  float inc_per_pixel, char *buffer, int *len,
+
118  int *state, int *cursor, int *select_begin, int *select_end,
+
119  const struct nk_style_property *style,
+
120  enum nk_property_filter filter, struct nk_input *in,
+
121  const struct nk_user_font *font, struct nk_text_edit *text_edit,
+
122  enum nk_button_behavior behavior)
+
123 {
+
124  const nk_plugin_filter filters[] = {
+
125  nk_filter_decimal,
+
126  nk_filter_float
+
127  };
+
128  nk_bool active, old;
+
129  int num_len = 0, name_len = 0;
+
130  char string[NK_MAX_NUMBER_BUFFER];
+
131  float size;
+
132 
+
133  char *dst = 0;
+
134  int *length;
+
135 
+
136  struct nk_rect left;
+
137  struct nk_rect right;
+
138  struct nk_rect label;
+
139  struct nk_rect edit;
+
140  struct nk_rect empty;
+
141 
+
142  /* left decrement button */
+
143  left.h = font->height/2;
+
144  left.w = left.h;
+
145  left.x = property.x + style->border + style->padding.x;
+
146  left.y = property.y + style->border + property.h/2.0f - left.h/2;
+
147 
+
148  /* text label */
+
149  if (name && name[0] != '#') {
+
150  name_len = nk_strlen(name);
+
151  }
+
152  size = font->width(font->userdata, font->height, name, name_len);
+
153  label.x = left.x + left.w + style->padding.x;
+
154  label.w = (float)size + 2 * style->padding.x;
+
155  label.y = property.y + style->border + style->padding.y;
+
156  label.h = property.h - (2 * style->border + 2 * style->padding.y);
+
157 
+
158  /* right increment button */
+
159  right.y = left.y;
+
160  right.w = left.w;
+
161  right.h = left.h;
+
162  right.x = property.x + property.w - (right.w + style->padding.x);
+
163 
+
164  /* edit */
+
165  if (*state == NK_PROPERTY_EDIT) {
+
166  size = font->width(font->userdata, font->height, buffer, *len);
+
167  size += style->edit.cursor_size;
+
168  length = len;
+
169  dst = buffer;
+
170  } else {
+
171  switch (variant->kind) {
+
172  default: break;
+
173  case NK_PROPERTY_INT:
+
174  nk_itoa(string, variant->value.i);
+
175  num_len = nk_strlen(string);
+
176  break;
+
177  case NK_PROPERTY_FLOAT:
+
178  NK_DTOA(string, (double)variant->value.f);
+
179  num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
+
180  break;
+
181  case NK_PROPERTY_DOUBLE:
+
182  NK_DTOA(string, variant->value.d);
+
183  num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
+
184  break;
+
185  }
+
186  size = font->width(font->userdata, font->height, string, num_len);
+
187  dst = string;
+
188  length = &num_len;
+
189  }
+
190 
+
191  edit.w = (float)size + 2 * style->padding.x;
+
192  edit.w = NK_MIN(edit.w, right.x - (label.x + label.w));
+
193  edit.x = right.x - (edit.w + style->padding.x);
+
194  edit.y = property.y + style->border;
+
195  edit.h = property.h - (2 * style->border);
+
196 
+
197  /* empty left space activator */
+
198  empty.w = edit.x - (label.x + label.w);
+
199  empty.x = label.x + label.w;
+
200  empty.y = property.y;
+
201  empty.h = property.h;
+
202 
+
203  /* update property */
+
204  old = (*state == NK_PROPERTY_EDIT);
+
205  nk_property_behavior(ws, in, property, label, edit, empty, state, variant, inc_per_pixel);
+
206 
+
207  /* draw property */
+
208  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
209  nk_draw_property(out, style, &property, &label, *ws, name, name_len, font);
+
210  if (style->draw_end) style->draw_end(out, style->userdata);
+
211 
+
212  /* execute right button */
+
213  if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) {
+
214  switch (variant->kind) {
+
215  default: break;
+
216  case NK_PROPERTY_INT:
+
217  variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i - variant->step.i, variant->max_value.i); break;
+
218  case NK_PROPERTY_FLOAT:
+
219  variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f - variant->step.f, variant->max_value.f); break;
+
220  case NK_PROPERTY_DOUBLE:
+
221  variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d - variant->step.d, variant->max_value.d); break;
+
222  }
+
223  }
+
224  /* execute left button */
+
225  if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) {
+
226  switch (variant->kind) {
+
227  default: break;
+
228  case NK_PROPERTY_INT:
+
229  variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i + variant->step.i, variant->max_value.i); break;
+
230  case NK_PROPERTY_FLOAT:
+
231  variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f + variant->step.f, variant->max_value.f); break;
+
232  case NK_PROPERTY_DOUBLE:
+
233  variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d + variant->step.d, variant->max_value.d); break;
+
234  }
+
235  }
+
236  if (old != NK_PROPERTY_EDIT && (*state == NK_PROPERTY_EDIT)) {
+
237  /* property has been activated so setup buffer */
+
238  NK_MEMCPY(buffer, dst, (nk_size)*length);
+
239  *cursor = nk_utf_len(buffer, *length);
+
240  *len = *length;
+
241  length = len;
+
242  dst = buffer;
+
243  active = 0;
+
244  } else active = (*state == NK_PROPERTY_EDIT);
+
245 
+
246  /* execute and run text edit field */
+
247  nk_textedit_clear_state(text_edit, NK_TEXT_EDIT_SINGLE_LINE, filters[filter]);
+
248  text_edit->active = (unsigned char)active;
+
249  text_edit->string.len = *length;
+
250  text_edit->cursor = NK_CLAMP(0, *cursor, *length);
+
251  text_edit->select_start = NK_CLAMP(0,*select_begin, *length);
+
252  text_edit->select_end = NK_CLAMP(0,*select_end, *length);
+
253  text_edit->string.buffer.allocated = (nk_size)*length;
+
254  text_edit->string.buffer.memory.size = NK_MAX_NUMBER_BUFFER;
+
255  text_edit->string.buffer.memory.ptr = dst;
+
256  text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER;
+
257  text_edit->mode = NK_TEXT_EDIT_MODE_INSERT;
+
258  nk_do_edit(ws, out, edit, (int)NK_EDIT_FIELD|(int)NK_EDIT_AUTO_SELECT,
+
259  filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font);
+
260 
+
261  *length = text_edit->string.len;
+
262  *cursor = text_edit->cursor;
+
263  *select_begin = text_edit->select_start;
+
264  *select_end = text_edit->select_end;
+
265  if (text_edit->active && nk_input_is_key_pressed(in, NK_KEY_ENTER))
+
266  text_edit->active = nk_false;
+
267 
+
268  if (active && !text_edit->active) {
+
269  /* property is now not active so convert edit text to value*/
+
270  *state = NK_PROPERTY_DEFAULT;
+
271  buffer[*len] = '\0';
+
272  switch (variant->kind) {
+
273  default: break;
+
274  case NK_PROPERTY_INT:
+
275  variant->value.i = nk_strtoi(buffer, 0);
+
276  variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
+
277  break;
+
278  case NK_PROPERTY_FLOAT:
+
279  nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
+
280  variant->value.f = nk_strtof(buffer, 0);
+
281  variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
+
282  break;
+
283  case NK_PROPERTY_DOUBLE:
+
284  nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
+
285  variant->value.d = nk_strtod(buffer, 0);
+
286  variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
+
287  break;
+
288  }
+
289  }
+
290 }
+
291 NK_LIB struct nk_property_variant
+
292 nk_property_variant_int(int value, int min_value, int max_value, int step)
+
293 {
+
294  struct nk_property_variant result;
+
295  result.kind = NK_PROPERTY_INT;
+
296  result.value.i = value;
+
297  result.min_value.i = min_value;
+
298  result.max_value.i = max_value;
+
299  result.step.i = step;
+
300  return result;
+
301 }
+
302 NK_LIB struct nk_property_variant
+
303 nk_property_variant_float(float value, float min_value, float max_value, float step)
+
304 {
+
305  struct nk_property_variant result;
+
306  result.kind = NK_PROPERTY_FLOAT;
+
307  result.value.f = value;
+
308  result.min_value.f = min_value;
+
309  result.max_value.f = max_value;
+
310  result.step.f = step;
+
311  return result;
+
312 }
+
313 NK_LIB struct nk_property_variant
+
314 nk_property_variant_double(double value, double min_value, double max_value,
+
315  double step)
+
316 {
+
317  struct nk_property_variant result;
+
318  result.kind = NK_PROPERTY_DOUBLE;
+
319  result.value.d = value;
+
320  result.min_value.d = min_value;
+
321  result.max_value.d = max_value;
+
322  result.step.d = step;
+
323  return result;
+
324 }
+
325 NK_LIB void
+
326 nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant,
+
327  float inc_per_pixel, const enum nk_property_filter filter)
+
328 {
+
329  struct nk_window *win;
+
330  struct nk_panel *layout;
+
331  struct nk_input *in;
+
332  const struct nk_style *style;
+
333 
+
334  struct nk_rect bounds;
+ +
336 
+
337  int *state = 0;
+
338  nk_hash hash = 0;
+
339  char *buffer = 0;
+
340  int *len = 0;
+
341  int *cursor = 0;
+
342  int *select_begin = 0;
+
343  int *select_end = 0;
+
344  int old_state;
+
345 
+
346  char dummy_buffer[NK_MAX_NUMBER_BUFFER];
+
347  int dummy_state = NK_PROPERTY_DEFAULT;
+
348  int dummy_length = 0;
+
349  int dummy_cursor = 0;
+
350  int dummy_select_begin = 0;
+
351  int dummy_select_end = 0;
+
352 
+
353  NK_ASSERT(ctx);
+
354  NK_ASSERT(ctx->current);
+
355  NK_ASSERT(ctx->current->layout);
+
356  if (!ctx || !ctx->current || !ctx->current->layout)
+
357  return;
+
358 
+
359  win = ctx->current;
+
360  layout = win->layout;
+
361  style = &ctx->style;
+
362  s = nk_widget(&bounds, ctx);
+
363  if (!s) return;
+
364 
+
365  /* calculate hash from name */
+
366  if (name[0] == '#') {
+
367  hash = nk_murmur_hash(name, (int)nk_strlen(name), win->property.seq++);
+
368  name++; /* special number hash */
+
369  } else hash = nk_murmur_hash(name, (int)nk_strlen(name), 42);
+
370 
+
371  /* check if property is currently hot item */
+
372  if (win->property.active && hash == win->property.name) {
+
373  buffer = win->property.buffer;
+
374  len = &win->property.length;
+
375  cursor = &win->property.cursor;
+
376  state = &win->property.state;
+
377  select_begin = &win->property.select_start;
+
378  select_end = &win->property.select_end;
+
379  } else {
+
380  buffer = dummy_buffer;
+
381  len = &dummy_length;
+
382  cursor = &dummy_cursor;
+
383  state = &dummy_state;
+
384  select_begin = &dummy_select_begin;
+
385  select_end = &dummy_select_end;
+
386  }
+
387 
+
388  /* execute property widget */
+
389  old_state = *state;
+
390  ctx->text_edit.clip = ctx->clip;
+
391  in = ((s == NK_WIDGET_ROM && !win->property.active) ||
+
392  layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED) ? 0 : &ctx->input;
+
393  nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name,
+
394  variant, inc_per_pixel, buffer, len, state, cursor, select_begin,
+
395  select_end, &style->property, filter, in, style->font, &ctx->text_edit,
+
396  ctx->button_behavior);
+
397 
+
398  if (in && *state != NK_PROPERTY_DEFAULT && !win->property.active) {
+
399  /* current property is now hot */
+
400  win->property.active = 1;
+
401  NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);
+
402  win->property.length = *len;
+
403  win->property.cursor = *cursor;
+
404  win->property.state = *state;
+
405  win->property.name = hash;
+
406  win->property.select_start = *select_begin;
+
407  win->property.select_end = *select_end;
+
408  if (*state == NK_PROPERTY_DRAG) {
+
409  ctx->input.mouse.grab = nk_true;
+
410  ctx->input.mouse.grabbed = nk_true;
+
411  }
+
412  }
+
413  /* check if previously active property is now inactive */
+
414  if (*state == NK_PROPERTY_DEFAULT && old_state != NK_PROPERTY_DEFAULT) {
+
415  if (old_state == NK_PROPERTY_DRAG) {
+
416  ctx->input.mouse.grab = nk_false;
+
417  ctx->input.mouse.grabbed = nk_false;
+
418  ctx->input.mouse.ungrab = nk_true;
+
419  }
+
420  win->property.select_start = 0;
+
421  win->property.select_end = 0;
+
422  win->property.active = 0;
+
423  }
+
424 }
+
425 NK_API void
+
426 nk_property_int(struct nk_context *ctx, const char *name,
+
427  int min, int *val, int max, int step, float inc_per_pixel)
+
428 {
+
429  struct nk_property_variant variant;
+
430  NK_ASSERT(ctx);
+
431  NK_ASSERT(name);
+
432  NK_ASSERT(val);
+
433 
+
434  if (!ctx || !ctx->current || !name || !val) return;
+
435  variant = nk_property_variant_int(*val, min, max, step);
+
436  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
+
437  *val = variant.value.i;
+
438 }
+
439 NK_API void
+
440 nk_property_float(struct nk_context *ctx, const char *name,
+
441  float min, float *val, float max, float step, float inc_per_pixel)
+
442 {
+
443  struct nk_property_variant variant;
+
444  NK_ASSERT(ctx);
+
445  NK_ASSERT(name);
+
446  NK_ASSERT(val);
+
447 
+
448  if (!ctx || !ctx->current || !name || !val) return;
+
449  variant = nk_property_variant_float(*val, min, max, step);
+
450  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+
451  *val = variant.value.f;
+
452 }
+
453 NK_API void
+
454 nk_property_double(struct nk_context *ctx, const char *name,
+
455  double min, double *val, double max, double step, float inc_per_pixel)
+
456 {
+
457  struct nk_property_variant variant;
+
458  NK_ASSERT(ctx);
+
459  NK_ASSERT(name);
+
460  NK_ASSERT(val);
+
461 
+
462  if (!ctx || !ctx->current || !name || !val) return;
+
463  variant = nk_property_variant_double(*val, min, max, step);
+
464  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+
465  *val = variant.value.d;
+
466 }
+
467 NK_API int
+
468 nk_propertyi(struct nk_context *ctx, const char *name, int min, int val,
+
469  int max, int step, float inc_per_pixel)
+
470 {
+
471  struct nk_property_variant variant;
+
472  NK_ASSERT(ctx);
+
473  NK_ASSERT(name);
+
474 
+
475  if (!ctx || !ctx->current || !name) return val;
+
476  variant = nk_property_variant_int(val, min, max, step);
+
477  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
+
478  val = variant.value.i;
+
479  return val;
+
480 }
+
481 NK_API float
+
482 nk_propertyf(struct nk_context *ctx, const char *name, float min,
+
483  float val, float max, float step, float inc_per_pixel)
+
484 {
+
485  struct nk_property_variant variant;
+
486  NK_ASSERT(ctx);
+
487  NK_ASSERT(name);
+
488 
+
489  if (!ctx || !ctx->current || !name) return val;
+
490  variant = nk_property_variant_float(val, min, max, step);
+
491  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+
492  val = variant.value.f;
+
493  return val;
+
494 }
+
495 NK_API double
+
496 nk_propertyd(struct nk_context *ctx, const char *name, double min,
+
497  double val, double max, double step, float inc_per_pixel)
+
498 {
+
499  struct nk_property_variant variant;
+
500  NK_ASSERT(ctx);
+
501  NK_ASSERT(name);
+
502 
+
503  if (!ctx || !ctx->current || !name) return val;
+
504  variant = nk_property_variant_double(val, min, max, step);
+
505  nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+
506  val = variant.value.d;
+
507  return val;
+
508 }
+
509 
+
main API and documentation file
+
NK_API float nk_propertyf(struct nk_context *, const char *name, float min, float val, float max, float step, float inc_per_pixel)
+
NK_API void nk_property_float(struct nk_context *, const char *name, float min, float *val, float max, float step, float inc_per_pixel)
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_property_double(struct nk_context *, const char *name, double min, double *val, double max, double step, float inc_per_pixel)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+
NK_API double nk_propertyd(struct nk_context *, const char *name, double min, double val, double max, double step, float inc_per_pixel)
+
NK_API int nk_propertyi(struct nk_context *, const char *name, int min, int val, int max, int step, float inc_per_pixel)
+
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
nk_size size
!< number of allocation calls
Definition: nuklear.h:4198
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+ + +
struct nk_text_edit text_edit
text editor objects are quite big because of an internal undo/redo stack.
Definition: nuklear.h:5728
+ + + + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + + +
+
+ + + + diff --git a/nuklear__scrollbar_8c_source.html b/nuklear__scrollbar_8c_source.html new file mode 100644 index 000000000..e1b9cb31b --- /dev/null +++ b/nuklear__scrollbar_8c_source.html @@ -0,0 +1,435 @@ + + + + + + + +Nuklear: src/nuklear_scrollbar.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_scrollbar.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * SCROLLBAR
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB float
+
10 nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
+
11  int has_scrolling, const struct nk_rect *scroll,
+
12  const struct nk_rect *cursor, const struct nk_rect *empty0,
+
13  const struct nk_rect *empty1, float scroll_offset,
+
14  float target, float scroll_step, enum nk_orientation o)
+
15 {
+
16  nk_flags ws = 0;
+
17  int left_mouse_down;
+
18  unsigned int left_mouse_clicked;
+
19  int left_mouse_click_in_cursor;
+
20  float scroll_delta;
+
21 
+
22  nk_widget_state_reset(state);
+
23  if (!in) return scroll_offset;
+
24 
+
25  left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+
26  left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
+
27  left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
+
28  NK_BUTTON_LEFT, *cursor, nk_true);
+
29  if (nk_input_is_mouse_hovering_rect(in, *scroll))
+
30  *state = NK_WIDGET_STATE_HOVERED;
+
31 
+
32  scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x;
+
33  if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
+
34  /* update cursor by mouse dragging */
+
35  float pixel, delta;
+
36  *state = NK_WIDGET_STATE_ACTIVE;
+
37  if (o == NK_VERTICAL) {
+
38  float cursor_y;
+
39  pixel = in->mouse.delta.y;
+
40  delta = (pixel / scroll->h) * target;
+
41  scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->h);
+
42  cursor_y = scroll->y + ((scroll_offset/target) * scroll->h);
+
43  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f;
+
44  } else {
+
45  float cursor_x;
+
46  pixel = in->mouse.delta.x;
+
47  delta = (pixel / scroll->w) * target;
+
48  scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->w);
+
49  cursor_x = scroll->x + ((scroll_offset/target) * scroll->w);
+
50  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f;
+
51  }
+
52  } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_UP) && o == NK_VERTICAL && has_scrolling)||
+
53  nk_button_behavior(&ws, *empty0, in, NK_BUTTON_DEFAULT)) {
+
54  /* scroll page up by click on empty space or shortcut */
+
55  if (o == NK_VERTICAL)
+
56  scroll_offset = NK_MAX(0, scroll_offset - scroll->h);
+
57  else scroll_offset = NK_MAX(0, scroll_offset - scroll->w);
+
58  } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_DOWN) && o == NK_VERTICAL && has_scrolling) ||
+
59  nk_button_behavior(&ws, *empty1, in, NK_BUTTON_DEFAULT)) {
+
60  /* scroll page down by click on empty space or shortcut */
+
61  if (o == NK_VERTICAL)
+
62  scroll_offset = NK_MIN(scroll_offset + scroll->h, target - scroll->h);
+
63  else scroll_offset = NK_MIN(scroll_offset + scroll->w, target - scroll->w);
+
64  } else if (has_scrolling) {
+
65  if ((scroll_delta < 0 || (scroll_delta > 0))) {
+
66  /* update cursor by mouse scrolling */
+
67  scroll_offset = scroll_offset + scroll_step * (-scroll_delta);
+
68  if (o == NK_VERTICAL)
+
69  scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->h);
+
70  else scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->w);
+
71  } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_START)) {
+
72  /* update cursor to the beginning */
+
73  if (o == NK_VERTICAL) scroll_offset = 0;
+
74  } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_END)) {
+
75  /* update cursor to the end */
+
76  if (o == NK_VERTICAL) scroll_offset = target - scroll->h;
+
77  }
+
78  }
+
79  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *scroll))
+
80  *state |= NK_WIDGET_STATE_ENTERED;
+
81  else if (nk_input_is_mouse_prev_hovering_rect(in, *scroll))
+
82  *state |= NK_WIDGET_STATE_LEFT;
+
83  return scroll_offset;
+
84 }
+
85 NK_LIB void
+
86 nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state,
+
87  const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
+
88  const struct nk_rect *scroll)
+
89 {
+
90  const struct nk_style_item *background;
+
91  const struct nk_style_item *cursor;
+
92 
+
93  /* select correct colors/images to draw */
+
94  if (state & NK_WIDGET_STATE_ACTIVED) {
+
95  background = &style->active;
+
96  cursor = &style->cursor_active;
+
97  } else if (state & NK_WIDGET_STATE_HOVER) {
+
98  background = &style->hover;
+
99  cursor = &style->cursor_hover;
+
100  } else {
+
101  background = &style->normal;
+
102  cursor = &style->cursor_normal;
+
103  }
+
104 
+
105  /* draw background */
+
106  switch (background->type) {
+
107  case NK_STYLE_ITEM_IMAGE:
+
108  nk_draw_image(out, *bounds, &background->data.image, nk_white);
+
109  break;
+
110  case NK_STYLE_ITEM_NINE_SLICE:
+
111  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white);
+
112  break;
+
113  case NK_STYLE_ITEM_COLOR:
+
114  nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+
115  nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
+
116  break;
+
117  }
+
118 
+
119  /* draw cursor */
+
120  switch (cursor->type) {
+
121  case NK_STYLE_ITEM_IMAGE:
+
122  nk_draw_image(out, *scroll, &cursor->data.image, nk_white);
+
123  break;
+
124  case NK_STYLE_ITEM_NINE_SLICE:
+
125  nk_draw_nine_slice(out, *scroll, &cursor->data.slice, nk_white);
+
126  break;
+
127  case NK_STYLE_ITEM_COLOR:
+
128  nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
+
129  nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
+
130  break;
+
131  }
+
132 }
+
133 NK_LIB float
+
134 nk_do_scrollbarv(nk_flags *state,
+
135  struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
+
136  float offset, float target, float step, float button_pixel_inc,
+
137  const struct nk_style_scrollbar *style, struct nk_input *in,
+
138  const struct nk_user_font *font)
+
139 {
+
140  struct nk_rect empty_north;
+
141  struct nk_rect empty_south;
+
142  struct nk_rect cursor;
+
143 
+
144  float scroll_step;
+
145  float scroll_offset;
+
146  float scroll_off;
+
147  float scroll_ratio;
+
148 
+
149  NK_ASSERT(out);
+
150  NK_ASSERT(style);
+
151  NK_ASSERT(state);
+
152  if (!out || !style) return 0;
+
153 
+
154  scroll.w = NK_MAX(scroll.w, 1);
+
155  scroll.h = NK_MAX(scroll.h, 0);
+
156  if (target <= scroll.h) return 0;
+
157 
+
158  /* optional scrollbar buttons */
+
159  if (style->show_buttons) {
+
160  nk_flags ws;
+
161  float scroll_h;
+
162  struct nk_rect button;
+
163 
+
164  button.x = scroll.x;
+
165  button.w = scroll.w;
+
166  button.h = scroll.w;
+
167 
+
168  scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
+
169  scroll_step = NK_MIN(step, button_pixel_inc);
+
170 
+
171  /* decrement button */
+
172  button.y = scroll.y;
+
173  if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
+
174  NK_BUTTON_REPEATER, &style->dec_button, in, font))
+
175  offset = offset - scroll_step;
+
176 
+
177  /* increment button */
+
178  button.y = scroll.y + scroll.h - button.h;
+
179  if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
+
180  NK_BUTTON_REPEATER, &style->inc_button, in, font))
+
181  offset = offset + scroll_step;
+
182 
+
183  scroll.y = scroll.y + button.h;
+
184  scroll.h = scroll_h;
+
185  }
+
186 
+
187  /* calculate scrollbar constants */
+
188  scroll_step = NK_MIN(step, scroll.h);
+
189  scroll_offset = NK_CLAMP(0, offset, target - scroll.h);
+
190  scroll_ratio = scroll.h / target;
+
191  scroll_off = scroll_offset / target;
+
192 
+
193  /* calculate scrollbar cursor bounds */
+
194  cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
+
195  cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
+
196  cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
+
197  cursor.x = scroll.x + style->border + style->padding.x;
+
198 
+
199  /* calculate empty space around cursor */
+
200  empty_north.x = scroll.x;
+
201  empty_north.y = scroll.y;
+
202  empty_north.w = scroll.w;
+
203  empty_north.h = NK_MAX(cursor.y - scroll.y, 0);
+
204 
+
205  empty_south.x = scroll.x;
+
206  empty_south.y = cursor.y + cursor.h;
+
207  empty_south.w = scroll.w;
+
208  empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0);
+
209 
+
210  /* update scrollbar */
+
211  scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
+
212  &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
+
213  scroll_off = scroll_offset / target;
+
214  cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;
+
215 
+
216  /* draw scrollbar */
+
217  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
218  nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
+
219  if (style->draw_end) style->draw_end(out, style->userdata);
+
220  return scroll_offset;
+
221 }
+
222 NK_LIB float
+
223 nk_do_scrollbarh(nk_flags *state,
+
224  struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
+
225  float offset, float target, float step, float button_pixel_inc,
+
226  const struct nk_style_scrollbar *style, struct nk_input *in,
+
227  const struct nk_user_font *font)
+
228 {
+
229  struct nk_rect cursor;
+
230  struct nk_rect empty_west;
+
231  struct nk_rect empty_east;
+
232 
+
233  float scroll_step;
+
234  float scroll_offset;
+
235  float scroll_off;
+
236  float scroll_ratio;
+
237 
+
238  NK_ASSERT(out);
+
239  NK_ASSERT(style);
+
240  if (!out || !style) return 0;
+
241 
+
242  /* scrollbar background */
+
243  scroll.h = NK_MAX(scroll.h, 1);
+
244  scroll.w = NK_MAX(scroll.w, 2 * scroll.h);
+
245  if (target <= scroll.w) return 0;
+
246 
+
247  /* optional scrollbar buttons */
+
248  if (style->show_buttons) {
+
249  nk_flags ws;
+
250  float scroll_w;
+
251  struct nk_rect button;
+
252  button.y = scroll.y;
+
253  button.w = scroll.h;
+
254  button.h = scroll.h;
+
255 
+
256  scroll_w = scroll.w - 2 * button.w;
+
257  scroll_step = NK_MIN(step, button_pixel_inc);
+
258 
+
259  /* decrement button */
+
260  button.x = scroll.x;
+
261  if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
+
262  NK_BUTTON_REPEATER, &style->dec_button, in, font))
+
263  offset = offset - scroll_step;
+
264 
+
265  /* increment button */
+
266  button.x = scroll.x + scroll.w - button.w;
+
267  if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
+
268  NK_BUTTON_REPEATER, &style->inc_button, in, font))
+
269  offset = offset + scroll_step;
+
270 
+
271  scroll.x = scroll.x + button.w;
+
272  scroll.w = scroll_w;
+
273  }
+
274 
+
275  /* calculate scrollbar constants */
+
276  scroll_step = NK_MIN(step, scroll.w);
+
277  scroll_offset = NK_CLAMP(0, offset, target - scroll.w);
+
278  scroll_ratio = scroll.w / target;
+
279  scroll_off = scroll_offset / target;
+
280 
+
281  /* calculate cursor bounds */
+
282  cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
+
283  cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
+
284  cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
+
285  cursor.y = scroll.y + style->border + style->padding.y;
+
286 
+
287  /* calculate empty space around cursor */
+
288  empty_west.x = scroll.x;
+
289  empty_west.y = scroll.y;
+
290  empty_west.w = cursor.x - scroll.x;
+
291  empty_west.h = scroll.h;
+
292 
+
293  empty_east.x = cursor.x + cursor.w;
+
294  empty_east.y = scroll.y;
+
295  empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w);
+
296  empty_east.h = scroll.h;
+
297 
+
298  /* update scrollbar */
+
299  scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
+
300  &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL);
+
301  scroll_off = scroll_offset / target;
+
302  cursor.x = scroll.x + (scroll_off * scroll.w);
+
303 
+
304  /* draw scrollbar */
+
305  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
306  nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
+
307  if (style->draw_end) style->draw_end(out, style->userdata);
+
308  return scroll_offset;
+
309 }
+
310 
+
main API and documentation file
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+ + + + + + +
+
+ + + + diff --git a/nuklear__selectable_8c_source.html b/nuklear__selectable_8c_source.html new file mode 100644 index 000000000..32d0e0672 --- /dev/null +++ b/nuklear__selectable_8c_source.html @@ -0,0 +1,463 @@ + + + + + + + +Nuklear: src/nuklear_selectable.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_selectable.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * SELECTABLE
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_draw_selectable(struct nk_command_buffer *out,
+
11  nk_flags state, const struct nk_style_selectable *style, nk_bool active,
+
12  const struct nk_rect *bounds,
+
13  const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym,
+
14  const char *string, int len, nk_flags align, const struct nk_user_font *font)
+
15 {
+
16  const struct nk_style_item *background;
+
17  struct nk_text text;
+
18  text.padding = style->padding;
+
19 
+
20  /* select correct colors/images */
+
21  if (!active) {
+
22  if (state & NK_WIDGET_STATE_ACTIVED) {
+
23  background = &style->pressed;
+
24  text.text = style->text_pressed;
+
25  } else if (state & NK_WIDGET_STATE_HOVER) {
+
26  background = &style->hover;
+
27  text.text = style->text_hover;
+
28  } else {
+
29  background = &style->normal;
+
30  text.text = style->text_normal;
+
31  }
+
32  } else {
+
33  if (state & NK_WIDGET_STATE_ACTIVED) {
+
34  background = &style->pressed_active;
+
35  text.text = style->text_pressed_active;
+
36  } else if (state & NK_WIDGET_STATE_HOVER) {
+
37  background = &style->hover_active;
+
38  text.text = style->text_hover_active;
+
39  } else {
+
40  background = &style->normal_active;
+
41  text.text = style->text_normal_active;
+
42  }
+
43  }
+
44 
+
45  text.text = nk_rgb_factor(text.text, style->color_factor);
+
46 
+
47  /* draw selectable background and text */
+
48  switch (background->type) {
+
49  case NK_STYLE_ITEM_IMAGE:
+
50  text.background = nk_rgba(0, 0, 0, 0);
+
51  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
52  break;
+
53  case NK_STYLE_ITEM_NINE_SLICE:
+
54  text.background = nk_rgba(0, 0, 0, 0);
+
55  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
56  break;
+
57  case NK_STYLE_ITEM_COLOR:
+
58  text.background = background->data.color;
+
59  nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+
60  break;
+
61  }
+
62  if (icon) {
+
63  if (img) nk_draw_image(out, *icon, img, nk_rgb_factor(nk_white, style->color_factor));
+
64  else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font);
+
65  }
+
66  nk_widget_text(out, *bounds, string, len, &text, align, font);
+
67 }
+
68 NK_LIB nk_bool
+
69 nk_do_selectable(nk_flags *state, struct nk_command_buffer *out,
+
70  struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value,
+
71  const struct nk_style_selectable *style, const struct nk_input *in,
+
72  const struct nk_user_font *font)
+
73 {
+
74  int old_value;
+
75  struct nk_rect touch;
+
76 
+
77  NK_ASSERT(state);
+
78  NK_ASSERT(out);
+
79  NK_ASSERT(str);
+
80  NK_ASSERT(len);
+
81  NK_ASSERT(value);
+
82  NK_ASSERT(style);
+
83  NK_ASSERT(font);
+
84 
+
85  if (!state || !out || !str || !len || !value || !style || !font) return 0;
+
86  old_value = *value;
+
87 
+
88  /* remove padding */
+
89  touch.x = bounds.x - style->touch_padding.x;
+
90  touch.y = bounds.y - style->touch_padding.y;
+
91  touch.w = bounds.w + style->touch_padding.x * 2;
+
92  touch.h = bounds.h + style->touch_padding.y * 2;
+
93 
+
94  /* update button */
+
95  if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+
96  *value = !(*value);
+
97 
+
98  /* draw selectable */
+
99  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
100  nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
+
101  if (style->draw_end) style->draw_end(out, style->userdata);
+
102  return old_value != *value;
+
103 }
+
104 NK_LIB nk_bool
+
105 nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out,
+
106  struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value,
+
107  const struct nk_image *img, const struct nk_style_selectable *style,
+
108  const struct nk_input *in, const struct nk_user_font *font)
+
109 {
+
110  nk_bool old_value;
+
111  struct nk_rect touch;
+
112  struct nk_rect icon;
+
113 
+
114  NK_ASSERT(state);
+
115  NK_ASSERT(out);
+
116  NK_ASSERT(str);
+
117  NK_ASSERT(len);
+
118  NK_ASSERT(value);
+
119  NK_ASSERT(style);
+
120  NK_ASSERT(font);
+
121 
+
122  if (!state || !out || !str || !len || !value || !style || !font) return 0;
+
123  old_value = *value;
+
124 
+
125  /* toggle behavior */
+
126  touch.x = bounds.x - style->touch_padding.x;
+
127  touch.y = bounds.y - style->touch_padding.y;
+
128  touch.w = bounds.w + style->touch_padding.x * 2;
+
129  touch.h = bounds.h + style->touch_padding.y * 2;
+
130  if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+
131  *value = !(*value);
+
132 
+
133  icon.y = bounds.y + style->padding.y;
+
134  icon.w = icon.h = bounds.h - 2 * style->padding.y;
+
135  if (align & NK_TEXT_ALIGN_LEFT) {
+
136  icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+
137  icon.x = NK_MAX(icon.x, 0);
+
138  } else icon.x = bounds.x + 2 * style->padding.x;
+
139 
+
140  icon.x += style->image_padding.x;
+
141  icon.y += style->image_padding.y;
+
142  icon.w -= 2 * style->image_padding.x;
+
143  icon.h -= 2 * style->image_padding.y;
+
144 
+
145  /* draw selectable */
+
146  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
147  nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font);
+
148  if (style->draw_end) style->draw_end(out, style->userdata);
+
149  return old_value != *value;
+
150 }
+
151 NK_LIB nk_bool
+
152 nk_do_selectable_symbol(nk_flags *state, struct nk_command_buffer *out,
+
153  struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value,
+
154  enum nk_symbol_type sym, const struct nk_style_selectable *style,
+
155  const struct nk_input *in, const struct nk_user_font *font)
+
156 {
+
157  int old_value;
+
158  struct nk_rect touch;
+
159  struct nk_rect icon;
+
160 
+
161  NK_ASSERT(state);
+
162  NK_ASSERT(out);
+
163  NK_ASSERT(str);
+
164  NK_ASSERT(len);
+
165  NK_ASSERT(value);
+
166  NK_ASSERT(style);
+
167  NK_ASSERT(font);
+
168 
+
169  if (!state || !out || !str || !len || !value || !style || !font) return 0;
+
170  old_value = *value;
+
171 
+
172  /* toggle behavior */
+
173  touch.x = bounds.x - style->touch_padding.x;
+
174  touch.y = bounds.y - style->touch_padding.y;
+
175  touch.w = bounds.w + style->touch_padding.x * 2;
+
176  touch.h = bounds.h + style->touch_padding.y * 2;
+
177  if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+
178  *value = !(*value);
+
179 
+
180  icon.y = bounds.y + style->padding.y;
+
181  icon.w = icon.h = bounds.h - 2 * style->padding.y;
+
182  if (align & NK_TEXT_ALIGN_LEFT) {
+
183  icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+
184  icon.x = NK_MAX(icon.x, 0);
+
185  } else icon.x = bounds.x + 2 * style->padding.x;
+
186 
+
187  icon.x += style->image_padding.x;
+
188  icon.y += style->image_padding.y;
+
189  icon.w -= 2 * style->image_padding.x;
+
190  icon.h -= 2 * style->image_padding.y;
+
191 
+
192  /* draw selectable */
+
193  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
194  nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font);
+
195  if (style->draw_end) style->draw_end(out, style->userdata);
+
196  return old_value != *value;
+
197 }
+
198 
+
199 NK_API nk_bool
+
200 nk_selectable_text(struct nk_context *ctx, const char *str, int len,
+
201  nk_flags align, nk_bool *value)
+
202 {
+
203  struct nk_window *win;
+
204  struct nk_panel *layout;
+
205  const struct nk_input *in;
+
206  const struct nk_style *style;
+
207 
+
208  enum nk_widget_layout_states state;
+
209  struct nk_rect bounds;
+
210 
+
211  NK_ASSERT(ctx);
+
212  NK_ASSERT(value);
+
213  NK_ASSERT(ctx->current);
+
214  NK_ASSERT(ctx->current->layout);
+
215  if (!ctx || !ctx->current || !ctx->current->layout || !value)
+
216  return 0;
+
217 
+
218  win = ctx->current;
+
219  layout = win->layout;
+
220  style = &ctx->style;
+
221 
+
222  state = nk_widget(&bounds, ctx);
+
223  if (!state) return 0;
+
224  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
225  return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds,
+
226  str, len, align, value, &style->selectable, in, style->font);
+
227 }
+
228 NK_API nk_bool
+
229 nk_selectable_image_text(struct nk_context *ctx, struct nk_image img,
+
230  const char *str, int len, nk_flags align, nk_bool *value)
+
231 {
+
232  struct nk_window *win;
+
233  struct nk_panel *layout;
+
234  const struct nk_input *in;
+
235  const struct nk_style *style;
+
236 
+
237  enum nk_widget_layout_states state;
+
238  struct nk_rect bounds;
+
239 
+
240  NK_ASSERT(ctx);
+
241  NK_ASSERT(value);
+
242  NK_ASSERT(ctx->current);
+
243  NK_ASSERT(ctx->current->layout);
+
244  if (!ctx || !ctx->current || !ctx->current->layout || !value)
+
245  return 0;
+
246 
+
247  win = ctx->current;
+
248  layout = win->layout;
+
249  style = &ctx->style;
+
250 
+
251  state = nk_widget(&bounds, ctx);
+
252  if (!state) return 0;
+
253  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
254  return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds,
+
255  str, len, align, value, &img, &style->selectable, in, style->font);
+
256 }
+
257 NK_API nk_bool
+
258 nk_selectable_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+
259  const char *str, int len, nk_flags align, nk_bool *value)
+
260 {
+
261  struct nk_window *win;
+
262  struct nk_panel *layout;
+
263  const struct nk_input *in;
+
264  const struct nk_style *style;
+
265 
+
266  enum nk_widget_layout_states state;
+
267  struct nk_rect bounds;
+
268 
+
269  NK_ASSERT(ctx);
+
270  NK_ASSERT(value);
+
271  NK_ASSERT(ctx->current);
+
272  NK_ASSERT(ctx->current->layout);
+
273  if (!ctx || !ctx->current || !ctx->current->layout || !value)
+
274  return 0;
+
275 
+
276  win = ctx->current;
+
277  layout = win->layout;
+
278  style = &ctx->style;
+
279 
+
280  state = nk_widget(&bounds, ctx);
+
281  if (!state) return 0;
+
282  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
283  return nk_do_selectable_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+
284  str, len, align, value, sym, &style->selectable, in, style->font);
+
285 }
+
286 NK_API nk_bool
+
287 nk_selectable_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+
288  const char *title, nk_flags align, nk_bool *value)
+
289 {
+
290  return nk_selectable_symbol_text(ctx, sym, title, nk_strlen(title), align, value);
+
291 }
+
292 NK_API nk_bool nk_select_text(struct nk_context *ctx, const char *str, int len,
+
293  nk_flags align, nk_bool value)
+
294 {
+
295  nk_selectable_text(ctx, str, len, align, &value);return value;
+
296 }
+
297 NK_API nk_bool nk_selectable_label(struct nk_context *ctx, const char *str, nk_flags align, nk_bool *value)
+
298 {
+
299  return nk_selectable_text(ctx, str, nk_strlen(str), align, value);
+
300 }
+
301 NK_API nk_bool nk_selectable_image_label(struct nk_context *ctx,struct nk_image img,
+
302  const char *str, nk_flags align, nk_bool *value)
+
303 {
+
304  return nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, value);
+
305 }
+
306 NK_API nk_bool nk_select_label(struct nk_context *ctx, const char *str, nk_flags align, nk_bool value)
+
307 {
+
308  nk_selectable_text(ctx, str, nk_strlen(str), align, &value);return value;
+
309 }
+
310 NK_API nk_bool nk_select_image_label(struct nk_context *ctx, struct nk_image img,
+
311  const char *str, nk_flags align, nk_bool value)
+
312 {
+
313  nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, &value);return value;
+
314 }
+
315 NK_API nk_bool nk_select_image_text(struct nk_context *ctx, struct nk_image img,
+
316  const char *str, int len, nk_flags align, nk_bool value)
+
317 {
+
318  nk_selectable_image_text(ctx, img, str, len, align, &value);return value;
+
319 }
+
320 NK_API nk_bool
+
321 nk_select_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+
322  const char *title, int title_len, nk_flags align, nk_bool value)
+
323 {
+
324  nk_selectable_symbol_text(ctx, sym, title, title_len, align, &value);return value;
+
325 }
+
326 NK_API nk_bool
+
327 nk_select_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+
328  const char *title, nk_flags align, nk_bool value)
+
329 {
+
330  return nk_select_symbol_text(ctx, sym, title, nk_strlen(title), align, value);
+
331 }
+
332 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__slider_8c_source.html b/nuklear__slider_8c_source.html new file mode 100644 index 000000000..5ccd909f4 --- /dev/null +++ b/nuklear__slider_8c_source.html @@ -0,0 +1,395 @@ + + + + + + + +Nuklear: src/nuklear_slider.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_slider.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * SLIDER
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB float
+
10 nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor,
+
11  struct nk_rect *visual_cursor, struct nk_input *in,
+
12  struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
+
13  float slider_step, float slider_steps)
+
14 {
+
15  int left_mouse_down;
+
16  int left_mouse_click_in_cursor;
+
17 
+
18  /* check if visual cursor is being dragged */
+
19  nk_widget_state_reset(state);
+
20  left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+
21  left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
+
22  NK_BUTTON_LEFT, *visual_cursor, nk_true);
+
23 
+
24  if (left_mouse_down && left_mouse_click_in_cursor) {
+
25  float ratio = 0;
+
26  const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
+
27  const float pxstep = bounds.w / slider_steps;
+
28 
+
29  /* only update value if the next slider step is reached */
+
30  *state = NK_WIDGET_STATE_ACTIVE;
+
31  if (NK_ABS(d) >= pxstep) {
+
32  const float steps = (float)((int)(NK_ABS(d) / pxstep));
+
33  slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps);
+
34  slider_value = NK_CLAMP(slider_min, slider_value, slider_max);
+
35  ratio = (slider_value - slider_min)/slider_step;
+
36  logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
+
37  in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
+
38  }
+
39  }
+
40 
+
41  /* slider widget state */
+
42  if (nk_input_is_mouse_hovering_rect(in, bounds))
+
43  *state = NK_WIDGET_STATE_HOVERED;
+
44  if (*state & NK_WIDGET_STATE_HOVER &&
+
45  !nk_input_is_mouse_prev_hovering_rect(in, bounds))
+
46  *state |= NK_WIDGET_STATE_ENTERED;
+
47  else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
+
48  *state |= NK_WIDGET_STATE_LEFT;
+
49  return slider_value;
+
50 }
+
51 NK_LIB void
+
52 nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
+
53  const struct nk_style_slider *style, const struct nk_rect *bounds,
+
54  const struct nk_rect *visual_cursor, float min, float value, float max)
+
55 {
+
56  struct nk_rect fill;
+
57  struct nk_rect bar;
+
58  const struct nk_style_item *background;
+
59 
+
60  /* select correct slider images/colors */
+
61  struct nk_color bar_color;
+
62  const struct nk_style_item *cursor;
+
63 
+
64  NK_UNUSED(min);
+
65  NK_UNUSED(max);
+
66  NK_UNUSED(value);
+
67 
+
68  if (state & NK_WIDGET_STATE_ACTIVED) {
+
69  background = &style->active;
+
70  bar_color = style->bar_active;
+
71  cursor = &style->cursor_active;
+
72  } else if (state & NK_WIDGET_STATE_HOVER) {
+
73  background = &style->hover;
+
74  bar_color = style->bar_hover;
+
75  cursor = &style->cursor_hover;
+
76  } else {
+
77  background = &style->normal;
+
78  bar_color = style->bar_normal;
+
79  cursor = &style->cursor_normal;
+
80  }
+
81 
+
82  /* calculate slider background bar */
+
83  bar.x = bounds->x;
+
84  bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12;
+
85  bar.w = bounds->w;
+
86  bar.h = bounds->h/6;
+
87 
+
88  /* filled background bar style */
+
89  fill.w = (visual_cursor->x + (visual_cursor->w/2.0f)) - bar.x;
+
90  fill.x = bar.x;
+
91  fill.y = bar.y;
+
92  fill.h = bar.h;
+
93 
+
94  /* draw background */
+
95  switch(background->type) {
+
96  case NK_STYLE_ITEM_IMAGE:
+
97  nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
98  break;
+
99  case NK_STYLE_ITEM_NINE_SLICE:
+
100  nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
+
101  break;
+
102  case NK_STYLE_ITEM_COLOR:
+
103  nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor));
+
104  nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor));
+
105  break;
+
106  }
+
107 
+
108  /* draw slider bar */
+
109  nk_fill_rect(out, bar, style->rounding, nk_rgb_factor(bar_color, style->color_factor));
+
110  nk_fill_rect(out, fill, style->rounding, nk_rgb_factor(style->bar_filled, style->color_factor));
+
111 
+
112  /* draw cursor */
+
113  if (cursor->type == NK_STYLE_ITEM_IMAGE)
+
114  nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
115  else
+
116  nk_fill_circle(out, *visual_cursor, nk_rgb_factor(cursor->data.color, style->color_factor));
+
117 }
+
118 NK_LIB float
+
119 nk_do_slider(nk_flags *state,
+
120  struct nk_command_buffer *out, struct nk_rect bounds,
+
121  float min, float val, float max, float step,
+
122  const struct nk_style_slider *style, struct nk_input *in,
+
123  const struct nk_user_font *font)
+
124 {
+
125  float slider_range;
+
126  float slider_min;
+
127  float slider_max;
+
128  float slider_value;
+
129  float slider_steps;
+
130  float cursor_offset;
+
131 
+
132  struct nk_rect visual_cursor;
+
133  struct nk_rect logical_cursor;
+
134 
+
135  NK_ASSERT(style);
+
136  NK_ASSERT(out);
+
137  if (!out || !style)
+
138  return 0;
+
139 
+
140  /* remove padding from slider bounds */
+
141  bounds.x = bounds.x + style->padding.x;
+
142  bounds.y = bounds.y + style->padding.y;
+
143  bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
+
144  bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x);
+
145  bounds.w -= 2 * style->padding.x;
+
146  bounds.h -= 2 * style->padding.y;
+
147 
+
148  /* optional buttons */
+
149  if (style->show_buttons) {
+
150  nk_flags ws;
+
151  struct nk_rect button;
+
152  button.y = bounds.y;
+
153  button.w = bounds.h;
+
154  button.h = bounds.h;
+
155 
+
156  /* decrement button */
+
157  button.x = bounds.x;
+
158  if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
+
159  &style->dec_button, in, font))
+
160  val -= step;
+
161 
+
162  /* increment button */
+
163  button.x = (bounds.x + bounds.w) - button.w;
+
164  if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
+
165  &style->inc_button, in, font))
+
166  val += step;
+
167 
+
168  bounds.x = bounds.x + button.w + style->spacing.x;
+
169  bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
+
170  }
+
171 
+
172  /* remove one cursor size to support visual cursor */
+
173  bounds.x += style->cursor_size.x*0.5f;
+
174  bounds.w -= style->cursor_size.x;
+
175 
+
176  /* make sure the provided values are correct */
+
177  slider_max = NK_MAX(min, max);
+
178  slider_min = NK_MIN(min, max);
+
179  slider_value = NK_CLAMP(slider_min, val, slider_max);
+
180  slider_range = slider_max - slider_min;
+
181  slider_steps = slider_range / step;
+
182  cursor_offset = (slider_value - slider_min) / step;
+
183 
+
184  /* calculate cursor
+
185  Basically you have two cursors. One for visual representation and interaction
+
186  and one for updating the actual cursor value. */
+
187  logical_cursor.h = bounds.h;
+
188  logical_cursor.w = bounds.w / slider_steps;
+
189  logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset);
+
190  logical_cursor.y = bounds.y;
+
191 
+
192  visual_cursor.h = style->cursor_size.y;
+
193  visual_cursor.w = style->cursor_size.x;
+
194  visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f;
+
195  visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
+
196 
+
197  slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor,
+
198  in, bounds, slider_min, slider_max, slider_value, step, slider_steps);
+
199  visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
+
200 
+
201  /* draw slider */
+
202  if (style->draw_begin) style->draw_begin(out, style->userdata);
+
203  nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
+
204  if (style->draw_end) style->draw_end(out, style->userdata);
+
205  return slider_value;
+
206 }
+
207 NK_API nk_bool
+
208 nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max_value,
+
209  float value_step)
+
210 {
+
211  struct nk_window *win;
+
212  struct nk_panel *layout;
+
213  struct nk_input *in;
+
214  const struct nk_style *style;
+
215 
+
216  int ret = 0;
+
217  float old_value;
+
218  struct nk_rect bounds;
+
219  enum nk_widget_layout_states state;
+
220 
+
221  NK_ASSERT(ctx);
+
222  NK_ASSERT(ctx->current);
+
223  NK_ASSERT(ctx->current->layout);
+
224  NK_ASSERT(value);
+
225  if (!ctx || !ctx->current || !ctx->current->layout || !value)
+
226  return ret;
+
227 
+
228  win = ctx->current;
+
229  style = &ctx->style;
+
230  layout = win->layout;
+
231 
+
232  state = nk_widget(&bounds, ctx);
+
233  if (!state) return ret;
+
234  in = (/*state == NK_WIDGET_ROM || */ state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
235 
+
236  old_value = *value;
+
237  *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value,
+
238  old_value, max_value, value_step, &style->slider, in, style->font);
+
239  return (old_value > *value || old_value < *value);
+
240 }
+
241 NK_API float
+
242 nk_slide_float(struct nk_context *ctx, float min, float val, float max, float step)
+
243 {
+
244  nk_slider_float(ctx, min, &val, max, step); return val;
+
245 }
+
246 NK_API int
+
247 nk_slide_int(struct nk_context *ctx, int min, int val, int max, int step)
+
248 {
+
249  float value = (float)val;
+
250  nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
+
251  return (int)value;
+
252 }
+
253 NK_API nk_bool
+
254 nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step)
+
255 {
+
256  int ret;
+
257  float value = (float)*val;
+
258  ret = nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
+
259  *val = (int)value;
+
260  return ret;
+
261 }
+
262 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
@ NK_WIDGET_STATE_HOVERED
!< widget is from this frame on not hovered anymore
Definition: nuklear.h:3094
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+ + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__string_8c_source.html b/nuklear__string_8c_source.html new file mode 100644 index 000000000..9861b679a --- /dev/null +++ b/nuklear__string_8c_source.html @@ -0,0 +1,565 @@ + + + + + + + +Nuklear: src/nuklear_string.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_string.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * STRING
+
7  *
+
8  * ===============================================================*/
+
9 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
10 NK_API void
+
11 nk_str_init_default(struct nk_str *str)
+
12 {
+
13  struct nk_allocator alloc;
+
14  alloc.userdata.ptr = 0;
+
15  alloc.alloc = nk_malloc;
+
16  alloc.free = nk_mfree;
+
17  nk_buffer_init(&str->buffer, &alloc, 32);
+
18  str->len = 0;
+
19 }
+
20 #endif
+
21 
+
22 NK_API void
+
23 nk_str_init(struct nk_str *str, const struct nk_allocator *alloc, nk_size size)
+
24 {
+
25  nk_buffer_init(&str->buffer, alloc, size);
+
26  str->len = 0;
+
27 }
+
28 NK_API void
+
29 nk_str_init_fixed(struct nk_str *str, void *memory, nk_size size)
+
30 {
+
31  nk_buffer_init_fixed(&str->buffer, memory, size);
+
32  str->len = 0;
+
33 }
+
34 NK_API int
+
35 nk_str_append_text_char(struct nk_str *s, const char *str, int len)
+
36 {
+
37  char *mem;
+
38  NK_ASSERT(s);
+
39  NK_ASSERT(str);
+
40  if (!s || !str || !len) return 0;
+
41  mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
+
42  if (!mem) return 0;
+
43  NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
+
44  s->len += nk_utf_len(str, len);
+
45  return len;
+
46 }
+
47 NK_API int
+
48 nk_str_append_str_char(struct nk_str *s, const char *str)
+
49 {
+
50  return nk_str_append_text_char(s, str, nk_strlen(str));
+
51 }
+
52 NK_API int
+
53 nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
+
54 {
+
55  int i = 0;
+
56  int byte_len = 0;
+
57  nk_rune unicode;
+
58  if (!str || !text || !len) return 0;
+
59  for (i = 0; i < len; ++i)
+
60  byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
+
61  nk_str_append_text_char(str, text, byte_len);
+
62  return len;
+
63 }
+
64 NK_API int
+
65 nk_str_append_str_utf8(struct nk_str *str, const char *text)
+
66 {
+
67  int byte_len = 0;
+
68  int num_runes = 0;
+
69  int glyph_len = 0;
+
70  nk_rune unicode;
+
71  if (!str || !text) return 0;
+
72 
+
73  glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
+
74  while (unicode != '\0' && glyph_len) {
+
75  glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
+
76  byte_len += glyph_len;
+
77  num_runes++;
+
78  }
+
79  nk_str_append_text_char(str, text, byte_len);
+
80  return num_runes;
+
81 }
+
82 NK_API int
+
83 nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
+
84 {
+
85  int i = 0;
+
86  int byte_len = 0;
+
87  nk_glyph glyph;
+
88 
+
89  NK_ASSERT(str);
+
90  if (!str || !text || !len) return 0;
+
91  for (i = 0; i < len; ++i) {
+
92  byte_len = nk_utf_encode(text[i], glyph, NK_UTF_SIZE);
+
93  if (!byte_len) break;
+
94  nk_str_append_text_char(str, glyph, byte_len);
+
95  }
+
96  return len;
+
97 }
+
98 NK_API int
+
99 nk_str_append_str_runes(struct nk_str *str, const nk_rune *runes)
+
100 {
+
101  int i = 0;
+
102  nk_glyph glyph;
+
103  int byte_len;
+
104  NK_ASSERT(str);
+
105  if (!str || !runes) return 0;
+
106  while (runes[i] != '\0') {
+
107  byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
+
108  nk_str_append_text_char(str, glyph, byte_len);
+
109  i++;
+
110  }
+
111  return i;
+
112 }
+
113 NK_API int
+
114 nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len)
+
115 {
+
116  int i;
+
117  void *mem;
+
118  char *src;
+
119  char *dst;
+
120 
+
121  int copylen;
+
122  NK_ASSERT(s);
+
123  NK_ASSERT(str);
+
124  NK_ASSERT(len >= 0);
+
125  if (!s || !str || !len || (nk_size)pos > s->buffer.allocated) return 0;
+
126  if ((s->buffer.allocated + (nk_size)len >= s->buffer.memory.size) &&
+
127  (s->buffer.type == NK_BUFFER_FIXED)) return 0;
+
128 
+
129  copylen = (int)s->buffer.allocated - pos;
+
130  if (!copylen) {
+
131  nk_str_append_text_char(s, str, len);
+
132  return 1;
+
133  }
+
134  mem = nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
+
135  if (!mem) return 0;
+
136 
+
137  /* memmove */
+
138  NK_ASSERT(((int)pos + (int)len + ((int)copylen - 1)) >= 0);
+
139  NK_ASSERT(((int)pos + ((int)copylen - 1)) >= 0);
+
140  dst = nk_ptr_add(char, s->buffer.memory.ptr, pos + len + (copylen - 1));
+
141  src = nk_ptr_add(char, s->buffer.memory.ptr, pos + (copylen-1));
+
142  for (i = 0; i < copylen; ++i) *dst-- = *src--;
+
143  mem = nk_ptr_add(void, s->buffer.memory.ptr, pos);
+
144  NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
+
145  s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
+
146  return 1;
+
147 }
+
148 NK_API int
+
149 nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
+
150 {
+
151  int glyph_len;
+
152  nk_rune unicode;
+
153  const char *begin;
+
154  const char *buffer;
+
155 
+
156  NK_ASSERT(str);
+
157  NK_ASSERT(cstr);
+
158  NK_ASSERT(len);
+
159  if (!str || !cstr || !len) return 0;
+
160  begin = nk_str_at_rune(str, pos, &unicode, &glyph_len);
+
161  if (!str->len)
+
162  return nk_str_append_text_char(str, cstr, len);
+
163  buffer = nk_str_get_const(str);
+
164  if (!begin) return 0;
+
165  return nk_str_insert_at_char(str, (int)(begin - buffer), cstr, len);
+
166 }
+
167 NK_API int
+
168 nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
+
169 {
+
170  return nk_str_insert_text_utf8(str, pos, text, len);
+
171 }
+
172 NK_API int
+
173 nk_str_insert_str_char(struct nk_str *str, int pos, const char *text)
+
174 {
+
175  return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text));
+
176 }
+
177 NK_API int
+
178 nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
+
179 {
+
180  int i = 0;
+
181  int byte_len = 0;
+
182  nk_rune unicode;
+
183 
+
184  NK_ASSERT(str);
+
185  NK_ASSERT(text);
+
186  if (!str || !text || !len) return 0;
+
187  for (i = 0; i < len; ++i)
+
188  byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
+
189  nk_str_insert_at_rune(str, pos, text, byte_len);
+
190  return len;
+
191 }
+
192 NK_API int
+
193 nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text)
+
194 {
+
195  int byte_len = 0;
+
196  int num_runes = 0;
+
197  int glyph_len = 0;
+
198  nk_rune unicode;
+
199  if (!str || !text) return 0;
+
200 
+
201  glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
+
202  while (unicode != '\0' && glyph_len) {
+
203  glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
+
204  byte_len += glyph_len;
+
205  num_runes++;
+
206  }
+
207  nk_str_insert_at_rune(str, pos, text, byte_len);
+
208  return num_runes;
+
209 }
+
210 NK_API int
+
211 nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int len)
+
212 {
+
213  int i = 0;
+
214  int byte_len = 0;
+
215  nk_glyph glyph;
+
216 
+
217  NK_ASSERT(str);
+
218  if (!str || !runes || !len) return 0;
+
219  for (i = 0; i < len; ++i) {
+
220  byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
+
221  if (!byte_len) break;
+
222  nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
+
223  }
+
224  return len;
+
225 }
+
226 NK_API int
+
227 nk_str_insert_str_runes(struct nk_str *str, int pos, const nk_rune *runes)
+
228 {
+
229  int i = 0;
+
230  nk_glyph glyph;
+
231  int byte_len;
+
232  NK_ASSERT(str);
+
233  if (!str || !runes) return 0;
+
234  while (runes[i] != '\0') {
+
235  byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
+
236  nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
+
237  i++;
+
238  }
+
239  return i;
+
240 }
+
241 NK_API void
+
242 nk_str_remove_chars(struct nk_str *s, int len)
+
243 {
+
244  NK_ASSERT(s);
+
245  NK_ASSERT(len >= 0);
+
246  if (!s || len < 0 || (nk_size)len > s->buffer.allocated) return;
+
247  NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
+
248  s->buffer.allocated -= (nk_size)len;
+
249  s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
+
250 }
+
251 NK_API void
+
252 nk_str_remove_runes(struct nk_str *str, int len)
+
253 {
+
254  int index;
+
255  const char *begin;
+
256  const char *end;
+
257  nk_rune unicode;
+
258 
+
259  NK_ASSERT(str);
+
260  NK_ASSERT(len >= 0);
+
261  if (!str || len < 0) return;
+
262  if (len >= str->len) {
+
263  str->len = 0;
+
264  return;
+
265  }
+
266 
+
267  index = str->len - len;
+
268  begin = nk_str_at_rune(str, index, &unicode, &len);
+
269  end = (const char*)str->buffer.memory.ptr + str->buffer.allocated;
+
270  nk_str_remove_chars(str, (int)(end-begin)+1);
+
271 }
+
272 NK_API void
+
273 nk_str_delete_chars(struct nk_str *s, int pos, int len)
+
274 {
+
275  NK_ASSERT(s);
+
276  if (!s || !len || (nk_size)pos > s->buffer.allocated ||
+
277  (nk_size)(pos + len) > s->buffer.allocated) return;
+
278 
+
279  if ((nk_size)(pos + len) < s->buffer.allocated) {
+
280  /* memmove */
+
281  char *dst = nk_ptr_add(char, s->buffer.memory.ptr, pos);
+
282  char *src = nk_ptr_add(char, s->buffer.memory.ptr, pos + len);
+
283  NK_MEMCPY(dst, src, s->buffer.allocated - (nk_size)(pos + len));
+
284  NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
+
285  s->buffer.allocated -= (nk_size)len;
+
286  } else nk_str_remove_chars(s, len);
+
287  s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
+
288 }
+
289 NK_API void
+
290 nk_str_delete_runes(struct nk_str *s, int pos, int len)
+
291 {
+
292  char *temp;
+
293  nk_rune unicode;
+
294  char *begin;
+
295  char *end;
+
296  int unused;
+
297 
+
298  NK_ASSERT(s);
+
299  NK_ASSERT(s->len >= pos + len);
+
300  if (s->len < pos + len)
+
301  len = NK_CLAMP(0, (s->len - pos), s->len);
+
302  if (!len) return;
+
303 
+
304  temp = (char *)s->buffer.memory.ptr;
+
305  begin = nk_str_at_rune(s, pos, &unicode, &unused);
+
306  if (!begin) return;
+
307  s->buffer.memory.ptr = begin;
+
308  end = nk_str_at_rune(s, len, &unicode, &unused);
+
309  s->buffer.memory.ptr = temp;
+
310  if (!end) return;
+
311  nk_str_delete_chars(s, (int)(begin - temp), (int)(end - begin));
+
312 }
+
313 NK_API char*
+
314 nk_str_at_char(struct nk_str *s, int pos)
+
315 {
+
316  NK_ASSERT(s);
+
317  if (!s || pos > (int)s->buffer.allocated) return 0;
+
318  return nk_ptr_add(char, s->buffer.memory.ptr, pos);
+
319 }
+
320 NK_API char*
+
321 nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len)
+
322 {
+
323  int i = 0;
+
324  int src_len = 0;
+
325  int glyph_len = 0;
+
326  char *text;
+
327  int text_len;
+
328 
+
329  NK_ASSERT(str);
+
330  NK_ASSERT(unicode);
+
331  NK_ASSERT(len);
+
332 
+
333  if (!str || !unicode || !len) return 0;
+
334  if (pos < 0) {
+
335  *unicode = 0;
+
336  *len = 0;
+
337  return 0;
+
338  }
+
339 
+
340  text = (char*)str->buffer.memory.ptr;
+
341  text_len = (int)str->buffer.allocated;
+
342  glyph_len = nk_utf_decode(text, unicode, text_len);
+
343  while (glyph_len) {
+
344  if (i == pos) {
+
345  *len = glyph_len;
+
346  break;
+
347  }
+
348 
+
349  i++;
+
350  src_len = src_len + glyph_len;
+
351  glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
+
352  }
+
353  if (i != pos) return 0;
+
354  return text + src_len;
+
355 }
+
356 NK_API const char*
+
357 nk_str_at_char_const(const struct nk_str *s, int pos)
+
358 {
+
359  NK_ASSERT(s);
+
360  if (!s || pos > (int)s->buffer.allocated) return 0;
+
361  return nk_ptr_add(char, s->buffer.memory.ptr, pos);
+
362 }
+
363 NK_API const char*
+
364 nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len)
+
365 {
+
366  int i = 0;
+
367  int src_len = 0;
+
368  int glyph_len = 0;
+
369  char *text;
+
370  int text_len;
+
371 
+
372  NK_ASSERT(str);
+
373  NK_ASSERT(unicode);
+
374  NK_ASSERT(len);
+
375 
+
376  if (!str || !unicode || !len) return 0;
+
377  if (pos < 0) {
+
378  *unicode = 0;
+
379  *len = 0;
+
380  return 0;
+
381  }
+
382 
+
383  text = (char*)str->buffer.memory.ptr;
+
384  text_len = (int)str->buffer.allocated;
+
385  glyph_len = nk_utf_decode(text, unicode, text_len);
+
386  while (glyph_len) {
+
387  if (i == pos) {
+
388  *len = glyph_len;
+
389  break;
+
390  }
+
391 
+
392  i++;
+
393  src_len = src_len + glyph_len;
+
394  glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
+
395  }
+
396  if (i != pos) return 0;
+
397  return text + src_len;
+
398 }
+
399 NK_API nk_rune
+
400 nk_str_rune_at(const struct nk_str *str, int pos)
+
401 {
+
402  int len;
+
403  nk_rune unicode = 0;
+
404  nk_str_at_const(str, pos, &unicode, &len);
+
405  return unicode;
+
406 }
+
407 NK_API char*
+
408 nk_str_get(struct nk_str *s)
+
409 {
+
410  NK_ASSERT(s);
+
411  if (!s || !s->len || !s->buffer.allocated) return 0;
+
412  return (char*)s->buffer.memory.ptr;
+
413 }
+
414 NK_API const char*
+
415 nk_str_get_const(const struct nk_str *s)
+
416 {
+
417  NK_ASSERT(s);
+
418  if (!s || !s->len || !s->buffer.allocated) return 0;
+
419  return (const char*)s->buffer.memory.ptr;
+
420 }
+
421 NK_API int
+
422 nk_str_len(const struct nk_str *s)
+
423 {
+
424  NK_ASSERT(s);
+
425  if (!s || !s->len || !s->buffer.allocated) return 0;
+
426  return s->len;
+
427 }
+
428 NK_API int
+
429 nk_str_len_char(const struct nk_str *s)
+
430 {
+
431  NK_ASSERT(s);
+
432  if (!s || !s->len || !s->buffer.allocated) return 0;
+
433  return (int)s->buffer.allocated;
+
434 }
+
435 NK_API void
+
436 nk_str_clear(struct nk_str *str)
+
437 {
+
438  NK_ASSERT(str);
+
439  nk_buffer_clear(&str->buffer);
+
440  str->len = 0;
+
441 }
+
442 NK_API void
+
443 nk_str_free(struct nk_str *str)
+
444 {
+
445  NK_ASSERT(str);
+
446  nk_buffer_free(&str->buffer);
+
447  str->len = 0;
+
448 }
+
main API and documentation file
+
#define NK_UTF_SIZE
describes the number of bytes a glyph consists of
Definition: nuklear.h:22
+ +
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
enum nk_allocation_type type
!< allocator callback for dynamic buffers
Definition: nuklear.h:4192
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+
==============================================================
Definition: nuklear.h:4226
+
+
+ + + + diff --git a/nuklear__style_8c_source.html b/nuklear__style_8c_source.html new file mode 100644 index 000000000..869368951 --- /dev/null +++ b/nuklear__style_8c_source.html @@ -0,0 +1,998 @@ + + + + + + + +Nuklear: src/nuklear_style.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_style.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * STYLE
+
7  *
+
8  * ===============================================================*/
+
9 NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0);}
+
10 #define NK_COLOR_MAP(NK_COLOR)\
+
11  NK_COLOR(NK_COLOR_TEXT, 175,175,175,255) \
+
12  NK_COLOR(NK_COLOR_WINDOW, 45, 45, 45, 255) \
+
13  NK_COLOR(NK_COLOR_HEADER, 40, 40, 40, 255) \
+
14  NK_COLOR(NK_COLOR_BORDER, 65, 65, 65, 255) \
+
15  NK_COLOR(NK_COLOR_BUTTON, 50, 50, 50, 255) \
+
16  NK_COLOR(NK_COLOR_BUTTON_HOVER, 40, 40, 40, 255) \
+
17  NK_COLOR(NK_COLOR_BUTTON_ACTIVE, 35, 35, 35, 255) \
+
18  NK_COLOR(NK_COLOR_TOGGLE, 100,100,100,255) \
+
19  NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \
+
20  NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \
+
21  NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \
+
22  NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \
+
23  NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \
+
24  NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \
+
25  NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \
+
26  NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \
+
27  NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \
+
28  NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \
+
29  NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \
+
30  NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \
+
31  NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \
+
32  NK_COLOR(NK_COLOR_CHART_COLOR, 45, 45, 45, 255) \
+
33  NK_COLOR(NK_COLOR_CHART_COLOR_HIGHLIGHT, 255, 0, 0, 255) \
+
34  NK_COLOR(NK_COLOR_SCROLLBAR, 40, 40, 40, 255) \
+
35  NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \
+
36  NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER, 120,120,120,255) \
+
37  NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, 150,150,150,255) \
+
38  NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255) \
+
39  NK_COLOR(NK_COLOR_KNOB, 38, 38, 38, 255) \
+
40  NK_COLOR(NK_COLOR_KNOB_CURSOR, 100,100,100,255) \
+
41  NK_COLOR(NK_COLOR_KNOB_CURSOR_HOVER, 120,120,120,255) \
+
42  NK_COLOR(NK_COLOR_KNOB_CURSOR_ACTIVE, 150,150,150,255)
+
43 
+
44 NK_GLOBAL const struct nk_color
+
45 nk_default_color_style[NK_COLOR_COUNT] = {
+
46 #define NK_COLOR(a,b,c,d,e) {b,c,d,e},
+
47  NK_COLOR_MAP(NK_COLOR)
+
48 #undef NK_COLOR
+
49 };
+
50 NK_GLOBAL const char *nk_color_names[NK_COLOR_COUNT] = {
+
51 #define NK_COLOR(a,b,c,d,e) #a,
+
52  NK_COLOR_MAP(NK_COLOR)
+
53 #undef NK_COLOR
+
54 };
+
55 
+
56 NK_API const char*
+
57 nk_style_get_color_by_name(enum nk_style_colors c)
+
58 {
+
59  return nk_color_names[c];
+
60 }
+
61 NK_API struct nk_style_item
+
62 nk_style_item_color(struct nk_color col)
+
63 {
+
64  struct nk_style_item i;
+
65  i.type = NK_STYLE_ITEM_COLOR;
+
66  i.data.color = col;
+
67  return i;
+
68 }
+
69 NK_API struct nk_style_item
+
70 nk_style_item_image(struct nk_image img)
+
71 {
+
72  struct nk_style_item i;
+
73  i.type = NK_STYLE_ITEM_IMAGE;
+
74  i.data.image = img;
+
75  return i;
+
76 }
+
77 NK_API struct nk_style_item
+
78 nk_style_item_nine_slice(struct nk_nine_slice slice)
+
79 {
+
80  struct nk_style_item i;
+
81  i.type = NK_STYLE_ITEM_NINE_SLICE;
+
82  i.data.slice = slice;
+
83  return i;
+
84 }
+
85 NK_API struct nk_style_item
+
86 nk_style_item_hide(void)
+
87 {
+
88  struct nk_style_item i;
+
89  i.type = NK_STYLE_ITEM_COLOR;
+
90  i.data.color = nk_rgba(0,0,0,0);
+
91  return i;
+
92 }
+
93 NK_API void
+
94 nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
+
95 {
+
96  struct nk_style *style;
+
97  struct nk_style_text *text;
+
98  struct nk_style_button *button;
+
99  struct nk_style_toggle *toggle;
+
100  struct nk_style_selectable *select;
+
101  struct nk_style_slider *slider;
+
102  struct nk_style_knob *knob;
+
103  struct nk_style_progress *prog;
+
104  struct nk_style_scrollbar *scroll;
+
105  struct nk_style_edit *edit;
+
106  struct nk_style_property *property;
+
107  struct nk_style_combo *combo;
+
108  struct nk_style_chart *chart;
+
109  struct nk_style_tab *tab;
+
110  struct nk_style_window *win;
+
111 
+
112  NK_ASSERT(ctx);
+
113  if (!ctx) return;
+
114  style = &ctx->style;
+
115  table = (!table) ? nk_default_color_style: table;
+
116 
+
117  /* default text */
+
118  text = &style->text;
+
119  text->color = table[NK_COLOR_TEXT];
+
120  text->padding = nk_vec2(0,0);
+
121  text->color_factor = 1.0f;
+
122  text->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
123 
+
124  /* default button */
+
125  button = &style->button;
+
126  nk_zero_struct(*button);
+
127  button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]);
+
128  button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
+
129  button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
+
130  button->border_color = table[NK_COLOR_BORDER];
+
131  button->text_background = table[NK_COLOR_BUTTON];
+
132  button->text_normal = table[NK_COLOR_TEXT];
+
133  button->text_hover = table[NK_COLOR_TEXT];
+
134  button->text_active = table[NK_COLOR_TEXT];
+
135  button->padding = nk_vec2(2.0f,2.0f);
+
136  button->image_padding = nk_vec2(0.0f,0.0f);
+
137  button->touch_padding = nk_vec2(0.0f, 0.0f);
+
138  button->userdata = nk_handle_ptr(0);
+
139  button->text_alignment = NK_TEXT_CENTERED;
+
140  button->border = 1.0f;
+
141  button->rounding = 4.0f;
+
142  button->color_factor_text = 1.0f;
+
143  button->color_factor_background = 1.0f;
+
144  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
145  button->draw_begin = 0;
+
146  button->draw_end = 0;
+
147 
+
148  /* contextual button */
+
149  button = &style->contextual_button;
+
150  nk_zero_struct(*button);
+
151  button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
152  button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
+
153  button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
+
154  button->border_color = table[NK_COLOR_WINDOW];
+
155  button->text_background = table[NK_COLOR_WINDOW];
+
156  button->text_normal = table[NK_COLOR_TEXT];
+
157  button->text_hover = table[NK_COLOR_TEXT];
+
158  button->text_active = table[NK_COLOR_TEXT];
+
159  button->padding = nk_vec2(2.0f,2.0f);
+
160  button->touch_padding = nk_vec2(0.0f,0.0f);
+
161  button->userdata = nk_handle_ptr(0);
+
162  button->text_alignment = NK_TEXT_CENTERED;
+
163  button->border = 0.0f;
+
164  button->rounding = 0.0f;
+
165  button->color_factor_text = 1.0f;
+
166  button->color_factor_background = 1.0f;
+
167  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
168  button->draw_begin = 0;
+
169  button->draw_end = 0;
+
170 
+
171  /* menu button */
+
172  button = &style->menu_button;
+
173  nk_zero_struct(*button);
+
174  button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
175  button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
176  button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
177  button->border_color = table[NK_COLOR_WINDOW];
+
178  button->text_background = table[NK_COLOR_WINDOW];
+
179  button->text_normal = table[NK_COLOR_TEXT];
+
180  button->text_hover = table[NK_COLOR_TEXT];
+
181  button->text_active = table[NK_COLOR_TEXT];
+
182  button->padding = nk_vec2(2.0f,2.0f);
+
183  button->touch_padding = nk_vec2(0.0f,0.0f);
+
184  button->userdata = nk_handle_ptr(0);
+
185  button->text_alignment = NK_TEXT_CENTERED;
+
186  button->border = 0.0f;
+
187  button->rounding = 1.0f;
+
188  button->color_factor_text = 1.0f;
+
189  button->color_factor_background = 1.0f;
+
190  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
191  button->draw_begin = 0;
+
192  button->draw_end = 0;
+
193 
+
194  /* checkbox toggle */
+
195  toggle = &style->checkbox;
+
196  nk_zero_struct(*toggle);
+
197  toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
+
198  toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+
199  toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+
200  toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+
201  toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+
202  toggle->userdata = nk_handle_ptr(0);
+
203  toggle->text_background = table[NK_COLOR_WINDOW];
+
204  toggle->text_normal = table[NK_COLOR_TEXT];
+
205  toggle->text_hover = table[NK_COLOR_TEXT];
+
206  toggle->text_active = table[NK_COLOR_TEXT];
+
207  toggle->padding = nk_vec2(2.0f, 2.0f);
+
208  toggle->touch_padding = nk_vec2(0,0);
+
209  toggle->border_color = nk_rgba(0,0,0,0);
+
210  toggle->border = 0.0f;
+
211  toggle->spacing = 4;
+
212  toggle->color_factor = 1.0f;
+
213  toggle->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
214 
+
215  /* option toggle */
+
216  toggle = &style->option;
+
217  nk_zero_struct(*toggle);
+
218  toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
+
219  toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+
220  toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+
221  toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+
222  toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+
223  toggle->userdata = nk_handle_ptr(0);
+
224  toggle->text_background = table[NK_COLOR_WINDOW];
+
225  toggle->text_normal = table[NK_COLOR_TEXT];
+
226  toggle->text_hover = table[NK_COLOR_TEXT];
+
227  toggle->text_active = table[NK_COLOR_TEXT];
+
228  toggle->padding = nk_vec2(3.0f, 3.0f);
+
229  toggle->touch_padding = nk_vec2(0,0);
+
230  toggle->border_color = nk_rgba(0,0,0,0);
+
231  toggle->border = 0.0f;
+
232  toggle->spacing = 4;
+
233  toggle->color_factor = 1.0f;
+
234  toggle->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
235 
+
236  /* selectable */
+
237  select = &style->selectable;
+
238  nk_zero_struct(*select);
+
239  select->normal = nk_style_item_color(table[NK_COLOR_SELECT]);
+
240  select->hover = nk_style_item_color(table[NK_COLOR_SELECT]);
+
241  select->pressed = nk_style_item_color(table[NK_COLOR_SELECT]);
+
242  select->normal_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+
243  select->hover_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+
244  select->pressed_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+
245  select->text_normal = table[NK_COLOR_TEXT];
+
246  select->text_hover = table[NK_COLOR_TEXT];
+
247  select->text_pressed = table[NK_COLOR_TEXT];
+
248  select->text_normal_active = table[NK_COLOR_TEXT];
+
249  select->text_hover_active = table[NK_COLOR_TEXT];
+
250  select->text_pressed_active = table[NK_COLOR_TEXT];
+
251  select->padding = nk_vec2(2.0f,2.0f);
+
252  select->image_padding = nk_vec2(2.0f,2.0f);
+
253  select->touch_padding = nk_vec2(0,0);
+
254  select->userdata = nk_handle_ptr(0);
+
255  select->rounding = 0.0f;
+
256  select->color_factor = 1.0f;
+
257  select->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
258  select->draw_begin = 0;
+
259  select->draw_end = 0;
+
260 
+
261  /* slider */
+
262  slider = &style->slider;
+
263  nk_zero_struct(*slider);
+
264  slider->normal = nk_style_item_hide();
+
265  slider->hover = nk_style_item_hide();
+
266  slider->active = nk_style_item_hide();
+
267  slider->bar_normal = table[NK_COLOR_SLIDER];
+
268  slider->bar_hover = table[NK_COLOR_SLIDER];
+
269  slider->bar_active = table[NK_COLOR_SLIDER];
+
270  slider->bar_filled = table[NK_COLOR_SLIDER_CURSOR];
+
271  slider->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
+
272  slider->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
+
273  slider->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
+
274  slider->inc_symbol = NK_SYMBOL_TRIANGLE_RIGHT;
+
275  slider->dec_symbol = NK_SYMBOL_TRIANGLE_LEFT;
+
276  slider->cursor_size = nk_vec2(16,16);
+
277  slider->padding = nk_vec2(2,2);
+
278  slider->spacing = nk_vec2(2,2);
+
279  slider->userdata = nk_handle_ptr(0);
+
280  slider->show_buttons = nk_false;
+
281  slider->bar_height = 8;
+
282  slider->rounding = 0;
+
283  slider->color_factor = 1.0f;
+
284  slider->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
285  slider->draw_begin = 0;
+
286  slider->draw_end = 0;
+
287 
+
288  /* slider buttons */
+
289  button = &style->slider.inc_button;
+
290  button->normal = nk_style_item_color(nk_rgb(40,40,40));
+
291  button->hover = nk_style_item_color(nk_rgb(42,42,42));
+
292  button->active = nk_style_item_color(nk_rgb(44,44,44));
+
293  button->border_color = nk_rgb(65,65,65);
+
294  button->text_background = nk_rgb(40,40,40);
+
295  button->text_normal = nk_rgb(175,175,175);
+
296  button->text_hover = nk_rgb(175,175,175);
+
297  button->text_active = nk_rgb(175,175,175);
+
298  button->padding = nk_vec2(8.0f,8.0f);
+
299  button->touch_padding = nk_vec2(0.0f,0.0f);
+
300  button->userdata = nk_handle_ptr(0);
+
301  button->text_alignment = NK_TEXT_CENTERED;
+
302  button->border = 1.0f;
+
303  button->rounding = 0.0f;
+
304  button->color_factor_text = 1.0f;
+
305  button->color_factor_background = 1.0f;
+
306  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
307  button->draw_begin = 0;
+
308  button->draw_end = 0;
+
309  style->slider.dec_button = style->slider.inc_button;
+
310 
+
311  /* knob */
+
312  knob = &style->knob;
+
313  nk_zero_struct(*knob);
+
314  knob->normal = nk_style_item_hide();
+
315  knob->hover = nk_style_item_hide();
+
316  knob->active = nk_style_item_hide();
+
317  knob->knob_normal = table[NK_COLOR_KNOB];
+
318  knob->knob_hover = table[NK_COLOR_KNOB];
+
319  knob->knob_active = table[NK_COLOR_KNOB];
+
320  knob->cursor_normal = table[NK_COLOR_KNOB_CURSOR];
+
321  knob->cursor_hover = table[NK_COLOR_KNOB_CURSOR_HOVER];
+
322  knob->cursor_active = table[NK_COLOR_KNOB_CURSOR_ACTIVE];
+
323 
+
324  knob->knob_border_color = table[NK_COLOR_BORDER];
+
325  knob->knob_border = 1.0f;
+
326 
+
327  knob->padding = nk_vec2(2,2);
+
328  knob->spacing = nk_vec2(2,2);
+
329  knob->cursor_width = 2;
+
330  knob->color_factor = 1.0f;
+
331  knob->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
332 
+
333  knob->userdata = nk_handle_ptr(0);
+
334  knob->draw_begin = 0;
+
335  knob->draw_end = 0;
+
336 
+
337  /* progressbar */
+
338  prog = &style->progress;
+
339  nk_zero_struct(*prog);
+
340  prog->normal = nk_style_item_color(table[NK_COLOR_SLIDER]);
+
341  prog->hover = nk_style_item_color(table[NK_COLOR_SLIDER]);
+
342  prog->active = nk_style_item_color(table[NK_COLOR_SLIDER]);
+
343  prog->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
+
344  prog->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
+
345  prog->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
+
346  prog->border_color = nk_rgba(0,0,0,0);
+
347  prog->cursor_border_color = nk_rgba(0,0,0,0);
+
348  prog->userdata = nk_handle_ptr(0);
+
349  prog->padding = nk_vec2(4,4);
+
350  prog->rounding = 0;
+
351  prog->border = 0;
+
352  prog->cursor_rounding = 0;
+
353  prog->cursor_border = 0;
+
354  prog->color_factor = 1.0f;
+
355  prog->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
356  prog->draw_begin = 0;
+
357  prog->draw_end = 0;
+
358 
+
359  /* scrollbars */
+
360  scroll = &style->scrollh;
+
361  nk_zero_struct(*scroll);
+
362  scroll->normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+
363  scroll->hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+
364  scroll->active = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+
365  scroll->cursor_normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR]);
+
366  scroll->cursor_hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_HOVER]);
+
367  scroll->cursor_active = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE]);
+
368  scroll->dec_symbol = NK_SYMBOL_CIRCLE_SOLID;
+
369  scroll->inc_symbol = NK_SYMBOL_CIRCLE_SOLID;
+
370  scroll->userdata = nk_handle_ptr(0);
+
371  scroll->border_color = table[NK_COLOR_SCROLLBAR];
+
372  scroll->cursor_border_color = table[NK_COLOR_SCROLLBAR];
+
373  scroll->padding = nk_vec2(0,0);
+
374  scroll->show_buttons = nk_false;
+
375  scroll->border = 0;
+
376  scroll->rounding = 0;
+
377  scroll->border_cursor = 0;
+
378  scroll->rounding_cursor = 0;
+
379  scroll->color_factor = 1.0f;
+
380  scroll->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
381  scroll->draw_begin = 0;
+
382  scroll->draw_end = 0;
+
383  style->scrollv = style->scrollh;
+
384 
+
385  /* scrollbars buttons */
+
386  button = &style->scrollh.inc_button;
+
387  button->normal = nk_style_item_color(nk_rgb(40,40,40));
+
388  button->hover = nk_style_item_color(nk_rgb(42,42,42));
+
389  button->active = nk_style_item_color(nk_rgb(44,44,44));
+
390  button->border_color = nk_rgb(65,65,65);
+
391  button->text_background = nk_rgb(40,40,40);
+
392  button->text_normal = nk_rgb(175,175,175);
+
393  button->text_hover = nk_rgb(175,175,175);
+
394  button->text_active = nk_rgb(175,175,175);
+
395  button->padding = nk_vec2(4.0f,4.0f);
+
396  button->touch_padding = nk_vec2(0.0f,0.0f);
+
397  button->userdata = nk_handle_ptr(0);
+
398  button->text_alignment = NK_TEXT_CENTERED;
+
399  button->border = 1.0f;
+
400  button->rounding = 0.0f;
+
401  button->color_factor_text = 1.0f;
+
402  button->color_factor_background = 1.0f;
+
403  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
404  button->draw_begin = 0;
+
405  button->draw_end = 0;
+
406  style->scrollh.dec_button = style->scrollh.inc_button;
+
407  style->scrollv.inc_button = style->scrollh.inc_button;
+
408  style->scrollv.dec_button = style->scrollh.inc_button;
+
409 
+
410  /* edit */
+
411  edit = &style->edit;
+
412  nk_zero_struct(*edit);
+
413  edit->normal = nk_style_item_color(table[NK_COLOR_EDIT]);
+
414  edit->hover = nk_style_item_color(table[NK_COLOR_EDIT]);
+
415  edit->active = nk_style_item_color(table[NK_COLOR_EDIT]);
+
416  edit->cursor_normal = table[NK_COLOR_TEXT];
+
417  edit->cursor_hover = table[NK_COLOR_TEXT];
+
418  edit->cursor_text_normal= table[NK_COLOR_EDIT];
+
419  edit->cursor_text_hover = table[NK_COLOR_EDIT];
+
420  edit->border_color = table[NK_COLOR_BORDER];
+
421  edit->text_normal = table[NK_COLOR_TEXT];
+
422  edit->text_hover = table[NK_COLOR_TEXT];
+
423  edit->text_active = table[NK_COLOR_TEXT];
+
424  edit->selected_normal = table[NK_COLOR_TEXT];
+
425  edit->selected_hover = table[NK_COLOR_TEXT];
+
426  edit->selected_text_normal = table[NK_COLOR_EDIT];
+
427  edit->selected_text_hover = table[NK_COLOR_EDIT];
+
428  edit->scrollbar_size = nk_vec2(10,10);
+
429  edit->scrollbar = style->scrollv;
+
430  edit->padding = nk_vec2(4,4);
+
431  edit->row_padding = 2;
+
432  edit->cursor_size = 4;
+
433  edit->border = 1;
+
434  edit->rounding = 0;
+
435  edit->color_factor = 1.0f;
+
436  edit->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
437 
+
438  /* property */
+
439  property = &style->property;
+
440  nk_zero_struct(*property);
+
441  property->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
442  property->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
443  property->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
444  property->border_color = table[NK_COLOR_BORDER];
+
445  property->label_normal = table[NK_COLOR_TEXT];
+
446  property->label_hover = table[NK_COLOR_TEXT];
+
447  property->label_active = table[NK_COLOR_TEXT];
+
448  property->sym_left = NK_SYMBOL_TRIANGLE_LEFT;
+
449  property->sym_right = NK_SYMBOL_TRIANGLE_RIGHT;
+
450  property->userdata = nk_handle_ptr(0);
+
451  property->padding = nk_vec2(4,4);
+
452  property->border = 1;
+
453  property->rounding = 10;
+
454  property->draw_begin = 0;
+
455  property->draw_end = 0;
+
456  property->color_factor = 1.0f;
+
457  property->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
458 
+
459  /* property buttons */
+
460  button = &style->property.dec_button;
+
461  nk_zero_struct(*button);
+
462  button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
463  button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
464  button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
465  button->border_color = nk_rgba(0,0,0,0);
+
466  button->text_background = table[NK_COLOR_PROPERTY];
+
467  button->text_normal = table[NK_COLOR_TEXT];
+
468  button->text_hover = table[NK_COLOR_TEXT];
+
469  button->text_active = table[NK_COLOR_TEXT];
+
470  button->padding = nk_vec2(0.0f,0.0f);
+
471  button->touch_padding = nk_vec2(0.0f,0.0f);
+
472  button->userdata = nk_handle_ptr(0);
+
473  button->text_alignment = NK_TEXT_CENTERED;
+
474  button->border = 0.0f;
+
475  button->rounding = 0.0f;
+
476  button->color_factor_text = 1.0f;
+
477  button->color_factor_background = 1.0f;
+
478  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
479  button->draw_begin = 0;
+
480  button->draw_end = 0;
+
481  style->property.inc_button = style->property.dec_button;
+
482 
+
483  /* property edit */
+
484  edit = &style->property.edit;
+
485  nk_zero_struct(*edit);
+
486  edit->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
487  edit->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
488  edit->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+
489  edit->border_color = nk_rgba(0,0,0,0);
+
490  edit->cursor_normal = table[NK_COLOR_TEXT];
+
491  edit->cursor_hover = table[NK_COLOR_TEXT];
+
492  edit->cursor_text_normal= table[NK_COLOR_EDIT];
+
493  edit->cursor_text_hover = table[NK_COLOR_EDIT];
+
494  edit->text_normal = table[NK_COLOR_TEXT];
+
495  edit->text_hover = table[NK_COLOR_TEXT];
+
496  edit->text_active = table[NK_COLOR_TEXT];
+
497  edit->selected_normal = table[NK_COLOR_TEXT];
+
498  edit->selected_hover = table[NK_COLOR_TEXT];
+
499  edit->selected_text_normal = table[NK_COLOR_EDIT];
+
500  edit->selected_text_hover = table[NK_COLOR_EDIT];
+
501  edit->padding = nk_vec2(0,0);
+
502  edit->cursor_size = 8;
+
503  edit->border = 0;
+
504  edit->rounding = 0;
+
505  edit->color_factor = 1.0f;
+
506  edit->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
507 
+
508  /* chart */
+
509  chart = &style->chart;
+
510  nk_zero_struct(*chart);
+
511  chart->background = nk_style_item_color(table[NK_COLOR_CHART]);
+
512  chart->border_color = table[NK_COLOR_BORDER];
+
513  chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT];
+
514  chart->color = table[NK_COLOR_CHART_COLOR];
+
515  chart->padding = nk_vec2(4,4);
+
516  chart->border = 0;
+
517  chart->rounding = 0;
+
518  chart->color_factor = 1.0f;
+
519  chart->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
520  chart->show_markers = nk_true;
+
521 
+
522  /* combo */
+
523  combo = &style->combo;
+
524  combo->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
+
525  combo->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
+
526  combo->active = nk_style_item_color(table[NK_COLOR_COMBO]);
+
527  combo->border_color = table[NK_COLOR_BORDER];
+
528  combo->label_normal = table[NK_COLOR_TEXT];
+
529  combo->label_hover = table[NK_COLOR_TEXT];
+
530  combo->label_active = table[NK_COLOR_TEXT];
+
531  combo->sym_normal = NK_SYMBOL_TRIANGLE_DOWN;
+
532  combo->sym_hover = NK_SYMBOL_TRIANGLE_DOWN;
+
533  combo->sym_active = NK_SYMBOL_TRIANGLE_DOWN;
+
534  combo->content_padding = nk_vec2(4,4);
+
535  combo->button_padding = nk_vec2(0,4);
+
536  combo->spacing = nk_vec2(4,0);
+
537  combo->border = 1;
+
538  combo->rounding = 0;
+
539  combo->color_factor = 1.0f;
+
540  combo->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
541 
+
542  /* combo button */
+
543  button = &style->combo.button;
+
544  nk_zero_struct(*button);
+
545  button->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
+
546  button->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
+
547  button->active = nk_style_item_color(table[NK_COLOR_COMBO]);
+
548  button->border_color = nk_rgba(0,0,0,0);
+
549  button->text_background = table[NK_COLOR_COMBO];
+
550  button->text_normal = table[NK_COLOR_TEXT];
+
551  button->text_hover = table[NK_COLOR_TEXT];
+
552  button->text_active = table[NK_COLOR_TEXT];
+
553  button->padding = nk_vec2(2.0f,2.0f);
+
554  button->touch_padding = nk_vec2(0.0f,0.0f);
+
555  button->userdata = nk_handle_ptr(0);
+
556  button->text_alignment = NK_TEXT_CENTERED;
+
557  button->border = 0.0f;
+
558  button->rounding = 0.0f;
+
559  button->color_factor_text = 1.0f;
+
560  button->color_factor_background = 1.0f;
+
561  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
562  button->draw_begin = 0;
+
563  button->draw_end = 0;
+
564 
+
565  /* tab */
+
566  tab = &style->tab;
+
567  tab->background = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+
568  tab->border_color = table[NK_COLOR_BORDER];
+
569  tab->text = table[NK_COLOR_TEXT];
+
570  tab->sym_minimize = NK_SYMBOL_TRIANGLE_RIGHT;
+
571  tab->sym_maximize = NK_SYMBOL_TRIANGLE_DOWN;
+
572  tab->padding = nk_vec2(4,4);
+
573  tab->spacing = nk_vec2(4,4);
+
574  tab->indent = 10.0f;
+
575  tab->border = 1;
+
576  tab->rounding = 0;
+
577  tab->color_factor = 1.0f;
+
578  tab->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
579 
+
580  /* tab button */
+
581  button = &style->tab.tab_minimize_button;
+
582  nk_zero_struct(*button);
+
583  button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+
584  button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+
585  button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+
586  button->border_color = nk_rgba(0,0,0,0);
+
587  button->text_background = table[NK_COLOR_TAB_HEADER];
+
588  button->text_normal = table[NK_COLOR_TEXT];
+
589  button->text_hover = table[NK_COLOR_TEXT];
+
590  button->text_active = table[NK_COLOR_TEXT];
+
591  button->padding = nk_vec2(2.0f,2.0f);
+
592  button->touch_padding = nk_vec2(0.0f,0.0f);
+
593  button->userdata = nk_handle_ptr(0);
+
594  button->text_alignment = NK_TEXT_CENTERED;
+
595  button->border = 0.0f;
+
596  button->rounding = 0.0f;
+
597  button->color_factor_text = 1.0f;
+
598  button->color_factor_background = 1.0f;
+
599  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
600  button->draw_begin = 0;
+
601  button->draw_end = 0;
+
602  style->tab.tab_maximize_button =*button;
+
603 
+
604  /* node button */
+
605  button = &style->tab.node_minimize_button;
+
606  nk_zero_struct(*button);
+
607  button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
608  button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
609  button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
610  button->border_color = nk_rgba(0,0,0,0);
+
611  button->text_background = table[NK_COLOR_TAB_HEADER];
+
612  button->text_normal = table[NK_COLOR_TEXT];
+
613  button->text_hover = table[NK_COLOR_TEXT];
+
614  button->text_active = table[NK_COLOR_TEXT];
+
615  button->padding = nk_vec2(2.0f,2.0f);
+
616  button->touch_padding = nk_vec2(0.0f,0.0f);
+
617  button->userdata = nk_handle_ptr(0);
+
618  button->text_alignment = NK_TEXT_CENTERED;
+
619  button->border = 0.0f;
+
620  button->rounding = 0.0f;
+
621  button->color_factor_text = 1.0f;
+
622  button->color_factor_background = 1.0f;
+
623  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
624  button->draw_begin = 0;
+
625  button->draw_end = 0;
+
626  style->tab.node_maximize_button =*button;
+
627 
+
628  /* window header */
+
629  win = &style->window;
+
630  win->header.align = NK_HEADER_RIGHT;
+
631  win->header.close_symbol = NK_SYMBOL_X;
+
632  win->header.minimize_symbol = NK_SYMBOL_MINUS;
+
633  win->header.maximize_symbol = NK_SYMBOL_PLUS;
+
634  win->header.normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+
635  win->header.hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+
636  win->header.active = nk_style_item_color(table[NK_COLOR_HEADER]);
+
637  win->header.label_normal = table[NK_COLOR_TEXT];
+
638  win->header.label_hover = table[NK_COLOR_TEXT];
+
639  win->header.label_active = table[NK_COLOR_TEXT];
+
640  win->header.label_padding = nk_vec2(4,4);
+
641  win->header.padding = nk_vec2(4,4);
+
642  win->header.spacing = nk_vec2(0,0);
+
643 
+
644  /* window header close button */
+
645  button = &style->window.header.close_button;
+
646  nk_zero_struct(*button);
+
647  button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+
648  button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+
649  button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
+
650  button->border_color = nk_rgba(0,0,0,0);
+
651  button->text_background = table[NK_COLOR_HEADER];
+
652  button->text_normal = table[NK_COLOR_TEXT];
+
653  button->text_hover = table[NK_COLOR_TEXT];
+
654  button->text_active = table[NK_COLOR_TEXT];
+
655  button->padding = nk_vec2(0.0f,0.0f);
+
656  button->touch_padding = nk_vec2(0.0f,0.0f);
+
657  button->userdata = nk_handle_ptr(0);
+
658  button->text_alignment = NK_TEXT_CENTERED;
+
659  button->border = 0.0f;
+
660  button->rounding = 0.0f;
+
661  button->color_factor_text = 1.0f;
+
662  button->color_factor_background = 1.0f;
+
663  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
664  button->draw_begin = 0;
+
665  button->draw_end = 0;
+
666 
+
667  /* window header minimize button */
+
668  button = &style->window.header.minimize_button;
+
669  nk_zero_struct(*button);
+
670  button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+
671  button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+
672  button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
+
673  button->border_color = nk_rgba(0,0,0,0);
+
674  button->text_background = table[NK_COLOR_HEADER];
+
675  button->text_normal = table[NK_COLOR_TEXT];
+
676  button->text_hover = table[NK_COLOR_TEXT];
+
677  button->text_active = table[NK_COLOR_TEXT];
+
678  button->padding = nk_vec2(0.0f,0.0f);
+
679  button->touch_padding = nk_vec2(0.0f,0.0f);
+
680  button->userdata = nk_handle_ptr(0);
+
681  button->text_alignment = NK_TEXT_CENTERED;
+
682  button->border = 0.0f;
+
683  button->rounding = 0.0f;
+
684  button->color_factor_text = 1.0f;
+
685  button->color_factor_background = 1.0f;
+
686  button->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
+
687  button->draw_begin = 0;
+
688  button->draw_end = 0;
+
689 
+
690  /* window */
+
691  win->background = table[NK_COLOR_WINDOW];
+
692  win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]);
+
693  win->border_color = table[NK_COLOR_BORDER];
+
694  win->popup_border_color = table[NK_COLOR_BORDER];
+
695  win->combo_border_color = table[NK_COLOR_BORDER];
+
696  win->contextual_border_color = table[NK_COLOR_BORDER];
+
697  win->menu_border_color = table[NK_COLOR_BORDER];
+
698  win->group_border_color = table[NK_COLOR_BORDER];
+
699  win->tooltip_border_color = table[NK_COLOR_BORDER];
+
700  win->scaler = nk_style_item_color(table[NK_COLOR_TEXT]);
+
701 
+
702  win->rounding = 0.0f;
+
703  win->spacing = nk_vec2(4,4);
+
704  win->scrollbar_size = nk_vec2(10,10);
+
705  win->min_size = nk_vec2(64,64);
+
706 
+
707  win->combo_border = 1.0f;
+
708  win->contextual_border = 1.0f;
+
709  win->menu_border = 1.0f;
+
710  win->group_border = 1.0f;
+
711  win->tooltip_border = 1.0f;
+
712  win->popup_border = 1.0f;
+
713  win->border = 2.0f;
+
714  win->min_row_height_padding = 8;
+
715 
+
716  win->padding = nk_vec2(4,4);
+
717  win->group_padding = nk_vec2(4,4);
+
718  win->popup_padding = nk_vec2(4,4);
+
719  win->combo_padding = nk_vec2(4,4);
+
720  win->contextual_padding = nk_vec2(4,4);
+
721  win->menu_padding = nk_vec2(4,4);
+
722  win->tooltip_padding = nk_vec2(4,4);
+
723 }
+
724 NK_API void
+
725 nk_style_set_font(struct nk_context *ctx, const struct nk_user_font *font)
+
726 {
+
727  struct nk_style *style;
+
728  NK_ASSERT(ctx);
+
729 
+
730  if (!ctx) return;
+
731  style = &ctx->style;
+
732  style->font = font;
+
733  ctx->stacks.fonts.head = 0;
+
734  if (ctx->current)
+ +
736 }
+
737 NK_API nk_bool
+
738 nk_style_push_font(struct nk_context *ctx, const struct nk_user_font *font)
+
739 {
+
740  struct nk_config_stack_user_font *font_stack;
+
741  struct nk_config_stack_user_font_element *element;
+
742 
+
743  NK_ASSERT(ctx);
+
744  if (!ctx) return 0;
+
745 
+
746  font_stack = &ctx->stacks.fonts;
+
747  NK_ASSERT(font_stack->head < (int)NK_LEN(font_stack->elements));
+
748  if (font_stack->head >= (int)NK_LEN(font_stack->elements))
+
749  return 0;
+
750 
+
751  element = &font_stack->elements[font_stack->head++];
+
752  element->address = &ctx->style.font;
+
753  element->old_value = ctx->style.font;
+
754  ctx->style.font = font;
+
755  return 1;
+
756 }
+
757 NK_API nk_bool
+
758 nk_style_pop_font(struct nk_context *ctx)
+
759 {
+
760  struct nk_config_stack_user_font *font_stack;
+
761  struct nk_config_stack_user_font_element *element;
+
762 
+
763  NK_ASSERT(ctx);
+
764  if (!ctx) return 0;
+
765 
+
766  font_stack = &ctx->stacks.fonts;
+
767  NK_ASSERT(font_stack->head > 0);
+
768  if (font_stack->head < 1)
+
769  return 0;
+
770 
+
771  element = &font_stack->elements[--font_stack->head];
+
772  *element->address = element->old_value;
+
773  return 1;
+
774 }
+
775 #define NK_STYLE_PUSH_IMPLEMENATION(prefix, type, stack) \
+
776 nk_style_push_##type(struct nk_context *ctx, prefix##_##type *address, prefix##_##type value)\
+
777 {\
+
778  struct nk_config_stack_##type * type_stack;\
+
779  struct nk_config_stack_##type##_element *element;\
+
780  NK_ASSERT(ctx);\
+
781  if (!ctx) return 0;\
+
782  type_stack = &ctx->stacks.stack;\
+
783  NK_ASSERT(type_stack->head < (int)NK_LEN(type_stack->elements));\
+
784  if (type_stack->head >= (int)NK_LEN(type_stack->elements))\
+
785  return 0;\
+
786  element = &type_stack->elements[type_stack->head++];\
+
787  element->address = address;\
+
788  element->old_value = *address;\
+
789  *address = value;\
+
790  return 1;\
+
791 }
+
792 #define NK_STYLE_POP_IMPLEMENATION(type, stack) \
+
793 nk_style_pop_##type(struct nk_context *ctx)\
+
794 {\
+
795  struct nk_config_stack_##type *type_stack;\
+
796  struct nk_config_stack_##type##_element *element;\
+
797  NK_ASSERT(ctx);\
+
798  if (!ctx) return 0;\
+
799  type_stack = &ctx->stacks.stack;\
+
800  NK_ASSERT(type_stack->head > 0);\
+
801  if (type_stack->head < 1)\
+
802  return 0;\
+
803  element = &type_stack->elements[--type_stack->head];\
+
804  *element->address = element->old_value;\
+
805  return 1;\
+
806 }
+
807 NK_API nk_bool NK_STYLE_PUSH_IMPLEMENATION(struct nk, style_item, style_items)
+
808 NK_API nk_bool NK_STYLE_PUSH_IMPLEMENATION(nk,float, floats)
+
809 NK_API nk_bool NK_STYLE_PUSH_IMPLEMENATION(struct nk, vec2, vectors)
+
810 NK_API nk_bool NK_STYLE_PUSH_IMPLEMENATION(nk,flags, flags)
+
811 NK_API nk_bool NK_STYLE_PUSH_IMPLEMENATION(struct nk,color, colors)
+
812 
+
813 NK_API nk_bool NK_STYLE_POP_IMPLEMENATION(style_item, style_items)
+
814 NK_API nk_bool NK_STYLE_POP_IMPLEMENATION(float,floats)
+
815 NK_API nk_bool NK_STYLE_POP_IMPLEMENATION(vec2, vectors)
+
816 NK_API nk_bool NK_STYLE_POP_IMPLEMENATION(flags,flags)
+
817 NK_API nk_bool NK_STYLE_POP_IMPLEMENATION(color,colors)
+
818 
+
819 NK_API nk_bool
+
820 nk_style_set_cursor(struct nk_context *ctx, enum nk_style_cursor c)
+
821 {
+
822  struct nk_style *style;
+
823  NK_ASSERT(ctx);
+
824  if (!ctx) return 0;
+
825  style = &ctx->style;
+
826  if (style->cursors[c]) {
+
827  style->cursor_active = style->cursors[c];
+
828  return 1;
+
829  }
+
830  return 0;
+
831 }
+
832 NK_API void
+
833 nk_style_show_cursor(struct nk_context *ctx)
+
834 {
+
835  ctx->style.cursor_visible = nk_true;
+
836 }
+
837 NK_API void
+
838 nk_style_hide_cursor(struct nk_context *ctx)
+
839 {
+
840  ctx->style.cursor_visible = nk_false;
+
841 }
+
842 NK_API void
+
843 nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor,
+
844  const struct nk_cursor *c)
+
845 {
+
846  struct nk_style *style;
+
847  NK_ASSERT(ctx);
+
848  if (!ctx) return;
+
849  style = &ctx->style;
+
850  style->cursors[cursor] = c;
+
851 }
+
852 NK_API void
+
853 nk_style_load_all_cursors(struct nk_context *ctx, const struct nk_cursor *cursors)
+
854 {
+
855  int i = 0;
+
856  struct nk_style *style;
+
857  NK_ASSERT(ctx);
+
858  if (!ctx) return;
+
859  style = &ctx->style;
+
860  for (i = 0; i < NK_CURSOR_COUNT; ++i)
+
861  style->cursors[i] = &cursors[i];
+
862  style->cursor_visible = nk_true;
+
863 }
+
main API and documentation file
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/nuklear__table_8c_source.html b/nuklear__table_8c_source.html new file mode 100644 index 000000000..072bd89a8 --- /dev/null +++ b/nuklear__table_8c_source.html @@ -0,0 +1,205 @@ + + + + + + + +Nuklear: src/nuklear_table.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_table.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TABLE
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB struct nk_table*
+
10 nk_create_table(struct nk_context *ctx)
+
11 {
+
12  struct nk_page_element *elem;
+
13  elem = nk_create_page_element(ctx);
+
14  if (!elem) return 0;
+
15  nk_zero_struct(*elem);
+
16  return &elem->data.tbl;
+
17 }
+
18 NK_LIB void
+
19 nk_free_table(struct nk_context *ctx, struct nk_table *tbl)
+
20 {
+
21  union nk_page_data *pd = NK_CONTAINER_OF(tbl, union nk_page_data, tbl);
+
22  struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+
23  nk_free_page_element(ctx, pe);
+
24 }
+
25 NK_LIB void
+
26 nk_push_table(struct nk_window *win, struct nk_table *tbl)
+
27 {
+
28  if (!win->tables) {
+
29  win->tables = tbl;
+
30  tbl->next = 0;
+
31  tbl->prev = 0;
+
32  tbl->size = 0;
+
33  win->table_count = 1;
+
34  return;
+
35  }
+
36  win->tables->prev = tbl;
+
37  tbl->next = win->tables;
+
38  tbl->prev = 0;
+
39  tbl->size = 0;
+
40  win->tables = tbl;
+
41  win->table_count++;
+
42 }
+
43 NK_LIB void
+
44 nk_remove_table(struct nk_window *win, struct nk_table *tbl)
+
45 {
+
46  if (win->tables == tbl)
+
47  win->tables = tbl->next;
+
48  if (tbl->next)
+
49  tbl->next->prev = tbl->prev;
+
50  if (tbl->prev)
+
51  tbl->prev->next = tbl->next;
+
52  tbl->next = 0;
+
53  tbl->prev = 0;
+
54 }
+
55 NK_LIB nk_uint*
+
56 nk_add_value(struct nk_context *ctx, struct nk_window *win,
+
57  nk_hash name, nk_uint value)
+
58 {
+
59  NK_ASSERT(ctx);
+
60  NK_ASSERT(win);
+
61  if (!win || !ctx) return 0;
+
62  if (!win->tables || win->tables->size >= NK_VALUE_PAGE_CAPACITY) {
+
63  struct nk_table *tbl = nk_create_table(ctx);
+
64  NK_ASSERT(tbl);
+
65  if (!tbl) return 0;
+
66  nk_push_table(win, tbl);
+
67  }
+
68  win->tables->seq = win->seq;
+
69  win->tables->keys[win->tables->size] = name;
+
70  win->tables->values[win->tables->size] = value;
+
71  return &win->tables->values[win->tables->size++];
+
72 }
+
73 NK_LIB nk_uint*
+
74 nk_find_value(const struct nk_window *win, nk_hash name)
+
75 {
+
76  struct nk_table *iter = win->tables;
+
77  while (iter) {
+
78  unsigned int i = 0;
+
79  unsigned int size = iter->size;
+
80  for (i = 0; i < size; ++i) {
+
81  if (iter->keys[i] == name) {
+
82  iter->seq = win->seq;
+
83  return &iter->values[i];
+
84  }
+
85  } size = NK_VALUE_PAGE_CAPACITY;
+
86  iter = iter->next;
+
87  }
+
88  return 0;
+
89 }
+
main API and documentation file
+ + + + + +
+
+ + + + diff --git a/nuklear__text_8c_source.html b/nuklear__text_8c_source.html new file mode 100644 index 000000000..874c9bd66 --- /dev/null +++ b/nuklear__text_8c_source.html @@ -0,0 +1,414 @@ + + + + + + + +Nuklear: src/nuklear_text.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_text.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TEXT
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void
+
10 nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
+
11  const char *string, int len, const struct nk_text *t,
+
12  nk_flags a, const struct nk_user_font *f)
+
13 {
+
14  struct nk_rect label;
+
15  float text_width;
+
16 
+
17  NK_ASSERT(o);
+
18  NK_ASSERT(t);
+
19  if (!o || !t) return;
+
20 
+
21  b.h = NK_MAX(b.h, 2 * t->padding.y);
+
22  label.x = 0; label.w = 0;
+
23  label.y = b.y + t->padding.y;
+
24  label.h = NK_MIN(f->height, b.h - 2 * t->padding.y);
+
25 
+
26  text_width = f->width(f->userdata, f->height, (const char*)string, len);
+
27  text_width += (2.0f * t->padding.x);
+
28 
+
29  /* align in x-axis */
+
30  if (a & NK_TEXT_ALIGN_LEFT) {
+
31  label.x = b.x + t->padding.x;
+
32  label.w = NK_MAX(0, b.w - 2 * t->padding.x);
+
33  } else if (a & NK_TEXT_ALIGN_CENTERED) {
+
34  label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width);
+
35  label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2);
+
36  label.x = NK_MAX(b.x + t->padding.x, label.x);
+
37  label.w = NK_MIN(b.x + b.w, label.x + label.w);
+
38  if (label.w >= label.x) label.w -= label.x;
+
39  } else if (a & NK_TEXT_ALIGN_RIGHT) {
+
40  label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width));
+
41  label.w = (float)text_width + 2 * t->padding.x;
+
42  } else return;
+
43 
+
44  /* align in y-axis */
+
45  if (a & NK_TEXT_ALIGN_MIDDLE) {
+
46  label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
+
47  label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
+
48  } else if (a & NK_TEXT_ALIGN_BOTTOM) {
+
49  label.y = b.y + b.h - f->height;
+
50  label.h = f->height;
+
51  }
+
52  nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text);
+
53 }
+
54 NK_LIB void
+
55 nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b,
+
56  const char *string, int len, const struct nk_text *t,
+
57  const struct nk_user_font *f)
+
58 {
+
59  float width;
+
60  int glyphs = 0;
+
61  int fitting = 0;
+
62  int done = 0;
+
63  struct nk_rect line;
+
64  struct nk_text text;
+
65  NK_INTERN nk_rune seperator[] = {' '};
+
66 
+
67  NK_ASSERT(o);
+
68  NK_ASSERT(t);
+
69  if (!o || !t) return;
+
70 
+
71  text.padding = nk_vec2(0,0);
+
72  text.background = t->background;
+
73  text.text = t->text;
+
74 
+
75  b.w = NK_MAX(b.w, 2 * t->padding.x);
+
76  b.h = NK_MAX(b.h, 2 * t->padding.y);
+
77  b.h = b.h - 2 * t->padding.y;
+
78 
+
79  line.x = b.x + t->padding.x;
+
80  line.y = b.y + t->padding.y;
+
81  line.w = b.w - 2 * t->padding.x;
+
82  line.h = 2 * t->padding.y + f->height;
+
83 
+
84  fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
+
85  while (done < len) {
+
86  if (!fitting || line.y + line.h >= (b.y + b.h)) break;
+
87  nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f);
+
88  done += fitting;
+
89  line.y += f->height + 2 * t->padding.y;
+
90  fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
+
91  }
+
92 }
+
93 NK_API void
+
94 nk_text_colored(struct nk_context *ctx, const char *str, int len,
+
95  nk_flags alignment, struct nk_color color)
+
96 {
+
97  struct nk_window *win;
+
98  const struct nk_style *style;
+
99 
+
100  struct nk_vec2 item_padding;
+
101  struct nk_rect bounds;
+
102  struct nk_text text;
+
103 
+
104  NK_ASSERT(ctx);
+
105  NK_ASSERT(ctx->current);
+
106  NK_ASSERT(ctx->current->layout);
+
107  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
108 
+
109  win = ctx->current;
+
110  style = &ctx->style;
+
111  nk_panel_alloc_space(&bounds, ctx);
+
112  item_padding = style->text.padding;
+
113 
+
114  text.padding.x = item_padding.x;
+
115  text.padding.y = item_padding.y;
+
116  text.background = style->window.background;
+
117  text.text = nk_rgb_factor(color, style->text.color_factor);
+
118  nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
+
119 }
+
120 NK_API void
+
121 nk_text_wrap_colored(struct nk_context *ctx, const char *str,
+
122  int len, struct nk_color color)
+
123 {
+
124  struct nk_window *win;
+
125  const struct nk_style *style;
+
126 
+
127  struct nk_vec2 item_padding;
+
128  struct nk_rect bounds;
+
129  struct nk_text text;
+
130 
+
131  NK_ASSERT(ctx);
+
132  NK_ASSERT(ctx->current);
+
133  NK_ASSERT(ctx->current->layout);
+
134  if (!ctx || !ctx->current || !ctx->current->layout) return;
+
135 
+
136  win = ctx->current;
+
137  style = &ctx->style;
+
138  nk_panel_alloc_space(&bounds, ctx);
+
139  item_padding = style->text.padding;
+
140 
+
141  text.padding.x = item_padding.x;
+
142  text.padding.y = item_padding.y;
+
143  text.background = style->window.background;
+
144  text.text = nk_rgb_factor(color, style->text.color_factor);
+
145  nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
+
146 }
+
147 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
148 NK_API void
+
149 nk_labelf_colored(struct nk_context *ctx, nk_flags flags,
+
150  struct nk_color color, const char *fmt, ...)
+
151 {
+
152  va_list args;
+
153  va_start(args, fmt);
+
154  nk_labelfv_colored(ctx, flags, color, fmt, args);
+
155  va_end(args);
+
156 }
+
157 NK_API void
+
158 nk_labelf_colored_wrap(struct nk_context *ctx, struct nk_color color,
+
159  const char *fmt, ...)
+
160 {
+
161  va_list args;
+
162  va_start(args, fmt);
+
163  nk_labelfv_colored_wrap(ctx, color, fmt, args);
+
164  va_end(args);
+
165 }
+
166 NK_API void
+
167 nk_labelf(struct nk_context *ctx, nk_flags flags, const char *fmt, ...)
+
168 {
+
169  va_list args;
+
170  va_start(args, fmt);
+
171  nk_labelfv(ctx, flags, fmt, args);
+
172  va_end(args);
+
173 }
+
174 NK_API void
+
175 nk_labelf_wrap(struct nk_context *ctx, const char *fmt,...)
+
176 {
+
177  va_list args;
+
178  va_start(args, fmt);
+
179  nk_labelfv_wrap(ctx, fmt, args);
+
180  va_end(args);
+
181 }
+
182 NK_API void
+
183 nk_labelfv_colored(struct nk_context *ctx, nk_flags flags,
+
184  struct nk_color color, const char *fmt, va_list args)
+
185 {
+
186  char buf[256];
+
187  nk_strfmt(buf, NK_LEN(buf), fmt, args);
+
188  nk_label_colored(ctx, buf, flags, color);
+
189 }
+
190 
+
191 NK_API void
+
192 nk_labelfv_colored_wrap(struct nk_context *ctx, struct nk_color color,
+
193  const char *fmt, va_list args)
+
194 {
+
195  char buf[256];
+
196  nk_strfmt(buf, NK_LEN(buf), fmt, args);
+
197  nk_label_colored_wrap(ctx, buf, color);
+
198 }
+
199 
+
200 NK_API void
+
201 nk_labelfv(struct nk_context *ctx, nk_flags flags, const char *fmt, va_list args)
+
202 {
+
203  char buf[256];
+
204  nk_strfmt(buf, NK_LEN(buf), fmt, args);
+
205  nk_label(ctx, buf, flags);
+
206 }
+
207 
+
208 NK_API void
+
209 nk_labelfv_wrap(struct nk_context *ctx, const char *fmt, va_list args)
+
210 {
+
211  char buf[256];
+
212  nk_strfmt(buf, NK_LEN(buf), fmt, args);
+
213  nk_label_wrap(ctx, buf);
+
214 }
+
215 
+
216 NK_API void
+
217 nk_value_bool(struct nk_context *ctx, const char *prefix, int value)
+
218 {
+
219  nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, ((value) ? "true": "false"));
+
220 }
+
221 NK_API void
+
222 nk_value_int(struct nk_context *ctx, const char *prefix, int value)
+
223 {
+
224  nk_labelf(ctx, NK_TEXT_LEFT, "%s: %d", prefix, value);
+
225 }
+
226 NK_API void
+
227 nk_value_uint(struct nk_context *ctx, const char *prefix, unsigned int value)
+
228 {
+
229  nk_labelf(ctx, NK_TEXT_LEFT, "%s: %u", prefix, value);
+
230 }
+
231 NK_API void
+
232 nk_value_float(struct nk_context *ctx, const char *prefix, float value)
+
233 {
+
234  double double_value = (double)value;
+
235  nk_labelf(ctx, NK_TEXT_LEFT, "%s: %.3f", prefix, double_value);
+
236 }
+
237 NK_API void
+
238 nk_value_color_byte(struct nk_context *ctx, const char *p, struct nk_color c)
+
239 {
+
240  nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%d, %d, %d, %d)", p, c.r, c.g, c.b, c.a);
+
241 }
+
242 NK_API void
+
243 nk_value_color_float(struct nk_context *ctx, const char *p, struct nk_color color)
+
244 {
+
245  double c[4]; nk_color_dv(c, color);
+
246  nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%.2f, %.2f, %.2f, %.2f)",
+
247  p, c[0], c[1], c[2], c[3]);
+
248 }
+
249 NK_API void
+
250 nk_value_color_hex(struct nk_context *ctx, const char *prefix, struct nk_color color)
+
251 {
+
252  char hex[16];
+
253  nk_color_hex_rgba(hex, color);
+
254  nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, hex);
+
255 }
+
256 #endif
+
257 NK_API void
+
258 nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment)
+
259 {
+
260  NK_ASSERT(ctx);
+
261  if (!ctx) return;
+
262  nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
+
263 }
+
264 NK_API void
+
265 nk_text_wrap(struct nk_context *ctx, const char *str, int len)
+
266 {
+
267  NK_ASSERT(ctx);
+
268  if (!ctx) return;
+
269  nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
+
270 }
+
271 NK_API void
+
272 nk_label(struct nk_context *ctx, const char *str, nk_flags alignment)
+
273 {
+
274  nk_text(ctx, str, nk_strlen(str), alignment);
+
275 }
+
276 NK_API void
+
277 nk_label_colored(struct nk_context *ctx, const char *str, nk_flags align,
+
278  struct nk_color color)
+
279 {
+
280  nk_text_colored(ctx, str, nk_strlen(str), align, color);
+
281 }
+
282 NK_API void
+
283 nk_label_wrap(struct nk_context *ctx, const char *str)
+
284 {
+
285  nk_text_wrap(ctx, str, nk_strlen(str));
+
286 }
+
287 NK_API void
+
288 nk_label_colored_wrap(struct nk_context *ctx, const char *str, struct nk_color color)
+
289 {
+
290  nk_text_wrap_colored(ctx, str, nk_strlen(str), color);
+
291 }
+
292 
+
main API and documentation file
+ + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__text__editor_8c_source.html b/nuklear__text__editor_8c_source.html new file mode 100644 index 000000000..9e5e53c54 --- /dev/null +++ b/nuklear__text__editor_8c_source.html @@ -0,0 +1,1151 @@ + + + + + + + +Nuklear: src/nuklear_text_editor.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_text_editor.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TEXT EDITOR
+
7  *
+
8  * ===============================================================*/
+
9 /* stb_textedit.h - v1.8 - public domain - Sean Barrett */
+
10 struct nk_text_find {
+
11  float x,y; /* position of n'th character */
+
12  float height; /* height of line */
+
13  int first_char, length; /* first char of row, and length */
+
14  int prev_first; /*_ first char of previous row */
+
15 };
+
16 
+ +
18  float x0,x1;
+
19  /* starting x location, end x location (allows for align=right, etc) */
+
20  float baseline_y_delta;
+
21  /* position of baseline relative to previous row's baseline*/
+
22  float ymin,ymax;
+
23  /* height of row above and below baseline */
+
24  int num_chars;
+
25 };
+
26 
+
27 /* forward declarations */
+
28 NK_INTERN void nk_textedit_makeundo_delete(struct nk_text_edit*, int, int);
+
29 NK_INTERN void nk_textedit_makeundo_insert(struct nk_text_edit*, int, int);
+
30 NK_INTERN void nk_textedit_makeundo_replace(struct nk_text_edit*, int, int, int);
+
31 #define NK_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end)
+
32 
+
33 NK_INTERN float
+
34 nk_textedit_get_width(const struct nk_text_edit *edit, int line_start, int char_id,
+
35  const struct nk_user_font *font)
+
36 {
+
37  int len = 0;
+
38  nk_rune unicode = 0;
+
39  const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len);
+
40  return font->width(font->userdata, font->height, str, len);
+
41 }
+
42 NK_INTERN void
+
43 nk_textedit_layout_row(struct nk_text_edit_row *r, struct nk_text_edit *edit,
+
44  int line_start_id, float row_height, const struct nk_user_font *font)
+
45 {
+
46  int l;
+
47  int glyphs = 0;
+
48  nk_rune unicode;
+
49  const char *remaining;
+
50  int len = nk_str_len_char(&edit->string);
+
51  const char *end = nk_str_get_const(&edit->string) + len;
+
52  const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l);
+
53  const struct nk_vec2 size = nk_text_calculate_text_bounds(font,
+
54  text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE);
+
55 
+
56  r->x0 = 0.0f;
+
57  r->x1 = size.x;
+
58  r->baseline_y_delta = size.y;
+
59  r->ymin = 0.0f;
+
60  r->ymax = size.y;
+
61  r->num_chars = glyphs;
+
62 }
+
63 NK_INTERN int
+
64 nk_textedit_locate_coord(struct nk_text_edit *edit, float x, float y,
+
65  const struct nk_user_font *font, float row_height)
+
66 {
+
67  struct nk_text_edit_row r;
+
68  int n = edit->string.len;
+
69  float base_y = 0, prev_x;
+
70  int i=0, k;
+
71 
+
72  r.x0 = r.x1 = 0;
+
73  r.ymin = r.ymax = 0;
+
74  r.num_chars = 0;
+
75 
+
76  /* search rows to find one that straddles 'y' */
+
77  while (i < n) {
+
78  nk_textedit_layout_row(&r, edit, i, row_height, font);
+
79  if (r.num_chars <= 0)
+
80  return n;
+
81 
+
82  if (i==0 && y < base_y + r.ymin)
+
83  return 0;
+
84 
+
85  if (y < base_y + r.ymax)
+
86  break;
+
87 
+
88  i += r.num_chars;
+
89  base_y += r.baseline_y_delta;
+
90  }
+
91 
+
92  /* below all text, return 'after' last character */
+
93  if (i >= n)
+
94  return n;
+
95 
+
96  /* check if it's before the beginning of the line */
+
97  if (x < r.x0)
+
98  return i;
+
99 
+
100  /* check if it's before the end of the line */
+
101  if (x < r.x1) {
+
102  /* search characters in row for one that straddles 'x' */
+
103  k = i;
+
104  prev_x = r.x0;
+
105  for (i=0; i < r.num_chars; ++i) {
+
106  float w = nk_textedit_get_width(edit, k, i, font);
+
107  if (x < prev_x+w) {
+
108  if (x < prev_x+w/2)
+
109  return k+i;
+
110  else return k+i+1;
+
111  }
+
112  prev_x += w;
+
113  }
+
114  /* shouldn't happen, but if it does, fall through to end-of-line case */
+
115  }
+
116 
+
117  /* if the last character is a newline, return that.
+
118  * otherwise return 'after' the last character */
+
119  if (nk_str_rune_at(&edit->string, i+r.num_chars-1) == '\n')
+
120  return i+r.num_chars-1;
+
121  else return i+r.num_chars;
+
122 }
+
123 NK_LIB void
+
124 nk_textedit_click(struct nk_text_edit *state, float x, float y,
+
125  const struct nk_user_font *font, float row_height)
+
126 {
+
127  /* API click: on mouse down, move the cursor to the clicked location,
+
128  * and reset the selection */
+
129  state->cursor = nk_textedit_locate_coord(state, x, y, font, row_height);
+
130  state->select_start = state->cursor;
+
131  state->select_end = state->cursor;
+
132  state->has_preferred_x = 0;
+
133 }
+
134 NK_LIB void
+
135 nk_textedit_drag(struct nk_text_edit *state, float x, float y,
+
136  const struct nk_user_font *font, float row_height)
+
137 {
+
138  /* API drag: on mouse drag, move the cursor and selection endpoint
+
139  * to the clicked location */
+
140  int p = nk_textedit_locate_coord(state, x, y, font, row_height);
+
141  if (state->select_start == state->select_end)
+
142  state->select_start = state->cursor;
+
143  state->cursor = state->select_end = p;
+
144 }
+
145 NK_INTERN void
+
146 nk_textedit_find_charpos(struct nk_text_find *find, struct nk_text_edit *state,
+
147  int n, int single_line, const struct nk_user_font *font, float row_height)
+
148 {
+
149  /* find the x/y location of a character, and remember info about the previous
+
150  * row in case we get a move-up event (for page up, we'll have to rescan) */
+
151  struct nk_text_edit_row r;
+
152  int prev_start = 0;
+
153  int z = state->string.len;
+
154  int i=0, first;
+
155 
+
156  nk_zero_struct(r);
+
157  if (n == z) {
+
158  /* if it's at the end, then find the last line -- simpler than trying to
+
159  explicitly handle this case in the regular code */
+
160  nk_textedit_layout_row(&r, state, 0, row_height, font);
+
161  if (single_line) {
+
162  find->first_char = 0;
+
163  find->length = z;
+
164  } else {
+
165  while (i < z) {
+
166  prev_start = i;
+
167  i += r.num_chars;
+
168  nk_textedit_layout_row(&r, state, i, row_height, font);
+
169  }
+
170 
+
171  find->first_char = i;
+
172  find->length = r.num_chars;
+
173  }
+
174  find->x = r.x1;
+
175  find->y = r.ymin;
+
176  find->height = r.ymax - r.ymin;
+
177  find->prev_first = prev_start;
+
178  return;
+
179  }
+
180 
+
181  /* search rows to find the one that straddles character n */
+
182  find->y = 0;
+
183 
+
184  for(;;) {
+
185  nk_textedit_layout_row(&r, state, i, row_height, font);
+
186  if (n < i + r.num_chars) break;
+
187  prev_start = i;
+
188  i += r.num_chars;
+
189  find->y += r.baseline_y_delta;
+
190  }
+
191 
+
192  find->first_char = first = i;
+
193  find->length = r.num_chars;
+
194  find->height = r.ymax - r.ymin;
+
195  find->prev_first = prev_start;
+
196 
+
197  /* now scan to find xpos */
+
198  find->x = r.x0;
+
199  for (i=0; first+i < n; ++i)
+
200  find->x += nk_textedit_get_width(state, first, i, font);
+
201 }
+
202 NK_INTERN void
+
203 nk_textedit_clamp(struct nk_text_edit *state)
+
204 {
+
205  /* make the selection/cursor state valid if client altered the string */
+
206  int n = state->string.len;
+
207  if (NK_TEXT_HAS_SELECTION(state)) {
+
208  if (state->select_start > n) state->select_start = n;
+
209  if (state->select_end > n) state->select_end = n;
+
210  /* if clamping forced them to be equal, move the cursor to match */
+
211  if (state->select_start == state->select_end)
+
212  state->cursor = state->select_start;
+
213  }
+
214  if (state->cursor > n) state->cursor = n;
+
215 }
+
216 NK_API void
+
217 nk_textedit_delete(struct nk_text_edit *state, int where, int len)
+
218 {
+
219  /* delete characters while updating undo */
+
220  nk_textedit_makeundo_delete(state, where, len);
+
221  nk_str_delete_runes(&state->string, where, len);
+
222  state->has_preferred_x = 0;
+
223 }
+
224 NK_API void
+
225 nk_textedit_delete_selection(struct nk_text_edit *state)
+
226 {
+
227  /* delete the section */
+
228  nk_textedit_clamp(state);
+
229  if (NK_TEXT_HAS_SELECTION(state)) {
+
230  if (state->select_start < state->select_end) {
+
231  nk_textedit_delete(state, state->select_start,
+
232  state->select_end - state->select_start);
+
233  state->select_end = state->cursor = state->select_start;
+
234  } else {
+
235  nk_textedit_delete(state, state->select_end,
+
236  state->select_start - state->select_end);
+
237  state->select_start = state->cursor = state->select_end;
+
238  }
+
239  state->has_preferred_x = 0;
+
240  }
+
241 }
+
242 NK_INTERN void
+
243 nk_textedit_sortselection(struct nk_text_edit *state)
+
244 {
+
245  /* canonicalize the selection so start <= end */
+
246  if (state->select_end < state->select_start) {
+
247  int temp = state->select_end;
+
248  state->select_end = state->select_start;
+
249  state->select_start = temp;
+
250  }
+
251 }
+
252 NK_INTERN void
+
253 nk_textedit_move_to_first(struct nk_text_edit *state)
+
254 {
+
255  /* move cursor to first character of selection */
+
256  if (NK_TEXT_HAS_SELECTION(state)) {
+
257  nk_textedit_sortselection(state);
+
258  state->cursor = state->select_start;
+
259  state->select_end = state->select_start;
+
260  state->has_preferred_x = 0;
+
261  }
+
262 }
+
263 NK_INTERN void
+
264 nk_textedit_move_to_last(struct nk_text_edit *state)
+
265 {
+
266  /* move cursor to last character of selection */
+
267  if (NK_TEXT_HAS_SELECTION(state)) {
+
268  nk_textedit_sortselection(state);
+
269  nk_textedit_clamp(state);
+
270  state->cursor = state->select_end;
+
271  state->select_start = state->select_end;
+
272  state->has_preferred_x = 0;
+
273  }
+
274 }
+
275 NK_INTERN int
+
276 nk_is_word_boundary( struct nk_text_edit *state, int idx)
+
277 {
+
278  int len;
+
279  nk_rune c;
+
280  if (idx <= 0) return 1;
+
281  if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1;
+
282  return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' ||
+
283  c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' ||
+
284  c == '|');
+
285 }
+
286 NK_INTERN int
+
287 nk_textedit_move_to_word_previous(struct nk_text_edit *state)
+
288 {
+
289  int c = state->cursor - 1;
+
290  while( c >= 0 && !nk_is_word_boundary(state, c))
+
291  --c;
+
292 
+
293  if( c < 0 )
+
294  c = 0;
+
295 
+
296  return c;
+
297 }
+
298 NK_INTERN int
+
299 nk_textedit_move_to_word_next(struct nk_text_edit *state)
+
300 {
+
301  const int len = state->string.len;
+
302  int c = state->cursor+1;
+
303  while( c < len && !nk_is_word_boundary(state, c))
+
304  ++c;
+
305 
+
306  if( c > len )
+
307  c = len;
+
308 
+
309  return c;
+
310 }
+
311 NK_INTERN void
+
312 nk_textedit_prep_selection_at_cursor(struct nk_text_edit *state)
+
313 {
+
314  /* update selection and cursor to match each other */
+
315  if (!NK_TEXT_HAS_SELECTION(state))
+
316  state->select_start = state->select_end = state->cursor;
+
317  else state->cursor = state->select_end;
+
318 }
+
319 NK_API nk_bool
+
320 nk_textedit_cut(struct nk_text_edit *state)
+
321 {
+
322  /* API cut: delete selection */
+
323  if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+
324  return 0;
+
325  if (NK_TEXT_HAS_SELECTION(state)) {
+
326  nk_textedit_delete_selection(state); /* implicitly clamps */
+
327  state->has_preferred_x = 0;
+
328  return 1;
+
329  }
+
330  return 0;
+
331 }
+
332 NK_API nk_bool
+
333 nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len)
+
334 {
+
335  /* API paste: replace existing selection with passed-in text */
+
336  int glyphs;
+
337  const char *text = (const char *) ctext;
+
338  if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0;
+
339 
+
340  /* if there's a selection, the paste should delete it */
+
341  nk_textedit_clamp(state);
+
342  nk_textedit_delete_selection(state);
+
343 
+
344  /* try to insert the characters */
+
345  glyphs = nk_utf_len(ctext, len);
+
346  if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
+
347  nk_textedit_makeundo_insert(state, state->cursor, glyphs);
+
348  state->cursor += len;
+
349  state->has_preferred_x = 0;
+
350  return 1;
+
351  }
+
352  /* remove the undo since we didn't actually insert the characters */
+
353  if (state->undo.undo_point)
+
354  --state->undo.undo_point;
+
355  return 0;
+
356 }
+
357 NK_API void
+
358 nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
+
359 {
+
360  nk_rune unicode;
+
361  int glyph_len;
+
362  int text_len = 0;
+
363 
+
364  NK_ASSERT(state);
+
365  NK_ASSERT(text);
+
366  if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;
+
367 
+
368  glyph_len = nk_utf_decode(text, &unicode, total_len);
+
369  while ((text_len < total_len) && glyph_len)
+
370  {
+
371  /* don't insert a backward delete, just process the event */
+
372  if (unicode == 127) goto next;
+
373  /* can't add newline in single-line mode */
+
374  if (unicode == '\n' && state->single_line) goto next;
+
375  /* filter incoming text */
+
376  if (state->filter && !state->filter(state, unicode)) goto next;
+
377 
+
378  if (!NK_TEXT_HAS_SELECTION(state) &&
+
379  state->cursor < state->string.len)
+
380  {
+
381  if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) {
+
382  nk_textedit_makeundo_replace(state, state->cursor, 1, 1);
+
383  nk_str_delete_runes(&state->string, state->cursor, 1);
+
384  }
+
385  if (nk_str_insert_text_utf8(&state->string, state->cursor,
+
386  text+text_len, 1))
+
387  {
+
388  ++state->cursor;
+
389  state->has_preferred_x = 0;
+
390  }
+
391  } else {
+
392  nk_textedit_delete_selection(state); /* implicitly clamps */
+
393  if (nk_str_insert_text_utf8(&state->string, state->cursor,
+
394  text+text_len, 1))
+
395  {
+
396  nk_textedit_makeundo_insert(state, state->cursor, 1);
+
397  state->cursor = NK_MIN(state->cursor + 1, state->string.len);
+
398  state->has_preferred_x = 0;
+
399  }
+
400  }
+
401  next:
+
402  text_len += glyph_len;
+
403  glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
+
404  }
+
405 }
+
406 NK_LIB void
+
407 nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod,
+
408  const struct nk_user_font *font, float row_height)
+
409 {
+
410 retry:
+
411  switch (key)
+
412  {
+
413  case NK_KEY_NONE:
+
414  case NK_KEY_CTRL:
+
415  case NK_KEY_ENTER:
+
416  case NK_KEY_SHIFT:
+
417  case NK_KEY_TAB:
+
418  case NK_KEY_COPY:
+
419  case NK_KEY_CUT:
+
420  case NK_KEY_PASTE:
+
421  case NK_KEY_MAX:
+
422  default: break;
+
423  case NK_KEY_TEXT_UNDO:
+
424  nk_textedit_undo(state);
+
425  state->has_preferred_x = 0;
+
426  break;
+
427 
+
428  case NK_KEY_TEXT_REDO:
+
429  nk_textedit_redo(state);
+
430  state->has_preferred_x = 0;
+
431  break;
+
432 
+
433  case NK_KEY_TEXT_SELECT_ALL:
+
434  nk_textedit_select_all(state);
+
435  state->has_preferred_x = 0;
+
436  break;
+
437 
+
438  case NK_KEY_TEXT_INSERT_MODE:
+
439  if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+
440  state->mode = NK_TEXT_EDIT_MODE_INSERT;
+
441  break;
+
442  case NK_KEY_TEXT_REPLACE_MODE:
+
443  if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+
444  state->mode = NK_TEXT_EDIT_MODE_REPLACE;
+
445  break;
+
446  case NK_KEY_TEXT_RESET_MODE:
+
447  if (state->mode == NK_TEXT_EDIT_MODE_INSERT ||
+
448  state->mode == NK_TEXT_EDIT_MODE_REPLACE)
+
449  state->mode = NK_TEXT_EDIT_MODE_VIEW;
+
450  break;
+
451 
+
452  case NK_KEY_LEFT:
+
453  if (shift_mod) {
+
454  nk_textedit_clamp(state);
+
455  nk_textedit_prep_selection_at_cursor(state);
+
456  /* move selection left */
+
457  if (state->select_end > 0)
+
458  --state->select_end;
+
459  state->cursor = state->select_end;
+
460  state->has_preferred_x = 0;
+
461  } else {
+
462  /* if currently there's a selection,
+
463  * move cursor to start of selection */
+
464  if (NK_TEXT_HAS_SELECTION(state))
+
465  nk_textedit_move_to_first(state);
+
466  else if (state->cursor > 0)
+
467  --state->cursor;
+
468  state->has_preferred_x = 0;
+
469  } break;
+
470 
+
471  case NK_KEY_RIGHT:
+
472  if (shift_mod) {
+
473  nk_textedit_prep_selection_at_cursor(state);
+
474  /* move selection right */
+
475  ++state->select_end;
+
476  nk_textedit_clamp(state);
+
477  state->cursor = state->select_end;
+
478  state->has_preferred_x = 0;
+
479  } else {
+
480  /* if currently there's a selection,
+
481  * move cursor to end of selection */
+
482  if (NK_TEXT_HAS_SELECTION(state))
+
483  nk_textedit_move_to_last(state);
+
484  else ++state->cursor;
+
485  nk_textedit_clamp(state);
+
486  state->has_preferred_x = 0;
+
487  } break;
+
488 
+
489  case NK_KEY_TEXT_WORD_LEFT:
+
490  if (shift_mod) {
+
491  if( !NK_TEXT_HAS_SELECTION( state ) )
+
492  nk_textedit_prep_selection_at_cursor(state);
+
493  state->cursor = nk_textedit_move_to_word_previous(state);
+
494  state->select_end = state->cursor;
+
495  nk_textedit_clamp(state );
+
496  } else {
+
497  if (NK_TEXT_HAS_SELECTION(state))
+
498  nk_textedit_move_to_first(state);
+
499  else {
+
500  state->cursor = nk_textedit_move_to_word_previous(state);
+
501  nk_textedit_clamp(state );
+
502  }
+
503  } break;
+
504 
+
505  case NK_KEY_TEXT_WORD_RIGHT:
+
506  if (shift_mod) {
+
507  if( !NK_TEXT_HAS_SELECTION( state ) )
+
508  nk_textedit_prep_selection_at_cursor(state);
+
509  state->cursor = nk_textedit_move_to_word_next(state);
+
510  state->select_end = state->cursor;
+
511  nk_textedit_clamp(state);
+
512  } else {
+
513  if (NK_TEXT_HAS_SELECTION(state))
+
514  nk_textedit_move_to_last(state);
+
515  else {
+
516  state->cursor = nk_textedit_move_to_word_next(state);
+
517  nk_textedit_clamp(state );
+
518  }
+
519  } break;
+
520 
+
521  case NK_KEY_DOWN: {
+
522  struct nk_text_find find;
+
523  struct nk_text_edit_row row;
+
524  int i, sel = shift_mod;
+
525 
+
526  if (state->single_line) {
+
527  /* on windows, up&down in single-line behave like left&right */
+
528  key = NK_KEY_RIGHT;
+
529  goto retry;
+
530  }
+
531 
+
532  if (sel)
+
533  nk_textedit_prep_selection_at_cursor(state);
+
534  else if (NK_TEXT_HAS_SELECTION(state))
+
535  nk_textedit_move_to_last(state);
+
536 
+
537  /* compute current position of cursor point */
+
538  nk_textedit_clamp(state);
+
539  nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+
540  font, row_height);
+
541 
+
542  /* now find character position down a row */
+
543  if (find.length)
+
544  {
+
545  float x;
+
546  float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
+
547  int start = find.first_char + find.length;
+
548 
+
549  state->cursor = start;
+
550  nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
+
551  x = row.x0;
+
552 
+
553  for (i=0; i < row.num_chars && x < row.x1; ++i) {
+
554  float dx = nk_textedit_get_width(state, start, i, font);
+
555  x += dx;
+
556  if (x > goal_x)
+
557  break;
+
558  ++state->cursor;
+
559  }
+
560  nk_textedit_clamp(state);
+
561 
+
562  state->has_preferred_x = 1;
+
563  state->preferred_x = goal_x;
+
564  if (sel)
+
565  state->select_end = state->cursor;
+
566  }
+
567  } break;
+
568 
+
569  case NK_KEY_UP: {
+
570  struct nk_text_find find;
+
571  struct nk_text_edit_row row;
+
572  int i, sel = shift_mod;
+
573 
+
574  if (state->single_line) {
+
575  /* on windows, up&down become left&right */
+
576  key = NK_KEY_LEFT;
+
577  goto retry;
+
578  }
+
579 
+
580  if (sel)
+
581  nk_textedit_prep_selection_at_cursor(state);
+
582  else if (NK_TEXT_HAS_SELECTION(state))
+
583  nk_textedit_move_to_first(state);
+
584 
+
585  /* compute current position of cursor point */
+
586  nk_textedit_clamp(state);
+
587  nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+
588  font, row_height);
+
589 
+
590  /* can only go up if there's a previous row */
+
591  if (find.prev_first != find.first_char) {
+
592  /* now find character position up a row */
+
593  float x;
+
594  float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
+
595 
+
596  state->cursor = find.prev_first;
+
597  nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
+
598  x = row.x0;
+
599 
+
600  for (i=0; i < row.num_chars && x < row.x1; ++i) {
+
601  float dx = nk_textedit_get_width(state, find.prev_first, i, font);
+
602  x += dx;
+
603  if (x > goal_x)
+
604  break;
+
605  ++state->cursor;
+
606  }
+
607  nk_textedit_clamp(state);
+
608 
+
609  state->has_preferred_x = 1;
+
610  state->preferred_x = goal_x;
+
611  if (sel) state->select_end = state->cursor;
+
612  }
+
613  } break;
+
614 
+
615  case NK_KEY_DEL:
+
616  if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+
617  break;
+
618  if (NK_TEXT_HAS_SELECTION(state))
+
619  nk_textedit_delete_selection(state);
+
620  else {
+
621  int n = state->string.len;
+
622  if (state->cursor < n)
+
623  nk_textedit_delete(state, state->cursor, 1);
+
624  }
+
625  state->has_preferred_x = 0;
+
626  break;
+
627 
+
628  case NK_KEY_BACKSPACE:
+
629  if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+
630  break;
+
631  if (NK_TEXT_HAS_SELECTION(state))
+
632  nk_textedit_delete_selection(state);
+
633  else {
+
634  nk_textedit_clamp(state);
+
635  if (state->cursor > 0) {
+
636  nk_textedit_delete(state, state->cursor-1, 1);
+
637  --state->cursor;
+
638  }
+
639  }
+
640  state->has_preferred_x = 0;
+
641  break;
+
642 
+
643  case NK_KEY_TEXT_START:
+
644  if (shift_mod) {
+
645  nk_textedit_prep_selection_at_cursor(state);
+
646  state->cursor = state->select_end = 0;
+
647  state->has_preferred_x = 0;
+
648  } else {
+
649  state->cursor = state->select_start = state->select_end = 0;
+
650  state->has_preferred_x = 0;
+
651  }
+
652  break;
+
653 
+
654  case NK_KEY_TEXT_END:
+
655  if (shift_mod) {
+
656  nk_textedit_prep_selection_at_cursor(state);
+
657  state->cursor = state->select_end = state->string.len;
+
658  state->has_preferred_x = 0;
+
659  } else {
+
660  state->cursor = state->string.len;
+
661  state->select_start = state->select_end = 0;
+
662  state->has_preferred_x = 0;
+
663  }
+
664  break;
+
665 
+
666  case NK_KEY_TEXT_LINE_START: {
+
667  if (shift_mod) {
+
668  struct nk_text_find find;
+
669  nk_textedit_clamp(state);
+
670  nk_textedit_prep_selection_at_cursor(state);
+
671  if (state->string.len && state->cursor == state->string.len)
+
672  --state->cursor;
+
673  nk_textedit_find_charpos(&find, state,state->cursor, state->single_line,
+
674  font, row_height);
+
675  state->cursor = state->select_end = find.first_char;
+
676  state->has_preferred_x = 0;
+
677  } else {
+
678  struct nk_text_find find;
+
679  if (state->string.len && state->cursor == state->string.len)
+
680  --state->cursor;
+
681  nk_textedit_clamp(state);
+
682  nk_textedit_move_to_first(state);
+
683  nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+
684  font, row_height);
+
685  state->cursor = find.first_char;
+
686  state->has_preferred_x = 0;
+
687  }
+
688  } break;
+
689 
+
690  case NK_KEY_TEXT_LINE_END: {
+
691  if (shift_mod) {
+
692  struct nk_text_find find;
+
693  nk_textedit_clamp(state);
+
694  nk_textedit_prep_selection_at_cursor(state);
+
695  nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+
696  font, row_height);
+
697  state->has_preferred_x = 0;
+
698  state->cursor = find.first_char + find.length;
+
699  if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
+
700  --state->cursor;
+
701  state->select_end = state->cursor;
+
702  } else {
+
703  struct nk_text_find find;
+
704  nk_textedit_clamp(state);
+
705  nk_textedit_move_to_first(state);
+
706  nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+
707  font, row_height);
+
708 
+
709  state->has_preferred_x = 0;
+
710  state->cursor = find.first_char + find.length;
+
711  if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
+
712  --state->cursor;
+
713  }} break;
+
714  }
+
715 }
+
716 NK_INTERN void
+
717 nk_textedit_flush_redo(struct nk_text_undo_state *state)
+
718 {
+
719  state->redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
+
720  state->redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
+
721 }
+
722 NK_INTERN void
+
723 nk_textedit_discard_undo(struct nk_text_undo_state *state)
+
724 {
+
725  /* discard the oldest entry in the undo list */
+
726  if (state->undo_point > 0) {
+
727  /* if the 0th undo state has characters, clean those up */
+
728  if (state->undo_rec[0].char_storage >= 0) {
+
729  int n = state->undo_rec[0].insert_length, i;
+
730  /* delete n characters from all other records */
+
731  state->undo_char_point = (short)(state->undo_char_point - n);
+
732  NK_MEMCPY(state->undo_char, state->undo_char + n,
+
733  (nk_size)state->undo_char_point*sizeof(nk_rune));
+
734  for (i=0; i < state->undo_point; ++i) {
+
735  if (state->undo_rec[i].char_storage >= 0)
+
736  state->undo_rec[i].char_storage = (short)
+
737  (state->undo_rec[i].char_storage - n);
+
738  }
+
739  }
+
740  --state->undo_point;
+
741  NK_MEMCPY(state->undo_rec, state->undo_rec+1,
+
742  (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0])));
+
743  }
+
744 }
+
745 NK_INTERN void
+
746 nk_textedit_discard_redo(struct nk_text_undo_state *state)
+
747 {
+
748 /* discard the oldest entry in the redo list--it's bad if this
+
749  ever happens, but because undo & redo have to store the actual
+
750  characters in different cases, the redo character buffer can
+
751  fill up even though the undo buffer didn't */
+
752  nk_size num;
+
753  int k = NK_TEXTEDIT_UNDOSTATECOUNT-1;
+
754  if (state->redo_point <= k) {
+
755  /* if the k'th undo state has characters, clean those up */
+
756  if (state->undo_rec[k].char_storage >= 0) {
+
757  int n = state->undo_rec[k].insert_length, i;
+
758  /* delete n characters from all other records */
+
759  state->redo_char_point = (short)(state->redo_char_point + n);
+
760  num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
+
761  NK_MEMCPY(state->undo_char + state->redo_char_point,
+
762  state->undo_char + state->redo_char_point-n, num * sizeof(char));
+
763  for (i = state->redo_point; i < k; ++i) {
+
764  if (state->undo_rec[i].char_storage >= 0) {
+
765  state->undo_rec[i].char_storage = (short)
+
766  (state->undo_rec[i].char_storage + n);
+
767  }
+
768  }
+
769  }
+
770  ++state->redo_point;
+
771  num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
+
772  if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1,
+
773  state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0]));
+
774  }
+
775 }
+
776 NK_INTERN struct nk_text_undo_record*
+
777 nk_textedit_create_undo_record(struct nk_text_undo_state *state, int numchars)
+
778 {
+
779  /* any time we create a new undo record, we discard redo*/
+
780  nk_textedit_flush_redo(state);
+
781 
+
782  /* if we have no free records, we have to make room,
+
783  * by sliding the existing records down */
+
784  if (state->undo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+
785  nk_textedit_discard_undo(state);
+
786 
+
787  /* if the characters to store won't possibly fit in the buffer,
+
788  * we can't undo */
+
789  if (numchars > NK_TEXTEDIT_UNDOCHARCOUNT) {
+
790  state->undo_point = 0;
+
791  state->undo_char_point = 0;
+
792  return 0;
+
793  }
+
794 
+
795  /* if we don't have enough free characters in the buffer,
+
796  * we have to make room */
+
797  while (state->undo_char_point + numchars > NK_TEXTEDIT_UNDOCHARCOUNT)
+
798  nk_textedit_discard_undo(state);
+
799  return &state->undo_rec[state->undo_point++];
+
800 }
+
801 NK_INTERN nk_rune*
+
802 nk_textedit_createundo(struct nk_text_undo_state *state, int pos,
+
803  int insert_len, int delete_len)
+
804 {
+
805  struct nk_text_undo_record *r = nk_textedit_create_undo_record(state, insert_len);
+
806  if (r == 0)
+
807  return 0;
+
808 
+
809  r->where = pos;
+
810  r->insert_length = (short) insert_len;
+
811  r->delete_length = (short) delete_len;
+
812 
+
813  if (insert_len == 0) {
+
814  r->char_storage = -1;
+
815  return 0;
+
816  } else {
+
817  r->char_storage = state->undo_char_point;
+
818  state->undo_char_point = (short)(state->undo_char_point + insert_len);
+
819  return &state->undo_char[r->char_storage];
+
820  }
+
821 }
+
822 NK_API void
+
823 nk_textedit_undo(struct nk_text_edit *state)
+
824 {
+
825  struct nk_text_undo_state *s = &state->undo;
+
826  struct nk_text_undo_record u, *r;
+
827  if (s->undo_point == 0)
+
828  return;
+
829 
+
830  /* we need to do two things: apply the undo record, and create a redo record */
+
831  u = s->undo_rec[s->undo_point-1];
+
832  r = &s->undo_rec[s->redo_point-1];
+
833  r->char_storage = -1;
+
834 
+
835  r->insert_length = u.delete_length;
+
836  r->delete_length = u.insert_length;
+
837  r->where = u.where;
+
838 
+
839  if (u.delete_length)
+
840  {
+
841  /* if the undo record says to delete characters, then the redo record will
+
842  need to re-insert the characters that get deleted, so we need to store
+
843  them.
+
844  there are three cases:
+
845  - there's enough room to store the characters
+
846  - characters stored for *redoing* don't leave room for redo
+
847  - characters stored for *undoing* don't leave room for redo
+
848  if the last is true, we have to bail */
+
849  if (s->undo_char_point + u.delete_length >= NK_TEXTEDIT_UNDOCHARCOUNT) {
+
850  /* the undo records take up too much character space; there's no space
+
851  * to store the redo characters */
+
852  r->insert_length = 0;
+
853  } else {
+
854  int i;
+
855  /* there's definitely room to store the characters eventually */
+
856  while (s->undo_char_point + u.delete_length > s->redo_char_point) {
+
857  /* there's currently not enough room, so discard a redo record */
+
858  nk_textedit_discard_redo(s);
+
859  /* should never happen: */
+
860  if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+
861  return;
+
862  }
+
863 
+
864  r = &s->undo_rec[s->redo_point-1];
+
865  r->char_storage = (short)(s->redo_char_point - u.delete_length);
+
866  s->redo_char_point = (short)(s->redo_char_point - u.delete_length);
+
867 
+
868  /* now save the characters */
+
869  for (i=0; i < u.delete_length; ++i)
+
870  s->undo_char[r->char_storage + i] =
+
871  nk_str_rune_at(&state->string, u.where + i);
+
872  }
+
873  /* now we can carry out the deletion */
+
874  nk_str_delete_runes(&state->string, u.where, u.delete_length);
+
875  }
+
876 
+
877  /* check type of recorded action: */
+
878  if (u.insert_length) {
+
879  /* easy case: was a deletion, so we need to insert n characters */
+
880  nk_str_insert_text_runes(&state->string, u.where,
+
881  &s->undo_char[u.char_storage], u.insert_length);
+
882  s->undo_char_point = (short)(s->undo_char_point - u.insert_length);
+
883  }
+
884  state->cursor = (short)(u.where + u.insert_length);
+
885 
+
886  s->undo_point--;
+
887  s->redo_point--;
+
888 }
+
889 NK_API void
+
890 nk_textedit_redo(struct nk_text_edit *state)
+
891 {
+
892  struct nk_text_undo_state *s = &state->undo;
+
893  struct nk_text_undo_record *u, r;
+
894  if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+
895  return;
+
896 
+
897  /* we need to do two things: apply the redo record, and create an undo record */
+
898  u = &s->undo_rec[s->undo_point];
+
899  r = s->undo_rec[s->redo_point];
+
900 
+
901  /* we KNOW there must be room for the undo record, because the redo record
+
902  was derived from an undo record */
+
903  u->delete_length = r.insert_length;
+
904  u->insert_length = r.delete_length;
+
905  u->where = r.where;
+
906  u->char_storage = -1;
+
907 
+
908  if (r.delete_length) {
+
909  /* the redo record requires us to delete characters, so the undo record
+
910  needs to store the characters */
+
911  if (s->undo_char_point + u->insert_length > s->redo_char_point) {
+
912  u->insert_length = 0;
+
913  u->delete_length = 0;
+
914  } else {
+
915  int i;
+
916  u->char_storage = s->undo_char_point;
+
917  s->undo_char_point = (short)(s->undo_char_point + u->insert_length);
+
918 
+
919  /* now save the characters */
+
920  for (i=0; i < u->insert_length; ++i) {
+
921  s->undo_char[u->char_storage + i] =
+
922  nk_str_rune_at(&state->string, u->where + i);
+
923  }
+
924  }
+
925  nk_str_delete_runes(&state->string, r.where, r.delete_length);
+
926  }
+
927 
+
928  if (r.insert_length) {
+
929  /* easy case: need to insert n characters */
+
930  nk_str_insert_text_runes(&state->string, r.where,
+
931  &s->undo_char[r.char_storage], r.insert_length);
+
932  }
+
933  state->cursor = r.where + r.insert_length;
+
934 
+
935  s->undo_point++;
+
936  s->redo_point++;
+
937 }
+
938 NK_INTERN void
+
939 nk_textedit_makeundo_insert(struct nk_text_edit *state, int where, int length)
+
940 {
+
941  nk_textedit_createundo(&state->undo, where, 0, length);
+
942 }
+
943 NK_INTERN void
+
944 nk_textedit_makeundo_delete(struct nk_text_edit *state, int where, int length)
+
945 {
+
946  int i;
+
947  nk_rune *p = nk_textedit_createundo(&state->undo, where, length, 0);
+
948  if (p) {
+
949  for (i=0; i < length; ++i)
+
950  p[i] = nk_str_rune_at(&state->string, where+i);
+
951  }
+
952 }
+
953 NK_INTERN void
+
954 nk_textedit_makeundo_replace(struct nk_text_edit *state, int where,
+
955  int old_length, int new_length)
+
956 {
+
957  int i;
+
958  nk_rune *p = nk_textedit_createundo(&state->undo, where, old_length, new_length);
+
959  if (p) {
+
960  for (i=0; i < old_length; ++i)
+
961  p[i] = nk_str_rune_at(&state->string, where+i);
+
962  }
+
963 }
+
964 NK_LIB void
+
965 nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type,
+
966  nk_plugin_filter filter)
+
967 {
+
968  /* reset the state to default */
+
969  state->undo.undo_point = 0;
+
970  state->undo.undo_char_point = 0;
+
971  state->undo.redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
+
972  state->undo.redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
+
973  state->select_end = state->select_start = 0;
+
974  state->cursor = 0;
+
975  state->has_preferred_x = 0;
+
976  state->preferred_x = 0;
+
977  state->cursor_at_end_of_line = 0;
+
978  state->initialized = 1;
+
979  state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE);
+
980  state->mode = NK_TEXT_EDIT_MODE_VIEW;
+
981  state->filter = filter;
+
982  state->scrollbar = nk_vec2(0,0);
+
983 }
+
984 NK_API void
+
985 nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
+
986 {
+
987  NK_ASSERT(state);
+
988  NK_ASSERT(memory);
+
989  if (!state || !memory || !size) return;
+
990  NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+
991  nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+
992  nk_str_init_fixed(&state->string, memory, size);
+
993 }
+
994 NK_API void
+
995 nk_textedit_init(struct nk_text_edit *state, const struct nk_allocator *alloc, nk_size size)
+
996 {
+
997  NK_ASSERT(state);
+
998  NK_ASSERT(alloc);
+
999  if (!state || !alloc) return;
+
1000  NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+
1001  nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+
1002  nk_str_init(&state->string, alloc, size);
+
1003 }
+
1004 #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+
1005 NK_API void
+
1006 nk_textedit_init_default(struct nk_text_edit *state)
+
1007 {
+
1008  NK_ASSERT(state);
+
1009  if (!state) return;
+
1010  NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+
1011  nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+
1012  nk_str_init_default(&state->string);
+
1013 }
+
1014 #endif
+
1015 NK_API void
+
1016 nk_textedit_select_all(struct nk_text_edit *state)
+
1017 {
+
1018  NK_ASSERT(state);
+
1019  state->select_start = 0;
+
1020  state->select_end = state->string.len;
+
1021 }
+
1022 NK_API void
+
1023 nk_textedit_free(struct nk_text_edit *state)
+
1024 {
+
1025  NK_ASSERT(state);
+
1026  if (!state) return;
+
1027  nk_str_free(&state->string);
+
1028 }
+
1029 
+
main API and documentation file
+
NK_API void nk_textedit_init(struct nk_text_edit *, const struct nk_allocator *, nk_size size)
text editor
+ + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ +
+
+ + + + diff --git a/nuklear__toggle_8c_source.html b/nuklear__toggle_8c_source.html new file mode 100644 index 000000000..1d23b0bc8 --- /dev/null +++ b/nuklear__toggle_8c_source.html @@ -0,0 +1,573 @@ + + + + + + + +Nuklear: src/nuklear_toggle.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_toggle.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TOGGLE
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB nk_bool
+
10 nk_toggle_behavior(const struct nk_input *in, struct nk_rect select,
+
11  nk_flags *state, nk_bool active)
+
12 {
+
13  nk_widget_state_reset(state);
+
14  if (nk_button_behavior(state, select, in, NK_BUTTON_DEFAULT)) {
+
15  *state = NK_WIDGET_STATE_ACTIVE;
+
16  active = !active;
+
17  }
+
18  if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, select))
+
19  *state |= NK_WIDGET_STATE_ENTERED;
+
20  else if (nk_input_is_mouse_prev_hovering_rect(in, select))
+
21  *state |= NK_WIDGET_STATE_LEFT;
+
22  return active;
+
23 }
+
24 NK_LIB void
+
25 nk_draw_checkbox(struct nk_command_buffer *out,
+
26  nk_flags state, const struct nk_style_toggle *style, nk_bool active,
+
27  const struct nk_rect *label, const struct nk_rect *selector,
+
28  const struct nk_rect *cursors, const char *string, int len,
+
29  const struct nk_user_font *font, nk_flags text_alignment)
+
30 {
+
31  const struct nk_style_item *background;
+
32  const struct nk_style_item *cursor;
+
33  struct nk_text text;
+
34 
+
35  /* select correct colors/images */
+
36  if (state & NK_WIDGET_STATE_HOVER) {
+
37  background = &style->hover;
+
38  cursor = &style->cursor_hover;
+
39  text.text = style->text_hover;
+
40  } else if (state & NK_WIDGET_STATE_ACTIVED) {
+
41  background = &style->hover;
+
42  cursor = &style->cursor_hover;
+
43  text.text = style->text_active;
+
44  } else {
+
45  background = &style->normal;
+
46  cursor = &style->cursor_normal;
+
47  text.text = style->text_normal;
+
48  }
+
49 
+
50  text.text = nk_rgb_factor(text.text, style->color_factor);
+
51  text.padding.x = 0;
+
52  text.padding.y = 0;
+
53  text.background = style->text_background;
+
54  nk_widget_text(out, *label, string, len, &text, text_alignment, font);
+
55 
+
56  /* draw background and cursor */
+
57  if (background->type == NK_STYLE_ITEM_COLOR) {
+
58  nk_fill_rect(out, *selector, 0, nk_rgb_factor(style->border_color, style->color_factor));
+
59  nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, nk_rgb_factor(background->data.color, style->color_factor));
+
60  } else nk_draw_image(out, *selector, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
61  if (active) {
+
62  if (cursor->type == NK_STYLE_ITEM_IMAGE)
+
63  nk_draw_image(out, *cursors, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
64  else nk_fill_rect(out, *cursors, 0, cursor->data.color);
+
65  }
+
66 }
+
67 NK_LIB void
+
68 nk_draw_option(struct nk_command_buffer *out,
+
69  nk_flags state, const struct nk_style_toggle *style, nk_bool active,
+
70  const struct nk_rect *label, const struct nk_rect *selector,
+
71  const struct nk_rect *cursors, const char *string, int len,
+
72  const struct nk_user_font *font, nk_flags text_alignment)
+
73 {
+
74  const struct nk_style_item *background;
+
75  const struct nk_style_item *cursor;
+
76  struct nk_text text;
+
77 
+
78  /* select correct colors/images */
+
79  if (state & NK_WIDGET_STATE_HOVER) {
+
80  background = &style->hover;
+
81  cursor = &style->cursor_hover;
+
82  text.text = style->text_hover;
+
83  } else if (state & NK_WIDGET_STATE_ACTIVED) {
+
84  background = &style->hover;
+
85  cursor = &style->cursor_hover;
+
86  text.text = style->text_active;
+
87  } else {
+
88  background = &style->normal;
+
89  cursor = &style->cursor_normal;
+
90  text.text = style->text_normal;
+
91  }
+
92 
+
93  text.text = nk_rgb_factor(text.text, style->color_factor);
+
94  text.padding.x = 0;
+
95  text.padding.y = 0;
+
96  text.background = style->text_background;
+
97  nk_widget_text(out, *label, string, len, &text, text_alignment, font);
+
98 
+
99  /* draw background and cursor */
+
100  if (background->type == NK_STYLE_ITEM_COLOR) {
+
101  nk_fill_circle(out, *selector, nk_rgb_factor(style->border_color, style->color_factor));
+
102  nk_fill_circle(out, nk_shrink_rect(*selector, style->border), nk_rgb_factor(background->data.color, style->color_factor));
+
103  } else nk_draw_image(out, *selector, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
104  if (active) {
+
105  if (cursor->type == NK_STYLE_ITEM_IMAGE)
+
106  nk_draw_image(out, *cursors, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor));
+
107  else nk_fill_circle(out, *cursors, cursor->data.color);
+
108  }
+
109 }
+
110 NK_LIB nk_bool
+
111 nk_do_toggle(nk_flags *state,
+
112  struct nk_command_buffer *out, struct nk_rect r,
+
113  nk_bool *active, const char *str, int len, enum nk_toggle_type type,
+
114  const struct nk_style_toggle *style, const struct nk_input *in,
+
115  const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment)
+
116 {
+
117  int was_active;
+
118  struct nk_rect bounds;
+
119  struct nk_rect select;
+
120  struct nk_rect cursor;
+
121  struct nk_rect label;
+
122 
+
123  NK_ASSERT(style);
+
124  NK_ASSERT(out);
+
125  NK_ASSERT(font);
+
126  if (!out || !style || !font || !active)
+
127  return 0;
+
128 
+
129  r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
+
130  r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);
+
131 
+
132  /* add additional touch padding for touch screen devices */
+
133  bounds.x = r.x - style->touch_padding.x;
+
134  bounds.y = r.y - style->touch_padding.y;
+
135  bounds.w = r.w + 2 * style->touch_padding.x;
+
136  bounds.h = r.h + 2 * style->touch_padding.y;
+
137 
+
138  /* calculate the selector space */
+
139  select.w = font->height;
+
140  select.h = select.w;
+
141 
+
142  if (widget_alignment & NK_WIDGET_ALIGN_RIGHT) {
+
143  select.x = r.x + r.w - font->height;
+
144 
+
145  /* label in front of the selector */
+
146  label.x = r.x;
+
147  label.w = r.w - select.w - style->spacing * 2;
+
148  } else if (widget_alignment & NK_WIDGET_ALIGN_CENTERED) {
+
149  select.x = r.x + (r.w - select.w) / 2;
+
150 
+
151  /* label in front of selector */
+
152  label.x = r.x;
+
153  label.w = (r.w - select.w - style->spacing * 2) / 2;
+
154  } else { /* Default: NK_WIDGET_ALIGN_LEFT */
+
155  select.x = r.x;
+
156 
+
157  /* label behind the selector */
+
158  label.x = select.x + select.w + style->spacing;
+
159  label.w = NK_MAX(r.x + r.w, label.x) - label.x;
+
160  }
+
161 
+
162  if (widget_alignment & NK_WIDGET_ALIGN_TOP) {
+
163  select.y = r.y;
+
164  } else if (widget_alignment & NK_WIDGET_ALIGN_BOTTOM) {
+
165  select.y = r.y + r.h - select.h - 2 * style->padding.y;
+
166  } else { /* Default: NK_WIDGET_ALIGN_MIDDLE */
+
167  select.y = r.y + r.h/2.0f - select.h/2.0f;
+
168  }
+
169 
+
170  label.y = select.y;
+
171  label.h = select.w;
+
172 
+
173  /* calculate the bounds of the cursor inside the selector */
+
174  cursor.x = select.x + style->padding.x + style->border;
+
175  cursor.y = select.y + style->padding.y + style->border;
+
176  cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
+
177  cursor.h = select.h - (2 * style->padding.y + 2 * style->border);
+
178 
+
179  /* update selector */
+
180  was_active = *active;
+
181  *active = nk_toggle_behavior(in, bounds, state, *active);
+
182 
+
183  /* draw selector */
+
184  if (style->draw_begin)
+
185  style->draw_begin(out, style->userdata);
+
186  if (type == NK_TOGGLE_CHECK) {
+
187  nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
+
188  } else {
+
189  nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
+
190  }
+
191  if (style->draw_end)
+
192  style->draw_end(out, style->userdata);
+
193  return (was_active != *active);
+
194 }
+
195 /*----------------------------------------------------------------
+
196  *
+
197  * CHECKBOX
+
198  *
+
199  * --------------------------------------------------------------*/
+
200 NK_API nk_bool
+
201 nk_check_text(struct nk_context *ctx, const char *text, int len, nk_bool active)
+
202 {
+
203  struct nk_window *win;
+
204  struct nk_panel *layout;
+
205  const struct nk_input *in;
+
206  const struct nk_style *style;
+
207 
+
208  struct nk_rect bounds;
+
209  enum nk_widget_layout_states state;
+
210 
+
211  NK_ASSERT(ctx);
+
212  NK_ASSERT(ctx->current);
+
213  NK_ASSERT(ctx->current->layout);
+
214  if (!ctx || !ctx->current || !ctx->current->layout)
+
215  return active;
+
216 
+
217  win = ctx->current;
+
218  style = &ctx->style;
+
219  layout = win->layout;
+
220 
+
221  state = nk_widget(&bounds, ctx);
+
222  if (!state) return active;
+
223  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
224  nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
+
225  text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font, NK_WIDGET_LEFT, NK_TEXT_LEFT);
+
226  return active;
+
227 }
+
228 NK_API nk_bool
+
229 nk_check_text_align(struct nk_context *ctx, const char *text, int len, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment)
+
230 {
+
231  struct nk_window *win;
+
232  struct nk_panel *layout;
+
233  const struct nk_input *in;
+
234  const struct nk_style *style;
+
235 
+
236  struct nk_rect bounds;
+
237  enum nk_widget_layout_states state;
+
238 
+
239  NK_ASSERT(ctx);
+
240  NK_ASSERT(ctx->current);
+
241  NK_ASSERT(ctx->current->layout);
+
242  if (!ctx || !ctx->current || !ctx->current->layout)
+
243  return active;
+
244 
+
245  win = ctx->current;
+
246  style = &ctx->style;
+
247  layout = win->layout;
+
248 
+
249  state = nk_widget(&bounds, ctx);
+
250  if (!state) return active;
+
251  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
252  nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
+
253  text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font, widget_alignment, text_alignment);
+
254  return active;
+
255 }
+
256 NK_API unsigned int
+
257 nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
+
258  unsigned int flags, unsigned int value)
+
259 {
+
260  int old_active;
+
261  NK_ASSERT(ctx);
+
262  NK_ASSERT(text);
+
263  if (!ctx || !text) return flags;
+
264  old_active = (int)((flags & value) & value);
+
265  if (nk_check_text(ctx, text, len, old_active))
+
266  flags |= value;
+
267  else flags &= ~value;
+
268  return flags;
+
269 }
+
270 NK_API nk_bool
+
271 nk_checkbox_text(struct nk_context *ctx, const char *text, int len, nk_bool *active)
+
272 {
+
273  int old_val;
+
274  NK_ASSERT(ctx);
+
275  NK_ASSERT(text);
+
276  NK_ASSERT(active);
+
277  if (!ctx || !text || !active) return 0;
+
278  old_val = *active;
+
279  *active = nk_check_text(ctx, text, len, *active);
+
280  return old_val != *active;
+
281 }
+
282 NK_API nk_bool
+
283 nk_checkbox_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
+
284 {
+
285  int old_val;
+
286  NK_ASSERT(ctx);
+
287  NK_ASSERT(text);
+
288  NK_ASSERT(active);
+
289  if (!ctx || !text || !active) return 0;
+
290  old_val = *active;
+
291  *active = nk_check_text_align(ctx, text, len, *active, widget_alignment, text_alignment);
+
292  return old_val != *active;
+
293 }
+
294 NK_API nk_bool
+
295 nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
+
296  unsigned int *flags, unsigned int value)
+
297 {
+
298  nk_bool active;
+
299  NK_ASSERT(ctx);
+
300  NK_ASSERT(text);
+
301  NK_ASSERT(flags);
+
302  if (!ctx || !text || !flags) return 0;
+
303 
+
304  active = (int)((*flags & value) & value);
+
305  if (nk_checkbox_text(ctx, text, len, &active)) {
+
306  if (active) *flags |= value;
+
307  else *flags &= ~value;
+
308  return 1;
+
309  }
+
310  return 0;
+
311 }
+
312 NK_API nk_bool nk_check_label(struct nk_context *ctx, const char *label, nk_bool active)
+
313 {
+
314  return nk_check_text(ctx, label, nk_strlen(label), active);
+
315 }
+
316 NK_API unsigned int nk_check_flags_label(struct nk_context *ctx, const char *label,
+
317  unsigned int flags, unsigned int value)
+
318 {
+
319  return nk_check_flags_text(ctx, label, nk_strlen(label), flags, value);
+
320 }
+
321 NK_API nk_bool nk_checkbox_label(struct nk_context *ctx, const char *label, nk_bool *active)
+
322 {
+
323  return nk_checkbox_text(ctx, label, nk_strlen(label), active);
+
324 }
+
325 NK_API nk_bool nk_checkbox_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
+
326 {
+
327  return nk_checkbox_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment);
+
328 }
+
329 NK_API nk_bool nk_checkbox_flags_label(struct nk_context *ctx, const char *label,
+
330  unsigned int *flags, unsigned int value)
+
331 {
+
332  return nk_checkbox_flags_text(ctx, label, nk_strlen(label), flags, value);
+
333 }
+
334 /*----------------------------------------------------------------
+
335  *
+
336  * OPTION
+
337  *
+
338  * --------------------------------------------------------------*/
+
339 NK_API nk_bool
+
340 nk_option_text(struct nk_context *ctx, const char *text, int len, nk_bool is_active)
+
341 {
+
342  struct nk_window *win;
+
343  struct nk_panel *layout;
+
344  const struct nk_input *in;
+
345  const struct nk_style *style;
+
346 
+
347  struct nk_rect bounds;
+
348  enum nk_widget_layout_states state;
+
349 
+
350  NK_ASSERT(ctx);
+
351  NK_ASSERT(ctx->current);
+
352  NK_ASSERT(ctx->current->layout);
+
353  if (!ctx || !ctx->current || !ctx->current->layout)
+
354  return is_active;
+
355 
+
356  win = ctx->current;
+
357  style = &ctx->style;
+
358  layout = win->layout;
+
359 
+
360  state = nk_widget(&bounds, ctx);
+
361  if (!state) return (int)state;
+
362  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
363  nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
+
364  text, len, NK_TOGGLE_OPTION, &style->option, in, style->font, NK_WIDGET_LEFT, NK_TEXT_LEFT);
+
365  return is_active;
+
366 }
+
367 NK_API nk_bool
+
368 nk_option_text_align(struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment)
+
369 {
+
370  struct nk_window *win;
+
371  struct nk_panel *layout;
+
372  const struct nk_input *in;
+
373  const struct nk_style *style;
+
374 
+
375  struct nk_rect bounds;
+
376  enum nk_widget_layout_states state;
+
377 
+
378  NK_ASSERT(ctx);
+
379  NK_ASSERT(ctx->current);
+
380  NK_ASSERT(ctx->current->layout);
+
381  if (!ctx || !ctx->current || !ctx->current->layout)
+
382  return is_active;
+
383 
+
384  win = ctx->current;
+
385  style = &ctx->style;
+
386  layout = win->layout;
+
387 
+
388  state = nk_widget(&bounds, ctx);
+
389  if (!state) return (int)state;
+
390  in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
391  nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
+
392  text, len, NK_TOGGLE_OPTION, &style->option, in, style->font, widget_alignment, text_alignment);
+
393  return is_active;
+
394 }
+
395 NK_API nk_bool
+
396 nk_radio_text(struct nk_context *ctx, const char *text, int len, nk_bool *active)
+
397 {
+
398  int old_value;
+
399  NK_ASSERT(ctx);
+
400  NK_ASSERT(text);
+
401  NK_ASSERT(active);
+
402  if (!ctx || !text || !active) return 0;
+
403  old_value = *active;
+
404  *active = nk_option_text(ctx, text, len, old_value);
+
405  return old_value != *active;
+
406 }
+
407 NK_API nk_bool
+
408 nk_radio_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
+
409 {
+
410  int old_value;
+
411  NK_ASSERT(ctx);
+
412  NK_ASSERT(text);
+
413  NK_ASSERT(active);
+
414  if (!ctx || !text || !active) return 0;
+
415  old_value = *active;
+
416  *active = nk_option_text_align(ctx, text, len, old_value, widget_alignment, text_alignment);
+
417  return old_value != *active;
+
418 }
+
419 NK_API nk_bool
+
420 nk_option_label(struct nk_context *ctx, const char *label, nk_bool active)
+
421 {
+
422  return nk_option_text(ctx, label, nk_strlen(label), active);
+
423 }
+
424 NK_API nk_bool
+
425 nk_option_label_align(struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment)
+
426 {
+
427  return nk_option_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment);
+
428 }
+
429 NK_API nk_bool
+
430 nk_radio_label(struct nk_context *ctx, const char *label, nk_bool *active)
+
431 {
+
432  return nk_radio_text(ctx, label, nk_strlen(label), active);
+
433 }
+
434 NK_API nk_bool
+
435 nk_radio_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment)
+
436 {
+
437  return nk_radio_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment);
+
438 }
+
439 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
@ NK_WIDGET_STATE_LEFT
!< widget is currently activated
Definition: nuklear.h:3093
+
@ NK_WIDGET_STATE_ACTIVED
!< widget is being hovered
Definition: nuklear.h:3092
+
@ NK_WIDGET_STATE_ENTERED
!< widget is neither active nor hovered
Definition: nuklear.h:3090
+
@ NK_WIDGET_STATE_HOVER
!< widget has been hovered on the current frame
Definition: nuklear.h:3091
+
@ NK_WIDGET_STATE_ACTIVE
!< widget is being hovered
Definition: nuklear.h:3095
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+ + + + + + + + + + +
float height
!< user provided font handle
Definition: nuklear.h:4008
+ +
+
+ + + + diff --git a/nuklear__tooltip_8c_source.html b/nuklear__tooltip_8c_source.html new file mode 100644 index 000000000..5302f5b5f --- /dev/null +++ b/nuklear__tooltip_8c_source.html @@ -0,0 +1,233 @@ + + + + + + + +Nuklear: src/nuklear_tooltip.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_tooltip.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TOOLTIP
+
7  *
+
8  * ===============================================================*/
+
9 NK_API nk_bool
+
10 nk_tooltip_begin(struct nk_context *ctx, float width)
+
11 {
+
12  int x,y,w,h;
+
13  struct nk_window *win;
+
14  const struct nk_input *in;
+
15  struct nk_rect bounds;
+
16  int ret;
+
17 
+
18  NK_ASSERT(ctx);
+
19  NK_ASSERT(ctx->current);
+
20  NK_ASSERT(ctx->current->layout);
+
21  if (!ctx || !ctx->current || !ctx->current->layout)
+
22  return 0;
+
23 
+
24  /* make sure that no nonblocking popup is currently active */
+
25  win = ctx->current;
+
26  in = &ctx->input;
+
27  if (win->popup.win && ((int)win->popup.type & (int)NK_PANEL_SET_NONBLOCK))
+
28  return 0;
+
29 
+
30  w = nk_iceilf(width);
+
31  h = nk_iceilf(nk_null_rect.h);
+
32  x = nk_ifloorf(in->mouse.pos.x + 1) - (int)win->layout->clip.x;
+
33  y = nk_ifloorf(in->mouse.pos.y + 1) - (int)win->layout->clip.y;
+
34 
+
35  bounds.x = (float)x;
+
36  bounds.y = (float)y;
+
37  bounds.w = (float)w;
+
38  bounds.h = (float)h;
+
39 
+
40  ret = nk_popup_begin(ctx, NK_POPUP_DYNAMIC,
+
41  "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds);
+
42  if (ret) win->layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
43  win->popup.type = NK_PANEL_TOOLTIP;
+
44  ctx->current->layout->type = NK_PANEL_TOOLTIP;
+
45  return ret;
+
46 }
+
47 
+
48 NK_API void
+
49 nk_tooltip_end(struct nk_context *ctx)
+
50 {
+
51  NK_ASSERT(ctx);
+
52  NK_ASSERT(ctx->current);
+
53  if (!ctx || !ctx->current) return;
+
54  ctx->current->seq--;
+
55  nk_popup_close(ctx);
+
56  nk_popup_end(ctx);
+
57 }
+
58 NK_API void
+
59 nk_tooltip(struct nk_context *ctx, const char *text)
+
60 {
+
61  const struct nk_style *style;
+
62  struct nk_vec2 padding;
+
63 
+
64  int text_len;
+
65  float text_width;
+
66  float text_height;
+
67 
+
68  NK_ASSERT(ctx);
+
69  NK_ASSERT(ctx->current);
+
70  NK_ASSERT(ctx->current->layout);
+
71  NK_ASSERT(text);
+
72  if (!ctx || !ctx->current || !ctx->current->layout || !text)
+
73  return;
+
74 
+
75  /* fetch configuration data */
+
76  style = &ctx->style;
+
77  padding = style->window.padding;
+
78 
+
79  /* calculate size of the text and tooltip */
+
80  text_len = nk_strlen(text);
+
81  text_width = style->font->width(style->font->userdata,
+
82  style->font->height, text, text_len);
+
83  text_width += (4 * padding.x);
+
84  text_height = (style->font->height + 2 * padding.y);
+
85 
+
86  /* execute tooltip and fill with text */
+
87  if (nk_tooltip_begin(ctx, (float)text_width)) {
+
88  nk_layout_row_dynamic(ctx, (float)text_height, 1);
+
89  nk_text(ctx, text, text_len, NK_TEXT_LEFT);
+
90  nk_tooltip_end(ctx);
+
91  }
+
92 }
+
93 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
94 NK_API void
+
95 nk_tooltipf(struct nk_context *ctx, const char *fmt, ...)
+
96 {
+
97  va_list args;
+
98  va_start(args, fmt);
+
99  nk_tooltipfv(ctx, fmt, args);
+
100  va_end(args);
+
101 }
+
102 NK_API void
+
103 nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
+
104 {
+
105  char buf[256];
+
106  nk_strfmt(buf, NK_LEN(buf), fmt, args);
+
107  nk_tooltip(ctx, buf);
+
108 }
+
109 #endif
+
110 
+
111 
+
main API and documentation file
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+ + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__tree_8c_source.html b/nuklear__tree_8c_source.html new file mode 100644 index 000000000..d6e9073d9 --- /dev/null +++ b/nuklear__tree_8c_source.html @@ -0,0 +1,490 @@ + + + + + + + +Nuklear: src/nuklear_tree.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_tree.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * TREE
+
7  *
+
8  * ===============================================================*/
+
9 NK_INTERN int
+
10 nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type,
+
11  struct nk_image *img, const char *title, enum nk_collapse_states *state)
+
12 {
+
13  struct nk_window *win;
+
14  struct nk_panel *layout;
+
15  const struct nk_style *style;
+
16  struct nk_command_buffer *out;
+
17  const struct nk_input *in;
+
18  const struct nk_style_button *button;
+
19  enum nk_symbol_type symbol;
+
20  float row_height;
+
21 
+
22  struct nk_vec2 item_spacing;
+
23  struct nk_rect header = {0,0,0,0};
+
24  struct nk_rect sym = {0,0,0,0};
+
25  struct nk_text text;
+
26 
+
27  nk_flags ws = 0;
+
28  enum nk_widget_layout_states widget_state;
+
29 
+
30  NK_ASSERT(ctx);
+
31  NK_ASSERT(ctx->current);
+
32  NK_ASSERT(ctx->current->layout);
+
33  if (!ctx || !ctx->current || !ctx->current->layout)
+
34  return 0;
+
35 
+
36  /* cache some data */
+
37  win = ctx->current;
+
38  layout = win->layout;
+
39  out = &win->buffer;
+
40  style = &ctx->style;
+
41  item_spacing = style->window.spacing;
+
42 
+
43  /* calculate header bounds and draw background */
+
44  row_height = style->font->height + 2 * style->tab.padding.y;
+
45  nk_layout_set_min_row_height(ctx, row_height);
+
46  nk_layout_row_dynamic(ctx, row_height, 1);
+ +
48 
+
49  widget_state = nk_widget(&header, ctx);
+
50  if (type == NK_TREE_TAB) {
+
51  const struct nk_style_item *background = &style->tab.background;
+
52 
+
53  switch(background->type) {
+
54  case NK_STYLE_ITEM_IMAGE:
+
55  nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor));
+
56  break;
+
57  case NK_STYLE_ITEM_NINE_SLICE:
+
58  nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor));
+
59  break;
+
60  case NK_STYLE_ITEM_COLOR:
+
61  nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor));
+
62  nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
+
63  style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor));
+
64  break;
+
65  }
+
66  } else text.background = style->window.background;
+
67 
+
68  /* update node state */
+
69  in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
+
70  in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
+
71  if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT))
+
72  *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;
+
73 
+
74  /* select correct button style */
+
75  if (*state == NK_MAXIMIZED) {
+
76  symbol = style->tab.sym_maximize;
+
77  if (type == NK_TREE_TAB)
+
78  button = &style->tab.tab_maximize_button;
+
79  else button = &style->tab.node_maximize_button;
+
80  } else {
+
81  symbol = style->tab.sym_minimize;
+
82  if (type == NK_TREE_TAB)
+
83  button = &style->tab.tab_minimize_button;
+
84  else button = &style->tab.node_minimize_button;
+
85  }
+
86 
+
87  {/* draw triangle button */
+
88  sym.w = sym.h = style->font->height;
+
89  sym.y = header.y + style->tab.padding.y;
+
90  sym.x = header.x + style->tab.padding.x;
+
91  nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT,
+
92  button, 0, style->font);
+
93 
+
94  if (img) {
+
95  /* draw optional image icon */
+
96  sym.x = sym.x + sym.w + 4 * item_spacing.x;
+
97  nk_draw_image(&win->buffer, sym, img, nk_white);
+
98  sym.w = style->font->height + style->tab.spacing.x;}
+
99  }
+
100 
+
101  {/* draw label */
+
102  struct nk_rect label;
+
103  header.w = NK_MAX(header.w, sym.w + item_spacing.x);
+
104  label.x = sym.x + sym.w + item_spacing.x;
+
105  label.y = sym.y;
+
106  label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
+
107  label.h = style->font->height;
+
108  text.text = nk_rgb_factor(style->tab.text, style->tab.color_factor);
+
109  text.padding = nk_vec2(0,0);
+
110  nk_widget_text(out, label, title, nk_strlen(title), &text,
+
111  NK_TEXT_LEFT, style->font);}
+
112 
+
113  /* increase x-axis cursor widget position pointer */
+
114  if (*state == NK_MAXIMIZED) {
+
115  layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
+
116  layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
+
117  layout->bounds.w -= (style->tab.indent + style->window.padding.x);
+
118  layout->row.tree_depth++;
+
119  return nk_true;
+
120  } else return nk_false;
+
121 }
+
122 NK_INTERN int
+
123 nk_tree_base(struct nk_context *ctx, enum nk_tree_type type,
+
124  struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
+
125  const char *hash, int len, int line)
+
126 {
+
127  struct nk_window *win = ctx->current;
+
128  int title_len = 0;
+
129  nk_hash tree_hash = 0;
+
130  nk_uint *state = 0;
+
131 
+
132  /* retrieve tree state from internal widget state tables */
+
133  if (!hash) {
+
134  title_len = (int)nk_strlen(title);
+
135  tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
+
136  } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
+
137  state = nk_find_value(win, tree_hash);
+
138  if (!state) {
+
139  state = nk_add_value(ctx, win, tree_hash, 0);
+
140  *state = initial_state;
+
141  }
+
142  return nk_tree_state_base(ctx, type, img, title, (enum nk_collapse_states*)state);
+
143 }
+
144 NK_API nk_bool
+
145 nk_tree_state_push(struct nk_context *ctx, enum nk_tree_type type,
+
146  const char *title, enum nk_collapse_states *state)
+
147 {
+
148  return nk_tree_state_base(ctx, type, 0, title, state);
+
149 }
+
150 NK_API nk_bool
+
151 nk_tree_state_image_push(struct nk_context *ctx, enum nk_tree_type type,
+
152  struct nk_image img, const char *title, enum nk_collapse_states *state)
+
153 {
+
154  return nk_tree_state_base(ctx, type, &img, title, state);
+
155 }
+
156 NK_API void
+ +
158 {
+
159  struct nk_window *win = 0;
+
160  struct nk_panel *layout = 0;
+
161 
+
162  NK_ASSERT(ctx);
+
163  NK_ASSERT(ctx->current);
+
164  NK_ASSERT(ctx->current->layout);
+
165  if (!ctx || !ctx->current || !ctx->current->layout)
+
166  return;
+
167 
+
168  win = ctx->current;
+
169  layout = win->layout;
+
170  layout->at_x -= ctx->style.tab.indent + (float)*layout->offset_x;
+
171  layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
+
172  NK_ASSERT(layout->row.tree_depth);
+
173  layout->row.tree_depth--;
+
174 }
+
175 NK_API nk_bool
+
176 nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+
177  const char *title, enum nk_collapse_states initial_state,
+
178  const char *hash, int len, int line)
+
179 {
+
180  return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line);
+
181 }
+
182 NK_API nk_bool
+
183 nk_tree_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+
184  struct nk_image img, const char *title, enum nk_collapse_states initial_state,
+
185  const char *hash, int len,int seed)
+
186 {
+
187  return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed);
+
188 }
+
189 NK_API void
+ +
191 {
+
192  nk_tree_state_pop(ctx);
+
193 }
+
194 NK_INTERN int
+
195 nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type type,
+
196  struct nk_image *img, const char *title, int title_len,
+
197  enum nk_collapse_states *state, nk_bool *selected)
+
198 {
+
199  struct nk_window *win;
+
200  struct nk_panel *layout;
+
201  const struct nk_style *style;
+
202  struct nk_command_buffer *out;
+
203  const struct nk_input *in;
+
204  const struct nk_style_button *button;
+
205  enum nk_symbol_type symbol;
+
206  float row_height;
+
207  struct nk_vec2 padding;
+
208 
+
209  int text_len;
+
210  float text_width;
+
211 
+
212  struct nk_vec2 item_spacing;
+
213  struct nk_rect header = {0,0,0,0};
+
214  struct nk_rect sym = {0,0,0,0};
+
215 
+
216  nk_flags ws = 0;
+
217  enum nk_widget_layout_states widget_state;
+
218 
+
219  NK_ASSERT(ctx);
+
220  NK_ASSERT(ctx->current);
+
221  NK_ASSERT(ctx->current->layout);
+
222  if (!ctx || !ctx->current || !ctx->current->layout)
+
223  return 0;
+
224 
+
225  /* cache some data */
+
226  win = ctx->current;
+
227  layout = win->layout;
+
228  out = &win->buffer;
+
229  style = &ctx->style;
+
230  item_spacing = style->window.spacing;
+
231  padding = style->selectable.padding;
+
232 
+
233  /* calculate header bounds and draw background */
+
234  row_height = style->font->height + 2 * style->tab.padding.y;
+
235  nk_layout_set_min_row_height(ctx, row_height);
+
236  nk_layout_row_dynamic(ctx, row_height, 1);
+ +
238 
+
239  widget_state = nk_widget(&header, ctx);
+
240  if (type == NK_TREE_TAB) {
+
241  const struct nk_style_item *background = &style->tab.background;
+
242 
+
243  switch (background->type) {
+
244  case NK_STYLE_ITEM_IMAGE:
+
245  nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor));
+
246  break;
+
247  case NK_STYLE_ITEM_NINE_SLICE:
+
248  nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor));
+
249  break;
+
250  case NK_STYLE_ITEM_COLOR:
+
251  nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor));
+
252  nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
+
253  style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor));
+
254 
+
255  break;
+
256  }
+
257  }
+
258 
+
259  in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
+
260  in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
+
261 
+
262  /* select correct button style */
+
263  if (*state == NK_MAXIMIZED) {
+
264  symbol = style->tab.sym_maximize;
+
265  if (type == NK_TREE_TAB)
+
266  button = &style->tab.tab_maximize_button;
+
267  else button = &style->tab.node_maximize_button;
+
268  } else {
+
269  symbol = style->tab.sym_minimize;
+
270  if (type == NK_TREE_TAB)
+
271  button = &style->tab.tab_minimize_button;
+
272  else button = &style->tab.node_minimize_button;
+
273  }
+
274  {/* draw triangle button */
+
275  sym.w = sym.h = style->font->height;
+
276  sym.y = header.y + style->tab.padding.y;
+
277  sym.x = header.x + style->tab.padding.x;
+
278  if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font))
+
279  *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;}
+
280 
+
281  /* draw label */
+
282  {nk_flags dummy = 0;
+
283  struct nk_rect label;
+
284  /* calculate size of the text and tooltip */
+
285  text_len = nk_strlen(title);
+
286  text_width = style->font->width(style->font->userdata, style->font->height, title, text_len);
+
287  text_width += (4 * padding.x);
+
288 
+
289  header.w = NK_MAX(header.w, sym.w + item_spacing.x);
+
290  label.x = sym.x + sym.w + item_spacing.x;
+
291  label.y = sym.y;
+
292  label.w = NK_MIN(header.w - (sym.w + item_spacing.y + style->tab.indent), text_width);
+
293  label.h = style->font->height;
+
294 
+
295  if (img) {
+
296  nk_do_selectable_image(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT,
+
297  selected, img, &style->selectable, in, style->font);
+
298  } else nk_do_selectable(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT,
+
299  selected, &style->selectable, in, style->font);
+
300  }
+
301  /* increase x-axis cursor widget position pointer */
+
302  if (*state == NK_MAXIMIZED) {
+
303  layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
+
304  layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
+
305  layout->bounds.w -= (style->tab.indent + style->window.padding.x);
+
306  layout->row.tree_depth++;
+
307  return nk_true;
+
308  } else return nk_false;
+
309 }
+
310 NK_INTERN int
+
311 nk_tree_element_base(struct nk_context *ctx, enum nk_tree_type type,
+
312  struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
+
313  nk_bool *selected, const char *hash, int len, int line)
+
314 {
+
315  struct nk_window *win = ctx->current;
+
316  int title_len = 0;
+
317  nk_hash tree_hash = 0;
+
318  nk_uint *state = 0;
+
319 
+
320  /* retrieve tree state from internal widget state tables */
+
321  if (!hash) {
+
322  title_len = (int)nk_strlen(title);
+
323  tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
+
324  } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
+
325  state = nk_find_value(win, tree_hash);
+
326  if (!state) {
+
327  state = nk_add_value(ctx, win, tree_hash, 0);
+
328  *state = initial_state;
+
329  } return nk_tree_element_image_push_hashed_base(ctx, type, img, title,
+
330  nk_strlen(title), (enum nk_collapse_states*)state, selected);
+
331 }
+
332 NK_API nk_bool
+
333 nk_tree_element_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+
334  const char *title, enum nk_collapse_states initial_state,
+
335  nk_bool *selected, const char *hash, int len, int seed)
+
336 {
+
337  return nk_tree_element_base(ctx, type, 0, title, initial_state, selected, hash, len, seed);
+
338 }
+
339 NK_API nk_bool
+
340 nk_tree_element_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+
341  struct nk_image img, const char *title, enum nk_collapse_states initial_state,
+
342  nk_bool *selected, const char *hash, int len,int seed)
+
343 {
+
344  return nk_tree_element_base(ctx, type, &img, title, initial_state, selected, hash, len, seed);
+
345 }
+
346 NK_API void
+
347 nk_tree_element_pop(struct nk_context *ctx)
+
348 {
+
349  nk_tree_state_pop(ctx);
+
350 }
+
351 
+
main API and documentation file
+
NK_API void nk_tree_pop(struct nk_context *)
Definition: nuklear_tree.c:190
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API void nk_draw_image(struct nk_command_buffer *, struct nk_rect, const struct nk_image *, struct nk_color)
misc
Definition: nuklear_draw.c:395
+
NK_API nk_bool nk_tree_image_push_hashed(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:183
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API nk_bool nk_tree_state_image_push(struct nk_context *, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:151
+
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
Sets current row layout to share horizontal space between @cols number of widgets evenly.
+
NK_API void nk_layout_reset_min_row_height(struct nk_context *)
Reset the currently used minimum row height back to font_height + text_padding + padding
+
NK_API nk_bool nk_tree_state_push(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states *state)
Definition: nuklear_tree.c:145
+
NK_API nk_bool nk_tree_push_hashed(struct nk_context *, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len, int seed)
Definition: nuklear_tree.c:176
+
NK_API void nk_layout_set_min_row_height(struct nk_context *, float height)
Sets the currently used minimum row height.
+
NK_API void nk_tree_state_pop(struct nk_context *)
Definition: nuklear_tree.c:157
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_VALID
The widget is completely inside the window and can be updated and drawn.
Definition: nuklear.h:3083
+ + + + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + +
+
+ + + + diff --git a/nuklear__utf8_8c_source.html b/nuklear__utf8_8c_source.html new file mode 100644 index 000000000..cfa47ecdf --- /dev/null +++ b/nuklear__utf8_8c_source.html @@ -0,0 +1,257 @@ + + + + + + + +Nuklear: src/nuklear_utf8.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_utf8.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * UTF-8
+
7  *
+
8  * ===============================================================*/
+
9 NK_GLOBAL const nk_byte nk_utfbyte[NK_UTF_SIZE+1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
+
10 NK_GLOBAL const nk_byte nk_utfmask[NK_UTF_SIZE+1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
+
11 NK_GLOBAL const nk_uint nk_utfmin[NK_UTF_SIZE+1] = {0, 0, 0x80, 0x800, 0x10000};
+
12 NK_GLOBAL const nk_uint nk_utfmax[NK_UTF_SIZE+1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
+
13 
+
14 NK_INTERN int
+
15 nk_utf_validate(nk_rune *u, int i)
+
16 {
+
17  NK_ASSERT(u);
+
18  if (!u) return 0;
+
19  if (!NK_BETWEEN(*u, nk_utfmin[i], nk_utfmax[i]) ||
+
20  NK_BETWEEN(*u, 0xD800, 0xDFFF))
+
21  *u = NK_UTF_INVALID;
+
22  for (i = 1; *u > nk_utfmax[i]; ++i);
+
23  return i;
+
24 }
+
25 NK_INTERN nk_rune
+
26 nk_utf_decode_byte(char c, int *i)
+
27 {
+
28  NK_ASSERT(i);
+
29  if (!i) return 0;
+
30  for(*i = 0; *i < (int)NK_LEN(nk_utfmask); ++(*i)) {
+
31  if (((nk_byte)c & nk_utfmask[*i]) == nk_utfbyte[*i])
+
32  return (nk_byte)(c & ~nk_utfmask[*i]);
+
33  }
+
34  return 0;
+
35 }
+
36 NK_API int
+
37 nk_utf_decode(const char *c, nk_rune *u, int clen)
+
38 {
+
39  int i, j, len, type=0;
+
40  nk_rune udecoded;
+
41 
+
42  NK_ASSERT(c);
+
43  NK_ASSERT(u);
+
44 
+
45  if (!c || !u) return 0;
+
46  if (!clen) return 0;
+
47  *u = NK_UTF_INVALID;
+
48 
+
49  udecoded = nk_utf_decode_byte(c[0], &len);
+
50  if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
+
51  return 1;
+
52 
+
53  for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
+
54  udecoded = (udecoded << 6) | nk_utf_decode_byte(c[i], &type);
+
55  if (type != 0)
+
56  return j;
+
57  }
+
58  if (j < len)
+
59  return 0;
+
60  *u = udecoded;
+
61  nk_utf_validate(u, len);
+
62  return len;
+
63 }
+
64 NK_INTERN char
+
65 nk_utf_encode_byte(nk_rune u, int i)
+
66 {
+
67  return (char)((nk_utfbyte[i]) | ((nk_byte)u & ~nk_utfmask[i]));
+
68 }
+
69 NK_API int
+
70 nk_utf_encode(nk_rune u, char *c, int clen)
+
71 {
+
72  int len, i;
+
73  len = nk_utf_validate(&u, 0);
+
74  if (clen < len || !len || len > NK_UTF_SIZE)
+
75  return 0;
+
76 
+
77  for (i = len - 1; i != 0; --i) {
+
78  c[i] = nk_utf_encode_byte(u, 0);
+
79  u >>= 6;
+
80  }
+
81  c[0] = nk_utf_encode_byte(u, len);
+
82  return len;
+
83 }
+
84 NK_API int
+
85 nk_utf_len(const char *str, int len)
+
86 {
+
87  const char *text;
+
88  int glyphs = 0;
+
89  int text_len;
+
90  int glyph_len;
+
91  int src_len = 0;
+
92  nk_rune unicode;
+
93 
+
94  NK_ASSERT(str);
+
95  if (!str || !len) return 0;
+
96 
+
97  text = str;
+
98  text_len = len;
+
99  glyph_len = nk_utf_decode(text, &unicode, text_len);
+
100  while (glyph_len && src_len < len) {
+
101  glyphs++;
+
102  src_len = src_len + glyph_len;
+
103  glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
+
104  }
+
105  return glyphs;
+
106 }
+
107 NK_API const char*
+
108 nk_utf_at(const char *buffer, int length, int index,
+
109  nk_rune *unicode, int *len)
+
110 {
+
111  int i = 0;
+
112  int src_len = 0;
+
113  int glyph_len = 0;
+
114  const char *text;
+
115  int text_len;
+
116 
+
117  NK_ASSERT(buffer);
+
118  NK_ASSERT(unicode);
+
119  NK_ASSERT(len);
+
120 
+
121  if (!buffer || !unicode || !len) return 0;
+
122  if (index < 0) {
+
123  *unicode = NK_UTF_INVALID;
+
124  *len = 0;
+
125  return 0;
+
126  }
+
127 
+
128  text = buffer;
+
129  text_len = length;
+
130  glyph_len = nk_utf_decode(text, unicode, text_len);
+
131  while (glyph_len) {
+
132  if (i == index) {
+
133  *len = glyph_len;
+
134  break;
+
135  }
+
136 
+
137  i++;
+
138  src_len = src_len + glyph_len;
+
139  glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
+
140  }
+
141  if (i != index) return 0;
+
142  return buffer + src_len;
+
143 }
+
144 
+
main API and documentation file
+
#define NK_UTF_INVALID
internal invalid utf8 rune
Definition: nuklear.h:5750
+
#define NK_UTF_SIZE
describes the number of bytes a glyph consists of
Definition: nuklear.h:22
+
+
+ + + + diff --git a/nuklear__util_8c_source.html b/nuklear__util_8c_source.html new file mode 100644 index 000000000..424ae995d --- /dev/null +++ b/nuklear__util_8c_source.html @@ -0,0 +1,1244 @@ + + + + + + + +Nuklear: src/nuklear_util.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_util.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * UTIL
+
7  *
+
8  * ===============================================================*/
+
9 NK_INTERN int nk_str_match_here(const char *regexp, const char *text);
+
10 NK_INTERN int nk_str_match_star(int c, const char *regexp, const char *text);
+
11 NK_LIB nk_bool nk_is_lower(int c) {return (c >= 'a' && c <= 'z') || (c >= 0xE0 && c <= 0xFF);}
+
12 NK_LIB nk_bool nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <= 0xDF);}
+
13 NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
+
14 NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
+
15 
+
16 #ifndef NK_MEMCPY
+
17 #define NK_MEMCPY nk_memcopy
+
18 NK_LIB void*
+
19 nk_memcopy(void *dst0, const void *src0, nk_size length)
+
20 {
+
21  nk_ptr t;
+
22  char *dst = (char*)dst0;
+
23  const char *src = (const char*)src0;
+
24  if (length == 0 || dst == src)
+
25  goto done;
+
26 
+
27  #define nk_word int
+
28  #define nk_wsize sizeof(nk_word)
+
29  #define nk_wmask (nk_wsize-1)
+
30  #define NK_TLOOP(s) if (t) NK_TLOOP1(s)
+
31  #define NK_TLOOP1(s) do { s; } while (--t)
+
32 
+
33  if (dst < src) {
+
34  t = (nk_ptr)src; /* only need low bits */
+
35  if ((t | (nk_ptr)dst) & nk_wmask) {
+
36  if ((t ^ (nk_ptr)dst) & nk_wmask || length < nk_wsize)
+
37  t = length;
+
38  else
+
39  t = nk_wsize - (t & nk_wmask);
+
40  length -= t;
+
41  NK_TLOOP1(*dst++ = *src++);
+
42  }
+
43  t = length / nk_wsize;
+
44  NK_TLOOP(*(nk_word*)(void*)dst = *(const nk_word*)(const void*)src;
+
45  src += nk_wsize; dst += nk_wsize);
+
46  t = length & nk_wmask;
+
47  NK_TLOOP(*dst++ = *src++);
+
48  } else {
+
49  src += length;
+
50  dst += length;
+
51  t = (nk_ptr)src;
+
52  if ((t | (nk_ptr)dst) & nk_wmask) {
+
53  if ((t ^ (nk_ptr)dst) & nk_wmask || length <= nk_wsize)
+
54  t = length;
+
55  else
+
56  t &= nk_wmask;
+
57  length -= t;
+
58  NK_TLOOP1(*--dst = *--src);
+
59  }
+
60  t = length / nk_wsize;
+
61  NK_TLOOP(src -= nk_wsize; dst -= nk_wsize;
+
62  *(nk_word*)(void*)dst = *(const nk_word*)(const void*)src);
+
63  t = length & nk_wmask;
+
64  NK_TLOOP(*--dst = *--src);
+
65  }
+
66  #undef nk_word
+
67  #undef nk_wsize
+
68  #undef nk_wmask
+
69  #undef NK_TLOOP
+
70  #undef NK_TLOOP1
+
71 done:
+
72  return (dst0);
+
73 }
+
74 #endif
+
75 #ifndef NK_MEMSET
+
76 #define NK_MEMSET nk_memset
+
77 NK_LIB void
+
78 nk_memset(void *ptr, int c0, nk_size size)
+
79 {
+
80  #define nk_word unsigned
+
81  #define nk_wsize sizeof(nk_word)
+
82  #define nk_wmask (nk_wsize - 1)
+
83  nk_byte *dst = (nk_byte*)ptr;
+
84  unsigned c = 0;
+
85  nk_size t = 0;
+
86 
+
87  if ((c = (nk_byte)c0) != 0) {
+
88  c = (c << 8) | c; /* at least 16-bits */
+
89  if (sizeof(unsigned int) > 2)
+
90  c = (c << 16) | c; /* at least 32-bits*/
+
91  }
+
92 
+
93  /* too small of a word count */
+
94  dst = (nk_byte*)ptr;
+
95  if (size < 3 * nk_wsize) {
+
96  while (size--) *dst++ = (nk_byte)c0;
+
97  return;
+
98  }
+
99 
+
100  /* align destination */
+
101  if ((t = NK_PTR_TO_UINT(dst) & nk_wmask) != 0) {
+
102  t = nk_wsize -t;
+
103  size -= t;
+
104  do {
+
105  *dst++ = (nk_byte)c0;
+
106  } while (--t != 0);
+
107  }
+
108 
+
109  /* fill word */
+
110  t = size / nk_wsize;
+
111  do {
+
112  *(nk_word*)((void*)dst) = c;
+
113  dst += nk_wsize;
+
114  } while (--t != 0);
+
115 
+
116  /* fill trailing bytes */
+
117  t = (size & nk_wmask);
+
118  if (t != 0) {
+
119  do {
+
120  *dst++ = (nk_byte)c0;
+
121  } while (--t != 0);
+
122  }
+
123 
+
124  #undef nk_word
+
125  #undef nk_wsize
+
126  #undef nk_wmask
+
127 }
+
128 #endif
+
129 NK_LIB void
+
130 nk_zero(void *ptr, nk_size size)
+
131 {
+
132  NK_ASSERT(ptr);
+
133  NK_MEMSET(ptr, 0, size);
+
134 }
+
135 NK_API int
+
136 nk_strlen(const char *str)
+
137 {
+
138  int siz = 0;
+
139  NK_ASSERT(str);
+
140  while (str && *str++ != '\0') siz++;
+
141  return siz;
+
142 }
+
143 NK_API int
+
144 nk_strtoi(const char *str, char **endptr)
+
145 {
+
146  int neg = 1;
+
147  const char *p = str;
+
148  int value = 0;
+
149 
+
150  NK_ASSERT(str);
+
151  if (!str) return 0;
+
152 
+
153  /* skip whitespace */
+
154  while (*p == ' ') p++;
+
155  if (*p == '-') {
+
156  neg = -1;
+
157  p++;
+
158  }
+
159  while (*p && *p >= '0' && *p <= '9') {
+
160  value = value * 10 + (int) (*p - '0');
+
161  p++;
+
162  }
+
163  if (endptr)
+
164  *endptr = (char *)p;
+
165  return neg*value;
+
166 }
+
167 NK_API double
+
168 nk_strtod(const char *str, char **endptr)
+
169 {
+
170  double m;
+
171  double neg = 1.0;
+
172  char *p = (char *)str;
+
173  double value = 0;
+
174  double number = 0;
+
175 
+
176  NK_ASSERT(str);
+
177  if (!str) return 0;
+
178 
+
179  /* skip whitespace */
+
180  while (*p == ' ') p++;
+
181  if (*p == '-') {
+
182  neg = -1.0;
+
183  p++;
+
184  }
+
185 
+
186  while (*p && *p != '.' && *p != 'e') {
+
187  value = value * 10.0 + (double) (*p - '0');
+
188  p++;
+
189  }
+
190 
+
191  if (*p == '.') {
+
192  p++;
+
193  for(m = 0.1; *p && *p != 'e'; p++ ) {
+
194  value = value + (double) (*p - '0') * m;
+
195  m *= 0.1;
+
196  }
+
197  }
+
198  if (*p == 'e') {
+
199  int i, pow, div;
+
200  p++;
+
201  if (*p == '-') {
+
202  div = nk_true;
+
203  p++;
+
204  } else if (*p == '+') {
+
205  div = nk_false;
+
206  p++;
+
207  } else div = nk_false;
+
208 
+
209  for (pow = 0; *p; p++)
+
210  pow = pow * 10 + (int) (*p - '0');
+
211 
+
212  for (m = 1.0, i = 0; i < pow; i++)
+
213  m *= 10.0;
+
214 
+
215  if (div)
+
216  value /= m;
+
217  else value *= m;
+
218  }
+
219  number = value * neg;
+
220  if (endptr)
+
221  *endptr = p;
+
222  return number;
+
223 }
+
224 NK_API float
+
225 nk_strtof(const char *str, char **endptr)
+
226 {
+
227  float float_value;
+
228  double double_value;
+
229  double_value = NK_STRTOD(str, endptr);
+
230  float_value = (float)double_value;
+
231  return float_value;
+
232 }
+
233 NK_API int
+
234 nk_stricmp(const char *s1, const char *s2)
+
235 {
+
236  nk_int c1,c2,d;
+
237  do {
+
238  c1 = *s1++;
+
239  c2 = *s2++;
+
240  d = c1 - c2;
+
241  while (d) {
+
242  if (c1 <= 'Z' && c1 >= 'A') {
+
243  d += ('a' - 'A');
+
244  if (!d) break;
+
245  }
+
246  if (c2 <= 'Z' && c2 >= 'A') {
+
247  d -= ('a' - 'A');
+
248  if (!d) break;
+
249  }
+
250  return ((d >= 0) << 1) - 1;
+
251  }
+
252  } while (c1);
+
253  return 0;
+
254 }
+
255 NK_API int
+
256 nk_stricmpn(const char *s1, const char *s2, int n)
+
257 {
+
258  int c1,c2,d;
+
259  NK_ASSERT(n >= 0);
+
260  do {
+
261  c1 = *s1++;
+
262  c2 = *s2++;
+
263  if (!n--) return 0;
+
264 
+
265  d = c1 - c2;
+
266  while (d) {
+
267  if (c1 <= 'Z' && c1 >= 'A') {
+
268  d += ('a' - 'A');
+
269  if (!d) break;
+
270  }
+
271  if (c2 <= 'Z' && c2 >= 'A') {
+
272  d -= ('a' - 'A');
+
273  if (!d) break;
+
274  }
+
275  return ((d >= 0) << 1) - 1;
+
276  }
+
277  } while (c1);
+
278  return 0;
+
279 }
+
280 NK_INTERN int
+
281 nk_str_match_here(const char *regexp, const char *text)
+
282 {
+
283  if (regexp[0] == '\0')
+
284  return 1;
+
285  if (regexp[1] == '*')
+
286  return nk_str_match_star(regexp[0], regexp+2, text);
+
287  if (regexp[0] == '$' && regexp[1] == '\0')
+
288  return *text == '\0';
+
289  if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text))
+
290  return nk_str_match_here(regexp+1, text+1);
+
291  return 0;
+
292 }
+
293 NK_INTERN int
+
294 nk_str_match_star(int c, const char *regexp, const char *text)
+
295 {
+
296  do {/* a '* matches zero or more instances */
+
297  if (nk_str_match_here(regexp, text))
+
298  return 1;
+
299  } while (*text != '\0' && (*text++ == c || c == '.'));
+
300  return 0;
+
301 }
+
302 NK_API int
+
303 nk_strfilter(const char *text, const char *regexp)
+
304 {
+
305  /*
+
306  c matches any literal character c
+
307  . matches any single character
+
308  ^ matches the beginning of the input string
+
309  $ matches the end of the input string
+
310  * matches zero or more occurrences of the previous character*/
+
311  if (regexp[0] == '^')
+
312  return nk_str_match_here(regexp+1, text);
+
313  do { /* must look even if string is empty */
+
314  if (nk_str_match_here(regexp, text))
+
315  return 1;
+
316  } while (*text++ != '\0');
+
317  return 0;
+
318 }
+
319 NK_API int
+
320 nk_strmatch_fuzzy_text(const char *str, int str_len,
+
321  const char *pattern, int *out_score)
+
322 {
+
323  /* Returns true if each character in pattern is found sequentially within str
+
324  * if found then out_score is also set. Score value has no intrinsic meaning.
+
325  * Range varies with pattern. Can only compare scores with same search pattern. */
+
326 
+
327  /* bonus for adjacent matches */
+
328  #define NK_ADJACENCY_BONUS 5
+
329  /* bonus if match occurs after a separator */
+
330  #define NK_SEPARATOR_BONUS 10
+
331  /* bonus if match is uppercase and prev is lower */
+
332  #define NK_CAMEL_BONUS 10
+
333  /* penalty applied for every letter in str before the first match */
+
334  #define NK_LEADING_LETTER_PENALTY (-3)
+
335  /* maximum penalty for leading letters */
+
336  #define NK_MAX_LEADING_LETTER_PENALTY (-9)
+
337  /* penalty for every letter that doesn't matter */
+
338  #define NK_UNMATCHED_LETTER_PENALTY (-1)
+
339 
+
340  /* loop variables */
+
341  int score = 0;
+
342  char const * pattern_iter = pattern;
+
343  int str_iter = 0;
+
344  int prev_matched = nk_false;
+
345  int prev_lower = nk_false;
+
346  /* true so if first letter match gets separator bonus*/
+
347  int prev_separator = nk_true;
+
348 
+
349  /* use "best" matched letter if multiple string letters match the pattern */
+
350  char const * best_letter = 0;
+
351  int best_letter_score = 0;
+
352 
+
353  /* loop over strings */
+
354  NK_ASSERT(str);
+
355  NK_ASSERT(pattern);
+
356  if (!str || !str_len || !pattern) return 0;
+
357  while (str_iter < str_len)
+
358  {
+
359  const char pattern_letter = *pattern_iter;
+
360  const char str_letter = str[str_iter];
+
361 
+
362  int next_match = *pattern_iter != '\0' &&
+
363  nk_to_lower(pattern_letter) == nk_to_lower(str_letter);
+
364  int rematch = best_letter && nk_to_upper(*best_letter) == nk_to_upper(str_letter);
+
365 
+
366  int advanced = next_match && best_letter;
+
367  int pattern_repeat = best_letter && *pattern_iter != '\0';
+
368  pattern_repeat = pattern_repeat &&
+
369  nk_to_lower(*best_letter) == nk_to_lower(pattern_letter);
+
370 
+
371  if (advanced || pattern_repeat) {
+
372  score += best_letter_score;
+
373  best_letter = 0;
+
374  best_letter_score = 0;
+
375  }
+
376 
+
377  if (next_match || rematch)
+
378  {
+
379  int new_score = 0;
+
380  /* Apply penalty for each letter before the first pattern match */
+
381  if (pattern_iter == pattern) {
+
382  int count = (int)(&str[str_iter] - str);
+
383  int penalty = NK_LEADING_LETTER_PENALTY * count;
+
384  if (penalty < NK_MAX_LEADING_LETTER_PENALTY)
+
385  penalty = NK_MAX_LEADING_LETTER_PENALTY;
+
386 
+
387  score += penalty;
+
388  }
+
389 
+
390  /* apply bonus for consecutive bonuses */
+
391  if (prev_matched)
+
392  new_score += NK_ADJACENCY_BONUS;
+
393 
+
394  /* apply bonus for matches after a separator */
+
395  if (prev_separator)
+
396  new_score += NK_SEPARATOR_BONUS;
+
397 
+
398  /* apply bonus across camel case boundaries */
+
399  if (prev_lower && nk_is_upper(str_letter))
+
400  new_score += NK_CAMEL_BONUS;
+
401 
+
402  /* update pattern iter IFF the next pattern letter was matched */
+
403  if (next_match)
+
404  ++pattern_iter;
+
405 
+
406  /* update best letter in str which may be for a "next" letter or a rematch */
+
407  if (new_score >= best_letter_score) {
+
408  /* apply penalty for now skipped letter */
+
409  if (best_letter != 0)
+
410  score += NK_UNMATCHED_LETTER_PENALTY;
+
411 
+
412  best_letter = &str[str_iter];
+
413  best_letter_score = new_score;
+
414  }
+
415  prev_matched = nk_true;
+
416  } else {
+
417  score += NK_UNMATCHED_LETTER_PENALTY;
+
418  prev_matched = nk_false;
+
419  }
+
420 
+
421  /* separators should be more easily defined */
+
422  prev_lower = nk_is_lower(str_letter) != 0;
+
423  prev_separator = str_letter == '_' || str_letter == ' ';
+
424 
+
425  ++str_iter;
+
426  }
+
427 
+
428  /* apply score for last match */
+
429  if (best_letter)
+
430  score += best_letter_score;
+
431 
+
432  /* did not match full pattern */
+
433  if (*pattern_iter != '\0')
+
434  return nk_false;
+
435 
+
436  if (out_score)
+
437  *out_score = score;
+
438  return nk_true;
+
439 }
+
440 NK_API int
+
441 nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score)
+
442 {
+
443  return nk_strmatch_fuzzy_text(str, nk_strlen(str), pattern, out_score);
+
444 }
+
445 NK_LIB int
+
446 nk_string_float_limit(char *string, int prec)
+
447 {
+
448  int dot = 0;
+
449  char *c = string;
+
450  while (*c) {
+
451  if (*c == '.') {
+
452  dot = 1;
+
453  c++;
+
454  continue;
+
455  }
+
456  if (dot == (prec+1)) {
+
457  *c = 0;
+
458  break;
+
459  }
+
460  if (dot > 0) dot++;
+
461  c++;
+
462  }
+
463  return (int)(c - string);
+
464 }
+
465 NK_INTERN void
+
466 nk_strrev_ascii(char *s)
+
467 {
+
468  int len = nk_strlen(s);
+
469  int end = len / 2;
+
470  int i = 0;
+
471  char t;
+
472  for (; i < end; ++i) {
+
473  t = s[i];
+
474  s[i] = s[len - 1 - i];
+
475  s[len -1 - i] = t;
+
476  }
+
477 }
+
478 NK_LIB char*
+
479 nk_itoa(char *s, long n)
+
480 {
+
481  long i = 0;
+
482  if (n == 0) {
+
483  s[i++] = '0';
+
484  s[i] = 0;
+
485  return s;
+
486  }
+
487  if (n < 0) {
+
488  s[i++] = '-';
+
489  n = -n;
+
490  }
+
491  while (n > 0) {
+
492  s[i++] = (char)('0' + (n % 10));
+
493  n /= 10;
+
494  }
+
495  s[i] = 0;
+
496  if (s[0] == '-')
+
497  ++s;
+
498 
+
499  nk_strrev_ascii(s);
+
500  return s;
+
501 }
+
502 #ifndef NK_DTOA
+
503 #define NK_DTOA nk_dtoa
+
504 NK_LIB char*
+
505 nk_dtoa(char *s, double n)
+
506 {
+
507  int useExp = 0;
+
508  int digit = 0, m = 0, m1 = 0;
+
509  char *c = s;
+
510  int neg = 0;
+
511 
+
512  NK_ASSERT(s);
+
513  if (!s) return 0;
+
514 
+
515  if (n == 0.0) {
+
516  s[0] = '0'; s[1] = '\0';
+
517  return s;
+
518  }
+
519 
+
520  neg = (n < 0);
+
521  if (neg) n = -n;
+
522 
+
523  /* calculate magnitude */
+
524  m = nk_log10(n);
+
525  useExp = (m >= 14 || (neg && m >= 9) || m <= -9);
+
526  if (neg) *(c++) = '-';
+
527 
+
528  /* set up for scientific notation */
+
529  if (useExp) {
+
530  if (m < 0)
+
531  m -= 1;
+
532  n = n / (double)nk_pow(10.0, m);
+
533  m1 = m;
+
534  m = 0;
+
535  }
+
536  if (m < 1.0) {
+
537  m = 0;
+
538  }
+
539 
+
540  /* convert the number */
+
541  while (n > NK_FLOAT_PRECISION || m >= 0) {
+
542  double weight = nk_pow(10.0, m);
+
543  if (weight > 0) {
+
544  double t = (double)n / weight;
+
545  digit = nk_ifloord(t);
+
546  n -= ((double)digit * weight);
+
547  *(c++) = (char)('0' + (char)digit);
+
548  }
+
549  if (m == 0 && n > 0)
+
550  *(c++) = '.';
+
551  m--;
+
552  }
+
553 
+
554  if (useExp) {
+
555  /* convert the exponent */
+
556  int i, j;
+
557  *(c++) = 'e';
+
558  if (m1 > 0) {
+
559  *(c++) = '+';
+
560  } else {
+
561  *(c++) = '-';
+
562  m1 = -m1;
+
563  }
+
564  m = 0;
+
565  while (m1 > 0) {
+
566  *(c++) = (char)('0' + (char)(m1 % 10));
+
567  m1 /= 10;
+
568  m++;
+
569  }
+
570  c -= m;
+
571  for (i = 0, j = m-1; i<j; i++, j--) {
+
572  /* swap without temporary */
+
573  c[i] ^= c[j];
+
574  c[j] ^= c[i];
+
575  c[i] ^= c[j];
+
576  }
+
577  c += m;
+
578  }
+
579  *(c) = '\0';
+
580  return s;
+
581 }
+
582 #endif
+
583 #ifdef NK_INCLUDE_STANDARD_VARARGS
+
584 #ifndef NK_INCLUDE_STANDARD_IO
+
585 NK_INTERN int
+
586 nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
+
587 {
+
588  enum nk_arg_type {
+
589  NK_ARG_TYPE_CHAR,
+
590  NK_ARG_TYPE_SHORT,
+
591  NK_ARG_TYPE_DEFAULT,
+
592  NK_ARG_TYPE_LONG
+
593  };
+
594  enum nk_arg_flags {
+
595  NK_ARG_FLAG_LEFT = 0x01,
+
596  NK_ARG_FLAG_PLUS = 0x02,
+
597  NK_ARG_FLAG_SPACE = 0x04,
+
598  NK_ARG_FLAG_NUM = 0x10,
+
599  NK_ARG_FLAG_ZERO = 0x20
+
600  };
+
601 
+
602  char number_buffer[NK_MAX_NUMBER_BUFFER];
+
603  enum nk_arg_type arg_type = NK_ARG_TYPE_DEFAULT;
+
604  int precision = NK_DEFAULT;
+
605  int width = NK_DEFAULT;
+
606  nk_flags flag = 0;
+
607 
+
608  int len = 0;
+
609  int result = -1;
+
610  const char *iter = fmt;
+
611 
+
612  NK_ASSERT(buf);
+
613  NK_ASSERT(buf_size);
+
614  if (!buf || !buf_size || !fmt) return 0;
+
615  for (iter = fmt; *iter && len < buf_size; iter++) {
+
616  /* copy all non-format characters */
+
617  while (*iter && (*iter != '%') && (len < buf_size))
+
618  buf[len++] = *iter++;
+
619  if (!(*iter) || len >= buf_size) break;
+
620  iter++;
+
621 
+
622  /* flag arguments */
+
623  while (*iter) {
+
624  if (*iter == '-') flag |= NK_ARG_FLAG_LEFT;
+
625  else if (*iter == '+') flag |= NK_ARG_FLAG_PLUS;
+
626  else if (*iter == ' ') flag |= NK_ARG_FLAG_SPACE;
+
627  else if (*iter == '#') flag |= NK_ARG_FLAG_NUM;
+
628  else if (*iter == '0') flag |= NK_ARG_FLAG_ZERO;
+
629  else break;
+
630  iter++;
+
631  }
+
632 
+
633  /* width argument */
+
634  width = NK_DEFAULT;
+
635  if (*iter >= '1' && *iter <= '9') {
+
636  char *end;
+
637  width = nk_strtoi(iter, &end);
+
638  if (end == iter)
+
639  width = -1;
+
640  else iter = end;
+
641  } else if (*iter == '*') {
+
642  width = va_arg(args, int);
+
643  iter++;
+
644  }
+
645 
+
646  /* precision argument */
+
647  precision = NK_DEFAULT;
+
648  if (*iter == '.') {
+
649  iter++;
+
650  if (*iter == '*') {
+
651  precision = va_arg(args, int);
+
652  iter++;
+
653  } else {
+
654  char *end;
+
655  precision = nk_strtoi(iter, &end);
+
656  if (end == iter)
+
657  precision = -1;
+
658  else iter = end;
+
659  }
+
660  }
+
661 
+
662  /* length modifier */
+
663  if (*iter == 'h') {
+
664  if (*(iter+1) == 'h') {
+
665  arg_type = NK_ARG_TYPE_CHAR;
+
666  iter++;
+
667  } else arg_type = NK_ARG_TYPE_SHORT;
+
668  iter++;
+
669  } else if (*iter == 'l') {
+
670  arg_type = NK_ARG_TYPE_LONG;
+
671  iter++;
+
672  } else arg_type = NK_ARG_TYPE_DEFAULT;
+
673 
+
674  /* specifier */
+
675  if (*iter == '%') {
+
676  NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
+
677  NK_ASSERT(precision == NK_DEFAULT);
+
678  NK_ASSERT(width == NK_DEFAULT);
+
679  if (len < buf_size)
+
680  buf[len++] = '%';
+
681  } else if (*iter == 's') {
+
682  /* string */
+
683  const char *str = va_arg(args, const char*);
+
684  NK_ASSERT(str != buf && "buffer and argument are not allowed to overlap!");
+
685  NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
+
686  NK_ASSERT(precision == NK_DEFAULT);
+
687  NK_ASSERT(width == NK_DEFAULT);
+
688  if (str == buf) return -1;
+
689  while (str && *str && len < buf_size)
+
690  buf[len++] = *str++;
+
691  } else if (*iter == 'n') {
+
692  /* current length callback */
+
693  signed int *n = va_arg(args, int*);
+
694  NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
+
695  NK_ASSERT(precision == NK_DEFAULT);
+
696  NK_ASSERT(width == NK_DEFAULT);
+
697  if (n) *n = len;
+
698  } else if (*iter == 'c' || *iter == 'i' || *iter == 'd') {
+
699  /* signed integer */
+
700  long value = 0;
+
701  const char *num_iter;
+
702  int num_len, num_print, padding;
+
703  int cur_precision = NK_MAX(precision, 1);
+
704  int cur_width = NK_MAX(width, 0);
+
705 
+
706  /* retrieve correct value type */
+
707  if (arg_type == NK_ARG_TYPE_CHAR)
+
708  value = (signed char)va_arg(args, int);
+
709  else if (arg_type == NK_ARG_TYPE_SHORT)
+
710  value = (signed short)va_arg(args, int);
+
711  else if (arg_type == NK_ARG_TYPE_LONG)
+
712  value = va_arg(args, signed long);
+
713  else if (*iter == 'c')
+
714  value = (unsigned char)va_arg(args, int);
+
715  else value = va_arg(args, signed int);
+
716 
+
717  /* convert number to string */
+
718  nk_itoa(number_buffer, value);
+
719  num_len = nk_strlen(number_buffer);
+
720  padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0);
+
721  if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE))
+
722  padding = NK_MAX(padding-1, 0);
+
723 
+
724  /* fill left padding up to a total of `width` characters */
+
725  if (!(flag & NK_ARG_FLAG_LEFT)) {
+
726  while (padding-- > 0 && (len < buf_size)) {
+
727  if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT))
+
728  buf[len++] = '0';
+
729  else buf[len++] = ' ';
+
730  }
+
731  }
+
732 
+
733  /* copy string value representation into buffer */
+
734  if ((flag & NK_ARG_FLAG_PLUS) && value >= 0 && len < buf_size)
+
735  buf[len++] = '+';
+
736  else if ((flag & NK_ARG_FLAG_SPACE) && value >= 0 && len < buf_size)
+
737  buf[len++] = ' ';
+
738 
+
739  /* fill up to precision number of digits with '0' */
+
740  num_print = NK_MAX(cur_precision, num_len);
+
741  while (precision && (num_print > num_len) && (len < buf_size)) {
+
742  buf[len++] = '0';
+
743  num_print--;
+
744  }
+
745 
+
746  /* copy string value representation into buffer */
+
747  num_iter = number_buffer;
+
748  while (precision && *num_iter && len < buf_size)
+
749  buf[len++] = *num_iter++;
+
750 
+
751  /* fill right padding up to width characters */
+
752  if (flag & NK_ARG_FLAG_LEFT) {
+
753  while ((padding-- > 0) && (len < buf_size))
+
754  buf[len++] = ' ';
+
755  }
+
756  } else if (*iter == 'o' || *iter == 'x' || *iter == 'X' || *iter == 'u') {
+
757  /* unsigned integer */
+
758  unsigned long value = 0;
+
759  int num_len = 0, num_print, padding = 0;
+
760  int cur_precision = NK_MAX(precision, 1);
+
761  int cur_width = NK_MAX(width, 0);
+
762  unsigned int base = (*iter == 'o') ? 8: (*iter == 'u')? 10: 16;
+
763 
+
764  /* print oct/hex/dec value */
+
765  const char *upper_output_format = "0123456789ABCDEF";
+
766  const char *lower_output_format = "0123456789abcdef";
+
767  const char *output_format = (*iter == 'x') ?
+
768  lower_output_format: upper_output_format;
+
769 
+
770  /* retrieve correct value type */
+
771  if (arg_type == NK_ARG_TYPE_CHAR)
+
772  value = (unsigned char)va_arg(args, int);
+
773  else if (arg_type == NK_ARG_TYPE_SHORT)
+
774  value = (unsigned short)va_arg(args, int);
+
775  else if (arg_type == NK_ARG_TYPE_LONG)
+
776  value = va_arg(args, unsigned long);
+
777  else value = va_arg(args, unsigned int);
+
778 
+
779  do {
+
780  /* convert decimal number into hex/oct number */
+
781  int digit = output_format[value % base];
+
782  if (num_len < NK_MAX_NUMBER_BUFFER)
+
783  number_buffer[num_len++] = (char)digit;
+
784  value /= base;
+
785  } while (value > 0);
+
786 
+
787  num_print = NK_MAX(cur_precision, num_len);
+
788  padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0);
+
789  if (flag & NK_ARG_FLAG_NUM)
+
790  padding = NK_MAX(padding-1, 0);
+
791 
+
792  /* fill left padding up to a total of `width` characters */
+
793  if (!(flag & NK_ARG_FLAG_LEFT)) {
+
794  while ((padding-- > 0) && (len < buf_size)) {
+
795  if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT))
+
796  buf[len++] = '0';
+
797  else buf[len++] = ' ';
+
798  }
+
799  }
+
800 
+
801  /* fill up to precision number of digits */
+
802  if (num_print && (flag & NK_ARG_FLAG_NUM)) {
+
803  if ((*iter == 'o') && (len < buf_size)) {
+
804  buf[len++] = '0';
+
805  } else if ((*iter == 'x') && ((len+1) < buf_size)) {
+
806  buf[len++] = '0';
+
807  buf[len++] = 'x';
+
808  } else if ((*iter == 'X') && ((len+1) < buf_size)) {
+
809  buf[len++] = '0';
+
810  buf[len++] = 'X';
+
811  }
+
812  }
+
813  while (precision && (num_print > num_len) && (len < buf_size)) {
+
814  buf[len++] = '0';
+
815  num_print--;
+
816  }
+
817 
+
818  /* reverse number direction */
+
819  while (num_len > 0) {
+
820  if (precision && (len < buf_size))
+
821  buf[len++] = number_buffer[num_len-1];
+
822  num_len--;
+
823  }
+
824 
+
825  /* fill right padding up to width characters */
+
826  if (flag & NK_ARG_FLAG_LEFT) {
+
827  while ((padding-- > 0) && (len < buf_size))
+
828  buf[len++] = ' ';
+
829  }
+
830  } else if (*iter == 'f') {
+
831  /* floating point */
+
832  const char *num_iter;
+
833  int cur_precision = (precision < 0) ? 6: precision;
+
834  int prefix, cur_width = NK_MAX(width, 0);
+
835  double value = va_arg(args, double);
+
836  int num_len = 0, frac_len = 0, dot = 0;
+
837  int padding = 0;
+
838 
+
839  NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
+
840  NK_DTOA(number_buffer, value);
+
841  num_len = nk_strlen(number_buffer);
+
842 
+
843  /* calculate padding */
+
844  num_iter = number_buffer;
+
845  while (*num_iter && *num_iter != '.')
+
846  num_iter++;
+
847 
+
848  prefix = (*num_iter == '.')?(int)(num_iter - number_buffer)+1:0;
+
849  padding = NK_MAX(cur_width - (prefix + NK_MIN(cur_precision, num_len - prefix)) , 0);
+
850  if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE))
+
851  padding = NK_MAX(padding-1, 0);
+
852 
+
853  /* fill left padding up to a total of `width` characters */
+
854  if (!(flag & NK_ARG_FLAG_LEFT)) {
+
855  while (padding-- > 0 && (len < buf_size)) {
+
856  if (flag & NK_ARG_FLAG_ZERO)
+
857  buf[len++] = '0';
+
858  else buf[len++] = ' ';
+
859  }
+
860  }
+
861 
+
862  /* copy string value representation into buffer */
+
863  num_iter = number_buffer;
+
864  if ((flag & NK_ARG_FLAG_PLUS) && (value >= 0) && (len < buf_size))
+
865  buf[len++] = '+';
+
866  else if ((flag & NK_ARG_FLAG_SPACE) && (value >= 0) && (len < buf_size))
+
867  buf[len++] = ' ';
+
868  while (*num_iter) {
+
869  if (dot) frac_len++;
+
870  if (len < buf_size)
+
871  buf[len++] = *num_iter;
+
872  if (*num_iter == '.') dot = 1;
+
873  if (frac_len >= cur_precision) break;
+
874  num_iter++;
+
875  }
+
876 
+
877  /* fill number up to precision */
+
878  while (frac_len < cur_precision) {
+
879  if (!dot && len < buf_size) {
+
880  buf[len++] = '.';
+
881  dot = 1;
+
882  }
+
883  if (len < buf_size)
+
884  buf[len++] = '0';
+
885  frac_len++;
+
886  }
+
887 
+
888  /* fill right padding up to width characters */
+
889  if (flag & NK_ARG_FLAG_LEFT) {
+
890  while ((padding-- > 0) && (len < buf_size))
+
891  buf[len++] = ' ';
+
892  }
+
893  } else {
+
894  /* Specifier not supported: g,G,e,E,p,z */
+
895  NK_ASSERT(0 && "specifier is not supported!");
+
896  return result;
+
897  }
+
898  }
+
899  buf[(len >= buf_size)?(buf_size-1):len] = 0;
+
900  result = (len >= buf_size)?-1:len;
+
901  return result;
+
902 }
+
903 #endif
+
904 NK_LIB int
+
905 nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args)
+
906 {
+
907  int result = -1;
+
908  NK_ASSERT(buf);
+
909  NK_ASSERT(buf_size);
+
910  if (!buf || !buf_size || !fmt) return 0;
+
911 #ifdef NK_INCLUDE_STANDARD_IO
+
912  result = NK_VSNPRINTF(buf, (nk_size)buf_size, fmt, args);
+
913  result = (result >= buf_size) ? -1: result;
+
914  buf[buf_size-1] = 0;
+
915 #else
+
916  result = nk_vsnprintf(buf, buf_size, fmt, args);
+
917 #endif
+
918  return result;
+
919 }
+
920 #endif
+
921 NK_API nk_hash
+
922 nk_murmur_hash(const void * key, int len, nk_hash seed)
+
923 {
+
924  /* 32-Bit MurmurHash3: https://code.google.com/p/smhasher/wiki/MurmurHash3*/
+
925  #define NK_ROTL(x,r) ((x) << (r) | ((x) >> (32 - r)))
+
926 
+
927  nk_uint h1 = seed;
+
928  nk_uint k1;
+
929  const nk_byte *data = (const nk_byte*)key;
+
930  const nk_byte *keyptr = data;
+
931  nk_byte *k1ptr;
+
932  const int bsize = sizeof(k1);
+
933  const int nblocks = len/4;
+
934 
+
935  const nk_uint c1 = 0xcc9e2d51;
+
936  const nk_uint c2 = 0x1b873593;
+
937  const nk_byte *tail;
+
938  int i;
+
939 
+
940  /* body */
+
941  if (!key) return 0;
+
942  for (i = 0; i < nblocks; ++i, keyptr += bsize) {
+
943  k1ptr = (nk_byte*)&k1;
+
944  k1ptr[0] = keyptr[0];
+
945  k1ptr[1] = keyptr[1];
+
946  k1ptr[2] = keyptr[2];
+
947  k1ptr[3] = keyptr[3];
+
948 
+
949  k1 *= c1;
+
950  k1 = NK_ROTL(k1,15);
+
951  k1 *= c2;
+
952 
+
953  h1 ^= k1;
+
954  h1 = NK_ROTL(h1,13);
+
955  h1 = h1*5+0xe6546b64;
+
956  }
+
957 
+
958  /* tail */
+
959  tail = (const nk_byte*)(data + nblocks*4);
+
960  k1 = 0;
+
961  switch (len & 3) {
+
962  case 3: k1 ^= (nk_uint)(tail[2] << 16); /* fallthrough */
+
963  case 2: k1 ^= (nk_uint)(tail[1] << 8u); /* fallthrough */
+
964  case 1: k1 ^= tail[0];
+
965  k1 *= c1;
+
966  k1 = NK_ROTL(k1,15);
+
967  k1 *= c2;
+
968  h1 ^= k1;
+
969  break;
+
970  default: break;
+
971  }
+
972 
+
973  /* finalization */
+
974  h1 ^= (nk_uint)len;
+
975  /* fmix32 */
+
976  h1 ^= h1 >> 16;
+
977  h1 *= 0x85ebca6b;
+
978  h1 ^= h1 >> 13;
+
979  h1 *= 0xc2b2ae35;
+
980  h1 ^= h1 >> 16;
+
981 
+
982  #undef NK_ROTL
+
983  return h1;
+
984 }
+
985 #ifdef NK_INCLUDE_STANDARD_IO
+
986 NK_LIB char*
+
987 nk_file_load(const char* path, nk_size* siz, const struct nk_allocator *alloc)
+
988 {
+
989  char *buf;
+
990  FILE *fd;
+
991  long ret;
+
992 
+
993  NK_ASSERT(path);
+
994  NK_ASSERT(siz);
+
995  NK_ASSERT(alloc);
+
996  if (!path || !siz || !alloc)
+
997  return 0;
+
998 
+
999  fd = fopen(path, "rb");
+
1000  if (!fd) return 0;
+
1001  fseek(fd, 0, SEEK_END);
+
1002  ret = ftell(fd);
+
1003  if (ret < 0) {
+
1004  fclose(fd);
+
1005  return 0;
+
1006  }
+
1007  *siz = (nk_size)ret;
+
1008  fseek(fd, 0, SEEK_SET);
+
1009  buf = (char*)alloc->alloc(alloc->userdata,0, *siz);
+
1010  NK_ASSERT(buf);
+
1011  if (!buf) {
+
1012  fclose(fd);
+
1013  return 0;
+
1014  }
+
1015  *siz = (nk_size)fread(buf, 1,*siz, fd);
+
1016  fclose(fd);
+
1017  return buf;
+
1018 }
+
1019 #endif
+
1020 NK_LIB int
+
1021 nk_text_clamp(const struct nk_user_font *font, const char *text,
+
1022  int text_len, float space, int *glyphs, float *text_width,
+
1023  nk_rune *sep_list, int sep_count)
+
1024 {
+
1025  int i = 0;
+
1026  int glyph_len = 0;
+
1027  float last_width = 0;
+
1028  nk_rune unicode = 0;
+
1029  float width = 0;
+
1030  int len = 0;
+
1031  int g = 0;
+
1032  float s;
+
1033 
+
1034  int sep_len = 0;
+
1035  int sep_g = 0;
+
1036  float sep_width = 0;
+
1037  sep_count = NK_MAX(sep_count,0);
+
1038 
+
1039  glyph_len = nk_utf_decode(text, &unicode, text_len);
+
1040  while (glyph_len && (width < space) && (len < text_len)) {
+
1041  len += glyph_len;
+
1042  s = font->width(font->userdata, font->height, text, len);
+
1043  for (i = 0; i < sep_count; ++i) {
+
1044  if (unicode != sep_list[i]) continue;
+
1045  sep_width = last_width = width;
+
1046  sep_g = g+1;
+
1047  sep_len = len;
+
1048  break;
+
1049  }
+
1050  if (i == sep_count){
+
1051  last_width = sep_width = width;
+
1052  sep_g = g+1;
+
1053  }
+
1054  width = s;
+
1055  glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
+
1056  g++;
+
1057  }
+
1058  if (len >= text_len) {
+
1059  *glyphs = g;
+
1060  *text_width = last_width;
+
1061  return len;
+
1062  } else {
+
1063  *glyphs = sep_g;
+
1064  *text_width = sep_width;
+
1065  return (!sep_len) ? len: sep_len;
+
1066  }
+
1067 }
+
1068 NK_LIB struct nk_vec2
+
1069 nk_text_calculate_text_bounds(const struct nk_user_font *font,
+
1070  const char *begin, int byte_len, float row_height, const char **remaining,
+
1071  struct nk_vec2 *out_offset, int *glyphs, int op)
+
1072 {
+
1073  float line_height = row_height;
+
1074  struct nk_vec2 text_size = nk_vec2(0,0);
+
1075  float line_width = 0.0f;
+
1076 
+
1077  float glyph_width;
+
1078  int glyph_len = 0;
+
1079  nk_rune unicode = 0;
+
1080  int text_len = 0;
+
1081  if (!begin || byte_len <= 0 || !font)
+
1082  return nk_vec2(0,row_height);
+
1083 
+
1084  glyph_len = nk_utf_decode(begin, &unicode, byte_len);
+
1085  if (!glyph_len) return text_size;
+
1086  glyph_width = font->width(font->userdata, font->height, begin, glyph_len);
+
1087 
+
1088  *glyphs = 0;
+
1089  while ((text_len < byte_len) && glyph_len) {
+
1090  if (unicode == '\n') {
+
1091  text_size.x = NK_MAX(text_size.x, line_width);
+
1092  text_size.y += line_height;
+
1093  line_width = 0;
+
1094  *glyphs+=1;
+
1095  if (op == NK_STOP_ON_NEW_LINE)
+
1096  break;
+
1097 
+
1098  text_len++;
+
1099  glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+
1100  continue;
+
1101  }
+
1102 
+
1103  if (unicode == '\r') {
+
1104  text_len++;
+
1105  *glyphs+=1;
+
1106  glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+
1107  continue;
+
1108  }
+
1109 
+
1110  *glyphs = *glyphs + 1;
+
1111  text_len += glyph_len;
+
1112  line_width += (float)glyph_width;
+
1113  glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+
1114  glyph_width = font->width(font->userdata, font->height, begin+text_len, glyph_len);
+
1115  continue;
+
1116  }
+
1117 
+
1118  if (text_size.x < line_width)
+
1119  text_size.x = line_width;
+
1120  if (out_offset)
+
1121  *out_offset = nk_vec2(line_width, text_size.y + line_height);
+
1122  if (line_width > 0 || text_size.y == 0.0f)
+
1123  text_size.y += line_height;
+
1124  if (remaining)
+
1125  *remaining = begin+text_len;
+
1126  return text_size;
+
1127 }
+
1128 
+
main API and documentation file
+ + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ +
+
+ + + + diff --git a/nuklear__vertex_8c_source.html b/nuklear__vertex_8c_source.html new file mode 100644 index 000000000..2329ca1cf --- /dev/null +++ b/nuklear__vertex_8c_source.html @@ -0,0 +1,1493 @@ + + + + + + + +Nuklear: src/nuklear_vertex.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_vertex.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * VERTEX
+
7  *
+
8  * ===============================================================*/
+
9 #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+
10 NK_API void
+
11 nk_draw_list_init(struct nk_draw_list *list)
+
12 {
+
13  nk_size i = 0;
+
14  NK_ASSERT(list);
+
15  if (!list) return;
+
16  nk_zero(list, sizeof(*list));
+
17  for (i = 0; i < NK_LEN(list->circle_vtx); ++i) {
+
18  const float a = ((float)i / (float)NK_LEN(list->circle_vtx)) * 2 * NK_PI;
+
19  list->circle_vtx[i].x = (float)NK_COS(a);
+
20  list->circle_vtx[i].y = (float)NK_SIN(a);
+
21  }
+
22 }
+
23 NK_API void
+
24 nk_draw_list_setup(struct nk_draw_list *canvas, const struct nk_convert_config *config,
+
25  struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements,
+
26  enum nk_anti_aliasing line_aa, enum nk_anti_aliasing shape_aa)
+
27 {
+
28  NK_ASSERT(canvas);
+
29  NK_ASSERT(config);
+
30  NK_ASSERT(cmds);
+
31  NK_ASSERT(vertices);
+
32  NK_ASSERT(elements);
+
33  if (!canvas || !config || !cmds || !vertices || !elements)
+
34  return;
+
35 
+
36  canvas->buffer = cmds;
+
37  canvas->config = *config;
+
38  canvas->elements = elements;
+
39  canvas->vertices = vertices;
+
40  canvas->line_AA = line_aa;
+
41  canvas->shape_AA = shape_aa;
+
42  canvas->clip_rect = nk_null_rect;
+
43 
+
44  canvas->cmd_offset = 0;
+
45  canvas->element_count = 0;
+
46  canvas->vertex_count = 0;
+
47  canvas->cmd_offset = 0;
+
48  canvas->cmd_count = 0;
+
49  canvas->path_count = 0;
+
50 }
+
51 NK_API const struct nk_draw_command*
+
52 nk__draw_list_begin(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
+
53 {
+
54  nk_byte *memory;
+
55  nk_size offset;
+
56  const struct nk_draw_command *cmd;
+
57 
+
58  NK_ASSERT(buffer);
+
59  if (!buffer || !buffer->size || !canvas->cmd_count)
+
60  return 0;
+
61 
+
62  memory = (nk_byte*)buffer->memory.ptr;
+
63  offset = buffer->memory.size - canvas->cmd_offset;
+
64  cmd = nk_ptr_add(const struct nk_draw_command, memory, offset);
+
65  return cmd;
+
66 }
+
67 NK_API const struct nk_draw_command*
+
68 nk__draw_list_end(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
+
69 {
+
70  nk_size size;
+
71  nk_size offset;
+
72  nk_byte *memory;
+
73  const struct nk_draw_command *end;
+
74 
+
75  NK_ASSERT(buffer);
+
76  NK_ASSERT(canvas);
+
77  if (!buffer || !canvas)
+
78  return 0;
+
79 
+
80  memory = (nk_byte*)buffer->memory.ptr;
+
81  size = buffer->memory.size;
+
82  offset = size - canvas->cmd_offset;
+
83  end = nk_ptr_add(const struct nk_draw_command, memory, offset);
+
84  end -= (canvas->cmd_count-1);
+
85  return end;
+
86 }
+
87 NK_API const struct nk_draw_command*
+
88 nk__draw_list_next(const struct nk_draw_command *cmd,
+
89  const struct nk_buffer *buffer, const struct nk_draw_list *canvas)
+
90 {
+
91  const struct nk_draw_command *end;
+
92  NK_ASSERT(buffer);
+
93  NK_ASSERT(canvas);
+
94  if (!cmd || !buffer || !canvas)
+
95  return 0;
+
96 
+
97  end = nk__draw_list_end(canvas, buffer);
+
98  if (cmd <= end) return 0;
+
99  return (cmd-1);
+
100 }
+
101 NK_INTERN struct nk_vec2*
+
102 nk_draw_list_alloc_path(struct nk_draw_list *list, int count)
+
103 {
+
104  struct nk_vec2 *points;
+
105  NK_STORAGE const nk_size point_align = NK_ALIGNOF(struct nk_vec2);
+
106  NK_STORAGE const nk_size point_size = sizeof(struct nk_vec2);
+
107  points = (struct nk_vec2*)
+
108  nk_buffer_alloc(list->buffer, NK_BUFFER_FRONT,
+
109  point_size * (nk_size)count, point_align);
+
110 
+
111  if (!points) return 0;
+
112  if (!list->path_offset) {
+
113  void *memory = nk_buffer_memory(list->buffer);
+
114  list->path_offset = (unsigned int)((nk_byte*)points - (nk_byte*)memory);
+
115  }
+
116  list->path_count += (unsigned int)count;
+
117  return points;
+
118 }
+
119 NK_INTERN struct nk_vec2
+
120 nk_draw_list_path_last(struct nk_draw_list *list)
+
121 {
+
122  void *memory;
+
123  struct nk_vec2 *point;
+
124  NK_ASSERT(list->path_count);
+
125  memory = nk_buffer_memory(list->buffer);
+
126  point = nk_ptr_add(struct nk_vec2, memory, list->path_offset);
+
127  point += (list->path_count-1);
+
128  return *point;
+
129 }
+
130 NK_INTERN struct nk_draw_command*
+
131 nk_draw_list_push_command(struct nk_draw_list *list, struct nk_rect clip,
+
132  nk_handle texture)
+
133 {
+
134  NK_STORAGE const nk_size cmd_align = NK_ALIGNOF(struct nk_draw_command);
+
135  NK_STORAGE const nk_size cmd_size = sizeof(struct nk_draw_command);
+
136  struct nk_draw_command *cmd;
+
137 
+
138  NK_ASSERT(list);
+
139  cmd = (struct nk_draw_command*)
+
140  nk_buffer_alloc(list->buffer, NK_BUFFER_BACK, cmd_size, cmd_align);
+
141 
+
142  if (!cmd) return 0;
+
143  if (!list->cmd_count) {
+
144  nk_byte *memory = (nk_byte*)nk_buffer_memory(list->buffer);
+
145  nk_size total = nk_buffer_total(list->buffer);
+
146  memory = nk_ptr_add(nk_byte, memory, total);
+
147  list->cmd_offset = (nk_size)(memory - (nk_byte*)cmd);
+
148  }
+
149 
+
150  cmd->elem_count = 0;
+
151  cmd->clip_rect = clip;
+
152  cmd->texture = texture;
+
153 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
154  cmd->userdata = list->userdata;
+
155 #endif
+
156 
+
157  list->cmd_count++;
+
158  list->clip_rect = clip;
+
159  return cmd;
+
160 }
+
161 NK_INTERN struct nk_draw_command*
+
162 nk_draw_list_command_last(struct nk_draw_list *list)
+
163 {
+
164  void *memory;
+
165  nk_size size;
+
166  struct nk_draw_command *cmd;
+
167  NK_ASSERT(list->cmd_count);
+
168 
+
169  memory = nk_buffer_memory(list->buffer);
+
170  size = nk_buffer_total(list->buffer);
+
171  cmd = nk_ptr_add(struct nk_draw_command, memory, size - list->cmd_offset);
+
172  return (cmd - (list->cmd_count-1));
+
173 }
+
174 NK_INTERN void
+
175 nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect)
+
176 {
+
177  NK_ASSERT(list);
+
178  if (!list) return;
+
179  if (!list->cmd_count) {
+
180  nk_draw_list_push_command(list, rect, list->config.tex_null.texture);
+
181  } else {
+
182  struct nk_draw_command *prev = nk_draw_list_command_last(list);
+
183  if (prev->elem_count == 0)
+
184  prev->clip_rect = rect;
+
185  nk_draw_list_push_command(list, rect, prev->texture);
+
186  }
+
187 }
+
188 NK_INTERN void
+
189 nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
+
190 {
+
191  NK_ASSERT(list);
+
192  if (!list) return;
+
193  if (!list->cmd_count) {
+
194  nk_draw_list_push_command(list, nk_null_rect, texture);
+
195  } else {
+
196  struct nk_draw_command *prev = nk_draw_list_command_last(list);
+
197  if (prev->elem_count == 0) {
+
198  prev->texture = texture;
+
199  #ifdef NK_INCLUDE_COMMAND_USERDATA
+
200  prev->userdata = list->userdata;
+
201  #endif
+
202  } else if (prev->texture.id != texture.id
+
203  #ifdef NK_INCLUDE_COMMAND_USERDATA
+
204  || prev->userdata.id != list->userdata.id
+
205  #endif
+
206  ) {
+
207  nk_draw_list_push_command(list, prev->clip_rect, texture);
+
208  }
+
209  }
+
210 }
+
211 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
212 NK_API void
+
213 nk_draw_list_push_userdata(struct nk_draw_list *list, nk_handle userdata)
+
214 {
+
215  list->userdata = userdata;
+
216 }
+
217 #endif
+
218 NK_INTERN void*
+
219 nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
+
220 {
+
221  void *vtx;
+
222  NK_ASSERT(list);
+
223  if (!list) return 0;
+
224  vtx = nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT,
+
225  list->config.vertex_size*count, list->config.vertex_alignment);
+
226  if (!vtx) return 0;
+
227  list->vertex_count += (unsigned int)count;
+
228 
+
229  /* This assert triggers because your are drawing a lot of stuff and nuklear
+
230  * defined `nk_draw_index` as `nk_ushort` to safe space be default.
+
231  *
+
232  * So you reached the maximum number of indices or rather vertexes.
+
233  * To solve this issue please change typedef `nk_draw_index` to `nk_uint`
+
234  * and don't forget to specify the new element size in your drawing
+
235  * backend (OpenGL, DirectX, ...). For example in OpenGL for `glDrawElements`
+
236  * instead of specifying `GL_UNSIGNED_SHORT` you have to define `GL_UNSIGNED_INT`.
+
237  * Sorry for the inconvenience. */
+
238  if(sizeof(nk_draw_index)==2) NK_ASSERT((list->vertex_count < NK_USHORT_MAX &&
+
239  "To many vertices for 16-bit vertex indices. Please read comment above on how to solve this problem"));
+
240  return vtx;
+
241 }
+
242 NK_INTERN nk_draw_index*
+
243 nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count)
+
244 {
+
245  nk_draw_index *ids;
+
246  struct nk_draw_command *cmd;
+
247  NK_STORAGE const nk_size elem_align = NK_ALIGNOF(nk_draw_index);
+
248  NK_STORAGE const nk_size elem_size = sizeof(nk_draw_index);
+
249  NK_ASSERT(list);
+
250  if (!list) return 0;
+
251 
+
252  ids = (nk_draw_index*)
+
253  nk_buffer_alloc(list->elements, NK_BUFFER_FRONT, elem_size*count, elem_align);
+
254  if (!ids) return 0;
+
255  cmd = nk_draw_list_command_last(list);
+
256  list->element_count += (unsigned int)count;
+
257  cmd->elem_count += (unsigned int)count;
+
258  return ids;
+
259 }
+
260 NK_INTERN int
+
261 nk_draw_vertex_layout_element_is_end_of_layout(
+
262  const struct nk_draw_vertex_layout_element *element)
+
263 {
+
264  return (element->attribute == NK_VERTEX_ATTRIBUTE_COUNT ||
+
265  element->format == NK_FORMAT_COUNT);
+
266 }
+
267 NK_INTERN void
+
268 nk_draw_vertex_color(void *attr, const float *vals,
+
269  enum nk_draw_vertex_layout_format format)
+
270 {
+
271  /* if this triggers you tried to provide a value format for a color */
+
272  float val[4];
+
273  NK_ASSERT(format >= NK_FORMAT_COLOR_BEGIN);
+
274  NK_ASSERT(format <= NK_FORMAT_COLOR_END);
+
275  if (format < NK_FORMAT_COLOR_BEGIN || format > NK_FORMAT_COLOR_END) return;
+
276 
+
277  val[0] = NK_SATURATE(vals[0]);
+
278  val[1] = NK_SATURATE(vals[1]);
+
279  val[2] = NK_SATURATE(vals[2]);
+
280  val[3] = NK_SATURATE(vals[3]);
+
281 
+
282  switch (format) {
+
283  default: NK_ASSERT(0 && "Invalid vertex layout color format"); break;
+
284  case NK_FORMAT_R8G8B8A8:
+
285  case NK_FORMAT_R8G8B8: {
+
286  struct nk_color col = nk_rgba_fv(val);
+
287  NK_MEMCPY(attr, &col.r, sizeof(col));
+
288  } break;
+
289  case NK_FORMAT_B8G8R8A8: {
+
290  struct nk_color col = nk_rgba_fv(val);
+
291  struct nk_color bgra = nk_rgba(col.b, col.g, col.r, col.a);
+
292  NK_MEMCPY(attr, &bgra, sizeof(bgra));
+
293  } break;
+
294  case NK_FORMAT_R16G15B16: {
+
295  nk_ushort col[3];
+
296  col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
+
297  col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
+
298  col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
+
299  NK_MEMCPY(attr, col, sizeof(col));
+
300  } break;
+
301  case NK_FORMAT_R16G15B16A16: {
+
302  nk_ushort col[4];
+
303  col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
+
304  col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
+
305  col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
+
306  col[3] = (nk_ushort)(val[3]*(float)NK_USHORT_MAX);
+
307  NK_MEMCPY(attr, col, sizeof(col));
+
308  } break;
+
309  case NK_FORMAT_R32G32B32: {
+
310  nk_uint col[3];
+
311  col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
+
312  col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
+
313  col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
+
314  NK_MEMCPY(attr, col, sizeof(col));
+
315  } break;
+
316  case NK_FORMAT_R32G32B32A32: {
+
317  nk_uint col[4];
+
318  col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
+
319  col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
+
320  col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
+
321  col[3] = (nk_uint)(val[3]*(float)NK_UINT_MAX);
+
322  NK_MEMCPY(attr, col, sizeof(col));
+
323  } break;
+
324  case NK_FORMAT_R32G32B32A32_FLOAT:
+
325  NK_MEMCPY(attr, val, sizeof(float)*4);
+
326  break;
+
327  case NK_FORMAT_R32G32B32A32_DOUBLE: {
+
328  double col[4];
+
329  col[0] = (double)val[0];
+
330  col[1] = (double)val[1];
+
331  col[2] = (double)val[2];
+
332  col[3] = (double)val[3];
+
333  NK_MEMCPY(attr, col, sizeof(col));
+
334  } break;
+
335  case NK_FORMAT_RGB32:
+
336  case NK_FORMAT_RGBA32: {
+
337  struct nk_color col = nk_rgba_fv(val);
+
338  nk_uint color = nk_color_u32(col);
+
339  NK_MEMCPY(attr, &color, sizeof(color));
+
340  } break; }
+
341 }
+
342 NK_INTERN void
+
343 nk_draw_vertex_element(void *dst, const float *values, int value_count,
+
344  enum nk_draw_vertex_layout_format format)
+
345 {
+
346  int value_index;
+
347  void *attribute = dst;
+
348  /* if this triggers you tried to provide a color format for a value */
+
349  NK_ASSERT(format < NK_FORMAT_COLOR_BEGIN);
+
350  if (format >= NK_FORMAT_COLOR_BEGIN && format <= NK_FORMAT_COLOR_END) return;
+
351  for (value_index = 0; value_index < value_count; ++value_index) {
+
352  switch (format) {
+
353  default: NK_ASSERT(0 && "invalid vertex layout format"); break;
+
354  case NK_FORMAT_SCHAR: {
+
355  char value = (char)NK_CLAMP((float)NK_SCHAR_MIN, values[value_index], (float)NK_SCHAR_MAX);
+
356  NK_MEMCPY(attribute, &value, sizeof(value));
+
357  attribute = (void*)((char*)attribute + sizeof(char));
+
358  } break;
+
359  case NK_FORMAT_SSHORT: {
+
360  nk_short value = (nk_short)NK_CLAMP((float)NK_SSHORT_MIN, values[value_index], (float)NK_SSHORT_MAX);
+
361  NK_MEMCPY(attribute, &value, sizeof(value));
+
362  attribute = (void*)((char*)attribute + sizeof(value));
+
363  } break;
+
364  case NK_FORMAT_SINT: {
+
365  nk_int value = (nk_int)NK_CLAMP((float)NK_SINT_MIN, values[value_index], (float)NK_SINT_MAX);
+
366  NK_MEMCPY(attribute, &value, sizeof(value));
+
367  attribute = (void*)((char*)attribute + sizeof(nk_int));
+
368  } break;
+
369  case NK_FORMAT_UCHAR: {
+
370  unsigned char value = (unsigned char)NK_CLAMP((float)NK_UCHAR_MIN, values[value_index], (float)NK_UCHAR_MAX);
+
371  NK_MEMCPY(attribute, &value, sizeof(value));
+
372  attribute = (void*)((char*)attribute + sizeof(unsigned char));
+
373  } break;
+
374  case NK_FORMAT_USHORT: {
+
375  nk_ushort value = (nk_ushort)NK_CLAMP((float)NK_USHORT_MIN, values[value_index], (float)NK_USHORT_MAX);
+
376  NK_MEMCPY(attribute, &value, sizeof(value));
+
377  attribute = (void*)((char*)attribute + sizeof(value));
+
378  } break;
+
379  case NK_FORMAT_UINT: {
+
380  nk_uint value = (nk_uint)NK_CLAMP((float)NK_UINT_MIN, values[value_index], (float)NK_UINT_MAX);
+
381  NK_MEMCPY(attribute, &value, sizeof(value));
+
382  attribute = (void*)((char*)attribute + sizeof(nk_uint));
+
383  } break;
+
384  case NK_FORMAT_FLOAT:
+
385  NK_MEMCPY(attribute, &values[value_index], sizeof(values[value_index]));
+
386  attribute = (void*)((char*)attribute + sizeof(float));
+
387  break;
+
388  case NK_FORMAT_DOUBLE: {
+
389  double value = (double)values[value_index];
+
390  NK_MEMCPY(attribute, &value, sizeof(value));
+
391  attribute = (void*)((char*)attribute + sizeof(double));
+
392  } break;
+
393  }
+
394  }
+
395 }
+
396 NK_INTERN void*
+
397 nk_draw_vertex(void *dst, const struct nk_convert_config *config,
+
398  struct nk_vec2 pos, struct nk_vec2 uv, struct nk_colorf color)
+
399 {
+
400  void *result = (void*)((char*)dst + config->vertex_size);
+
401  const struct nk_draw_vertex_layout_element *elem_iter = config->vertex_layout;
+
402  while (!nk_draw_vertex_layout_element_is_end_of_layout(elem_iter)) {
+
403  void *address = (void*)((char*)dst + elem_iter->offset);
+
404  switch (elem_iter->attribute) {
+
405  case NK_VERTEX_ATTRIBUTE_COUNT:
+
406  default: NK_ASSERT(0 && "wrong element attribute"); break;
+
407  case NK_VERTEX_POSITION: nk_draw_vertex_element(address, &pos.x, 2, elem_iter->format); break;
+
408  case NK_VERTEX_TEXCOORD: nk_draw_vertex_element(address, &uv.x, 2, elem_iter->format); break;
+
409  case NK_VERTEX_COLOR: nk_draw_vertex_color(address, &color.r, elem_iter->format); break;
+
410  }
+
411  elem_iter++;
+
412  }
+
413  return result;
+
414 }
+
415 NK_API void
+
416 nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *points,
+
417  const unsigned int points_count, struct nk_color color, enum nk_draw_list_stroke closed,
+
418  float thickness, enum nk_anti_aliasing aliasing)
+
419 {
+
420  nk_size count;
+
421  int thick_line;
+
422  struct nk_colorf col;
+
423  struct nk_colorf col_trans;
+
424  NK_ASSERT(list);
+
425  if (!list || points_count < 2) return;
+
426 
+
427  color.a = (nk_byte)((float)color.a * list->config.global_alpha);
+
428  count = points_count;
+
429  if (!closed) count = points_count-1;
+
430  thick_line = thickness > 1.0f;
+
431 
+
432 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
433  nk_draw_list_push_userdata(list, list->userdata);
+
434 #endif
+
435 
+
436  color.a = (nk_byte)((float)color.a * list->config.global_alpha);
+
437  nk_color_fv(&col.r, color);
+
438  col_trans = col;
+
439  col_trans.a = 0;
+
440 
+
441  if (aliasing == NK_ANTI_ALIASING_ON) {
+
442  /* ANTI-ALIASED STROKE */
+
443  const float AA_SIZE = 1.0f;
+
444  NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
+
445  NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
+
446 
+
447  /* allocate vertices and elements */
+
448  nk_size i1 = 0;
+
449  nk_size vertex_offset;
+
450  nk_size index = list->vertex_count;
+
451 
+
452  const nk_size idx_count = (thick_line) ? (count * 18) : (count * 12);
+
453  const nk_size vtx_count = (thick_line) ? (points_count * 4): (points_count *3);
+
454 
+
455  void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
+
456  nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
+
457 
+
458  nk_size size;
+
459  struct nk_vec2 *normals, *temp;
+
460  if (!vtx || !ids) return;
+
461 
+
462  /* temporary allocate normals + points */
+
463  vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
+
464  nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
+
465  size = pnt_size * ((thick_line) ? 5 : 3) * points_count;
+
466  normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
+
467  if (!normals) return;
+
468  temp = normals + points_count;
+
469 
+
470  /* make sure vertex pointer is still correct */
+
471  vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);
+
472 
+
473  /* calculate normals */
+
474  for (i1 = 0; i1 < count; ++i1) {
+
475  const nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
+
476  struct nk_vec2 diff = nk_vec2_sub(points[i2], points[i1]);
+
477  float len;
+
478 
+
479  /* vec2 inverted length */
+
480  len = nk_vec2_len_sqr(diff);
+
481  if (len != 0.0f)
+
482  len = NK_INV_SQRT(len);
+
483  else len = 1.0f;
+
484 
+
485  diff = nk_vec2_muls(diff, len);
+
486  normals[i1].x = diff.y;
+
487  normals[i1].y = -diff.x;
+
488  }
+
489 
+
490  if (!closed)
+
491  normals[points_count-1] = normals[points_count-2];
+
492 
+
493  if (!thick_line) {
+
494  nk_size idx1, i;
+
495  if (!closed) {
+
496  struct nk_vec2 d;
+
497  temp[0] = nk_vec2_add(points[0], nk_vec2_muls(normals[0], AA_SIZE));
+
498  temp[1] = nk_vec2_sub(points[0], nk_vec2_muls(normals[0], AA_SIZE));
+
499  d = nk_vec2_muls(normals[points_count-1], AA_SIZE);
+
500  temp[(points_count-1) * 2 + 0] = nk_vec2_add(points[points_count-1], d);
+
501  temp[(points_count-1) * 2 + 1] = nk_vec2_sub(points[points_count-1], d);
+
502  }
+
503 
+
504  /* fill elements */
+
505  idx1 = index;
+
506  for (i1 = 0; i1 < count; i1++) {
+
507  struct nk_vec2 dm;
+
508  float dmr2;
+
509  nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
+
510  nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 3);
+
511 
+
512  /* average normals */
+
513  dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f);
+
514  dmr2 = dm.x * dm.x + dm.y* dm.y;
+
515  if (dmr2 > 0.000001f) {
+
516  float scale = 1.0f/dmr2;
+
517  scale = NK_MIN(100.0f, scale);
+
518  dm = nk_vec2_muls(dm, scale);
+
519  }
+
520 
+
521  dm = nk_vec2_muls(dm, AA_SIZE);
+
522  temp[i2*2+0] = nk_vec2_add(points[i2], dm);
+
523  temp[i2*2+1] = nk_vec2_sub(points[i2], dm);
+
524 
+
525  ids[0] = (nk_draw_index)(idx2 + 0); ids[1] = (nk_draw_index)(idx1+0);
+
526  ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2);
+
527  ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+0);
+
528  ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1);
+
529  ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0);
+
530  ids[10]= (nk_draw_index)(idx2 + 0); ids[11]= (nk_draw_index)(idx2+1);
+
531  ids += 12;
+
532  idx1 = idx2;
+
533  }
+
534 
+
535  /* fill vertices */
+
536  for (i = 0; i < points_count; ++i) {
+
537  const struct nk_vec2 uv = list->config.tex_null.uv;
+
538  vtx = nk_draw_vertex(vtx, &list->config, points[i], uv, col);
+
539  vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+0], uv, col_trans);
+
540  vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+1], uv, col_trans);
+
541  }
+
542  } else {
+
543  nk_size idx1, i;
+
544  const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f;
+
545  if (!closed) {
+
546  struct nk_vec2 d1 = nk_vec2_muls(normals[0], half_inner_thickness + AA_SIZE);
+
547  struct nk_vec2 d2 = nk_vec2_muls(normals[0], half_inner_thickness);
+
548 
+
549  temp[0] = nk_vec2_add(points[0], d1);
+
550  temp[1] = nk_vec2_add(points[0], d2);
+
551  temp[2] = nk_vec2_sub(points[0], d2);
+
552  temp[3] = nk_vec2_sub(points[0], d1);
+
553 
+
554  d1 = nk_vec2_muls(normals[points_count-1], half_inner_thickness + AA_SIZE);
+
555  d2 = nk_vec2_muls(normals[points_count-1], half_inner_thickness);
+
556 
+
557  temp[(points_count-1)*4+0] = nk_vec2_add(points[points_count-1], d1);
+
558  temp[(points_count-1)*4+1] = nk_vec2_add(points[points_count-1], d2);
+
559  temp[(points_count-1)*4+2] = nk_vec2_sub(points[points_count-1], d2);
+
560  temp[(points_count-1)*4+3] = nk_vec2_sub(points[points_count-1], d1);
+
561  }
+
562 
+
563  /* add all elements */
+
564  idx1 = index;
+
565  for (i1 = 0; i1 < count; ++i1) {
+
566  struct nk_vec2 dm_out, dm_in;
+
567  const nk_size i2 = ((i1+1) == points_count) ? 0: (i1 + 1);
+
568  nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 4);
+
569 
+
570  /* average normals */
+
571  struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f);
+
572  float dmr2 = dm.x * dm.x + dm.y* dm.y;
+
573  if (dmr2 > 0.000001f) {
+
574  float scale = 1.0f/dmr2;
+
575  scale = NK_MIN(100.0f, scale);
+
576  dm = nk_vec2_muls(dm, scale);
+
577  }
+
578 
+
579  dm_out = nk_vec2_muls(dm, ((half_inner_thickness) + AA_SIZE));
+
580  dm_in = nk_vec2_muls(dm, half_inner_thickness);
+
581  temp[i2*4+0] = nk_vec2_add(points[i2], dm_out);
+
582  temp[i2*4+1] = nk_vec2_add(points[i2], dm_in);
+
583  temp[i2*4+2] = nk_vec2_sub(points[i2], dm_in);
+
584  temp[i2*4+3] = nk_vec2_sub(points[i2], dm_out);
+
585 
+
586  /* add indexes */
+
587  ids[0] = (nk_draw_index)(idx2 + 1); ids[1] = (nk_draw_index)(idx1+1);
+
588  ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2);
+
589  ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+1);
+
590  ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1);
+
591  ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0);
+
592  ids[10]= (nk_draw_index)(idx2 + 0); ids[11] = (nk_draw_index)(idx2+1);
+
593  ids[12]= (nk_draw_index)(idx2 + 2); ids[13] = (nk_draw_index)(idx1+2);
+
594  ids[14]= (nk_draw_index)(idx1 + 3); ids[15] = (nk_draw_index)(idx1+3);
+
595  ids[16]= (nk_draw_index)(idx2 + 3); ids[17] = (nk_draw_index)(idx2+2);
+
596  ids += 18;
+
597  idx1 = idx2;
+
598  }
+
599 
+
600  /* add vertices */
+
601  for (i = 0; i < points_count; ++i) {
+
602  const struct nk_vec2 uv = list->config.tex_null.uv;
+
603  vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+0], uv, col_trans);
+
604  vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+1], uv, col);
+
605  vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+2], uv, col);
+
606  vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+3], uv, col_trans);
+
607  }
+
608  }
+
609  /* free temporary normals + points */
+
610  nk_buffer_reset(list->vertices, NK_BUFFER_FRONT);
+
611  } else {
+
612  /* NON ANTI-ALIASED STROKE */
+
613  nk_size i1 = 0;
+
614  nk_size idx = list->vertex_count;
+
615  const nk_size idx_count = count * 6;
+
616  const nk_size vtx_count = count * 4;
+
617  void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
+
618  nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
+
619  if (!vtx || !ids) return;
+
620 
+
621  for (i1 = 0; i1 < count; ++i1) {
+
622  float dx, dy;
+
623  const struct nk_vec2 uv = list->config.tex_null.uv;
+
624  const nk_size i2 = ((i1+1) == points_count) ? 0 : i1 + 1;
+
625  const struct nk_vec2 p1 = points[i1];
+
626  const struct nk_vec2 p2 = points[i2];
+
627  struct nk_vec2 diff = nk_vec2_sub(p2, p1);
+
628  float len;
+
629 
+
630  /* vec2 inverted length */
+
631  len = nk_vec2_len_sqr(diff);
+
632  if (len != 0.0f)
+
633  len = NK_INV_SQRT(len);
+
634  else len = 1.0f;
+
635  diff = nk_vec2_muls(diff, len);
+
636 
+
637  /* add vertices */
+
638  dx = diff.x * (thickness * 0.5f);
+
639  dy = diff.y * (thickness * 0.5f);
+
640 
+
641  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x + dy, p1.y - dx), uv, col);
+
642  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x + dy, p2.y - dx), uv, col);
+
643  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x - dy, p2.y + dx), uv, col);
+
644  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x - dy, p1.y + dx), uv, col);
+
645 
+
646  ids[0] = (nk_draw_index)(idx+0); ids[1] = (nk_draw_index)(idx+1);
+
647  ids[2] = (nk_draw_index)(idx+2); ids[3] = (nk_draw_index)(idx+0);
+
648  ids[4] = (nk_draw_index)(idx+2); ids[5] = (nk_draw_index)(idx+3);
+
649 
+
650  ids += 6;
+
651  idx += 4;
+
652  }
+
653  }
+
654 }
+
655 NK_API void
+
656 nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
+
657  const struct nk_vec2 *points, const unsigned int points_count,
+
658  struct nk_color color, enum nk_anti_aliasing aliasing)
+
659 {
+
660  struct nk_colorf col;
+
661  struct nk_colorf col_trans;
+
662 
+
663  NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
+
664  NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
+
665  NK_ASSERT(list);
+
666  if (!list || points_count < 3) return;
+
667 
+
668 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
669  nk_draw_list_push_userdata(list, list->userdata);
+
670 #endif
+
671 
+
672  color.a = (nk_byte)((float)color.a * list->config.global_alpha);
+
673  nk_color_fv(&col.r, color);
+
674  col_trans = col;
+
675  col_trans.a = 0;
+
676 
+
677  if (aliasing == NK_ANTI_ALIASING_ON) {
+
678  nk_size i = 0;
+
679  nk_size i0 = 0;
+
680  nk_size i1 = 0;
+
681 
+
682  const float AA_SIZE = 1.0f;
+
683  nk_size vertex_offset = 0;
+
684  nk_size index = list->vertex_count;
+
685 
+
686  const nk_size idx_count = (points_count-2)*3 + points_count*6;
+
687  const nk_size vtx_count = (points_count*2);
+
688 
+
689  void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
+
690  nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
+
691 
+
692  nk_size size = 0;
+
693  struct nk_vec2 *normals = 0;
+
694  unsigned int vtx_inner_idx = (unsigned int)(index + 0);
+
695  unsigned int vtx_outer_idx = (unsigned int)(index + 1);
+
696  if (!vtx || !ids) return;
+
697 
+
698  /* temporary allocate normals */
+
699  vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
+
700  nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
+
701  size = pnt_size * points_count;
+
702  normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
+
703  if (!normals) return;
+
704  vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);
+
705 
+
706  /* add elements */
+
707  for (i = 2; i < points_count; i++) {
+
708  ids[0] = (nk_draw_index)(vtx_inner_idx);
+
709  ids[1] = (nk_draw_index)(vtx_inner_idx + ((i-1) << 1));
+
710  ids[2] = (nk_draw_index)(vtx_inner_idx + (i << 1));
+
711  ids += 3;
+
712  }
+
713 
+
714  /* compute normals */
+
715  for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
+
716  struct nk_vec2 p0 = points[i0];
+
717  struct nk_vec2 p1 = points[i1];
+
718  struct nk_vec2 diff = nk_vec2_sub(p1, p0);
+
719 
+
720  /* vec2 inverted length */
+
721  float len = nk_vec2_len_sqr(diff);
+
722  if (len != 0.0f)
+
723  len = NK_INV_SQRT(len);
+
724  else len = 1.0f;
+
725  diff = nk_vec2_muls(diff, len);
+
726 
+
727  normals[i0].x = diff.y;
+
728  normals[i0].y = -diff.x;
+
729  }
+
730 
+
731  /* add vertices + indexes */
+
732  for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
+
733  const struct nk_vec2 uv = list->config.tex_null.uv;
+
734  struct nk_vec2 n0 = normals[i0];
+
735  struct nk_vec2 n1 = normals[i1];
+
736  struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(n0, n1), 0.5f);
+
737  float dmr2 = dm.x*dm.x + dm.y*dm.y;
+
738  if (dmr2 > 0.000001f) {
+
739  float scale = 1.0f / dmr2;
+
740  scale = NK_MIN(scale, 100.0f);
+
741  dm = nk_vec2_muls(dm, scale);
+
742  }
+
743  dm = nk_vec2_muls(dm, AA_SIZE * 0.5f);
+
744 
+
745  /* add vertices */
+
746  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_sub(points[i1], dm), uv, col);
+
747  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_add(points[i1], dm), uv, col_trans);
+
748 
+
749  /* add indexes */
+
750  ids[0] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
+
751  ids[1] = (nk_draw_index)(vtx_inner_idx+(i0<<1));
+
752  ids[2] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
+
753  ids[3] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
+
754  ids[4] = (nk_draw_index)(vtx_outer_idx+(i1<<1));
+
755  ids[5] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
+
756  ids += 6;
+
757  }
+
758  /* free temporary normals + points */
+
759  nk_buffer_reset(list->vertices, NK_BUFFER_FRONT);
+
760  } else {
+
761  nk_size i = 0;
+
762  nk_size index = list->vertex_count;
+
763  const nk_size idx_count = (points_count-2)*3;
+
764  const nk_size vtx_count = points_count;
+
765  void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
+
766  nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
+
767 
+
768  if (!vtx || !ids) return;
+
769  for (i = 0; i < vtx_count; ++i)
+
770  vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.tex_null.uv, col);
+
771  for (i = 2; i < points_count; ++i) {
+
772  ids[0] = (nk_draw_index)index;
+
773  ids[1] = (nk_draw_index)(index+ i - 1);
+
774  ids[2] = (nk_draw_index)(index+i);
+
775  ids += 3;
+
776  }
+
777  }
+
778 }
+
779 NK_API void
+
780 nk_draw_list_path_clear(struct nk_draw_list *list)
+
781 {
+
782  NK_ASSERT(list);
+
783  if (!list) return;
+
784  nk_buffer_reset(list->buffer, NK_BUFFER_FRONT);
+
785  list->path_count = 0;
+
786  list->path_offset = 0;
+
787 }
+
788 NK_API void
+
789 nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos)
+
790 {
+
791  struct nk_vec2 *points = 0;
+
792  struct nk_draw_command *cmd = 0;
+
793  NK_ASSERT(list);
+
794  if (!list) return;
+
795  if (!list->cmd_count)
+
796  nk_draw_list_add_clip(list, nk_null_rect);
+
797 
+
798  cmd = nk_draw_list_command_last(list);
+
799  if (cmd && cmd->texture.ptr != list->config.tex_null.texture.ptr)
+
800  nk_draw_list_push_image(list, list->config.tex_null.texture);
+
801 
+
802  points = nk_draw_list_alloc_path(list, 1);
+
803  if (!points) return;
+
804  points[0] = pos;
+
805 }
+
806 NK_API void
+
807 nk_draw_list_path_arc_to_fast(struct nk_draw_list *list, struct nk_vec2 center,
+
808  float radius, int a_min, int a_max)
+
809 {
+
810  int a = 0;
+
811  NK_ASSERT(list);
+
812  if (!list) return;
+
813  if (a_min <= a_max) {
+
814  for (a = a_min; a <= a_max; a++) {
+
815  const struct nk_vec2 c = list->circle_vtx[(nk_size)a % NK_LEN(list->circle_vtx)];
+
816  const float x = center.x + c.x * radius;
+
817  const float y = center.y + c.y * radius;
+
818  nk_draw_list_path_line_to(list, nk_vec2(x, y));
+
819  }
+
820  }
+
821 }
+
822 NK_API void
+
823 nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center,
+
824  float radius, float a_min, float a_max, unsigned int segments)
+
825 {
+
826  unsigned int i = 0;
+
827  NK_ASSERT(list);
+
828  if (!list) return;
+
829  if (radius == 0.0f) return;
+
830 
+
831  /* This algorithm for arc drawing relies on these two trigonometric identities[1]:
+
832  sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b)
+
833  cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b)
+
834 
+
835  Two coordinates (x, y) of a point on a circle centered on
+
836  the origin can be written in polar form as:
+
837  x = r * cos(a)
+
838  y = r * sin(a)
+
839  where r is the radius of the circle,
+
840  a is the angle between (x, y) and the origin.
+
841 
+
842  This allows us to rotate the coordinates around the
+
843  origin by an angle b using the following transformation:
+
844  x' = r * cos(a + b) = x * cos(b) - y * sin(b)
+
845  y' = r * sin(a + b) = y * cos(b) + x * sin(b)
+
846 
+
847  [1] https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities
+
848  */
+
849  {const float d_angle = (a_max - a_min) / (float)segments;
+
850  const float sin_d = (float)NK_SIN(d_angle);
+
851  const float cos_d = (float)NK_COS(d_angle);
+
852 
+
853  float cx = (float)NK_COS(a_min) * radius;
+
854  float cy = (float)NK_SIN(a_min) * radius;
+
855  for(i = 0; i <= segments; ++i) {
+
856  float new_cx, new_cy;
+
857  const float x = center.x + cx;
+
858  const float y = center.y + cy;
+
859  nk_draw_list_path_line_to(list, nk_vec2(x, y));
+
860 
+
861  new_cx = cx * cos_d - cy * sin_d;
+
862  new_cy = cy * cos_d + cx * sin_d;
+
863  cx = new_cx;
+
864  cy = new_cy;
+
865  }}
+
866 }
+
867 NK_API void
+
868 nk_draw_list_path_rect_to(struct nk_draw_list *list, struct nk_vec2 a,
+
869  struct nk_vec2 b, float rounding)
+
870 {
+
871  float r;
+
872  NK_ASSERT(list);
+
873  if (!list) return;
+
874  r = rounding;
+
875  r = NK_MIN(r, ((b.x-a.x) < 0) ? -(b.x-a.x): (b.x-a.x));
+
876  r = NK_MIN(r, ((b.y-a.y) < 0) ? -(b.y-a.y): (b.y-a.y));
+
877 
+
878  if (r == 0.0f) {
+
879  nk_draw_list_path_line_to(list, a);
+
880  nk_draw_list_path_line_to(list, nk_vec2(b.x,a.y));
+
881  nk_draw_list_path_line_to(list, b);
+
882  nk_draw_list_path_line_to(list, nk_vec2(a.x,b.y));
+
883  } else {
+
884  nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, a.y + r), r, 6, 9);
+
885  nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, a.y + r), r, 9, 12);
+
886  nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, b.y - r), r, 0, 3);
+
887  nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, b.y - r), r, 3, 6);
+
888  }
+
889 }
+
890 NK_API void
+
891 nk_draw_list_path_curve_to(struct nk_draw_list *list, struct nk_vec2 p2,
+
892  struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments)
+
893 {
+
894  float t_step;
+
895  unsigned int i_step;
+
896  struct nk_vec2 p1;
+
897 
+
898  NK_ASSERT(list);
+
899  NK_ASSERT(list->path_count);
+
900  if (!list || !list->path_count) return;
+
901  num_segments = NK_MAX(num_segments, 1);
+
902 
+
903  p1 = nk_draw_list_path_last(list);
+
904  t_step = 1.0f/(float)num_segments;
+
905  for (i_step = 1; i_step <= num_segments; ++i_step) {
+
906  float t = t_step * (float)i_step;
+
907  float u = 1.0f - t;
+
908  float w1 = u*u*u;
+
909  float w2 = 3*u*u*t;
+
910  float w3 = 3*u*t*t;
+
911  float w4 = t * t *t;
+
912  float x = w1 * p1.x + w2 * p2.x + w3 * p3.x + w4 * p4.x;
+
913  float y = w1 * p1.y + w2 * p2.y + w3 * p3.y + w4 * p4.y;
+
914  nk_draw_list_path_line_to(list, nk_vec2(x,y));
+
915  }
+
916 }
+
917 NK_API void
+
918 nk_draw_list_path_fill(struct nk_draw_list *list, struct nk_color color)
+
919 {
+
920  struct nk_vec2 *points;
+
921  NK_ASSERT(list);
+
922  if (!list) return;
+
923  points = (struct nk_vec2*)nk_buffer_memory(list->buffer);
+
924  nk_draw_list_fill_poly_convex(list, points, list->path_count, color, list->config.shape_AA);
+
925  nk_draw_list_path_clear(list);
+
926 }
+
927 NK_API void
+
928 nk_draw_list_path_stroke(struct nk_draw_list *list, struct nk_color color,
+
929  enum nk_draw_list_stroke closed, float thickness)
+
930 {
+
931  struct nk_vec2 *points;
+
932  NK_ASSERT(list);
+
933  if (!list) return;
+
934  points = (struct nk_vec2*)nk_buffer_memory(list->buffer);
+
935  nk_draw_list_stroke_poly_line(list, points, list->path_count, color,
+
936  closed, thickness, list->config.line_AA);
+
937  nk_draw_list_path_clear(list);
+
938 }
+
939 NK_API void
+
940 nk_draw_list_stroke_line(struct nk_draw_list *list, struct nk_vec2 a,
+
941  struct nk_vec2 b, struct nk_color col, float thickness)
+
942 {
+
943  NK_ASSERT(list);
+
944  if (!list || !col.a) return;
+
945  if (list->line_AA == NK_ANTI_ALIASING_ON) {
+
946  nk_draw_list_path_line_to(list, a);
+
947  nk_draw_list_path_line_to(list, b);
+
948  } else {
+
949  nk_draw_list_path_line_to(list, nk_vec2_sub(a,nk_vec2(0.5f,0.5f)));
+
950  nk_draw_list_path_line_to(list, nk_vec2_sub(b,nk_vec2(0.5f,0.5f)));
+
951  }
+
952  nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
+
953 }
+
954 NK_API void
+
955 nk_draw_list_fill_rect(struct nk_draw_list *list, struct nk_rect rect,
+
956  struct nk_color col, float rounding)
+
957 {
+
958  NK_ASSERT(list);
+
959  if (!list || !col.a) return;
+
960 
+
961  if (list->line_AA == NK_ANTI_ALIASING_ON) {
+
962  nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y),
+
963  nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
+
964  } else {
+
965  nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f),
+
966  nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
+
967  } nk_draw_list_path_fill(list, col);
+
968 }
+
969 NK_API void
+
970 nk_draw_list_stroke_rect(struct nk_draw_list *list, struct nk_rect rect,
+
971  struct nk_color col, float rounding, float thickness)
+
972 {
+
973  NK_ASSERT(list);
+
974  if (!list || !col.a) return;
+
975  if (list->line_AA == NK_ANTI_ALIASING_ON) {
+
976  nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y),
+
977  nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
+
978  } else {
+
979  nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f),
+
980  nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
+
981  } nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
+
982 }
+
983 NK_API void
+
984 nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rect,
+
985  struct nk_color left, struct nk_color top, struct nk_color right,
+
986  struct nk_color bottom)
+
987 {
+
988  void *vtx;
+
989  struct nk_colorf col_left, col_top;
+
990  struct nk_colorf col_right, col_bottom;
+
991  nk_draw_index *idx;
+
992  nk_draw_index index;
+
993 
+
994  nk_color_fv(&col_left.r, left);
+
995  nk_color_fv(&col_right.r, right);
+
996  nk_color_fv(&col_top.r, top);
+
997  nk_color_fv(&col_bottom.r, bottom);
+
998 
+
999  NK_ASSERT(list);
+
1000  if (!list) return;
+
1001 
+
1002  nk_draw_list_push_image(list, list->config.tex_null.texture);
+
1003  index = (nk_draw_index)list->vertex_count;
+
1004  vtx = nk_draw_list_alloc_vertices(list, 4);
+
1005  idx = nk_draw_list_alloc_elements(list, 6);
+
1006  if (!vtx || !idx) return;
+
1007 
+
1008  idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1);
+
1009  idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0);
+
1010  idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3);
+
1011 
+
1012  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y), list->config.tex_null.uv, col_left);
+
1013  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y), list->config.tex_null.uv, col_top);
+
1014  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.tex_null.uv, col_right);
+
1015  vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.tex_null.uv, col_bottom);
+
1016 }
+
1017 NK_API void
+
1018 nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a,
+
1019  struct nk_vec2 b, struct nk_vec2 c, struct nk_color col)
+
1020 {
+
1021  NK_ASSERT(list);
+
1022  if (!list || !col.a) return;
+
1023  nk_draw_list_path_line_to(list, a);
+
1024  nk_draw_list_path_line_to(list, b);
+
1025  nk_draw_list_path_line_to(list, c);
+
1026  nk_draw_list_path_fill(list, col);
+
1027 }
+
1028 NK_API void
+
1029 nk_draw_list_stroke_triangle(struct nk_draw_list *list, struct nk_vec2 a,
+
1030  struct nk_vec2 b, struct nk_vec2 c, struct nk_color col, float thickness)
+
1031 {
+
1032  NK_ASSERT(list);
+
1033  if (!list || !col.a) return;
+
1034  nk_draw_list_path_line_to(list, a);
+
1035  nk_draw_list_path_line_to(list, b);
+
1036  nk_draw_list_path_line_to(list, c);
+
1037  nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
+
1038 }
+
1039 NK_API void
+
1040 nk_draw_list_fill_circle(struct nk_draw_list *list, struct nk_vec2 center,
+
1041  float radius, struct nk_color col, unsigned int segs)
+
1042 {
+
1043  float a_max;
+
1044  NK_ASSERT(list);
+
1045  if (!list || !col.a) return;
+
1046  a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs;
+
1047  nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
+
1048  nk_draw_list_path_fill(list, col);
+
1049 }
+
1050 NK_API void
+
1051 nk_draw_list_stroke_circle(struct nk_draw_list *list, struct nk_vec2 center,
+
1052  float radius, struct nk_color col, unsigned int segs, float thickness)
+
1053 {
+
1054  float a_max;
+
1055  NK_ASSERT(list);
+
1056  if (!list || !col.a) return;
+
1057  a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs;
+
1058  nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
+
1059  nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
+
1060 }
+
1061 NK_API void
+
1062 nk_draw_list_stroke_curve(struct nk_draw_list *list, struct nk_vec2 p0,
+
1063  struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1,
+
1064  struct nk_color col, unsigned int segments, float thickness)
+
1065 {
+
1066  NK_ASSERT(list);
+
1067  if (!list || !col.a) return;
+
1068  nk_draw_list_path_line_to(list, p0);
+
1069  nk_draw_list_path_curve_to(list, cp0, cp1, p1, segments);
+
1070  nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
+
1071 }
+
1072 NK_INTERN void
+
1073 nk_draw_list_push_rect_uv(struct nk_draw_list *list, struct nk_vec2 a,
+
1074  struct nk_vec2 c, struct nk_vec2 uva, struct nk_vec2 uvc,
+
1075  struct nk_color color)
+
1076 {
+
1077  void *vtx;
+
1078  struct nk_vec2 uvb;
+
1079  struct nk_vec2 uvd;
+
1080  struct nk_vec2 b;
+
1081  struct nk_vec2 d;
+
1082 
+
1083  struct nk_colorf col;
+
1084  nk_draw_index *idx;
+
1085  nk_draw_index index;
+
1086  NK_ASSERT(list);
+
1087  if (!list) return;
+
1088 
+
1089  nk_color_fv(&col.r, color);
+
1090  uvb = nk_vec2(uvc.x, uva.y);
+
1091  uvd = nk_vec2(uva.x, uvc.y);
+
1092  b = nk_vec2(c.x, a.y);
+
1093  d = nk_vec2(a.x, c.y);
+
1094 
+
1095  index = (nk_draw_index)list->vertex_count;
+
1096  vtx = nk_draw_list_alloc_vertices(list, 4);
+
1097  idx = nk_draw_list_alloc_elements(list, 6);
+
1098  if (!vtx || !idx) return;
+
1099 
+
1100  idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1);
+
1101  idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0);
+
1102  idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3);
+
1103 
+
1104  vtx = nk_draw_vertex(vtx, &list->config, a, uva, col);
+
1105  vtx = nk_draw_vertex(vtx, &list->config, b, uvb, col);
+
1106  vtx = nk_draw_vertex(vtx, &list->config, c, uvc, col);
+
1107  vtx = nk_draw_vertex(vtx, &list->config, d, uvd, col);
+
1108 }
+
1109 NK_API void
+
1110 nk_draw_list_add_image(struct nk_draw_list *list, struct nk_image texture,
+
1111  struct nk_rect rect, struct nk_color color)
+
1112 {
+
1113  NK_ASSERT(list);
+
1114  if (!list) return;
+
1115  /* push new command with given texture */
+
1116  nk_draw_list_push_image(list, texture.handle);
+
1117  if (nk_image_is_subimage(&texture)) {
+
1118  /* add region inside of the texture */
+
1119  struct nk_vec2 uv[2];
+
1120  uv[0].x = (float)texture.region[0]/(float)texture.w;
+
1121  uv[0].y = (float)texture.region[1]/(float)texture.h;
+
1122  uv[1].x = (float)(texture.region[0] + texture.region[2])/(float)texture.w;
+
1123  uv[1].y = (float)(texture.region[1] + texture.region[3])/(float)texture.h;
+
1124  nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y),
+
1125  nk_vec2(rect.x + rect.w, rect.y + rect.h), uv[0], uv[1], color);
+
1126  } else nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y),
+
1127  nk_vec2(rect.x + rect.w, rect.y + rect.h),
+
1128  nk_vec2(0.0f, 0.0f), nk_vec2(1.0f, 1.0f),color);
+
1129 }
+
1130 NK_API void
+
1131 nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font,
+
1132  struct nk_rect rect, const char *text, int len, float font_height,
+
1133  struct nk_color fg)
+
1134 {
+
1135  float x = 0;
+
1136  int text_len = 0;
+
1137  nk_rune unicode = 0;
+
1138  nk_rune next = 0;
+
1139  int glyph_len = 0;
+
1140  int next_glyph_len = 0;
+
1141  struct nk_user_font_glyph g;
+
1142 
+
1143  NK_ASSERT(list);
+
1144  if (!list || !len || !text) return;
+
1145  if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
+
1146  list->clip_rect.x, list->clip_rect.y, list->clip_rect.w, list->clip_rect.h)) return;
+
1147 
+
1148  nk_draw_list_push_image(list, font->texture);
+
1149  x = rect.x;
+
1150  glyph_len = nk_utf_decode(text, &unicode, len);
+
1151  if (!glyph_len) return;
+
1152 
+
1153  /* draw every glyph image */
+
1154  fg.a = (nk_byte)((float)fg.a * list->config.global_alpha);
+
1155  while (text_len < len && glyph_len) {
+
1156  float gx, gy, gh, gw;
+
1157  float char_width = 0;
+
1158  if (unicode == NK_UTF_INVALID) break;
+
1159 
+
1160  /* query currently drawn glyph information */
+
1161  next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len);
+
1162  font->query(font->userdata, font_height, &g, unicode,
+
1163  (next == NK_UTF_INVALID) ? '\0' : next);
+
1164 
+
1165  /* calculate and draw glyph drawing rectangle and image */
+
1166  gx = x + g.offset.x;
+
1167  gy = rect.y + g.offset.y;
+
1168  gw = g.width; gh = g.height;
+
1169  char_width = g.xadvance;
+
1170  nk_draw_list_push_rect_uv(list, nk_vec2(gx,gy), nk_vec2(gx + gw, gy+ gh),
+
1171  g.uv[0], g.uv[1], fg);
+
1172 
+
1173  /* offset next glyph */
+
1174  text_len += glyph_len;
+
1175  x += char_width;
+
1176  glyph_len = next_glyph_len;
+
1177  unicode = next;
+
1178  }
+
1179 }
+
1180 NK_API nk_flags
+
1181 nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
+
1182  struct nk_buffer *vertices, struct nk_buffer *elements,
+
1183  const struct nk_convert_config *config)
+
1184 {
+
1185  nk_flags res = NK_CONVERT_SUCCESS;
+
1186  const struct nk_command *cmd;
+
1187  NK_ASSERT(ctx);
+
1188  NK_ASSERT(cmds);
+
1189  NK_ASSERT(vertices);
+
1190  NK_ASSERT(elements);
+
1191  NK_ASSERT(config);
+
1192  NK_ASSERT(config->vertex_layout);
+
1193  NK_ASSERT(config->vertex_size);
+
1194  if (!ctx || !cmds || !vertices || !elements || !config || !config->vertex_layout)
+
1195  return NK_CONVERT_INVALID_PARAM;
+
1196 
+
1197  nk_draw_list_setup(&ctx->draw_list, config, cmds, vertices, elements,
+
1198  config->line_AA, config->shape_AA);
+
1199  nk_foreach(cmd, ctx)
+
1200  {
+
1201 #ifdef NK_INCLUDE_COMMAND_USERDATA
+
1202  ctx->draw_list.userdata = cmd->userdata;
+
1203 #endif
+
1204  switch (cmd->type) {
+
1205  case NK_COMMAND_NOP: break;
+
1206  case NK_COMMAND_SCISSOR: {
+
1207  const struct nk_command_scissor *s = (const struct nk_command_scissor*)cmd;
+
1208  nk_draw_list_add_clip(&ctx->draw_list, nk_rect(s->x, s->y, s->w, s->h));
+
1209  } break;
+
1210  case NK_COMMAND_LINE: {
+
1211  const struct nk_command_line *l = (const struct nk_command_line*)cmd;
+
1212  nk_draw_list_stroke_line(&ctx->draw_list, nk_vec2(l->begin.x, l->begin.y),
+
1213  nk_vec2(l->end.x, l->end.y), l->color, l->line_thickness);
+
1214  } break;
+
1215  case NK_COMMAND_CURVE: {
+
1216  const struct nk_command_curve *q = (const struct nk_command_curve*)cmd;
+
1217  nk_draw_list_stroke_curve(&ctx->draw_list, nk_vec2(q->begin.x, q->begin.y),
+
1218  nk_vec2(q->ctrl[0].x, q->ctrl[0].y), nk_vec2(q->ctrl[1].x,
+
1219  q->ctrl[1].y), nk_vec2(q->end.x, q->end.y), q->color,
+
1220  config->curve_segment_count, q->line_thickness);
+
1221  } break;
+
1222  case NK_COMMAND_RECT: {
+
1223  const struct nk_command_rect *r = (const struct nk_command_rect*)cmd;
+
1224  nk_draw_list_stroke_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
+
1225  r->color, (float)r->rounding, r->line_thickness);
+
1226  } break;
+
1227  case NK_COMMAND_RECT_FILLED: {
+
1228  const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled*)cmd;
+
1229  nk_draw_list_fill_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
+
1230  r->color, (float)r->rounding);
+
1231  } break;
+
1232  case NK_COMMAND_RECT_MULTI_COLOR: {
+
1233  const struct nk_command_rect_multi_color *r = (const struct nk_command_rect_multi_color*)cmd;
+
1234  nk_draw_list_fill_rect_multi_color(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
+
1235  r->left, r->top, r->right, r->bottom);
+
1236  } break;
+
1237  case NK_COMMAND_CIRCLE: {
+
1238  const struct nk_command_circle *c = (const struct nk_command_circle*)cmd;
+
1239  nk_draw_list_stroke_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2,
+
1240  (float)c->y + (float)c->h/2), (float)c->w/2, c->color,
+
1241  config->circle_segment_count, c->line_thickness);
+
1242  } break;
+
1243  case NK_COMMAND_CIRCLE_FILLED: {
+
1244  const struct nk_command_circle_filled *c = (const struct nk_command_circle_filled *)cmd;
+
1245  nk_draw_list_fill_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2,
+
1246  (float)c->y + (float)c->h/2), (float)c->w/2, c->color,
+
1247  config->circle_segment_count);
+
1248  } break;
+
1249  case NK_COMMAND_ARC: {
+
1250  const struct nk_command_arc *c = (const struct nk_command_arc*)cmd;
+
1251  nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy));
+
1252  nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r,
+
1253  c->a[0], c->a[1], config->arc_segment_count);
+
1254  nk_draw_list_path_stroke(&ctx->draw_list, c->color, NK_STROKE_CLOSED, c->line_thickness);
+
1255  } break;
+
1256  case NK_COMMAND_ARC_FILLED: {
+
1257  const struct nk_command_arc_filled *c = (const struct nk_command_arc_filled*)cmd;
+
1258  nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy));
+
1259  nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r,
+
1260  c->a[0], c->a[1], config->arc_segment_count);
+
1261  nk_draw_list_path_fill(&ctx->draw_list, c->color);
+
1262  } break;
+
1263  case NK_COMMAND_TRIANGLE: {
+
1264  const struct nk_command_triangle *t = (const struct nk_command_triangle*)cmd;
+
1265  nk_draw_list_stroke_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y),
+
1266  nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color,
+
1267  t->line_thickness);
+
1268  } break;
+
1269  case NK_COMMAND_TRIANGLE_FILLED: {
+
1270  const struct nk_command_triangle_filled *t = (const struct nk_command_triangle_filled*)cmd;
+
1271  nk_draw_list_fill_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y),
+
1272  nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color);
+
1273  } break;
+
1274  case NK_COMMAND_POLYGON: {
+
1275  int i;
+
1276  const struct nk_command_polygon*p = (const struct nk_command_polygon*)cmd;
+
1277  for (i = 0; i < p->point_count; ++i) {
+
1278  struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
+
1279  nk_draw_list_path_line_to(&ctx->draw_list, pnt);
+
1280  }
+
1281  nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_CLOSED, p->line_thickness);
+
1282  } break;
+
1283  case NK_COMMAND_POLYGON_FILLED: {
+
1284  int i;
+
1285  const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled*)cmd;
+
1286  for (i = 0; i < p->point_count; ++i) {
+
1287  struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
+
1288  nk_draw_list_path_line_to(&ctx->draw_list, pnt);
+
1289  }
+
1290  nk_draw_list_path_fill(&ctx->draw_list, p->color);
+
1291  } break;
+
1292  case NK_COMMAND_POLYLINE: {
+
1293  int i;
+
1294  const struct nk_command_polyline *p = (const struct nk_command_polyline*)cmd;
+
1295  for (i = 0; i < p->point_count; ++i) {
+
1296  struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
+
1297  nk_draw_list_path_line_to(&ctx->draw_list, pnt);
+
1298  }
+
1299  nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_OPEN, p->line_thickness);
+
1300  } break;
+
1301  case NK_COMMAND_TEXT: {
+
1302  const struct nk_command_text *t = (const struct nk_command_text*)cmd;
+
1303  nk_draw_list_add_text(&ctx->draw_list, t->font, nk_rect(t->x, t->y, t->w, t->h),
+
1304  t->string, t->length, t->height, t->foreground);
+
1305  } break;
+
1306  case NK_COMMAND_IMAGE: {
+
1307  const struct nk_command_image *i = (const struct nk_command_image*)cmd;
+
1308  nk_draw_list_add_image(&ctx->draw_list, i->img, nk_rect(i->x, i->y, i->w, i->h), i->col);
+
1309  } break;
+
1310  case NK_COMMAND_CUSTOM: {
+
1311  const struct nk_command_custom *c = (const struct nk_command_custom*)cmd;
+
1312  c->callback(&ctx->draw_list, c->x, c->y, c->w, c->h, c->callback_data);
+
1313  } break;
+
1314  default: break;
+
1315  }
+
1316  }
+
1317  res |= (cmds->needed > cmds->allocated + (cmds->memory.size - cmds->size)) ? NK_CONVERT_COMMAND_BUFFER_FULL: 0;
+
1318  res |= (vertices->needed > vertices->allocated) ? NK_CONVERT_VERTEX_BUFFER_FULL: 0;
+
1319  res |= (elements->needed > elements->allocated) ? NK_CONVERT_ELEMENT_BUFFER_FULL: 0;
+
1320  return res;
+
1321 }
+
1322 NK_API const struct nk_draw_command*
+
1323 nk__draw_begin(const struct nk_context *ctx,
+
1324  const struct nk_buffer *buffer)
+
1325 {
+
1326  return nk__draw_list_begin(&ctx->draw_list, buffer);
+
1327 }
+
1328 NK_API const struct nk_draw_command*
+
1329 nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buffer)
+
1330 {
+
1331  return nk__draw_list_end(&ctx->draw_list, buffer);
+
1332 }
+
1333 NK_API const struct nk_draw_command*
+
1334 nk__draw_next(const struct nk_draw_command *cmd,
+
1335  const struct nk_buffer *buffer, const struct nk_context *ctx)
+
1336 {
+
1337  return nk__draw_list_next(cmd, buffer, &ctx->draw_list);
+
1338 }
+
1339 #endif
+
1340 
+
main API and documentation file
+
#define NK_UTF_INVALID
internal invalid utf8 rune
Definition: nuklear.h:5750
+
#define nk_foreach(c, ctx)
Iterates over each draw command inside the context draw command list.
Definition: nuklear.h:1031
+ +
struct nk_memory memory
!< memory management type
Definition: nuklear.h:4193
+
nk_size needed
!< total amount of memory allocated
Definition: nuklear.h:4196
+
nk_size size
!< number of allocation calls
Definition: nuklear.h:4198
+
nk_size allocated
!< growing factor for dynamic memory management
Definition: nuklear.h:4195
+ + + + + + + + + + + + + + + + + + + + +
command base and header of every command inside the buffer
Definition: nuklear.h:4467
+ + +
enum nk_anti_aliasing shape_AA
!< line anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:981
+
enum nk_anti_aliasing line_AA
!< global alpha value
Definition: nuklear.h:980
+
nk_size vertex_size
!< describes the vertex output format and packing
Definition: nuklear.h:987
+
const struct nk_draw_vertex_layout_element * vertex_layout
!< handle to texture with a white pixel for shape drawing
Definition: nuklear.h:986
+
unsigned arc_segment_count
!< number of segments used for circles: default to 22
Definition: nuklear.h:983
+
unsigned circle_segment_count
!< shape anti-aliasing flag can be turned off if you are tight on memory
Definition: nuklear.h:982
+
unsigned curve_segment_count
!< number of segments used for arcs: default to 22
Definition: nuklear.h:984
+ + + + + +
+
+ + + + diff --git a/nuklear__widget_8c_source.html b/nuklear__widget_8c_source.html new file mode 100644 index 000000000..53491fa72 --- /dev/null +++ b/nuklear__widget_8c_source.html @@ -0,0 +1,483 @@ + + + + + + + +Nuklear: src/nuklear_widget.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_widget.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * WIDGET
+
7  *
+
8  * ===============================================================*/
+
9 NK_API struct nk_rect
+
10 nk_widget_bounds(const struct nk_context *ctx)
+
11 {
+
12  struct nk_rect bounds;
+
13  NK_ASSERT(ctx);
+
14  NK_ASSERT(ctx->current);
+
15  if (!ctx || !ctx->current)
+
16  return nk_rect(0,0,0,0);
+
17  nk_layout_peek(&bounds, ctx);
+
18  return bounds;
+
19 }
+
20 NK_API struct nk_vec2
+
21 nk_widget_position(const struct nk_context *ctx)
+
22 {
+
23  struct nk_rect bounds;
+
24  NK_ASSERT(ctx);
+
25  NK_ASSERT(ctx->current);
+
26  if (!ctx || !ctx->current)
+
27  return nk_vec2(0,0);
+
28 
+
29  nk_layout_peek(&bounds, ctx);
+
30  return nk_vec2(bounds.x, bounds.y);
+
31 }
+
32 NK_API struct nk_vec2
+
33 nk_widget_size(const struct nk_context *ctx)
+
34 {
+
35  struct nk_rect bounds;
+
36  NK_ASSERT(ctx);
+
37  NK_ASSERT(ctx->current);
+
38  if (!ctx || !ctx->current)
+
39  return nk_vec2(0,0);
+
40 
+
41  nk_layout_peek(&bounds, ctx);
+
42  return nk_vec2(bounds.w, bounds.h);
+
43 }
+
44 NK_API float
+
45 nk_widget_width(const struct nk_context *ctx)
+
46 {
+
47  struct nk_rect bounds;
+
48  NK_ASSERT(ctx);
+
49  NK_ASSERT(ctx->current);
+
50  if (!ctx || !ctx->current)
+
51  return 0;
+
52 
+
53  nk_layout_peek(&bounds, ctx);
+
54  return bounds.w;
+
55 }
+
56 NK_API float
+
57 nk_widget_height(const struct nk_context *ctx)
+
58 {
+
59  struct nk_rect bounds;
+
60  NK_ASSERT(ctx);
+
61  NK_ASSERT(ctx->current);
+
62  if (!ctx || !ctx->current)
+
63  return 0;
+
64 
+
65  nk_layout_peek(&bounds, ctx);
+
66  return bounds.h;
+
67 }
+
68 NK_API nk_bool
+
69 nk_widget_is_hovered(const struct nk_context *ctx)
+
70 {
+
71  struct nk_rect c, v;
+
72  struct nk_rect bounds;
+
73  NK_ASSERT(ctx);
+
74  NK_ASSERT(ctx->current);
+
75  if (!ctx || !ctx->current || ctx->active != ctx->current)
+
76  return 0;
+
77 
+
78  c = ctx->current->layout->clip;
+
79  c.x = (float)((int)c.x);
+
80  c.y = (float)((int)c.y);
+
81  c.w = (float)((int)c.w);
+
82  c.h = (float)((int)c.h);
+
83 
+
84  nk_layout_peek(&bounds, ctx);
+
85  nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+
86  if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+
87  return 0;
+
88  return nk_input_is_mouse_hovering_rect(&ctx->input, bounds);
+
89 }
+
90 NK_API nk_bool
+
91 nk_widget_is_mouse_clicked(const struct nk_context *ctx, enum nk_buttons btn)
+
92 {
+
93  struct nk_rect c, v;
+
94  struct nk_rect bounds;
+
95  NK_ASSERT(ctx);
+
96  NK_ASSERT(ctx->current);
+
97  if (!ctx || !ctx->current || ctx->active != ctx->current)
+
98  return 0;
+
99 
+
100  c = ctx->current->layout->clip;
+
101  c.x = (float)((int)c.x);
+
102  c.y = (float)((int)c.y);
+
103  c.w = (float)((int)c.w);
+
104  c.h = (float)((int)c.h);
+
105 
+
106  nk_layout_peek(&bounds, ctx);
+
107  nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+
108  if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+
109  return 0;
+
110  return nk_input_mouse_clicked(&ctx->input, btn, bounds);
+
111 }
+
112 NK_API nk_bool
+
113 nk_widget_has_mouse_click_down(const struct nk_context *ctx, enum nk_buttons btn, nk_bool down)
+
114 {
+
115  struct nk_rect c, v;
+
116  struct nk_rect bounds;
+
117  NK_ASSERT(ctx);
+
118  NK_ASSERT(ctx->current);
+
119  if (!ctx || !ctx->current || ctx->active != ctx->current)
+
120  return 0;
+
121 
+
122  c = ctx->current->layout->clip;
+
123  c.x = (float)((int)c.x);
+
124  c.y = (float)((int)c.y);
+
125  c.w = (float)((int)c.w);
+
126  c.h = (float)((int)c.h);
+
127 
+
128  nk_layout_peek(&bounds, ctx);
+
129  nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+
130  if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+
131  return 0;
+
132  return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down);
+
133 }
+
134 NK_API enum nk_widget_layout_states
+
135 nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
+
136 {
+
137  struct nk_rect c, v;
+
138  struct nk_window *win;
+
139  struct nk_panel *layout;
+
140  const struct nk_input *in;
+
141 
+
142  NK_ASSERT(ctx);
+
143  NK_ASSERT(ctx->current);
+
144  NK_ASSERT(ctx->current->layout);
+
145  if (!ctx || !ctx->current || !ctx->current->layout)
+
146  return NK_WIDGET_INVALID;
+
147 
+
148  /* allocate space and check if the widget needs to be updated and drawn */
+
149  nk_panel_alloc_space(bounds, ctx);
+
150  win = ctx->current;
+
151  layout = win->layout;
+
152  in = &ctx->input;
+
153  c = layout->clip;
+
154 
+
155  /* if one of these triggers you forgot to add an `if` condition around either
+
156  a window, group, popup, combobox or contextual menu `begin` and `end` block.
+
157  Example:
+
158  if (nk_begin(...) {...} nk_end(...); or
+
159  if (nk_group_begin(...) { nk_group_end(...);} */
+
160  NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
+
161  NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
+
162  NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
+
163 
+
164  /* need to convert to int here to remove floating point errors */
+
165  bounds->x = (float)((int)bounds->x);
+
166  bounds->y = (float)((int)bounds->y);
+
167  bounds->w = (float)((int)bounds->w);
+
168  bounds->h = (float)((int)bounds->h);
+
169 
+
170  c.x = (float)((int)c.x);
+
171  c.y = (float)((int)c.y);
+
172  c.w = (float)((int)c.w);
+
173  c.h = (float)((int)c.h);
+
174 
+
175  nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
+
176  if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
+
177  return NK_WIDGET_INVALID;
+
178  if (win->widgets_disabled)
+
179  return NK_WIDGET_DISABLED;
+
180  if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
+
181  return NK_WIDGET_ROM;
+
182  return NK_WIDGET_VALID;
+
183 }
+
184 NK_API enum nk_widget_layout_states
+
185 nk_widget_fitting(struct nk_rect *bounds, const struct nk_context *ctx,
+
186  struct nk_vec2 item_padding)
+
187 {
+
188  /* update the bounds to stand without padding */
+
189  enum nk_widget_layout_states state;
+
190  NK_UNUSED(item_padding);
+
191 
+
192  NK_ASSERT(ctx);
+
193  NK_ASSERT(ctx->current);
+
194  NK_ASSERT(ctx->current->layout);
+
195  if (!ctx || !ctx->current || !ctx->current->layout)
+
196  return NK_WIDGET_INVALID;
+
197 
+
198  state = nk_widget(bounds, ctx);
+
199  return state;
+
200 }
+
201 NK_API void
+
202 nk_spacing(struct nk_context *ctx, int cols)
+
203 {
+
204  struct nk_window *win;
+
205  struct nk_panel *layout;
+
206  struct nk_rect none;
+
207  int i, index, rows;
+
208 
+
209  NK_ASSERT(ctx);
+
210  NK_ASSERT(ctx->current);
+
211  NK_ASSERT(ctx->current->layout);
+
212  if (!ctx || !ctx->current || !ctx->current->layout)
+
213  return;
+
214 
+
215  /* spacing over row boundaries */
+
216  win = ctx->current;
+
217  layout = win->layout;
+
218  index = (layout->row.index + cols) % layout->row.columns;
+
219  rows = (layout->row.index + cols) / layout->row.columns;
+
220  if (rows) {
+
221  for (i = 0; i < rows; ++i)
+
222  nk_panel_alloc_row(ctx, win);
+
223  cols = index;
+
224  }
+
225  /* non table layout need to allocate space */
+
226  if (layout->row.type != NK_LAYOUT_DYNAMIC_FIXED &&
+
227  layout->row.type != NK_LAYOUT_STATIC_FIXED) {
+
228  for (i = 0; i < cols; ++i)
+
229  nk_panel_alloc_space(&none, ctx);
+
230  } layout->row.index = index;
+
231 }
+
232 NK_API void
+
233 nk_widget_disable_begin(struct nk_context* ctx)
+
234 {
+
235  struct nk_window* win;
+
236  struct nk_style* style;
+
237 
+
238  NK_ASSERT(ctx);
+
239  NK_ASSERT(ctx->current);
+
240 
+
241  if (!ctx || !ctx->current)
+
242  return;
+
243 
+
244  win = ctx->current;
+
245  style = &ctx->style;
+
246 
+
247  win->widgets_disabled = nk_true;
+
248 
+
249  style->button.color_factor_text = style->button.disabled_factor;
+
250  style->button.color_factor_background = style->button.disabled_factor;
+
251  style->chart.color_factor = style->chart.disabled_factor;
+
252  style->checkbox.color_factor = style->checkbox.disabled_factor;
+
253  style->combo.color_factor = style->combo.disabled_factor;
+
254  style->combo.button.color_factor_text = style->combo.button.disabled_factor;
+
255  style->combo.button.color_factor_background = style->combo.button.disabled_factor;
+
256  style->contextual_button.color_factor_text = style->contextual_button.disabled_factor;
+
257  style->contextual_button.color_factor_background = style->contextual_button.disabled_factor;
+
258  style->edit.color_factor = style->edit.disabled_factor;
+
259  style->edit.scrollbar.color_factor = style->edit.scrollbar.disabled_factor;
+
260  style->menu_button.color_factor_text = style->menu_button.disabled_factor;
+
261  style->menu_button.color_factor_background = style->menu_button.disabled_factor;
+
262  style->option.color_factor = style->option.disabled_factor;
+
263  style->progress.color_factor = style->progress.disabled_factor;
+
264  style->property.color_factor = style->property.disabled_factor;
+
265  style->property.inc_button.color_factor_text = style->property.inc_button.disabled_factor;
+
266  style->property.inc_button.color_factor_background = style->property.inc_button.disabled_factor;
+
267  style->property.dec_button.color_factor_text = style->property.dec_button.disabled_factor;
+
268  style->property.dec_button.color_factor_background = style->property.dec_button.disabled_factor;
+
269  style->property.edit.color_factor = style->property.edit.disabled_factor;
+
270  style->scrollh.color_factor = style->scrollh.disabled_factor;
+
271  style->scrollh.inc_button.color_factor_text = style->scrollh.inc_button.disabled_factor;
+
272  style->scrollh.inc_button.color_factor_background = style->scrollh.inc_button.disabled_factor;
+
273  style->scrollh.dec_button.color_factor_text = style->scrollh.dec_button.disabled_factor;
+
274  style->scrollh.dec_button.color_factor_background = style->scrollh.dec_button.disabled_factor;
+
275  style->scrollv.color_factor = style->scrollv.disabled_factor;
+
276  style->scrollv.inc_button.color_factor_text = style->scrollv.inc_button.disabled_factor;
+
277  style->scrollv.inc_button.color_factor_background = style->scrollv.inc_button.disabled_factor;
+
278  style->scrollv.dec_button.color_factor_text = style->scrollv.dec_button.disabled_factor;
+
279  style->scrollv.dec_button.color_factor_background = style->scrollv.dec_button.disabled_factor;
+
280  style->selectable.color_factor = style->selectable.disabled_factor;
+
281  style->slider.color_factor = style->slider.disabled_factor;
+
282  style->slider.inc_button.color_factor_text = style->slider.inc_button.disabled_factor;
+
283  style->slider.inc_button.color_factor_background = style->slider.inc_button.disabled_factor;
+
284  style->slider.dec_button.color_factor_text = style->slider.dec_button.disabled_factor;
+
285  style->slider.dec_button.color_factor_background = style->slider.dec_button.disabled_factor;
+
286  style->tab.color_factor = style->tab.disabled_factor;
+
287  style->tab.node_maximize_button.color_factor_text = style->tab.node_maximize_button.disabled_factor;
+
288  style->tab.node_minimize_button.color_factor_text = style->tab.node_minimize_button.disabled_factor;
+
289  style->tab.tab_maximize_button.color_factor_text = style->tab.tab_maximize_button.disabled_factor;
+
290  style->tab.tab_maximize_button.color_factor_background = style->tab.tab_maximize_button.disabled_factor;
+
291  style->tab.tab_minimize_button.color_factor_text = style->tab.tab_minimize_button.disabled_factor;
+
292  style->tab.tab_minimize_button.color_factor_background = style->tab.tab_minimize_button.disabled_factor;
+
293  style->text.color_factor = style->text.disabled_factor;
+
294 }
+
295 NK_API void
+
296 nk_widget_disable_end(struct nk_context* ctx)
+
297 {
+
298  struct nk_window* win;
+
299  struct nk_style* style;
+
300 
+
301  NK_ASSERT(ctx);
+
302  NK_ASSERT(ctx->current);
+
303 
+
304  if (!ctx || !ctx->current)
+
305  return;
+
306 
+
307  win = ctx->current;
+
308  style = &ctx->style;
+
309 
+
310  win->widgets_disabled = nk_false;
+
311 
+
312  style->button.color_factor_text = 1.0f;
+
313  style->button.color_factor_background = 1.0f;
+
314  style->chart.color_factor = 1.0f;
+
315  style->checkbox.color_factor = 1.0f;
+
316  style->combo.color_factor = 1.0f;
+
317  style->combo.button.color_factor_text = 1.0f;
+
318  style->combo.button.color_factor_background = 1.0f;
+
319  style->contextual_button.color_factor_text = 1.0f;
+
320  style->contextual_button.color_factor_background = 1.0f;
+
321  style->edit.color_factor = 1.0f;
+
322  style->edit.scrollbar.color_factor = 1.0f;
+
323  style->menu_button.color_factor_text = 1.0f;
+
324  style->menu_button.color_factor_background = 1.0f;
+
325  style->option.color_factor = 1.0f;
+
326  style->progress.color_factor = 1.0f;
+
327  style->property.color_factor = 1.0f;
+
328  style->property.inc_button.color_factor_text = 1.0f;
+
329  style->property.inc_button.color_factor_background = 1.0f;
+
330  style->property.dec_button.color_factor_text = 1.0f;
+
331  style->property.dec_button.color_factor_background = 1.0f;
+
332  style->property.edit.color_factor = 1.0f;
+
333  style->scrollh.color_factor = 1.0f;
+
334  style->scrollh.inc_button.color_factor_text = 1.0f;
+
335  style->scrollh.inc_button.color_factor_background = 1.0f;
+
336  style->scrollh.dec_button.color_factor_text = 1.0f;
+
337  style->scrollh.dec_button.color_factor_background = 1.0f;
+
338  style->scrollv.color_factor = 1.0f;
+
339  style->scrollv.inc_button.color_factor_text = 1.0f;
+
340  style->scrollv.inc_button.color_factor_background = 1.0f;
+
341  style->scrollv.dec_button.color_factor_text = 1.0f;
+
342  style->scrollv.dec_button.color_factor_background = 1.0f;
+
343  style->selectable.color_factor = 1.0f;
+
344  style->slider.color_factor = 1.0f;
+
345  style->slider.inc_button.color_factor_text = 1.0f;
+
346  style->slider.inc_button.color_factor_background = 1.0f;
+
347  style->slider.dec_button.color_factor_text = 1.0f;
+
348  style->slider.dec_button.color_factor_background = 1.0f;
+
349  style->tab.color_factor = 1.0f;
+
350  style->tab.node_maximize_button.color_factor_text = 1.0f;
+
351  style->tab.node_minimize_button.color_factor_text = 1.0f;
+
352  style->tab.tab_maximize_button.color_factor_text = 1.0f;
+
353  style->tab.tab_maximize_button.color_factor_background = 1.0f;
+
354  style->tab.tab_minimize_button.color_factor_text = 1.0f;
+
355  style->tab.tab_minimize_button.color_factor_background = 1.0f;
+
356  style->text.color_factor = 1.0f;
+
357 }
+
main API and documentation file
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
@ NK_WIDGET_DISABLED
The widget is manually disabled and acts like NK_WIDGET_ROM.
Definition: nuklear.h:3085
+
@ NK_WIDGET_ROM
The widget is partially visible and cannot be updated.
Definition: nuklear.h:3084
+
@ NK_WIDGET_VALID
The widget is completely inside the window and can be updated and drawn.
Definition: nuklear.h:3083
+
@ NK_WIDGET_INVALID
The widget cannot be seen and is completely out of view.
Definition: nuklear.h:3082
+ + + + + + + +
+
+ + + + diff --git a/nuklear__window_8c_source.html b/nuklear__window_8c_source.html new file mode 100644 index 000000000..ec09f8f3e --- /dev/null +++ b/nuklear__window_8c_source.html @@ -0,0 +1,845 @@ + + + + + + + +Nuklear: src/nuklear_window.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
nuklear_window.c
+
+
+
1 #include "nuklear.h"
+
2 #include "nuklear_internal.h"
+
3 
+
4 /* ===============================================================
+
5  *
+
6  * WINDOW
+
7  *
+
8  * ===============================================================*/
+
9 NK_LIB void*
+
10 nk_create_window(struct nk_context *ctx)
+
11 {
+
12  struct nk_page_element *elem;
+
13  elem = nk_create_page_element(ctx);
+
14  if (!elem) return 0;
+
15  elem->data.win.seq = ctx->seq;
+
16  return &elem->data.win;
+
17 }
+
18 NK_LIB void
+
19 nk_free_window(struct nk_context *ctx, struct nk_window *win)
+
20 {
+
21  /* unlink windows from list */
+
22  struct nk_table *it = win->tables;
+
23  if (win->popup.win) {
+
24  nk_free_window(ctx, win->popup.win);
+
25  win->popup.win = 0;
+
26  }
+
27  win->next = 0;
+
28  win->prev = 0;
+
29 
+
30  while (it) {
+
31  /*free window state tables */
+
32  struct nk_table *n = it->next;
+
33  nk_remove_table(win, it);
+
34  nk_free_table(ctx, it);
+
35  if (it == win->tables)
+
36  win->tables = n;
+
37  it = n;
+
38  }
+
39 
+
40  /* link windows into freelist */
+
41  {union nk_page_data *pd = NK_CONTAINER_OF(win, union nk_page_data, win);
+
42  struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+
43  nk_free_page_element(ctx, pe);}
+
44 }
+
45 NK_LIB struct nk_window*
+
46 nk_find_window(const struct nk_context *ctx, nk_hash hash, const char *name)
+
47 {
+
48  struct nk_window *iter;
+
49  iter = ctx->begin;
+
50  while (iter) {
+
51  NK_ASSERT(iter != iter->next);
+
52  if (iter->name == hash) {
+
53  int max_len = nk_strlen(iter->name_string);
+
54  if (!nk_stricmpn(iter->name_string, name, max_len))
+
55  return iter;
+
56  }
+
57  iter = iter->next;
+
58  }
+
59  return 0;
+
60 }
+
61 NK_LIB void
+
62 nk_insert_window(struct nk_context *ctx, struct nk_window *win,
+
63  enum nk_window_insert_location loc)
+
64 {
+
65  const struct nk_window *iter;
+
66  NK_ASSERT(ctx);
+
67  NK_ASSERT(win);
+
68  if (!win || !ctx) return;
+
69 
+
70  iter = ctx->begin;
+
71  while (iter) {
+
72  NK_ASSERT(iter != iter->next);
+
73  NK_ASSERT(iter != win);
+
74  if (iter == win) return;
+
75  iter = iter->next;
+
76  }
+
77 
+
78  if (!ctx->begin) {
+
79  win->next = 0;
+
80  win->prev = 0;
+
81  ctx->begin = win;
+
82  ctx->end = win;
+
83  ctx->count = 1;
+
84  return;
+
85  }
+
86  if (loc == NK_INSERT_BACK) {
+
87  struct nk_window *end;
+
88  end = ctx->end;
+
89  end->flags |= NK_WINDOW_ROM;
+
90  end->next = win;
+
91  win->prev = ctx->end;
+
92  win->next = 0;
+
93  ctx->end = win;
+
94  ctx->active = ctx->end;
+
95  ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
96  } else {
+
97  /*ctx->end->flags |= NK_WINDOW_ROM;*/
+
98  ctx->begin->prev = win;
+
99  win->next = ctx->begin;
+
100  win->prev = 0;
+
101  ctx->begin = win;
+
102  ctx->begin->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
103  }
+
104  ctx->count++;
+
105 }
+
106 NK_LIB void
+
107 nk_remove_window(struct nk_context *ctx, struct nk_window *win)
+
108 {
+
109  if (win == ctx->begin || win == ctx->end) {
+
110  if (win == ctx->begin) {
+
111  ctx->begin = win->next;
+
112  if (win->next)
+
113  win->next->prev = 0;
+
114  }
+
115  if (win == ctx->end) {
+
116  ctx->end = win->prev;
+
117  if (win->prev)
+
118  win->prev->next = 0;
+
119  }
+
120  } else {
+
121  if (win->next)
+
122  win->next->prev = win->prev;
+
123  if (win->prev)
+
124  win->prev->next = win->next;
+
125  }
+
126  if (win == ctx->active || !ctx->active) {
+
127  ctx->active = ctx->end;
+
128  if (ctx->end)
+
129  ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
130  }
+
131  win->next = 0;
+
132  win->prev = 0;
+
133  ctx->count--;
+
134 }
+
135 NK_API nk_bool
+
136 nk_begin(struct nk_context *ctx, const char *title,
+
137  struct nk_rect bounds, nk_flags flags)
+
138 {
+
139  return nk_begin_titled(ctx, title, title, bounds, flags);
+
140 }
+
141 NK_API nk_bool
+
142 nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
+
143  struct nk_rect bounds, nk_flags flags)
+
144 {
+
145  struct nk_window *win;
+
146  struct nk_style *style;
+
147  nk_hash name_hash;
+
148  int name_len;
+
149  int ret = 0;
+
150 
+
151  NK_ASSERT(ctx);
+
152  NK_ASSERT(name);
+
153  NK_ASSERT(title);
+
154  NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font");
+
155  NK_ASSERT(!ctx->current && "if this triggers you missed a `nk_end` call");
+
156  if (!ctx || ctx->current || !title || !name)
+
157  return 0;
+
158 
+
159  /* find or create window */
+
160  style = &ctx->style;
+
161  name_len = (int)nk_strlen(name);
+
162  name_hash = nk_murmur_hash(name, (int)name_len, NK_WINDOW_TITLE);
+
163  win = nk_find_window(ctx, name_hash, name);
+
164  if (!win) {
+
165  /* create new window */
+
166  nk_size name_length = (nk_size)name_len;
+
167  win = (struct nk_window*)nk_create_window(ctx);
+
168  NK_ASSERT(win);
+
169  if (!win) return 0;
+
170 
+
171  if (flags & NK_WINDOW_BACKGROUND)
+
172  nk_insert_window(ctx, win, NK_INSERT_FRONT);
+
173  else nk_insert_window(ctx, win, NK_INSERT_BACK);
+
174  nk_command_buffer_init(&win->buffer, &ctx->memory, NK_CLIPPING_ON);
+
175 
+
176  win->flags = flags;
+
177  win->bounds = bounds;
+
178  win->name = name_hash;
+
179  name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
+
180  NK_MEMCPY(win->name_string, name, name_length);
+
181  win->name_string[name_length] = 0;
+
182  win->popup.win = 0;
+
183  win->widgets_disabled = nk_false;
+
184  if (!ctx->active)
+
185  ctx->active = win;
+
186  } else {
+
187  /* update window */
+
188  win->flags &= ~(nk_flags)(NK_WINDOW_PRIVATE-1);
+
189  win->flags |= flags;
+
190  if (!(win->flags & (NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE)))
+
191  win->bounds = bounds;
+
192  /* If this assert triggers you either:
+
193  *
+
194  * I.) Have more than one window with the same name or
+
195  * II.) You forgot to actually draw the window.
+
196  * More specific you did not call `nk_clear` (nk_clear will be
+
197  * automatically called for you if you are using one of the
+
198  * provided demo backends). */
+
199  NK_ASSERT(win->seq != ctx->seq);
+
200  win->seq = ctx->seq;
+
201  if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN)) {
+
202  ctx->active = win;
+
203  ctx->end = win;
+
204  }
+
205  }
+
206  if (win->flags & NK_WINDOW_HIDDEN) {
+
207  ctx->current = win;
+
208  win->layout = 0;
+
209  return 0;
+
210  } else nk_start(ctx, win);
+
211 
+
212  /* window overlapping */
+
213  if (!(win->flags & NK_WINDOW_HIDDEN) && !(win->flags & NK_WINDOW_NO_INPUT))
+
214  {
+
215  int inpanel, ishovered;
+
216  struct nk_window *iter = win;
+
217  float h = ctx->style.font->height + 2.0f * style->window.header.padding.y +
+
218  (2.0f * style->window.header.label_padding.y);
+
219  struct nk_rect win_bounds = (!(win->flags & NK_WINDOW_MINIMIZED))?
+
220  win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h);
+
221 
+
222  /* activate window if hovered and no other window is overlapping this window */
+
223  inpanel = nk_input_has_mouse_click_down_in_rect(&ctx->input, NK_BUTTON_LEFT, win_bounds, nk_true);
+
224  inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked;
+
225  ishovered = nk_input_is_mouse_hovering_rect(&ctx->input, win_bounds);
+
226  if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) {
+
227  iter = win->next;
+
228  while (iter) {
+
229  struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
+
230  iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
+
231  if (NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+
232  iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
+
233  (!(iter->flags & NK_WINDOW_HIDDEN)))
+
234  break;
+
235 
+
236  if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
+
237  NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+
238  iter->popup.win->bounds.x, iter->popup.win->bounds.y,
+
239  iter->popup.win->bounds.w, iter->popup.win->bounds.h))
+
240  break;
+
241  iter = iter->next;
+
242  }
+
243  }
+
244 
+
245  /* activate window if clicked */
+
246  if (iter && inpanel && (win != ctx->end)) {
+
247  iter = win->next;
+
248  while (iter) {
+
249  /* try to find a panel with higher priority in the same position */
+
250  struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
+
251  iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
+
252  if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y,
+
253  iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
+
254  !(iter->flags & NK_WINDOW_HIDDEN))
+
255  break;
+
256  if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
+
257  NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+
258  iter->popup.win->bounds.x, iter->popup.win->bounds.y,
+
259  iter->popup.win->bounds.w, iter->popup.win->bounds.h))
+
260  break;
+
261  iter = iter->next;
+
262  }
+
263  }
+
264  if (iter && !(win->flags & NK_WINDOW_ROM) && (win->flags & NK_WINDOW_BACKGROUND)) {
+
265  win->flags |= (nk_flags)NK_WINDOW_ROM;
+
266  iter->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
267  ctx->active = iter;
+
268  if (!(iter->flags & NK_WINDOW_BACKGROUND)) {
+
269  /* current window is active in that position so transfer to top
+
270  * at the highest priority in stack */
+
271  nk_remove_window(ctx, iter);
+
272  nk_insert_window(ctx, iter, NK_INSERT_BACK);
+
273  }
+
274  } else {
+
275  if (!iter && ctx->end != win) {
+
276  if (!(win->flags & NK_WINDOW_BACKGROUND)) {
+
277  /* current window is active in that position so transfer to top
+
278  * at the highest priority in stack */
+
279  nk_remove_window(ctx, win);
+
280  nk_insert_window(ctx, win, NK_INSERT_BACK);
+
281  }
+
282  win->flags &= ~(nk_flags)NK_WINDOW_ROM;
+
283  ctx->active = win;
+
284  }
+
285  if (ctx->end != win && !(win->flags & NK_WINDOW_BACKGROUND))
+
286  win->flags |= NK_WINDOW_ROM;
+
287  }
+
288  }
+
289  win->layout = (struct nk_panel*)nk_create_panel(ctx);
+
290  ctx->current = win;
+
291  ret = nk_panel_begin(ctx, title, NK_PANEL_WINDOW);
+
292  win->layout->offset_x = &win->scrollbar.x;
+
293  win->layout->offset_y = &win->scrollbar.y;
+
294  return ret;
+
295 }
+
296 NK_API void
+
297 nk_end(struct nk_context *ctx)
+
298 {
+
299  struct nk_panel *layout;
+
300  NK_ASSERT(ctx);
+
301  NK_ASSERT(ctx->current && "if this triggers you forgot to call `nk_begin`");
+
302  if (!ctx || !ctx->current)
+
303  return;
+
304 
+
305  layout = ctx->current->layout;
+
306  if (!layout || (layout->type == NK_PANEL_WINDOW && (ctx->current->flags & NK_WINDOW_HIDDEN))) {
+
307  ctx->current = 0;
+
308  return;
+
309  }
+
310  nk_panel_end(ctx);
+
311  nk_free_panel(ctx, ctx->current->layout);
+
312  ctx->current = 0;
+
313 }
+
314 NK_API struct nk_rect
+
315 nk_window_get_bounds(const struct nk_context *ctx)
+
316 {
+
317  NK_ASSERT(ctx);
+
318  NK_ASSERT(ctx->current);
+
319  if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
+
320  return ctx->current->bounds;
+
321 }
+
322 NK_API struct nk_vec2
+
323 nk_window_get_position(const struct nk_context *ctx)
+
324 {
+
325  NK_ASSERT(ctx);
+
326  NK_ASSERT(ctx->current);
+
327  if (!ctx || !ctx->current) return nk_vec2(0,0);
+
328  return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y);
+
329 }
+
330 NK_API struct nk_vec2
+
331 nk_window_get_size(const struct nk_context *ctx)
+
332 {
+
333  NK_ASSERT(ctx);
+
334  NK_ASSERT(ctx->current);
+
335  if (!ctx || !ctx->current) return nk_vec2(0,0);
+
336  return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h);
+
337 }
+
338 NK_API float
+
339 nk_window_get_width(const struct nk_context *ctx)
+
340 {
+
341  NK_ASSERT(ctx);
+
342  NK_ASSERT(ctx->current);
+
343  if (!ctx || !ctx->current) return 0;
+
344  return ctx->current->bounds.w;
+
345 }
+
346 NK_API float
+ +
348 {
+
349  NK_ASSERT(ctx);
+
350  NK_ASSERT(ctx->current);
+
351  if (!ctx || !ctx->current) return 0;
+
352  return ctx->current->bounds.h;
+
353 }
+
354 NK_API struct nk_rect
+
355 nk_window_get_content_region(const struct nk_context *ctx)
+
356 {
+
357  NK_ASSERT(ctx);
+
358  NK_ASSERT(ctx->current);
+
359  if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
+
360  return ctx->current->layout->clip;
+
361 }
+
362 NK_API struct nk_vec2
+ +
364 {
+
365  NK_ASSERT(ctx);
+
366  NK_ASSERT(ctx->current);
+
367  NK_ASSERT(ctx->current->layout);
+
368  if (!ctx || !ctx->current) return nk_vec2(0,0);
+
369  return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y);
+
370 }
+
371 NK_API struct nk_vec2
+ +
373 {
+
374  NK_ASSERT(ctx);
+
375  NK_ASSERT(ctx->current);
+
376  NK_ASSERT(ctx->current->layout);
+
377  if (!ctx || !ctx->current) return nk_vec2(0,0);
+
378  return nk_vec2(ctx->current->layout->clip.x + ctx->current->layout->clip.w,
+
379  ctx->current->layout->clip.y + ctx->current->layout->clip.h);
+
380 }
+
381 NK_API struct nk_vec2
+ +
383 {
+
384  NK_ASSERT(ctx);
+
385  NK_ASSERT(ctx->current);
+
386  NK_ASSERT(ctx->current->layout);
+
387  if (!ctx || !ctx->current) return nk_vec2(0,0);
+
388  return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h);
+
389 }
+
390 NK_API struct nk_command_buffer*
+ +
392 {
+
393  NK_ASSERT(ctx);
+
394  NK_ASSERT(ctx->current);
+
395  NK_ASSERT(ctx->current->layout);
+
396  if (!ctx || !ctx->current) return 0;
+
397  return &ctx->current->buffer;
+
398 }
+
399 NK_API struct nk_panel*
+
400 nk_window_get_panel(const struct nk_context *ctx)
+
401 {
+
402  NK_ASSERT(ctx);
+
403  NK_ASSERT(ctx->current);
+
404  if (!ctx || !ctx->current) return 0;
+
405  return ctx->current->layout;
+
406 }
+
407 NK_API void
+
408 nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+
409 {
+
410  struct nk_window *win;
+
411  NK_ASSERT(ctx);
+
412  NK_ASSERT(ctx->current);
+
413  if (!ctx || !ctx->current)
+
414  return ;
+
415  win = ctx->current;
+
416  if (offset_x)
+
417  *offset_x = win->scrollbar.x;
+
418  if (offset_y)
+
419  *offset_y = win->scrollbar.y;
+
420 }
+
421 NK_API nk_bool
+
422 nk_window_has_focus(const struct nk_context *ctx)
+
423 {
+
424  NK_ASSERT(ctx);
+
425  NK_ASSERT(ctx->current);
+
426  NK_ASSERT(ctx->current->layout);
+
427  if (!ctx || !ctx->current) return 0;
+
428  return ctx->current == ctx->active;
+
429 }
+
430 NK_API nk_bool
+ +
432 {
+
433  NK_ASSERT(ctx);
+
434  NK_ASSERT(ctx->current);
+
435  if (!ctx || !ctx->current || (ctx->current->flags & NK_WINDOW_HIDDEN))
+
436  return 0;
+
437  else {
+
438  struct nk_rect actual_bounds = ctx->current->bounds;
+
439  if (ctx->begin->flags & NK_WINDOW_MINIMIZED) {
+
440  actual_bounds.h = ctx->current->layout->header_height;
+
441  }
+
442  return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds);
+
443  }
+
444 }
+
445 NK_API nk_bool
+ +
447 {
+
448  struct nk_window *iter;
+
449  NK_ASSERT(ctx);
+
450  if (!ctx) return 0;
+
451  iter = ctx->begin;
+
452  while (iter) {
+
453  /* check if window is being hovered */
+
454  if(!(iter->flags & NK_WINDOW_HIDDEN)) {
+
455  /* check if window popup is being hovered */
+
456  if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds))
+
457  return 1;
+
458 
+
459  if (iter->flags & NK_WINDOW_MINIMIZED) {
+
460  struct nk_rect header = iter->bounds;
+
461  header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y;
+
462  if (nk_input_is_mouse_hovering_rect(&ctx->input, header))
+
463  return 1;
+
464  } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) {
+
465  return 1;
+
466  }
+
467  }
+
468  iter = iter->next;
+
469  }
+
470  return 0;
+
471 }
+
472 NK_API nk_bool
+ +
474 {
+
475  int any_hovered = nk_window_is_any_hovered(ctx);
+
476  int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
+
477  return any_hovered || any_active;
+
478 }
+
479 NK_API nk_bool
+
480 nk_window_is_collapsed(const struct nk_context *ctx, const char *name)
+
481 {
+
482  int title_len;
+
483  nk_hash title_hash;
+
484  struct nk_window *win;
+
485  NK_ASSERT(ctx);
+
486  if (!ctx) return 0;
+
487 
+
488  title_len = (int)nk_strlen(name);
+
489  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
490  win = nk_find_window(ctx, title_hash, name);
+
491  if (!win) return 0;
+
492  return win->flags & NK_WINDOW_MINIMIZED;
+
493 }
+
494 NK_API nk_bool
+
495 nk_window_is_closed(const struct nk_context *ctx, const char *name)
+
496 {
+
497  int title_len;
+
498  nk_hash title_hash;
+
499  struct nk_window *win;
+
500  NK_ASSERT(ctx);
+
501  if (!ctx) return 1;
+
502 
+
503  title_len = (int)nk_strlen(name);
+
504  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
505  win = nk_find_window(ctx, title_hash, name);
+
506  if (!win) return 1;
+
507  return (win->flags & NK_WINDOW_CLOSED);
+
508 }
+
509 NK_API nk_bool
+
510 nk_window_is_hidden(const struct nk_context *ctx, const char *name)
+
511 {
+
512  int title_len;
+
513  nk_hash title_hash;
+
514  struct nk_window *win;
+
515  NK_ASSERT(ctx);
+
516  if (!ctx) return 1;
+
517 
+
518  title_len = (int)nk_strlen(name);
+
519  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
520  win = nk_find_window(ctx, title_hash, name);
+
521  if (!win) return 1;
+
522  return (win->flags & NK_WINDOW_HIDDEN);
+
523 }
+
524 NK_API nk_bool
+
525 nk_window_is_active(const struct nk_context *ctx, const char *name)
+
526 {
+
527  int title_len;
+
528  nk_hash title_hash;
+
529  struct nk_window *win;
+
530  NK_ASSERT(ctx);
+
531  if (!ctx) return 0;
+
532 
+
533  title_len = (int)nk_strlen(name);
+
534  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
535  win = nk_find_window(ctx, title_hash, name);
+
536  if (!win) return 0;
+
537  return win == ctx->active;
+
538 }
+
539 NK_API struct nk_window*
+
540 nk_window_find(const struct nk_context *ctx, const char *name)
+
541 {
+
542  int title_len;
+
543  nk_hash title_hash;
+
544  title_len = (int)nk_strlen(name);
+
545  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
546  return nk_find_window(ctx, title_hash, name);
+
547 }
+
548 NK_API void
+
549 nk_window_close(struct nk_context *ctx, const char *name)
+
550 {
+
551  struct nk_window *win;
+
552  NK_ASSERT(ctx);
+
553  if (!ctx) return;
+
554  win = nk_window_find(ctx, name);
+
555  if (!win) return;
+
556  NK_ASSERT(ctx->current != win && "You cannot close a currently active window");
+
557  if (ctx->current == win) return;
+
558  win->flags |= NK_WINDOW_HIDDEN;
+
559  win->flags |= NK_WINDOW_CLOSED;
+
560 }
+
561 NK_API void
+ +
563  const char *name, struct nk_rect bounds)
+
564 {
+
565  struct nk_window *win;
+
566  NK_ASSERT(ctx);
+
567  if (!ctx) return;
+
568  win = nk_window_find(ctx, name);
+
569  if (!win) return;
+
570  win->bounds = bounds;
+
571 }
+
572 NK_API void
+ +
574  const char *name, struct nk_vec2 pos)
+
575 {
+
576  struct nk_window *win = nk_window_find(ctx, name);
+
577  if (!win) return;
+
578  win->bounds.x = pos.x;
+
579  win->bounds.y = pos.y;
+
580 }
+
581 NK_API void
+ +
583  const char *name, struct nk_vec2 size)
+
584 {
+
585  struct nk_window *win = nk_window_find(ctx, name);
+
586  if (!win) return;
+
587  win->bounds.w = size.x;
+
588  win->bounds.h = size.y;
+
589 }
+
590 NK_API void
+
591 nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+
592 {
+
593  struct nk_window *win;
+
594  NK_ASSERT(ctx);
+
595  NK_ASSERT(ctx->current);
+
596  if (!ctx || !ctx->current)
+
597  return;
+
598  win = ctx->current;
+
599  win->scrollbar.x = offset_x;
+
600  win->scrollbar.y = offset_y;
+
601 }
+
602 NK_API void
+
603 nk_window_collapse(struct nk_context *ctx, const char *name,
+
604  enum nk_collapse_states c)
+
605 {
+
606  int title_len;
+
607  nk_hash title_hash;
+
608  struct nk_window *win;
+
609  NK_ASSERT(ctx);
+
610  if (!ctx) return;
+
611 
+
612  title_len = (int)nk_strlen(name);
+
613  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
614  win = nk_find_window(ctx, title_hash, name);
+
615  if (!win) return;
+
616  if (c == NK_MINIMIZED)
+
617  win->flags |= NK_WINDOW_MINIMIZED;
+
618  else win->flags &= ~(nk_flags)NK_WINDOW_MINIMIZED;
+
619 }
+
620 NK_API void
+
621 nk_window_collapse_if(struct nk_context *ctx, const char *name,
+
622  enum nk_collapse_states c, int cond)
+
623 {
+
624  NK_ASSERT(ctx);
+
625  if (!ctx || !cond) return;
+
626  nk_window_collapse(ctx, name, c);
+
627 }
+
628 NK_API void
+
629 nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states s)
+
630 {
+
631  int title_len;
+
632  nk_hash title_hash;
+
633  struct nk_window *win;
+
634  NK_ASSERT(ctx);
+
635  if (!ctx) return;
+
636 
+
637  title_len = (int)nk_strlen(name);
+
638  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
639  win = nk_find_window(ctx, title_hash, name);
+
640  if (!win) return;
+
641  if (s == NK_HIDDEN) {
+
642  win->flags |= NK_WINDOW_HIDDEN;
+
643  } else win->flags &= ~(nk_flags)NK_WINDOW_HIDDEN;
+
644 }
+
645 NK_API void
+
646 nk_window_show_if(struct nk_context *ctx, const char *name,
+
647  enum nk_show_states s, int cond)
+
648 {
+
649  NK_ASSERT(ctx);
+
650  if (!ctx || !cond) return;
+
651  nk_window_show(ctx, name, s);
+
652 }
+
653 
+
654 NK_API void
+
655 nk_window_set_focus(struct nk_context *ctx, const char *name)
+
656 {
+
657  int title_len;
+
658  nk_hash title_hash;
+
659  struct nk_window *win;
+
660  NK_ASSERT(ctx);
+
661  if (!ctx) return;
+
662 
+
663  title_len = (int)nk_strlen(name);
+
664  title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+
665  win = nk_find_window(ctx, title_hash, name);
+
666  if (win && ctx->end != win) {
+
667  nk_remove_window(ctx, win);
+
668  nk_insert_window(ctx, win, NK_INSERT_BACK);
+
669  }
+
670  ctx->active = win;
+
671 }
+
672 NK_API void
+
673 nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
+
674 {
+
675  struct nk_rect space;
+
676  enum nk_widget_layout_states state = nk_widget(&space, ctx);
+
677  struct nk_command_buffer *canvas = nk_window_get_canvas(ctx);
+
678  if (!state) return;
+
679  nk_fill_rect(canvas, space, rounding && space.h > 1.5f ? space.h / 2.0f : 0, color);
+
680 }
+
main API and documentation file
+
NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx)
+
NK_API void nk_window_close(struct nk_context *ctx, const char *name)
+
NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
+
@ NK_WINDOW_CLOSED
Directly closes and frees the window at the end of the frame.
Definition: nuklear.h:5495
+
@ NK_WINDOW_MINIMIZED
marks the window as minimized
Definition: nuklear.h:5496
+
@ NK_WINDOW_HIDDEN
Hides window and stops any window interaction and drawing.
Definition: nuklear.h:5494
+
@ NK_WINDOW_ROM
sets window widgets into a read only mode and does not allow input changes
Definition: nuklear.h:5492
+
NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx)
+
NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond)
+
NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+
NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char *name)
+
NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name)
+
NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char *name)
+
NK_API void nk_fill_rect(struct nk_command_buffer *, struct nk_rect, float rounding, struct nk_color)
filled shades
Definition: nuklear_draw.c:152
+
NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx)
+
NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+
NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos)
+
NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state)
+
NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name)
+
NK_API struct nk_command_buffer * nk_window_get_canvas(const struct nk_context *ctx)
+
NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state)
+
NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx)
+
NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds)
+
NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx)
+
NK_API struct nk_panel * nk_window_get_panel(const struct nk_context *ctx)
+
NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond)
+
NK_API float nk_window_get_height(const struct nk_context *ctx)
+
NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags)
+
NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags)
+
NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size)
+
NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx)
+
NK_API float nk_window_get_width(const struct nk_context *ctx)
nk_window_get_width
+
nk_widget_layout_states
Definition: nuklear.h:3081
+
NK_API struct nk_rect nk_window_get_content_region(const struct nk_context *ctx)
+
NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char *name)
+
NK_API void nk_end(struct nk_context *ctx)
+
NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx)
+
NK_API struct nk_window * nk_window_find(const struct nk_context *ctx, const char *name)
+ + + + + + + + +
nk_text_width_f width
!< max height of the font
Definition: nuklear.h:4009
+
float height
!< user provided font handle
Definition: nuklear.h:4008
+ + + +
+
+ + + + diff --git a/open.png b/open.png new file mode 100644 index 000000000..30f75c7ef Binary files /dev/null and b/open.png differ diff --git a/pages.html b/pages.html new file mode 100644 index 000000000..06de326f7 --- /dev/null +++ b/pages.html @@ -0,0 +1,125 @@ + + + + + + + +Nuklear: Related Pages + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Related Pages
+
+
+
Here is a list of all related documentation pages:
+ + + + + + + + + + + + + +
 ContextContexts are the main entry point and the majestro of nuklear and contain all required state
 InputThe input API is responsible for holding the current input state composed of mouse, key and text input states
 Drawing=============================================================================
 Window=============================================================================
 LayoutingLayouting in general describes placing widget inside a window with position and size
 Groups=============================================================================
 Tree=============================================================================
 PropertiesProperties are the main value modification widgets in Nuklear
 FontFont handling in this library was designed to be quite customizable and lets you decide what you want to use and what you want to provide
 Buffer==============================================================
 Editor===============================================================
 Stack
+
+
+
+ + + + diff --git a/resize.js b/resize.js new file mode 100644 index 000000000..e1ad0fe3b --- /dev/null +++ b/resize.js @@ -0,0 +1,140 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initResizable() +{ + var cookie_namespace = 'doxygen'; + var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight; + + function readCookie(cookie) + { + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) { + var index = document.cookie.indexOf(myCookie); + if (index != -1) { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + return 0; + } + + function writeCookie(cookie, val, expiration) + { + if (val==undefined) return; + if (expiration == null) { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + } + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; + } + + function resizeWidth() + { + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + writeCookie('width',sidenavWidth-barWidth, null); + } + + function restoreWidth(navWidth) + { + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight() + { + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + content.css({height:windowHeight + "px"}); + navtree.css({height:windowHeight + "px"}); + sidenav.css({height:windowHeight + "px"}); + var width=$(window).width(); + if (width!=collapsedWidth) { + if (width=desktop_vp) { + if (!collapsed) { + collapseExpand(); + } + } else if (width>desktop_vp && collapsedWidth0) { + restoreWidth(0); + collapsed=true; + } + else { + var width = readCookie('width'); + if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } + collapsed=false; + } + } + + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + $(window).resize(function() { resizeHeight(); }); + var device = navigator.userAgent.toLowerCase(); + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + var width = readCookie('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + $(window).on('load',resizeHeight); +} +/* @license-end */ diff --git a/search/all_0.html b/search/all_0.html new file mode 100644 index 000000000..1ec5b2d59 --- /dev/null +++ b/search/all_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_0.js b/search/all_0.js new file mode 100644 index 000000000..7468a27c4 --- /dev/null +++ b/search/all_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['allocated_0',['allocated',['../structnk__buffer.html#a91e9be62aa08687400bc00059825de02',1,'nk_buffer']]], + ['arc_5fsegment_5fcount_1',['arc_segment_count',['../structnk__convert__config.html#ae367d812c2f866e843f9684b3a920e73',1,'nk_convert_config']]] +]; diff --git a/search/all_1.html b/search/all_1.html new file mode 100644 index 000000000..9f80e9043 --- /dev/null +++ b/search/all_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_1.js b/search/all_1.js new file mode 100644 index 000000000..565a38444 --- /dev/null +++ b/search/all_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['buffer_2',['Buffer',['../Memory.html',1,'']]], + ['build_3',['build',['../structnk__context.html#a0d0f953ef2b6c56b046e4e5488d074e6',1,'nk_context']]] +]; diff --git a/search/all_2.html b/search/all_2.html new file mode 100644 index 000000000..02cfffc2e --- /dev/null +++ b/search/all_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_2.js b/search/all_2.js new file mode 100644 index 000000000..a03e91900 --- /dev/null +++ b/search/all_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['calls_4',['calls',['../structnk__buffer.html#acd962a6e042a8ffabac679768e4851bb',1,'nk_buffer']]], + ['circle_5fsegment_5fcount_5',['circle_segment_count',['../structnk__convert__config.html#ae62d641bf9c5bc6b3e66c6071f4a8267',1,'nk_convert_config']]], + ['curve_5fsegment_5fcount_6',['curve_segment_count',['../structnk__convert__config.html#afcf45f3fc6e3f043b572b59cb04424c5',1,'nk_convert_config']]] +]; diff --git a/search/all_3.html b/search/all_3.html new file mode 100644 index 000000000..39767b85b --- /dev/null +++ b/search/all_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_3.js b/search/all_3.js new file mode 100644 index 000000000..bd01447f9 --- /dev/null +++ b/search/all_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['editor_7',['Editor',['../Text.html',1,'']]] +]; diff --git a/search/all_4.html b/search/all_4.html new file mode 100644 index 000000000..fc40463c8 --- /dev/null +++ b/search/all_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_4.js b/search/all_4.js new file mode 100644 index 000000000..a8e718aff --- /dev/null +++ b/search/all_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['grow_5ffactor_8',['grow_factor',['../structnk__buffer.html#ab4ec59165f6aa6e9358bced8070cc84e',1,'nk_buffer']]] +]; diff --git a/search/all_5.html b/search/all_5.html new file mode 100644 index 000000000..9dd9344b0 --- /dev/null +++ b/search/all_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_5.js b/search/all_5.js new file mode 100644 index 000000000..6e02a04a4 --- /dev/null +++ b/search/all_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['height_9',['height',['../structnk__user__font.html#ab98ed37df408e0c2febfe448897ccf82',1,'nk_user_font']]] +]; diff --git a/search/all_6.html b/search/all_6.html new file mode 100644 index 000000000..f1e516d75 --- /dev/null +++ b/search/all_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_6.js b/search/all_6.js new file mode 100644 index 000000000..4707fc86f --- /dev/null +++ b/search/all_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['line_5faa_10',['line_AA',['../structnk__convert__config.html#a7279543367b1ad0e5f183491233cedad',1,'nk_convert_config']]] +]; diff --git a/search/all_7.html b/search/all_7.html new file mode 100644 index 000000000..8ddbf6c8e --- /dev/null +++ b/search/all_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_7.js b/search/all_7.js new file mode 100644 index 000000000..f7ae1e97f --- /dev/null +++ b/search/all_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['memory_11',['memory',['../structnk__buffer.html#a228b585debec1d328859fb52080ca3fd',1,'nk_buffer']]] +]; diff --git a/search/all_8.html b/search/all_8.html new file mode 100644 index 000000000..83c55ae22 --- /dev/null +++ b/search/all_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_8.js b/search/all_8.js new file mode 100644 index 000000000..c159345c3 --- /dev/null +++ b/search/all_8.js @@ -0,0 +1,228 @@ +var searchData= +[ + ['needed_12',['needed',['../structnk__buffer.html#a6b0ea49209eaba5285b715d902c5f446',1,'nk_buffer']]], + ['nk_5f_5fbegin_13',['nk__begin',['../nuklear_8h.html#a842e2f7d16d53f2625c3e41fecb79fa6',1,'nuklear_context.c']]], + ['nk_5f_5fnext_14',['nk__next',['../nuklear_8h.html#add3ee7ed9a05770277443ccd001c1031',1,'nuklear_context.c']]], + ['nk_5fallocator_15',['nk_allocator',['../structnk__allocator.html',1,'']]], + ['nk_5fbegin_16',['nk_begin',['../nuklear_8h.html#aafe58ef289cad9c8cd7f5419fabe7cdd',1,'nuklear_window.c']]], + ['nk_5fbegin_5ftitled_17',['nk_begin_titled',['../nuklear_8h.html#aabf02f938d9da8ac02cd0b972f2e0260',1,'nuklear_window.c']]], + ['nk_5fbool_18',['NK_BOOL',['../nuklear_8h.html#a3d22f7496565fb07532fa0c473894915',1,'nuklear.h']]], + ['nk_5fbuffer_19',['nk_buffer',['../structnk__buffer.html',1,'']]], + ['nk_5fbuffer_5fmarker_20',['nk_buffer_marker',['../structnk__buffer__marker.html',1,'']]], + ['nk_5fchart_21',['nk_chart',['../structnk__chart.html',1,'']]], + ['nk_5fchart_5fslot_22',['nk_chart_slot',['../structnk__chart__slot.html',1,'']]], + ['nk_5fclear_23',['nk_clear',['../nuklear_8h.html#ade3301f0a92370be1b4beac7eceac279',1,'nuklear_context.c']]], + ['nk_5fclipboard_24',['nk_clipboard',['../structnk__clipboard.html',1,'']]], + ['nk_5fcolor_25',['nk_color',['../structnk__color.html',1,'']]], + ['nk_5fcolorf_26',['nk_colorf',['../structnk__colorf.html',1,'']]], + ['nk_5fcommand_27',['nk_command',['../structnk__command.html',1,'']]], + ['nk_5fcommand_5farc_28',['nk_command_arc',['../structnk__command__arc.html',1,'']]], + ['nk_5fcommand_5farc_5ffilled_29',['nk_command_arc_filled',['../structnk__command__arc__filled.html',1,'']]], + ['nk_5fcommand_5fbuffer_30',['nk_command_buffer',['../structnk__command__buffer.html',1,'']]], + ['nk_5fcommand_5fcircle_31',['nk_command_circle',['../structnk__command__circle.html',1,'']]], + ['nk_5fcommand_5fcircle_5ffilled_32',['nk_command_circle_filled',['../structnk__command__circle__filled.html',1,'']]], + ['nk_5fcommand_5fcurve_33',['nk_command_curve',['../structnk__command__curve.html',1,'']]], + ['nk_5fcommand_5fcustom_34',['nk_command_custom',['../structnk__command__custom.html',1,'']]], + ['nk_5fcommand_5fimage_35',['nk_command_image',['../structnk__command__image.html',1,'']]], + ['nk_5fcommand_5fline_36',['nk_command_line',['../structnk__command__line.html',1,'']]], + ['nk_5fcommand_5fpolygon_37',['nk_command_polygon',['../structnk__command__polygon.html',1,'']]], + ['nk_5fcommand_5fpolygon_5ffilled_38',['nk_command_polygon_filled',['../structnk__command__polygon__filled.html',1,'']]], + ['nk_5fcommand_5fpolyline_39',['nk_command_polyline',['../structnk__command__polyline.html',1,'']]], + ['nk_5fcommand_5frect_40',['nk_command_rect',['../structnk__command__rect.html',1,'']]], + ['nk_5fcommand_5frect_5ffilled_41',['nk_command_rect_filled',['../structnk__command__rect__filled.html',1,'']]], + ['nk_5fcommand_5frect_5fmulti_5fcolor_42',['nk_command_rect_multi_color',['../structnk__command__rect__multi__color.html',1,'']]], + ['nk_5fcommand_5fscissor_43',['nk_command_scissor',['../structnk__command__scissor.html',1,'']]], + ['nk_5fcommand_5ftext_44',['nk_command_text',['../structnk__command__text.html',1,'']]], + ['nk_5fcommand_5ftriangle_45',['nk_command_triangle',['../structnk__command__triangle.html',1,'']]], + ['nk_5fcommand_5ftriangle_5ffilled_46',['nk_command_triangle_filled',['../structnk__command__triangle__filled.html',1,'']]], + ['nk_5fconfiguration_5fstacks_47',['nk_configuration_stacks',['../structnk__configuration__stacks.html',1,'']]], + ['nk_5fcontext_48',['nk_context',['../structnk__context.html',1,'']]], + ['nk_5fconvert_5fconfig_49',['nk_convert_config',['../structnk__convert__config.html',1,'']]], + ['nk_5fcursor_50',['nk_cursor',['../structnk__cursor.html',1,'']]], + ['nk_5fdraw_5fimage_51',['nk_draw_image',['../nuklear_8h.html#a322678fb670fa1d061dbed321ee38d1b',1,'nuklear_draw.c']]], + ['nk_5fdraw_5fnull_5ftexture_52',['nk_draw_null_texture',['../structnk__draw__null__texture.html',1,'']]], + ['nk_5fedit_5factivated_53',['NK_EDIT_ACTIVATED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abe7aa005cc1df810a8d99d335e5b2e21',1,'nuklear.h']]], + ['nk_5fedit_5fcommited_54',['NK_EDIT_COMMITED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abdd1da5f55b6213f935e8333840ee3d1',1,'nuklear.h']]], + ['nk_5fedit_5fdeactivated_55',['NK_EDIT_DEACTIVATED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737aa72e5bf401897ea75f2eaed14b4d1b97',1,'nuklear.h']]], + ['nk_5fedit_5fevents_56',['nk_edit_events',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737',1,'nuklear.h']]], + ['nk_5fedit_5finactive_57',['NK_EDIT_INACTIVE',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737a15b71573eb3cb988dcf77ba090e80c6b',1,'nuklear.h']]], + ['nk_5fedit_5fstate_58',['nk_edit_state',['../structnk__edit__state.html',1,'']]], + ['nk_5fend_59',['nk_end',['../nuklear_8h.html#ae0ade48c4c8df72456b9d97ab3d195e3',1,'nuklear_window.c']]], + ['nk_5ffill_5frect_60',['nk_fill_rect',['../nuklear_8h.html#a63407f682d240622d8b025d7911596fb',1,'nuklear_draw.c']]], + ['nk_5ffilter_5fdefault_61',['nk_filter_default',['../nuklear_8h.html#a826f79e651ee0e905ca0857886d2848a',1,'nuklear_edit.c']]], + ['nk_5fforeach_62',['nk_foreach',['../nuklear_8h.html#aaca7101364db82c0f03401fafd2c66a6',1,'nuklear.h']]], + ['nk_5ffree_63',['nk_free',['../nuklear_8h.html#a06772e194320fa99524681fd32df85e9',1,'nuklear_context.c']]], + ['nk_5fgroup_5fbegin_64',['nk_group_begin',['../nuklear_8h.html#a09a50849fef9426cf7a9ad9960b1486a',1,'nuklear_group.c']]], + ['nk_5fgroup_5fbegin_5ftitled_65',['nk_group_begin_titled',['../nuklear_8h.html#aa8ab5670480005694241e37b188d8e06',1,'nuklear_group.c']]], + ['nk_5fgroup_5fend_66',['nk_group_end',['../nuklear_8h.html#ae0e5210696cae430a9e9b79e1f76cee5',1,'nuklear_group.c']]], + ['nk_5fgroup_5fget_5fscroll_67',['nk_group_get_scroll',['../nuklear_8h.html#a4cdbee562347fba0fae90b8250274d96',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5fbegin_68',['nk_group_scrolled_begin',['../nuklear_8h.html#af17d78936039c79f6fe91a4c70d253e2',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5fend_69',['nk_group_scrolled_end',['../nuklear_8h.html#a4552d30d3265ccff7c82232da3cea657',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5foffset_5fbegin_70',['nk_group_scrolled_offset_begin',['../nuklear_8h.html#a6adb72deb66e2714d654c8d57bd277b5',1,'nuklear_group.c']]], + ['nk_5fgroup_5fset_5fscroll_71',['nk_group_set_scroll',['../nuklear_8h.html#ab26b83016c296e5ed1f4c6dc79bd5cd1',1,'nuklear_group.c']]], + ['nk_5fhandle_72',['nk_handle',['../unionnk__handle.html',1,'']]], + ['nk_5fimage_73',['nk_image',['../structnk__image.html',1,'']]], + ['nk_5finit_74',['nk_init',['../nuklear_8h.html#ab5c6cdd02a560dbcbdb5bd54ed753b2c',1,'nuklear_context.c']]], + ['nk_5finit_5fcustom_75',['nk_init_custom',['../nuklear_8h.html#a4122ba85b642a16b61268932b1fed694',1,'nuklear_context.c']]], + ['nk_5finit_5ffixed_76',['nk_init_fixed',['../nuklear_8h.html#a27a65e767320f4d72cee9c3175153b56',1,'nuklear_context.c']]], + ['nk_5finput_77',['nk_input',['../structnk__input.html',1,'']]], + ['nk_5finput_5fbegin_78',['nk_input_begin',['../nuklear_8h.html#a1dd51949401094f71d10429d45779d53',1,'nuklear_input.c']]], + ['nk_5finput_5fbutton_79',['nk_input_button',['../nuklear_8h.html#ab25cec61c5c9d134f1516f1f30f6eec6',1,'nuklear_input.c']]], + ['nk_5finput_5fchar_80',['nk_input_char',['../nuklear_8h.html#ab9d1ed53c659bd03c8c1c9fc2d9b212f',1,'nuklear_input.c']]], + ['nk_5finput_5fend_81',['nk_input_end',['../nuklear_8h.html#a15c0d237b6bb2f5195a09e259fd7b375',1,'nuklear_input.c']]], + ['nk_5finput_5fglyph_82',['nk_input_glyph',['../nuklear_8h.html#af1d13fdae700f9c0dcd6b683701b71ba',1,'nuklear_input.c']]], + ['nk_5finput_5fkey_83',['nk_input_key',['../nuklear_8h.html#a5d73e825488390b84483762d1265eb43',1,'nuklear_input.c']]], + ['nk_5finput_5fmotion_84',['nk_input_motion',['../nuklear_8h.html#acdbdc5795b24d36875281cf3cac671fe',1,'nuklear_input.c']]], + ['nk_5finput_5fscroll_85',['nk_input_scroll',['../nuklear_8h.html#abfc42a2f22d2f4404305ec8a82429290',1,'nuklear_input.c']]], + ['nk_5finput_5funicode_86',['nk_input_unicode',['../nuklear_8h.html#a576737a9d5fd115e5007f99c5c8aa4cd',1,'nuklear_input.c']]], + ['nk_5fitem_5fis_5fany_5factive_87',['nk_item_is_any_active',['../nuklear_8h.html#a562be2c0a03cb227be14ea82b4b517d7',1,'nuklear_window.c']]], + ['nk_5fkey_88',['nk_key',['../structnk__key.html',1,'']]], + ['nk_5fkeyboard_89',['nk_keyboard',['../structnk__keyboard.html',1,'']]], + ['nk_5flayout_5fratio_5ffrom_5fpixel_90',['nk_layout_ratio_from_pixel',['../nuklear_8h.html#ab638c3eb41863167e6d63782f1b03da5',1,'nuklear_layout.c']]], + ['nk_5flayout_5freset_5fmin_5frow_5fheight_91',['nk_layout_reset_min_row_height',['../nuklear_8h.html#a89484639fccf5ad9d7a3bd7a4c6f61c4',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_92',['nk_layout_row',['../nuklear_8h.html#a2cff6f5c2a9078eb768ac753b63a5c31',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fbegin_93',['nk_layout_row_begin',['../nuklear_8h.html#aa6fa7480529cb74d07dd28c9c26d6549',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fdynamic_94',['nk_layout_row_dynamic',['../nuklear_8h.html#a76e65dc775c0bd5efaa3c8f38f96823f',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fend_95',['nk_layout_row_end',['../nuklear_8h.html#a14c7337d52877793ae04968e75f2c21f',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fpush_96',['nk_layout_row_push',['../nuklear_8h.html#ab6fb149f7829d6c5f7361c93f26066aa',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fstatic_97',['nk_layout_row_static',['../nuklear_8h.html#af8176018717fa81e62969ca5830414e3',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fbegin_98',['nk_layout_row_template_begin',['../nuklear_8h.html#ab4d9ca7699d2c14a607d743224519c09',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fend_99',['nk_layout_row_template_end',['../nuklear_8h.html#a85583ce3aa0054fc050bb165fc580462',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fdynamic_100',['nk_layout_row_template_push_dynamic',['../nuklear_8h.html#a47e464949ca9a44f483d327edb99e51b',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fstatic_101',['nk_layout_row_template_push_static',['../nuklear_8h.html#a6836529c6d66e638eee38ba3da0d4d56',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fvariable_102',['nk_layout_row_template_push_variable',['../nuklear_8h.html#ae89deb176b082dbbf6fec568bc21a860',1,'nuklear_layout.c']]], + ['nk_5flayout_5fset_5fmin_5frow_5fheight_103',['nk_layout_set_min_row_height',['../nuklear_8h.html#aa0f2bd54b2ca26744dc1d019c10824c4',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fbegin_104',['nk_layout_space_begin',['../nuklear_8h.html#ace378fd581870e7045334ca5a7cd8f2e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fbounds_105',['nk_layout_space_bounds',['../nuklear_8h.html#acf7221ac37ad8e7054a89b54f0278405',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fend_106',['nk_layout_space_end',['../nuklear_8h.html#a2231e266013063456f3b20f882a9831e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fpush_107',['nk_layout_space_push',['../nuklear_8h.html#aafd65bb1d45bb98e147ec1d76173242e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5frect_5fto_5flocal_108',['nk_layout_space_rect_to_local',['../nuklear_8h.html#a936ad1078428b94f079d22f7f6691950',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5frect_5fto_5fscreen_109',['nk_layout_space_rect_to_screen',['../nuklear_8h.html#ab7ed4576104cc5d0e2d3b91094772e86',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fto_5flocal_110',['nk_layout_space_to_local',['../nuklear_8h.html#a4f05d86822b6809dc276645517151895',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fto_5fscreen_111',['nk_layout_space_to_screen',['../nuklear_8h.html#a3bf8ed829f20eeee39b9fb6f734ff9ce',1,'nuklear_layout.c']]], + ['nk_5flayout_5fwidget_5fbounds_112',['nk_layout_widget_bounds',['../nuklear_8h.html#ab781f44009d6c85898ab8484a1d09797',1,'nuklear_layout.c']]], + ['nk_5flist_5fview_113',['nk_list_view',['../structnk__list__view.html',1,'']]], + ['nk_5fmemory_114',['nk_memory',['../structnk__memory.html',1,'']]], + ['nk_5fmemory_5fstatus_115',['nk_memory_status',['../structnk__memory__status.html',1,'']]], + ['nk_5fmenu_5fstate_116',['nk_menu_state',['../structnk__menu__state.html',1,'']]], + ['nk_5fmouse_117',['nk_mouse',['../structnk__mouse.html',1,'']]], + ['nk_5fmouse_5fbutton_118',['nk_mouse_button',['../structnk__mouse__button.html',1,'']]], + ['nk_5fnine_5fslice_119',['nk_nine_slice',['../structnk__nine__slice.html',1,'']]], + ['nk_5fpage_120',['nk_page',['../structnk__page.html',1,'']]], + ['nk_5fpage_5fdata_121',['nk_page_data',['../unionnk__page__data.html',1,'']]], + ['nk_5fpage_5felement_122',['nk_page_element',['../structnk__page__element.html',1,'']]], + ['nk_5fpanel_123',['nk_panel',['../structnk__panel.html',1,'']]], + ['nk_5fpool_124',['nk_pool',['../structnk__pool.html',1,'']]], + ['nk_5fpopup_5fbuffer_125',['nk_popup_buffer',['../structnk__popup__buffer.html',1,'']]], + ['nk_5fpopup_5fstate_126',['nk_popup_state',['../structnk__popup__state.html',1,'']]], + ['nk_5fproperty_127',['nk_property',['../unionnk__property.html',1,'']]], + ['nk_5fproperty_5fdouble_128',['nk_property_double',['../nuklear_8h.html#a6078e0bd051eadbaab18f5acea38e516',1,'nuklear_property.c']]], + ['nk_5fproperty_5ffloat_129',['nk_property_float',['../nuklear_8h.html#a2ad0b76d6b0b29ba37ca1777953d4f89',1,'nuklear_property.c']]], + ['nk_5fproperty_5fstate_130',['nk_property_state',['../structnk__property__state.html',1,'']]], + ['nk_5fproperty_5fvariant_131',['nk_property_variant',['../structnk__property__variant.html',1,'']]], + ['nk_5fpropertyd_132',['nk_propertyd',['../nuklear_8h.html#ac5840ee35a5f6fcb30a086cf72afd991',1,'nuklear_property.c']]], + ['nk_5fpropertyf_133',['nk_propertyf',['../nuklear_8h.html#a2030121357983cfabd73fadb997dbf04',1,'nuklear_property.c']]], + ['nk_5fpropertyi_134',['nk_propertyi',['../nuklear_8h.html#af079769a8700d947492b8b08977eeca2',1,'nuklear_property.c']]], + ['nk_5frect_135',['nk_rect',['../structnk__rect.html',1,'']]], + ['nk_5frecti_136',['nk_recti',['../structnk__recti.html',1,'']]], + ['nk_5frow_5flayout_137',['nk_row_layout',['../structnk__row__layout.html',1,'']]], + ['nk_5frule_5fhorizontal_138',['nk_rule_horizontal',['../nuklear_8h.html#a21f6b2b4f799375a50b7382be96d397f',1,'nuklear_window.c']]], + ['nk_5fscroll_139',['nk_scroll',['../structnk__scroll.html',1,'']]], + ['nk_5fspacer_140',['nk_spacer',['../nuklear_8h.html#a197cb17338c3c973765558f0ddeb9fc0',1,'nuklear_layout.c']]], + ['nk_5fstr_141',['nk_str',['../structnk__str.html',1,'']]], + ['nk_5fstroke_5fline_142',['nk_stroke_line',['../nuklear_8h.html#a5f48f521429154981803612ee2c80850',1,'nuklear_draw.c']]], + ['nk_5fstyle_143',['nk_style',['../structnk__style.html',1,'']]], + ['nk_5fstyle_5fbutton_144',['nk_style_button',['../structnk__style__button.html',1,'']]], + ['nk_5fstyle_5fchart_145',['nk_style_chart',['../structnk__style__chart.html',1,'']]], + ['nk_5fstyle_5fcombo_146',['nk_style_combo',['../structnk__style__combo.html',1,'']]], + ['nk_5fstyle_5fedit_147',['nk_style_edit',['../structnk__style__edit.html',1,'']]], + ['nk_5fstyle_5fitem_148',['nk_style_item',['../structnk__style__item.html',1,'']]], + ['nk_5fstyle_5fitem_5fdata_149',['nk_style_item_data',['../unionnk__style__item__data.html',1,'']]], + ['nk_5fstyle_5fknob_150',['nk_style_knob',['../structnk__style__knob.html',1,'']]], + ['nk_5fstyle_5fprogress_151',['nk_style_progress',['../structnk__style__progress.html',1,'']]], + ['nk_5fstyle_5fproperty_152',['nk_style_property',['../structnk__style__property.html',1,'']]], + ['nk_5fstyle_5fscrollbar_153',['nk_style_scrollbar',['../structnk__style__scrollbar.html',1,'']]], + ['nk_5fstyle_5fselectable_154',['nk_style_selectable',['../structnk__style__selectable.html',1,'']]], + ['nk_5fstyle_5fslider_155',['nk_style_slider',['../structnk__style__slider.html',1,'']]], + ['nk_5fstyle_5ftab_156',['nk_style_tab',['../structnk__style__tab.html',1,'']]], + ['nk_5fstyle_5ftext_157',['nk_style_text',['../structnk__style__text.html',1,'']]], + ['nk_5fstyle_5ftoggle_158',['nk_style_toggle',['../structnk__style__toggle.html',1,'']]], + ['nk_5fstyle_5fwindow_159',['nk_style_window',['../structnk__style__window.html',1,'']]], + ['nk_5fstyle_5fwindow_5fheader_160',['nk_style_window_header',['../structnk__style__window__header.html',1,'']]], + ['nk_5ftable_161',['nk_table',['../structnk__table.html',1,'']]], + ['nk_5ftext_162',['nk_text',['../structnk__text.html',1,'']]], + ['nk_5ftext_5fedit_163',['nk_text_edit',['../structnk__text__edit.html',1,'']]], + ['nk_5ftext_5fedit_5frow_164',['nk_text_edit_row',['../structnk__text__edit__row.html',1,'']]], + ['nk_5ftext_5ffind_165',['nk_text_find',['../structnk__text__find.html',1,'']]], + ['nk_5ftext_5fundo_5frecord_166',['nk_text_undo_record',['../structnk__text__undo__record.html',1,'']]], + ['nk_5ftext_5fundo_5fstate_167',['nk_text_undo_state',['../structnk__text__undo__state.html',1,'']]], + ['nk_5ftextedit_5finit_168',['nk_textedit_init',['../nuklear_8h.html#af93216fccd3c3f84ed133a6fb08561e1',1,'nuklear_text_editor.c']]], + ['nk_5ftree_5fimage_5fpush_169',['nk_tree_image_push',['../nuklear_8h.html#a51eaeff03e299744c9bd2ad096183425',1,'nuklear.h']]], + ['nk_5ftree_5fimage_5fpush_5fhashed_170',['nk_tree_image_push_hashed',['../nuklear_8h.html#a42cc204c4350de1acc2e652a0a486bcf',1,'nuklear_tree.c']]], + ['nk_5ftree_5fimage_5fpush_5fid_171',['nk_tree_image_push_id',['../nuklear_8h.html#a369a7855c556b4f77c23a7114c70b9d1',1,'nuklear.h']]], + ['nk_5ftree_5fpop_172',['nk_tree_pop',['../nuklear_8h.html#a05362d2293e86def0f3ba6d312276a9a',1,'nuklear_tree.c']]], + ['nk_5ftree_5fpush_173',['nk_tree_push',['../nuklear_8h.html#aa53e8d85086bd6cf126ccca1aa18b2d8',1,'nuklear.h']]], + ['nk_5ftree_5fpush_5fhashed_174',['nk_tree_push_hashed',['../nuklear_8h.html#a99112ed97e24a0d53c0060f7d6dc8cc0',1,'nuklear_tree.c']]], + ['nk_5ftree_5fpush_5fid_175',['nk_tree_push_id',['../nuklear_8h.html#a9b006635928fac2b54c5f822f9312927',1,'nuklear.h']]], + ['nk_5ftree_5fstate_5fimage_5fpush_176',['nk_tree_state_image_push',['../nuklear_8h.html#a6bb8e2faf97d70d1a40db1201671780f',1,'nuklear_tree.c']]], + ['nk_5ftree_5fstate_5fpop_177',['nk_tree_state_pop',['../nuklear_8h.html#ab654dd3881863a7ae992db45a071d77f',1,'nuklear_tree.c']]], + ['nk_5ftree_5fstate_5fpush_178',['nk_tree_state_push',['../nuklear_8h.html#a976a55dc27c8169dc1a99f7d13088be8',1,'nuklear_tree.c']]], + ['nk_5fuser_5ffont_179',['nk_user_font',['../structnk__user__font.html',1,'']]], + ['nk_5futf_5finvalid_180',['NK_UTF_INVALID',['../nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6',1,'NK_UTF_INVALID(): nuklear.h'],['../nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6',1,'NK_UTF_INVALID(): nuklear.h']]], + ['nk_5futf_5fsize_181',['NK_UTF_SIZE',['../nuklear_8h.html#a5751d22e6e68d2bf104010d6422bd28e',1,'nuklear.h']]], + ['nk_5fvec2_182',['nk_vec2',['../structnk__vec2.html',1,'']]], + ['nk_5fvec2i_183',['nk_vec2i',['../structnk__vec2i.html',1,'']]], + ['nk_5fwidget_5fdisabled_184',['NK_WIDGET_DISABLED',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a41d0b2a9298cdfbc00b7edfd8e4d2b80',1,'nuklear.h']]], + ['nk_5fwidget_5finvalid_185',['NK_WIDGET_INVALID',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1ad5f813542df282f73abddd1f7bdda45c',1,'nuklear.h']]], + ['nk_5fwidget_5flayout_5fstates_186',['nk_widget_layout_states',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1',1,'nuklear.h']]], + ['nk_5fwidget_5from_187',['NK_WIDGET_ROM',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a557df3c02dd4ccb5463d5c416791f8b1',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5factive_188',['NK_WIDGET_STATE_ACTIVE',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecac98cceb386b40c1fd53c0e3767981d72',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5factived_189',['NK_WIDGET_STATE_ACTIVED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca50500d1a5679bdcea512b954f2166861',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fentered_190',['NK_WIDGET_STATE_ENTERED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca65255dbe033baa60268dc401e4648be4',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fhover_191',['NK_WIDGET_STATE_HOVER',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca87f536ff0af612d2ac85e586780208f9',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fhovered_192',['NK_WIDGET_STATE_HOVERED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecacce4016e3b9a1f21434caa9180d3e71a',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fleft_193',['NK_WIDGET_STATE_LEFT',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca2fb9071f1785d3bd24e5b2d3c54fadc6',1,'nuklear.h']]], + ['nk_5fwidget_5fstates_194',['nk_widget_states',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ec',1,'nuklear.h']]], + ['nk_5fwidget_5fvalid_195',['NK_WIDGET_VALID',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a7f6fe5dc8fe1861be8501688439fc6a5',1,'nuklear.h']]], + ['nk_5fwindow_196',['nk_window',['../structnk__window.html',1,'']]], + ['nk_5fwindow_5fclose_197',['nk_window_close',['../nuklear_8h.html#a17d99544eee290e0d79e5d3eb1cdac03',1,'nuklear_window.c']]], + ['nk_5fwindow_5fclosed_198',['NK_WINDOW_CLOSED',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba3be8a8e7e04ad6ab437896166ebcbc4f',1,'nuklear.h']]], + ['nk_5fwindow_5fcollapse_199',['nk_window_collapse',['../nuklear_8h.html#a7fc3d426db189e2e0a4557e80135601e',1,'nuklear_window.c']]], + ['nk_5fwindow_5fcollapse_5fif_200',['nk_window_collapse_if',['../nuklear_8h.html#a35eb1ef534da74f5b1a6cfd873aad40e',1,'nuklear_window.c']]], + ['nk_5fwindow_5fdynamic_201',['NK_WINDOW_DYNAMIC',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaab90ee2238b18042d986c5c2021d44e8',1,'nuklear.h']]], + ['nk_5fwindow_5ffind_202',['nk_window_find',['../nuklear_8h.html#afa03f5e650448bc8b23d21191622a89f',1,'nuklear_window.c']]], + ['nk_5fwindow_5fflags_203',['nk_window_flags',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcb',1,'nuklear.h']]], + ['nk_5fwindow_5fget_5fbounds_204',['nk_window_get_bounds',['../nuklear_8h.html#a953e4260d75945c20995971ba0454806',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcanvas_205',['nk_window_get_canvas',['../nuklear_8h.html#a767970d6ba82bde35cc90851d4077dd1',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_206',['nk_window_get_content_region',['../nuklear_8h.html#ad32015c0b7b53e4df428d7b8e123e18e',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fmax_207',['nk_window_get_content_region_max',['../nuklear_8h.html#a0c121dd2f61a58534da0a1c5de756f85',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fmin_208',['nk_window_get_content_region_min',['../nuklear_8h.html#ab9869953c48593e9e85de6bbb3b8e9e5',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fsize_209',['nk_window_get_content_region_size',['../nuklear_8h.html#a69e94ee039dd5a69831aaef36a24b520',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fheight_210',['nk_window_get_height',['../nuklear_8h.html#aa62210de969d101d5d79ba600fe9ff33',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fpanel_211',['nk_window_get_panel',['../nuklear_8h.html#a983290e0e285e1366aee0af6ba0ed4e7',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fposition_212',['nk_window_get_position',['../nuklear_8h.html#aef2af65486366fb8f4a36166b4dc9c41',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fscroll_213',['nk_window_get_scroll',['../nuklear_8h.html#a6aa450a42ad526df04edeedd1db8348a',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fsize_214',['nk_window_get_size',['../nuklear_8h.html#a45b8d37fe77e0042ebf5b58e1b253217',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fwidth_215',['nk_window_get_width',['../nuklear_8h.html#abc629faa5b527aea0c5b3f4b6a233883',1,'nuklear_window.c']]], + ['nk_5fwindow_5fhas_5ffocus_216',['nk_window_has_focus',['../nuklear_8h.html#a87d7636e4f8ad8fff456a7291d63549b',1,'nuklear_window.c']]], + ['nk_5fwindow_5fhidden_217',['NK_WINDOW_HIDDEN',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba81992755e35fb91f927d8bd2713dc863',1,'nuklear.h']]], + ['nk_5fwindow_5fis_5factive_218',['nk_window_is_active',['../nuklear_8h.html#a4aea66b4db514df19651e03b26eaacee',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fany_5fhovered_219',['nk_window_is_any_hovered',['../nuklear_8h.html#a5922a25b765837062d0ded6bb8369041',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fclosed_220',['nk_window_is_closed',['../nuklear_8h.html#ad8e62bbe0e9db9d84e83f494ab750c26',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fcollapsed_221',['nk_window_is_collapsed',['../nuklear_8h.html#a759513017e5bca51e13be0268d41f510',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fhidden_222',['nk_window_is_hidden',['../nuklear_8h.html#a5ba38e6da74e5a1f82453c1215ccd138',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fhovered_223',['nk_window_is_hovered',['../nuklear_8h.html#a324553b9e3c4450764a208454ac71454',1,'nuklear_window.c']]], + ['nk_5fwindow_5fminimized_224',['NK_WINDOW_MINIMIZED',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba47f192dacded1a121d2cc1310b6e8744',1,'nuklear.h']]], + ['nk_5fwindow_5fnot_5finteractive_225',['NK_WINDOW_NOT_INTERACTIVE',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba9c4699c1a5cd1c98ef0ce61a735a222b',1,'nuklear.h']]], + ['nk_5fwindow_5fremove_5from_226',['NK_WINDOW_REMOVE_ROM',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaf208ef2afefe375192c16346807ffdbc',1,'nuklear.h']]], + ['nk_5fwindow_5from_227',['NK_WINDOW_ROM',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba8aef178528a755ee12bd36d5a4e41837',1,'nuklear.h']]], + ['nk_5fwindow_5fset_5fbounds_228',['nk_window_set_bounds',['../nuklear_8h.html#a953db327dad500d512deee42378816ac',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5ffocus_229',['nk_window_set_focus',['../nuklear_8h.html#a55f290b12d04ce2b8de2229cf0c9540a',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fposition_230',['nk_window_set_position',['../nuklear_8h.html#a6de7d1d2c130ab249964b71a4626b1aa',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fscroll_231',['nk_window_set_scroll',['../nuklear_8h.html#a43344b5de927f1e705cbf6eca17c7314',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fsize_232',['nk_window_set_size',['../nuklear_8h.html#ab19652cd191237bf2723f235a14385f5',1,'nuklear_window.c']]], + ['nk_5fwindow_5fshow_233',['nk_window_show',['../nuklear_8h.html#a73ed9654303545bca9b8e4d6a5454363',1,'nuklear_window.c']]], + ['nk_5fwindow_5fshow_5fif_234',['nk_window_show_if',['../nuklear_8h.html#aa1eaa64d0de02f059163fc502386ce1b',1,'nuklear_window.c']]], + ['nuklear_235',['Nuklear',['../index.html',1,'']]], + ['nuklear_2eh_236',['nuklear.h',['../nuklear_8h.html',1,'']]] +]; diff --git a/search/all_9.html b/search/all_9.html new file mode 100644 index 000000000..1e263c134 --- /dev/null +++ b/search/all_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_9.js b/search/all_9.js new file mode 100644 index 000000000..1ac2e7a45 --- /dev/null +++ b/search/all_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['overlay_237',['overlay',['../structnk__context.html#ae51cac633c54b94a63c8fe77b9558f4a',1,'nk_context']]] +]; diff --git a/search/all_a.html b/search/all_a.html new file mode 100644 index 000000000..3a6cac108 --- /dev/null +++ b/search/all_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_a.js b/search/all_a.js new file mode 100644 index 000000000..c339d962d --- /dev/null +++ b/search/all_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['pool_238',['pool',['../structnk__buffer.html#a0cd2b90bb2994190fa1aa0e9ffbc1184',1,'nk_buffer']]] +]; diff --git a/search/all_b.html b/search/all_b.html new file mode 100644 index 000000000..130deb4ed --- /dev/null +++ b/search/all_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_b.js b/search/all_b.js new file mode 100644 index 000000000..dbaa68d61 --- /dev/null +++ b/search/all_b.js @@ -0,0 +1,18 @@ +var searchData= +[ + ['shape_5faa_239',['shape_AA',['../structnk__convert__config.html#a1d0cf3e01234c636729dfd0fddf5b2c7',1,'nk_convert_config']]], + ['size_240',['size',['../structnk__buffer.html#a71e66eb6dad2c5827e363f2389ad4505',1,'nk_buffer']]], + ['stbrp_5fcontext_241',['stbrp_context',['../structstbrp__context.html',1,'']]], + ['stbrp_5fnode_242',['stbrp_node',['../structstbrp__node.html',1,'']]], + ['stbrp_5frect_243',['stbrp_rect',['../structstbrp__rect.html',1,'']]], + ['stbtt_5f_5fbitmap_244',['stbtt__bitmap',['../structstbtt____bitmap.html',1,'']]], + ['stbtt_5f_5fbuf_245',['stbtt__buf',['../structstbtt____buf.html',1,'']]], + ['stbtt_5faligned_5fquad_246',['stbtt_aligned_quad',['../structstbtt__aligned__quad.html',1,'']]], + ['stbtt_5fbakedchar_247',['stbtt_bakedchar',['../structstbtt__bakedchar.html',1,'']]], + ['stbtt_5ffontinfo_248',['stbtt_fontinfo',['../structstbtt__fontinfo.html',1,'']]], + ['stbtt_5fkerningentry_249',['stbtt_kerningentry',['../structstbtt__kerningentry.html',1,'']]], + ['stbtt_5fpack_5fcontext_250',['stbtt_pack_context',['../structstbtt__pack__context.html',1,'']]], + ['stbtt_5fpack_5frange_251',['stbtt_pack_range',['../structstbtt__pack__range.html',1,'']]], + ['stbtt_5fpackedchar_252',['stbtt_packedchar',['../structstbtt__packedchar.html',1,'']]], + ['stbtt_5fvertex_253',['stbtt_vertex',['../structstbtt__vertex.html',1,'']]] +]; diff --git a/search/all_c.html b/search/all_c.html new file mode 100644 index 000000000..3dd5af06d --- /dev/null +++ b/search/all_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_c.js b/search/all_c.js new file mode 100644 index 000000000..c1a8c7eb6 --- /dev/null +++ b/search/all_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['tex_5fnull_254',['tex_null',['../structnk__convert__config.html#afe7d1907a295a3db7bbb11e3f0f98c1e',1,'nk_convert_config']]], + ['text_5fedit_255',['text_edit',['../structnk__context.html#aca8a2124af97661372f7b35d636c9bc6',1,'nk_context']]], + ['type_256',['type',['../structnk__buffer.html#a3842a03554db557944e84bc5af61249e',1,'nk_buffer']]] +]; diff --git a/search/all_d.html b/search/all_d.html new file mode 100644 index 000000000..af7f2f0f5 --- /dev/null +++ b/search/all_d.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_d.js b/search/all_d.js new file mode 100644 index 000000000..f5da7f732 --- /dev/null +++ b/search/all_d.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['uv_257',['uv',['../structnk__draw__null__texture.html#ae00f89beb79ed9aa53d2ddcbdd1ea7c7',1,'nk_draw_null_texture']]] +]; diff --git a/search/all_e.html b/search/all_e.html new file mode 100644 index 000000000..e25df423a --- /dev/null +++ b/search/all_e.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_e.js b/search/all_e.js new file mode 100644 index 000000000..1cfd80eef --- /dev/null +++ b/search/all_e.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['vertex_5falignment_258',['vertex_alignment',['../structnk__convert__config.html#a92519fe62ef0e8f0d7180dbd874c775f',1,'nk_convert_config']]], + ['vertex_5flayout_259',['vertex_layout',['../structnk__convert__config.html#addeb894f54f2ba1dbe3d5bf887b27776',1,'nk_convert_config']]], + ['vertex_5fsize_260',['vertex_size',['../structnk__convert__config.html#acf0d9e08220c6e29ee9d2753f9273591',1,'nk_convert_config']]] +]; diff --git a/search/all_f.html b/search/all_f.html new file mode 100644 index 000000000..b23da6ce4 --- /dev/null +++ b/search/all_f.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/all_f.js b/search/all_f.js new file mode 100644 index 000000000..50420425f --- /dev/null +++ b/search/all_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['width_261',['width',['../structnk__user__font.html#aac686ca3e72208ddfb982caa7c89293a',1,'nk_user_font']]] +]; diff --git a/search/classes_0.html b/search/classes_0.html new file mode 100644 index 000000000..af8159ee6 --- /dev/null +++ b/search/classes_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/classes_0.js b/search/classes_0.js new file mode 100644 index 000000000..c14a89e45 --- /dev/null +++ b/search/classes_0.js @@ -0,0 +1,93 @@ +var searchData= +[ + ['nk_5fallocator_262',['nk_allocator',['../structnk__allocator.html',1,'']]], + ['nk_5fbuffer_263',['nk_buffer',['../structnk__buffer.html',1,'']]], + ['nk_5fbuffer_5fmarker_264',['nk_buffer_marker',['../structnk__buffer__marker.html',1,'']]], + ['nk_5fchart_265',['nk_chart',['../structnk__chart.html',1,'']]], + ['nk_5fchart_5fslot_266',['nk_chart_slot',['../structnk__chart__slot.html',1,'']]], + ['nk_5fclipboard_267',['nk_clipboard',['../structnk__clipboard.html',1,'']]], + ['nk_5fcolor_268',['nk_color',['../structnk__color.html',1,'']]], + ['nk_5fcolorf_269',['nk_colorf',['../structnk__colorf.html',1,'']]], + ['nk_5fcommand_270',['nk_command',['../structnk__command.html',1,'']]], + ['nk_5fcommand_5farc_271',['nk_command_arc',['../structnk__command__arc.html',1,'']]], + ['nk_5fcommand_5farc_5ffilled_272',['nk_command_arc_filled',['../structnk__command__arc__filled.html',1,'']]], + ['nk_5fcommand_5fbuffer_273',['nk_command_buffer',['../structnk__command__buffer.html',1,'']]], + ['nk_5fcommand_5fcircle_274',['nk_command_circle',['../structnk__command__circle.html',1,'']]], + ['nk_5fcommand_5fcircle_5ffilled_275',['nk_command_circle_filled',['../structnk__command__circle__filled.html',1,'']]], + ['nk_5fcommand_5fcurve_276',['nk_command_curve',['../structnk__command__curve.html',1,'']]], + ['nk_5fcommand_5fcustom_277',['nk_command_custom',['../structnk__command__custom.html',1,'']]], + ['nk_5fcommand_5fimage_278',['nk_command_image',['../structnk__command__image.html',1,'']]], + ['nk_5fcommand_5fline_279',['nk_command_line',['../structnk__command__line.html',1,'']]], + ['nk_5fcommand_5fpolygon_280',['nk_command_polygon',['../structnk__command__polygon.html',1,'']]], + ['nk_5fcommand_5fpolygon_5ffilled_281',['nk_command_polygon_filled',['../structnk__command__polygon__filled.html',1,'']]], + ['nk_5fcommand_5fpolyline_282',['nk_command_polyline',['../structnk__command__polyline.html',1,'']]], + ['nk_5fcommand_5frect_283',['nk_command_rect',['../structnk__command__rect.html',1,'']]], + ['nk_5fcommand_5frect_5ffilled_284',['nk_command_rect_filled',['../structnk__command__rect__filled.html',1,'']]], + ['nk_5fcommand_5frect_5fmulti_5fcolor_285',['nk_command_rect_multi_color',['../structnk__command__rect__multi__color.html',1,'']]], + ['nk_5fcommand_5fscissor_286',['nk_command_scissor',['../structnk__command__scissor.html',1,'']]], + ['nk_5fcommand_5ftext_287',['nk_command_text',['../structnk__command__text.html',1,'']]], + ['nk_5fcommand_5ftriangle_288',['nk_command_triangle',['../structnk__command__triangle.html',1,'']]], + ['nk_5fcommand_5ftriangle_5ffilled_289',['nk_command_triangle_filled',['../structnk__command__triangle__filled.html',1,'']]], + ['nk_5fconfiguration_5fstacks_290',['nk_configuration_stacks',['../structnk__configuration__stacks.html',1,'']]], + ['nk_5fcontext_291',['nk_context',['../structnk__context.html',1,'']]], + ['nk_5fconvert_5fconfig_292',['nk_convert_config',['../structnk__convert__config.html',1,'']]], + ['nk_5fcursor_293',['nk_cursor',['../structnk__cursor.html',1,'']]], + ['nk_5fdraw_5fnull_5ftexture_294',['nk_draw_null_texture',['../structnk__draw__null__texture.html',1,'']]], + ['nk_5fedit_5fstate_295',['nk_edit_state',['../structnk__edit__state.html',1,'']]], + ['nk_5fhandle_296',['nk_handle',['../unionnk__handle.html',1,'']]], + ['nk_5fimage_297',['nk_image',['../structnk__image.html',1,'']]], + ['nk_5finput_298',['nk_input',['../structnk__input.html',1,'']]], + ['nk_5fkey_299',['nk_key',['../structnk__key.html',1,'']]], + ['nk_5fkeyboard_300',['nk_keyboard',['../structnk__keyboard.html',1,'']]], + ['nk_5flist_5fview_301',['nk_list_view',['../structnk__list__view.html',1,'']]], + ['nk_5fmemory_302',['nk_memory',['../structnk__memory.html',1,'']]], + ['nk_5fmemory_5fstatus_303',['nk_memory_status',['../structnk__memory__status.html',1,'']]], + ['nk_5fmenu_5fstate_304',['nk_menu_state',['../structnk__menu__state.html',1,'']]], + ['nk_5fmouse_305',['nk_mouse',['../structnk__mouse.html',1,'']]], + ['nk_5fmouse_5fbutton_306',['nk_mouse_button',['../structnk__mouse__button.html',1,'']]], + ['nk_5fnine_5fslice_307',['nk_nine_slice',['../structnk__nine__slice.html',1,'']]], + ['nk_5fpage_308',['nk_page',['../structnk__page.html',1,'']]], + ['nk_5fpage_5fdata_309',['nk_page_data',['../unionnk__page__data.html',1,'']]], + ['nk_5fpage_5felement_310',['nk_page_element',['../structnk__page__element.html',1,'']]], + ['nk_5fpanel_311',['nk_panel',['../structnk__panel.html',1,'']]], + ['nk_5fpool_312',['nk_pool',['../structnk__pool.html',1,'']]], + ['nk_5fpopup_5fbuffer_313',['nk_popup_buffer',['../structnk__popup__buffer.html',1,'']]], + ['nk_5fpopup_5fstate_314',['nk_popup_state',['../structnk__popup__state.html',1,'']]], + ['nk_5fproperty_315',['nk_property',['../unionnk__property.html',1,'']]], + ['nk_5fproperty_5fstate_316',['nk_property_state',['../structnk__property__state.html',1,'']]], + ['nk_5fproperty_5fvariant_317',['nk_property_variant',['../structnk__property__variant.html',1,'']]], + ['nk_5frect_318',['nk_rect',['../structnk__rect.html',1,'']]], + ['nk_5frecti_319',['nk_recti',['../structnk__recti.html',1,'']]], + ['nk_5frow_5flayout_320',['nk_row_layout',['../structnk__row__layout.html',1,'']]], + ['nk_5fscroll_321',['nk_scroll',['../structnk__scroll.html',1,'']]], + ['nk_5fstr_322',['nk_str',['../structnk__str.html',1,'']]], + ['nk_5fstyle_323',['nk_style',['../structnk__style.html',1,'']]], + ['nk_5fstyle_5fbutton_324',['nk_style_button',['../structnk__style__button.html',1,'']]], + ['nk_5fstyle_5fchart_325',['nk_style_chart',['../structnk__style__chart.html',1,'']]], + ['nk_5fstyle_5fcombo_326',['nk_style_combo',['../structnk__style__combo.html',1,'']]], + ['nk_5fstyle_5fedit_327',['nk_style_edit',['../structnk__style__edit.html',1,'']]], + ['nk_5fstyle_5fitem_328',['nk_style_item',['../structnk__style__item.html',1,'']]], + ['nk_5fstyle_5fitem_5fdata_329',['nk_style_item_data',['../unionnk__style__item__data.html',1,'']]], + ['nk_5fstyle_5fknob_330',['nk_style_knob',['../structnk__style__knob.html',1,'']]], + ['nk_5fstyle_5fprogress_331',['nk_style_progress',['../structnk__style__progress.html',1,'']]], + ['nk_5fstyle_5fproperty_332',['nk_style_property',['../structnk__style__property.html',1,'']]], + ['nk_5fstyle_5fscrollbar_333',['nk_style_scrollbar',['../structnk__style__scrollbar.html',1,'']]], + ['nk_5fstyle_5fselectable_334',['nk_style_selectable',['../structnk__style__selectable.html',1,'']]], + ['nk_5fstyle_5fslider_335',['nk_style_slider',['../structnk__style__slider.html',1,'']]], + ['nk_5fstyle_5ftab_336',['nk_style_tab',['../structnk__style__tab.html',1,'']]], + ['nk_5fstyle_5ftext_337',['nk_style_text',['../structnk__style__text.html',1,'']]], + ['nk_5fstyle_5ftoggle_338',['nk_style_toggle',['../structnk__style__toggle.html',1,'']]], + ['nk_5fstyle_5fwindow_339',['nk_style_window',['../structnk__style__window.html',1,'']]], + ['nk_5fstyle_5fwindow_5fheader_340',['nk_style_window_header',['../structnk__style__window__header.html',1,'']]], + ['nk_5ftable_341',['nk_table',['../structnk__table.html',1,'']]], + ['nk_5ftext_342',['nk_text',['../structnk__text.html',1,'']]], + ['nk_5ftext_5fedit_343',['nk_text_edit',['../structnk__text__edit.html',1,'']]], + ['nk_5ftext_5fedit_5frow_344',['nk_text_edit_row',['../structnk__text__edit__row.html',1,'']]], + ['nk_5ftext_5ffind_345',['nk_text_find',['../structnk__text__find.html',1,'']]], + ['nk_5ftext_5fundo_5frecord_346',['nk_text_undo_record',['../structnk__text__undo__record.html',1,'']]], + ['nk_5ftext_5fundo_5fstate_347',['nk_text_undo_state',['../structnk__text__undo__state.html',1,'']]], + ['nk_5fuser_5ffont_348',['nk_user_font',['../structnk__user__font.html',1,'']]], + ['nk_5fvec2_349',['nk_vec2',['../structnk__vec2.html',1,'']]], + ['nk_5fvec2i_350',['nk_vec2i',['../structnk__vec2i.html',1,'']]], + ['nk_5fwindow_351',['nk_window',['../structnk__window.html',1,'']]] +]; diff --git a/search/classes_1.html b/search/classes_1.html new file mode 100644 index 000000000..576e91689 --- /dev/null +++ b/search/classes_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/classes_1.js b/search/classes_1.js new file mode 100644 index 000000000..c72a28dbc --- /dev/null +++ b/search/classes_1.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['stbrp_5fcontext_352',['stbrp_context',['../structstbrp__context.html',1,'']]], + ['stbrp_5fnode_353',['stbrp_node',['../structstbrp__node.html',1,'']]], + ['stbrp_5frect_354',['stbrp_rect',['../structstbrp__rect.html',1,'']]], + ['stbtt_5f_5fbitmap_355',['stbtt__bitmap',['../structstbtt____bitmap.html',1,'']]], + ['stbtt_5f_5fbuf_356',['stbtt__buf',['../structstbtt____buf.html',1,'']]], + ['stbtt_5faligned_5fquad_357',['stbtt_aligned_quad',['../structstbtt__aligned__quad.html',1,'']]], + ['stbtt_5fbakedchar_358',['stbtt_bakedchar',['../structstbtt__bakedchar.html',1,'']]], + ['stbtt_5ffontinfo_359',['stbtt_fontinfo',['../structstbtt__fontinfo.html',1,'']]], + ['stbtt_5fkerningentry_360',['stbtt_kerningentry',['../structstbtt__kerningentry.html',1,'']]], + ['stbtt_5fpack_5fcontext_361',['stbtt_pack_context',['../structstbtt__pack__context.html',1,'']]], + ['stbtt_5fpack_5frange_362',['stbtt_pack_range',['../structstbtt__pack__range.html',1,'']]], + ['stbtt_5fpackedchar_363',['stbtt_packedchar',['../structstbtt__packedchar.html',1,'']]], + ['stbtt_5fvertex_364',['stbtt_vertex',['../structstbtt__vertex.html',1,'']]] +]; diff --git a/search/close.svg b/search/close.svg new file mode 100644 index 000000000..a933eea1a --- /dev/null +++ b/search/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/search/defines_0.html b/search/defines_0.html new file mode 100644 index 000000000..15cc3de38 --- /dev/null +++ b/search/defines_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/defines_0.js b/search/defines_0.js new file mode 100644 index 000000000..e54d7150c --- /dev/null +++ b/search/defines_0.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['nk_5fbool_513',['NK_BOOL',['../nuklear_8h.html#a3d22f7496565fb07532fa0c473894915',1,'nuklear.h']]], + ['nk_5fforeach_514',['nk_foreach',['../nuklear_8h.html#aaca7101364db82c0f03401fafd2c66a6',1,'nuklear.h']]], + ['nk_5ftree_5fimage_5fpush_515',['nk_tree_image_push',['../nuklear_8h.html#a51eaeff03e299744c9bd2ad096183425',1,'nuklear.h']]], + ['nk_5ftree_5fimage_5fpush_5fid_516',['nk_tree_image_push_id',['../nuklear_8h.html#a369a7855c556b4f77c23a7114c70b9d1',1,'nuklear.h']]], + ['nk_5ftree_5fpush_517',['nk_tree_push',['../nuklear_8h.html#aa53e8d85086bd6cf126ccca1aa18b2d8',1,'nuklear.h']]], + ['nk_5ftree_5fpush_5fid_518',['nk_tree_push_id',['../nuklear_8h.html#a9b006635928fac2b54c5f822f9312927',1,'nuklear.h']]], + ['nk_5futf_5finvalid_519',['NK_UTF_INVALID',['../nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6',1,'NK_UTF_INVALID(): nuklear.h'],['../nuklear_8h.html#a3d052e6e91b71a1837356c6f8bebb1a6',1,'NK_UTF_INVALID(): nuklear.h']]], + ['nk_5futf_5fsize_520',['NK_UTF_SIZE',['../nuklear_8h.html#a5751d22e6e68d2bf104010d6422bd28e',1,'nuklear.h']]] +]; diff --git a/search/enums_0.html b/search/enums_0.html new file mode 100644 index 000000000..141fff57b --- /dev/null +++ b/search/enums_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/enums_0.js b/search/enums_0.js new file mode 100644 index 000000000..9ca391a4b --- /dev/null +++ b/search/enums_0.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['nk_5fedit_5fevents_488',['nk_edit_events',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737',1,'nuklear.h']]], + ['nk_5fwidget_5flayout_5fstates_489',['nk_widget_layout_states',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1',1,'nuklear.h']]], + ['nk_5fwidget_5fstates_490',['nk_widget_states',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ec',1,'nuklear.h']]], + ['nk_5fwindow_5fflags_491',['nk_window_flags',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcb',1,'nuklear.h']]] +]; diff --git a/search/enumvalues_0.html b/search/enumvalues_0.html new file mode 100644 index 000000000..0d131d95b --- /dev/null +++ b/search/enumvalues_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/enumvalues_0.js b/search/enumvalues_0.js new file mode 100644 index 000000000..c2ad1dacf --- /dev/null +++ b/search/enumvalues_0.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['nk_5fedit_5factivated_492',['NK_EDIT_ACTIVATED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abe7aa005cc1df810a8d99d335e5b2e21',1,'nuklear.h']]], + ['nk_5fedit_5fcommited_493',['NK_EDIT_COMMITED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737abdd1da5f55b6213f935e8333840ee3d1',1,'nuklear.h']]], + ['nk_5fedit_5fdeactivated_494',['NK_EDIT_DEACTIVATED',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737aa72e5bf401897ea75f2eaed14b4d1b97',1,'nuklear.h']]], + ['nk_5fedit_5finactive_495',['NK_EDIT_INACTIVE',['../nuklear_8h.html#af0693d499c07b19b3a07075a0035a737a15b71573eb3cb988dcf77ba090e80c6b',1,'nuklear.h']]], + ['nk_5fwidget_5fdisabled_496',['NK_WIDGET_DISABLED',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a41d0b2a9298cdfbc00b7edfd8e4d2b80',1,'nuklear.h']]], + ['nk_5fwidget_5finvalid_497',['NK_WIDGET_INVALID',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1ad5f813542df282f73abddd1f7bdda45c',1,'nuklear.h']]], + ['nk_5fwidget_5from_498',['NK_WIDGET_ROM',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a557df3c02dd4ccb5463d5c416791f8b1',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5factive_499',['NK_WIDGET_STATE_ACTIVE',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecac98cceb386b40c1fd53c0e3767981d72',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5factived_500',['NK_WIDGET_STATE_ACTIVED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca50500d1a5679bdcea512b954f2166861',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fentered_501',['NK_WIDGET_STATE_ENTERED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca65255dbe033baa60268dc401e4648be4',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fhover_502',['NK_WIDGET_STATE_HOVER',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca87f536ff0af612d2ac85e586780208f9',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fhovered_503',['NK_WIDGET_STATE_HOVERED',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943ecacce4016e3b9a1f21434caa9180d3e71a',1,'nuklear.h']]], + ['nk_5fwidget_5fstate_5fleft_504',['NK_WIDGET_STATE_LEFT',['../nuklear_8h.html#a894de85b018e1e285053f71b6c9943eca2fb9071f1785d3bd24e5b2d3c54fadc6',1,'nuklear.h']]], + ['nk_5fwidget_5fvalid_505',['NK_WIDGET_VALID',['../nuklear_8h.html#ac18958859f81ea11be7d0283adabb2e1a7f6fe5dc8fe1861be8501688439fc6a5',1,'nuklear.h']]], + ['nk_5fwindow_5fclosed_506',['NK_WINDOW_CLOSED',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba3be8a8e7e04ad6ab437896166ebcbc4f',1,'nuklear.h']]], + ['nk_5fwindow_5fdynamic_507',['NK_WINDOW_DYNAMIC',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaab90ee2238b18042d986c5c2021d44e8',1,'nuklear.h']]], + ['nk_5fwindow_5fhidden_508',['NK_WINDOW_HIDDEN',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba81992755e35fb91f927d8bd2713dc863',1,'nuklear.h']]], + ['nk_5fwindow_5fminimized_509',['NK_WINDOW_MINIMIZED',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba47f192dacded1a121d2cc1310b6e8744',1,'nuklear.h']]], + ['nk_5fwindow_5fnot_5finteractive_510',['NK_WINDOW_NOT_INTERACTIVE',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba9c4699c1a5cd1c98ef0ce61a735a222b',1,'nuklear.h']]], + ['nk_5fwindow_5fremove_5from_511',['NK_WINDOW_REMOVE_ROM',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcbaf208ef2afefe375192c16346807ffdbc',1,'nuklear.h']]], + ['nk_5fwindow_5from_512',['NK_WINDOW_ROM',['../nuklear_8h.html#a2c89a31da47e59bdfa3813d2db18dbcba8aef178528a755ee12bd36d5a4e41837',1,'nuklear.h']]] +]; diff --git a/search/files_0.html b/search/files_0.html new file mode 100644 index 000000000..9498842a6 --- /dev/null +++ b/search/files_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/files_0.js b/search/files_0.js new file mode 100644 index 000000000..22357d95b --- /dev/null +++ b/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['nuklear_2eh_365',['nuklear.h',['../nuklear_8h.html',1,'']]] +]; diff --git a/search/functions_0.html b/search/functions_0.html new file mode 100644 index 000000000..eb4c5014c --- /dev/null +++ b/search/functions_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/functions_0.js b/search/functions_0.js new file mode 100644 index 000000000..560d0dd12 --- /dev/null +++ b/search/functions_0.js @@ -0,0 +1,102 @@ +var searchData= +[ + ['nk_5f_5fbegin_366',['nk__begin',['../nuklear_8h.html#a842e2f7d16d53f2625c3e41fecb79fa6',1,'nuklear_context.c']]], + ['nk_5f_5fnext_367',['nk__next',['../nuklear_8h.html#add3ee7ed9a05770277443ccd001c1031',1,'nuklear_context.c']]], + ['nk_5fbegin_368',['nk_begin',['../nuklear_8h.html#aafe58ef289cad9c8cd7f5419fabe7cdd',1,'nuklear_window.c']]], + ['nk_5fbegin_5ftitled_369',['nk_begin_titled',['../nuklear_8h.html#aabf02f938d9da8ac02cd0b972f2e0260',1,'nuklear_window.c']]], + ['nk_5fclear_370',['nk_clear',['../nuklear_8h.html#ade3301f0a92370be1b4beac7eceac279',1,'nuklear_context.c']]], + ['nk_5fdraw_5fimage_371',['nk_draw_image',['../nuklear_8h.html#a322678fb670fa1d061dbed321ee38d1b',1,'nuklear_draw.c']]], + ['nk_5fend_372',['nk_end',['../nuklear_8h.html#ae0ade48c4c8df72456b9d97ab3d195e3',1,'nuklear_window.c']]], + ['nk_5ffill_5frect_373',['nk_fill_rect',['../nuklear_8h.html#a63407f682d240622d8b025d7911596fb',1,'nuklear_draw.c']]], + ['nk_5ffilter_5fdefault_374',['nk_filter_default',['../nuklear_8h.html#a826f79e651ee0e905ca0857886d2848a',1,'nuklear_edit.c']]], + ['nk_5ffree_375',['nk_free',['../nuklear_8h.html#a06772e194320fa99524681fd32df85e9',1,'nuklear_context.c']]], + ['nk_5fgroup_5fbegin_376',['nk_group_begin',['../nuklear_8h.html#a09a50849fef9426cf7a9ad9960b1486a',1,'nuklear_group.c']]], + ['nk_5fgroup_5fbegin_5ftitled_377',['nk_group_begin_titled',['../nuklear_8h.html#aa8ab5670480005694241e37b188d8e06',1,'nuklear_group.c']]], + ['nk_5fgroup_5fend_378',['nk_group_end',['../nuklear_8h.html#ae0e5210696cae430a9e9b79e1f76cee5',1,'nuklear_group.c']]], + ['nk_5fgroup_5fget_5fscroll_379',['nk_group_get_scroll',['../nuklear_8h.html#a4cdbee562347fba0fae90b8250274d96',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5fbegin_380',['nk_group_scrolled_begin',['../nuklear_8h.html#af17d78936039c79f6fe91a4c70d253e2',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5fend_381',['nk_group_scrolled_end',['../nuklear_8h.html#a4552d30d3265ccff7c82232da3cea657',1,'nuklear_group.c']]], + ['nk_5fgroup_5fscrolled_5foffset_5fbegin_382',['nk_group_scrolled_offset_begin',['../nuklear_8h.html#a6adb72deb66e2714d654c8d57bd277b5',1,'nuklear_group.c']]], + ['nk_5fgroup_5fset_5fscroll_383',['nk_group_set_scroll',['../nuklear_8h.html#ab26b83016c296e5ed1f4c6dc79bd5cd1',1,'nuklear_group.c']]], + ['nk_5finit_384',['nk_init',['../nuklear_8h.html#ab5c6cdd02a560dbcbdb5bd54ed753b2c',1,'nuklear_context.c']]], + ['nk_5finit_5fcustom_385',['nk_init_custom',['../nuklear_8h.html#a4122ba85b642a16b61268932b1fed694',1,'nuklear_context.c']]], + ['nk_5finit_5ffixed_386',['nk_init_fixed',['../nuklear_8h.html#a27a65e767320f4d72cee9c3175153b56',1,'nuklear_context.c']]], + ['nk_5finput_5fbegin_387',['nk_input_begin',['../nuklear_8h.html#a1dd51949401094f71d10429d45779d53',1,'nuklear_input.c']]], + ['nk_5finput_5fbutton_388',['nk_input_button',['../nuklear_8h.html#ab25cec61c5c9d134f1516f1f30f6eec6',1,'nuklear_input.c']]], + ['nk_5finput_5fchar_389',['nk_input_char',['../nuklear_8h.html#ab9d1ed53c659bd03c8c1c9fc2d9b212f',1,'nuklear_input.c']]], + ['nk_5finput_5fend_390',['nk_input_end',['../nuklear_8h.html#a15c0d237b6bb2f5195a09e259fd7b375',1,'nuklear_input.c']]], + ['nk_5finput_5fglyph_391',['nk_input_glyph',['../nuklear_8h.html#af1d13fdae700f9c0dcd6b683701b71ba',1,'nuklear_input.c']]], + ['nk_5finput_5fkey_392',['nk_input_key',['../nuklear_8h.html#a5d73e825488390b84483762d1265eb43',1,'nuklear_input.c']]], + ['nk_5finput_5fmotion_393',['nk_input_motion',['../nuklear_8h.html#acdbdc5795b24d36875281cf3cac671fe',1,'nuklear_input.c']]], + ['nk_5finput_5fscroll_394',['nk_input_scroll',['../nuklear_8h.html#abfc42a2f22d2f4404305ec8a82429290',1,'nuklear_input.c']]], + ['nk_5finput_5funicode_395',['nk_input_unicode',['../nuklear_8h.html#a576737a9d5fd115e5007f99c5c8aa4cd',1,'nuklear_input.c']]], + ['nk_5fitem_5fis_5fany_5factive_396',['nk_item_is_any_active',['../nuklear_8h.html#a562be2c0a03cb227be14ea82b4b517d7',1,'nuklear_window.c']]], + ['nk_5flayout_5fratio_5ffrom_5fpixel_397',['nk_layout_ratio_from_pixel',['../nuklear_8h.html#ab638c3eb41863167e6d63782f1b03da5',1,'nuklear_layout.c']]], + ['nk_5flayout_5freset_5fmin_5frow_5fheight_398',['nk_layout_reset_min_row_height',['../nuklear_8h.html#a89484639fccf5ad9d7a3bd7a4c6f61c4',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_399',['nk_layout_row',['../nuklear_8h.html#a2cff6f5c2a9078eb768ac753b63a5c31',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fbegin_400',['nk_layout_row_begin',['../nuklear_8h.html#aa6fa7480529cb74d07dd28c9c26d6549',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fdynamic_401',['nk_layout_row_dynamic',['../nuklear_8h.html#a76e65dc775c0bd5efaa3c8f38f96823f',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fend_402',['nk_layout_row_end',['../nuklear_8h.html#a14c7337d52877793ae04968e75f2c21f',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fpush_403',['nk_layout_row_push',['../nuklear_8h.html#ab6fb149f7829d6c5f7361c93f26066aa',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5fstatic_404',['nk_layout_row_static',['../nuklear_8h.html#af8176018717fa81e62969ca5830414e3',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fbegin_405',['nk_layout_row_template_begin',['../nuklear_8h.html#ab4d9ca7699d2c14a607d743224519c09',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fend_406',['nk_layout_row_template_end',['../nuklear_8h.html#a85583ce3aa0054fc050bb165fc580462',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fdynamic_407',['nk_layout_row_template_push_dynamic',['../nuklear_8h.html#a47e464949ca9a44f483d327edb99e51b',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fstatic_408',['nk_layout_row_template_push_static',['../nuklear_8h.html#a6836529c6d66e638eee38ba3da0d4d56',1,'nuklear_layout.c']]], + ['nk_5flayout_5frow_5ftemplate_5fpush_5fvariable_409',['nk_layout_row_template_push_variable',['../nuklear_8h.html#ae89deb176b082dbbf6fec568bc21a860',1,'nuklear_layout.c']]], + ['nk_5flayout_5fset_5fmin_5frow_5fheight_410',['nk_layout_set_min_row_height',['../nuklear_8h.html#aa0f2bd54b2ca26744dc1d019c10824c4',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fbegin_411',['nk_layout_space_begin',['../nuklear_8h.html#ace378fd581870e7045334ca5a7cd8f2e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fbounds_412',['nk_layout_space_bounds',['../nuklear_8h.html#acf7221ac37ad8e7054a89b54f0278405',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fend_413',['nk_layout_space_end',['../nuklear_8h.html#a2231e266013063456f3b20f882a9831e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fpush_414',['nk_layout_space_push',['../nuklear_8h.html#aafd65bb1d45bb98e147ec1d76173242e',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5frect_5fto_5flocal_415',['nk_layout_space_rect_to_local',['../nuklear_8h.html#a936ad1078428b94f079d22f7f6691950',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5frect_5fto_5fscreen_416',['nk_layout_space_rect_to_screen',['../nuklear_8h.html#ab7ed4576104cc5d0e2d3b91094772e86',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fto_5flocal_417',['nk_layout_space_to_local',['../nuklear_8h.html#a4f05d86822b6809dc276645517151895',1,'nuklear_layout.c']]], + ['nk_5flayout_5fspace_5fto_5fscreen_418',['nk_layout_space_to_screen',['../nuklear_8h.html#a3bf8ed829f20eeee39b9fb6f734ff9ce',1,'nuklear_layout.c']]], + ['nk_5flayout_5fwidget_5fbounds_419',['nk_layout_widget_bounds',['../nuklear_8h.html#ab781f44009d6c85898ab8484a1d09797',1,'nuklear_layout.c']]], + ['nk_5fproperty_5fdouble_420',['nk_property_double',['../nuklear_8h.html#a6078e0bd051eadbaab18f5acea38e516',1,'nuklear_property.c']]], + ['nk_5fproperty_5ffloat_421',['nk_property_float',['../nuklear_8h.html#a2ad0b76d6b0b29ba37ca1777953d4f89',1,'nuklear_property.c']]], + ['nk_5fpropertyd_422',['nk_propertyd',['../nuklear_8h.html#ac5840ee35a5f6fcb30a086cf72afd991',1,'nuklear_property.c']]], + ['nk_5fpropertyf_423',['nk_propertyf',['../nuklear_8h.html#a2030121357983cfabd73fadb997dbf04',1,'nuklear_property.c']]], + ['nk_5fpropertyi_424',['nk_propertyi',['../nuklear_8h.html#af079769a8700d947492b8b08977eeca2',1,'nuklear_property.c']]], + ['nk_5frule_5fhorizontal_425',['nk_rule_horizontal',['../nuklear_8h.html#a21f6b2b4f799375a50b7382be96d397f',1,'nuklear_window.c']]], + ['nk_5fspacer_426',['nk_spacer',['../nuklear_8h.html#a197cb17338c3c973765558f0ddeb9fc0',1,'nuklear_layout.c']]], + ['nk_5fstroke_5fline_427',['nk_stroke_line',['../nuklear_8h.html#a5f48f521429154981803612ee2c80850',1,'nuklear_draw.c']]], + ['nk_5ftextedit_5finit_428',['nk_textedit_init',['../nuklear_8h.html#af93216fccd3c3f84ed133a6fb08561e1',1,'nuklear_text_editor.c']]], + ['nk_5ftree_5fimage_5fpush_5fhashed_429',['nk_tree_image_push_hashed',['../nuklear_8h.html#a42cc204c4350de1acc2e652a0a486bcf',1,'nuklear_tree.c']]], + ['nk_5ftree_5fpop_430',['nk_tree_pop',['../nuklear_8h.html#a05362d2293e86def0f3ba6d312276a9a',1,'nuklear_tree.c']]], + ['nk_5ftree_5fpush_5fhashed_431',['nk_tree_push_hashed',['../nuklear_8h.html#a99112ed97e24a0d53c0060f7d6dc8cc0',1,'nuklear_tree.c']]], + ['nk_5ftree_5fstate_5fimage_5fpush_432',['nk_tree_state_image_push',['../nuklear_8h.html#a6bb8e2faf97d70d1a40db1201671780f',1,'nuklear_tree.c']]], + ['nk_5ftree_5fstate_5fpop_433',['nk_tree_state_pop',['../nuklear_8h.html#ab654dd3881863a7ae992db45a071d77f',1,'nuklear_tree.c']]], + ['nk_5ftree_5fstate_5fpush_434',['nk_tree_state_push',['../nuklear_8h.html#a976a55dc27c8169dc1a99f7d13088be8',1,'nuklear_tree.c']]], + ['nk_5fwindow_5fclose_435',['nk_window_close',['../nuklear_8h.html#a17d99544eee290e0d79e5d3eb1cdac03',1,'nuklear_window.c']]], + ['nk_5fwindow_5fcollapse_436',['nk_window_collapse',['../nuklear_8h.html#a7fc3d426db189e2e0a4557e80135601e',1,'nuklear_window.c']]], + ['nk_5fwindow_5fcollapse_5fif_437',['nk_window_collapse_if',['../nuklear_8h.html#a35eb1ef534da74f5b1a6cfd873aad40e',1,'nuklear_window.c']]], + ['nk_5fwindow_5ffind_438',['nk_window_find',['../nuklear_8h.html#afa03f5e650448bc8b23d21191622a89f',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fbounds_439',['nk_window_get_bounds',['../nuklear_8h.html#a953e4260d75945c20995971ba0454806',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcanvas_440',['nk_window_get_canvas',['../nuklear_8h.html#a767970d6ba82bde35cc90851d4077dd1',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_441',['nk_window_get_content_region',['../nuklear_8h.html#ad32015c0b7b53e4df428d7b8e123e18e',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fmax_442',['nk_window_get_content_region_max',['../nuklear_8h.html#a0c121dd2f61a58534da0a1c5de756f85',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fmin_443',['nk_window_get_content_region_min',['../nuklear_8h.html#ab9869953c48593e9e85de6bbb3b8e9e5',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fcontent_5fregion_5fsize_444',['nk_window_get_content_region_size',['../nuklear_8h.html#a69e94ee039dd5a69831aaef36a24b520',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fheight_445',['nk_window_get_height',['../nuklear_8h.html#aa62210de969d101d5d79ba600fe9ff33',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fpanel_446',['nk_window_get_panel',['../nuklear_8h.html#a983290e0e285e1366aee0af6ba0ed4e7',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fposition_447',['nk_window_get_position',['../nuklear_8h.html#aef2af65486366fb8f4a36166b4dc9c41',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fscroll_448',['nk_window_get_scroll',['../nuklear_8h.html#a6aa450a42ad526df04edeedd1db8348a',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fsize_449',['nk_window_get_size',['../nuklear_8h.html#a45b8d37fe77e0042ebf5b58e1b253217',1,'nuklear_window.c']]], + ['nk_5fwindow_5fget_5fwidth_450',['nk_window_get_width',['../nuklear_8h.html#abc629faa5b527aea0c5b3f4b6a233883',1,'nuklear_window.c']]], + ['nk_5fwindow_5fhas_5ffocus_451',['nk_window_has_focus',['../nuklear_8h.html#a87d7636e4f8ad8fff456a7291d63549b',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5factive_452',['nk_window_is_active',['../nuklear_8h.html#a4aea66b4db514df19651e03b26eaacee',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fany_5fhovered_453',['nk_window_is_any_hovered',['../nuklear_8h.html#a5922a25b765837062d0ded6bb8369041',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fclosed_454',['nk_window_is_closed',['../nuklear_8h.html#ad8e62bbe0e9db9d84e83f494ab750c26',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fcollapsed_455',['nk_window_is_collapsed',['../nuklear_8h.html#a759513017e5bca51e13be0268d41f510',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fhidden_456',['nk_window_is_hidden',['../nuklear_8h.html#a5ba38e6da74e5a1f82453c1215ccd138',1,'nuklear_window.c']]], + ['nk_5fwindow_5fis_5fhovered_457',['nk_window_is_hovered',['../nuklear_8h.html#a324553b9e3c4450764a208454ac71454',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fbounds_458',['nk_window_set_bounds',['../nuklear_8h.html#a953db327dad500d512deee42378816ac',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5ffocus_459',['nk_window_set_focus',['../nuklear_8h.html#a55f290b12d04ce2b8de2229cf0c9540a',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fposition_460',['nk_window_set_position',['../nuklear_8h.html#a6de7d1d2c130ab249964b71a4626b1aa',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fscroll_461',['nk_window_set_scroll',['../nuklear_8h.html#a43344b5de927f1e705cbf6eca17c7314',1,'nuklear_window.c']]], + ['nk_5fwindow_5fset_5fsize_462',['nk_window_set_size',['../nuklear_8h.html#ab19652cd191237bf2723f235a14385f5',1,'nuklear_window.c']]], + ['nk_5fwindow_5fshow_463',['nk_window_show',['../nuklear_8h.html#a73ed9654303545bca9b8e4d6a5454363',1,'nuklear_window.c']]], + ['nk_5fwindow_5fshow_5fif_464',['nk_window_show_if',['../nuklear_8h.html#aa1eaa64d0de02f059163fc502386ce1b',1,'nuklear_window.c']]] +]; diff --git a/search/mag_sel.svg b/search/mag_sel.svg new file mode 100644 index 000000000..03626f64a --- /dev/null +++ b/search/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/search/nomatches.html b/search/nomatches.html new file mode 100644 index 000000000..2b9360b6b --- /dev/null +++ b/search/nomatches.html @@ -0,0 +1,13 @@ + + + + + + + + +
+
No Matches
+
+ + diff --git a/search/pages_0.html b/search/pages_0.html new file mode 100644 index 000000000..8517b48f0 --- /dev/null +++ b/search/pages_0.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/pages_0.js b/search/pages_0.js new file mode 100644 index 000000000..1cd6de966 --- /dev/null +++ b/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['buffer_521',['Buffer',['../Memory.html',1,'']]] +]; diff --git a/search/pages_1.html b/search/pages_1.html new file mode 100644 index 000000000..a0fb67963 --- /dev/null +++ b/search/pages_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/pages_1.js b/search/pages_1.js new file mode 100644 index 000000000..3110c0672 --- /dev/null +++ b/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['editor_522',['Editor',['../Text.html',1,'']]] +]; diff --git a/search/pages_2.html b/search/pages_2.html new file mode 100644 index 000000000..084edfd03 --- /dev/null +++ b/search/pages_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/pages_2.js b/search/pages_2.js new file mode 100644 index 000000000..76d91f9f8 --- /dev/null +++ b/search/pages_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['nuklear_523',['Nuklear',['../index.html',1,'']]] +]; diff --git a/search/search.css b/search/search.css new file mode 100644 index 000000000..a0dba441c --- /dev/null +++ b/search/search.css @@ -0,0 +1,273 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#MSearchBox { + white-space : nowrap; + float: none; + margin-top: 0px; + right: 0px; + width: 170px; + height: 24px; + z-index: 102; + display: inline; + position: absolute; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:111px; + margin-left:20px; + padding-left:4px; + color: #909090; + outline: none; + font: 9pt Arial, Verdana, sans-serif; + -webkit-border-radius: 0px; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + top:0px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; + z-index:10000; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/search/search.js b/search/search.js new file mode 100644 index 000000000..fb226f734 --- /dev/null +++ b/search/search.js @@ -0,0 +1,816 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + this.extension; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches' + this.extension; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline-block'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_0.js b/search/variables_0.js new file mode 100644 index 000000000..6af1af656 --- /dev/null +++ b/search/variables_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['allocated_465',['allocated',['../structnk__buffer.html#a91e9be62aa08687400bc00059825de02',1,'nk_buffer']]], + ['arc_5fsegment_5fcount_466',['arc_segment_count',['../structnk__convert__config.html#ae367d812c2f866e843f9684b3a920e73',1,'nk_convert_config']]] +]; diff --git a/search/variables_1.html b/search/variables_1.html new file mode 100644 index 000000000..ea73d9a49 --- /dev/null +++ b/search/variables_1.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_1.js b/search/variables_1.js new file mode 100644 index 000000000..9f6ea918d --- /dev/null +++ b/search/variables_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['build_467',['build',['../structnk__context.html#a0d0f953ef2b6c56b046e4e5488d074e6',1,'nk_context']]] +]; diff --git a/search/variables_2.html b/search/variables_2.html new file mode 100644 index 000000000..0580462e9 --- /dev/null +++ b/search/variables_2.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_2.js b/search/variables_2.js new file mode 100644 index 000000000..5d227c633 --- /dev/null +++ b/search/variables_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['calls_468',['calls',['../structnk__buffer.html#acd962a6e042a8ffabac679768e4851bb',1,'nk_buffer']]], + ['circle_5fsegment_5fcount_469',['circle_segment_count',['../structnk__convert__config.html#ae62d641bf9c5bc6b3e66c6071f4a8267',1,'nk_convert_config']]], + ['curve_5fsegment_5fcount_470',['curve_segment_count',['../structnk__convert__config.html#afcf45f3fc6e3f043b572b59cb04424c5',1,'nk_convert_config']]] +]; diff --git a/search/variables_3.html b/search/variables_3.html new file mode 100644 index 000000000..0d69e7619 --- /dev/null +++ b/search/variables_3.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_3.js b/search/variables_3.js new file mode 100644 index 000000000..122b174a0 --- /dev/null +++ b/search/variables_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['grow_5ffactor_471',['grow_factor',['../structnk__buffer.html#ab4ec59165f6aa6e9358bced8070cc84e',1,'nk_buffer']]] +]; diff --git a/search/variables_4.html b/search/variables_4.html new file mode 100644 index 000000000..a4b6506bb --- /dev/null +++ b/search/variables_4.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_4.js b/search/variables_4.js new file mode 100644 index 000000000..e8475747b --- /dev/null +++ b/search/variables_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['height_472',['height',['../structnk__user__font.html#ab98ed37df408e0c2febfe448897ccf82',1,'nk_user_font']]] +]; diff --git a/search/variables_5.html b/search/variables_5.html new file mode 100644 index 000000000..7e345d16c --- /dev/null +++ b/search/variables_5.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_5.js b/search/variables_5.js new file mode 100644 index 000000000..5eef893f6 --- /dev/null +++ b/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['line_5faa_473',['line_AA',['../structnk__convert__config.html#a7279543367b1ad0e5f183491233cedad',1,'nk_convert_config']]] +]; diff --git a/search/variables_6.html b/search/variables_6.html new file mode 100644 index 000000000..7d48e75e2 --- /dev/null +++ b/search/variables_6.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_6.js b/search/variables_6.js new file mode 100644 index 000000000..b3fe6b1b2 --- /dev/null +++ b/search/variables_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['memory_474',['memory',['../structnk__buffer.html#a228b585debec1d328859fb52080ca3fd',1,'nk_buffer']]] +]; diff --git a/search/variables_7.html b/search/variables_7.html new file mode 100644 index 000000000..5c2634092 --- /dev/null +++ b/search/variables_7.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_7.js b/search/variables_7.js new file mode 100644 index 000000000..190bca9c6 --- /dev/null +++ b/search/variables_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['needed_475',['needed',['../structnk__buffer.html#a6b0ea49209eaba5285b715d902c5f446',1,'nk_buffer']]] +]; diff --git a/search/variables_8.html b/search/variables_8.html new file mode 100644 index 000000000..dc9ec54a5 --- /dev/null +++ b/search/variables_8.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_8.js b/search/variables_8.js new file mode 100644 index 000000000..53450c2cd --- /dev/null +++ b/search/variables_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['overlay_476',['overlay',['../structnk__context.html#ae51cac633c54b94a63c8fe77b9558f4a',1,'nk_context']]] +]; diff --git a/search/variables_9.html b/search/variables_9.html new file mode 100644 index 000000000..7b0147509 --- /dev/null +++ b/search/variables_9.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_9.js b/search/variables_9.js new file mode 100644 index 000000000..64db21652 --- /dev/null +++ b/search/variables_9.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['pool_477',['pool',['../structnk__buffer.html#a0cd2b90bb2994190fa1aa0e9ffbc1184',1,'nk_buffer']]] +]; diff --git a/search/variables_a.html b/search/variables_a.html new file mode 100644 index 000000000..52a724d19 --- /dev/null +++ b/search/variables_a.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_a.js b/search/variables_a.js new file mode 100644 index 000000000..a9ec6bd6d --- /dev/null +++ b/search/variables_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['shape_5faa_478',['shape_AA',['../structnk__convert__config.html#a1d0cf3e01234c636729dfd0fddf5b2c7',1,'nk_convert_config']]], + ['size_479',['size',['../structnk__buffer.html#a71e66eb6dad2c5827e363f2389ad4505',1,'nk_buffer']]] +]; diff --git a/search/variables_b.html b/search/variables_b.html new file mode 100644 index 000000000..f376b27af --- /dev/null +++ b/search/variables_b.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_b.js b/search/variables_b.js new file mode 100644 index 000000000..5fe71b1b6 --- /dev/null +++ b/search/variables_b.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['tex_5fnull_480',['tex_null',['../structnk__convert__config.html#afe7d1907a295a3db7bbb11e3f0f98c1e',1,'nk_convert_config']]], + ['text_5fedit_481',['text_edit',['../structnk__context.html#aca8a2124af97661372f7b35d636c9bc6',1,'nk_context']]], + ['type_482',['type',['../structnk__buffer.html#a3842a03554db557944e84bc5af61249e',1,'nk_buffer']]] +]; diff --git a/search/variables_c.html b/search/variables_c.html new file mode 100644 index 000000000..6019eba96 --- /dev/null +++ b/search/variables_c.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_c.js b/search/variables_c.js new file mode 100644 index 000000000..a26517d95 --- /dev/null +++ b/search/variables_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['uv_483',['uv',['../structnk__draw__null__texture.html#ae00f89beb79ed9aa53d2ddcbdd1ea7c7',1,'nk_draw_null_texture']]] +]; diff --git a/search/variables_d.html b/search/variables_d.html new file mode 100644 index 000000000..f61ae7511 --- /dev/null +++ b/search/variables_d.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_d.js b/search/variables_d.js new file mode 100644 index 000000000..35e49e19e --- /dev/null +++ b/search/variables_d.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['vertex_5falignment_484',['vertex_alignment',['../structnk__convert__config.html#a92519fe62ef0e8f0d7180dbd874c775f',1,'nk_convert_config']]], + ['vertex_5flayout_485',['vertex_layout',['../structnk__convert__config.html#addeb894f54f2ba1dbe3d5bf887b27776',1,'nk_convert_config']]], + ['vertex_5fsize_486',['vertex_size',['../structnk__convert__config.html#acf0d9e08220c6e29ee9d2753f9273591',1,'nk_convert_config']]] +]; diff --git a/search/variables_e.html b/search/variables_e.html new file mode 100644 index 000000000..7bfd37215 --- /dev/null +++ b/search/variables_e.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/search/variables_e.js b/search/variables_e.js new file mode 100644 index 000000000..c32eaa235 --- /dev/null +++ b/search/variables_e.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['width_487',['width',['../structnk__user__font.html#aac686ca3e72208ddfb982caa7c89293a',1,'nk_user_font']]] +]; diff --git a/splitbar.png b/splitbar.png new file mode 100644 index 000000000..fe895f2c5 Binary files /dev/null and b/splitbar.png differ diff --git a/stb__rect__pack_8h_source.html b/stb__rect__pack_8h_source.html new file mode 100644 index 000000000..692553059 --- /dev/null +++ b/stb__rect__pack_8h_source.html @@ -0,0 +1,733 @@ + + + + + + + +Nuklear: src/stb_rect_pack.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
stb_rect_pack.h
+
+
+
1 // stb_rect_pack.h - v1.01 - public domain - rectangle packing
+
2 // Sean Barrett 2014
+
3 //
+
4 // Useful for e.g. packing rectangular textures into an atlas.
+
5 // Does not do rotation.
+
6 //
+
7 // Before #including,
+
8 //
+
9 // #define STB_RECT_PACK_IMPLEMENTATION
+
10 //
+
11 // in the file that you want to have the implementation.
+
12 //
+
13 // Not necessarily the awesomest packing method, but better than
+
14 // the totally naive one in stb_truetype (which is primarily what
+
15 // this is meant to replace).
+
16 //
+
17 // Has only had a few tests run, may have issues.
+
18 //
+
19 // More docs to come.
+
20 //
+
21 // No memory allocations; uses qsort() and assert() from stdlib.
+
22 // Can override those by defining STBRP_SORT and STBRP_ASSERT.
+
23 //
+
24 // This library currently uses the Skyline Bottom-Left algorithm.
+
25 //
+
26 // Please note: better rectangle packers are welcome! Please
+
27 // implement them to the same API, but with a different init
+
28 // function.
+
29 //
+
30 // Credits
+
31 //
+
32 // Library
+
33 // Sean Barrett
+
34 // Minor features
+
35 // Martins Mozeiko
+
36 // github:IntellectualKitty
+
37 //
+
38 // Bugfixes / warning fixes
+
39 // Jeremy Jaussaud
+
40 // Fabian Giesen
+
41 //
+
42 // Version history:
+
43 //
+
44 // 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section
+
45 // 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
+
46 // 0.99 (2019-02-07) warning fixes
+
47 // 0.11 (2017-03-03) return packing success/fail result
+
48 // 0.10 (2016-10-25) remove cast-away-const to avoid warnings
+
49 // 0.09 (2016-08-27) fix compiler warnings
+
50 // 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
+
51 // 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
+
52 // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
+
53 // 0.05: added STBRP_ASSERT to allow replacing assert
+
54 // 0.04: fixed minor bug in STBRP_LARGE_RECTS support
+
55 // 0.01: initial release
+
56 //
+
57 // LICENSE
+
58 //
+
59 // See end of file for license information.
+
60 
+
62 //
+
63 // INCLUDE SECTION
+
64 //
+
65 
+
66 #ifndef STB_INCLUDE_STB_RECT_PACK_H
+
67 #define STB_INCLUDE_STB_RECT_PACK_H
+
68 
+
69 #define STB_RECT_PACK_VERSION 1
+
70 
+
71 #ifdef STBRP_STATIC
+
72 #define STBRP_DEF static
+
73 #else
+
74 #define STBRP_DEF extern
+
75 #endif
+
76 
+
77 #ifdef __cplusplus
+
78 extern "C" {
+
79 #endif
+
80 
+
81 typedef struct stbrp_context stbrp_context;
+
82 typedef struct stbrp_node stbrp_node;
+
83 typedef struct stbrp_rect stbrp_rect;
+
84 
+
85 typedef int stbrp_coord;
+
86 
+
87 #define STBRP__MAXVAL 0x7fffffff
+
88 // Mostly for internal use, but this is the maximum supported coordinate value.
+
89 
+
90 STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
+
91 // Assign packed locations to rectangles. The rectangles are of type
+
92 // 'stbrp_rect' defined below, stored in the array 'rects', and there
+
93 // are 'num_rects' many of them.
+
94 //
+
95 // Rectangles which are successfully packed have the 'was_packed' flag
+
96 // set to a non-zero value and 'x' and 'y' store the minimum location
+
97 // on each axis (i.e. bottom-left in cartesian coordinates, top-left
+
98 // if you imagine y increasing downwards). Rectangles which do not fit
+
99 // have the 'was_packed' flag set to 0.
+
100 //
+
101 // You should not try to access the 'rects' array from another thread
+
102 // while this function is running, as the function temporarily reorders
+
103 // the array while it executes.
+
104 //
+
105 // To pack into another rectangle, you need to call stbrp_init_target
+
106 // again. To continue packing into the same rectangle, you can call
+
107 // this function again. Calling this multiple times with multiple rect
+
108 // arrays will probably produce worse packing results than calling it
+
109 // a single time with the full rectangle array, but the option is
+
110 // available.
+
111 //
+
112 // The function returns 1 if all of the rectangles were successfully
+
113 // packed and 0 otherwise.
+
114 
+ +
116 {
+
117  // reserved for your use:
+
118  int id;
+
119 
+
120  // input:
+
121  stbrp_coord w, h;
+
122 
+
123  // output:
+
124  stbrp_coord x, y;
+
125  int was_packed; // non-zero if valid packing
+
126 
+
127 }; // 16 bytes, nominally
+
128 
+
129 
+
130 STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
+
131 // Initialize a rectangle packer to:
+
132 // pack a rectangle that is 'width' by 'height' in dimensions
+
133 // using temporary storage provided by the array 'nodes', which is 'num_nodes' long
+
134 //
+
135 // You must call this function every time you start packing into a new target.
+
136 //
+
137 // There is no "shutdown" function. The 'nodes' memory must stay valid for
+
138 // the following stbrp_pack_rects() call (or calls), but can be freed after
+
139 // the call (or calls) finish.
+
140 //
+
141 // Note: to guarantee best results, either:
+
142 // 1. make sure 'num_nodes' >= 'width'
+
143 // or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
+
144 //
+
145 // If you don't do either of the above things, widths will be quantized to multiples
+
146 // of small integers to guarantee the algorithm doesn't run out of temporary storage.
+
147 //
+
148 // If you do #2, then the non-quantized algorithm will be used, but the algorithm
+
149 // may run out of temporary storage and be unable to pack some rectangles.
+
150 
+
151 STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
+
152 // Optionally call this function after init but before doing any packing to
+
153 // change the handling of the out-of-temp-memory scenario, described above.
+
154 // If you call init again, this will be reset to the default (false).
+
155 
+
156 
+
157 STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
+
158 // Optionally select which packing heuristic the library should use. Different
+
159 // heuristics will produce better/worse results for different data sets.
+
160 // If you call init again, this will be reset to the default.
+
161 
+
162 enum
+
163 {
+
164  STBRP_HEURISTIC_Skyline_default=0,
+
165  STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
+
166  STBRP_HEURISTIC_Skyline_BF_sortHeight
+
167 };
+
168 
+
169 
+
171 //
+
172 // the details of the following structures don't matter to you, but they must
+
173 // be visible so you can handle the memory allocations for them
+
174 
+ +
176 {
+
177  stbrp_coord x,y;
+
178  stbrp_node *next;
+
179 };
+
180 
+ +
182 {
+
183  int width;
+
184  int height;
+
185  int align;
+
186  int init_mode;
+
187  int heuristic;
+
188  int num_nodes;
+
189  stbrp_node *active_head;
+
190  stbrp_node *free_head;
+
191  stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
+
192 };
+
193 
+
194 #ifdef __cplusplus
+
195 }
+
196 #endif
+
197 
+
198 #endif
+
199 
+
201 //
+
202 // IMPLEMENTATION SECTION
+
203 //
+
204 
+
205 #ifdef STB_RECT_PACK_IMPLEMENTATION
+
206 #ifndef STBRP_SORT
+
207 #include <stdlib.h>
+
208 #define STBRP_SORT qsort
+
209 #endif
+
210 
+
211 #ifndef STBRP_ASSERT
+
212 #include <assert.h>
+
213 #define STBRP_ASSERT assert
+
214 #endif
+
215 
+
216 #ifdef _MSC_VER
+
217 #define STBRP__NOTUSED(v) (void)(v)
+
218 #define STBRP__CDECL __cdecl
+
219 #else
+
220 #define STBRP__NOTUSED(v) (void)sizeof(v)
+
221 #define STBRP__CDECL
+
222 #endif
+
223 
+
224 enum
+
225 {
+
226  STBRP__INIT_skyline = 1
+
227 };
+
228 
+
229 STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
+
230 {
+
231  switch (context->init_mode) {
+
232  case STBRP__INIT_skyline:
+
233  STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
+
234  context->heuristic = heuristic;
+
235  break;
+
236  default:
+
237  STBRP_ASSERT(0);
+
238  }
+
239 }
+
240 
+
241 STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
+
242 {
+
243  if (allow_out_of_mem)
+
244  // if it's ok to run out of memory, then don't bother aligning them;
+
245  // this gives better packing, but may fail due to OOM (even though
+
246  // the rectangles easily fit). @TODO a smarter approach would be to only
+
247  // quantize once we've hit OOM, then we could get rid of this parameter.
+
248  context->align = 1;
+
249  else {
+
250  // if it's not ok to run out of memory, then quantize the widths
+
251  // so that num_nodes is always enough nodes.
+
252  //
+
253  // I.e. num_nodes * align >= width
+
254  // align >= width / num_nodes
+
255  // align = ceil(width/num_nodes)
+
256 
+
257  context->align = (context->width + context->num_nodes-1) / context->num_nodes;
+
258  }
+
259 }
+
260 
+
261 STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
+
262 {
+
263  int i;
+
264 
+
265  for (i=0; i < num_nodes-1; ++i)
+
266  nodes[i].next = &nodes[i+1];
+
267  nodes[i].next = NULL;
+
268  context->init_mode = STBRP__INIT_skyline;
+
269  context->heuristic = STBRP_HEURISTIC_Skyline_default;
+
270  context->free_head = &nodes[0];
+
271  context->active_head = &context->extra[0];
+
272  context->width = width;
+
273  context->height = height;
+
274  context->num_nodes = num_nodes;
+
275  stbrp_setup_allow_out_of_mem(context, 0);
+
276 
+
277  // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
+
278  context->extra[0].x = 0;
+
279  context->extra[0].y = 0;
+
280  context->extra[0].next = &context->extra[1];
+
281  context->extra[1].x = (stbrp_coord) width;
+
282  context->extra[1].y = (1<<30);
+
283  context->extra[1].next = NULL;
+
284 }
+
285 
+
286 // find minimum y position if it starts at x1
+
287 static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
+
288 {
+
289  stbrp_node *node = first;
+
290  int x1 = x0 + width;
+
291  int min_y, visited_width, waste_area;
+
292 
+
293  STBRP__NOTUSED(c);
+
294 
+
295  STBRP_ASSERT(first->x <= x0);
+
296 
+
297  #if 0
+
298  // skip in case we're past the node
+
299  while (node->next->x <= x0)
+
300  ++node;
+
301  #else
+
302  STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
+
303  #endif
+
304 
+
305  STBRP_ASSERT(node->x <= x0);
+
306 
+
307  min_y = 0;
+
308  waste_area = 0;
+
309  visited_width = 0;
+
310  while (node->x < x1) {
+
311  if (node->y > min_y) {
+
312  // raise min_y higher.
+
313  // we've accounted for all waste up to min_y,
+
314  // but we'll now add more waste for everything we've visited
+
315  waste_area += visited_width * (node->y - min_y);
+
316  min_y = node->y;
+
317  // the first time through, visited_width might be reduced
+
318  if (node->x < x0)
+
319  visited_width += node->next->x - x0;
+
320  else
+
321  visited_width += node->next->x - node->x;
+
322  } else {
+
323  // add waste area
+
324  int under_width = node->next->x - node->x;
+
325  if (under_width + visited_width > width)
+
326  under_width = width - visited_width;
+
327  waste_area += under_width * (min_y - node->y);
+
328  visited_width += under_width;
+
329  }
+
330  node = node->next;
+
331  }
+
332 
+
333  *pwaste = waste_area;
+
334  return min_y;
+
335 }
+
336 
+
337 typedef struct
+
338 {
+
339  int x,y;
+
340  stbrp_node **prev_link;
+
341 } stbrp__findresult;
+
342 
+
343 static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
+
344 {
+
345  int best_waste = (1<<30), best_x, best_y = (1 << 30);
+
346  stbrp__findresult fr;
+
347  stbrp_node **prev, *node, *tail, **best = NULL;
+
348 
+
349  // align to multiple of c->align
+
350  width = (width + c->align - 1);
+
351  width -= width % c->align;
+
352  STBRP_ASSERT(width % c->align == 0);
+
353 
+
354  // if it can't possibly fit, bail immediately
+
355  if (width > c->width || height > c->height) {
+
356  fr.prev_link = NULL;
+
357  fr.x = fr.y = 0;
+
358  return fr;
+
359  }
+
360 
+
361  node = c->active_head;
+
362  prev = &c->active_head;
+
363  while (node->x + width <= c->width) {
+
364  int y,waste;
+
365  y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
+
366  if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
+
367  // bottom left
+
368  if (y < best_y) {
+
369  best_y = y;
+
370  best = prev;
+
371  }
+
372  } else {
+
373  // best-fit
+
374  if (y + height <= c->height) {
+
375  // can only use it if it first vertically
+
376  if (y < best_y || (y == best_y && waste < best_waste)) {
+
377  best_y = y;
+
378  best_waste = waste;
+
379  best = prev;
+
380  }
+
381  }
+
382  }
+
383  prev = &node->next;
+
384  node = node->next;
+
385  }
+
386 
+
387  best_x = (best == NULL) ? 0 : (*best)->x;
+
388 
+
389  // if doing best-fit (BF), we also have to try aligning right edge to each node position
+
390  //
+
391  // e.g, if fitting
+
392  //
+
393  // ____________________
+
394  // |____________________|
+
395  //
+
396  // into
+
397  //
+
398  // | |
+
399  // | ____________|
+
400  // |____________|
+
401  //
+
402  // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
+
403  //
+
404  // This makes BF take about 2x the time
+
405 
+
406  if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
+
407  tail = c->active_head;
+
408  node = c->active_head;
+
409  prev = &c->active_head;
+
410  // find first node that's admissible
+
411  while (tail->x < width)
+
412  tail = tail->next;
+
413  while (tail) {
+
414  int xpos = tail->x - width;
+
415  int y,waste;
+
416  STBRP_ASSERT(xpos >= 0);
+
417  // find the left position that matches this
+
418  while (node->next->x <= xpos) {
+
419  prev = &node->next;
+
420  node = node->next;
+
421  }
+
422  STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
+
423  y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
+
424  if (y + height <= c->height) {
+
425  if (y <= best_y) {
+
426  if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
+
427  best_x = xpos;
+
428  STBRP_ASSERT(y <= best_y);
+
429  best_y = y;
+
430  best_waste = waste;
+
431  best = prev;
+
432  }
+
433  }
+
434  }
+
435  tail = tail->next;
+
436  }
+
437  }
+
438 
+
439  fr.prev_link = best;
+
440  fr.x = best_x;
+
441  fr.y = best_y;
+
442  return fr;
+
443 }
+
444 
+
445 static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
+
446 {
+
447  // find best position according to heuristic
+
448  stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
+
449  stbrp_node *node, *cur;
+
450 
+
451  // bail if:
+
452  // 1. it failed
+
453  // 2. the best node doesn't fit (we don't always check this)
+
454  // 3. we're out of memory
+
455  if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
+
456  res.prev_link = NULL;
+
457  return res;
+
458  }
+
459 
+
460  // on success, create new node
+
461  node = context->free_head;
+
462  node->x = (stbrp_coord) res.x;
+
463  node->y = (stbrp_coord) (res.y + height);
+
464 
+
465  context->free_head = node->next;
+
466 
+
467  // insert the new node into the right starting point, and
+
468  // let 'cur' point to the remaining nodes needing to be
+
469  // stitched back in
+
470 
+
471  cur = *res.prev_link;
+
472  if (cur->x < res.x) {
+
473  // preserve the existing one, so start testing with the next one
+
474  stbrp_node *next = cur->next;
+
475  cur->next = node;
+
476  cur = next;
+
477  } else {
+
478  *res.prev_link = node;
+
479  }
+
480 
+
481  // from here, traverse cur and free the nodes, until we get to one
+
482  // that shouldn't be freed
+
483  while (cur->next && cur->next->x <= res.x + width) {
+
484  stbrp_node *next = cur->next;
+
485  // move the current node to the free list
+
486  cur->next = context->free_head;
+
487  context->free_head = cur;
+
488  cur = next;
+
489  }
+
490 
+
491  // stitch the list back in
+
492  node->next = cur;
+
493 
+
494  if (cur->x < res.x + width)
+
495  cur->x = (stbrp_coord) (res.x + width);
+
496 
+
497 #ifdef _DEBUG
+
498  cur = context->active_head;
+
499  while (cur->x < context->width) {
+
500  STBRP_ASSERT(cur->x < cur->next->x);
+
501  cur = cur->next;
+
502  }
+
503  STBRP_ASSERT(cur->next == NULL);
+
504 
+
505  {
+
506  int count=0;
+
507  cur = context->active_head;
+
508  while (cur) {
+
509  cur = cur->next;
+
510  ++count;
+
511  }
+
512  cur = context->free_head;
+
513  while (cur) {
+
514  cur = cur->next;
+
515  ++count;
+
516  }
+
517  STBRP_ASSERT(count == context->num_nodes+2);
+
518  }
+
519 #endif
+
520 
+
521  return res;
+
522 }
+
523 
+
524 static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
+
525 {
+
526  const stbrp_rect *p = (const stbrp_rect *) a;
+
527  const stbrp_rect *q = (const stbrp_rect *) b;
+
528  if (p->h > q->h)
+
529  return -1;
+
530  if (p->h < q->h)
+
531  return 1;
+
532  return (p->w > q->w) ? -1 : (p->w < q->w);
+
533 }
+
534 
+
535 static int STBRP__CDECL rect_original_order(const void *a, const void *b)
+
536 {
+
537  const stbrp_rect *p = (const stbrp_rect *) a;
+
538  const stbrp_rect *q = (const stbrp_rect *) b;
+
539  return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
+
540 }
+
541 
+
542 STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
+
543 {
+
544  int i, all_rects_packed = 1;
+
545 
+
546  // we use the 'was_packed' field internally to allow sorting/unsorting
+
547  for (i=0; i < num_rects; ++i) {
+
548  rects[i].was_packed = i;
+
549  }
+
550 
+
551  // sort according to heuristic
+
552  STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
+
553 
+
554  for (i=0; i < num_rects; ++i) {
+
555  if (rects[i].w == 0 || rects[i].h == 0) {
+
556  rects[i].x = rects[i].y = 0; // empty rect needs no space
+
557  } else {
+
558  stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
+
559  if (fr.prev_link) {
+
560  rects[i].x = (stbrp_coord) fr.x;
+
561  rects[i].y = (stbrp_coord) fr.y;
+
562  } else {
+
563  rects[i].x = rects[i].y = STBRP__MAXVAL;
+
564  }
+
565  }
+
566  }
+
567 
+
568  // unsort
+
569  STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
+
570 
+
571  // set was_packed flags and all_rects_packed status
+
572  for (i=0; i < num_rects; ++i) {
+
573  rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
+
574  if (!rects[i].was_packed)
+
575  all_rects_packed = 0;
+
576  }
+
577 
+
578  // return the all_rects_packed status
+
579  return all_rects_packed;
+
580 }
+
581 #endif
+
582 
+
583 /*
+
584 ------------------------------------------------------------------------------
+
585 This software is available under 2 licenses -- choose whichever you prefer.
+
586 ------------------------------------------------------------------------------
+
587 ALTERNATIVE A - MIT License
+
588 Copyright (c) 2017 Sean Barrett
+
589 Permission is hereby granted, free of charge, to any person obtaining a copy of
+
590 this software and associated documentation files (the "Software"), to deal in
+
591 the Software without restriction, including without limitation the rights to
+
592 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+
593 of the Software, and to permit persons to whom the Software is furnished to do
+
594 so, subject to the following conditions:
+
595 The above copyright notice and this permission notice shall be included in all
+
596 copies or substantial portions of the Software.
+
597 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
598 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
599 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
600 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
601 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
602 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
603 SOFTWARE.
+
604 ------------------------------------------------------------------------------
+
605 ALTERNATIVE B - Public Domain (www.unlicense.org)
+
606 This is free and unencumbered software released into the public domain.
+
607 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+
608 software, either in source code form or as a compiled binary, for any purpose,
+
609 commercial or non-commercial, and by any means.
+
610 In jurisdictions that recognize copyright laws, the author or authors of this
+
611 software dedicate any and all copyright interest in the software to the public
+
612 domain. We make this dedication for the benefit of the public at large and to
+
613 the detriment of our heirs and successors. We intend this dedication to be an
+
614 overt act of relinquishment in perpetuity of all present and future rights to
+
615 this software under copyright law.
+
616 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
617 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
618 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
619 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+
620 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+
621 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
622 ------------------------------------------------------------------------------
+
623 */
+ + + +
+
+ + + + diff --git a/stb__truetype_8h_source.html b/stb__truetype_8h_source.html new file mode 100644 index 000000000..53510cd1e --- /dev/null +++ b/stb__truetype_8h_source.html @@ -0,0 +1,5153 @@ + + + + + + + +Nuklear: src/stb_truetype.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
stb_truetype.h
+
+
+
1 // stb_truetype.h - v1.26 - public domain
+
2 // authored from 2009-2021 by Sean Barrett / RAD Game Tools
+
3 //
+
4 // =======================================================================
+
5 //
+
6 // NO SECURITY GUARANTEE -- DO NOT USE THIS ON UNTRUSTED FONT FILES
+
7 //
+
8 // This library does no range checking of the offsets found in the file,
+
9 // meaning an attacker can use it to read arbitrary memory.
+
10 //
+
11 // =======================================================================
+
12 //
+
13 // This library processes TrueType files:
+
14 // parse files
+
15 // extract glyph metrics
+
16 // extract glyph shapes
+
17 // render glyphs to one-channel bitmaps with antialiasing (box filter)
+
18 // render glyphs to one-channel SDF bitmaps (signed-distance field/function)
+
19 //
+
20 // Todo:
+
21 // non-MS cmaps
+
22 // crashproof on bad data
+
23 // hinting? (no longer patented)
+
24 // cleartype-style AA?
+
25 // optimize: use simple memory allocator for intermediates
+
26 // optimize: build edge-list directly from curves
+
27 // optimize: rasterize directly from curves?
+
28 //
+
29 // ADDITIONAL CONTRIBUTORS
+
30 //
+
31 // Mikko Mononen: compound shape support, more cmap formats
+
32 // Tor Andersson: kerning, subpixel rendering
+
33 // Dougall Johnson: OpenType / Type 2 font handling
+
34 // Daniel Ribeiro Maciel: basic GPOS-based kerning
+
35 //
+
36 // Misc other:
+
37 // Ryan Gordon
+
38 // Simon Glass
+
39 // github:IntellectualKitty
+
40 // Imanol Celaya
+
41 // Daniel Ribeiro Maciel
+
42 //
+
43 // Bug/warning reports/fixes:
+
44 // "Zer" on mollyrocket Fabian "ryg" Giesen github:NiLuJe
+
45 // Cass Everitt Martins Mozeiko github:aloucks
+
46 // stoiko (Haemimont Games) Cap Petschulat github:oyvindjam
+
47 // Brian Hook Omar Cornut github:vassvik
+
48 // Walter van Niftrik Ryan Griege
+
49 // David Gow Peter LaValle
+
50 // David Given Sergey Popov
+
51 // Ivan-Assen Ivanov Giumo X. Clanjor
+
52 // Anthony Pesch Higor Euripedes
+
53 // Johan Duparc Thomas Fields
+
54 // Hou Qiming Derek Vinyard
+
55 // Rob Loach Cort Stratton
+
56 // Kenney Phillis Jr. Brian Costabile
+
57 // Ken Voskuil (kaesve)
+
58 //
+
59 // VERSION HISTORY
+
60 //
+
61 // 1.26 (2021-08-28) fix broken rasterizer
+
62 // 1.25 (2021-07-11) many fixes
+
63 // 1.24 (2020-02-05) fix warning
+
64 // 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS)
+
65 // 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined
+
66 // 1.21 (2019-02-25) fix warning
+
67 // 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()
+
68 // 1.19 (2018-02-11) GPOS kerning, STBTT_fmod
+
69 // 1.18 (2018-01-29) add missing function
+
70 // 1.17 (2017-07-23) make more arguments const; doc fix
+
71 // 1.16 (2017-07-12) SDF support
+
72 // 1.15 (2017-03-03) make more arguments const
+
73 // 1.14 (2017-01-16) num-fonts-in-TTC function
+
74 // 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts
+
75 // 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual
+
76 // 1.11 (2016-04-02) fix unused-variable warning
+
77 // 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef
+
78 // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly
+
79 // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges
+
80 // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
+
81 // variant PackFontRanges to pack and render in separate phases;
+
82 // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
+
83 // fixed an assert() bug in the new rasterizer
+
84 // replace assert() with STBTT_assert() in new rasterizer
+
85 //
+
86 // Full history can be found at the end of this file.
+
87 //
+
88 // LICENSE
+
89 //
+
90 // See end of file for license information.
+
91 //
+
92 // USAGE
+
93 //
+
94 // Include this file in whatever places need to refer to it. In ONE C/C++
+
95 // file, write:
+
96 // #define STB_TRUETYPE_IMPLEMENTATION
+
97 // before the #include of this file. This expands out the actual
+
98 // implementation into that C/C++ file.
+
99 //
+
100 // To make the implementation private to the file that generates the implementation,
+
101 // #define STBTT_STATIC
+
102 //
+
103 // Simple 3D API (don't ship this, but it's fine for tools and quick start)
+
104 // stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture
+
105 // stbtt_GetBakedQuad() -- compute quad to draw for a given char
+
106 //
+
107 // Improved 3D API (more shippable):
+
108 // #include "stb_rect_pack.h" -- optional, but you really want it
+
109 // stbtt_PackBegin()
+
110 // stbtt_PackSetOversampling() -- for improved quality on small fonts
+
111 // stbtt_PackFontRanges() -- pack and renders
+
112 // stbtt_PackEnd()
+
113 // stbtt_GetPackedQuad()
+
114 //
+
115 // "Load" a font file from a memory buffer (you have to keep the buffer loaded)
+
116 // stbtt_InitFont()
+
117 // stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections
+
118 // stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections
+
119 //
+
120 // Render a unicode codepoint to a bitmap
+
121 // stbtt_GetCodepointBitmap() -- allocates and returns a bitmap
+
122 // stbtt_MakeCodepointBitmap() -- renders into bitmap you provide
+
123 // stbtt_GetCodepointBitmapBox() -- how big the bitmap must be
+
124 //
+
125 // Character advance/positioning
+
126 // stbtt_GetCodepointHMetrics()
+
127 // stbtt_GetFontVMetrics()
+
128 // stbtt_GetFontVMetricsOS2()
+
129 // stbtt_GetCodepointKernAdvance()
+
130 //
+
131 // Starting with version 1.06, the rasterizer was replaced with a new,
+
132 // faster and generally-more-precise rasterizer. The new rasterizer more
+
133 // accurately measures pixel coverage for anti-aliasing, except in the case
+
134 // where multiple shapes overlap, in which case it overestimates the AA pixel
+
135 // coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If
+
136 // this turns out to be a problem, you can re-enable the old rasterizer with
+
137 // #define STBTT_RASTERIZER_VERSION 1
+
138 // which will incur about a 15% speed hit.
+
139 //
+
140 // ADDITIONAL DOCUMENTATION
+
141 //
+
142 // Immediately after this block comment are a series of sample programs.
+
143 //
+
144 // After the sample programs is the "header file" section. This section
+
145 // includes documentation for each API function.
+
146 //
+
147 // Some important concepts to understand to use this library:
+
148 //
+
149 // Codepoint
+
150 // Characters are defined by unicode codepoints, e.g. 65 is
+
151 // uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is
+
152 // the hiragana for "ma".
+
153 //
+
154 // Glyph
+
155 // A visual character shape (every codepoint is rendered as
+
156 // some glyph)
+
157 //
+
158 // Glyph index
+
159 // A font-specific integer ID representing a glyph
+
160 //
+
161 // Baseline
+
162 // Glyph shapes are defined relative to a baseline, which is the
+
163 // bottom of uppercase characters. Characters extend both above
+
164 // and below the baseline.
+
165 //
+
166 // Current Point
+
167 // As you draw text to the screen, you keep track of a "current point"
+
168 // which is the origin of each character. The current point's vertical
+
169 // position is the baseline. Even "baked fonts" use this model.
+
170 //
+
171 // Vertical Font Metrics
+
172 // The vertical qualities of the font, used to vertically position
+
173 // and space the characters. See docs for stbtt_GetFontVMetrics.
+
174 //
+
175 // Font Size in Pixels or Points
+
176 // The preferred interface for specifying font sizes in stb_truetype
+
177 // is to specify how tall the font's vertical extent should be in pixels.
+
178 // If that sounds good enough, skip the next paragraph.
+
179 //
+
180 // Most font APIs instead use "points", which are a common typographic
+
181 // measurement for describing font size, defined as 72 points per inch.
+
182 // stb_truetype provides a point API for compatibility. However, true
+
183 // "per inch" conventions don't make much sense on computer displays
+
184 // since different monitors have different number of pixels per
+
185 // inch. For example, Windows traditionally uses a convention that
+
186 // there are 96 pixels per inch, thus making 'inch' measurements have
+
187 // nothing to do with inches, and thus effectively defining a point to
+
188 // be 1.333 pixels. Additionally, the TrueType font data provides
+
189 // an explicit scale factor to scale a given font's glyphs to points,
+
190 // but the author has observed that this scale factor is often wrong
+
191 // for non-commercial fonts, thus making fonts scaled in points
+
192 // according to the TrueType spec incoherently sized in practice.
+
193 //
+
194 // DETAILED USAGE:
+
195 //
+
196 // Scale:
+
197 // Select how high you want the font to be, in points or pixels.
+
198 // Call ScaleForPixelHeight or ScaleForMappingEmToPixels to compute
+
199 // a scale factor SF that will be used by all other functions.
+
200 //
+
201 // Baseline:
+
202 // You need to select a y-coordinate that is the baseline of where
+
203 // your text will appear. Call GetFontBoundingBox to get the baseline-relative
+
204 // bounding box for all characters. SF*-y0 will be the distance in pixels
+
205 // that the worst-case character could extend above the baseline, so if
+
206 // you want the top edge of characters to appear at the top of the
+
207 // screen where y=0, then you would set the baseline to SF*-y0.
+
208 //
+
209 // Current point:
+
210 // Set the current point where the first character will appear. The
+
211 // first character could extend left of the current point; this is font
+
212 // dependent. You can either choose a current point that is the leftmost
+
213 // point and hope, or add some padding, or check the bounding box or
+
214 // left-side-bearing of the first character to be displayed and set
+
215 // the current point based on that.
+
216 //
+
217 // Displaying a character:
+
218 // Compute the bounding box of the character. It will contain signed values
+
219 // relative to <current_point, baseline>. I.e. if it returns x0,y0,x1,y1,
+
220 // then the character should be displayed in the rectangle from
+
221 // <current_point+SF*x0, baseline+SF*y0> to <current_point+SF*x1,baseline+SF*y1).
+
222 //
+
223 // Advancing for the next character:
+
224 // Call GlyphHMetrics, and compute 'current_point += SF * advance'.
+
225 //
+
226 //
+
227 // ADVANCED USAGE
+
228 //
+
229 // Quality:
+
230 //
+
231 // - Use the functions with Subpixel at the end to allow your characters
+
232 // to have subpixel positioning. Since the font is anti-aliased, not
+
233 // hinted, this is very import for quality. (This is not possible with
+
234 // baked fonts.)
+
235 //
+
236 // - Kerning is now supported, and if you're supporting subpixel rendering
+
237 // then kerning is worth using to give your text a polished look.
+
238 //
+
239 // Performance:
+
240 //
+
241 // - Convert Unicode codepoints to glyph indexes and operate on the glyphs;
+
242 // if you don't do this, stb_truetype is forced to do the conversion on
+
243 // every call.
+
244 //
+
245 // - There are a lot of memory allocations. We should modify it to take
+
246 // a temp buffer and allocate from the temp buffer (without freeing),
+
247 // should help performance a lot.
+
248 //
+
249 // NOTES
+
250 //
+
251 // The system uses the raw data found in the .ttf file without changing it
+
252 // and without building auxiliary data structures. This is a bit inefficient
+
253 // on little-endian systems (the data is big-endian), but assuming you're
+
254 // caching the bitmaps or glyph shapes this shouldn't be a big deal.
+
255 //
+
256 // It appears to be very hard to programmatically determine what font a
+
257 // given file is in a general way. I provide an API for this, but I don't
+
258 // recommend it.
+
259 //
+
260 //
+
261 // PERFORMANCE MEASUREMENTS FOR 1.06:
+
262 //
+
263 // 32-bit 64-bit
+
264 // Previous release: 8.83 s 7.68 s
+
265 // Pool allocations: 7.72 s 6.34 s
+
266 // Inline sort : 6.54 s 5.65 s
+
267 // New rasterizer : 5.63 s 5.00 s
+
268 
+
274 //
+
275 // Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless.
+
276 // See "tests/truetype_demo_win32.c" for a complete version.
+
277 #if 0
+
278 #define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation
+
279 #include "stb_truetype.h"
+
280 
+
281 unsigned char ttf_buffer[1<<20];
+
282 unsigned char temp_bitmap[512*512];
+
283 
+
284 stbtt_bakedchar cdata[96]; // ASCII 32..126 is 95 glyphs
+
285 GLuint ftex;
+
286 
+
287 void my_stbtt_initfont(void)
+
288 {
+
289  fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb"));
+
290  stbtt_BakeFontBitmap(ttf_buffer,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits!
+
291  // can free ttf_buffer at this point
+
292  glGenTextures(1, &ftex);
+
293  glBindTexture(GL_TEXTURE_2D, ftex);
+
294  glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, temp_bitmap);
+
295  // can free temp_bitmap at this point
+
296  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
297 }
+
298 
+
299 void my_stbtt_print(float x, float y, char *text)
+
300 {
+
301  // assume orthographic projection with units = screen pixels, origin at top left
+
302  glEnable(GL_BLEND);
+
303  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
304  glEnable(GL_TEXTURE_2D);
+
305  glBindTexture(GL_TEXTURE_2D, ftex);
+
306  glBegin(GL_QUADS);
+
307  while (*text) {
+
308  if (*text >= 32 && *text < 128) {
+ +
310  stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9
+
311  glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y0);
+
312  glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y0);
+
313  glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y1);
+
314  glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y1);
+
315  }
+
316  ++text;
+
317  }
+
318  glEnd();
+
319 }
+
320 #endif
+
321 //
+
322 //
+
324 //
+
325 // Complete program (this compiles): get a single bitmap, print as ASCII art
+
326 //
+
327 #if 0
+
328 #include <stdio.h>
+
329 #define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation
+
330 #include "stb_truetype.h"
+
331 
+
332 char ttf_buffer[1<<25];
+
333 
+
334 int main(int argc, char **argv)
+
335 {
+
336  stbtt_fontinfo font;
+
337  unsigned char *bitmap;
+
338  int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20);
+
339 
+
340  fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb"));
+
341 
+
342  stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0));
+
343  bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0);
+
344 
+
345  for (j=0; j < h; ++j) {
+
346  for (i=0; i < w; ++i)
+
347  putchar(" .:ioVM@"[bitmap[j*w+i]>>5]);
+
348  putchar('\n');
+
349  }
+
350  return 0;
+
351 }
+
352 #endif
+
353 //
+
354 // Output:
+
355 //
+
356 // .ii.
+
357 // @@@@@@.
+
358 // V@Mio@@o
+
359 // :i. V@V
+
360 // :oM@@M
+
361 // :@@@MM@M
+
362 // @@o o@M
+
363 // :@@. M@M
+
364 // @@@o@@@@
+
365 // :M@@V:@@.
+
366 //
+
368 //
+
369 // Complete program: print "Hello World!" banner, with bugs
+
370 //
+
371 #if 0
+
372 char buffer[24<<20];
+
373 unsigned char screen[20][79];
+
374 
+
375 int main(int arg, char **argv)
+
376 {
+
377  stbtt_fontinfo font;
+
378  int i,j,ascent,baseline,ch=0;
+
379  float scale, xpos=2; // leave a little padding in case the character extends left
+
380  char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness
+
381 
+
382  fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb"));
+
383  stbtt_InitFont(&font, buffer, 0);
+
384 
+
385  scale = stbtt_ScaleForPixelHeight(&font, 15);
+
386  stbtt_GetFontVMetrics(&font, &ascent,0,0);
+
387  baseline = (int) (ascent*scale);
+
388 
+
389  while (text[ch]) {
+
390  int advance,lsb,x0,y0,x1,y1;
+
391  float x_shift = xpos - (float) floor(xpos);
+
392  stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb);
+
393  stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1);
+
394  stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]);
+
395  // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong
+
396  // because this API is really for baking character bitmaps into textures. if you want to render
+
397  // a sequence of characters, you really need to render each bitmap to a temp buffer, then
+
398  // "alpha blend" that into the working buffer
+
399  xpos += (advance * scale);
+
400  if (text[ch+1])
+
401  xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]);
+
402  ++ch;
+
403  }
+
404 
+
405  for (j=0; j < 20; ++j) {
+
406  for (i=0; i < 78; ++i)
+
407  putchar(" .:ioVM@"[screen[j][i]>>5]);
+
408  putchar('\n');
+
409  }
+
410 
+
411  return 0;
+
412 }
+
413 #endif
+
414 
+
415 
+
424 
+
425 #ifdef STB_TRUETYPE_IMPLEMENTATION
+
426  // #define your own (u)stbtt_int8/16/32 before including to override this
+
427  #ifndef stbtt_uint8
+
428  typedef unsigned char stbtt_uint8;
+
429  typedef signed char stbtt_int8;
+
430  typedef unsigned short stbtt_uint16;
+
431  typedef signed short stbtt_int16;
+
432  typedef unsigned int stbtt_uint32;
+
433  typedef signed int stbtt_int32;
+
434  #endif
+
435 
+
436  typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1];
+
437  typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1];
+
438 
+
439  // e.g. #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h
+
440  #ifndef STBTT_ifloor
+
441  #include <math.h>
+
442  #define STBTT_ifloor(x) ((int) floor(x))
+
443  #define STBTT_iceil(x) ((int) ceil(x))
+
444  #endif
+
445 
+
446  #ifndef STBTT_sqrt
+
447  #include <math.h>
+
448  #define STBTT_sqrt(x) sqrt(x)
+
449  #define STBTT_pow(x,y) pow(x,y)
+
450  #endif
+
451 
+
452  #ifndef STBTT_fmod
+
453  #include <math.h>
+
454  #define STBTT_fmod(x,y) fmod(x,y)
+
455  #endif
+
456 
+
457  #ifndef STBTT_cos
+
458  #include <math.h>
+
459  #define STBTT_cos(x) cos(x)
+
460  #define STBTT_acos(x) acos(x)
+
461  #endif
+
462 
+
463  #ifndef STBTT_fabs
+
464  #include <math.h>
+
465  #define STBTT_fabs(x) fabs(x)
+
466  #endif
+
467 
+
468  // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h
+
469  #ifndef STBTT_malloc
+
470  #include <stdlib.h>
+
471  #define STBTT_malloc(x,u) ((void)(u),malloc(x))
+
472  #define STBTT_free(x,u) ((void)(u),free(x))
+
473  #endif
+
474 
+
475  #ifndef STBTT_assert
+
476  #include <assert.h>
+
477  #define STBTT_assert(x) assert(x)
+
478  #endif
+
479 
+
480  #ifndef STBTT_strlen
+
481  #include <string.h>
+
482  #define STBTT_strlen(x) strlen(x)
+
483  #endif
+
484 
+
485  #ifndef STBTT_memcpy
+
486  #include <string.h>
+
487  #define STBTT_memcpy memcpy
+
488  #define STBTT_memset memset
+
489  #endif
+
490 #endif
+
491 
+
498 
+
499 #ifndef __STB_INCLUDE_STB_TRUETYPE_H__
+
500 #define __STB_INCLUDE_STB_TRUETYPE_H__
+
501 
+
502 #ifdef STBTT_STATIC
+
503 #define STBTT_DEF static
+
504 #else
+
505 #define STBTT_DEF extern
+
506 #endif
+
507 
+
508 #ifdef __cplusplus
+
509 extern "C" {
+
510 #endif
+
511 
+
512 // private structure
+
513 typedef struct
+
514 {
+
515  unsigned char *data;
+
516  int cursor;
+
517  int size;
+
518 } stbtt__buf;
+
519 
+
521 //
+
522 // TEXTURE BAKING API
+
523 //
+
524 // If you use this API, you only have to call two functions ever.
+
525 //
+
526 
+
527 typedef struct
+
528 {
+
529  unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap
+
530  float xoff,yoff,xadvance;
+ +
532 
+
533 STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf)
+
534  float pixel_height, // height of font in pixels
+
535  unsigned char *pixels, int pw, int ph, // bitmap to be filled in
+
536  int first_char, int num_chars, // characters to bake
+
537  stbtt_bakedchar *chardata); // you allocate this, it's num_chars long
+
538 // if return is positive, the first unused row of the bitmap
+
539 // if return is negative, returns the negative of the number of characters that fit
+
540 // if return is 0, no characters fit and no rows were used
+
541 // This uses a very crappy packing.
+
542 
+
543 typedef struct
+
544 {
+
545  float x0,y0,s0,t0; // top-left
+
546  float x1,y1,s1,t1; // bottom-right
+ +
548 
+
549 STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, // same data as above
+
550  int char_index, // character to display
+
551  float *xpos, float *ypos, // pointers to current position in screen pixel space
+
552  stbtt_aligned_quad *q, // output: quad to draw
+
553  int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier
+
554 // Call GetBakedQuad with char_index = 'character - first_char', and it
+
555 // creates the quad you need to draw and advances the current position.
+
556 //
+
557 // The coordinate system used assumes y increases downwards.
+
558 //
+
559 // Characters will extend both above and below the current position;
+
560 // see discussion of "BASELINE" above.
+
561 //
+
562 // It's inefficient; you might want to c&p it and optimize it.
+
563 
+
564 STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap);
+
565 // Query the font vertical metrics without having to create a font first.
+
566 
+
567 
+
569 //
+
570 // NEW TEXTURE BAKING API
+
571 //
+
572 // This provides options for packing multiple fonts into one atlas, not
+
573 // perfectly but better than nothing.
+
574 
+
575 typedef struct
+
576 {
+
577  unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap
+
578  float xoff,yoff,xadvance;
+
579  float xoff2,yoff2;
+ +
581 
+ +
583 typedef struct stbtt_fontinfo stbtt_fontinfo;
+
584 #ifndef STB_RECT_PACK_VERSION
+
585 typedef struct stbrp_rect stbrp_rect;
+
586 #endif
+
587 
+
588 STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context);
+
589 // Initializes a packing context stored in the passed-in stbtt_pack_context.
+
590 // Future calls using this context will pack characters into the bitmap passed
+
591 // in here: a 1-channel bitmap that is width * height. stride_in_bytes is
+
592 // the distance from one row to the next (or 0 to mean they are packed tightly
+
593 // together). "padding" is the amount of padding to leave between each
+
594 // character (normally you want '1' for bitmaps you'll use as textures with
+
595 // bilinear filtering).
+
596 //
+
597 // Returns 0 on failure, 1 on success.
+
598 
+
599 STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc);
+
600 // Cleans up the packing context and frees all memory.
+
601 
+
602 #define STBTT_POINT_SIZE(x) (-(x))
+
603 
+
604 STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size,
+
605  int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range);
+
606 // Creates character bitmaps from the font_index'th font found in fontdata (use
+
607 // font_index=0 if you don't know what that is). It creates num_chars_in_range
+
608 // bitmaps for characters with unicode values starting at first_unicode_char_in_range
+
609 // and increasing. Data for how to render them is stored in chardata_for_range;
+
610 // pass these to stbtt_GetPackedQuad to get back renderable quads.
+
611 //
+
612 // font_size is the full height of the character from ascender to descender,
+
613 // as computed by stbtt_ScaleForPixelHeight. To use a point size as computed
+
614 // by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE()
+
615 // and pass that result as 'font_size':
+
616 // ..., 20 , ... // font max minus min y is 20 pixels tall
+
617 // ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall
+
618 
+
619 typedef struct
+
620 {
+
621  float font_size;
+
622  int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint
+
623  int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints
+
624  int num_chars;
+
625  stbtt_packedchar *chardata_for_range; // output
+
626  unsigned char h_oversample, v_oversample; // don't set these, they're used internally
+ +
628 
+
629 STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges);
+
630 // Creates character bitmaps from multiple ranges of characters stored in
+
631 // ranges. This will usually create a better-packed bitmap than multiple
+
632 // calls to stbtt_PackFontRange. Note that you can call this multiple
+
633 // times within a single PackBegin/PackEnd.
+
634 
+
635 STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample);
+
636 // Oversampling a font increases the quality by allowing higher-quality subpixel
+
637 // positioning, and is especially valuable at smaller text sizes.
+
638 //
+
639 // This function sets the amount of oversampling for all following calls to
+
640 // stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given
+
641 // pack context. The default (no oversampling) is achieved by h_oversample=1
+
642 // and v_oversample=1. The total number of pixels required is
+
643 // h_oversample*v_oversample larger than the default; for example, 2x2
+
644 // oversampling requires 4x the storage of 1x1. For best results, render
+
645 // oversampled textures with bilinear filtering. Look at the readme in
+
646 // stb/tests/oversample for information about oversampled fonts
+
647 //
+
648 // To use with PackFontRangesGather etc., you must set it before calls
+
649 // call to PackFontRangesGatherRects.
+
650 
+
651 STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
+
652 // If skip != 0, this tells stb_truetype to skip any codepoints for which
+
653 // there is no corresponding glyph. If skip=0, which is the default, then
+
654 // codepoints without a glyph recived the font's "missing character" glyph,
+
655 // typically an empty box by convention.
+
656 
+
657 STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above
+
658  int char_index, // character to display
+
659  float *xpos, float *ypos, // pointers to current position in screen pixel space
+
660  stbtt_aligned_quad *q, // output: quad to draw
+
661  int align_to_integer);
+
662 
+
663 STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
+
664 STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects);
+
665 STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
+
666 // Calling these functions in sequence is roughly equivalent to calling
+
667 // stbtt_PackFontRanges(). If you more control over the packing of multiple
+
668 // fonts, or if you want to pack custom data into a font texture, take a look
+
669 // at the source to of stbtt_PackFontRanges() and create a custom version
+
670 // using these functions, e.g. call GatherRects multiple times,
+
671 // building up a single array of rects, then call PackRects once,
+
672 // then call RenderIntoRects repeatedly. This may result in a
+
673 // better packing than calling PackFontRanges multiple times
+
674 // (or it may not).
+
675 
+
676 // this is an opaque structure that you shouldn't mess with which holds
+
677 // all the context needed from PackBegin to PackEnd.
+ +
679  void *user_allocator_context;
+
680  void *pack_info;
+
681  int width;
+
682  int height;
+
683  int stride_in_bytes;
+
684  int padding;
+
685  int skip_missing;
+
686  unsigned int h_oversample, v_oversample;
+
687  unsigned char *pixels;
+
688  void *nodes;
+
689 };
+
690 
+
692 //
+
693 // FONT LOADING
+
694 //
+
695 //
+
696 
+
697 STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data);
+
698 // This function will determine the number of fonts in a font file. TrueType
+
699 // collection (.ttc) files may contain multiple fonts, while TrueType font
+
700 // (.ttf) files only contain one font. The number of fonts can be used for
+
701 // indexing with the previous function where the index is between zero and one
+
702 // less than the total fonts. If an error occurs, -1 is returned.
+
703 
+
704 STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index);
+
705 // Each .ttf/.ttc file may have more than one font. Each font has a sequential
+
706 // index number starting from 0. Call this function to get the font offset for
+
707 // a given index; it returns -1 if the index is out of range. A regular .ttf
+
708 // file will only define one font and it always be at offset 0, so it will
+
709 // return '0' for index 0, and -1 for all other indices.
+
710 
+
711 // The following structure is defined publicly so you can declare one on
+
712 // the stack or as a global or etc, but you should treat it as opaque.
+ +
714 {
+
715  void * userdata;
+
716  unsigned char * data; // pointer to .ttf file
+
717  int fontstart; // offset of start of font
+
718 
+
719  int numGlyphs; // number of glyphs, needed for range checking
+
720 
+
721  int loca,head,glyf,hhea,hmtx,kern,gpos,svg; // table locations as offset from start of .ttf
+
722  int index_map; // a cmap mapping for our chosen character encoding
+
723  int indexToLocFormat; // format needed to map from glyph index to glyph
+
724 
+
725  stbtt__buf cff; // cff font data
+
726  stbtt__buf charstrings; // the charstring index
+
727  stbtt__buf gsubrs; // global charstring subroutines index
+
728  stbtt__buf subrs; // private charstring subroutines index
+
729  stbtt__buf fontdicts; // array of font dicts
+
730  stbtt__buf fdselect; // map from glyph to fontdict
+
731 };
+
732 
+
733 STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset);
+
734 // Given an offset into the file that defines a font, this function builds
+
735 // the necessary cached info for the rest of the system. You must allocate
+
736 // the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't
+
737 // need to do anything special to free it, because the contents are pure
+
738 // value data with no additional data structures. Returns 0 on failure.
+
739 
+
740 
+
742 //
+
743 // CHARACTER TO GLYPH-INDEX CONVERSIOn
+
744 
+
745 STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint);
+
746 // If you're going to perform multiple operations on the same character
+
747 // and you want a speed-up, call this function with the character you're
+
748 // going to process, then use glyph-based functions instead of the
+
749 // codepoint-based functions.
+
750 // Returns 0 if the character codepoint is not defined in the font.
+
751 
+
752 
+
754 //
+
755 // CHARACTER PROPERTIES
+
756 //
+
757 
+
758 STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels);
+
759 // computes a scale factor to produce a font whose "height" is 'pixels' tall.
+
760 // Height is measured as the distance from the highest ascender to the lowest
+
761 // descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics
+
762 // and computing:
+
763 // scale = pixels / (ascent - descent)
+
764 // so if you prefer to measure height by the ascent only, use a similar calculation.
+
765 
+
766 STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels);
+
767 // computes a scale factor to produce a font whose EM size is mapped to
+
768 // 'pixels' tall. This is probably what traditional APIs compute, but
+
769 // I'm not positive.
+
770 
+
771 STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap);
+
772 // ascent is the coordinate above the baseline the font extends; descent
+
773 // is the coordinate below the baseline the font extends (i.e. it is typically negative)
+
774 // lineGap is the spacing between one row's descent and the next row's ascent...
+
775 // so you should advance the vertical position by "*ascent - *descent + *lineGap"
+
776 // these are expressed in unscaled coordinates, so you must multiply by
+
777 // the scale factor for a given size
+
778 
+
779 STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap);
+
780 // analogous to GetFontVMetrics, but returns the "typographic" values from the OS/2
+
781 // table (specific to MS/Windows TTF files).
+
782 //
+
783 // Returns 1 on success (table present), 0 on failure.
+
784 
+
785 STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1);
+
786 // the bounding box around all possible characters
+
787 
+
788 STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing);
+
789 // leftSideBearing is the offset from the current horizontal position to the left edge of the character
+
790 // advanceWidth is the offset from the current horizontal position to the next horizontal position
+
791 // these are expressed in unscaled coordinates
+
792 
+
793 STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2);
+
794 // an additional amount to add to the 'advance' value between ch1 and ch2
+
795 
+
796 STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1);
+
797 // Gets the bounding box of the visible part of the glyph, in unscaled coordinates
+
798 
+
799 STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing);
+
800 STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2);
+
801 STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1);
+
802 // as above, but takes one or more glyph indices for greater efficiency
+
803 
+
804 typedef struct stbtt_kerningentry
+
805 {
+
806  int glyph1; // use stbtt_FindGlyphIndex
+
807  int glyph2;
+
808  int advance;
+ +
810 
+
811 STBTT_DEF int stbtt_GetKerningTableLength(const stbtt_fontinfo *info);
+
812 STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningentry* table, int table_length);
+
813 // Retrieves a complete list of all of the kerning pairs provided by the font
+
814 // stbtt_GetKerningTable never writes more than table_length entries and returns how many entries it did write.
+
815 // The table will be sorted by (a.glyph1 == b.glyph1)?(a.glyph2 < b.glyph2):(a.glyph1 < b.glyph1)
+
816 
+
818 //
+
819 // GLYPH SHAPES (you probably don't need these, but they have to go before
+
820 // the bitmaps for C declaration-order reasons)
+
821 //
+
822 
+
823 #ifndef STBTT_vmove // you can predefine these to use different values (but why?)
+
824  enum {
+
825  STBTT_vmove=1,
+
826  STBTT_vline,
+
827  STBTT_vcurve,
+
828  STBTT_vcubic
+
829  };
+
830 #endif
+
831 
+
832 #ifndef stbtt_vertex // you can predefine this to use different values
+
833  // (we share this with other code at RAD)
+
834  #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file
+
835  typedef struct
+
836  {
+
837  stbtt_vertex_type x,y,cx,cy,cx1,cy1;
+
838  unsigned char type,padding;
+
839  } stbtt_vertex;
+
840 #endif
+
841 
+
842 STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index);
+
843 // returns non-zero if nothing is drawn for this glyph
+
844 
+
845 STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices);
+
846 STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices);
+
847 // returns # of vertices and fills *vertices with the pointer to them
+
848 // these are expressed in "unscaled" coordinates
+
849 //
+
850 // The shape is a series of contours. Each one starts with
+
851 // a STBTT_moveto, then consists of a series of mixed
+
852 // STBTT_lineto and STBTT_curveto segments. A lineto
+
853 // draws a line from previous endpoint to its x,y; a curveto
+
854 // draws a quadratic bezier from previous endpoint to
+
855 // its x,y, using cx,cy as the bezier control point.
+
856 
+
857 STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices);
+
858 // frees the data allocated above
+
859 
+
860 STBTT_DEF unsigned char *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl);
+
861 STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg);
+
862 STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg);
+
863 // fills svg with the character's SVG data.
+
864 // returns data size or 0 if SVG not found.
+
865 
+
867 //
+
868 // BITMAP RENDERING
+
869 //
+
870 
+
871 STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata);
+
872 // frees the bitmap allocated below
+
873 
+
874 STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff);
+
875 // allocates a large-enough single-channel 8bpp bitmap and renders the
+
876 // specified character/glyph at the specified scale into it, with
+
877 // antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque).
+
878 // *width & *height are filled out with the width & height of the bitmap,
+
879 // which is stored left-to-right, top-to-bottom.
+
880 //
+
881 // xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap
+
882 
+
883 STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff);
+
884 // the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel
+
885 // shift for the character
+
886 
+
887 STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint);
+
888 // the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap
+
889 // in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap
+
890 // is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the
+
891 // width and height and positioning info for it first.
+
892 
+
893 STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint);
+
894 // same as stbtt_MakeCodepointBitmap, but you can specify a subpixel
+
895 // shift for the character
+
896 
+
897 STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint);
+
898 // same as stbtt_MakeCodepointBitmapSubpixel, but prefiltering
+
899 // is performed (see stbtt_PackSetOversampling)
+
900 
+
901 STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1);
+
902 // get the bbox of the bitmap centered around the glyph origin; so the
+
903 // bitmap width is ix1-ix0, height is iy1-iy0, and location to place
+
904 // the bitmap top left is (leftSideBearing*scale,iy0).
+
905 // (Note that the bitmap uses y-increases-down, but the shape uses
+
906 // y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.)
+
907 
+
908 STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1);
+
909 // same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel
+
910 // shift for the character
+
911 
+
912 // the following functions are equivalent to the above functions, but operate
+
913 // on glyph indices instead of Unicode codepoints (for efficiency)
+
914 STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff);
+
915 STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff);
+
916 STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph);
+
917 STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph);
+
918 STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int glyph);
+
919 STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1);
+
920 STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1);
+
921 
+
922 
+
923 // @TODO: don't expose this structure
+
924 typedef struct
+
925 {
+
926  int w,h,stride;
+
927  unsigned char *pixels;
+
928 } stbtt__bitmap;
+
929 
+
930 // rasterize a shape with quadratic beziers into a bitmap
+
931 STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into
+
932  float flatness_in_pixels, // allowable error of curve in pixels
+
933  stbtt_vertex *vertices, // array of vertices defining shape
+
934  int num_verts, // number of vertices in above array
+
935  float scale_x, float scale_y, // scale applied to input vertices
+
936  float shift_x, float shift_y, // translation applied to input vertices
+
937  int x_off, int y_off, // another translation applied to input
+
938  int invert, // if non-zero, vertically flip shape
+
939  void *userdata); // context for to STBTT_MALLOC
+
940 
+
942 //
+
943 // Signed Distance Function (or Field) rendering
+
944 
+
945 STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata);
+
946 // frees the SDF bitmap allocated below
+
947 
+
948 STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff);
+
949 STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff);
+
950 // These functions compute a discretized SDF field for a single character, suitable for storing
+
951 // in a single-channel texture, sampling with bilinear filtering, and testing against
+
952 // larger than some threshold to produce scalable fonts.
+
953 // info -- the font
+
954 // scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap
+
955 // glyph/codepoint -- the character to generate the SDF for
+
956 // padding -- extra "pixels" around the character which are filled with the distance to the character (not 0),
+
957 // which allows effects like bit outlines
+
958 // onedge_value -- value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character)
+
959 // pixel_dist_scale -- what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale)
+
960 // if positive, > onedge_value is inside; if negative, < onedge_value is inside
+
961 // width,height -- output height & width of the SDF bitmap (including padding)
+
962 // xoff,yoff -- output origin of the character
+
963 // return value -- a 2D array of bytes 0..255, width*height in size
+
964 //
+
965 // pixel_dist_scale & onedge_value are a scale & bias that allows you to make
+
966 // optimal use of the limited 0..255 for your application, trading off precision
+
967 // and special effects. SDF values outside the range 0..255 are clamped to 0..255.
+
968 //
+
969 // Example:
+
970 // scale = stbtt_ScaleForPixelHeight(22)
+
971 // padding = 5
+
972 // onedge_value = 180
+
973 // pixel_dist_scale = 180/5.0 = 36.0
+
974 //
+
975 // This will create an SDF bitmap in which the character is about 22 pixels
+
976 // high but the whole bitmap is about 22+5+5=32 pixels high. To produce a filled
+
977 // shape, sample the SDF at each pixel and fill the pixel if the SDF value
+
978 // is greater than or equal to 180/255. (You'll actually want to antialias,
+
979 // which is beyond the scope of this example.) Additionally, you can compute
+
980 // offset outlines (e.g. to stroke the character border inside & outside,
+
981 // or only outside). For example, to fill outside the character up to 3 SDF
+
982 // pixels, you would compare against (180-36.0*3)/255 = 72/255. The above
+
983 // choice of variables maps a range from 5 pixels outside the shape to
+
984 // 2 pixels inside the shape to 0..255; this is intended primarily for apply
+
985 // outside effects only (the interior range is needed to allow proper
+
986 // antialiasing of the font at *smaller* sizes)
+
987 //
+
988 // The function computes the SDF analytically at each SDF pixel, not by e.g.
+
989 // building a higher-res bitmap and approximating it. In theory the quality
+
990 // should be as high as possible for an SDF of this size & representation, but
+
991 // unclear if this is true in practice (perhaps building a higher-res bitmap
+
992 // and computing from that can allow drop-out prevention).
+
993 //
+
994 // The algorithm has not been optimized at all, so expect it to be slow
+
995 // if computing lots of characters or very large sizes.
+
996 
+
997 
+
998 
+
1000 //
+
1001 // Finding the right font...
+
1002 //
+
1003 // You should really just solve this offline, keep your own tables
+
1004 // of what font is what, and don't try to get it out of the .ttf file.
+
1005 // That's because getting it out of the .ttf file is really hard, because
+
1006 // the names in the file can appear in many possible encodings, in many
+
1007 // possible languages, and e.g. if you need a case-insensitive comparison,
+
1008 // the details of that depend on the encoding & language in a complex way
+
1009 // (actually underspecified in truetype, but also gigantic).
+
1010 //
+
1011 // But you can use the provided functions in two possible ways:
+
1012 // stbtt_FindMatchingFont() will use *case-sensitive* comparisons on
+
1013 // unicode-encoded names to try to find the font you want;
+
1014 // you can run this before calling stbtt_InitFont()
+
1015 //
+
1016 // stbtt_GetFontNameString() lets you get any of the various strings
+
1017 // from the file yourself and do your own comparisons on them.
+
1018 // You have to have called stbtt_InitFont() first.
+
1019 
+
1020 
+
1021 STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags);
+
1022 // returns the offset (not index) of the font that matches, or -1 if none
+
1023 // if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold".
+
1024 // if you use any other flag, use a font name like "Arial"; this checks
+
1025 // the 'macStyle' header field; i don't know if fonts set this consistently
+
1026 #define STBTT_MACSTYLE_DONTCARE 0
+
1027 #define STBTT_MACSTYLE_BOLD 1
+
1028 #define STBTT_MACSTYLE_ITALIC 2
+
1029 #define STBTT_MACSTYLE_UNDERSCORE 4
+
1030 #define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0
+
1031 
+
1032 STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2);
+
1033 // returns 1/0 whether the first string interpreted as utf8 is identical to
+
1034 // the second string interpreted as big-endian utf16... useful for strings from next func
+
1035 
+
1036 STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID);
+
1037 // returns the string (which may be big-endian double byte, e.g. for unicode)
+
1038 // and puts the length in bytes in *length.
+
1039 //
+
1040 // some of the values for the IDs are below; for more see the truetype spec:
+
1041 // http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html
+
1042 // http://www.microsoft.com/typography/otspec/name.htm
+
1043 
+
1044 enum { // platformID
+
1045  STBTT_PLATFORM_ID_UNICODE =0,
+
1046  STBTT_PLATFORM_ID_MAC =1,
+
1047  STBTT_PLATFORM_ID_ISO =2,
+
1048  STBTT_PLATFORM_ID_MICROSOFT =3
+
1049 };
+
1050 
+
1051 enum { // encodingID for STBTT_PLATFORM_ID_UNICODE
+
1052  STBTT_UNICODE_EID_UNICODE_1_0 =0,
+
1053  STBTT_UNICODE_EID_UNICODE_1_1 =1,
+
1054  STBTT_UNICODE_EID_ISO_10646 =2,
+
1055  STBTT_UNICODE_EID_UNICODE_2_0_BMP=3,
+
1056  STBTT_UNICODE_EID_UNICODE_2_0_FULL=4
+
1057 };
+
1058 
+
1059 enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT
+
1060  STBTT_MS_EID_SYMBOL =0,
+
1061  STBTT_MS_EID_UNICODE_BMP =1,
+
1062  STBTT_MS_EID_SHIFTJIS =2,
+
1063  STBTT_MS_EID_UNICODE_FULL =10
+
1064 };
+
1065 
+
1066 enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes
+
1067  STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4,
+
1068  STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5,
+
1069  STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6,
+
1070  STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7
+
1071 };
+
1072 
+
1073 enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID...
+
1074  // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs
+
1075  STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410,
+
1076  STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411,
+
1077  STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412,
+
1078  STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419,
+
1079  STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409,
+
1080  STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D
+
1081 };
+
1082 
+
1083 enum { // languageID for STBTT_PLATFORM_ID_MAC
+
1084  STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11,
+
1085  STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23,
+
1086  STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32,
+
1087  STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 ,
+
1088  STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 ,
+
1089  STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33,
+
1090  STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19
+
1091 };
+
1092 
+
1093 #ifdef __cplusplus
+
1094 }
+
1095 #endif
+
1096 
+
1097 #endif // __STB_INCLUDE_STB_TRUETYPE_H__
+
1098 
+
1105 
+
1106 #ifdef STB_TRUETYPE_IMPLEMENTATION
+
1107 
+
1108 #ifndef STBTT_MAX_OVERSAMPLE
+
1109 #define STBTT_MAX_OVERSAMPLE 8
+
1110 #endif
+
1111 
+
1112 #if STBTT_MAX_OVERSAMPLE > 255
+
1113 #error "STBTT_MAX_OVERSAMPLE cannot be > 255"
+
1114 #endif
+
1115 
+
1116 typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1];
+
1117 
+
1118 #ifndef STBTT_RASTERIZER_VERSION
+
1119 #define STBTT_RASTERIZER_VERSION 2
+
1120 #endif
+
1121 
+
1122 #ifdef _MSC_VER
+
1123 #define STBTT__NOTUSED(v) (void)(v)
+
1124 #else
+
1125 #define STBTT__NOTUSED(v) (void)sizeof(v)
+
1126 #endif
+
1127 
+
1129 //
+
1130 // stbtt__buf helpers to parse data from file
+
1131 //
+
1132 
+
1133 static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b)
+
1134 {
+
1135  if (b->cursor >= b->size)
+
1136  return 0;
+
1137  return b->data[b->cursor++];
+
1138 }
+
1139 
+
1140 static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b)
+
1141 {
+
1142  if (b->cursor >= b->size)
+
1143  return 0;
+
1144  return b->data[b->cursor];
+
1145 }
+
1146 
+
1147 static void stbtt__buf_seek(stbtt__buf *b, int o)
+
1148 {
+
1149  STBTT_assert(!(o > b->size || o < 0));
+
1150  b->cursor = (o > b->size || o < 0) ? b->size : o;
+
1151 }
+
1152 
+
1153 static void stbtt__buf_skip(stbtt__buf *b, int o)
+
1154 {
+
1155  stbtt__buf_seek(b, b->cursor + o);
+
1156 }
+
1157 
+
1158 static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n)
+
1159 {
+
1160  stbtt_uint32 v = 0;
+
1161  int i;
+
1162  STBTT_assert(n >= 1 && n <= 4);
+
1163  for (i = 0; i < n; i++)
+
1164  v = (v << 8) | stbtt__buf_get8(b);
+
1165  return v;
+
1166 }
+
1167 
+
1168 static stbtt__buf stbtt__new_buf(const void *p, size_t size)
+
1169 {
+
1170  stbtt__buf r;
+
1171  STBTT_assert(size < 0x40000000);
+
1172  r.data = (stbtt_uint8*) p;
+
1173  r.size = (int) size;
+
1174  r.cursor = 0;
+
1175  return r;
+
1176 }
+
1177 
+
1178 #define stbtt__buf_get16(b) stbtt__buf_get((b), 2)
+
1179 #define stbtt__buf_get32(b) stbtt__buf_get((b), 4)
+
1180 
+
1181 static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s)
+
1182 {
+
1183  stbtt__buf r = stbtt__new_buf(NULL, 0);
+
1184  if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r;
+
1185  r.data = b->data + o;
+
1186  r.size = s;
+
1187  return r;
+
1188 }
+
1189 
+
1190 static stbtt__buf stbtt__cff_get_index(stbtt__buf *b)
+
1191 {
+
1192  int count, start, offsize;
+
1193  start = b->cursor;
+
1194  count = stbtt__buf_get16(b);
+
1195  if (count) {
+
1196  offsize = stbtt__buf_get8(b);
+
1197  STBTT_assert(offsize >= 1 && offsize <= 4);
+
1198  stbtt__buf_skip(b, offsize * count);
+
1199  stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1);
+
1200  }
+
1201  return stbtt__buf_range(b, start, b->cursor - start);
+
1202 }
+
1203 
+
1204 static stbtt_uint32 stbtt__cff_int(stbtt__buf *b)
+
1205 {
+
1206  int b0 = stbtt__buf_get8(b);
+
1207  if (b0 >= 32 && b0 <= 246) return b0 - 139;
+
1208  else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108;
+
1209  else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108;
+
1210  else if (b0 == 28) return stbtt__buf_get16(b);
+
1211  else if (b0 == 29) return stbtt__buf_get32(b);
+
1212  STBTT_assert(0);
+
1213  return 0;
+
1214 }
+
1215 
+
1216 static void stbtt__cff_skip_operand(stbtt__buf *b) {
+
1217  int v, b0 = stbtt__buf_peek8(b);
+
1218  STBTT_assert(b0 >= 28);
+
1219  if (b0 == 30) {
+
1220  stbtt__buf_skip(b, 1);
+
1221  while (b->cursor < b->size) {
+
1222  v = stbtt__buf_get8(b);
+
1223  if ((v & 0xF) == 0xF || (v >> 4) == 0xF)
+
1224  break;
+
1225  }
+
1226  } else {
+
1227  stbtt__cff_int(b);
+
1228  }
+
1229 }
+
1230 
+
1231 static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key)
+
1232 {
+
1233  stbtt__buf_seek(b, 0);
+
1234  while (b->cursor < b->size) {
+
1235  int start = b->cursor, end, op;
+
1236  while (stbtt__buf_peek8(b) >= 28)
+
1237  stbtt__cff_skip_operand(b);
+
1238  end = b->cursor;
+
1239  op = stbtt__buf_get8(b);
+
1240  if (op == 12) op = stbtt__buf_get8(b) | 0x100;
+
1241  if (op == key) return stbtt__buf_range(b, start, end-start);
+
1242  }
+
1243  return stbtt__buf_range(b, 0, 0);
+
1244 }
+
1245 
+
1246 static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out)
+
1247 {
+
1248  int i;
+
1249  stbtt__buf operands = stbtt__dict_get(b, key);
+
1250  for (i = 0; i < outcount && operands.cursor < operands.size; i++)
+
1251  out[i] = stbtt__cff_int(&operands);
+
1252 }
+
1253 
+
1254 static int stbtt__cff_index_count(stbtt__buf *b)
+
1255 {
+
1256  stbtt__buf_seek(b, 0);
+
1257  return stbtt__buf_get16(b);
+
1258 }
+
1259 
+
1260 static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i)
+
1261 {
+
1262  int count, offsize, start, end;
+
1263  stbtt__buf_seek(&b, 0);
+
1264  count = stbtt__buf_get16(&b);
+
1265  offsize = stbtt__buf_get8(&b);
+
1266  STBTT_assert(i >= 0 && i < count);
+
1267  STBTT_assert(offsize >= 1 && offsize <= 4);
+
1268  stbtt__buf_skip(&b, i*offsize);
+
1269  start = stbtt__buf_get(&b, offsize);
+
1270  end = stbtt__buf_get(&b, offsize);
+
1271  return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start);
+
1272 }
+
1273 
+
1275 //
+
1276 // accessors to parse data from file
+
1277 //
+
1278 
+
1279 // on platforms that don't allow misaligned reads, if we want to allow
+
1280 // truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE
+
1281 
+
1282 #define ttBYTE(p) (* (stbtt_uint8 *) (p))
+
1283 #define ttCHAR(p) (* (stbtt_int8 *) (p))
+
1284 #define ttFixed(p) ttLONG(p)
+
1285 
+
1286 static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; }
+
1287 static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; }
+
1288 static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; }
+
1289 static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; }
+
1290 
+
1291 #define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3))
+
1292 #define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3])
+
1293 
+
1294 static int stbtt__isfont(stbtt_uint8 *font)
+
1295 {
+
1296  // check the version number
+
1297  if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1
+
1298  if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this!
+
1299  if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF
+
1300  if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0
+
1301  if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts
+
1302  return 0;
+
1303 }
+
1304 
+
1305 // @OPTIMIZE: binary search
+
1306 static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag)
+
1307 {
+
1308  stbtt_int32 num_tables = ttUSHORT(data+fontstart+4);
+
1309  stbtt_uint32 tabledir = fontstart + 12;
+
1310  stbtt_int32 i;
+
1311  for (i=0; i < num_tables; ++i) {
+
1312  stbtt_uint32 loc = tabledir + 16*i;
+
1313  if (stbtt_tag(data+loc+0, tag))
+
1314  return ttULONG(data+loc+8);
+
1315  }
+
1316  return 0;
+
1317 }
+
1318 
+
1319 static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index)
+
1320 {
+
1321  // if it's just a font, there's only one valid index
+
1322  if (stbtt__isfont(font_collection))
+
1323  return index == 0 ? 0 : -1;
+
1324 
+
1325  // check if it's a TTC
+
1326  if (stbtt_tag(font_collection, "ttcf")) {
+
1327  // version 1?
+
1328  if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) {
+
1329  stbtt_int32 n = ttLONG(font_collection+8);
+
1330  if (index >= n)
+
1331  return -1;
+
1332  return ttULONG(font_collection+12+index*4);
+
1333  }
+
1334  }
+
1335  return -1;
+
1336 }
+
1337 
+
1338 static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection)
+
1339 {
+
1340  // if it's just a font, there's only one valid font
+
1341  if (stbtt__isfont(font_collection))
+
1342  return 1;
+
1343 
+
1344  // check if it's a TTC
+
1345  if (stbtt_tag(font_collection, "ttcf")) {
+
1346  // version 1?
+
1347  if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) {
+
1348  return ttLONG(font_collection+8);
+
1349  }
+
1350  }
+
1351  return 0;
+
1352 }
+
1353 
+
1354 static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict)
+
1355 {
+
1356  stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 };
+
1357  stbtt__buf pdict;
+
1358  stbtt__dict_get_ints(&fontdict, 18, 2, private_loc);
+
1359  if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0);
+
1360  pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]);
+
1361  stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff);
+
1362  if (!subrsoff) return stbtt__new_buf(NULL, 0);
+
1363  stbtt__buf_seek(&cff, private_loc[1]+subrsoff);
+
1364  return stbtt__cff_get_index(&cff);
+
1365 }
+
1366 
+
1367 // since most people won't use this, find this table the first time it's needed
+
1368 static int stbtt__get_svg(stbtt_fontinfo *info)
+
1369 {
+
1370  stbtt_uint32 t;
+
1371  if (info->svg < 0) {
+
1372  t = stbtt__find_table(info->data, info->fontstart, "SVG ");
+
1373  if (t) {
+
1374  stbtt_uint32 offset = ttULONG(info->data + t + 2);
+
1375  info->svg = t + offset;
+
1376  } else {
+
1377  info->svg = 0;
+
1378  }
+
1379  }
+
1380  return info->svg;
+
1381 }
+
1382 
+
1383 static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart)
+
1384 {
+
1385  stbtt_uint32 cmap, t;
+
1386  stbtt_int32 i,numTables;
+
1387 
+
1388  info->data = data;
+
1389  info->fontstart = fontstart;
+
1390  info->cff = stbtt__new_buf(NULL, 0);
+
1391 
+
1392  cmap = stbtt__find_table(data, fontstart, "cmap"); // required
+
1393  info->loca = stbtt__find_table(data, fontstart, "loca"); // required
+
1394  info->head = stbtt__find_table(data, fontstart, "head"); // required
+
1395  info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required
+
1396  info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required
+
1397  info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required
+
1398  info->kern = stbtt__find_table(data, fontstart, "kern"); // not required
+
1399  info->gpos = stbtt__find_table(data, fontstart, "GPOS"); // not required
+
1400 
+
1401  if (!cmap || !info->head || !info->hhea || !info->hmtx)
+
1402  return 0;
+
1403  if (info->glyf) {
+
1404  // required for truetype
+
1405  if (!info->loca) return 0;
+
1406  } else {
+
1407  // initialization for CFF / Type2 fonts (OTF)
+
1408  stbtt__buf b, topdict, topdictidx;
+
1409  stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0;
+
1410  stbtt_uint32 cff;
+
1411 
+
1412  cff = stbtt__find_table(data, fontstart, "CFF ");
+
1413  if (!cff) return 0;
+
1414 
+
1415  info->fontdicts = stbtt__new_buf(NULL, 0);
+
1416  info->fdselect = stbtt__new_buf(NULL, 0);
+
1417 
+
1418  // @TODO this should use size from table (not 512MB)
+
1419  info->cff = stbtt__new_buf(data+cff, 512*1024*1024);
+
1420  b = info->cff;
+
1421 
+
1422  // read the header
+
1423  stbtt__buf_skip(&b, 2);
+
1424  stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize
+
1425 
+
1426  // @TODO the name INDEX could list multiple fonts,
+
1427  // but we just use the first one.
+
1428  stbtt__cff_get_index(&b); // name INDEX
+
1429  topdictidx = stbtt__cff_get_index(&b);
+
1430  topdict = stbtt__cff_index_get(topdictidx, 0);
+
1431  stbtt__cff_get_index(&b); // string INDEX
+
1432  info->gsubrs = stbtt__cff_get_index(&b);
+
1433 
+
1434  stbtt__dict_get_ints(&topdict, 17, 1, &charstrings);
+
1435  stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype);
+
1436  stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff);
+
1437  stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff);
+
1438  info->subrs = stbtt__get_subrs(b, topdict);
+
1439 
+
1440  // we only support Type 2 charstrings
+
1441  if (cstype != 2) return 0;
+
1442  if (charstrings == 0) return 0;
+
1443 
+
1444  if (fdarrayoff) {
+
1445  // looks like a CID font
+
1446  if (!fdselectoff) return 0;
+
1447  stbtt__buf_seek(&b, fdarrayoff);
+
1448  info->fontdicts = stbtt__cff_get_index(&b);
+
1449  info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff);
+
1450  }
+
1451 
+
1452  stbtt__buf_seek(&b, charstrings);
+
1453  info->charstrings = stbtt__cff_get_index(&b);
+
1454  }
+
1455 
+
1456  t = stbtt__find_table(data, fontstart, "maxp");
+
1457  if (t)
+
1458  info->numGlyphs = ttUSHORT(data+t+4);
+
1459  else
+
1460  info->numGlyphs = 0xffff;
+
1461 
+
1462  info->svg = -1;
+
1463 
+
1464  // find a cmap encoding table we understand *now* to avoid searching
+
1465  // later. (todo: could make this installable)
+
1466  // the same regardless of glyph.
+
1467  numTables = ttUSHORT(data + cmap + 2);
+
1468  info->index_map = 0;
+
1469  for (i=0; i < numTables; ++i) {
+
1470  stbtt_uint32 encoding_record = cmap + 4 + 8 * i;
+
1471  // find an encoding we understand:
+
1472  switch(ttUSHORT(data+encoding_record)) {
+
1473  case STBTT_PLATFORM_ID_MICROSOFT:
+
1474  switch (ttUSHORT(data+encoding_record+2)) {
+
1475  case STBTT_MS_EID_UNICODE_BMP:
+
1476  case STBTT_MS_EID_UNICODE_FULL:
+
1477  // MS/Unicode
+
1478  info->index_map = cmap + ttULONG(data+encoding_record+4);
+
1479  break;
+
1480  }
+
1481  break;
+
1482  case STBTT_PLATFORM_ID_UNICODE:
+
1483  // Mac/iOS has these
+
1484  // all the encodingIDs are unicode, so we don't bother to check it
+
1485  info->index_map = cmap + ttULONG(data+encoding_record+4);
+
1486  break;
+
1487  }
+
1488  }
+
1489  if (info->index_map == 0)
+
1490  return 0;
+
1491 
+
1492  info->indexToLocFormat = ttUSHORT(data+info->head + 50);
+
1493  return 1;
+
1494 }
+
1495 
+
1496 STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint)
+
1497 {
+
1498  stbtt_uint8 *data = info->data;
+
1499  stbtt_uint32 index_map = info->index_map;
+
1500 
+
1501  stbtt_uint16 format = ttUSHORT(data + index_map + 0);
+
1502  if (format == 0) { // apple byte encoding
+
1503  stbtt_int32 bytes = ttUSHORT(data + index_map + 2);
+
1504  if (unicode_codepoint < bytes-6)
+
1505  return ttBYTE(data + index_map + 6 + unicode_codepoint);
+
1506  return 0;
+
1507  } else if (format == 6) {
+
1508  stbtt_uint32 first = ttUSHORT(data + index_map + 6);
+
1509  stbtt_uint32 count = ttUSHORT(data + index_map + 8);
+
1510  if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count)
+
1511  return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2);
+
1512  return 0;
+
1513  } else if (format == 2) {
+
1514  STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean
+
1515  return 0;
+
1516  } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges
+
1517  stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1;
+
1518  stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1;
+
1519  stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10);
+
1520  stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1;
+
1521 
+
1522  // do a binary search of the segments
+
1523  stbtt_uint32 endCount = index_map + 14;
+
1524  stbtt_uint32 search = endCount;
+
1525 
+
1526  if (unicode_codepoint > 0xffff)
+
1527  return 0;
+
1528 
+
1529  // they lie from endCount .. endCount + segCount
+
1530  // but searchRange is the nearest power of two, so...
+
1531  if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2))
+
1532  search += rangeShift*2;
+
1533 
+
1534  // now decrement to bias correctly to find smallest
+
1535  search -= 2;
+
1536  while (entrySelector) {
+
1537  stbtt_uint16 end;
+
1538  searchRange >>= 1;
+
1539  end = ttUSHORT(data + search + searchRange*2);
+
1540  if (unicode_codepoint > end)
+
1541  search += searchRange*2;
+
1542  --entrySelector;
+
1543  }
+
1544  search += 2;
+
1545 
+
1546  {
+
1547  stbtt_uint16 offset, start, last;
+
1548  stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1);
+
1549 
+
1550  start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
+
1551  last = ttUSHORT(data + endCount + 2*item);
+
1552  if (unicode_codepoint < start || unicode_codepoint > last)
+
1553  return 0;
+
1554 
+
1555  offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
+
1556  if (offset == 0)
+
1557  return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item));
+
1558 
+
1559  return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item);
+
1560  }
+
1561  } else if (format == 12 || format == 13) {
+
1562  stbtt_uint32 ngroups = ttULONG(data+index_map+12);
+
1563  stbtt_int32 low,high;
+
1564  low = 0; high = (stbtt_int32)ngroups;
+
1565  // Binary search the right group.
+
1566  while (low < high) {
+
1567  stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high
+
1568  stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12);
+
1569  stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4);
+
1570  if ((stbtt_uint32) unicode_codepoint < start_char)
+
1571  high = mid;
+
1572  else if ((stbtt_uint32) unicode_codepoint > end_char)
+
1573  low = mid+1;
+
1574  else {
+
1575  stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8);
+
1576  if (format == 12)
+
1577  return start_glyph + unicode_codepoint-start_char;
+
1578  else // format == 13
+
1579  return start_glyph;
+
1580  }
+
1581  }
+
1582  return 0; // not found
+
1583  }
+
1584  // @TODO
+
1585  STBTT_assert(0);
+
1586  return 0;
+
1587 }
+
1588 
+
1589 STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices)
+
1590 {
+
1591  return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices);
+
1592 }
+
1593 
+
1594 static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy)
+
1595 {
+
1596  v->type = type;
+
1597  v->x = (stbtt_int16) x;
+
1598  v->y = (stbtt_int16) y;
+
1599  v->cx = (stbtt_int16) cx;
+
1600  v->cy = (stbtt_int16) cy;
+
1601 }
+
1602 
+
1603 static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index)
+
1604 {
+
1605  int g1,g2;
+
1606 
+
1607  STBTT_assert(!info->cff.size);
+
1608 
+
1609  if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range
+
1610  if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format
+
1611 
+
1612  if (info->indexToLocFormat == 0) {
+
1613  g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2;
+
1614  g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2;
+
1615  } else {
+
1616  g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4);
+
1617  g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4);
+
1618  }
+
1619 
+
1620  return g1==g2 ? -1 : g1; // if length is 0, return -1
+
1621 }
+
1622 
+
1623 static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1);
+
1624 
+
1625 STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1)
+
1626 {
+
1627  if (info->cff.size) {
+
1628  stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1);
+
1629  } else {
+
1630  int g = stbtt__GetGlyfOffset(info, glyph_index);
+
1631  if (g < 0) return 0;
+
1632 
+
1633  if (x0) *x0 = ttSHORT(info->data + g + 2);
+
1634  if (y0) *y0 = ttSHORT(info->data + g + 4);
+
1635  if (x1) *x1 = ttSHORT(info->data + g + 6);
+
1636  if (y1) *y1 = ttSHORT(info->data + g + 8);
+
1637  }
+
1638  return 1;
+
1639 }
+
1640 
+
1641 STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1)
+
1642 {
+
1643  return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1);
+
1644 }
+
1645 
+
1646 STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index)
+
1647 {
+
1648  stbtt_int16 numberOfContours;
+
1649  int g;
+
1650  if (info->cff.size)
+
1651  return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0;
+
1652  g = stbtt__GetGlyfOffset(info, glyph_index);
+
1653  if (g < 0) return 1;
+
1654  numberOfContours = ttSHORT(info->data + g);
+
1655  return numberOfContours == 0;
+
1656 }
+
1657 
+
1658 static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off,
+
1659  stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy)
+
1660 {
+
1661  if (start_off) {
+
1662  if (was_off)
+
1663  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy);
+
1664  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy);
+
1665  } else {
+
1666  if (was_off)
+
1667  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy);
+
1668  else
+
1669  stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0);
+
1670  }
+
1671  return num_vertices;
+
1672 }
+
1673 
+
1674 static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices)
+
1675 {
+
1676  stbtt_int16 numberOfContours;
+
1677  stbtt_uint8 *endPtsOfContours;
+
1678  stbtt_uint8 *data = info->data;
+
1679  stbtt_vertex *vertices=0;
+
1680  int num_vertices=0;
+
1681  int g = stbtt__GetGlyfOffset(info, glyph_index);
+
1682 
+
1683  *pvertices = NULL;
+
1684 
+
1685  if (g < 0) return 0;
+
1686 
+
1687  numberOfContours = ttSHORT(data + g);
+
1688 
+
1689  if (numberOfContours > 0) {
+
1690  stbtt_uint8 flags=0,flagcount;
+
1691  stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0;
+
1692  stbtt_int32 x,y,cx,cy,sx,sy, scx,scy;
+
1693  stbtt_uint8 *points;
+
1694  endPtsOfContours = (data + g + 10);
+
1695  ins = ttUSHORT(data + g + 10 + numberOfContours * 2);
+
1696  points = data + g + 10 + numberOfContours * 2 + 2 + ins;
+
1697 
+
1698  n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2);
+
1699 
+
1700  m = n + 2*numberOfContours; // a loose bound on how many vertices we might need
+
1701  vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata);
+
1702  if (vertices == 0)
+
1703  return 0;
+
1704 
+
1705  next_move = 0;
+
1706  flagcount=0;
+
1707 
+
1708  // in first pass, we load uninterpreted data into the allocated array
+
1709  // above, shifted to the end of the array so we won't overwrite it when
+
1710  // we create our final data starting from the front
+
1711 
+
1712  off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated
+
1713 
+
1714  // first load flags
+
1715 
+
1716  for (i=0; i < n; ++i) {
+
1717  if (flagcount == 0) {
+
1718  flags = *points++;
+
1719  if (flags & 8)
+
1720  flagcount = *points++;
+
1721  } else
+
1722  --flagcount;
+
1723  vertices[off+i].type = flags;
+
1724  }
+
1725 
+
1726  // now load x coordinates
+
1727  x=0;
+
1728  for (i=0; i < n; ++i) {
+
1729  flags = vertices[off+i].type;
+
1730  if (flags & 2) {
+
1731  stbtt_int16 dx = *points++;
+
1732  x += (flags & 16) ? dx : -dx; // ???
+
1733  } else {
+
1734  if (!(flags & 16)) {
+
1735  x = x + (stbtt_int16) (points[0]*256 + points[1]);
+
1736  points += 2;
+
1737  }
+
1738  }
+
1739  vertices[off+i].x = (stbtt_int16) x;
+
1740  }
+
1741 
+
1742  // now load y coordinates
+
1743  y=0;
+
1744  for (i=0; i < n; ++i) {
+
1745  flags = vertices[off+i].type;
+
1746  if (flags & 4) {
+
1747  stbtt_int16 dy = *points++;
+
1748  y += (flags & 32) ? dy : -dy; // ???
+
1749  } else {
+
1750  if (!(flags & 32)) {
+
1751  y = y + (stbtt_int16) (points[0]*256 + points[1]);
+
1752  points += 2;
+
1753  }
+
1754  }
+
1755  vertices[off+i].y = (stbtt_int16) y;
+
1756  }
+
1757 
+
1758  // now convert them to our format
+
1759  num_vertices=0;
+
1760  sx = sy = cx = cy = scx = scy = 0;
+
1761  for (i=0; i < n; ++i) {
+
1762  flags = vertices[off+i].type;
+
1763  x = (stbtt_int16) vertices[off+i].x;
+
1764  y = (stbtt_int16) vertices[off+i].y;
+
1765 
+
1766  if (next_move == i) {
+
1767  if (i != 0)
+
1768  num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
+
1769 
+
1770  // now start the new one
+
1771  start_off = !(flags & 1);
+
1772  if (start_off) {
+
1773  // if we start off with an off-curve point, then when we need to find a point on the curve
+
1774  // where we can start, and we need to save some state for when we wraparound.
+
1775  scx = x;
+
1776  scy = y;
+
1777  if (!(vertices[off+i+1].type & 1)) {
+
1778  // next point is also a curve point, so interpolate an on-point curve
+
1779  sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1;
+
1780  sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1;
+
1781  } else {
+
1782  // otherwise just use the next point as our start point
+
1783  sx = (stbtt_int32) vertices[off+i+1].x;
+
1784  sy = (stbtt_int32) vertices[off+i+1].y;
+
1785  ++i; // we're using point i+1 as the starting point, so skip it
+
1786  }
+
1787  } else {
+
1788  sx = x;
+
1789  sy = y;
+
1790  }
+
1791  stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0);
+
1792  was_off = 0;
+
1793  next_move = 1 + ttUSHORT(endPtsOfContours+j*2);
+
1794  ++j;
+
1795  } else {
+
1796  if (!(flags & 1)) { // if it's a curve
+
1797  if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint
+
1798  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy);
+
1799  cx = x;
+
1800  cy = y;
+
1801  was_off = 1;
+
1802  } else {
+
1803  if (was_off)
+
1804  stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy);
+
1805  else
+
1806  stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0);
+
1807  was_off = 0;
+
1808  }
+
1809  }
+
1810  }
+
1811  num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
+
1812  } else if (numberOfContours < 0) {
+
1813  // Compound shapes.
+
1814  int more = 1;
+
1815  stbtt_uint8 *comp = data + g + 10;
+
1816  num_vertices = 0;
+
1817  vertices = 0;
+
1818  while (more) {
+
1819  stbtt_uint16 flags, gidx;
+
1820  int comp_num_verts = 0, i;
+
1821  stbtt_vertex *comp_verts = 0, *tmp = 0;
+
1822  float mtx[6] = {1,0,0,1,0,0}, m, n;
+
1823 
+
1824  flags = ttSHORT(comp); comp+=2;
+
1825  gidx = ttSHORT(comp); comp+=2;
+
1826 
+
1827  if (flags & 2) { // XY values
+
1828  if (flags & 1) { // shorts
+
1829  mtx[4] = ttSHORT(comp); comp+=2;
+
1830  mtx[5] = ttSHORT(comp); comp+=2;
+
1831  } else {
+
1832  mtx[4] = ttCHAR(comp); comp+=1;
+
1833  mtx[5] = ttCHAR(comp); comp+=1;
+
1834  }
+
1835  }
+
1836  else {
+
1837  // @TODO handle matching point
+
1838  STBTT_assert(0);
+
1839  }
+
1840  if (flags & (1<<3)) { // WE_HAVE_A_SCALE
+
1841  mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
+
1842  mtx[1] = mtx[2] = 0;
+
1843  } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE
+
1844  mtx[0] = ttSHORT(comp)/16384.0f; comp+=2;
+
1845  mtx[1] = mtx[2] = 0;
+
1846  mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
+
1847  } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO
+
1848  mtx[0] = ttSHORT(comp)/16384.0f; comp+=2;
+
1849  mtx[1] = ttSHORT(comp)/16384.0f; comp+=2;
+
1850  mtx[2] = ttSHORT(comp)/16384.0f; comp+=2;
+
1851  mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
+
1852  }
+
1853 
+
1854  // Find transformation scales.
+
1855  m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]);
+
1856  n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]);
+
1857 
+
1858  // Get indexed glyph.
+
1859  comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts);
+
1860  if (comp_num_verts > 0) {
+
1861  // Transform vertices.
+
1862  for (i = 0; i < comp_num_verts; ++i) {
+
1863  stbtt_vertex* v = &comp_verts[i];
+
1864  stbtt_vertex_type x,y;
+
1865  x=v->x; y=v->y;
+
1866  v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
+
1867  v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
+
1868  x=v->cx; y=v->cy;
+
1869  v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
+
1870  v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
+
1871  }
+
1872  // Append vertices.
+
1873  tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata);
+
1874  if (!tmp) {
+
1875  if (vertices) STBTT_free(vertices, info->userdata);
+
1876  if (comp_verts) STBTT_free(comp_verts, info->userdata);
+
1877  return 0;
+
1878  }
+
1879  if (num_vertices > 0 && vertices) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex));
+
1880  STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex));
+
1881  if (vertices) STBTT_free(vertices, info->userdata);
+
1882  vertices = tmp;
+
1883  STBTT_free(comp_verts, info->userdata);
+
1884  num_vertices += comp_num_verts;
+
1885  }
+
1886  // More components ?
+
1887  more = flags & (1<<5);
+
1888  }
+
1889  } else {
+
1890  // numberOfCounters == 0, do nothing
+
1891  }
+
1892 
+
1893  *pvertices = vertices;
+
1894  return num_vertices;
+
1895 }
+
1896 
+
1897 typedef struct
+
1898 {
+
1899  int bounds;
+
1900  int started;
+
1901  float first_x, first_y;
+
1902  float x, y;
+
1903  stbtt_int32 min_x, max_x, min_y, max_y;
+
1904 
+
1905  stbtt_vertex *pvertices;
+
1906  int num_vertices;
+
1907 } stbtt__csctx;
+
1908 
+
1909 #define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0}
+
1910 
+
1911 static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y)
+
1912 {
+
1913  if (x > c->max_x || !c->started) c->max_x = x;
+
1914  if (y > c->max_y || !c->started) c->max_y = y;
+
1915  if (x < c->min_x || !c->started) c->min_x = x;
+
1916  if (y < c->min_y || !c->started) c->min_y = y;
+
1917  c->started = 1;
+
1918 }
+
1919 
+
1920 static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1)
+
1921 {
+
1922  if (c->bounds) {
+
1923  stbtt__track_vertex(c, x, y);
+
1924  if (type == STBTT_vcubic) {
+
1925  stbtt__track_vertex(c, cx, cy);
+
1926  stbtt__track_vertex(c, cx1, cy1);
+
1927  }
+
1928  } else {
+
1929  stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy);
+
1930  c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1;
+
1931  c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1;
+
1932  }
+
1933  c->num_vertices++;
+
1934 }
+
1935 
+
1936 static void stbtt__csctx_close_shape(stbtt__csctx *ctx)
+
1937 {
+
1938  if (ctx->first_x != ctx->x || ctx->first_y != ctx->y)
+
1939  stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0);
+
1940 }
+
1941 
+
1942 static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy)
+
1943 {
+
1944  stbtt__csctx_close_shape(ctx);
+
1945  ctx->first_x = ctx->x = ctx->x + dx;
+
1946  ctx->first_y = ctx->y = ctx->y + dy;
+
1947  stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);
+
1948 }
+
1949 
+
1950 static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy)
+
1951 {
+
1952  ctx->x += dx;
+
1953  ctx->y += dy;
+
1954  stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);
+
1955 }
+
1956 
+
1957 static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3)
+
1958 {
+
1959  float cx1 = ctx->x + dx1;
+
1960  float cy1 = ctx->y + dy1;
+
1961  float cx2 = cx1 + dx2;
+
1962  float cy2 = cy1 + dy2;
+
1963  ctx->x = cx2 + dx3;
+
1964  ctx->y = cy2 + dy3;
+
1965  stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2);
+
1966 }
+
1967 
+
1968 static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n)
+
1969 {
+
1970  int count = stbtt__cff_index_count(&idx);
+
1971  int bias = 107;
+
1972  if (count >= 33900)
+
1973  bias = 32768;
+
1974  else if (count >= 1240)
+
1975  bias = 1131;
+
1976  n += bias;
+
1977  if (n < 0 || n >= count)
+
1978  return stbtt__new_buf(NULL, 0);
+
1979  return stbtt__cff_index_get(idx, n);
+
1980 }
+
1981 
+
1982 static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index)
+
1983 {
+
1984  stbtt__buf fdselect = info->fdselect;
+
1985  int nranges, start, end, v, fmt, fdselector = -1, i;
+
1986 
+
1987  stbtt__buf_seek(&fdselect, 0);
+
1988  fmt = stbtt__buf_get8(&fdselect);
+
1989  if (fmt == 0) {
+
1990  // untested
+
1991  stbtt__buf_skip(&fdselect, glyph_index);
+
1992  fdselector = stbtt__buf_get8(&fdselect);
+
1993  } else if (fmt == 3) {
+
1994  nranges = stbtt__buf_get16(&fdselect);
+
1995  start = stbtt__buf_get16(&fdselect);
+
1996  for (i = 0; i < nranges; i++) {
+
1997  v = stbtt__buf_get8(&fdselect);
+
1998  end = stbtt__buf_get16(&fdselect);
+
1999  if (glyph_index >= start && glyph_index < end) {
+
2000  fdselector = v;
+
2001  break;
+
2002  }
+
2003  start = end;
+
2004  }
+
2005  }
+
2006  if (fdselector == -1) stbtt__new_buf(NULL, 0);
+
2007  return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector));
+
2008 }
+
2009 
+
2010 static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c)
+
2011 {
+
2012  int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0;
+
2013  int has_subrs = 0, clear_stack;
+
2014  float s[48];
+
2015  stbtt__buf subr_stack[10], subrs = info->subrs, b;
+
2016  float f;
+
2017 
+
2018 #define STBTT__CSERR(s) (0)
+
2019 
+
2020  // this currently ignores the initial width value, which isn't needed if we have hmtx
+
2021  b = stbtt__cff_index_get(info->charstrings, glyph_index);
+
2022  while (b.cursor < b.size) {
+
2023  i = 0;
+
2024  clear_stack = 1;
+
2025  b0 = stbtt__buf_get8(&b);
+
2026  switch (b0) {
+
2027  // @TODO implement hinting
+
2028  case 0x13: // hintmask
+
2029  case 0x14: // cntrmask
+
2030  if (in_header)
+
2031  maskbits += (sp / 2); // implicit "vstem"
+
2032  in_header = 0;
+
2033  stbtt__buf_skip(&b, (maskbits + 7) / 8);
+
2034  break;
+
2035 
+
2036  case 0x01: // hstem
+
2037  case 0x03: // vstem
+
2038  case 0x12: // hstemhm
+
2039  case 0x17: // vstemhm
+
2040  maskbits += (sp / 2);
+
2041  break;
+
2042 
+
2043  case 0x15: // rmoveto
+
2044  in_header = 0;
+
2045  if (sp < 2) return STBTT__CSERR("rmoveto stack");
+
2046  stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]);
+
2047  break;
+
2048  case 0x04: // vmoveto
+
2049  in_header = 0;
+
2050  if (sp < 1) return STBTT__CSERR("vmoveto stack");
+
2051  stbtt__csctx_rmove_to(c, 0, s[sp-1]);
+
2052  break;
+
2053  case 0x16: // hmoveto
+
2054  in_header = 0;
+
2055  if (sp < 1) return STBTT__CSERR("hmoveto stack");
+
2056  stbtt__csctx_rmove_to(c, s[sp-1], 0);
+
2057  break;
+
2058 
+
2059  case 0x05: // rlineto
+
2060  if (sp < 2) return STBTT__CSERR("rlineto stack");
+
2061  for (; i + 1 < sp; i += 2)
+
2062  stbtt__csctx_rline_to(c, s[i], s[i+1]);
+
2063  break;
+
2064 
+
2065  // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical
+
2066  // starting from a different place.
+
2067 
+
2068  case 0x07: // vlineto
+
2069  if (sp < 1) return STBTT__CSERR("vlineto stack");
+
2070  goto vlineto;
+
2071  case 0x06: // hlineto
+
2072  if (sp < 1) return STBTT__CSERR("hlineto stack");
+
2073  for (;;) {
+
2074  if (i >= sp) break;
+
2075  stbtt__csctx_rline_to(c, s[i], 0);
+
2076  i++;
+
2077  vlineto:
+
2078  if (i >= sp) break;
+
2079  stbtt__csctx_rline_to(c, 0, s[i]);
+
2080  i++;
+
2081  }
+
2082  break;
+
2083 
+
2084  case 0x1F: // hvcurveto
+
2085  if (sp < 4) return STBTT__CSERR("hvcurveto stack");
+
2086  goto hvcurveto;
+
2087  case 0x1E: // vhcurveto
+
2088  if (sp < 4) return STBTT__CSERR("vhcurveto stack");
+
2089  for (;;) {
+
2090  if (i + 3 >= sp) break;
+
2091  stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f);
+
2092  i += 4;
+
2093  hvcurveto:
+
2094  if (i + 3 >= sp) break;
+
2095  stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]);
+
2096  i += 4;
+
2097  }
+
2098  break;
+
2099 
+
2100  case 0x08: // rrcurveto
+
2101  if (sp < 6) return STBTT__CSERR("rcurveline stack");
+
2102  for (; i + 5 < sp; i += 6)
+
2103  stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]);
+
2104  break;
+
2105 
+
2106  case 0x18: // rcurveline
+
2107  if (sp < 8) return STBTT__CSERR("rcurveline stack");
+
2108  for (; i + 5 < sp - 2; i += 6)
+
2109  stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]);
+
2110  if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack");
+
2111  stbtt__csctx_rline_to(c, s[i], s[i+1]);
+
2112  break;
+
2113 
+
2114  case 0x19: // rlinecurve
+
2115  if (sp < 8) return STBTT__CSERR("rlinecurve stack");
+
2116  for (; i + 1 < sp - 6; i += 2)
+
2117  stbtt__csctx_rline_to(c, s[i], s[i+1]);
+
2118  if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack");
+
2119  stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]);
+
2120  break;
+
2121 
+
2122  case 0x1A: // vvcurveto
+
2123  case 0x1B: // hhcurveto
+
2124  if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack");
+
2125  f = 0.0;
+
2126  if (sp & 1) { f = s[i]; i++; }
+
2127  for (; i + 3 < sp; i += 4) {
+
2128  if (b0 == 0x1B)
+
2129  stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0);
+
2130  else
+
2131  stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]);
+
2132  f = 0.0;
+
2133  }
+
2134  break;
+
2135 
+
2136  case 0x0A: // callsubr
+
2137  if (!has_subrs) {
+
2138  if (info->fdselect.size)
+
2139  subrs = stbtt__cid_get_glyph_subrs(info, glyph_index);
+
2140  has_subrs = 1;
+
2141  }
+
2142  // FALLTHROUGH
+
2143  case 0x1D: // callgsubr
+
2144  if (sp < 1) return STBTT__CSERR("call(g|)subr stack");
+
2145  v = (int) s[--sp];
+
2146  if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit");
+
2147  subr_stack[subr_stack_height++] = b;
+
2148  b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v);
+
2149  if (b.size == 0) return STBTT__CSERR("subr not found");
+
2150  b.cursor = 0;
+
2151  clear_stack = 0;
+
2152  break;
+
2153 
+
2154  case 0x0B: // return
+
2155  if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr");
+
2156  b = subr_stack[--subr_stack_height];
+
2157  clear_stack = 0;
+
2158  break;
+
2159 
+
2160  case 0x0E: // endchar
+
2161  stbtt__csctx_close_shape(c);
+
2162  return 1;
+
2163 
+
2164  case 0x0C: { // two-byte escape
+
2165  float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6;
+
2166  float dx, dy;
+
2167  int b1 = stbtt__buf_get8(&b);
+
2168  switch (b1) {
+
2169  // @TODO These "flex" implementations ignore the flex-depth and resolution,
+
2170  // and always draw beziers.
+
2171  case 0x22: // hflex
+
2172  if (sp < 7) return STBTT__CSERR("hflex stack");
+
2173  dx1 = s[0];
+
2174  dx2 = s[1];
+
2175  dy2 = s[2];
+
2176  dx3 = s[3];
+
2177  dx4 = s[4];
+
2178  dx5 = s[5];
+
2179  dx6 = s[6];
+
2180  stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0);
+
2181  stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0);
+
2182  break;
+
2183 
+
2184  case 0x23: // flex
+
2185  if (sp < 13) return STBTT__CSERR("flex stack");
+
2186  dx1 = s[0];
+
2187  dy1 = s[1];
+
2188  dx2 = s[2];
+
2189  dy2 = s[3];
+
2190  dx3 = s[4];
+
2191  dy3 = s[5];
+
2192  dx4 = s[6];
+
2193  dy4 = s[7];
+
2194  dx5 = s[8];
+
2195  dy5 = s[9];
+
2196  dx6 = s[10];
+
2197  dy6 = s[11];
+
2198  //fd is s[12]
+
2199  stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3);
+
2200  stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6);
+
2201  break;
+
2202 
+
2203  case 0x24: // hflex1
+
2204  if (sp < 9) return STBTT__CSERR("hflex1 stack");
+
2205  dx1 = s[0];
+
2206  dy1 = s[1];
+
2207  dx2 = s[2];
+
2208  dy2 = s[3];
+
2209  dx3 = s[4];
+
2210  dx4 = s[5];
+
2211  dx5 = s[6];
+
2212  dy5 = s[7];
+
2213  dx6 = s[8];
+
2214  stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0);
+
2215  stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5));
+
2216  break;
+
2217 
+
2218  case 0x25: // flex1
+
2219  if (sp < 11) return STBTT__CSERR("flex1 stack");
+
2220  dx1 = s[0];
+
2221  dy1 = s[1];
+
2222  dx2 = s[2];
+
2223  dy2 = s[3];
+
2224  dx3 = s[4];
+
2225  dy3 = s[5];
+
2226  dx4 = s[6];
+
2227  dy4 = s[7];
+
2228  dx5 = s[8];
+
2229  dy5 = s[9];
+
2230  dx6 = dy6 = s[10];
+
2231  dx = dx1+dx2+dx3+dx4+dx5;
+
2232  dy = dy1+dy2+dy3+dy4+dy5;
+
2233  if (STBTT_fabs(dx) > STBTT_fabs(dy))
+
2234  dy6 = -dy;
+
2235  else
+
2236  dx6 = -dx;
+
2237  stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3);
+
2238  stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6);
+
2239  break;
+
2240 
+
2241  default:
+
2242  return STBTT__CSERR("unimplemented");
+
2243  }
+
2244  } break;
+
2245 
+
2246  default:
+
2247  if (b0 != 255 && b0 != 28 && b0 < 32)
+
2248  return STBTT__CSERR("reserved operator");
+
2249 
+
2250  // push immediate
+
2251  if (b0 == 255) {
+
2252  f = (float)(stbtt_int32)stbtt__buf_get32(&b) / 0x10000;
+
2253  } else {
+
2254  stbtt__buf_skip(&b, -1);
+
2255  f = (float)(stbtt_int16)stbtt__cff_int(&b);
+
2256  }
+
2257  if (sp >= 48) return STBTT__CSERR("push stack overflow");
+
2258  s[sp++] = f;
+
2259  clear_stack = 0;
+
2260  break;
+
2261  }
+
2262  if (clear_stack) sp = 0;
+
2263  }
+
2264  return STBTT__CSERR("no endchar");
+
2265 
+
2266 #undef STBTT__CSERR
+
2267 }
+
2268 
+
2269 static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices)
+
2270 {
+
2271  // runs the charstring twice, once to count and once to output (to avoid realloc)
+
2272  stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1);
+
2273  stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0);
+
2274  if (stbtt__run_charstring(info, glyph_index, &count_ctx)) {
+
2275  *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata);
+
2276  output_ctx.pvertices = *pvertices;
+
2277  if (stbtt__run_charstring(info, glyph_index, &output_ctx)) {
+
2278  STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices);
+
2279  return output_ctx.num_vertices;
+
2280  }
+
2281  }
+
2282  *pvertices = NULL;
+
2283  return 0;
+
2284 }
+
2285 
+
2286 static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1)
+
2287 {
+
2288  stbtt__csctx c = STBTT__CSCTX_INIT(1);
+
2289  int r = stbtt__run_charstring(info, glyph_index, &c);
+
2290  if (x0) *x0 = r ? c.min_x : 0;
+
2291  if (y0) *y0 = r ? c.min_y : 0;
+
2292  if (x1) *x1 = r ? c.max_x : 0;
+
2293  if (y1) *y1 = r ? c.max_y : 0;
+
2294  return r ? c.num_vertices : 0;
+
2295 }
+
2296 
+
2297 STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices)
+
2298 {
+
2299  if (!info->cff.size)
+
2300  return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices);
+
2301  else
+
2302  return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices);
+
2303 }
+
2304 
+
2305 STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing)
+
2306 {
+
2307  stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34);
+
2308  if (glyph_index < numOfLongHorMetrics) {
+
2309  if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index);
+
2310  if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2);
+
2311  } else {
+
2312  if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1));
+
2313  if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics));
+
2314  }
+
2315 }
+
2316 
+
2317 STBTT_DEF int stbtt_GetKerningTableLength(const stbtt_fontinfo *info)
+
2318 {
+
2319  stbtt_uint8 *data = info->data + info->kern;
+
2320 
+
2321  // we only look at the first table. it must be 'horizontal' and format 0.
+
2322  if (!info->kern)
+
2323  return 0;
+
2324  if (ttUSHORT(data+2) < 1) // number of tables, need at least 1
+
2325  return 0;
+
2326  if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format
+
2327  return 0;
+
2328 
+
2329  return ttUSHORT(data+10);
+
2330 }
+
2331 
+
2332 STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningentry* table, int table_length)
+
2333 {
+
2334  stbtt_uint8 *data = info->data + info->kern;
+
2335  int k, length;
+
2336 
+
2337  // we only look at the first table. it must be 'horizontal' and format 0.
+
2338  if (!info->kern)
+
2339  return 0;
+
2340  if (ttUSHORT(data+2) < 1) // number of tables, need at least 1
+
2341  return 0;
+
2342  if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format
+
2343  return 0;
+
2344 
+
2345  length = ttUSHORT(data+10);
+
2346  if (table_length < length)
+
2347  length = table_length;
+
2348 
+
2349  for (k = 0; k < length; k++)
+
2350  {
+
2351  table[k].glyph1 = ttUSHORT(data+18+(k*6));
+
2352  table[k].glyph2 = ttUSHORT(data+20+(k*6));
+
2353  table[k].advance = ttSHORT(data+22+(k*6));
+
2354  }
+
2355 
+
2356  return length;
+
2357 }
+
2358 
+
2359 static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
+
2360 {
+
2361  stbtt_uint8 *data = info->data + info->kern;
+
2362  stbtt_uint32 needle, straw;
+
2363  int l, r, m;
+
2364 
+
2365  // we only look at the first table. it must be 'horizontal' and format 0.
+
2366  if (!info->kern)
+
2367  return 0;
+
2368  if (ttUSHORT(data+2) < 1) // number of tables, need at least 1
+
2369  return 0;
+
2370  if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format
+
2371  return 0;
+
2372 
+
2373  l = 0;
+
2374  r = ttUSHORT(data+10) - 1;
+
2375  needle = glyph1 << 16 | glyph2;
+
2376  while (l <= r) {
+
2377  m = (l + r) >> 1;
+
2378  straw = ttULONG(data+18+(m*6)); // note: unaligned read
+
2379  if (needle < straw)
+
2380  r = m - 1;
+
2381  else if (needle > straw)
+
2382  l = m + 1;
+
2383  else
+
2384  return ttSHORT(data+22+(m*6));
+
2385  }
+
2386  return 0;
+
2387 }
+
2388 
+
2389 static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph)
+
2390 {
+
2391  stbtt_uint16 coverageFormat = ttUSHORT(coverageTable);
+
2392  switch (coverageFormat) {
+
2393  case 1: {
+
2394  stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2);
+
2395 
+
2396  // Binary search.
+
2397  stbtt_int32 l=0, r=glyphCount-1, m;
+
2398  int straw, needle=glyph;
+
2399  while (l <= r) {
+
2400  stbtt_uint8 *glyphArray = coverageTable + 4;
+
2401  stbtt_uint16 glyphID;
+
2402  m = (l + r) >> 1;
+
2403  glyphID = ttUSHORT(glyphArray + 2 * m);
+
2404  straw = glyphID;
+
2405  if (needle < straw)
+
2406  r = m - 1;
+
2407  else if (needle > straw)
+
2408  l = m + 1;
+
2409  else {
+
2410  return m;
+
2411  }
+
2412  }
+
2413  break;
+
2414  }
+
2415 
+
2416  case 2: {
+
2417  stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2);
+
2418  stbtt_uint8 *rangeArray = coverageTable + 4;
+
2419 
+
2420  // Binary search.
+
2421  stbtt_int32 l=0, r=rangeCount-1, m;
+
2422  int strawStart, strawEnd, needle=glyph;
+
2423  while (l <= r) {
+
2424  stbtt_uint8 *rangeRecord;
+
2425  m = (l + r) >> 1;
+
2426  rangeRecord = rangeArray + 6 * m;
+
2427  strawStart = ttUSHORT(rangeRecord);
+
2428  strawEnd = ttUSHORT(rangeRecord + 2);
+
2429  if (needle < strawStart)
+
2430  r = m - 1;
+
2431  else if (needle > strawEnd)
+
2432  l = m + 1;
+
2433  else {
+
2434  stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4);
+
2435  return startCoverageIndex + glyph - strawStart;
+
2436  }
+
2437  }
+
2438  break;
+
2439  }
+
2440 
+
2441  default: return -1; // unsupported
+
2442  }
+
2443 
+
2444  return -1;
+
2445 }
+
2446 
+
2447 static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
+
2448 {
+
2449  stbtt_uint16 classDefFormat = ttUSHORT(classDefTable);
+
2450  switch (classDefFormat)
+
2451  {
+
2452  case 1: {
+
2453  stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2);
+
2454  stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4);
+
2455  stbtt_uint8 *classDef1ValueArray = classDefTable + 6;
+
2456 
+
2457  if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
+
2458  return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
+
2459  break;
+
2460  }
+
2461 
+
2462  case 2: {
+
2463  stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2);
+
2464  stbtt_uint8 *classRangeRecords = classDefTable + 4;
+
2465 
+
2466  // Binary search.
+
2467  stbtt_int32 l=0, r=classRangeCount-1, m;
+
2468  int strawStart, strawEnd, needle=glyph;
+
2469  while (l <= r) {
+
2470  stbtt_uint8 *classRangeRecord;
+
2471  m = (l + r) >> 1;
+
2472  classRangeRecord = classRangeRecords + 6 * m;
+
2473  strawStart = ttUSHORT(classRangeRecord);
+
2474  strawEnd = ttUSHORT(classRangeRecord + 2);
+
2475  if (needle < strawStart)
+
2476  r = m - 1;
+
2477  else if (needle > strawEnd)
+
2478  l = m + 1;
+
2479  else
+
2480  return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
+
2481  }
+
2482  break;
+
2483  }
+
2484 
+
2485  default:
+
2486  return -1; // Unsupported definition type, return an error.
+
2487  }
+
2488 
+
2489  // "All glyphs not assigned to a class fall into class 0". (OpenType spec)
+
2490  return 0;
+
2491 }
+
2492 
+
2493 // Define to STBTT_assert(x) if you want to break on unimplemented formats.
+
2494 #define STBTT_GPOS_TODO_assert(x)
+
2495 
+
2496 static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
+
2497 {
+
2498  stbtt_uint16 lookupListOffset;
+
2499  stbtt_uint8 *lookupList;
+
2500  stbtt_uint16 lookupCount;
+
2501  stbtt_uint8 *data;
+
2502  stbtt_int32 i, sti;
+
2503 
+
2504  if (!info->gpos) return 0;
+
2505 
+
2506  data = info->data + info->gpos;
+
2507 
+
2508  if (ttUSHORT(data+0) != 1) return 0; // Major version 1
+
2509  if (ttUSHORT(data+2) != 0) return 0; // Minor version 0
+
2510 
+
2511  lookupListOffset = ttUSHORT(data+8);
+
2512  lookupList = data + lookupListOffset;
+
2513  lookupCount = ttUSHORT(lookupList);
+
2514 
+
2515  for (i=0; i<lookupCount; ++i) {
+
2516  stbtt_uint16 lookupOffset = ttUSHORT(lookupList + 2 + 2 * i);
+
2517  stbtt_uint8 *lookupTable = lookupList + lookupOffset;
+
2518 
+
2519  stbtt_uint16 lookupType = ttUSHORT(lookupTable);
+
2520  stbtt_uint16 subTableCount = ttUSHORT(lookupTable + 4);
+
2521  stbtt_uint8 *subTableOffsets = lookupTable + 6;
+
2522  if (lookupType != 2) // Pair Adjustment Positioning Subtable
+
2523  continue;
+
2524 
+
2525  for (sti=0; sti<subTableCount; sti++) {
+
2526  stbtt_uint16 subtableOffset = ttUSHORT(subTableOffsets + 2 * sti);
+
2527  stbtt_uint8 *table = lookupTable + subtableOffset;
+
2528  stbtt_uint16 posFormat = ttUSHORT(table);
+
2529  stbtt_uint16 coverageOffset = ttUSHORT(table + 2);
+
2530  stbtt_int32 coverageIndex = stbtt__GetCoverageIndex(table + coverageOffset, glyph1);
+
2531  if (coverageIndex == -1) continue;
+
2532 
+
2533  switch (posFormat) {
+
2534  case 1: {
+
2535  stbtt_int32 l, r, m;
+
2536  int straw, needle;
+
2537  stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
+
2538  stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
+
2539  if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats?
+
2540  stbtt_int32 valueRecordPairSizeInBytes = 2;
+
2541  stbtt_uint16 pairSetCount = ttUSHORT(table + 8);
+
2542  stbtt_uint16 pairPosOffset = ttUSHORT(table + 10 + 2 * coverageIndex);
+
2543  stbtt_uint8 *pairValueTable = table + pairPosOffset;
+
2544  stbtt_uint16 pairValueCount = ttUSHORT(pairValueTable);
+
2545  stbtt_uint8 *pairValueArray = pairValueTable + 2;
+
2546 
+
2547  if (coverageIndex >= pairSetCount) return 0;
+
2548 
+
2549  needle=glyph2;
+
2550  r=pairValueCount-1;
+
2551  l=0;
+
2552 
+
2553  // Binary search.
+
2554  while (l <= r) {
+
2555  stbtt_uint16 secondGlyph;
+
2556  stbtt_uint8 *pairValue;
+
2557  m = (l + r) >> 1;
+
2558  pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m;
+
2559  secondGlyph = ttUSHORT(pairValue);
+
2560  straw = secondGlyph;
+
2561  if (needle < straw)
+
2562  r = m - 1;
+
2563  else if (needle > straw)
+
2564  l = m + 1;
+
2565  else {
+
2566  stbtt_int16 xAdvance = ttSHORT(pairValue + 2);
+
2567  return xAdvance;
+
2568  }
+
2569  }
+
2570  } else
+
2571  return 0;
+
2572  break;
+
2573  }
+
2574 
+
2575  case 2: {
+
2576  stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
+
2577  stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
+
2578  if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats?
+
2579  stbtt_uint16 classDef1Offset = ttUSHORT(table + 8);
+
2580  stbtt_uint16 classDef2Offset = ttUSHORT(table + 10);
+
2581  int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1);
+
2582  int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2);
+
2583 
+
2584  stbtt_uint16 class1Count = ttUSHORT(table + 12);
+
2585  stbtt_uint16 class2Count = ttUSHORT(table + 14);
+
2586  stbtt_uint8 *class1Records, *class2Records;
+
2587  stbtt_int16 xAdvance;
+
2588 
+
2589  if (glyph1class < 0 || glyph1class >= class1Count) return 0; // malformed
+
2590  if (glyph2class < 0 || glyph2class >= class2Count) return 0; // malformed
+
2591 
+
2592  class1Records = table + 16;
+
2593  class2Records = class1Records + 2 * (glyph1class * class2Count);
+
2594  xAdvance = ttSHORT(class2Records + 2 * glyph2class);
+
2595  return xAdvance;
+
2596  } else
+
2597  return 0;
+
2598  break;
+
2599  }
+
2600 
+
2601  default:
+
2602  return 0; // Unsupported position format
+
2603  }
+
2604  }
+
2605  }
+
2606 
+
2607  return 0;
+
2608 }
+
2609 
+
2610 STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2)
+
2611 {
+
2612  int xAdvance = 0;
+
2613 
+
2614  if (info->gpos)
+
2615  xAdvance += stbtt__GetGlyphGPOSInfoAdvance(info, g1, g2);
+
2616  else if (info->kern)
+
2617  xAdvance += stbtt__GetGlyphKernInfoAdvance(info, g1, g2);
+
2618 
+
2619  return xAdvance;
+
2620 }
+
2621 
+
2622 STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2)
+
2623 {
+
2624  if (!info->kern && !info->gpos) // if no kerning table, don't waste time looking up both codepoint->glyphs
+
2625  return 0;
+
2626  return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2));
+
2627 }
+
2628 
+
2629 STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing)
+
2630 {
+
2631  stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing);
+
2632 }
+
2633 
+
2634 STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap)
+
2635 {
+
2636  if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4);
+
2637  if (descent) *descent = ttSHORT(info->data+info->hhea + 6);
+
2638  if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8);
+
2639 }
+
2640 
+
2641 STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap)
+
2642 {
+
2643  int tab = stbtt__find_table(info->data, info->fontstart, "OS/2");
+
2644  if (!tab)
+
2645  return 0;
+
2646  if (typoAscent ) *typoAscent = ttSHORT(info->data+tab + 68);
+
2647  if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70);
+
2648  if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72);
+
2649  return 1;
+
2650 }
+
2651 
+
2652 STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1)
+
2653 {
+
2654  *x0 = ttSHORT(info->data + info->head + 36);
+
2655  *y0 = ttSHORT(info->data + info->head + 38);
+
2656  *x1 = ttSHORT(info->data + info->head + 40);
+
2657  *y1 = ttSHORT(info->data + info->head + 42);
+
2658 }
+
2659 
+
2660 STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height)
+
2661 {
+
2662  int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6);
+
2663  return (float) height / fheight;
+
2664 }
+
2665 
+
2666 STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels)
+
2667 {
+
2668  int unitsPerEm = ttUSHORT(info->data + info->head + 18);
+
2669  return pixels / unitsPerEm;
+
2670 }
+
2671 
+
2672 STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v)
+
2673 {
+
2674  STBTT_free(v, info->userdata);
+
2675 }
+
2676 
+
2677 STBTT_DEF stbtt_uint8 *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl)
+
2678 {
+
2679  int i;
+
2680  stbtt_uint8 *data = info->data;
+
2681  stbtt_uint8 *svg_doc_list = data + stbtt__get_svg((stbtt_fontinfo *) info);
+
2682 
+
2683  int numEntries = ttUSHORT(svg_doc_list);
+
2684  stbtt_uint8 *svg_docs = svg_doc_list + 2;
+
2685 
+
2686  for(i=0; i<numEntries; i++) {
+
2687  stbtt_uint8 *svg_doc = svg_docs + (12 * i);
+
2688  if ((gl >= ttUSHORT(svg_doc)) && (gl <= ttUSHORT(svg_doc + 2)))
+
2689  return svg_doc;
+
2690  }
+
2691  return 0;
+
2692 }
+
2693 
+
2694 STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg)
+
2695 {
+
2696  stbtt_uint8 *data = info->data;
+
2697  stbtt_uint8 *svg_doc;
+
2698 
+
2699  if (info->svg == 0)
+
2700  return 0;
+
2701 
+
2702  svg_doc = stbtt_FindSVGDoc(info, gl);
+
2703  if (svg_doc != NULL) {
+
2704  *svg = (char *) data + info->svg + ttULONG(svg_doc + 4);
+
2705  return ttULONG(svg_doc + 8);
+
2706  } else {
+
2707  return 0;
+
2708  }
+
2709 }
+
2710 
+
2711 STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg)
+
2712 {
+
2713  return stbtt_GetGlyphSVG(info, stbtt_FindGlyphIndex(info, unicode_codepoint), svg);
+
2714 }
+
2715 
+
2717 //
+
2718 // antialiasing software rasterizer
+
2719 //
+
2720 
+
2721 STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1)
+
2722 {
+
2723  int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning
+
2724  if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) {
+
2725  // e.g. space character
+
2726  if (ix0) *ix0 = 0;
+
2727  if (iy0) *iy0 = 0;
+
2728  if (ix1) *ix1 = 0;
+
2729  if (iy1) *iy1 = 0;
+
2730  } else {
+
2731  // move to integral bboxes (treating pixels as little squares, what pixels get touched)?
+
2732  if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x);
+
2733  if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y);
+
2734  if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x);
+
2735  if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y);
+
2736  }
+
2737 }
+
2738 
+
2739 STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1)
+
2740 {
+
2741  stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1);
+
2742 }
+
2743 
+
2744 STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1)
+
2745 {
+
2746  stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1);
+
2747 }
+
2748 
+
2749 STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1)
+
2750 {
+
2751  stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1);
+
2752 }
+
2753 
+
2755 //
+
2756 // Rasterizer
+
2757 
+
2758 typedef struct stbtt__hheap_chunk
+
2759 {
+
2760  struct stbtt__hheap_chunk *next;
+
2761 } stbtt__hheap_chunk;
+
2762 
+
2763 typedef struct stbtt__hheap
+
2764 {
+
2765  struct stbtt__hheap_chunk *head;
+
2766  void *first_free;
+
2767  int num_remaining_in_head_chunk;
+
2768 } stbtt__hheap;
+
2769 
+
2770 static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata)
+
2771 {
+
2772  if (hh->first_free) {
+
2773  void *p = hh->first_free;
+
2774  hh->first_free = * (void **) p;
+
2775  return p;
+
2776  } else {
+
2777  if (hh->num_remaining_in_head_chunk == 0) {
+
2778  int count = (size < 32 ? 2000 : size < 128 ? 800 : 100);
+
2779  stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata);
+
2780  if (c == NULL)
+
2781  return NULL;
+
2782  c->next = hh->head;
+
2783  hh->head = c;
+
2784  hh->num_remaining_in_head_chunk = count;
+
2785  }
+
2786  --hh->num_remaining_in_head_chunk;
+
2787  return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk;
+
2788  }
+
2789 }
+
2790 
+
2791 static void stbtt__hheap_free(stbtt__hheap *hh, void *p)
+
2792 {
+
2793  *(void **) p = hh->first_free;
+
2794  hh->first_free = p;
+
2795 }
+
2796 
+
2797 static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata)
+
2798 {
+
2799  stbtt__hheap_chunk *c = hh->head;
+
2800  while (c) {
+
2801  stbtt__hheap_chunk *n = c->next;
+
2802  STBTT_free(c, userdata);
+
2803  c = n;
+
2804  }
+
2805 }
+
2806 
+
2807 typedef struct stbtt__edge {
+
2808  float x0,y0, x1,y1;
+
2809  int invert;
+
2810 } stbtt__edge;
+
2811 
+
2812 
+
2813 typedef struct stbtt__active_edge
+
2814 {
+
2815  struct stbtt__active_edge *next;
+
2816  #if STBTT_RASTERIZER_VERSION==1
+
2817  int x,dx;
+
2818  float ey;
+
2819  int direction;
+
2820  #elif STBTT_RASTERIZER_VERSION==2
+
2821  float fx,fdx,fdy;
+
2822  float direction;
+
2823  float sy;
+
2824  float ey;
+
2825  #else
+
2826  #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+
2827  #endif
+
2828 } stbtt__active_edge;
+
2829 
+
2830 #if STBTT_RASTERIZER_VERSION == 1
+
2831 #define STBTT_FIXSHIFT 10
+
2832 #define STBTT_FIX (1 << STBTT_FIXSHIFT)
+
2833 #define STBTT_FIXMASK (STBTT_FIX-1)
+
2834 
+
2835 static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata)
+
2836 {
+
2837  stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
+
2838  float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
+
2839  STBTT_assert(z != NULL);
+
2840  if (!z) return z;
+
2841 
+
2842  // round dx down to avoid overshooting
+
2843  if (dxdy < 0)
+
2844  z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy);
+
2845  else
+
2846  z->dx = STBTT_ifloor(STBTT_FIX * dxdy);
+
2847 
+
2848  z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount
+
2849  z->x -= off_x * STBTT_FIX;
+
2850 
+
2851  z->ey = e->y1;
+
2852  z->next = 0;
+
2853  z->direction = e->invert ? 1 : -1;
+
2854  return z;
+
2855 }
+
2856 #elif STBTT_RASTERIZER_VERSION == 2
+
2857 static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata)
+
2858 {
+
2859  stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
+
2860  float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
+
2861  STBTT_assert(z != NULL);
+
2862  //STBTT_assert(e->y0 <= start_point);
+
2863  if (!z) return z;
+
2864  z->fdx = dxdy;
+
2865  z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f;
+
2866  z->fx = e->x0 + dxdy * (start_point - e->y0);
+
2867  z->fx -= off_x;
+
2868  z->direction = e->invert ? 1.0f : -1.0f;
+
2869  z->sy = e->y0;
+
2870  z->ey = e->y1;
+
2871  z->next = 0;
+
2872  return z;
+
2873 }
+
2874 #else
+
2875 #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+
2876 #endif
+
2877 
+
2878 #if STBTT_RASTERIZER_VERSION == 1
+
2879 // note: this routine clips fills that extend off the edges... ideally this
+
2880 // wouldn't happen, but it could happen if the truetype glyph bounding boxes
+
2881 // are wrong, or if the user supplies a too-small bitmap
+
2882 static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight)
+
2883 {
+
2884  // non-zero winding fill
+
2885  int x0=0, w=0;
+
2886 
+
2887  while (e) {
+
2888  if (w == 0) {
+
2889  // if we're currently at zero, we need to record the edge start point
+
2890  x0 = e->x; w += e->direction;
+
2891  } else {
+
2892  int x1 = e->x; w += e->direction;
+
2893  // if we went to zero, we need to draw
+
2894  if (w == 0) {
+
2895  int i = x0 >> STBTT_FIXSHIFT;
+
2896  int j = x1 >> STBTT_FIXSHIFT;
+
2897 
+
2898  if (i < len && j >= 0) {
+
2899  if (i == j) {
+
2900  // x0,x1 are the same pixel, so compute combined coverage
+
2901  scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT);
+
2902  } else {
+
2903  if (i >= 0) // add antialiasing for x0
+
2904  scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT);
+
2905  else
+
2906  i = -1; // clip
+
2907 
+
2908  if (j < len) // add antialiasing for x1
+
2909  scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT);
+
2910  else
+
2911  j = len; // clip
+
2912 
+
2913  for (++i; i < j; ++i) // fill pixels between x0 and x1
+
2914  scanline[i] = scanline[i] + (stbtt_uint8) max_weight;
+
2915  }
+
2916  }
+
2917  }
+
2918  }
+
2919 
+
2920  e = e->next;
+
2921  }
+
2922 }
+
2923 
+
2924 static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
+
2925 {
+
2926  stbtt__hheap hh = { 0, 0, 0 };
+
2927  stbtt__active_edge *active = NULL;
+
2928  int y,j=0;
+
2929  int max_weight = (255 / vsubsample); // weight per vertical scanline
+
2930  int s; // vertical subsample index
+
2931  unsigned char scanline_data[512], *scanline;
+
2932 
+
2933  if (result->w > 512)
+
2934  scanline = (unsigned char *) STBTT_malloc(result->w, userdata);
+
2935  else
+
2936  scanline = scanline_data;
+
2937 
+
2938  y = off_y * vsubsample;
+
2939  e[n].y0 = (off_y + result->h) * (float) vsubsample + 1;
+
2940 
+
2941  while (j < result->h) {
+
2942  STBTT_memset(scanline, 0, result->w);
+
2943  for (s=0; s < vsubsample; ++s) {
+
2944  // find center of pixel for this scanline
+
2945  float scan_y = y + 0.5f;
+
2946  stbtt__active_edge **step = &active;
+
2947 
+
2948  // update all active edges;
+
2949  // remove all active edges that terminate before the center of this scanline
+
2950  while (*step) {
+
2951  stbtt__active_edge * z = *step;
+
2952  if (z->ey <= scan_y) {
+
2953  *step = z->next; // delete from list
+
2954  STBTT_assert(z->direction);
+
2955  z->direction = 0;
+
2956  stbtt__hheap_free(&hh, z);
+
2957  } else {
+
2958  z->x += z->dx; // advance to position for current scanline
+
2959  step = &((*step)->next); // advance through list
+
2960  }
+
2961  }
+
2962 
+
2963  // resort the list if needed
+
2964  for(;;) {
+
2965  int changed=0;
+
2966  step = &active;
+
2967  while (*step && (*step)->next) {
+
2968  if ((*step)->x > (*step)->next->x) {
+
2969  stbtt__active_edge *t = *step;
+
2970  stbtt__active_edge *q = t->next;
+
2971 
+
2972  t->next = q->next;
+
2973  q->next = t;
+
2974  *step = q;
+
2975  changed = 1;
+
2976  }
+
2977  step = &(*step)->next;
+
2978  }
+
2979  if (!changed) break;
+
2980  }
+
2981 
+
2982  // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline
+
2983  while (e->y0 <= scan_y) {
+
2984  if (e->y1 > scan_y) {
+
2985  stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata);
+
2986  if (z != NULL) {
+
2987  // find insertion point
+
2988  if (active == NULL)
+
2989  active = z;
+
2990  else if (z->x < active->x) {
+
2991  // insert at front
+
2992  z->next = active;
+
2993  active = z;
+
2994  } else {
+
2995  // find thing to insert AFTER
+
2996  stbtt__active_edge *p = active;
+
2997  while (p->next && p->next->x < z->x)
+
2998  p = p->next;
+
2999  // at this point, p->next->x is NOT < z->x
+
3000  z->next = p->next;
+
3001  p->next = z;
+
3002  }
+
3003  }
+
3004  }
+
3005  ++e;
+
3006  }
+
3007 
+
3008  // now process all active edges in XOR fashion
+
3009  if (active)
+
3010  stbtt__fill_active_edges(scanline, result->w, active, max_weight);
+
3011 
+
3012  ++y;
+
3013  }
+
3014  STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w);
+
3015  ++j;
+
3016  }
+
3017 
+
3018  stbtt__hheap_cleanup(&hh, userdata);
+
3019 
+
3020  if (scanline != scanline_data)
+
3021  STBTT_free(scanline, userdata);
+
3022 }
+
3023 
+
3024 #elif STBTT_RASTERIZER_VERSION == 2
+
3025 
+
3026 // the edge passed in here does not cross the vertical line at x or the vertical line at x+1
+
3027 // (i.e. it has already been clipped to those)
+
3028 static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1)
+
3029 {
+
3030  if (y0 == y1) return;
+
3031  STBTT_assert(y0 < y1);
+
3032  STBTT_assert(e->sy <= e->ey);
+
3033  if (y0 > e->ey) return;
+
3034  if (y1 < e->sy) return;
+
3035  if (y0 < e->sy) {
+
3036  x0 += (x1-x0) * (e->sy - y0) / (y1-y0);
+
3037  y0 = e->sy;
+
3038  }
+
3039  if (y1 > e->ey) {
+
3040  x1 += (x1-x0) * (e->ey - y1) / (y1-y0);
+
3041  y1 = e->ey;
+
3042  }
+
3043 
+
3044  if (x0 == x)
+
3045  STBTT_assert(x1 <= x+1);
+
3046  else if (x0 == x+1)
+
3047  STBTT_assert(x1 >= x);
+
3048  else if (x0 <= x)
+
3049  STBTT_assert(x1 <= x);
+
3050  else if (x0 >= x+1)
+
3051  STBTT_assert(x1 >= x+1);
+
3052  else
+
3053  STBTT_assert(x1 >= x && x1 <= x+1);
+
3054 
+
3055  if (x0 <= x && x1 <= x)
+
3056  scanline[x] += e->direction * (y1-y0);
+
3057  else if (x0 >= x+1 && x1 >= x+1)
+
3058  ;
+
3059  else {
+
3060  STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1);
+
3061  scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position
+
3062  }
+
3063 }
+
3064 
+
3065 static float stbtt__sized_trapezoid_area(float height, float top_width, float bottom_width)
+
3066 {
+
3067  STBTT_assert(top_width >= 0);
+
3068  STBTT_assert(bottom_width >= 0);
+
3069  return (top_width + bottom_width) / 2.0f * height;
+
3070 }
+
3071 
+
3072 static float stbtt__position_trapezoid_area(float height, float tx0, float tx1, float bx0, float bx1)
+
3073 {
+
3074  return stbtt__sized_trapezoid_area(height, tx1 - tx0, bx1 - bx0);
+
3075 }
+
3076 
+
3077 static float stbtt__sized_triangle_area(float height, float width)
+
3078 {
+
3079  return height * width / 2;
+
3080 }
+
3081 
+
3082 static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top)
+
3083 {
+
3084  float y_bottom = y_top+1;
+
3085 
+
3086  while (e) {
+
3087  // brute force every pixel
+
3088 
+
3089  // compute intersection points with top & bottom
+
3090  STBTT_assert(e->ey >= y_top);
+
3091 
+
3092  if (e->fdx == 0) {
+
3093  float x0 = e->fx;
+
3094  if (x0 < len) {
+
3095  if (x0 >= 0) {
+
3096  stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom);
+
3097  stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom);
+
3098  } else {
+
3099  stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom);
+
3100  }
+
3101  }
+
3102  } else {
+
3103  float x0 = e->fx;
+
3104  float dx = e->fdx;
+
3105  float xb = x0 + dx;
+
3106  float x_top, x_bottom;
+
3107  float sy0,sy1;
+
3108  float dy = e->fdy;
+
3109  STBTT_assert(e->sy <= y_bottom && e->ey >= y_top);
+
3110 
+
3111  // compute endpoints of line segment clipped to this scanline (if the
+
3112  // line segment starts on this scanline. x0 is the intersection of the
+
3113  // line with y_top, but that may be off the line segment.
+
3114  if (e->sy > y_top) {
+
3115  x_top = x0 + dx * (e->sy - y_top);
+
3116  sy0 = e->sy;
+
3117  } else {
+
3118  x_top = x0;
+
3119  sy0 = y_top;
+
3120  }
+
3121  if (e->ey < y_bottom) {
+
3122  x_bottom = x0 + dx * (e->ey - y_top);
+
3123  sy1 = e->ey;
+
3124  } else {
+
3125  x_bottom = xb;
+
3126  sy1 = y_bottom;
+
3127  }
+
3128 
+
3129  if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) {
+
3130  // from here on, we don't have to range check x values
+
3131 
+
3132  if ((int) x_top == (int) x_bottom) {
+
3133  float height;
+
3134  // simple case, only spans one pixel
+
3135  int x = (int) x_top;
+
3136  height = (sy1 - sy0) * e->direction;
+
3137  STBTT_assert(x >= 0 && x < len);
+
3138  scanline[x] += stbtt__position_trapezoid_area(height, x_top, x+1.0f, x_bottom, x+1.0f);
+
3139  scanline_fill[x] += height; // everything right of this pixel is filled
+
3140  } else {
+
3141  int x,x1,x2;
+
3142  float y_crossing, y_final, step, sign, area;
+
3143  // covers 2+ pixels
+
3144  if (x_top > x_bottom) {
+
3145  // flip scanline vertically; signed area is the same
+
3146  float t;
+
3147  sy0 = y_bottom - (sy0 - y_top);
+
3148  sy1 = y_bottom - (sy1 - y_top);
+
3149  t = sy0, sy0 = sy1, sy1 = t;
+
3150  t = x_bottom, x_bottom = x_top, x_top = t;
+
3151  dx = -dx;
+
3152  dy = -dy;
+
3153  t = x0, x0 = xb, xb = t;
+
3154  }
+
3155  STBTT_assert(dy >= 0);
+
3156  STBTT_assert(dx >= 0);
+
3157 
+
3158  x1 = (int) x_top;
+
3159  x2 = (int) x_bottom;
+
3160  // compute intersection with y axis at x1+1
+
3161  y_crossing = y_top + dy * (x1+1 - x0);
+
3162 
+
3163  // compute intersection with y axis at x2
+
3164  y_final = y_top + dy * (x2 - x0);
+
3165 
+
3166  // x1 x_top x2 x_bottom
+
3167  // y_top +------|-----+------------+------------+--------|---+------------+
+
3168  // | | | | | |
+
3169  // | | | | | |
+
3170  // sy0 | Txxxxx|............|............|............|............|
+
3171  // y_crossing | *xxxxx.......|............|............|............|
+
3172  // | | xxxxx..|............|............|............|
+
3173  // | | /- xx*xxxx........|............|............|
+
3174  // | | dy < | xxxxxx..|............|............|
+
3175  // y_final | | \- | xx*xxx.........|............|
+
3176  // sy1 | | | | xxxxxB...|............|
+
3177  // | | | | | |
+
3178  // | | | | | |
+
3179  // y_bottom +------------+------------+------------+------------+------------+
+
3180  //
+
3181  // goal is to measure the area covered by '.' in each pixel
+
3182 
+
3183  // if x2 is right at the right edge of x1, y_crossing can blow up, github #1057
+
3184  // @TODO: maybe test against sy1 rather than y_bottom?
+
3185  if (y_crossing > y_bottom)
+
3186  y_crossing = y_bottom;
+
3187 
+
3188  sign = e->direction;
+
3189 
+
3190  // area of the rectangle covered from sy0..y_crossing
+
3191  area = sign * (y_crossing-sy0);
+
3192 
+
3193  // area of the triangle (x_top,sy0), (x1+1,sy0), (x1+1,y_crossing)
+
3194  scanline[x1] += stbtt__sized_triangle_area(area, x1+1 - x_top);
+
3195 
+
3196  // check if final y_crossing is blown up; no test case for this
+
3197  if (y_final > y_bottom) {
+
3198  y_final = y_bottom;
+
3199  dy = (y_final - y_crossing ) / (x2 - (x1+1)); // if denom=0, y_final = y_crossing, so y_final <= y_bottom
+
3200  }
+
3201 
+
3202  // in second pixel, area covered by line segment found in first pixel
+
3203  // is always a rectangle 1 wide * the height of that line segment; this
+
3204  // is exactly what the variable 'area' stores. it also gets a contribution
+
3205  // from the line segment within it. the THIRD pixel will get the first
+
3206  // pixel's rectangle contribution, the second pixel's rectangle contribution,
+
3207  // and its own contribution. the 'own contribution' is the same in every pixel except
+
3208  // the leftmost and rightmost, a trapezoid that slides down in each pixel.
+
3209  // the second pixel's contribution to the third pixel will be the
+
3210  // rectangle 1 wide times the height change in the second pixel, which is dy.
+
3211 
+
3212  step = sign * dy * 1; // dy is dy/dx, change in y for every 1 change in x,
+
3213  // which multiplied by 1-pixel-width is how much pixel area changes for each step in x
+
3214  // so the area advances by 'step' every time
+
3215 
+
3216  for (x = x1+1; x < x2; ++x) {
+
3217  scanline[x] += area + step/2; // area of trapezoid is 1*step/2
+
3218  area += step;
+
3219  }
+
3220  STBTT_assert(STBTT_fabs(area) <= 1.01f); // accumulated error from area += step unless we round step down
+
3221  STBTT_assert(sy1 > y_final-0.01f);
+
3222 
+
3223  // area covered in the last pixel is the rectangle from all the pixels to the left,
+
3224  // plus the trapezoid filled by the line segment in this pixel all the way to the right edge
+
3225  scanline[x2] += area + sign * stbtt__position_trapezoid_area(sy1-y_final, (float) x2, x2+1.0f, x_bottom, x2+1.0f);
+
3226 
+
3227  // the rest of the line is filled based on the total height of the line segment in this pixel
+
3228  scanline_fill[x2] += sign * (sy1-sy0);
+
3229  }
+
3230  } else {
+
3231  // if edge goes outside of box we're drawing, we require
+
3232  // clipping logic. since this does not match the intended use
+
3233  // of this library, we use a different, very slow brute
+
3234  // force implementation
+
3235  // note though that this does happen some of the time because
+
3236  // x_top and x_bottom can be extrapolated at the top & bottom of
+
3237  // the shape and actually lie outside the bounding box
+
3238  int x;
+
3239  for (x=0; x < len; ++x) {
+
3240  // cases:
+
3241  //
+
3242  // there can be up to two intersections with the pixel. any intersection
+
3243  // with left or right edges can be handled by splitting into two (or three)
+
3244  // regions. intersections with top & bottom do not necessitate case-wise logic.
+
3245  //
+
3246  // the old way of doing this found the intersections with the left & right edges,
+
3247  // then used some simple logic to produce up to three segments in sorted order
+
3248  // from top-to-bottom. however, this had a problem: if an x edge was epsilon
+
3249  // across the x border, then the corresponding y position might not be distinct
+
3250  // from the other y segment, and it might ignored as an empty segment. to avoid
+
3251  // that, we need to explicitly produce segments based on x positions.
+
3252 
+
3253  // rename variables to clearly-defined pairs
+
3254  float y0 = y_top;
+
3255  float x1 = (float) (x);
+
3256  float x2 = (float) (x+1);
+
3257  float x3 = xb;
+
3258  float y3 = y_bottom;
+
3259 
+
3260  // x = e->x + e->dx * (y-y_top)
+
3261  // (y-y_top) = (x - e->x) / e->dx
+
3262  // y = (x - e->x) / e->dx + y_top
+
3263  float y1 = (x - x0) / dx + y_top;
+
3264  float y2 = (x+1 - x0) / dx + y_top;
+
3265 
+
3266  if (x0 < x1 && x3 > x2) { // three segments descending down-right
+
3267  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+
3268  stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2);
+
3269  stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+
3270  } else if (x3 < x1 && x0 > x2) { // three segments descending down-left
+
3271  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+
3272  stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1);
+
3273  stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+
3274  } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right
+
3275  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+
3276  stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+
3277  } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left
+
3278  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+
3279  stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+
3280  } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right
+
3281  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+
3282  stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+
3283  } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left
+
3284  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+
3285  stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+
3286  } else { // one segment
+
3287  stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3);
+
3288  }
+
3289  }
+
3290  }
+
3291  }
+
3292  e = e->next;
+
3293  }
+
3294 }
+
3295 
+
3296 // directly AA rasterize edges w/o supersampling
+
3297 static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
+
3298 {
+
3299  stbtt__hheap hh = { 0, 0, 0 };
+
3300  stbtt__active_edge *active = NULL;
+
3301  int y,j=0, i;
+
3302  float scanline_data[129], *scanline, *scanline2;
+
3303 
+
3304  STBTT__NOTUSED(vsubsample);
+
3305 
+
3306  if (result->w > 64)
+
3307  scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata);
+
3308  else
+
3309  scanline = scanline_data;
+
3310 
+
3311  scanline2 = scanline + result->w;
+
3312 
+
3313  y = off_y;
+
3314  e[n].y0 = (float) (off_y + result->h) + 1;
+
3315 
+
3316  while (j < result->h) {
+
3317  // find center of pixel for this scanline
+
3318  float scan_y_top = y + 0.0f;
+
3319  float scan_y_bottom = y + 1.0f;
+
3320  stbtt__active_edge **step = &active;
+
3321 
+
3322  STBTT_memset(scanline , 0, result->w*sizeof(scanline[0]));
+
3323  STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0]));
+
3324 
+
3325  // update all active edges;
+
3326  // remove all active edges that terminate before the top of this scanline
+
3327  while (*step) {
+
3328  stbtt__active_edge * z = *step;
+
3329  if (z->ey <= scan_y_top) {
+
3330  *step = z->next; // delete from list
+
3331  STBTT_assert(z->direction);
+
3332  z->direction = 0;
+
3333  stbtt__hheap_free(&hh, z);
+
3334  } else {
+
3335  step = &((*step)->next); // advance through list
+
3336  }
+
3337  }
+
3338 
+
3339  // insert all edges that start before the bottom of this scanline
+
3340  while (e->y0 <= scan_y_bottom) {
+
3341  if (e->y0 != e->y1) {
+
3342  stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata);
+
3343  if (z != NULL) {
+
3344  if (j == 0 && off_y != 0) {
+
3345  if (z->ey < scan_y_top) {
+
3346  // this can happen due to subpixel positioning and some kind of fp rounding error i think
+
3347  z->ey = scan_y_top;
+
3348  }
+
3349  }
+
3350  STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds
+
3351  // insert at front
+
3352  z->next = active;
+
3353  active = z;
+
3354  }
+
3355  }
+
3356  ++e;
+
3357  }
+
3358 
+
3359  // now process all active edges
+
3360  if (active)
+
3361  stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top);
+
3362 
+
3363  {
+
3364  float sum = 0;
+
3365  for (i=0; i < result->w; ++i) {
+
3366  float k;
+
3367  int m;
+
3368  sum += scanline2[i];
+
3369  k = scanline[i] + sum;
+
3370  k = (float) STBTT_fabs(k)*255 + 0.5f;
+
3371  m = (int) k;
+
3372  if (m > 255) m = 255;
+
3373  result->pixels[j*result->stride + i] = (unsigned char) m;
+
3374  }
+
3375  }
+
3376  // advance all the edges
+
3377  step = &active;
+
3378  while (*step) {
+
3379  stbtt__active_edge *z = *step;
+
3380  z->fx += z->fdx; // advance to position for current scanline
+
3381  step = &((*step)->next); // advance through list
+
3382  }
+
3383 
+
3384  ++y;
+
3385  ++j;
+
3386  }
+
3387 
+
3388  stbtt__hheap_cleanup(&hh, userdata);
+
3389 
+
3390  if (scanline != scanline_data)
+
3391  STBTT_free(scanline, userdata);
+
3392 }
+
3393 #else
+
3394 #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+
3395 #endif
+
3396 
+
3397 #define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0)
+
3398 
+
3399 static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n)
+
3400 {
+
3401  int i,j;
+
3402  for (i=1; i < n; ++i) {
+
3403  stbtt__edge t = p[i], *a = &t;
+
3404  j = i;
+
3405  while (j > 0) {
+
3406  stbtt__edge *b = &p[j-1];
+
3407  int c = STBTT__COMPARE(a,b);
+
3408  if (!c) break;
+
3409  p[j] = p[j-1];
+
3410  --j;
+
3411  }
+
3412  if (i != j)
+
3413  p[j] = t;
+
3414  }
+
3415 }
+
3416 
+
3417 static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
+
3418 {
+
3419  /* threshold for transitioning to insertion sort */
+
3420  while (n > 12) {
+
3421  stbtt__edge t;
+
3422  int c01,c12,c,m,i,j;
+
3423 
+
3424  /* compute median of three */
+
3425  m = n >> 1;
+
3426  c01 = STBTT__COMPARE(&p[0],&p[m]);
+
3427  c12 = STBTT__COMPARE(&p[m],&p[n-1]);
+
3428  /* if 0 >= mid >= end, or 0 < mid < end, then use mid */
+
3429  if (c01 != c12) {
+
3430  /* otherwise, we'll need to swap something else to middle */
+
3431  int z;
+
3432  c = STBTT__COMPARE(&p[0],&p[n-1]);
+
3433  /* 0>mid && mid<n: 0>n => n; 0<n => 0 */
+
3434  /* 0<mid && mid>n: 0>n => 0; 0<n => n */
+
3435  z = (c == c12) ? 0 : n-1;
+
3436  t = p[z];
+
3437  p[z] = p[m];
+
3438  p[m] = t;
+
3439  }
+
3440  /* now p[m] is the median-of-three */
+
3441  /* swap it to the beginning so it won't move around */
+
3442  t = p[0];
+
3443  p[0] = p[m];
+
3444  p[m] = t;
+
3445 
+
3446  /* partition loop */
+
3447  i=1;
+
3448  j=n-1;
+
3449  for(;;) {
+
3450  /* handling of equality is crucial here */
+
3451  /* for sentinels & efficiency with duplicates */
+
3452  for (;;++i) {
+
3453  if (!STBTT__COMPARE(&p[i], &p[0])) break;
+
3454  }
+
3455  for (;;--j) {
+
3456  if (!STBTT__COMPARE(&p[0], &p[j])) break;
+
3457  }
+
3458  /* make sure we haven't crossed */
+
3459  if (i >= j) break;
+
3460  t = p[i];
+
3461  p[i] = p[j];
+
3462  p[j] = t;
+
3463 
+
3464  ++i;
+
3465  --j;
+
3466  }
+
3467  /* recurse on smaller side, iterate on larger */
+
3468  if (j < (n-i)) {
+
3469  stbtt__sort_edges_quicksort(p,j);
+
3470  p = p+i;
+
3471  n = n-i;
+
3472  } else {
+
3473  stbtt__sort_edges_quicksort(p+i, n-i);
+
3474  n = j;
+
3475  }
+
3476  }
+
3477 }
+
3478 
+
3479 static void stbtt__sort_edges(stbtt__edge *p, int n)
+
3480 {
+
3481  stbtt__sort_edges_quicksort(p, n);
+
3482  stbtt__sort_edges_ins_sort(p, n);
+
3483 }
+
3484 
+
3485 typedef struct
+
3486 {
+
3487  float x,y;
+
3488 } stbtt__point;
+
3489 
+
3490 static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata)
+
3491 {
+
3492  float y_scale_inv = invert ? -scale_y : scale_y;
+
3493  stbtt__edge *e;
+
3494  int n,i,j,k,m;
+
3495 #if STBTT_RASTERIZER_VERSION == 1
+
3496  int vsubsample = result->h < 8 ? 15 : 5;
+
3497 #elif STBTT_RASTERIZER_VERSION == 2
+
3498  int vsubsample = 1;
+
3499 #else
+
3500  #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+
3501 #endif
+
3502  // vsubsample should divide 255 evenly; otherwise we won't reach full opacity
+
3503 
+
3504  // now we have to blow out the windings into explicit edge lists
+
3505  n = 0;
+
3506  for (i=0; i < windings; ++i)
+
3507  n += wcount[i];
+
3508 
+
3509  e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel
+
3510  if (e == 0) return;
+
3511  n = 0;
+
3512 
+
3513  m=0;
+
3514  for (i=0; i < windings; ++i) {
+
3515  stbtt__point *p = pts + m;
+
3516  m += wcount[i];
+
3517  j = wcount[i]-1;
+
3518  for (k=0; k < wcount[i]; j=k++) {
+
3519  int a=k,b=j;
+
3520  // skip the edge if horizontal
+
3521  if (p[j].y == p[k].y)
+
3522  continue;
+
3523  // add edge from j to k to the list
+
3524  e[n].invert = 0;
+
3525  if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) {
+
3526  e[n].invert = 1;
+
3527  a=j,b=k;
+
3528  }
+
3529  e[n].x0 = p[a].x * scale_x + shift_x;
+
3530  e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample;
+
3531  e[n].x1 = p[b].x * scale_x + shift_x;
+
3532  e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample;
+
3533  ++n;
+
3534  }
+
3535  }
+
3536 
+
3537  // now sort the edges by their highest point (should snap to integer, and then by x)
+
3538  //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare);
+
3539  stbtt__sort_edges(e, n);
+
3540 
+
3541  // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule
+
3542  stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata);
+
3543 
+
3544  STBTT_free(e, userdata);
+
3545 }
+
3546 
+
3547 static void stbtt__add_point(stbtt__point *points, int n, float x, float y)
+
3548 {
+
3549  if (!points) return; // during first pass, it's unallocated
+
3550  points[n].x = x;
+
3551  points[n].y = y;
+
3552 }
+
3553 
+
3554 // tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching
+
3555 static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n)
+
3556 {
+
3557  // midpoint
+
3558  float mx = (x0 + 2*x1 + x2)/4;
+
3559  float my = (y0 + 2*y1 + y2)/4;
+
3560  // versus directly drawn line
+
3561  float dx = (x0+x2)/2 - mx;
+
3562  float dy = (y0+y2)/2 - my;
+
3563  if (n > 16) // 65536 segments on one curve better be enough!
+
3564  return 1;
+
3565  if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA
+
3566  stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1);
+
3567  stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1);
+
3568  } else {
+
3569  stbtt__add_point(points, *num_points,x2,y2);
+
3570  *num_points = *num_points+1;
+
3571  }
+
3572  return 1;
+
3573 }
+
3574 
+
3575 static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n)
+
3576 {
+
3577  // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough
+
3578  float dx0 = x1-x0;
+
3579  float dy0 = y1-y0;
+
3580  float dx1 = x2-x1;
+
3581  float dy1 = y2-y1;
+
3582  float dx2 = x3-x2;
+
3583  float dy2 = y3-y2;
+
3584  float dx = x3-x0;
+
3585  float dy = y3-y0;
+
3586  float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2));
+
3587  float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy);
+
3588  float flatness_squared = longlen*longlen-shortlen*shortlen;
+
3589 
+
3590  if (n > 16) // 65536 segments on one curve better be enough!
+
3591  return;
+
3592 
+
3593  if (flatness_squared > objspace_flatness_squared) {
+
3594  float x01 = (x0+x1)/2;
+
3595  float y01 = (y0+y1)/2;
+
3596  float x12 = (x1+x2)/2;
+
3597  float y12 = (y1+y2)/2;
+
3598  float x23 = (x2+x3)/2;
+
3599  float y23 = (y2+y3)/2;
+
3600 
+
3601  float xa = (x01+x12)/2;
+
3602  float ya = (y01+y12)/2;
+
3603  float xb = (x12+x23)/2;
+
3604  float yb = (y12+y23)/2;
+
3605 
+
3606  float mx = (xa+xb)/2;
+
3607  float my = (ya+yb)/2;
+
3608 
+
3609  stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1);
+
3610  stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1);
+
3611  } else {
+
3612  stbtt__add_point(points, *num_points,x3,y3);
+
3613  *num_points = *num_points+1;
+
3614  }
+
3615 }
+
3616 
+
3617 // returns number of contours
+
3618 static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata)
+
3619 {
+
3620  stbtt__point *points=0;
+
3621  int num_points=0;
+
3622 
+
3623  float objspace_flatness_squared = objspace_flatness * objspace_flatness;
+
3624  int i,n=0,start=0, pass;
+
3625 
+
3626  // count how many "moves" there are to get the contour count
+
3627  for (i=0; i < num_verts; ++i)
+
3628  if (vertices[i].type == STBTT_vmove)
+
3629  ++n;
+
3630 
+
3631  *num_contours = n;
+
3632  if (n == 0) return 0;
+
3633 
+
3634  *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata);
+
3635 
+
3636  if (*contour_lengths == 0) {
+
3637  *num_contours = 0;
+
3638  return 0;
+
3639  }
+
3640 
+
3641  // make two passes through the points so we don't need to realloc
+
3642  for (pass=0; pass < 2; ++pass) {
+
3643  float x=0,y=0;
+
3644  if (pass == 1) {
+
3645  points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata);
+
3646  if (points == NULL) goto error;
+
3647  }
+
3648  num_points = 0;
+
3649  n= -1;
+
3650  for (i=0; i < num_verts; ++i) {
+
3651  switch (vertices[i].type) {
+
3652  case STBTT_vmove:
+
3653  // start the next contour
+
3654  if (n >= 0)
+
3655  (*contour_lengths)[n] = num_points - start;
+
3656  ++n;
+
3657  start = num_points;
+
3658 
+
3659  x = vertices[i].x, y = vertices[i].y;
+
3660  stbtt__add_point(points, num_points++, x,y);
+
3661  break;
+
3662  case STBTT_vline:
+
3663  x = vertices[i].x, y = vertices[i].y;
+
3664  stbtt__add_point(points, num_points++, x, y);
+
3665  break;
+
3666  case STBTT_vcurve:
+
3667  stbtt__tesselate_curve(points, &num_points, x,y,
+
3668  vertices[i].cx, vertices[i].cy,
+
3669  vertices[i].x, vertices[i].y,
+
3670  objspace_flatness_squared, 0);
+
3671  x = vertices[i].x, y = vertices[i].y;
+
3672  break;
+
3673  case STBTT_vcubic:
+
3674  stbtt__tesselate_cubic(points, &num_points, x,y,
+
3675  vertices[i].cx, vertices[i].cy,
+
3676  vertices[i].cx1, vertices[i].cy1,
+
3677  vertices[i].x, vertices[i].y,
+
3678  objspace_flatness_squared, 0);
+
3679  x = vertices[i].x, y = vertices[i].y;
+
3680  break;
+
3681  }
+
3682  }
+
3683  (*contour_lengths)[n] = num_points - start;
+
3684  }
+
3685 
+
3686  return points;
+
3687 error:
+
3688  STBTT_free(points, userdata);
+
3689  STBTT_free(*contour_lengths, userdata);
+
3690  *contour_lengths = 0;
+
3691  *num_contours = 0;
+
3692  return NULL;
+
3693 }
+
3694 
+
3695 STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata)
+
3696 {
+
3697  float scale = scale_x > scale_y ? scale_y : scale_x;
+
3698  int winding_count = 0;
+
3699  int *winding_lengths = NULL;
+
3700  stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata);
+
3701  if (windings) {
+
3702  stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata);
+
3703  STBTT_free(winding_lengths, userdata);
+
3704  STBTT_free(windings, userdata);
+
3705  }
+
3706 }
+
3707 
+
3708 STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata)
+
3709 {
+
3710  STBTT_free(bitmap, userdata);
+
3711 }
+
3712 
+
3713 STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff)
+
3714 {
+
3715  int ix0,iy0,ix1,iy1;
+
3716  stbtt__bitmap gbm;
+
3717  stbtt_vertex *vertices;
+
3718  int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices);
+
3719 
+
3720  if (scale_x == 0) scale_x = scale_y;
+
3721  if (scale_y == 0) {
+
3722  if (scale_x == 0) {
+
3723  STBTT_free(vertices, info->userdata);
+
3724  return NULL;
+
3725  }
+
3726  scale_y = scale_x;
+
3727  }
+
3728 
+
3729  stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1);
+
3730 
+
3731  // now we get the size
+
3732  gbm.w = (ix1 - ix0);
+
3733  gbm.h = (iy1 - iy0);
+
3734  gbm.pixels = NULL; // in case we error
+
3735 
+
3736  if (width ) *width = gbm.w;
+
3737  if (height) *height = gbm.h;
+
3738  if (xoff ) *xoff = ix0;
+
3739  if (yoff ) *yoff = iy0;
+
3740 
+
3741  if (gbm.w && gbm.h) {
+
3742  gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata);
+
3743  if (gbm.pixels) {
+
3744  gbm.stride = gbm.w;
+
3745 
+
3746  stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata);
+
3747  }
+
3748  }
+
3749  STBTT_free(vertices, info->userdata);
+
3750  return gbm.pixels;
+
3751 }
+
3752 
+
3753 STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff)
+
3754 {
+
3755  return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff);
+
3756 }
+
3757 
+
3758 STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph)
+
3759 {
+
3760  int ix0,iy0;
+
3761  stbtt_vertex *vertices;
+
3762  int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices);
+
3763  stbtt__bitmap gbm;
+
3764 
+
3765  stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0);
+
3766  gbm.pixels = output;
+
3767  gbm.w = out_w;
+
3768  gbm.h = out_h;
+
3769  gbm.stride = out_stride;
+
3770 
+
3771  if (gbm.w && gbm.h)
+
3772  stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata);
+
3773 
+
3774  STBTT_free(vertices, info->userdata);
+
3775 }
+
3776 
+
3777 STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph)
+
3778 {
+
3779  stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph);
+
3780 }
+
3781 
+
3782 STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff)
+
3783 {
+
3784  return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff);
+
3785 }
+
3786 
+
3787 STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint)
+
3788 {
+
3789  stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, stbtt_FindGlyphIndex(info,codepoint));
+
3790 }
+
3791 
+
3792 STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint)
+
3793 {
+
3794  stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint));
+
3795 }
+
3796 
+
3797 STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff)
+
3798 {
+
3799  return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff);
+
3800 }
+
3801 
+
3802 STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint)
+
3803 {
+
3804  stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint);
+
3805 }
+
3806 
+
3808 //
+
3809 // bitmap baking
+
3810 //
+
3811 // This is SUPER-CRAPPY packing to keep source code small
+
3812 
+
3813 static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf)
+
3814  float pixel_height, // height of font in pixels
+
3815  unsigned char *pixels, int pw, int ph, // bitmap to be filled in
+
3816  int first_char, int num_chars, // characters to bake
+
3817  stbtt_bakedchar *chardata)
+
3818 {
+
3819  float scale;
+
3820  int x,y,bottom_y, i;
+
3821  stbtt_fontinfo f;
+
3822  f.userdata = NULL;
+
3823  if (!stbtt_InitFont(&f, data, offset))
+
3824  return -1;
+
3825  STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels
+
3826  x=y=1;
+
3827  bottom_y = 1;
+
3828 
+
3829  scale = stbtt_ScaleForPixelHeight(&f, pixel_height);
+
3830 
+
3831  for (i=0; i < num_chars; ++i) {
+
3832  int advance, lsb, x0,y0,x1,y1,gw,gh;
+
3833  int g = stbtt_FindGlyphIndex(&f, first_char + i);
+
3834  stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb);
+
3835  stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1);
+
3836  gw = x1-x0;
+
3837  gh = y1-y0;
+
3838  if (x + gw + 1 >= pw)
+
3839  y = bottom_y, x = 1; // advance to next row
+
3840  if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row
+
3841  return -i;
+
3842  STBTT_assert(x+gw < pw);
+
3843  STBTT_assert(y+gh < ph);
+
3844  stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g);
+
3845  chardata[i].x0 = (stbtt_int16) x;
+
3846  chardata[i].y0 = (stbtt_int16) y;
+
3847  chardata[i].x1 = (stbtt_int16) (x + gw);
+
3848  chardata[i].y1 = (stbtt_int16) (y + gh);
+
3849  chardata[i].xadvance = scale * advance;
+
3850  chardata[i].xoff = (float) x0;
+
3851  chardata[i].yoff = (float) y0;
+
3852  x = x + gw + 1;
+
3853  if (y+gh+1 > bottom_y)
+
3854  bottom_y = y+gh+1;
+
3855  }
+
3856  return bottom_y;
+
3857 }
+
3858 
+
3859 STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule)
+
3860 {
+
3861  float d3d_bias = opengl_fillrule ? 0 : -0.5f;
+
3862  float ipw = 1.0f / pw, iph = 1.0f / ph;
+
3863  const stbtt_bakedchar *b = chardata + char_index;
+
3864  int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f);
+
3865  int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f);
+
3866 
+
3867  q->x0 = round_x + d3d_bias;
+
3868  q->y0 = round_y + d3d_bias;
+
3869  q->x1 = round_x + b->x1 - b->x0 + d3d_bias;
+
3870  q->y1 = round_y + b->y1 - b->y0 + d3d_bias;
+
3871 
+
3872  q->s0 = b->x0 * ipw;
+
3873  q->t0 = b->y0 * iph;
+
3874  q->s1 = b->x1 * ipw;
+
3875  q->t1 = b->y1 * iph;
+
3876 
+
3877  *xpos += b->xadvance;
+
3878 }
+
3879 
+
3881 //
+
3882 // rectangle packing replacement routines if you don't have stb_rect_pack.h
+
3883 //
+
3884 
+
3885 #ifndef STB_RECT_PACK_VERSION
+
3886 
+
3887 typedef int stbrp_coord;
+
3888 
+
3890 // //
+
3891 // //
+
3892 // COMPILER WARNING ?!?!? //
+
3893 // //
+
3894 // //
+
3895 // if you get a compile warning due to these symbols being defined more than //
+
3896 // once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" //
+
3897 // //
+
3899 
+
3900 typedef struct
+
3901 {
+
3902  int width,height;
+
3903  int x,y,bottom_y;
+
3904 } stbrp_context;
+
3905 
+
3906 typedef struct
+
3907 {
+
3908  unsigned char x;
+
3909 } stbrp_node;
+
3910 
+
3911 struct stbrp_rect
+
3912 {
+
3913  stbrp_coord x,y;
+
3914  int id,w,h,was_packed;
+
3915 };
+
3916 
+
3917 static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes)
+
3918 {
+
3919  con->width = pw;
+
3920  con->height = ph;
+
3921  con->x = 0;
+
3922  con->y = 0;
+
3923  con->bottom_y = 0;
+
3924  STBTT__NOTUSED(nodes);
+
3925  STBTT__NOTUSED(num_nodes);
+
3926 }
+
3927 
+
3928 static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects)
+
3929 {
+
3930  int i;
+
3931  for (i=0; i < num_rects; ++i) {
+
3932  if (con->x + rects[i].w > con->width) {
+
3933  con->x = 0;
+
3934  con->y = con->bottom_y;
+
3935  }
+
3936  if (con->y + rects[i].h > con->height)
+
3937  break;
+
3938  rects[i].x = con->x;
+
3939  rects[i].y = con->y;
+
3940  rects[i].was_packed = 1;
+
3941  con->x += rects[i].w;
+
3942  if (con->y + rects[i].h > con->bottom_y)
+
3943  con->bottom_y = con->y + rects[i].h;
+
3944  }
+
3945  for ( ; i < num_rects; ++i)
+
3946  rects[i].was_packed = 0;
+
3947 }
+
3948 #endif
+
3949 
+
3951 //
+
3952 // bitmap baking
+
3953 //
+
3954 // This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If
+
3955 // stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy.
+
3956 
+
3957 STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context)
+
3958 {
+
3959  stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context);
+
3960  int num_nodes = pw - padding;
+
3961  stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context);
+
3962 
+
3963  if (context == NULL || nodes == NULL) {
+
3964  if (context != NULL) STBTT_free(context, alloc_context);
+
3965  if (nodes != NULL) STBTT_free(nodes , alloc_context);
+
3966  return 0;
+
3967  }
+
3968 
+
3969  spc->user_allocator_context = alloc_context;
+
3970  spc->width = pw;
+
3971  spc->height = ph;
+
3972  spc->pixels = pixels;
+
3973  spc->pack_info = context;
+
3974  spc->nodes = nodes;
+
3975  spc->padding = padding;
+
3976  spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw;
+
3977  spc->h_oversample = 1;
+
3978  spc->v_oversample = 1;
+
3979  spc->skip_missing = 0;
+
3980 
+
3981  stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);
+
3982 
+
3983  if (pixels)
+
3984  STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels
+
3985 
+
3986  return 1;
+
3987 }
+
3988 
+
3989 STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc)
+
3990 {
+
3991  STBTT_free(spc->nodes , spc->user_allocator_context);
+
3992  STBTT_free(spc->pack_info, spc->user_allocator_context);
+
3993 }
+
3994 
+
3995 STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample)
+
3996 {
+
3997  STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE);
+
3998  STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE);
+
3999  if (h_oversample <= STBTT_MAX_OVERSAMPLE)
+
4000  spc->h_oversample = h_oversample;
+
4001  if (v_oversample <= STBTT_MAX_OVERSAMPLE)
+
4002  spc->v_oversample = v_oversample;
+
4003 }
+
4004 
+
4005 STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip)
+
4006 {
+
4007  spc->skip_missing = skip;
+
4008 }
+
4009 
+
4010 #define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1)
+
4011 
+
4012 static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width)
+
4013 {
+
4014  unsigned char buffer[STBTT_MAX_OVERSAMPLE];
+
4015  int safe_w = w - kernel_width;
+
4016  int j;
+
4017  STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze
+
4018  for (j=0; j < h; ++j) {
+
4019  int i;
+
4020  unsigned int total;
+
4021  STBTT_memset(buffer, 0, kernel_width);
+
4022 
+
4023  total = 0;
+
4024 
+
4025  // make kernel_width a constant in common cases so compiler can optimize out the divide
+
4026  switch (kernel_width) {
+
4027  case 2:
+
4028  for (i=0; i <= safe_w; ++i) {
+
4029  total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+
4030  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+
4031  pixels[i] = (unsigned char) (total / 2);
+
4032  }
+
4033  break;
+
4034  case 3:
+
4035  for (i=0; i <= safe_w; ++i) {
+
4036  total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+
4037  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+
4038  pixels[i] = (unsigned char) (total / 3);
+
4039  }
+
4040  break;
+
4041  case 4:
+
4042  for (i=0; i <= safe_w; ++i) {
+
4043  total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+
4044  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+
4045  pixels[i] = (unsigned char) (total / 4);
+
4046  }
+
4047  break;
+
4048  case 5:
+
4049  for (i=0; i <= safe_w; ++i) {
+
4050  total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+
4051  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+
4052  pixels[i] = (unsigned char) (total / 5);
+
4053  }
+
4054  break;
+
4055  default:
+
4056  for (i=0; i <= safe_w; ++i) {
+
4057  total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+
4058  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+
4059  pixels[i] = (unsigned char) (total / kernel_width);
+
4060  }
+
4061  break;
+
4062  }
+
4063 
+
4064  for (; i < w; ++i) {
+
4065  STBTT_assert(pixels[i] == 0);
+
4066  total -= buffer[i & STBTT__OVER_MASK];
+
4067  pixels[i] = (unsigned char) (total / kernel_width);
+
4068  }
+
4069 
+
4070  pixels += stride_in_bytes;
+
4071  }
+
4072 }
+
4073 
+
4074 static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width)
+
4075 {
+
4076  unsigned char buffer[STBTT_MAX_OVERSAMPLE];
+
4077  int safe_h = h - kernel_width;
+
4078  int j;
+
4079  STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze
+
4080  for (j=0; j < w; ++j) {
+
4081  int i;
+
4082  unsigned int total;
+
4083  STBTT_memset(buffer, 0, kernel_width);
+
4084 
+
4085  total = 0;
+
4086 
+
4087  // make kernel_width a constant in common cases so compiler can optimize out the divide
+
4088  switch (kernel_width) {
+
4089  case 2:
+
4090  for (i=0; i <= safe_h; ++i) {
+
4091  total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+
4092  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+
4093  pixels[i*stride_in_bytes] = (unsigned char) (total / 2);
+
4094  }
+
4095  break;
+
4096  case 3:
+
4097  for (i=0; i <= safe_h; ++i) {
+
4098  total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+
4099  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+
4100  pixels[i*stride_in_bytes] = (unsigned char) (total / 3);
+
4101  }
+
4102  break;
+
4103  case 4:
+
4104  for (i=0; i <= safe_h; ++i) {
+
4105  total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+
4106  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+
4107  pixels[i*stride_in_bytes] = (unsigned char) (total / 4);
+
4108  }
+
4109  break;
+
4110  case 5:
+
4111  for (i=0; i <= safe_h; ++i) {
+
4112  total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+
4113  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+
4114  pixels[i*stride_in_bytes] = (unsigned char) (total / 5);
+
4115  }
+
4116  break;
+
4117  default:
+
4118  for (i=0; i <= safe_h; ++i) {
+
4119  total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+
4120  buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+
4121  pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width);
+
4122  }
+
4123  break;
+
4124  }
+
4125 
+
4126  for (; i < h; ++i) {
+
4127  STBTT_assert(pixels[i*stride_in_bytes] == 0);
+
4128  total -= buffer[i & STBTT__OVER_MASK];
+
4129  pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width);
+
4130  }
+
4131 
+
4132  pixels += 1;
+
4133  }
+
4134 }
+
4135 
+
4136 static float stbtt__oversample_shift(int oversample)
+
4137 {
+
4138  if (!oversample)
+
4139  return 0.0f;
+
4140 
+
4141  // The prefilter is a box filter of width "oversample",
+
4142  // which shifts phase by (oversample - 1)/2 pixels in
+
4143  // oversampled space. We want to shift in the opposite
+
4144  // direction to counter this.
+
4145  return (float)-(oversample - 1) / (2.0f * (float)oversample);
+
4146 }
+
4147 
+
4148 // rects array must be big enough to accommodate all characters in the given ranges
+
4149 STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
+
4150 {
+
4151  int i,j,k;
+
4152  int missing_glyph_added = 0;
+
4153 
+
4154  k=0;
+
4155  for (i=0; i < num_ranges; ++i) {
+
4156  float fh = ranges[i].font_size;
+
4157  float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh);
+
4158  ranges[i].h_oversample = (unsigned char) spc->h_oversample;
+
4159  ranges[i].v_oversample = (unsigned char) spc->v_oversample;
+
4160  for (j=0; j < ranges[i].num_chars; ++j) {
+
4161  int x0,y0,x1,y1;
+
4162  int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
+
4163  int glyph = stbtt_FindGlyphIndex(info, codepoint);
+
4164  if (glyph == 0 && (spc->skip_missing || missing_glyph_added)) {
+
4165  rects[k].w = rects[k].h = 0;
+
4166  } else {
+
4167  stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
+
4168  scale * spc->h_oversample,
+
4169  scale * spc->v_oversample,
+
4170  0,0,
+
4171  &x0,&y0,&x1,&y1);
+
4172  rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
+
4173  rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
+
4174  if (glyph == 0)
+
4175  missing_glyph_added = 1;
+
4176  }
+
4177  ++k;
+
4178  }
+
4179  }
+
4180 
+
4181  return k;
+
4182 }
+
4183 
+
4184 STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph)
+
4185 {
+
4186  stbtt_MakeGlyphBitmapSubpixel(info,
+
4187  output,
+
4188  out_w - (prefilter_x - 1),
+
4189  out_h - (prefilter_y - 1),
+
4190  out_stride,
+
4191  scale_x,
+
4192  scale_y,
+
4193  shift_x,
+
4194  shift_y,
+
4195  glyph);
+
4196 
+
4197  if (prefilter_x > 1)
+
4198  stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x);
+
4199 
+
4200  if (prefilter_y > 1)
+
4201  stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y);
+
4202 
+
4203  *sub_x = stbtt__oversample_shift(prefilter_x);
+
4204  *sub_y = stbtt__oversample_shift(prefilter_y);
+
4205 }
+
4206 
+
4207 // rects array must be big enough to accommodate all characters in the given ranges
+
4208 STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
+
4209 {
+
4210  int i,j,k, missing_glyph = -1, return_value = 1;
+
4211 
+
4212  // save current values
+
4213  int old_h_over = spc->h_oversample;
+
4214  int old_v_over = spc->v_oversample;
+
4215 
+
4216  k = 0;
+
4217  for (i=0; i < num_ranges; ++i) {
+
4218  float fh = ranges[i].font_size;
+
4219  float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh);
+
4220  float recip_h,recip_v,sub_x,sub_y;
+
4221  spc->h_oversample = ranges[i].h_oversample;
+
4222  spc->v_oversample = ranges[i].v_oversample;
+
4223  recip_h = 1.0f / spc->h_oversample;
+
4224  recip_v = 1.0f / spc->v_oversample;
+
4225  sub_x = stbtt__oversample_shift(spc->h_oversample);
+
4226  sub_y = stbtt__oversample_shift(spc->v_oversample);
+
4227  for (j=0; j < ranges[i].num_chars; ++j) {
+
4228  stbrp_rect *r = &rects[k];
+
4229  if (r->was_packed && r->w != 0 && r->h != 0) {
+
4230  stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];
+
4231  int advance, lsb, x0,y0,x1,y1;
+
4232  int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
+
4233  int glyph = stbtt_FindGlyphIndex(info, codepoint);
+
4234  stbrp_coord pad = (stbrp_coord) spc->padding;
+
4235 
+
4236  // pad on left and top
+
4237  r->x += pad;
+
4238  r->y += pad;
+
4239  r->w -= pad;
+
4240  r->h -= pad;
+
4241  stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb);
+
4242  stbtt_GetGlyphBitmapBox(info, glyph,
+
4243  scale * spc->h_oversample,
+
4244  scale * spc->v_oversample,
+
4245  &x0,&y0,&x1,&y1);
+
4246  stbtt_MakeGlyphBitmapSubpixel(info,
+
4247  spc->pixels + r->x + r->y*spc->stride_in_bytes,
+
4248  r->w - spc->h_oversample+1,
+
4249  r->h - spc->v_oversample+1,
+
4250  spc->stride_in_bytes,
+
4251  scale * spc->h_oversample,
+
4252  scale * spc->v_oversample,
+
4253  0,0,
+
4254  glyph);
+
4255 
+
4256  if (spc->h_oversample > 1)
+
4257  stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
+
4258  r->w, r->h, spc->stride_in_bytes,
+
4259  spc->h_oversample);
+
4260 
+
4261  if (spc->v_oversample > 1)
+
4262  stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
+
4263  r->w, r->h, spc->stride_in_bytes,
+
4264  spc->v_oversample);
+
4265 
+
4266  bc->x0 = (stbtt_int16) r->x;
+
4267  bc->y0 = (stbtt_int16) r->y;
+
4268  bc->x1 = (stbtt_int16) (r->x + r->w);
+
4269  bc->y1 = (stbtt_int16) (r->y + r->h);
+
4270  bc->xadvance = scale * advance;
+
4271  bc->xoff = (float) x0 * recip_h + sub_x;
+
4272  bc->yoff = (float) y0 * recip_v + sub_y;
+
4273  bc->xoff2 = (x0 + r->w) * recip_h + sub_x;
+
4274  bc->yoff2 = (y0 + r->h) * recip_v + sub_y;
+
4275 
+
4276  if (glyph == 0)
+
4277  missing_glyph = j;
+
4278  } else if (spc->skip_missing) {
+
4279  return_value = 0;
+
4280  } else if (r->was_packed && r->w == 0 && r->h == 0 && missing_glyph >= 0) {
+
4281  ranges[i].chardata_for_range[j] = ranges[i].chardata_for_range[missing_glyph];
+
4282  } else {
+
4283  return_value = 0; // if any fail, report failure
+
4284  }
+
4285 
+
4286  ++k;
+
4287  }
+
4288  }
+
4289 
+
4290  // restore original values
+
4291  spc->h_oversample = old_h_over;
+
4292  spc->v_oversample = old_v_over;
+
4293 
+
4294  return return_value;
+
4295 }
+
4296 
+
4297 STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects)
+
4298 {
+
4299  stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects);
+
4300 }
+
4301 
+
4302 STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
+
4303 {
+
4304  stbtt_fontinfo info;
+
4305  int i,j,n, return_value = 1;
+
4306  //stbrp_context *context = (stbrp_context *) spc->pack_info;
+
4307  stbrp_rect *rects;
+
4308 
+
4309  // flag all characters as NOT packed
+
4310  for (i=0; i < num_ranges; ++i)
+
4311  for (j=0; j < ranges[i].num_chars; ++j)
+
4312  ranges[i].chardata_for_range[j].x0 =
+
4313  ranges[i].chardata_for_range[j].y0 =
+
4314  ranges[i].chardata_for_range[j].x1 =
+
4315  ranges[i].chardata_for_range[j].y1 = 0;
+
4316 
+
4317  n = 0;
+
4318  for (i=0; i < num_ranges; ++i)
+
4319  n += ranges[i].num_chars;
+
4320 
+
4321  rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
+
4322  if (rects == NULL)
+
4323  return 0;
+
4324 
+
4325  info.userdata = spc->user_allocator_context;
+
4326  stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index));
+
4327 
+
4328  n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);
+
4329 
+
4330  stbtt_PackFontRangesPackRects(spc, rects, n);
+
4331 
+
4332  return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);
+
4333 
+
4334  STBTT_free(rects, spc->user_allocator_context);
+
4335  return return_value;
+
4336 }
+
4337 
+
4338 STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size,
+
4339  int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range)
+
4340 {
+
4341  stbtt_pack_range range;
+
4342  range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range;
+
4343  range.array_of_unicode_codepoints = NULL;
+
4344  range.num_chars = num_chars_in_range;
+
4345  range.chardata_for_range = chardata_for_range;
+
4346  range.font_size = font_size;
+
4347  return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);
+
4348 }
+
4349 
+
4350 STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap)
+
4351 {
+
4352  int i_ascent, i_descent, i_lineGap;
+
4353  float scale;
+
4354  stbtt_fontinfo info;
+
4355  stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index));
+
4356  scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size);
+
4357  stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap);
+
4358  *ascent = (float) i_ascent * scale;
+
4359  *descent = (float) i_descent * scale;
+
4360  *lineGap = (float) i_lineGap * scale;
+
4361 }
+
4362 
+
4363 STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer)
+
4364 {
+
4365  float ipw = 1.0f / pw, iph = 1.0f / ph;
+
4366  const stbtt_packedchar *b = chardata + char_index;
+
4367 
+
4368  if (align_to_integer) {
+
4369  float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f);
+
4370  float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f);
+
4371  q->x0 = x;
+
4372  q->y0 = y;
+
4373  q->x1 = x + b->xoff2 - b->xoff;
+
4374  q->y1 = y + b->yoff2 - b->yoff;
+
4375  } else {
+
4376  q->x0 = *xpos + b->xoff;
+
4377  q->y0 = *ypos + b->yoff;
+
4378  q->x1 = *xpos + b->xoff2;
+
4379  q->y1 = *ypos + b->yoff2;
+
4380  }
+
4381 
+
4382  q->s0 = b->x0 * ipw;
+
4383  q->t0 = b->y0 * iph;
+
4384  q->s1 = b->x1 * ipw;
+
4385  q->t1 = b->y1 * iph;
+
4386 
+
4387  *xpos += b->xadvance;
+
4388 }
+
4389 
+
4391 //
+
4392 // sdf computation
+
4393 //
+
4394 
+
4395 #define STBTT_min(a,b) ((a) < (b) ? (a) : (b))
+
4396 #define STBTT_max(a,b) ((a) < (b) ? (b) : (a))
+
4397 
+
4398 static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], float q0[2], float q1[2], float q2[2], float hits[2][2])
+
4399 {
+
4400  float q0perp = q0[1]*ray[0] - q0[0]*ray[1];
+
4401  float q1perp = q1[1]*ray[0] - q1[0]*ray[1];
+
4402  float q2perp = q2[1]*ray[0] - q2[0]*ray[1];
+
4403  float roperp = orig[1]*ray[0] - orig[0]*ray[1];
+
4404 
+
4405  float a = q0perp - 2*q1perp + q2perp;
+
4406  float b = q1perp - q0perp;
+
4407  float c = q0perp - roperp;
+
4408 
+
4409  float s0 = 0., s1 = 0.;
+
4410  int num_s = 0;
+
4411 
+
4412  if (a != 0.0) {
+
4413  float discr = b*b - a*c;
+
4414  if (discr > 0.0) {
+
4415  float rcpna = -1 / a;
+
4416  float d = (float) STBTT_sqrt(discr);
+
4417  s0 = (b+d) * rcpna;
+
4418  s1 = (b-d) * rcpna;
+
4419  if (s0 >= 0.0 && s0 <= 1.0)
+
4420  num_s = 1;
+
4421  if (d > 0.0 && s1 >= 0.0 && s1 <= 1.0) {
+
4422  if (num_s == 0) s0 = s1;
+
4423  ++num_s;
+
4424  }
+
4425  }
+
4426  } else {
+
4427  // 2*b*s + c = 0
+
4428  // s = -c / (2*b)
+
4429  s0 = c / (-2 * b);
+
4430  if (s0 >= 0.0 && s0 <= 1.0)
+
4431  num_s = 1;
+
4432  }
+
4433 
+
4434  if (num_s == 0)
+
4435  return 0;
+
4436  else {
+
4437  float rcp_len2 = 1 / (ray[0]*ray[0] + ray[1]*ray[1]);
+
4438  float rayn_x = ray[0] * rcp_len2, rayn_y = ray[1] * rcp_len2;
+
4439 
+
4440  float q0d = q0[0]*rayn_x + q0[1]*rayn_y;
+
4441  float q1d = q1[0]*rayn_x + q1[1]*rayn_y;
+
4442  float q2d = q2[0]*rayn_x + q2[1]*rayn_y;
+
4443  float rod = orig[0]*rayn_x + orig[1]*rayn_y;
+
4444 
+
4445  float q10d = q1d - q0d;
+
4446  float q20d = q2d - q0d;
+
4447  float q0rd = q0d - rod;
+
4448 
+
4449  hits[0][0] = q0rd + s0*(2.0f - 2.0f*s0)*q10d + s0*s0*q20d;
+
4450  hits[0][1] = a*s0+b;
+
4451 
+
4452  if (num_s > 1) {
+
4453  hits[1][0] = q0rd + s1*(2.0f - 2.0f*s1)*q10d + s1*s1*q20d;
+
4454  hits[1][1] = a*s1+b;
+
4455  return 2;
+
4456  } else {
+
4457  return 1;
+
4458  }
+
4459  }
+
4460 }
+
4461 
+
4462 static int equal(float *a, float *b)
+
4463 {
+
4464  return (a[0] == b[0] && a[1] == b[1]);
+
4465 }
+
4466 
+
4467 static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex *verts)
+
4468 {
+
4469  int i;
+
4470  float orig[2], ray[2] = { 1, 0 };
+
4471  float y_frac;
+
4472  int winding = 0;
+
4473 
+
4474  // make sure y never passes through a vertex of the shape
+
4475  y_frac = (float) STBTT_fmod(y, 1.0f);
+
4476  if (y_frac < 0.01f)
+
4477  y += 0.01f;
+
4478  else if (y_frac > 0.99f)
+
4479  y -= 0.01f;
+
4480 
+
4481  orig[0] = x;
+
4482  orig[1] = y;
+
4483 
+
4484  // test a ray from (-infinity,y) to (x,y)
+
4485  for (i=0; i < nverts; ++i) {
+
4486  if (verts[i].type == STBTT_vline) {
+
4487  int x0 = (int) verts[i-1].x, y0 = (int) verts[i-1].y;
+
4488  int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y;
+
4489  if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) {
+
4490  float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0;
+
4491  if (x_inter < x)
+
4492  winding += (y0 < y1) ? 1 : -1;
+
4493  }
+
4494  }
+
4495  if (verts[i].type == STBTT_vcurve) {
+
4496  int x0 = (int) verts[i-1].x , y0 = (int) verts[i-1].y ;
+
4497  int x1 = (int) verts[i ].cx, y1 = (int) verts[i ].cy;
+
4498  int x2 = (int) verts[i ].x , y2 = (int) verts[i ].y ;
+
4499  int ax = STBTT_min(x0,STBTT_min(x1,x2)), ay = STBTT_min(y0,STBTT_min(y1,y2));
+
4500  int by = STBTT_max(y0,STBTT_max(y1,y2));
+
4501  if (y > ay && y < by && x > ax) {
+
4502  float q0[2],q1[2],q2[2];
+
4503  float hits[2][2];
+
4504  q0[0] = (float)x0;
+
4505  q0[1] = (float)y0;
+
4506  q1[0] = (float)x1;
+
4507  q1[1] = (float)y1;
+
4508  q2[0] = (float)x2;
+
4509  q2[1] = (float)y2;
+
4510  if (equal(q0,q1) || equal(q1,q2)) {
+
4511  x0 = (int)verts[i-1].x;
+
4512  y0 = (int)verts[i-1].y;
+
4513  x1 = (int)verts[i ].x;
+
4514  y1 = (int)verts[i ].y;
+
4515  if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) {
+
4516  float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0;
+
4517  if (x_inter < x)
+
4518  winding += (y0 < y1) ? 1 : -1;
+
4519  }
+
4520  } else {
+
4521  int num_hits = stbtt__ray_intersect_bezier(orig, ray, q0, q1, q2, hits);
+
4522  if (num_hits >= 1)
+
4523  if (hits[0][0] < 0)
+
4524  winding += (hits[0][1] < 0 ? -1 : 1);
+
4525  if (num_hits >= 2)
+
4526  if (hits[1][0] < 0)
+
4527  winding += (hits[1][1] < 0 ? -1 : 1);
+
4528  }
+
4529  }
+
4530  }
+
4531  }
+
4532  return winding;
+
4533 }
+
4534 
+
4535 static float stbtt__cuberoot( float x )
+
4536 {
+
4537  if (x<0)
+
4538  return -(float) STBTT_pow(-x,1.0f/3.0f);
+
4539  else
+
4540  return (float) STBTT_pow( x,1.0f/3.0f);
+
4541 }
+
4542 
+
4543 // x^3 + a*x^2 + b*x + c = 0
+
4544 static int stbtt__solve_cubic(float a, float b, float c, float* r)
+
4545 {
+
4546  float s = -a / 3;
+
4547  float p = b - a*a / 3;
+
4548  float q = a * (2*a*a - 9*b) / 27 + c;
+
4549  float p3 = p*p*p;
+
4550  float d = q*q + 4*p3 / 27;
+
4551  if (d >= 0) {
+
4552  float z = (float) STBTT_sqrt(d);
+
4553  float u = (-q + z) / 2;
+
4554  float v = (-q - z) / 2;
+
4555  u = stbtt__cuberoot(u);
+
4556  v = stbtt__cuberoot(v);
+
4557  r[0] = s + u + v;
+
4558  return 1;
+
4559  } else {
+
4560  float u = (float) STBTT_sqrt(-p/3);
+
4561  float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative
+
4562  float m = (float) STBTT_cos(v);
+
4563  float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f;
+
4564  r[0] = s + u * 2 * m;
+
4565  r[1] = s - u * (m + n);
+
4566  r[2] = s - u * (m - n);
+
4567 
+
4568  //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe?
+
4569  //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f);
+
4570  //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f);
+
4571  return 3;
+
4572  }
+
4573 }
+
4574 
+
4575 STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff)
+
4576 {
+
4577  float scale_x = scale, scale_y = scale;
+
4578  int ix0,iy0,ix1,iy1;
+
4579  int w,h;
+
4580  unsigned char *data;
+
4581 
+
4582  if (scale == 0) return NULL;
+
4583 
+
4584  stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1);
+
4585 
+
4586  // if empty, return NULL
+
4587  if (ix0 == ix1 || iy0 == iy1)
+
4588  return NULL;
+
4589 
+
4590  ix0 -= padding;
+
4591  iy0 -= padding;
+
4592  ix1 += padding;
+
4593  iy1 += padding;
+
4594 
+
4595  w = (ix1 - ix0);
+
4596  h = (iy1 - iy0);
+
4597 
+
4598  if (width ) *width = w;
+
4599  if (height) *height = h;
+
4600  if (xoff ) *xoff = ix0;
+
4601  if (yoff ) *yoff = iy0;
+
4602 
+
4603  // invert for y-downwards bitmaps
+
4604  scale_y = -scale_y;
+
4605 
+
4606  {
+
4607  int x,y,i,j;
+
4608  float *precompute;
+
4609  stbtt_vertex *verts;
+
4610  int num_verts = stbtt_GetGlyphShape(info, glyph, &verts);
+
4611  data = (unsigned char *) STBTT_malloc(w * h, info->userdata);
+
4612  precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata);
+
4613 
+
4614  for (i=0,j=num_verts-1; i < num_verts; j=i++) {
+
4615  if (verts[i].type == STBTT_vline) {
+
4616  float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y;
+
4617  float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y;
+
4618  float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
+
4619  precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist;
+
4620  } else if (verts[i].type == STBTT_vcurve) {
+
4621  float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y;
+
4622  float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y;
+
4623  float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y;
+
4624  float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2;
+
4625  float len2 = bx*bx + by*by;
+
4626  if (len2 != 0.0f)
+
4627  precompute[i] = 1.0f / (bx*bx + by*by);
+
4628  else
+
4629  precompute[i] = 0.0f;
+
4630  } else
+
4631  precompute[i] = 0.0f;
+
4632  }
+
4633 
+
4634  for (y=iy0; y < iy1; ++y) {
+
4635  for (x=ix0; x < ix1; ++x) {
+
4636  float val;
+
4637  float min_dist = 999999.0f;
+
4638  float sx = (float) x + 0.5f;
+
4639  float sy = (float) y + 0.5f;
+
4640  float x_gspace = (sx / scale_x);
+
4641  float y_gspace = (sy / scale_y);
+
4642 
+
4643  int winding = stbtt__compute_crossings_x(x_gspace, y_gspace, num_verts, verts); // @OPTIMIZE: this could just be a rasterization, but needs to be line vs. non-tesselated curves so a new path
+
4644 
+
4645  for (i=0; i < num_verts; ++i) {
+
4646  float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y;
+
4647 
+
4648  if (verts[i].type == STBTT_vline && precompute[i] != 0.0f) {
+
4649  float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y;
+
4650 
+
4651  float dist,dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy);
+
4652  if (dist2 < min_dist*min_dist)
+
4653  min_dist = (float) STBTT_sqrt(dist2);
+
4654 
+
4655  // coarse culling against bbox
+
4656  //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist &&
+
4657  // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist)
+
4658  dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i];
+
4659  STBTT_assert(i != 0);
+
4660  if (dist < min_dist) {
+
4661  // check position along line
+
4662  // x' = x0 + t*(x1-x0), y' = y0 + t*(y1-y0)
+
4663  // minimize (x'-sx)*(x'-sx)+(y'-sy)*(y'-sy)
+
4664  float dx = x1-x0, dy = y1-y0;
+
4665  float px = x0-sx, py = y0-sy;
+
4666  // minimize (px+t*dx)^2 + (py+t*dy)^2 = px*px + 2*px*dx*t + t^2*dx*dx + py*py + 2*py*dy*t + t^2*dy*dy
+
4667  // derivative: 2*px*dx + 2*py*dy + (2*dx*dx+2*dy*dy)*t, set to 0 and solve
+
4668  float t = -(px*dx + py*dy) / (dx*dx + dy*dy);
+
4669  if (t >= 0.0f && t <= 1.0f)
+
4670  min_dist = dist;
+
4671  }
+
4672  } else if (verts[i].type == STBTT_vcurve) {
+
4673  float x2 = verts[i-1].x *scale_x, y2 = verts[i-1].y *scale_y;
+
4674  float x1 = verts[i ].cx*scale_x, y1 = verts[i ].cy*scale_y;
+
4675  float box_x0 = STBTT_min(STBTT_min(x0,x1),x2);
+
4676  float box_y0 = STBTT_min(STBTT_min(y0,y1),y2);
+
4677  float box_x1 = STBTT_max(STBTT_max(x0,x1),x2);
+
4678  float box_y1 = STBTT_max(STBTT_max(y0,y1),y2);
+
4679  // coarse culling against bbox to avoid computing cubic unnecessarily
+
4680  if (sx > box_x0-min_dist && sx < box_x1+min_dist && sy > box_y0-min_dist && sy < box_y1+min_dist) {
+
4681  int num=0;
+
4682  float ax = x1-x0, ay = y1-y0;
+
4683  float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2;
+
4684  float mx = x0 - sx, my = y0 - sy;
+
4685  float res[3] = {0.f,0.f,0.f};
+
4686  float px,py,t,it,dist2;
+
4687  float a_inv = precompute[i];
+
4688  if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula
+
4689  float a = 3*(ax*bx + ay*by);
+
4690  float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by);
+
4691  float c = mx*ax+my*ay;
+
4692  if (a == 0.0) { // if a is 0, it's linear
+
4693  if (b != 0.0) {
+
4694  res[num++] = -c/b;
+
4695  }
+
4696  } else {
+
4697  float discriminant = b*b - 4*a*c;
+
4698  if (discriminant < 0)
+
4699  num = 0;
+
4700  else {
+
4701  float root = (float) STBTT_sqrt(discriminant);
+
4702  res[0] = (-b - root)/(2*a);
+
4703  res[1] = (-b + root)/(2*a);
+
4704  num = 2; // don't bother distinguishing 1-solution case, as code below will still work
+
4705  }
+
4706  }
+
4707  } else {
+
4708  float b = 3*(ax*bx + ay*by) * a_inv; // could precompute this as it doesn't depend on sample point
+
4709  float c = (2*(ax*ax + ay*ay) + (mx*bx+my*by)) * a_inv;
+
4710  float d = (mx*ax+my*ay) * a_inv;
+
4711  num = stbtt__solve_cubic(b, c, d, res);
+
4712  }
+
4713  dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy);
+
4714  if (dist2 < min_dist*min_dist)
+
4715  min_dist = (float) STBTT_sqrt(dist2);
+
4716 
+
4717  if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) {
+
4718  t = res[0], it = 1.0f - t;
+
4719  px = it*it*x0 + 2*t*it*x1 + t*t*x2;
+
4720  py = it*it*y0 + 2*t*it*y1 + t*t*y2;
+
4721  dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy);
+
4722  if (dist2 < min_dist * min_dist)
+
4723  min_dist = (float) STBTT_sqrt(dist2);
+
4724  }
+
4725  if (num >= 2 && res[1] >= 0.0f && res[1] <= 1.0f) {
+
4726  t = res[1], it = 1.0f - t;
+
4727  px = it*it*x0 + 2*t*it*x1 + t*t*x2;
+
4728  py = it*it*y0 + 2*t*it*y1 + t*t*y2;
+
4729  dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy);
+
4730  if (dist2 < min_dist * min_dist)
+
4731  min_dist = (float) STBTT_sqrt(dist2);
+
4732  }
+
4733  if (num >= 3 && res[2] >= 0.0f && res[2] <= 1.0f) {
+
4734  t = res[2], it = 1.0f - t;
+
4735  px = it*it*x0 + 2*t*it*x1 + t*t*x2;
+
4736  py = it*it*y0 + 2*t*it*y1 + t*t*y2;
+
4737  dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy);
+
4738  if (dist2 < min_dist * min_dist)
+
4739  min_dist = (float) STBTT_sqrt(dist2);
+
4740  }
+
4741  }
+
4742  }
+
4743  }
+
4744  if (winding == 0)
+
4745  min_dist = -min_dist; // if outside the shape, value is negative
+
4746  val = onedge_value + pixel_dist_scale * min_dist;
+
4747  if (val < 0)
+
4748  val = 0;
+
4749  else if (val > 255)
+
4750  val = 255;
+
4751  data[(y-iy0)*w+(x-ix0)] = (unsigned char) val;
+
4752  }
+
4753  }
+
4754  STBTT_free(precompute, info->userdata);
+
4755  STBTT_free(verts, info->userdata);
+
4756  }
+
4757  return data;
+
4758 }
+
4759 
+
4760 STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff)
+
4761 {
+
4762  return stbtt_GetGlyphSDF(info, scale, stbtt_FindGlyphIndex(info, codepoint), padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff);
+
4763 }
+
4764 
+
4765 STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata)
+
4766 {
+
4767  STBTT_free(bitmap, userdata);
+
4768 }
+
4769 
+
4771 //
+
4772 // font name matching -- recommended not to use this
+
4773 //
+
4774 
+
4775 // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string
+
4776 static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2)
+
4777 {
+
4778  stbtt_int32 i=0;
+
4779 
+
4780  // convert utf16 to utf8 and compare the results while converting
+
4781  while (len2) {
+
4782  stbtt_uint16 ch = s2[0]*256 + s2[1];
+
4783  if (ch < 0x80) {
+
4784  if (i >= len1) return -1;
+
4785  if (s1[i++] != ch) return -1;
+
4786  } else if (ch < 0x800) {
+
4787  if (i+1 >= len1) return -1;
+
4788  if (s1[i++] != 0xc0 + (ch >> 6)) return -1;
+
4789  if (s1[i++] != 0x80 + (ch & 0x3f)) return -1;
+
4790  } else if (ch >= 0xd800 && ch < 0xdc00) {
+
4791  stbtt_uint32 c;
+
4792  stbtt_uint16 ch2 = s2[2]*256 + s2[3];
+
4793  if (i+3 >= len1) return -1;
+
4794  c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000;
+
4795  if (s1[i++] != 0xf0 + (c >> 18)) return -1;
+
4796  if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1;
+
4797  if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1;
+
4798  if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1;
+
4799  s2 += 2; // plus another 2 below
+
4800  len2 -= 2;
+
4801  } else if (ch >= 0xdc00 && ch < 0xe000) {
+
4802  return -1;
+
4803  } else {
+
4804  if (i+2 >= len1) return -1;
+
4805  if (s1[i++] != 0xe0 + (ch >> 12)) return -1;
+
4806  if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1;
+
4807  if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1;
+
4808  }
+
4809  s2 += 2;
+
4810  len2 -= 2;
+
4811  }
+
4812  return i;
+
4813 }
+
4814 
+
4815 static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2)
+
4816 {
+
4817  return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2);
+
4818 }
+
4819 
+
4820 // returns results in whatever encoding you request... but note that 2-byte encodings
+
4821 // will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare
+
4822 STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID)
+
4823 {
+
4824  stbtt_int32 i,count,stringOffset;
+
4825  stbtt_uint8 *fc = font->data;
+
4826  stbtt_uint32 offset = font->fontstart;
+
4827  stbtt_uint32 nm = stbtt__find_table(fc, offset, "name");
+
4828  if (!nm) return NULL;
+
4829 
+
4830  count = ttUSHORT(fc+nm+2);
+
4831  stringOffset = nm + ttUSHORT(fc+nm+4);
+
4832  for (i=0; i < count; ++i) {
+
4833  stbtt_uint32 loc = nm + 6 + 12 * i;
+
4834  if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2)
+
4835  && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) {
+
4836  *length = ttUSHORT(fc+loc+8);
+
4837  return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10));
+
4838  }
+
4839  }
+
4840  return NULL;
+
4841 }
+
4842 
+
4843 static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id)
+
4844 {
+
4845  stbtt_int32 i;
+
4846  stbtt_int32 count = ttUSHORT(fc+nm+2);
+
4847  stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4);
+
4848 
+
4849  for (i=0; i < count; ++i) {
+
4850  stbtt_uint32 loc = nm + 6 + 12 * i;
+
4851  stbtt_int32 id = ttUSHORT(fc+loc+6);
+
4852  if (id == target_id) {
+
4853  // find the encoding
+
4854  stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4);
+
4855 
+
4856  // is this a Unicode encoding?
+
4857  if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) {
+
4858  stbtt_int32 slen = ttUSHORT(fc+loc+8);
+
4859  stbtt_int32 off = ttUSHORT(fc+loc+10);
+
4860 
+
4861  // check if there's a prefix match
+
4862  stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen);
+
4863  if (matchlen >= 0) {
+
4864  // check for target_id+1 immediately following, with same encoding & language
+
4865  if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) {
+
4866  slen = ttUSHORT(fc+loc+12+8);
+
4867  off = ttUSHORT(fc+loc+12+10);
+
4868  if (slen == 0) {
+
4869  if (matchlen == nlen)
+
4870  return 1;
+
4871  } else if (matchlen < nlen && name[matchlen] == ' ') {
+
4872  ++matchlen;
+
4873  if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen))
+
4874  return 1;
+
4875  }
+
4876  } else {
+
4877  // if nothing immediately following
+
4878  if (matchlen == nlen)
+
4879  return 1;
+
4880  }
+
4881  }
+
4882  }
+
4883 
+
4884  // @TODO handle other encodings
+
4885  }
+
4886  }
+
4887  return 0;
+
4888 }
+
4889 
+
4890 static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags)
+
4891 {
+
4892  stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name);
+
4893  stbtt_uint32 nm,hd;
+
4894  if (!stbtt__isfont(fc+offset)) return 0;
+
4895 
+
4896  // check italics/bold/underline flags in macStyle...
+
4897  if (flags) {
+
4898  hd = stbtt__find_table(fc, offset, "head");
+
4899  if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0;
+
4900  }
+
4901 
+
4902  nm = stbtt__find_table(fc, offset, "name");
+
4903  if (!nm) return 0;
+
4904 
+
4905  if (flags) {
+
4906  // if we checked the macStyle flags, then just check the family and ignore the subfamily
+
4907  if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1;
+
4908  if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1;
+
4909  if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1;
+
4910  } else {
+
4911  if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1;
+
4912  if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1;
+
4913  if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1;
+
4914  }
+
4915 
+
4916  return 0;
+
4917 }
+
4918 
+
4919 static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags)
+
4920 {
+
4921  stbtt_int32 i;
+
4922  for (i=0;;++i) {
+
4923  stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i);
+
4924  if (off < 0) return off;
+
4925  if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags))
+
4926  return off;
+
4927  }
+
4928 }
+
4929 
+
4930 #if defined(__GNUC__) || defined(__clang__)
+
4931 #pragma GCC diagnostic push
+
4932 #pragma GCC diagnostic ignored "-Wcast-qual"
+
4933 #endif
+
4934 
+
4935 STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset,
+
4936  float pixel_height, unsigned char *pixels, int pw, int ph,
+
4937  int first_char, int num_chars, stbtt_bakedchar *chardata)
+
4938 {
+
4939  return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata);
+
4940 }
+
4941 
+
4942 STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index)
+
4943 {
+
4944  return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index);
+
4945 }
+
4946 
+
4947 STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data)
+
4948 {
+
4949  return stbtt_GetNumberOfFonts_internal((unsigned char *) data);
+
4950 }
+
4951 
+
4952 STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset)
+
4953 {
+
4954  return stbtt_InitFont_internal(info, (unsigned char *) data, offset);
+
4955 }
+
4956 
+
4957 STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags)
+
4958 {
+
4959  return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags);
+
4960 }
+
4961 
+
4962 STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2)
+
4963 {
+
4964  return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2);
+
4965 }
+
4966 
+
4967 #if defined(__GNUC__) || defined(__clang__)
+
4968 #pragma GCC diagnostic pop
+
4969 #endif
+
4970 
+
4971 #endif // STB_TRUETYPE_IMPLEMENTATION
+
4972 
+
4973 
+
4974 // FULL VERSION HISTORY
+
4975 //
+
4976 // 1.25 (2021-07-11) many fixes
+
4977 // 1.24 (2020-02-05) fix warning
+
4978 // 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS)
+
4979 // 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined
+
4980 // 1.21 (2019-02-25) fix warning
+
4981 // 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()
+
4982 // 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod
+
4983 // 1.18 (2018-01-29) add missing function
+
4984 // 1.17 (2017-07-23) make more arguments const; doc fix
+
4985 // 1.16 (2017-07-12) SDF support
+
4986 // 1.15 (2017-03-03) make more arguments const
+
4987 // 1.14 (2017-01-16) num-fonts-in-TTC function
+
4988 // 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts
+
4989 // 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual
+
4990 // 1.11 (2016-04-02) fix unused-variable warning
+
4991 // 1.10 (2016-04-02) allow user-defined fabs() replacement
+
4992 // fix memory leak if fontsize=0.0
+
4993 // fix warning from duplicate typedef
+
4994 // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges
+
4995 // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges
+
4996 // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
+
4997 // allow PackFontRanges to pack and render in separate phases;
+
4998 // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
+
4999 // fixed an assert() bug in the new rasterizer
+
5000 // replace assert() with STBTT_assert() in new rasterizer
+
5001 // 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine)
+
5002 // also more precise AA rasterizer, except if shapes overlap
+
5003 // remove need for STBTT_sort
+
5004 // 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC
+
5005 // 1.04 (2015-04-15) typo in example
+
5006 // 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes
+
5007 // 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++
+
5008 // 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match
+
5009 // non-oversampled; STBTT_POINT_SIZE for packed case only
+
5010 // 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling
+
5011 // 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg)
+
5012 // 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID
+
5013 // 0.8b (2014-07-07) fix a warning
+
5014 // 0.8 (2014-05-25) fix a few more warnings
+
5015 // 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back
+
5016 // 0.6c (2012-07-24) improve documentation
+
5017 // 0.6b (2012-07-20) fix a few more warnings
+
5018 // 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels,
+
5019 // stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty
+
5020 // 0.5 (2011-12-09) bugfixes:
+
5021 // subpixel glyph renderer computed wrong bounding box
+
5022 // first vertex of shape can be off-curve (FreeSans)
+
5023 // 0.4b (2011-12-03) fixed an error in the font baking example
+
5024 // 0.4 (2011-12-01) kerning, subpixel rendering (tor)
+
5025 // bugfixes for:
+
5026 // codepoint-to-glyph conversion using table fmt=12
+
5027 // codepoint-to-glyph conversion using table fmt=4
+
5028 // stbtt_GetBakedQuad with non-square texture (Zer)
+
5029 // updated Hello World! sample to use kerning and subpixel
+
5030 // fixed some warnings
+
5031 // 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM)
+
5032 // userdata, malloc-from-userdata, non-zero fill (stb)
+
5033 // 0.2 (2009-03-11) Fix unsigned/signed char warnings
+
5034 // 0.1 (2009-03-09) First public release
+
5035 //
+
5036 
+
5037 /*
+
5038 ------------------------------------------------------------------------------
+
5039 This software is available under 2 licenses -- choose whichever you prefer.
+
5040 ------------------------------------------------------------------------------
+
5041 ALTERNATIVE A - MIT License
+
5042 Copyright (c) 2017 Sean Barrett
+
5043 Permission is hereby granted, free of charge, to any person obtaining a copy of
+
5044 this software and associated documentation files (the "Software"), to deal in
+
5045 the Software without restriction, including without limitation the rights to
+
5046 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+
5047 of the Software, and to permit persons to whom the Software is furnished to do
+
5048 so, subject to the following conditions:
+
5049 The above copyright notice and this permission notice shall be included in all
+
5050 copies or substantial portions of the Software.
+
5051 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
5052 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
5053 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
5054 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
5055 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
5056 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
5057 SOFTWARE.
+
5058 ------------------------------------------------------------------------------
+
5059 ALTERNATIVE B - Public Domain (www.unlicense.org)
+
5060 This is free and unencumbered software released into the public domain.
+
5061 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+
5062 software, either in source code form or as a compiled binary, for any purpose,
+
5063 commercial or non-commercial, and by any means.
+
5064 In jurisdictions that recognize copyright laws, the author or authors of this
+
5065 software dedicate any and all copyright interest in the software to the public
+
5066 domain. We make this dedication for the benefit of the public at large and to
+
5067 the detriment of our heirs and successors. We intend this dedication to be an
+
5068 overt act of relinquishment in perpetuity of all present and future rights to
+
5069 this software under copyright law.
+
5070 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
5071 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
5072 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
5073 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+
5074 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+
5075 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
5076 ------------------------------------------------------------------------------
+
5077 */
+ + + + + + + + + + + + + +
+
+ + + + diff --git a/structnk__allocator.html b/structnk__allocator.html new file mode 100644 index 000000000..add0c8743 --- /dev/null +++ b/structnk__allocator.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_allocator Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_allocator Struct Reference
+
+
+
+Collaboration diagram for nk_allocator:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+nk_handle userdata
 
+nk_plugin_alloc alloc
 
+nk_plugin_free free
 
+

Detailed Description

+
+

Definition at line 293 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__allocator.js b/structnk__allocator.js new file mode 100644 index 000000000..5963d346e --- /dev/null +++ b/structnk__allocator.js @@ -0,0 +1,6 @@ +var structnk__allocator = +[ + [ "alloc", "structnk__allocator.html#ad99f758ced10853bb1cb6f56b6c586f9", null ], + [ "free", "structnk__allocator.html#af190be0e199490790ccc1f2877c2d77e", null ], + [ "userdata", "structnk__allocator.html#a15aa4d412b676a8578ed07f73eac6455", null ] +]; \ No newline at end of file diff --git a/structnk__allocator__coll__graph.dot b/structnk__allocator__coll__graph.dot new file mode 100644 index 000000000..883d4fb51 --- /dev/null +++ b/structnk__allocator__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_allocator" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node2 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__buffer.html b/structnk__buffer.html new file mode 100644 index 000000000..82b03026a --- /dev/null +++ b/structnk__buffer.html @@ -0,0 +1,162 @@ + + + + + + + +Nuklear: nk_buffer Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_buffer Struct Reference
+
+
+
+Collaboration diagram for nk_buffer:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_buffer_marker marker [NK_BUFFER_MAX]
 
+struct nk_allocator pool
 !< buffer marker to free a buffer to a certain offset
 
+enum nk_allocation_type type
 !< allocator callback for dynamic buffers
 
+struct nk_memory memory
 !< memory management type
 
+float grow_factor
 !< memory and size of the current memory block
 
+nk_size allocated
 !< growing factor for dynamic memory management
 
+nk_size needed
 !< total amount of memory allocated
 
+nk_size calls
 !< totally consumed memory given that enough memory is present
 
+nk_size size
 !< number of allocation calls
 
+

Detailed Description

+
+

Definition at line 4189 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__buffer.js b/structnk__buffer.js new file mode 100644 index 000000000..b6c8b2600 --- /dev/null +++ b/structnk__buffer.js @@ -0,0 +1,12 @@ +var structnk__buffer = +[ + [ "allocated", "structnk__buffer.html#a91e9be62aa08687400bc00059825de02", null ], + [ "calls", "structnk__buffer.html#acd962a6e042a8ffabac679768e4851bb", null ], + [ "grow_factor", "structnk__buffer.html#ab4ec59165f6aa6e9358bced8070cc84e", null ], + [ "marker", "structnk__buffer.html#aaa4beec86444feb7908aad98c20b6849", null ], + [ "memory", "structnk__buffer.html#a228b585debec1d328859fb52080ca3fd", null ], + [ "needed", "structnk__buffer.html#a6b0ea49209eaba5285b715d902c5f446", null ], + [ "pool", "structnk__buffer.html#a0cd2b90bb2994190fa1aa0e9ffbc1184", null ], + [ "size", "structnk__buffer.html#a71e66eb6dad2c5827e363f2389ad4505", null ], + [ "type", "structnk__buffer.html#a3842a03554db557944e84bc5af61249e", null ] +]; \ No newline at end of file diff --git a/structnk__buffer__coll__graph.dot b/structnk__buffer__coll__graph.dot new file mode 100644 index 000000000..05933c016 --- /dev/null +++ b/structnk__buffer__coll__graph.dot @@ -0,0 +1,15 @@ +digraph "nk_buffer" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node2 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node4 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node5 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; +} diff --git a/structnk__buffer__marker.html b/structnk__buffer__marker.html new file mode 100644 index 000000000..69e6ab120 --- /dev/null +++ b/structnk__buffer__marker.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_buffer_marker Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_buffer_marker Struct Reference
+
+
+ + + + + + +

+Data Fields

+nk_bool active
 
+nk_size offset
 
+

Detailed Description

+
+

Definition at line 4183 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__buffer__marker.js b/structnk__buffer__marker.js new file mode 100644 index 000000000..d1a7f7cb4 --- /dev/null +++ b/structnk__buffer__marker.js @@ -0,0 +1,5 @@ +var structnk__buffer__marker = +[ + [ "active", "structnk__buffer__marker.html#aff3980487974aab41e3faf5f84c42dcf", null ], + [ "offset", "structnk__buffer__marker.html#a225c3628eb1e93f2400496110c4bd87a", null ] +]; \ No newline at end of file diff --git a/structnk__chart.html b/structnk__chart.html new file mode 100644 index 000000000..72555de79 --- /dev/null +++ b/structnk__chart.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_chart Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_chart Struct Reference
+
+
+
+Collaboration diagram for nk_chart:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+int slot
 
+float x
 
+float y
 
+float w
 
+float h
 
+struct nk_chart_slot slots [NK_CHART_MAX_SLOT]
 
+

Detailed Description

+
+

Definition at line 5415 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__chart.js b/structnk__chart.js new file mode 100644 index 000000000..6c1729dd9 --- /dev/null +++ b/structnk__chart.js @@ -0,0 +1,9 @@ +var structnk__chart = +[ + [ "h", "structnk__chart.html#a7c8799e3f091c21a8df50290d5a69d45", null ], + [ "slot", "structnk__chart.html#a7efbaddcc43ef4b3a74e843c2fad9efb", null ], + [ "slots", "structnk__chart.html#abd217868acd2a20d1ff27914156573ac", null ], + [ "w", "structnk__chart.html#acc9a21d99c3d518b74e736a0bee2f699", null ], + [ "x", "structnk__chart.html#a62ce20cad6ebcb59d5d7a5033fb0cdbc", null ], + [ "y", "structnk__chart.html#ab412562c43ee5deec5ae0527325089f4", null ] +]; \ No newline at end of file diff --git a/structnk__chart__coll__graph.dot b/structnk__chart__coll__graph.dot new file mode 100644 index 000000000..42a5655dd --- /dev/null +++ b/structnk__chart__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_chart" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node2 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node3 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node4 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__chart__slot.html b/structnk__chart__slot.html new file mode 100644 index 000000000..af25cf5f9 --- /dev/null +++ b/structnk__chart__slot.html @@ -0,0 +1,157 @@ + + + + + + + +Nuklear: nk_chart_slot Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_chart_slot Struct Reference
+
+
+
+Collaboration diagram for nk_chart_slot:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+enum nk_chart_type type
 
+struct nk_color color
 
+struct nk_color highlight
 
+float min
 
+float max
 
+float range
 
+int count
 
+struct nk_vec2 last
 
+int index
 
+nk_bool show_markers
 
+

Detailed Description

+
+

Definition at line 5404 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__chart__slot.js b/structnk__chart__slot.js new file mode 100644 index 000000000..7c745ae36 --- /dev/null +++ b/structnk__chart__slot.js @@ -0,0 +1,13 @@ +var structnk__chart__slot = +[ + [ "color", "structnk__chart__slot.html#a0c316cc7cef54dd2f0857bf6f5108a28", null ], + [ "count", "structnk__chart__slot.html#a0b700427a0a5f1431331629763476afb", null ], + [ "highlight", "structnk__chart__slot.html#a0336ff329d36a3422aeec4c3009f02ce", null ], + [ "index", "structnk__chart__slot.html#ae66e71dddf3f3811ebfd06a21c49157e", null ], + [ "last", "structnk__chart__slot.html#a2bd8d754537102846247d40483a97239", null ], + [ "max", "structnk__chart__slot.html#a58aa25a63cb64e32048c76ef309e77f1", null ], + [ "min", "structnk__chart__slot.html#ae7c42d9f745b91c73c838a6029c3380a", null ], + [ "range", "structnk__chart__slot.html#a60431f77dd3aff82aba2b751034a8638", null ], + [ "show_markers", "structnk__chart__slot.html#a2f6c44e075a58818d39d1739f265aa89", null ], + [ "type", "structnk__chart__slot.html#a5ddac2544ff93ee695d262fb11274c27", null ] +]; \ No newline at end of file diff --git a/structnk__chart__slot__coll__graph.dot b/structnk__chart__slot__coll__graph.dot new file mode 100644 index 000000000..7d4bd09d5 --- /dev/null +++ b/structnk__chart__slot__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_chart_slot" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node3 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__clipboard.html b/structnk__clipboard.html new file mode 100644 index 000000000..44fb4fb6f --- /dev/null +++ b/structnk__clipboard.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_clipboard Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_clipboard Struct Reference
+
+
+
+Collaboration diagram for nk_clipboard:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+nk_handle userdata
 
+nk_plugin_paste paste
 
+nk_plugin_copy copy
 
+

Detailed Description

+
+

Definition at line 4312 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__clipboard.js b/structnk__clipboard.js new file mode 100644 index 000000000..bffc08487 --- /dev/null +++ b/structnk__clipboard.js @@ -0,0 +1,6 @@ +var structnk__clipboard = +[ + [ "copy", "structnk__clipboard.html#a3fa8f2ea1924acce4456e714f575ddb4", null ], + [ "paste", "structnk__clipboard.html#ac3224d9fcbceaed96f4c5740cd76797d", null ], + [ "userdata", "structnk__clipboard.html#a40e1bfd251716852fe3fa3f6856aeb2c", null ] +]; \ No newline at end of file diff --git a/structnk__clipboard__coll__graph.dot b/structnk__clipboard__coll__graph.dot new file mode 100644 index 000000000..d2e63fd43 --- /dev/null +++ b/structnk__clipboard__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_clipboard" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_clipboard",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" copy\npaste\nuserdata" ,fontname="Helvetica"]; + Node2 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__color.html b/structnk__color.html new file mode 100644 index 000000000..e0501e65e --- /dev/null +++ b/structnk__color.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_color Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_color Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+nk_byte r
 
+nk_byte g
 
+nk_byte b
 
+nk_byte a
 
+

Detailed Description

+
+

Definition at line 261 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__color.js b/structnk__color.js new file mode 100644 index 000000000..1384bbd66 --- /dev/null +++ b/structnk__color.js @@ -0,0 +1,7 @@ +var structnk__color = +[ + [ "a", "structnk__color.html#a5201902552072c321cb43bb0e821fde8", null ], + [ "b", "structnk__color.html#abce18b5d5e10d175f553cf1b91fee9d4", null ], + [ "g", "structnk__color.html#a5f9b6e27eec7cc99ab12fa52a31ca6d1", null ], + [ "r", "structnk__color.html#a8c27a9094c4cc8a24adfd111f1c38812", null ] +]; \ No newline at end of file diff --git a/structnk__colorf.html b/structnk__colorf.html new file mode 100644 index 000000000..416838e6b --- /dev/null +++ b/structnk__colorf.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_colorf Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_colorf Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+float r
 
+float g
 
+float b
 
+float a
 
+

Detailed Description

+
+

Definition at line 262 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__colorf.js b/structnk__colorf.js new file mode 100644 index 000000000..e16e3e9a1 --- /dev/null +++ b/structnk__colorf.js @@ -0,0 +1,7 @@ +var structnk__colorf = +[ + [ "a", "structnk__colorf.html#aff9db540076346a2563bab0d7cd9ef86", null ], + [ "b", "structnk__colorf.html#a616fe0dea8242077a5f13bc0296bde85", null ], + [ "g", "structnk__colorf.html#a41ff42d9dce5f1812132b305cf3395fb", null ], + [ "r", "structnk__colorf.html#a19908af2a694aa5dd2f0d045b5bc69c1", null ] +]; \ No newline at end of file diff --git a/structnk__command.html b/structnk__command.html new file mode 100644 index 000000000..c0cf0ff1e --- /dev/null +++ b/structnk__command.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_command Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command Struct Reference
+
+
+ +

command base and header of every command inside the buffer + More...

+ +

#include <nuklear.h>

+ + + + + + +

+Data Fields

+enum nk_command_type type
 
+nk_size next
 
+

Detailed Description

+

command base and header of every command inside the buffer

+ +

Definition at line 4467 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command.js b/structnk__command.js new file mode 100644 index 000000000..88d5b9e85 --- /dev/null +++ b/structnk__command.js @@ -0,0 +1,5 @@ +var structnk__command = +[ + [ "next", "structnk__command.html#a5b3ef494f3ab1e30cb7822499a5a7b56", null ], + [ "type", "structnk__command.html#a0bd82809bee01cfb621f9ebcabd050b5", null ] +]; \ No newline at end of file diff --git a/structnk__command__arc.html b/structnk__command__arc.html new file mode 100644 index 000000000..e4fc5189c --- /dev/null +++ b/structnk__command__arc.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_arc Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_arc Struct Reference
+
+
+
+Collaboration diagram for nk_command_arc:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short cx
 
+short cy
 
+unsigned short r
 
+unsigned short line_thickness
 
+float a [2]
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4557 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__arc.js b/structnk__command__arc.js new file mode 100644 index 000000000..6457afd4e --- /dev/null +++ b/structnk__command__arc.js @@ -0,0 +1,10 @@ +var structnk__command__arc = +[ + [ "a", "structnk__command__arc.html#a446403034fc3de885fe610d9fdd7c7bb", null ], + [ "color", "structnk__command__arc.html#ab74d0d447665a04b87b656eb300a5884", null ], + [ "cx", "structnk__command__arc.html#ac348e962a2508e0c537b6dd5c8363b01", null ], + [ "cy", "structnk__command__arc.html#ac4a837a3aa6f5e59dc872d7ef0a37cde", null ], + [ "header", "structnk__command__arc.html#a0aa359ae78961f4c9b4ff5f004e7df61", null ], + [ "line_thickness", "structnk__command__arc.html#a6ba6c78fea7429e1ec08d4f1f6e5cf99", null ], + [ "r", "structnk__command__arc.html#a46c4562ff5abdf1c75bc95ba86f9f9ba", null ] +]; \ No newline at end of file diff --git a/structnk__command__arc__coll__graph.dot b/structnk__command__arc__coll__graph.dot new file mode 100644 index 000000000..7acb85655 --- /dev/null +++ b/structnk__command__arc__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_arc" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_arc",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__arc__filled.html b/structnk__command__arc__filled.html new file mode 100644 index 000000000..a18bbc239 --- /dev/null +++ b/structnk__command__arc__filled.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_command_arc_filled Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_arc_filled Struct Reference
+
+
+
+Collaboration diagram for nk_command_arc_filled:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short cx
 
+short cy
 
+unsigned short r
 
+float a [2]
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4566 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__arc__filled.js b/structnk__command__arc__filled.js new file mode 100644 index 000000000..57a6f03a5 --- /dev/null +++ b/structnk__command__arc__filled.js @@ -0,0 +1,9 @@ +var structnk__command__arc__filled = +[ + [ "a", "structnk__command__arc__filled.html#aeffc48c9cae2eec6e3bc4835ef330377", null ], + [ "color", "structnk__command__arc__filled.html#adcc1cdd72808838ae02c4b552c4f3229", null ], + [ "cx", "structnk__command__arc__filled.html#aa460de8a71d839c0b07272e73d3cadf4", null ], + [ "cy", "structnk__command__arc__filled.html#a256160e8fe2a191ce9932e83f6cb2b07", null ], + [ "header", "structnk__command__arc__filled.html#a5dab5721944b118c5baae25ab8654ecb", null ], + [ "r", "structnk__command__arc__filled.html#a31784cc181f33422ea8b09bc01463937", null ] +]; \ No newline at end of file diff --git a/structnk__command__arc__filled__coll__graph.dot b/structnk__command__arc__filled__coll__graph.dot new file mode 100644 index 000000000..13bf38053 --- /dev/null +++ b/structnk__command__arc__filled__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_arc_filled" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_arc_filled",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__buffer.html b/structnk__command__buffer.html new file mode 100644 index 000000000..3bcac7b2c --- /dev/null +++ b/structnk__command__buffer.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_buffer Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_buffer Struct Reference
+
+
+
+Collaboration diagram for nk_command_buffer:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_bufferbase
 
+struct nk_rect clip
 
+int use_clipping
 
+nk_handle userdata
 
+nk_size begin
 
+nk_size end
 
+nk_size last
 
+

Detailed Description

+
+

Definition at line 4632 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__buffer.js b/structnk__command__buffer.js new file mode 100644 index 000000000..7ddc489be --- /dev/null +++ b/structnk__command__buffer.js @@ -0,0 +1,10 @@ +var structnk__command__buffer = +[ + [ "base", "structnk__command__buffer.html#a2f4ee111972e35eb24365a245f858006", null ], + [ "begin", "structnk__command__buffer.html#a7c3c96052c6c8461ea78e7c4c6ed8ab2", null ], + [ "clip", "structnk__command__buffer.html#a65da2f77d2ce8eb0a6ac6a0861e39382", null ], + [ "end", "structnk__command__buffer.html#a12fd620faceb994143967021e44a8b71", null ], + [ "last", "structnk__command__buffer.html#a6334ab37cb3c65736585a30fc3e19c01", null ], + [ "use_clipping", "structnk__command__buffer.html#a65f789788b8a857efa0c4080781591f7", null ], + [ "userdata", "structnk__command__buffer.html#adc12ff0f2c3965f2df8da6d83c5b9903", null ] +]; \ No newline at end of file diff --git a/structnk__command__buffer__coll__graph.dot b/structnk__command__buffer__coll__graph.dot new file mode 100644 index 000000000..0ea4ba83a --- /dev/null +++ b/structnk__command__buffer__coll__graph.dot @@ -0,0 +1,20 @@ +digraph "nk_command_buffer" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node2 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node3 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node4 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node5 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node6 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node6 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node7 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__command__circle.html b/structnk__command__circle.html new file mode 100644 index 000000000..1fae779de --- /dev/null +++ b/structnk__command__circle.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_circle Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_circle Struct Reference
+
+
+
+Collaboration diagram for nk_command_circle:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short line_thickness
 
+unsigned short w
 
+unsigned short h
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4542 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__circle.js b/structnk__command__circle.js new file mode 100644 index 000000000..6a1edb485 --- /dev/null +++ b/structnk__command__circle.js @@ -0,0 +1,10 @@ +var structnk__command__circle = +[ + [ "color", "structnk__command__circle.html#aa9f19465515260dc83e60cab859cb040", null ], + [ "h", "structnk__command__circle.html#a88c469119d31c7e7ea9c0b10814db875", null ], + [ "header", "structnk__command__circle.html#a30307deb035c1dccf43c849fd04a11f7", null ], + [ "line_thickness", "structnk__command__circle.html#a116b0d9a26840d54000e63dbcf0829ac", null ], + [ "w", "structnk__command__circle.html#a07238a686ed308b4d1802a35b587eb0d", null ], + [ "x", "structnk__command__circle.html#a31305a7d86f24c473a1368822582d856", null ], + [ "y", "structnk__command__circle.html#adbeef71bac7e533fe09e059a9c1969e4", null ] +]; \ No newline at end of file diff --git a/structnk__command__circle__coll__graph.dot b/structnk__command__circle__coll__graph.dot new file mode 100644 index 000000000..24781c6f0 --- /dev/null +++ b/structnk__command__circle__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_circle" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_circle",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__circle__filled.html b/structnk__command__circle__filled.html new file mode 100644 index 000000000..df8604fe0 --- /dev/null +++ b/structnk__command__circle__filled.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_command_circle_filled Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_circle_filled Struct Reference
+
+
+
+Collaboration diagram for nk_command_circle_filled:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4550 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__circle__filled.js b/structnk__command__circle__filled.js new file mode 100644 index 000000000..162e52e3d --- /dev/null +++ b/structnk__command__circle__filled.js @@ -0,0 +1,9 @@ +var structnk__command__circle__filled = +[ + [ "color", "structnk__command__circle__filled.html#a3ccbfd9af3e71ceeae359b12f171128e", null ], + [ "h", "structnk__command__circle__filled.html#a60c15bfe4b517a9b0b2a3a8806ff360b", null ], + [ "header", "structnk__command__circle__filled.html#a42a9f266f1068910d9c7fac048c4d590", null ], + [ "w", "structnk__command__circle__filled.html#aafd7973ccf4203a120db5510ea11a98d", null ], + [ "x", "structnk__command__circle__filled.html#ac8d5a03cb675627590860653ae24eec4", null ], + [ "y", "structnk__command__circle__filled.html#a85b0338c5be8741816dd7f9ba0693918", null ] +]; \ No newline at end of file diff --git a/structnk__command__circle__filled__coll__graph.dot b/structnk__command__circle__filled__coll__graph.dot new file mode 100644 index 000000000..a5dbf7629 --- /dev/null +++ b/structnk__command__circle__filled__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_circle_filled" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_circle_filled",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__curve.html b/structnk__command__curve.html new file mode 100644 index 000000000..ef8b85001 --- /dev/null +++ b/structnk__command__curve.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_command_curve Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_curve Struct Reference
+
+
+
+Collaboration diagram for nk_command_curve:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+unsigned short line_thickness
 
+struct nk_vec2i begin
 
+struct nk_vec2i end
 
+struct nk_vec2i ctrl [2]
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4489 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__curve.js b/structnk__command__curve.js new file mode 100644 index 000000000..67e094020 --- /dev/null +++ b/structnk__command__curve.js @@ -0,0 +1,9 @@ +var structnk__command__curve = +[ + [ "begin", "structnk__command__curve.html#ac90ce7358b1ed8d529d2cbaec92c2fd7", null ], + [ "color", "structnk__command__curve.html#a9e3bd7fb76b0ca7be0fd1a215bf28858", null ], + [ "ctrl", "structnk__command__curve.html#a237c28ec24d044902526a37ba721d325", null ], + [ "end", "structnk__command__curve.html#aa69e2aea76ec8cadbf55fd27557d6582", null ], + [ "header", "structnk__command__curve.html#a4a83c7e8c5ba8b4340238f9a7401461d", null ], + [ "line_thickness", "structnk__command__curve.html#ae780aa8003d662d9873cba9527b0a02c", null ] +]; \ No newline at end of file diff --git a/structnk__command__curve__coll__graph.dot b/structnk__command__curve__coll__graph.dot new file mode 100644 index 000000000..9f4580b1e --- /dev/null +++ b/structnk__command__curve__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_curve" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_curve",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" begin\nctrl\nend" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__custom.html b/structnk__command__custom.html new file mode 100644 index 000000000..7c7fb7fae --- /dev/null +++ b/structnk__command__custom.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_custom Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_custom Struct Reference
+
+
+
+Collaboration diagram for nk_command_custom:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+nk_handle callback_data
 
+nk_command_custom_callback callback
 
+

Detailed Description

+
+

Definition at line 4607 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__custom.js b/structnk__command__custom.js new file mode 100644 index 000000000..f59ba1581 --- /dev/null +++ b/structnk__command__custom.js @@ -0,0 +1,10 @@ +var structnk__command__custom = +[ + [ "callback", "structnk__command__custom.html#ada2427e791d8e1d96264f9873b1d5e08", null ], + [ "callback_data", "structnk__command__custom.html#ae4d6bed7d6f565ecf799ad64e06be834", null ], + [ "h", "structnk__command__custom.html#aeeef97c98b0b23de526713fcb88fb536", null ], + [ "header", "structnk__command__custom.html#a2694ddc1418ae575b1f2a594327a113a", null ], + [ "w", "structnk__command__custom.html#a13aad7adc5361402e2f375bde35c6cae", null ], + [ "x", "structnk__command__custom.html#a847207902e09d1aa6dc974fc226c463b", null ], + [ "y", "structnk__command__custom.html#a11a17cf05108285041473a0b44c81154", null ] +]; \ No newline at end of file diff --git a/structnk__command__custom__coll__graph.dot b/structnk__command__custom__coll__graph.dot new file mode 100644 index 000000000..0e0bd24d9 --- /dev/null +++ b/structnk__command__custom__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_custom" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_custom",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node2 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" callback\ncallback_data" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__command__image.html b/structnk__command__image.html new file mode 100644 index 000000000..1c82726dc --- /dev/null +++ b/structnk__command__image.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_image Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_image Struct Reference
+
+
+
+Collaboration diagram for nk_command_image:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+struct nk_image img
 
+struct nk_color col
 
+

Detailed Description

+
+

Definition at line 4597 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__image.js b/structnk__command__image.js new file mode 100644 index 000000000..af1f0db62 --- /dev/null +++ b/structnk__command__image.js @@ -0,0 +1,10 @@ +var structnk__command__image = +[ + [ "col", "structnk__command__image.html#a2d98223c2a444c2916b05c01986fca8d", null ], + [ "h", "structnk__command__image.html#a366459669a34bc07fcb2b66d01159ebf", null ], + [ "header", "structnk__command__image.html#a7f6037a268632506b1de92d2a16e9c5c", null ], + [ "img", "structnk__command__image.html#ac95060c32a20e739a464fb40234282fa", null ], + [ "w", "structnk__command__image.html#aa1dc36e2ba784ad28bcb341a3494f549", null ], + [ "x", "structnk__command__image.html#aaaf990c35a61ed7fe29a292d85eb636c", null ], + [ "y", "structnk__command__image.html#a918d37c9a97ec8ef3541fc611da83264", null ] +]; \ No newline at end of file diff --git a/structnk__command__image__coll__graph.dot b/structnk__command__image__coll__graph.dot new file mode 100644 index 000000000..eb8296ba9 --- /dev/null +++ b/structnk__command__image__coll__graph.dot @@ -0,0 +1,15 @@ +digraph "nk_command_image" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_image",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" col" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node3 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node4 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node5 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__line.html b/structnk__command__line.html new file mode 100644 index 000000000..37c650547 --- /dev/null +++ b/structnk__command__line.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_command_line Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_line Struct Reference
+
+
+
+Collaboration diagram for nk_command_line:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+unsigned short line_thickness
 
+struct nk_vec2i begin
 
+struct nk_vec2i end
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4481 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__line.js b/structnk__command__line.js new file mode 100644 index 000000000..e84d27bdb --- /dev/null +++ b/structnk__command__line.js @@ -0,0 +1,8 @@ +var structnk__command__line = +[ + [ "begin", "structnk__command__line.html#aaebd3121f997d61e5cd2afbd2a63258e", null ], + [ "color", "structnk__command__line.html#abc13f5b8ba019c8b0ef619ee8a3fc73d", null ], + [ "end", "structnk__command__line.html#abae974f2c6c475c9cdd5d19e8c5a3ba1", null ], + [ "header", "structnk__command__line.html#a9ca513e60a7dabaaa4048ffecf0b86c9", null ], + [ "line_thickness", "structnk__command__line.html#a4cf2513ba2e852022553f1d7fff74d05", null ] +]; \ No newline at end of file diff --git a/structnk__command__line__coll__graph.dot b/structnk__command__line__coll__graph.dot new file mode 100644 index 000000000..f72e3414d --- /dev/null +++ b/structnk__command__line__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_line" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_line",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" begin\nend" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__polygon.html b/structnk__command__polygon.html new file mode 100644 index 000000000..ff70e9f7c --- /dev/null +++ b/structnk__command__polygon.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_command_polygon Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_polygon Struct Reference
+
+
+
+Collaboration diagram for nk_command_polygon:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+struct nk_color color
 
+unsigned short line_thickness
 
+unsigned short point_count
 
+struct nk_vec2i points [1]
 
+

Detailed Description

+
+

Definition at line 4574 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__polygon.js b/structnk__command__polygon.js new file mode 100644 index 000000000..5b5c99656 --- /dev/null +++ b/structnk__command__polygon.js @@ -0,0 +1,8 @@ +var structnk__command__polygon = +[ + [ "color", "structnk__command__polygon.html#ab7b7b39934676870924a6793dc2dc00f", null ], + [ "header", "structnk__command__polygon.html#a62fcb322cddbbc496b698ac0fe70e811", null ], + [ "line_thickness", "structnk__command__polygon.html#a866c970775ae0a05527d80878f597245", null ], + [ "point_count", "structnk__command__polygon.html#aae8b227a3aaec19baf32f06b28449728", null ], + [ "points", "structnk__command__polygon.html#ae28ff35fae64f9f3977d0402121db223", null ] +]; \ No newline at end of file diff --git a/structnk__command__polygon__coll__graph.dot b/structnk__command__polygon__coll__graph.dot new file mode 100644 index 000000000..4926be797 --- /dev/null +++ b/structnk__command__polygon__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_polygon" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_polygon",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" points" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__polygon__filled.html b/structnk__command__polygon__filled.html new file mode 100644 index 000000000..80c0166da --- /dev/null +++ b/structnk__command__polygon__filled.html @@ -0,0 +1,139 @@ + + + + + + + +Nuklear: nk_command_polygon_filled Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_polygon_filled Struct Reference
+
+
+
+Collaboration diagram for nk_command_polygon_filled:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+struct nk_color color
 
+unsigned short point_count
 
+struct nk_vec2i points [1]
 
+

Detailed Description

+
+

Definition at line 4582 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__polygon__filled.js b/structnk__command__polygon__filled.js new file mode 100644 index 000000000..69dacf9ff --- /dev/null +++ b/structnk__command__polygon__filled.js @@ -0,0 +1,7 @@ +var structnk__command__polygon__filled = +[ + [ "color", "structnk__command__polygon__filled.html#aba8305ce94bcec6ef9800878279b426b", null ], + [ "header", "structnk__command__polygon__filled.html#af92b38523df52be6497c62b27887ce3f", null ], + [ "point_count", "structnk__command__polygon__filled.html#a77c628f3053bba44270489623fafcc21", null ], + [ "points", "structnk__command__polygon__filled.html#a65b585227f390f0be21ce32828a09a99", null ] +]; \ No newline at end of file diff --git a/structnk__command__polygon__filled__coll__graph.dot b/structnk__command__polygon__filled__coll__graph.dot new file mode 100644 index 000000000..d9320d49c --- /dev/null +++ b/structnk__command__polygon__filled__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_polygon_filled" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_polygon\l_filled",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" points" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__polyline.html b/structnk__command__polyline.html new file mode 100644 index 000000000..65b568c6e --- /dev/null +++ b/structnk__command__polyline.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_command_polyline Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_polyline Struct Reference
+
+
+
+Collaboration diagram for nk_command_polyline:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+struct nk_color color
 
+unsigned short line_thickness
 
+unsigned short point_count
 
+struct nk_vec2i points [1]
 
+

Detailed Description

+
+

Definition at line 4589 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__polyline.js b/structnk__command__polyline.js new file mode 100644 index 000000000..bf75d9a9b --- /dev/null +++ b/structnk__command__polyline.js @@ -0,0 +1,8 @@ +var structnk__command__polyline = +[ + [ "color", "structnk__command__polyline.html#a9ff77b8a3788b03ea52a7ef5b472f70c", null ], + [ "header", "structnk__command__polyline.html#ac4b2857834ce82c7780d20993f665c69", null ], + [ "line_thickness", "structnk__command__polyline.html#a1413616519a1bfbacf3ea85455d6ccad", null ], + [ "point_count", "structnk__command__polyline.html#accef2f25308202055403979b4b8a0deb", null ], + [ "points", "structnk__command__polyline.html#a7a12da93e13f22c6286c0e3f608170b5", null ] +]; \ No newline at end of file diff --git a/structnk__command__polyline__coll__graph.dot b/structnk__command__polyline__coll__graph.dot new file mode 100644 index 000000000..48458c6cd --- /dev/null +++ b/structnk__command__polyline__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_polyline" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_polyline",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" points" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__rect.html b/structnk__command__rect.html new file mode 100644 index 000000000..f89522d9e --- /dev/null +++ b/structnk__command__rect.html @@ -0,0 +1,151 @@ + + + + + + + +Nuklear: nk_command_rect Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_rect Struct Reference
+
+
+
+Collaboration diagram for nk_command_rect:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+unsigned short rounding
 
+unsigned short line_thickness
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4498 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__rect.js b/structnk__command__rect.js new file mode 100644 index 000000000..efc760d86 --- /dev/null +++ b/structnk__command__rect.js @@ -0,0 +1,11 @@ +var structnk__command__rect = +[ + [ "color", "structnk__command__rect.html#a459f754c3020184bee8e866ce280b219", null ], + [ "h", "structnk__command__rect.html#a430ba7f3274d6746f3ffaf2d92b26b83", null ], + [ "header", "structnk__command__rect.html#af226093def19264b5fe9ca10beee0858", null ], + [ "line_thickness", "structnk__command__rect.html#a6261e370240fb8d33f54d1e69e5a628c", null ], + [ "rounding", "structnk__command__rect.html#a577dba663ae1e3f6c91b9cb9a515f0aa", null ], + [ "w", "structnk__command__rect.html#a4f1ab19724e091adb07766db30aef2a3", null ], + [ "x", "structnk__command__rect.html#af6a275761f7d8eef83312ddb18f1fd9a", null ], + [ "y", "structnk__command__rect.html#a15646d8a746934d4748a9761b9b9a6e6", null ] +]; \ No newline at end of file diff --git a/structnk__command__rect__coll__graph.dot b/structnk__command__rect__coll__graph.dot new file mode 100644 index 000000000..9fd144915 --- /dev/null +++ b/structnk__command__rect__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_rect" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_rect",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__rect__filled.html b/structnk__command__rect__filled.html new file mode 100644 index 000000000..85c969d04 --- /dev/null +++ b/structnk__command__rect__filled.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_command_rect_filled Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_rect_filled Struct Reference
+
+
+
+Collaboration diagram for nk_command_rect_filled:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+unsigned short rounding
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4507 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__rect__filled.js b/structnk__command__rect__filled.js new file mode 100644 index 000000000..17a68024c --- /dev/null +++ b/structnk__command__rect__filled.js @@ -0,0 +1,10 @@ +var structnk__command__rect__filled = +[ + [ "color", "structnk__command__rect__filled.html#af8a168369f9f434f67dab58fa2fa7fbb", null ], + [ "h", "structnk__command__rect__filled.html#af834a2f4ebaf9542858fe508a142008c", null ], + [ "header", "structnk__command__rect__filled.html#a30ce332f6ffee33554f0847f273eeb08", null ], + [ "rounding", "structnk__command__rect__filled.html#aeeb368a566f41a7e7251f0d42beca769", null ], + [ "w", "structnk__command__rect__filled.html#aea649ea0e06951f6b43cf081e3ed46cb", null ], + [ "x", "structnk__command__rect__filled.html#a06cec93b095fc457ae510a417c0a8e20", null ], + [ "y", "structnk__command__rect__filled.html#a445d257d9223e67ebe2efb6dd1e9ddcb", null ] +]; \ No newline at end of file diff --git a/structnk__command__rect__filled__coll__graph.dot b/structnk__command__rect__filled__coll__graph.dot new file mode 100644 index 000000000..e4d9cf711 --- /dev/null +++ b/structnk__command__rect__filled__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_rect_filled" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_rect_filled",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__rect__multi__color.html b/structnk__command__rect__multi__color.html new file mode 100644 index 000000000..b39326044 --- /dev/null +++ b/structnk__command__rect__multi__color.html @@ -0,0 +1,154 @@ + + + + + + + +Nuklear: nk_command_rect_multi_color Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_rect_multi_color Struct Reference
+
+
+
+Collaboration diagram for nk_command_rect_multi_color:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+struct nk_color left
 
+struct nk_color top
 
+struct nk_color bottom
 
+struct nk_color right
 
+

Detailed Description

+
+

Definition at line 4515 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__rect__multi__color.js b/structnk__command__rect__multi__color.js new file mode 100644 index 000000000..8958cb983 --- /dev/null +++ b/structnk__command__rect__multi__color.js @@ -0,0 +1,12 @@ +var structnk__command__rect__multi__color = +[ + [ "bottom", "structnk__command__rect__multi__color.html#ad45d7eed36c7f030afd6831189e5bed0", null ], + [ "h", "structnk__command__rect__multi__color.html#abaea460479c699b2766b4d95d1d94811", null ], + [ "header", "structnk__command__rect__multi__color.html#a00aa4e65f829de4f4462e92f9772f5f4", null ], + [ "left", "structnk__command__rect__multi__color.html#a6553b421a549546420de5f2afd565e57", null ], + [ "right", "structnk__command__rect__multi__color.html#a991243abaf14d0bc794e45cdf2148115", null ], + [ "top", "structnk__command__rect__multi__color.html#a3cb10db3ee61b9db8e4818fb09ceee0b", null ], + [ "w", "structnk__command__rect__multi__color.html#af359df4ff0853bd61d10ac00bc8e34c3", null ], + [ "x", "structnk__command__rect__multi__color.html#ae0ac34d18501f6fd6acd335ccb1a83df", null ], + [ "y", "structnk__command__rect__multi__color.html#aa1d244d6076653c43109ab1e45c197e3", null ] +]; \ No newline at end of file diff --git a/structnk__command__rect__multi__color__coll__graph.dot b/structnk__command__rect__multi__color__coll__graph.dot new file mode 100644 index 000000000..0f8971f01 --- /dev/null +++ b/structnk__command__rect__multi__color__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_command_rect_multi_color" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_rect_multi\l_color",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bottom\nleft\nright\ntop" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node3 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__scissor.html b/structnk__command__scissor.html new file mode 100644 index 000000000..214ab0190 --- /dev/null +++ b/structnk__command__scissor.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_command_scissor Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_scissor Struct Reference
+
+
+
+Collaboration diagram for nk_command_scissor:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+

Detailed Description

+
+

Definition at line 4475 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__scissor.js b/structnk__command__scissor.js new file mode 100644 index 000000000..4d2ab32df --- /dev/null +++ b/structnk__command__scissor.js @@ -0,0 +1,8 @@ +var structnk__command__scissor = +[ + [ "h", "structnk__command__scissor.html#a6d6412b7991f81796c8c30283cc15a37", null ], + [ "header", "structnk__command__scissor.html#aeddedae36988a3f957d8a56802152b8a", null ], + [ "w", "structnk__command__scissor.html#a7659c8208820f4636b65c10f78c662cc", null ], + [ "x", "structnk__command__scissor.html#aefabf712b38b86e869d552a11c59c9d4", null ], + [ "y", "structnk__command__scissor.html#a12150dd6ece25013658ea6adcfe5c530", null ] +]; \ No newline at end of file diff --git a/structnk__command__scissor__coll__graph.dot b/structnk__command__scissor__coll__graph.dot new file mode 100644 index 000000000..65626fc5e --- /dev/null +++ b/structnk__command__scissor__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_command_scissor" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_scissor",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node2 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__text.html b/structnk__command__text.html new file mode 100644 index 000000000..a67380523 --- /dev/null +++ b/structnk__command__text.html @@ -0,0 +1,160 @@ + + + + + + + +Nuklear: nk_command_text Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_text Struct Reference
+
+
+
+Collaboration diagram for nk_command_text:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+const struct nk_user_fontfont
 
+struct nk_color background
 
+struct nk_color foreground
 
+short x
 
+short y
 
+unsigned short w
 
+unsigned short h
 
+float height
 
+int length
 
+char string [1]
 
+

Detailed Description

+
+

Definition at line 4615 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__text.js b/structnk__command__text.js new file mode 100644 index 000000000..817d19ba4 --- /dev/null +++ b/structnk__command__text.js @@ -0,0 +1,14 @@ +var structnk__command__text = +[ + [ "background", "structnk__command__text.html#a3a1225818bc3f2174b836d797979a55b", null ], + [ "font", "structnk__command__text.html#a57e049a57f88d08355b6aa929d8e960c", null ], + [ "foreground", "structnk__command__text.html#a89f088f305fa55471fe85e74d6d7e69c", null ], + [ "h", "structnk__command__text.html#ad14a9b2dbadcaee4f9d5de6846e09007", null ], + [ "header", "structnk__command__text.html#a5a7a41a2afb06824c9b1573d20573fca", null ], + [ "height", "structnk__command__text.html#ac4c5a4f26388eaee498ef221b87fdeff", null ], + [ "length", "structnk__command__text.html#a61808e6a805e90be52ec3b412446cd9d", null ], + [ "string", "structnk__command__text.html#a15f58b2e33dd173cf5b6b9803e1617bb", null ], + [ "w", "structnk__command__text.html#aeb1534c55f5f583788aa6baf8e89da0e", null ], + [ "x", "structnk__command__text.html#aabc9267e7890ddcdd8caefa34cf0e220", null ], + [ "y", "structnk__command__text.html#ace809f5ab5b1aadd3a97284fb5210a50", null ] +]; \ No newline at end of file diff --git a/structnk__command__text__coll__graph.dot b/structnk__command__text__coll__graph.dot new file mode 100644 index 000000000..2fd4be27e --- /dev/null +++ b/structnk__command__text__coll__graph.dot @@ -0,0 +1,15 @@ +digraph "nk_command_text" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_text",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" font" ,fontname="Helvetica"]; + Node2 [label="nk_user_font",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__user__font.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata\nwidth" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\nforeground" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node5 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__triangle.html b/structnk__command__triangle.html new file mode 100644 index 000000000..48b5c3659 --- /dev/null +++ b/structnk__command__triangle.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_command_triangle Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_triangle Struct Reference
+
+
+
+Collaboration diagram for nk_command_triangle:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+unsigned short line_thickness
 
+struct nk_vec2i a
 
+struct nk_vec2i b
 
+struct nk_vec2i c
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4525 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__triangle.js b/structnk__command__triangle.js new file mode 100644 index 000000000..81501e5d9 --- /dev/null +++ b/structnk__command__triangle.js @@ -0,0 +1,9 @@ +var structnk__command__triangle = +[ + [ "a", "structnk__command__triangle.html#a3075515b028883cd55113bd830cc3b19", null ], + [ "b", "structnk__command__triangle.html#a50fdee47bcbf228ac6948f7f501a7f31", null ], + [ "c", "structnk__command__triangle.html#a66cc7af34255c6b6e6949ee7ce1f6539", null ], + [ "color", "structnk__command__triangle.html#ae3698f324f8c4c5d654307c46d903b2b", null ], + [ "header", "structnk__command__triangle.html#ae39911e004d052d2546ea9a013eac7c2", null ], + [ "line_thickness", "structnk__command__triangle.html#a1a7b8926b82bbcd507142fbb337518f7", null ] +]; \ No newline at end of file diff --git a/structnk__command__triangle__coll__graph.dot b/structnk__command__triangle__coll__graph.dot new file mode 100644 index 000000000..af353e17e --- /dev/null +++ b/structnk__command__triangle__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_triangle" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_triangle",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" a\nb\nc" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__command__triangle__filled.html b/structnk__command__triangle__filled.html new file mode 100644 index 000000000..71104c9f2 --- /dev/null +++ b/structnk__command__triangle__filled.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_command_triangle_filled Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_command_triangle_filled Struct Reference
+
+
+
+Collaboration diagram for nk_command_triangle_filled:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_command header
 
+struct nk_vec2i a
 
+struct nk_vec2i b
 
+struct nk_vec2i c
 
+struct nk_color color
 
+

Detailed Description

+
+

Definition at line 4534 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__command__triangle__filled.js b/structnk__command__triangle__filled.js new file mode 100644 index 000000000..e3ede4892 --- /dev/null +++ b/structnk__command__triangle__filled.js @@ -0,0 +1,8 @@ +var structnk__command__triangle__filled = +[ + [ "a", "structnk__command__triangle__filled.html#aca4ee3d0be539c944ee86758fa434cd4", null ], + [ "b", "structnk__command__triangle__filled.html#a74a97afd25d3ca85f507f0fef6f7a3a7", null ], + [ "c", "structnk__command__triangle__filled.html#a74aedb1be3f5af2aa0f11ec82fe25389", null ], + [ "color", "structnk__command__triangle__filled.html#af1a8f938d6b75eafc0212ab4c5a1baf8", null ], + [ "header", "structnk__command__triangle__filled.html#aba10245834e42312409e2b46e89364c5", null ] +]; \ No newline at end of file diff --git a/structnk__command__triangle__filled__coll__graph.dot b/structnk__command__triangle__filled__coll__graph.dot new file mode 100644 index 000000000..11e8e185b --- /dev/null +++ b/structnk__command__triangle__filled__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_command_triangle_filled" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_command_triangle\l_filled",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" a\nb\nc" ,fontname="Helvetica"]; + Node3 [label="nk_vec2i",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2i.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node4 [label="nk_command",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command.html",tooltip="command base and header of every command inside the buffer"]; +} diff --git a/structnk__configuration__stacks.html b/structnk__configuration__stacks.html new file mode 100644 index 000000000..624496b5d --- /dev/null +++ b/structnk__configuration__stacks.html @@ -0,0 +1,143 @@ + + + + + + + +Nuklear: nk_configuration_stacks Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_configuration_stacks Struct Reference
+
+
+ + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_config_stack_style_item style_items
 
+struct nk_config_stack_float floats
 
+struct nk_config_stack_vec2 vectors
 
+struct nk_config_stack_flags flags
 
+struct nk_config_stack_color colors
 
+struct nk_config_stack_user_font fonts
 
+struct nk_config_stack_button_behavior button_behaviors
 
+

Detailed Description

+
+

Definition at line 5651 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__configuration__stacks.js b/structnk__configuration__stacks.js new file mode 100644 index 000000000..bbf4a7f85 --- /dev/null +++ b/structnk__configuration__stacks.js @@ -0,0 +1,10 @@ +var structnk__configuration__stacks = +[ + [ "button_behaviors", "structnk__configuration__stacks.html#acdd04ace1959669efbcf441cd6c154e0", null ], + [ "colors", "structnk__configuration__stacks.html#a72201e81abce704239551304a41d43bb", null ], + [ "flags", "structnk__configuration__stacks.html#a54e6f345ddb5f80b1b5c4985f3bad922", null ], + [ "floats", "structnk__configuration__stacks.html#aaa0169624803bd2dbb6c871930901ba5", null ], + [ "fonts", "structnk__configuration__stacks.html#addf7cdf072a4c6cc7fc5a545b578b892", null ], + [ "style_items", "structnk__configuration__stacks.html#a55967201de962032e2f803bca733bb31", null ], + [ "vectors", "structnk__configuration__stacks.html#a24a2fbd356785b0ac5dc302605dbe736", null ] +]; \ No newline at end of file diff --git a/structnk__context.html b/structnk__context.html new file mode 100644 index 000000000..48fa2bfb0 --- /dev/null +++ b/structnk__context.html @@ -0,0 +1,209 @@ + + + + + + + +Nuklear: nk_context Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_context Struct Reference
+
+
+
+Collaboration diagram for nk_context:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_input input
 
+struct nk_style style
 
+struct nk_buffer memory
 
+struct nk_clipboard clip
 
+nk_flags last_widget_state
 
+enum nk_button_behavior button_behavior
 
+struct nk_configuration_stacks stacks
 
+float delta_time_seconds
 
struct nk_text_edit text_edit
 text editor objects are quite big because of an internal undo/redo stack. More...
 
+struct nk_command_buffer overlay
 draw buffer used for overlay drawing operation like cursor
 
+int build
 windows
 
+int use_pool
 
+struct nk_pool pool
 
+struct nk_windowbegin
 
+struct nk_windowend
 
+struct nk_windowactive
 
+struct nk_windowcurrent
 
+struct nk_page_elementfreelist
 
+unsigned int count
 
+unsigned int seq
 
+

Detailed Description

+
+

Definition at line 5704 of file nuklear.h.

+

Field Documentation

+ +

◆ text_edit

+ +
+
+ + + + +
struct nk_text_edit nk_context::text_edit
+
+ +

text editor objects are quite big because of an internal undo/redo stack.

+

Therefore it does not make sense to have one for each window for temporary use cases, so I only provide one instance for all windows. This works because the content is cleared anyway

+ +

Definition at line 5713 of file nuklear.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__context.js b/structnk__context.js new file mode 100644 index 000000000..514654ec3 --- /dev/null +++ b/structnk__context.js @@ -0,0 +1,23 @@ +var structnk__context = +[ + [ "active", "structnk__context.html#ab8d399ddadeb71a3d68fe6ec063a4eaf", null ], + [ "begin", "structnk__context.html#a43a1c4cf1a69b90ad33b78789915d4eb", null ], + [ "build", "structnk__context.html#a0d0f953ef2b6c56b046e4e5488d074e6", null ], + [ "button_behavior", "structnk__context.html#a1b37f5fdd034ad23c79f90a0094ac349", null ], + [ "clip", "structnk__context.html#a834f5a5fad2919a354472381b013a81f", null ], + [ "count", "structnk__context.html#a332f044ac74fd5450fa61097ea45be65", null ], + [ "current", "structnk__context.html#a63efcbf544ff88f819f4d7e03927d7c6", null ], + [ "delta_time_seconds", "structnk__context.html#a400eeefb70eab5d544831b856300ac06", null ], + [ "end", "structnk__context.html#a70f3687079206d314b2006db5fc3da05", null ], + [ "freelist", "structnk__context.html#aa66b352c5a05615e844a4e065186aa85", null ], + [ "input", "structnk__context.html#abee1c200e8e185fe718556c0ddff31ad", null ], + [ "last_widget_state", "structnk__context.html#a15a7e828c4fb1ac317c72f00ff278b95", null ], + [ "memory", "structnk__context.html#a678e6980553a5f32f7b59f2fbcebebe9", null ], + [ "overlay", "structnk__context.html#ae51cac633c54b94a63c8fe77b9558f4a", null ], + [ "pool", "structnk__context.html#a84dcedd9a6418f47d22f39e2b20d741d", null ], + [ "seq", "structnk__context.html#a4ca2377a51d98a451bdcc61ccd967820", null ], + [ "stacks", "structnk__context.html#a86bc92d9133c81f3dd85c8ae99d612dc", null ], + [ "style", "structnk__context.html#a39208175c061b8486ee8fb51e50a243e", null ], + [ "text_edit", "structnk__context.html#aca8a2124af97661372f7b35d636c9bc6", null ], + [ "use_pool", "structnk__context.html#a10afb1419df73de41b2be1d0bff8523c", null ] +]; \ No newline at end of file diff --git a/structnk__context__coll__graph.dot b/structnk__context__coll__graph.dot new file mode 100644 index 000000000..317b86008 --- /dev/null +++ b/structnk__context__coll__graph.dot @@ -0,0 +1,192 @@ +digraph "nk_context" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + rankdir="LR"; + Node1 [label="nk_context",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" overlay" ,fontname="Helvetica"]; + Node2 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node3 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node4 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node5 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node7 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node8 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node8 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node6 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" stacks" ,fontname="Helvetica"]; + Node9 [label="nk_configuration_stacks",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__configuration__stacks.html",tooltip=" "]; + Node10 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" style" ,fontname="Helvetica"]; + Node10 [label="nk_style",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style.html",tooltip=" "]; + Node11 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text" ,fontname="Helvetica"]; + Node11 [label="nk_style_text",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__text.html",tooltip=" "]; + Node12 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node12 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node13 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node13 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node14 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" selectable" ,fontname="Helvetica"]; + Node14 [label="nk_style_selectable",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__selectable.html",tooltip=" "]; + Node15 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" hover\nhover_active\nnormal\nnormal_active\npressed\npressed_active" ,fontname="Helvetica"]; + Node15 [label="nk_style_item",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node12 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_background\ntext_hover\ntext_hover_active\ntext_normal\ntext_normal_active\ntext_pressed\ntext_pressed_active" ,fontname="Helvetica"]; + Node13 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node6 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node19 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_active\ncursor_last\ncursors" ,fontname="Helvetica"]; + Node19 [label="nk_cursor",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__cursor.html",tooltip=" "]; + Node17 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node17 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node13 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node20 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node20 [label="nk_style_property",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__property.html",tooltip=" "]; + Node15 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node21 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node21 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node15 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node13 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node6 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node13 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node22 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node22 [label="nk_style_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__edit.html",tooltip=" "]; + Node15 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_hover\ncursor_normal\ncursor_text_hover\ncursor_text_normal\nselected_hover\nselected_normal\nselected_text_hover\nselected_text_normal\ntext_active\n..." ,fontname="Helvetica"]; + Node13 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nscrollbar_size" ,fontname="Helvetica"]; + Node23 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node23 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__scrollbar.html",tooltip=" "]; + Node15 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node21 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node13 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node6 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node6 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node24 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" font" ,fontname="Helvetica"]; + Node24 [label="nk_user_font",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__user__font.html",tooltip=" "]; + Node6 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata\nwidth" ,fontname="Helvetica"]; + Node25 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tab" ,fontname="Helvetica"]; + Node25 [label="nk_style_tab",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__tab.html",tooltip=" "]; + Node15 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node12 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext" ,fontname="Helvetica"]; + Node21 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" node_maximize_button\nnode_minimize_button\ntab_maximize_button\ntab_minimize_button" ,fontname="Helvetica"]; + Node13 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node26 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" progress" ,fontname="Helvetica"]; + Node26 [label="nk_style_progress",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__progress.html",tooltip=" "]; + Node15 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node13 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node6 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node21 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button\ncontextual_button\nmenu_button" ,fontname="Helvetica"]; + Node27 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo" ,fontname="Helvetica"]; + Node27 [label="nk_style_combo",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__combo.html",tooltip=" "]; + Node15 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal\nsymbol_active\nsymbol_hover\nsymbol_normal" ,fontname="Helvetica"]; + Node21 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button" ,fontname="Helvetica"]; + Node13 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button_padding\ncontent_padding\nspacing" ,fontname="Helvetica"]; + Node28 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" knob" ,fontname="Helvetica"]; + Node28 [label="nk_style_knob",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__knob.html",tooltip=" "]; + Node15 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_active\ncursor_hover\ncursor_normal\nknob_active\nknob_border_color\nknob_hover\nknob_normal" ,fontname="Helvetica"]; + Node13 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node6 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node22 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node29 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" checkbox\noption" ,fontname="Helvetica"]; + Node29 [label="nk_style_toggle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__toggle.html",tooltip=" "]; + Node15 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node13 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\ntouch_padding" ,fontname="Helvetica"]; + Node6 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node30 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" window" ,fontname="Helvetica"]; + Node30 [label="nk_style_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window.html",tooltip=" "]; + Node15 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" fixed_background\nscaler" ,fontname="Helvetica"]; + Node12 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\nborder_color\ncombo_border_color\ncontextual_border\l_color\ngroup_border_color\nmenu_border_color\npopup_border_color\ntooltip_border_color" ,fontname="Helvetica"]; + Node31 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node31 [label="nk_style_window_header",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window__header.html",tooltip=" "]; + Node15 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node21 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" close_button\nminimize_button" ,fontname="Helvetica"]; + Node13 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_padding\npadding\nspacing" ,fontname="Helvetica"]; + Node13 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo_padding\ncontextual_padding\ngroup_padding\nmenu_padding\nmin_size\npadding\npopup_padding\nscrollbar_size\nspacing\ntooltip_padding\n..." ,fontname="Helvetica"]; + Node32 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slider" ,fontname="Helvetica"]; + Node32 [label="nk_style_slider",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__slider.html",tooltip=" "]; + Node15 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node12 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bar_active\nbar_filled\nbar_hover\nbar_normal\nborder_color" ,fontname="Helvetica"]; + Node21 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node13 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_size\npadding\nspacing" ,fontname="Helvetica"]; + Node6 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node33 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node33 [label="nk_style_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__chart.html",tooltip=" "]; + Node15 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node12 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncolor\nselected_color" ,fontname="Helvetica"]; + Node13 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node23 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollh\nscrollv" ,fontname="Helvetica"]; + Node34 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node34 [label="nk_pool",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__pool.html",tooltip=" "]; + Node5 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc" ,fontname="Helvetica"]; + Node35 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pages" ,fontname="Helvetica"]; + Node35 [label="nk_page",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page.html",tooltip=" "]; + Node35 -> Node35 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; + Node36 -> Node35 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node36 [label="nk_page_element",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page__element.html",tooltip=" "]; + Node37 -> Node36 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node37 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__page__data.html",tooltip=" "]; + Node38 -> Node37 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node38 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node2 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node39 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node39 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node3 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node38 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node40 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node40 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node41 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node41 [label="nk_panel",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node2 -> Node41 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node3 -> Node41 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node41 -> Node41 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node46 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node46 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node46 -> Node46 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node47 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node47 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node39 -> Node47 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node48 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node48 [label="nk_popup_state",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node3 -> Node48 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node38 -> Node48 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node41 -> Node37 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node46 -> Node37 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; + Node36 -> Node36 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node36 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" freelist" ,fontname="Helvetica"]; + Node50 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" input" ,fontname="Helvetica"]; + Node50 [label="nk_input",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__input.html",tooltip=" "]; + Node51 -> Node50 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keyboard" ,fontname="Helvetica"]; + Node51 [label="nk_keyboard",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__keyboard.html",tooltip=" "]; + Node52 -> Node51 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keys" ,fontname="Helvetica"]; + Node52 [label="nk_key",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__key.html",tooltip=" "]; + Node53 -> Node50 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mouse" ,fontname="Helvetica"]; + Node53 [label="nk_mouse",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__mouse.html",tooltip=" "]; + Node13 -> Node53 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" delta\npos\nprev\nscroll_delta" ,fontname="Helvetica"]; + Node38 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nbegin\ncurrent\nend" ,fontname="Helvetica"]; + Node55 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node55 [label="nk_clipboard",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__clipboard.html",tooltip=" "]; + Node6 -> Node55 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" copy\npaste\nuserdata" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node36 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" freelist" ,fontname="Helvetica"]; + Node56 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_edit" ,fontname="Helvetica"]; + Node56 [label="nk_text_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__text__edit.html",tooltip=" "]; + Node57 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" undo" ,fontname="Helvetica"]; + Node57 [label="nk_text_undo_state",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__text__undo__state.html",tooltip=" "]; + Node55 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node13 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node56 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" filter" ,fontname="Helvetica"]; + Node59 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" string" ,fontname="Helvetica"]; + Node59 [label="nk_str",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__str.html",tooltip="=============================================================="]; + Node4 -> Node59 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; +} diff --git a/structnk__convert__config.html b/structnk__convert__config.html new file mode 100644 index 000000000..d0eb435c0 --- /dev/null +++ b/structnk__convert__config.html @@ -0,0 +1,166 @@ + + + + + + + +Nuklear: nk_convert_config Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_convert_config Struct Reference
+
+
+
+Collaboration diagram for nk_convert_config:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+float global_alpha
 
+enum nk_anti_aliasing line_AA
 !< global alpha value
 
+enum nk_anti_aliasing shape_AA
 !< line anti-aliasing flag can be turned off if you are tight on memory
 
+unsigned circle_segment_count
 !< shape anti-aliasing flag can be turned off if you are tight on memory
 
+unsigned arc_segment_count
 !< number of segments used for circles: default to 22
 
+unsigned curve_segment_count
 !< number of segments used for arcs: default to 22
 
+struct nk_draw_null_texture tex_null
 !< number of segments used for curves: default to 22
 
+const struct nk_draw_vertex_layout_element * vertex_layout
 !< handle to texture with a white pixel for shape drawing
 
+nk_size vertex_size
 !< describes the vertex output format and packing
 
+nk_size vertex_alignment
 !< sizeof one vertex for vertex packing
 
+

Detailed Description

+
+

Definition at line 978 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__convert__config.js b/structnk__convert__config.js new file mode 100644 index 000000000..70062b85d --- /dev/null +++ b/structnk__convert__config.js @@ -0,0 +1,13 @@ +var structnk__convert__config = +[ + [ "arc_segment_count", "structnk__convert__config.html#ae367d812c2f866e843f9684b3a920e73", null ], + [ "circle_segment_count", "structnk__convert__config.html#ae62d641bf9c5bc6b3e66c6071f4a8267", null ], + [ "curve_segment_count", "structnk__convert__config.html#afcf45f3fc6e3f043b572b59cb04424c5", null ], + [ "global_alpha", "structnk__convert__config.html#ad344c555b0c1ce0a07dded48860ceb00", null ], + [ "line_AA", "structnk__convert__config.html#a7279543367b1ad0e5f183491233cedad", null ], + [ "shape_AA", "structnk__convert__config.html#a1d0cf3e01234c636729dfd0fddf5b2c7", null ], + [ "tex_null", "structnk__convert__config.html#afe7d1907a295a3db7bbb11e3f0f98c1e", null ], + [ "vertex_alignment", "structnk__convert__config.html#a92519fe62ef0e8f0d7180dbd874c775f", null ], + [ "vertex_layout", "structnk__convert__config.html#addeb894f54f2ba1dbe3d5bf887b27776", null ], + [ "vertex_size", "structnk__convert__config.html#acf0d9e08220c6e29ee9d2753f9273591", null ] +]; \ No newline at end of file diff --git a/structnk__convert__config__coll__graph.dot b/structnk__convert__config__coll__graph.dot new file mode 100644 index 000000000..4a02f35dc --- /dev/null +++ b/structnk__convert__config__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_convert_config" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_convert_config",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tex_null" ,fontname="Helvetica"]; + Node2 [label="nk_draw_null_texture",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__draw__null__texture.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" uv" ,fontname="Helvetica"]; + Node3 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" texture" ,fontname="Helvetica"]; + Node4 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__cursor.html b/structnk__cursor.html new file mode 100644 index 000000000..a024ea170 --- /dev/null +++ b/structnk__cursor.html @@ -0,0 +1,133 @@ + + + + + + + +Nuklear: nk_cursor Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_cursor Struct Reference
+
+
+
+Collaboration diagram for nk_cursor:
+
+
Collaboration graph
+
[legend]
+ + + + + + +

+Data Fields

+struct nk_image img
 
+struct nk_vec2 size offset
 
+

Detailed Description

+
+

Definition at line 271 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__cursor.js b/structnk__cursor.js new file mode 100644 index 000000000..34e92a187 --- /dev/null +++ b/structnk__cursor.js @@ -0,0 +1,5 @@ +var structnk__cursor = +[ + [ "img", "structnk__cursor.html#ae85598fd872f474a4e63e92bbee10a92", null ], + [ "offset", "structnk__cursor.html#ae01b7938eb679481a8ef549c27a59080", null ] +]; \ No newline at end of file diff --git a/structnk__cursor__coll__graph.dot b/structnk__cursor__coll__graph.dot new file mode 100644 index 000000000..0275949c4 --- /dev/null +++ b/structnk__cursor__coll__graph.dot @@ -0,0 +1,13 @@ +digraph "nk_cursor" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_cursor",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node2 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node4 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__draw__null__texture.html b/structnk__draw__null__texture.html new file mode 100644 index 000000000..680878243 --- /dev/null +++ b/structnk__draw__null__texture.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_draw_null_texture Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_draw_null_texture Struct Reference
+
+
+
+Collaboration diagram for nk_draw_null_texture:
+
+
Collaboration graph
+
[legend]
+ + + + + + + +

+Data Fields

+nk_handle texture
 
+struct nk_vec2 uv
 !< texture handle to a texture with a white pixel
 
+

Detailed Description

+
+

Definition at line 974 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__draw__null__texture.js b/structnk__draw__null__texture.js new file mode 100644 index 000000000..4c4be5cf4 --- /dev/null +++ b/structnk__draw__null__texture.js @@ -0,0 +1,5 @@ +var structnk__draw__null__texture = +[ + [ "texture", "structnk__draw__null__texture.html#a28406c59e642297560123c8f927dbf44", null ], + [ "uv", "structnk__draw__null__texture.html#ae00f89beb79ed9aa53d2ddcbdd1ea7c7", null ] +]; \ No newline at end of file diff --git a/structnk__draw__null__texture__coll__graph.dot b/structnk__draw__null__texture__coll__graph.dot new file mode 100644 index 000000000..ba9d1d356 --- /dev/null +++ b/structnk__draw__null__texture__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_draw_null_texture" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_draw_null_texture",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" uv" ,fontname="Helvetica"]; + Node2 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" texture" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__edit__state.html b/structnk__edit__state.html new file mode 100644 index 000000000..f3ef381ec --- /dev/null +++ b/structnk__edit__state.html @@ -0,0 +1,160 @@ + + + + + + + +Nuklear: nk_edit_state Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_edit_state Struct Reference
+
+
+
+Collaboration diagram for nk_edit_state:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+nk_hash name
 
+unsigned int seq
 
+unsigned int old
 
+int active
 
+int prev
 
+int cursor
 
+int sel_start
 
+int sel_end
 
+struct nk_scroll scrollbar
 
+unsigned char mode
 
+unsigned char single_line
 
+

Detailed Description

+
+

Definition at line 5512 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__edit__state.js b/structnk__edit__state.js new file mode 100644 index 000000000..ebb66b9a3 --- /dev/null +++ b/structnk__edit__state.js @@ -0,0 +1,14 @@ +var structnk__edit__state = +[ + [ "active", "structnk__edit__state.html#a29e96834b044eb48096b50ee584d3528", null ], + [ "cursor", "structnk__edit__state.html#ab416471cb61eacf633a05ad54d8c6bc8", null ], + [ "mode", "structnk__edit__state.html#ae841853374d727742a6ac7d31e9346e6", null ], + [ "name", "structnk__edit__state.html#a87920c698f22575eab9d07d5ebae318e", null ], + [ "old", "structnk__edit__state.html#ab71fb9bbac77248af5f1c3bd1471ddfc", null ], + [ "prev", "structnk__edit__state.html#aaacf3bdbd141697e4f5645f128bcf785", null ], + [ "scrollbar", "structnk__edit__state.html#af66f1fff3c22f0149b513ec224360f74", null ], + [ "sel_end", "structnk__edit__state.html#a529ee69a1bb79ac2d3377c2d052f5774", null ], + [ "sel_start", "structnk__edit__state.html#aeecc32de6d1be464baa562d9bba3a351", null ], + [ "seq", "structnk__edit__state.html#a1c65e389e43214b89c65214a859e883f", null ], + [ "single_line", "structnk__edit__state.html#ab124091270e7af08f6df9410a647ae1c", null ] +]; \ No newline at end of file diff --git a/structnk__edit__state__coll__graph.dot b/structnk__edit__state__coll__graph.dot new file mode 100644 index 000000000..d8c3c4588 --- /dev/null +++ b/structnk__edit__state__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_edit_state" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node2 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; +} diff --git a/structnk__image.html b/structnk__image.html new file mode 100644 index 000000000..46cc7c987 --- /dev/null +++ b/structnk__image.html @@ -0,0 +1,139 @@ + + + + + + + +Nuklear: nk_image Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_image Struct Reference
+
+
+
+Collaboration diagram for nk_image:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + +

+Data Fields

+nk_handle handle
 
+nk_ushort w
 
+nk_ushort h
 
+nk_ushort region [4]
 
+

Detailed Description

+
+

Definition at line 269 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__image.js b/structnk__image.js new file mode 100644 index 000000000..e9e743a33 --- /dev/null +++ b/structnk__image.js @@ -0,0 +1,7 @@ +var structnk__image = +[ + [ "h", "structnk__image.html#af058304478269a6048d1c7b06944b7ac", null ], + [ "handle", "structnk__image.html#ac8489fd68c4b2228eecdd017353ccf40", null ], + [ "region", "structnk__image.html#a33d049716b7a874f16f38ce7b197d805", null ], + [ "w", "structnk__image.html#a35d97a29e49d6d2d7195140927bd4a68", null ] +]; \ No newline at end of file diff --git a/structnk__image__coll__graph.dot b/structnk__image__coll__graph.dot new file mode 100644 index 000000000..7532ba750 --- /dev/null +++ b/structnk__image__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_image" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node2 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__input.html b/structnk__input.html new file mode 100644 index 000000000..87a3c52b1 --- /dev/null +++ b/structnk__input.html @@ -0,0 +1,133 @@ + + + + + + + +Nuklear: nk_input Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_input Struct Reference
+
+
+
+Collaboration diagram for nk_input:
+
+
Collaboration graph
+
[legend]
+ + + + + + +

+Data Fields

+struct nk_keyboard keyboard
 
+struct nk_mouse mouse
 
+

Detailed Description

+
+

Definition at line 4699 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__input.js b/structnk__input.js new file mode 100644 index 000000000..002349f66 --- /dev/null +++ b/structnk__input.js @@ -0,0 +1,5 @@ +var structnk__input = +[ + [ "keyboard", "structnk__input.html#a07db4d8c752d4e9fcc7e18638dfa8740", null ], + [ "mouse", "structnk__input.html#ac34a784eebb90e3c839a8008f2127c61", null ] +]; \ No newline at end of file diff --git a/structnk__input__coll__graph.dot b/structnk__input__coll__graph.dot new file mode 100644 index 000000000..4dc49596b --- /dev/null +++ b/structnk__input__coll__graph.dot @@ -0,0 +1,18 @@ +digraph "nk_input" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_input",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keyboard" ,fontname="Helvetica"]; + Node2 [label="nk_keyboard",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__keyboard.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keys" ,fontname="Helvetica"]; + Node3 [label="nk_key",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__key.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mouse" ,fontname="Helvetica"]; + Node4 [label="nk_mouse",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__mouse.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" delta\npos\nprev\nscroll_delta" ,fontname="Helvetica"]; + Node5 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buttons" ,fontname="Helvetica"]; + Node6 [label="nk_mouse_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__mouse__button.html",tooltip=" "]; + Node5 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clicked_pos" ,fontname="Helvetica"]; +} diff --git a/structnk__key.html b/structnk__key.html new file mode 100644 index 000000000..7f4439c99 --- /dev/null +++ b/structnk__key.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_key Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_key Struct Reference
+
+
+ + + + + + +

+Data Fields

+nk_bool down
 
+unsigned int clicked
 
+

Detailed Description

+
+

Definition at line 4689 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__key.js b/structnk__key.js new file mode 100644 index 000000000..b5ac63fd1 --- /dev/null +++ b/structnk__key.js @@ -0,0 +1,5 @@ +var structnk__key = +[ + [ "clicked", "structnk__key.html#a55a84cf59c1c5b8cf3e691e690e0c276", null ], + [ "down", "structnk__key.html#acfce029d66f24aa0359c5f9881eff6ee", null ] +]; \ No newline at end of file diff --git a/structnk__keyboard.html b/structnk__keyboard.html new file mode 100644 index 000000000..aee854fc1 --- /dev/null +++ b/structnk__keyboard.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_keyboard Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_keyboard Struct Reference
+
+
+
+Collaboration diagram for nk_keyboard:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+struct nk_key keys [NK_KEY_MAX]
 
+char text [NK_INPUT_MAX]
 
+int text_len
 
+

Detailed Description

+
+

Definition at line 4693 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__keyboard.js b/structnk__keyboard.js new file mode 100644 index 000000000..67532492e --- /dev/null +++ b/structnk__keyboard.js @@ -0,0 +1,6 @@ +var structnk__keyboard = +[ + [ "keys", "structnk__keyboard.html#a7f4bc6e6c826efeef5ac3ccfe7be2951", null ], + [ "text", "structnk__keyboard.html#a9cdc372561fb571c1feb28837d5fc965", null ], + [ "text_len", "structnk__keyboard.html#a17efc7c3577ba4ff1b3eb4a46bc6f082", null ] +]; \ No newline at end of file diff --git a/structnk__keyboard__coll__graph.dot b/structnk__keyboard__coll__graph.dot new file mode 100644 index 000000000..735d2dbbc --- /dev/null +++ b/structnk__keyboard__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_keyboard" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_keyboard",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keys" ,fontname="Helvetica"]; + Node2 [label="nk_key",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__key.html",tooltip=" "]; +} diff --git a/structnk__list__view.html b/structnk__list__view.html new file mode 100644 index 000000000..b60d06f07 --- /dev/null +++ b/structnk__list__view.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: nk_list_view Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_list_view Struct Reference
+
+
+
+Collaboration diagram for nk_list_view:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+int begin
 
+int end
 
+int count
 
+int total_height
 
+struct nk_contextctx
 
+nk_uint * scroll_pointer
 
+nk_uint scroll_value
 
+

Detailed Description

+
+

Definition at line 3065 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__list__view.js b/structnk__list__view.js new file mode 100644 index 000000000..2de30d7f5 --- /dev/null +++ b/structnk__list__view.js @@ -0,0 +1,10 @@ +var structnk__list__view = +[ + [ "begin", "structnk__list__view.html#aa4879e58fcd4a3d28bd7bff09cdf5624", null ], + [ "count", "structnk__list__view.html#a665f64779d41052ee4a203b9ae785e8e", null ], + [ "ctx", "structnk__list__view.html#aeb23229308cd613e95cf1164f26ab8f9", null ], + [ "end", "structnk__list__view.html#a5f53b59714337769b991392a24ef64f7", null ], + [ "scroll_pointer", "structnk__list__view.html#ac00e7a4b62ad7c6b8d244248db2a0175", null ], + [ "scroll_value", "structnk__list__view.html#a2090ced9c850ad0ee1ac6e88d8d9a82d", null ], + [ "total_height", "structnk__list__view.html#ae912b372c49b234cac66f8c3232f8af6", null ] +]; \ No newline at end of file diff --git a/structnk__list__view__coll__graph.dot b/structnk__list__view__coll__graph.dot new file mode 100644 index 000000000..171a9e4e1 --- /dev/null +++ b/structnk__list__view__coll__graph.dot @@ -0,0 +1,192 @@ +digraph "nk_list_view" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + rankdir="LR"; + Node1 [label="nk_list_view",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" ctx" ,fontname="Helvetica"]; + Node2 [label="nk_context",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__context.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" overlay" ,fontname="Helvetica"]; + Node3 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node4 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node5 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node6 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node7 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node8 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node8 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node9 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node9 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node10 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" stacks" ,fontname="Helvetica"]; + Node10 [label="nk_configuration_stacks",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__configuration__stacks.html",tooltip=" "]; + Node11 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" style" ,fontname="Helvetica"]; + Node11 [label="nk_style",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style.html",tooltip=" "]; + Node12 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text" ,fontname="Helvetica"]; + Node12 [label="nk_style_text",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__text.html",tooltip=" "]; + Node13 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node13 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node14 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node14 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node15 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" selectable" ,fontname="Helvetica"]; + Node15 [label="nk_style_selectable",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__selectable.html",tooltip=" "]; + Node16 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" hover\nhover_active\nnormal\nnormal_active\npressed\npressed_active" ,fontname="Helvetica"]; + Node16 [label="nk_style_item",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node13 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_background\ntext_hover\ntext_hover_active\ntext_normal\ntext_normal_active\ntext_pressed\ntext_pressed_active" ,fontname="Helvetica"]; + Node14 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node7 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node20 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_active\ncursor_last\ncursors" ,fontname="Helvetica"]; + Node20 [label="nk_cursor",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__cursor.html",tooltip=" "]; + Node18 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node18 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node7 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node14 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node21 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node21 [label="nk_style_property",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__property.html",tooltip=" "]; + Node16 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node22 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node22 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node16 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node14 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node7 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node14 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node23 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node23 [label="nk_style_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__edit.html",tooltip=" "]; + Node16 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_hover\ncursor_normal\ncursor_text_hover\ncursor_text_normal\nselected_hover\nselected_normal\nselected_text_hover\nselected_text_normal\ntext_active\n..." ,fontname="Helvetica"]; + Node14 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nscrollbar_size" ,fontname="Helvetica"]; + Node24 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node24 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__scrollbar.html",tooltip=" "]; + Node16 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node22 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node14 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node7 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node7 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node25 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" font" ,fontname="Helvetica"]; + Node25 [label="nk_user_font",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__user__font.html",tooltip=" "]; + Node7 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata\nwidth" ,fontname="Helvetica"]; + Node26 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tab" ,fontname="Helvetica"]; + Node26 [label="nk_style_tab",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__tab.html",tooltip=" "]; + Node16 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node13 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext" ,fontname="Helvetica"]; + Node22 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" node_maximize_button\nnode_minimize_button\ntab_maximize_button\ntab_minimize_button" ,fontname="Helvetica"]; + Node14 -> Node26 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node27 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" progress" ,fontname="Helvetica"]; + Node27 [label="nk_style_progress",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__progress.html",tooltip=" "]; + Node16 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node14 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node7 -> Node27 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node22 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button\ncontextual_button\nmenu_button" ,fontname="Helvetica"]; + Node28 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo" ,fontname="Helvetica"]; + Node28 [label="nk_style_combo",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__combo.html",tooltip=" "]; + Node16 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal\nsymbol_active\nsymbol_hover\nsymbol_normal" ,fontname="Helvetica"]; + Node22 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button" ,fontname="Helvetica"]; + Node14 -> Node28 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button_padding\ncontent_padding\nspacing" ,fontname="Helvetica"]; + Node29 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" knob" ,fontname="Helvetica"]; + Node29 [label="nk_style_knob",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__knob.html",tooltip=" "]; + Node16 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_active\ncursor_hover\ncursor_normal\nknob_active\nknob_border_color\nknob_hover\nknob_normal" ,fontname="Helvetica"]; + Node14 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node7 -> Node29 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node23 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node30 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" checkbox\noption" ,fontname="Helvetica"]; + Node30 [label="nk_style_toggle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__toggle.html",tooltip=" "]; + Node16 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node14 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\ntouch_padding" ,fontname="Helvetica"]; + Node7 -> Node30 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node31 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" window" ,fontname="Helvetica"]; + Node31 [label="nk_style_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window.html",tooltip=" "]; + Node16 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" fixed_background\nscaler" ,fontname="Helvetica"]; + Node13 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\nborder_color\ncombo_border_color\ncontextual_border\l_color\ngroup_border_color\nmenu_border_color\npopup_border_color\ntooltip_border_color" ,fontname="Helvetica"]; + Node32 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node32 [label="nk_style_window_header",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window__header.html",tooltip=" "]; + Node16 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node22 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" close_button\nminimize_button" ,fontname="Helvetica"]; + Node14 -> Node32 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_padding\npadding\nspacing" ,fontname="Helvetica"]; + Node14 -> Node31 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo_padding\ncontextual_padding\ngroup_padding\nmenu_padding\nmin_size\npadding\npopup_padding\nscrollbar_size\nspacing\ntooltip_padding\n..." ,fontname="Helvetica"]; + Node33 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slider" ,fontname="Helvetica"]; + Node33 [label="nk_style_slider",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__slider.html",tooltip=" "]; + Node16 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node13 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bar_active\nbar_filled\nbar_hover\nbar_normal\nborder_color" ,fontname="Helvetica"]; + Node22 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node14 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_size\npadding\nspacing" ,fontname="Helvetica"]; + Node7 -> Node33 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node34 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node34 [label="nk_style_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__chart.html",tooltip=" "]; + Node16 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node13 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncolor\nselected_color" ,fontname="Helvetica"]; + Node14 -> Node34 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node24 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollh\nscrollv" ,fontname="Helvetica"]; + Node35 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node35 [label="nk_pool",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__pool.html",tooltip=" "]; + Node6 -> Node35 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc" ,fontname="Helvetica"]; + Node36 -> Node35 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pages" ,fontname="Helvetica"]; + Node36 [label="nk_page",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page.html",tooltip=" "]; + Node36 -> Node36 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; + Node37 -> Node36 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node37 [label="nk_page_element",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page__element.html",tooltip=" "]; + Node38 -> Node37 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node38 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__page__data.html",tooltip=" "]; + Node39 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node39 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node3 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node40 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node40 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node4 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node39 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node41 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node41 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node42 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node42 [label="nk_panel",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node3 -> Node42 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node4 -> Node42 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node42 -> Node42 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node47 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node47 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node47 -> Node47 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node48 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node48 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node40 -> Node48 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node49 -> Node39 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node49 [label="nk_popup_state",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node4 -> Node49 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node39 -> Node49 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node42 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node47 -> Node38 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; + Node37 -> Node37 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node37 -> Node35 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" freelist" ,fontname="Helvetica"]; + Node51 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" input" ,fontname="Helvetica"]; + Node51 [label="nk_input",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__input.html",tooltip=" "]; + Node52 -> Node51 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" keyboard" ,fontname="Helvetica"]; + Node52 [label="nk_keyboard",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__keyboard.html",tooltip=" "]; + Node54 -> Node51 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mouse" ,fontname="Helvetica"]; + Node54 [label="nk_mouse",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__mouse.html",tooltip=" "]; + Node14 -> Node54 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" delta\npos\nprev\nscroll_delta" ,fontname="Helvetica"]; + Node39 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nbegin\ncurrent\nend" ,fontname="Helvetica"]; + Node56 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node56 [label="nk_clipboard",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__clipboard.html",tooltip=" "]; + Node7 -> Node56 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" copy\npaste\nuserdata" ,fontname="Helvetica"]; + Node5 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node37 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" freelist" ,fontname="Helvetica"]; + Node57 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_edit" ,fontname="Helvetica"]; + Node57 [label="nk_text_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__text__edit.html",tooltip=" "]; + Node58 -> Node57 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" undo" ,fontname="Helvetica"]; + Node58 [label="nk_text_undo_state",height=0.2,width=0.4,color="red", fillcolor="white", style="filled",URL="$structnk__text__undo__state.html",tooltip=" "]; + Node56 -> Node57 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node14 -> Node57 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node57 -> Node57 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" filter" ,fontname="Helvetica"]; + Node60 -> Node57 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" string" ,fontname="Helvetica"]; + Node60 [label="nk_str",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__str.html",tooltip="=============================================================="]; + Node5 -> Node60 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; +} diff --git a/structnk__memory.html b/structnk__memory.html new file mode 100644 index 000000000..cd34fea03 --- /dev/null +++ b/structnk__memory.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_memory Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_memory Struct Reference
+
+
+ + + + + + +

+Data Fields

+void * ptr
 
+nk_size size
 
+

Detailed Description

+
+

Definition at line 4188 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__memory.js b/structnk__memory.js new file mode 100644 index 000000000..93204df52 --- /dev/null +++ b/structnk__memory.js @@ -0,0 +1,5 @@ +var structnk__memory = +[ + [ "ptr", "structnk__memory.html#a844a5bebb33c6e11678e4e1ad5a9762c", null ], + [ "size", "structnk__memory.html#a02e6260408d501c5c06c6a73189b5e23", null ] +]; \ No newline at end of file diff --git a/structnk__memory__status.html b/structnk__memory__status.html new file mode 100644 index 000000000..d5ab3e329 --- /dev/null +++ b/structnk__memory__status.html @@ -0,0 +1,140 @@ + + + + + + + +Nuklear: nk_memory_status Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_memory_status Struct Reference
+
+
+ + + + + + + + + + + + + + +

+Data Fields

+void * memory
 
+unsigned int type
 
+nk_size size
 
+nk_size allocated
 
+nk_size needed
 
+nk_size calls
 
+

Detailed Description

+
+

Definition at line 4163 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__memory__status.js b/structnk__memory__status.js new file mode 100644 index 000000000..6d0689c78 --- /dev/null +++ b/structnk__memory__status.js @@ -0,0 +1,9 @@ +var structnk__memory__status = +[ + [ "allocated", "structnk__memory__status.html#a3fc6ed3975955adc725902ef3202eda5", null ], + [ "calls", "structnk__memory__status.html#a9ccd108a6be26c752346353c81dafcd8", null ], + [ "memory", "structnk__memory__status.html#a59d1cb36709894b5f922a1d4cf057051", null ], + [ "needed", "structnk__memory__status.html#a1dcfdb12316a8b864595d23839ef7072", null ], + [ "size", "structnk__memory__status.html#afff8181f79734681fbe2f240e866dae1", null ], + [ "type", "structnk__memory__status.html#a68c5a40b0c4f683e78c64301f5ab319b", null ] +]; \ No newline at end of file diff --git a/structnk__menu__state.html b/structnk__menu__state.html new file mode 100644 index 000000000..c1b23058a --- /dev/null +++ b/structnk__menu__state.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_menu_state Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_menu_state Struct Reference
+
+
+
+Collaboration diagram for nk_menu_state:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+float x
 
+float y
 
+float w
 
+float h
 
+struct nk_scroll offset
 
+

Detailed Description

+
+

Definition at line 5457 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__menu__state.js b/structnk__menu__state.js new file mode 100644 index 000000000..b3a79d017 --- /dev/null +++ b/structnk__menu__state.js @@ -0,0 +1,8 @@ +var structnk__menu__state = +[ + [ "h", "structnk__menu__state.html#a9cdc4e270abddf8ca2439344462d000e", null ], + [ "offset", "structnk__menu__state.html#a5c9dbc6f4874d334884970a3a50a9106", null ], + [ "w", "structnk__menu__state.html#a03bc0fc57cc730e820c1c3f6b55ae389", null ], + [ "x", "structnk__menu__state.html#a9a8e94b2aa566d747731e543de318150", null ], + [ "y", "structnk__menu__state.html#a23f425097a6d2ace1e954a593149584c", null ] +]; \ No newline at end of file diff --git a/structnk__menu__state__coll__graph.dot b/structnk__menu__state__coll__graph.dot new file mode 100644 index 000000000..a7ff199dc --- /dev/null +++ b/structnk__menu__state__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_menu_state" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node2 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; +} diff --git a/structnk__mouse.html b/structnk__mouse.html new file mode 100644 index 000000000..9ed77e4f7 --- /dev/null +++ b/structnk__mouse.html @@ -0,0 +1,151 @@ + + + + + + + +Nuklear: nk_mouse Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_mouse Struct Reference
+
+
+
+Collaboration diagram for nk_mouse:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_mouse_button buttons [NK_BUTTON_MAX]
 
+struct nk_vec2 pos
 
+struct nk_vec2 prev
 
+struct nk_vec2 delta
 
+struct nk_vec2 scroll_delta
 
+unsigned char grab
 
+unsigned char grabbed
 
+unsigned char ungrab
 
+

Detailed Description

+
+

Definition at line 4675 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__mouse.js b/structnk__mouse.js new file mode 100644 index 000000000..cc70d828b --- /dev/null +++ b/structnk__mouse.js @@ -0,0 +1,11 @@ +var structnk__mouse = +[ + [ "buttons", "structnk__mouse.html#a08d6933b4a6d87555cd0d3514f0507fc", null ], + [ "delta", "structnk__mouse.html#ad51017f1b2ab199b892e454ec8f6e970", null ], + [ "grab", "structnk__mouse.html#a93b114f1d129ce336d0d237980337ac9", null ], + [ "grabbed", "structnk__mouse.html#a498f60d6bf88ca50aacbddcb2a2032ad", null ], + [ "pos", "structnk__mouse.html#a07c094826e58d6d56af36b61ec91cc9a", null ], + [ "prev", "structnk__mouse.html#ae9bfaf081795f248ee28ff73e0e7510b", null ], + [ "scroll_delta", "structnk__mouse.html#a73dd665a6eca9bc85763a6148f0ff459", null ], + [ "ungrab", "structnk__mouse.html#a3420ca85bb04a09dd14694dfb394c7f0", null ] +]; \ No newline at end of file diff --git a/structnk__mouse__button.html b/structnk__mouse__button.html new file mode 100644 index 000000000..603dbed2e --- /dev/null +++ b/structnk__mouse__button.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_mouse_button Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_mouse_button Struct Reference
+
+
+
+Collaboration diagram for nk_mouse_button:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+nk_bool down
 
+unsigned int clicked
 
+struct nk_vec2 clicked_pos
 
+

Detailed Description

+
+

Definition at line 4670 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__mouse__button.js b/structnk__mouse__button.js new file mode 100644 index 000000000..c8e3d3ceb --- /dev/null +++ b/structnk__mouse__button.js @@ -0,0 +1,6 @@ +var structnk__mouse__button = +[ + [ "clicked", "structnk__mouse__button.html#a1b685639b8ff0c166ece7097f89be423", null ], + [ "clicked_pos", "structnk__mouse__button.html#a4a025ef1d8ff957864230a2f72c92983", null ], + [ "down", "structnk__mouse__button.html#aab2c8e6f794134b8957960ccf8ca85dd", null ] +]; \ No newline at end of file diff --git a/structnk__mouse__button__coll__graph.dot b/structnk__mouse__button__coll__graph.dot new file mode 100644 index 000000000..285696d0f --- /dev/null +++ b/structnk__mouse__button__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_mouse_button" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_mouse_button",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clicked_pos" ,fontname="Helvetica"]; + Node2 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__mouse__coll__graph.dot b/structnk__mouse__coll__graph.dot new file mode 100644 index 000000000..4d71e1561 --- /dev/null +++ b/structnk__mouse__coll__graph.dot @@ -0,0 +1,12 @@ +digraph "nk_mouse" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_mouse",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" delta\npos\nprev\nscroll_delta" ,fontname="Helvetica"]; + Node2 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buttons" ,fontname="Helvetica"]; + Node3 [label="nk_mouse_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__mouse__button.html",tooltip=" "]; + Node2 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clicked_pos" ,fontname="Helvetica"]; +} diff --git a/structnk__nine__slice.html b/structnk__nine__slice.html new file mode 100644 index 000000000..fa717dee5 --- /dev/null +++ b/structnk__nine__slice.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_nine_slice Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_nine_slice Struct Reference
+
+
+
+Collaboration diagram for nk_nine_slice:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+struct nk_image img
 
+nk_ushort l
 
+nk_ushort t
 
+nk_ushort r
 
+nk_ushort b
 
+

Detailed Description

+
+

Definition at line 270 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__nine__slice.js b/structnk__nine__slice.js new file mode 100644 index 000000000..1bf26c6a3 --- /dev/null +++ b/structnk__nine__slice.js @@ -0,0 +1,8 @@ +var structnk__nine__slice = +[ + [ "b", "structnk__nine__slice.html#a778ebe86a6927393459da90f534d15d6", null ], + [ "img", "structnk__nine__slice.html#a0a0edf2dbc3be1b35fa171756ddf9825", null ], + [ "l", "structnk__nine__slice.html#afe712a1747021a3fb87de67bfce6ad86", null ], + [ "r", "structnk__nine__slice.html#aaf65e84b82888201756ee66e6dfae6a7", null ], + [ "t", "structnk__nine__slice.html#a80eca7542c66cb337359364cf0e27377", null ] +]; \ No newline at end of file diff --git a/structnk__nine__slice__coll__graph.dot b/structnk__nine__slice__coll__graph.dot new file mode 100644 index 000000000..f2cc4da90 --- /dev/null +++ b/structnk__nine__slice__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_nine_slice" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node2 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__page.html b/structnk__page.html new file mode 100644 index 000000000..5912529c6 --- /dev/null +++ b/structnk__page.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_page Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_page Struct Reference
+
+
+
+Collaboration diagram for nk_page:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+unsigned int size
 
+struct nk_pagenext
 
+struct nk_page_element win [1]
 
+

Detailed Description

+
+

Definition at line 5687 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__page.js b/structnk__page.js new file mode 100644 index 000000000..c1516f311 --- /dev/null +++ b/structnk__page.js @@ -0,0 +1,6 @@ +var structnk__page = +[ + [ "next", "structnk__page.html#a1e5da2e0cd34e3a43361c8dbc3387a1e", null ], + [ "size", "structnk__page.html#ac50d0195abe080870f0ea10e87fbd2b2", null ], + [ "win", "structnk__page.html#a217456877442e5b9a21be2042d50cb1b", null ] +]; \ No newline at end of file diff --git a/structnk__page__coll__graph.dot b/structnk__page__coll__graph.dot new file mode 100644 index 000000000..2afaee627 --- /dev/null +++ b/structnk__page__coll__graph.dot @@ -0,0 +1,69 @@ +digraph "nk_page" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_page",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node2 [label="nk_page_element",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page__element.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__page__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node4 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node5 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node6 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node7 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node7 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node8 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node9 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node10 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node10 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node11 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node11 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node9 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node12 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node12 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node6 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node4 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node13 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node13 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node14 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node14 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node5 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node6 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node15 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node15 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node6 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node14 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node16 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node16 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node12 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node17 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node17 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node18 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node18 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node19 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node19 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node20 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node20 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node21 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node21 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node21 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node22 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node22 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node12 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node23 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node23 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node6 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node24 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node24 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node4 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node14 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node21 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; + Node2 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; +} diff --git a/structnk__page__element.html b/structnk__page__element.html new file mode 100644 index 000000000..53edbd4aa --- /dev/null +++ b/structnk__page__element.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_page_element Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_page_element Struct Reference
+
+
+
+Collaboration diagram for nk_page_element:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+union nk_page_data data
 
+struct nk_page_elementnext
 
+struct nk_page_elementprev
 
+

Detailed Description

+
+

Definition at line 5681 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__page__element.js b/structnk__page__element.js new file mode 100644 index 000000000..fdd58c5f5 --- /dev/null +++ b/structnk__page__element.js @@ -0,0 +1,6 @@ +var structnk__page__element = +[ + [ "data", "structnk__page__element.html#a073b1fa427f3f6ca81ea5bb95783199f", null ], + [ "next", "structnk__page__element.html#a4bfb5e8153bc2e02547fecf055181cad", null ], + [ "prev", "structnk__page__element.html#a1254dabb77cb9a33240f007f473a99b2", null ] +]; \ No newline at end of file diff --git a/structnk__page__element__coll__graph.dot b/structnk__page__element__coll__graph.dot new file mode 100644 index 000000000..0d32cce6d --- /dev/null +++ b/structnk__page__element__coll__graph.dot @@ -0,0 +1,66 @@ +digraph "nk_page_element" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_page_element",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node2 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__page__data.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node3 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node4 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node5 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node6 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node6 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node7 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node8 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node9 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node9 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node10 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node10 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node8 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node11 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node11 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node3 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node12 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node12 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node13 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node13 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node4 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node5 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node14 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node14 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node5 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node13 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node15 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node15 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node11 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node16 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node16 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node17 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node17 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node18 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node18 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node19 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node19 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node20 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node20 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node20 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node21 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node21 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node11 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node22 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node22 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node5 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node23 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node23 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node3 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node13 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node20 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; +} diff --git a/structnk__panel.html b/structnk__panel.html new file mode 100644 index 000000000..a7db31383 --- /dev/null +++ b/structnk__panel.html @@ -0,0 +1,181 @@ + + + + + + + +Nuklear: nk_panel Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_panel Struct Reference
+
+
+
+Collaboration diagram for nk_panel:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+enum nk_panel_type type
 
+nk_flags flags
 
+struct nk_rect bounds
 
+nk_uint * offset_x
 
+nk_uint * offset_y
 
+float at_x
 
+float at_y
 
+float max_x
 
+float footer_height
 
+float header_height
 
+float border
 
+unsigned int has_scrolling
 
+struct nk_rect clip
 
+struct nk_menu_state menu
 
+struct nk_row_layout row
 
+struct nk_chart chart
 
+struct nk_command_bufferbuffer
 
+struct nk_panelparent
 
+

Detailed Description

+
+

Definition at line 5462 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__panel.js b/structnk__panel.js new file mode 100644 index 000000000..47c3dfe08 --- /dev/null +++ b/structnk__panel.js @@ -0,0 +1,21 @@ +var structnk__panel = +[ + [ "at_x", "structnk__panel.html#a9479cf50da71987fe268685af6b59c54", null ], + [ "at_y", "structnk__panel.html#a35aa7e42a81f41b7b274b653c10bbc06", null ], + [ "border", "structnk__panel.html#a18d808e6efd65f6ae8b6c35ac8e12541", null ], + [ "bounds", "structnk__panel.html#ac959321fd621009edb4b5cc9ad8f1b17", null ], + [ "buffer", "structnk__panel.html#af92431d2360f7f815e7caf2896ea9090", null ], + [ "chart", "structnk__panel.html#a435683be8b2ee51cf51eb8254bccbb87", null ], + [ "clip", "structnk__panel.html#a6312d12ff73c92d1514429bb16cd43d2", null ], + [ "flags", "structnk__panel.html#a611bb738010ced8097aad851ea4397f0", null ], + [ "footer_height", "structnk__panel.html#ac206a493d6ac30679e44abc7bfc84db5", null ], + [ "has_scrolling", "structnk__panel.html#ab2de8d754a7f2cc3f8aea0aa0cd838e9", null ], + [ "header_height", "structnk__panel.html#afd450a3ec4982561df129e6ef610efc8", null ], + [ "max_x", "structnk__panel.html#ae5077b921e52862b991798c89ec1c12a", null ], + [ "menu", "structnk__panel.html#a328ce831e11cefc6308d1dcb0c124771", null ], + [ "offset_x", "structnk__panel.html#a2aced4e49f290e87ed6c2823122d946c", null ], + [ "offset_y", "structnk__panel.html#a6704d6eb0414bdeaf9cba1facdb4c729", null ], + [ "parent", "structnk__panel.html#afce00b5b98ee2a0a8f274a5f626d798a", null ], + [ "row", "structnk__panel.html#a9687b3e8837edcf72a16332b80e6e42e", null ], + [ "type", "structnk__panel.html#a1c0a0e1bd86b8de10026106fb96787da", null ] +]; \ No newline at end of file diff --git a/structnk__panel__coll__graph.dot b/structnk__panel__coll__graph.dot new file mode 100644 index 000000000..82718ef25 --- /dev/null +++ b/structnk__panel__coll__graph.dot @@ -0,0 +1,39 @@ +digraph "nk_panel" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node2 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node3 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node4 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node5 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node7 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node8 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node8 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node6 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node9 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node3 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node10 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node10 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node11 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node11 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node12 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node12 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node13 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node13 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node14 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node14 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node15 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node15 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__pool.html b/structnk__pool.html new file mode 100644 index 000000000..a771cb614 --- /dev/null +++ b/structnk__pool.html @@ -0,0 +1,151 @@ + + + + + + + +Nuklear: nk_pool Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_pool Struct Reference
+
+
+
+Collaboration diagram for nk_pool:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_allocator alloc
 
+enum nk_allocation_type type
 
+unsigned int page_count
 
+struct nk_pagepages
 
+struct nk_page_elementfreelist
 
+unsigned capacity
 
+nk_size size
 
+nk_size cap
 
+

Detailed Description

+
+

Definition at line 5693 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__pool.js b/structnk__pool.js new file mode 100644 index 000000000..ad19553fe --- /dev/null +++ b/structnk__pool.js @@ -0,0 +1,11 @@ +var structnk__pool = +[ + [ "alloc", "structnk__pool.html#a2644741d1433862d67e1046fb2101f10", null ], + [ "cap", "structnk__pool.html#a7eb35ea500f4832024688285f1394df0", null ], + [ "capacity", "structnk__pool.html#ad65a0bf770d9244c15d76669082249a1", null ], + [ "freelist", "structnk__pool.html#a63aca14faed2e7d08a74d7bc3bd06872", null ], + [ "page_count", "structnk__pool.html#a36add32173cf3c647a13bf163a26384b", null ], + [ "pages", "structnk__pool.html#ae85bca8b0974e60bdf2dfadc3587848f", null ], + [ "size", "structnk__pool.html#a5995fa53f2098e079e47928e260120ac", null ], + [ "type", "structnk__pool.html#ae622d2f8662677712eb3644a8dd4008c", null ] +]; \ No newline at end of file diff --git a/structnk__pool__coll__graph.dot b/structnk__pool__coll__graph.dot new file mode 100644 index 000000000..b23a90b8c --- /dev/null +++ b/structnk__pool__coll__graph.dot @@ -0,0 +1,73 @@ +digraph "nk_pool" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_pool",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc" ,fontname="Helvetica"]; + Node2 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node3 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pages" ,fontname="Helvetica"]; + Node4 [label="nk_page",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page.html",tooltip=" "]; + Node4 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node5 [label="nk_page_element",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__page__element.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node6 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__page__data.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node7 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node8 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node9 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node10 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node10 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node2 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node11 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node11 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node12 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node12 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node3 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node13 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node13 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node9 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node7 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node14 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node14 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node15 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node15 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node8 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node9 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node16 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node16 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node9 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node15 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node17 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node17 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node13 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node18 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node18 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node19 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node19 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node20 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node20 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node21 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node21 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node22 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node22 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node22 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node23 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node23 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node13 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node24 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node24 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node9 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node25 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node25 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node7 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node15 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node22 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; + Node5 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" freelist" ,fontname="Helvetica"]; +} diff --git a/structnk__popup__buffer.html b/structnk__popup__buffer.html new file mode 100644 index 000000000..9f3affe4d --- /dev/null +++ b/structnk__popup__buffer.html @@ -0,0 +1,137 @@ + + + + + + + +Nuklear: nk_popup_buffer Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_popup_buffer Struct Reference
+
+
+ + + + + + + + + + + + +

+Data Fields

+nk_size begin
 
+nk_size parent
 
+nk_size last
 
+nk_size end
 
+nk_bool active
 
+

Detailed Description

+
+

Definition at line 5449 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__popup__buffer.js b/structnk__popup__buffer.js new file mode 100644 index 000000000..b6137c321 --- /dev/null +++ b/structnk__popup__buffer.js @@ -0,0 +1,8 @@ +var structnk__popup__buffer = +[ + [ "active", "structnk__popup__buffer.html#abc02c29d11327aac9e056d9b00c694e3", null ], + [ "begin", "structnk__popup__buffer.html#ae93e42070c567aa61352d9c832496c77", null ], + [ "end", "structnk__popup__buffer.html#a630c901d09e64b5945e5a9c760153496", null ], + [ "last", "structnk__popup__buffer.html#ab4c3e21e03a4428e92d375efe384add0", null ], + [ "parent", "structnk__popup__buffer.html#aff97e8d18ec464a77bf28be1b9f54bf7", null ] +]; \ No newline at end of file diff --git a/structnk__popup__state.html b/structnk__popup__state.html new file mode 100644 index 000000000..9cdc36cec --- /dev/null +++ b/structnk__popup__state.html @@ -0,0 +1,157 @@ + + + + + + + +Nuklear: nk_popup_state Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_popup_state Struct Reference
+
+
+
+Collaboration diagram for nk_popup_state:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_windowwin
 
+enum nk_panel_type type
 
+struct nk_popup_buffer buf
 
+nk_hash name
 
+nk_bool active
 
+unsigned combo_count
 
+unsigned con_count
 
+unsigned con_old
 
+unsigned active_con
 
+struct nk_rect header
 
+

Detailed Description

+
+

Definition at line 5500 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__popup__state.js b/structnk__popup__state.js new file mode 100644 index 000000000..bd76c3379 --- /dev/null +++ b/structnk__popup__state.js @@ -0,0 +1,13 @@ +var structnk__popup__state = +[ + [ "active", "structnk__popup__state.html#a73945da4ad8bd905f3f42442312ab2f4", null ], + [ "active_con", "structnk__popup__state.html#af670e7c6e45a92e369dc54e7b7321f78", null ], + [ "buf", "structnk__popup__state.html#a74261b023275e19b075c6db1dab8905b", null ], + [ "combo_count", "structnk__popup__state.html#aa3c1aaa75caa20b7bb8b2506aceb45ab", null ], + [ "con_count", "structnk__popup__state.html#ae2a49af137226e5994d10e2e33729aa6", null ], + [ "con_old", "structnk__popup__state.html#a5e6aef37a114b6d08184ff087d2d80e2", null ], + [ "header", "structnk__popup__state.html#a340e6ee6435224189edae0010a8bff37", null ], + [ "name", "structnk__popup__state.html#aabf4437be5882c80a3a290bc5240bc68", null ], + [ "type", "structnk__popup__state.html#af50698b4abee20445ffdd61584ed9740", null ], + [ "win", "structnk__popup__state.html#acce72ab5fd41fd54edf84d2a7915619c", null ] +]; \ No newline at end of file diff --git a/structnk__popup__state__coll__graph.dot b/structnk__popup__state__coll__graph.dot new file mode 100644 index 000000000..fc6536f51 --- /dev/null +++ b/structnk__popup__state__coll__graph.dot @@ -0,0 +1,59 @@ +digraph "nk_popup_state" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node2 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node3 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node4 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node5 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node2 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node6 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node7 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node8 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node9 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node9 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node10 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node10 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node8 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node11 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node11 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node2 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node4 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node12 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node12 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node13 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node13 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node5 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node2 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node14 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node14 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node2 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node13 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node15 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node15 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node11 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node16 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node16 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node17 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node17 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node18 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node18 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node19 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node19 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node20 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node20 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node20 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node21 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node21 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node11 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node1 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; +} diff --git a/structnk__property__state.html b/structnk__property__state.html new file mode 100644 index 000000000..774eb43bd --- /dev/null +++ b/structnk__property__state.html @@ -0,0 +1,155 @@ + + + + + + + +Nuklear: nk_property_state Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_property_state Struct Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+int active
 
+int prev
 
+char buffer [NK_MAX_NUMBER_BUFFER]
 
+int length
 
+int cursor
 
+int select_start
 
+int select_end
 
+nk_hash name
 
+unsigned int seq
 
+unsigned int old
 
+int state
 
+

Detailed Description

+
+

Definition at line 5525 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__property__state.js b/structnk__property__state.js new file mode 100644 index 000000000..05ff840ce --- /dev/null +++ b/structnk__property__state.js @@ -0,0 +1,14 @@ +var structnk__property__state = +[ + [ "active", "structnk__property__state.html#a70348c13baea22b6df6ad5fa1ef84f0a", null ], + [ "buffer", "structnk__property__state.html#aba9b0d6a242c09b6c949f933a3c4d6c0", null ], + [ "cursor", "structnk__property__state.html#a39f7b5ce4bacdc4dc826c13081b13a16", null ], + [ "length", "structnk__property__state.html#a7fb78c3d605eeda826192d5cb52bc65a", null ], + [ "name", "structnk__property__state.html#a6f05883484dcfe7d79af5dd6fda2b2ed", null ], + [ "old", "structnk__property__state.html#a425994ca840cd84b4bb43c14cc761f19", null ], + [ "prev", "structnk__property__state.html#ac200409ca5d075add6a4b68c3943e080", null ], + [ "select_end", "structnk__property__state.html#a4387cb65804a20dc3cc03b8a7bf388e5", null ], + [ "select_start", "structnk__property__state.html#a5a6dca290782c4691a70948aa6a2d403", null ], + [ "seq", "structnk__property__state.html#a17a7408517599a09e6244421b2f06f9b", null ], + [ "state", "structnk__property__state.html#acb8b93d0b35c75577a73362e05617259", null ] +]; \ No newline at end of file diff --git a/structnk__property__variant.html b/structnk__property__variant.html new file mode 100644 index 000000000..5d1912e87 --- /dev/null +++ b/structnk__property__variant.html @@ -0,0 +1,142 @@ + + + + + + + +Nuklear: nk_property_variant Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_property_variant Struct Reference
+
+
+
+Collaboration diagram for nk_property_variant:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + +

+Data Fields

+enum nk_property_kind kind
 
+union nk_property value
 
+union nk_property min_value
 
+union nk_property max_value
 
+union nk_property step
 
+

Detailed Description

+
+

Definition at line 319 of file nuklear_internal.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__property__variant.js b/structnk__property__variant.js new file mode 100644 index 000000000..1a9412beb --- /dev/null +++ b/structnk__property__variant.js @@ -0,0 +1,8 @@ +var structnk__property__variant = +[ + [ "kind", "structnk__property__variant.html#a36509f961ccfed93e15b33ad0d6a7f32", null ], + [ "max_value", "structnk__property__variant.html#a2150e69885d22af95de1577f893493be", null ], + [ "min_value", "structnk__property__variant.html#ab66f547d24f9be80f9390127f5ed9eee", null ], + [ "step", "structnk__property__variant.html#abee0a0a7add1e862369b6a89773dbafa", null ], + [ "value", "structnk__property__variant.html#ae42ff9fba95bdc3aa9c033e63e7b5a84", null ] +]; \ No newline at end of file diff --git a/structnk__property__variant__coll__graph.dot b/structnk__property__variant__coll__graph.dot new file mode 100644 index 000000000..2976fda74 --- /dev/null +++ b/structnk__property__variant__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_property_variant" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_property_variant",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" max_value\nmin_value\nstep\nvalue" ,fontname="Helvetica"]; + Node2 [label="nk_property",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__property.html",tooltip=" "]; +} diff --git a/structnk__rect.html b/structnk__rect.html new file mode 100644 index 000000000..d3856a0e6 --- /dev/null +++ b/structnk__rect.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_rect Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_rect Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+float x
 
+float y
 
+float w
 
+float h
 
+

Detailed Description

+
+

Definition at line 265 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__rect.js b/structnk__rect.js new file mode 100644 index 000000000..cc41093ca --- /dev/null +++ b/structnk__rect.js @@ -0,0 +1,7 @@ +var structnk__rect = +[ + [ "h", "structnk__rect.html#a1923740134757198bfa473f5513d66b5", null ], + [ "w", "structnk__rect.html#af2afe0055fff7694a63a53b8047f6022", null ], + [ "x", "structnk__rect.html#a406b23fbee8afcc3c1a8113c6e4616a1", null ], + [ "y", "structnk__rect.html#ac26ac69f1770909de805053a8cc94f08", null ] +]; \ No newline at end of file diff --git a/structnk__recti.html b/structnk__recti.html new file mode 100644 index 000000000..1dbac388e --- /dev/null +++ b/structnk__recti.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_recti Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_recti Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+short x
 
+short y
 
+short w
 
+short h
 
+

Detailed Description

+
+

Definition at line 266 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__recti.js b/structnk__recti.js new file mode 100644 index 000000000..c64c986d6 --- /dev/null +++ b/structnk__recti.js @@ -0,0 +1,7 @@ +var structnk__recti = +[ + [ "h", "structnk__recti.html#a347aa6882ebcdc51a94bb80a049d302c", null ], + [ "w", "structnk__recti.html#a3ad6451540db2a5f50fa003a3a0ffbde", null ], + [ "x", "structnk__recti.html#a97e89bfa91f1359ad07e3d40a0f26082", null ], + [ "y", "structnk__recti.html#a59bdabc718f54615256de8026399a518", null ] +]; \ No newline at end of file diff --git a/structnk__row__layout.html b/structnk__row__layout.html new file mode 100644 index 000000000..472203516 --- /dev/null +++ b/structnk__row__layout.html @@ -0,0 +1,166 @@ + + + + + + + +Nuklear: nk_row_layout Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_row_layout Struct Reference
+
+
+
+Collaboration diagram for nk_row_layout:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+enum nk_panel_row_layout_type type
 
+int index
 
+float height
 
+float min_height
 
+int columns
 
+const float * ratio
 
+float item_width
 
+float item_height
 
+float item_offset
 
+float filled
 
+struct nk_rect item
 
+int tree_depth
 
+float templates [NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS]
 
+

Detailed Description

+
+

Definition at line 5433 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__row__layout.js b/structnk__row__layout.js new file mode 100644 index 000000000..7e1113234 --- /dev/null +++ b/structnk__row__layout.js @@ -0,0 +1,16 @@ +var structnk__row__layout = +[ + [ "columns", "structnk__row__layout.html#a16f13d53cf3159bea36cf8297828296c", null ], + [ "filled", "structnk__row__layout.html#a100754dddcc6831144d57ce946d0b0cc", null ], + [ "height", "structnk__row__layout.html#a0d4150f39d7902658889b3eca96eda1b", null ], + [ "index", "structnk__row__layout.html#a2f67dbabb90fc669f89d146b72096214", null ], + [ "item", "structnk__row__layout.html#a9cf7d946ac238a1d740b30274c94d0c6", null ], + [ "item_height", "structnk__row__layout.html#a6b49798d8a6212635e6ff43ff18ff1b3", null ], + [ "item_offset", "structnk__row__layout.html#aed3b80106355700ff3c6f2b48955417a", null ], + [ "item_width", "structnk__row__layout.html#a9bed03da7c7e09d8acbcd40ea868a1a0", null ], + [ "min_height", "structnk__row__layout.html#a49e13ff37672b2ca384f934c81fa3150", null ], + [ "ratio", "structnk__row__layout.html#ade0fedd4bed112aee70a65ab4adcc584", null ], + [ "templates", "structnk__row__layout.html#ad73df5ad8ed8958a89920efa10dcdb70", null ], + [ "tree_depth", "structnk__row__layout.html#a4bc8a0292d154b34cd9b78b821a02961", null ], + [ "type", "structnk__row__layout.html#a41de8f5afc0197c0bef11e4ec7d621e3", null ] +]; \ No newline at end of file diff --git a/structnk__row__layout__coll__graph.dot b/structnk__row__layout__coll__graph.dot new file mode 100644 index 000000000..344429e39 --- /dev/null +++ b/structnk__row__layout__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_row_layout" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node2 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; +} diff --git a/structnk__scroll.html b/structnk__scroll.html new file mode 100644 index 000000000..f5fc7af7f --- /dev/null +++ b/structnk__scroll.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_scroll Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_scroll Struct Reference
+
+
+ + + + + + +

+Data Fields

+nk_uint x
 
+nk_uint y
 
+

Detailed Description

+
+

Definition at line 272 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__scroll.js b/structnk__scroll.js new file mode 100644 index 000000000..b53dcb489 --- /dev/null +++ b/structnk__scroll.js @@ -0,0 +1,5 @@ +var structnk__scroll = +[ + [ "x", "structnk__scroll.html#a6aa7dbdff410aadfde55e7514aca101d", null ], + [ "y", "structnk__scroll.html#a44fba8e9fb1e206f240e20257aad50b7", null ] +]; \ No newline at end of file diff --git a/structnk__str.html b/structnk__str.html new file mode 100644 index 000000000..ffcc146e4 --- /dev/null +++ b/structnk__str.html @@ -0,0 +1,141 @@ + + + + + + + +Nuklear: nk_str Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_str Struct Reference
+
+
+ +

============================================================== + More...

+ +

#include <nuklear.h>

+
+Collaboration diagram for nk_str:
+
+
Collaboration graph
+
[legend]
+ + + + + + +

+Data Fields

+struct nk_buffer buffer
 
+int len
 
+

Detailed Description

+

==============================================================

+
                    STRING
+

=============================================================== Basic string buffer which is only used in context with the text editor to manage and manipulate dynamic or fixed size string content. This is NOT the default string handling method. The only instance you should have any contact with this API is if you interact with an nk_text_edit object inside one of the copy and paste functions and even there only for more advanced cases.

+ +

Definition at line 4226 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__str.js b/structnk__str.js new file mode 100644 index 000000000..93c7ee59b --- /dev/null +++ b/structnk__str.js @@ -0,0 +1,5 @@ +var structnk__str = +[ + [ "buffer", "structnk__str.html#af09f932d4972189976784f9f6974e894", null ], + [ "len", "structnk__str.html#a3190eef31e3749578754e537adb19610", null ] +]; \ No newline at end of file diff --git a/structnk__str__coll__graph.dot b/structnk__str__coll__graph.dot new file mode 100644 index 000000000..b43d3cb12 --- /dev/null +++ b/structnk__str__coll__graph.dot @@ -0,0 +1,17 @@ +digraph "nk_str" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_str",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip="=============================================================="]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node2 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node3 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node4 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node5 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node5 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node6 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node6 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; +} diff --git a/structnk__style.html b/structnk__style.html new file mode 100644 index 000000000..b0350dbeb --- /dev/null +++ b/structnk__style.html @@ -0,0 +1,196 @@ + + + + + + + +Nuklear: nk_style Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style Struct Reference
+
+
+
+Collaboration diagram for nk_style:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+const struct nk_user_fontfont
 
+const struct nk_cursorcursors [NK_CURSOR_COUNT]
 
+const struct nk_cursorcursor_active
 
+struct nk_cursorcursor_last
 
+int cursor_visible
 
+struct nk_style_text text
 
+struct nk_style_button button
 
+struct nk_style_button contextual_button
 
+struct nk_style_button menu_button
 
+struct nk_style_toggle option
 
+struct nk_style_toggle checkbox
 
+struct nk_style_selectable selectable
 
+struct nk_style_slider slider
 
+struct nk_style_knob knob
 
+struct nk_style_progress progress
 
+struct nk_style_property property
 
+struct nk_style_edit edit
 
+struct nk_style_chart chart
 
+struct nk_style_scrollbar scrollh
 
+struct nk_style_scrollbar scrollv
 
+struct nk_style_tab tab
 
+struct nk_style_combo combo
 
+struct nk_style_window window
 
+

Detailed Description

+
+

Definition at line 5346 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style.js b/structnk__style.js new file mode 100644 index 000000000..ce36fd4d7 --- /dev/null +++ b/structnk__style.js @@ -0,0 +1,26 @@ +var structnk__style = +[ + [ "button", "structnk__style.html#a42b97653cc5b81ff97432e40fdf47026", null ], + [ "chart", "structnk__style.html#a61bfb1b8d07189d9ba529c666e42e886", null ], + [ "checkbox", "structnk__style.html#af3bd1c9f26bcdc34deeea5afe005b4ee", null ], + [ "combo", "structnk__style.html#ae206fbbb12d966b970cf291ca54e43ac", null ], + [ "contextual_button", "structnk__style.html#a22d7362fed90d872bca7e51c3281d10b", null ], + [ "cursor_active", "structnk__style.html#ac9b1221879c981b2afc829e819aaee5a", null ], + [ "cursor_last", "structnk__style.html#a90fbf5f270f36ec466bef6a0591fb37b", null ], + [ "cursor_visible", "structnk__style.html#a9ee1b418ab830430d317d9a4e06f4f98", null ], + [ "cursors", "structnk__style.html#aba31682e1e6dba96e52fcbdb750be34c", null ], + [ "edit", "structnk__style.html#a2e6872e44b048d5e562994b0f9acc4eb", null ], + [ "font", "structnk__style.html#aab136e535cc1d11d40e8b2fd18060c5d", null ], + [ "knob", "structnk__style.html#a42b012904a23d51192c9778c19864c65", null ], + [ "menu_button", "structnk__style.html#af26de9bbb7b4c8a9bd3e722ae41b6433", null ], + [ "option", "structnk__style.html#a12e31b1eff50ff00fc327325ce6cd7f9", null ], + [ "progress", "structnk__style.html#a8064c6b388f735cff32d4951c6156c9a", null ], + [ "property", "structnk__style.html#a6af2c48298dd1c358751c70c59b91924", null ], + [ "scrollh", "structnk__style.html#a3ba589ca868f99b7dfcffce8e788c7a9", null ], + [ "scrollv", "structnk__style.html#a11ec083ec9db3bdb607dd9fb74eac901", null ], + [ "selectable", "structnk__style.html#a7c05a97b375483b83cedf51932334357", null ], + [ "slider", "structnk__style.html#ac3f3abfee5be6a0fa96f8cbf0c63d77e", null ], + [ "tab", "structnk__style.html#a50ba7d1509135829d80fe1448cbff2b1", null ], + [ "text", "structnk__style.html#a3a84db8a7418bf259f60be1d10bd54ed", null ], + [ "window", "structnk__style.html#abab238d75bb12b1270171909a9b3e21a", null ] +]; \ No newline at end of file diff --git a/structnk__style__button.html b/structnk__style__button.html new file mode 100644 index 000000000..8dae4dd93 --- /dev/null +++ b/structnk__style__button.html @@ -0,0 +1,187 @@ + + + + + + + +Nuklear: nk_style_button Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_button Struct Reference
+
+
+
+Collaboration diagram for nk_style_button:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+float color_factor_background
 
+struct nk_color text_background
 
+struct nk_color text_normal
 
+struct nk_color text_hover
 
+struct nk_color text_active
 
+nk_flags text_alignment
 
+float color_factor_text
 
+float border
 
+float rounding
 
+struct nk_vec2 padding
 
+struct nk_vec2 image_padding
 
+struct nk_vec2 touch_padding
 
+float disabled_factor
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle userdata)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle userdata)
 
+

Detailed Description

+
+

Definition at line 4902 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__button.js b/structnk__style__button.js new file mode 100644 index 000000000..0856478eb --- /dev/null +++ b/structnk__style__button.js @@ -0,0 +1,23 @@ +var structnk__style__button = +[ + [ "active", "structnk__style__button.html#a69e536c30da388a84eed8f605e860129", null ], + [ "border", "structnk__style__button.html#a1f6e003617c76e6d7012ad4a64671303", null ], + [ "border_color", "structnk__style__button.html#aa89ff1863884006ea538cf4f5be8780a", null ], + [ "color_factor_background", "structnk__style__button.html#ad630f35887f18759d6924225bcbc033f", null ], + [ "color_factor_text", "structnk__style__button.html#acd102316049b57491bebcc9e15f83d17", null ], + [ "disabled_factor", "structnk__style__button.html#aeb76f996ca8162bb59bb43c1e2c7b487", null ], + [ "draw_begin", "structnk__style__button.html#a802641ef81a16f9d78c4a6758a3109b6", null ], + [ "draw_end", "structnk__style__button.html#a10cbc466ee1819b82fa19867095141a1", null ], + [ "hover", "structnk__style__button.html#a79019a05062f31a26cee5270f31a1c92", null ], + [ "image_padding", "structnk__style__button.html#ab53cdca97ddb24dea561e1cec88b3ba2", null ], + [ "normal", "structnk__style__button.html#a61dc3620dafc66cc38eeafca37a4b248", null ], + [ "padding", "structnk__style__button.html#a415445397a06f67cfe32516aeaac3683", null ], + [ "rounding", "structnk__style__button.html#ae1d141c0c8d52167d779fb4173b2da6b", null ], + [ "text_active", "structnk__style__button.html#a20188ac9f2d9353b770875ee1610126d", null ], + [ "text_alignment", "structnk__style__button.html#a3d8e4dc9e256e06ac66d9790403c79e4", null ], + [ "text_background", "structnk__style__button.html#a043c53b3664b19ad638c3e4aade0cb78", null ], + [ "text_hover", "structnk__style__button.html#a7e9e7511d72f41d83dccbb9af9b5dd33", null ], + [ "text_normal", "structnk__style__button.html#a70eabd8d45ca4dc60c0753c75b3b1b25", null ], + [ "touch_padding", "structnk__style__button.html#a70e4b8b7bc59f9b06e477c003bfab855", null ], + [ "userdata", "structnk__style__button.html#a486c8383bd02dae018cacaa370bf0c43", null ] +]; \ No newline at end of file diff --git a/structnk__style__button__coll__graph.dot b/structnk__style__button__coll__graph.dot new file mode 100644 index 000000000..34c612d89 --- /dev/null +++ b/structnk__style__button__coll__graph.dot @@ -0,0 +1,24 @@ +digraph "nk_style_button" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__chart.html b/structnk__style__chart.html new file mode 100644 index 000000000..d3cab1ec5 --- /dev/null +++ b/structnk__style__chart.html @@ -0,0 +1,157 @@ + + + + + + + +Nuklear: nk_style_chart Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_chart Struct Reference
+
+
+
+Collaboration diagram for nk_style_chart:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item background
 
+struct nk_color border_color
 
+struct nk_color selected_color
 
+struct nk_color color
 
+float border
 
+float rounding
 
+struct nk_vec2 padding
 
+float color_factor
 
+float disabled_factor
 
+nk_bool show_markers
 
+

Detailed Description

+
+

Definition at line 5207 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__chart.js b/structnk__style__chart.js new file mode 100644 index 000000000..e1348061d --- /dev/null +++ b/structnk__style__chart.js @@ -0,0 +1,13 @@ +var structnk__style__chart = +[ + [ "background", "structnk__style__chart.html#a45007058d04e5a1dc7611336ccfa4718", null ], + [ "border", "structnk__style__chart.html#a47ac4908b7c4d442e6e23c1b167c8a9e", null ], + [ "border_color", "structnk__style__chart.html#a1d84173adcc90140b7c12cb5875e716d", null ], + [ "color", "structnk__style__chart.html#ae9971b19eeb2b59cb81898f11cb56467", null ], + [ "color_factor", "structnk__style__chart.html#a1ac1072e07c2b90f74caea9c7d45400f", null ], + [ "disabled_factor", "structnk__style__chart.html#a5e57bbe387e7ce63f61895b7dbc5f491", null ], + [ "padding", "structnk__style__chart.html#aa74537263211d6e2202e82e2e2bb3052", null ], + [ "rounding", "structnk__style__chart.html#a178316102e8723bef6ba2c7e6c8ba0ed", null ], + [ "selected_color", "structnk__style__chart.html#ad1227179245ac3164d9e40b05b703926", null ], + [ "show_markers", "structnk__style__chart.html#a88675430de6d315612986a2e363bd5d0", null ] +]; \ No newline at end of file diff --git a/structnk__style__chart__coll__graph.dot b/structnk__style__chart__coll__graph.dot new file mode 100644 index 000000000..8c15e3e4a --- /dev/null +++ b/structnk__style__chart__coll__graph.dot @@ -0,0 +1,23 @@ +digraph "nk_style_chart" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_chart",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncolor\nselected_color" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__style__coll__graph.dot b/structnk__style__coll__graph.dot new file mode 100644 index 000000000..d392a5bcc --- /dev/null +++ b/structnk__style__coll__graph.dot @@ -0,0 +1,118 @@ +digraph "nk_style" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + rankdir="LR"; + Node1 [label="nk_style",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text" ,fontname="Helvetica"]; + Node2 [label="nk_style_text",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__text.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node3 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node4 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" selectable" ,fontname="Helvetica"]; + Node5 [label="nk_style_selectable",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__selectable.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" hover\nhover_active\nnormal\nnormal_active\npressed\npressed_active" ,fontname="Helvetica"]; + Node6 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node7 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node3 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node8 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node9 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node10 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node10 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node8 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node3 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_background\ntext_hover\ntext_hover_active\ntext_normal\ntext_normal_active\ntext_pressed\ntext_pressed_active" ,fontname="Helvetica"]; + Node4 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node11 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_active\ncursor_last\ncursors" ,fontname="Helvetica"]; + Node11 [label="nk_cursor",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__cursor.html",tooltip=" "]; + Node8 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node12 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node12 [label="nk_style_property",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__property.html",tooltip=" "]; + Node6 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node13 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node13 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node6 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node4 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node4 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node14 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node14 [label="nk_style_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__edit.html",tooltip=" "]; + Node6 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_hover\ncursor_normal\ncursor_text_hover\ncursor_text_normal\nselected_hover\nselected_normal\nselected_text_hover\nselected_text_normal\ntext_active\n..." ,fontname="Helvetica"]; + Node4 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nscrollbar_size" ,fontname="Helvetica"]; + Node15 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node15 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__scrollbar.html",tooltip=" "]; + Node6 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node13 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node4 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node9 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node16 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" font" ,fontname="Helvetica"]; + Node16 [label="nk_user_font",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__user__font.html",tooltip=" "]; + Node9 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata\nwidth" ,fontname="Helvetica"]; + Node17 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tab" ,fontname="Helvetica"]; + Node17 [label="nk_style_tab",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__tab.html",tooltip=" "]; + Node6 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node3 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext" ,fontname="Helvetica"]; + Node13 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" node_maximize_button\nnode_minimize_button\ntab_maximize_button\ntab_minimize_button" ,fontname="Helvetica"]; + Node4 -> Node17 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node18 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" progress" ,fontname="Helvetica"]; + Node18 [label="nk_style_progress",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__progress.html",tooltip=" "]; + Node6 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node4 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node9 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node13 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button\ncontextual_button\nmenu_button" ,fontname="Helvetica"]; + Node19 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo" ,fontname="Helvetica"]; + Node19 [label="nk_style_combo",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__combo.html",tooltip=" "]; + Node6 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal\nsymbol_active\nsymbol_hover\nsymbol_normal" ,fontname="Helvetica"]; + Node13 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button" ,fontname="Helvetica"]; + Node4 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button_padding\ncontent_padding\nspacing" ,fontname="Helvetica"]; + Node20 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" knob" ,fontname="Helvetica"]; + Node20 [label="nk_style_knob",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__knob.html",tooltip=" "]; + Node6 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_active\ncursor_hover\ncursor_normal\nknob_active\nknob_border_color\nknob_hover\nknob_normal" ,fontname="Helvetica"]; + Node4 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node9 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node14 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node21 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" checkbox\noption" ,fontname="Helvetica"]; + Node21 [label="nk_style_toggle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__toggle.html",tooltip=" "]; + Node6 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node4 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\ntouch_padding" ,fontname="Helvetica"]; + Node9 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node22 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" window" ,fontname="Helvetica"]; + Node22 [label="nk_style_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window.html",tooltip=" "]; + Node6 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" fixed_background\nscaler" ,fontname="Helvetica"]; + Node3 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\nborder_color\ncombo_border_color\ncontextual_border\l_color\ngroup_border_color\nmenu_border_color\npopup_border_color\ntooltip_border_color" ,fontname="Helvetica"]; + Node23 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node23 [label="nk_style_window_header",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window__header.html",tooltip=" "]; + Node6 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node13 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" close_button\nminimize_button" ,fontname="Helvetica"]; + Node4 -> Node23 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_padding\npadding\nspacing" ,fontname="Helvetica"]; + Node4 -> Node22 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo_padding\ncontextual_padding\ngroup_padding\nmenu_padding\nmin_size\npadding\npopup_padding\nscrollbar_size\nspacing\ntooltip_padding\n..." ,fontname="Helvetica"]; + Node24 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slider" ,fontname="Helvetica"]; + Node24 [label="nk_style_slider",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__slider.html",tooltip=" "]; + Node6 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node3 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bar_active\nbar_filled\nbar_hover\nbar_normal\nborder_color" ,fontname="Helvetica"]; + Node13 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node4 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_size\npadding\nspacing" ,fontname="Helvetica"]; + Node9 -> Node24 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node25 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node25 [label="nk_style_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__chart.html",tooltip=" "]; + Node6 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node3 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncolor\nselected_color" ,fontname="Helvetica"]; + Node4 -> Node25 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node15 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollh\nscrollv" ,fontname="Helvetica"]; +} diff --git a/structnk__style__combo.html b/structnk__style__combo.html new file mode 100644 index 000000000..b03d793ac --- /dev/null +++ b/structnk__style__combo.html @@ -0,0 +1,190 @@ + + + + + + + +Nuklear: nk_style_combo Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_combo Struct Reference
+
+
+
+Collaboration diagram for nk_style_combo:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_color label_normal
 
+struct nk_color label_hover
 
+struct nk_color label_active
 
+struct nk_color symbol_normal
 
+struct nk_color symbol_hover
 
+struct nk_color symbol_active
 
+struct nk_style_button button
 
+enum nk_symbol_type sym_normal
 
+enum nk_symbol_type sym_hover
 
+enum nk_symbol_type sym_active
 
+float border
 
+float rounding
 
+struct nk_vec2 content_padding
 
+struct nk_vec2 button_padding
 
+struct nk_vec2 spacing
 
+float color_factor
 
+float disabled_factor
 
+

Detailed Description

+
+

Definition at line 5223 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__combo.js b/structnk__style__combo.js new file mode 100644 index 000000000..d61ca0d2e --- /dev/null +++ b/structnk__style__combo.js @@ -0,0 +1,24 @@ +var structnk__style__combo = +[ + [ "active", "structnk__style__combo.html#aa8bd909d3b920864bf608d9358079d74", null ], + [ "border", "structnk__style__combo.html#a7590d9e1de6747e33b8a8b50e0e96ff4", null ], + [ "border_color", "structnk__style__combo.html#a560aa647e5759c9a7d27e6b88530d745", null ], + [ "button", "structnk__style__combo.html#a5f0d632c9044b05bd2eb9a039cd82c47", null ], + [ "button_padding", "structnk__style__combo.html#ad54d7c59d27c10d24000231699d32a33", null ], + [ "color_factor", "structnk__style__combo.html#ad726a163fd799994ec0af9a01957e653", null ], + [ "content_padding", "structnk__style__combo.html#a30a280e81ec452d7cd28be4fbc2e4255", null ], + [ "disabled_factor", "structnk__style__combo.html#a7c9bf901a680fd1cf6b2916056519fad", null ], + [ "hover", "structnk__style__combo.html#a7e43251b99975c9ec8069e77468698c1", null ], + [ "label_active", "structnk__style__combo.html#a2b901e453b2f00de9c4ac0b7f5a4d975", null ], + [ "label_hover", "structnk__style__combo.html#abd355bd2a43b1e6581746bd2a4f10c6e", null ], + [ "label_normal", "structnk__style__combo.html#a381df88d0500ee26c94654dfdceb9ff5", null ], + [ "normal", "structnk__style__combo.html#a4eb30990e9b05c237cb40ddcd75fbc84", null ], + [ "rounding", "structnk__style__combo.html#ac12f845441d878beaa895eb453e69c89", null ], + [ "spacing", "structnk__style__combo.html#a8d60722cdce4a4679d631feda0efa49c", null ], + [ "sym_active", "structnk__style__combo.html#a6240902e9bfdef2587d8d9322fddf203", null ], + [ "sym_hover", "structnk__style__combo.html#a85a58381e0f7d045f84cd02378dd1b25", null ], + [ "sym_normal", "structnk__style__combo.html#ab9bddd4bf005fe764cfc0e31760aa75a", null ], + [ "symbol_active", "structnk__style__combo.html#a9b73b9d12d5dbefafee3d6e2ca8a534e", null ], + [ "symbol_hover", "structnk__style__combo.html#aec3460dac9cc591cc9a8da26f01d941f", null ], + [ "symbol_normal", "structnk__style__combo.html#ae6acc5a734518b2d51f70e4c91657ea0", null ] +]; \ No newline at end of file diff --git a/structnk__style__combo__coll__graph.dot b/structnk__style__combo__coll__graph.dot new file mode 100644 index 000000000..e6bf32485 --- /dev/null +++ b/structnk__style__combo__coll__graph.dot @@ -0,0 +1,29 @@ +digraph "nk_style_combo" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_combo",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal\nsymbol_active\nsymbol_hover\nsymbol_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" button_padding\ncontent_padding\nspacing" ,fontname="Helvetica"]; +} diff --git a/structnk__style__edit.html b/structnk__style__edit.html new file mode 100644 index 000000000..67e03dd1b --- /dev/null +++ b/structnk__style__edit.html @@ -0,0 +1,199 @@ + + + + + + + +Nuklear: nk_style_edit Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_edit Struct Reference
+
+
+
+Collaboration diagram for nk_style_edit:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_style_scrollbar scrollbar
 
+struct nk_color cursor_normal
 
+struct nk_color cursor_hover
 
+struct nk_color cursor_text_normal
 
+struct nk_color cursor_text_hover
 
+struct nk_color text_normal
 
+struct nk_color text_hover
 
+struct nk_color text_active
 
+struct nk_color selected_normal
 
+struct nk_color selected_hover
 
+struct nk_color selected_text_normal
 
+struct nk_color selected_text_hover
 
+float border
 
+float rounding
 
+float cursor_size
 
+struct nk_vec2 scrollbar_size
 
+struct nk_vec2 padding
 
+float row_padding
 
+float color_factor
 
+float disabled_factor
 
+

Detailed Description

+
+

Definition at line 5138 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__edit.js b/structnk__style__edit.js new file mode 100644 index 000000000..af1160157 --- /dev/null +++ b/structnk__style__edit.js @@ -0,0 +1,27 @@ +var structnk__style__edit = +[ + [ "active", "structnk__style__edit.html#a084d5d9e1dd1e1c96842b38f9374b5f5", null ], + [ "border", "structnk__style__edit.html#a71cb11fe699fb87987b668da7ad09106", null ], + [ "border_color", "structnk__style__edit.html#a7db1be8d08fe0819c01573f30fd76dc4", null ], + [ "color_factor", "structnk__style__edit.html#a3a855b9561e023830592aad0dd30b630", null ], + [ "cursor_hover", "structnk__style__edit.html#aa204d0ab634e2a3d1c36497a847fbb0e", null ], + [ "cursor_normal", "structnk__style__edit.html#a5836e5f5889e3cfb9ceeb95d1e870b0b", null ], + [ "cursor_size", "structnk__style__edit.html#a7a07c991e93584f1cc27f93fca73e05d", null ], + [ "cursor_text_hover", "structnk__style__edit.html#ad68a82d55489c7748b329f9c051144f8", null ], + [ "cursor_text_normal", "structnk__style__edit.html#a8026344f1ad30782ef0972230e68e717", null ], + [ "disabled_factor", "structnk__style__edit.html#a1d4affc9baccb550a07a5d0fafe738f4", null ], + [ "hover", "structnk__style__edit.html#aeba75ada6a93ea4e9134d4b0267180c9", null ], + [ "normal", "structnk__style__edit.html#ad07a13b0c2bb0fca11d9c0f5e940affd", null ], + [ "padding", "structnk__style__edit.html#a7dd9e3f6cc5c55b975637efb9633713b", null ], + [ "rounding", "structnk__style__edit.html#a8ece09a4dd8ad3751b4f8f018b7d031e", null ], + [ "row_padding", "structnk__style__edit.html#ad3e38663299850e384418c2434dc9345", null ], + [ "scrollbar", "structnk__style__edit.html#a6e07fcf853df1fa96f9ccdd2f09621fe", null ], + [ "scrollbar_size", "structnk__style__edit.html#a901fcfe00eb51d67c95fd00119bd59b8", null ], + [ "selected_hover", "structnk__style__edit.html#a916e3c7beabccf78e513eb08ce223497", null ], + [ "selected_normal", "structnk__style__edit.html#a20fc95500c4cf144f1b6f9b4cd82d170", null ], + [ "selected_text_hover", "structnk__style__edit.html#a5d2d35fa59017d49618c464ffae7b19a", null ], + [ "selected_text_normal", "structnk__style__edit.html#a9cb16c11781b9eb11ef728df96a67fcb", null ], + [ "text_active", "structnk__style__edit.html#ac9f510ee90c741d734319c11ef0c91c0", null ], + [ "text_hover", "structnk__style__edit.html#a7af161d85dc3942b7f28e8ef127d0209", null ], + [ "text_normal", "structnk__style__edit.html#acad2fea48a0bd07cf6a21a30292ee3ff", null ] +]; \ No newline at end of file diff --git a/structnk__style__edit__coll__graph.dot b/structnk__style__edit__coll__graph.dot new file mode 100644 index 000000000..cbdfd1b92 --- /dev/null +++ b/structnk__style__edit__coll__graph.dot @@ -0,0 +1,35 @@ +digraph "nk_style_edit" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_edit",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_hover\ncursor_normal\ncursor_text_hover\ncursor_text_normal\nselected_hover\nselected_normal\nselected_text_hover\nselected_text_normal\ntext_active\n..." ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nscrollbar_size" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node9 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__scrollbar.html",tooltip=" "]; + Node2 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node10 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node10 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node8 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node6 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node8 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node6 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__item.html b/structnk__style__item.html new file mode 100644 index 000000000..b9201d666 --- /dev/null +++ b/structnk__style__item.html @@ -0,0 +1,133 @@ + + + + + + + +Nuklear: nk_style_item Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_item Struct Reference
+
+
+
+Collaboration diagram for nk_style_item:
+
+
Collaboration graph
+
[legend]
+ + + + + + +

+Data Fields

+enum nk_style_item_type type
 
+union nk_style_item_data data
 
+

Detailed Description

+
+

Definition at line 4890 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__item.js b/structnk__style__item.js new file mode 100644 index 000000000..b71804d86 --- /dev/null +++ b/structnk__style__item.js @@ -0,0 +1,5 @@ +var structnk__style__item = +[ + [ "data", "structnk__style__item.html#ad96b1cf96a4ec74e9229e8986a03cc4f", null ], + [ "type", "structnk__style__item.html#a743eeb49a50622632466d9300faaf448", null ] +]; \ No newline at end of file diff --git a/structnk__style__item__coll__graph.dot b/structnk__style__item__coll__graph.dot new file mode 100644 index 000000000..89424b9a8 --- /dev/null +++ b/structnk__style__item__coll__graph.dot @@ -0,0 +1,18 @@ +digraph "nk_style_item" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node2 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node3 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node4 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node5 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node6 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node6 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node4 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; +} diff --git a/structnk__style__knob.html b/structnk__style__knob.html new file mode 100644 index 000000000..337768ab9 --- /dev/null +++ b/structnk__style__knob.html @@ -0,0 +1,190 @@ + + + + + + + +Nuklear: nk_style_knob Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_knob Struct Reference
+
+
+
+Collaboration diagram for nk_style_knob:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_color knob_normal
 
+struct nk_color knob_hover
 
+struct nk_color knob_active
 
+struct nk_color knob_border_color
 
+struct nk_color cursor_normal
 
+struct nk_color cursor_hover
 
+struct nk_color cursor_active
 
+float border
 
+float knob_border
 
+struct nk_vec2 padding
 
+struct nk_vec2 spacing
 
+float cursor_width
 
+float color_factor
 
+float disabled_factor
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 5042 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__knob.js b/structnk__style__knob.js new file mode 100644 index 000000000..309cf4599 --- /dev/null +++ b/structnk__style__knob.js @@ -0,0 +1,24 @@ +var structnk__style__knob = +[ + [ "active", "structnk__style__knob.html#ae9a7b1c499313b0ea1171b20fe9dfb0f", null ], + [ "border", "structnk__style__knob.html#ada83bee170e6d6cba70c49c4697be5ca", null ], + [ "border_color", "structnk__style__knob.html#adc0361248706c55e26dbc55d76396e52", null ], + [ "color_factor", "structnk__style__knob.html#ac730a0a62d6345d8868f200734468d5b", null ], + [ "cursor_active", "structnk__style__knob.html#a65fdb3179adb1ee94277c5e42a3377de", null ], + [ "cursor_hover", "structnk__style__knob.html#ac1c94ab276553549cd12e4347dbdb4ab", null ], + [ "cursor_normal", "structnk__style__knob.html#acb432a1ef653453c81c2456033cbd880", null ], + [ "cursor_width", "structnk__style__knob.html#aea544ad7ac56a8fba307e5e5cf3b3d8a", null ], + [ "disabled_factor", "structnk__style__knob.html#a6d28d70b36b641b4cf89336e2f8ecc93", null ], + [ "draw_begin", "structnk__style__knob.html#ae066a2ff5a4cdb5dfb801b58ce1871fb", null ], + [ "draw_end", "structnk__style__knob.html#a59c92477cbd693e02b8a95b4bc8d7499", null ], + [ "hover", "structnk__style__knob.html#a367523e9833322b08878a0a637759190", null ], + [ "knob_active", "structnk__style__knob.html#ac93a95569917d87a611f108213e88f4c", null ], + [ "knob_border", "structnk__style__knob.html#a49d4828e152aca6f77b25771d3ef7ac1", null ], + [ "knob_border_color", "structnk__style__knob.html#a2ec50d4507af7db8dfc351fd5fdb97d3", null ], + [ "knob_hover", "structnk__style__knob.html#a81716a45e8df01821b289f2f1ccf106d", null ], + [ "knob_normal", "structnk__style__knob.html#a650f9223e0a236937416153a3f2ec528", null ], + [ "normal", "structnk__style__knob.html#ae34a7932fda902d425b7fcd34e838c7d", null ], + [ "padding", "structnk__style__knob.html#a943ca8939ae0bd72e6d60a921fc7d4bc", null ], + [ "spacing", "structnk__style__knob.html#a4556d81cec4a837b119a7e30a2fa50b7", null ], + [ "userdata", "structnk__style__knob.html#a3c6155a699e8d5a955f66a532cc6b75c", null ] +]; \ No newline at end of file diff --git a/structnk__style__knob__coll__graph.dot b/structnk__style__knob__coll__graph.dot new file mode 100644 index 000000000..9d3426996 --- /dev/null +++ b/structnk__style__knob__coll__graph.dot @@ -0,0 +1,24 @@ +digraph "nk_style_knob" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_knob",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_active\ncursor_hover\ncursor_normal\nknob_active\nknob_border_color\nknob_hover\nknob_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__progress.html b/structnk__style__progress.html new file mode 100644 index 000000000..4eae5767b --- /dev/null +++ b/structnk__style__progress.html @@ -0,0 +1,181 @@ + + + + + + + +Nuklear: nk_style_progress Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_progress Struct Reference
+
+
+
+Collaboration diagram for nk_style_progress:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_style_item cursor_normal
 
+struct nk_style_item cursor_hover
 
+struct nk_style_item cursor_active
 
+struct nk_color cursor_border_color
 
+float rounding
 
+float border
 
+float cursor_border
 
+float cursor_rounding
 
+struct nk_vec2 padding
 
+float color_factor
 
+float disabled_factor
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 5075 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__progress.js b/structnk__style__progress.js new file mode 100644 index 000000000..8f7663004 --- /dev/null +++ b/structnk__style__progress.js @@ -0,0 +1,21 @@ +var structnk__style__progress = +[ + [ "active", "structnk__style__progress.html#abb453eddb9a214da99d749f607d5623e", null ], + [ "border", "structnk__style__progress.html#aca84031f1ab9dc33c61e33114927a14f", null ], + [ "border_color", "structnk__style__progress.html#a68554aae9f9a0bd274878de0d6f7f5a2", null ], + [ "color_factor", "structnk__style__progress.html#aeab92e8aae9069c231790dc5ddc5c16f", null ], + [ "cursor_active", "structnk__style__progress.html#a9c6c963356ca9e1f4b8d1defa1cd9c4c", null ], + [ "cursor_border", "structnk__style__progress.html#a80b7c57f2bdd915e005714e797593873", null ], + [ "cursor_border_color", "structnk__style__progress.html#a640e304007caa59dda6661a9aa2398aa", null ], + [ "cursor_hover", "structnk__style__progress.html#a6a7818e0712da1bee016464e555195a3", null ], + [ "cursor_normal", "structnk__style__progress.html#a866c42112c17ee382558e69d087e1edc", null ], + [ "cursor_rounding", "structnk__style__progress.html#aa9b02af7e3b67fc361cd367331abce93", null ], + [ "disabled_factor", "structnk__style__progress.html#a1acd165ccb757345c644a5892e2c4326", null ], + [ "draw_begin", "structnk__style__progress.html#a8ad1b31c585c9146d1cdb5956edae910", null ], + [ "draw_end", "structnk__style__progress.html#a81cf48d7ef586bbe7ec6144e9e78541c", null ], + [ "hover", "structnk__style__progress.html#ac3861da43495ae38fd6a775e68dcccd5", null ], + [ "normal", "structnk__style__progress.html#a3b5e76c5d4a02397e1306a1c05db8556", null ], + [ "padding", "structnk__style__progress.html#a9e2d973ccf1bc0a04eb426cb74e33513", null ], + [ "rounding", "structnk__style__progress.html#a0dc22b2561fd10a3976c11bf7bab43c2", null ], + [ "userdata", "structnk__style__progress.html#af990f8b225eba54c3ad6b0137e619584", null ] +]; \ No newline at end of file diff --git a/structnk__style__progress__coll__graph.dot b/structnk__style__progress__coll__graph.dot new file mode 100644 index 000000000..7e44955c1 --- /dev/null +++ b/structnk__style__progress__coll__graph.dot @@ -0,0 +1,24 @@ +digraph "nk_style_progress" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_progress",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__property.html b/structnk__style__property.html new file mode 100644 index 000000000..94a9644de --- /dev/null +++ b/structnk__style__property.html @@ -0,0 +1,187 @@ + + + + + + + +Nuklear: nk_style_property Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_property Struct Reference
+
+
+
+Collaboration diagram for nk_style_property:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_color label_normal
 
+struct nk_color label_hover
 
+struct nk_color label_active
 
+enum nk_symbol_type sym_left
 
+enum nk_symbol_type sym_right
 
+float border
 
+float rounding
 
+struct nk_vec2 padding
 
+float color_factor
 
+float disabled_factor
 
+struct nk_style_edit edit
 
+struct nk_style_button inc_button
 
+struct nk_style_button dec_button
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 5174 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__property.js b/structnk__style__property.js new file mode 100644 index 000000000..0f55fe6cf --- /dev/null +++ b/structnk__style__property.js @@ -0,0 +1,23 @@ +var structnk__style__property = +[ + [ "active", "structnk__style__property.html#a4e3cdf1dec9c8b281cc30244c825be04", null ], + [ "border", "structnk__style__property.html#abe8322a79a6b21439701167a7c7d6aed", null ], + [ "border_color", "structnk__style__property.html#a616ded9dc7972df5ddb93221e7490086", null ], + [ "color_factor", "structnk__style__property.html#a96654a40ff9237b95e7262a6ec6237bf", null ], + [ "dec_button", "structnk__style__property.html#a22c87851305dcc0a9d512125c0788cb6", null ], + [ "disabled_factor", "structnk__style__property.html#a1f836a917c8a9daf999d0568d17b8e23", null ], + [ "draw_begin", "structnk__style__property.html#a2aef0170ff75d320823a03b6d86b002a", null ], + [ "draw_end", "structnk__style__property.html#a58a86e4d8e78c917022bf2755d1bffa0", null ], + [ "edit", "structnk__style__property.html#a535d43c8849cb49b3ec2fcd959512c60", null ], + [ "hover", "structnk__style__property.html#af068e57d16d3688ef77454f7ae166a67", null ], + [ "inc_button", "structnk__style__property.html#aee8c9b461e7959b29108e1510d95cc09", null ], + [ "label_active", "structnk__style__property.html#a9a36437119f317853ceb2f6cddbd9b24", null ], + [ "label_hover", "structnk__style__property.html#a5ff989c6583f7bd8da8217ea4469bbef", null ], + [ "label_normal", "structnk__style__property.html#a85e54e299a98c3dafd8e81d604f1cb47", null ], + [ "normal", "structnk__style__property.html#a969cb55e5a7852e684a1c18bb7e16b51", null ], + [ "padding", "structnk__style__property.html#ae20b4c10acc4b3b7441f10a6132c3e17", null ], + [ "rounding", "structnk__style__property.html#a8fa5d9ee8755ae85850fa92177aaf10c", null ], + [ "sym_left", "structnk__style__property.html#a1a3b31adbf1e81c87cc4151a8b310bd1", null ], + [ "sym_right", "structnk__style__property.html#a5b4fe5f11ee366d111fab105a0961034", null ], + [ "userdata", "structnk__style__property.html#a453d9d4df7e05c98746e5fae61725a2f", null ] +]; \ No newline at end of file diff --git a/structnk__style__property__coll__graph.dot b/structnk__style__property__coll__graph.dot new file mode 100644 index 000000000..c04a81cf6 --- /dev/null +++ b/structnk__style__property__coll__graph.dot @@ -0,0 +1,42 @@ +digraph "nk_style_property" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_property",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\nlabel_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node10 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node10 [label="nk_style_edit",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__edit.html",tooltip=" "]; + Node2 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_hover\ncursor_normal\ncursor_text_hover\ncursor_text_normal\nselected_hover\nselected_normal\nselected_text_hover\nselected_text_normal\ntext_active\n..." ,fontname="Helvetica"]; + Node9 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nscrollbar_size" ,fontname="Helvetica"]; + Node11 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node11 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__scrollbar.html",tooltip=" "]; + Node2 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node8 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node9 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node6 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__scrollbar.html b/structnk__style__scrollbar.html new file mode 100644 index 000000000..74b4ed727 --- /dev/null +++ b/structnk__style__scrollbar.html @@ -0,0 +1,196 @@ + + + + + + + +Nuklear: nk_style_scrollbar Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_scrollbar Struct Reference
+
+
+
+Collaboration diagram for nk_style_scrollbar:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_style_item cursor_normal
 
+struct nk_style_item cursor_hover
 
+struct nk_style_item cursor_active
 
+struct nk_color cursor_border_color
 
+float border
 
+float rounding
 
+float border_cursor
 
+float rounding_cursor
 
+struct nk_vec2 padding
 
+float color_factor
 
+float disabled_factor
 
+int show_buttons
 
+struct nk_style_button inc_button
 
+struct nk_style_button dec_button
 
+enum nk_symbol_type inc_symbol
 
+enum nk_symbol_type dec_symbol
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 5103 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__scrollbar.js b/structnk__style__scrollbar.js new file mode 100644 index 000000000..8b9b92dea --- /dev/null +++ b/structnk__style__scrollbar.js @@ -0,0 +1,26 @@ +var structnk__style__scrollbar = +[ + [ "active", "structnk__style__scrollbar.html#a9573ba744345893dca5cc83e0114dad5", null ], + [ "border", "structnk__style__scrollbar.html#a4ad9da720a06076e1e945cd020d72974", null ], + [ "border_color", "structnk__style__scrollbar.html#ad6489946e15dc9627a51673de29aea5d", null ], + [ "border_cursor", "structnk__style__scrollbar.html#a9b2f17f53a795487e099887747ab071a", null ], + [ "color_factor", "structnk__style__scrollbar.html#ac43a6c2d861fb84daba7138e72afc58c", null ], + [ "cursor_active", "structnk__style__scrollbar.html#a97b096336f28303c20aec3e9443bda75", null ], + [ "cursor_border_color", "structnk__style__scrollbar.html#a7bfa13e0e337fcbb9c8c48b4d244d774", null ], + [ "cursor_hover", "structnk__style__scrollbar.html#a6ad3a42ce7f9fc7277b0ee17eb48cd6c", null ], + [ "cursor_normal", "structnk__style__scrollbar.html#a62eefaabe4c7278fa367bfdab06d06a9", null ], + [ "dec_button", "structnk__style__scrollbar.html#a2f691b18296736c36da1e52295c87909", null ], + [ "dec_symbol", "structnk__style__scrollbar.html#ab6cfc79e1425a8eb0ec7839dac348e44", null ], + [ "disabled_factor", "structnk__style__scrollbar.html#a6f933c6e626cb110cbe8a58ed4a3593c", null ], + [ "draw_begin", "structnk__style__scrollbar.html#a71b634a194cacf873ba06c5010b7d154", null ], + [ "draw_end", "structnk__style__scrollbar.html#aa89c7f391ccb04c1d2c1e6a1fc5434c9", null ], + [ "hover", "structnk__style__scrollbar.html#a5059aac4c32afa1a127f02f6b465b90c", null ], + [ "inc_button", "structnk__style__scrollbar.html#a3184981c83202a1633f77a6fa224ff98", null ], + [ "inc_symbol", "structnk__style__scrollbar.html#ae880b936bb999860f48aeb9ab52e6a93", null ], + [ "normal", "structnk__style__scrollbar.html#a381f8388c9dd0aaf9c4c249f4d7320b6", null ], + [ "padding", "structnk__style__scrollbar.html#a3ad5ac59291c57e8cea5fc88028e0c6c", null ], + [ "rounding", "structnk__style__scrollbar.html#a654d88e47b733ddddac7f2cd555d06e1", null ], + [ "rounding_cursor", "structnk__style__scrollbar.html#a85338ec19a8d87922f6f56244eccc2d2", null ], + [ "show_buttons", "structnk__style__scrollbar.html#a446fa57c29033ddc7c960c83bee454fb", null ], + [ "userdata", "structnk__style__scrollbar.html#a9ffd74fad1ee2f9b293693ebd77f1110", null ] +]; \ No newline at end of file diff --git a/structnk__style__scrollbar__coll__graph.dot b/structnk__style__scrollbar__coll__graph.dot new file mode 100644 index 000000000..d8bfc1c13 --- /dev/null +++ b/structnk__style__scrollbar__coll__graph.dot @@ -0,0 +1,30 @@ +digraph "nk_style_scrollbar" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_scrollbar",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ncursor_border_color" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__selectable.html b/structnk__style__selectable.html new file mode 100644 index 000000000..8c6a1269c --- /dev/null +++ b/structnk__style__selectable.html @@ -0,0 +1,196 @@ + + + + + + + +Nuklear: nk_style_selectable Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_selectable Struct Reference
+
+
+
+Collaboration diagram for nk_style_selectable:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item pressed
 
+struct nk_style_item normal_active
 
+struct nk_style_item hover_active
 
+struct nk_style_item pressed_active
 
+struct nk_color text_normal
 
+struct nk_color text_hover
 
+struct nk_color text_pressed
 
+struct nk_color text_normal_active
 
+struct nk_color text_hover_active
 
+struct nk_color text_pressed_active
 
+struct nk_color text_background
 
+nk_flags text_alignment
 
+float rounding
 
+struct nk_vec2 padding
 
+struct nk_vec2 touch_padding
 
+struct nk_vec2 image_padding
 
+float color_factor
 
+float disabled_factor
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 4964 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__selectable.js b/structnk__style__selectable.js new file mode 100644 index 000000000..721cf2a95 --- /dev/null +++ b/structnk__style__selectable.js @@ -0,0 +1,26 @@ +var structnk__style__selectable = +[ + [ "color_factor", "structnk__style__selectable.html#a613ea09be0fba58650e363082ba2c865", null ], + [ "disabled_factor", "structnk__style__selectable.html#a09adc6a55d7fae545608cbaff1f9cd48", null ], + [ "draw_begin", "structnk__style__selectable.html#a5f8962de9e8498f98ca3a1d7b2d5e07c", null ], + [ "draw_end", "structnk__style__selectable.html#aeee4d32977d1afe0c1980d5fae22fa31", null ], + [ "hover", "structnk__style__selectable.html#a4baf84a6176b653b765de870a9295f12", null ], + [ "hover_active", "structnk__style__selectable.html#a53887479ef54ba2efd0c078ef64fbe4e", null ], + [ "image_padding", "structnk__style__selectable.html#a6a88ded1389d9a57728e885d9cfae6e5", null ], + [ "normal", "structnk__style__selectable.html#ac1d806a8b9e70279bf2c548b867ca3ae", null ], + [ "normal_active", "structnk__style__selectable.html#a7e73c516836b8d0574a1b32f8429a0f2", null ], + [ "padding", "structnk__style__selectable.html#a2c770699aeb61661fc489c3c6f8e29fb", null ], + [ "pressed", "structnk__style__selectable.html#ae86d07f5a16c62c546c95afddb3ef33d", null ], + [ "pressed_active", "structnk__style__selectable.html#aefd08007e119a3e321140e31cbfc3f7b", null ], + [ "rounding", "structnk__style__selectable.html#a2c0def63204e22489a0b5020b10baf57", null ], + [ "text_alignment", "structnk__style__selectable.html#ad5269b824144fa486e83f982767c71ab", null ], + [ "text_background", "structnk__style__selectable.html#af004e1c08e65f86c0d97f6cf38cc6387", null ], + [ "text_hover", "structnk__style__selectable.html#a1b4e828bbd8ba78ceed9e2efd7c882ba", null ], + [ "text_hover_active", "structnk__style__selectable.html#a68320f2eca12232ee4630fb884b389c2", null ], + [ "text_normal", "structnk__style__selectable.html#a6a849c9d50abd1dfbbffced1a0283869", null ], + [ "text_normal_active", "structnk__style__selectable.html#acc546befeecba45c2494c47e2800d5c7", null ], + [ "text_pressed", "structnk__style__selectable.html#ad96dd5eb1470bbd6cc6e66259e735688", null ], + [ "text_pressed_active", "structnk__style__selectable.html#aecb0b9ee1fb0cdd7d2d42f254c344cd6", null ], + [ "touch_padding", "structnk__style__selectable.html#a7c609f101e3d34ab2efd47512261285e", null ], + [ "userdata", "structnk__style__selectable.html#ab0cdeefe700feb442aefb82a49aa930b", null ] +]; \ No newline at end of file diff --git a/structnk__style__selectable__coll__graph.dot b/structnk__style__selectable__coll__graph.dot new file mode 100644 index 000000000..035e879d0 --- /dev/null +++ b/structnk__style__selectable__coll__graph.dot @@ -0,0 +1,24 @@ +digraph "nk_style_selectable" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_selectable",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" hover\nhover_active\nnormal\nnormal_active\npressed\npressed_active" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" text_background\ntext_hover\ntext_hover_active\ntext_normal\ntext_normal_active\ntext_pressed\ntext_pressed_active" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__slider.html b/structnk__style__slider.html new file mode 100644 index 000000000..00409fb84 --- /dev/null +++ b/structnk__style__slider.html @@ -0,0 +1,208 @@ + + + + + + + +Nuklear: nk_style_slider Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_slider Struct Reference
+
+
+
+Collaboration diagram for nk_style_slider:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_color bar_normal
 
+struct nk_color bar_hover
 
+struct nk_color bar_active
 
+struct nk_color bar_filled
 
+struct nk_style_item cursor_normal
 
+struct nk_style_item cursor_hover
 
+struct nk_style_item cursor_active
 
+float border
 
+float rounding
 
+float bar_height
 
+struct nk_vec2 padding
 
+struct nk_vec2 spacing
 
+struct nk_vec2 cursor_size
 
+float color_factor
 
+float disabled_factor
 
+int show_buttons
 
+struct nk_style_button inc_button
 
+struct nk_style_button dec_button
 
+enum nk_symbol_type inc_symbol
 
+enum nk_symbol_type dec_symbol
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 5001 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__slider.js b/structnk__style__slider.js new file mode 100644 index 000000000..8c7de7786 --- /dev/null +++ b/structnk__style__slider.js @@ -0,0 +1,30 @@ +var structnk__style__slider = +[ + [ "active", "structnk__style__slider.html#a9f85ea5ee0d952cc5d1e8dfcf06d09b6", null ], + [ "bar_active", "structnk__style__slider.html#a4234c3fd7dd2300c4c27d499eea7eb62", null ], + [ "bar_filled", "structnk__style__slider.html#aa0771bad7fb36018adad50913744dc34", null ], + [ "bar_height", "structnk__style__slider.html#a3c1f505c59eda0537441eb8e6d8c61e1", null ], + [ "bar_hover", "structnk__style__slider.html#a4beff8f720775d999ec7418f2424fc8e", null ], + [ "bar_normal", "structnk__style__slider.html#a1dc33f2a1593baa9cb1915035ef50ce7", null ], + [ "border", "structnk__style__slider.html#af2bb87b4b87a6e3d2663e2d3a64285dd", null ], + [ "border_color", "structnk__style__slider.html#a28182ddaeb0272101a4b484e8900c6db", null ], + [ "color_factor", "structnk__style__slider.html#ae5002f36af66b0d360ffefdb43f38941", null ], + [ "cursor_active", "structnk__style__slider.html#a110cadbf1de8a0830ea5da3e9d64563c", null ], + [ "cursor_hover", "structnk__style__slider.html#ae0045253c289dd775ba8fabf2b3b6761", null ], + [ "cursor_normal", "structnk__style__slider.html#a2029307fad5395d90ee585439583211e", null ], + [ "cursor_size", "structnk__style__slider.html#aedeb3490702bb178183e1a061bab2dcb", null ], + [ "dec_button", "structnk__style__slider.html#a2af42be5c477ddda05dde36d45fbebe4", null ], + [ "dec_symbol", "structnk__style__slider.html#a4974ffb84ecb0c34afc3b608e34bc339", null ], + [ "disabled_factor", "structnk__style__slider.html#a0d3e8bfcc3f24c8bbdb505d3c500284d", null ], + [ "draw_begin", "structnk__style__slider.html#a32d89881002446f40c03ff457a400bc5", null ], + [ "draw_end", "structnk__style__slider.html#a821c8a395eb26c6bd6089d75fc197881", null ], + [ "hover", "structnk__style__slider.html#a9f36bc9ca0a52499e74f486e7a1b4f32", null ], + [ "inc_button", "structnk__style__slider.html#a7d7bce402c16ed819a64c72b5ee1928f", null ], + [ "inc_symbol", "structnk__style__slider.html#a82d0f1a7c09ae08a0462047b1c4d035d", null ], + [ "normal", "structnk__style__slider.html#a338ae8754fc7997abbca126b60668c6a", null ], + [ "padding", "structnk__style__slider.html#a90c7b4d5cb928cf549eb76ec88f79dfd", null ], + [ "rounding", "structnk__style__slider.html#a950d2cbcc0c1b9dadf2a2c47b00fef4a", null ], + [ "show_buttons", "structnk__style__slider.html#a017823e8257d836b5b6b97433548039f", null ], + [ "spacing", "structnk__style__slider.html#a24853b62553da926bd2476e5305f27d4", null ], + [ "userdata", "structnk__style__slider.html#a6376ac01b14a9da29af611b9d2aeecd2", null ] +]; \ No newline at end of file diff --git a/structnk__style__slider__coll__graph.dot b/structnk__style__slider__coll__graph.dot new file mode 100644 index 000000000..1e2a93ead --- /dev/null +++ b/structnk__style__slider__coll__graph.dot @@ -0,0 +1,30 @@ +digraph "nk_style_slider" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_slider",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bar_active\nbar_filled\nbar_hover\nbar_normal\nborder_color" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dec_button\ninc_button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cursor_size\npadding\nspacing" ,fontname="Helvetica"]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__tab.html b/structnk__style__tab.html new file mode 100644 index 000000000..2e50346ce --- /dev/null +++ b/structnk__style__tab.html @@ -0,0 +1,175 @@ + + + + + + + +Nuklear: nk_style_tab Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_tab Struct Reference
+
+
+
+Collaboration diagram for nk_style_tab:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item background
 
+struct nk_color border_color
 
+struct nk_color text
 
+struct nk_style_button tab_maximize_button
 
+struct nk_style_button tab_minimize_button
 
+struct nk_style_button node_maximize_button
 
+struct nk_style_button node_minimize_button
 
+enum nk_symbol_type sym_minimize
 
+enum nk_symbol_type sym_maximize
 
+float border
 
+float rounding
 
+float indent
 
+struct nk_vec2 padding
 
+struct nk_vec2 spacing
 
+float color_factor
 
+float disabled_factor
 
+

Detailed Description

+
+

Definition at line 5256 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__tab.js b/structnk__style__tab.js new file mode 100644 index 000000000..4a37585bd --- /dev/null +++ b/structnk__style__tab.js @@ -0,0 +1,19 @@ +var structnk__style__tab = +[ + [ "background", "structnk__style__tab.html#a9f751874249b6e1a1d35a5e87eb95bda", null ], + [ "border", "structnk__style__tab.html#a5fd25a46147bd54d7700563c2860d1e8", null ], + [ "border_color", "structnk__style__tab.html#ae28051d435a882753fd267fef0637903", null ], + [ "color_factor", "structnk__style__tab.html#a04d70ee1edb74d61f3528ea9ea7d0a64", null ], + [ "disabled_factor", "structnk__style__tab.html#ae6528eba9916f683552bb531ce85f9b5", null ], + [ "indent", "structnk__style__tab.html#a535cb708f61a9cba5ee581ab044b8f71", null ], + [ "node_maximize_button", "structnk__style__tab.html#a1148fc1c2ba4fc697619e27a480469a8", null ], + [ "node_minimize_button", "structnk__style__tab.html#aacb1b9a6300f86ffdcb4f8cf90a344d2", null ], + [ "padding", "structnk__style__tab.html#ae7f4a7d0f21e33ecc0bf892902d012ad", null ], + [ "rounding", "structnk__style__tab.html#abf1cfda005f683974f5ab213c5513ea3", null ], + [ "spacing", "structnk__style__tab.html#acbaac49087d16fd6e755a125c4c23c84", null ], + [ "sym_maximize", "structnk__style__tab.html#a55e66550b450cf00499636997b6e9c19", null ], + [ "sym_minimize", "structnk__style__tab.html#a50977cd5e3328ce1bed6e7a7abaf7855", null ], + [ "tab_maximize_button", "structnk__style__tab.html#a249d7729ae42ddeb8a7791e359d05c19", null ], + [ "tab_minimize_button", "structnk__style__tab.html#a1b7600272b1e49296d89e68fb993cae2", null ], + [ "text", "structnk__style__tab.html#ad39a9118e595989bfe330ab5aad673a5", null ] +]; \ No newline at end of file diff --git a/structnk__style__tab__coll__graph.dot b/structnk__style__tab__coll__graph.dot new file mode 100644 index 000000000..dd224cfab --- /dev/null +++ b/structnk__style__tab__coll__graph.dot @@ -0,0 +1,29 @@ +digraph "nk_style_tab" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_tab",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" node_maximize_button\nnode_minimize_button\ntab_maximize_button\ntab_minimize_button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\nspacing" ,fontname="Helvetica"]; +} diff --git a/structnk__style__text.html b/structnk__style__text.html new file mode 100644 index 000000000..9e9618c27 --- /dev/null +++ b/structnk__style__text.html @@ -0,0 +1,139 @@ + + + + + + + +Nuklear: nk_style_text Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_text Struct Reference
+
+
+
+Collaboration diagram for nk_style_text:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + +

+Data Fields

+struct nk_color color
 
+struct nk_vec2 padding
 
+float color_factor
 
+float disabled_factor
 
+

Detailed Description

+
+

Definition at line 4895 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__text.js b/structnk__style__text.js new file mode 100644 index 000000000..3aba2f715 --- /dev/null +++ b/structnk__style__text.js @@ -0,0 +1,7 @@ +var structnk__style__text = +[ + [ "color", "structnk__style__text.html#a21064eb801febacffa14146f95ca7d74", null ], + [ "color_factor", "structnk__style__text.html#a6e8000878f61132a9310ed345762c092", null ], + [ "disabled_factor", "structnk__style__text.html#a562d89867c30152d09cea7f1e6439141", null ], + [ "padding", "structnk__style__text.html#a1939fda3b4e6295ec5645394a4fbc538", null ] +]; \ No newline at end of file diff --git a/structnk__style__text__coll__graph.dot b/structnk__style__text__coll__graph.dot new file mode 100644 index 000000000..a52f1f465 --- /dev/null +++ b/structnk__style__text__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_style_text" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_text",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node3 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__style__toggle.html b/structnk__style__toggle.html new file mode 100644 index 000000000..d1134e36e --- /dev/null +++ b/structnk__style__toggle.html @@ -0,0 +1,187 @@ + + + + + + + +Nuklear: nk_style_toggle Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_toggle Struct Reference
+
+
+
+Collaboration diagram for nk_style_toggle:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_color border_color
 
+struct nk_style_item cursor_normal
 
+struct nk_style_item cursor_hover
 
+struct nk_color text_normal
 
+struct nk_color text_hover
 
+struct nk_color text_active
 
+struct nk_color text_background
 
+nk_flags text_alignment
 
+struct nk_vec2 padding
 
+struct nk_vec2 touch_padding
 
+float spacing
 
+float border
 
+float color_factor
 
+float disabled_factor
 
+nk_handle userdata
 
+void(* draw_begin )(struct nk_command_buffer *, nk_handle)
 
+void(* draw_end )(struct nk_command_buffer *, nk_handle)
 
+

Detailed Description

+
+

Definition at line 4932 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__toggle.js b/structnk__style__toggle.js new file mode 100644 index 000000000..e2be55058 --- /dev/null +++ b/structnk__style__toggle.js @@ -0,0 +1,23 @@ +var structnk__style__toggle = +[ + [ "active", "structnk__style__toggle.html#a530dd1ded7867e555198fe08b666146f", null ], + [ "border", "structnk__style__toggle.html#a820feec522239e6415f2b177fa8feeda", null ], + [ "border_color", "structnk__style__toggle.html#a29792744d84cac0d0ca2c80caf83b2d9", null ], + [ "color_factor", "structnk__style__toggle.html#a27673c4c2b24a1baab48994615108f2b", null ], + [ "cursor_hover", "structnk__style__toggle.html#a081dad4b009cc2b0fb91eb1bd59b8b2e", null ], + [ "cursor_normal", "structnk__style__toggle.html#a2c94fa24f691cf912eb0551222cd5212", null ], + [ "disabled_factor", "structnk__style__toggle.html#af5a926eaba74e888eba0c790eb9121e7", null ], + [ "draw_begin", "structnk__style__toggle.html#aabff3e571b5bfd25c2b6d2d10a90c218", null ], + [ "draw_end", "structnk__style__toggle.html#a499f50c32b35717f5022272b95764599", null ], + [ "hover", "structnk__style__toggle.html#a153b011fb05353d22a0f05b0ccc1686b", null ], + [ "normal", "structnk__style__toggle.html#a4695e620bafae18faf6978d584042247", null ], + [ "padding", "structnk__style__toggle.html#a0eca091d63d706e3301362592b7716a3", null ], + [ "spacing", "structnk__style__toggle.html#af368c4c5cf5c3b1daf96ec50fb945275", null ], + [ "text_active", "structnk__style__toggle.html#a4559d75c458feb0065dc0ce215a9aea8", null ], + [ "text_alignment", "structnk__style__toggle.html#a5cb04eaf2146d08a6488138f41fd263a", null ], + [ "text_background", "structnk__style__toggle.html#af2a9e2bb0d58a1b757c968cc3fc556d3", null ], + [ "text_hover", "structnk__style__toggle.html#a60e3f7dbe4de71e4e93c887a57962367", null ], + [ "text_normal", "structnk__style__toggle.html#a21ecdac052ef22bdecad6ad23476c6ea", null ], + [ "touch_padding", "structnk__style__toggle.html#a5734e9bce0fee5178808a98fd6eb5ce2", null ], + [ "userdata", "structnk__style__toggle.html#ac3df28dd0fd8945d9d4effbd0953c957", null ] +]; \ No newline at end of file diff --git a/structnk__style__toggle__coll__graph.dot b/structnk__style__toggle__coll__graph.dot new file mode 100644 index 000000000..02168a3ad --- /dev/null +++ b/structnk__style__toggle__coll__graph.dot @@ -0,0 +1,24 @@ +digraph "nk_style_toggle" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_toggle",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\ncursor_hover\ncursor_normal\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding\ntouch_padding" ,fontname="Helvetica"]; + Node8 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; +} diff --git a/structnk__style__window.html b/structnk__style__window.html new file mode 100644 index 000000000..6456d5a77 --- /dev/null +++ b/structnk__style__window.html @@ -0,0 +1,217 @@ + + + + + + + +Nuklear: nk_style_window Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_window Struct Reference
+
+
+
+Collaboration diagram for nk_style_window:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_window_header header
 
+struct nk_style_item fixed_background
 
+struct nk_color background
 
+struct nk_color border_color
 
+struct nk_color popup_border_color
 
+struct nk_color combo_border_color
 
+struct nk_color contextual_border_color
 
+struct nk_color menu_border_color
 
+struct nk_color group_border_color
 
+struct nk_color tooltip_border_color
 
+struct nk_style_item scaler
 
+float border
 
+float combo_border
 
+float contextual_border
 
+float menu_border
 
+float group_border
 
+float tooltip_border
 
+float popup_border
 
+float min_row_height_padding
 
+float rounding
 
+struct nk_vec2 spacing
 
+struct nk_vec2 scrollbar_size
 
+struct nk_vec2 min_size
 
+struct nk_vec2 padding
 
+struct nk_vec2 group_padding
 
+struct nk_vec2 popup_padding
 
+struct nk_vec2 combo_padding
 
+struct nk_vec2 contextual_padding
 
+struct nk_vec2 menu_padding
 
+struct nk_vec2 tooltip_padding
 
+

Detailed Description

+
+

Definition at line 5309 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__window.js b/structnk__style__window.js new file mode 100644 index 000000000..bdf210e43 --- /dev/null +++ b/structnk__style__window.js @@ -0,0 +1,33 @@ +var structnk__style__window = +[ + [ "background", "structnk__style__window.html#a0e55fd791308fc8d44db3a28736597fb", null ], + [ "border", "structnk__style__window.html#ad7fa0f645e10ec7bc6d62692e6d6edf9", null ], + [ "border_color", "structnk__style__window.html#a588fddddfff17e20424605dd0752c5e0", null ], + [ "combo_border", "structnk__style__window.html#a5ef574e571d5e4726852ad2f65c3bbaa", null ], + [ "combo_border_color", "structnk__style__window.html#a4d713f3f55ceac37afd0325affec96c0", null ], + [ "combo_padding", "structnk__style__window.html#a83a35e01cad6096a632917eec64e78d7", null ], + [ "contextual_border", "structnk__style__window.html#ac4916772640d3241438c20c4a8ba0e50", null ], + [ "contextual_border_color", "structnk__style__window.html#ab476750247048a6857f70c19e3f1f8db", null ], + [ "contextual_padding", "structnk__style__window.html#ad5a1c6956c11037f90209d910d01bdc4", null ], + [ "fixed_background", "structnk__style__window.html#a02b8b0446c123c39ac66bada5c85028d", null ], + [ "group_border", "structnk__style__window.html#a01f2264c6f00fbfb81418c14bcccdb84", null ], + [ "group_border_color", "structnk__style__window.html#a3f27932c225305d78887c18aeb788c37", null ], + [ "group_padding", "structnk__style__window.html#a86d3a9f2f90380097f15b5abf09b0254", null ], + [ "header", "structnk__style__window.html#ab7b7c6889cc1f8dd34e55b556835ccec", null ], + [ "menu_border", "structnk__style__window.html#a21ca38bdb7f780cf8d02e3f400397219", null ], + [ "menu_border_color", "structnk__style__window.html#af0042cffbc72da702432ee1f3917d73c", null ], + [ "menu_padding", "structnk__style__window.html#a10bea28d74c8475b42642fb6d7fd2a5e", null ], + [ "min_row_height_padding", "structnk__style__window.html#a8015008fdc925c60cda1a81688eb9017", null ], + [ "min_size", "structnk__style__window.html#af285fb50f2acd6562706b97ee3233b0c", null ], + [ "padding", "structnk__style__window.html#a445b869eddbbe4883259f03263fc49df", null ], + [ "popup_border", "structnk__style__window.html#af8e78775dddd67f9e55ee160f8943a38", null ], + [ "popup_border_color", "structnk__style__window.html#a183e2d22fce0f95b1d4dca1a5df1fe95", null ], + [ "popup_padding", "structnk__style__window.html#a88ba604ec88fc6120dc7df0450b55a6c", null ], + [ "rounding", "structnk__style__window.html#a9be123b10d86541aa71dcb88272df015", null ], + [ "scaler", "structnk__style__window.html#a0b0b85091e31b0d2444e9cf761e9d878", null ], + [ "scrollbar_size", "structnk__style__window.html#a22a4285cab4e629d1a22ffb5e4fa31b8", null ], + [ "spacing", "structnk__style__window.html#a890814c49e4b1da0c311b1c1521c508c", null ], + [ "tooltip_border", "structnk__style__window.html#a9b989c066564f6af652248abcbc342f6", null ], + [ "tooltip_border_color", "structnk__style__window.html#acfc60df8137d2d6dfa344a39a0fc50e7", null ], + [ "tooltip_padding", "structnk__style__window.html#a29a5792cc695d42f7d2509ebec405465", null ] +]; \ No newline at end of file diff --git a/structnk__style__window__coll__graph.dot b/structnk__style__window__coll__graph.dot new file mode 100644 index 000000000..f41c017fc --- /dev/null +++ b/structnk__style__window__coll__graph.dot @@ -0,0 +1,34 @@ +digraph "nk_style_window" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_window",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" fixed_background\nscaler" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\nborder_color\ncombo_border_color\ncontextual_border\l_color\ngroup_border_color\nmenu_border_color\npopup_border_color\ntooltip_border_color" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node8 [label="nk_style_window_header",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__window__header.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" close_button\nminimize_button" ,fontname="Helvetica"]; + Node9 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node10 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node10 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node10 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_padding\npadding\nspacing" ,fontname="Helvetica"]; + Node10 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" combo_padding\ncontextual_padding\ngroup_padding\nmenu_padding\nmin_size\npadding\npopup_padding\nscrollbar_size\nspacing\ntooltip_padding\n..." ,fontname="Helvetica"]; +} diff --git a/structnk__style__window__header.html b/structnk__style__window__header.html new file mode 100644 index 000000000..f701f1baa --- /dev/null +++ b/structnk__style__window__header.html @@ -0,0 +1,172 @@ + + + + + + + +Nuklear: nk_style_window_header Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_window_header Struct Reference
+
+
+
+Collaboration diagram for nk_style_window_header:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_style_item normal
 
+struct nk_style_item hover
 
+struct nk_style_item active
 
+struct nk_style_button close_button
 
+struct nk_style_button minimize_button
 
+enum nk_symbol_type close_symbol
 
+enum nk_symbol_type minimize_symbol
 
+enum nk_symbol_type maximize_symbol
 
+struct nk_color label_normal
 
+struct nk_color label_hover
 
+struct nk_color label_active
 
+enum nk_style_header_align align
 
+struct nk_vec2 padding
 
+struct nk_vec2 label_padding
 
+struct nk_vec2 spacing
 
+

Detailed Description

+
+

Definition at line 5284 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__style__window__header.js b/structnk__style__window__header.js new file mode 100644 index 000000000..71463d2ed --- /dev/null +++ b/structnk__style__window__header.js @@ -0,0 +1,18 @@ +var structnk__style__window__header = +[ + [ "active", "structnk__style__window__header.html#a59505c74fca60c0a6c8b2e8ebe8e4c4a", null ], + [ "align", "structnk__style__window__header.html#ac625860b1a7a856e0b029b53bdc15c04", null ], + [ "close_button", "structnk__style__window__header.html#a1ca819b7f0dffcdeee9deaf7c9f6d5ce", null ], + [ "close_symbol", "structnk__style__window__header.html#a4462aa46088c539b1ccdcc2ddb0cd66e", null ], + [ "hover", "structnk__style__window__header.html#af3467d4e76b52493aaac1c56feb78d88", null ], + [ "label_active", "structnk__style__window__header.html#a765cc5c0b858988506b99a0664e3ebc8", null ], + [ "label_hover", "structnk__style__window__header.html#a649c485bd48904cc10427f72ee846228", null ], + [ "label_normal", "structnk__style__window__header.html#aa53277062d4275d5e7bb0aa5fd14cb41", null ], + [ "label_padding", "structnk__style__window__header.html#af36619005a7a69b06fcc037369a7e9e4", null ], + [ "maximize_symbol", "structnk__style__window__header.html#ad45757a0d00f6c46fa4f6c10fe9d526c", null ], + [ "minimize_button", "structnk__style__window__header.html#a492a9e48e37f089794368ebe4339440a", null ], + [ "minimize_symbol", "structnk__style__window__header.html#ab734ca0639f56dde1f263dce6868e527", null ], + [ "normal", "structnk__style__window__header.html#a60e54f5a43fc8963247f8ee035dbb44e", null ], + [ "padding", "structnk__style__window__header.html#a52553e15d47afbf06908e8a1949e12e2", null ], + [ "spacing", "structnk__style__window__header.html#a590cfd4a72e89b1fba9b3b966bf8ef5c", null ] +]; \ No newline at end of file diff --git a/structnk__style__window__header__coll__graph.dot b/structnk__style__window__header__coll__graph.dot new file mode 100644 index 000000000..57d800f71 --- /dev/null +++ b/structnk__style__window__header__coll__graph.dot @@ -0,0 +1,29 @@ +digraph "nk_style_window_header" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_window_header",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node2 [label="nk_style_item",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__item.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" data" ,fontname="Helvetica"]; + Node3 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__style__item__data.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node4 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node5 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node7 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node5 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_active\nlabel_hover\nlabel_normal" ,fontname="Helvetica"]; + Node8 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" close_button\nminimize_button" ,fontname="Helvetica"]; + Node8 [label="nk_style_button",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__style__button.html",tooltip=" "]; + Node2 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active\nhover\nnormal" ,fontname="Helvetica"]; + Node4 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" border_color\ntext_active\ntext_background\ntext_hover\ntext_normal" ,fontname="Helvetica"]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image_padding\npadding\ntouch_padding" ,fontname="Helvetica"]; + Node9 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node6 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" label_padding\npadding\nspacing" ,fontname="Helvetica"]; +} diff --git a/structnk__table.html b/structnk__table.html new file mode 100644 index 000000000..8443a2726 --- /dev/null +++ b/structnk__table.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_table Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_table Struct Reference
+
+
+
+Collaboration diagram for nk_table:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+unsigned int seq
 
+unsigned int size
 
+nk_hash keys [NK_VALUE_PAGE_CAPACITY]
 
+nk_uint values [NK_VALUE_PAGE_CAPACITY]
 
+struct nk_tablenext
 
+struct nk_tableprev
 
+

Detailed Description

+
+

Definition at line 5667 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__table.js b/structnk__table.js new file mode 100644 index 000000000..afd48e555 --- /dev/null +++ b/structnk__table.js @@ -0,0 +1,9 @@ +var structnk__table = +[ + [ "keys", "structnk__table.html#abe02ed8fb83c928c36e8e719d64e2cbf", null ], + [ "next", "structnk__table.html#a36a783e6a8874a8c0d793275d08355a4", null ], + [ "prev", "structnk__table.html#af01641e8389afdefbeb1e6a6e52dc557", null ], + [ "seq", "structnk__table.html#aa64704d2e52b6663f61c043b0378b2d4", null ], + [ "size", "structnk__table.html#a173992867275727635fff4f21e825d99", null ], + [ "values", "structnk__table.html#ae686139ae8eb9913024a5513c70bde76", null ] +]; \ No newline at end of file diff --git a/structnk__table__coll__graph.dot b/structnk__table__coll__graph.dot new file mode 100644 index 000000000..e87323005 --- /dev/null +++ b/structnk__table__coll__graph.dot @@ -0,0 +1,8 @@ +digraph "nk_table" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; +} diff --git a/structnk__text.html b/structnk__text.html new file mode 100644 index 000000000..4261ffe6d --- /dev/null +++ b/structnk__text.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_text Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text Struct Reference
+
+
+
+Collaboration diagram for nk_text:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+struct nk_vec2 padding
 
+struct nk_color background
 
+struct nk_color text
 
+

Detailed Description

+
+

Definition at line 236 of file nuklear_internal.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text.js b/structnk__text.js new file mode 100644 index 000000000..7969db842 --- /dev/null +++ b/structnk__text.js @@ -0,0 +1,6 @@ +var structnk__text = +[ + [ "background", "structnk__text.html#ac1976aa5779b97abcb48dc40b26372dc", null ], + [ "padding", "structnk__text.html#a34808df3c23c6997c8e30e2995a334af", null ], + [ "text", "structnk__text.html#ab89b4d2791913beff30666b32b3e1a94", null ] +]; \ No newline at end of file diff --git a/structnk__text__coll__graph.dot b/structnk__text__coll__graph.dot new file mode 100644 index 000000000..96b5a69fc --- /dev/null +++ b/structnk__text__coll__graph.dot @@ -0,0 +1,11 @@ +digraph "nk_text" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_text",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" background\ntext" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" padding" ,fontname="Helvetica"]; + Node3 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; +} diff --git a/structnk__text__edit.html b/structnk__text__edit.html new file mode 100644 index 000000000..5ae63f7d8 --- /dev/null +++ b/structnk__text__edit.html @@ -0,0 +1,175 @@ + + + + + + + +Nuklear: nk_text_edit Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text_edit Struct Reference
+
+
+
+Collaboration diagram for nk_text_edit:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct nk_clipboard clip
 
+struct nk_str string
 
+nk_plugin_filter filter
 
+struct nk_vec2 scrollbar
 
+int cursor
 
+int select_start
 
+int select_end
 
+unsigned char mode
 
+unsigned char cursor_at_end_of_line
 
+unsigned char initialized
 
+unsigned char has_preferred_x
 
+unsigned char single_line
 
+unsigned char active
 
+unsigned char padding1
 
+float preferred_x
 
+struct nk_text_undo_state undo
 
+

Detailed Description

+
+

Definition at line 4345 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text__edit.js b/structnk__text__edit.js new file mode 100644 index 000000000..bb039a2b4 --- /dev/null +++ b/structnk__text__edit.js @@ -0,0 +1,19 @@ +var structnk__text__edit = +[ + [ "active", "structnk__text__edit.html#a3d42a1c0032985e789fea827bc46c16a", null ], + [ "clip", "structnk__text__edit.html#a739e4da59f61a18ea51f9e17e970316a", null ], + [ "cursor", "structnk__text__edit.html#a40a308833ab82a4fd41aa1ce013d4430", null ], + [ "cursor_at_end_of_line", "structnk__text__edit.html#a731e886c13e4a3a0080dbd6b3594051d", null ], + [ "filter", "structnk__text__edit.html#a95a4fd378f171aedcfa8c018d351b5ff", null ], + [ "has_preferred_x", "structnk__text__edit.html#a3fe57c5d1b054e6e39f6bf4ea634e6ba", null ], + [ "initialized", "structnk__text__edit.html#a59ae91abb42caf733b9a3af950f9f288", null ], + [ "mode", "structnk__text__edit.html#a6d663e082a6944080d86d28a1f5063d7", null ], + [ "padding1", "structnk__text__edit.html#a7f1fd0b23e84fa90c5e5fc439e59f0ce", null ], + [ "preferred_x", "structnk__text__edit.html#a701466d8f31b392d4045db0ed1a2103d", null ], + [ "scrollbar", "structnk__text__edit.html#a36f4775f4ef50cc449212f737e7b5445", null ], + [ "select_end", "structnk__text__edit.html#a1bd5ca08f329f2485f0432b52c9093a6", null ], + [ "select_start", "structnk__text__edit.html#ac9d7d08e64dc391284f87ea54352093d", null ], + [ "single_line", "structnk__text__edit.html#a62aa1bf8ccab646b578c15fee5e6e60d", null ], + [ "string", "structnk__text__edit.html#a17295dc427008ac289138943c43ac556", null ], + [ "undo", "structnk__text__edit.html#aafeb06f0915d80cd8e4b16e9c3f3ef03", null ] +]; \ No newline at end of file diff --git a/structnk__text__edit__coll__graph.dot b/structnk__text__edit__coll__graph.dot new file mode 100644 index 000000000..2dd939bc6 --- /dev/null +++ b/structnk__text__edit__coll__graph.dot @@ -0,0 +1,29 @@ +digraph "nk_text_edit" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_text_edit",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" undo" ,fontname="Helvetica"]; + Node2 [label="nk_text_undo_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__text__undo__state.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" undo_rec" ,fontname="Helvetica"]; + Node3 [label="nk_text_undo_record",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__text__undo__record.html",tooltip=" "]; + Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node4 [label="nk_clipboard",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__clipboard.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" copy\npaste\nuserdata" ,fontname="Helvetica"]; + Node5 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node6 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" filter" ,fontname="Helvetica"]; + Node7 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" string" ,fontname="Helvetica"]; + Node7 [label="nk_str",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__str.html",tooltip="=============================================================="]; + Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node8 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node9 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node5 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node10 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node10 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node11 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node11 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; +} diff --git a/structnk__text__edit__row.html b/structnk__text__edit__row.html new file mode 100644 index 000000000..3ba7b4a8f --- /dev/null +++ b/structnk__text__edit__row.html @@ -0,0 +1,140 @@ + + + + + + + +Nuklear: nk_text_edit_row Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text_edit_row Struct Reference
+
+
+ + + + + + + + + + + + + + +

+Data Fields

+float x0
 
+float x1
 
+float baseline_y_delta
 
+float ymin
 
+float ymax
 
+int num_chars
 
+

Detailed Description

+
+

Definition at line 17 of file nuklear_text_editor.c.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text__edit__row.js b/structnk__text__edit__row.js new file mode 100644 index 000000000..84c494ec3 --- /dev/null +++ b/structnk__text__edit__row.js @@ -0,0 +1,9 @@ +var structnk__text__edit__row = +[ + [ "baseline_y_delta", "structnk__text__edit__row.html#ac46478d6dbfb1a75d12168ef4b5dc672", null ], + [ "num_chars", "structnk__text__edit__row.html#a8d4a667da69916faadc9c391585f97df", null ], + [ "x0", "structnk__text__edit__row.html#a82f893f6a9983cd55b27c1451995a7fd", null ], + [ "x1", "structnk__text__edit__row.html#aa1185ea1bce33b4e63bf2dd44b350bb2", null ], + [ "ymax", "structnk__text__edit__row.html#a2bf872ce52a8b4616cbbf5d5d0edeb04", null ], + [ "ymin", "structnk__text__edit__row.html#a1d55bef217c479a4ff57c8f851f3bb12", null ] +]; \ No newline at end of file diff --git a/structnk__text__find.html b/structnk__text__find.html new file mode 100644 index 000000000..448423e0d --- /dev/null +++ b/structnk__text__find.html @@ -0,0 +1,140 @@ + + + + + + + +Nuklear: nk_text_find Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text_find Struct Reference
+
+
+ + + + + + + + + + + + + + +

+Data Fields

+float x
 
+float y
 
+float height
 
+int first_char
 
+int length
 
+int prev_first
 
+

Detailed Description

+
+

Definition at line 10 of file nuklear_text_editor.c.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text__find.js b/structnk__text__find.js new file mode 100644 index 000000000..266325d20 --- /dev/null +++ b/structnk__text__find.js @@ -0,0 +1,9 @@ +var structnk__text__find = +[ + [ "first_char", "structnk__text__find.html#a0b49d16d52bdbf9d6270c5816a3ed32f", null ], + [ "height", "structnk__text__find.html#a6ae2fe074277e6ec09bb6afbdc6dd82b", null ], + [ "length", "structnk__text__find.html#a9d535fd53b9e796df11eee09f64220dd", null ], + [ "prev_first", "structnk__text__find.html#a1eeb6e6b2caea57b075d3dc89952b4ed", null ], + [ "x", "structnk__text__find.html#aac1710433af51f43fff9da2726b94c2b", null ], + [ "y", "structnk__text__find.html#a730df0c75ea3935854ff52c2a796c525", null ] +]; \ No newline at end of file diff --git a/structnk__text__undo__record.html b/structnk__text__undo__record.html new file mode 100644 index 000000000..77cec8fb4 --- /dev/null +++ b/structnk__text__undo__record.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: nk_text_undo_record Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text_undo_record Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+int where
 
+short insert_length
 
+short delete_length
 
+short char_storage
 
+

Detailed Description

+
+

Definition at line 4318 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text__undo__record.js b/structnk__text__undo__record.js new file mode 100644 index 000000000..a836cfa5b --- /dev/null +++ b/structnk__text__undo__record.js @@ -0,0 +1,7 @@ +var structnk__text__undo__record = +[ + [ "char_storage", "structnk__text__undo__record.html#ad5cd5f38387f14f8f34cf00ed861f70d", null ], + [ "delete_length", "structnk__text__undo__record.html#a449376b54622b187e084cc30b7f0f150", null ], + [ "insert_length", "structnk__text__undo__record.html#ae7f5973ad63b09bf0be082779de9b61e", null ], + [ "where", "structnk__text__undo__record.html#a2c32ddd92906ecaca05e6d6a1e6de551", null ] +]; \ No newline at end of file diff --git a/structnk__text__undo__state.html b/structnk__text__undo__state.html new file mode 100644 index 000000000..2f7e52f06 --- /dev/null +++ b/structnk__text__undo__state.html @@ -0,0 +1,145 @@ + + + + + + + +Nuklear: nk_text_undo_state Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_text_undo_state Struct Reference
+
+
+
+Collaboration diagram for nk_text_undo_state:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + +

+Data Fields

+struct nk_text_undo_record undo_rec [NK_TEXTEDIT_UNDOSTATECOUNT]
 
+nk_rune undo_char [NK_TEXTEDIT_UNDOCHARCOUNT]
 
+short undo_point
 
+short redo_point
 
+short undo_char_point
 
+short redo_char_point
 
+

Detailed Description

+
+

Definition at line 4325 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__text__undo__state.js b/structnk__text__undo__state.js new file mode 100644 index 000000000..e0d3c0af5 --- /dev/null +++ b/structnk__text__undo__state.js @@ -0,0 +1,9 @@ +var structnk__text__undo__state = +[ + [ "redo_char_point", "structnk__text__undo__state.html#ad1067474fa6efe12ad27a6b765b15c44", null ], + [ "redo_point", "structnk__text__undo__state.html#ab5cd02ca0246a81627790e3eb20773e1", null ], + [ "undo_char", "structnk__text__undo__state.html#a1e9a3b0a6cb7a1e2aee05c2de2ab618d", null ], + [ "undo_char_point", "structnk__text__undo__state.html#a2c98283f50f5ef3da53acee6b0b4f85d", null ], + [ "undo_point", "structnk__text__undo__state.html#acad719143b81dc7d2463c1d06f03c672", null ], + [ "undo_rec", "structnk__text__undo__state.html#ad8d4523c523f3f1a90fcc709f4db8756", null ] +]; \ No newline at end of file diff --git a/structnk__text__undo__state__coll__graph.dot b/structnk__text__undo__state__coll__graph.dot new file mode 100644 index 000000000..3943d5f93 --- /dev/null +++ b/structnk__text__undo__state__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_text_undo_state" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_text_undo_state",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" undo_rec" ,fontname="Helvetica"]; + Node2 [label="nk_text_undo_record",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__text__undo__record.html",tooltip=" "]; +} diff --git a/structnk__user__font.html b/structnk__user__font.html new file mode 100644 index 000000000..8e45ba616 --- /dev/null +++ b/structnk__user__font.html @@ -0,0 +1,138 @@ + + + + + + + +Nuklear: nk_user_font Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_user_font Struct Reference
+
+
+
+Collaboration diagram for nk_user_font:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + +

+Data Fields

+nk_handle userdata
 
+float height
 !< user provided font handle
 
+nk_text_width_f width
 !< max height of the font
 
+

Detailed Description

+
+

Definition at line 4006 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__user__font.js b/structnk__user__font.js new file mode 100644 index 000000000..5878d263b --- /dev/null +++ b/structnk__user__font.js @@ -0,0 +1,6 @@ +var structnk__user__font = +[ + [ "height", "structnk__user__font.html#ab98ed37df408e0c2febfe448897ccf82", null ], + [ "userdata", "structnk__user__font.html#a227c31a1ef360c78c98678d8d8546c03", null ], + [ "width", "structnk__user__font.html#aac686ca3e72208ddfb982caa7c89293a", null ] +]; \ No newline at end of file diff --git a/structnk__user__font__coll__graph.dot b/structnk__user__font__coll__graph.dot new file mode 100644 index 000000000..8d9a10977 --- /dev/null +++ b/structnk__user__font__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "nk_user_font" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_user_font",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata\nwidth" ,fontname="Helvetica"]; + Node2 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; +} diff --git a/structnk__vec2.html b/structnk__vec2.html new file mode 100644 index 000000000..911b38451 --- /dev/null +++ b/structnk__vec2.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_vec2 Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_vec2 Struct Reference
+
+
+ + + + + + +

+Data Fields

+float x
 
+float y
 
+

Detailed Description

+
+

Definition at line 263 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__vec2.js b/structnk__vec2.js new file mode 100644 index 000000000..f589def90 --- /dev/null +++ b/structnk__vec2.js @@ -0,0 +1,5 @@ +var structnk__vec2 = +[ + [ "x", "structnk__vec2.html#ac5f81ca9850b5c51081217c301cfea45", null ], + [ "y", "structnk__vec2.html#af9ce34510fcf72827a980f5d92d78f1c", null ] +]; \ No newline at end of file diff --git a/structnk__vec2i.html b/structnk__vec2i.html new file mode 100644 index 000000000..c4c2ad40d --- /dev/null +++ b/structnk__vec2i.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_vec2i Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_vec2i Struct Reference
+
+
+ + + + + + +

+Data Fields

+short x
 
+short y
 
+

Detailed Description

+
+

Definition at line 264 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__vec2i.js b/structnk__vec2i.js new file mode 100644 index 000000000..288304811 --- /dev/null +++ b/structnk__vec2i.js @@ -0,0 +1,5 @@ +var structnk__vec2i = +[ + [ "x", "structnk__vec2i.html#ad2ac1c7d932f8f02cb3becaf866b0892", null ], + [ "y", "structnk__vec2i.html#a08585382e94fa8985f9084f68282f349", null ] +]; \ No newline at end of file diff --git a/structnk__window.html b/structnk__window.html new file mode 100644 index 000000000..584666f62 --- /dev/null +++ b/structnk__window.html @@ -0,0 +1,184 @@ + + + + + + + +Nuklear: nk_window Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_window Struct Reference
+
+
+
+Collaboration diagram for nk_window:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+unsigned int seq
 
+nk_hash name
 
+char name_string [NK_WINDOW_MAX_NAME]
 
+nk_flags flags
 
+struct nk_rect bounds
 
+struct nk_scroll scrollbar
 
+struct nk_command_buffer buffer
 
+struct nk_panellayout
 
+float scrollbar_hiding_timer
 
+struct nk_property_state property
 
+struct nk_popup_state popup
 
+struct nk_edit_state edit
 
+unsigned int scrolled
 
+nk_bool widgets_disabled
 
+struct nk_tabletables
 
+unsigned int table_count
 
+struct nk_windownext
 
+struct nk_windowprev
 
+struct nk_windowparent
 
+

Detailed Description

+
+

Definition at line 5538 of file nuklear.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structnk__window.js b/structnk__window.js new file mode 100644 index 000000000..9aaf0e527 --- /dev/null +++ b/structnk__window.js @@ -0,0 +1,22 @@ +var structnk__window = +[ + [ "bounds", "structnk__window.html#a3faf3afe7ee63b8203eae8cf28bf1272", null ], + [ "buffer", "structnk__window.html#ab1a260769cace3a808d1361feeeaa002", null ], + [ "edit", "structnk__window.html#a5ff816faab95d10bf9bdff4518c268ea", null ], + [ "flags", "structnk__window.html#ab2c821a48b401380bc00031d5e7b9e87", null ], + [ "layout", "structnk__window.html#ad85f14784c55f21daa8e6bd9d226be43", null ], + [ "name", "structnk__window.html#afdb4b90e7f28cfec870cb349a5161ebc", null ], + [ "name_string", "structnk__window.html#a5fbe50f169aa47cab86ebef31e43047a", null ], + [ "next", "structnk__window.html#a43d9992fd6f4b1e86a325e099b7e49fa", null ], + [ "parent", "structnk__window.html#ade4eb319bf6471423d5d123a637f37c1", null ], + [ "popup", "structnk__window.html#aa5a5f13e1d678d56725eab9a0a130acd", null ], + [ "prev", "structnk__window.html#a467a7e9298d91e5226774ff6061a73b5", null ], + [ "property", "structnk__window.html#ab9fedd0b171796592daf5fa41a08bcea", null ], + [ "scrollbar", "structnk__window.html#a6a6e8fdf89a7039df725a14b640dc9df", null ], + [ "scrollbar_hiding_timer", "structnk__window.html#ae1edf68bb62484a80ef588d2ab0fd210", null ], + [ "scrolled", "structnk__window.html#ae08590387048eac30fbfde13579ca39a", null ], + [ "seq", "structnk__window.html#ac620283e47a5647e437a5f7742ac31bf", null ], + [ "table_count", "structnk__window.html#a1a2c2bcd90b8f65838f0c4d38f9e3f6d", null ], + [ "tables", "structnk__window.html#a5e7118c3d6354cce7d0a6b6ab19f2267", null ], + [ "widgets_disabled", "structnk__window.html#a5fa831106c9b3137c55abec3c4889d62", null ] +]; \ No newline at end of file diff --git a/structnk__window__coll__graph.dot b/structnk__window__coll__graph.dot new file mode 100644 index 000000000..27557bc87 --- /dev/null +++ b/structnk__window__coll__graph.dot @@ -0,0 +1,60 @@ +digraph "nk_window" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + rankdir="LR"; + Node1 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node2 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node3 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node4 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node5 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node6 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node7 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node7 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node8 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node8 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node6 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node9 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node10 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node10 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node11 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node11 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node2 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node3 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node12 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node12 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node3 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node11 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node13 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node13 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node9 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node14 -> Node11 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node14 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node15 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node15 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node16 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node16 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node17 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node17 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node18 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node18 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node18 -> Node18 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node19 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node19 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node9 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node20 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node20 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node3 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node21 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node21 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node1 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; +} diff --git a/structstbrp__context.html b/structstbrp__context.html new file mode 100644 index 000000000..e0ddceb7a --- /dev/null +++ b/structstbrp__context.html @@ -0,0 +1,154 @@ + + + + + + + +Nuklear: stbrp_context Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbrp_context Struct Reference
+
+
+
+Collaboration diagram for stbrp_context:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

+int width
 
+int height
 
+int align
 
+int init_mode
 
+int heuristic
 
+int num_nodes
 
+stbrp_nodeactive_head
 
+stbrp_nodefree_head
 
+stbrp_node extra [2]
 
+

Detailed Description

+
+

Definition at line 181 of file stb_rect_pack.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbrp__context.js b/structstbrp__context.js new file mode 100644 index 000000000..070e29914 --- /dev/null +++ b/structstbrp__context.js @@ -0,0 +1,12 @@ +var structstbrp__context = +[ + [ "active_head", "structstbrp__context.html#a13277239636803aff28f00b0a0376120", null ], + [ "align", "structstbrp__context.html#ae36053e2001a725aec2b5756dc990481", null ], + [ "extra", "structstbrp__context.html#a0b80e1fbdac125427526f3500d4e7624", null ], + [ "free_head", "structstbrp__context.html#a1336ae32373663847866cc65904c2839", null ], + [ "height", "structstbrp__context.html#af3715a6f3faecfb4fac8f6ccbb71f9c7", null ], + [ "heuristic", "structstbrp__context.html#a4b61a7f94e50a54c075e2a8f99f6503a", null ], + [ "init_mode", "structstbrp__context.html#a007509feee322404083034e4c2d3dc5d", null ], + [ "num_nodes", "structstbrp__context.html#afa8105d4ef6d3e0ae5aaf8e1ed4b2c58", null ], + [ "width", "structstbrp__context.html#a70cfcb2044ce8397cc440d28b30c09b2", null ] +]; \ No newline at end of file diff --git a/structstbrp__context__coll__graph.dot b/structstbrp__context__coll__graph.dot new file mode 100644 index 000000000..2cb70e13f --- /dev/null +++ b/structstbrp__context__coll__graph.dot @@ -0,0 +1,10 @@ +digraph "stbrp_context" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="stbrp_context",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" active_head\nextra\nfree_head" ,fontname="Helvetica"]; + Node2 [label="stbrp_node",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structstbrp__node.html",tooltip=" "]; + Node2 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; +} diff --git a/structstbrp__node.html b/structstbrp__node.html new file mode 100644 index 000000000..40583ab78 --- /dev/null +++ b/structstbrp__node.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: stbrp_node Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbrp_node Struct Reference
+
+
+
+Collaboration diagram for stbrp_node:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+stbrp_coord x
 
+stbrp_coord y
 
+stbrp_nodenext
 
+

Detailed Description

+
+

Definition at line 175 of file stb_rect_pack.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbrp__node.js b/structstbrp__node.js new file mode 100644 index 000000000..5a8773663 --- /dev/null +++ b/structstbrp__node.js @@ -0,0 +1,6 @@ +var structstbrp__node = +[ + [ "next", "structstbrp__node.html#a933cb2dd6cddc4fcaf10e3b40634bed4", null ], + [ "x", "structstbrp__node.html#a45ab31a88025db27d08040d715b129ea", null ], + [ "y", "structstbrp__node.html#ad0415cb102a4f37aa45073653307e67e", null ] +]; \ No newline at end of file diff --git a/structstbrp__node__coll__graph.dot b/structstbrp__node__coll__graph.dot new file mode 100644 index 000000000..a3cf3c8f7 --- /dev/null +++ b/structstbrp__node__coll__graph.dot @@ -0,0 +1,8 @@ +digraph "stbrp_node" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="stbrp_node",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next" ,fontname="Helvetica"]; +} diff --git a/structstbrp__rect.html b/structstbrp__rect.html new file mode 100644 index 000000000..1786e68ee --- /dev/null +++ b/structstbrp__rect.html @@ -0,0 +1,140 @@ + + + + + + + +Nuklear: stbrp_rect Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbrp_rect Struct Reference
+
+
+ + + + + + + + + + + + + + +

+Data Fields

+int id
 
+stbrp_coord w
 
+stbrp_coord h
 
+stbrp_coord x
 
+stbrp_coord y
 
+int was_packed
 
+

Detailed Description

+
+

Definition at line 115 of file stb_rect_pack.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbrp__rect.js b/structstbrp__rect.js new file mode 100644 index 000000000..7b841cf8f --- /dev/null +++ b/structstbrp__rect.js @@ -0,0 +1,9 @@ +var structstbrp__rect = +[ + [ "h", "structstbrp__rect.html#af68de2dadc7972b7c089d5e0c0558398", null ], + [ "id", "structstbrp__rect.html#a92da8626bc99df041c0c3bfd01c25f7a", null ], + [ "w", "structstbrp__rect.html#a248d43f1eb979c1e7b92ba6df431dec5", null ], + [ "was_packed", "structstbrp__rect.html#a74ba347755ce17f2f8a2ea66c612af49", null ], + [ "x", "structstbrp__rect.html#a4cc623a3e29f0bc0d3375f6645c84d18", null ], + [ "y", "structstbrp__rect.html#ae3034c1fbf86043b568f5a4dddf946fa", null ] +]; \ No newline at end of file diff --git a/structstbtt____bitmap.html b/structstbtt____bitmap.html new file mode 100644 index 000000000..b9faaa929 --- /dev/null +++ b/structstbtt____bitmap.html @@ -0,0 +1,134 @@ + + + + + + + +Nuklear: stbtt__bitmap Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt__bitmap Struct Reference
+
+
+ + + + + + + + + + +

+Data Fields

+int w
 
+int h
 
+int stride
 
+unsigned char * pixels
 
+

Detailed Description

+
+

Definition at line 924 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt____bitmap.js b/structstbtt____bitmap.js new file mode 100644 index 000000000..bb3bdcb74 --- /dev/null +++ b/structstbtt____bitmap.js @@ -0,0 +1,7 @@ +var structstbtt____bitmap = +[ + [ "h", "structstbtt____bitmap.html#a2afc802e26e9f1dda897ac16ecfff10e", null ], + [ "pixels", "structstbtt____bitmap.html#ae6be77625faf55b110eaaffde5c7733c", null ], + [ "stride", "structstbtt____bitmap.html#a48ee6b550ee4f1d85bfc32c62c0e9a98", null ], + [ "w", "structstbtt____bitmap.html#afbd607426f0a457b1a871ed902eeb926", null ] +]; \ No newline at end of file diff --git a/structstbtt____buf.html b/structstbtt____buf.html new file mode 100644 index 000000000..f03981f6e --- /dev/null +++ b/structstbtt____buf.html @@ -0,0 +1,131 @@ + + + + + + + +Nuklear: stbtt__buf Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt__buf Struct Reference
+
+
+ + + + + + + + +

+Data Fields

+unsigned char * data
 
+int cursor
 
+int size
 
+

Detailed Description

+
+

Definition at line 513 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt____buf.js b/structstbtt____buf.js new file mode 100644 index 000000000..8cbaa5c17 --- /dev/null +++ b/structstbtt____buf.js @@ -0,0 +1,6 @@ +var structstbtt____buf = +[ + [ "cursor", "structstbtt____buf.html#ac047fda650726920531272c28aa354fb", null ], + [ "data", "structstbtt____buf.html#a376d8cdacbc8295a7e88567ad52a0ac4", null ], + [ "size", "structstbtt____buf.html#a0f6f2d06981ab4a5697233bbd0cafb5b", null ] +]; \ No newline at end of file diff --git a/structstbtt__aligned__quad.html b/structstbtt__aligned__quad.html new file mode 100644 index 000000000..48cfce84e --- /dev/null +++ b/structstbtt__aligned__quad.html @@ -0,0 +1,146 @@ + + + + + + + +Nuklear: stbtt_aligned_quad Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_aligned_quad Struct Reference
+
+
+ + + + + + + + + + + + + + + + + + +

+Data Fields

+float x0
 
+float y0
 
+float s0
 
+float t0
 
+float x1
 
+float y1
 
+float s1
 
+float t1
 
+

Detailed Description

+
+

Definition at line 543 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__aligned__quad.js b/structstbtt__aligned__quad.js new file mode 100644 index 000000000..47f50af0e --- /dev/null +++ b/structstbtt__aligned__quad.js @@ -0,0 +1,11 @@ +var structstbtt__aligned__quad = +[ + [ "s0", "structstbtt__aligned__quad.html#ac23b153ff4042deb5499e5a8cacf4a59", null ], + [ "s1", "structstbtt__aligned__quad.html#a26360efee3cdfb5aa2bdc593157b436b", null ], + [ "t0", "structstbtt__aligned__quad.html#a921cd13638a8b3a1e0729021d371da49", null ], + [ "t1", "structstbtt__aligned__quad.html#ae1f5ed7333ca5bba46c6a098a05ac75b", null ], + [ "x0", "structstbtt__aligned__quad.html#ad74fd8fd69f8a8e1bd20cb0ab7df6e2e", null ], + [ "x1", "structstbtt__aligned__quad.html#a43a7eeac24238e289f825e644331dee6", null ], + [ "y0", "structstbtt__aligned__quad.html#a6178a6b380cf6889893afaeb5019ecd6", null ], + [ "y1", "structstbtt__aligned__quad.html#a66ee8061da982804073a3d2a9114e53c", null ] +]; \ No newline at end of file diff --git a/structstbtt__bakedchar.html b/structstbtt__bakedchar.html new file mode 100644 index 000000000..38c36de7f --- /dev/null +++ b/structstbtt__bakedchar.html @@ -0,0 +1,143 @@ + + + + + + + +Nuklear: stbtt_bakedchar Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_bakedchar Struct Reference
+
+
+ + + + + + + + + + + + + + + + +

+Data Fields

+unsigned short x0
 
+unsigned short y0
 
+unsigned short x1
 
+unsigned short y1
 
+float xoff
 
+float yoff
 
+float xadvance
 
+

Detailed Description

+
+

Definition at line 527 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__bakedchar.js b/structstbtt__bakedchar.js new file mode 100644 index 000000000..88f87409b --- /dev/null +++ b/structstbtt__bakedchar.js @@ -0,0 +1,10 @@ +var structstbtt__bakedchar = +[ + [ "x0", "structstbtt__bakedchar.html#a8011a0ed0410de9fa405c9cb1ab43da2", null ], + [ "x1", "structstbtt__bakedchar.html#a72c22c32abde95a5ba02925b8bd892bf", null ], + [ "xadvance", "structstbtt__bakedchar.html#ad77b35d1a849d9eb7edb91df05b10536", null ], + [ "xoff", "structstbtt__bakedchar.html#a0708a6588a2768b68a3ae59002944b7c", null ], + [ "y0", "structstbtt__bakedchar.html#aec4def12c086e0038ba32ff33ee78644", null ], + [ "y1", "structstbtt__bakedchar.html#ac831dc667f6c39b5d22740c6cbd5bc3f", null ], + [ "yoff", "structstbtt__bakedchar.html#aba01393e52d1c6f4ce86a8b51e498bb4", null ] +]; \ No newline at end of file diff --git a/structstbtt__fontinfo.html b/structstbtt__fontinfo.html new file mode 100644 index 000000000..c556d821a --- /dev/null +++ b/structstbtt__fontinfo.html @@ -0,0 +1,187 @@ + + + + + + + +Nuklear: stbtt_fontinfo Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_fontinfo Struct Reference
+
+
+
+Collaboration diagram for stbtt_fontinfo:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+void * userdata
 
+unsigned char * data
 
+int fontstart
 
+int numGlyphs
 
+int loca
 
+int head
 
+int glyf
 
+int hhea
 
+int hmtx
 
+int kern
 
+int gpos
 
+int svg
 
+int index_map
 
+int indexToLocFormat
 
+stbtt__buf cff
 
+stbtt__buf charstrings
 
+stbtt__buf gsubrs
 
+stbtt__buf subrs
 
+stbtt__buf fontdicts
 
+stbtt__buf fdselect
 
+

Detailed Description

+
+

Definition at line 713 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__fontinfo.js b/structstbtt__fontinfo.js new file mode 100644 index 000000000..60308d792 --- /dev/null +++ b/structstbtt__fontinfo.js @@ -0,0 +1,23 @@ +var structstbtt__fontinfo = +[ + [ "cff", "structstbtt__fontinfo.html#a6031b4bda94aa2b5ff07ef5d626a15a4", null ], + [ "charstrings", "structstbtt__fontinfo.html#aaf04a69f8dd4b6a8bed4191b57145082", null ], + [ "data", "structstbtt__fontinfo.html#af348db379cf0e0e71a68603d00501d41", null ], + [ "fdselect", "structstbtt__fontinfo.html#a4e06b1c29295a9aba529105e88fe1d71", null ], + [ "fontdicts", "structstbtt__fontinfo.html#a966c70ac9548a02fff558846fbce3677", null ], + [ "fontstart", "structstbtt__fontinfo.html#a139234d825b585afa27748a1f3d10c7d", null ], + [ "glyf", "structstbtt__fontinfo.html#a5de2129e0a415748920f6aa10ceee6e5", null ], + [ "gpos", "structstbtt__fontinfo.html#aeb6732549a55fa30235d0c0ecd743022", null ], + [ "gsubrs", "structstbtt__fontinfo.html#afc5bfc4a52ad0e3879f0f81a372da7fb", null ], + [ "head", "structstbtt__fontinfo.html#ab76ed2f4cbd8fcbd8465ca5f88e7e2b9", null ], + [ "hhea", "structstbtt__fontinfo.html#a91b82ae03d68892eb7f3fbd3a8b990e5", null ], + [ "hmtx", "structstbtt__fontinfo.html#aebf42701e99b88d07a59bf99cb84b9a1", null ], + [ "index_map", "structstbtt__fontinfo.html#a0b95e3ac0c397b72b7696ce6696eb189", null ], + [ "indexToLocFormat", "structstbtt__fontinfo.html#a5fa117a7ef058111a70a5b0b87d220f4", null ], + [ "kern", "structstbtt__fontinfo.html#a57cc83512daea60e97ed49354d634d37", null ], + [ "loca", "structstbtt__fontinfo.html#a15344195b181b50bde4f59ae7ca248c0", null ], + [ "numGlyphs", "structstbtt__fontinfo.html#a60ad8301a98eb7cd91472ce846d9080d", null ], + [ "subrs", "structstbtt__fontinfo.html#aebc496bb1c001a8a90e0e66da16107d2", null ], + [ "svg", "structstbtt__fontinfo.html#a2aae62e8e1269ab65be642a7ec82d7b3", null ], + [ "userdata", "structstbtt__fontinfo.html#a9c81078df96a7a3f730137151efab285", null ] +]; \ No newline at end of file diff --git a/structstbtt__fontinfo__coll__graph.dot b/structstbtt__fontinfo__coll__graph.dot new file mode 100644 index 000000000..b9e9ba1a4 --- /dev/null +++ b/structstbtt__fontinfo__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "stbtt_fontinfo" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="stbtt_fontinfo",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cff\ncharstrings\nfdselect\nfontdicts\ngsubrs\nsubrs" ,fontname="Helvetica"]; + Node2 [label="stbtt__buf",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structstbtt____buf.html",tooltip=" "]; +} diff --git a/structstbtt__kerningentry.html b/structstbtt__kerningentry.html new file mode 100644 index 000000000..ccc3a0d25 --- /dev/null +++ b/structstbtt__kerningentry.html @@ -0,0 +1,131 @@ + + + + + + + +Nuklear: stbtt_kerningentry Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_kerningentry Struct Reference
+
+
+ + + + + + + + +

+Data Fields

+int glyph1
 
+int glyph2
 
+int advance
 
+

Detailed Description

+
+

Definition at line 804 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__kerningentry.js b/structstbtt__kerningentry.js new file mode 100644 index 000000000..eef117c24 --- /dev/null +++ b/structstbtt__kerningentry.js @@ -0,0 +1,6 @@ +var structstbtt__kerningentry = +[ + [ "advance", "structstbtt__kerningentry.html#a1924543c84b2abbdbac1a951f441d8aa", null ], + [ "glyph1", "structstbtt__kerningentry.html#a395848ac004ad9193c532ebc08b07f91", null ], + [ "glyph2", "structstbtt__kerningentry.html#a9d5a83a93bb6a40bed5c166c5f295c61", null ] +]; \ No newline at end of file diff --git a/structstbtt__pack__context.html b/structstbtt__pack__context.html new file mode 100644 index 000000000..39944ea8c --- /dev/null +++ b/structstbtt__pack__context.html @@ -0,0 +1,155 @@ + + + + + + + +Nuklear: stbtt_pack_context Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_pack_context Struct Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+void * user_allocator_context
 
+void * pack_info
 
+int width
 
+int height
 
+int stride_in_bytes
 
+int padding
 
+int skip_missing
 
+unsigned int h_oversample
 
+unsigned int v_oversample
 
+unsigned char * pixels
 
+void * nodes
 
+

Detailed Description

+
+

Definition at line 678 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__pack__context.js b/structstbtt__pack__context.js new file mode 100644 index 000000000..3034d6105 --- /dev/null +++ b/structstbtt__pack__context.js @@ -0,0 +1,14 @@ +var structstbtt__pack__context = +[ + [ "h_oversample", "structstbtt__pack__context.html#aee1019f9634cad49fa07e8e1f897d6b7", null ], + [ "height", "structstbtt__pack__context.html#a817ec010d7f09ba9776517c5a87f13a7", null ], + [ "nodes", "structstbtt__pack__context.html#a11a73fa6860e6be1ac039fcca9db2c7c", null ], + [ "pack_info", "structstbtt__pack__context.html#a303a72f0a39479b439fa531925be7031", null ], + [ "padding", "structstbtt__pack__context.html#a1191f34fa995910044191584f0d7a803", null ], + [ "pixels", "structstbtt__pack__context.html#a6549105fd1922df983fbe036b9db4a1a", null ], + [ "skip_missing", "structstbtt__pack__context.html#a435bae89225862e65211e0b456f632d3", null ], + [ "stride_in_bytes", "structstbtt__pack__context.html#abbe9a25aae0e26b81a5f7339fac23801", null ], + [ "user_allocator_context", "structstbtt__pack__context.html#a45fddc4d4adfcef58aa08ad2874cedc0", null ], + [ "v_oversample", "structstbtt__pack__context.html#a4b55efa27ef36e7f258afe92921784c0", null ], + [ "width", "structstbtt__pack__context.html#a5da0b7b5d3b82d5fc75ea1c8945183fa", null ] +]; \ No newline at end of file diff --git a/structstbtt__pack__range.html b/structstbtt__pack__range.html new file mode 100644 index 000000000..877ee8fd7 --- /dev/null +++ b/structstbtt__pack__range.html @@ -0,0 +1,148 @@ + + + + + + + +Nuklear: stbtt_pack_range Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_pack_range Struct Reference
+
+
+
+Collaboration diagram for stbtt_pack_range:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + + + + + + + + + +

+Data Fields

+float font_size
 
+int first_unicode_codepoint_in_range
 
+int * array_of_unicode_codepoints
 
+int num_chars
 
+stbtt_packedcharchardata_for_range
 
+unsigned char h_oversample
 
+unsigned char v_oversample
 
+

Detailed Description

+
+

Definition at line 619 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__pack__range.js b/structstbtt__pack__range.js new file mode 100644 index 000000000..b4164e8ae --- /dev/null +++ b/structstbtt__pack__range.js @@ -0,0 +1,10 @@ +var structstbtt__pack__range = +[ + [ "array_of_unicode_codepoints", "structstbtt__pack__range.html#a1567aa5455e1251529a91b46261368cf", null ], + [ "chardata_for_range", "structstbtt__pack__range.html#aa8f7ddd637ed341ea39b08466fab9284", null ], + [ "first_unicode_codepoint_in_range", "structstbtt__pack__range.html#a3b414cbee1e164c29dd138e0ae3d5759", null ], + [ "font_size", "structstbtt__pack__range.html#a296916dc971e5e7627822fe98dc42828", null ], + [ "h_oversample", "structstbtt__pack__range.html#a7a642139ce446c58fde5c48553bcf008", null ], + [ "num_chars", "structstbtt__pack__range.html#a046d65b6ffb65fb998d471ba098e2e23", null ], + [ "v_oversample", "structstbtt__pack__range.html#a6288f14006e257544db3d015c32b4113", null ] +]; \ No newline at end of file diff --git a/structstbtt__pack__range__coll__graph.dot b/structstbtt__pack__range__coll__graph.dot new file mode 100644 index 000000000..fbed47bb4 --- /dev/null +++ b/structstbtt__pack__range__coll__graph.dot @@ -0,0 +1,9 @@ +digraph "stbtt_pack_range" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="stbtt_pack_range",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chardata_for_range" ,fontname="Helvetica"]; + Node2 [label="stbtt_packedchar",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structstbtt__packedchar.html",tooltip=" "]; +} diff --git a/structstbtt__packedchar.html b/structstbtt__packedchar.html new file mode 100644 index 000000000..83eb051e8 --- /dev/null +++ b/structstbtt__packedchar.html @@ -0,0 +1,149 @@ + + + + + + + +Nuklear: stbtt_packedchar Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_packedchar Struct Reference
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Data Fields

+unsigned short x0
 
+unsigned short y0
 
+unsigned short x1
 
+unsigned short y1
 
+float xoff
 
+float yoff
 
+float xadvance
 
+float xoff2
 
+float yoff2
 
+

Detailed Description

+
+

Definition at line 575 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__packedchar.js b/structstbtt__packedchar.js new file mode 100644 index 000000000..d394f902d --- /dev/null +++ b/structstbtt__packedchar.js @@ -0,0 +1,12 @@ +var structstbtt__packedchar = +[ + [ "x0", "structstbtt__packedchar.html#a02cb73a5af37ed60dafd5e4b731af09e", null ], + [ "x1", "structstbtt__packedchar.html#a99d371f0261cd13dfd1a179f143175d1", null ], + [ "xadvance", "structstbtt__packedchar.html#a28707ae98d1fa946b3390840aeff76ab", null ], + [ "xoff", "structstbtt__packedchar.html#adb30c50674c79d32116ae6f94bd5893f", null ], + [ "xoff2", "structstbtt__packedchar.html#a3a33880f925ca826c908cbf9f0673c9f", null ], + [ "y0", "structstbtt__packedchar.html#a43429c9545ca8ccf14012cedcf83c1a7", null ], + [ "y1", "structstbtt__packedchar.html#a9569073ba79fad355210b6ffc35905a7", null ], + [ "yoff", "structstbtt__packedchar.html#a6f342ae10df5319f4999ffd256567142", null ], + [ "yoff2", "structstbtt__packedchar.html#a2ec5bbd1010c9a9b7cbdeb7503dcaffa", null ] +]; \ No newline at end of file diff --git a/structstbtt__vertex.html b/structstbtt__vertex.html new file mode 100644 index 000000000..382e9f446 --- /dev/null +++ b/structstbtt__vertex.html @@ -0,0 +1,146 @@ + + + + + + + +Nuklear: stbtt_vertex Struct Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
stbtt_vertex Struct Reference
+
+
+ + + + + + + + + + + + + + + + + + +

+Data Fields

+stbtt_vertex_type x
 
+stbtt_vertex_type y
 
+stbtt_vertex_type cx
 
+stbtt_vertex_type cy
 
+stbtt_vertex_type cx1
 
+stbtt_vertex_type cy1
 
+unsigned char type
 
+unsigned char padding
 
+

Detailed Description

+
+

Definition at line 835 of file stb_truetype.h.

+

The documentation for this struct was generated from the following file: +
+
+ + + + diff --git a/structstbtt__vertex.js b/structstbtt__vertex.js new file mode 100644 index 000000000..766719332 --- /dev/null +++ b/structstbtt__vertex.js @@ -0,0 +1,11 @@ +var structstbtt__vertex = +[ + [ "cx", "structstbtt__vertex.html#a43835489e2a151b31cb100d20f8adeae", null ], + [ "cx1", "structstbtt__vertex.html#a1c45a8d41727b24b84f97a944f2b800a", null ], + [ "cy", "structstbtt__vertex.html#a5610d6335aa6962d970fc7fd2225545e", null ], + [ "cy1", "structstbtt__vertex.html#a68227d28643f5667064fa3c385f4ea7d", null ], + [ "padding", "structstbtt__vertex.html#a8bd328747e8ea018612960a52e3e3ede", null ], + [ "type", "structstbtt__vertex.html#aa325b3707b88e7e104c0de46bb2bf395", null ], + [ "x", "structstbtt__vertex.html#a81773edbe760d0e090561a3c1e86c919", null ], + [ "y", "structstbtt__vertex.html#a9052065ca544b63d537325b246928cfc", null ] +]; \ No newline at end of file diff --git a/sync_off.png b/sync_off.png new file mode 100644 index 000000000..3b443fc62 Binary files /dev/null and b/sync_off.png differ diff --git a/sync_on.png b/sync_on.png new file mode 100644 index 000000000..e08320fb6 Binary files /dev/null and b/sync_on.png differ diff --git a/tab_a.png b/tab_a.png new file mode 100644 index 000000000..3b725c41c Binary files /dev/null and b/tab_a.png differ diff --git a/tab_b.png b/tab_b.png new file mode 100644 index 000000000..e2b4a8638 Binary files /dev/null and b/tab_b.png differ diff --git a/tab_h.png b/tab_h.png new file mode 100644 index 000000000..fd5cb7054 Binary files /dev/null and b/tab_h.png differ diff --git a/tab_s.png b/tab_s.png new file mode 100644 index 000000000..ab478c95b Binary files /dev/null and b/tab_s.png differ diff --git a/tabs.css b/tabs.css new file mode 100644 index 000000000..7d45d36c1 --- /dev/null +++ b/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} diff --git a/unionnk__handle.html b/unionnk__handle.html new file mode 100644 index 000000000..c971d47fe --- /dev/null +++ b/unionnk__handle.html @@ -0,0 +1,128 @@ + + + + + + + +Nuklear: nk_handle Union Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_handle Union Reference
+
+
+ + + + + + +

+Data Fields

+void * ptr
 
+int id
 
+

Detailed Description

+
+

Definition at line 268 of file nuklear.h.

+

The documentation for this union was generated from the following file: +
+
+ + + + diff --git a/unionnk__handle.js b/unionnk__handle.js new file mode 100644 index 000000000..f9c42728d --- /dev/null +++ b/unionnk__handle.js @@ -0,0 +1,5 @@ +var unionnk__handle = +[ + [ "id", "unionnk__handle.html#ab4db605f712876c795e39598b25ca9b3", null ], + [ "ptr", "unionnk__handle.html#adbdcd879ad5f3d6cc77b5085bf35ac40", null ] +]; \ No newline at end of file diff --git a/unionnk__page__data.html b/unionnk__page__data.html new file mode 100644 index 000000000..a43b0c85e --- /dev/null +++ b/unionnk__page__data.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_page_data Union Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_page_data Union Reference
+
+
+
+Collaboration diagram for nk_page_data:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+struct nk_table tbl
 
+struct nk_panel pan
 
+struct nk_window win
 
+

Detailed Description

+
+

Definition at line 5675 of file nuklear.h.

+

The documentation for this union was generated from the following file: +
+
+ + + + diff --git a/unionnk__page__data.js b/unionnk__page__data.js new file mode 100644 index 000000000..f22bbddfe --- /dev/null +++ b/unionnk__page__data.js @@ -0,0 +1,6 @@ +var unionnk__page__data = +[ + [ "pan", "unionnk__page__data.html#ae0a8e6dafef7b65c846d19571209d2dc", null ], + [ "tbl", "unionnk__page__data.html#a825b989765fecd6442058144d9554894", null ], + [ "win", "unionnk__page__data.html#ae954192e5736fbedeb8b4a9242d6d13a", null ] +]; \ No newline at end of file diff --git a/unionnk__page__data__coll__graph.dot b/unionnk__page__data__coll__graph.dot new file mode 100644 index 000000000..3e3d5f965 --- /dev/null +++ b/unionnk__page__data__coll__graph.dot @@ -0,0 +1,63 @@ +digraph "nk_page_data" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_page_data",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node2 [label="nk_window",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__window.html",tooltip=" "]; + Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node3 [label="nk_command_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__command__buffer.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" clip" ,fontname="Helvetica"]; + Node4 [label="nk_rect",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__rect.html",tooltip=" "]; + Node5 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"]; + Node5 [label="nk_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer.html",tooltip=" "]; + Node6 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pool" ,fontname="Helvetica"]; + Node6 [label="nk_allocator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__allocator.html",tooltip=" "]; + Node7 -> Node6 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" alloc\nfree\nuserdata" ,fontname="Helvetica"]; + Node7 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node8 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" marker" ,fontname="Helvetica"]; + Node8 [label="nk_buffer_marker",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__buffer__marker.html",tooltip=" "]; + Node9 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" memory" ,fontname="Helvetica"]; + Node9 [label="nk_memory",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__memory.html",tooltip=" "]; + Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" userdata" ,fontname="Helvetica"]; + Node10 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node10 [label="nk_scroll",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__scroll.html",tooltip=" "]; + Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds" ,fontname="Helvetica"]; + Node2 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nparent\nprev" ,fontname="Helvetica"]; + Node11 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" property" ,fontname="Helvetica"]; + Node11 [label="nk_property_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__property__state.html",tooltip=" "]; + Node12 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" layout" ,fontname="Helvetica"]; + Node12 [label="nk_panel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__panel.html",tooltip=" "]; + Node3 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buffer" ,fontname="Helvetica"]; + Node4 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" bounds\nclip" ,fontname="Helvetica"]; + Node13 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row" ,fontname="Helvetica"]; + Node13 [label="nk_row_layout",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__row__layout.html",tooltip=" "]; + Node4 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" item" ,fontname="Helvetica"]; + Node12 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" parent" ,fontname="Helvetica"]; + Node14 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" menu" ,fontname="Helvetica"]; + Node14 [label="nk_menu_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__menu__state.html",tooltip=" "]; + Node10 -> Node14 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" offset" ,fontname="Helvetica"]; + Node15 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" chart" ,fontname="Helvetica"]; + Node15 [label="nk_chart",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart.html",tooltip=" "]; + Node16 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slots" ,fontname="Helvetica"]; + Node16 [label="nk_chart_slot",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__chart__slot.html",tooltip=" "]; + Node17 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color\nhighlight" ,fontname="Helvetica"]; + Node17 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node18 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" last" ,fontname="Helvetica"]; + Node18 [label="nk_vec2",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__vec2.html",tooltip=" "]; + Node19 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tables" ,fontname="Helvetica"]; + Node19 [label="nk_table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__table.html",tooltip=" "]; + Node19 -> Node19 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" next\nprev" ,fontname="Helvetica"]; + Node20 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" edit" ,fontname="Helvetica"]; + Node20 [label="nk_edit_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__edit__state.html",tooltip=" "]; + Node10 -> Node20 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scrollbar" ,fontname="Helvetica"]; + Node21 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" popup" ,fontname="Helvetica"]; + Node21 [label="nk_popup_state",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__state.html",tooltip=" "]; + Node4 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" header" ,fontname="Helvetica"]; + Node22 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" buf" ,fontname="Helvetica"]; + Node22 [label="nk_popup_buffer",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__popup__buffer.html",tooltip=" "]; + Node2 -> Node21 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" win" ,fontname="Helvetica"]; + Node12 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" pan" ,fontname="Helvetica"]; + Node19 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tbl" ,fontname="Helvetica"]; +} diff --git a/unionnk__property.html b/unionnk__property.html new file mode 100644 index 000000000..29d10b607 --- /dev/null +++ b/unionnk__property.html @@ -0,0 +1,131 @@ + + + + + + + +Nuklear: nk_property Union Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_property Union Reference
+
+
+ + + + + + + + +

+Data Fields

+int i
 
+float f
 
+double d
 
+

Detailed Description

+
+

Definition at line 314 of file nuklear_internal.h.

+

The documentation for this union was generated from the following file: +
+
+ + + + diff --git a/unionnk__property.js b/unionnk__property.js new file mode 100644 index 000000000..4286346b0 --- /dev/null +++ b/unionnk__property.js @@ -0,0 +1,6 @@ +var unionnk__property = +[ + [ "d", "unionnk__property.html#a7a04f4bdb47807638606e92aa0fd20b1", null ], + [ "f", "unionnk__property.html#a4b95b1e09f4e680899599164019c5e53", null ], + [ "i", "unionnk__property.html#a3723209993fe48d5c0473aebd78ca178", null ] +]; \ No newline at end of file diff --git a/unionnk__style__item__data.html b/unionnk__style__item__data.html new file mode 100644 index 000000000..dcb9c6f45 --- /dev/null +++ b/unionnk__style__item__data.html @@ -0,0 +1,136 @@ + + + + + + + +Nuklear: nk_style_item_data Union Reference + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Nuklear +
+
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
+
+ + + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
nk_style_item_data Union Reference
+
+
+
+Collaboration diagram for nk_style_item_data:
+
+
Collaboration graph
+
[legend]
+ + + + + + + + +

+Data Fields

+struct nk_color color
 
+struct nk_image image
 
+struct nk_nine_slice slice
 
+

Detailed Description

+
+

Definition at line 4884 of file nuklear.h.

+

The documentation for this union was generated from the following file: +
+
+ + + + diff --git a/unionnk__style__item__data.js b/unionnk__style__item__data.js new file mode 100644 index 000000000..87526ac55 --- /dev/null +++ b/unionnk__style__item__data.js @@ -0,0 +1,6 @@ +var unionnk__style__item__data = +[ + [ "color", "unionnk__style__item__data.html#ab7eee146e91f259891435c8c89792938", null ], + [ "image", "unionnk__style__item__data.html#ae0256c98c4e25f3b8ad0596d6dd68407", null ], + [ "slice", "unionnk__style__item__data.html#a59062cc6500d7011ed54d55b737a2085", null ] +]; \ No newline at end of file diff --git a/unionnk__style__item__data__coll__graph.dot b/unionnk__style__item__data__coll__graph.dot new file mode 100644 index 000000000..1ba15ec85 --- /dev/null +++ b/unionnk__style__item__data__coll__graph.dot @@ -0,0 +1,16 @@ +digraph "nk_style_item_data" +{ + // LATEX_PDF_SIZE + edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; + node [fontname="Helvetica",fontsize="10",shape=record]; + Node1 [label="nk_style_item_data",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black",tooltip=" "]; + Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" color" ,fontname="Helvetica"]; + Node2 [label="nk_color",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__color.html",tooltip=" "]; + Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" image" ,fontname="Helvetica"]; + Node3 [label="nk_image",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__image.html",tooltip=" "]; + Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" handle" ,fontname="Helvetica"]; + Node4 [label="nk_handle",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$unionnk__handle.html",tooltip=" "]; + Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" slice" ,fontname="Helvetica"]; + Node5 [label="nk_nine_slice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structnk__nine__slice.html",tooltip=" "]; + Node3 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" img" ,fontname="Helvetica"]; +}