├── misc ├── resources.rc ├── icon.icns ├── icon.ico ├── icon.png ├── icons.png ├── format.sh ├── vpv.desktop ├── genluafiles.sh └── vpv.py ├── src ├── menu.hpp ├── tests_runner.cpp ├── dragndrop.hpp ├── luafiles.hpp ├── fuzzy-finder │ ├── build.rs │ ├── Cargo.toml │ └── src │ │ └── cxxbridge.rs ├── icons.hpp ├── collection_expression.hpp ├── Progressable.hpp ├── watcher.hpp ├── layout.hpp ├── plambda.h ├── events.hpp ├── shaders.hpp ├── editors.hpp ├── strutils.cpp ├── strutils.hpp ├── OpenGLDebug.hpp ├── Texture.hpp ├── OpenGLDebug.cpp ├── EditGUI.hpp ├── SVG.hpp ├── config.hpp ├── fs.hpp ├── DisplayArea.hpp ├── ImageCache.hpp ├── View.hpp ├── globals.cpp ├── Terminal.hpp ├── Image.hpp ├── LoadingThread.cpp ├── FuzzyFinder.hpp ├── Player.hpp ├── Window.hpp ├── Histogram.hpp ├── imgui_custom.hpp ├── globals.hpp ├── Colormap.hpp ├── dragndrop.cpp └── shaders.cpp ├── .clang-format ├── external ├── reproc │ ├── reproc │ │ ├── src │ │ │ ├── init.h │ │ │ ├── clock.h │ │ │ ├── utf.posix.c │ │ │ ├── init.posix.c │ │ │ ├── strv.h │ │ │ ├── options.h │ │ │ ├── macro.h │ │ │ ├── clock.windows.c │ │ │ ├── clock.posix.c │ │ │ ├── init.windows.c │ │ │ ├── handle.h │ │ │ ├── handle.windows.c │ │ │ ├── utf.h │ │ │ ├── redirect.h │ │ │ ├── handle.posix.c │ │ │ ├── error.posix.c │ │ │ ├── utf.windows.c │ │ │ ├── error.h │ │ │ ├── run.c │ │ │ ├── pipe.h │ │ │ ├── strv.c │ │ │ └── redirect.posix.c │ │ ├── resources │ │ │ ├── deadline.c │ │ │ ├── stop.c │ │ │ ├── path.c │ │ │ ├── argv.c │ │ │ ├── env.c │ │ │ ├── pid.c │ │ │ ├── io.c │ │ │ ├── overflow.c │ │ │ ├── working-directory.c │ │ │ └── sleep.h │ │ ├── test │ │ │ ├── deadline.c │ │ │ ├── overflow.c │ │ │ ├── stop.c │ │ │ ├── working-directory.c │ │ │ ├── argv.c │ │ │ ├── path.c │ │ │ ├── fork.c │ │ │ ├── pid.c │ │ │ ├── env.c │ │ │ └── io.c │ │ ├── reproc-config.cmake.in │ │ ├── reproc.pc.in │ │ ├── examples │ │ │ ├── path.c │ │ │ ├── run.c │ │ │ ├── env.c │ │ │ └── parent.c │ │ ├── include │ │ │ └── reproc │ │ │ │ ├── export.h │ │ │ │ └── run.h │ │ └── CMakeLists.txt │ ├── reproc++ │ │ ├── reproc++-config.cmake.in │ │ ├── reproc++.pc.in │ │ ├── include │ │ │ └── reproc++ │ │ │ │ ├── detail │ │ │ │ ├── type_traits.hpp │ │ │ │ └── array.hpp │ │ │ │ ├── export.hpp │ │ │ │ ├── input.hpp │ │ │ │ ├── run.hpp │ │ │ │ └── arguments.hpp │ │ ├── examples │ │ │ └── run.cpp │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ └── LICENSE ├── imgui │ ├── misc │ │ ├── fonts │ │ │ ├── DroidSans.ttf │ │ │ ├── ProggyTiny.ttf │ │ │ ├── ProggyClean.ttf │ │ │ ├── Cousine-Regular.ttf │ │ │ ├── Karla-Regular.ttf │ │ │ └── Roboto-Medium.ttf │ │ └── natvis │ │ │ ├── README.txt │ │ │ └── imgui.natvis │ ├── examples │ │ ├── apple_example │ │ │ ├── imguiex-osx │ │ │ │ ├── Assets.xcassets │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── main.m │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ └── Info.plist │ │ │ └── imguiex-ios │ │ │ │ ├── Shaders │ │ │ │ ├── Shader.fsh │ │ │ │ └── Shader.vsh │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── GameViewController.h │ │ │ │ ├── main.m │ │ │ │ ├── debug_hud.h │ │ │ │ ├── imgui_impl_ios.h │ │ │ │ ├── Images.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Info.plist │ │ ├── libs │ │ │ ├── glfw │ │ │ │ ├── lib-vc2010-32 │ │ │ │ │ └── glfw3.lib │ │ │ │ ├── lib-vc2010-64 │ │ │ │ │ └── glfw3.lib │ │ │ │ └── COPYING.txt │ │ │ └── usynergy │ │ │ │ └── README.txt │ │ ├── vulkan_example │ │ │ ├── gen_spv.sh │ │ │ ├── glsl_shader.frag │ │ │ ├── glsl_shader.vert │ │ │ ├── build_win64.bat │ │ │ ├── build_win32.bat │ │ │ ├── CMakeLists.txt │ │ │ └── vulkan_example.vcxproj.filters │ │ ├── null_example │ │ │ ├── build_win32.bat │ │ │ └── main.cpp │ │ ├── directx9_example │ │ │ ├── build_win32.bat │ │ │ ├── imgui_impl_dx9.h │ │ │ └── directx9_example.vcxproj.filters │ │ ├── opengl2_example │ │ │ ├── build_win32.bat │ │ │ └── opengl2_example.vcxproj.filters │ │ ├── directx12_example │ │ │ ├── build_win32.bat │ │ │ └── directx12_example.vcxproj.filters │ │ ├── opengl3_example │ │ │ └── build_win32.bat │ │ ├── directx10_example │ │ │ ├── build_win32.bat │ │ │ ├── imgui_impl_dx10.h │ │ │ └── directx10_example.vcxproj.filters │ │ ├── directx11_example │ │ │ ├── build_win32.bat │ │ │ ├── imgui_impl_dx11.h │ │ │ └── directx11_example.vcxproj.filters │ │ ├── sdl_opengl2_example │ │ │ ├── build_win32.bat │ │ │ ├── README.md │ │ │ ├── sdl_opengl2_example.vcxproj.filters │ │ │ └── Makefile │ │ ├── sdl_opengl3_example │ │ │ ├── build_win32.bat │ │ │ ├── README.md │ │ │ └── imgui_impl_sdl_gl3.h │ │ ├── allegro5_example │ │ │ ├── imconfig_allegro5.h │ │ │ ├── README.md │ │ │ └── imgui_impl_allegro5.h │ │ └── marmalade_example │ │ │ ├── data │ │ │ └── app.icf │ │ │ ├── marmalade_example.mkb │ │ │ └── imgui_impl_marmalade.h │ └── LICENSE.txt ├── nanosvg │ ├── example │ │ ├── screenshot-1.png │ │ └── screenshot-2.png │ ├── LICENSE.txt │ └── premake4.lua ├── lua │ └── src │ │ ├── lua.hpp │ │ ├── lundump.h │ │ ├── lprefix.h │ │ ├── lualib.h │ │ ├── lzio.c │ │ ├── lapi.h │ │ ├── lopnames.h │ │ ├── lzio.h │ │ └── lstring.h ├── efsw │ ├── Makefile │ ├── src │ │ └── efsw │ │ │ ├── Mutex.cpp │ │ │ ├── Lock.hpp │ │ │ ├── Watcher.cpp │ │ │ ├── Mutex.hpp │ │ │ ├── platform │ │ │ ├── posix │ │ │ │ ├── SystemImpl.hpp │ │ │ │ ├── MutexImpl.hpp │ │ │ │ ├── ThreadImpl.hpp │ │ │ │ ├── MutexImpl.cpp │ │ │ │ ├── FileSystemImpl.hpp │ │ │ │ └── ThreadImpl.cpp │ │ │ ├── win │ │ │ │ ├── SystemImpl.hpp │ │ │ │ ├── MutexImpl.cpp │ │ │ │ ├── MutexImpl.hpp │ │ │ │ ├── ThreadImpl.hpp │ │ │ │ ├── FileSystemImpl.hpp │ │ │ │ ├── SystemImpl.cpp │ │ │ │ └── ThreadImpl.cpp │ │ │ └── platformimpl.hpp │ │ │ ├── System.cpp │ │ │ ├── WatcherInotify.hpp │ │ │ ├── System.hpp │ │ │ ├── Watcher.hpp │ │ │ ├── WatcherGeneric.hpp │ │ │ ├── DirectorySnapshotDiff.cpp │ │ │ ├── FileWatcherImpl.cpp │ │ │ ├── WatcherInotify.cpp │ │ │ ├── Log.cpp │ │ │ ├── Thread.cpp │ │ │ ├── DirectorySnapshotDiff.hpp │ │ │ ├── WatcherGeneric.cpp │ │ │ ├── DirectorySnapshot.hpp │ │ │ ├── Debug.hpp │ │ │ ├── FileSystem.hpp │ │ │ ├── FileInfo.hpp │ │ │ ├── DirWatcherGeneric.hpp │ │ │ ├── WatcherFSEvents.hpp │ │ │ └── FileWatcherGeneric.hpp │ └── LICENSE ├── iio │ ├── npy.h │ └── AUTHORS ├── kaguya │ └── include │ │ └── kaguya │ │ └── kaguya.hpp └── imscript │ ├── xmalloc.c │ ├── help_stuff.c │ └── smapa.h ├── .woodpecker ├── archlinux-aur.yml ├── nix.yml ├── fedora.yml ├── archlinux.yml ├── debian-stable.yml ├── debian-testing.yml ├── ubuntu-devel.yml ├── ubuntu-focal.yml ├── ubuntu-latest.yml └── ubuntu-rolling.yml ├── cmake └── modules │ ├── AddCXXFlagsIfSupported.cmake │ └── TargetEnableIPOIfSupported.cmake ├── .github └── workflows │ ├── clang-format-check.yml │ └── ci.yml ├── flake.lock └── flake.nix /misc/resources.rc: -------------------------------------------------------------------------------- 1 | 0 ICON icon.ico 2 | -------------------------------------------------------------------------------- /src/menu.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void menu(); 4 | -------------------------------------------------------------------------------- /misc/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/misc/icon.icns -------------------------------------------------------------------------------- /misc/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/misc/icon.ico -------------------------------------------------------------------------------- /misc/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/misc/icon.png -------------------------------------------------------------------------------- /misc/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/misc/icons.png -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: WebKit 3 | CommentPragmas: '^[^ ]' 4 | ... 5 | -------------------------------------------------------------------------------- /src/tests_runner.cpp: -------------------------------------------------------------------------------- 1 | #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 2 | #include "doctest.h" 3 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | int init(void); 4 | 5 | void deinit(void); 6 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/clock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | int64_t now(void); 6 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/utf.posix.c: -------------------------------------------------------------------------------- 1 | #include "utf.h" 2 | 3 | // `utf16_from_utf8` is Windows-only. 4 | -------------------------------------------------------------------------------- /misc/format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | git ls-files -- '*.cpp' '*.hpp' '*.c' '*.h' ':!:external/*' | xargs $(which clang-format) -i -------------------------------------------------------------------------------- /external/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /external/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /external/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /external/nanosvg/example/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/nanosvg/example/screenshot-1.png -------------------------------------------------------------------------------- /external/nanosvg/example/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/nanosvg/example/screenshot-2.png -------------------------------------------------------------------------------- /src/dragndrop.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void handleDragDropEvent(const std::string& str, bool isfile); 6 | -------------------------------------------------------------------------------- /external/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /external/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /external/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /external/reproc/reproc/resources/deadline.c: -------------------------------------------------------------------------------- 1 | #include "sleep.h" 2 | 3 | int main(void) 4 | { 5 | millisleep(25000); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/stop.c: -------------------------------------------------------------------------------- 1 | #include "sleep.h" 2 | 3 | int main(void) 4 | { 5 | millisleep(25000); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/luafiles.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // The C++ code is generated by cmake. 6 | int load_luafiles(lua_State* L); 7 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /external/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib -------------------------------------------------------------------------------- /external/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kidanger/vpv/HEAD/external/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib -------------------------------------------------------------------------------- /src/fuzzy-finder/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let _build = cxx_build::bridge("src/cxxbridge.rs"); 3 | println!("cargo:rerun-if-changed=src/cxxbridge.rs"); 4 | } 5 | -------------------------------------------------------------------------------- /external/imgui/misc/natvis/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Natvis file to describe types in Visual Studio debugger. 3 | You can include this in a project file, or install in Visual Studio folder. 4 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/init.posix.c: -------------------------------------------------------------------------------- 1 | #define _POSIX_C_SOURCE 200809L 2 | 3 | #include "init.h" 4 | 5 | int init(void) 6 | { 7 | return 0; 8 | } 9 | 10 | void deinit(void) {} 11 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/gen_spv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag 3 | glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert 4 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/path.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char **argv) 4 | { 5 | (void) argc; 6 | 7 | printf("%s", argv[0]); 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /.woodpecker/archlinux-aur.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: greyltc/archlinux-aur:yay 4 | commands: 5 | - sudo -u ab -D~ bash -c 'yay -Syu --removemake --needed --noprogressbar --noconfirm vpv' 6 | -------------------------------------------------------------------------------- /src/icons.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | enum IconID { 6 | ICON_FIT_COLORMAP, 7 | ICON_FIT_VIEW, 8 | }; 9 | 10 | bool show_icon_button(IconID id, const char* description); 11 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/strv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define STRV_FOREACH(s, l) for ((s) = (l); (s) && *(s); (s)++) 4 | 5 | char **strv_concat(char *const *a, const char *const *b); 6 | 7 | char **strv_free(char **l); 8 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/Shaders/Shader.fsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.fsh 3 | // imguiex 4 | 5 | varying lowp vec4 colorVarying; 6 | 7 | void main() 8 | { 9 | gl_FragColor = colorVarying; 10 | } 11 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/argv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char **argv) 4 | { 5 | for (int i = 0; i < argc; i++) { 6 | printf("%s\n", argv[i]); 7 | } 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /misc/vpv.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=vpv 4 | GenericName=Image viewer 5 | Categories=Viewer; 6 | Exec=vpv %F 7 | Icon=vpv 8 | MimeType=image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff; 9 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/options.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | reproc_stop_actions parse_stop_actions(reproc_stop_actions stop); 6 | 7 | int parse_options(reproc_options *options, const char *const *argv); 8 | -------------------------------------------------------------------------------- /src/collection_expression.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "fs.hpp" 7 | 8 | class ImageCollection; 9 | 10 | std::vector buildFilenamesFromExpression(const std::string& expr); 11 | -------------------------------------------------------------------------------- /external/lua/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /external/efsw/Makefile: -------------------------------------------------------------------------------- 1 | CPPFLAGS = -Iinclude -Isrc 2 | 3 | SRC = $(shell ls src/efsw/*.cpp src/efsw/platform/posix/*.cpp) 4 | OBJ = $(SRC:.cpp=.o) 5 | LIB = efsw.a 6 | 7 | $(LIB) : $(OBJ) ; $(AR) qc $(LIB) $(OBJ) 8 | clean : ; $(RM) $(LIB) $(OBJ) 9 | -------------------------------------------------------------------------------- /src/Progressable.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Progressable { 4 | public: 5 | virtual float getProgressPercentage() const = 0; 6 | virtual bool isLoaded() const = 0; 7 | virtual void progress() = 0; 8 | virtual ~Progressable() = default; 9 | }; 10 | -------------------------------------------------------------------------------- /src/watcher.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void watcher_initialize(); 7 | 8 | void watcher_add_file(const std::string& filename, const std::function& clb); 9 | 10 | void watcher_check(); 11 | -------------------------------------------------------------------------------- /.woodpecker/nix.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: nixpkgs/nix 4 | commands: 5 | - nix --extra-experimental-features nix-command --extra-experimental-features flakes flake check 6 | - nix --extra-experimental-features nix-command --extra-experimental-features flakes build . 7 | -------------------------------------------------------------------------------- /src/layout.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void nextLayout(); 8 | void previousLayout(); 9 | void freeLayout(); 10 | std::string getLayoutName(); 11 | 12 | void relayout(); 13 | 14 | void parseLayout(const std::string& str); 15 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // imguiex 4 | 5 | #import 6 | 7 | @interface AppDelegate : UIResponder 8 | 9 | @property (strong, nonatomic) UIWindow *window; 10 | 11 | 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /external/imgui/examples/null_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. *.cpp ..\..\*.cpp /FeDebug/null_example.exe /FoDebug/ /link gdi32.lib shell32.lib 4 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/env.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, const char **argv, const char **envp) 4 | { 5 | (void) argc; 6 | (void) argv; 7 | 8 | for (size_t i = 0; envp[i] != NULL; i++) { 9 | printf("%s\n", envp[i]); 10 | } 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/pid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | #include 5 | #define getpid (int) GetCurrentProcessId 6 | #else 7 | #include 8 | #endif 9 | 10 | int main(void) 11 | { 12 | printf("%d", getpid()); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/deadline.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | int main(void) 6 | { 7 | const char *argv[] = { RESOURCE_DIRECTORY "/deadline", NULL }; 8 | int r = reproc_run(argv, (reproc_options){ .deadline = 100 }); 9 | ASSERT(r == REPROC_SIGTERM); 10 | } 11 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/io.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | char input[8096]; 6 | 7 | if (fgets(input, sizeof(input), stdin) == NULL) { 8 | return 1; 9 | } 10 | 11 | fprintf(stdout, "%s", input); 12 | fprintf(stderr, "%s", input); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/plambda.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAMBDA_HEADER 2 | #define PLAMBDA_HEADER 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | float* execute_plambda(int n, float** x, int* w, int* h, int* pd, 9 | char* program, int* od, char** error); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/macro.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 4 | 5 | #define MIN(a, b) (a) < (b) ? (a) : (b) 6 | 7 | #if defined(_WIN32) && !defined(__MINGW32__) 8 | #define THREAD_LOCAL __declspec(thread) 9 | #else 10 | #define THREAD_LOCAL __thread 11 | #endif 12 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/overflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char buffer[8192]; 7 | 8 | for (int i = 0; i < 200; i++) { 9 | FILE *stream = rand() % 2 ? stdout : stderr; // NOLINT 10 | fprintf(stream, "%s", buffer); 11 | } 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/events.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | int getCode(const char* name); 6 | bool isKeyDown(const char* key); 7 | bool isKeyPressed(const char* key, bool repeat = true); 8 | bool isKeyReleased(const char* key); 9 | 10 | void stopTime(uint64_t ms); 11 | double /* in milliseconds */ letTimeFlow(uint64_t* t); 12 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/GameViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.h 3 | // imguiex 4 | 5 | // This is the OpenGL Example template from XCode, modified to support ImGui 6 | 7 | #import 8 | #import 9 | 10 | @interface GameViewController : GLKViewController 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /external/imgui/examples/libs/usynergy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | uSynergy client -- Implementation for the embedded Synergy client library 3 | version 1.0.0, July 7th, 2012 4 | Copyright (c) 2012 Alex Evans 5 | 6 | This is a copy of the files once found at: 7 | https://github.com/symless/synergy-core/tree/790d108a56ada9caad8e56ff777d444485a69da9/src/micro 8 | 9 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // imguiex 4 | // 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // imguiex-osx 4 | // 5 | // Created by James Chen on 4/5/16. 6 | // Copyright © 2016 Joel Davis. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // imguiex-osx 4 | // 5 | // Created by James Chen on 4/5/16. 6 | // Copyright © 2016 Joel Davis. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /external/reproc/reproc/reproc-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | set(REPROC_MULTITHREADED @REPROC_MULTITHREADED@) 4 | 5 | include(CMakeFindDependencyMacro) 6 | 7 | if(REPROC_MULTITHREADED) 8 | set(THREADS_PREFER_PTHREAD_FLAG ON) 9 | find_dependency(Threads) 10 | endif() 11 | 12 | include(${CMAKE_CURRENT_LIST_DIR}/@TARGET@-targets.cmake) 13 | -------------------------------------------------------------------------------- /cmake/modules/AddCXXFlagsIfSupported.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCXXCompilerFlag) 2 | 3 | function(add_cxx_flag_if_supported flags flag has) 4 | check_cxx_compiler_flag("${flag}" ${has}_CXX) 5 | if (${${has}_CXX}) 6 | set(${has} TRUE PARENT_SCOPE) 7 | set(${flags} "${${flags}} ${flag}" PARENT_SCOPE) 8 | endif() 9 | endfunction() 10 | 11 | -------------------------------------------------------------------------------- /external/imgui/examples/directx9_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I "%DXSDK_DIR%/Include" /D UNICODE /D _UNICODE *.cpp ..\..\*.cpp /FeDebug/directx9_example.exe /FoDebug/ /link /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d9.lib 4 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/glsl_shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=0, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct{ 7 | vec4 Color; 8 | vec2 UV; 9 | } In; 10 | 11 | void main() 12 | { 13 | fColor = In.Color * texture(sTexture, In.UV.st); 14 | } 15 | -------------------------------------------------------------------------------- /external/imgui/examples/opengl2_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\glfw\include *.cpp ..\..\*.cpp /FeDebug/opengl2_example.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 4 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/clock.windows.c: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_WINNT 2 | #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA 3 | #elif _WIN32_WINNT < 0x0600 4 | #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" 5 | #endif 6 | 7 | #include "clock.h" 8 | 9 | #include 10 | 11 | int64_t now(void) 12 | { 13 | return (int64_t) GetTickCount64(); 14 | } 15 | -------------------------------------------------------------------------------- /.woodpecker/fedora.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: fedora:latest 4 | commands: 5 | - dnf install -y make cmake gcc-c++ SDL2-devel libpng-devel libtiff-devel libjpeg-turbo-devel mesa-libGL-devel 6 | - mkdir build 7 | - cd build 8 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 9 | - make 10 | - ctest --output-on-failure 11 | - make install 12 | -------------------------------------------------------------------------------- /external/reproc/reproc++/reproc++-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | set(REPROC_MULTITHREADED @REPROC_MULTITHREADED@) 4 | 5 | include(CMakeFindDependencyMacro) 6 | find_dependency(reproc @PROJECT_VERSION@) 7 | 8 | if(REPROC_MULTITHREADED) 9 | set(THREADS_PREFER_PTHREAD_FLAG ON) 10 | find_dependency(Threads) 11 | endif() 12 | 13 | include(${CMAKE_CURRENT_LIST_DIR}/@TARGET@-targets.cmake) 14 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/clock.posix.c: -------------------------------------------------------------------------------- 1 | #define _POSIX_C_SOURCE 200809L 2 | 3 | #include "clock.h" 4 | 5 | #include 6 | 7 | #include "error.h" 8 | 9 | int64_t now(void) 10 | { 11 | struct timespec timespec = { 0 }; 12 | 13 | int r = clock_gettime(CLOCK_REALTIME, ×pec); 14 | ASSERT_UNUSED(r == 0); 15 | 16 | return timespec.tv_sec * 1000 + timespec.tv_nsec / 1000000; 17 | } 18 | -------------------------------------------------------------------------------- /external/imgui/examples/directx12_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /D UNICODE /D _UNICODE *.cpp ..\..\*.cpp /FeDebug/directx12_example.exe /FoDebug/ /link d3d12.lib d3dcompiler.lib dxgi.lib 4 | 5 | -------------------------------------------------------------------------------- /external/iio/npy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct npy_info { 6 | size_t header_offset; 7 | size_t dims[4]; 8 | int ndims; 9 | int type; 10 | int fortran_order; 11 | char desc[10]; 12 | }; 13 | 14 | int npy_read_header(FILE *fin, struct npy_info* ni); 15 | size_t npy_type_size(int type); 16 | float* npy_convert_to_float(void* src, int n, int src_fmt); 17 | 18 | -------------------------------------------------------------------------------- /.woodpecker/archlinux.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: archlinux 4 | commands: 5 | - pacman -Syu --noconfirm 6 | - pacman -S --noconfirm make gcc cmake sdl2 libpng libtiff libjpeg 7 | - pacman -S --noconfirm extra/cargo 8 | - mkdir build 9 | - cd build 10 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 11 | - make 12 | - ctest --output-on-failure 13 | - make install 14 | -------------------------------------------------------------------------------- /external/imgui/examples/opengl3_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\glfw\include /I ..\libs\gl3w *.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/opengl_example3.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 4 | -------------------------------------------------------------------------------- /.github/workflows/clang-format-check.yml: -------------------------------------------------------------------------------- 1 | name: clang-format Check 2 | on: [push] 3 | jobs: 4 | formatting-check: 5 | name: Formatting Check 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - name: Run clang-format style check for C/C++ programs. 10 | uses: jidicula/clang-format-action@v4.8.0 11 | with: 12 | clang-format-version: '19' 13 | check-path: 'src' 14 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Mutex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace efsw { 5 | 6 | Mutex::Mutex() : 7 | mMutexImpl( new Platform::MutexImpl() ) 8 | { 9 | } 10 | 11 | Mutex::~Mutex() 12 | { 13 | efSAFE_DELETE( mMutexImpl ); 14 | } 15 | 16 | void Mutex::lock() 17 | { 18 | mMutexImpl->lock(); 19 | } 20 | 21 | void Mutex::unlock() 22 | { 23 | mMutexImpl->unlock(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Lock.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_LOCK_HPP 2 | #define EFSW_LOCK_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | /** Simple mutex class */ 9 | class Lock { 10 | public: 11 | explicit Lock( Mutex& mutex ) : 12 | mMutex( mutex ) 13 | { 14 | mMutex.lock(); 15 | } 16 | 17 | ~Lock() 18 | { 19 | mMutex.unlock(); 20 | } 21 | private: 22 | Mutex& mMutex; 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Watcher.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace efsw { 4 | 5 | Watcher::Watcher() : 6 | ID(0), 7 | Directory(""), 8 | Listener(NULL), 9 | Recursive(false) 10 | { 11 | } 12 | 13 | Watcher::Watcher( WatchID id, std::string directory, FileWatchListener * listener, bool recursive ) : 14 | ID( id ), 15 | Directory( directory ), 16 | Listener( listener ), 17 | Recursive( recursive ) 18 | { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /external/imgui/examples/directx10_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" /D UNICODE /D _UNICODE *.cpp ..\..\*.cpp /FeDebug/directx10_example.exe /FoDebug/ /link /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d10.lib d3dcompiler.lib 4 | 5 | -------------------------------------------------------------------------------- /external/imgui/examples/directx11_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" /D UNICODE /D _UNICODE *.cpp ..\..\*.cpp /FeDebug/directx11_example.exe /FoDebug/ /link /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib 4 | 5 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/working-directory.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined(_WIN32) 4 | #include 5 | #define getcwd _getcwd 6 | #else 7 | #include 8 | #endif 9 | 10 | int main() 11 | { 12 | char working_directory[8096]; 13 | 14 | if (getcwd(working_directory, sizeof(working_directory)) == NULL) { 15 | return 1; 16 | } 17 | 18 | printf("%s", working_directory); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl2_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL2_DIR%\include main.cpp imgui_impl_sdl_gl2.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/sdl_opengl2_example.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 4 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl3_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL2_DIR%\include main.cpp imgui_impl_sdl_gl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/sdl_opengl3_example.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 4 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/overflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | int main(void) 6 | { 7 | const char *argv[] = { RESOURCE_DIRECTORY "/overflow", NULL }; 8 | char *output = NULL; 9 | reproc_sink sink = reproc_sink_string(&output); 10 | int r = -1; 11 | 12 | r = reproc_run_ex(argv, (reproc_options){ 0 }, sink, sink); 13 | ASSERT_OK(r); 14 | ASSERT(output != NULL); 15 | 16 | reproc_free(output); 17 | } 18 | -------------------------------------------------------------------------------- /external/reproc/reproc/reproc.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ 4 | libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ 5 | 6 | Name: @TARGET@ 7 | Description: @PROJECT_DESCRIPTION@ 8 | URL: @PROJECT_HOMEPAGE_URL@ 9 | Version: @PROJECT_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -l@TARGET@ 12 | Libs.private: @REPROC_THREAD_LIBRARY@ @REPROC_WINSOCK_LIBRARY@ @REPROC_RT_LIBRARY@ 13 | -------------------------------------------------------------------------------- /src/fuzzy-finder/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fuzzy-finder" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [dependencies] 7 | fuzzy-matcher = "0.3" 8 | ignore = "0.4" 9 | cxx = { version = "1.0", features = ["c++17"] } 10 | clru = "0.6" 11 | lexical-sort = "0.3" 12 | 13 | [dev-dependencies] 14 | tempfile = "3" 15 | 16 | [build-dependencies] 17 | cxx-build = { version = "1.0", features = ["parallel"] } 18 | 19 | [lib] 20 | crate-type = ["staticlib", "lib"] 21 | -------------------------------------------------------------------------------- /external/reproc/reproc++/reproc++.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ 4 | libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ 5 | 6 | Name: @TARGET@ 7 | Description: @PROJECT_DESCRIPTION@ 8 | URL: @PROJECT_HOMEPAGE_URL@ 9 | Version: @PROJECT_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -l@TARGET@ 12 | Libs.private: @REPROC_THREAD_LIBRARY@ 13 | Requires.private: reproc = @PROJECT_VERSION@ 14 | -------------------------------------------------------------------------------- /external/reproc/reproc/examples/path.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Redirects the output of the given command to the reproc.out file. 6 | int main(int argc, const char **argv) 7 | { 8 | (void) argc; 9 | 10 | int r = reproc_run(argv + 1, 11 | (reproc_options){ .redirect.path = "reproc.out" }); 12 | 13 | if (r < 0) { 14 | fprintf(stderr, "%s\n", reproc_strerror(r)); 15 | } 16 | 17 | return abs(r); 18 | } 19 | -------------------------------------------------------------------------------- /src/shaders.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "Shader.hpp" 8 | 9 | extern std::vector> gShaders; 10 | 11 | std::shared_ptr createShader(const std::string& tonemap, const std::string& name = ""); 12 | bool loadShader(const std::string& name, const std::string& tonemap); 13 | std::shared_ptr getShader(const std::string& name); 14 | -------------------------------------------------------------------------------- /external/reproc/reproc/resources/sleep.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | #include 5 | static inline void millisleep(long ms) 6 | { 7 | Sleep((DWORD) ms); 8 | } 9 | #else 10 | #define _POSIX_C_SOURCE 200809L 11 | #include 12 | static inline void millisleep(long ms) 13 | { 14 | nanosleep(&(struct timespec){ .tv_sec = (ms) / 1000, 15 | .tv_nsec = ((ms) % 1000L) * 1000000 }, 16 | NULL); 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /src/editors.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | struct Image; 8 | 9 | enum EditType { 10 | PLAMBDA, 11 | OCTAVE, 12 | }; 13 | 14 | std::shared_ptr edit_images(EditType edittype, const std::string& prog, 15 | const std::vector>& images, 16 | std::string& error); 17 | 18 | std::shared_ptr create_edited_collection(EditType edittype, const std::string& prog); 19 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/detail/type_traits.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace reproc { 6 | namespace detail { 7 | 8 | template 9 | using enable_if = typename std::enable_if::type; 10 | 11 | template 12 | using is_char_array = std::is_convertible; 13 | 14 | template 15 | using enable_if_not_char_array = enable_if::value>; 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /external/iio/AUTHORS: -------------------------------------------------------------------------------- 1 | CODE CONTRIBUTORS 2 | 3 | Enric Meinhardt-Llopis (initial coding) 4 | Gabriele Facciolo (many patches, python bindings, cmake files) 5 | Carlo de Franchis (patches) 6 | Juan Cardelino (cmake configuration, bug reports) 7 | Jérémy Anger (patches) 8 | Tina Nikoukhah (patches) 9 | 10 | 11 | 12 | ACKNOWLEDGEMENTS (testing, corrections and bug reports) 13 | 14 | Axel Davy 15 | Martin Etchart 16 | Roberto Pablo Pérez Palomares 17 | Nicolas Limare 18 | Rafael Grompone von Gioi 19 | -------------------------------------------------------------------------------- /src/strutils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "strutils.hpp" 3 | 4 | bool startswith(const std::string& fullString, const std::string& start) 5 | { 6 | return fullString.rfind(start, 0) == 0; 7 | } 8 | 9 | bool endswith(const std::string& fullString, const std::string& ending) 10 | { 11 | if (fullString.length() >= ending.length()) { 12 | return (0 == fullString.compare(fullString.length() - ending.length(), ending.length(), ending)); 13 | } else { 14 | return false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Mutex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_MUTEX_HPP 2 | #define EFSW_MUTEX_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | namespace Platform { class MutexImpl; } 9 | 10 | /** Simple mutex class */ 11 | class Mutex { 12 | public: 13 | Mutex(); 14 | 15 | ~Mutex(); 16 | 17 | /** Lock the mutex */ 18 | void lock(); 19 | 20 | /** Unlock the mutex */ 21 | void unlock(); 22 | private: 23 | Platform::MutexImpl * mMutexImpl; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /external/kaguya/include/kaguya/kaguya.hpp: -------------------------------------------------------------------------------- 1 | // Copyright satoren 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma once 7 | 8 | #include "kaguya/config.hpp" 9 | #include "kaguya/lua_ref.hpp" 10 | #include "kaguya/native_function.hpp" 11 | #include "kaguya/state.hpp" 12 | #include "kaguya/lua_ref_table.hpp" 13 | #include "kaguya/lua_ref_function.hpp" 14 | #include "kaguya/ref_tuple.hpp" 15 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/SystemImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_SYSTEMIMPLPOSIX_HPP 2 | #define EFSW_SYSTEMIMPLPOSIX_HPP 3 | 4 | #include 5 | 6 | #if defined( EFSW_PLATFORM_POSIX ) 7 | 8 | namespace efsw { namespace Platform { 9 | 10 | class System 11 | { 12 | public: 13 | static void sleep( const unsigned long& ms ); 14 | 15 | static std::string getProcessPath(); 16 | 17 | static void maxFD(); 18 | 19 | static Uint64 getMaxFD(); 20 | }; 21 | 22 | }} 23 | 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/SystemImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_SYSTEMIMPLWIN_HPP 2 | #define EFSW_SYSTEMIMPLWIN_HPP 3 | 4 | #include 5 | 6 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 7 | 8 | namespace efsw { namespace Platform { 9 | 10 | class System 11 | { 12 | public: 13 | static void sleep( const unsigned long& ms ); 14 | 15 | static std::string getProcessPath(); 16 | 17 | static void maxFD(); 18 | 19 | static Uint64 getMaxFD(); 20 | }; 21 | 22 | }} 23 | 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/System.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace efsw { 5 | 6 | void System::sleep( const unsigned long& ms ) 7 | { 8 | Platform::System::sleep( ms ); 9 | } 10 | 11 | std::string System::getProcessPath() 12 | { 13 | return Platform::System::getProcessPath(); 14 | } 15 | 16 | void System::maxFD() 17 | { 18 | Platform::System::maxFD(); 19 | } 20 | 21 | Uint64 System::getMaxFD() 22 | { 23 | return Platform::System::getMaxFD(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/MutexImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_MUTEXIMPLPOSIX_HPP 2 | #define EFSW_MUTEXIMPLPOSIX_HPP 3 | 4 | #include 5 | 6 | #if defined( EFSW_PLATFORM_POSIX ) 7 | 8 | #include 9 | 10 | namespace efsw { namespace Platform { 11 | 12 | class MutexImpl 13 | { 14 | public: 15 | MutexImpl(); 16 | 17 | ~MutexImpl(); 18 | 19 | void lock(); 20 | 21 | void unlock(); 22 | private: 23 | pthread_mutex_t mMutex; 24 | }; 25 | 26 | }} 27 | 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /.woodpecker/debian-stable.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: debian:stable 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /.woodpecker/debian-testing.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: debian:testing 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /.woodpecker/ubuntu-devel.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: ubuntu:devel 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /.woodpecker/ubuntu-focal.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: ubuntu:focal 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /.woodpecker/ubuntu-latest.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: ubuntu:latest 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /.woodpecker/ubuntu-rolling.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | build: 3 | image: ubuntu:rolling 4 | commands: 5 | - export DEBIAN_FRONTEND=noninteractive 6 | - apt-get update 7 | - apt-get install -qq build-essential cmake 8 | - apt-get install -qq libegl1-mesa-dev libgles2-mesa-dev 9 | - apt-get install -qq libsdl2-dev libpng-dev libtiff-dev libjpeg-dev 10 | - mkdir build 11 | - cd build 12 | - cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON 13 | - make 14 | - ctest --output-on-failure 15 | - make install 16 | -------------------------------------------------------------------------------- /external/reproc/reproc/examples/run.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Start a process from the arguments given on the command line. Inherit the 6 | // parent's standard streams and allow the process to run for maximum 5 seconds 7 | // before terminating it. 8 | int main(int argc, const char **argv) 9 | { 10 | (void) argc; 11 | 12 | int r = reproc_run(argv + 1, (reproc_options){ .deadline = 5000 }); 13 | 14 | if (r < 0) { 15 | fprintf(stderr, "%s\n", reproc_strerror(r)); 16 | } 17 | 18 | return abs(r); 19 | } 20 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/MutexImpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 4 | 5 | namespace efsw { namespace Platform { 6 | 7 | MutexImpl::MutexImpl() 8 | { 9 | InitializeCriticalSection(&mMutex); 10 | } 11 | 12 | MutexImpl::~MutexImpl() 13 | { 14 | DeleteCriticalSection(&mMutex); 15 | } 16 | 17 | void MutexImpl::lock() 18 | { 19 | EnterCriticalSection(&mMutex); 20 | } 21 | 22 | void MutexImpl::unlock() 23 | { 24 | LeaveCriticalSection(&mMutex); 25 | } 26 | 27 | }} 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/debug_hud.h: -------------------------------------------------------------------------------- 1 | // 2 | // debug_hud.h 3 | // imguiex 4 | 5 | #pragma once 6 | 7 | typedef struct DebugHUD 8 | { 9 | bool show_demo_window; 10 | bool show_another_window; 11 | float rotation_speed; 12 | float cubeColor1[4]; 13 | float cubeColor2[4]; 14 | float clearColor[4]; 15 | } DebugHUD; 16 | 17 | #if __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void DebugHUD_InitDefaults(DebugHUD *hud); 22 | void DebugHUD_DoInterface(DebugHUD *hud); 23 | 24 | #if __cplusplus 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /external/reproc/reproc/include/reproc/export.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef REPROC_EXPORT 4 | #ifdef _WIN32 5 | #ifdef REPROC_SHARED 6 | #ifdef REPROC_BUILDING 7 | #define REPROC_EXPORT __declspec(dllexport) 8 | #else 9 | #define REPROC_EXPORT __declspec(dllimport) 10 | #endif 11 | #else 12 | #define REPROC_EXPORT 13 | #endif 14 | #else 15 | #ifdef REPROC_BUILDING 16 | #define REPROC_EXPORT __attribute__((visibility("default"))) 17 | #else 18 | #define REPROC_EXPORT 19 | #endif 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/strutils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | template 6 | static void split(const std::string& s, Out result, const std::regex& re) 7 | { 8 | // https://stackoverflow.com/a/45204031 9 | std::sregex_token_iterator it { s.begin(), s.end(), re, -1 }; 10 | std::vector items { it, {} }; 11 | for (auto& i : items) { 12 | *(result++) = i; 13 | } 14 | } 15 | 16 | bool startswith(const std::string& fullString, const std::string& start); 17 | bool endswith(const std::string& fullString, const std::string& ending); 18 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/glsl_shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(push_constant) uniform uPushConstant{ 7 | vec2 uScale; 8 | vec2 uTranslate; 9 | } pc; 10 | 11 | out gl_PerVertex{ 12 | vec4 gl_Position; 13 | }; 14 | 15 | layout(location = 0) out struct{ 16 | vec4 Color; 17 | vec2 UV; 18 | } Out; 19 | 20 | void main() 21 | { 22 | Out.Color = aColor; 23 | Out.UV = aUV; 24 | gl_Position = vec4(aPos*pc.uScale+pc.uTranslate, 0, 1); 25 | } 26 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/export.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef REPROCXX_EXPORT 4 | #ifdef _WIN32 5 | #ifdef REPROCXX_SHARED 6 | #ifdef REPROCXX_BUILDING 7 | #define REPROCXX_EXPORT __declspec(dllexport) 8 | #else 9 | #define REPROCXX_EXPORT __declspec(dllimport) 10 | #endif 11 | #else 12 | #define REPROCXX_EXPORT 13 | #endif 14 | #else 15 | #ifdef REPROCXX_BUILDING 16 | #define REPROCXX_EXPORT __attribute__((visibility("default"))) 17 | #else 18 | #define REPROCXX_EXPORT 19 | #endif 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/MutexImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_MUTEXIMPLWIN_HPP 2 | #define EFSW_MUTEXIMPLWIN_HPP 3 | 4 | #include 5 | 6 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 7 | 8 | #ifndef WIN32_LEAN_AND_MEAN 9 | #define WIN32_LEAN_AND_MEAN 10 | #endif 11 | #include 12 | 13 | namespace efsw { namespace Platform { 14 | 15 | class MutexImpl 16 | { 17 | public: 18 | MutexImpl(); 19 | 20 | ~MutexImpl(); 21 | 22 | void lock(); 23 | 24 | void unlock(); 25 | private: 26 | CRITICAL_SECTION mMutex; 27 | }; 28 | 29 | }} 30 | 31 | #endif 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/WatcherInotify.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_WATCHERINOTIFY_HPP 2 | #define EFSW_WATCHERINOTIFY_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace efsw { 8 | 9 | class WatcherInotify : public Watcher 10 | { 11 | public: 12 | WatcherInotify(); 13 | 14 | WatcherInotify( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherInotify * parent = NULL ); 15 | 16 | bool inParentTree( WatcherInotify * parent ); 17 | 18 | WatcherInotify * Parent; 19 | 20 | FileInfo DirInfo; 21 | }; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /external/reproc/reproc++/examples/run.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Equivalent to reproc's run example but implemented using reproc++. 6 | int main(int argc, const char **argv) 7 | { 8 | (void) argc; 9 | 10 | int status = -1; 11 | std::error_code ec; 12 | 13 | reproc::options options; 14 | options.redirect.parent = true; 15 | options.deadline = reproc::milliseconds(5000); 16 | 17 | std::tie(status, ec) = reproc::run(argv + 1, options); 18 | 19 | if (ec) { 20 | std::cerr << ec.message() << std::endl; 21 | } 22 | 23 | return ec ? ec.value() : status; 24 | } 25 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/init.windows.c: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_WINNT 2 | #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA 3 | #elif _WIN32_WINNT < 0x0600 4 | #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" 5 | #endif 6 | 7 | #include "init.h" 8 | 9 | #include 10 | 11 | #include "error.h" 12 | 13 | int init(void) 14 | { 15 | WSADATA data; 16 | int r = WSAStartup(MAKEWORD(2, 2), &data); 17 | return -r; 18 | } 19 | 20 | void deinit(void) 21 | { 22 | int saved = WSAGetLastError(); 23 | 24 | int r = WSACleanup(); 25 | ASSERT_UNUSED(r == 0); 26 | 27 | WSASetLastError(saved); 28 | } 29 | -------------------------------------------------------------------------------- /cmake/modules/TargetEnableIPOIfSupported.cmake: -------------------------------------------------------------------------------- 1 | set(IPO_SUPPORTED OFF) 2 | if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0") 3 | include(CheckIPOSupported) 4 | check_ipo_supported(RESULT IPO_SUPPORTED) 5 | endif() 6 | 7 | function(target_enable_ipo_if_supported target) 8 | if(IPO_SUPPORTED) 9 | set_target_properties(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) 10 | set_target_properties(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) 11 | set_target_properties(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE) 12 | endif() 13 | endfunction() 14 | 15 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/System.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_SYSTEM_HPP 2 | #define EFSW_SYSTEM_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | class System 9 | { 10 | public: 11 | /// Sleep for x milliseconds 12 | static void sleep( const unsigned long& ms ); 13 | 14 | /// @return The process binary path 15 | static std::string getProcessPath(); 16 | 17 | /// Maximize the number of file descriptors allowed per process in the current OS 18 | static void maxFD(); 19 | 20 | /// @return The number of supported file descriptors for the process 21 | static Uint64 getMaxFD(); 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/ThreadImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_THREADIMPLPOSIX_HPP 2 | #define EFSW_THREADIMPLPOSIX_HPP 3 | 4 | #include 5 | 6 | #if defined( EFSW_PLATFORM_POSIX ) 7 | 8 | #include 9 | 10 | namespace efsw { 11 | 12 | class Thread; 13 | 14 | namespace Platform { 15 | 16 | class ThreadImpl 17 | { 18 | public: 19 | ThreadImpl( Thread * owner ); 20 | 21 | void wait(); 22 | 23 | void terminate(); 24 | protected: 25 | static void * entryPoint( void* userData ); 26 | 27 | pthread_t mThread; 28 | bool mIsActive; 29 | }; 30 | 31 | }} 32 | 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /external/imgui/examples/allegro5_example/imconfig_allegro5.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI ALLEGRO 5 EXAMPLE 3 | // See imconfig.h for the full template 4 | // Because Allegro doesn't support 16-bit vertex indices, we enable the compile-time option of imgui to use 32-bit indices 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | // Use 32-bit vertex indices because Allegro doesn't support 16-bit ones 10 | // This allows us to avoid converting vertices format at runtime 11 | #define ImDrawIdx int 12 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Watcher.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_WATCHERIMPL_HPP 2 | #define EFSW_WATCHERIMPL_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace efsw { 8 | 9 | /** @brief Base Watcher class */ 10 | class Watcher 11 | { 12 | public: 13 | Watcher(); 14 | 15 | Watcher( WatchID id, std::string directory, FileWatchListener * listener, bool recursive ); 16 | 17 | virtual ~Watcher() {} 18 | 19 | virtual void watch() {} 20 | 21 | WatchID ID; 22 | std::string Directory; 23 | FileWatchListener * Listener; 24 | bool Recursive; 25 | std::string OldFileName; 26 | }; 27 | 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/handle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #if defined(_WIN32) 7 | typedef void *handle_type; // `HANDLE` 8 | #else 9 | typedef int handle_type; // fd 10 | #endif 11 | 12 | extern const handle_type HANDLE_INVALID; 13 | 14 | // Sets the `FD_CLOEXEC` flag on the file descriptor. POSIX only. 15 | int handle_cloexec(handle_type handle, bool enable); 16 | 17 | // Closes `handle` if it is not an invalid handle and returns an invalid handle. 18 | // Does not overwrite the last system error if an error occurs while closing 19 | // `handle`. 20 | handle_type handle_destroy(handle_type handle); 21 | -------------------------------------------------------------------------------- /src/OpenGLDebug.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #define GLDEBUG() \ 9 | { \ 10 | GLenum e; \ 11 | while ((e = glGetError()) != GL_NO_ERROR) { \ 12 | std::printf("%s:%s:%d\n", getGLError(e), __FILE__, __LINE__); \ 13 | } \ 14 | } 15 | 16 | const char* getGLError(GLenum error); 17 | -------------------------------------------------------------------------------- /external/reproc/reproc/examples/env.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Runs a binary as a child process that prints all its environment variables to 6 | // stdout and exits. Additional environment variables (in the format A=B) passed 7 | // via the command line are added to the child process environment variables. 8 | int main(int argc, const char **argv) 9 | { 10 | (void) argc; 11 | 12 | const char *args[] = { RESOURCE_DIRECTORY "/env", NULL }; 13 | 14 | int r = reproc_run(args, (reproc_options){ .env.extra = argv + 1 }); 15 | 16 | if (r < 0) { 17 | fprintf(stderr, "%s\n", reproc_strerror(r)); 18 | } 19 | 20 | return abs(r); 21 | } 22 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/WatcherGeneric.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_WATCHERGENERIC_HPP 2 | #define EFSW_WATCHERGENERIC_HPP 3 | 4 | #include 5 | 6 | namespace efsw 7 | { 8 | 9 | class DirWatcherGeneric; 10 | 11 | class WatcherGeneric : public Watcher 12 | { 13 | public: 14 | FileWatcherImpl * WatcherImpl; 15 | DirWatcherGeneric * DirWatch; 16 | 17 | WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener * fwl, FileWatcherImpl * fw, bool recursive ); 18 | 19 | ~WatcherGeneric(); 20 | 21 | void watch(); 22 | 23 | void watchDir( std::string dir ); 24 | 25 | bool pathInWatches( std::string path ); 26 | }; 27 | 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // imguiex-osx 4 | // 5 | // Created by James Chen on 4/5/16. 6 | // Copyright © 2016 Joel Davis. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @property (weak) IBOutlet NSWindow *window; 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 19 | // Insert code here to initialize your application 20 | } 21 | 22 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /external/reproc/reproc++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | reproc_library(reproc++ CXX) 2 | 3 | target_link_libraries(reproc++ PRIVATE 4 | reproc 5 | $<$:Threads::Threads> 6 | ) 7 | 8 | target_sources( 9 | reproc++ 10 | PRIVATE src/reproc.cpp 11 | # We manually propagate reproc's object files until CMake adds support for 12 | # doing it automatically. 13 | INTERFACE $<$:$> 14 | ) 15 | 16 | reproc_example(reproc++ drain CXX) 17 | reproc_example(reproc++ forward CXX) 18 | reproc_example(reproc++ run CXX) 19 | 20 | if(REPROC_MULTITHREADED) 21 | reproc_example(reproc++ background CXX DEPENDS Threads::Threads) 22 | endif() 23 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/handle.windows.c: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_WINNT 2 | #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA 3 | #elif _WIN32_WINNT < 0x0600 4 | #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" 5 | #endif 6 | 7 | #include "handle.h" 8 | 9 | #include 10 | 11 | #include "error.h" 12 | 13 | const HANDLE HANDLE_INVALID = INVALID_HANDLE_VALUE; // NOLINT 14 | 15 | // `handle_cloexec` is POSIX-only. 16 | 17 | HANDLE handle_destroy(HANDLE handle) 18 | { 19 | if (handle == NULL || handle == HANDLE_INVALID) { 20 | return HANDLE_INVALID; 21 | } 22 | 23 | int r = CloseHandle(handle); 24 | ASSERT_UNUSED(r != 0); 25 | 26 | return HANDLE_INVALID; 27 | } 28 | -------------------------------------------------------------------------------- /src/Texture.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #define IMGUI_DEFINE_MATH_OPERATORS 8 | #include 9 | 10 | #include "Image.hpp" 11 | 12 | struct TextureTile { 13 | unsigned id; 14 | int x, y; 15 | size_t w, h; 16 | unsigned format; 17 | }; 18 | 19 | struct Texture { 20 | std::vector tiles; 21 | ImVec2 size; 22 | unsigned format = -1; 23 | 24 | ~Texture(); 25 | 26 | void upload(const Image& img, ImRect area, BandIndices bandidx = { 0, 1, 2 }); 27 | ImVec2 getSize() const { return size; } 28 | 29 | private: 30 | void create(size_t w, size_t h, unsigned format); 31 | }; 32 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/MutexImpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined( EFSW_PLATFORM_POSIX ) 4 | 5 | namespace efsw { namespace Platform { 6 | 7 | MutexImpl::MutexImpl() 8 | { 9 | pthread_mutexattr_t attributes; 10 | pthread_mutexattr_init(&attributes); 11 | pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE); 12 | pthread_mutex_init(&mMutex, &attributes); 13 | } 14 | 15 | MutexImpl::~MutexImpl() 16 | { 17 | pthread_mutex_destroy(&mMutex); 18 | } 19 | 20 | void MutexImpl::lock() 21 | { 22 | pthread_mutex_lock(&mMutex); 23 | } 24 | 25 | void MutexImpl::unlock() 26 | { 27 | pthread_mutex_unlock(&mMutex); 28 | } 29 | 30 | }} 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/DirectorySnapshotDiff.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace efsw { 4 | 5 | void DirectorySnapshotDiff::clear() 6 | { 7 | FilesCreated.clear(); 8 | FilesModified.clear(); 9 | FilesMoved.clear(); 10 | FilesDeleted.clear(); 11 | DirsCreated.clear(); 12 | DirsModified.clear(); 13 | DirsMoved.clear(); 14 | DirsDeleted.clear(); 15 | } 16 | 17 | bool DirectorySnapshotDiff::changed() 18 | { 19 | return !FilesCreated.empty() || 20 | !FilesModified.empty() || 21 | !FilesMoved.empty() || 22 | !FilesDeleted.empty() || 23 | !DirsCreated.empty() || 24 | !DirsModified.empty() || 25 | !DirsMoved.empty() || 26 | !DirsDeleted.empty(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of amd64/vcvars32.bat to setup 64-bit command-line compiler. 2 | 3 | mkdir Debug 4 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\glfw\include /I %VULKAN_SDK%\include *.cpp ..\..\*.cpp /FeDebug/vulkan_example.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 5 | 6 | mkdir Release 7 | cl /nologo /Zi /MD /Ox /Oi /I ..\.. /I ..\libs\glfw\include /I %VULKAN_SDK%\include *.cpp ..\..\*.cpp /FeRelease/vulkan_example.exe /FoRelease/ /link /LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 8 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | mkdir Debug 4 | cl /nologo /Zi /MD /I ..\.. /I ..\libs\glfw\include /I %VULKAN_SDK%\include *.cpp ..\..\*.cpp /FeDebug/vulkan_example.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 /libpath:%VULKAN_SDK%\lib32 glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 5 | 6 | mkdir Release 7 | cl /nologo /Zi /MD /Ox /Oi /I ..\.. /I ..\libs\glfw\include /I %VULKAN_SDK%\include *.cpp ..\..\*.cpp /FeRelease/vulkan_example.exe /FoRelease/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 /libpath:%VULKAN_SDK%\lib32 glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 8 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/utf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // `size` represents the entire size of `string`, including NUL-terminators. We 6 | // take the entire size because strings like the environment string passed to 7 | // CreateProcessW includes multiple NUL-terminators so we can't always rely on 8 | // `strlen` to calculate the string length for us. See the lpEnvironment 9 | // documentation of CreateProcessW: 10 | // https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw 11 | // Pass -1 as the size to have `utf16_from_utf8` calculate the size until (and 12 | // including) the first NUL terminator. 13 | wchar_t *utf16_from_utf8(const char *string, int size); 14 | -------------------------------------------------------------------------------- /src/OpenGLDebug.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "OpenGLDebug.hpp" 8 | 9 | const char* getGLError(GLenum error) 10 | { 11 | #define casereturn(x) \ 12 | case x: \ 13 | return #x 14 | switch (error) { 15 | casereturn(GL_INVALID_ENUM); 16 | casereturn(GL_INVALID_VALUE); 17 | casereturn(GL_INVALID_OPERATION); 18 | casereturn(GL_INVALID_FRAMEBUFFER_OPERATION); 19 | case GL_OUT_OF_MEMORY: 20 | std::fprintf(stderr, "%s:%d: out of memory\n", __FILE__, __LINE__); 21 | std::exit(1); 22 | default: 23 | case GL_NO_ERROR: 24 | return ""; 25 | } 26 | #undef casereturn 27 | } 28 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/Shaders/Shader.vsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.vsh 3 | // imguiex 4 | 5 | attribute vec4 position; 6 | attribute vec3 normal; 7 | 8 | varying lowp vec4 colorVarying; 9 | 10 | uniform vec3 diffuseColor; 11 | uniform mat4 modelViewProjectionMatrix; 12 | uniform mat3 normalMatrix; 13 | 14 | void main() 15 | { 16 | vec3 eyeNormal = normalize(normalMatrix * normal); 17 | vec3 lightPosition = vec3(0.0, 0.0, 1.0); 18 | 19 | float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); 20 | 21 | vec3 colorLit = diffuseColor * nDotVP; 22 | colorVarying = vec4( colorLit.x, colorLit.y, colorLit.z, 1.0 ); 23 | 24 | gl_Position = modelViewProjectionMatrix * position; 25 | } 26 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/platformimpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_PLATFORMIMPL_HPP 2 | #define EFSW_PLATFORMIMPL_HPP 3 | 4 | #include 5 | 6 | #if defined( EFSW_PLATFORM_POSIX ) 7 | #include 8 | #include 9 | #include 10 | #include 11 | #elif EFSW_PLATFORM == EFSW_PLATFORM_WIN32 12 | #include 13 | #include 14 | #include 15 | #include 16 | #else 17 | #error Thread, Mutex, and System not implemented for this platform. 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/EditGUI.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "editors.hpp" 6 | 7 | struct Sequence; 8 | 9 | #define MAX_VARS 10 10 | 11 | class EditGUI { 12 | float vars[MAX_VARS]; 13 | int nvars; 14 | 15 | public: 16 | std::string editprog; 17 | EditType edittype; 18 | 19 | EditGUI() 20 | : nvars(0) 21 | , editprog() 22 | , edittype(PLAMBDA) 23 | { 24 | for (int i = 0; i < MAX_VARS; i++) 25 | vars[i] = 0; 26 | } 27 | 28 | void display(Sequence& seq, bool focus); 29 | 30 | void validate(Sequence& seq); 31 | 32 | bool isEditing() const 33 | { 34 | return !editprog.empty(); 35 | } 36 | 37 | std::string getEditorName() const; 38 | }; 39 | -------------------------------------------------------------------------------- /misc/genluafiles.sh: -------------------------------------------------------------------------------- 1 | 2 | cat < 4 | #include 5 | #include 6 | 7 | int load_luafiles(lua_State* L) 8 | { 9 | (void) L; 10 | EOF 11 | 12 | for f in $@; do 13 | FILE_CONTENT=`cat $f \ 14 | | sed 's/"/\\\"/g' \ 15 | | sed 's/^\(.*\)$/"\1\\\n"/' 16 | ` 17 | cat < 2 | #include 3 | #include 4 | 5 | namespace efsw { 6 | 7 | FileWatcherImpl::FileWatcherImpl( FileWatcher * parent ) : 8 | mFileWatcher( parent ), 9 | mInitOK( false ), 10 | mIsGeneric( false ) 11 | { 12 | System::maxFD(); 13 | } 14 | 15 | FileWatcherImpl::~FileWatcherImpl() 16 | { 17 | } 18 | 19 | bool FileWatcherImpl::initOK() 20 | { 21 | return mInitOK; 22 | } 23 | 24 | bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link ) 25 | { 26 | return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) || -1 != String::strStartsWith( curPath, link ); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/FileSystemImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_FILESYSTEMIMPLPOSIX_HPP 2 | #define EFSW_FILESYSTEMIMPLPOSIX_HPP 3 | 4 | #include 5 | #include 6 | 7 | #if defined( EFSW_PLATFORM_POSIX ) 8 | 9 | namespace efsw { namespace Platform { 10 | 11 | class FileSystem 12 | { 13 | public: 14 | static FileInfoMap filesInfoFromPath( const std::string& path ); 15 | 16 | static char getOSSlash(); 17 | 18 | static bool isDirectory( const std::string& path ); 19 | 20 | static bool isRemoteFS( const std::string& directory ); 21 | 22 | static bool changeWorkingDirectory( const std::string & path ); 23 | 24 | static std::string getCurrentWorkingDirectory(); 25 | }; 26 | 27 | }} 28 | 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/WatcherInotify.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace efsw { 4 | 5 | WatcherInotify::WatcherInotify() : 6 | Watcher(), 7 | Parent( NULL ) 8 | { 9 | } 10 | 11 | WatcherInotify::WatcherInotify( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherInotify * parent ) : 12 | Watcher( id, directory, listener, recursive ), 13 | Parent( parent ), 14 | DirInfo( directory ) 15 | { 16 | } 17 | 18 | bool WatcherInotify::inParentTree( WatcherInotify * parent ) 19 | { 20 | WatcherInotify * tNext = Parent; 21 | 22 | while ( NULL != tNext ) 23 | { 24 | if ( tNext == parent ) 25 | { 26 | return true; 27 | } 28 | 29 | tNext = tNext->Parent; 30 | } 31 | 32 | return false; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/ThreadImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_THREADIMPLWIN_HPP 2 | #define EFSW_THREADIMPLWIN_HPP 3 | 4 | #include 5 | 6 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 7 | 8 | #ifndef WIN32_LEAN_AND_MEAN 9 | #define WIN32_LEAN_AND_MEAN 10 | #endif 11 | #include 12 | #include 13 | 14 | namespace efsw { 15 | 16 | class Thread; 17 | 18 | namespace Platform { 19 | 20 | class ThreadImpl 21 | { 22 | public: 23 | ThreadImpl( Thread * owner ); 24 | 25 | ~ThreadImpl(); 26 | 27 | void wait(); 28 | 29 | void terminate(); 30 | protected: 31 | static unsigned int __stdcall entryPoint(void* userData); 32 | 33 | HANDLE mThread; 34 | unsigned int mThreadId; 35 | }; 36 | 37 | }} 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/SVG.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | struct SVG { 11 | std::unique_ptr nsvg; 12 | std::string filename; 13 | bool valid; 14 | 15 | void draw(ImVec2 basepos, ImVec2 pos, float zoom) const; 16 | 17 | static std::shared_ptr get(const std::string& filename); 18 | static std::shared_ptr createFromString(const std::string& str); 19 | 20 | static std::unordered_map> cache; 21 | static void flushCache(); 22 | 23 | private: 24 | SVG(); 25 | void loadFromFile(const std::string& filename); 26 | void loadFromString(const std::string& str); 27 | }; 28 | -------------------------------------------------------------------------------- /src/config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace config { 7 | 8 | void load(); 9 | 10 | float get_float(const std::string& name); 11 | bool get_bool(const std::string& name); 12 | int get_int(const std::string& name); 13 | std::string get_string(const std::string& name); 14 | void load_shaders(); 15 | 16 | kaguya::State& get_lua(); 17 | 18 | } 19 | 20 | struct Sequence; 21 | struct Colormap; 22 | struct Player; 23 | struct View; 24 | struct Window; 25 | std::shared_ptr newSequence(std::shared_ptr c, std::shared_ptr p, std::shared_ptr v); 26 | std::shared_ptr newView(); 27 | std::shared_ptr newPlayer(); 28 | std::shared_ptr newColormap(); 29 | std::shared_ptr newWindow(); 30 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/FileSystemImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_FILESYSTEMIMPLWIN_HPP 2 | #define EFSW_FILESYSTEMIMPLWIN_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 9 | 10 | namespace efsw { namespace Platform { 11 | 12 | class FileSystem 13 | { 14 | public: 15 | static FileInfoMap filesInfoFromPath( const std::string& path ); 16 | 17 | static char getOSSlash(); 18 | 19 | static bool isDirectory( const std::string& path ); 20 | 21 | static bool isRemoteFS( const std::string& directory ); 22 | 23 | static bool changeWorkingDirectory( const std::string & path ); 24 | 25 | static std::string getCurrentWorkingDirectory(); 26 | }; 27 | 28 | }} 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/redirect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "handle.h" 6 | #include "pipe.h" 7 | 8 | int redirect_init(pipe_type *parent, 9 | handle_type *child, 10 | REPROC_STREAM stream, 11 | reproc_redirect redirect, 12 | bool nonblocking, 13 | handle_type out); 14 | 15 | handle_type redirect_destroy(handle_type child, REPROC_REDIRECT type); 16 | 17 | // Internal prototypes 18 | 19 | int redirect_parent(handle_type *child, REPROC_STREAM stream); 20 | 21 | int redirect_discard(handle_type *child, REPROC_STREAM stream); 22 | 23 | int redirect_file(handle_type *child, FILE *file); 24 | 25 | int redirect_path(handle_type *child, REPROC_STREAM stream, const char *path); 26 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/stop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | static void stop(REPROC_STOP action, int status) 6 | { 7 | int r = -1; 8 | 9 | reproc_t *process = reproc_new(); 10 | ASSERT(process); 11 | 12 | const char *argv[] = { RESOURCE_DIRECTORY "/stop", NULL }; 13 | 14 | r = reproc_start(process, argv, (reproc_options){ 0 }); 15 | ASSERT_OK(r); 16 | 17 | r = reproc_wait(process, 50); 18 | ASSERT(r == REPROC_ETIMEDOUT); 19 | 20 | reproc_stop_actions stop = { .first = { action, 500 } }; 21 | 22 | r = reproc_stop(process, stop); 23 | ASSERT_EQ_INT(r, status); 24 | 25 | reproc_destroy(process); 26 | } 27 | 28 | int main(void) 29 | { 30 | stop(REPROC_STOP_TERMINATE, REPROC_SIGTERM); 31 | stop(REPROC_STOP_KILL, REPROC_SIGKILL); 32 | } 33 | -------------------------------------------------------------------------------- /src/fs.hpp: -------------------------------------------------------------------------------- 1 | #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include) 2 | #if __has_include() && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) 3 | #define GHC_USE_STD_FS 4 | #include 5 | #include 6 | namespace fs { 7 | using namespace std::filesystem; 8 | using ifstream = std::ifstream; 9 | using ofstream = std::ofstream; 10 | using fstream = std::fstream; 11 | } 12 | #endif 13 | #endif 14 | #ifndef GHC_USE_STD_FS 15 | #include 16 | namespace fs { 17 | using namespace ghc::filesystem; 18 | using ifstream = ghc::filesystem::ifstream; 19 | using ofstream = ghc::filesystem::ofstream; 20 | using fstream = ghc::filesystem::fstream; 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Log.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace efsw { namespace Errors { 4 | 5 | static std::string LastError; 6 | 7 | std::string Log::getLastErrorLog() 8 | { 9 | return LastError; 10 | } 11 | 12 | Error Log::createLastError( Error err, std::string log ) 13 | { 14 | switch ( err ) 15 | { 16 | case FileNotFound: LastError = "File not found ( " + log + " )"; break; 17 | case FileRepeated: LastError = "File reapeated in watches ( " + log + " )"; break; 18 | case FileOutOfScope: LastError = "Symlink file out of scope ( " + log + " )"; break; 19 | case FileRemote: LastError = "File is located in a remote file system, use a generic watcher. ( " + log + " )"; break; 20 | case Unspecified: 21 | default: LastError = log; 22 | } 23 | 24 | return err; 25 | } 26 | 27 | }} 28 | -------------------------------------------------------------------------------- /src/DisplayArea.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Colormap.hpp" 6 | #include "Texture.hpp" 7 | 8 | struct Image; 9 | struct Colormap; 10 | struct View; 11 | struct Sequence; 12 | 13 | class DisplayArea { 14 | Texture texture; 15 | 16 | std::shared_ptr image; 17 | ImRect loadedRect; 18 | BandIndices loadedBands; 19 | 20 | public: 21 | DisplayArea() 22 | : image(nullptr) 23 | , loadedBands(BANDS_DEFAULT) 24 | { 25 | } 26 | 27 | void draw(const std::shared_ptr& image, ImVec2 pos, 28 | ImVec2 winSize, const Colormap& colormap, const View& view, float factor); 29 | ImVec2 getCurrentSize() const; 30 | 31 | private: 32 | void requestTextureArea(const std::shared_ptr& image, ImRect rect, BandIndices bandidx); 33 | }; 34 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Thread.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace efsw { 5 | 6 | Thread::Thread() : 7 | mThreadImpl(NULL), 8 | mEntryPoint(NULL) 9 | { 10 | } 11 | 12 | Thread::~Thread() 13 | { 14 | wait(); 15 | 16 | efSAFE_DELETE( mEntryPoint ); 17 | } 18 | 19 | void Thread::launch() 20 | { 21 | wait(); 22 | 23 | mThreadImpl = new Platform::ThreadImpl( this ); 24 | } 25 | 26 | void Thread::wait() 27 | { 28 | if ( mThreadImpl ) 29 | { 30 | mThreadImpl->wait(); 31 | 32 | efSAFE_DELETE( mThreadImpl ); 33 | } 34 | } 35 | 36 | void Thread::terminate() 37 | { 38 | if ( mThreadImpl ) 39 | { 40 | mThreadImpl->terminate(); 41 | 42 | efSAFE_DELETE( mThreadImpl ); 43 | } 44 | } 45 | 46 | void Thread::run() 47 | { 48 | mEntryPoint->run(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/handle.posix.c: -------------------------------------------------------------------------------- 1 | #define _POSIX_C_SOURCE 200809L 2 | 3 | #include "handle.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "error.h" 10 | 11 | const int HANDLE_INVALID = -1; 12 | 13 | int handle_cloexec(int handle, bool enable) 14 | { 15 | int r = -1; 16 | 17 | r = fcntl(handle, F_GETFD, 0); 18 | if (r < 0) { 19 | return -errno; 20 | } 21 | 22 | r = enable ? r | FD_CLOEXEC : r & ~FD_CLOEXEC; 23 | 24 | r = fcntl(handle, F_SETFD, r); 25 | if (r < 0) { 26 | return -errno; 27 | } 28 | 29 | return 0; 30 | } 31 | 32 | int handle_destroy(int handle) 33 | { 34 | if (handle == HANDLE_INVALID) { 35 | return HANDLE_INVALID; 36 | } 37 | 38 | int r = close(handle); 39 | ASSERT_UNUSED(r == 0); 40 | 41 | return HANDLE_INVALID; 42 | } 43 | -------------------------------------------------------------------------------- /src/ImageCache.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct Image; 7 | 8 | namespace ImageCache { 9 | 10 | bool has(const std::string& key); 11 | 12 | std::shared_ptr get(const std::string& key); 13 | std::shared_ptr getById(const std::string& id); // this is very bad 14 | 15 | void store(const std::string& key, std::shared_ptr image); 16 | 17 | bool remove(const std::string& key); 18 | bool remove_rec(const std::string& key); 19 | 20 | bool isFull(); 21 | 22 | void flush(); 23 | 24 | namespace Error { 25 | 26 | bool has(const std::string& key); 27 | 28 | std::string get(const std::string& key); 29 | 30 | void store(const std::string& key, const std::string& message); 31 | 32 | bool remove(const std::string& key); 33 | 34 | void flush(); 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/working-directory.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | static void replace(char *string, char old, char new) 6 | { 7 | for (size_t i = 0; i < strlen(string); i++) { 8 | string[i] = (char) (string[i] == old ? new : string[i]); 9 | } 10 | } 11 | 12 | int main(void) 13 | { 14 | const char *argv[] = { RESOURCE_DIRECTORY "/working-directory", NULL }; 15 | char *output = NULL; 16 | reproc_sink sink = reproc_sink_string(&output); 17 | int r = -1; 18 | 19 | r = reproc_run_ex(argv, 20 | (reproc_options){ .working_directory = RESOURCE_DIRECTORY }, 21 | sink, sink); 22 | ASSERT_OK(r); 23 | ASSERT(output != NULL); 24 | 25 | replace(output, '\\', '/'); 26 | ASSERT_EQ_STR(output, RESOURCE_DIRECTORY); 27 | 28 | reproc_free(output); 29 | } 30 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/imgui_impl_ios.h: -------------------------------------------------------------------------------- 1 | // ImGui iOS+OpenGL+Synergy binding 2 | // In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp. 3 | // Providing a standalone iOS application with Synergy integration makes this sample more verbose than others. It also hasn't been tested as much. 4 | // Refer to other examples to get an easier understanding of how to integrate ImGui into your existing application. 5 | 6 | // by Joel Davis (joeld42@gmail.com) 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | @interface ImGuiHelper : NSObject 14 | 15 | - (id) initWithView: (UIView *)view; 16 | 17 | - (void)connectServer: (NSString*)serverName; 18 | 19 | - (void)render; 20 | - (void)newFrame; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/input.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace reproc { 7 | 8 | class input { 9 | const uint8_t *data_ = nullptr; 10 | size_t size_ = 0; 11 | 12 | public: 13 | input() = default; 14 | 15 | input(const uint8_t *data, size_t size) : data_(data), size_(size) {} 16 | 17 | /*! Implicitly convert from string literals. */ 18 | template 19 | input(const char (&data)[N]) // NOLINT 20 | : data_(reinterpret_cast(data)), size_(N) 21 | {} 22 | 23 | input(const input &other) = default; 24 | input &operator=(const input &) = default; 25 | 26 | const uint8_t *data() const noexcept 27 | { 28 | return data_; 29 | } 30 | 31 | size_t size() const noexcept 32 | { 33 | return size_; 34 | } 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /external/reproc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12...3.21) 2 | 3 | project( 4 | reproc 5 | VERSION 14.2.4 6 | DESCRIPTION "Cross-platform C99/C++11 process library" 7 | HOMEPAGE_URL "https://github.com/DaanDeMeyer/reproc" 8 | LANGUAGES C 9 | ) 10 | 11 | # Common options and functions separated for easier reuse in other projects. 12 | include(cmake/reproc.cmake) 13 | 14 | option(REPROC++ "Build reproc++" ${REPROC_DEVELOP}) 15 | option( 16 | REPROC_MULTITHREADED 17 | "Use `pthread_sigmask` and link against the system's thread library" 18 | ON 19 | ) 20 | 21 | if(REPROC_MULTITHREADED) 22 | set(THREADS_PREFER_PTHREAD_FLAG ON) 23 | find_package(Threads REQUIRED) 24 | set(REPROC_THREAD_LIBRARY ${CMAKE_THREAD_LIBS_INIT}) 25 | endif() 26 | 27 | add_subdirectory(reproc) 28 | 29 | if(REPROC++) 30 | enable_language(CXX) 31 | add_subdirectory(reproc++) 32 | endif() 33 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl3_example/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's CLI 5 | 6 | ``` 7 | set SDL2DIR=path_to_your_sdl2_folder 8 | cl /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL2DIR%\include main.cpp imgui_impl_sdl_gl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /link /libpath:%SDL2DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 9 | ``` 10 | 11 | - On Linux and similar Unixes 12 | 13 | ``` 14 | c++ `sdl2-config --cflags` -I ../.. -I ../libs/gl3w main.cpp imgui_impl_sdl_gl3.cpp ../../imgui*.cpp ../libs/gl3w/GL/gl3w.c `sdl2-config --libs` -lGL -ldl -o sdl2example 15 | ``` 16 | 17 | - On Mac OS X 18 | 19 | ``` 20 | brew install sdl2 21 | c++ `sdl2-config --cflags` -I ../.. -I ../libs/gl3w main.cpp imgui_impl_sdl_gl3.cpp ../../imgui*.cpp ../libs/gl3w/GL/gl3w.c `sdl2-config --libs` -framework OpenGl -framework CoreFoundation -o sdl2example 22 | ``` 23 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/argv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | int main(void) 6 | { 7 | const char *argv[] = { RESOURCE_DIRECTORY "/argv", "\"argument 1\"", 8 | "\"argument 2\"", NULL }; 9 | char *output = NULL; 10 | reproc_sink sink = reproc_sink_string(&output); 11 | int r = -1; 12 | 13 | r = reproc_run_ex(argv, (reproc_options){ 0 }, sink, sink); 14 | ASSERT_OK(r); 15 | ASSERT(output != NULL); 16 | 17 | const char *current = output; 18 | 19 | for (size_t i = 0; i < 3; i++) { 20 | size_t size = strlen(argv[i]); 21 | 22 | ASSERT_GE_SIZE(strlen(current), size); 23 | ASSERT_EQ_MEM(current, argv[i], size); 24 | 25 | current += size; 26 | current += *current == '\r'; 27 | current += *current == '\n'; 28 | } 29 | 30 | ASSERT_EQ_SIZE(strlen(current), (size_t) 0); 31 | 32 | reproc_free(output); 33 | } 34 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/error.posix.c: -------------------------------------------------------------------------------- 1 | #define _POSIX_C_SOURCE 200809L 2 | 3 | #include "error.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "macro.h" 13 | 14 | const int REPROC_EINVAL = -EINVAL; 15 | const int REPROC_EPIPE = -EPIPE; 16 | const int REPROC_ETIMEDOUT = -ETIMEDOUT; 17 | const int REPROC_ENOMEM = -ENOMEM; 18 | const int REPROC_EWOULDBLOCK = -EWOULDBLOCK; 19 | 20 | enum { ERROR_STRING_MAX_SIZE = 512 }; 21 | 22 | const char *error_string(int error) 23 | { 24 | static THREAD_LOCAL char string[ERROR_STRING_MAX_SIZE]; 25 | 26 | if(error == INT_MIN) 27 | return "Failed to retrieve error string"; 28 | 29 | int r = strerror_r(abs(error), string, ARRAY_SIZE(string)); 30 | if (r != 0) { 31 | return "Failed to retrieve error string"; 32 | } 33 | 34 | return string; 35 | } 36 | -------------------------------------------------------------------------------- /external/imgui/examples/marmalade_example/data/app.icf: -------------------------------------------------------------------------------- 1 | # This file is for configuration settings for your 2 | # application. 3 | # 4 | # The syntax is similar to windows .ini files ie 5 | # 6 | # [GroupName] 7 | # Setting = Value 8 | # 9 | # Which can be read by your application using 10 | # e.g s3eConfigGetString("GroupName", "Setting", string) 11 | # 12 | # All settings must be documented in .config.txt files. 13 | # New settings specific to this application should be 14 | # documented in app.config.txt 15 | # 16 | # Some conditional operations are also permitted, see the 17 | # S3E documentation for details. 18 | 19 | [S3E] 20 | MemSize=6000000 21 | MemSizeDebug=6000000 22 | DispFixRot=FixedLandscape 23 | 24 | # emulate iphone 5 resolution, change these settings to emulate other display resolution 25 | WinWidth=1136 26 | WinHeight=640 27 | 28 | [GX] 29 | DataCacheSize=131070 30 | 31 | [Util] 32 | #MemoryBreakpoint=1282 33 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/DirectorySnapshotDiff.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_DIRECTORYSNAPSHOTDIFF_HPP 2 | #define EFSW_DIRECTORYSNAPSHOTDIFF_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | class DirectorySnapshotDiff 9 | { 10 | public: 11 | FileInfoList FilesDeleted; 12 | FileInfoList FilesCreated; 13 | FileInfoList FilesModified; 14 | MovedList FilesMoved; 15 | FileInfoList DirsDeleted; 16 | FileInfoList DirsCreated; 17 | FileInfoList DirsModified; 18 | MovedList DirsMoved; 19 | bool DirChanged; 20 | 21 | void clear(); 22 | 23 | bool changed(); 24 | }; 25 | 26 | #define DiffIterator( FileInfoListName ) it = Diff.FileInfoListName.begin(); \ 27 | for ( ; it != Diff.FileInfoListName.end(); it++ ) 28 | 29 | #define DiffMovedIterator( MovedListName ) mit = Diff.MovedListName.begin(); \ 30 | for ( ; mit != Diff.MovedListName.end(); mit++ ) 31 | 32 | } 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/path.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | int main(void) 6 | { 7 | const char *argv[] = { RESOURCE_DIRECTORY "/path", NULL }; 8 | int r = -1; 9 | 10 | r = reproc_run(argv, (reproc_options){ .redirect.path = "path.txt" }); 11 | ASSERT_OK(r); 12 | 13 | FILE *file = fopen("path.txt", "rb"); 14 | ASSERT(file != NULL); 15 | 16 | r = fseek(file, 0, SEEK_END); 17 | ASSERT_OK(r); 18 | 19 | r = (int) ftell(file); 20 | ASSERT_OK(r); 21 | 22 | size_t size = (size_t) r; 23 | char *string = malloc(size + 1); 24 | ASSERT(string != NULL); 25 | 26 | rewind(file); 27 | r = (int) fread(string, sizeof(char), size, file); 28 | ASSERT_EQ_INT(r, (int) size); 29 | 30 | string[r] = '\0'; 31 | 32 | r = fclose(file); 33 | ASSERT_OK(r); 34 | 35 | r = remove("path.txt"); 36 | ASSERT_OK(r); 37 | 38 | ASSERT_EQ_STR(string, argv[0]); 39 | 40 | free(string); 41 | } 42 | -------------------------------------------------------------------------------- /src/View.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | struct View { 9 | std::string ID; 10 | 11 | float zoom; 12 | ImVec2 center; 13 | bool shouldRescale; 14 | ImVec2 svgOffset; 15 | 16 | View(); 17 | 18 | bool operator==(const View& other); 19 | 20 | void resetZoom(); 21 | void changeZoom(float zoom); 22 | void setOptimalZoom(ImVec2 winSize, ImVec2 texSize, float zoomfactor); 23 | 24 | ImVec2 image2window(const ImVec2& im, const ImVec2& imSize, const ImVec2& winSize, float zoomfactor) const; 25 | ImVec2 window2image(const ImVec2& win, const ImVec2& imSize, const ImVec2& winSize, float zoomfactor) const; 26 | 27 | void displaySettings(); 28 | 29 | void onSequenceAttach(std::weak_ptr s) { } 30 | void onSequenceDetach(std::weak_ptr s) { } 31 | 32 | bool parseArg(const std::string& arg); 33 | }; 34 | -------------------------------------------------------------------------------- /external/imgui/examples/marmalade_example/marmalade_example.mkb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env mkb 2 | 3 | # ImGui - standalone example application for Marmalade 4 | # Copyright (C) 2015 by Giovanni Zito 5 | # This file is part of ImGui 6 | # https://github.com/ocornut/imgui 7 | 8 | define IMGUI_DISABLE_INCLUDE_IMCONFIG_H 9 | define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS 10 | define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS 11 | define _snprintf=snprintf 12 | 13 | options 14 | { 15 | optimise-speed=1 16 | } 17 | 18 | includepaths 19 | { 20 | ../.. 21 | } 22 | 23 | subprojects 24 | { 25 | iwgx 26 | } 27 | 28 | files 29 | { 30 | (.) 31 | ["imgui"] 32 | ../../imgui.cpp 33 | ../../imgui_demo.cpp 34 | ../../imgui_draw.cpp 35 | ../../imconfig.h 36 | ../../imgui.h 37 | ../../imgui_internal.h 38 | 39 | ["imgui","Marmalade binding"] 40 | imgui_impl_marmalade.h 41 | imgui_impl_marmalade.cpp 42 | main.cpp 43 | 44 | } 45 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/fork.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "assert.h" 8 | 9 | int main(void) 10 | { 11 | reproc_t *process = reproc_new(); 12 | const char *MESSAGE = "reproc stands for REdirected PROCess!"; 13 | char *output = NULL; 14 | reproc_sink sink = reproc_sink_string(&output); 15 | int r = -1; 16 | 17 | r = reproc_start(process, NULL, (reproc_options){ .fork = true }); 18 | 19 | if (r == 0) { 20 | printf("%s", MESSAGE); 21 | fclose(stdout); // `_exit` doesn't flush stdout. 22 | _exit(EXIT_SUCCESS); 23 | } 24 | 25 | ASSERT_OK(r); 26 | 27 | r = reproc_drain(process, sink, sink); 28 | ASSERT_OK(r); 29 | 30 | ASSERT(output != NULL); 31 | ASSERT_EQ_STR(output, MESSAGE); 32 | 33 | r = reproc_wait(process, REPROC_INFINITE); 34 | ASSERT_OK(r); 35 | 36 | reproc_destroy(process); 37 | 38 | reproc_free(output); 39 | } 40 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/pid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "assert.h" 8 | 9 | int main(void) 10 | { 11 | const char *argv[] = { RESOURCE_DIRECTORY "/pid", NULL }; 12 | char *output = NULL; 13 | reproc_sink sink = reproc_sink_string(&output); 14 | int r = -1; 15 | 16 | reproc_t *process = reproc_new(); 17 | ASSERT(process); 18 | 19 | ASSERT(reproc_pid(process) == REPROC_EINVAL); 20 | 21 | r = reproc_start(process, argv, (reproc_options){ 0 }); 22 | ASSERT_OK(r); 23 | 24 | r = reproc_drain(process, sink, sink); 25 | ASSERT_OK(r); 26 | ASSERT(output != NULL); 27 | 28 | ASSERT(reproc_pid(process) == strtol(output, NULL, 10)); 29 | 30 | r = reproc_wait(process, REPROC_INFINITE); 31 | ASSERT_OK(r); 32 | 33 | ASSERT(reproc_pid(process) == strtol(output, NULL, 10)); 34 | 35 | reproc_destroy(process); 36 | reproc_free(output); 37 | } 38 | -------------------------------------------------------------------------------- /external/nanosvg/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-14 Mikko Mononen memon@inside.org 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | -------------------------------------------------------------------------------- /external/lua/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | /* 22 | ** Encode major-minor version in one byte, one nibble for each 23 | */ 24 | #define LUAC_VERSION (((LUA_VERSION_NUM / 100) * 16) + LUA_VERSION_NUM % 100) 25 | 26 | #define LUAC_FORMAT 0 /* this is the official format */ 27 | 28 | /* load one chunk; from lundump.c */ 29 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 30 | 31 | /* dump one chunk; from ldump.c */ 32 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 33 | void* data, int strip); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/globals.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Terminal.hpp" 6 | #include "globals.hpp" 7 | 8 | std::vector> gSequences; 9 | std::vector> gViews; 10 | std::vector> gPlayers; 11 | std::vector> gWindows; 12 | std::vector> gColormaps; 13 | bool gSelecting; 14 | ImVec2 gSelectionFrom; 15 | ImVec2 gSelectionTo; 16 | bool gSelectionShown; 17 | ImVec2 gHoveredPixel; 18 | bool gShowHud; 19 | std::array gShowSVGs; 20 | bool gShowMenuBar; 21 | bool gShowHistogram; 22 | bool gShowMiniview; 23 | int gShowWindowBar; 24 | int gWindowBorder; 25 | bool gShowImage; 26 | float gDefaultFramerate; 27 | int gDownsamplingQuality; 28 | size_t gCacheLimitMB; 29 | bool gSmoothHistogram; 30 | bool gForceIioOpen; 31 | int gActive; 32 | int gShowView; 33 | bool gReloadImages; 34 | bool gShowHelp = false; 35 | 36 | Terminal term; 37 | Terminal& gTerminal = term; 38 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | env: 6 | BUILD_TYPE: Debug 7 | 8 | jobs: 9 | build-macos: 10 | runs-on: macos-latest 11 | strategy: 12 | fail-fast: false 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Install dependencies 18 | shell: bash 19 | run: brew install sdl2 rust #dylibbundler 20 | 21 | - name: Create Build Environment 22 | run: cmake -E make_directory ${{github.workspace}}/build 23 | 24 | - name: Configure CMake 25 | shell: bash 26 | working-directory: ${{github.workspace}}/build 27 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=ON 28 | 29 | - name: Build 30 | working-directory: ${{github.workspace}}/build 31 | shell: bash 32 | run: cmake --build . --config $BUILD_TYPE -v 33 | 34 | - name: Test 35 | working-directory: ${{github.workspace}}/build 36 | shell: bash 37 | run: ctest --output-on-failure 38 | 39 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/WatcherGeneric.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace efsw 6 | { 7 | 8 | WatcherGeneric::WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener * fwl, FileWatcherImpl * fw, bool recursive ) : 9 | Watcher( id, directory, fwl, recursive ), 10 | WatcherImpl( fw ), 11 | DirWatch( NULL ) 12 | { 13 | FileSystem::dirAddSlashAtEnd( Directory ); 14 | 15 | DirWatch = new DirWatcherGeneric( NULL, this, directory, recursive, false ); 16 | 17 | DirWatch->addChilds( false ); 18 | } 19 | 20 | WatcherGeneric::~WatcherGeneric() 21 | { 22 | efSAFE_DELETE( DirWatch ); 23 | } 24 | 25 | void WatcherGeneric::watch() 26 | { 27 | DirWatch->watch(); 28 | } 29 | 30 | void WatcherGeneric::watchDir( std::string dir ) 31 | { 32 | DirWatch->watchDir( dir ); 33 | } 34 | 35 | bool WatcherGeneric::pathInWatches( std::string path ) 36 | { 37 | return DirWatch->pathInWatches( path ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/DirectorySnapshot.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_DIRECTORYSNAPSHOT_HPP 2 | #define EFSW_DIRECTORYSNAPSHOT_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | class DirectorySnapshot 9 | { 10 | public: 11 | FileInfo DirectoryInfo; 12 | FileInfoMap Files; 13 | 14 | void setDirectoryInfo( std::string directory ); 15 | 16 | DirectorySnapshot(); 17 | 18 | DirectorySnapshot( std::string directory ); 19 | 20 | ~DirectorySnapshot(); 21 | 22 | void init( std::string directory ); 23 | 24 | bool exists(); 25 | 26 | DirectorySnapshotDiff scan(); 27 | 28 | FileInfoMap::iterator nodeInFiles( FileInfo& fi ); 29 | 30 | void addFile( std::string path ); 31 | 32 | void removeFile( std::string path ); 33 | 34 | void moveFile( std::string oldPath, std::string newPath ); 35 | 36 | void updateFile( std::string path ); 37 | protected: 38 | void initFiles(); 39 | 40 | void deleteAll( DirectorySnapshotDiff &Diff ); 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /external/reproc/reproc/include/reproc/run.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /*! Sets `options.redirect.parent = true` unless `discard` is set and calls 11 | `reproc_run_ex` with `REPROC_SINK_NULL` for the `out` and `err` sinks. */ 12 | REPROC_EXPORT int reproc_run(const char *const *argv, reproc_options options); 13 | 14 | /*! 15 | Wrapper function that starts a process with the given arguments, drain its 16 | output and waits until it exits. Have a look at its (trivial) implementation and 17 | the documentation of the functions it calls to see exactly what it does: 18 | https://github.com/DaanDeMeyer/reproc/blob/master/reproc/src/run.c 19 | */ 20 | REPROC_EXPORT int reproc_run_ex(const char *const *argv, 21 | reproc_options options, 22 | reproc_sink out, 23 | reproc_sink err); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /src/Terminal.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "LoadingThread.hpp" 11 | 12 | struct CommandResult { 13 | std::string out; 14 | std::string err; 15 | int status; 16 | }; 17 | 18 | class Terminal { 19 | friend class Process; 20 | 21 | std::mutex lock; 22 | std::map cache; 23 | 24 | public: 25 | std::string bufcommand; 26 | std::string command; 27 | CommandResult currentResult; 28 | enum State { NO_COMMAND, 29 | RUNNING, 30 | FINISHED } state 31 | = NO_COMMAND; 32 | bool shown; 33 | bool focusInput; 34 | std::unique_ptr> runner; 35 | std::deque queuecommands; 36 | 37 | void updateOutput(); 38 | 39 | Terminal(); 40 | ~Terminal(); 41 | 42 | void setVisible(bool visible); 43 | void tick(); 44 | void stopAllAndJoin(); 45 | }; 46 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/env.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "assert.h" 4 | 5 | int main(void) 6 | { 7 | const char *argv[] = { RESOURCE_DIRECTORY "/env", NULL }; 8 | const char *envp[] = { "IP=127.0.0.1", "PORT=8080", NULL }; 9 | char *output = NULL; 10 | reproc_sink sink = reproc_sink_string(&output); 11 | int r = -1; 12 | 13 | r = reproc_run_ex(argv, 14 | (reproc_options){ .env.behavior = REPROC_ENV_EMPTY, 15 | .env.extra = envp }, 16 | sink, sink); 17 | ASSERT_OK(r); 18 | ASSERT(output != NULL); 19 | 20 | const char *current = output; 21 | 22 | for (size_t i = 0; i < 2; i++) { 23 | size_t size = strlen(envp[i]); 24 | 25 | ASSERT_GE_SIZE(strlen(current), size); 26 | ASSERT_EQ_MEM(current, envp[i], size); 27 | 28 | current += size; 29 | current += *current == '\r'; 30 | current += *current == '\n'; 31 | } 32 | 33 | ASSERT_EQ_SIZE(strlen(current), (size_t) 0); 34 | 35 | reproc_free(output); 36 | } 37 | -------------------------------------------------------------------------------- /src/Image.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #if 0 12 | struct ImageTile { 13 | unsigned id; 14 | int x, y; 15 | size_t w, h, c; 16 | size_t scale; 17 | std::vector pixels; 18 | }; 19 | #endif 20 | 21 | using BandIndices = std::array; 22 | #define BANDS_DEFAULT (BandIndices { 0, 1, 2 }) 23 | 24 | class Histogram; 25 | 26 | struct Image { 27 | std::string ID; 28 | float* pixels; 29 | size_t w, h, c; 30 | ImVec2 size; 31 | float min; 32 | float max; 33 | uint64_t lastUsed; 34 | std::shared_ptr histogram; 35 | 36 | std::set usedBy; 37 | 38 | Image(float* pixels, size_t w, size_t h, size_t c); 39 | ~Image(); 40 | 41 | void getPixelValueAt(size_t x, size_t y, float* values, size_t d) const; 42 | std::array getPixelValueAtBands(size_t x, size_t y, BandIndices bands, float* values) const; 43 | }; 44 | -------------------------------------------------------------------------------- /external/lua/src/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /external/imgui/examples/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /external/imscript/xmalloc.c: -------------------------------------------------------------------------------- 1 | #ifndef _XMALLOC_C 2 | #define _XMALLOC_C 3 | 4 | #include 5 | 6 | #include "fail.c" 7 | 8 | static void *xmalloc(size_t size) 9 | { 10 | #ifndef NDEBUG 11 | { 12 | double sm = size / (0x100000 * 1.0); 13 | if (sm > 1000) 14 | fprintf(stderr, "WARNING: large malloc" 15 | " %zu bytes (%gMB)\n", size, sm); 16 | } 17 | #endif 18 | if (size == 0) 19 | fail("xmalloc: zero size"); 20 | void *new = malloc(size); 21 | if (!new) 22 | { 23 | double sm = size / (0x100000 * 1.0); 24 | fail("xmalloc: out of memory when requesting " 25 | "%zu bytes (%gMB)",//:\"%s\"", 26 | size, sm);//, strerror(errno)); 27 | } 28 | return new; 29 | } 30 | 31 | inline // to avoid unused warnings 32 | static void *xrealloc(void *p, size_t s) 33 | { 34 | void *r = realloc(p, s); 35 | if (!r) fail("realloc failed"); 36 | return r; 37 | } 38 | 39 | inline // to avoid unused warnings 40 | static void xfree(void *p) 41 | { 42 | if (!p) 43 | fail("thou shalt not free a null pointer!"); 44 | free(p); 45 | } 46 | 47 | #endif//_XMALLOC_C 48 | -------------------------------------------------------------------------------- /src/LoadingThread.cpp: -------------------------------------------------------------------------------- 1 | #include "Progressable.hpp" 2 | #include "events.hpp" 3 | #include "globals.hpp" 4 | 5 | #include "LoadingThread.hpp" 6 | 7 | bool LoadingThread::tick() 8 | { 9 | // load the queue 10 | if (!queue.empty()) { 11 | std::shared_ptr p = queue.back(); 12 | p->progress(); 13 | // if the provider is used somewhere else, refresh the screen 14 | // 2 because queue + local variable p 15 | if (p.use_count() != 2) { 16 | gActive = std::max(gActive, 2); 17 | } 18 | if (p->isLoaded()) { 19 | queue.pop(); 20 | } 21 | } 22 | 23 | if (!queue.empty()) { 24 | return false; 25 | } 26 | 27 | std::shared_ptr p = getnew(); 28 | if (p) { 29 | queue.push(p); 30 | return false; 31 | } 32 | 33 | return true; 34 | } 35 | 36 | void LoadingThread::run() 37 | { 38 | while (running) { 39 | bool canrest = tick(); 40 | if (canrest) { 41 | stopTime(10); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /external/reproc/reproc/examples/parent.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | // Forwards the provided command to `reproc_start` and redirects the standard 6 | // streams of the child process to the standard streams of the parent process. 7 | int main(int argc, const char **argv) 8 | { 9 | if (argc <= 1) { 10 | fprintf(stderr, 11 | "No arguments provided. Example usage: ./inherit cmake --help"); 12 | return EXIT_FAILURE; 13 | } 14 | 15 | reproc_t *process = NULL; 16 | int r = REPROC_ENOMEM; 17 | 18 | process = reproc_new(); 19 | if (process == NULL) { 20 | goto finish; 21 | } 22 | 23 | r = reproc_start(process, argv + 1, 24 | (reproc_options){ .redirect.parent = true }); 25 | if (r < 0) { 26 | goto finish; 27 | } 28 | 29 | r = reproc_wait(process, REPROC_INFINITE); 30 | if (r < 0) { 31 | goto finish; 32 | } 33 | 34 | finish: 35 | reproc_destroy(process); 36 | 37 | if (r < 0) { 38 | fprintf(stderr, "%s\n", reproc_strerror(r)); 39 | } 40 | 41 | return abs(r); 42 | } 43 | -------------------------------------------------------------------------------- /src/FuzzyFinder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "fuzzy-finder.hpp" 8 | 9 | class FuzzyFinderForSequence { 10 | 11 | rust::Box matcher; 12 | 13 | std::weak_ptr currentCollection; 14 | rust::Vec filenames; 15 | 16 | rust::Vec matches; 17 | char buf[1024] = { 0 }; 18 | 19 | int current; 20 | bool focus; 21 | 22 | rust::Vec computeMatches(const std::string& pattern) 23 | { 24 | auto values = rust::Slice(filenames.data(), filenames.size()); 25 | auto matches = matcher->matches(values, pattern); 26 | return matches; 27 | } 28 | 29 | void extractFilenames(const std::shared_ptr col); 30 | 31 | public: 32 | FuzzyFinderForSequence() 33 | : matcher(fuzzyfinder::fuzzy_string_matcher()) 34 | { 35 | } 36 | 37 | void open(); 38 | void display(struct Sequence&); 39 | }; 40 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/detail/array.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace reproc { 6 | namespace detail { 7 | 8 | class array { 9 | const char *const *data_; 10 | bool owned_; 11 | 12 | public: 13 | array(const char *const *data, bool owned) noexcept 14 | : data_(data), owned_(owned) 15 | {} 16 | 17 | array(array &&other) noexcept : data_(other.data_), owned_(other.owned_) 18 | { 19 | other.data_ = nullptr; 20 | other.owned_ = false; 21 | } 22 | 23 | array &operator=(array &&other) noexcept 24 | { 25 | if (&other != this) { 26 | data_ = other.data_; 27 | owned_ = other.owned_; 28 | other.data_ = nullptr; 29 | other.owned_ = false; 30 | } 31 | 32 | return *this; 33 | } 34 | 35 | ~array() noexcept 36 | { 37 | if (owned_) { 38 | for (size_t i = 0; data_[i] != nullptr; i++) { 39 | delete[] data_[i]; 40 | } 41 | 42 | delete[] data_; 43 | } 44 | } 45 | 46 | const char *const *data() const noexcept 47 | { 48 | return data_; 49 | } 50 | }; 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /external/imgui/examples/null_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - null/dummy example application (compile and link imgui with no inputs, no outputs) 2 | #include "imgui.h" 3 | #include 4 | 5 | int main(int, char**) 6 | { 7 | IMGUI_CHECKVERSION(); 8 | ImGui::CreateContext(); 9 | ImGuiIO& io = ImGui::GetIO(); 10 | 11 | // Build atlas 12 | unsigned char* tex_pixels = NULL; 13 | int tex_w, tex_h; 14 | io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); 15 | 16 | for (int n = 0; n < 50; n++) 17 | { 18 | printf("NewFrame() %d\n", n); 19 | io.DisplaySize = ImVec2(1920, 1080); 20 | io.DeltaTime = 1.0f / 60.0f; 21 | ImGui::NewFrame(); 22 | 23 | static float f = 0.0f; 24 | ImGui::Text("Hello, world!"); 25 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 26 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); 27 | ImGui::ShowDemoWindow(NULL); 28 | 29 | ImGui::Render(); 30 | } 31 | 32 | printf("DestroyContext()\n"); 33 | ImGui::DestroyContext(); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /external/reproc/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Daan De Meyer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/run.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace reproc { 7 | 8 | template 9 | std::pair 10 | run(const arguments &arguments, const options &options, Out &&out, Err &&err) 11 | { 12 | process process; 13 | std::error_code ec; 14 | 15 | ec = process.start(arguments, options); 16 | if (ec) { 17 | return { -1, ec }; 18 | } 19 | 20 | ec = drain(process, std::forward(out), std::forward(err)); 21 | if (ec) { 22 | return { -1, ec }; 23 | } 24 | 25 | return process.stop(options.stop); 26 | } 27 | 28 | inline std::pair run(const arguments &arguments, 29 | const options &options = {}) 30 | { 31 | struct options modified = options::clone(options); 32 | 33 | if (!options.redirect.discard && options.redirect.file == nullptr && 34 | options.redirect.path == nullptr) { 35 | modified.redirect.parent = true; 36 | } 37 | 38 | return run(arguments, modified, sink::null, sink::null); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/Player.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct Sequence; 9 | 10 | struct Player : std::enable_shared_from_this { 11 | private: 12 | std::set, std::owner_less>> sequences; 13 | 14 | public: 15 | std::string ID; 16 | 17 | int frame; 18 | int currentMinFrame; 19 | int currentMaxFrame; 20 | int minFrame; 21 | int maxFrame; 22 | 23 | float fps; 24 | bool playing = false; 25 | bool looping = true; 26 | bool bouncy = false; 27 | int direction = 1; 28 | 29 | uint64_t frameClock; 30 | double frameAccumulator; 31 | 32 | bool opened; 33 | 34 | Player(); 35 | 36 | bool operator==(const Player& other); 37 | 38 | void update(); 39 | void displaySettings(); 40 | void checkShortcuts(); 41 | void checkBounds(); 42 | void reconfigureBounds(); 43 | 44 | void onSequenceAttach(std::weak_ptr s); 45 | void onSequenceDetach(std::weak_ptr s); 46 | 47 | bool parseArg(const std::string& arg); 48 | }; 49 | -------------------------------------------------------------------------------- /external/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2018 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/utf.windows.c: -------------------------------------------------------------------------------- 1 | #include "utf.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "error.h" 8 | 9 | wchar_t *utf16_from_utf8(const char *string, int size) 10 | { 11 | ASSERT(string); 12 | 13 | // Determine wstring size (`MultiByteToWideChar` returns the required size if 14 | // its last two arguments are `NULL` and 0). 15 | int r = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, string, size, NULL, 16 | 0); 17 | if (r == 0) { 18 | return NULL; 19 | } 20 | 21 | // `MultiByteToWideChar` does not return negative values so the cast to 22 | // `size_t` is safe. 23 | wchar_t *wstring = calloc((size_t) r, sizeof(wchar_t)); 24 | if (wstring == NULL) { 25 | SetLastError(ERROR_NOT_ENOUGH_MEMORY); 26 | return NULL; 27 | } 28 | 29 | // Now we pass our allocated string and its size as the last two arguments 30 | // instead of `NULL` and 0 which makes `MultiByteToWideChar` actually perform 31 | // the conversion. 32 | r = MultiByteToWideChar(CP_UTF8, 0, string, size, wstring, r); 33 | if (r == 0) { 34 | free(wstring); 35 | return NULL; 36 | } 37 | 38 | return wstring; 39 | } 40 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/Debug.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_DEBUG_HPP 2 | #define EFSW_DEBUG_HPP 3 | 4 | #include 5 | 6 | namespace efsw { 7 | 8 | #ifdef DEBUG 9 | 10 | void efREPORT_ASSERT( const char * File, const int Line, const char * Exp ); 11 | 12 | #define efASSERT( expr ) if ( !(expr) ) { efREPORT_ASSERT( __FILE__, __LINE__, #expr ); } 13 | #define efASSERTM( expr, msg ) if ( !(expr) ) { efREPORT_ASSERT( __FILE__, __LINE__, #msg ); } 14 | 15 | void efPRINT ( const char * format, ... ); 16 | void efPRINTC ( unsigned int cond, const char * format, ... ); 17 | 18 | #else 19 | 20 | #define efASSERT( expr ) 21 | #define efASSERTM( expr, msg ) 22 | 23 | #ifndef EFSW_COMPILER_MSVC 24 | #define efPRINT( format, args... ) {} 25 | #define efPRINTC( cond, format, args... ) {} 26 | #else 27 | #define efPRINT 28 | #define efPRINTC 29 | #endif 30 | 31 | #endif 32 | 33 | #ifdef EFSW_VERBOSE 34 | #define efDEBUG efPRINT 35 | #define efDEBUGC efPRINTC 36 | #else 37 | 38 | #ifndef EFSW_COMPILER_MSVC 39 | #define efDEBUG( format, args... ) {} 40 | #define efDEBUGC( cond, format, args... ) {} 41 | #else 42 | #define efDEBUG 43 | #define efDEBUGC 44 | #endif 45 | 46 | #endif 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/FileSystem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_FILESYSTEM_HPP 2 | #define EFSW_FILESYSTEM_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace efsw { 9 | 10 | class FileSystem 11 | { 12 | public: 13 | static bool isDirectory( const std::string& path ); 14 | 15 | static FileInfoMap filesInfoFromPath( std::string path ); 16 | 17 | static char getOSSlash(); 18 | 19 | static bool slashAtEnd( std::string& dir ); 20 | 21 | static void dirAddSlashAtEnd( std::string& dir ); 22 | 23 | static void dirRemoveSlashAtEnd( std::string& dir ); 24 | 25 | static std::string fileNameFromPath( std::string filepath ); 26 | 27 | static std::string pathRemoveFileName( std::string filepath ); 28 | 29 | static void realPath( std::string curdir, std::string& path ); 30 | 31 | static std::string getLinkRealPath( std::string dir, std::string& curPath ); 32 | 33 | static std::string precomposeFileName(const std::string& name); 34 | 35 | static bool isRemoteFS( const std::string& directory ); 36 | 37 | static bool changeWorkingDirectory( const std::string & path ); 38 | 39 | static std::string getCurrentWorkingDirectory(); 40 | }; 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/error.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define ASSERT(expression) assert(expression) 6 | 7 | // Avoid unused assignment warnings in release mode when the result of an 8 | // assignment is only used in an assert statement. 9 | #define ASSERT_UNUSED(expression) \ 10 | do { \ 11 | (void) !(expression); \ 12 | ASSERT((expression)); \ 13 | } while (0) 14 | 15 | // Returns `r` if `expression` is false. 16 | #define ASSERT_RETURN(expression, r) \ 17 | do { \ 18 | if (!(expression)) { \ 19 | return (r); \ 20 | } \ 21 | } while (0) 22 | 23 | #define ASSERT_EINVAL(expression) ASSERT_RETURN(expression, REPROC_EINVAL) 24 | 25 | const char *error_string(int error); 26 | -------------------------------------------------------------------------------- /src/Window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #define IMGUI_DEFINE_MATH_OPERATORS 9 | #include 10 | 11 | #include "DisplayArea.hpp" 12 | #ifdef USE_FUZZY_FINDER 13 | #include "FuzzyFinder.hpp" 14 | #endif 15 | 16 | struct Sequence; 17 | class Histogram; 18 | 19 | struct Window : std::enable_shared_from_this { 20 | std::string ID; 21 | std::vector> sequences; 22 | std::shared_ptr histogram; 23 | #ifdef USE_FUZZY_FINDER 24 | FuzzyFinderForSequence fuzzyfinder; 25 | #endif 26 | int index; 27 | 28 | DisplayArea displayarea; 29 | bool opened; 30 | ImVec2 position; 31 | ImVec2 size; 32 | bool forceGeometry; 33 | ImRect contentRect; 34 | bool dontLayout; 35 | bool alwaysOnTop; 36 | 37 | bool shouldAskFocus; 38 | bool screenshot; 39 | 40 | Window(); 41 | 42 | void display(); 43 | void displaySequence(Sequence&); 44 | void displayInfo(Sequence&); 45 | 46 | void displaySettings(); 47 | 48 | void postRender(); 49 | 50 | std::shared_ptr getCurrentSequence() const; 51 | std::string getTitle() const; 52 | }; 53 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/SystemImpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 5 | 6 | #ifndef WIN32_LEAN_AND_MEAN 7 | #define WIN32_LEAN_AND_MEAN 8 | #endif 9 | #include 10 | #include 11 | 12 | namespace efsw { namespace Platform { 13 | 14 | void System::sleep( const unsigned long& ms ) 15 | { 16 | ::Sleep( ms ); 17 | } 18 | 19 | std::string System::getProcessPath() 20 | { 21 | // Get path to executable: 22 | WCHAR szDrive[_MAX_DRIVE]; 23 | WCHAR szDir[_MAX_DIR]; 24 | WCHAR szFilename[_MAX_DIR]; 25 | WCHAR szExt[_MAX_DIR]; 26 | std::wstring dllName( _MAX_DIR, 0 ); 27 | 28 | GetModuleFileNameW(0, &dllName[0], _MAX_PATH); 29 | 30 | #ifdef EFSW_COMPILER_MSVC 31 | _wsplitpath_s( dllName.c_str(), szDrive, _MAX_DRIVE, szDir, _MAX_DIR, szFilename, _MAX_DIR, szExt, _MAX_DIR ); 32 | #else 33 | _wsplitpath( dllName.c_str(), szDrive, szDir, szFilename, szExt); 34 | #endif 35 | 36 | return String( szDrive ).toUtf8() + String( szDir ).toUtf8(); 37 | } 38 | 39 | void System::maxFD() 40 | { 41 | } 42 | 43 | Uint64 System::getMaxFD() 44 | { // Number of ReadDirectory per thread 45 | return 60; 46 | } 47 | 48 | }} 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016 Joel Davis. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/Histogram.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #define IMGUI_DEFINE_MATH_OPERATORS 9 | #include 10 | 11 | #include "Progressable.hpp" 12 | 13 | struct Image; 14 | struct Colormap; 15 | 16 | class Histogram : public Progressable { 17 | private: 18 | bool loaded; 19 | mutable std::recursive_mutex lock; 20 | 21 | public: 22 | enum class Mode { 23 | SMOOTH, 24 | EXACT, 25 | } mode; 26 | float min, max; 27 | std::vector> values; 28 | std::weak_ptr image; 29 | size_t curh; 30 | const int nbins; 31 | ImRect region; 32 | 33 | public: 34 | Histogram() 35 | : loaded(true) 36 | , image(std::weak_ptr()) 37 | , curh(0) 38 | , nbins(256) 39 | , region() 40 | { 41 | } 42 | 43 | void request(std::shared_ptr image, Mode mode, ImRect region = ImRect(0, 0, 0, 0)); 44 | 45 | float getProgressPercentage() const override; 46 | 47 | bool isLoaded() const override 48 | { 49 | return loaded; 50 | } 51 | 52 | void progress() override; 53 | 54 | void draw(const Colormap& colormap, const float* highlights); 55 | }; 56 | -------------------------------------------------------------------------------- /external/imgui/examples/allegro5_example/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Configuration 3 | 4 | Dear ImGui outputs 16-bit vertex indices by default. 5 | Allegro doesn't support them natively, so we have two solutions: convert the indices manually in imgui_impl_allegro5.cpp, or compile imgui with 32-bit indices. 6 | You can either modify imconfig.h that comes with Dear ImGui (easier), or set a C++ preprocessor option IMGUI_USER_CONFIG to find to a filename. 7 | We are providing `imconfig_allegro5.h` that enables 32-bit indices. 8 | Note that the back-end supports _BOTH_ 16-bit and 32-bit indices, but 32-bit indices will be slightly faster as they won't require a manual conversion. 9 | 10 | # How to Build 11 | 12 | - On Ubuntu 14.04+ 13 | 14 | ```bash 15 | g++ -DIMGUI_USER_CONFIG=\"examples/allegro5_example/imconfig_allegro5.h\" -I ../.. main.cpp imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_primitives -o allegro5_example 16 | ``` 17 | 18 | - On Windows with Visual Studio's CLI 19 | 20 | ``` 21 | set ALLEGRODIR=path_to_your_allegro5_folder 22 | cl /Zi /MD /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG=\"examples/allegro5_example/imconfig_allegro5.h\" /I ..\.. main.cpp imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib 23 | ``` 24 | -------------------------------------------------------------------------------- /external/imscript/help_stuff.c: -------------------------------------------------------------------------------- 1 | #include // strcmp 2 | #include // puts, snprintf 3 | #include // system, exit, abs 4 | 5 | static int do_man(int raw) 6 | { 7 | #ifdef __OpenBSD__ 8 | #define MANPIPE "|mandoc -a" 9 | #else 10 | #define MANPIPE "|man -l -" 11 | #endif 12 | char buf[0x200]; 13 | snprintf(buf, 0x200, "help2man -N -S imscript -n \"%s\" %s%s %s", 14 | // 1 2 3 4 15 | help_string_oneliner, // 1 16 | raw>0 ? "" : "./", // 2 17 | help_string_name, // 3 18 | abs(raw)>1 ? "" : MANPIPE // 4 19 | ); 20 | return system(buf); 21 | } 22 | 23 | static void if_help_is_requested_print_it_and_exit_the_program(char *s) 24 | { 25 | if (!strcmp(s, "-?")) exit(0*puts(help_string_oneliner)); 26 | if (!strcmp(s, "-h")) exit(0*puts(help_string_usage)); 27 | if (!strcmp(s, "--help")) exit(0*puts(help_string_long)); 28 | if (!strcmp(s, "--version")) exit(0*puts(help_string_version)); 29 | if (!strcmp(s, "--man")) exit(do_man( 1)); 30 | if (!strcmp(s, "--manraw")) exit(do_man( 2)); 31 | if (!strcmp(s, "--man-x")) exit(do_man(-1)); 32 | if (!strcmp(s, "--manraw-x")) exit(do_man(-2)); 33 | if (!strcmp(s, "--help-oneliner")) puts(help_string_oneliner); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /external/efsw/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Martín Lucas Golini 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | This software is a fork of the "simplefilewatcher" by James Wynn (james@jameswynn.com) 22 | http://code.google.com/p/simplefilewatcher/ also MIT licensed. -------------------------------------------------------------------------------- /external/lua/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_MATHLIBNAME "math" 39 | LUAMOD_API int (luaopen_math) (lua_State *L); 40 | 41 | #define LUA_DBLIBNAME "debug" 42 | LUAMOD_API int (luaopen_debug) (lua_State *L); 43 | 44 | #define LUA_LOADLIBNAME "package" 45 | LUAMOD_API int (luaopen_package) (lua_State *L); 46 | 47 | 48 | /* open all previous libraries */ 49 | LUALIB_API void (luaL_openlibs) (lua_State *L); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/imgui_custom.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include "Shader.hpp" 9 | 10 | namespace ImGui { 11 | 12 | struct ShaderUserData { 13 | std::shared_ptr shader; 14 | std::array scale; 15 | std::array bias; 16 | }; 17 | 18 | void SetShaderCallback(const ImDrawList* parent_list, const ImDrawCmd* pcmd); 19 | 20 | void PlotMultiLines(const char* label, 21 | int num_datas, 22 | const char** names, 23 | const ImColor* colors, 24 | float (*getter)(const void* data, int idx), 25 | const void* const* datas, 26 | int values_count, 27 | float scale_min, 28 | float scale_max, 29 | ImVec2 graph_size, 30 | const int* boundsmin, const int* boundsmax, const int* highlights); 31 | 32 | void PlotMultiHistograms(const char* label, 33 | int num_hists, 34 | const char** names, 35 | const ImColor* colors, 36 | float (*getter)(const void* data, int idx), 37 | const void* const* datas, 38 | int values_count, 39 | float scale_min, 40 | float scale_max, 41 | ImVec2 graph_size, 42 | const int* boundsmin, const int* boundsmax, const int* highlights); 43 | 44 | bool BufferingBar(const char* label, float value, 45 | const ImVec2& size_arg, const ImU32& bg_col, 46 | const ImU32& fg_col); 47 | } 48 | -------------------------------------------------------------------------------- /src/globals.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #define SEQUENCE_SEPARATOR ("::") 8 | 9 | struct Sequence; 10 | struct View; 11 | struct Player; 12 | struct Window; 13 | struct Colormap; 14 | class Terminal; 15 | 16 | extern std::vector> gSequences; 17 | extern std::vector> gViews; 18 | extern std::vector> gPlayers; 19 | extern std::vector> gWindows; 20 | extern std::vector> gColormaps; 21 | extern Terminal& gTerminal; 22 | 23 | #include 24 | extern bool gSelecting; 25 | extern ImVec2 gSelectionFrom; 26 | extern ImVec2 gSelectionTo; 27 | extern bool gSelectionShown; 28 | 29 | extern ImVec2 gHoveredPixel; 30 | 31 | extern bool gShowHud; 32 | extern std::array gShowSVGs; 33 | extern bool gShowHistogram; 34 | extern bool gShowMenuBar; 35 | extern bool gShowImage; 36 | extern int gShowWindowBar; 37 | extern int gWindowBorder; 38 | extern bool gShowMiniview; 39 | 40 | extern float gDefaultFramerate; 41 | extern int gDownsamplingQuality; 42 | extern size_t gCacheLimitMB; 43 | extern bool gSmoothHistogram; 44 | extern bool gForceIioOpen; 45 | 46 | extern int gActive; 47 | extern int gShowView; 48 | #define MAX_SHOWVIEW 70 49 | extern bool gReloadImages; 50 | extern bool gShowHelp; 51 | -------------------------------------------------------------------------------- /external/imgui/examples/allegro5_example/imgui_impl_allegro5.h: -------------------------------------------------------------------------------- 1 | // ImGui Allegro 5 bindings 2 | 3 | // Implemented features: 4 | // [X] User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 5 | // Missing features: 6 | // [ ] Clipboard support via al_set_clipboard_text/al_clipboard_has_text. 7 | 8 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 9 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 10 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 11 | // https://github.com/ocornut/imgui, Original code by @birthggd 12 | 13 | #pragma once 14 | 15 | struct ALLEGRO_DISPLAY; 16 | union ALLEGRO_EVENT; 17 | 18 | IMGUI_API bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display); 19 | IMGUI_API void ImGui_ImplA5_Shutdown(); 20 | IMGUI_API void ImGui_ImplA5_NewFrame(); 21 | IMGUI_API void ImGui_ImplA5_RenderDrawData(ImDrawData* draw_data); 22 | IMGUI_API bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT* event); 23 | 24 | // Use if you want to reset your rendering device without losing ImGui state. 25 | IMGUI_API bool Imgui_ImplA5_CreateDeviceObjects(); 26 | IMGUI_API void ImGui_ImplA5_InvalidateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-osx/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "size" : "512x512", 50 | "idiom" : "mac", 51 | "filename" : "icon_imgui_180x180.png", 52 | "scale" : "2x" 53 | }, 54 | { 55 | "idiom" : "mac", 56 | "size" : "512x512", 57 | "scale" : "2x" 58 | } 59 | ], 60 | "info" : { 61 | "version" : 1, 62 | "author" : "xcode" 63 | } 64 | } -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(ImGuiGLFWVulkanExample C CXX) 3 | 4 | if(NOT CMAKE_BUILD_TYPE) 5 | set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE) 6 | endif() 7 | 8 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") 9 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") 10 | 11 | # GLFW 12 | set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo 13 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) 14 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) 15 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF) 16 | option(GLFW_INSTALL "Generate installation target" OFF) 17 | option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) 18 | add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL) 19 | include_directories(${GLFW_DIR}/include) 20 | 21 | # ImGui 22 | set(IMGUI_DIR ../../) 23 | include_directories(${IMGUI_DIR}) 24 | 25 | # Libraries 26 | find_library(VULKAN_LIBRARY 27 | NAMES vulkan vulkan-1) 28 | set(LIBRARIES "glfw;${VULKAN_LIBRARY}") 29 | 30 | # Use vulkan headers from glfw: 31 | include_directories(${GLFW_DIR}/deps) 32 | 33 | file(GLOB sources *.cpp) 34 | 35 | add_executable(vulkan_example ${sources} ${IMGUI_DIR}/imgui.cpp ${IMGUI_DIR}/imgui_draw.cpp ${IMGUI_DIR}/imgui_demo.cpp) 36 | target_link_libraries(vulkan_example ${LIBRARIES}) 37 | -------------------------------------------------------------------------------- /external/imgui/misc/natvis/imgui.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{Size={Size} Capacity={Capacity}}} 9 | 10 | 11 | Size 12 | Data 13 | 14 | 15 | 16 | 17 | 18 | {{x={x,g} y={y,g}}} 19 | 20 | 21 | 22 | {{x={x,g} y={y,g} z={z,g} w={w,g}}} 23 | 24 | 25 | 26 | {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} 27 | 28 | Min 29 | Max 30 | Max.x - Min.x 31 | Max.y - Min.y 32 | 33 | 34 | 35 | 36 | {{Name={Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d}} 37 | 38 | 39 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/run.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "error.h" 6 | 7 | int reproc_run(const char *const *argv, reproc_options options) 8 | { 9 | if (!options.redirect.discard && !options.redirect.file && 10 | !options.redirect.path) { 11 | options.redirect.parent = true; 12 | } 13 | 14 | return reproc_run_ex(argv, options, REPROC_SINK_NULL, REPROC_SINK_NULL); 15 | } 16 | 17 | int reproc_run_ex(const char *const *argv, 18 | reproc_options options, // lgtm [cpp/large-parameter] 19 | reproc_sink out, 20 | reproc_sink err) 21 | { 22 | reproc_t *process = NULL; 23 | int r = REPROC_ENOMEM; 24 | 25 | // There's no way for `reproc_run_ex` to inform the caller whether we're in 26 | // the forked process or the parent process so let's not allow forking when 27 | // using `reproc_run_ex`. 28 | ASSERT_EINVAL(!options.fork); 29 | 30 | process = reproc_new(); 31 | if (process == NULL) { 32 | goto finish; 33 | } 34 | 35 | r = reproc_start(process, argv, options); 36 | if (r < 0) { 37 | goto finish; 38 | } 39 | 40 | r = reproc_drain(process, out, err); 41 | if (r < 0) { 42 | goto finish; 43 | } 44 | 45 | r = reproc_stop(process, options.stop); 46 | if (r < 0) { 47 | goto finish; 48 | } 49 | 50 | finish: 51 | reproc_destroy(process); 52 | 53 | return r; 54 | } 55 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/win/ThreadImpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32 6 | 7 | #include 8 | 9 | namespace efsw { namespace Platform { 10 | 11 | ThreadImpl::ThreadImpl( Thread *owner ) 12 | { 13 | mThread = reinterpret_cast( _beginthreadex( NULL, 0, &ThreadImpl::entryPoint, owner, 0, &mThreadId ) ); 14 | 15 | if ( !mThread ) 16 | { 17 | efDEBUG( "Failed to create thread\n" ); 18 | } 19 | } 20 | 21 | ThreadImpl::~ThreadImpl() 22 | { 23 | if ( mThread ) 24 | { 25 | CloseHandle( mThread ); 26 | } 27 | } 28 | 29 | void ThreadImpl::wait() 30 | { 31 | // Wait for the thread to finish, no timeout 32 | if ( mThread ) 33 | { 34 | assert( mThreadId != GetCurrentThreadId() ); // A thread cannot wait for itself! 35 | 36 | WaitForSingleObject( mThread, INFINITE ); 37 | } 38 | } 39 | 40 | void ThreadImpl::terminate() 41 | { 42 | if ( mThread ) 43 | { 44 | TerminateThread( mThread, 0 ); 45 | } 46 | } 47 | 48 | unsigned int __stdcall ThreadImpl::entryPoint( void * userData ) 49 | { 50 | // The Thread instance is stored in the user data 51 | Thread * owner = static_cast( userData ); 52 | 53 | // Forward to the owner 54 | owner->run(); 55 | 56 | // Optional, but it is cleaner 57 | _endthreadex(0); 58 | 59 | return 0; 60 | } 61 | 62 | }} 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/Colormap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "Image.hpp" // for bands 9 | #include "Shader.hpp" 10 | 11 | struct Colormap { 12 | private: 13 | std::set, std::owner_less>> sequences; 14 | 15 | public: 16 | std::string ID; 17 | std::array center; 18 | float radius; 19 | std::shared_ptr shader; 20 | bool initialized; 21 | int currentSat; 22 | BandIndices bands; 23 | 24 | Colormap(); 25 | 26 | bool operator==(const Colormap& other); 27 | 28 | void displaySettings(); 29 | void getRange(float& min, float& max, int n) const; 30 | void getRange(std::array& min, std::array& max) const; 31 | std::array getScale() const; 32 | std::array getBias() const; 33 | 34 | void autoCenterAndRadius(float min, float max); 35 | 36 | void nextShader(); 37 | void previousShader(); 38 | const std::string& getShaderName() const; 39 | bool setShader(const std::string& name); 40 | 41 | bool bandsAreStandard() const { return bands[0] == 0 && bands[1] == 1 && bands[2] == 2; } 42 | 43 | void onSequenceAttach(std::weak_ptr s); 44 | void onSequenceDetach(std::weak_ptr s); 45 | 46 | bool parseArg(const std::string& arg); 47 | }; 48 | -------------------------------------------------------------------------------- /src/fuzzy-finder/src/cxxbridge.rs: -------------------------------------------------------------------------------- 1 | use crate::{FuzzyPathFinder, FuzzyPathFinderBuilder, FuzzyStringMatcher, IndexedMatch, Match}; 2 | 3 | #[cxx::bridge] 4 | mod ffi { 5 | #[namespace = "fuzzyfinder"] 6 | extern "Rust" { 7 | type FuzzyStringMatcher; 8 | type FuzzyPathFinder; 9 | type Match; 10 | type IndexedMatch; 11 | 12 | fn to_str(self: &Match) -> &str; 13 | fn score(self: &Match) -> i64; 14 | fn indices(self: &Match) -> &Vec; 15 | 16 | fn to_str(self: &IndexedMatch) -> &str; 17 | fn score(self: &IndexedMatch) -> i64; 18 | fn indices(self: &IndexedMatch) -> &Vec; 19 | fn index(self: &IndexedMatch) -> usize; 20 | 21 | fn fuzzy_string_matcher() -> Box; 22 | fn matches(self: &FuzzyStringMatcher, values: &[&str], pattern: &str) -> Vec; 23 | 24 | fn fuzzy_path_finder(base: &str) -> Box; 25 | fn matches_skip_and_take( 26 | self: &mut FuzzyPathFinder, 27 | pattern: &str, 28 | skip: usize, 29 | take: usize, 30 | ) -> Vec; 31 | } 32 | } 33 | 34 | pub fn fuzzy_string_matcher() -> Box { 35 | Box::new(FuzzyStringMatcher::default()) 36 | } 37 | 38 | fn fuzzy_path_finder(base: &str) -> Box { 39 | Box::new(FuzzyPathFinderBuilder::from_path(base).build()) 40 | } 41 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/pipe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef _WIN64 8 | typedef uint64_t pipe_type; // `SOCKET` 9 | #elif _WIN32 10 | typedef uint32_t pipe_type; // `SOCKET` 11 | #else 12 | typedef int pipe_type; // fd 13 | #endif 14 | 15 | extern const pipe_type PIPE_INVALID; 16 | 17 | extern const short PIPE_EVENT_IN; 18 | extern const short PIPE_EVENT_OUT; 19 | 20 | typedef struct { 21 | pipe_type pipe; 22 | short interests; 23 | short events; 24 | } pipe_event_source; 25 | 26 | // Creates a new anonymous pipe. `parent` and `child` are set to the parent and 27 | // child endpoint of the pipe respectively. 28 | int pipe_init(pipe_type *read, pipe_type *write); 29 | 30 | // Sets `pipe` to nonblocking mode. 31 | int pipe_nonblocking(pipe_type pipe, bool enable); 32 | 33 | // Reads up to `size` bytes into `buffer` from the pipe indicated by `pipe` and 34 | // returns the amount of bytes read. 35 | int pipe_read(pipe_type pipe, uint8_t *buffer, size_t size); 36 | 37 | // Writes up to `size` bytes from `buffer` to the pipe indicated by `pipe` and 38 | // returns the amount of bytes written. 39 | int pipe_write(pipe_type pipe, const uint8_t *buffer, size_t size); 40 | 41 | // Polls the given event sources for events. 42 | int pipe_poll(pipe_event_source *sources, size_t num_sources, int timeout); 43 | 44 | int pipe_shutdown(pipe_type pipe); 45 | 46 | pipe_type pipe_destroy(pipe_type pipe); 47 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/strv.c: -------------------------------------------------------------------------------- 1 | #include "strv.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "error.h" 8 | 9 | static char *str_dup(const char *s) 10 | { 11 | ASSERT_RETURN(s, NULL); 12 | 13 | char *r = malloc(strlen(s) + 1); 14 | if (!r) { 15 | return NULL; 16 | } 17 | 18 | strcpy(r, s); // NOLINT 19 | 20 | return r; 21 | } 22 | 23 | char **strv_concat(char *const *a, const char *const *b) 24 | { 25 | char *const *i = NULL; 26 | const char *const *j = NULL; 27 | size_t size = 1; 28 | size_t c = 0; 29 | 30 | STRV_FOREACH(i, a) { 31 | size++; 32 | } 33 | 34 | STRV_FOREACH(j, b) { 35 | size++; 36 | } 37 | 38 | char **r = calloc(size, sizeof(char *)); 39 | if (!r) { 40 | goto finish; 41 | } 42 | 43 | STRV_FOREACH(i, a) { 44 | r[c] = str_dup(*i); 45 | if (!r[c]) { 46 | goto finish; 47 | } 48 | 49 | c++; 50 | } 51 | 52 | STRV_FOREACH(j, b) { 53 | r[c] = str_dup(*j); 54 | if (!r[c]) { 55 | goto finish; 56 | } 57 | 58 | c++; 59 | } 60 | 61 | r[c++] = NULL; 62 | 63 | finish: 64 | if (c < size) { 65 | STRV_FOREACH(i, r) { 66 | free(*i); 67 | } 68 | 69 | free(r); 70 | 71 | return NULL; 72 | } 73 | 74 | return r; 75 | } 76 | 77 | char **strv_free(char **l) 78 | { 79 | char **s = NULL; 80 | 81 | STRV_FOREACH(s, l) { 82 | free(*s); 83 | } 84 | 85 | free(l); 86 | 87 | return NULL; 88 | } 89 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/FileInfo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_FILEINFO_HPP 2 | #define EFSW_FILEINFO_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace efsw { 10 | 11 | class FileInfo 12 | { 13 | public: 14 | static bool exists( const std::string& filePath ); 15 | 16 | static bool isLink( const std::string& filePath ); 17 | 18 | static bool inodeSupported(); 19 | 20 | FileInfo(); 21 | 22 | FileInfo( const std::string& filepath ); 23 | 24 | FileInfo( const std::string& filepath, bool linkInfo ); 25 | 26 | bool operator==( const FileInfo& Other ) const; 27 | 28 | bool operator!=( const FileInfo& Other ) const; 29 | 30 | FileInfo& operator=( const FileInfo& Other ); 31 | 32 | bool isDirectory() const; 33 | 34 | bool isRegularFile() const; 35 | 36 | bool isReadable() const; 37 | 38 | bool sameInode( const FileInfo& Other ) const; 39 | 40 | bool isLink() const; 41 | 42 | std::string linksTo(); 43 | 44 | bool exists(); 45 | 46 | void getInfo(); 47 | 48 | void getRealInfo(); 49 | 50 | std::string Filepath; 51 | Uint64 ModificationTime; 52 | Uint64 Size; 53 | Uint32 OwnerId; 54 | Uint32 GroupId; 55 | Uint32 Permissions; 56 | Uint64 Inode; 57 | }; 58 | 59 | typedef std::map FileInfoMap; 60 | typedef std::list FileInfoList; 61 | typedef std::list< std::pair< std::string, FileInfo> > MovedList; 62 | 63 | } 64 | 65 | #endif 66 | 67 | -------------------------------------------------------------------------------- /misc/vpv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | 4 | import os 5 | import sys 6 | import tempfile 7 | import numpy as np 8 | 9 | 10 | def vpv(*args): 11 | ''' 12 | *args should be a list containing numpy arrays or strings 13 | arrays should be of shape ([nframes, ]height, width[, nchannels]) 14 | torch.Tensor as converted as numpy arrays of the same shape 15 | ''' 16 | cmd = 'vpv' 17 | dir = os.path.join(tempfile.gettempdir(), 'vpvpython') 18 | 19 | if args and isinstance(args[0], int): 20 | num = args[0] 21 | dir = dir + '_' + str(num) 22 | cmd = 'env WATCH=1 ' + cmd 23 | args = args[1:] 24 | isnumbered = True 25 | else: 26 | isnumbered = False 27 | 28 | if not os.path.exists(dir): 29 | os.makedirs(dir) 30 | newwindow = True 31 | else: 32 | newwindow = False 33 | 34 | j = 1 35 | for o in args: 36 | if type(o).__module__ is 'torch': 37 | o = o.cpu().detach().numpy() 38 | 39 | if isinstance(o, str): 40 | cmd += ' ' + o 41 | else: 42 | name = '{}/{}.npy'.format(dir, j) 43 | np.save(name, o) 44 | cmd = cmd + ' ' + name 45 | j += 1 46 | 47 | cmd = '({}; rm -rf "{}") &'.format(cmd, dir) 48 | if not isnumbered or newwindow: 49 | print(cmd) 50 | os.system(cmd) 51 | elif isnumbered: 52 | print('vpv #', num, ' updated.') 53 | 54 | 55 | # make so the vpv module is callable 56 | sys.modules[__name__] = vpv 57 | -------------------------------------------------------------------------------- /external/imgui/examples/directx9_example/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX9 binding 2 | 3 | // Implemented features: 4 | // [X] User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 5 | 6 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 7 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 8 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 9 | // https://github.com/ocornut/imgui 10 | 11 | struct IDirect3DDevice9; 12 | 13 | IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device); 14 | IMGUI_API void ImGui_ImplDX9_Shutdown(); 15 | IMGUI_API void ImGui_ImplDX9_NewFrame(); 16 | IMGUI_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 17 | 18 | // Use if you want to reset your rendering device without losing ImGui state. 19 | IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 20 | IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects(); 21 | 22 | // Handler for Win32 messages, update mouse/keyboard data. 23 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 24 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 25 | /* 26 | IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 27 | */ 28 | -------------------------------------------------------------------------------- /external/imgui/examples/directx10_example/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX10 binding 2 | 3 | // Implemented features: 4 | // [X] User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 5 | 6 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 7 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 8 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 9 | // https://github.com/ocornut/imgui 10 | 11 | struct ID3D10Device; 12 | 13 | IMGUI_API bool ImGui_ImplDX10_Init(void* hwnd, ID3D10Device* device); 14 | IMGUI_API void ImGui_ImplDX10_Shutdown(); 15 | IMGUI_API void ImGui_ImplDX10_NewFrame(); 16 | IMGUI_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 17 | 18 | // Use if you want to reset your rendering device without losing ImGui state. 19 | IMGUI_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 20 | IMGUI_API bool ImGui_ImplDX10_CreateDeviceObjects(); 21 | 22 | // Handler for Win32 messages, update mouse/keyboard data. 23 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 24 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 25 | /* 26 | IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 27 | */ 28 | -------------------------------------------------------------------------------- /external/imgui/examples/directx12_example/directx12_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fb3d294f-51ec-478e-a627-25831c80fefd} 6 | 7 | 8 | {4f33ddea-9910-456d-b868-4267eb3c2b19} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | sources 20 | 21 | 22 | imgui 23 | 24 | 25 | 26 | 27 | imgui 28 | 29 | 30 | sources 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/DirWatcherGeneric.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_DIRWATCHERGENERIC_HPP 2 | #define EFSW_DIRWATCHERGENERIC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace efsw { 10 | 11 | class DirWatcherGeneric 12 | { 13 | public: 14 | typedef std::map DirWatchMap; 15 | 16 | DirWatcherGeneric * Parent; 17 | WatcherGeneric * Watch; 18 | DirectorySnapshot DirSnap; 19 | DirWatchMap Directories; 20 | bool Recursive; 21 | 22 | DirWatcherGeneric( DirWatcherGeneric * parent, WatcherGeneric * ws, const std::string& directory, bool recursive, bool reportNewFiles = false ); 23 | 24 | ~DirWatcherGeneric(); 25 | 26 | void watch( bool reportOwnChange = false ); 27 | 28 | void watchDir( std::string& dir ); 29 | 30 | static bool isDir( const std::string& directory ); 31 | 32 | bool pathInWatches( std::string path ); 33 | 34 | void addChilds( bool reportNewFiles = true ); 35 | 36 | DirWatcherGeneric * findDirWatcher( std::string dir ); 37 | 38 | DirWatcherGeneric * findDirWatcherFast( std::string dir ); 39 | protected: 40 | bool Deleted; 41 | 42 | DirWatcherGeneric * createDirectory( std::string newdir ); 43 | 44 | void removeDirectory( std::string dir ); 45 | 46 | void moveDirectory( std::string oldDir, std::string newDir ); 47 | 48 | void resetDirectory( std::string directory ); 49 | 50 | void handleAction( const std::string& filename, unsigned long action, std::string oldFilename = ""); 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/platform/posix/ThreadImpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if defined( EFSW_PLATFORM_POSIX ) 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | namespace efsw { namespace Platform { 11 | 12 | ThreadImpl::ThreadImpl( Thread * owner ) : 13 | mIsActive(false) 14 | { 15 | mIsActive = pthread_create( &mThread, NULL, &ThreadImpl::entryPoint, owner ) == 0; 16 | 17 | if ( !mIsActive ) 18 | { 19 | efDEBUG( "Failed to create thread\n" ); 20 | } 21 | } 22 | 23 | void ThreadImpl::wait() 24 | { 25 | // Wait for the thread to finish, no timeout 26 | if ( mIsActive ) 27 | { 28 | assert( pthread_equal( pthread_self(), mThread ) == 0 ); 29 | 30 | pthread_join( mThread, NULL ); 31 | 32 | mIsActive = false; // Reset the thread state 33 | } 34 | } 35 | 36 | void ThreadImpl::terminate() 37 | { 38 | if ( mIsActive ) 39 | { 40 | #if !defined( __ANDROID__ ) && !defined( ANDROID ) 41 | pthread_cancel( mThread ); 42 | #else 43 | pthread_kill( mThread , SIGUSR1 ); 44 | #endif 45 | 46 | mIsActive = false; 47 | } 48 | } 49 | 50 | void * ThreadImpl::entryPoint( void * userData ) 51 | { 52 | // The Thread instance is stored in the user data 53 | Thread * owner = static_cast( userData ); 54 | 55 | // Tell the thread to handle cancel requests immediatly 56 | #ifdef PTHREAD_CANCEL_ASYNCHRONOUS 57 | pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, NULL ); 58 | #endif 59 | 60 | // Forward to the owner 61 | owner->run(); 62 | 63 | return NULL; 64 | } 65 | 66 | }} 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /external/imscript/smapa.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // a smart parameter is just like a regular parameter, but it can be 6 | // re-defined at the shell-environment. Instead of 7 | // 8 | // #define NUMBER 42 9 | // ... 10 | // printf("%g", NUMBER); 11 | // 12 | // do 13 | // SMART_PARAMETER(NUMBER,42) 14 | // ... 15 | // printf("%g", NUMBER()); 16 | // 17 | // Notice that the environment only gets queried once, at the first use. 18 | // 19 | #define SMART_PARAMETER(n,v) static double n(void)\ 20 | {\ 21 | static bool smapa_known_ ## n = false;\ 22 | static double smapa_value_ ## n = v;\ 23 | if (!smapa_known_ ## n)\ 24 | {\ 25 | fprintf(stderr,"scanning the environment for \"%s\"... ", #n);\ 26 | int r = 0;\ 27 | char *sv = getenv(#n);\ 28 | double y;\ 29 | if (sv)\ 30 | r = sscanf(sv, "%lf", &y);\ 31 | if (sv && r == 1)\ 32 | {\ 33 | fprintf(stderr, "got value %g\n", y);\ 34 | smapa_value_ ## n = y;\ 35 | } else {\ 36 | fprintf(stderr, "kept default value %g\n",\ 37 | smapa_value_ ## n);\ 38 | }\ 39 | smapa_known_ ## n = true;\ 40 | }\ 41 | return smapa_value_ ## n;\ 42 | } 43 | 44 | #define SMART_PARAMETER_SILENT(n,v) static double n(void)\ 45 | {\ 46 | static bool smapa_known_ ## n = false;\ 47 | static double smapa_value_ ## n = v;\ 48 | if (!smapa_known_ ## n)\ 49 | {\ 50 | int r = 0;\ 51 | char *sv = getenv(#n);\ 52 | double y;\ 53 | if (sv)\ 54 | r = sscanf(sv, "%lf", &y);\ 55 | if (sv && r == 1)\ 56 | smapa_value_ ## n = y;\ 57 | smapa_known_ ## n = true;\ 58 | }\ 59 | return smapa_value_ ## n;\ 60 | } 61 | -------------------------------------------------------------------------------- /external/lua/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lzio_c 8 | #define LUA_CORE 9 | 10 | #include "lprefix.h" 11 | 12 | 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | #include "llimits.h" 18 | #include "lmem.h" 19 | #include "lstate.h" 20 | #include "lzio.h" 21 | 22 | 23 | int luaZ_fill (ZIO *z) { 24 | size_t size; 25 | lua_State *L = z->L; 26 | const char *buff; 27 | lua_unlock(L); 28 | buff = z->reader(L, z->data, &size); 29 | lua_lock(L); 30 | if (buff == NULL || size == 0) 31 | return EOZ; 32 | z->n = size - 1; /* discount char being returned */ 33 | z->p = buff; 34 | return cast_uchar(*(z->p++)); 35 | } 36 | 37 | 38 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 39 | z->L = L; 40 | z->reader = reader; 41 | z->data = data; 42 | z->n = 0; 43 | z->p = NULL; 44 | } 45 | 46 | 47 | /* --------------------------------------------------------------- read --- */ 48 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 49 | while (n) { 50 | size_t m; 51 | if (z->n == 0) { /* no bytes in buffer? */ 52 | if (luaZ_fill(z) == EOZ) /* try to read more */ 53 | return n; /* no more input; return number of missing bytes */ 54 | else { 55 | z->n++; /* luaZ_fill consumed first byte; put it back */ 56 | z->p--; 57 | } 58 | } 59 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 60 | memcpy(b, z->p, m); 61 | z->n -= m; 62 | z->p += m; 63 | b = (char *)b + m; 64 | n -= m; 65 | } 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /external/lua/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | 15 | /* Increments 'L->top.p', checking for stack overflows */ 16 | #define api_incr_top(L) {L->top.p++; \ 17 | api_check(L, L->top.p <= L->ci->top.p, \ 18 | "stack overflow");} 19 | 20 | 21 | /* 22 | ** If a call returns too many multiple returns, the callee may not have 23 | ** stack space to accommodate all results. In this case, this macro 24 | ** increases its stack space ('L->ci->top.p'). 25 | */ 26 | #define adjustresults(L,nres) \ 27 | { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \ 28 | L->ci->top.p = L->top.p; } 29 | 30 | 31 | /* Ensure the stack has at least 'n' elements */ 32 | #define api_checknelems(L,n) \ 33 | api_check(L, (n) < (L->top.p - L->ci->func.p), \ 34 | "not enough elements in the stack") 35 | 36 | 37 | /* 38 | ** To reduce the overhead of returning from C functions, the presence of 39 | ** to-be-closed variables in these functions is coded in the CallInfo's 40 | ** field 'nresults', in a way that functions with no to-be-closed variables 41 | ** with zero, one, or "all" wanted results have no overhead. Functions 42 | ** with other number of wanted results, as well as functions with 43 | ** variables to be closed, have an extra check. 44 | */ 45 | 46 | #define hastocloseCfunc(n) ((n) < LUA_MULTRET) 47 | 48 | /* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ 49 | #define codeNresults(n) (-(n) - 3) 50 | #define decodeNresults(n) (-(n) - 3) 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /external/imgui/examples/directx11_example/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX11 binding 2 | 3 | // Implemented features: 4 | // [X] User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 5 | 6 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 7 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 8 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 9 | // https://github.com/ocornut/imgui 10 | 11 | struct ID3D11Device; 12 | struct ID3D11DeviceContext; 13 | 14 | IMGUI_API bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContext* device_context); 15 | IMGUI_API void ImGui_ImplDX11_Shutdown(); 16 | IMGUI_API void ImGui_ImplDX11_NewFrame(); 17 | IMGUI_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 18 | 19 | // Use if you want to reset your rendering device without losing ImGui state. 20 | IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 21 | IMGUI_API bool ImGui_ImplDX11_CreateDeviceObjects(); 22 | 23 | // Handler for Win32 messages, update mouse/keyboard data. 24 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 25 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 26 | /* 27 | IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 28 | */ 29 | -------------------------------------------------------------------------------- /external/reproc/reproc/src/redirect.posix.c: -------------------------------------------------------------------------------- 1 | #define _POSIX_C_SOURCE 200809L 2 | 3 | #include "redirect.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "error.h" 10 | #include "pipe.h" 11 | 12 | static FILE *stream_to_file(REPROC_STREAM stream) 13 | { 14 | switch (stream) { 15 | case REPROC_STREAM_IN: 16 | return stdin; 17 | case REPROC_STREAM_OUT: 18 | return stdout; 19 | case REPROC_STREAM_ERR: 20 | return stderr; 21 | } 22 | 23 | return NULL; 24 | } 25 | 26 | int redirect_parent(int *child, REPROC_STREAM stream) 27 | { 28 | ASSERT(child); 29 | 30 | FILE *file = stream_to_file(stream); 31 | if (file == NULL) { 32 | return -EINVAL; 33 | } 34 | 35 | int r = fileno(file); 36 | if (r < 0) { 37 | return errno == EBADF ? -EPIPE : -errno; 38 | } 39 | 40 | *child = r; // `r` contains the duplicated file descriptor. 41 | 42 | return 0; 43 | } 44 | 45 | int redirect_discard(int *child, REPROC_STREAM stream) 46 | { 47 | return redirect_path(child, stream, "/dev/null"); 48 | } 49 | 50 | int redirect_file(int *child, FILE *file) 51 | { 52 | ASSERT(child); 53 | 54 | int r = fileno(file); 55 | if (r < 0) { 56 | return -errno; 57 | } 58 | 59 | *child = r; 60 | 61 | return 0; 62 | } 63 | 64 | int redirect_path(int *child, REPROC_STREAM stream, const char *path) 65 | { 66 | ASSERT(child); 67 | ASSERT(path); 68 | 69 | int mode = stream == REPROC_STREAM_IN ? O_RDONLY : O_WRONLY; 70 | 71 | int r = open(path, mode | O_CREAT | O_CLOEXEC, 0640); 72 | if (r < 0) { 73 | return -errno; 74 | } 75 | 76 | *child = r; 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /external/imgui/examples/marmalade_example/imgui_impl_marmalade.h: -------------------------------------------------------------------------------- 1 | // ImGui Marmalade binding with IwGx 2 | 3 | // Implemented features: 4 | // [X] User texture binding. Use 'CIwTexture*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 5 | 6 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 7 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 8 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 9 | // https://github.com/ocornut/imgui 10 | 11 | // Copyright (C) 2015 by Giovanni Zito 12 | // This file is part of ImGui 13 | 14 | IMGUI_API bool ImGui_Marmalade_Init(bool install_callbacks); 15 | IMGUI_API void ImGui_Marmalade_Shutdown(); 16 | IMGUI_API void ImGui_Marmalade_NewFrame(); 17 | IMGUI_API void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data); 18 | 19 | // Use if you want to reset your rendering device without losing ImGui state. 20 | IMGUI_API void ImGui_Marmalade_InvalidateDeviceObjects(); 21 | IMGUI_API bool ImGui_Marmalade_CreateDeviceObjects(); 22 | 23 | // callbacks (installed by default if you enable 'install_callbacks' during initialization) 24 | // You can also handle inputs yourself and use those as a reference. 25 | IMGUI_API int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserData); 26 | IMGUI_API int32 ImGui_Marmalade_KeyCallback(void* SystemData, void* userData); 27 | IMGUI_API int32 ImGui_Marmalade_CharCallback(void* SystemData, void* userData); 28 | -------------------------------------------------------------------------------- /external/nanosvg/premake4.lua: -------------------------------------------------------------------------------- 1 | 2 | local action = _ACTION or "" 3 | 4 | solution "nanosvg" 5 | location ( "build" ) 6 | configurations { "Debug", "Release" } 7 | platforms {"native", "x64", "x32"} 8 | 9 | project "example1" 10 | kind "ConsoleApp" 11 | language "C++" 12 | files { "example/example1.c", "example/*.h", "src/*.h" } 13 | includedirs { "example", "src" } 14 | targetdir("build") 15 | 16 | configuration { "linux" } 17 | links { "X11","Xrandr", "rt", "GL", "GLU", "pthread", "glfw" } 18 | 19 | configuration { "windows" } 20 | links { "glu32","opengl32", "gdi32", "winmm", "user32" } 21 | 22 | configuration { "macosx" } 23 | links { "glfw3" } 24 | linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" } 25 | 26 | configuration "Debug" 27 | defines { "DEBUG" } 28 | flags { "Symbols", "ExtraWarnings"} 29 | 30 | configuration "Release" 31 | defines { "NDEBUG" } 32 | flags { "Optimize", "ExtraWarnings"} 33 | 34 | project "example2" 35 | kind "ConsoleApp" 36 | language "C++" 37 | files { "example/example2.c", "example/*.h", "src/*.h" } 38 | includedirs { "example", "src" } 39 | targetdir("build") 40 | 41 | configuration { "linux" } 42 | links { "X11","Xrandr", "rt", "pthread" } 43 | 44 | configuration { "windows" } 45 | links { "winmm", "user32" } 46 | 47 | configuration { "macosx" } 48 | linkoptions { "-framework Cocoa", "-framework IOKit" } 49 | 50 | configuration "Debug" 51 | defines { "DEBUG" } 52 | flags { "Symbols", "ExtraWarnings"} 53 | 54 | configuration "Release" 55 | defines { "NDEBUG" } 56 | flags { "Optimize", "ExtraWarnings"} 57 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/WatcherFSEvents.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_WATCHERINOTIFY_HPP 2 | #define EFSW_WATCHERINOTIFY_HPP 3 | 4 | #include 5 | 6 | #if EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace efsw { 16 | 17 | class FileWatcherFSEvents; 18 | 19 | class FSEvent 20 | { 21 | public: 22 | FSEvent( std::string path, long flags, Uint64 id ) : 23 | Path( path ), 24 | Flags( flags ), 25 | Id ( id ) 26 | { 27 | } 28 | 29 | std::string Path; 30 | long Flags; 31 | Uint64 Id; 32 | }; 33 | 34 | class WatcherFSEvents : public Watcher 35 | { 36 | public: 37 | WatcherFSEvents(); 38 | 39 | WatcherFSEvents( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherFSEvents * parent = NULL ); 40 | 41 | ~WatcherFSEvents(); 42 | 43 | void init(); 44 | 45 | void initAsync(); 46 | 47 | void handleActions( std::vector & events ); 48 | 49 | void process(); 50 | 51 | FileWatcherFSEvents * FWatcher; 52 | 53 | FSEventStreamRef FSStream; 54 | protected: 55 | void handleAddModDel( const Uint32 &flags, const std::string &path, std::string &dirPath, std::string &filePath ); 56 | 57 | WatcherGeneric * WatcherGen; 58 | 59 | bool initializedAsync; 60 | 61 | std::set DirsChanged; 62 | 63 | void sendFileAction( WatchID watchid, const std::string& dir, const std::string& filename, Action action, std::string oldFilename = "" ); 64 | }; 65 | 66 | } 67 | 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /external/imgui/examples/directx10_example/directx10_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | sources 20 | 21 | 22 | imgui 23 | 24 | 25 | 26 | 27 | imgui 28 | 29 | 30 | sources 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | 43 | 44 | 45 | sources 46 | 47 | 48 | -------------------------------------------------------------------------------- /external/imgui/examples/directx11_example/directx11_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | sources 20 | 21 | 22 | imgui 23 | 24 | 25 | 26 | 27 | imgui 28 | 29 | 30 | sources 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | 43 | 44 | 45 | sources 46 | 47 | 48 | -------------------------------------------------------------------------------- /external/lua/src/lopnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lopnames.h $ 3 | ** Opcode names 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #if !defined(lopnames_h) 8 | #define lopnames_h 9 | 10 | #include 11 | 12 | 13 | /* ORDER OP */ 14 | 15 | static const char *const opnames[] = { 16 | "MOVE", 17 | "LOADI", 18 | "LOADF", 19 | "LOADK", 20 | "LOADKX", 21 | "LOADFALSE", 22 | "LFALSESKIP", 23 | "LOADTRUE", 24 | "LOADNIL", 25 | "GETUPVAL", 26 | "SETUPVAL", 27 | "GETTABUP", 28 | "GETTABLE", 29 | "GETI", 30 | "GETFIELD", 31 | "SETTABUP", 32 | "SETTABLE", 33 | "SETI", 34 | "SETFIELD", 35 | "NEWTABLE", 36 | "SELF", 37 | "ADDI", 38 | "ADDK", 39 | "SUBK", 40 | "MULK", 41 | "MODK", 42 | "POWK", 43 | "DIVK", 44 | "IDIVK", 45 | "BANDK", 46 | "BORK", 47 | "BXORK", 48 | "SHRI", 49 | "SHLI", 50 | "ADD", 51 | "SUB", 52 | "MUL", 53 | "MOD", 54 | "POW", 55 | "DIV", 56 | "IDIV", 57 | "BAND", 58 | "BOR", 59 | "BXOR", 60 | "SHL", 61 | "SHR", 62 | "MMBIN", 63 | "MMBINI", 64 | "MMBINK", 65 | "UNM", 66 | "BNOT", 67 | "NOT", 68 | "LEN", 69 | "CONCAT", 70 | "CLOSE", 71 | "TBC", 72 | "JMP", 73 | "EQ", 74 | "LT", 75 | "LE", 76 | "EQK", 77 | "EQI", 78 | "LTI", 79 | "LEI", 80 | "GTI", 81 | "GEI", 82 | "TEST", 83 | "TESTSET", 84 | "CALL", 85 | "TAILCALL", 86 | "RETURN", 87 | "RETURN0", 88 | "RETURN1", 89 | "FORLOOP", 90 | "FORPREP", 91 | "TFORPREP", 92 | "TFORCALL", 93 | "TFORLOOP", 94 | "SETLIST", 95 | "CLOSURE", 96 | "VARARG", 97 | "VARARGPREP", 98 | "EXTRAARG", 99 | NULL 100 | }; 101 | 102 | #endif 103 | 104 | -------------------------------------------------------------------------------- /external/lua/src/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include "lua.h" 12 | 13 | #include "lmem.h" 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 21 | 22 | 23 | typedef struct Mbuffer { 24 | char *buffer; 25 | size_t n; 26 | size_t buffsize; 27 | } Mbuffer; 28 | 29 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30 | 31 | #define luaZ_buffer(buff) ((buff)->buffer) 32 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 33 | #define luaZ_bufflen(buff) ((buff)->n) 34 | 35 | #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 | (buff)->buffsize, size), \ 42 | (buff)->buffsize = size) 43 | 44 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 45 | 46 | 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ 50 | 51 | 52 | 53 | /* --------- Private Part ------------------ */ 54 | 55 | struct Zio { 56 | size_t n; /* bytes still unread */ 57 | const char *p; /* current position in buffer */ 58 | lua_Reader reader; /* reader function */ 59 | void *data; /* additional data */ 60 | lua_State *L; /* Lua state (for reader) */ 61 | }; 62 | 63 | 64 | LUAI_FUNC int luaZ_fill (ZIO *z); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /external/efsw/src/efsw/FileWatcherGeneric.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFSW_FILEWATCHERGENERIC_HPP 2 | #define EFSW_FILEWATCHERGENERIC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace efsw 10 | { 11 | 12 | /// Implementation for Generic File Watcher. 13 | /// @class FileWatcherGeneric 14 | class FileWatcherGeneric : public FileWatcherImpl 15 | { 16 | public: 17 | typedef std::list WatchList; 18 | 19 | FileWatcherGeneric( FileWatcher * parent ); 20 | 21 | virtual ~FileWatcherGeneric(); 22 | 23 | /// Add a directory watch 24 | /// On error returns WatchID with Error type. 25 | WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive); 26 | 27 | /// Remove a directory watch. This is a brute force lazy search O(nlogn). 28 | void removeWatch(const std::string& directory); 29 | 30 | /// Remove a directory watch. This is a map lookup O(logn). 31 | void removeWatch(WatchID watchid); 32 | 33 | /// Updates the watcher. Must be called often. 34 | void watch(); 35 | 36 | /// Handles the action 37 | void handleAction(Watcher * watch, const std::string& filename, unsigned long action, std::string oldFilename = ""); 38 | 39 | /// @return Returns a list of the directories that are being watched 40 | std::list directories(); 41 | protected: 42 | Thread * mThread; 43 | 44 | /// The last watchid 45 | WatchID mLastWatchID; 46 | 47 | /// Map of WatchID to WatchStruct pointers 48 | WatchList mWatches; 49 | 50 | Mutex mWatchesLock; 51 | 52 | bool pathInWatches( const std::string& path ); 53 | private: 54 | void run(); 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1731533236, 9 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 10 | "owner": "numtide", 11 | "repo": "flake-utils", 12 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "numtide", 17 | "repo": "flake-utils", 18 | "type": "github" 19 | } 20 | }, 21 | "nixpkgs": { 22 | "locked": { 23 | "lastModified": 1748370509, 24 | "narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", 25 | "owner": "NixOS", 26 | "repo": "nixpkgs", 27 | "rev": "4faa5f5321320e49a78ae7848582f684d64783e9", 28 | "type": "github" 29 | }, 30 | "original": { 31 | "owner": "NixOS", 32 | "ref": "nixos-unstable", 33 | "repo": "nixpkgs", 34 | "type": "github" 35 | } 36 | }, 37 | "root": { 38 | "inputs": { 39 | "flake-utils": "flake-utils", 40 | "nixpkgs": "nixpkgs" 41 | } 42 | }, 43 | "systems": { 44 | "locked": { 45 | "lastModified": 1681028828, 46 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 47 | "owner": "nix-systems", 48 | "repo": "default", 49 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 50 | "type": "github" 51 | }, 52 | "original": { 53 | "owner": "nix-systems", 54 | "repo": "default", 55 | "type": "github" 56 | } 57 | } 58 | }, 59 | "root": "root", 60 | "version": 7 61 | } 62 | -------------------------------------------------------------------------------- /external/reproc/reproc++/include/reproc++/arguments.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace reproc { 7 | 8 | class arguments : public detail::array { 9 | public: 10 | arguments(const char *const *argv) // NOLINT 11 | : detail::array(argv, false) 12 | {} 13 | 14 | /*! 15 | `Arguments` must be iterable as a sequence of strings. Examples of types that 16 | satisfy this requirement are `std::vector` and 17 | `std::array`. 18 | 19 | `arguments` has the same restrictions as `argv` in `reproc_start` except 20 | that it should not end with `NULL` (`start` allocates a new array which 21 | includes the missing `NULL` value). 22 | */ 23 | template > 25 | arguments(const Arguments &arguments) // NOLINT 26 | : detail::array(from(arguments), true) 27 | {} 28 | 29 | private: 30 | template 31 | static const char *const *from(const Arguments &arguments); 32 | }; 33 | 34 | template 35 | const char *const *arguments::from(const Arguments &arguments) 36 | { 37 | using size_type = typename Arguments::value_type::size_type; 38 | 39 | const char **argv = new const char *[arguments.size() + 1]; 40 | std::size_t current = 0; 41 | 42 | for (const auto &argument : arguments) { 43 | char *string = new char[argument.size() + 1]; 44 | 45 | argv[current++] = string; 46 | 47 | for (size_type i = 0; i < argument.size(); i++) { 48 | *string++ = argument[i]; 49 | } 50 | 51 | *string = '\0'; 52 | } 53 | 54 | argv[current] = nullptr; 55 | 56 | return argv; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /external/reproc/reproc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(WIN32) 2 | set(REPROC_WINSOCK_LIBRARY ws2_32) 3 | elseif(CMAKE_SYSTEM_NAME MATCHES Linux) 4 | set(REPROC_RT_LIBRARY rt) # clock_gettime 5 | endif() 6 | 7 | reproc_library(reproc C) 8 | 9 | if(REPROC_MULTITHREADED) 10 | target_compile_definitions(reproc PRIVATE REPROC_MULTITHREADED) 11 | target_link_libraries(reproc PRIVATE Threads::Threads) 12 | endif() 13 | 14 | if(WIN32) 15 | set(PLATFORM windows) 16 | target_compile_definitions(reproc PRIVATE WIN32_LEAN_AND_MEAN) 17 | target_link_libraries(reproc PRIVATE ${REPROC_WINSOCK_LIBRARY}) 18 | else() 19 | set(PLATFORM posix) 20 | if(NOT APPLE) 21 | target_link_libraries(reproc PRIVATE ${REPROC_RT_LIBRARY}) 22 | endif() 23 | endif() 24 | 25 | target_sources(reproc PRIVATE 26 | src/clock.${PLATFORM}.c 27 | src/drain.c 28 | src/error.${PLATFORM}.c 29 | src/handle.${PLATFORM}.c 30 | src/init.${PLATFORM}.c 31 | src/options.c 32 | src/pipe.${PLATFORM}.c 33 | src/process.${PLATFORM}.c 34 | src/redirect.${PLATFORM}.c 35 | src/redirect.c 36 | src/reproc.c 37 | src/run.c 38 | src/strv.c 39 | src/utf.${PLATFORM}.c 40 | ) 41 | 42 | reproc_test(reproc argv C) 43 | reproc_test(reproc deadline C) 44 | reproc_test(reproc env C) 45 | reproc_test(reproc io C) 46 | reproc_test(reproc overflow C) 47 | reproc_test(reproc path C) 48 | reproc_test(reproc stop C) 49 | reproc_test(reproc working-directory C) 50 | reproc_test(reproc pid C) 51 | 52 | if(UNIX) 53 | reproc_test(reproc fork C) 54 | endif() 55 | 56 | reproc_example(reproc drain C) 57 | reproc_example(reproc env C ARGS PROJECT=REPROC) 58 | reproc_example(reproc path C) 59 | reproc_example(reproc poll C) 60 | reproc_example(reproc read C) 61 | reproc_example(reproc parent C) 62 | reproc_example(reproc run C) 63 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "icon_imgui_60@2x~iphone.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "size" : "60x60", 31 | "idiom" : "iphone", 32 | "filename" : "icon_imgui_60@3x~iphone.png", 33 | "scale" : "3x" 34 | }, 35 | { 36 | "idiom" : "ipad", 37 | "size" : "29x29", 38 | "scale" : "1x" 39 | }, 40 | { 41 | "idiom" : "ipad", 42 | "size" : "29x29", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "40x40", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "40x40", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "size" : "76x76", 57 | "idiom" : "ipad", 58 | "filename" : "icon_imgui_76~ipad.png", 59 | "scale" : "1x" 60 | }, 61 | { 62 | "size" : "76x76", 63 | "idiom" : "ipad", 64 | "filename" : "icon_imgui_76@2x~ipad.png", 65 | "scale" : "2x" 66 | }, 67 | { 68 | "idiom" : "ipad", 69 | "size" : "83.5x83.5", 70 | "scale" : "2x" 71 | } 72 | ], 73 | "info" : { 74 | "version" : 1, 75 | "author" : "xcode" 76 | } 77 | } -------------------------------------------------------------------------------- /external/imgui/examples/directx9_example/directx9_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {a82cba23-9de0-45c2-b1e3-2eb1666702de} 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | sources 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | sources 38 | 39 | 40 | imgui 41 | 42 | 43 | 44 | 45 | 46 | sources 47 | 48 | 49 | -------------------------------------------------------------------------------- /external/imgui/examples/opengl2_example/opengl2_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | sources 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | sources 38 | 39 | 40 | imgui 41 | 42 | 43 | 44 | 45 | 46 | sources 47 | 48 | 49 | -------------------------------------------------------------------------------- /external/imgui/examples/vulkan_example/vulkan_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | imgui 38 | 39 | 40 | sources 41 | 42 | 43 | 44 | 45 | 46 | sources 47 | 48 | 49 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl2_example/sdl_opengl2_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | imgui 38 | 39 | 40 | sources 41 | 42 | 43 | 44 | 45 | 46 | sources 47 | 48 | 49 | -------------------------------------------------------------------------------- /external/imgui/examples/apple_example/imguiex-ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.imgui.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl2_example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = sdl_opengl2_example 18 | SOURCES = main.cpp imgui_impl_sdl_gl2.cpp 19 | SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp 20 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 21 | 22 | UNAME_S := $(shell uname -s) 23 | 24 | 25 | ifeq ($(UNAME_S), Linux) #LINUX 26 | ECHO_MESSAGE = "Linux" 27 | LIBS = -lGL -ldl `sdl2-config --libs` 28 | 29 | CXXFLAGS = -I../../ `sdl2-config --cflags` 30 | CXXFLAGS += -Wall -Wformat 31 | CFLAGS = $(CXXFLAGS) 32 | endif 33 | 34 | ifeq ($(UNAME_S), Darwin) #APPLE 35 | ECHO_MESSAGE = "Mac OS X" 36 | LIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 37 | 38 | CXXFLAGS = -I../../ -I/usr/local/include `sdl2-config --cflags` 39 | CXXFLAGS += -Wall -Wformat 40 | CFLAGS = $(CXXFLAGS) 41 | endif 42 | 43 | ifeq ($(findstring MINGW,$(UNAME_S)),MINGW) 44 | ECHO_MESSAGE = "Windows" 45 | LIBS = -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 46 | 47 | CXXFLAGS = -I../../ `pkg-config --cflags sdl2` 48 | CXXFLAGS += -Wall -Wformat 49 | CFLAGS = $(CXXFLAGS) 50 | endif 51 | 52 | 53 | %.o:%.cpp 54 | $(CXX) $(CXXFLAGS) -c -o $@ $< 55 | 56 | %.o:../../%.cpp 57 | $(CXX) $(CXXFLAGS) -c -o $@ $< 58 | 59 | all: $(EXE) 60 | @echo Build complete for $(ECHO_MESSAGE) 61 | 62 | $(EXE): $(OBJS) 63 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 64 | 65 | clean: 66 | rm -f $(EXE) $(OBJS) 67 | -------------------------------------------------------------------------------- /src/dragndrop.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "ImageCollection.hpp" 7 | #include "Sequence.hpp" 8 | #include "Window.hpp" 9 | #include "collection_expression.hpp" 10 | #include "config.hpp" 11 | #include "dragndrop.hpp" 12 | #include "globals.hpp" 13 | #include "layout.hpp" 14 | 15 | static std::vector dropping; 16 | 17 | void handleDragDropEvent(const std::string& str, bool isfile) 18 | { 19 | if (str.empty()) { // last event of the serie 20 | if (dropping.size() == 0) 21 | return; 22 | auto colormap = !gColormaps.empty() ? gColormaps.back() : newColormap(); 23 | auto player = !gPlayers.empty() ? gPlayers.back() : newPlayer(); 24 | auto view = !gViews.empty() ? gViews.back() : newView(); 25 | auto seq = newSequence(std::move(colormap), std::move(player), std::move(view)); 26 | 27 | std::string files; 28 | for (const auto& s : dropping) { 29 | files += s + SEQUENCE_SEPARATOR; 30 | } 31 | *(files.end() - strlen(SEQUENCE_SEPARATOR)) = 0; 32 | auto filenames = buildFilenamesFromExpression(files); 33 | auto col = buildImageCollectionFromFilenames(filenames); 34 | seq->setImageCollection(col, ""); 35 | 36 | std::shared_ptr win; 37 | if (gWindows.empty()) { 38 | win = newWindow(); 39 | gShowHelp = false; 40 | } else if (gWindows[0]->sequences.empty()) { 41 | win = gWindows[0]; 42 | } else { 43 | win = newWindow(); 44 | } 45 | win->sequences.push_back(std::move(seq)); 46 | relayout(); 47 | dropping.clear(); 48 | } else { 49 | dropping.push_back(str); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/shaders.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Shader.hpp" 7 | #include "globals.hpp" 8 | #include "shaders.hpp" 9 | 10 | std::vector> gShaders; 11 | 12 | #define S(...) #__VA_ARGS__ 13 | 14 | static const std::string defaultVertex = S( 15 | uniform mat4 v_transform; 16 | layout(location = 1) in vec2 v_position; 17 | layout(location = 2) in vec2 v_texcoord; 18 | layout(location = 3) in vec4 v_color; 19 | out vec2 f_texcoord; 20 | out vec4 f_color; 21 | void main() { 22 | f_texcoord = v_texcoord; 23 | f_color = v_color; 24 | gl_Position = v_transform * vec4(v_position.xy, 0, 1); 25 | }); 26 | 27 | std::shared_ptr createShader(const std::string& mainFragment, const std::string& name) 28 | { 29 | return std::make_shared(std::initializer_list { 30 | Shader::Vertex(defaultVertex), 31 | Shader::Fragment(mainFragment) }, 32 | name); 33 | } 34 | 35 | bool loadShader(const std::string& name, const std::string& mainFragment) 36 | { 37 | auto shader = createShader(mainFragment, name); 38 | gShaders.push_back(shader); 39 | std::sort(gShaders.begin(), gShaders.end(), 40 | [](const std::shared_ptr lhs, const std::shared_ptr rhs) { 41 | return lhs->getName() < rhs->getName(); 42 | }); 43 | return true; 44 | } 45 | 46 | std::shared_ptr getShader(const std::string& name) 47 | { 48 | for (const auto& s : gShaders) { 49 | if (s->getName() == name) 50 | return s; 51 | } 52 | return nullptr; 53 | } 54 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Image viewer for image processing experts"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | flake-utils.url = "github:numtide/flake-utils"; 7 | }; 8 | 9 | outputs = { 10 | self, 11 | nixpkgs, 12 | flake-utils, 13 | }: 14 | flake-utils.lib.eachDefaultSystem ( 15 | system: let 16 | pkgs = nixpkgs.legacyPackages.${system}; 17 | rustPlatform = pkgs.rustPlatform; 18 | in { 19 | packages = rec { 20 | vpv = pkgs.stdenv.mkDerivation rec { 21 | pname = "vpv"; 22 | version = "0.9.0"; 23 | src = ./.; 24 | 25 | cargoRoot = "src/fuzzy-finder"; 26 | cargoDeps = rustPlatform.importCargoLock { 27 | lockFile = ./src/fuzzy-finder/Cargo.lock; 28 | }; 29 | 30 | cmakeFlags = [ 31 | "-DUSE_GDAL=ON" 32 | "-DUSE_OCTAVE=ON" 33 | "-DVPV_VERSION=${version}" 34 | "-DBUILD_TESTING=ON" 35 | ]; 36 | 37 | nativeBuildInputs = with pkgs; [ 38 | cmake 39 | pkg-config 40 | rustPlatform.cargoSetupHook 41 | cargo 42 | ]; 43 | 44 | buildInputs = with pkgs; 45 | [ 46 | libpng 47 | libtiff 48 | libjpeg 49 | SDL2 50 | gdal 51 | 52 | octave 53 | pkgs.octavePackages.image 54 | ] 55 | ++ lib.optionals stdenv.hostPlatform.isLinux [ 56 | libGL 57 | xorg.libX11 58 | ]; 59 | 60 | doCheck = true; 61 | }; 62 | 63 | default = vpv; 64 | }; 65 | } 66 | ); 67 | } 68 | -------------------------------------------------------------------------------- /external/reproc/reproc/test/io.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "assert.h" 5 | 6 | #define MESSAGE "reproc stands for REdirected PROCess" 7 | 8 | static void io() 9 | { 10 | int r = -1; 11 | 12 | reproc_t *process = reproc_new(); 13 | ASSERT(process); 14 | 15 | const char *argv[] = { RESOURCE_DIRECTORY "/io", NULL }; 16 | 17 | r = reproc_start(process, argv, 18 | (reproc_options){ 19 | .redirect.err.type = REPROC_REDIRECT_STDOUT }); 20 | ASSERT_OK(r); 21 | 22 | r = reproc_write(process, (uint8_t *) MESSAGE, strlen(MESSAGE)); 23 | ASSERT_OK(r); 24 | ASSERT_EQ_INT(r, (int) strlen(MESSAGE)); 25 | 26 | r = reproc_close(process, REPROC_STREAM_IN); 27 | ASSERT_OK(r); 28 | 29 | char *out = NULL; 30 | r = reproc_drain(process, reproc_sink_string(&out), REPROC_SINK_NULL); 31 | ASSERT_OK(r); 32 | 33 | ASSERT(out != NULL); 34 | ASSERT_EQ_STR(out, MESSAGE MESSAGE); 35 | 36 | r = reproc_wait(process, REPROC_INFINITE); 37 | ASSERT_OK(r); 38 | 39 | reproc_destroy(process); 40 | 41 | reproc_free(out); 42 | } 43 | 44 | static void timeout(void) 45 | { 46 | int r = -1; 47 | 48 | reproc_t *process = reproc_new(); 49 | ASSERT(process); 50 | 51 | const char *argv[] = { RESOURCE_DIRECTORY "/io", NULL }; 52 | 53 | r = reproc_start(process, argv, (reproc_options){ 0 }); 54 | ASSERT_OK(r); 55 | 56 | reproc_event_source source = { process, REPROC_EVENT_OUT | REPROC_EVENT_ERR, 57 | 0 }; 58 | r = reproc_poll(&source, 1, 200); 59 | ASSERT(r == 0); 60 | 61 | r = reproc_close(process, REPROC_STREAM_IN); 62 | ASSERT_OK(r); 63 | 64 | r = reproc_poll(&source, 1, 200); 65 | ASSERT_OK(r); 66 | 67 | reproc_destroy(process); 68 | } 69 | 70 | int main(void) 71 | { 72 | io(); 73 | timeout(); 74 | } 75 | -------------------------------------------------------------------------------- /external/lua/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include "lgc.h" 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | 14 | 15 | /* 16 | ** Memory-allocation error message must be preallocated (it cannot 17 | ** be created after memory is exhausted) 18 | */ 19 | #define MEMERRMSG "not enough memory" 20 | 21 | 22 | /* 23 | ** Size of a TString: Size of the header plus space for the string 24 | ** itself (including final '\0'). 25 | */ 26 | #define sizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char)) 27 | 28 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 29 | (sizeof(s)/sizeof(char))-1)) 30 | 31 | 32 | /* 33 | ** test whether a string is a reserved word 34 | */ 35 | #define isreserved(s) ((s)->tt == LUA_VSHRSTR && (s)->extra > 0) 36 | 37 | 38 | /* 39 | ** equality for short strings, which are always internalized 40 | */ 41 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b)) 42 | 43 | 44 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 45 | LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 46 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 47 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 48 | LUAI_FUNC void luaS_clearcache (global_State *g); 49 | LUAI_FUNC void luaS_init (lua_State *L); 50 | LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); 51 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue); 52 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 53 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 54 | LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /external/imgui/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h: -------------------------------------------------------------------------------- 1 | // ImGui SDL2 binding with OpenGL3 2 | // (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) 3 | // (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) 4 | 5 | // Implemented features: 6 | // [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 7 | // Missing features: 8 | // [ ] SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME. 9 | 10 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 11 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 12 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 13 | // https://github.com/ocornut/imgui 14 | 15 | struct SDL_Window; 16 | typedef union SDL_Event SDL_Event; 17 | 18 | IMGUI_API bool ImGui_ImplSdlGL3_Init(SDL_Window* window, const char* glsl_version = NULL); 19 | IMGUI_API void ImGui_ImplSdlGL3_Shutdown(); 20 | IMGUI_API void ImGui_ImplSdlGL3_NewFrame(SDL_Window* window); 21 | IMGUI_API void ImGui_ImplSdlGL3_RenderDrawData(ImDrawData* draw_data); 22 | IMGUI_API bool ImGui_ImplSdlGL3_ProcessEvent(SDL_Event* event); 23 | 24 | // Use if you want to reset your rendering device without losing ImGui state. 25 | IMGUI_API void ImGui_ImplSdlGL3_InvalidateDeviceObjects(); 26 | IMGUI_API bool ImGui_ImplSdlGL3_CreateDeviceObjects(); 27 | --------------------------------------------------------------------------------