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
+
+ 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.
+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.
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 |
+ 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.
+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:
+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.
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.
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).
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:
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
:
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.
+ 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.
+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.
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.
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.
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:
+ 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.
+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:
In the grand concept groups can be called after starting a window with nk_begin_xxx
and before calling nk_end
:
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 |
+ 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.
+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.
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 |
+ 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.
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(...); ```
+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(...); ```
+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(...); ```
+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(...); ```
+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(...); ```
+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(...); ```
+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 |
+ 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.
+ |
+ + | +
==============================================================
+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.
+
+ 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.
+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.
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 |
Integer property directly modifying a passed in value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling a layouting function | |||
| String used both as a label as well as a unique identifier | |||
| Minimum value not allowed to be underflown | |||
| Integer pointer to be modified | |||
| Maximum value not allowed to be overflown | |||
| Increment added and subtracted on increment and decrement button | |||
| Value per pixel added or subtracted on dragging |
+ 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 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.
+
+ 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.
+ |
+ + | +
===============================================================
+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.
+
+ 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
.
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.
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 |
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 |
+ 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
.
+
+
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.
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.
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
+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 |
State | Description |
---|---|
NK_MINIMIZED | UI section is collapsed and not visible until maximized |
NK_MAXIMIZED | UI section is extended and visible until minimized |
+ 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
+
+ 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
+
+ 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
+
+ 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
+
+ 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 | |
build.py | |
nuklear.h | Main 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 |
+ 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
+
+ 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
+
+ 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
+
+ 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
+
+ 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
+
+ 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
+
+ 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
+
+ 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 page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ 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 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.
+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.:
+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.
+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:
!!! WARNING The following flags if defined need to be defined for both header and implementation:
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:
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:
!!! WARNING The following dependencies if defined need to be defined for both header and implementation:
!!! WARNING The following dependencies if defined need to be defined only for the implementation part:
+ 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.
+ |
+ + | +
main API and documentation file +More...
+Go to the source code of this file.
++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_command * | nk__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_command * | nk__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_window * | nk_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_panel * | nk_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_buffer * | nk_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) |
main API and documentation file
+ +Definition in file nuklear.h.
+#define NK_CONFIG_STACK | +( | ++ | type, | +
+ | + | + | size | +
+ | ) | ++ |
#define NK_CONFIGURATION_STACK_TYPE | +( | ++ | prefix, | +
+ | + | + | name, | +
+ | + | + | type | +
+ | ) | ++ |
#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.
+[in] | ctx | | Must point to an previously initialized nk_context struct at the end of a frame |
[in] | cmd | | Command pointer initialized to NULL |
#define NK_INTERSECT | +( | ++ | x0, | +
+ | + | + | y0, | +
+ | + | + | w0, | +
+ | + | + | h0, | +
+ | + | + | x1, | +
+ | + | + | y1, | +
+ | + | + | w1, | +
+ | + | + | h1 | +
+ | ) | ++ |
#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__) | +
Start a collapsible UI section with image and label header !!!
__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.Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Image to display inside the header on the left of the label | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states |
true(1)
if visible and fillable with widgets or false(0)
otherwise #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) | +
Start a collapsible UI section with image and label header and internal state management callable in a look
+Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Image to display inside the header on the left of the label | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states | |||
| Loop counter index if this function is called in a loop |
true(1)
if visible and fillable with widgets or false(0)
otherwise #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__) | +
Starts a collapsible UI section with internal state management !!!
__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.Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states |
true(1)
if visible and fillable with widgets or false(0)
otherwise #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) | +
Starts a collapsible UI section with internal state management callable in a look
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states | |||
| Loop counter index if this function is called in a loop |
true(1)
if visible and fillable with widgets or false(0)
otherwise enum nk_edit_events | +
enum nk_widget_layout_states | +
enum nk_widget_states | +
enum nk_window_flags | +
NK_API const struct nk_command* nk__begin | +( | +struct nk_context * | +ctx | ) | ++ |
Returns a draw command list iterator to iterate all draw commands accumulated over one frame.
+[in] | ctx | | must point to an previously initialized nk_context struct at the end of a frame |
Definition at line 310 of file nuklear_context.c.
+ +References nk_context::build, and nk_buffer::memory.
+ +NK_API const struct nk_command* nk__next | +( | +struct nk_context * | +ctx, | +
+ | + | const struct nk_command * | +cmd | +
+ | ) | ++ |
Returns draw command pointer pointing to the next command inside the draw command list.
+[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 |
Definition at line 332 of file nuklear_context.c.
+ +References nk_buffer::allocated, and nk_buffer::memory.
+ +NK_API nk_bool nk_begin | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +title, | +
+ | + | struct nk_rect | +bounds, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
+Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Window title and identifier. Needs to be persistent over frames to identify the window | |||
| 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 | |||
| Window flags defined in the nk_panel_flags section with a number of different window behaviors |
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_API nk_bool nk_begin_titled | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | const char * | +title, | +
+ | + | struct nk_rect | +bounds, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
Extended window start with separated title and identifier to allow multiple windows with same title but not name
+Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Window identifier. Needs to be persistent over frames to identify the window | |||
| Window title displayed inside header if flag NK_WINDOW_TITLE or either NK_WINDOW_CLOSABLE or NK_WINDOW_MINIMIZED was set | |||
| 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 | |||
| Window flags defined in the nk_panel_flags section with a number of different window behaviors |
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_API void nk_clear | +( | +struct nk_context * | +ctx | ) | ++ |
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.
+[in] | ctx | Must point to a previously initialized nk_context struct |
Definition at line 110 of file nuklear_context.c.
+ +NK_API void nk_end | +( | +struct nk_context * | +ctx | ) | ++ |
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
+Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
Definition at line 297 of file nuklear_window.c.
+ +NK_API void nk_free | +( | +struct nk_context * | +ctx | ) | ++ |
Frees all memory allocated by nuklear; Not needed if context was initialized with nk_init_fixed
.
[in] | ctx | Must point to a previously initialized nk_context struct |
Definition at line 88 of file nuklear_context.c.
+ +NK_API nk_bool nk_group_begin | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +title, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
Starts a new widget group.
+Requires a previous layouting function to specify a pos/size.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Must be an unique identifier for this group that is also used for the group header | |||
| Window flags defined in the nk_panel_flags section with a number of different group behaviors |
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_API nk_bool nk_group_begin_titled | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | const char * | +title, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
Starts a new widget group.
+Requires a previous layouting function to specify a pos/size.
[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 |
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_API void nk_group_end | +( | +struct nk_context * | +ctx | ) | ++ |
Ends a widget group
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
Definition at line 165 of file nuklear_group.c.
+ +References nk_group_scrolled_end().
+ +NK_API void nk_group_get_scroll | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +id, | +
+ | + | nk_uint * | +x_offset, | +
+ | + | nk_uint * | +y_offset | +
+ | ) | ++ |
Gets the scroll position of the given group.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| The id of the group to get the scroll position of | |||
| A pointer to the x offset output (or NULL to ignore) | |||
| A pointer to the y offset output (or NULL to ignore) |
Definition at line 170 of file nuklear_group.c.
+ +NK_API nk_bool nk_group_scrolled_begin | +( | +struct nk_context * | +ctx, | +
+ | + | struct nk_scroll * | +off, | +
+ | + | const char * | +title, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
Starts a new widget group. requires a previous layouting function to specify a size. Does not keep track of scrollbar.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Both x- and y- scroll offset. Allows for manual scrollbar control | |||
| Window unique group title used to both identify and display in the group header | |||
| Window flags from nk_panel_flags section |
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_API void nk_group_scrolled_end | +( | +struct nk_context * | +ctx | ) | ++ |
Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
Definition at line 59 of file nuklear_group.c.
+ +Referenced by nk_group_end().
+ +NK_API nk_bool nk_group_scrolled_offset_begin | +( | +struct nk_context * | +ctx, | +
+ | + | nk_uint * | +x_offset, | +
+ | + | nk_uint * | +y_offset, | +
+ | + | const char * | +title, | +
+ | + | nk_flags | +flags | +
+ | ) | ++ |
starts a new widget group. requires a previous layouting function to specify a size. Does not keep track of scrollbar.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Scrollbar x-offset to offset all widgets inside the group horizontally. | |||
| Scrollbar y-offset to offset all widgets inside the group vertically | |||
| Window unique group title used to both identify and display in the group header | |||
| Window flags from the nk_panel_flags section |
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_API void nk_group_set_scroll | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +id, | +
+ | + | nk_uint | +x_offset, | +
+ | + | nk_uint | +y_offset | +
+ | ) | ++ |
Sets the scroll position of the given group.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| The id of the group to scroll | |||
| The x offset to scroll to | |||
| The y offset to scroll to |
Definition at line 205 of file nuklear_group.c.
+ +NK_API nk_bool nk_init | +( | +struct nk_context * | +ctx, | +
+ | + | const struct nk_allocator * | +alloc, | +
+ | + | const struct nk_user_font * | +font | +
+ | ) | ++ |
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.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an either stack or heap allocated nk_context struct | |||
| Must point to a previously allocated memory allocator | |||
| Must point to a previously initialized font handle for more info look at font documentation |
false(0)
on failure or true(1)
on success. Definition at line 66 of file nuklear_context.c.
+ +NK_API nk_bool nk_init_custom | +( | +struct nk_context * | +ctx, | +
+ | + | struct nk_buffer * | +cmds, | +
+ | + | struct nk_buffer * | +pool, | +
+ | + | const struct nk_user_font * | +font | +
+ | ) | ++ |
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.
+[in] | ctx | Must point to an either stack or heap allocated nk_context struct |
[in] | cmds | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into |
[in] | pool | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables |
[in] | font | Must point to a previously initialized font handle for more info look at font documentation |
false(0)
on failure or true(1)
on success. Definition at line 45 of file nuklear_context.c.
+ +References nk_buffer::type.
+ +NK_API nk_bool nk_init_fixed | +( | +struct nk_context * | +ctx, | +
+ | + | void * | +memory, | +
+ | + | nk_size | +size, | +
+ | + | const struct nk_user_font * | +font | +
+ | ) | ++ |
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.
!!! Warning make sure the passed memory block is aligned correctly for nk_draw_commands
.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an either stack or heap allocated nk_context struct | |||
| Must point to a previously allocated memory block | |||
| Must contain the total size of memory | |||
| Must point to a previously initialized font handle for more info look at font documentation |
false(0)
on failure or true(1)
on success. Definition at line 34 of file nuklear_context.c.
+ +NK_API void nk_input_begin | +( | +struct nk_context * | +ctx | ) | ++ |
Begins the input mirroring process by resetting text, scroll mouse, previous mouse position and movement as well as key state transitions.
+[in] | ctx | Must point to a previously initialized nk_context struct |
Definition at line 10 of file nuklear_input.c.
+ +NK_API void nk_input_button | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_buttons, | +
+ | + | int | +x, | +
+ | + | int | +y, | +
+ | + | nk_bool | +down | +
+ | ) | ++ |
Mirrors the state of a specific mouse button to nuklear.
+[in] | ctx | Must point to a previously initialized nk_context struct |
[in] | btn | Must be any value specified in enum nk_buttons that needs to be mirrored |
[in] | x | Must contain an integer describing mouse cursor x-position on click up/down |
[in] | y | Must contain an integer describing mouse cursor y-position on click up/down |
[in] | down | Must be 0 for key is up and 1 for key is down |
Definition at line 72 of file nuklear_input.c.
+ +NK_API void nk_input_char | +( | +struct nk_context * | +ctx, | +
+ | + | 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.
+nk_input_begin
and nk_input_end
.[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_API void nk_input_end | +( | +struct nk_context * | +ctx | ) | ++ |
End the input mirroring process by resetting mouse grabbing state to ensure the mouse cursor is not grabbed indefinitely.
+[in] | ctx | | Must point to a previously initialized nk_context struct |
Definition at line 30 of file nuklear_input.c.
+ +NK_API void nk_input_glyph | +( | +struct nk_context * | +ctx, | +
+ | + | const | +nk_glyph | +
+ | ) | ++ |
Converts an encoded unicode rune into UTF-8 and copies the result into an internal text buffer.
+nk_input_begin
and nk_input_end
.[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_API void nk_input_key | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_keys, | +
+ | + | nk_bool | +down | +
+ | ) | ++ |
Mirrors the state of a specific key to nuklear.
+[in] | ctx | Must point to a previously initialized nk_context struct |
[in] | key | Must be any value specified in enum nk_keys that needs to be mirrored |
[in] | down | Must be 0 for key is up and 1 for key is down |
Definition at line 57 of file nuklear_input.c.
+ +NK_API void nk_input_motion | +( | +struct nk_context * | +ctx, | +
+ | + | int | +x, | +
+ | + | int | +y | +
+ | ) | ++ |
Mirrors current mouse position to nuklear.
+[in] | ctx | Must point to a previously initialized nk_context struct |
[in] | x | Must hold an integer describing the current mouse cursor x-position |
[in] | y | Must hold an integer describing the current mouse cursor y-position |
Definition at line 45 of file nuklear_input.c.
+ +NK_API void nk_input_scroll | +( | +struct nk_context * | +ctx, | +
+ | + | 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.
+[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_API void nk_input_unicode | +( | +struct nk_context * | +ctx, | +
+ | + | nk_rune | +unicode | +
+ | ) | ++ |
Converts a unicode rune into UTF-8 and copies the result into an internal text buffer.
+nk_input_begin
and nk_input_end
.[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_API nk_bool nk_item_is_any_active | +( | +const struct nk_context * | +ctx | ) | ++ |
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API float nk_layout_ratio_from_pixel | +( | +const struct nk_context * | +ctx, | +
+ | + | float | +pixel_width | +
+ | ) | ++ |
Utility functions to calculate window ratio from pixel size.
+[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 |
nk_rect
with both position and size of the next row Definition at line 137 of file nuklear_layout.c.
+ +NK_API void nk_layout_reset_min_row_height | +( | +struct nk_context * | +ctx | ) | ++ |
Reset the currently used minimum row height back to font_height + text_padding + padding
[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_API void nk_layout_row | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_layout_format, | +
+ | + | float | +height, | +
+ | + | int | +cols, | +
+ | + | const float * | +ratio | +
+ | ) | ++ |
Specifies row columns in array as either window ratio or size.
+[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_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.
+[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_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.
+Once called all subsequent widget calls greater than @cols will allocate a new row with same layout.
+[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_API void nk_layout_row_end | +( | +struct nk_context * | +ctx | ) | ++ |
Finished previously started row.
+[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_API void nk_layout_row_push | +( | +struct nk_context * | +ctx, | +
+ | + | float | +value | +
+ | ) | ++ |
\breif Specifies either window ratio or width of a single column
+[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_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.
+Once called all subsequent widget calls greater than @cols will allocate a new row with same layout.
+[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_API void nk_layout_row_template_begin | +( | +struct nk_context * | +ctx, | +
+ | + | float | +row_height | +
+ | ) | ++ |
Begins the row template declaration
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx | |||
| Holds height of each widget in row or zero for auto layouting |
Definition at line 268 of file nuklear_layout.c.
+ +NK_API void nk_layout_row_template_end | +( | +struct nk_context * | +ctx | ) | ++ |
Marks the end of the row template
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx |
Definition at line 355 of file nuklear_layout.c.
+ +NK_API void nk_layout_row_template_push_dynamic | +( | +struct nk_context * | +ctx | ) | ++ |
Adds a dynamic column that dynamically grows and can go to zero if not enough space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx | |||
| Holds height of each widget in row or zero for auto layouting |
Definition at line 295 of file nuklear_layout.c.
+ +NK_API void nk_layout_row_template_push_static | +( | +struct nk_context * | +ctx, | +
+ | + | float | +width | +
+ | ) | ++ |
Adds a static column that does not grow and will always have the same size
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx | |||
| Holds the absolute pixel width value the next column must be |
Definition at line 335 of file nuklear_layout.c.
+ +NK_API void nk_layout_row_template_push_variable | +( | +struct nk_context * | +ctx, | +
+ | + | float | +min_width | +
+ | ) | ++ |
Adds a variable column that dynamically grows but does not shrink below specified pixel width
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx | |||
| Holds the minimum pixel width the next column must always be |
Definition at line 315 of file nuklear_layout.c.
+ +NK_API void nk_layout_set_min_row_height | +( | +struct nk_context * | +ctx, | +
+ | + | float | +height | +
+ | ) | ++ |
Sets the currently used minimum row height.
+!!!
[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_API void nk_layout_space_begin | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_layout_format, | +
+ | + | float | +height, | +
+ | + | int | +widget_count | +
+ | ) | ++ |
Begins a new layouting space that allows to specify each widgets position and size.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_begin_xxx | |||
| Either NK_DYNAMIC for window ratio or NK_STATIC for fixed size columns | |||
| Holds height of each widget in row or zero for auto layouting | |||
| Number of widgets inside row |
Definition at line 406 of file nuklear_layout.c.
+ +NK_API struct nk_rect nk_layout_space_bounds | +( | +const struct nk_context * | +ctx | ) | ++ |
Utility function to calculate total space allocated for nk_layout_space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin |
nk_rect
holding the total space allocated Definition at line 465 of file nuklear_layout.c.
+ +NK_API void nk_layout_space_end | +( | +struct nk_context * | +ctx | ) | ++ |
Marks the end of the layout space
Parameter | Description | |||
---|---|---|---|---|
| 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_API void nk_layout_space_push | +( | +struct nk_context * | +ctx, | +
+ | + | struct nk_rect | +bounds | +
+ | ) | ++ |
Pushes position and size of the next widget in own coordinate space either as pixel or ratio
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin | |||
| Position and size in laoyut space local coordinates |
Definition at line 450 of file nuklear_layout.c.
+ +NK_API struct nk_rect nk_layout_space_rect_to_local | +( | +const struct nk_context * | +ctx, | +
+ | + | struct nk_rect | +bounds | +
+ | ) | ++ |
Converts rectangle from layout space into screen space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin | |||
| Rectangle to convert from layout space into screen space |
nk_rect
in layout space coordinates Definition at line 551 of file nuklear_layout.c.
+ +NK_API struct nk_rect nk_layout_space_rect_to_screen | +( | +const struct nk_context * | +ctx, | +
+ | + | struct nk_rect | +bounds | +
+ | ) | ++ |
Converts rectangle from screen space into layout space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin | |||
| Rectangle to convert from layout space into screen space |
nk_rect
in screen space coordinates Definition at line 535 of file nuklear_layout.c.
+ +NK_API struct nk_vec2 nk_layout_space_to_local | +( | +const struct nk_context * | +ctx, | +
+ | + | struct nk_vec2 | +vec | +
+ | ) | ++ |
Converts vector from layout space into screen space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin | |||
| Position to convert from screen space into layout coordinate space |
nk_vec2
in layout space coordinates Definition at line 519 of file nuklear_layout.c.
+ +NK_API struct nk_vec2 nk_layout_space_to_screen | +( | +const struct nk_context * | +ctx, | +
+ | + | struct nk_vec2 | +vec | +
+ | ) | ++ |
Converts vector from nk_layout_space coordinate space into screen space
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after call nk_layout_space_begin | |||
| Position to convert from layout space into screen coordinate space |
nk_vec2
in screen space coordinates Definition at line 503 of file nuklear_layout.c.
+ +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.
+[in] | ctx | | Must point to an previously initialized nk_context struct after call nk_begin_xxx |
nk_rect
with both position and size of the next row Definition at line 484 of file nuklear_layout.c.
+ +NK_API void nk_property_double | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | double | +min, | +
+ | + | double * | +val, | +
+ | + | double | +max, | +
+ | + | double | +step, | +
+ | + | float | +inc_per_pixel | +
+ | ) | ++ |
Double property directly modifying a passed in value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling a layouting function | |||
| String used both as a label as well as a unique identifier | |||
| Minimum value not allowed to be underflown | |||
| Double pointer to be modified | |||
| Maximum value not allowed to be overflown | |||
| Increment added and subtracted on increment and decrement button | |||
| Value per pixel added or subtracted on dragging |
Definition at line 454 of file nuklear_property.c.
+ +NK_API void nk_property_float | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | float | +min, | +
+ | + | float * | +val, | +
+ | + | float | +max, | +
+ | + | float | +step, | +
+ | + | float | +inc_per_pixel | +
+ | ) | ++ |
Float property directly modifying a passed in value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling a layouting function | |||
| String used both as a label as well as a unique identifier | |||
| Minimum value not allowed to be underflown | |||
| Float pointer to be modified | |||
| Maximum value not allowed to be overflown | |||
| Increment added and subtracted on increment and decrement button | |||
| Value per pixel added or subtracted on dragging |
Definition at line 440 of file nuklear_property.c.
+ +NK_API double nk_propertyd | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | double | +min, | +
+ | + | double | +val, | +
+ | + | double | +max, | +
+ | + | double | +step, | +
+ | + | float | +inc_per_pixel | +
+ | ) | ++ |
Float property modifying a passed in value and returning the new value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.[in] | ctx | Must point to an previously initialized nk_context struct after calling a layouting function |
[in] | name | String used both as a label as well as a unique identifier |
[in] | min | Minimum value not allowed to be underflown |
[in] | val | Current double value to be modified and returned |
[in] | max | Maximum value not allowed to be overflown |
[in] | step | Increment added and subtracted on increment and decrement button |
[in] | inc_per_pixel | Value per pixel added or subtracted on dragging |
Definition at line 496 of file nuklear_property.c.
+ +NK_API float nk_propertyf | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | float | +min, | +
+ | + | float | +val, | +
+ | + | float | +max, | +
+ | + | float | +step, | +
+ | + | float | +inc_per_pixel | +
+ | ) | ++ |
Float property modifying a passed in value and returning the new value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.[in] | ctx | Must point to an previously initialized nk_context struct after calling a layouting function |
[in] | name | String used both as a label as well as a unique identifier |
[in] | min | Minimum value not allowed to be underflown |
[in] | val | Current float value to be modified and returned |
[in] | max | Maximum value not allowed to be overflown |
[in] | step | Increment added and subtracted on increment and decrement button |
[in] | inc_per_pixel | Value per pixel added or subtracted on dragging |
Definition at line 482 of file nuklear_property.c.
+ +NK_API int nk_propertyi | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | int | +min, | +
+ | + | int | +val, | +
+ | + | int | +max, | +
+ | + | int | +step, | +
+ | + | float | +inc_per_pixel | +
+ | ) | ++ |
Integer property modifying a passed in value and returning the new value !!!
#
at the beginning. It will not be shown but guarantees correct behavior.[in] | ctx | Must point to an previously initialized nk_context struct after calling a layouting function |
[in] | name | String used both as a label as well as a unique identifier |
[in] | min | Minimum value not allowed to be underflown |
[in] | val | Current integer value to be modified and returned |
[in] | max | Maximum value not allowed to be overflown |
[in] | step | Increment added and subtracted on increment and decrement button |
[in] | inc_per_pixel | Value per pixel added or subtracted on dragging |
Definition at line 468 of file nuklear_property.c.
+ +NK_API void nk_rule_horizontal | +( | +struct nk_context * | +ctx, | +
+ | + | struct nk_color | +color, | +
+ | + | nk_bool | +rounding | +
+ | ) | ++ |
Line for visual separation. Draws a line with thickness determined by the current row height.
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Color of the horizontal line | |||
| Whether or not to make the line round |
Definition at line 673 of file nuklear_window.c.
+ +NK_API void nk_spacer | +( | +struct nk_context * | +ctx | ) | ++ |
Spacer is a dummy widget that consumes space as usual but doesn't draw anything
Parameter | Description | |||
---|---|---|---|---|
| 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_API nk_bool nk_tree_image_push_hashed | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_tree_type, | +
+ | + | struct nk_image | +img, | +
+ | + | const char * | +title, | +
+ | + | enum nk_collapse_states | +initial_state, | +
+ | + | const char * | +hash, | +
+ | + | int | +len, | +
+ | + | int | +seed | +
+ | ) | ++ |
Start a collapsible UI section with internal state management with full control over internal unique ID used to store state
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Image to display inside the header on the left of the label | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states | |||
| Memory block or string to generate the ID from | |||
| Size of passed memory block or string in hash | |||
| Seeding value if this function is called in a loop or default to 0 |
true(1)
if visible and fillable with widgets or false(0)
otherwise Definition at line 183 of file nuklear_tree.c.
+ +NK_API void nk_tree_pop | +( | +struct nk_context * | +ctx | ) | ++ |
Ends a collapsabale UI section
Parameter | Description | |||
---|---|---|---|---|
| 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_API nk_bool nk_tree_push_hashed | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_tree_type, | +
+ | + | const char * | +title, | +
+ | + | enum nk_collapse_states | +initial_state, | +
+ | + | const char * | +hash, | +
+ | + | int | +len, | +
+ | + | int | +seed | +
+ | ) | ++ |
Start a collapsible UI section with internal state management with full control over internal unique ID used to store state
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Label printed in the tree header | |||
| Initial tree state value out of nk_collapse_states | |||
| Memory block or string to generate the ID from | |||
| Size of passed memory block or string in hash | |||
| Seeding value if this function is called in a loop or default to 0 |
true(1)
if visible and fillable with widgets or false(0)
otherwise Definition at line 176 of file nuklear_tree.c.
+ +NK_API nk_bool nk_tree_state_image_push | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_tree_type, | +
+ | + | struct nk_image | +img, | +
+ | + | const char * | +title, | +
+ | + | enum nk_collapse_states * | +state | +
+ | ) | ++ |
Start a collapsible UI section with image and label header and external state management
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx | |||
| Image to display inside the header on the left of the label | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Label printed in the tree header | |||
| Persistent state to update |
true(1)
if visible and fillable with widgets or false(0)
otherwise Definition at line 151 of file nuklear_tree.c.
+ +NK_API void nk_tree_state_pop | +( | +struct nk_context * | +ctx | ) | ++ |
Ends a collapsabale UI section
Parameter | Description | |||
---|---|---|---|---|
| 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_API nk_bool nk_tree_state_push | +( | +struct nk_context * | +ctx, | +
+ | + | enum | +nk_tree_type, | +
+ | + | const char * | +title, | +
+ | + | enum nk_collapse_states * | +state | +
+ | ) | ++ |
Start a collapsible UI section with external state management
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct after calling nk_tree_xxx_push_xxx | |||
| Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node | |||
| Label printed in the tree header | |||
| Persistent state to update |
true(1)
if visible and fillable with widgets or false(0)
otherwise Definition at line 145 of file nuklear_tree.c.
+ +NK_API void nk_window_close | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Closes a window and marks it for being freed at the end of the frame
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| 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_API void nk_window_collapse | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | enum nk_collapse_states | +state | +
+ | ) | ++ |
Updates collapse state of a window with given name
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to close | |||
| value out of nk_collapse_states section |
Definition at line 603 of file nuklear_window.c.
+ +Referenced by nk_window_collapse_if().
+ +NK_API void nk_window_collapse_if | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | enum nk_collapse_states | +state, | +
+ | + | int | +cond | +
+ | ) | ++ |
Updates collapse state of a window with given name if given condition is met
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to either collapse or maximize | |||
| value out of nk_collapse_states section the window should be put into | |||
| 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_API struct nk_window* nk_window_find | +( | +const struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Finds and returns a window from passed name
+Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Window identifier |
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_API struct nk_rect nk_window_get_bounds | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
nk_rect
struct with window upper left window position and size Definition at line 314 of file nuklear_window.c.
+ +NK_API struct nk_command_buffer* nk_window_get_canvas | +( | +const struct nk_context * | +ctx | ) | ++ |
nk_begin_xxx
and nk_end
!!! nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API struct nk_rect nk_window_get_content_region | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API struct nk_vec2 nk_window_get_content_region_max | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API struct nk_vec2 nk_window_get_content_region_min | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| 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_API struct nk_vec2 nk_window_get_content_region_size | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
nk_vec2
struct with size the visible space inside the current window Definition at line 381 of file nuklear_window.c.
+ +NK_API float nk_window_get_height | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
Definition at line 347 of file nuklear_window.c.
+ +NK_API struct nk_panel* nk_window_get_panel | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
!!! nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
nk_panel
state. Definition at line 400 of file nuklear_window.c.
+ +NK_API struct nk_vec2 nk_window_get_position | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
nk_vec2
struct with window upper left position Definition at line 322 of file nuklear_window.c.
+ +NK_API void nk_window_get_scroll | +( | +const struct nk_context * | +ctx, | +
+ | + | nk_uint * | +offset_x, | +
+ | + | nk_uint * | +offset_y | +
+ | ) | ++ |
Gets the scroll offset for the current window !!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| A pointer to the x offset output (or NULL to ignore) | |||
| A pointer to the y offset output (or NULL to ignore) |
Definition at line 408 of file nuklear_window.c.
+ +NK_API struct nk_vec2 nk_window_get_size | +( | +const struct nk_context * | +ctx | ) | ++ |
!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
nk_vec2
struct with window width and height Definition at line 330 of file nuklear_window.c.
+ +NK_API float nk_window_get_width | +( | +const struct nk_context * | +ctx | ) | ++ |
nk_window_get_width
+!!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
Definition at line 339 of file nuklear_window.c.
+ +NK_API nk_bool nk_window_has_focus | +( | +const struct nk_context * | +ctx | ) | ++ |
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
false(0)
if current window is not active or true(1)
if it is Definition at line 422 of file nuklear_window.c.
+ +NK_API nk_bool nk_window_is_active | +( | +const struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Same as nk_window_has_focus for some reason
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of window you want to check if it is active |
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_API nk_bool nk_window_is_any_hovered | +( | +const struct nk_context * | +ctx | ) | ++ |
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API nk_bool nk_window_is_closed | +( | +const struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
nk_close
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of window you want to check if it is closed |
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_API nk_bool nk_window_is_collapsed | +( | +const struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of window you want to check if it is collapsed |
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_API nk_bool nk_window_is_hidden | +( | +const struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of window you want to check if it is hidden |
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_API nk_bool nk_window_is_hovered | +( | +const struct nk_context * | +ctx | ) | ++ |
Return if the current window is being hovered !!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct |
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_API void nk_window_set_bounds | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | struct nk_rect | +bounds | +
+ | ) | ++ |
Updates position and size of window with passed in name
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to modify both position and size | |||
| 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_API void nk_window_set_focus | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name | +
+ | ) | ++ |
Sets the window with given name as active
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to set focus on |
Definition at line 655 of file nuklear_window.c.
+ +NK_API void nk_window_set_position | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | struct nk_vec2 | +pos | +
+ | ) | ++ |
Updates position of window with passed name
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to modify both position | |||
| 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_API void nk_window_set_scroll | +( | +struct nk_context * | +ctx, | +
+ | + | nk_uint | +offset_x, | +
+ | + | nk_uint | +offset_y | +
+ | ) | ++ |
Sets the scroll offset for the current window !!!
nk_begin_xxx
and nk_end
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| The x offset to scroll to | |||
| The y offset to scroll to |
Definition at line 591 of file nuklear_window.c.
+ +NK_API void nk_window_set_size | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | struct nk_vec2 | +size | +
+ | ) | ++ |
Updates size of window with passed in name
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to modify both window 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_API void nk_window_show | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | enum nk_show_states | +state | +
+ | ) | ++ |
updates visibility state of a window with given name
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to either collapse or maximize | |||
| 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_API void nk_window_show_if | +( | +struct nk_context * | +ctx, | +
+ | + | const char * | +name, | +
+ | + | enum nk_show_states | +state, | +
+ | + | int | +cond | +
+ | ) | ++ |
Updates visibility state of a window with given name if a given condition is met
Parameter | Description | |||
---|---|---|---|---|
| Must point to an previously initialized nk_context struct | |||
| Identifier of the window to either hide or show | |||
| state with either visible or hidden to modify the window with | |||
| 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().
+ +