aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml105
-rw-r--r--.travis.yml36
-rw-r--r--ChangeLog19
-rw-r--r--README.md93
-rw-r--r--VERSION2
-rw-r--r--manifest.ttl.in46
-rw-r--r--meson.build145
-rw-r--r--meson_options.txt7
-rw-r--r--midi_matrix.c30
-rw-r--r--midi_matrix.h43
-rw-r--r--midi_matrix.ttl233
-rw-r--r--midi_matrix_channel_filter.c182
-rw-r--r--midi_matrix_channel_filter_nk.c308
-rw-r--r--midi_matrix_nk.c31
-rw-r--r--midi_matrix_ui.ttl27
-rw-r--r--nk_patcher.h774
-rw-r--r--screenshots/screenshot_1.pngbin0 -> 86371 bytes
-rw-r--r--subprojects/nk_pugl/.gitlab-ci.yml94
-rw-r--r--subprojects/nk_pugl/COPYING201
-rw-r--r--subprojects/nk_pugl/VERSION1
-rw-r--r--subprojects/nk_pugl/example/example.c (renamed from example/example.c)0
-rw-r--r--subprojects/nk_pugl/glew-2.1.0/GL/eglew.h (renamed from glew-2.1.0/GL/eglew.h)0
-rw-r--r--subprojects/nk_pugl/glew-2.1.0/GL/glew.h (renamed from glew-2.1.0/GL/glew.h)0
-rw-r--r--subprojects/nk_pugl/glew-2.1.0/GL/glxew.h (renamed from glew-2.1.0/GL/glxew.h)0
-rw-r--r--subprojects/nk_pugl/glew-2.1.0/GL/wglew.h (renamed from glew-2.1.0/GL/wglew.h)0
-rw-r--r--subprojects/nk_pugl/glew-2.1.0/glew.c (renamed from glew-2.1.0/glew.c)0
-rw-r--r--subprojects/nk_pugl/meson.build86
-rw-r--r--subprojects/nk_pugl/meson_options.txt4
-rw-r--r--subprojects/nk_pugl/nk_pugl/nk_pugl.h (renamed from nk_pugl/nk_pugl.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/.gitattributes (renamed from nuklear/.gitattributes)0
-rw-r--r--subprojects/nk_pugl/nuklear/.gitignore (renamed from nuklear/.gitignore)0
-rw-r--r--subprojects/nk_pugl/nuklear/.gitmodules (renamed from nuklear/.gitmodules)0
-rw-r--r--subprojects/nk_pugl/nuklear/.travis.yml (renamed from nuklear/.travis.yml)0
-rw-r--r--subprojects/nk_pugl/nuklear/Readme.md (renamed from nuklear/Readme.md)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.h (renamed from nuklear/demo/allegro5/KeyboardHandleriOS.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.m (renamed from nuklear/demo/allegro5/KeyboardHandleriOS.m)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/Makefile (renamed from nuklear/demo/allegro5/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/Readme.md (renamed from nuklear/demo/allegro5/Readme.md)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/main.c (renamed from nuklear/demo/allegro5/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/allegro5/nuklear_allegro5.h (renamed from nuklear/demo/allegro5/nuklear_allegro5.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/calculator.c (renamed from nuklear/demo/calculator.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/build.bat (renamed from nuklear/demo/d3d11/build.bat)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/main.c (renamed from nuklear/demo/d3d11/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.h (renamed from nuklear/demo/d3d11/nuklear_d3d11.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.hlsl (renamed from nuklear/demo/d3d11/nuklear_d3d11.hlsl)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h (renamed from nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h (renamed from nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d9/build.bat (renamed from nuklear/demo/d3d9/build.bat)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d9/main.c (renamed from nuklear/demo/d3d9/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/d3d9/nuklear_d3d9.h (renamed from nuklear/demo/d3d9/nuklear_d3d9.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdi/build.bat (renamed from nuklear/demo/gdi/build.bat)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdi/main.c (renamed from nuklear/demo/gdi/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdi/nuklear_gdi.h (renamed from nuklear/demo/gdi/nuklear_gdi.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdip/build.bat (renamed from nuklear/demo/gdip/build.bat)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdip/main.c (renamed from nuklear/demo/gdip/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/gdip/nuklear_gdip.h (renamed from nuklear/demo/gdip/nuklear_gdip.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl2/Makefile (renamed from nuklear/demo/glfw_opengl2/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl2/main.c (renamed from nuklear/demo/glfw_opengl2/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h (renamed from nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl3/Makefile (renamed from nuklear/demo/glfw_opengl3/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl3/main.c (renamed from nuklear/demo/glfw_opengl3/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h (renamed from nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/node_editor.c (renamed from nuklear/demo/node_editor.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/overview.c (renamed from nuklear/demo/overview.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl2/Makefile (renamed from nuklear/demo/sdl_opengl2/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl2/main.c (renamed from nuklear/demo/sdl_opengl2/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h (renamed from nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl3/Makefile (renamed from nuklear/demo/sdl_opengl3/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl3/main.c (renamed from nuklear/demo/sdl_opengl3/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h (renamed from nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengles2/Makefile (renamed from nuklear/demo/sdl_opengles2/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengles2/main.c (renamed from nuklear/demo/sdl_opengles2/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h (renamed from nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Makefile (renamed from nuklear/demo/sfml_opengl2/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Readme.md (renamed from nuklear/demo/sfml_opengl2/Readme.md)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl2/main.cpp (renamed from nuklear/demo/sfml_opengl2/main.cpp)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h (renamed from nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Makefile (renamed from nuklear/demo/sfml_opengl3/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Readme.md (renamed from nuklear/demo/sfml_opengl3/Readme.md)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl3/main.cpp (renamed from nuklear/demo/sfml_opengl3/main.cpp)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h (renamed from nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/style.c (renamed from nuklear/demo/style.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11/Makefile (renamed from nuklear/demo/x11/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11/main.c (renamed from nuklear/demo/x11/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11/nuklear_xlib.h (renamed from nuklear/demo/x11/nuklear_xlib.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl2/Makefile (renamed from nuklear/demo/x11_opengl2/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl2/main.c (renamed from nuklear/demo/x11_opengl2/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h (renamed from nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl3/Makefile (renamed from nuklear/demo/x11_opengl3/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl3/main.c (renamed from nuklear/demo/x11_opengl3/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h (renamed from nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_rawfb/Makefile (renamed from nuklear/demo/x11_rawfb/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_rawfb/main.c (renamed from nuklear/demo/x11_rawfb/main.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_rawfb.h (renamed from nuklear/demo/x11_rawfb/nuklear_rawfb.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_xlib.h (renamed from nuklear/demo/x11_rawfb/nuklear_xlib.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/doc/Makefile (renamed from nuklear/doc/Makefile)0
-rwxr-xr-xsubprojects/nk_pugl/nuklear/doc/build.sh (renamed from nuklear/doc/build.sh)0
-rw-r--r--subprojects/nk_pugl/nuklear/doc/nuklear.html (renamed from nuklear/doc/nuklear.html)0
-rw-r--r--subprojects/nk_pugl/nuklear/doc/stddoc.c (renamed from nuklear/doc/stddoc.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/Makefile (renamed from nuklear/example/Makefile)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/canvas.c (renamed from nuklear/example/canvas.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/extended.c (renamed from nuklear/example/extended.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/file_browser.c (renamed from nuklear/example/file_browser.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/checked.png (renamed from nuklear/example/icon/checked.png)bin1813 -> 1813 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/cloud.png (renamed from nuklear/example/icon/cloud.png)bin7509 -> 7509 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/computer.png (renamed from nuklear/example/icon/computer.png)bin620 -> 620 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/copy.png (renamed from nuklear/example/icon/copy.png)bin655 -> 655 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/default.png (renamed from nuklear/example/icon/default.png)bin460 -> 460 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/delete.png (renamed from nuklear/example/icon/delete.png)bin11040 -> 11040 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/desktop.png (renamed from nuklear/example/icon/desktop.png)bin583 -> 583 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/directory.png (renamed from nuklear/example/icon/directory.png)bin533 -> 533 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/edit.png (renamed from nuklear/example/icon/edit.png)bin14998 -> 14998 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/export.png (renamed from nuklear/example/icon/export.png)bin13336 -> 13336 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/font.png (renamed from nuklear/example/icon/font.png)bin561 -> 561 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/home.png (renamed from nuklear/example/icon/home.png)bin819 -> 819 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/img.png (renamed from nuklear/example/icon/img.png)bin648 -> 648 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/movie.png (renamed from nuklear/example/icon/movie.png)bin626 -> 626 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/music.png (renamed from nuklear/example/icon/music.png)bin610 -> 610 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/next.png (renamed from nuklear/example/icon/next.png)bin703 -> 703 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/pause.png (renamed from nuklear/example/icon/pause.png)bin1338 -> 1338 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/pen.png (renamed from nuklear/example/icon/pen.png)bin5949 -> 5949 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/phone.png (renamed from nuklear/example/icon/phone.png)bin15778 -> 15778 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/plane.png (renamed from nuklear/example/icon/plane.png)bin13546 -> 13546 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/play.png (renamed from nuklear/example/icon/play.png)bin566 -> 566 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/prev.png (renamed from nuklear/example/icon/prev.png)bin701 -> 701 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/rocket.png (renamed from nuklear/example/icon/rocket.png)bin1121 -> 1121 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/settings.png (renamed from nuklear/example/icon/settings.png)bin15671 -> 15671 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/stop.png (renamed from nuklear/example/icon/stop.png)bin520 -> 520 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/text.png (renamed from nuklear/example/icon/text.png)bin601 -> 601 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/tools.png (renamed from nuklear/example/icon/tools.png)bin24483 -> 24483 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/unchecked.png (renamed from nuklear/example/icon/unchecked.png)bin1044 -> 1044 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/volume.png (renamed from nuklear/example/icon/volume.png)bin25438 -> 25438 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/icon/wifi.png (renamed from nuklear/example/icon/wifi.png)bin18857 -> 18857 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image1.png (renamed from nuklear/example/images/image1.png)bin42882 -> 42882 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image2.png (renamed from nuklear/example/images/image2.png)bin5671 -> 5671 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image3.png (renamed from nuklear/example/images/image3.png)bin131502 -> 131502 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image4.png (renamed from nuklear/example/images/image4.png)bin185821 -> 185821 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image5.png (renamed from nuklear/example/images/image5.png)bin98475 -> 98475 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image6.png (renamed from nuklear/example/images/image6.png)bin35633 -> 35633 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image7.png (renamed from nuklear/example/images/image7.png)bin13960 -> 13960 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image8.png (renamed from nuklear/example/images/image8.png)bin45987 -> 45987 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/images/image9.png (renamed from nuklear/example/images/image9.png)bin30759 -> 30759 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/skinning.c (renamed from nuklear/example/skinning.c)0
-rw-r--r--subprojects/nk_pugl/nuklear/example/skins/gwen.png (renamed from nuklear/example/skins/gwen.png)bin24565 -> 24565 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/example/stb_image.h (renamed from nuklear/example/stb_image.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Cousine-Regular.ttf (renamed from nuklear/extra_font/Cousine-Regular.ttf)bin43912 -> 43912 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/DroidSans.ttf (renamed from nuklear/extra_font/DroidSans.ttf)bin190044 -> 190044 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Karla-Regular.ttf (renamed from nuklear/extra_font/Karla-Regular.ttf)bin16848 -> 16848 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/ProggyClean.ttf (renamed from nuklear/extra_font/ProggyClean.ttf)bin41208 -> 41208 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/ProggyTiny.ttf (renamed from nuklear/extra_font/ProggyTiny.ttf)bin35656 -> 35656 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Raleway-Bold.ttf (renamed from nuklear/extra_font/Raleway-Bold.ttf)bin176280 -> 176280 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Roboto-Bold.ttf (renamed from nuklear/extra_font/Roboto-Bold.ttf)bin135820 -> 135820 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Roboto-Light.ttf (renamed from nuklear/extra_font/Roboto-Light.ttf)bin140276 -> 140276 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/Roboto-Regular.ttf (renamed from nuklear/extra_font/Roboto-Regular.ttf)bin145348 -> 145348 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/kenvector_future.ttf (renamed from nuklear/extra_font/kenvector_future.ttf)bin34136 -> 34136 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/extra_font/kenvector_future_thin.ttf (renamed from nuklear/extra_font/kenvector_future_thin.ttf)bin34100 -> 34100 bytes
-rw-r--r--subprojects/nk_pugl/nuklear/nuklear.h (renamed from nuklear/nuklear.h)0
-rw-r--r--subprojects/nk_pugl/nuklear/package.json (renamed from nuklear/package.json)0
-rw-r--r--subprojects/nk_pugl/pugl/.clang-format (renamed from pugl/.clang-format)0
-rw-r--r--subprojects/nk_pugl/pugl/.clang-tidy (renamed from pugl/.clang-tidy)0
-rw-r--r--subprojects/nk_pugl/pugl/.gitattributes (renamed from pugl/.gitattributes)0
-rw-r--r--subprojects/nk_pugl/pugl/.gitignore (renamed from pugl/.gitignore)0
-rw-r--r--subprojects/nk_pugl/pugl/.gitlab-ci.yml (renamed from pugl/.gitlab-ci.yml)0
-rw-r--r--subprojects/nk_pugl/pugl/.gitmodules (renamed from pugl/.gitmodules)0
-rw-r--r--subprojects/nk_pugl/pugl/AUTHORS (renamed from pugl/AUTHORS)0
-rw-r--r--subprojects/nk_pugl/pugl/COPYING (renamed from pugl/COPYING)0
-rw-r--r--subprojects/nk_pugl/pugl/README.md (renamed from pugl/README.md)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/footer.html (renamed from pugl/doc/footer.html)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/header.html (renamed from pugl/doc/header.html)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/layout.xml (renamed from pugl/doc/layout.xml)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/mainpage.md (renamed from pugl/doc/mainpage.md)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/reference.doxygen.in (renamed from pugl/doc/reference.doxygen.in)0
-rw-r--r--subprojects/nk_pugl/pugl/doc/style.css (renamed from pugl/doc/style.css)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/cube_view.h (renamed from pugl/examples/cube_view.h)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/demo_utils.h (renamed from pugl/examples/demo_utils.h)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/glad/glad.c (renamed from pugl/examples/glad/glad.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/glad/glad.h (renamed from pugl/examples/glad/glad.h)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/glad/khrplatform.h (renamed from pugl/examples/glad/khrplatform.h)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/pugl_cairo_demo.c (renamed from pugl/examples/pugl_cairo_demo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/pugl_embed_demo.c (renamed from pugl/examples/pugl_embed_demo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/pugl_gl3_demo.c (renamed from pugl/examples/pugl_gl3_demo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/pugl_print_events.c (renamed from pugl/examples/pugl_print_events.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/pugl_window_demo.c (renamed from pugl/examples/pugl_window_demo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/examples/shader_utils.h (renamed from pugl/examples/shader_utils.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl.pc.in (renamed from pugl/pugl.pc.in)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/implementation.c (renamed from pugl/pugl/detail/implementation.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/implementation.h (renamed from pugl/pugl/detail/implementation.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/mac.h (renamed from pugl/pugl/detail/mac.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/mac.m (renamed from pugl/pugl/detail/mac.m)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/mac_cairo.m (renamed from pugl/pugl/detail/mac_cairo.m)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/mac_gl.m (renamed from pugl/pugl/detail/mac_gl.m)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/mac_stub.m (renamed from pugl/pugl/detail/mac_stub.m)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/types.h (renamed from pugl/pugl/detail/types.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/win.c (renamed from pugl/pugl/detail/win.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/win.h (renamed from pugl/pugl/detail/win.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/win_cairo.c (renamed from pugl/pugl/detail/win_cairo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/win_gl.c (renamed from pugl/pugl/detail/win_gl.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/x11.c (renamed from pugl/pugl/detail/x11.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/x11.h (renamed from pugl/pugl/detail/x11.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/x11_cairo.c (renamed from pugl/pugl/detail/x11_cairo.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/detail/x11_gl.c (renamed from pugl/pugl/detail/x11_gl.c)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/gl.h (renamed from pugl/pugl/gl.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/glu.h (renamed from pugl/pugl/glu.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl.h (renamed from pugl/pugl/pugl.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl.hpp (renamed from pugl/pugl/pugl.hpp)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_cairo.h (renamed from pugl/pugl/pugl_cairo.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_cairo_backend.h (renamed from pugl/pugl/pugl_cairo_backend.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_gl.h (renamed from pugl/pugl/pugl_gl.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_gl_backend.h (renamed from pugl/pugl/pugl_gl_backend.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_stub.h (renamed from pugl/pugl/pugl_stub.h)0
-rw-r--r--subprojects/nk_pugl/pugl/pugl/pugl_stub_backend.h (renamed from pugl/pugl/pugl_stub_backend.h)0
-rw-r--r--subprojects/nk_pugl/pugl/resources/Info.plist.in (renamed from pugl/resources/Info.plist.in)0
-rw-r--r--subprojects/nk_pugl/pugl/resources/pugl.ipe (renamed from pugl/resources/pugl.ipe)0
-rw-r--r--subprojects/nk_pugl/pugl/resources/pugl.png (renamed from pugl/resources/pugl.png)bin2641 -> 2641 bytes
-rw-r--r--subprojects/nk_pugl/pugl/resources/pugl.svg (renamed from pugl/resources/pugl.svg)0
-rw-r--r--subprojects/nk_pugl/pugl/shaders/rect.frag (renamed from pugl/shaders/rect.frag)0
-rw-r--r--subprojects/nk_pugl/pugl/shaders/rect.vert (renamed from pugl/shaders/rect.vert)0
-rw-r--r--subprojects/nk_pugl/pugl/test/test_redisplay.c (renamed from pugl/test/test_redisplay.c)0
-rw-r--r--subprojects/nk_pugl/pugl/test/test_show_hide.c (renamed from pugl/test/test_show_hide.c)0
-rw-r--r--subprojects/nk_pugl/pugl/test/test_timer.c (renamed from pugl/test/test_timer.c)0
-rw-r--r--subprojects/nk_pugl/pugl/test/test_update.c (renamed from pugl/test/test_update.c)0
-rw-r--r--subprojects/nk_pugl/pugl/test/test_utils.h (renamed from pugl/test/test_utils.h)0
-rwxr-xr-xsubprojects/nk_pugl/pugl/waf (renamed from pugl/waf)0
-rw-r--r--subprojects/nk_pugl/pugl/wscript (renamed from pugl/wscript)0
224 files changed, 2364 insertions, 103 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e289a04..026a52a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,45 +4,48 @@ stages:
.variables_template: &variables_definition
variables:
- BASE_NAME: "nk_pugl"
PKG_CONFIG_PATH: "/opt/lv2/lib/pkgconfig:/opt/${CI_BUILD_NAME}/lib/pkgconfig:/usr/lib/${CI_BUILD_NAME}/pkgconfig"
+ BUILD_OPTS: ""
.common_template: &common_definition
<<: *variables_definition
stage: build
artifacts:
- name: "${BASE_NAME}-$(cat VERSION)-${CI_BUILD_NAME}"
+ name: "${CI_PROJECT_NAME}-$(cat VERSION)-${CI_BUILD_NAME}"
paths:
- - "${BASE_NAME}-$(cat VERSION)/"
+ - "${CI_PROJECT_NAME}-$(cat VERSION)/${CI_BUILD_NAME}/"
.build_template: &build_definition
<<: *common_definition
script:
- - meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" build
- - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' build/build.ninja
+ - meson --prefix="${CI_PROJECT_DIR}/${CI_PROJECT_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" -Dlv2libdir="" --cross-file "${CI_BUILD_NAME}" ${BUILD_OPTS} build
+ - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' -e '/framework/s/-Wl,-soname,.*dylib//g' build/build.ninja
- ninja -C build
- - DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install
+ - ninja -C build test
+ - ninja -C build install
-.analyze_template: &analyze_definition
- <<: *common_definition
- script:
- - meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" build
- - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' build/build.ninja
- - ninja -C build
- - DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install
+.universal_linux_template_stretch: &universal_linux_definition_stretch
+ image: ventosus/universal-linux-gnu:stretch
+ <<: *build_definition
+
+.universal_linux_template_buster: &universal_linux_definition_buster
+ image: ventosus/universal-linux-gnu:buster
+ <<: *build_definition
- - CC=clang CXX=clang++ meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" clang
- - ninja -C clang
+.universal_linux_template_bullseye: &universal_linux_definition_bullseye
+ image: ventosus/universal-linux-gnu:bullseye
+ <<: *build_definition
- - scan-build --status-bugs meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" scanbuild
- - scan-build --status-bugs ninja -C scanbuild
+.arm_linux_template_stretch: &arm_linux_definition_stretch
+ image: ventosus/arm-linux-gnueabihf:stretch
+ <<: *build_definition
-.universal_linux_template: &universal_linux_definition
- image: ventosus/universal-linux-gnu
- <<: *analyze_definition
+.arm_linux_template_buster: &arm_linux_definition_buster
+ image: ventosus/arm-linux-gnueabihf:buster
+ <<: *build_definition
-.arm_linux_template: &arm_linux_definition
- image: ventosus/arm-linux-gnueabihf
+.arm_linux_template_bullseye: &arm_linux_definition_bullseye
+ image: ventosus/arm-linux-gnueabihf:bullseye
<<: *build_definition
.universal_w64_template: &universal_w64_definition
@@ -54,25 +57,41 @@ stages:
<<: *build_definition
# building in docker
-x86_64-linux-gnu:
- before_script:
- - apt-get install -y libglu1-mesa-dev libevdev-dev
- <<: *universal_linux_definition
-
-i686-linux-gnu:
- before_script:
- - apt-get install -y libglu1-mesa-dev:i386 libevdev-dev:i386
- <<: *universal_linux_definition
-
-arm-linux-gnueabihf:
- before_script:
- - apt-get install -y libglu1-mesa-dev:armhf libevdev-dev:armhf
- <<: *arm_linux_definition
-
-aarch64-linux-gnu:
- before_script:
- - apt-get install -y libglu1-mesa-dev:arm64 libevdev-dev:arm64
- <<: *arm_linux_definition
+x86_64-linux-gnu-stretch:
+ <<: *universal_linux_definition_stretch
+
+x86_64-linux-gnu-buster:
+ <<: *universal_linux_definition_buster
+
+x86_64-linux-gnu-bullseye:
+ <<: *universal_linux_definition_bullseye
+
+i686-linux-gnu-stretch:
+ <<: *universal_linux_definition_stretch
+
+i686-linux-gnu-buster:
+ <<: *universal_linux_definition_buster
+
+i686-linux-gnu-bullseye:
+ <<: *universal_linux_definition_bullseye
+
+arm-linux-gnueabihf-stretch:
+ <<: *arm_linux_definition_stretch
+
+arm-linux-gnueabihf-buster:
+ <<: *arm_linux_definition_buster
+
+arm-linux-gnueabihf-bullseye:
+ <<: *arm_linux_definition_bullseye
+
+aarch64-linux-gnu-stretch:
+ <<: *arm_linux_definition_stretch
+
+aarch64-linux-gnu-buster:
+ <<: *arm_linux_definition_buster
+
+aarch64-linux-gnu-bullseye:
+ <<: *arm_linux_definition_bullseye
x86_64-w64-mingw32:
<<: *universal_w64_definition
@@ -89,6 +108,6 @@ pack:
script:
- echo 'packing up...'
artifacts:
- name: "${BASE_NAME}-$(cat VERSION)"
+ name: "${CI_PROJECT_NAME}-$(cat VERSION)"
paths:
- - "${BASE_NAME}-$(cat VERSION)/"
+ - "${CI_PROJECT_NAME}-$(cat VERSION)/"
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..c161961
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,36 @@
+sudo: required
+dist: trusty
+language:
+ - c
+os:
+ - linux
+compiler:
+ - gcc
+ # - clang
+before_install:
+ - wget http://lv2plug.in/spec/lv2-1.12.0.tar.bz2
+ - wget http://download.drobilla.net/serd-0.22.0.tar.bz2
+ - wget http://download.drobilla.net/sord-0.14.0.tar.bz2
+ - wget http://download.drobilla.net/sratom-0.4.6.tar.bz2
+ - wget http://download.drobilla.net/lilv-0.22.0.tar.bz2
+ - wget https://github.com/nanomsg/nanomsg/releases/download/0.8-beta/nanomsg-0.8-beta.tar.gz
+ - tar xjf lv2-1.12.0.tar.bz2
+ - tar xjf serd-0.22.0.tar.bz2
+ - tar xjf sord-0.14.0.tar.bz2
+ - tar xjf sratom-0.4.6.tar.bz2
+ - tar xjf lilv-0.22.0.tar.bz2
+ - tar xzf nanomsg-0.8-beta.tar.gz
+ - sudo add-apt-repository -y ppa:enlightenment-git/ppa
+ - sudo apt-get -q update
+install:
+ - sudo apt-get install -y libefl-dev
+ - pushd lv2-1.12.0 && ./waf configure --no-plugins --prefix=/usr && ./waf build && sudo ./waf install && popd
+ - pushd serd-0.22.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
+ - pushd sord-0.14.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
+ - pushd sratom-0.4.6 && ./waf configure --prefix=/usr && ./waf build && sudo ./waf install && popd
+ - pushd lilv-0.22.0 && ./waf configure --no-utils --prefix=/usr && ./waf build && sudo ./waf install && popd
+ - pushd nanomsg-0.8-beta && ./configure --prefix=/usr && make && sudo make install && popd
+before_script:
+ - mkdir build && pushd build && cmake .. && popd
+script:
+ - pushd build && make && sudo make install && popd
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..507be26
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,19 @@
+# Changelog
+
+## [0.24.0] - 13 Apr 2020
+
+### Changed
+
+* to build with pugl master
+
+## [0.22.0] - 15 Apr 2019
+
+### Added
+
+* ui resize extension
+* dynamic drawing/erasing while mouse down
+* button for one-to-one connection layout
+
+### Changed
+
+* build system from CMake to meson
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..59488a8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,93 @@
+## Midi Matrix
+
+### An LV2 MIDI channel matrix patcher
+
+Things that can be accomplished with this plugin:
+
+* MIDI channel filtering (e.g. blocking of specific channels)
+* MIDI channel multiplication (e.g. send events from channel X to channels X, Y and Z)
+* MIDI channel rerouting (e.g send events from channel X to channel Y)
+* And any possible combination thereof
+
+#### Build status
+
+[![build status](https://gitlab.com/OpenMusicKontrollers/midi_matrix.lv2/badges/master/build.svg)](https://gitlab.com/OpenMusicKontrollers/midi_matrix.lv2/commits/master)
+
+### Binaries
+
+For GNU/Linux (64-bit, 32-bit, armv7), Windows (64-bit, 32-bit) and MacOS
+(64/32-bit univeral).
+
+To install the plugin bundle on your system, simply copy the __midi_matrix.lv2__
+folder out of the platform folder of the downloaded package into your
+[LV2 path](http://lv2plug.in/pages/filesystem-hierarchy-standard.html).
+
+#### Stable release
+
+* [midi_matrix.lv2-0.24.0.zip](https://dl.open-music-kontrollers.ch/midi_matrix.lv2/stable/midi_matrix.lv2-0.24.0.zip) ([sig](https://dl.open-music-kontrollers.ch/midi_matrix.lv2/stable/midi_matrix.lv2-0.24.0.zip.sig))
+
+#### Unstable (nightly) release
+
+* [midi_matrix.lv2-latest-unstable.zip](https://dl.open-music-kontrollers.ch/midi_matrix.lv2/unstable/midi_matrix.lv2-latest-unstable.zip) ([sig](https://dl.open-music-kontrollers.ch/midi_matrix.lv2/unstable/midi_matrix.lv2-latest-unstable.zip.sig))
+
+### Sources
+
+#### Stable release
+
+* [midi_matrix.lv2-0.24.0.tar.xz](https://git.open-music-kontrollers.ch/lv2/midi_matrix.lv2/snapshot/midi_matrix.lv2-0.24.0.tar.xz)
+
+#### Git repository
+
+* <https://git.open-music-kontrollers.ch/lv2/midi_matrix.lv2>
+
+### Packages
+
+* [ArchLinux](https://www.archlinux.org/packages/community/x86_64/midi_matrix.lv2/)
+
+### Bugs and feature requests
+
+* [Gitlab](https://gitlab.com/OpenMusicKontrollers/midi_matrix.lv2)
+* [Github](https://github.com/OpenMusicKontrollers/midi_matrix.lv2)
+
+### Plugins
+
+### Channel Filter
+
+![Through](/screenshots/screenshot_1.png)
+
+The _Midi Matrix - Channel Filter_ is a 3-in-1 filter plugin with a simple UI enabling you to easily accomplish:
+
+* MIDI channel filtering (e.g. blocking of specific channels)
+* MIDI channel multiplication (e.g. send events from channel X to channels X, Y and Z)
+* MIDI channel rerouting (e.g send events from channel X to channel Y)
+* And any possible combination thereof
+
+#### Dependencies
+
+* [LV2](http://lv2plug.in) (LV2 Plugin Specification)
+
+#### Build / install
+
+ git clone https://git.open-music-kontrollers.ch/lv2/midi_matrix.lv2.git
+ cd midi_matrix.lv2
+ meson build
+ cd build
+ ninja -j4
+ sudo ninja install
+
+#### License
+
+Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+
+This is free software: you can redistribute it and/or modify
+it under the terms of the Artistic License 2.0 as published by
+The Perl Foundation.
+
+This source is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+Artistic License 2.0 for more details.
+
+You should have received a copy of the Artistic License 2.0
+along the source as a COPYING file. If not, obtain it from
+<http://www.perlfoundation.org/artistic_license_2_0>.
diff --git a/VERSION b/VERSION
index a0e8ec1..d898071 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.145
+0.25.7
diff --git a/manifest.ttl.in b/manifest.ttl.in
new file mode 100644
index 0000000..38981d6
--- /dev/null
+++ b/manifest.ttl.in
@@ -0,0 +1,46 @@
+# Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+#
+# This is free software: you can redistribute it and/or modify
+# it under the terms of the Artistic License 2.0 as published by
+# The Perl Foundation.
+#
+# This source is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Artistic License 2.0 for more details.
+#
+# You should have received a copy of the Artistic License 2.0
+# along the source as a COPYING file. If not, obtain it from
+# http://www.perlfoundation.org/artistic_license_2_0.
+
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
+@prefix kx: <http://kxstudio.sf.net/ns/lv2ext/external-ui#> .
+
+@prefix midi_matrix: <http://open-music-kontrollers.ch/lv2/midi_matrix#> .
+
+# to please sord_validate
+ui:EoUI
+ a rdfs:Class, owl:Class ;
+ rdfs:subClassOf ui:UI .
+kx:Widget
+ a rdfs:Class, owl:Class ;
+ rdfs:subClassOf ui:UI .
+kx:Host
+ a lv2:Feature .
+
+# Channel Filter Plugin
+midi_matrix:channel_filter
+ a lv2:Plugin ;
+ lv2:minorVersion @MINOR_VERSION@ ;
+ lv2:microVersion @MICRO_VERSION@ ;
+ lv2:binary <midi_matrix@MODULE_SUFFIX@> ;
+ ui:ui midi_matrix:channel_filter_4_nk ;
+ rdfs:seeAlso <midi_matrix.ttl> .
+
+midi_matrix:channel_filter_4_nk
+ a ui:@UI_TYPE@;
+ ui:binary <midi_matrix_ui@MODULE_SUFFIX@> ;
+ rdfs:seeAlso <midi_matrix_ui.ttl> .
diff --git a/meson.build b/meson.build
index 65a0f74..e215e3a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,86 +1,121 @@
-project('nk_pugl', 'c', default_options : [
+project('midi_matrix.lv2', 'c', default_options : [
'buildtype=release',
'warning_level=3',
'werror=false',
'b_lto=false',
'c_std=gnu11'])
-build_examples = get_option('build-examples')
+nk_pugl = subproject('nk_pugl')
-static_link = false #meson.is_cross_build()
+lv2libdir = get_option('lv2libdir')
+
+inst_dir = join_paths(lv2libdir, meson.project_name())
+
+nk_pugl_dep = nk_pugl.get_variable('nk_pugl_gl')
+cousine_regular_ttf = nk_pugl.get_variable('cousine_regular_ttf')
+
+source_root = meson.source_root()
+build_root = meson.build_root()
+
+static_link = meson.is_cross_build()
cc = meson.get_compiler('c')
m_dep = cc.find_library('m')
-lv2_dep = dependency('lv2',
- version : '>=1.14.0')
-glew_dep = dependency('glew',
- version : '>=2.1.0',
- static : static_link,
- required : false)
-if not glew_dep.found()
- glew_dep = declare_dependency(
- compile_args : '-DGLEW_STATIC',
- include_directories : include_directories('glew-2.1.0'),
- sources : join_paths('glew-2.1.0', 'glew.c'))
-endif
+lv2_dep = dependency('lv2', version : '>=1.14.0')
-deps = [m_dep, lv2_dep, glew_dep]
-links = []
+dsp_deps = [m_dep, lv2_dep]
+ui_deps = [m_dep, lv2_dep, nk_pugl_dep]
-pugl_inc = include_directories('pugl')
-inc_dir = [pugl_inc]
+nk_pugl_inc = include_directories(join_paths('subprojects', 'nk_pugl'))
+inc_dir = [nk_pugl_inc]
+rawvers = run_command('cat', 'VERSION').stdout().strip()
+version = rawvers.split('.')
+
+conf_data = configuration_data()
+conf_data.set('MAJOR_VERSION', version[0])
+conf_data.set('MINOR_VERSION', version[1])
+conf_data.set('MICRO_VERSION', version[2])
+
+add_project_arguments('-DMIDI_MATRIX_VERSION="'+rawvers+'"', language : 'c')
add_project_arguments('-D_GNU_SOURCE', language : 'c')
-bin_srcs = [
- join_paths('example', 'example.c')
-]
+lv2_validate = find_program('lv2_validate', native : true, required : false)
+sord_validate = find_program('sord_validate', native : true, required : false)
+lv2lint = find_program('lv2lint', required : false)
-lib_srcs = [
- join_paths('pugl', 'pugl', 'detail', 'implementation.c')
-]
+dsp_srcs = ['midi_matrix.c',
+ 'midi_matrix_channel_filter.c']
-c_args = ['-fvisibility=hidden',
- '-ffast-math']
+ui_srcs = ['midi_matrix_nk.c',
+ 'midi_matrix_channel_filter_nk.c']
+
+c_args = [
+ '-fvisibility=hidden']
if host_machine.system() == 'windows'
- deps += cc.find_library('opengl32')
- deps += cc.find_library('gdi32')
- deps += cc.find_library('ws2_32')
- lib_srcs += 'pugl/pugl/detail/win.c'
- lib_srcs += 'pugl/pugl/detail/win_gl.c'
+ conf_data.set('UI_TYPE', 'WindowsUI')
elif host_machine.system() == 'darwin'
- add_languages('objc')
- links += ['-framework', 'OpenGL']
- links += ['-framework', 'Cocoa']
- lib_srcs += 'pugl/pugl/detail/mac.m'
- lib_srcs += 'pugl/pugl/detail/mac_gl.m'
+ conf_data.set('UI_TYPE', 'CocoaUI')
else
- deps += dependency('gl')
- deps += dependency('x11', version : '>=1.6.0')
- deps += dependency('xext', version : '>=1.3.0')
- lib_srcs += 'pugl/pugl/detail/x11.c'
- lib_srcs += 'pugl/pugl/detail/x11_gl.c'
+ conf_data.set('UI_TYPE', 'X11UI')
endif
-nk_pugl_gl = declare_dependency(
+mod = shared_module('midi_matrix', dsp_srcs,
+ c_args : c_args,
include_directories : inc_dir,
- dependencies : deps,
- link_args : links,
- sources : lib_srcs)
+ name_prefix : '',
+ dependencies : dsp_deps,
+ install : true,
+ install_dir : inst_dir)
-cousine_regular_ttf = configure_file(
- input : join_paths('nuklear', 'extra_font', 'Cousine-Regular.ttf'),
+ui = shared_module('midi_matrix_ui', ui_srcs,
+ c_args : c_args,
+ include_directories : inc_dir,
+ name_prefix : '',
+ dependencies : ui_deps,
+ install : true,
+ install_dir : inst_dir)
+
+suffix = mod.full_path().strip().split('.')[-1]
+conf_data.set('MODULE_SUFFIX', '.' + suffix)
+
+manifest_ttl = configure_file(
+ input : 'manifest.ttl.in',
+ output : 'manifest.ttl',
+ configuration : conf_data,
+ install : true,
+ install_dir : inst_dir)
+
+dsp_ttl = configure_file(
+ input : 'midi_matrix.ttl',
+ output : 'midi_matrix.ttl',
+ copy : true,
+ install : true,
+ install_dir : inst_dir)
+
+ui_ttl = configure_file(
+ input : 'midi_matrix_ui.ttl',
+ output : 'midi_matrix_ui.ttl',
+ copy : true,
+ install : true,
+ install_dir : inst_dir)
+
+configure_file(
+ input : cousine_regular_ttf,
output : 'Cousine-Regular.ttf',
copy : true,
- install : false)
+ install : true,
+ install_dir : inst_dir)
-if build_examples
+if lv2_validate.found() and sord_validate.found()
+ test('LV2 validate', lv2_validate,
+ args : [manifest_ttl, dsp_ttl, ui_ttl])
+endif
- executable('nk_pugl.gl', [bin_srcs],
- c_args : c_args,
- include_directories : inc_dir,
- dependencies: nk_pugl_gl,
- install : false)
+if lv2lint.found()
+ test('LV2 lint', lv2lint,
+ args : ['-Ewarn', '-I', join_paths(build_root, ''),
+ 'http://open-music-kontrollers.ch/lv2/midi_matrix#channel_filter'])
endif
diff --git a/meson_options.txt b/meson_options.txt
index 0a4a2a9..8a007bd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,3 @@
-option('build-examples',
- type : 'boolean',
- value : false,
- yield : true)
+option('lv2libdir',
+ type : 'string',
+ value : 'lib/lv2')
diff --git a/midi_matrix.c b/midi_matrix.c
new file mode 100644
index 0000000..736d3b6
--- /dev/null
+++ b/midi_matrix.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <midi_matrix.h>
+
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
+lv2_descriptor(uint32_t index)
+{
+ switch(index)
+ {
+ case 0:
+ return &channel_filter;
+ default:
+ return NULL;
+ }
+}
diff --git a/midi_matrix.h b/midi_matrix.h
new file mode 100644
index 0000000..dec4f28
--- /dev/null
+++ b/midi_matrix.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#ifndef _MIDI_MATRIX_LV2_H
+#define _MIDI_MATRIX_LV2_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
+#include "lv2/lv2plug.in/ns/ext/atom/util.h"
+#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
+#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
+#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
+
+#define MIDI_MATRIX_URI "http://open-music-kontrollers.ch/lv2/midi_matrix"
+
+#define MIDI_MATRIX_CHANNEL_FILTER_URI MIDI_MATRIX_URI"#channel_filter"
+
+#define MIDI_MATRIX_CHANNEL_FILTER_NK_URI MIDI_MATRIX_URI"#channel_filter_4_nk"
+
+extern const LV2_Descriptor channel_filter;
+
+extern const LV2UI_Descriptor channel_filter_nk;
+
+#endif // _MIDI_MATRIX_LV2_H
diff --git a/midi_matrix.ttl b/midi_matrix.ttl
new file mode 100644
index 0000000..744abf2
--- /dev/null
+++ b/midi_matrix.ttl
@@ -0,0 +1,233 @@
+# Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+#
+# This is free software: you can redistribute it and/or modify
+# it under the terms of the Artistic License 2.0 as published by
+# The Perl Foundation.
+#
+# This source is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Artistic License 2.0 for more details.
+#
+# You should have received a copy of the Artistic License 2.0
+# along the source as a COPYING file. If not, obtain it from
+# http://www.perlfoundation.org/artistic_license_2_0.
+
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
+@prefix midi: <http://lv2plug.in/ns/ext/midi#> .
+@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
+@prefix kx: <http://kxstudio.sf.net/ns/lv2ext/external-ui#> .
+
+@prefix lic: <http://opensource.org/licenses/> .
+@prefix omk: <http://open-music-kontrollers.ch/ventosus#> .
+@prefix proj: <http://open-music-kontrollers.ch/lv2/> .
+@prefix midi_matrix: <http://open-music-kontrollers.ch/lv2/midi_matrix#> .
+
+# Maintainer
+omk:me
+ a foaf:Person ;
+ foaf:name "Hanspeter Portner" ;
+ foaf:mbox <mailto:dev@open-music-kontrollers.ch> ;
+ foaf:homepage <http://open-music-kontrollers.ch> .
+
+lv2:isBitmask
+ a lv2:PortProperty .
+
+# Project
+proj:midi_matrix
+ a doap:Project ;
+ doap:maintainer omk:me ;
+ doap:name "MIDI Matrix Bundle" .
+
+# Channel Filter Plugin
+midi_matrix:channel_filter
+ a lv2:Plugin,
+ lv2:MixerPlugin;
+ doap:name "MIDI Channel Matrix Multiplexer and Demultiplexer" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:midi_matrix ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:requiredFeature urid:map ;
+
+ lv2:port [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 0 ;
+ lv2:symbol "mask_channel_1" ;
+ lv2:name "Mask of Channel 1" ;
+ lv2:default 1 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 1 ;
+ lv2:symbol "mask_channel_2" ;
+ lv2:name "Mask of Channel 2" ;
+ lv2:default 2 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 2 ;
+ lv2:symbol "mask_channel_3" ;
+ lv2:name "Mask of Channel 3" ;
+ lv2:default 4 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 3 ;
+ lv2:symbol "mask_channel_4" ;
+ lv2:name "Mask of Channel 4" ;
+ lv2:default 8 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 4 ;
+ lv2:symbol "mask_channel_5" ;
+ lv2:name "Mask of Channel 5" ;
+ lv2:default 16 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 5 ;
+ lv2:symbol "mask_channel_6" ;
+ lv2:name "Mask of Channel 6" ;
+ lv2:default 32 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 6 ;
+ lv2:symbol "mask_channel_7" ;
+ lv2:name "Mask of Channel 7" ;
+ lv2:default 64 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 7 ;
+ lv2:symbol "mask_channel_8" ;
+ lv2:name "Mask of Channel 8" ;
+ lv2:default 128 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 8 ;
+ lv2:symbol "mask_channel_9" ;
+ lv2:name "Mask of Channel 9" ;
+ lv2:default 256 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 9 ;
+ lv2:symbol "mask_channel_10" ;
+ lv2:name "Mask of Channel 10" ;
+ lv2:default 512 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 10 ;
+ lv2:symbol "mask_channel_11" ;
+ lv2:name "Mask of Channel 11" ;
+ lv2:default 1024 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 11 ;
+ lv2:symbol "mask_channel_12" ;
+ lv2:name "Mask of Channel 12" ;
+ lv2:default 2048 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 12 ;
+ lv2:symbol "mask_channel_13" ;
+ lv2:name "Mask of Channel 13" ;
+ lv2:default 4096 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 13 ;
+ lv2:symbol "mask_channel_14" ;
+ lv2:name "Mask of Channel 14" ;
+ lv2:default 8192 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 14 ;
+ lv2:symbol "mask_channel_15" ;
+ lv2:name "Mask of Channel 15" ;
+ lv2:default 16384 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ lv2:ControlPort ;
+ lv2:index 15 ;
+ lv2:symbol "mask_channel_16" ;
+ lv2:name "Mask of Channel 16" ;
+ lv2:default 32768 ;
+ lv2:minimum 0 ;
+ lv2:maximum 65535 ;
+ lv2:portProperty lv2:integer, lv2:isBitmask ;
+ ] , [
+ a lv2:InputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports midi:MidiEvent ;
+ lv2:index 16 ;
+ lv2:symbol "midi_in" ;
+ lv2:name "MIDI Input Port" ;
+ lv2:designation lv2:control ;
+ ] , [
+ a lv2:OutputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports midi:MidiEvent ;
+ lv2:index 17 ;
+ lv2:symbol "midi_out" ;
+ lv2:name "MIDI Output Port" ;
+ lv2:designation lv2:control ;
+ ] .
diff --git a/midi_matrix_channel_filter.c b/midi_matrix_channel_filter.c
new file mode 100644
index 0000000..f1ef518
--- /dev/null
+++ b/midi_matrix_channel_filter.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <midi_matrix.h>
+
+typedef struct _Handle Handle;
+
+struct _Handle {
+ LV2_URID_Map *map;
+ struct {
+ LV2_URID midi_MidiEvent;
+ } uris;
+
+ const LV2_Atom_Sequence *midi_in;
+ LV2_Atom_Sequence *midi_out;
+ float *control [0x10];
+ uint16_t mask [0x10];
+
+ LV2_Atom_Forge forge;
+ LV2_Atom_Forge_Frame frame;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate __attribute__((unused)),
+ const char *bundle_path __attribute__((unused)), const LV2_Feature *const *features)
+{
+ int i;
+ Handle *handle = (Handle *)calloc(1, sizeof(Handle));
+ if(!handle)
+ return NULL;
+
+ for(i=0; features[i]; i++)
+ if(!strcmp(features[i]->URI, LV2_URID__map))
+ handle->map = (LV2_URID_Map *)features[i]->data;
+
+ if(!handle->map)
+ {
+ fprintf(stderr, "%s: Host does not support urid:map\n", descriptor->URI);
+ free(handle);
+ return NULL;
+ }
+
+ handle->uris.midi_MidiEvent = handle->map->map(handle->map->handle, LV2_MIDI__MidiEvent);
+ lv2_atom_forge_init(&handle->forge, handle->map);
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ Handle *handle = (Handle *)instance;
+ switch(port)
+ {
+ case 0x00:
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x07:
+ case 0x08:
+ case 0x09:
+ case 0x0a:
+ case 0x0b:
+ case 0x0c:
+ case 0x0d:
+ case 0x0e:
+ case 0x0f:
+ handle->control[port] = (float *)data;
+ break;
+ case 0x10:
+ handle->midi_in = (const LV2_Atom_Sequence *)data;
+ break;
+ case 0x11:
+ handle->midi_out = (LV2_Atom_Sequence *)data;
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples __attribute__((unused)))
+{
+ Handle *handle = (Handle *)instance;
+
+ if(!handle->midi_in || !handle->midi_out)
+ return;
+
+ // fill channel mask array
+ int i;
+ for(i=0x0; i<0x10; i++)
+ handle->mask[i] = (uint16_t)*handle->control[i];
+
+ // prepare midi atom forge
+ const uint32_t capacity = handle->midi_out->atom.size;
+ LV2_Atom_Forge *forge = &handle->forge;
+ lv2_atom_forge_set_buffer(forge, (uint8_t *)handle->midi_out, capacity);
+ lv2_atom_forge_sequence_head(forge, &handle->frame, 0);
+
+ // process incoming events
+ LV2_ATOM_SEQUENCE_FOREACH(handle->midi_in, ev)
+ {
+ if(ev->body.type == handle->uris.midi_MidiEvent)
+ {
+ int64_t frames = ev->time.frames;
+ const uint32_t len = ev->body.size;
+ const uint8_t *buf = LV2_ATOM_BODY_CONST(&ev->body);
+
+ const uint8_t cmd = buf[0] & 0xf0;
+ if(cmd == 0xf0)
+ continue; // ignore system messages
+
+ const uint8_t src = buf[0] & 0x0f; // source channel
+ if(handle->mask[src]) // are there any active output channels at all for this input channel?
+ {
+ uint8_t dst;
+ uint16_t mask;
+ for(dst=0x0, mask=0x1; dst<0x10; dst++, mask=mask<<1)
+ {
+ if(handle->mask[src] & mask) // is this output channel active?
+ {
+ LV2_Atom midiatom;
+ midiatom.type = handle->uris.midi_MidiEvent;
+ midiatom.size = len;
+ const uint8_t m = (buf[0] & 0xf0) | dst; // rewrite channel number
+
+ lv2_atom_forge_frame_time(forge, frames);
+ lv2_atom_forge_raw(forge, &midiatom, sizeof(LV2_Atom));
+ lv2_atom_forge_raw(forge, &m, 1);
+ lv2_atom_forge_raw(forge, &buf[1], len-1);
+ lv2_atom_forge_pad(forge, sizeof(LV2_Atom) + len);
+ }
+ }
+ }
+ }
+ }
+
+ lv2_atom_forge_pop(forge, &handle->frame);
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ Handle *handle = (Handle *)instance;
+
+ free(handle);
+}
+
+static const void*
+extension_data(const char* uri __attribute__((unused)))
+{
+ //nothing
+ return NULL;
+}
+
+const LV2_Descriptor channel_filter = {
+ .URI = MIDI_MATRIX_CHANNEL_FILTER_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/midi_matrix_channel_filter_nk.c b/midi_matrix_channel_filter_nk.c
new file mode 100644
index 0000000..ca8f79c
--- /dev/null
+++ b/midi_matrix_channel_filter_nk.c
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <time.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include <midi_matrix.h>
+
+#define NK_PUGL_IMPLEMENTATION
+#include "nk_pugl/nk_pugl.h"
+
+#define NK_PATCHER_IMPLEMENTATION
+#include <nk_patcher.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ LV2_URID_Map *map;
+ LV2_Atom_Forge forge;
+
+ LV2_URID ui_floatProtocol;
+
+ nk_pugl_window_t win;
+
+ LV2UI_Controller *controller;
+ LV2UI_Write_Function writer;
+
+ uint16_t mask [0x10];
+
+ nk_patcher_t patch;
+};
+
+static void
+_change(void *data, uintptr_t src_id, uintptr_t snk_id, bool state)
+{
+ plughandle_t *handle = data;
+
+ uint16_t *dst = &handle->mask[src_id];
+ const uint16_t bits = 1 << snk_id;
+
+ if(state)
+ *dst |= bits;
+ else
+ *dst &= ~bits;
+
+ const float val = *dst;
+ handle->writer(handle->controller, src_id, sizeof(float), 0, &val);
+
+ nk_patcher_connected_set(&handle->patch, src_id, snk_id, state, NK_PATCHER_TYPE_DIRECT);
+ nk_pugl_post_redisplay(&handle->win);
+}
+
+static void
+_clear(plughandle_t *handle)
+{
+ for(int src_id = 0; src_id < 0x10; src_id++)
+ {
+ uint16_t *dst = &handle->mask[src_id];
+ *dst = 0x0; // clear
+
+ const float val = *dst;
+ handle->writer(handle->controller, src_id, sizeof(float), 0, &val);
+
+ for(int snk_id = 0; snk_id < 0x10; snk_id++)
+ {
+ const bool state = false;
+ nk_patcher_connected_set(&handle->patch, src_id, snk_id, state, NK_PATCHER_TYPE_DIRECT);
+ }
+ }
+
+ nk_pugl_post_redisplay(&handle->win);
+}
+
+static void
+_one_to_one(plughandle_t *handle)
+{
+ for(int src_id = 0; src_id < 0x10; src_id++)
+ {
+ uint16_t *dst = &handle->mask[src_id];
+ *dst = (1 << src_id); // 1:1
+
+ const float val = *dst;
+ handle->writer(handle->controller, src_id, sizeof(float), 0, &val);
+
+ for(int snk_id = 0; snk_id < 0x10; snk_id++)
+ {
+ const bool state = (snk_id == src_id);
+ nk_patcher_connected_set(&handle->patch, src_id, snk_id, state, NK_PATCHER_TYPE_DIRECT);
+ }
+ }
+
+ nk_pugl_post_redisplay(&handle->win);
+}
+
+static void
+_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
+{
+ plughandle_t *handle = data;
+
+ const float dy = 20.f * nk_pugl_get_scale(&handle->win);
+ struct nk_style *style = &ctx->style;
+ const struct nk_vec2 window_padding = nk_panel_get_padding(style, NK_PANEL_WINDOW);
+
+ const char *window_name = "ChannelFilter";
+ if(nk_begin(ctx, window_name, wbounds, NK_WINDOW_NO_SCROLLBAR))
+ {
+ struct nk_panel *center = nk_window_get_panel(ctx);
+
+ const float widget_h = center->bounds.h - 3*window_padding.y - dy;
+ nk_layout_row_dynamic(ctx, widget_h, 1);
+ nk_patcher_render(&handle->patch, ctx, wbounds, _change, handle);
+
+ nk_layout_row_dynamic(ctx, dy, 3);
+ if(nk_button_label(ctx, "clear"))
+ _clear(handle);
+ if(nk_button_label(ctx, "1:1"))
+ _one_to_one(handle);
+ nk_label(ctx, "MidiMatrix.lv2: "MIDI_MATRIX_VERSION, NK_TEXT_RIGHT);
+ }
+ nk_end(ctx);
+}
+
+static LV2UI_Handle
+instantiate(const LV2UI_Descriptor *descriptor,
+ const char *plugin_uri __attribute__((unused)), const char *bundle_path,
+ LV2UI_Write_Function write_function, LV2UI_Controller controller,
+ LV2UI_Widget *widget, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ void *parent = NULL;
+ LV2UI_Resize *host_resize = NULL;
+ for(int i=0; features[i]; i++)
+ {
+ if(!strcmp(features[i]->URI, LV2_UI__parent))
+ parent = features[i]->data;
+ else if(!strcmp(features[i]->URI, LV2_UI__resize))
+ host_resize = features[i]->data;
+ else if(!strcmp(features[i]->URI, LV2_URID__map))
+ handle->map = features[i]->data;
+ }
+
+ if(!parent)
+ {
+ fprintf(stderr,
+ "%s: Host does not support ui:parent\n", descriptor->URI);
+ free(handle);
+ return NULL;
+ }
+ if(!handle->map)
+ {
+ fprintf(stderr,
+ "%s: Host does not support urid:map\n", descriptor->URI);
+ free(handle);
+ return NULL;
+ }
+
+ lv2_atom_forge_init(&handle->forge, handle->map);
+
+ handle->ui_floatProtocol = handle->map->map(handle->map->handle, LV2_UI_PREFIX"floatProtocol");
+
+ handle->controller = controller;
+ handle->writer = write_function;
+
+ nk_pugl_config_t *cfg = &handle->win.cfg;
+ cfg->width = 640;
+ cfg->height = 640;
+ cfg->resizable = true;
+ cfg->fixed_aspect = true;
+ cfg->ignore = false;
+ cfg->class = "channel_filter";
+ cfg->title = "Channel Filter";
+ cfg->parent = (intptr_t)parent;
+ cfg->host_resize = host_resize;
+ cfg->data = handle;
+ cfg->expose = _expose;
+
+ if(asprintf(&cfg->font.face, "%sCousine-Regular.ttf", bundle_path) == -1)
+ cfg->font.face= NULL;
+ cfg->font.size = 13;
+
+ *(intptr_t *)widget = nk_pugl_init(&handle->win);
+ nk_pugl_show(&handle->win);
+
+ nk_patcher_init(&handle->patch, 0.8f);
+ nk_patcher_reinit(&handle->patch, 0x10, 0x10);
+
+ for(int i = 0; i < 0x10; i++)
+ {
+ nk_patcher_src_id_set(&handle->patch, i, i);
+ nk_patcher_snk_id_set(&handle->patch, i, i);
+
+ char tmp [32];
+ snprintf(tmp, 32, "IN-%02i", i + 1);
+ nk_patcher_src_label_set(&handle->patch, i, tmp);
+ snprintf(tmp, 32, "OUT-%02i", i + 1);
+ nk_patcher_snk_label_set(&handle->patch, i, tmp);
+
+ nk_patcher_src_color_set(&handle->patch, i, nk_rgb(0xbb, 0x00, 0x00));
+ nk_patcher_snk_color_set(&handle->patch, i, nk_rgb(0xbb, 0x00, 0x00));
+ }
+
+ return handle;
+}
+
+static void
+cleanup(LV2UI_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ nk_patcher_deinit(&handle->patch);
+
+ if(handle->win.cfg.font.face)
+ free(handle->win.cfg.font.face);
+ nk_pugl_hide(&handle->win);
+ nk_pugl_shutdown(&handle->win);
+
+ free(handle);
+}
+
+static void
+port_event(LV2UI_Handle instance, uint32_t index, uint32_t size __attribute__((unused)),
+ uint32_t protocol, const void *buf)
+{
+ plughandle_t *handle = instance;
+
+ if( (protocol == 0) || (protocol == handle->ui_floatProtocol) )
+ {
+ if(index < 0x10)
+ {
+ uint16_t *dst = &handle->mask[index];
+ *dst = *(const float *)buf;
+
+ for(int snk_id = 0; snk_id < 0x10; snk_id++)
+ {
+ const uint16_t bits = 1 << snk_id;
+ const bool sel = (*dst & bits) == bits;
+
+ nk_patcher_connected_set(&handle->patch, index, snk_id, sel, NK_PATCHER_TYPE_DIRECT);
+ }
+
+ nk_pugl_post_redisplay(&handle->win);
+ }
+ }
+}
+
+static int
+_idle(LV2UI_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ return nk_pugl_process_events(&handle->win);
+}
+
+static const LV2UI_Idle_Interface idle_ext = {
+ .idle = _idle
+};
+
+static int
+_resize(LV2UI_Handle instance, int width, int height)
+{
+ plughandle_t *handle = instance;
+
+ return nk_pugl_resize(&handle->win, width, height);
+}
+
+static const LV2UI_Resize resize_ext = {
+ .ui_resize = _resize
+};
+
+static const void *
+extension_data(const char *uri)
+{
+ if(!strcmp(uri, LV2_UI__idleInterface))
+ return &idle_ext;
+ else if(!strcmp(uri, LV2_UI__resize))
+ return &resize_ext;
+
+ return NULL;
+}
+
+const LV2UI_Descriptor channel_filter_nk = {
+ .URI = MIDI_MATRIX_CHANNEL_FILTER_NK_URI,
+ .instantiate = instantiate,
+ .cleanup = cleanup,
+ .port_event = port_event,
+ .extension_data = extension_data
+};
diff --git a/midi_matrix_nk.c b/midi_matrix_nk.c
new file mode 100644
index 0000000..7237f69
--- /dev/null
+++ b/midi_matrix_nk.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <midi_matrix.h>
+
+LV2_SYMBOL_EXPORT const LV2UI_Descriptor*
+lv2ui_descriptor(uint32_t index)
+{
+ switch(index)
+ {
+ case 0:
+ return &channel_filter_nk;
+
+ default:
+ return NULL;
+ }
+}
diff --git a/midi_matrix_ui.ttl b/midi_matrix_ui.ttl
new file mode 100644
index 0000000..158244e
--- /dev/null
+++ b/midi_matrix_ui.ttl
@@ -0,0 +1,27 @@
+# Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+#
+# This is free software: you can redistribute it and/or modify
+# it under the terms of the Artistic License 2.0 as published by
+# The Perl Foundation.
+#
+# This source is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Artistic License 2.0 for more details.
+#
+# You should have received a copy of the Artistic License 2.0
+# along the source as a COPYING file. If not, obtain it from
+# http://www.perlfoundation.org/artistic_license_2_0.
+
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
+@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
+@prefix kx: <http://kxstudio.sf.net/ns/lv2ext/external-ui#> .
+
+@prefix midi_matrix: <http://open-music-kontrollers.ch/lv2/midi_matrix#> .
+
+# Channel Filter UI
+midi_matrix:channel_filter_4_nk
+ lv2:requiredFeature ui:idleInterface, urid:map ;
+ lv2:optionalFeature ui:resize ;
+ lv2:extensionData ui:idleInterface, ui:resize .
diff --git a/nk_patcher.h b/nk_patcher.h
new file mode 100644
index 0000000..652e12f
--- /dev/null
+++ b/nk_patcher.h
@@ -0,0 +1,774 @@
+ /*
+ * Copyright (c) 2015-2020 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This src is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the iapplied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the src as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#ifndef _NK_PATCHER_H
+#define _NK_PATCHER_H
+
+typedef enum _nk_patcher_type_t {
+ NK_PATCHER_TYPE_DIRECT,
+ NK_PATCHER_TYPE_FEEDBACK,
+ NK_PATCHER_TYPE_INDIRECT
+} nk_patcher_type_t;
+
+typedef struct _nk_patcher_port_t nk_patcher_port_t;
+typedef struct _nk_patcher_connection_t nk_patcher_connection_t;
+typedef struct _nk_patcher_t nk_patcher_t;
+typedef void (*nk_patcher_fill_t)(void *data, uintptr_t src_id, uintptr_t snk_id,
+ bool *state, nk_patcher_type_t *type);
+typedef void (nk_patcher_change_t)(void *data, uintptr_t src_id, uintptr_t snk_id,
+ bool state);
+
+struct _nk_patcher_port_t {
+ int idx;
+ uintptr_t id;
+ struct nk_color color;
+ char *label;
+};
+
+struct _nk_patcher_connection_t {
+ bool state;
+ nk_patcher_type_t type;
+ int enm;
+ bool drawing;
+};
+
+struct _nk_patcher_t {
+ int src_n;
+ int snk_n;
+ float scale;
+
+ nk_patcher_port_t *srcs;
+ nk_patcher_port_t *snks;
+
+ nk_patcher_connection_t **connections;
+
+ // cached 'constants'
+ float X, Y;
+ float W, H;
+ float W2, H2;
+ float span, span1, span2;
+ float x0, y0;
+
+ bool drawing_state;
+};
+
+enum {
+ CONNECTED = (1 << 0),
+ VERTICAL = (1 << 1),
+ HORIZONTAL = (1 << 2),
+ VERTICAL_EDGE = (1 << 3),
+ HORIZONTAL_EDGE = (1 << 4),
+ FEEDBACK = (1 << 5),
+ INDIRECT = (1 << 6)
+};
+
+static void
+nk_patcher_init(nk_patcher_t *patch, float scale);
+
+static void
+nk_patcher_reinit(nk_patcher_t *patch, int src_n, int snk_n);
+
+static void
+nk_patcher_deinit(nk_patcher_t *patch);
+
+static int
+nk_patcher_connected_set(nk_patcher_t *patch, uintptr_t src_id, intptr_t snk_id,
+ bool state, nk_patcher_type_t type);
+
+static int
+nk_patcher_src_id_set(nk_patcher_t *patch, int src_idx, uintptr_t src_id);
+
+static int
+nk_patcher_snk_id_set(nk_patcher_t *patch, int snk_idx, uintptr_t snk_id);
+
+static int
+nk_patcher_src_color_set(nk_patcher_t *patch, int src_idx, struct nk_color src_color);
+
+static int
+nk_patcher_snk_color_set(nk_patcher_t *patch, int snk_idx, struct nk_color snk_color);
+
+static int
+nk_patcher_src_label_set(nk_patcher_t *patch, int src_idx, const char *src_label);
+
+static int
+nk_patcher_snk_label_set(nk_patcher_t *patch, int snk_idx, const char *snk_label);
+
+static void
+nk_patcher_render(nk_patcher_t *patch, struct nk_context *ctx, struct nk_rect bounds,
+ nk_patcher_change_t *change, void *data);
+
+#endif // _NK_PATCHER_H
+
+#ifdef NK_PATCHER_IMPLEMENTATION
+static const struct nk_color bright = {.r = 0xee, .g = 0xee, .b = 0xee, .a = 0xff};
+
+static void
+nk_patcher_init(nk_patcher_t *patch, float scale)
+{
+ nk_patcher_reinit(patch, 0, 0);
+
+ patch->scale = scale;
+}
+
+static void
+nk_patcher_reinit(nk_patcher_t *patch, int src_n, int snk_n)
+{
+ nk_patcher_deinit(patch);
+
+ patch->src_n = src_n;
+ patch->snk_n = snk_n;
+
+ patch->srcs = patch->src_n ? calloc(patch->src_n, sizeof(nk_patcher_port_t)) : NULL;
+ patch->snks = patch->snk_n ? calloc(patch->snk_n, sizeof(nk_patcher_port_t)) : NULL;
+
+ patch->connections = patch->src_n ? calloc(patch->src_n, sizeof(nk_patcher_connection_t *)) : NULL;
+ for(int src_idx=0; src_idx<patch->src_n; src_idx++)
+ {
+ patch->connections[src_idx] = snk_n ? calloc(patch->snk_n, sizeof(nk_patcher_connection_t)) : NULL;
+ }
+}
+
+static void
+nk_patcher_deinit(nk_patcher_t *patch)
+{
+ if(patch->connections)
+ {
+ for(int src_idx=0; src_idx<patch->src_n; src_idx++)
+ {
+ if(patch->connections[src_idx])
+ free(patch->connections[src_idx]);
+ }
+ free(patch->connections);
+ }
+
+ if(patch->srcs)
+ {
+ for(int src_idx=0; src_idx<patch->src_n; src_idx++)
+ {
+ nk_patcher_port_t *port = &patch->srcs[src_idx];
+
+ if(port->label)
+ free(port->label);
+ }
+ free(patch->srcs);
+ }
+
+ if(patch->snks)
+ {
+ for(int snk_idx=0; snk_idx<patch->snk_n; snk_idx++)
+ {
+ nk_patcher_port_t *port = &patch->snks[snk_idx];
+
+ if(port->label)
+ free(port->label);
+ }
+ free(patch->snks);
+ }
+
+ patch->src_n = 0;
+ patch->snk_n = 0;
+}
+
+static inline int
+_nk_patcher_src_idx_get(nk_patcher_t *patch, uintptr_t src_id)
+{
+ for(int src_idx=0; src_idx<patch->src_n; src_idx++)
+ {
+ if(patch->srcs[src_idx].id == src_id)
+ return src_idx;
+ }
+
+ return -1; // not found
+}
+
+static inline int
+_nk_patcher_snk_idx_get(nk_patcher_t *patch, uintptr_t snk_id)
+{
+ for(int snk_idx=0; snk_idx<patch->snk_n; snk_idx++)
+ {
+ if(patch->snks[snk_idx].id == snk_id)
+ return snk_idx;
+ }
+
+ return -1; // not found
+}
+
+static int
+nk_patcher_connected_set(nk_patcher_t *patch, uintptr_t src_id, intptr_t snk_id,
+ bool state, nk_patcher_type_t type)
+{
+ const int src_idx = _nk_patcher_src_idx_get(patch, src_id);
+ const int snk_idx = _nk_patcher_snk_idx_get(patch, snk_id);
+
+ if( (src_idx == -1) || (snk_idx == -1) )
+ return -1;
+
+ nk_patcher_connection_t *conn = &patch->connections[src_idx][snk_idx];
+ conn->state = state;
+ conn->type = type;
+
+ return 0;
+}
+
+static int
+nk_patcher_src_id_set(nk_patcher_t *patch, int src_idx, uintptr_t src_id)
+{
+ if( (src_idx < 0) || (src_idx >= patch->src_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->srcs[src_idx];
+ port->id = src_id;
+
+ return 0;
+}
+
+static int
+nk_patcher_snk_id_set(nk_patcher_t *patch, int snk_idx, uintptr_t snk_id)
+{
+ if( (snk_idx < 0) || (snk_idx >= patch->snk_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->snks[snk_idx];
+ port->id = snk_id;
+
+ return 0;
+}
+
+static int
+nk_patcher_src_color_set(nk_patcher_t *patch, int src_idx, struct nk_color src_color)
+{
+ if( (src_idx < 0) || (src_idx >= patch->src_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->srcs[src_idx];
+ port->color = src_color;
+
+ return 0;
+}
+
+static int
+nk_patcher_snk_color_set(nk_patcher_t *patch, int snk_idx, struct nk_color snk_color)
+{
+ if( (snk_idx < 0) || (snk_idx >= patch->snk_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->snks[snk_idx];
+ port->color = snk_color;
+
+ return 0;
+}
+
+static int
+nk_patcher_src_label_set(nk_patcher_t *patch, int src_idx, const char *src_label)
+{
+ if( (src_idx < 0) || (src_idx >= patch->src_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->srcs[src_idx];
+ if(port->label)
+ free(port->label);
+ port->label = strdup(src_label);
+
+ return 0;
+}
+
+static int
+nk_patcher_snk_label_set(nk_patcher_t *patch, int snk_idx, const char *snk_label)
+{
+ if( (snk_idx < 0) || (snk_idx >= patch->snk_n) )
+ return -1;
+
+ nk_patcher_port_t *port = &patch->snks[snk_idx];
+ if(port->label)
+ free(port->label);
+ port->label = strdup(snk_label);
+
+ return 0;
+}
+
+static inline void
+_rel_to_abs(nk_patcher_t *patch, float ax, float ay, float *_fx, float *_fy)
+{
+ ay = patch->snk_n - ay;
+ float fx = patch->x0 + patch->span * ( ax + ay);
+ float fy = patch->y0 + patch->span * (-ax + ay);
+
+ fx = fx*patch->W2 + patch->X + patch->W2;
+ fy = -fy*patch->H2 + patch->Y + patch->H2;
+
+ *_fx = fx;
+ *_fy = fy;
+}
+
+static inline void
+_abs_to_rel(nk_patcher_t *patch, float fx, float fy, int *_ax, int *_ay)
+{
+ fx = (fx - patch->X - patch->W2) / patch->W2;
+ fy = -(fy - patch->Y - patch->H2) / patch->H2;
+
+ float ax = floor( (-patch->x0 + fx + patch->y0 - fy) * patch->span2);
+ float ay = floor( (-patch->x0 + fx - patch->y0 + fy) * patch->span2);
+ ay = patch->snk_n - 1 - ay;
+
+ if( (ax >= 0) && (ax < patch->src_n) && (ay >= 0) && (ay < patch->snk_n) )
+ {
+ // inside-bounds
+ }
+ else if(ax >= patch->src_n)
+ {
+ ax = -1; // out-of-bounds
+
+ ay = floor( (-patch->y0 - fy) * patch->span1);
+ if( (ay < 0) || (ay >= patch->snk_n) )
+ ay = -1; // out-of-bounds
+ }
+ else if(ay >= patch->snk_n)
+ {
+ ax = floor( (patch->y0 - fy) * patch->span1);
+ if( (ax < 0) || (ax >= patch->src_n) )
+ ax = -1; // out-of-bounds
+
+ ay = -1; // out-of-bounds
+ }
+ else
+ {
+ ax = -1; // out-of-bounds
+ ay = -1; // out-of-bounds
+ }
+
+ *_ax = ax;
+ *_ay = ay;
+}
+
+static void
+_precalc(nk_patcher_t *patch, struct nk_rect bounds)
+{
+ if(patch->src_n > patch->snk_n)
+ {
+ patch->span = 1.f*patch->scale / patch->src_n;
+ const float offset = patch->span * (patch->src_n - patch->snk_n) * 0.5;
+ patch->x0 = -1.f*patch->scale + offset;
+ patch->y0 = 0.f*patch->scale + offset;
+ }
+ else if(patch->snk_n > patch->src_n)
+ {
+ patch->span = 1.f*patch->scale / patch->snk_n;
+ const float offset = patch->span * (patch->snk_n - patch->src_n) * 0.5;
+ patch->x0 = -1.f*patch->scale + offset;
+ patch->y0 = 0.f*patch->scale - offset;
+ }
+ else // patch->snk_n == patch->src_n
+ {
+ patch->span = 1.f*patch->scale / patch->src_n;
+ patch->x0 = -1.f*patch->scale;
+ patch->y0 = 0.f*patch->scale;
+ }
+
+ patch->span1 = 1.f / patch->span;
+ patch->span2 = 0.5 / patch->span;
+
+ patch->W = bounds.w > bounds.h ? bounds.w : bounds.h;
+ patch->H = bounds.h > bounds.w ? bounds.h : bounds.w;
+
+ patch->W2 = patch->W / 2.f;
+ patch->H2 = patch->H / 2.f;
+
+ patch->X = bounds.x - (patch->W - bounds.w) / 2;
+ patch->Y = bounds.y - (patch->H - bounds.h) / 2;
+}
+
+static void
+nk_patcher_render(nk_patcher_t *patch, struct nk_context *ctx, struct nk_rect bounds,
+ nk_patcher_change_t *change, void *data)
+{
+ if( patch->src_n && patch->snk_n
+ && (nk_widget(&bounds, ctx) != NK_WIDGET_INVALID) )
+ {
+ struct nk_style *style = &ctx->style;
+ struct nk_input *in = &ctx->input;
+ int src_ptr = -1; // initialize
+ int snk_ptr = -1; // initialize
+
+ _precalc(patch, bounds);
+
+ // handle mouse input
+ if(nk_input_is_mouse_hovering_rect(in, bounds))
+ {
+ if(in->mouse.scroll_delta.y)
+ {
+ patch->scale *= 1.0 + in->mouse.scroll_delta.y * 0.05;
+ patch->scale = NK_CLAMP(0.1, patch->scale, 0.8);
+ _precalc(patch, bounds);
+
+ in->mouse.scroll_delta.y = 0.f;
+ }
+
+ _abs_to_rel(patch, in->mouse.pos.x, in->mouse.pos.y, &src_ptr, &snk_ptr);
+
+ const bool drawing = nk_input_is_mouse_down(in, NK_BUTTON_LEFT);
+
+ // handle state toggling
+ if(change && nk_input_is_mouse_pressed(in, NK_BUTTON_LEFT))
+ {
+ if( (src_ptr != -1) && (snk_ptr != -1) )
+ {
+ nk_patcher_port_t *src_port = &patch->srcs[src_ptr];
+ nk_patcher_port_t *snk_port = &patch->snks[snk_ptr];
+ nk_patcher_connection_t *conn = &patch->connections[src_ptr][snk_ptr];
+
+ patch->drawing_state = !conn->state;
+ change(data, src_port->id, snk_port->id, patch->drawing_state);
+ conn->drawing = true;
+ }
+ else if(src_ptr != -1)
+ {
+ nk_patcher_port_t *src_port = &patch->srcs[src_ptr];
+ bool state = false;
+
+ for(int snk_idx = 0; snk_idx < patch->snk_n; snk_idx++)
+ {
+ nk_patcher_connection_t *conn = &patch->connections[src_ptr][snk_idx];
+
+ state = state || conn->state;
+ }
+ for(int snk_idx = 0; snk_idx < patch->snk_n; snk_idx++)
+ {
+ nk_patcher_port_t *snk_port = &patch->snks[snk_idx];
+
+ change(data, src_port->id, snk_port->id, !state);
+ }
+ }
+ else if(snk_ptr != -1)
+ {
+ nk_patcher_port_t *snk_port = &patch->snks[snk_ptr];
+ bool state = false;
+
+ for(int src_idx = 0; src_idx < patch->src_n; src_idx++)
+ {
+ nk_patcher_connection_t *conn = &patch->connections[src_idx][snk_ptr];
+
+ state = state || conn->state;
+ }
+ for(int src_idx = 0; src_idx < patch->src_n; src_idx++)
+ {
+ nk_patcher_port_t *src_port = &patch->srcs[src_idx];
+
+ change(data, src_port->id, snk_port->id, !state);
+ }
+ }
+ }
+ else if(change && drawing)
+ {
+ if( (src_ptr != -1) && (snk_ptr != -1) )
+ {
+ nk_patcher_port_t *src_port = &patch->srcs[src_ptr];
+ nk_patcher_port_t *snk_port = &patch->snks[snk_ptr];
+ nk_patcher_connection_t *conn = &patch->connections[src_ptr][snk_ptr];
+
+ if(!conn->drawing)
+ change(data, src_port->id, snk_port->id, patch->drawing_state);
+ conn->drawing = true;
+ }
+ }
+ }
+
+ // reset patch fields
+ for(int src_idx = 0; src_idx < patch->src_n; src_idx++)
+ {
+ for(int snk_idx = 0; snk_idx < patch->snk_n; snk_idx++)
+ {
+ nk_patcher_connection_t *conn = &patch->connections[src_idx][snk_idx];
+
+ if( (src_ptr != src_idx) || (snk_ptr != snk_idx) )
+ conn->drawing = false;
+
+ conn->enm = 0;
+ switch(conn->type)
+ {
+ case NK_PATCHER_TYPE_DIRECT:
+ break;
+ case NK_PATCHER_TYPE_FEEDBACK:
+ conn->enm |= FEEDBACK;
+ break;
+ case NK_PATCHER_TYPE_INDIRECT:
+ conn->enm |= INDIRECT;
+ break;
+ }
+ }
+ }
+
+ // fill patch fields
+ if( (src_ptr != -1) && (snk_ptr != -1) )
+ {
+ for(int src_idx = 0; src_idx < patch->src_n; src_idx++)
+ {
+ for(int snk_idx = 0; snk_idx < patch->snk_n; snk_idx++)
+ {
+ nk_patcher_connection_t *conn = &patch->connections[src_idx][snk_idx];
+
+ if( (snk_idx == snk_ptr) && (src_idx > src_ptr) )
+ conn->enm |= HORIZONTAL;
+ if( (snk_idx == snk_ptr) && (src_idx == src_ptr) )
+ conn->enm |= HORIZONTAL_EDGE | VERTICAL_EDGE;
+ if( (snk_idx > snk_ptr) && (src_idx == src_ptr) )
+ conn->enm |= VERTICAL;
+ }
+ }
+ }
+ else if(src_ptr != -1)
+ {
+ int thresh = patch->snk_n;
+ for(int snk_idx = thresh-1; snk_idx >= 0; snk_idx--)
+ {
+ if(patch->connections[src_ptr][snk_idx].state)
+ {
+ thresh = snk_idx;
+
+ patch->connections[src_ptr][snk_idx].enm |= HORIZONTAL_EDGE;
+ for(int src_idx = src_ptr+1; src_idx < patch->src_n; src_idx++)
+ patch->connections[src_idx][snk_idx].enm |= HORIZONTAL;
+ }
+ }
+
+ for(int snk_idx = thresh; snk_idx < patch->snk_n; snk_idx++)
+ patch->connections[src_ptr][snk_idx].enm |= snk_idx == thresh ? VERTICAL_EDGE : VERTICAL;
+ }
+ else if(snk_ptr != -1)
+ {
+ int thresh = patch->src_n;
+ for(int src_idx = thresh-1; src_idx >= 0; src_idx--)
+ {
+ if(patch->connections[src_idx][snk_ptr].state)
+ {
+ thresh = src_idx;
+
+ patch->connections[src_idx][snk_ptr].enm |= VERTICAL_EDGE;
+ for(int snk_idx = snk_ptr+1; snk_idx < patch->snk_n; snk_idx++)
+ patch->connections[src_idx][snk_idx].enm |= VERTICAL;
+ }
+ }
+
+ for(int src_idx = thresh; src_idx < patch->src_n; src_idx++)
+ patch->connections[src_idx][snk_ptr].enm |= src_idx == thresh ? HORIZONTAL_EDGE : HORIZONTAL;
+ }
+
+ struct nk_command_buffer *canvas = nk_window_get_canvas(ctx);
+
+ // draw patch fields
+ for(int src_idx = 0; src_idx < patch->src_n; src_idx++)
+ {
+ for(int snk_idx = 0; snk_idx < patch->snk_n; snk_idx++)
+ {
+ nk_patcher_connection_t *conn = &patch->connections[src_idx][snk_idx];
+ float p [8];
+
+ // FEEDBACK | INDIRECT | DIRECT
+ _rel_to_abs(patch, src_idx + 0.0, snk_idx + 0.0, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.0, snk_idx + 1.0, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 1.0, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 0.0, &p[0], &p[1]);
+ if(conn->enm & FEEDBACK)
+ nk_fill_polygon(canvas, p, 4, style->button.hover.data.color);
+ else if(conn->enm & INDIRECT)
+ nk_fill_polygon(canvas, p, 4, style->button.active.data.color);
+ else
+ nk_fill_polygon(canvas, p, 4, style->button.normal.data.color);
+
+ // HORIZONTAL
+ if(conn->enm & HORIZONTAL)
+ {
+ _rel_to_abs(patch, src_idx + 0.0, snk_idx + 0.4, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.0, snk_idx + 0.6, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 0.6, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 0.4, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, patch->snks[snk_idx].color);
+ }
+
+ // HORIZONTAL_EDGE
+ if(conn->enm & HORIZONTAL_EDGE)
+ {
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 0.4, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 0.6, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 0.6, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 1.0, snk_idx + 0.4, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, patch->snks[snk_idx].color);
+ }
+
+ // VERTICAL
+ if(conn->enm & VERTICAL)
+ {
+ _rel_to_abs(patch, src_idx + 0.4, snk_idx + 0.0, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.4, snk_idx + 1.0, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 1.0, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 0.0, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, patch->srcs[src_idx].color);
+ }
+
+ // VERTICAL_EDGE
+ if(conn->enm & VERTICAL_EDGE)
+ {
+ _rel_to_abs(patch, src_idx + 0.4, snk_idx + 0.6, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.4, snk_idx + 1.0, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 1.0, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 0.6, snk_idx + 0.6, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, patch->srcs[src_idx].color);
+ }
+
+ // CONNECTED
+ if(conn->state)
+ {
+ _rel_to_abs(patch, src_idx + 0.2, snk_idx + 0.2, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.2, snk_idx + 0.8, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 0.8, snk_idx + 0.8, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 0.8, snk_idx + 0.2, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, bright);
+ }
+ // EDGE
+ else if(conn->enm & (VERTICAL_EDGE | HORIZONTAL_EDGE) )
+ {
+ _rel_to_abs(patch, src_idx + 0.38, snk_idx + 0.38, &p[6], &p[7]);
+ _rel_to_abs(patch, src_idx + 0.38, snk_idx + 0.62, &p[4], &p[5]);
+ _rel_to_abs(patch, src_idx + 0.62, snk_idx + 0.62, &p[2], &p[3]);
+ _rel_to_abs(patch, src_idx + 0.62, snk_idx + 0.38, &p[0], &p[1]);
+
+ nk_fill_polygon(canvas, p, 4, style->text.color);
+ }
+ }
+ }
+
+ // draw HORIZONTAL_LINES
+ float yl, xl;
+ for(int src_idx = 0; src_idx <= patch->src_n; src_idx++)
+ {
+ const int snk_idx = patch->snk_n;
+
+ float p [6];
+ _rel_to_abs(patch, src_idx, 0, &p[0], &p[1]);
+ _rel_to_abs(patch, src_idx, snk_idx, &p[2], &p[3]);
+ p[4] = bounds.x; //-1.f;
+ p[5] = p[3];
+
+ float q [6];
+ _rel_to_abs(patch, src_idx - 0.2, snk_idx, &q[0], &q[1]);
+ _rel_to_abs(patch, src_idx - 0.8, snk_idx, &q[2], &q[3]);
+ q[4] = q[2];
+ q[5] = q[1];
+
+ if(src_idx > 0)
+ {
+ const int c = src_idx - 1;
+ const bool active = (src_ptr == c)
+ || ( (src_ptr == -1) && (snk_ptr != -1) && patch->connections[c][snk_ptr].state );
+
+ nk_patcher_port_t *src_port = &patch->srcs[c];
+ struct nk_rect label = nk_rect(p[4], yl, xl-p[4], p[3]-yl);
+ const char *name = src_port->label;
+ const size_t len = name ? nk_strlen(name) : 0;
+ const struct nk_text text = {
+ .padding.x = 2,
+ .padding.y = 0,
+ .background = style->window.background,
+ .text = active ? src_port->color : style->text.color
+ };
+
+ if(active)
+ nk_fill_rect(canvas, label, 0.f, style->button.active.data.color);
+ nk_fill_polygon(canvas, q, 3, src_port->color);
+
+ const struct nk_rect old_clip = canvas->clip;
+ nk_push_scissor(canvas, label);
+ nk_widget_text(canvas, label, name, len, &text,
+ NK_TEXT_ALIGN_RIGHT | NK_TEXT_ALIGN_MIDDLE, style->font);
+ nk_push_scissor(canvas, old_clip);
+ }
+
+ nk_stroke_polyline(canvas, p, 3, 2.f, style->window.border_color);
+ xl = p[2];
+ yl = p[3];
+ }
+
+ // draw VERTICAL_LINES
+ for(int snk_idx = 0; snk_idx <= patch->snk_n; snk_idx++)
+ {
+ const int src_idx = patch->src_n;
+
+ float p [6];
+ _rel_to_abs(patch, 0, snk_idx, &p[0], &p[1]);
+ _rel_to_abs(patch, src_idx, snk_idx, &p[2], &p[3]);
+ p[4] = bounds.x + bounds.w; //1.f;
+ p[5] = p[3];
+
+ float q[6];
+ _rel_to_abs(patch, src_idx, snk_idx - 0.2, &q[0], &q[1]);
+ _rel_to_abs(patch, src_idx, snk_idx - 0.8, &q[2], &q[3]);
+ q[4] = q[2];
+ q[5] = q[1];
+
+ if(snk_idx > 0)
+ {
+ const int r = snk_idx - 1;
+ const bool active = (snk_ptr == r)
+ || ( (src_ptr != -1) && (snk_ptr == -1) && patch->connections[src_ptr][r].state );
+
+ nk_patcher_port_t *snk_port = &patch->snks[r];
+ struct nk_rect label = nk_rect(xl, yl, p[4]-xl, p[3]-yl);
+ const char *name = snk_port->label;
+ const size_t len = name ? nk_strlen(name) : 0;
+ const struct nk_text text = {
+ .padding.x = 2,
+ .padding.y = 0,
+ .background = style->window.background,
+ .text = active ? snk_port->color : style->text.color
+ };
+
+ if(active)
+ nk_fill_rect(canvas, label, 0.f, style->button.active.data.color);
+ nk_fill_polygon(canvas, q, 3, snk_port->color);
+
+ const struct nk_rect old_clip = canvas->clip;
+ nk_push_scissor(canvas, label);
+ nk_widget_text(canvas, label, name, len, &text,
+ NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE, style->font);
+ nk_push_scissor(canvas, old_clip);
+ }
+
+ nk_stroke_polyline(canvas, p, 3, 2.f, style->window.border_color);
+ xl = p[2];
+ yl = p[3];
+ }
+
+ // draw HOVER
+ if( (src_ptr != -1) && (snk_ptr != -1) )
+ {
+ float p [8];
+
+ _rel_to_abs(patch, src_ptr + 0, snk_ptr + 0, &p[0], &p[1]);
+ _rel_to_abs(patch, src_ptr + 0, snk_ptr + 1, &p[2], &p[3]);
+ _rel_to_abs(patch, src_ptr + 1, snk_ptr + 1, &p[4], &p[5]);
+ _rel_to_abs(patch, src_ptr + 1, snk_ptr + 0, &p[6], &p[7]);
+
+ nk_stroke_polygon(canvas, p, 4, 2.f, bright);
+ }
+ }
+}
+
+#endif // NK_PATCHER_IMPLEMENTATION
diff --git a/screenshots/screenshot_1.png b/screenshots/screenshot_1.png
new file mode 100644
index 0000000..a787443
--- /dev/null
+++ b/screenshots/screenshot_1.png
Binary files differ
diff --git a/subprojects/nk_pugl/.gitlab-ci.yml b/subprojects/nk_pugl/.gitlab-ci.yml
new file mode 100644
index 0000000..e289a04
--- /dev/null
+++ b/subprojects/nk_pugl/.gitlab-ci.yml
@@ -0,0 +1,94 @@
+stages:
+ - build
+ - deploy
+
+.variables_template: &variables_definition
+ variables:
+ BASE_NAME: "nk_pugl"
+ PKG_CONFIG_PATH: "/opt/lv2/lib/pkgconfig:/opt/${CI_BUILD_NAME}/lib/pkgconfig:/usr/lib/${CI_BUILD_NAME}/pkgconfig"
+
+.common_template: &common_definition
+ <<: *variables_definition
+ stage: build
+ artifacts:
+ name: "${BASE_NAME}-$(cat VERSION)-${CI_BUILD_NAME}"
+ paths:
+ - "${BASE_NAME}-$(cat VERSION)/"
+
+.build_template: &build_definition
+ <<: *common_definition
+ script:
+ - meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" build
+ - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' build/build.ninja
+ - ninja -C build
+ - DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install
+
+.analyze_template: &analyze_definition
+ <<: *common_definition
+ script:
+ - meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" build
+ - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' build/build.ninja
+ - ninja -C build
+ - DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install
+
+ - CC=clang CXX=clang++ meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" clang
+ - ninja -C clang
+
+ - scan-build --status-bugs meson -Dbuild-examples=true --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" scanbuild
+ - scan-build --status-bugs ninja -C scanbuild
+
+.universal_linux_template: &universal_linux_definition
+ image: ventosus/universal-linux-gnu
+ <<: *analyze_definition
+
+.arm_linux_template: &arm_linux_definition
+ image: ventosus/arm-linux-gnueabihf
+ <<: *build_definition
+
+.universal_w64_template: &universal_w64_definition
+ image: ventosus/universal-w64-mingw32
+ <<: *build_definition
+
+.universal_apple_template: &universal_apple_definition
+ image: ventosus/universal-apple-darwin
+ <<: *build_definition
+
+# building in docker
+x86_64-linux-gnu:
+ before_script:
+ - apt-get install -y libglu1-mesa-dev libevdev-dev
+ <<: *universal_linux_definition
+
+i686-linux-gnu:
+ before_script:
+ - apt-get install -y libglu1-mesa-dev:i386 libevdev-dev:i386
+ <<: *universal_linux_definition
+
+arm-linux-gnueabihf:
+ before_script:
+ - apt-get install -y libglu1-mesa-dev:armhf libevdev-dev:armhf
+ <<: *arm_linux_definition
+
+aarch64-linux-gnu:
+ before_script:
+ - apt-get install -y libglu1-mesa-dev:arm64 libevdev-dev:arm64
+ <<: *arm_linux_definition
+
+x86_64-w64-mingw32:
+ <<: *universal_w64_definition
+
+i686-w64-mingw32:
+ <<: *universal_w64_definition
+
+universal-apple-darwin:
+ <<: *universal_apple_definition
+
+pack:
+ <<: *variables_definition
+ stage: deploy
+ script:
+ - echo 'packing up...'
+ artifacts:
+ name: "${BASE_NAME}-$(cat VERSION)"
+ paths:
+ - "${BASE_NAME}-$(cat VERSION)/"
diff --git a/subprojects/nk_pugl/COPYING b/subprojects/nk_pugl/COPYING
new file mode 100644
index 0000000..ddb9a46
--- /dev/null
+++ b/subprojects/nk_pugl/COPYING
@@ -0,0 +1,201 @@
+ The Artistic License 2.0
+
+ Copyright (c) 2000-2006, The Perl Foundation.
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package. If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+ "Copyright Holder" means the individual(s) or organization(s)
+ named in the copyright notice for the entire Package.
+
+ "Contributor" means any party that has contributed code or other
+ material to the Package, in accordance with the Copyright Holder's
+ procedures.
+
+ "You" and "your" means any person who would like to copy,
+ distribute, or modify the Package.
+
+ "Package" means the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection and/or of
+ those files. A given Package may consist of either the Standard
+ Version, or a Modified Version.
+
+ "Distribute" means providing a copy of the Package or making it
+ accessible to anyone else, or in the case of a company or
+ organization, to others outside of your company or organization.
+
+ "Distributor Fee" means any fee that you charge for Distributing
+ this Package or providing support for this Package to another
+ party. It does not mean licensing fees.
+
+ "Standard Version" refers to the Package if it has not been
+ modified, or has been modified only in ways explicitly requested
+ by the Copyright Holder.
+
+ "Modified Version" means the Package, if it has been changed, and
+ such changes were not explicitly requested by the Copyright
+ Holder.
+
+ "Original License" means this Artistic License as Distributed with
+ the Standard Version of the Package, in its current version or as
+ it may be modified by The Perl Foundation in the future.
+
+ "Source" form means the source code, documentation source, and
+ configuration files for the Package.
+
+ "Compiled" form means the compiled bytecode, object code, binary,
+ or any other form resulting from mechanical transformation or
+ translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1) You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2) You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers. At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3) You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder. The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4) You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+ (a) make the Modified Version available to the Copyright Holder
+ of the Standard Version, under the Original License, so that the
+ Copyright Holder may include your modifications in the Standard
+ Version.
+
+ (b) ensure that installation of your Modified Version does not
+ prevent the user installing or running the Standard Version. In
+ addition, the Modified Version must bear a name that is different
+ from the name of the Standard Version.
+
+ (c) allow anyone who receives a copy of the Modified Version to
+ make the Source form of the Modified Version available to others
+ under
+
+ (i) the Original License or
+
+ (ii) a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5) You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version. Such instructions must be
+valid at the time of your distribution. If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6) You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7) You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package. Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version. In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10) Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11) If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12) This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13) This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14) Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/subprojects/nk_pugl/VERSION b/subprojects/nk_pugl/VERSION
new file mode 100644
index 0000000..a0e8ec1
--- /dev/null
+++ b/subprojects/nk_pugl/VERSION
@@ -0,0 +1 @@
+0.1.145
diff --git a/example/example.c b/subprojects/nk_pugl/example/example.c
index 1c505da..1c505da 100644
--- a/example/example.c
+++ b/subprojects/nk_pugl/example/example.c
diff --git a/glew-2.1.0/GL/eglew.h b/subprojects/nk_pugl/glew-2.1.0/GL/eglew.h
index 4670147..4670147 100644
--- a/glew-2.1.0/GL/eglew.h
+++ b/subprojects/nk_pugl/glew-2.1.0/GL/eglew.h
diff --git a/glew-2.1.0/GL/glew.h b/subprojects/nk_pugl/glew-2.1.0/GL/glew.h
index b5b6987..b5b6987 100644
--- a/glew-2.1.0/GL/glew.h
+++ b/subprojects/nk_pugl/glew-2.1.0/GL/glew.h
diff --git a/glew-2.1.0/GL/glxew.h b/subprojects/nk_pugl/glew-2.1.0/GL/glxew.h
index 7e39c2f..7e39c2f 100644
--- a/glew-2.1.0/GL/glxew.h
+++ b/subprojects/nk_pugl/glew-2.1.0/GL/glxew.h
diff --git a/glew-2.1.0/GL/wglew.h b/subprojects/nk_pugl/glew-2.1.0/GL/wglew.h
index 2097c0f..2097c0f 100644
--- a/glew-2.1.0/GL/wglew.h
+++ b/subprojects/nk_pugl/glew-2.1.0/GL/wglew.h
diff --git a/glew-2.1.0/glew.c b/subprojects/nk_pugl/glew-2.1.0/glew.c
index 18a2853..18a2853 100644
--- a/glew-2.1.0/glew.c
+++ b/subprojects/nk_pugl/glew-2.1.0/glew.c
diff --git a/subprojects/nk_pugl/meson.build b/subprojects/nk_pugl/meson.build
new file mode 100644
index 0000000..65a0f74
--- /dev/null
+++ b/subprojects/nk_pugl/meson.build
@@ -0,0 +1,86 @@
+project('nk_pugl', 'c', default_options : [
+ 'buildtype=release',
+ 'warning_level=3',
+ 'werror=false',
+ 'b_lto=false',
+ 'c_std=gnu11'])
+
+build_examples = get_option('build-examples')
+
+static_link = false #meson.is_cross_build()
+
+cc = meson.get_compiler('c')
+
+m_dep = cc.find_library('m')
+lv2_dep = dependency('lv2',
+ version : '>=1.14.0')
+glew_dep = dependency('glew',
+ version : '>=2.1.0',
+ static : static_link,
+ required : false)
+if not glew_dep.found()
+ glew_dep = declare_dependency(
+ compile_args : '-DGLEW_STATIC',
+ include_directories : include_directories('glew-2.1.0'),
+ sources : join_paths('glew-2.1.0', 'glew.c'))
+endif
+
+deps = [m_dep, lv2_dep, glew_dep]
+links = []
+
+pugl_inc = include_directories('pugl')
+inc_dir = [pugl_inc]
+
+add_project_arguments('-D_GNU_SOURCE', language : 'c')
+
+bin_srcs = [
+ join_paths('example', 'example.c')
+]
+
+lib_srcs = [
+ join_paths('pugl', 'pugl', 'detail', 'implementation.c')
+]
+
+c_args = ['-fvisibility=hidden',
+ '-ffast-math']
+
+if host_machine.system() == 'windows'
+ deps += cc.find_library('opengl32')
+ deps += cc.find_library('gdi32')
+ deps += cc.find_library('ws2_32')
+ lib_srcs += 'pugl/pugl/detail/win.c'
+ lib_srcs += 'pugl/pugl/detail/win_gl.c'
+elif host_machine.system() == 'darwin'
+ add_languages('objc')
+ links += ['-framework', 'OpenGL']
+ links += ['-framework', 'Cocoa']
+ lib_srcs += 'pugl/pugl/detail/mac.m'
+ lib_srcs += 'pugl/pugl/detail/mac_gl.m'
+else
+ deps += dependency('gl')
+ deps += dependency('x11', version : '>=1.6.0')
+ deps += dependency('xext', version : '>=1.3.0')
+ lib_srcs += 'pugl/pugl/detail/x11.c'
+ lib_srcs += 'pugl/pugl/detail/x11_gl.c'
+endif
+
+nk_pugl_gl = declare_dependency(
+ include_directories : inc_dir,
+ dependencies : deps,
+ link_args : links,
+ sources : lib_srcs)
+
+cousine_regular_ttf = configure_file(
+ input : join_paths('nuklear', 'extra_font', 'Cousine-Regular.ttf'),
+ output : 'Cousine-Regular.ttf',
+ copy : true,
+ install : false)
+
+if build_examples
+
+ executable('nk_pugl.gl', [bin_srcs],
+ c_args : c_args,
+ include_directories : inc_dir,
+ dependencies: nk_pugl_gl,
+ install : false)
+endif
diff --git a/subprojects/nk_pugl/meson_options.txt b/subprojects/nk_pugl/meson_options.txt
new file mode 100644
index 0000000..0a4a2a9
--- /dev/null
+++ b/subprojects/nk_pugl/meson_options.txt
@@ -0,0 +1,4 @@
+option('build-examples',
+ type : 'boolean',
+ value : false,
+ yield : true)
diff --git a/nk_pugl/nk_pugl.h b/subprojects/nk_pugl/nk_pugl/nk_pugl.h
index 3b46933..3b46933 100644
--- a/nk_pugl/nk_pugl.h
+++ b/subprojects/nk_pugl/nk_pugl/nk_pugl.h
diff --git a/nuklear/.gitattributes b/subprojects/nk_pugl/nuklear/.gitattributes
index 5a5328c..5a5328c 100644
--- a/nuklear/.gitattributes
+++ b/subprojects/nk_pugl/nuklear/.gitattributes
diff --git a/nuklear/.gitignore b/subprojects/nk_pugl/nuklear/.gitignore
index 6b06b55..6b06b55 100644
--- a/nuklear/.gitignore
+++ b/subprojects/nk_pugl/nuklear/.gitignore
diff --git a/nuklear/.gitmodules b/subprojects/nk_pugl/nuklear/.gitmodules
index e69de29..e69de29 100644
--- a/nuklear/.gitmodules
+++ b/subprojects/nk_pugl/nuklear/.gitmodules
diff --git a/nuklear/.travis.yml b/subprojects/nk_pugl/nuklear/.travis.yml
index 80a5ad5..80a5ad5 100644
--- a/nuklear/.travis.yml
+++ b/subprojects/nk_pugl/nuklear/.travis.yml
diff --git a/nuklear/Readme.md b/subprojects/nk_pugl/nuklear/Readme.md
index d097e35..d097e35 100644
--- a/nuklear/Readme.md
+++ b/subprojects/nk_pugl/nuklear/Readme.md
diff --git a/nuklear/demo/allegro5/KeyboardHandleriOS.h b/subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.h
index 2664d2e..2664d2e 100644
--- a/nuklear/demo/allegro5/KeyboardHandleriOS.h
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.h
diff --git a/nuklear/demo/allegro5/KeyboardHandleriOS.m b/subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.m
index 206f9e4..206f9e4 100644
--- a/nuklear/demo/allegro5/KeyboardHandleriOS.m
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/KeyboardHandleriOS.m
diff --git a/nuklear/demo/allegro5/Makefile b/subprojects/nk_pugl/nuklear/demo/allegro5/Makefile
index 090a126..090a126 100644
--- a/nuklear/demo/allegro5/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/Makefile
diff --git a/nuklear/demo/allegro5/Readme.md b/subprojects/nk_pugl/nuklear/demo/allegro5/Readme.md
index 71a4840..71a4840 100644
--- a/nuklear/demo/allegro5/Readme.md
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/Readme.md
diff --git a/nuklear/demo/allegro5/main.c b/subprojects/nk_pugl/nuklear/demo/allegro5/main.c
index 624e7c9..624e7c9 100644
--- a/nuklear/demo/allegro5/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/main.c
diff --git a/nuklear/demo/allegro5/nuklear_allegro5.h b/subprojects/nk_pugl/nuklear/demo/allegro5/nuklear_allegro5.h
index f396600..f396600 100644
--- a/nuklear/demo/allegro5/nuklear_allegro5.h
+++ b/subprojects/nk_pugl/nuklear/demo/allegro5/nuklear_allegro5.h
diff --git a/nuklear/demo/calculator.c b/subprojects/nk_pugl/nuklear/demo/calculator.c
index b871301..b871301 100644
--- a/nuklear/demo/calculator.c
+++ b/subprojects/nk_pugl/nuklear/demo/calculator.c
diff --git a/nuklear/demo/d3d11/build.bat b/subprojects/nk_pugl/nuklear/demo/d3d11/build.bat
index 31bd0e0..31bd0e0 100644
--- a/nuklear/demo/d3d11/build.bat
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/build.bat
diff --git a/nuklear/demo/d3d11/main.c b/subprojects/nk_pugl/nuklear/demo/d3d11/main.c
index a7abf1d..a7abf1d 100644
--- a/nuklear/demo/d3d11/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/main.c
diff --git a/nuklear/demo/d3d11/nuklear_d3d11.h b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.h
index 7097d98..7097d98 100644
--- a/nuklear/demo/d3d11/nuklear_d3d11.h
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.h
diff --git a/nuklear/demo/d3d11/nuklear_d3d11.hlsl b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.hlsl
index a932dca..a932dca 100644
--- a/nuklear/demo/d3d11/nuklear_d3d11.hlsl
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11.hlsl
diff --git a/nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h
index 1447559..1447559 100644
--- a/nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_pixel_shader.h
diff --git a/nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h
index 770d2dd..770d2dd 100644
--- a/nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h
+++ b/subprojects/nk_pugl/nuklear/demo/d3d11/nuklear_d3d11_vertex_shader.h
diff --git a/nuklear/demo/d3d9/build.bat b/subprojects/nk_pugl/nuklear/demo/d3d9/build.bat
index 726b6f6..726b6f6 100644
--- a/nuklear/demo/d3d9/build.bat
+++ b/subprojects/nk_pugl/nuklear/demo/d3d9/build.bat
diff --git a/nuklear/demo/d3d9/main.c b/subprojects/nk_pugl/nuklear/demo/d3d9/main.c
index b329e2b..b329e2b 100644
--- a/nuklear/demo/d3d9/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/d3d9/main.c
diff --git a/nuklear/demo/d3d9/nuklear_d3d9.h b/subprojects/nk_pugl/nuklear/demo/d3d9/nuklear_d3d9.h
index fd8d176..fd8d176 100644
--- a/nuklear/demo/d3d9/nuklear_d3d9.h
+++ b/subprojects/nk_pugl/nuklear/demo/d3d9/nuklear_d3d9.h
diff --git a/nuklear/demo/gdi/build.bat b/subprojects/nk_pugl/nuklear/demo/gdi/build.bat
index 3884317..3884317 100644
--- a/nuklear/demo/gdi/build.bat
+++ b/subprojects/nk_pugl/nuklear/demo/gdi/build.bat
diff --git a/nuklear/demo/gdi/main.c b/subprojects/nk_pugl/nuklear/demo/gdi/main.c
index 1755b9c..1755b9c 100644
--- a/nuklear/demo/gdi/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/gdi/main.c
diff --git a/nuklear/demo/gdi/nuklear_gdi.h b/subprojects/nk_pugl/nuklear/demo/gdi/nuklear_gdi.h
index c875de1..c875de1 100644
--- a/nuklear/demo/gdi/nuklear_gdi.h
+++ b/subprojects/nk_pugl/nuklear/demo/gdi/nuklear_gdi.h
diff --git a/nuklear/demo/gdip/build.bat b/subprojects/nk_pugl/nuklear/demo/gdip/build.bat
index 0f24655..0f24655 100644
--- a/nuklear/demo/gdip/build.bat
+++ b/subprojects/nk_pugl/nuklear/demo/gdip/build.bat
diff --git a/nuklear/demo/gdip/main.c b/subprojects/nk_pugl/nuklear/demo/gdip/main.c
index a90a0cf..a90a0cf 100644
--- a/nuklear/demo/gdip/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/gdip/main.c
diff --git a/nuklear/demo/gdip/nuklear_gdip.h b/subprojects/nk_pugl/nuklear/demo/gdip/nuklear_gdip.h
index 8a6c8d4..8a6c8d4 100644
--- a/nuklear/demo/gdip/nuklear_gdip.h
+++ b/subprojects/nk_pugl/nuklear/demo/gdip/nuklear_gdip.h
diff --git a/nuklear/demo/glfw_opengl2/Makefile b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/Makefile
index c08d65f..c08d65f 100644
--- a/nuklear/demo/glfw_opengl2/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/Makefile
diff --git a/nuklear/demo/glfw_opengl2/main.c b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/main.c
index 5d68bb9..5d68bb9 100644
--- a/nuklear/demo/glfw_opengl2/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/main.c
diff --git a/nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h
index 7724b25..7724b25 100644
--- a/nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl2/nuklear_glfw_gl2.h
diff --git a/nuklear/demo/glfw_opengl3/Makefile b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/Makefile
index da95261..da95261 100644
--- a/nuklear/demo/glfw_opengl3/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/Makefile
diff --git a/nuklear/demo/glfw_opengl3/main.c b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/main.c
index 529e88c..529e88c 100644
--- a/nuklear/demo/glfw_opengl3/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/main.c
diff --git a/nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h
index 8fe98fc..8fe98fc 100644
--- a/nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h
+++ b/subprojects/nk_pugl/nuklear/demo/glfw_opengl3/nuklear_glfw_gl3.h
diff --git a/nuklear/demo/node_editor.c b/subprojects/nk_pugl/nuklear/demo/node_editor.c
index d4f34c3..d4f34c3 100644
--- a/nuklear/demo/node_editor.c
+++ b/subprojects/nk_pugl/nuklear/demo/node_editor.c
diff --git a/nuklear/demo/overview.c b/subprojects/nk_pugl/nuklear/demo/overview.c
index 3c3f381..3c3f381 100644
--- a/nuklear/demo/overview.c
+++ b/subprojects/nk_pugl/nuklear/demo/overview.c
diff --git a/nuklear/demo/sdl_opengl2/Makefile b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/Makefile
index b73174a..b73174a 100644
--- a/nuklear/demo/sdl_opengl2/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/Makefile
diff --git a/nuklear/demo/sdl_opengl2/main.c b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/main.c
index 0fbf3ff..0fbf3ff 100644
--- a/nuklear/demo/sdl_opengl2/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/main.c
diff --git a/nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h
index 62dc64e..62dc64e 100644
--- a/nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl2/nuklear_sdl_gl2.h
diff --git a/nuklear/demo/sdl_opengl3/Makefile b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/Makefile
index c6fcb45..c6fcb45 100644
--- a/nuklear/demo/sdl_opengl3/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/Makefile
diff --git a/nuklear/demo/sdl_opengl3/main.c b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/main.c
index 9959d8a..9959d8a 100644
--- a/nuklear/demo/sdl_opengl3/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/main.c
diff --git a/nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h
index eb53ebb..eb53ebb 100644
--- a/nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengl3/nuklear_sdl_gl3.h
diff --git a/nuklear/demo/sdl_opengles2/Makefile b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/Makefile
index 7385305..7385305 100644
--- a/nuklear/demo/sdl_opengles2/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/Makefile
diff --git a/nuklear/demo/sdl_opengles2/main.c b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/main.c
index 16a271a..16a271a 100644
--- a/nuklear/demo/sdl_opengles2/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/main.c
diff --git a/nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h
index f96e610..f96e610 100644
--- a/nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h
+++ b/subprojects/nk_pugl/nuklear/demo/sdl_opengles2/nuklear_sdl_gles2.h
diff --git a/nuklear/demo/sfml_opengl2/Makefile b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Makefile
index 28848a4..28848a4 100644
--- a/nuklear/demo/sfml_opengl2/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Makefile
diff --git a/nuklear/demo/sfml_opengl2/Readme.md b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Readme.md
index e3879c0..e3879c0 100644
--- a/nuklear/demo/sfml_opengl2/Readme.md
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/Readme.md
diff --git a/nuklear/demo/sfml_opengl2/main.cpp b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/main.cpp
index 805c1f8..805c1f8 100644
--- a/nuklear/demo/sfml_opengl2/main.cpp
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/main.cpp
diff --git a/nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h
index 9649ec0..9649ec0 100644
--- a/nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl2/nuklear_sfml_gl2.h
diff --git a/nuklear/demo/sfml_opengl3/Makefile b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Makefile
index b30bf28..b30bf28 100644
--- a/nuklear/demo/sfml_opengl3/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Makefile
diff --git a/nuklear/demo/sfml_opengl3/Readme.md b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Readme.md
index ac03e75..ac03e75 100644
--- a/nuklear/demo/sfml_opengl3/Readme.md
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/Readme.md
diff --git a/nuklear/demo/sfml_opengl3/main.cpp b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/main.cpp
index 5dc2a6e..5dc2a6e 100644
--- a/nuklear/demo/sfml_opengl3/main.cpp
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/main.cpp
diff --git a/nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h
index 40b390e..40b390e 100644
--- a/nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h
+++ b/subprojects/nk_pugl/nuklear/demo/sfml_opengl3/nuklear_sfml_gl3.h
diff --git a/nuklear/demo/style.c b/subprojects/nk_pugl/nuklear/demo/style.c
index 17c48fe..17c48fe 100644
--- a/nuklear/demo/style.c
+++ b/subprojects/nk_pugl/nuklear/demo/style.c
diff --git a/nuklear/demo/x11/Makefile b/subprojects/nk_pugl/nuklear/demo/x11/Makefile
index 9057c7b..9057c7b 100644
--- a/nuklear/demo/x11/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/x11/Makefile
diff --git a/nuklear/demo/x11/main.c b/subprojects/nk_pugl/nuklear/demo/x11/main.c
index 791653d..791653d 100644
--- a/nuklear/demo/x11/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/x11/main.c
diff --git a/nuklear/demo/x11/nuklear_xlib.h b/subprojects/nk_pugl/nuklear/demo/x11/nuklear_xlib.h
index 8b6b4ff..8b6b4ff 100644
--- a/nuklear/demo/x11/nuklear_xlib.h
+++ b/subprojects/nk_pugl/nuklear/demo/x11/nuklear_xlib.h
diff --git a/nuklear/demo/x11_opengl2/Makefile b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/Makefile
index a3d6d32..a3d6d32 100644
--- a/nuklear/demo/x11_opengl2/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/Makefile
diff --git a/nuklear/demo/x11_opengl2/main.c b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/main.c
index 12cbed1..12cbed1 100644
--- a/nuklear/demo/x11_opengl2/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/main.c
diff --git a/nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h
index ab36eb6..ab36eb6 100644
--- a/nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl2/nuklear_xlib_gl2.h
diff --git a/nuklear/demo/x11_opengl3/Makefile b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/Makefile
index a3d6d32..a3d6d32 100644
--- a/nuklear/demo/x11_opengl3/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/Makefile
diff --git a/nuklear/demo/x11_opengl3/main.c b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/main.c
index 0191f98..0191f98 100644
--- a/nuklear/demo/x11_opengl3/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/main.c
diff --git a/nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h
index 487dbc7..487dbc7 100644
--- a/nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h
+++ b/subprojects/nk_pugl/nuklear/demo/x11_opengl3/nuklear_xlib_gl3.h
diff --git a/nuklear/demo/x11_rawfb/Makefile b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/Makefile
index c1a178a..c1a178a 100644
--- a/nuklear/demo/x11_rawfb/Makefile
+++ b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/Makefile
diff --git a/nuklear/demo/x11_rawfb/main.c b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/main.c
index c70b024..c70b024 100644
--- a/nuklear/demo/x11_rawfb/main.c
+++ b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/main.c
diff --git a/nuklear/demo/x11_rawfb/nuklear_rawfb.h b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_rawfb.h
index e518780..e518780 100644
--- a/nuklear/demo/x11_rawfb/nuklear_rawfb.h
+++ b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_rawfb.h
diff --git a/nuklear/demo/x11_rawfb/nuklear_xlib.h b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_xlib.h
index 068112f..068112f 100644
--- a/nuklear/demo/x11_rawfb/nuklear_xlib.h
+++ b/subprojects/nk_pugl/nuklear/demo/x11_rawfb/nuklear_xlib.h
diff --git a/nuklear/doc/Makefile b/subprojects/nk_pugl/nuklear/doc/Makefile
index 72a598b..72a598b 100644
--- a/nuklear/doc/Makefile
+++ b/subprojects/nk_pugl/nuklear/doc/Makefile
diff --git a/nuklear/doc/build.sh b/subprojects/nk_pugl/nuklear/doc/build.sh
index 560dd59..560dd59 100755
--- a/nuklear/doc/build.sh
+++ b/subprojects/nk_pugl/nuklear/doc/build.sh
diff --git a/nuklear/doc/nuklear.html b/subprojects/nk_pugl/nuklear/doc/nuklear.html
index ad0d63b..ad0d63b 100644
--- a/nuklear/doc/nuklear.html
+++ b/subprojects/nk_pugl/nuklear/doc/nuklear.html
diff --git a/nuklear/doc/stddoc.c b/subprojects/nk_pugl/nuklear/doc/stddoc.c
index 461ddc1..461ddc1 100644
--- a/nuklear/doc/stddoc.c
+++ b/subprojects/nk_pugl/nuklear/doc/stddoc.c
diff --git a/nuklear/example/Makefile b/subprojects/nk_pugl/nuklear/example/Makefile
index a3ae6f0..a3ae6f0 100644
--- a/nuklear/example/Makefile
+++ b/subprojects/nk_pugl/nuklear/example/Makefile
diff --git a/nuklear/example/canvas.c b/subprojects/nk_pugl/nuklear/example/canvas.c
index 2a7f7a2..2a7f7a2 100644
--- a/nuklear/example/canvas.c
+++ b/subprojects/nk_pugl/nuklear/example/canvas.c
diff --git a/nuklear/example/extended.c b/subprojects/nk_pugl/nuklear/example/extended.c
index 003adf3..003adf3 100644
--- a/nuklear/example/extended.c
+++ b/subprojects/nk_pugl/nuklear/example/extended.c
diff --git a/nuklear/example/file_browser.c b/subprojects/nk_pugl/nuklear/example/file_browser.c
index 1945ff5..1945ff5 100644
--- a/nuklear/example/file_browser.c
+++ b/subprojects/nk_pugl/nuklear/example/file_browser.c
diff --git a/nuklear/example/icon/checked.png b/subprojects/nk_pugl/nuklear/example/icon/checked.png
index e4e05b2..e4e05b2 100644
--- a/nuklear/example/icon/checked.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/checked.png
Binary files differ
diff --git a/nuklear/example/icon/cloud.png b/subprojects/nk_pugl/nuklear/example/icon/cloud.png
index ecc5791..ecc5791 100644
--- a/nuklear/example/icon/cloud.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/cloud.png
Binary files differ
diff --git a/nuklear/example/icon/computer.png b/subprojects/nk_pugl/nuklear/example/icon/computer.png
index 29db8fc..29db8fc 100644
--- a/nuklear/example/icon/computer.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/computer.png
Binary files differ
diff --git a/nuklear/example/icon/copy.png b/subprojects/nk_pugl/nuklear/example/icon/copy.png
index 0a6e979..0a6e979 100644
--- a/nuklear/example/icon/copy.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/copy.png
Binary files differ
diff --git a/nuklear/example/icon/default.png b/subprojects/nk_pugl/nuklear/example/icon/default.png
index c11145a..c11145a 100644
--- a/nuklear/example/icon/default.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/default.png
Binary files differ
diff --git a/nuklear/example/icon/delete.png b/subprojects/nk_pugl/nuklear/example/icon/delete.png
index 7bc6dde..7bc6dde 100644
--- a/nuklear/example/icon/delete.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/delete.png
Binary files differ
diff --git a/nuklear/example/icon/desktop.png b/subprojects/nk_pugl/nuklear/example/icon/desktop.png
index b4abcfd..b4abcfd 100644
--- a/nuklear/example/icon/desktop.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/desktop.png
Binary files differ
diff --git a/nuklear/example/icon/directory.png b/subprojects/nk_pugl/nuklear/example/icon/directory.png
index 4c73d37..4c73d37 100644
--- a/nuklear/example/icon/directory.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/directory.png
Binary files differ
diff --git a/nuklear/example/icon/edit.png b/subprojects/nk_pugl/nuklear/example/icon/edit.png
index 62ce0b4..62ce0b4 100644
--- a/nuklear/example/icon/edit.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/edit.png
Binary files differ
diff --git a/nuklear/example/icon/export.png b/subprojects/nk_pugl/nuklear/example/icon/export.png
index ff6b5aa..ff6b5aa 100644
--- a/nuklear/example/icon/export.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/export.png
Binary files differ
diff --git a/nuklear/example/icon/font.png b/subprojects/nk_pugl/nuklear/example/icon/font.png
index 918e9bf..918e9bf 100644
--- a/nuklear/example/icon/font.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/font.png
Binary files differ
diff --git a/nuklear/example/icon/home.png b/subprojects/nk_pugl/nuklear/example/icon/home.png
index 8560626..8560626 100644
--- a/nuklear/example/icon/home.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/home.png
Binary files differ
diff --git a/nuklear/example/icon/img.png b/subprojects/nk_pugl/nuklear/example/icon/img.png
index 1985957..1985957 100644
--- a/nuklear/example/icon/img.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/img.png
Binary files differ
diff --git a/nuklear/example/icon/movie.png b/subprojects/nk_pugl/nuklear/example/icon/movie.png
index 5227883..5227883 100644
--- a/nuklear/example/icon/movie.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/movie.png
Binary files differ
diff --git a/nuklear/example/icon/music.png b/subprojects/nk_pugl/nuklear/example/icon/music.png
index 0f1415c..0f1415c 100644
--- a/nuklear/example/icon/music.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/music.png
Binary files differ
diff --git a/nuklear/example/icon/next.png b/subprojects/nk_pugl/nuklear/example/icon/next.png
index af0b98d..af0b98d 100644
--- a/nuklear/example/icon/next.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/next.png
Binary files differ
diff --git a/nuklear/example/icon/pause.png b/subprojects/nk_pugl/nuklear/example/icon/pause.png
index 7d6367e..7d6367e 100644
--- a/nuklear/example/icon/pause.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/pause.png
Binary files differ
diff --git a/nuklear/example/icon/pen.png b/subprojects/nk_pugl/nuklear/example/icon/pen.png
index 10c851c..10c851c 100644
--- a/nuklear/example/icon/pen.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/pen.png
Binary files differ
diff --git a/nuklear/example/icon/phone.png b/subprojects/nk_pugl/nuklear/example/icon/phone.png
index 5e6f613..5e6f613 100644
--- a/nuklear/example/icon/phone.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/phone.png
Binary files differ
diff --git a/nuklear/example/icon/plane.png b/subprojects/nk_pugl/nuklear/example/icon/plane.png
index 3a98489..3a98489 100644
--- a/nuklear/example/icon/plane.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/plane.png
Binary files differ
diff --git a/nuklear/example/icon/play.png b/subprojects/nk_pugl/nuklear/example/icon/play.png
index 9c9e8f0..9c9e8f0 100644
--- a/nuklear/example/icon/play.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/play.png
Binary files differ
diff --git a/nuklear/example/icon/prev.png b/subprojects/nk_pugl/nuklear/example/icon/prev.png
index 0eecc2e..0eecc2e 100644
--- a/nuklear/example/icon/prev.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/prev.png
Binary files differ
diff --git a/nuklear/example/icon/rocket.png b/subprojects/nk_pugl/nuklear/example/icon/rocket.png
index ea8e187..ea8e187 100644
--- a/nuklear/example/icon/rocket.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/rocket.png
Binary files differ
diff --git a/nuklear/example/icon/settings.png b/subprojects/nk_pugl/nuklear/example/icon/settings.png
index e6e13f8..e6e13f8 100644
--- a/nuklear/example/icon/settings.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/settings.png
Binary files differ
diff --git a/nuklear/example/icon/stop.png b/subprojects/nk_pugl/nuklear/example/icon/stop.png
index 6742baf..6742baf 100644
--- a/nuklear/example/icon/stop.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/stop.png
Binary files differ
diff --git a/nuklear/example/icon/text.png b/subprojects/nk_pugl/nuklear/example/icon/text.png
index 136e534..136e534 100644
--- a/nuklear/example/icon/text.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/text.png
Binary files differ
diff --git a/nuklear/example/icon/tools.png b/subprojects/nk_pugl/nuklear/example/icon/tools.png
index 412ff85..412ff85 100644
--- a/nuklear/example/icon/tools.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/tools.png
Binary files differ
diff --git a/nuklear/example/icon/unchecked.png b/subprojects/nk_pugl/nuklear/example/icon/unchecked.png
index fca94d2..fca94d2 100644
--- a/nuklear/example/icon/unchecked.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/unchecked.png
Binary files differ
diff --git a/nuklear/example/icon/volume.png b/subprojects/nk_pugl/nuklear/example/icon/volume.png
index 8e86fa9..8e86fa9 100644
--- a/nuklear/example/icon/volume.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/volume.png
Binary files differ
diff --git a/nuklear/example/icon/wifi.png b/subprojects/nk_pugl/nuklear/example/icon/wifi.png
index 270d55d..270d55d 100644
--- a/nuklear/example/icon/wifi.png
+++ b/subprojects/nk_pugl/nuklear/example/icon/wifi.png
Binary files differ
diff --git a/nuklear/example/images/image1.png b/subprojects/nk_pugl/nuklear/example/images/image1.png
index 66a2b63..66a2b63 100644
--- a/nuklear/example/images/image1.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image1.png
Binary files differ
diff --git a/nuklear/example/images/image2.png b/subprojects/nk_pugl/nuklear/example/images/image2.png
index 4acafe5..4acafe5 100644
--- a/nuklear/example/images/image2.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image2.png
Binary files differ
diff --git a/nuklear/example/images/image3.png b/subprojects/nk_pugl/nuklear/example/images/image3.png
index 4dfe664..4dfe664 100644
--- a/nuklear/example/images/image3.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image3.png
Binary files differ
diff --git a/nuklear/example/images/image4.png b/subprojects/nk_pugl/nuklear/example/images/image4.png
index d2f16d0..d2f16d0 100644
--- a/nuklear/example/images/image4.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image4.png
Binary files differ
diff --git a/nuklear/example/images/image5.png b/subprojects/nk_pugl/nuklear/example/images/image5.png
index 852fd70..852fd70 100644
--- a/nuklear/example/images/image5.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image5.png
Binary files differ
diff --git a/nuklear/example/images/image6.png b/subprojects/nk_pugl/nuklear/example/images/image6.png
index 0e261cb..0e261cb 100644
--- a/nuklear/example/images/image6.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image6.png
Binary files differ
diff --git a/nuklear/example/images/image7.png b/subprojects/nk_pugl/nuklear/example/images/image7.png
index f61325b..f61325b 100644
--- a/nuklear/example/images/image7.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image7.png
Binary files differ
diff --git a/nuklear/example/images/image8.png b/subprojects/nk_pugl/nuklear/example/images/image8.png
index 6b27cb8..6b27cb8 100644
--- a/nuklear/example/images/image8.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image8.png
Binary files differ
diff --git a/nuklear/example/images/image9.png b/subprojects/nk_pugl/nuklear/example/images/image9.png
index 516929e..516929e 100644
--- a/nuklear/example/images/image9.png
+++ b/subprojects/nk_pugl/nuklear/example/images/image9.png
Binary files differ
diff --git a/nuklear/example/skinning.c b/subprojects/nk_pugl/nuklear/example/skinning.c
index 4020aec..4020aec 100644
--- a/nuklear/example/skinning.c
+++ b/subprojects/nk_pugl/nuklear/example/skinning.c
diff --git a/nuklear/example/skins/gwen.png b/subprojects/nk_pugl/nuklear/example/skins/gwen.png
index 40956c9..40956c9 100644
--- a/nuklear/example/skins/gwen.png
+++ b/subprojects/nk_pugl/nuklear/example/skins/gwen.png
Binary files differ
diff --git a/nuklear/example/stb_image.h b/subprojects/nk_pugl/nuklear/example/stb_image.h
index 0a9de39..0a9de39 100644
--- a/nuklear/example/stb_image.h
+++ b/subprojects/nk_pugl/nuklear/example/stb_image.h
diff --git a/nuklear/extra_font/Cousine-Regular.ttf b/subprojects/nk_pugl/nuklear/extra_font/Cousine-Regular.ttf
index 70a0bf9..70a0bf9 100644
--- a/nuklear/extra_font/Cousine-Regular.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Cousine-Regular.ttf
Binary files differ
diff --git a/nuklear/extra_font/DroidSans.ttf b/subprojects/nk_pugl/nuklear/extra_font/DroidSans.ttf
index 767c63a..767c63a 100644
--- a/nuklear/extra_font/DroidSans.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/DroidSans.ttf
Binary files differ
diff --git a/nuklear/extra_font/Karla-Regular.ttf b/subprojects/nk_pugl/nuklear/extra_font/Karla-Regular.ttf
index 81b3de6..81b3de6 100644
--- a/nuklear/extra_font/Karla-Regular.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Karla-Regular.ttf
Binary files differ
diff --git a/nuklear/extra_font/ProggyClean.ttf b/subprojects/nk_pugl/nuklear/extra_font/ProggyClean.ttf
index 0270cdf..0270cdf 100644
--- a/nuklear/extra_font/ProggyClean.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/ProggyClean.ttf
Binary files differ
diff --git a/nuklear/extra_font/ProggyTiny.ttf b/subprojects/nk_pugl/nuklear/extra_font/ProggyTiny.ttf
index 1c4312c..1c4312c 100644
--- a/nuklear/extra_font/ProggyTiny.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/ProggyTiny.ttf
Binary files differ
diff --git a/nuklear/extra_font/Raleway-Bold.ttf b/subprojects/nk_pugl/nuklear/extra_font/Raleway-Bold.ttf
index 7aa37f0..7aa37f0 100644
--- a/nuklear/extra_font/Raleway-Bold.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Raleway-Bold.ttf
Binary files differ
diff --git a/nuklear/extra_font/Roboto-Bold.ttf b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Bold.ttf
index aaf374d..aaf374d 100644
--- a/nuklear/extra_font/Roboto-Bold.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Bold.ttf
Binary files differ
diff --git a/nuklear/extra_font/Roboto-Light.ttf b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Light.ttf
index 664e1b2..664e1b2 100644
--- a/nuklear/extra_font/Roboto-Light.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Light.ttf
Binary files differ
diff --git a/nuklear/extra_font/Roboto-Regular.ttf b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Regular.ttf
index 3e6e2e7..3e6e2e7 100644
--- a/nuklear/extra_font/Roboto-Regular.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/Roboto-Regular.ttf
Binary files differ
diff --git a/nuklear/extra_font/kenvector_future.ttf b/subprojects/nk_pugl/nuklear/extra_font/kenvector_future.ttf
index 39ebdfa..39ebdfa 100644
--- a/nuklear/extra_font/kenvector_future.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/kenvector_future.ttf
Binary files differ
diff --git a/nuklear/extra_font/kenvector_future_thin.ttf b/subprojects/nk_pugl/nuklear/extra_font/kenvector_future_thin.ttf
index 9f4b4fa..9f4b4fa 100644
--- a/nuklear/extra_font/kenvector_future_thin.ttf
+++ b/subprojects/nk_pugl/nuklear/extra_font/kenvector_future_thin.ttf
Binary files differ
diff --git a/nuklear/nuklear.h b/subprojects/nk_pugl/nuklear/nuklear.h
index dd423b9..dd423b9 100644
--- a/nuklear/nuklear.h
+++ b/subprojects/nk_pugl/nuklear/nuklear.h
diff --git a/nuklear/package.json b/subprojects/nk_pugl/nuklear/package.json
index edff924..edff924 100644
--- a/nuklear/package.json
+++ b/subprojects/nk_pugl/nuklear/package.json
diff --git a/pugl/.clang-format b/subprojects/nk_pugl/pugl/.clang-format
index b788676..b788676 100644
--- a/pugl/.clang-format
+++ b/subprojects/nk_pugl/pugl/.clang-format
diff --git a/pugl/.clang-tidy b/subprojects/nk_pugl/pugl/.clang-tidy
index 055d63b..055d63b 100644
--- a/pugl/.clang-tidy
+++ b/subprojects/nk_pugl/pugl/.clang-tidy
diff --git a/pugl/.gitattributes b/subprojects/nk_pugl/pugl/.gitattributes
index 32967c1..32967c1 100644
--- a/pugl/.gitattributes
+++ b/subprojects/nk_pugl/pugl/.gitattributes
diff --git a/pugl/.gitignore b/subprojects/nk_pugl/pugl/.gitignore
index dad71c3..dad71c3 100644
--- a/pugl/.gitignore
+++ b/subprojects/nk_pugl/pugl/.gitignore
diff --git a/pugl/.gitlab-ci.yml b/subprojects/nk_pugl/pugl/.gitlab-ci.yml
index 29dc8be..29dc8be 100644
--- a/pugl/.gitlab-ci.yml
+++ b/subprojects/nk_pugl/pugl/.gitlab-ci.yml
diff --git a/pugl/.gitmodules b/subprojects/nk_pugl/pugl/.gitmodules
index cc8b569..cc8b569 100644
--- a/pugl/.gitmodules
+++ b/subprojects/nk_pugl/pugl/.gitmodules
diff --git a/pugl/AUTHORS b/subprojects/nk_pugl/pugl/AUTHORS
index 1470491..1470491 100644
--- a/pugl/AUTHORS
+++ b/subprojects/nk_pugl/pugl/AUTHORS
diff --git a/pugl/COPYING b/subprojects/nk_pugl/pugl/COPYING
index 4a287b9..4a287b9 100644
--- a/pugl/COPYING
+++ b/subprojects/nk_pugl/pugl/COPYING
diff --git a/pugl/README.md b/subprojects/nk_pugl/pugl/README.md
index ae9c420..ae9c420 100644
--- a/pugl/README.md
+++ b/subprojects/nk_pugl/pugl/README.md
diff --git a/pugl/doc/footer.html b/subprojects/nk_pugl/pugl/doc/footer.html
index 0dc6919..0dc6919 100644
--- a/pugl/doc/footer.html
+++ b/subprojects/nk_pugl/pugl/doc/footer.html
diff --git a/pugl/doc/header.html b/subprojects/nk_pugl/pugl/doc/header.html
index 54c25b0..54c25b0 100644
--- a/pugl/doc/header.html
+++ b/subprojects/nk_pugl/pugl/doc/header.html
diff --git a/pugl/doc/layout.xml b/subprojects/nk_pugl/pugl/doc/layout.xml
index 1889302..1889302 100644
--- a/pugl/doc/layout.xml
+++ b/subprojects/nk_pugl/pugl/doc/layout.xml
diff --git a/pugl/doc/mainpage.md b/subprojects/nk_pugl/pugl/doc/mainpage.md
index aa6f925..aa6f925 100644
--- a/pugl/doc/mainpage.md
+++ b/subprojects/nk_pugl/pugl/doc/mainpage.md
diff --git a/pugl/doc/reference.doxygen.in b/subprojects/nk_pugl/pugl/doc/reference.doxygen.in
index 1357fe4..1357fe4 100644
--- a/pugl/doc/reference.doxygen.in
+++ b/subprojects/nk_pugl/pugl/doc/reference.doxygen.in
diff --git a/pugl/doc/style.css b/subprojects/nk_pugl/pugl/doc/style.css
index 28f0519..28f0519 100644
--- a/pugl/doc/style.css
+++ b/subprojects/nk_pugl/pugl/doc/style.css
diff --git a/pugl/examples/cube_view.h b/subprojects/nk_pugl/pugl/examples/cube_view.h
index 9fd2349..9fd2349 100644
--- a/pugl/examples/cube_view.h
+++ b/subprojects/nk_pugl/pugl/examples/cube_view.h
diff --git a/pugl/examples/demo_utils.h b/subprojects/nk_pugl/pugl/examples/demo_utils.h
index 9a1cb7a..9a1cb7a 100644
--- a/pugl/examples/demo_utils.h
+++ b/subprojects/nk_pugl/pugl/examples/demo_utils.h
diff --git a/pugl/examples/glad/glad.c b/subprojects/nk_pugl/pugl/examples/glad/glad.c
index 38f442c..38f442c 100644
--- a/pugl/examples/glad/glad.c
+++ b/subprojects/nk_pugl/pugl/examples/glad/glad.c
diff --git a/pugl/examples/glad/glad.h b/subprojects/nk_pugl/pugl/examples/glad/glad.h
index d8068c6..d8068c6 100644
--- a/pugl/examples/glad/glad.h
+++ b/subprojects/nk_pugl/pugl/examples/glad/glad.h
diff --git a/pugl/examples/glad/khrplatform.h b/subprojects/nk_pugl/pugl/examples/glad/khrplatform.h
index 5b55ea2..5b55ea2 100644
--- a/pugl/examples/glad/khrplatform.h
+++ b/subprojects/nk_pugl/pugl/examples/glad/khrplatform.h
diff --git a/pugl/examples/pugl_cairo_demo.c b/subprojects/nk_pugl/pugl/examples/pugl_cairo_demo.c
index 483446f..483446f 100644
--- a/pugl/examples/pugl_cairo_demo.c
+++ b/subprojects/nk_pugl/pugl/examples/pugl_cairo_demo.c
diff --git a/pugl/examples/pugl_embed_demo.c b/subprojects/nk_pugl/pugl/examples/pugl_embed_demo.c
index 3a7b051..3a7b051 100644
--- a/pugl/examples/pugl_embed_demo.c
+++ b/subprojects/nk_pugl/pugl/examples/pugl_embed_demo.c
diff --git a/pugl/examples/pugl_gl3_demo.c b/subprojects/nk_pugl/pugl/examples/pugl_gl3_demo.c
index c49ed3d..c49ed3d 100644
--- a/pugl/examples/pugl_gl3_demo.c
+++ b/subprojects/nk_pugl/pugl/examples/pugl_gl3_demo.c
diff --git a/pugl/examples/pugl_print_events.c b/subprojects/nk_pugl/pugl/examples/pugl_print_events.c
index 52b58c4..52b58c4 100644
--- a/pugl/examples/pugl_print_events.c
+++ b/subprojects/nk_pugl/pugl/examples/pugl_print_events.c
diff --git a/pugl/examples/pugl_window_demo.c b/subprojects/nk_pugl/pugl/examples/pugl_window_demo.c
index 183119c..183119c 100644
--- a/pugl/examples/pugl_window_demo.c
+++ b/subprojects/nk_pugl/pugl/examples/pugl_window_demo.c
diff --git a/pugl/examples/shader_utils.h b/subprojects/nk_pugl/pugl/examples/shader_utils.h
index 834d8fc..834d8fc 100644
--- a/pugl/examples/shader_utils.h
+++ b/subprojects/nk_pugl/pugl/examples/shader_utils.h
diff --git a/pugl/pugl.pc.in b/subprojects/nk_pugl/pugl/pugl.pc.in
index 531cd54..531cd54 100644
--- a/pugl/pugl.pc.in
+++ b/subprojects/nk_pugl/pugl/pugl.pc.in
diff --git a/pugl/pugl/detail/implementation.c b/subprojects/nk_pugl/pugl/pugl/detail/implementation.c
index ee9b242..ee9b242 100644
--- a/pugl/pugl/detail/implementation.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/implementation.c
diff --git a/pugl/pugl/detail/implementation.h b/subprojects/nk_pugl/pugl/pugl/detail/implementation.h
index bcecd85..bcecd85 100644
--- a/pugl/pugl/detail/implementation.h
+++ b/subprojects/nk_pugl/pugl/pugl/detail/implementation.h
diff --git a/pugl/pugl/detail/mac.h b/subprojects/nk_pugl/pugl/pugl/detail/mac.h
index 2243337..2243337 100644
--- a/pugl/pugl/detail/mac.h
+++ b/subprojects/nk_pugl/pugl/pugl/detail/mac.h
diff --git a/pugl/pugl/detail/mac.m b/subprojects/nk_pugl/pugl/pugl/detail/mac.m
index 501be02..501be02 100644
--- a/pugl/pugl/detail/mac.m
+++ b/subprojects/nk_pugl/pugl/pugl/detail/mac.m
diff --git a/pugl/pugl/detail/mac_cairo.m b/subprojects/nk_pugl/pugl/pugl/detail/mac_cairo.m
index 51c1c13..51c1c13 100644
--- a/pugl/pugl/detail/mac_cairo.m
+++ b/subprojects/nk_pugl/pugl/pugl/detail/mac_cairo.m
diff --git a/pugl/pugl/detail/mac_gl.m b/subprojects/nk_pugl/pugl/pugl/detail/mac_gl.m
index eda4371..eda4371 100644
--- a/pugl/pugl/detail/mac_gl.m
+++ b/subprojects/nk_pugl/pugl/pugl/detail/mac_gl.m
diff --git a/pugl/pugl/detail/mac_stub.m b/subprojects/nk_pugl/pugl/pugl/detail/mac_stub.m
index 71a54b8..71a54b8 100644
--- a/pugl/pugl/detail/mac_stub.m
+++ b/subprojects/nk_pugl/pugl/pugl/detail/mac_stub.m
diff --git a/pugl/pugl/detail/types.h b/subprojects/nk_pugl/pugl/pugl/detail/types.h
index eb450e1..eb450e1 100644
--- a/pugl/pugl/detail/types.h
+++ b/subprojects/nk_pugl/pugl/pugl/detail/types.h
diff --git a/pugl/pugl/detail/win.c b/subprojects/nk_pugl/pugl/pugl/detail/win.c
index 44ba6cd..44ba6cd 100644
--- a/pugl/pugl/detail/win.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/win.c
diff --git a/pugl/pugl/detail/win.h b/subprojects/nk_pugl/pugl/pugl/detail/win.h
index 949fa90..949fa90 100644
--- a/pugl/pugl/detail/win.h
+++ b/subprojects/nk_pugl/pugl/pugl/detail/win.h
diff --git a/pugl/pugl/detail/win_cairo.c b/subprojects/nk_pugl/pugl/pugl/detail/win_cairo.c
index a8b371f..a8b371f 100644
--- a/pugl/pugl/detail/win_cairo.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/win_cairo.c
diff --git a/pugl/pugl/detail/win_gl.c b/subprojects/nk_pugl/pugl/pugl/detail/win_gl.c
index f5acfd6..f5acfd6 100644
--- a/pugl/pugl/detail/win_gl.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/win_gl.c
diff --git a/pugl/pugl/detail/x11.c b/subprojects/nk_pugl/pugl/pugl/detail/x11.c
index e3fb264..e3fb264 100644
--- a/pugl/pugl/detail/x11.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/x11.c
diff --git a/pugl/pugl/detail/x11.h b/subprojects/nk_pugl/pugl/pugl/detail/x11.h
index 6b7a150..6b7a150 100644
--- a/pugl/pugl/detail/x11.h
+++ b/subprojects/nk_pugl/pugl/pugl/detail/x11.h
diff --git a/pugl/pugl/detail/x11_cairo.c b/subprojects/nk_pugl/pugl/pugl/detail/x11_cairo.c
index 0229d97..0229d97 100644
--- a/pugl/pugl/detail/x11_cairo.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/x11_cairo.c
diff --git a/pugl/pugl/detail/x11_gl.c b/subprojects/nk_pugl/pugl/pugl/detail/x11_gl.c
index 33a05df..33a05df 100644
--- a/pugl/pugl/detail/x11_gl.c
+++ b/subprojects/nk_pugl/pugl/pugl/detail/x11_gl.c
diff --git a/pugl/pugl/gl.h b/subprojects/nk_pugl/pugl/pugl/gl.h
index 55a55c4..55a55c4 100644
--- a/pugl/pugl/gl.h
+++ b/subprojects/nk_pugl/pugl/pugl/gl.h
diff --git a/pugl/pugl/glu.h b/subprojects/nk_pugl/pugl/pugl/glu.h
index 0ade70c..0ade70c 100644
--- a/pugl/pugl/glu.h
+++ b/subprojects/nk_pugl/pugl/pugl/glu.h
diff --git a/pugl/pugl/pugl.h b/subprojects/nk_pugl/pugl/pugl/pugl.h
index 57e23fa..57e23fa 100644
--- a/pugl/pugl/pugl.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl.h
diff --git a/pugl/pugl/pugl.hpp b/subprojects/nk_pugl/pugl/pugl/pugl.hpp
index 73cfe2a..73cfe2a 100644
--- a/pugl/pugl/pugl.hpp
+++ b/subprojects/nk_pugl/pugl/pugl/pugl.hpp
diff --git a/pugl/pugl/pugl_cairo.h b/subprojects/nk_pugl/pugl/pugl/pugl_cairo.h
index e71072e..e71072e 100644
--- a/pugl/pugl/pugl_cairo.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_cairo.h
diff --git a/pugl/pugl/pugl_cairo_backend.h b/subprojects/nk_pugl/pugl/pugl/pugl_cairo_backend.h
index 3f8cec3..3f8cec3 100644
--- a/pugl/pugl/pugl_cairo_backend.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_cairo_backend.h
diff --git a/pugl/pugl/pugl_gl.h b/subprojects/nk_pugl/pugl/pugl/pugl_gl.h
index 9c5fa94..9c5fa94 100644
--- a/pugl/pugl/pugl_gl.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_gl.h
diff --git a/pugl/pugl/pugl_gl_backend.h b/subprojects/nk_pugl/pugl/pugl/pugl_gl_backend.h
index e1b9a15..e1b9a15 100644
--- a/pugl/pugl/pugl_gl_backend.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_gl_backend.h
diff --git a/pugl/pugl/pugl_stub.h b/subprojects/nk_pugl/pugl/pugl/pugl_stub.h
index da918aa..da918aa 100644
--- a/pugl/pugl/pugl_stub.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_stub.h
diff --git a/pugl/pugl/pugl_stub_backend.h b/subprojects/nk_pugl/pugl/pugl/pugl_stub_backend.h
index e5aa513..e5aa513 100644
--- a/pugl/pugl/pugl_stub_backend.h
+++ b/subprojects/nk_pugl/pugl/pugl/pugl_stub_backend.h
diff --git a/pugl/resources/Info.plist.in b/subprojects/nk_pugl/pugl/resources/Info.plist.in
index a08dbd0..a08dbd0 100644
--- a/pugl/resources/Info.plist.in
+++ b/subprojects/nk_pugl/pugl/resources/Info.plist.in
diff --git a/pugl/resources/pugl.ipe b/subprojects/nk_pugl/pugl/resources/pugl.ipe
index 238c09c..238c09c 100644
--- a/pugl/resources/pugl.ipe
+++ b/subprojects/nk_pugl/pugl/resources/pugl.ipe
diff --git a/pugl/resources/pugl.png b/subprojects/nk_pugl/pugl/resources/pugl.png
index 4641660..4641660 100644
--- a/pugl/resources/pugl.png
+++ b/subprojects/nk_pugl/pugl/resources/pugl.png
Binary files differ
diff --git a/pugl/resources/pugl.svg b/subprojects/nk_pugl/pugl/resources/pugl.svg
index 5bb5335..5bb5335 100644
--- a/pugl/resources/pugl.svg
+++ b/subprojects/nk_pugl/pugl/resources/pugl.svg
diff --git a/pugl/shaders/rect.frag b/subprojects/nk_pugl/pugl/shaders/rect.frag
index 5e3af9d..5e3af9d 100644
--- a/pugl/shaders/rect.frag
+++ b/subprojects/nk_pugl/pugl/shaders/rect.frag
diff --git a/pugl/shaders/rect.vert b/subprojects/nk_pugl/pugl/shaders/rect.vert
index bf2e951..bf2e951 100644
--- a/pugl/shaders/rect.vert
+++ b/subprojects/nk_pugl/pugl/shaders/rect.vert
diff --git a/pugl/test/test_redisplay.c b/subprojects/nk_pugl/pugl/test/test_redisplay.c
index 75006cb..75006cb 100644
--- a/pugl/test/test_redisplay.c
+++ b/subprojects/nk_pugl/pugl/test/test_redisplay.c
diff --git a/pugl/test/test_show_hide.c b/subprojects/nk_pugl/pugl/test/test_show_hide.c
index cc2c972..cc2c972 100644
--- a/pugl/test/test_show_hide.c
+++ b/subprojects/nk_pugl/pugl/test/test_show_hide.c
diff --git a/pugl/test/test_timer.c b/subprojects/nk_pugl/pugl/test/test_timer.c
index 58d0652..58d0652 100644
--- a/pugl/test/test_timer.c
+++ b/subprojects/nk_pugl/pugl/test/test_timer.c
diff --git a/pugl/test/test_update.c b/subprojects/nk_pugl/pugl/test/test_update.c
index 081fb9b..081fb9b 100644
--- a/pugl/test/test_update.c
+++ b/subprojects/nk_pugl/pugl/test/test_update.c
diff --git a/pugl/test/test_utils.h b/subprojects/nk_pugl/pugl/test/test_utils.h
index 7d33601..7d33601 100644
--- a/pugl/test/test_utils.h
+++ b/subprojects/nk_pugl/pugl/test/test_utils.h
diff --git a/pugl/waf b/subprojects/nk_pugl/pugl/waf
index 58d14c3..58d14c3 100755
--- a/pugl/waf
+++ b/subprojects/nk_pugl/pugl/waf
diff --git a/pugl/wscript b/subprojects/nk_pugl/pugl/wscript
index 2fc48de..2fc48de 100644
--- a/pugl/wscript
+++ b/subprojects/nk_pugl/pugl/wscript