浏览代码

add conditional style configurator to all demos

Richard Gill 10 月之前
父节点
当前提交
b5477a4c84

+ 13 - 0
demo/allegro5/main.c

@@ -42,6 +42,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -49,6 +50,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -64,6 +66,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -81,6 +86,11 @@ int main(void)
     NkAllegro5Font *font;
     NkAllegro5Font *font;
     struct nk_context *ctx;
     struct nk_context *ctx;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     if (!al_init()) {
     if (!al_init()) {
         fprintf(stdout, "failed to initialize allegro5!\n");
         fprintf(stdout, "failed to initialize allegro5!\n");
         exit(1);
         exit(1);
@@ -168,6 +178,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/d3d11/main.c

@@ -38,6 +38,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -45,6 +46,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -60,6 +62,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -149,6 +154,11 @@ int main(void)
     D3D_FEATURE_LEVEL feature_level;
     D3D_FEATURE_LEVEL feature_level;
     DXGI_SWAP_CHAIN_DESC swap_chain_desc;
     DXGI_SWAP_CHAIN_DESC swap_chain_desc;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* Win32 */
     /* Win32 */
     memset(&wc, 0, sizeof(wc));
     memset(&wc, 0, sizeof(wc));
     wc.style = CS_DBLCLKS;
     wc.style = CS_DBLCLKS;
@@ -267,6 +277,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/d3d12/main.c

@@ -41,6 +41,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -48,6 +49,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -63,6 +65,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -207,6 +212,11 @@ int main(void)
     DXGI_SWAP_CHAIN_DESC1 swap_chain_desc;
     DXGI_SWAP_CHAIN_DESC1 swap_chain_desc;
     D3D12_DESCRIPTOR_HEAP_DESC rtv_desc_heap_desc;
     D3D12_DESCRIPTOR_HEAP_DESC rtv_desc_heap_desc;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* Win32 */
     /* Win32 */
     memset(&wc, 0, sizeof(wc));
     memset(&wc, 0, sizeof(wc));
     wc.style = CS_DBLCLKS;
     wc.style = CS_DBLCLKS;
@@ -359,6 +369,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/d3d9/main.c

@@ -35,6 +35,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -42,6 +43,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -57,6 +59,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -179,6 +184,11 @@ int main(void)
     HWND wnd;
     HWND wnd;
     int running = 1;
     int running = 1;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* Win32 */
     /* Win32 */
     memset(&wc, 0, sizeof(wc));
     memset(&wc, 0, sizeof(wc));
     wc.style = CS_DBLCLKS;
     wc.style = CS_DBLCLKS;
@@ -272,6 +282,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/gdi/main.c

@@ -30,6 +30,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -37,6 +38,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -52,6 +54,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -92,6 +97,11 @@ int main(void)
     int running = 1;
     int running = 1;
     int needs_refresh = 1;
     int needs_refresh = 1;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* Win32 */
     /* Win32 */
     memset(&wc, 0, sizeof(wc));
     memset(&wc, 0, sizeof(wc));
     wc.style = CS_DBLCLKS;
     wc.style = CS_DBLCLKS;
@@ -167,6 +177,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/gdip/main.c

@@ -30,6 +30,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -37,6 +38,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -52,6 +54,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -87,6 +92,11 @@ int main(void)
     int running = 1;
     int running = 1;
     int needs_refresh = 1;
     int needs_refresh = 1;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* Win32 */
     /* Win32 */
     memset(&wc, 0, sizeof(wc));
     memset(&wc, 0, sizeof(wc));
     wc.style = CS_DBLCLKS;
     wc.style = CS_DBLCLKS;
@@ -162,6 +172,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/glfw_opengl2/main.c

@@ -43,6 +43,7 @@
 /* #define INCLUDE_CANVAS       */
 /* #define INCLUDE_CANVAS       */
 /* #define INCLUDE_FILE_BROWSER */
 /* #define INCLUDE_FILE_BROWSER */
 /* #define INCLUDE_OVERVIEW     */
 /* #define INCLUDE_OVERVIEW     */
+/* #define INCLUDE_CONFIGURATOR */
 /* #define INCLUDE_NODE_EDITOR  */
 /* #define INCLUDE_NODE_EDITOR  */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -51,6 +52,7 @@
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_FILE_BROWSER
   #define INCLUDE_FILE_BROWSER
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -69,6 +71,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -95,6 +100,11 @@ int main(void)
     struct media media;
     struct media media;
 #endif
 #endif
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* GLFW */
     /* GLFW */
     glfwSetErrorCallback(error_callback);
     glfwSetErrorCallback(error_callback);
     if (!glfwInit()) {
     if (!glfwInit()) {
@@ -195,6 +205,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/glfw_opengl3/main.c

@@ -43,6 +43,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -50,6 +51,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -65,6 +67,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -86,6 +91,11 @@ int main(void)
     struct nk_context *ctx;
     struct nk_context *ctx;
     struct nk_colorf bg;
     struct nk_colorf bg;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* GLFW */
     /* GLFW */
     glfwSetErrorCallback(error_callback);
     glfwSetErrorCallback(error_callback);
     if (!glfwInit()) {
     if (!glfwInit()) {
@@ -177,6 +187,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/glfw_opengl4/main.c

@@ -43,6 +43,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -50,6 +51,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -65,6 +67,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -86,6 +91,11 @@ int main(void)
     struct nk_colorf bg;
     struct nk_colorf bg;
     struct nk_image img;
     struct nk_image img;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* GLFW */
     /* GLFW */
     glfwSetErrorCallback(error_callback);
     glfwSetErrorCallback(error_callback);
     if (!glfwInit()) {
     if (!glfwInit()) {
@@ -198,6 +208,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/glfw_vulkan/main.c

@@ -40,6 +40,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_OVERVIEW*/
 /*#define INCLUDE_OVERVIEW*/
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -47,6 +48,7 @@
 #define INCLUDE_CALCULATOR
 #define INCLUDE_CALCULATOR
 #define INCLUDE_CANVAS
 #define INCLUDE_CANVAS
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
 #define INCLUDE_NODE_EDITOR
 #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -62,6 +64,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
 #include "../../demo/common/overview.c"
 #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+#include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
 #include "../../demo/common/node_editor.c"
 #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -2089,6 +2094,11 @@ int main(void) {
     VkResult result;
     VkResult result;
     VkSemaphore nk_semaphore;
     VkSemaphore nk_semaphore;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     glfwSetErrorCallback(glfw_error_callback);
     glfwSetErrorCallback(glfw_error_callback);
     if (!glfwInit()) {
     if (!glfwInit()) {
         fprintf(stderr, "[GFLW] failed to init!\n");
         fprintf(stderr, "[GFLW] failed to init!\n");
@@ -2195,6 +2205,9 @@ int main(void) {
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
         overview(ctx);
         overview(ctx);
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+        style_configurator(ctx, color_table);
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
         node_editor(ctx);
         node_editor(ctx);
 #endif
 #endif

+ 1 - 1
demo/rawfb/sdl/Makefile

@@ -1,4 +1,4 @@
-CFLAGS=`sdl2-config --cflags --libs`   -std=c89 -Wall -Wextra -pedantic -Wno-unused-function -O0 -g -fvisibility=hidden `pkg-config SDL2_ttf --cflags --libs`
+CFLAGS+=`sdl2-config --cflags --libs`   -std=c89 -Wall -Wextra -pedantic -Wno-unused-function -O0 -g -fvisibility=hidden `pkg-config SDL2_ttf --cflags --libs`
 
 
 .PHONY: clean
 .PHONY: clean
 
 

二进制
demo/rawfb/sdl/demo


+ 13 - 0
demo/rawfb/sdl/main.c

@@ -34,6 +34,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -41,6 +42,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -56,6 +58,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../common/overview.c"
   #include "../../common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../common/node_editor.c"
   #include "../../common/node_editor.c"
 #endif
 #endif
@@ -141,6 +146,11 @@ int main(int argc, char **argv)
     SDL_Texture *tex;
     SDL_Texture *tex;
     SDL_Surface *surface;
     SDL_Surface *surface;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     NK_UNUSED(argc);
     NK_UNUSED(argc);
     NK_UNUSED(argv);
     NK_UNUSED(argv);
 
 
@@ -246,6 +256,9 @@ int main(int argc, char **argv)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(&(context->ctx));
           overview(&(context->ctx));
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(&(context->ctx), color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(&(context->ctx));
           node_editor(&(context->ctx));
         #endif
         #endif

+ 1 - 1
demo/rawfb/wayland/Makefile

@@ -2,7 +2,7 @@ WAYLAND=`pkg-config wayland-client --cflags --libs`
 WAYLAND_SCANNER=wayland-scanner
 WAYLAND_SCANNER=wayland-scanner
 WAYLAND_PROTOCOLS_DIR=/usr/share/wayland-protocols
 WAYLAND_PROTOCOLS_DIR=/usr/share/wayland-protocols
 
 
-CFLAGS?=-std=c99 -Wall -Wextra -pedantic -Wno-unused-function -O3 -fvisibility=hidden
+CFLAGS+=-std=c99 -Wall -Wextra -pedantic -Wno-unused-function -O3 -fvisibility=hidden
 
 
 .PHONY: clean
 .PHONY: clean
 
 

+ 13 - 0
demo/rawfb/wayland/main.c

@@ -63,6 +63,7 @@ struct nk_wayland {
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -70,6 +71,7 @@ struct nk_wayland {
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -85,6 +87,9 @@ struct nk_wayland {
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../common/overview.c"
   #include "../../common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../common/node_editor.c"
   #include "../../common/node_editor.c"
 #endif
 #endif
@@ -452,6 +457,11 @@ int main ()
     int running = 1;
     int running = 1;
     struct rawfb_pl pl;
     struct rawfb_pl pl;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     //1. Initialize display
     //1. Initialize display
 	nk_wayland_ctx.display = wl_display_connect (NULL);
 	nk_wayland_ctx.display = wl_display_connect (NULL);
     if (nk_wayland_ctx.display == NULL) {
     if (nk_wayland_ctx.display == NULL) {
@@ -545,6 +555,9 @@ int main ()
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(&(nk_wayland_ctx.rawfb->ctx));
           overview(&(nk_wayland_ctx.rawfb->ctx));
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(&(nk_wayland_ctx.rawfb->ctx), color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(&(nk_wayland_ctx.rawfb->ctx));
           node_editor(&(nk_wayland_ctx.rawfb->ctx));
         #endif
         #endif

二进制
demo/rawfb/x11/bin/demo


+ 13 - 0
demo/rawfb/x11/main.c

@@ -115,6 +115,7 @@ sleep_for(long t)
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -122,6 +123,7 @@ sleep_for(long t)
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -137,6 +139,9 @@ sleep_for(long t)
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../common/overview.c"
   #include "../../common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../common/node_editor.c"
   #include "../../common/node_editor.c"
 #endif
 #endif
@@ -159,6 +164,11 @@ main(void)
     struct rawfb_pl pl;
     struct rawfb_pl pl;
     unsigned char tex_scratch[512 * 512];
     unsigned char tex_scratch[512 * 512];
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* X11 */
     /* X11 */
     memset(&xw, 0, sizeof xw);
     memset(&xw, 0, sizeof xw);
     xw.dpy = XOpenDisplay(NULL);
     xw.dpy = XOpenDisplay(NULL);
@@ -234,6 +244,9 @@ main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(&rawfb->ctx);
           overview(&rawfb->ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(&rawfb->ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(&rawfb->ctx);
           node_editor(&rawfb->ctx);
         #endif
         #endif

+ 14 - 1
demo/sdl_opengl2/main.c

@@ -34,11 +34,12 @@
  * ===============================================================*/
  * ===============================================================*/
 /* This are some code examples to provide a small overview of what can be
 /* This are some code examples to provide a small overview of what can be
  * done with this library. To try out an example uncomment the defines */
  * done with this library. To try out an example uncomment the defines */
-#define INCLUDE_ALL 
+/*#define INCLUDE_ALL */
 /*#define INCLUDE_STYLE */
 /*#define INCLUDE_STYLE */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -46,6 +47,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -61,6 +63,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -83,6 +88,11 @@ main(int argc, char *argv[])
     struct nk_context *ctx;
     struct nk_context *ctx;
     struct nk_colorf bg;
     struct nk_colorf bg;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     NK_UNUSED(argc);
     NK_UNUSED(argc);
     NK_UNUSED(argv);
     NK_UNUSED(argv);
 
 
@@ -173,6 +183,9 @@ main(int argc, char *argv[])
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 1 - 1
demo/sdl_opengl3/main.c

@@ -43,7 +43,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
-#define INCLUDE_CONFIGURATOR
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL

+ 13 - 1
demo/sdl_opengles2/main.c

@@ -44,6 +44,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -51,6 +52,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -66,6 +68,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -83,10 +88,14 @@ int running = nk_true;
 
 
 static void
 static void
 MainLoop(void* loopArg){
 MainLoop(void* loopArg){
+    SDL_Event evt;
     struct nk_context *ctx = (struct nk_context *)loopArg;
     struct nk_context *ctx = (struct nk_context *)loopArg;
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
 
 
     /* Input */
     /* Input */
-    SDL_Event evt;
     nk_input_begin(ctx);
     nk_input_begin(ctx);
     while (SDL_PollEvent(&evt)) {
     while (SDL_PollEvent(&evt)) {
         if (evt.type == SDL_QUIT) running = nk_false;
         if (evt.type == SDL_QUIT) running = nk_false;
@@ -147,6 +156,9 @@ MainLoop(void* loopArg){
     #ifdef INCLUDE_OVERVIEW
     #ifdef INCLUDE_OVERVIEW
       overview(ctx);
       overview(ctx);
     #endif
     #endif
+    #ifdef INCLUDE_CONFIGURATOR
+      style_configurator(ctx, color_table);
+    #endif
     #ifdef INCLUDE_NODE_EDITOR
     #ifdef INCLUDE_NODE_EDITOR
       node_editor(ctx);
       node_editor(ctx);
     #endif
     #endif

+ 14 - 1
demo/sdl_renderer/main.c

@@ -38,6 +38,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -45,6 +46,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -60,6 +62,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -70,7 +75,7 @@
  *
  *
  * ===============================================================*/
  * ===============================================================*/
 int
 int
-main(int argc, char *argv[])
+main(void)
 {
 {
     /* Platform */
     /* Platform */
     SDL_Window *win;
     SDL_Window *win;
@@ -83,6 +88,11 @@ main(int argc, char *argv[])
     struct nk_context *ctx;
     struct nk_context *ctx;
     struct nk_colorf bg;
     struct nk_colorf bg;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* SDL setup */
     /* SDL setup */
     SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0");
     SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0");
     SDL_Init(SDL_INIT_VIDEO);
     SDL_Init(SDL_INIT_VIDEO);
@@ -212,6 +222,9 @@ main(int argc, char *argv[])
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 19 - 6
demo/sdl_vulkan/main.c

@@ -40,15 +40,17 @@
 /* #define INCLUDE_STYLE */
 /* #define INCLUDE_STYLE */
 /* #define INCLUDE_CALCULATOR */
 /* #define INCLUDE_CALCULATOR */
 /* #define INCLUDE_CANVAS */
 /* #define INCLUDE_CANVAS */
-/* #define INCLUDE_OVERVIEW */
+#define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /* #define INCLUDE_NODE_EDITOR */
 /* #define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
-#define INCLUDE_STYLE
-#define INCLUDE_CALCULATOR
-#define INCLUDE_CANVAS
-#define INCLUDE_OVERVIEW
-#define INCLUDE_NODE_EDITOR
+  #define INCLUDE_STYLE
+  #define INCLUDE_CALCULATOR
+  #define INCLUDE_CANVAS
+  #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
+  #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
 #ifdef INCLUDE_STYLE
 #ifdef INCLUDE_STYLE
@@ -63,6 +65,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
 #include "../../demo/common/overview.c"
 #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
 #include "../../demo/common/node_editor.c"
 #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -2083,6 +2088,11 @@ int main(void) {
     VkResult result;
     VkResult result;
     VkSemaphore nk_semaphore;
     VkSemaphore nk_semaphore;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0");
     SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0");
 
 
     if (SDL_Init(SDL_INIT_VIDEO) < 0) {
     if (SDL_Init(SDL_INIT_VIDEO) < 0) {
@@ -2200,6 +2210,9 @@ int main(void) {
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
         overview(ctx);
         overview(ctx);
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+        style_configurator(ctx, color_table);
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
         node_editor(ctx);
         node_editor(ctx);
 #endif
 #endif

+ 13 - 0
demo/sfml_opengl2/main.cpp

@@ -39,6 +39,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -46,6 +47,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -61,6 +63,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -96,6 +101,11 @@ int main(void)
     /*nk_style_load_all_cursors(ctx, atlas->cursors);*/
     /*nk_style_load_all_cursors(ctx, atlas->cursors);*/
     /*nk_style_set_font(ctx, &droid->handle);*/
     /*nk_style_set_font(ctx, &droid->handle);*/
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     struct nk_colorf bg;
     struct nk_colorf bg;
     bg.r = 0.10f, bg.g = 0.18f, bg.b = 0.24f, bg.a = 1.0f;
     bg.r = 0.10f, bg.g = 0.18f, bg.b = 0.24f, bg.a = 1.0f;
     while (win.isOpen())
     while (win.isOpen())
@@ -157,6 +167,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/sfml_opengl3/main.cpp

@@ -41,6 +41,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -48,6 +49,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -63,6 +65,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -102,6 +107,11 @@ int main(void)
     /*nk_style_load_all_cursors(ctx, atlas->cursors);*/
     /*nk_style_load_all_cursors(ctx, atlas->cursors);*/
     /*nk_style_set_font(ctx, &droid->handle);*/
     /*nk_style_set_font(ctx, &droid->handle);*/
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     struct nk_colorf bg;
     struct nk_colorf bg;
     bg.r = 0.10f, bg.g = 0.18f, bg.b = 0.24f, bg.a = 1.0f;
     bg.r = 0.10f, bg.g = 0.18f, bg.b = 0.24f, bg.a = 1.0f;
     while (win.isOpen())
     while (win.isOpen())
@@ -164,6 +174,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/x11/main.c

@@ -81,6 +81,7 @@ sleep_for(long t)
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -88,6 +89,7 @@ sleep_for(long t)
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -103,6 +105,9 @@ sleep_for(long t)
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -121,6 +126,11 @@ main(void)
     XWindow xw;
     XWindow xw;
     struct nk_context *ctx;
     struct nk_context *ctx;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* X11 */
     /* X11 */
     memset(&xw, 0, sizeof xw);
     memset(&xw, 0, sizeof xw);
     xw.dpy = XOpenDisplay(NULL);
     xw.dpy = XOpenDisplay(NULL);
@@ -197,6 +207,9 @@ main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/x11_opengl2/main.c

@@ -42,6 +42,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -49,6 +50,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -64,6 +66,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -129,6 +134,11 @@ int main(void)
     struct nk_context *ctx;
     struct nk_context *ctx;
     struct nk_colorf bg;
     struct nk_colorf bg;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     memset(&win, 0, sizeof(win));
     memset(&win, 0, sizeof(win));
     win.dpy = XOpenDisplay(NULL);
     win.dpy = XOpenDisplay(NULL);
     if (!win.dpy) die("Failed to open X display\n");
     if (!win.dpy) die("Failed to open X display\n");
@@ -314,6 +324,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/x11_opengl3/main.c

@@ -40,6 +40,7 @@
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -47,6 +48,7 @@
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -62,6 +64,9 @@
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -127,6 +132,11 @@ int main(void)
     struct nk_context *ctx;
     struct nk_context *ctx;
     struct nk_colorf bg;
     struct nk_colorf bg;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     memset(&win, 0, sizeof(win));
     memset(&win, 0, sizeof(win));
     win.dpy = XOpenDisplay(NULL);
     win.dpy = XOpenDisplay(NULL);
     if (!win.dpy) die("Failed to open X display\n");
     if (!win.dpy) die("Failed to open X display\n");
@@ -311,6 +321,9 @@ int main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/x11_xft/main.c

@@ -81,6 +81,7 @@ sleep_for(long t)
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 
 
 #ifdef INCLUDE_ALL
 #ifdef INCLUDE_ALL
@@ -88,6 +89,7 @@ sleep_for(long t)
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
 #endif
 #endif
 
 
@@ -103,6 +105,9 @@ sleep_for(long t)
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../../demo/common/overview.c"
   #include "../../demo/common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../../demo/common/node_editor.c"
   #include "../../demo/common/node_editor.c"
 #endif
 #endif
@@ -121,6 +126,11 @@ main(void)
     XWindow xw;
     XWindow xw;
     struct nk_context *ctx;
     struct nk_context *ctx;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     /* X11 */
     /* X11 */
     memset(&xw, 0, sizeof xw);
     memset(&xw, 0, sizeof xw);
     xw.dpy = XOpenDisplay(NULL);
     xw.dpy = XOpenDisplay(NULL);
@@ -201,6 +211,9 @@ main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
           overview(ctx);
           overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
           node_editor(ctx);
           node_editor(ctx);
         #endif
         #endif

+ 13 - 0
demo/xcb_cairo/main.c

@@ -42,6 +42,7 @@ static void die(const char *fmt, ...)
 /*#define INCLUDE_STYLE */
 /*#define INCLUDE_STYLE */
 /*#define INCLUDE_CALCULATOR */
 /*#define INCLUDE_CALCULATOR */
 #define INCLUDE_OVERVIEW
 #define INCLUDE_OVERVIEW
+/*#define INCLUDE_CONFIGURATOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_NODE_EDITOR */
 /*#define INCLUDE_CANVAS */
 /*#define INCLUDE_CANVAS */
 
 
@@ -50,6 +51,7 @@ static void die(const char *fmt, ...)
   #define INCLUDE_CALCULATOR
   #define INCLUDE_CALCULATOR
   #define INCLUDE_OVERVIEW
   #define INCLUDE_OVERVIEW
   #define INCLUDE_NODE_EDITOR
   #define INCLUDE_NODE_EDITOR
+  #define INCLUDE_CONFIGURATOR
   #define INCLUDE_CANVAS
   #define INCLUDE_CANVAS
 #endif
 #endif
 
 
@@ -62,6 +64,9 @@ static void die(const char *fmt, ...)
 #ifdef INCLUDE_OVERVIEW
 #ifdef INCLUDE_OVERVIEW
   #include "../common/overview.c"
   #include "../common/overview.c"
 #endif
 #endif
+#ifdef INCLUDE_CONFIGURATOR
+  #include "../../demo/common/style_configurator.c"
+#endif
 #ifdef INCLUDE_NODE_EDITOR
 #ifdef INCLUDE_NODE_EDITOR
   #include "../common/node_editor.c"
   #include "../common/node_editor.c"
 #endif
 #endif
@@ -85,6 +90,11 @@ main(void)
     int running = 1;
     int running = 1;
     int events;
     int events;
 
 
+    #ifdef INCLUDE_CONFIGURATOR
+    static struct nk_color color_table[NK_COLOR_COUNT];
+    memcpy(color_table, nk_default_color_style, sizeof(color_table));
+    #endif
+
     xcb_ctx = nk_xcb_init("Nuklear XCB/Cairo", 20, 20, 600, 800);
     xcb_ctx = nk_xcb_init("Nuklear XCB/Cairo", 20, 20, 600, 800);
     cairo_ctx = nk_cairo_init(&background, NULL, 0, nk_xcb_create_cairo_surface(xcb_ctx));
     cairo_ctx = nk_cairo_init(&background, NULL, 0, nk_xcb_create_cairo_surface(xcb_ctx));
     /*cairo_ctx = nk_cairo_init(&background, "../../extra_font/DroidSans.ttf", 0, nk_xcb_create_surface(xcb_ctx));*/
     /*cairo_ctx = nk_cairo_init(&background, "../../extra_font/DroidSans.ttf", 0, nk_xcb_create_surface(xcb_ctx));*/
@@ -145,6 +155,9 @@ main(void)
         #ifdef INCLUDE_OVERVIEW
         #ifdef INCLUDE_OVERVIEW
         overview(ctx);
         overview(ctx);
         #endif
         #endif
+        #ifdef INCLUDE_CONFIGURATOR
+          style_configurator(ctx, color_table);
+        #endif
         #ifdef INCLUDE_NODE_EDITOR
         #ifdef INCLUDE_NODE_EDITOR
         node_editor(ctx);
         node_editor(ctx);
         #endif
         #endif