├── imgui-react-runtime ├── .babelrc ├── external │ ├── stb │ │ ├── stb.c │ │ ├── version_stb │ │ └── CMakeLists.txt │ ├── soloud │ │ ├── src │ │ │ ├── audiosource │ │ │ │ ├── wav │ │ │ │ │ ├── stb_vorbis.h │ │ │ │ │ └── dr_impl.cpp │ │ │ │ ├── speech │ │ │ │ │ ├── tts.h │ │ │ │ │ ├── darray.h │ │ │ │ │ ├── legal_readme.txt │ │ │ │ │ ├── darray.cpp │ │ │ │ │ ├── resonator.h │ │ │ │ │ └── resonator.cpp │ │ │ │ ├── tedsid │ │ │ │ │ ├── readme.txt │ │ │ │ │ └── ted.h │ │ │ │ └── ay │ │ │ │ │ ├── readme.txt │ │ │ │ │ ├── chipplayer.h │ │ │ │ │ ├── sndrender.h │ │ │ │ │ ├── sndbuffer.cpp │ │ │ │ │ └── sndbuffer.h │ │ │ ├── tools │ │ │ │ └── resamplerlab │ │ │ │ │ └── stb_image_write.c │ │ │ └── backend │ │ │ │ └── null │ │ │ │ └── soloud_null.cpp │ │ ├── version │ │ ├── soloud.png │ │ ├── .gitmodules │ │ ├── scripts │ │ │ ├── compile_gamemaker_dll.bat │ │ │ ├── makeglue.py │ │ │ ├── make_gmez.bat │ │ │ ├── readme.txt │ │ │ ├── checkapidoc.py │ │ │ ├── checksanity.py │ │ │ ├── gen_autoit.py │ │ │ └── gen_blitzmax.py │ │ ├── contrib │ │ │ ├── README.md │ │ │ ├── cmake │ │ │ │ ├── Install.cmake │ │ │ │ ├── PrintOptionStatus.cmake │ │ │ │ ├── InstallExport.cmake │ │ │ │ └── OptionDependentOnPackage.cmake │ │ │ ├── CMakeLists.txt │ │ │ ├── demos.cmake │ │ │ └── Configure.cmake │ │ ├── README.md │ │ ├── issue_template.md │ │ ├── .gitignore │ │ ├── include │ │ │ ├── soloud_file_hack_off.h │ │ │ ├── soloud_misc.h │ │ │ ├── soloud_error.h │ │ │ ├── soloud_fft.h │ │ │ ├── soloud_dcremovalfilter.h │ │ │ ├── soloud_openmpt.h │ │ │ ├── soloud_vizsn.h │ │ │ ├── soloud_fader.h │ │ │ ├── soloud_ay.h │ │ │ ├── soloud_noise.h │ │ │ ├── soloud_tedsid.h │ │ │ ├── soloud_waveshaperfilter.h │ │ │ ├── soloud_bassboostfilter.h │ │ │ ├── soloud_flangerfilter.h │ │ │ ├── soloud_echofilter.h │ │ │ ├── soloud_robotizefilter.h │ │ │ ├── soloud_duckfilter.h │ │ │ ├── soloud_file_hack_on.h │ │ │ ├── soloud_queue.h │ │ │ ├── soloud_lofifilter.h │ │ │ ├── soloud_eqfilter.h │ │ │ ├── soloud_fftfilter.h │ │ │ ├── soloud_speech.h │ │ │ └── soloud_freeverbfilter.h │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── LICENSE │ │ ├── AUTHORS │ │ └── CONTRIBUTING │ ├── sokol │ │ ├── version_sokol │ │ ├── sokol.c │ │ └── CMakeLists.txt │ ├── yoga │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── cimgui │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ └── imgui │ │ │ └── LICENSE.txt │ ├── glfw │ │ └── CMakeLists.txt │ └── libwebsockets │ │ └── CMakeLists.txt ├── examples │ ├── uix │ │ ├── core.cpp │ │ └── CMakeLists.txt │ ├── hello │ │ ├── hello.cpp │ │ ├── app.jsx │ │ ├── CMakeLists.txt │ │ └── index.js │ ├── showcase │ │ ├── showcase.cpp │ │ ├── CMakeLists.txt │ │ └── index.js │ ├── dynamic-windows │ │ ├── dynamic-windows.cpp │ │ ├── CMakeLists.txt │ │ ├── index.js │ │ └── app.jsx │ ├── CMakeLists.txt │ └── persistent-vector-demo │ │ └── CMakeLists.txt ├── .npmrc.example ├── .prettierrc ├── media │ └── showcase.jpg ├── lib │ ├── imgui-unit │ │ ├── js_externs.c │ │ ├── gen_js_externs.sh │ │ ├── CMakeLists.txt │ │ └── main.js │ ├── native │ │ ├── immer │ │ │ ├── extra │ │ │ │ ├── persist │ │ │ │ │ ├── xxhash │ │ │ │ │ │ ├── xxhash_64.cpp │ │ │ │ │ │ └── xxhash.hpp │ │ │ │ │ ├── detail │ │ │ │ │ │ ├── traits.hpp │ │ │ │ │ │ ├── transform.hpp │ │ │ │ │ │ ├── names.hpp │ │ │ │ │ │ ├── alias.hpp │ │ │ │ │ │ ├── common │ │ │ │ │ │ │ └── pool.hpp │ │ │ │ │ │ ├── rbts │ │ │ │ │ │ │ └── traits.hpp │ │ │ │ │ │ └── cereal │ │ │ │ │ │ │ ├── compact_map.hpp │ │ │ │ │ │ │ └── input_archive_util.hpp │ │ │ │ │ ├── types.hpp │ │ │ │ │ ├── hash_container_conversion.hpp │ │ │ │ │ ├── errors.hpp │ │ │ │ │ └── cereal │ │ │ │ │ │ └── load.hpp │ │ │ │ ├── cereal │ │ │ │ │ ├── immer_box.hpp │ │ │ │ │ ├── immer_array.hpp │ │ │ │ │ ├── immer_set.hpp │ │ │ │ │ ├── immer_table.hpp │ │ │ │ │ └── immer_vector.hpp │ │ │ │ └── io.hpp │ │ │ ├── heap │ │ │ │ ├── tags.hpp │ │ │ │ ├── free_list_node.hpp │ │ │ │ ├── identity_heap.hpp │ │ │ │ ├── cpp_heap.hpp │ │ │ │ ├── with_data.hpp │ │ │ │ ├── split_heap.hpp │ │ │ │ ├── malloc_heap.hpp │ │ │ │ ├── thread_local_free_list_heap.hpp │ │ │ │ └── debug_size_heap.hpp │ │ │ ├── lock │ │ │ │ ├── no_lock_policy.hpp │ │ │ │ └── spinlock_policy.hpp │ │ │ ├── refcount │ │ │ │ ├── no_refcount_policy.hpp │ │ │ │ ├── enable_intrusive_ptr.hpp │ │ │ │ ├── unsafe_refcount_policy.hpp │ │ │ │ └── refcount_policy.hpp │ │ │ ├── detail │ │ │ │ ├── rbts │ │ │ │ │ ├── bits.hpp │ │ │ │ │ └── visitor.hpp │ │ │ │ └── ref_count_base.hpp │ │ │ ├── transience │ │ │ │ └── no_transience_policy.hpp │ │ │ └── experimental │ │ │ │ └── dvektor.hpp │ │ ├── LICENSE_immer │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── imgui-runtime │ │ ├── WebSocketSupport.h │ │ ├── MappedFileBuffer.h │ │ └── CMakeLists.txt │ ├── native-support │ │ ├── WebSocketSupport.h │ │ ├── MappedFileBuffer.h │ │ └── CMakeLists.txt │ ├── jslib-unit │ │ └── CMakeLists.txt │ ├── skia-unit │ │ ├── CMakeLists.txt │ │ └── renderer.js │ └── react-imgui-reconciler │ │ ├── tree-node.js │ │ └── tree-printer.js ├── .gitignore ├── LICENSE_sokol ├── LICENSE ├── LICENSE_soloud ├── .vscode │ └── settings.json ├── doc │ └── TODO.md ├── tools │ └── xxd.py ├── scripts │ └── bundle-react-unit.js ├── CMakeLists.txt └── LICENSE_stb ├── deps.edn ├── .gitignore ├── package.json ├── .gitmodules ├── shadow-cljs.edn ├── .vscode └── settings.json └── README.md /imgui-react-runtime/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-react"] 3 | } 4 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/stb/stb.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_IMPLEMENTATION 2 | #include "stb_image.h" -------------------------------------------------------------------------------- /imgui-react-runtime/examples/uix/core.cpp: -------------------------------------------------------------------------------- 1 | #define PROVIDE_IMGUI_MAIN 2 | #include "imgui-runtime.h" 3 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | {:deps {thheller/shadow-cljs {:mvn/version "3.2.1"} 2 | com.pitch/uix.core {:mvn/version "1.4.7"}}} -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/wav/stb_vorbis.h: -------------------------------------------------------------------------------- 1 | #define STB_VORBIS_HEADER_ONLY 2 | #include "stb_vorbis.c" -------------------------------------------------------------------------------- /imgui-react-runtime/external/sokol/version_sokol: -------------------------------------------------------------------------------- 1 | https://github.com/floooh/sokol 2 | 31f3dfc17931113cfa3d4f73b242730631f44cf5 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/version: -------------------------------------------------------------------------------- 1 | https://github.com/jarikomppa/soloud 2 | 1157475881da0d7f76102578255b937c7d4e8f57 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/stb/version_stb: -------------------------------------------------------------------------------- 1 | https://github.com/nothings/stb.git 2 | beebb24b945efdea3b9bba23affb8eb3ba8982e7 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/.npmrc.example: -------------------------------------------------------------------------------- 1 | # Copy this file to .npmrc and update the path to your Hermes binary 2 | hermes_bin=/path/to/hermes 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "tabWidth": 2, 5 | "trailingComma": "es5" 6 | } 7 | -------------------------------------------------------------------------------- /imgui-react-runtime/media/showcase.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roman01la/cljs-static-hermes/master/imgui-react-runtime/media/showcase.jpg -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/tts.h: -------------------------------------------------------------------------------- 1 | 2 | extern int xlate_string (const char *string,darray *phone); 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/tools/resamplerlab/stb_image_write.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_WRITE_IMPLEMENTATION 2 | #include "stb_image_write.h" 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/soloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roman01la/cljs-static-hermes/master/imgui-react-runtime/external/soloud/soloud.png -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-unit/js_externs.c: -------------------------------------------------------------------------------- 1 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 2 | #include "cimgui/cimgui.h" 3 | #include "sokol/sokol_imgui.h" 4 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/libmodplug"] 2 | path = ext/libmodplug 3 | url = https://github.com/jarikomppa/libmodplug.git 4 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/stb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(stb stb.c stb_image.h) 2 | target_include_directories(stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | bundle/ 4 | *.log 5 | .DS_Store 6 | .npmrc 7 | cmake-build-*/ 8 | .claude/ 9 | .idea/ 10 | examples/uix/out -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/tedsid/readme.txt: -------------------------------------------------------------------------------- 1 | The TED / SID support is based on tedplay (c) 2012 Attila Grosz, used under Unlicense http://unlicense.org/ 2 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/compile_gamemaker_dll.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call vcvars32.bat 3 | cl /LD /MT /Ox /nologo soloud_gamemaker_dll.c soloud_gamemaker_dll.def user32.lib 4 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/ay/readme.txt: -------------------------------------------------------------------------------- 1 | The AY sound support is based on public domain zxssk library 2 | "created under public domain license by SMT, jan.2006" 3 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/makeglue.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import glob 3 | import subprocess 4 | 5 | for file in glob.glob("gen_*.py"): 6 | subprocess.call(["python",file]) 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .cpcache/ 3 | .idea/ 4 | .shadow-cljs/ 5 | imgui-react-runtime/examples/persistent-vector-demo/cljs-out/ 6 | imgui-react-runtime/examples/uix/out 7 | imgui-react-runtime/examples/skia/out 8 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/make_gmez.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | del soloud.gmez 3 | cd gm_temp 4 | 7z a -r -y ../../glue/soloud.gmez * 5 | cd .. 6 | rd /s /q gm_temp 7 | del soloud_gamemaker_dll.* 8 | del soloud.extension.gmx 9 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/hello/hello.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | #define PROVIDE_IMGUI_MAIN 6 | #include "imgui-runtime.h" 7 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/showcase/showcase.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | #define PROVIDE_IMGUI_MAIN 6 | #include "imgui-runtime.h" 7 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/yoga/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Yoga - Flexbox layout engine 2 | # Build as a regular subdirectory 3 | 4 | add_subdirectory(yoga) 5 | 6 | # Create an alias yoga -> yogacore for easier linking 7 | add_library(yoga ALIAS yogacore) 8 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/readme.txt: -------------------------------------------------------------------------------- 1 | The 'codegen' tool can be used to parse SoLoud headers and generate the 2 | soloud_codegen.py file. 3 | 4 | This file can then be used to generate various "glue" code for non-c 5 | environments. 6 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/dynamic-windows/dynamic-windows.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | #define PROVIDE_IMGUI_MAIN 6 | #include "imgui-runtime.h" 7 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Third-party native libraries 2 | add_subdirectory(cimgui) 3 | add_subdirectory(sokol) 4 | add_subdirectory(stb) 5 | add_subdirectory(libwebsockets) 6 | add_subdirectory(skia) 7 | add_subdirectory(glfw) 8 | add_subdirectory(yoga) 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@babel/cli": "^7.28.3", 4 | "@babel/core": "^7.28.4", 5 | "@babel/preset-react": "^7.27.1", 6 | "esbuild": "^0.25.11", 7 | "react": "19.2.0", 8 | "react-reconciler": "0.33.0", 9 | "react-refresh": "^0.18.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/xxhash/xxhash_64.cpp: -------------------------------------------------------------------------------- 1 | #include "xxhash.hpp" 2 | 3 | #include 4 | 5 | namespace immer::persist { 6 | 7 | std::uint64_t xx_hash_value_string(const std::string& str) 8 | { 9 | return XXH3_64bits(str.c_str(), str.size()); 10 | } 11 | 12 | } // namespace immer::persist 13 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/hello/app.jsx: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | import React from 'react'; 6 | 7 | export function App() { 8 | return ( 9 | 10 | Hello World! 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/README.md: -------------------------------------------------------------------------------- 1 | The contrib folder contains files that may be of use to some people 2 | but are not maintained by the project itself. As such they may be 3 | out of date. Pull requests are welcome. 4 | 5 | Note that the licenses of the contrib files may also be out of line 6 | with the SoLoud proper. You have been warned. -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/traits.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace immer::persist::detail { 4 | 5 | /** 6 | * Define these traits to connect a type (vector_one) to its pool 7 | * (output_pool). 8 | */ 9 | template 10 | struct container_traits 11 | {}; 12 | 13 | } // namespace immer::persist::detail 14 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/README.md: -------------------------------------------------------------------------------- 1 | SoLoud 2 | ====== 3 | 4 | SoLoud is an easy to use, free, portable c/c++ audio engine for games. 5 | 6 | ![ScreenShot](https://raw.github.com/jarikomppa/soloud/master/soloud.png) 7 | 8 | Zlib/LibPng licensed. Portable. Easy. 9 | 10 | Official site with documentation can be found at: 11 | http://soloud-audio.com 12 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/uix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Note: Native libraries (cimgui, sokol, stb, soloud) are built in external/ 2 | # Note: Hermes configuration is in root CMakeLists.txt 3 | # Note: jslib-unit and imgui-unit are built in lib/ 4 | 5 | # Build the UIx React+ImGui application 6 | add_react_imgui_app( 7 | TARGET uix 8 | ENTRY_POINT out/main.js 9 | SOURCES core.cpp 10 | ) 11 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/wav/dr_impl.cpp: -------------------------------------------------------------------------------- 1 | #define DR_MP3_IMPLEMENTATION 2 | #define DR_MP3_NO_STDIO 3 | #define DR_MP3_FLOAT_OUTPUT 4 | #include "dr_mp3.h" 5 | 6 | #define DR_WAV_IMPLEMENTATION 7 | #define DR_WAV_NO_STDIO 8 | #include "dr_wav.h" 9 | 10 | #define DR_FLAC_IMPLEMENTATION 11 | #define DR_FLAC_NO_STDIO 12 | #define DR_FLAC_NO_CRC 13 | #include "dr_flac.h" 14 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace immer::persist { 6 | 7 | struct node_id_tag; 8 | using node_id = detail::type_alias; 9 | 10 | struct container_id_tag; 11 | using container_id = detail::type_alias; 12 | 13 | } // namespace immer::persist 14 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/cimgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Dear ImGui C bindings 2 | add_library(cimgui STATIC 3 | cimgui.cpp 4 | cimgui.h 5 | imgui/imgui.cpp 6 | imgui/imgui.h 7 | imgui/imgui_widgets.cpp 8 | imgui/imgui_draw.cpp 9 | imgui/imgui_tables.cpp 10 | imgui/imgui_demo.cpp) 11 | target_include_directories(cimgui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 12 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # JavaScript library units compiled with Static Hermes 6 | 7 | add_subdirectory(native-support) 8 | add_subdirectory(jslib-unit) 9 | add_subdirectory(imgui-unit) 10 | add_subdirectory(skia-unit) 11 | add_subdirectory(imgui-runtime) 12 | add_subdirectory(native) 13 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Examples directory - each subdirectory is an example application 6 | add_subdirectory(hello) 7 | add_subdirectory(dynamic-windows) 8 | add_subdirectory(showcase) 9 | add_subdirectory(uix) 10 | add_subdirectory(persistent-vector-demo) 11 | add_subdirectory(skia) 12 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/tags.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | namespace immer { 12 | 13 | struct norefs_tag 14 | {}; 15 | 16 | } // namespace immer 17 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-unit/gen_js_externs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ../tools/ffigen.py js js_externs.c sokol_imgui.h,cimgui.h > js_externs.js 4 | ../tools/ffigen.py cwrap js_externs.c sokol_imgui.h,cimgui.h > tmp-cwrap.c 5 | 6 | cat << "EOF" - tmp-cwrap.c > js_externs_cwrap.c 7 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 8 | #include "cimgui.h" 9 | #include "sokol_app.h" 10 | #include "sokol_gfx.h" 11 | #include "sokol_imgui.h" 12 | EOF 13 | 14 | rm tmp-cwrap.c 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/darray.h: -------------------------------------------------------------------------------- 1 | #if !defined(DARRAY_H) 2 | #define DARRAY_H 3 | 4 | class darray 5 | { 6 | protected: 7 | char *mData; 8 | int mUsed; 9 | int mAllocated; 10 | int mAllocChunk; 11 | public: 12 | darray(); 13 | ~darray(); 14 | void clear(); 15 | char *getDataInPos(int aPosition); 16 | void put(int aData); 17 | int getSize() const { return mUsed; } 18 | char *getData() { return mData; } 19 | }; 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/hello/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Note: Native libraries (cimgui, sokol, stb, soloud) are built in external/ 6 | # Note: Hermes configuration is in root CMakeLists.txt 7 | # Note: jslib-unit and imgui-unit are built in lib/ 8 | 9 | # Build the hello React+ImGui application 10 | add_react_imgui_app( 11 | TARGET hello 12 | ENTRY_POINT index.js 13 | SOURCES hello.cpp 14 | ) 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/showcase/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Note: Native libraries (cimgui, sokol, stb, soloud) are built in external/ 6 | # Note: Hermes configuration is in root CMakeLists.txt 7 | # Note: jslib-unit and imgui-unit are built in lib/ 8 | 9 | # Build the showcase React+ImGui application 10 | add_react_imgui_app( 11 | TARGET showcase 12 | ENTRY_POINT index.js 13 | SOURCES showcase.cpp 14 | ) 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-runtime/WebSocketSupport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /// Initialize WebSocket support and install the WebSocket constructor into the JS runtime. 8 | void initializeWebSocketSupport(facebook::hermes::HermesRuntime &runtime); 9 | 10 | /// Pump libwebsockets once, processing pending network events. 11 | void pumpWebSocketSupport(); 12 | 13 | /// Shutdown WebSocket support and release associated resources. 14 | void shutdownWebSocketSupport(); 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native-support/WebSocketSupport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /// Initialize WebSocket support and install the WebSocket constructor into the JS runtime. 8 | void initializeWebSocketSupport(facebook::hermes::HermesRuntime &runtime); 9 | 10 | /// Pump libwebsockets once, processing pending network events. 11 | void pumpWebSocketSupport(); 12 | 13 | /// Shutdown WebSocket support and release associated resources. 14 | void shutdownWebSocketSupport(); 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/dynamic-windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Note: Native libraries (cimgui, sokol, stb, soloud) are built in external/ 6 | # Note: Hermes configuration is in root CMakeLists.txt 7 | # Note: jslib-unit and imgui-unit are built in lib/ 8 | 9 | # Build the dynamic-windows React+ImGui application 10 | add_react_imgui_app( 11 | TARGET dynamic-windows 12 | ENTRY_POINT index.js 13 | SOURCES dynamic-windows.cpp 14 | ) 15 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/issue_template.md: -------------------------------------------------------------------------------- 1 | > Expected behavior: 2 | 3 | 4 | > Actual behavior: 5 | 6 | 7 | > Steps to reproduce the problem: 8 | 9 | 10 | > SoLoud version, operating system, backend used, any other potentially useful information: 11 | 12 | 13 | [//]: # ( You don't need to follow the above template if you do not want to; feel free to start from scratch. ) 14 | [//]: # ( Following the template leads to problem reports that are helpful to the developers. ) 15 | [//]: # ( ...yes, this weird syntax is how one writes comments in a markdown file ) 16 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | _UpgradeReport_Files/ 3 | *.ipch 4 | *.opensdf 5 | *.sdf 6 | *.old 7 | *.filters 8 | build/ 9 | *.aux 10 | *.out 11 | *.gz 12 | *.toc 13 | *.o 14 | incoming/ 15 | experiments/ 16 | scripts/*.log 17 | lib/* 18 | rel/* 19 | doc/* 20 | bin/audio/ 21 | bin/ 22 | lib/*.ilk 23 | lib/*.lib 24 | lib/*.dll 25 | out/ 26 | *.pyc 27 | *.exp 28 | docsrc/xelatex_output.txt 29 | docsrc/kindlegen_output.txt 30 | *.idb 31 | *.pdb 32 | docsrc/20* 33 | glue/* 34 | scripts/soloud_codegen.py 35 | glue/rpgmaker_soloud.rb 36 | *.lastcodeanalysissucceeded 37 | *.bak 38 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/sokol/sokol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Tzvetan Mikov. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #define SOKOL_IMPL 9 | #include "sokol_app.h" 10 | #include "sokol_gfx.h" 11 | #include "sokol_glue.h" 12 | #include "sokol_log.h" 13 | #include "sokol_time.h" 14 | 15 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 16 | #include "cimgui.h" 17 | #define SOKOL_IMGUI_IMPL 18 | #include "sokol_imgui.h" 19 | 20 | // Must be separate to avoid reordering. 21 | #include "sokol_debugtext.h" 22 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-runtime/MappedFileBuffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | /// Memory map a file. 11 | /// 12 | /// @param path the file path to map 13 | /// @param attemptTrailingZero if possible, add a trailing zero and increase the 14 | /// logical mapped size to include it. 15 | /// @return memory mapped buffer 16 | std::shared_ptr 17 | mapFileBuffer(const char *path, bool attemptTrailingZero = false); 18 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native-support/MappedFileBuffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | /// Memory map a file. 11 | /// 12 | /// @param path the file path to map 13 | /// @param attemptTrailingZero if possible, add a trailing zero and increase the 14 | /// logical mapped size to include it. 15 | /// @return memory mapped buffer 16 | std::shared_ptr 17 | mapFileBuffer(const char *path, bool attemptTrailingZero = false); 18 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/cereal/immer_box.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace cereal { 7 | 8 | template 9 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, immer::box& m) 10 | { 11 | T x; 12 | ar(x); 13 | m = std::move(x); 14 | } 15 | 16 | template 17 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, 18 | const immer::box& m) 19 | { 20 | ar(m.get()); 21 | } 22 | 23 | } // namespace cereal 24 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "imgui-react-runtime/external/libwebsockets/libwebsockets"] 2 | path = imgui-react-runtime/external/libwebsockets/libwebsockets 3 | url = https://github.com/warmcat/libwebsockets 4 | [submodule "imgui-react-runtime/external/skia/skia"] 5 | path = imgui-react-runtime/external/skia/skia 6 | url = https://skia.googlesource.com/skia.git 7 | [submodule "imgui-react-runtime/external/glfw/glfw"] 8 | path = imgui-react-runtime/external/glfw/glfw 9 | url = https://github.com/glfw/glfw.git 10 | [submodule "imgui-react-runtime/external/yoga/yoga"] 11 | path = imgui-react-runtime/external/yoga/yoga 12 | url = https://github.com/facebook/yoga.git 13 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/free_list_node.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace immer { 14 | 15 | struct free_list_node 16 | { 17 | free_list_node* next; 18 | }; 19 | 20 | template 21 | struct with_free_list_node : with_data 22 | {}; 23 | 24 | } // namespace immer 25 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/lock/no_lock_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | namespace immer { 12 | 13 | struct no_lock_policy 14 | { 15 | bool try_lock() { return true; } 16 | void lock() {} 17 | void unlock() {} 18 | 19 | struct scoped_lock 20 | { 21 | scoped_lock(no_lock_policy&) {} 22 | }; 23 | }; 24 | 25 | } // namespace immer 26 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/cmake/Install.cmake: -------------------------------------------------------------------------------- 1 | # Required Vars: 2 | # ${TARGET_NAME} 3 | 4 | SET (INSTALL_BINDIR bin) 5 | IF(WIN32) 6 | SET(INSTALL_LIBDIR bin) 7 | SET(INSTALL_ARCHIVEDIR lib) 8 | ELSE(WIN32) 9 | SET(INSTALL_LIBDIR lib${LIB_POSTFIX}) 10 | SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX}) 11 | ENDIF(WIN32) 12 | 13 | SET (PROJECT_NAME_LOWERCASE) 14 | STRING (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE) 15 | INSTALL ( 16 | TARGETS ${TARGET_NAME} 17 | EXPORT ${PROJECT_NAME_LOWERCASE}-config 18 | RUNTIME DESTINATION ${INSTALL_BINDIR} 19 | BUNDLE DESTINATION ${INSTALL_BINDIR} 20 | LIBRARY DESTINATION ${INSTALL_LIBDIR} 21 | ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} 22 | ) 23 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/jslib-unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Jslib unit - Event loop library (untyped) 6 | # Provides setTimeout, setImmediate, and event loop functionality 7 | 8 | set(JSLIB_UNIT_O jslib-unit${CMAKE_C_OUTPUT_EXTENSION}) 9 | hermes_compile_native( 10 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${JSLIB_UNIT_O} 11 | SOURCES jslib.js 12 | UNIT_NAME jslib 13 | ) 14 | 15 | add_library(jslib-unit STATIC ${CMAKE_CURRENT_BINARY_DIR}/${JSLIB_UNIT_O}) 16 | set_target_properties(jslib-unit PROPERTIES LINKER_LANGUAGE C) 17 | 18 | # Ensure Hermes is built before compiling this unit 19 | add_dependencies(jslib-unit hermes) 20 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/transform.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace immer::persist::detail { 6 | 7 | template 8 | auto get_container_id(const output_pools& pools, 9 | const Container& container) 10 | { 11 | const auto& old_pool = 12 | pools.template get_output_pool>(); 13 | const auto [new_pool, id] = add_to_pool(container, old_pool); 14 | if (!(new_pool == old_pool)) { 15 | throw std::logic_error{ 16 | "Expecting that the container has already been persisted"}; 17 | } 18 | return id; 19 | } 20 | 21 | } // namespace immer::persist::detail 22 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/cmake/PrintOptionStatus.cmake: -------------------------------------------------------------------------------- 1 | # Parameters: 2 | # OPTION: boolean option. 3 | # TEXT - option meaning text, printed between "[+/-]" and "enabled/disabled". 4 | # PREPEND - optional parameter, count of spaces inserted before output. 5 | # Useful for indenting relative options. 6 | 7 | MACRO (PRINT_OPTION_STATUS OPTION TEXT) 8 | SET (PREPEND "") 9 | IF (${ARGC} GREATER 2) 10 | IF (${ARGV2} GREATER 0) 11 | FOREACH (A RANGE 1 ${ARGV2}) 12 | SET (PREPEND "${PREPEND} ") 13 | ENDFOREACH (A) 14 | ENDIF (${ARGV2} GREATER 0) 15 | ENDIF (${ARGC} GREATER 2) 16 | IF (${OPTION}) 17 | MESSAGE ("${PREPEND}[+] ${TEXT} enabled") 18 | ELSE (${OPTION}) 19 | MESSAGE ("${PREPEND}[-] ${TEXT} disabled") 20 | ENDIF (${OPTION}) 21 | ENDMACRO (PRINT_OPTION_STATUS) 22 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/xxhash/xxhash.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace immer::persist { 6 | 7 | /** 8 | * xxHash is a good option to be used with `immer::persist` as it produces 9 | * hashes identical across all platforms. 10 | * 11 | * @see https://xxhash.com/ 12 | * @ingroup persist-api 13 | */ 14 | template 15 | struct xx_hash 16 | { 17 | std::uint64_t operator()(const T& val) const { return xx_hash_value(val); } 18 | }; 19 | 20 | std::uint64_t xx_hash_value_string(const std::string& str); 21 | 22 | template <> 23 | struct xx_hash 24 | { 25 | std::uint64_t operator()(const std::string& val) const 26 | { 27 | return xx_hash_value_string(val); 28 | } 29 | }; 30 | 31 | } // namespace immer::persist 32 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/refcount/no_refcount_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | namespace immer { 12 | 13 | struct disowned 14 | {}; 15 | 16 | /*! 17 | * Disables reference counting, to be used with an alternative garbage 18 | * collection strategy like a `gc_heap`. 19 | */ 20 | struct no_refcount_policy 21 | { 22 | no_refcount_policy(){}; 23 | no_refcount_policy(disowned) {} 24 | 25 | void inc() {} 26 | bool dec() { return false; } 27 | bool unique() { return false; } 28 | }; 29 | 30 | } // namespace immer 31 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/dynamic-windows/index.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | import React from 'react'; 6 | import { createRoot, render } from 'react-imgui-reconciler/reconciler.js'; 7 | import { App } from './app.jsx'; 8 | 9 | // Configure window 10 | globalThis.sappConfig.title = "Dynamic Windows Demo"; 11 | 12 | // Create React root with fiber root and container 13 | const root = createRoot(); 14 | 15 | // Expose to typed unit via global 16 | globalThis.reactApp = { 17 | rootChildren: [], 18 | 19 | // Render the app 20 | // Note: resetAfterCommit in host-config.js will sync rootChildren after each render 21 | render() { 22 | render(React.createElement(App), root); 23 | } 24 | }; 25 | 26 | // Initial render 27 | globalThis.reactApp.render(); 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | add_library(imgui-runtime imgui-runtime.cpp 6 | imgui-runtime.h 7 | ) 8 | target_link_directories(imgui-runtime INTERFACE 9 | ${HERMES_BUILD}/lib 10 | ${HERMES_BUILD}/jsi 11 | ${HERMES_BUILD}/external/boost/boost_1_86_0/libs/context 12 | ) 13 | target_link_libraries(imgui-runtime 14 | sokol stb cimgui imgui-unit jslib-unit native-support websockets native-cljs 15 | $<$:hermesvm_a jsi boost_context> 16 | $<$:hermesvm> 17 | $<$:icuuc icui18n icudata> 18 | ) 19 | target_include_directories(imgui-runtime INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 20 | target_include_directories(imgui-runtime PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../native) 21 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/cereal/immer_array.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace cereal { 7 | 8 | template 9 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, immer::array& m) 10 | { 11 | size_type size; 12 | ar(make_size_tag(size)); 13 | m = {}; 14 | 15 | for (auto i = size_type{}; i < size; ++i) { 16 | T x; 17 | ar(x); 18 | m = std::move(m).push_back(std::move(x)); 19 | } 20 | } 21 | 22 | template 23 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, 24 | const immer::array& m) 25 | { 26 | ar(make_size_tag(static_cast(m.size()))); 27 | for (auto&& v : m) 28 | ar(v); 29 | } 30 | 31 | } // namespace cereal 32 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/identity_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace immer { 14 | 15 | /*! 16 | * A heap that simply passes on to the parent heap. 17 | */ 18 | template 19 | struct identity_heap : Base 20 | { 21 | template 22 | static void* allocate(std::size_t size, Tags... tags) 23 | { 24 | return Base::allocate(size, tags...); 25 | } 26 | 27 | template 28 | static void deallocate(std::size_t size, void* data, Tags... tags) 29 | { 30 | Base::deallocate(size, data, tags...); 31 | } 32 | }; 33 | 34 | } // namespace immer 35 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # ImGui unit - FFI bindings and renderer (typed) 6 | # Provides ImGui rendering functionality using Static Hermes FFI 7 | 8 | set(IMGUI_UNIT_O imgui-unit${CMAKE_C_OUTPUT_EXTENSION}) 9 | hermes_compile_native( 10 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${IMGUI_UNIT_O} 11 | SOURCES 12 | ffi_helpers.js 13 | asciiz.js 14 | sapp.js 15 | js_externs.js 16 | renderer.js 17 | main.js 18 | UNIT_NAME imgui 19 | FLAGS -typed -Wc,-I. 20 | ) 21 | 22 | add_library(imgui-unit STATIC js_externs_cwrap.c ${CMAKE_CURRENT_BINARY_DIR}/${IMGUI_UNIT_O}) 23 | set_target_properties(imgui-unit PROPERTIES LINKER_LANGUAGE C) 24 | target_link_libraries(imgui-unit cimgui sokol) 25 | 26 | # Ensure Hermes is built before compiling this unit 27 | add_dependencies(imgui-unit hermes) 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/detail/rbts/bits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | namespace immer { 15 | namespace detail { 16 | namespace rbts { 17 | 18 | using bits_t = std::uint32_t; 19 | using shift_t = std::uint32_t; 20 | using count_t = std::uint32_t; 21 | using size_t = std::size_t; 22 | 23 | template 24 | constexpr T branches = T{1} << B; 25 | 26 | template 27 | constexpr T mask = branches - 1; 28 | 29 | template 30 | constexpr shift_t endshift = shift_t{BL} - shift_t{B}; 31 | 32 | } // namespace rbts 33 | } // namespace detail 34 | } // namespace immer 35 | -------------------------------------------------------------------------------- /imgui-react-runtime/LICENSE_sokol: -------------------------------------------------------------------------------- 1 | zlib/libpng license 2 | 3 | Copyright (c) 2018 Andre Weissflog 4 | 5 | This software is provided 'as-is', without any express or implied warranty. 6 | In no event will the authors be held liable for any damages arising from the 7 | use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software in a 15 | product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/skia-unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Skia unit - Graphics rendering with Skia 6 | # Provides Skia rendering functionality using Static Hermes 7 | 8 | set(SKIA_UNIT_O skia-unit${CMAKE_C_OUTPUT_EXTENSION}) 9 | hermes_compile_native( 10 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SKIA_UNIT_O} 11 | SOURCES 12 | ../imgui-unit/ffi_helpers.js 13 | ../imgui-unit/asciiz.js 14 | skia_externs.js 15 | yoga_layout.js 16 | renderer.js 17 | main.js 18 | UNIT_NAME skia 19 | FLAGS -typed -Wc,-I. 20 | ) 21 | 22 | add_library(skia-unit STATIC skia_externs_cwrap.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SKIA_UNIT_O}) 23 | set_target_properties(skia-unit PROPERTIES LINKER_LANGUAGE CXX) 24 | target_link_libraries(skia-unit skia-lib yoga) 25 | 26 | # Ensure Hermes is built before compiling this unit 27 | add_dependencies(skia-unit hermes) 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/refcount/enable_intrusive_ptr.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace immer { 14 | 15 | template 16 | class enable_intrusive_ptr 17 | { 18 | mutable RefcountPolicy refcount_data_; 19 | 20 | public: 21 | enable_intrusive_ptr() 22 | : refcount_data_{disowned{}} 23 | { 24 | } 25 | 26 | friend void intrusive_ptr_add_ref(const Deriv* x) 27 | { 28 | x->refcount_data_.inc(); 29 | } 30 | 31 | friend void intrusive_ptr_release(const Deriv* x) 32 | { 33 | if (x->refcount_data_.dec()) 34 | delete x; 35 | } 36 | }; 37 | 38 | } // namespace immer 39 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #cmake_minimum_required (VERSION 2.8) 2 | 3 | project (SoLoud) 4 | 5 | set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}") 6 | set (CMAKE_POSITION_INDEPENDENT_CODE ON) 7 | #INCLUDE (StandartIncludes) 8 | 9 | include_directories (../include) 10 | 11 | include (Configure.cmake) 12 | #INCLUDE (InstallIncludes.cmake) 13 | #INCLUDE (InstallStaticData.cmake) 14 | 15 | if (UNIX AND NOT WIN32 AND NOT APPLE) 16 | if (CMAKE_SIZEOF_VOID_P MATCHES "8") 17 | set (LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement") 18 | mark_as_advanced (LIB_POSTFIX) 19 | endif () 20 | endif () 21 | if (MSVC) 22 | add_definitions (-D_CRT_SECURE_NO_WARNINGS) 23 | endif() 24 | if (NOT DEFINED LIB_POSTFIX) 25 | set (LIB_POSTFIX "") 26 | endif () 27 | 28 | include (src.cmake) 29 | 30 | # Demos 31 | IF (SOLOUD_BUILD_DEMOS) 32 | include (demos.cmake) 33 | endif () 34 | 35 | IF (SOLOUD_GENERATE_GLUE) 36 | include (gen_glue.cmake) 37 | endif () 38 | 39 | include (InstallExport) 40 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/refcount/unsafe_refcount_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace immer { 17 | 18 | /*! 19 | * A reference counting policy implemented using a raw `int` count. 20 | * It is **not thread-safe**. 21 | */ 22 | struct unsafe_refcount_policy 23 | { 24 | mutable int refcount; 25 | 26 | unsafe_refcount_policy() 27 | : refcount{1} {}; 28 | unsafe_refcount_policy(disowned) 29 | : refcount{0} 30 | { 31 | } 32 | 33 | void inc() { ++refcount; } 34 | bool dec() { return --refcount == 0; } 35 | bool unique() { return refcount == 1; } 36 | }; 37 | 38 | } // namespace immer 39 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/detail/ref_count_base.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace immer { 14 | namespace detail { 15 | 16 | template 17 | struct ref_count_base 18 | { 19 | mutable std::atomic ref_count{0}; 20 | 21 | friend void intrusive_ptr_add_ref(const Deriv* x) 22 | { 23 | x->ref_count.fetch_add(1, std::memory_order_relaxed); 24 | } 25 | 26 | friend void intrusive_ptr_release(const Deriv* x) 27 | { 28 | if (x->ref_count.fetch_sub(1, std::memory_order_release) == 1) { 29 | std::atomic_thread_fence(std::memory_order_acquire); 30 | delete x; 31 | } 32 | } 33 | }; 34 | 35 | } /* namespace detail */ 36 | } /* namespace immer */ 37 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/io.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace immer::util { 6 | 7 | /*! 8 | * Restores the iostream state. 9 | * 10 | * This is particularly handy for utilities that can be used to peek or query 11 | * properties of a document read from a stream, while leaving the stream in the 12 | * original state. 13 | */ 14 | struct istream_snapshot 15 | { 16 | std::reference_wrapper stream; 17 | std::istream::pos_type pos = stream.get().tellg(); 18 | std::istream::iostate state = stream.get().rdstate(); 19 | std::istream::iostate exceptions = stream.get().exceptions(); 20 | 21 | istream_snapshot(std::istream& is) 22 | : stream{is} 23 | { 24 | } 25 | 26 | // It is not copyable nor movable 27 | istream_snapshot(istream_snapshot&&) = delete; 28 | 29 | ~istream_snapshot() 30 | { 31 | stream.get().exceptions(exceptions); 32 | stream.get().clear(state); 33 | stream.get().seekg(pos); 34 | } 35 | }; 36 | 37 | } // namespace immer::util 38 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/hash_container_conversion.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace immer::persist { 4 | 5 | /** 6 | * The wrapper is used to enable the incompatible hash mode which is required 7 | * when the key of a hash-based container transformed in a way that changes its 8 | * hash. 9 | * 10 | * A value of this type should be returned from a transforming function 11 | * accepting `target_container_type_request`. 12 | * 13 | * @ingroup persist-transform 14 | * @see 15 | * @rst 16 | * :ref:`modifying-the-hash-of-the-id` 17 | * @endrst 18 | */ 19 | template 20 | struct incompatible_hash_wrapper 21 | {}; 22 | 23 | /** 24 | * This type is used as an argument for a transforming function. 25 | * The return type of the function is used to specify the desired container type 26 | * to contain the transformed values. 27 | * 28 | * @ingroup persist-transform 29 | * @see 30 | * @rst 31 | * :ref:`transforming-hash-based-containers` 32 | * @endrst 33 | */ 34 | struct target_container_type_request 35 | {}; 36 | 37 | } // namespace immer::persist 38 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/hello/index.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | import React from 'react'; 6 | import { createRoot, render } from 'react-imgui-reconciler/reconciler.js'; 7 | import { App } from './app.jsx'; 8 | 9 | // Configure window (optional - defaults are provided) 10 | // globalThis.sappConfig is created by imgui-unit with { title: "imgui-react-runtime" } 11 | // Applications can override properties here before rendering 12 | globalThis.sappConfig.title = "Hello World"; 13 | globalThis.sappConfig.width = 320; 14 | globalThis.sappConfig.height = 200; 15 | 16 | // Create React root with fiber root and container 17 | const root = createRoot(); 18 | 19 | // Expose to typed unit via global 20 | globalThis.reactApp = { 21 | rootChildren: [], 22 | 23 | // Render the app 24 | // Note: resetAfterCommit in host-config.js will sync rootChildren after each render 25 | render() { 26 | render(React.createElement(App), root); 27 | } 28 | }; 29 | 30 | // Initial render 31 | globalThis.reactApp.render(); 32 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/ay/chipplayer.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHIPPLAYER_H_INCLUDED 2 | #define _CHIPPLAYER_H_INCLUDED 3 | 4 | #include "sndchip.h" 5 | 6 | namespace SoLoud 7 | { 8 | class AyInstance; 9 | } 10 | 11 | class ChipPlayer 12 | { 13 | public: 14 | 15 | // play next song chunk to buffer 16 | unsigned play(float *dst, unsigned need_samples); 17 | 18 | // for internal use by ChipSong class 19 | void set_timings(unsigned system_clock_rate, unsigned chip_clock_rate, unsigned sample_rate); 20 | void set_volumes(SNDCHIP::CHIP_TYPE t, unsigned global_vol, const SNDCHIP_VOLTAB *vt, const SNDCHIP_PANTAB *pt); 21 | 22 | ChipPlayer(SoLoud::AyInstance *aInstance); 23 | ~ChipPlayer(); 24 | 25 | //private: 26 | SoLoud::AyInstance *mInstance; 27 | SNDBUFFER buffer; 28 | SNDCHIP chip; 29 | SNDCHIP chip2; 30 | 31 | 32 | unsigned locate(unsigned tick); 33 | unsigned playtick; 34 | unsigned playpos; 35 | unsigned system_clock_rate; 36 | unsigned ticks_per_buffer; 37 | 38 | unsigned get_time(unsigned tick); 39 | }; 40 | 41 | #endif // _CHIPPLAYER_H_INCLUDED 42 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/showcase/index.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | import React from 'react'; 6 | import { createRoot, render } from 'react-imgui-reconciler/reconciler.js'; 7 | import { App } from './app.jsx'; 8 | 9 | // Configure window (optional - defaults are provided) 10 | // globalThis.sappConfig is created by imgui-unit with { title: "imgui-react-runtime" } 11 | // Applications can override properties here before rendering 12 | globalThis.sappConfig.title = "React + ImGui Showcase"; 13 | globalThis.sappConfig.width = 1024; 14 | globalThis.sappConfig.height = 768; 15 | 16 | // Create React root with fiber root and container 17 | const root = createRoot(); 18 | 19 | // Expose to typed unit via global 20 | globalThis.reactApp = { 21 | rootChildren: [], 22 | 23 | // Render the app 24 | // Note: resetAfterCommit in host-config.js will sync rootChildren after each render 25 | render() { 26 | render(React.createElement(App), root); 27 | } 28 | }; 29 | 30 | // Initial render 31 | globalThis.reactApp.render(); 32 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/refcount/refcount_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace immer { 18 | 19 | /*! 20 | * A reference counting policy implemented using an *atomic* `int` 21 | * count. It is **thread-safe**. 22 | */ 23 | struct refcount_policy 24 | { 25 | mutable std::atomic refcount; 26 | 27 | refcount_policy() 28 | : refcount{1} {}; 29 | refcount_policy(disowned) 30 | : refcount{0} 31 | { 32 | } 33 | 34 | void inc() { refcount.fetch_add(1, std::memory_order_relaxed); } 35 | 36 | bool dec() { return 1 == refcount.fetch_sub(1, std::memory_order_acq_rel); } 37 | 38 | bool unique() { return refcount == 1; } 39 | }; 40 | 41 | } // namespace immer 42 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/cereal/immer_set.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace cereal { 8 | 9 | template 15 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, immer::set& m) 16 | { 17 | size_type size; 18 | ar(make_size_tag(size)); 19 | m = {}; 20 | 21 | for (auto i = size_type{}; i < size; ++i) { 22 | T x; 23 | ar(x); 24 | m = std::move(m).insert(std::move(x)); 25 | } 26 | if (size != m.size()) 27 | throw std::runtime_error{"duplicate items?"}; 28 | } 29 | 30 | template 36 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, const immer::set& m) 37 | { 38 | ar(make_size_tag(static_cast(m.size()))); 39 | for (auto&& v : m) 40 | ar(v); 41 | } 42 | 43 | } // namespace cereal 44 | -------------------------------------------------------------------------------- /imgui-react-runtime/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Tzvetan Mikov and contributors 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 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/imgui-unit/main.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | // Main entry point for typed ImGui unit 6 | // Provides on_init, on_frame, on_event callbacks for C++ bridge 7 | // Note: globalThis.sappConfig is created by C++ before units load 8 | 9 | globalThis.on_init = function on_init(): void { 10 | // Trigger initial React render 11 | const reactApp = globalThis.reactApp; 12 | if (reactApp && reactApp.render) { 13 | reactApp.render(); 14 | } 15 | }; 16 | 17 | globalThis.on_frame = function on_frame(width: number, height: number, curTime: number): void { 18 | // Flush temporary allocations from previous frame 19 | flushAllocTmp(); 20 | 21 | // Render the React tree (callbacks are invoked directly during rendering) 22 | const imguiUnit = (globalThis as any).imguiUnit; 23 | if (imguiUnit && imguiUnit.renderTree) { 24 | imguiUnit.renderTree(); 25 | } 26 | }; 27 | 28 | globalThis.on_event = function on_event(type: number, key_code: number, modifiers: number): void { 29 | // Handle events if needed 30 | // For now, we'll just pass through 31 | }; 32 | -------------------------------------------------------------------------------- /shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | {:deps true 2 | :builds 3 | {:app {:target :esm 4 | :output-dir "imgui-react-runtime/examples/uix/out" 5 | :modules {:main {:entries [hermes.app] 6 | :init-fn hermes.app/init}} 7 | :js-options {:js-provider :import} 8 | :runtime :custom 9 | :devtools {:client-ns hermes.repl.client 10 | :preloads [uix.preload]}} 11 | :skia-app {:target :esm 12 | :output-dir "imgui-react-runtime/examples/skia/out" 13 | :modules {:main {:entries [skia.app] 14 | :init-fn skia.app/init}} 15 | :js-options {:js-provider :import} 16 | :runtime :custom 17 | :devtools {:client-ns hermes.repl.client 18 | :preloads [uix.preload]}} 19 | :persistent-vector-example 20 | {:target :browser 21 | :output-dir "imgui-react-runtime/examples/persistent-vector-demo/cljs-out" 22 | :modules {:main {:entries [hermes.persistent-vector-example] 23 | :init-fn hermes.persistent-vector-example/init}} 24 | :js-options {:js-provider :import} 25 | :runtime :custom}}} 26 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/cimgui/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stephan Dilly 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 | 23 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/cimgui/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2020 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 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/glfw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # GLFW - Multi-platform library for OpenGL, window and input handling 2 | # https://www.glfw.org/ 3 | 4 | # Disable GLFW-specific options we don't need 5 | set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs" FORCE) 6 | set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs" FORCE) 7 | set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation" FORCE) 8 | set(GLFW_INSTALL OFF CACHE BOOL "Generate installation target" FORCE) 9 | 10 | # Use static library 11 | set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE) 12 | 13 | # Platform-specific configuration 14 | if(APPLE) 15 | set(GLFW_BUILD_COCOA ON CACHE BOOL "Build support for Cocoa" FORCE) 16 | elseif(WIN32) 17 | set(GLFW_BUILD_WIN32 ON CACHE BOOL "Build support for Win32" FORCE) 18 | elseif(UNIX) 19 | set(GLFW_BUILD_X11 ON CACHE BOOL "Build support for X11" FORCE) 20 | set(GLFW_BUILD_WAYLAND OFF CACHE BOOL "Build support for Wayland" FORCE) 21 | endif() 22 | 23 | # Add GLFW as subdirectory 24 | add_subdirectory(glfw) 25 | 26 | # Expose GLFW for downstream targets 27 | # The GLFW target 'glfw' is automatically created by the GLFW CMakeLists.txt 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/cpp_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | namespace immer { 15 | 16 | /*! 17 | * A heap that uses `operator new` and `operator delete`. 18 | */ 19 | struct cpp_heap 20 | { 21 | /*! 22 | * Returns a pointer to a memory region of size `size`, if the 23 | * allocation was successful, and throws otherwise. 24 | */ 25 | template 26 | static void* allocate(std::size_t size, Tags...) 27 | { 28 | return ::operator new(size); 29 | } 30 | 31 | /*! 32 | * Releases a memory region `data` that was previously returned by 33 | * `allocate`. One must not use nor deallocate again a memory 34 | * region that once it has been deallocated. 35 | */ 36 | static void deallocate(std::size_t, void* data) { ::operator delete(data); } 37 | }; 38 | 39 | } // namespace immer 40 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_file_hack_off.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | /* 26 | See soloud_file_hack_on.h 27 | */ 28 | 29 | #undef FILE 30 | #undef fgetc 31 | #undef fread 32 | #undef fseek 33 | #undef ftell 34 | #undef fclose 35 | #undef fopen 36 | #undef fopen_s 37 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | > 1. Remove this template before submitting 2 | > 3 | > 2. SoLoud project requires extremely liberal licensing, i.e, no attribution is required for binary forms. 4 | > Patches should come under zlib, cc0, unlicense or wtfpl license, or if you wish to not retain any 5 | > rights, don't include a license and the rights of your patch are released to the project owner and 6 | > included under the SoLoud zlib/libpng licensing for anyone to (ab)use. 7 | > 8 | > 3. Code should generally follow the coding conventions in SoLoud, meaning formatting that's basically 9 | > the ANSI format in Artistic Style formatter (or just read some of the code and make yours look the 10 | > same). 11 | > 12 | > 4. Code should generally follow "Orthodox C++" rules, i.e, not "modern c++". This means minimal template 13 | > use and basically no "new" c++ features. 14 | > 15 | > 5. Platform-specific code (i.e, backends / sinks) are pretty much expected to break the 3. and 4. above. 16 | > 17 | > 6. To show that you understand and accept the rules above, add your name to the AUTHORS file. 18 | > 19 | > TL;DR: make code similar to what's in SoLoud, don't add new licensing requirements, sign the AUTHORS file, thanks. 20 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/cereal/immer_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace cereal { 8 | 9 | template 16 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, immer::table& m) 17 | { 18 | size_type size; 19 | ar(make_size_tag(size)); 20 | m = {}; 21 | 22 | for (auto i = size_type{}; i < size; ++i) { 23 | T x; 24 | ar(x); 25 | m = std::move(m).insert(std::move(x)); 26 | } 27 | if (size != m.size()) 28 | throw std::runtime_error{"duplicate ids?"}; 29 | } 30 | 31 | template 38 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, 39 | const immer::table& m) 40 | { 41 | ar(make_size_tag(static_cast(m.size()))); 42 | for (auto&& v : m) 43 | ar(v); 44 | } 45 | 46 | } // namespace cereal 47 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/with_data.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace immer { 14 | 15 | /*! 16 | * Appends a default constructed extra object of type `T` at the 17 | * *before* the requested region. 18 | * 19 | * @tparam T Type of the appended data. 20 | * @tparam Base Type of the parent heap. 21 | */ 22 | template 23 | struct with_data : Base 24 | { 25 | using base_t = Base; 26 | 27 | template 28 | static void* allocate(std::size_t size, Tags... tags) 29 | { 30 | auto p = base_t::allocate(size + sizeof(T), tags...); 31 | return new (p) T{} + 1; 32 | } 33 | 34 | template 35 | static void deallocate(std::size_t size, void* p, Tags... tags) 36 | { 37 | auto dp = static_cast(p) - 1; 38 | dp->~T(); 39 | base_t::deallocate(size + sizeof(T), dp, tags...); 40 | } 41 | }; 42 | 43 | } // namespace immer 44 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/cmake/InstallExport.cmake: -------------------------------------------------------------------------------- 1 | # Installs export targets (i.e. cmake config files) into location 2 | # specified for OS. 3 | # Installs ${PROJECT_NAME}-SetThirdParties.cmake too if such file 4 | # is found in ${PROJECT_SOURCE_DIR}. 5 | 6 | SET (EV_CMAKE_EXPORT_DIR share/${PROJECT_NAME}/cmake) 7 | 8 | IF (WIN32) 9 | SET (EV_CMAKE_EXPORT_DIR cmake) 10 | ENDIF () 11 | 12 | SET (PROJECT_NAME_LOWERCASE) 13 | STRING (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE) 14 | INSTALL ( 15 | EXPORT ${PROJECT_NAME_LOWERCASE}-config 16 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 17 | ) 18 | 19 | SET (EV_STP_FILENAME ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}-SetThirdParties.cmake) 20 | IF (EXISTS ${EV_STP_FILENAME}) 21 | INSTALL ( 22 | FILES ${EV_STP_FILENAME} 23 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 24 | ) 25 | ENDIF () 26 | 27 | SET (EV_SETTINGS_FILENAME ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}-Settings.cmake) 28 | IF (NOT EXISTS ${EV_SETTINGS_FILENAME}) 29 | # This file may be configured => it placed in binary dir 30 | SET (EV_SETTINGS_FILENAME ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-Settings.cmake) 31 | ENDIF () 32 | 33 | IF (EXISTS ${EV_SETTINGS_FILENAME}) 34 | INSTALL ( 35 | FILES ${EV_SETTINGS_FILENAME} 36 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 37 | ) 38 | ENDIF () 39 | -------------------------------------------------------------------------------- /imgui-react-runtime/LICENSE_soloud: -------------------------------------------------------------------------------- 1 | SoLoud contains various third party libraries which vary in licenses, 2 | but are all extremely liberal; no attribution in binary form is required. 3 | For more information, see SoLoud manual or http://soloud-audio.com/legal.html 4 | 5 | SoLoud proper is licensed under the zlib/libpng license: 6 | 7 | SoLoud audio engine 8 | Copyright (c) 2013-2018 Jari Komppa 9 | 10 | This software is provided 'as-is', without any express or implied 11 | warranty. In no event will the authors be held liable for any damages 12 | arising from the use of this software. 13 | 14 | Permission is granted to anyone to use this software for any purpose, 15 | including commercial applications, and to alter it and redistribute it 16 | freely, subject to the following restrictions: 17 | 18 | 1. The origin of this software must not be misrepresented; you must not 19 | claim that you wrote the original software. If you use this software 20 | in a product, an acknowledgment in the product documentation would be 21 | appreciated but is not required. 22 | 23 | 2. Altered source versions must be plainly marked as such, and must not be 24 | misrepresented as being the original software. 25 | 26 | 3. This notice may not be removed or altered from any source 27 | distribution. 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native-support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Shared native support library for WebSocket and file mapping 6 | # Used by imgui-runtime and skia examples 7 | 8 | add_library(native-support STATIC 9 | WebSocketSupport.cpp 10 | WebSocketSupport.h 11 | MappedFileBuffer.cpp 12 | MappedFileBuffer.h 13 | ) 14 | 15 | target_include_directories(native-support PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 16 | target_link_libraries(native-support PUBLIC websockets) 17 | 18 | # Add Hermes include directories 19 | target_include_directories(native-support PRIVATE 20 | ${CMAKE_BINARY_DIR}/hermes/lib/config 21 | ${CMAKE_BINARY_DIR}/hermes-src/include 22 | ${CMAKE_BINARY_DIR}/hermes-src/public 23 | ${CMAKE_BINARY_DIR}/hermes-src/API 24 | ${CMAKE_BINARY_DIR}/hermes-src/API/jsi 25 | ) 26 | 27 | # Add libwebsockets include directories 28 | target_include_directories(native-support PRIVATE 29 | ${CMAKE_SOURCE_DIR}/external/libwebsockets/libwebsockets/lib/../include 30 | ${CMAKE_BINARY_DIR}/external/libwebsockets/libwebsockets/lib/../include 31 | ) 32 | 33 | # Ensure Hermes is built before this library 34 | add_dependencies(native-support hermes) 35 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/LICENSE: -------------------------------------------------------------------------------- 1 | SoLoud contains various third party libraries which vary in licenses, 2 | but are all extremely liberal; no attribution in binary form is required. 3 | For more information, see SoLoud manual or http://soloud-audio.com/legal.html 4 | 5 | SoLoud proper is licensed under the zlib/libpng license: 6 | 7 | SoLoud audio engine 8 | Copyright (c) 2013-2018 Jari Komppa 9 | 10 | This software is provided 'as-is', without any express or implied 11 | warranty. In no event will the authors be held liable for any damages 12 | arising from the use of this software. 13 | 14 | Permission is granted to anyone to use this software for any purpose, 15 | including commercial applications, and to alter it and redistribute it 16 | freely, subject to the following restrictions: 17 | 18 | 1. The origin of this software must not be misrepresented; you must not 19 | claim that you wrote the original software. If you use this software 20 | in a product, an acknowledgment in the product documentation would be 21 | appreciated but is not required. 22 | 23 | 2. Altered source versions must be plainly marked as such, and must not be 24 | misrepresented as being the original software. 25 | 26 | 3. This notice may not be removed or altered from any source 27 | distribution. 28 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/split_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace immer { 16 | 17 | /*! 18 | * Adaptor that uses `SmallHeap` for allocations that are smaller or 19 | * equal to `Size` and `BigHeap` otherwise. 20 | */ 21 | template 22 | struct split_heap 23 | { 24 | template 25 | static void* allocate(std::size_t size, Tags... tags) 26 | { 27 | return size <= Size ? SmallHeap::allocate(size, tags...) 28 | : BigHeap::allocate(size, tags...); 29 | } 30 | 31 | template 32 | static void deallocate(std::size_t size, void* data, Tags... tags) 33 | { 34 | if (size <= Size) 35 | SmallHeap::deallocate(size, data, tags...); 36 | else 37 | BigHeap::deallocate(size, data, tags...); 38 | } 39 | }; 40 | 41 | } // namespace immer 42 | -------------------------------------------------------------------------------- /imgui-react-runtime/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.adoc": "plaintext", 4 | "algorithm": "cpp", 5 | "array": "cpp", 6 | "__hash_table": "cpp", 7 | "__node_handle": "cpp", 8 | "__tree": "cpp", 9 | "__verbose_abort": "cpp", 10 | "cmath": "cpp", 11 | "cstddef": "cpp", 12 | "cstdint": "cpp", 13 | "cstdio": "cpp", 14 | "cstdlib": "cpp", 15 | "cstring": "cpp", 16 | "cwchar": "cpp", 17 | "deque": "cpp", 18 | "initializer_list": "cpp", 19 | "iosfwd": "cpp", 20 | "limits": "cpp", 21 | "list": "cpp", 22 | "map": "cpp", 23 | "new": "cpp", 24 | "optional": "cpp", 25 | "print": "cpp", 26 | "stdexcept": "cpp", 27 | "string": "cpp", 28 | "string_view": "cpp", 29 | "typeinfo": "cpp", 30 | "unordered_map": "cpp", 31 | "variant": "cpp", 32 | "vector": "cpp", 33 | "__split_buffer": "cpp", 34 | "bitset": "cpp", 35 | "cctype": "cpp", 36 | "clocale": "cpp", 37 | "ctime": "cpp", 38 | "cwctype": "cpp", 39 | "execution": "cpp", 40 | "ios": "cpp", 41 | "locale": "cpp", 42 | "queue": "cpp", 43 | "ratio": "cpp", 44 | "stack": "cpp", 45 | "streambuf": "cpp", 46 | "__bit_reference": "cpp", 47 | "__locale": "cpp", 48 | "cstdarg": "cpp", 49 | "mutex": "cpp" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/persistent-vector-demo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # PersistentVector Demo - A standalone console application demonstrating 6 | # PersistentVector functionality without GUI dependencies. 7 | 8 | add_executable(persistent-vector-demo main.cpp) 9 | 10 | # Include directories 11 | target_include_directories(persistent-vector-demo PRIVATE 12 | ${CMAKE_SOURCE_DIR}/lib/native 13 | ) 14 | 15 | # Link directories for Hermes 16 | target_link_directories(persistent-vector-demo PRIVATE 17 | ${HERMES_BUILD}/lib 18 | ${HERMES_BUILD}/jsi 19 | ) 20 | 21 | # Link libraries 22 | target_link_libraries(persistent-vector-demo 23 | PRIVATE 24 | native-cljs 25 | $<$:hermesvm_a jsi> 26 | $<$:hermesvm> 27 | $<$:icuuc icui18n icudata> 28 | ) 29 | 30 | # On macOS the Hermes static libraries depend on CoreFoundation and Boost.Context 31 | if(APPLE) 32 | target_link_directories(persistent-vector-demo PRIVATE 33 | ${CMAKE_BINARY_DIR}/hermes/external/boost/boost_1_86_0/libs/context 34 | ) 35 | target_link_libraries(persistent-vector-demo PRIVATE 36 | "-framework CoreFoundation" 37 | boost_context 38 | ) 39 | endif() 40 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/legal_readme.txt: -------------------------------------------------------------------------------- 1 | The speech synth is based on rsynth by the late 2 | Nick Ing-Simmons (et al). 3 | 4 | He described the legal status as: 5 | 6 | This is a text to speech system produced by 7 | integrating various pieces of code and tables 8 | of data, which are all (I believe) in the 9 | public domain. 10 | 11 | Since then, the rsynth source code has passed legal 12 | checks by several open source organizations, so it 13 | "should" be pretty safe. 14 | 15 | The primary copyright claims seem to have to do 16 | with text-to-speech dictionary use, which I've 17 | removed completely. 18 | 19 | I've done some serious refactoring, clean-up and 20 | feature removal on the source, as all I need is 21 | "a" free, simple speech synth, not a "good" 22 | speech synth. Since I've removed a bunch of stuff, 23 | this is probably safer public domain release 24 | than the original. 25 | 26 | (I'm rather surprised there's no good public domain 27 | speech synths out there; after all, it's 2013..) 28 | 29 | I'm placing my changes in public domain as well, 30 | or if that's not acceptable for you, then CC0: 31 | http://creativecommons.org/publicdomain/zero/1.0/ 32 | 33 | The SoLoud interface files (soloud_speech.*) are 34 | under ZLib/LibPNG license. 35 | 36 | -- Jari Komppa 37 | 2013 38 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/react-imgui-reconciler/tree-node.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | /** 6 | * Global counter for assigning unique IDs to TreeNodes. 7 | * Each TreeNode gets a unique ID that persists for its lifetime, 8 | * which is used by ImGui's ID stack for widget identity. 9 | */ 10 | let nextNodeId = 1; 11 | 12 | /** 13 | * TreeNode represents a component instance in our tree. 14 | * This is what React creates and manipulates through our host config. 15 | */ 16 | export class TreeNode { 17 | constructor(type, props) { 18 | this.id = nextNodeId++; // Unique ID for ImGui ID stack 19 | this.type = type; // Component type like "Window", "Button", etc. 20 | this.props = props; // Props object passed to the component 21 | this.children = []; // Array of child TreeNodes or TextNodes 22 | this.parent = null; // Parent TreeNode (for debugging/traversal) 23 | } 24 | } 25 | 26 | /** 27 | * TextNode represents text content in our tree. 28 | * React treats text as a special type of child. 29 | */ 30 | export class TextNode { 31 | constructor(text) { 32 | this.id = nextNodeId++; // Unique ID for ImGui ID stack 33 | this.text = text; // The text content 34 | this.parent = null; // Parent TreeNode 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/darray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "darray.h" 4 | 5 | darray::darray() 6 | { 7 | mAllocChunk = 128; 8 | mAllocated = mUsed = 0; 9 | mData = NULL; 10 | } 11 | 12 | void darray::clear() 13 | { 14 | free(mData); 15 | mAllocChunk = 128; 16 | mAllocated = mUsed = 0; 17 | mData = NULL; 18 | } 19 | 20 | darray::~darray() 21 | { 22 | clear(); 23 | } 24 | 25 | char * darray::getDataInPos(int aPosition) 26 | { 27 | if (aPosition < mAllocated && aPosition < mUsed) 28 | return mData + aPosition; 29 | 30 | if (aPosition >= mAllocated) 31 | { 32 | int newsize = mAllocated; 33 | 34 | while (newsize <= aPosition) 35 | { 36 | newsize += mAllocChunk; 37 | mAllocChunk *= 2; 38 | } 39 | 40 | char *newdata = (char*)realloc(mData, newsize); 41 | if (!newdata) 42 | { 43 | free(mData); 44 | mData = NULL; 45 | mAllocated = mUsed = 0; 46 | return NULL; 47 | } 48 | else 49 | { 50 | memset(newdata + mAllocated, 0, newsize - mAllocated); 51 | } 52 | 53 | mData = newdata; 54 | mAllocated = newsize; 55 | } 56 | 57 | if (aPosition >= mUsed) 58 | { 59 | mUsed = aPosition + 1; 60 | } 61 | 62 | return mData + aPosition; 63 | } 64 | 65 | void darray::put(int aData) 66 | { 67 | char *s = getDataInPos(mUsed); 68 | 69 | *s = (char)aData; 70 | } 71 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/transience/no_transience_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | namespace immer { 12 | 13 | /*! 14 | * Disables any special *transience* tracking. To be used when 15 | * *reference counting* is available instead. 16 | */ 17 | struct no_transience_policy 18 | { 19 | template 20 | struct apply 21 | { 22 | struct type 23 | { 24 | struct edit 25 | {}; 26 | 27 | struct owner 28 | { 29 | operator edit() const { return {}; } 30 | }; 31 | 32 | struct ownee 33 | { 34 | ownee& operator=(edit) { return *this; }; 35 | bool can_mutate(edit) const { return false; } 36 | bool owned() const { return false; } 37 | }; 38 | 39 | static owner noone; 40 | }; 41 | }; 42 | }; 43 | 44 | template 45 | typename no_transience_policy::apply::type::owner 46 | no_transience_policy::apply::type::noone = {}; 47 | 48 | } // namespace immer 49 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/resonator.h: -------------------------------------------------------------------------------- 1 | #ifndef RESONATOR_H 2 | #define RESONATOR_H 3 | 4 | class resonator 5 | { 6 | float mA, mB, mC, mP1, mP2; 7 | public: 8 | 9 | /* Convert formant freqencies and bandwidth into resonator difference equation coefficents 10 | */ 11 | void initResonator( 12 | int aFrequency, /* Frequency of resonator in Hz */ 13 | int aBandwidth, /* Bandwidth of resonator in Hz */ 14 | int aSamplerate); 15 | 16 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants 17 | */ 18 | void initAntiresonator( 19 | int aFrequency, /* Frequency of resonator in Hz */ 20 | int aBandwidth, /* Bandwidth of resonator in Hz */ 21 | int aSamplerate); 22 | 23 | /* Set gain */ 24 | void setGain(float aG); 25 | 26 | /* Generic resonator function */ 27 | float resonate(float input); 28 | 29 | /* Generic anti-resonator function 30 | Same as resonator except that a,b,c need to be set with initAntiresonator() 31 | and we save inputs in p1/p2 rather than outputs. 32 | There is currently only one of these - "mNasalZero" 33 | 34 | Output = (mNasalZero.a * input) + (mNasalZero.b * oldin1) + (mNasalZero.c * oldin2) 35 | */ 36 | 37 | float antiresonate(float input); 38 | 39 | resonator(); 40 | 41 | ~resonator(); 42 | }; 43 | 44 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/malloc_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace immer { 19 | 20 | /*! 21 | * A heap that uses `std::malloc` and `std::free` to manage memory. 22 | */ 23 | struct malloc_heap 24 | { 25 | /*! 26 | * Returns a pointer to a memory region of size `size`, if the 27 | * allocation was successful and throws `std::bad_alloc` otherwise. 28 | */ 29 | template 30 | static void* allocate(std::size_t size, Tags...) 31 | { 32 | auto p = std::malloc(size); 33 | if (IMMER_UNLIKELY(!p)) 34 | IMMER_THROW(std::bad_alloc{}); 35 | return p; 36 | } 37 | 38 | /*! 39 | * Releases a memory region `data` that was previously returned by 40 | * `allocate`. One must not use nor deallocate again a memory 41 | * region that once it has been deallocated. 42 | */ 43 | static void deallocate(std::size_t, void* data) { std::free(data); } 44 | }; 45 | 46 | } // namespace immer 47 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/LICENSE_immer: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/checkapidoc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ Complains if some API call is not documented """ 3 | 4 | import soloud_codegen 5 | import glob 6 | import os 7 | 8 | def checkfile(apifunc, fname): 9 | """ Checks whether the string can be found in a file """ 10 | if apifunc in open(fname).read(): 11 | #print("; " + apifunc + " found in " + fname) 12 | return True 13 | return False 14 | 15 | def checkfiles(apifunc): 16 | """ Goes through all multimarkdown files in doc dir and passes 17 | them to checkfile. If found, early out. 18 | """ 19 | for file in glob.glob("../docsrc/*.mmd"): 20 | if checkfile(apifunc, file): 21 | return True 22 | return False 23 | 24 | print("Checking for undocumented APIs..") 25 | print() 26 | 27 | found = 0 28 | total = 0 29 | 30 | for func in soloud_codegen.soloud_func: 31 | apifunc = func[1].replace("_",".") 32 | if ((apifunc[-2::] != "Ex") and 33 | (apifunc[-7::] != "destroy") and 34 | (apifunc[-6::] != "create")): 35 | total += 1 36 | if not checkfiles(apifunc + "()"): 37 | print(apifunc) 38 | found += 1 39 | 40 | if found == 0: 41 | print("All good! (" + str(total) + ", not counting ctor/dtor/ex)") 42 | else: 43 | print() 44 | print(str(found) + " / " + str(total) + " APIs undocumented. Get to work!") 45 | print("(not counting ctor/dtor/ex variants)") 46 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/demos.cmake: -------------------------------------------------------------------------------- 1 | set (HEADER_PATH ../include) 2 | set (SOURCE_PATH ../demos) 3 | 4 | function (soloud_add_demo name sources) 5 | set (TARGET_NAME SoLoud_${name}) 6 | add_executable (${TARGET_NAME} ${sources}) 7 | target_link_libraries (${TARGET_NAME} soloud) 8 | include (Install) 9 | endfunction() 10 | 11 | include_directories (${SOURCE_PATH}/common) 12 | include_directories (${SOURCE_PATH}/common/imgui) 13 | 14 | 15 | # soloud_add_demo(c_test ${SOURCE_PATH}/c_test/main.c) 16 | soloud_add_demo(enumerate ${SOURCE_PATH}/enumerate/main.cpp) 17 | # soloud_add_demo(env ${SOURCE_PATH}/env/main.cpp) 18 | # soloud_add_demo(megademo 19 | # ${SOURCE_PATH}/megademo/3dtest.cpp 20 | # ${SOURCE_PATH}/megademo/main.cpp 21 | # ${SOURCE_PATH}/megademo/mixbusses.cpp 22 | # ${SOURCE_PATH}/megademo/monotone.cpp 23 | # ${SOURCE_PATH}/megademo/multimusic.cpp 24 | # ${SOURCE_PATH}/megademo/pewpew.cpp 25 | # ${SOURCE_PATH}/megademo/radiogaga.cpp 26 | # ${SOURCE_PATH}/megademo/space.cpp 27 | # ${SOURCE_PATH}/megademo/speechfilter.cpp 28 | # ${SOURCE_PATH}/megademo/tedsid.cpp 29 | # ${SOURCE_PATH}/megademo/virtualvoices.cpp 30 | # ) 31 | soloud_add_demo(null ${SOURCE_PATH}/null/main.cpp) 32 | # soloud_add_demo(piano 33 | # ${SOURCE_PATH}/piano/main.cpp 34 | # ${SOURCE_PATH}/piano/soloud_basicwave.cpp 35 | # ${SOURCE_PATH}/piano/soloud_padsynth.cpp 36 | # ) 37 | soloud_add_demo(simplest ${SOURCE_PATH}/simplest/main.cpp) 38 | soloud_add_demo(welcome ${SOURCE_PATH}/welcome/main.cpp) 39 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) Tzvetan Mikov and contributors 2 | # SPDX-License-Identifier: MIT 3 | # See LICENSE file for full license text 4 | 5 | # Native data structures library for ClojureScript/Hermes integration 6 | # Provides persistent data structures using Immer library 7 | 8 | add_library(native-cljs 9 | PersistentVector.cpp 10 | PersistentVector.h 11 | PersistentMap.cpp 12 | PersistentMap.h 13 | ) 14 | 15 | # Include Immer headers (header-only library) 16 | target_include_directories(native-cljs PUBLIC 17 | ${CMAKE_CURRENT_SOURCE_DIR} 18 | ) 19 | 20 | # Add Hermes include directories 21 | target_include_directories(native-cljs PRIVATE 22 | ${CMAKE_BINARY_DIR}/hermes/lib/config 23 | ${CMAKE_BINARY_DIR}/hermes-src/include 24 | ${CMAKE_BINARY_DIR}/hermes-src/public 25 | ${CMAKE_BINARY_DIR}/hermes-src/API 26 | ${CMAKE_BINARY_DIR}/hermes-src/API/jsi 27 | ) 28 | 29 | # Immer headers need to be found via the 'immer' subdirectory 30 | target_include_directories(native-cljs SYSTEM PUBLIC 31 | ${CMAKE_CURRENT_SOURCE_DIR} 32 | ) 33 | 34 | target_link_directories(native-cljs INTERFACE 35 | ${CMAKE_BINARY_DIR}/hermes/lib 36 | ${CMAKE_BINARY_DIR}/hermes/jsi 37 | ) 38 | 39 | # Link against Hermes for JSI support 40 | target_link_libraries(native-cljs 41 | $<$:hermesvm_a jsi> 42 | $<$:hermesvm> 43 | ) 44 | 45 | # Ensure Hermes is built before this library 46 | add_dependencies(native-cljs hermes) 47 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_MISC_H 26 | #define SOLOUD_MISC_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | namespace Misc 33 | { 34 | // Generate a waveform. 35 | float generateWaveform(int aWaveform, float p); 36 | 37 | // WELL512 random 38 | class Prg 39 | { 40 | public: 41 | // random generator 42 | Prg(); 43 | unsigned int mState[16]; 44 | unsigned int mIndex; 45 | unsigned int rand(); 46 | float rand_float(); 47 | void srand(int aSeed); 48 | }; 49 | 50 | }; 51 | }; 52 | 53 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/detail/rbts/visitor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace immer { 17 | namespace detail { 18 | namespace rbts { 19 | 20 | template 21 | struct visitor_base 22 | { 23 | template 24 | static decltype(auto) visit_node(Args&&... args) 25 | { 26 | IMMER_UNREACHABLE; 27 | } 28 | 29 | template 30 | static decltype(auto) visit_relaxed(Args&&... args) 31 | { 32 | return Deriv::visit_inner(std::forward(args)...); 33 | } 34 | 35 | template 36 | static decltype(auto) visit_regular(Args&&... args) 37 | { 38 | return Deriv::visit_inner(std::forward(args)...); 39 | } 40 | 41 | template 42 | static decltype(auto) visit_inner(Args&&... args) 43 | { 44 | return Deriv::visit_node(std::forward(args)...); 45 | } 46 | 47 | template 48 | static decltype(auto) visit_leaf(Args&&... args) 49 | { 50 | return Deriv::visit_node(std::forward(args)...); 51 | } 52 | }; 53 | 54 | } // namespace rbts 55 | } // namespace detail 56 | } // namespace immer 57 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/libwebsockets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(BUILD_SHARED_LIBS OFF CACHE BOOL "Disable shared libraries" FORCE) 2 | set(LWS_BUILD_SHARED OFF CACHE BOOL "Disable libwebsockets shared library" FORCE) 3 | set(LWS_BUILD_STATIC ON CACHE BOOL "Enable libwebsockets static library" FORCE) 4 | set(LWS_WITH_SSL OFF CACHE BOOL "Disable SSL support" FORCE) 5 | set(LWS_WITH_ZLIB OFF CACHE BOOL "Disable zlib support" FORCE) 6 | set(LWS_WITH_LIBUV OFF CACHE BOOL "Disable libuv integration" FORCE) 7 | set(LWS_WITH_LIBEVENT OFF CACHE BOOL "Disable libevent integration" FORCE) 8 | set(LWS_WITH_PLUGINS OFF CACHE BOOL "Disable plugins" FORCE) 9 | set(LWS_WITH_HTTP2 OFF CACHE BOOL "Disable HTTP/2 support" FORCE) 10 | set(LWS_WITH_MINIMAL_EXAMPLES OFF CACHE BOOL "Skip minimal examples" FORCE) 11 | set(LWS_WITHOUT_TESTAPPS ON CACHE BOOL "Skip test applications" FORCE) 12 | set(LWS_WITH_SERVER OFF CACHE BOOL "Disable server role" FORCE) 13 | set(LWS_WITH_CLIENT ON CACHE BOOL "Enable client role" FORCE) 14 | set(LWS_WITH_SHARED OFF CACHE BOOL "Disable shared object exports" FORCE) 15 | set(LWS_WITHOUT_EXTENSIONS ON CACHE BOOL "Disable protocol extensions" FORCE) 16 | set(DISABLE_WERROR ON CACHE BOOL "Do not treat warnings as errors" FORCE) 17 | 18 | set(LIBWEBSOCKETS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libwebsockets") 19 | 20 | add_subdirectory(${LIBWEBSOCKETS_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/libwebsockets) 21 | 22 | if (TARGET websockets_static AND NOT TARGET websockets) 23 | add_library(websockets INTERFACE) 24 | target_link_libraries(websockets INTERFACE websockets_static) 25 | endif() 26 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2014 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | #ifndef SOLOUD_ERROR_H 25 | #define SOLOUD_ERROR_H 26 | 27 | namespace SoLoud 28 | { 29 | enum SOLOUD_ERRORS 30 | { 31 | SO_NO_ERROR = 0, // No error 32 | INVALID_PARAMETER = 1, // Some parameter is invalid 33 | FILE_NOT_FOUND = 2, // File not found 34 | FILE_LOAD_FAILED = 3, // File found, but could not be loaded 35 | DLL_NOT_FOUND = 4, // DLL not found, or wrong DLL 36 | OUT_OF_MEMORY = 5, // Out of memory 37 | NOT_IMPLEMENTED = 6, // Feature not implemented 38 | UNKNOWN_ERROR = 7 // Other error 39 | }; 40 | }; 41 | #endif -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.adoc": "plaintext", 4 | "__bit_reference": "cpp", 5 | "__locale": "cpp", 6 | "__split_buffer": "cpp", 7 | "__verbose_abort": "cpp", 8 | "array": "cpp", 9 | "cctype": "cpp", 10 | "clocale": "cpp", 11 | "cmath": "cpp", 12 | "cstddef": "cpp", 13 | "cstdint": "cpp", 14 | "cstdlib": "cpp", 15 | "cstring": "cpp", 16 | "initializer_list": "cpp", 17 | "iosfwd": "cpp", 18 | "limits": "cpp", 19 | "list": "cpp", 20 | "locale": "cpp", 21 | "map": "cpp", 22 | "new": "cpp", 23 | "stdexcept": "cpp", 24 | "string": "cpp", 25 | "string_view": "cpp", 26 | "typeinfo": "cpp", 27 | "unordered_map": "cpp", 28 | "vector": "cpp", 29 | "__hash_table": "cpp", 30 | "__node_handle": "cpp", 31 | "__tree": "cpp", 32 | "cstdarg": "cpp", 33 | "cstdio": "cpp", 34 | "ctime": "cpp", 35 | "cwchar": "cpp", 36 | "deque": "cpp", 37 | "execution": "cpp", 38 | "ios": "cpp", 39 | "mutex": "cpp", 40 | "optional": "cpp", 41 | "print": "cpp", 42 | "streambuf": "cpp", 43 | "variant": "cpp", 44 | "complex": "cpp", 45 | "quat": "cpp", 46 | "*.inc": "cpp", 47 | "system_error": "cpp", 48 | "concepts": "cpp", 49 | "*.def": "cpp", 50 | "compare": "cpp", 51 | "regex": "cpp", 52 | "chrono": "cpp", 53 | "span": "cpp", 54 | "scoped_allocator": "cpp", 55 | "text_encoding": "cpp", 56 | "image": "cpp", 57 | "texture": "cpp", 58 | "sokol_gfx.h": "c", 59 | "sokol_imgui.h": "c", 60 | "*.hpp11": "cpp" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/checksanity.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ Complains if some API call is not tested """ 3 | 4 | import soloud_codegen 5 | import glob 6 | import os 7 | 8 | def checkfile(apifunc, fname): 9 | """ Checks whether the string can be found in a file """ 10 | if apifunc in open(fname).read(): 11 | # print(apifunc + " found in " + fname) 12 | return True 13 | return False 14 | 15 | def checkfiles(apifunc): 16 | """ Goes through all sources files in sanity dir and passes 17 | them to checkfile. If found, early out. 18 | """ 19 | for file in glob.glob("../src/tools/sanity/*.cpp"): 20 | if checkfile(apifunc, file): 21 | return True 22 | for file in glob.glob("../src/tools/sanity/*.h"): 23 | if checkfile(apifunc, file): 24 | return True 25 | return False 26 | 27 | print("Checking for untested APIs..") 28 | print() 29 | 30 | found = 0 31 | total = 0 32 | 33 | for func in soloud_codegen.soloud_func: 34 | apifunc = func[1].replace("_",".") 35 | if ((apifunc[-2::] != "Ex") and 36 | (apifunc[-7::] != "destroy")): 37 | if (apifunc[-6::] == "create"): 38 | apifunc = "SoLoud::" + apifunc[:-7:] 39 | total += 1 40 | if not checkfiles(apifunc): 41 | print(apifunc) 42 | found += 1 43 | 44 | if found == 0: 45 | print("All good! (" + str(total) + ", not counting ctor/dtor/ex)") 46 | else: 47 | print() 48 | print(str(found) + " / " + str(total) + " APIs untested. Get to work!") 49 | print("(not counting ctor/dtor/ex variants)") 50 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/sokol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOKOL_HEADERS 2 | sokol_app.h 3 | sokol_debugtext.h 4 | sokol_gfx.h 5 | sokol_glue.h 6 | sokol_imgui.h 7 | sokol_log.h 8 | sokol_time.h) 9 | set(SOKOL_DEFINES) 10 | 11 | if (EMSCRIPTEN) 12 | add_definitions(-DSOKOL_GLES2) 13 | add_library(sokol STATIC sokol.c ${SOKOL_HEADERS}) 14 | set(CMAKE_EXECUTABLE_SUFFIX ".html") 15 | elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin) 16 | add_library(sokol STATIC sokol.c ${SOKOL_HEADERS}) 17 | target_compile_options(sokol PRIVATE -x objective-c) 18 | if (1) 19 | set(SOKOL_DEFINES ${SOKOL_DEFINES} -DSOKOL_METAL) 20 | target_link_libraries(sokol PUBLIC 21 | "-framework QuartzCore" 22 | "-framework Cocoa" 23 | "-framework MetalKit" 24 | "-framework Metal") 25 | else () 26 | set(SOKOL_DEFINES ${SOKOL_DEFINES} -DSOKOL_GLCORE33) 27 | target_link_libraries(sokol PUBLIC 28 | "-framework QuartzCore" 29 | "-framework Cocoa" 30 | "-framework OpenGL") 31 | endif () 32 | else () 33 | set(SOKOL_DEFINES ${SOKOL_DEFINES} -DSOKOL_GLCORE33) 34 | add_library(sokol STATIC sokol.c ${SOKOL_HEADERS}) 35 | if (CMAKE_SYSTEM_NAME STREQUAL Linux) 36 | target_link_libraries(sokol INTERFACE X11 Xi Xcursor GL dl m) 37 | endif () 38 | endif () 39 | find_package(Threads REQUIRED) 40 | target_link_libraries(sokol PUBLIC Threads::Threads) 41 | target_link_libraries(sokol PUBLIC cimgui) 42 | target_include_directories(sokol INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 43 | target_compile_definitions(sokol PUBLIC ${SOKOL_DEFINES}) 44 | -------------------------------------------------------------------------------- /imgui-react-runtime/doc/TODO.md: -------------------------------------------------------------------------------- 1 | # TODO List 2 | 3 | ## Runtime Improvements 4 | 5 | ### Proper Timer Implementation 6 | Currently, timer implementation is tied to the Sokol frame callback, which means: 7 | - Timers are only checked and executed before each frame render 8 | - No true background timer events (limited to ~60Hz frame rate) 9 | - Timer precision is limited by the frame rate 10 | 11 | **Goal**: Implement proper timer support with: 12 | - Native timer events from the platform (separate from frame callbacks) 13 | - Better precision for setTimeout/setInterval 14 | - Ability to wake event loop independently of rendering 15 | 16 | ### Environment Variable Import on Startup 17 | Add ability to import system environment variables when the runtime starts. 18 | 19 | **Goal**: 20 | - Populate `process.env` with system environment variables 21 | - Allow configuration via environment (e.g., `DEBUG=1`, custom paths) 22 | - Match Node.js behavior more closely 23 | 24 | ### Node.js API Compatibility 25 | 26 | Provide Node.js-compatible APIs: 27 | 28 | **Priority modules**: 29 | - `fs` - File system operations (readFile, writeFile, stat, readdir, etc.) 30 | - `path` - Path manipulation utilities (join, resolve, dirname, etc.) 31 | - `os` - Operating system information (platform, tmpdir, etc.) 32 | - `buffer` - Buffer class for binary data handling 33 | - `stream` - Stream handling for file and data operations 34 | 35 | **Future modules**: 36 | - `http`/`https` - Network operations 37 | - `child_process` - Process spawning 38 | - `worker_threads` - Parallel execution 39 | 40 | ### Web Workers 41 | 42 | Multi-thread support will be nice. 43 | 44 | ### Misc 45 | 46 | Remove try/finally in rendering 47 | react compiler 48 | caching of component data 49 | -------------------------------------------------------------------------------- /imgui-react-runtime/tools/xxd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) Meta Platforms, Inc. and affiliates. 3 | # 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | """ 8 | This module exists so that a Windows build can have access to functionality 9 | like xxd -i. 10 | This script is intended to be compliant with both py2 and py3. 11 | """ 12 | 13 | import argparse 14 | import sys 15 | from os import path 16 | 17 | 18 | # This is about 80 characters long (4 characters per byte + comma + space) 19 | BYTES_PER_LINE = 12 20 | IS_PY3 = sys.version_info > (3, 0) 21 | 22 | 23 | def main(): 24 | parser = argparse.ArgumentParser() 25 | parser.add_argument("file") 26 | args = parser.parse_args() 27 | 28 | # Ensure the file exists before writing out anything 29 | if not path.exists(args.file): 30 | raise Exception('File "{}" doesn\'t exist'.format(args.file)) 31 | 32 | with open(args.file, "rb") as f: 33 | # Could read in chunks instead for extra performance, but this script 34 | # isn't meant to be used on gigantic files. 35 | file_as_bytes = f.read() 36 | 37 | # Make groups of bytes that fit in a single line 38 | lines = [ 39 | file_as_bytes[i : i + BYTES_PER_LINE] 40 | for i in range(0, len(file_as_bytes), BYTES_PER_LINE) 41 | ] 42 | # in python2, byte is same as str and interating it yield strs. 43 | # in python3, byte is distinct and interating it yield ints. 44 | print( 45 | ",\n".join( 46 | ", ".join("0x{:02x}".format(b if IS_PY3 else ord(b)) for b in l) 47 | for l in lines 48 | ) 49 | ) 50 | 51 | 52 | if __name__ == "__main__": 53 | main() 54 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/names.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace immer::persist::detail { 7 | 8 | template 9 | auto get_demangled_name(const T&) 10 | { 11 | return boost::core::demangle(typeid(std::decay_t).name()); 12 | } 13 | 14 | template 15 | class error_duplicate_pool_name_found; 16 | 17 | /** 18 | * @brief This function ensures that all the names are unique for the given map 19 | * of types to names. Otherwise, it triggers a compile-time error. 20 | * 21 | * @ingroup persist-impl 22 | */ 23 | template 24 | auto are_type_names_unique(T type_names) 25 | { 26 | namespace hana = boost::hana; 27 | auto names_set = 28 | hana::fold_left(type_names, hana::make_set(), [](auto set, auto pair) { 29 | return hana::if_( 30 | hana::contains(set, hana::second(pair)), 31 | [](auto pair) { 32 | return error_duplicate_pool_name_found< 33 | decltype(hana::second(pair))>{}; 34 | }, 35 | [&set](auto pair) { 36 | return hana::insert(set, hana::second(pair)); 37 | })(pair); 38 | }); 39 | return hana::length(type_names) == hana::length(names_set); 40 | } 41 | 42 | template 43 | struct name_from_map_fn 44 | { 45 | static_assert(decltype(are_type_names_unique(Map{}))::value, 46 | "Pool names in the map must be unique"); 47 | 48 | template 49 | auto operator()(const T& container) const 50 | { 51 | return Map{}[boost::hana::typeid_(container)].c_str(); 52 | } 53 | }; 54 | 55 | } // namespace immer::persist::detail 56 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/tedsid/ted.h: -------------------------------------------------------------------------------- 1 | 2 | class TED 3 | { 4 | public: 5 | unsigned int masterVolume; 6 | int Volume; 7 | int Snd1Status; 8 | int Snd2Status; 9 | int SndNoiseStatus; 10 | int DAStatus; 11 | unsigned short Freq1; 12 | unsigned short Freq2; 13 | int NoiseCounter; 14 | int FlipFlop[2]; 15 | int dcOutput[2]; 16 | int oscCount[2]; 17 | int OscReload[2]; 18 | int waveForm[2]; 19 | int oscStep; 20 | int sampleRate; 21 | unsigned char noise[256]; // 0-8 22 | unsigned int channelMask[3]; 23 | int vol; 24 | 25 | TED(); 26 | void enableChannel(unsigned int channel, bool enable); 27 | void setFreq(unsigned int channel, int freq); 28 | void oscillatorReset(); 29 | void oscillatorInit(); 30 | void writeSoundReg(unsigned int reg, unsigned char value); 31 | void storeToBuffer(short *buffer, unsigned int count); 32 | unsigned int waveSquare(unsigned int channel); 33 | unsigned int waveSawTooth(unsigned int channel); 34 | unsigned int waveTriangle(unsigned int channel); 35 | unsigned int getWaveSample(unsigned int channel, unsigned int wave); 36 | void renderSound(unsigned int nrsamples, short *buffer); 37 | void setMasterVolume(unsigned int shift); 38 | void selectWaveForm(unsigned int channel, unsigned int wave); 39 | void setplaybackSpeed(unsigned int speed); 40 | unsigned int getTimeSinceLastReset(); 41 | void setSampleRate(unsigned int value); 42 | void setFilterOrder(unsigned int value); 43 | void initFilter(unsigned int sampleRate_, unsigned int filterOrder_); 44 | }; -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/gen_autoit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # AutoIt wrapper generator 3 | 4 | from soloud_codegen import * 5 | 6 | fo = open("soloud.au3", "w") 7 | 8 | """ 9 | Global $dll = DllOpen(@ScriptDir & "\soloud.dll") 10 | 11 | Const $CONSTANT = 1234567890 12 | 13 | 14 | 15 | Func _SoLoud_method($param1, $param2, $paramN) 16 | Local $ret = DllCall($dll, "return type e.g. int", "function", "type1 if necessary", "param1 if necessary", "typeN if necessary", "paramN if necessary") 17 | If @error Then Return SetError(1, 1, 0) 18 | Return $ret[0] 19 | EndFunc 20 | """ 21 | 22 | fo.write("; SoLoud wrapper for AutoIt\n") 23 | fo.write("; This file is autogenerated; any changes will be overwritten\n") 24 | fo.write('Global $dll = DllOpen(@ScriptDir & "\\soloud_x86.dll")\n') 25 | fo.write("\n") 26 | fo.write("; Enumerations\n") 27 | for x in soloud_enum: 28 | fo.write("Const $" + x + " = " + str(soloud_enum[x]) + "\n") 29 | fo.write("\n") 30 | fo.write("; Functions\n") 31 | for x in soloud_func: 32 | funcdef = "Func _" + x[1] + "(" 33 | first = True; 34 | for p in x[2]: 35 | if len(p) > 0: 36 | if not first: 37 | funcdef += ", " 38 | else: 39 | first = False 40 | funcdef += "$" + p[1] 41 | funcdef += ")" 42 | 43 | calldef = "\tLocal $ret = DllCall($dll, " 44 | calldef += '"' + x[0] + '", ' # return type 45 | calldef += '"' + x[1] + '"' 46 | 47 | for p in x[2]: 48 | if len(p) > 0: 49 | calldef += ', "' + p[0] + '", "' + p[1] + '"' 50 | calldef += ')' 51 | 52 | fo.write(funcdef + "\n") 53 | fo.write(calldef + "\n") 54 | fo.write('\tIf @error Then Return SetError(1, 1, 0)\n') 55 | fo.write('\tReturn $ret[0]\n') 56 | fo.write('EndFunc\n') 57 | fo.write("\n") 58 | 59 | fo.close() 60 | print("soloud.au3 generated") 61 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_fft.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FFT_H 26 | #define SOLOUD_FFT_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | namespace FFT 33 | { 34 | // Perform 1024 unit FFT. Buffer must have 1024 floats, and will be overwritten 35 | void fft1024(float *aBuffer); 36 | 37 | // Perform 256 unit FFT. Buffer must have 256 floats, and will be overwritten 38 | void fft256(float *aBuffer); 39 | 40 | // Perform 256 unit IFFT. Buffer must have 256 floats, and will be overwritten 41 | void ifft256(float *aBuffer); 42 | 43 | // Generic (slower) power of two FFT. Buffer is overwritten. 44 | void fft(float *aBuffer, unsigned int aBufferLength); 45 | 46 | // Generic (slower) power of two IFFT. Buffer is overwritten. 47 | void ifft(float *aBuffer, unsigned int aBufferLength); 48 | }; 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/thread_local_free_list_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace immer { 16 | namespace detail { 17 | 18 | template 19 | struct thread_local_free_list_storage 20 | { 21 | struct head_t 22 | { 23 | free_list_node* data; 24 | std::size_t count; 25 | 26 | ~head_t() { Heap::clear(); } 27 | }; 28 | 29 | static head_t& head() 30 | { 31 | thread_local static head_t head_{nullptr, 0}; 32 | return head_; 33 | } 34 | }; 35 | 36 | } // namespace detail 37 | 38 | /*! 39 | * Adaptor that does not release the memory to the parent heap but 40 | * instead it keeps the memory in a `thread_local` global free 41 | * list. Must be preceded by a `with_data` heap 42 | * adaptor. When the current thread finishes, the memory is returned 43 | * to the parent heap. 44 | * 45 | * @tparam Size Maximum size of the objects to be allocated. 46 | * @tparam Limit Maximum number of elements to keep in the free list. 47 | * @tparam Base Type of the parent heap. 48 | */ 49 | template 50 | struct thread_local_free_list_heap 51 | : detail::unsafe_free_list_heap_impl 55 | {}; 56 | 57 | } // namespace immer 58 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/AUTHORS: -------------------------------------------------------------------------------- 1 | If you wish to contribute code to SoLoud, add your name to 2 | this list when sending a pull request. All code must be 3 | either public domain, CC0, wtfpl, zlib/libpng licensed, or 4 | similarly free to use (without attribution, or (l)gpl-like 5 | limitations. 6 | 7 | Jari Komppa http://iki.fi/sol/ 8 | Tom V�h�-Salo tomvahasalo@gmail.com 9 | Trygve Vea trygve.vea@gmail.com 10 | dorgonman dorgonman@hotmail.com 11 | Gabriel Teles Bastos http://mundorpgmaker.com.br 12 | r-lyeh https://github.com/r-lyeh 13 | Colden Cullen https://github.com/ColdenCullen 14 | Cosku Bas cosku.bas@gmail.com 15 | Neil Richardson https://github.com/neilogd 16 | Petri Häkkinen 17 | Omar Cornut 18 | amir ramezani http://shaberoshan.ir 19 | Luke San Antonio Bialecki lukesanantonio@gmail.com 20 | Konstantin S. Matveyev kos@eligovision.ru 21 | Eduardo Doria Lima https://github.com/eduardodoria 22 | Ilya Zhuravlev https://github.com/xyzz 23 | Jussi Sammaltupa 24 | Tam Toucn https://github.com/TamToucan 25 | lamelizard 26 | Tapio Vierros https://github.com/tapio 27 | Danny Angelo Carminati Grein https://github.com/fungos 28 | Igor Ivanov https://github.com/laptabrok 29 | Matthew O'Connell https://github.com/matthew-oconnell 30 | Boris Carvajal https://github.com/BorisCarvajal 31 | Osman Turan https://osmanturan.com 32 | Samson Close https://github.com/qwertysam 33 | Bruce A Henderson https://github.com/woollybah 34 | Philip Bennefall https://github.com/blastbay/ 35 | Sebastian Hartte https://github.com/shartte/ 36 | Jean-Luc Mackail https://github.com/fuzzyquills 37 | HumanGamer https://github.com/HumanGamer/ 38 | Ales Mlakar https://github.com/jazzbre 39 | lexander Yashin https://github.com/yashin-alexander 40 | Nils Duval https://github.com/nlsdvl 41 | JackRedstonia jackredstonia64@gmail.com 42 | David Bullock https://github.com/dwbullock 43 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_dcremovalfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_DCREMOVAL_H 26 | #define SOLOUD_DCREMOVAL_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class DCRemovalFilter; 33 | 34 | class DCRemovalFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | float *mTotals; 38 | int mBufferLength; 39 | DCRemovalFilter *mParent; 40 | int mOffset; 41 | 42 | public: 43 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 44 | virtual ~DCRemovalFilterInstance(); 45 | DCRemovalFilterInstance(DCRemovalFilter *aParent); 46 | }; 47 | 48 | class DCRemovalFilter : public Filter 49 | { 50 | public: 51 | float mLength; 52 | virtual FilterInstance *createInstance(); 53 | DCRemovalFilter(); 54 | result setParams(float aLength = 0.1f); 55 | }; 56 | } 57 | 58 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/alias.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace immer::persist::detail { 6 | 7 | template 8 | struct type_alias 9 | { 10 | using rep_t = T; 11 | 12 | T value{}; 13 | 14 | type_alias() = default; 15 | 16 | explicit type_alias(T value_) 17 | : value{std::move(value_)} 18 | { 19 | } 20 | 21 | friend bool operator==(const type_alias& left, const type_alias& right) 22 | { 23 | return left.value == right.value; 24 | } 25 | 26 | friend bool operator!=(const type_alias& left, const type_alias& right) 27 | { 28 | return left.value != right.value; 29 | } 30 | 31 | /** 32 | * This works only starting with fmt v10. 33 | */ 34 | friend auto format_as(const type_alias& v) { return v.value; } 35 | 36 | template 37 | auto save_minimal(const Archive&) const 38 | { 39 | return value; 40 | } 41 | 42 | template 43 | auto load_minimal(const Archive&, const T& value_) 44 | { 45 | value = value_; 46 | } 47 | }; 48 | 49 | } // namespace immer::persist::detail 50 | 51 | /** 52 | * Have to use this for fmt v9. 53 | */ 54 | template 55 | struct fmt::formatter> : formatter 56 | { 57 | template 58 | auto format(const immer::persist::detail::type_alias& value, 59 | FormatContext& ctx) const 60 | { 61 | return formatter::format(value.value, ctx); 62 | } 63 | }; 64 | 65 | template 66 | struct std::hash> 67 | { 68 | auto operator()(const immer::persist::detail::type_alias& x) const 69 | { 70 | return hash{}(x.value); 71 | } 72 | }; 73 | -------------------------------------------------------------------------------- /imgui-react-runtime/examples/dynamic-windows/app.jsx: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | import React, { useState } from 'react'; 6 | 7 | export function App() { 8 | const [windows, setWindows] = useState([ 9 | { id: 1, title: "Window 1" }, 10 | { id: 2, title: "Window 2" }, 11 | ]); 12 | const [nextId, setNextId] = useState(3); 13 | 14 | const addWindow = () => { 15 | setWindows([...windows, { id: nextId, title: `Window ${nextId}` }]); 16 | setNextId(nextId + 1); 17 | }; 18 | 19 | const closeWindow = (windowId) => { 20 | setWindows(windows.filter(w => w.id !== windowId)); 21 | }; 22 | 23 | return ( 24 | <> 25 | 26 | Dynamic Window Manager 27 | 28 | Total windows: {windows.length} 29 | 30 | 31 | Click the X button on any window to close it 32 | 33 | 34 | {windows.map(w => ( 35 | closeWindow(w.id)} 43 | > 44 | This is {w.title} 45 | 46 | Window ID: {w.id} 47 | Click the X button in the title bar to close this window 48 | 49 | Each window can be closed independently 50 | 51 | ))} 52 | 53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /imgui-react-runtime/scripts/bundle-react-unit.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | // Copyright (c) Tzvetan Mikov and contributors 3 | // SPDX-License-Identifier: MIT 4 | // See LICENSE file for full license text 5 | 6 | import * as esbuild from 'esbuild'; 7 | import { mkdirSync } from 'fs'; 8 | import { dirname, resolve } from 'path'; 9 | import { fileURLToPath } from 'url'; 10 | 11 | // Usage: bundle-react-unit.js [node-env] 12 | // Example: bundle-react-unit.js src/react-unit/index.js build/react-bundle.js production 13 | 14 | const entryPoint = process.argv[2]; 15 | const outfile = process.argv[3]; 16 | const nodeEnv = process.argv[4] || 'production'; 17 | 18 | if (!entryPoint || !outfile) { 19 | console.error('Usage: bundle-react-unit.js [node-env]'); 20 | console.error('Example: bundle-react-unit.js src/react-unit/index.js build/react-bundle.js production'); 21 | process.exit(1); 22 | } 23 | 24 | // Resolve lib directory relative to this script (scripts/ and lib/ are siblings) 25 | const __filename = fileURLToPath(import.meta.url); 26 | const __dirname = dirname(__filename); 27 | const libDir = resolve(__dirname, '../lib/react-imgui-reconciler'); 28 | 29 | // Ensure output directory exists 30 | mkdirSync(dirname(outfile), { recursive: true }); 31 | 32 | await esbuild.build({ 33 | entryPoints: [entryPoint], 34 | bundle: true, 35 | outfile: outfile, 36 | platform: 'neutral', 37 | format: 'iife', 38 | target: 'esnext', 39 | minify: false, 40 | sourcemap: true, 41 | // External packages that should be bundled 42 | external: [], 43 | // Alias for clean imports from lib/ 44 | alias: { 45 | 'react-imgui-reconciler': libDir, 46 | }, 47 | // Define NODE_ENV for dead code elimination 48 | define: { 49 | 'process.env.NODE_ENV': JSON.stringify(nodeEnv), 50 | }, 51 | }); 52 | 53 | console.log('React unit bundle created:', outfile, `(NODE_ENV=${nodeEnv})`); 54 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Here's some guidelines on contributing to the SoLoud project. 2 | 3 | - SoLoud is extremely liberally licensed. All submitted code 4 | must follow suit to keep it that way. 5 | (public domain, CC0, wtfpl, zlib/libpng, unlicense, or similar 6 | no-attribution and definitely no viral licenses). 7 | 8 | - When submitting the first time, add your name in AUTHORS. 9 | 10 | - Many small commits are better than few huge ones. 11 | 12 | - Try to follow the coding convention of the surrounding code. 13 | If stand alone (such as platform or output device specific), 14 | this isn't as important. 15 | 16 | - All optimized code (such as SSE or assembler) must be 17 | accompanied by plain 'c' version, because: 18 | a) optimizations come and go, porting 30 years from now 19 | can be really painful. 20 | b) plain 'c' version works as documentation of the 21 | optimized code. 22 | 23 | - When doing platform specific code or otherwise optionally 24 | compiled code, it's often better to have some duplicate 25 | code inside large ifdef block than to have tons of hard 26 | to follow small ifdef blocks. 27 | 28 | - Unless there's a really, really good reason, no templates, 29 | including funkycast. foo = (int)bar works fine. 30 | 31 | - Unless performance critical, always try to write for readability. 32 | 33 | Coding convention in brief: 34 | 35 | - On naming: 36 | aFunctionParameter 37 | mMemberVariable 38 | gGlobalVariable 39 | localVariable 40 | CONSTANT_VALUE 41 | ClassName 42 | functionName 43 | 44 | int ExampleClass::example(int aFoo) 45 | { 46 | if (aFoo) 47 | { 48 | int i; 49 | for (i = 0; i < mBarCycles; i++) 50 | { 51 | bar(); 52 | } 53 | switch (gBah) 54 | { 55 | case BOO: 56 | return HISS; 57 | } 58 | } 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/Configure.cmake: -------------------------------------------------------------------------------- 1 | include (OptionDependentOnPackage) 2 | include (PrintOptionStatus) 3 | 4 | option (SOLOUD_DYNAMIC "Set to ON to build dynamic SoLoud" OFF) 5 | print_option_status (SOLOUD_DYNAMIC "Build dynamic library") 6 | 7 | option (SOLOUD_STATIC "Set to ON to build static SoLoud" ON) 8 | print_option_status (SOLOUD_STATIC "Build static library") 9 | 10 | option (SOLOUD_C_API "Set to ON to include the C API" OFF) 11 | print_option_status (SOLOUD_C_API "Build C API") 12 | 13 | # TODO: 14 | option (SOLOUD_BUILD_DEMOS "Set to ON for building demos" OFF) 15 | print_option_status (SOLOUD_BUILD_DEMOS "Build demos") 16 | 17 | option (SOLOUD_BACKEND_NULL "Set to ON for building NULL backend" ON) 18 | print_option_status (SOLOUD_BACKEND_NULL "NULL backend") 19 | 20 | option (SOLOUD_BACKEND_SDL2 "Set to ON for building SDL2 backend" ON) 21 | print_option_status (SOLOUD_BACKEND_SDL2 "SDL2 backend") 22 | 23 | option (SOLOUD_BACKEND_ALSA "Set to ON for building ALSA backend" OFF) 24 | print_option_status (SOLOUD_BACKEND_ALSA "ALSA backend") 25 | 26 | option (SOLOUD_BACKEND_COREAUDIO "Set to ON for building CoreAudio backend" OFF) 27 | print_option_status (SOLOUD_BACKEND_COREAUDIO "CoreAudio backend") 28 | 29 | option (SOLOUD_BACKEND_OPENSLES "Set to ON for building OpenSLES backend" OFF) 30 | print_option_status (SOLOUD_BACKEND_OPENSLES "OpenSLES backend") 31 | 32 | option (SOLOUD_BACKEND_XAUDIO2 "Set to ON for building XAudio2 backend" OFF) 33 | print_option_status (SOLOUD_BACKEND_XAUDIO2 "XAudio2 backend") 34 | 35 | option (SOLOUD_BACKEND_WINMM "Set to ON for building WINMM backend" OFF) 36 | print_option_status (SOLOUD_BACKEND_WINMM "WINMM backend") 37 | 38 | option (SOLOUD_BACKEND_WASAPI "Set to ON for building WASAPI backend" OFF) 39 | print_option_status (SOLOUD_BACKEND_WASAPI "WASAPI backend") 40 | 41 | option (SOLOUD_GENERATE_GLUE "Set to ON for generating the Glue APIs" OFF) 42 | print_option_status (SOLOUD_GENERATE_GLUE "Generate Glue") 43 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_openmpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Openmpt module for SoLoud audio engine 3 | Copyright (c) 2016 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef OPENMPT_H 26 | #define OPENMPT_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class Openmpt; 33 | class File; 34 | 35 | class OpenmptInstance : public AudioSourceInstance 36 | { 37 | Openmpt *mParent; 38 | void *mModfile; 39 | int mPlaying; 40 | 41 | public: 42 | OpenmptInstance(Openmpt *aParent); 43 | virtual ~OpenmptInstance(); 44 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 45 | virtual bool hasEnded(); 46 | }; 47 | 48 | class Openmpt : public AudioSource 49 | { 50 | public: 51 | char *mData; 52 | unsigned int mDataLen; 53 | Openmpt(); 54 | virtual ~Openmpt(); 55 | result load(const char* aFilename); 56 | result loadMem(const unsigned char *aMem, unsigned int aLength, bool aCopy = false, bool aTakeOwnership = true); 57 | result loadFile(File *aFile); 58 | virtual AudioSourceInstance *createInstance(); 59 | }; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_vizsn.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | vizsn speech synthesizer (c) by Ville-Matias Heikkilä, 6 | released under WTFPL, http://www.wtfpl.net/txt/copying/ 7 | (in short, "do whatever you want to") 8 | 9 | Integration and changes to work with SoLoud by Jari Komppa, 10 | released under same license. 11 | */ 12 | 13 | #ifndef SOLOUD_VIZSN_H 14 | #define SOLOUD_VIZSN_H 15 | 16 | #include "soloud.h" 17 | 18 | namespace SoLoud 19 | { 20 | class Vizsn; 21 | 22 | struct VizsnResonator 23 | { 24 | public: 25 | float a, b, c, p1, p2; 26 | 27 | float resonate(float i); 28 | float antiresonate(float i); 29 | VizsnResonator(); 30 | }; 31 | 32 | struct VizsnBank 33 | { 34 | VizsnResonator r[10]; 35 | float pitch; 36 | float frica, voice, aspir, bypas, breth; 37 | VizsnBank(); 38 | }; 39 | 40 | class VizsnInstance : public AudioSourceInstance 41 | { 42 | public: 43 | VizsnInstance(Vizsn *aParent); 44 | ~VizsnInstance(); 45 | 46 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 47 | virtual bool hasEnded(); 48 | 49 | public: 50 | Vizsn *mParent; 51 | VizsnBank mBank0, mBank1, mBank0to1; 52 | int mNper, mNmod, mNopen; 53 | int mEchobuf[1024], mPtr; 54 | int mCurrentVoiceType; 55 | float mPitch; 56 | char *mS; 57 | float mBuf[2048]; 58 | unsigned int mBufwrite; 59 | unsigned int mBufread; 60 | float vcsrc(int aPitch, int aVoicetype); 61 | float noisrc(); 62 | float genwave(); 63 | void setphone(VizsnBank *aB, char aP, float aPitch); 64 | void slidePrepare(int aNumtix); 65 | void slideTick(); 66 | int mA; 67 | int mB; 68 | int mOrgv; 69 | float mGlotlast; 70 | }; 71 | 72 | class Vizsn : public AudioSource 73 | { 74 | public: 75 | char *mText; 76 | Vizsn(); 77 | virtual ~Vizsn(); 78 | void setText(char *aText); 79 | public: 80 | virtual AudioSourceInstance *createInstance(); 81 | }; 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_fader.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2014 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FADER_H 26 | #define SOLOUD_FADER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | // Helper class to process faders 33 | class Fader 34 | { 35 | public: 36 | // Value to fade from 37 | float mFrom; 38 | // Value to fade to 39 | float mTo; 40 | // Delta between from and to 41 | float mDelta; 42 | // Total time to fade 43 | time mTime; 44 | // Time fading started 45 | time mStartTime; 46 | // Time fading will end 47 | time mEndTime; 48 | // Current value. Used in case time rolls over. 49 | float mCurrent; 50 | // Active flag; 0 means disabled, 1 is active, 2 is LFO, -1 means was active, but stopped 51 | int mActive; 52 | // Ctor 53 | Fader(); 54 | // Set up LFO 55 | void setLFO(float aFrom, float aTo, time aTime, time aStartTime); 56 | // Set up fader 57 | void set(float aFrom, float aTo, time aTime, time aStartTime); 58 | // Get the current fading value 59 | float get(time aCurrentTime); 60 | }; 61 | }; 62 | 63 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/contrib/cmake/OptionDependentOnPackage.cmake: -------------------------------------------------------------------------------- 1 | # Parameters: 2 | # OPTION_VAR_NAME is variable name which will be passed to OPTION call 3 | # OPTION_DESCRIPTION is text description which will be passed to OPTION call 4 | # PACKAGE_FOUND_VAR is boolean variable indicated is requiring package found or not 5 | MACRO (OPTION_DEPENDENT_ON_PACKAGE OPTION_VAR_NAME OPTION_DESCRIPTION PACKAGE_FOUND_VAR) 6 | IF (NOT DEFINED ${OPTION_VAR_NAME}) 7 | OPTION (${OPTION_VAR_NAME} "${OPTION_DESCRIPTION}" ${${PACKAGE_FOUND_VAR}}) 8 | ELSE (NOT DEFINED ${OPTION_VAR_NAME}) 9 | IF (${OPTION_VAR_NAME} AND NOT ${PACKAGE_FOUND_VAR}) 10 | MESSAGE (FATAL_ERROR "You have set using of ${OPTION_VAR_NAME} whereas ${PACKAGE_FOUND_VAR} is NO") 11 | ENDIF (${OPTION_VAR_NAME} AND NOT ${PACKAGE_FOUND_VAR}) 12 | ENDIF (NOT DEFINED ${OPTION_VAR_NAME}) 13 | ENDMACRO (OPTION_DEPENDENT_ON_PACKAGE) 14 | 15 | # Parameters: 16 | # OPTION_VAR_NAME is variable name which will be passed to OPTION call 17 | # OPTION_DESCRIPTION is text description which will be passed to OPTION call 18 | # PACKAGE_FOUND_VAR and after parameters are boolean variables indicated is requiring package found or not 19 | MACRO (OPTION_DEPENDENT_ON_ALL_PACKAGES OPTION_VAR_NAME OPTION_DESCRIPTION PACKAGE_FOUND_VAR) 20 | SET (ALL_PACKAGES_FOUND TRUE) 21 | FOREACH (cur_package ${PACKAGE_FOUND_VAR} ${ARGN}) 22 | IF (NOT ${cur_package}) 23 | SET (ALL_PACKAGES_FOUND FALSE) 24 | SET (NOTFOUND_PACKAGES ${NOTFOUND_PACKAGES} ${cur_package}) 25 | ENDIF (NOT ${cur_package}) 26 | ENDFOREACH (cur_package) 27 | IF (NOT DEFINED ${OPTION_VAR_NAME}) 28 | OPTION (${OPTION_VAR_NAME} "${OPTION_DESCRIPTION}" ${ALL_PACKAGES_FOUND}) 29 | ELSE (NOT DEFINED ${OPTION_VAR_NAME}) 30 | IF (${OPTION_VAR_NAME} AND NOT ALL_PACKAGES_FOUND) 31 | MESSAGE (FATAL_ERROR "You have set using of ${OPTION_VAR_NAME} whereas ${NOTFOUND_PACKAGES} is NO") 32 | ENDIF (${OPTION_VAR_NAME} AND NOT ALL_PACKAGES_FOUND) 33 | ENDIF (NOT DEFINED ${OPTION_VAR_NAME}) 34 | ENDMACRO (OPTION_DEPENDENT_ON_ALL_PACKAGES) 35 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/backend/null/soloud_null.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include "soloud.h" 26 | 27 | #if !defined(WITH_NULL) 28 | 29 | namespace SoLoud 30 | { 31 | result null_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer) 32 | { 33 | return NOT_IMPLEMENTED; 34 | } 35 | }; 36 | 37 | #else 38 | 39 | namespace SoLoud 40 | { 41 | static void nullCleanup(Soloud * /*aSoloud*/) 42 | { 43 | } 44 | 45 | result null_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels) 46 | { 47 | if (aChannels == 0 || aChannels == 3 || aChannels == 5 || aChannels == 7 || aChannels > MAX_CHANNELS || aBuffer < SAMPLE_GRANULARITY) 48 | return INVALID_PARAMETER; 49 | aSoloud->mBackendData = 0; 50 | aSoloud->mBackendCleanupFunc = nullCleanup; 51 | 52 | aSoloud->postinit_internal(aSamplerate, aBuffer, aFlags, aChannels); 53 | aSoloud->mBackendString = "null driver"; 54 | return SO_NO_ERROR; 55 | } 56 | }; 57 | #endif 58 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/ay/sndrender.h: -------------------------------------------------------------------------------- 1 | /* 2 | sound resampling core for Unreal Speccy project 3 | created under public domain license by SMT, jan.2006 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "sndbuffer.h" 9 | 10 | struct SNDOUT; 11 | 12 | const unsigned SNDR_DEFAULT_SYSTICK_RATE = 3500000; // ZX-Spectrum Z80 clock 13 | const unsigned SNDR_DEFAULT_SAMPLE_RATE = 44100; 14 | 15 | class SNDRENDER 16 | { 17 | public: 18 | SNDRENDER(SNDBUFFER& sndbuffer); 19 | 20 | void set_timings(unsigned sys_clock_rate, unsigned sample_rate); 21 | 22 | // 'render' is a function that converts array of DAC inputs into PCM-buffer 23 | void render(SNDOUT *src, unsigned srclen, unsigned sys_ticks); 24 | 25 | // set of functions that fills buffer in emulation progress: 26 | 27 | // when called, we assume that sys_tick reset to 0 28 | void start_frame(); 29 | // system writes to DAC at given sys_tick 30 | void update(unsigned sys_tick, unsigned l, unsigned r); 31 | // emulate non-changed DAC value until end of frame 32 | void end_frame(unsigned endframe_sys_tick); 33 | 34 | protected: 35 | 36 | friend class SNDBUFFER; // access to dstpos in count() 37 | SNDBUFFER& sndbuffer; 38 | 39 | unsigned mix_l, mix_r; // current L/R volume values 40 | bufptr_t dstpos; // write position 41 | bufptr_t dst_start; // write position at start of frame. used to track count of samples in frame 42 | 43 | private: 44 | // local copies of sndbuffer params (for speed) 45 | SNDSAMPLE* buffer; 46 | unsigned bufsize; 47 | 48 | unsigned tick, base_tick; 49 | unsigned s1_l, s1_r; 50 | unsigned s2_l, s2_r; 51 | 52 | unsigned sys_clock_rate, sample_rate; 53 | unsigned passed_sys_ticks, passed_snd_ticks; 54 | unsigned mult_const; 55 | 56 | void flush(unsigned endtick); 57 | }; 58 | 59 | struct SNDOUT 60 | { 61 | unsigned timestamp; // in 'system clock' ticks 62 | SNDSAMPLE newvalue; 63 | }; 64 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/scripts/gen_blitzmax.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # BlitzMax wrapper generator 3 | # Thanks to James Boyd for help with this! 4 | 5 | import soloud_codegen 6 | 7 | fo = open("../glue/soloud.bmx", "w") 8 | 9 | """ 10 | Global SoloudLib:Int = LoadLibraryA ("soloud_x86.dll") 11 | 12 | If not SoloudLib Then Notify "soloud_x86.dll not found"; End 13 | 14 | Const SFXR_BLIP:Int = 6 15 | 16 | Global Soloud_destroy:Int (aSoloud:Byte Ptr) "win32" = GetProcAddress (SoloudLib, "Soloud_destroy") 17 | 18 | """ 19 | 20 | C_TO_BMX_TYPES = { 21 | "int":"Int", 22 | "void":"Int", 23 | "const char *":"Byte Ptr", 24 | "const unsigned char *":"Byte Ptr", 25 | "unsigned int":"Int", 26 | "float":"Float", 27 | "double":"Double", 28 | "float *":"Float Ptr", 29 | "File *":"Byte Ptr", 30 | "unsigned char *":"Byte Ptr", 31 | "char *":"Byte Ptr", 32 | "unsigned char":"Byte", 33 | "short *":"Byte Ptr" 34 | } 35 | 36 | for soloud_type in soloud_codegen.soloud_type: 37 | C_TO_BMX_TYPES[soloud_type + " *"] = "Byte Ptr" 38 | 39 | fo.write("' SoLoud wrapper for BlitzMax\n") 40 | fo.write("' This file is autogenerated; any changes will be overwritten\n") 41 | fo.write("\n") 42 | fo.write('Global SoloudLib:Int = LoadLibraryA ("soloud_x86.dll")\n') 43 | fo.write('If not SoloudLib Then Notify "soloud_x86.dll not found"; End\n') 44 | fo.write("\n") 45 | fo.write("' Enumerations\n") 46 | for x in soloud_codegen.soloud_enum: 47 | fo.write("Const " + x + ":Int = " + str(soloud_codegen.soloud_enum[x]) + "\n") 48 | fo.write("\n") 49 | fo.write("' Functions\n") 50 | for x in soloud_codegen.soloud_func: 51 | funcdef = "Global " + x[1] + ":" + C_TO_BMX_TYPES[x[0]] + " (" 52 | first = True; 53 | for p in x[2]: 54 | if len(p) > 0: 55 | if not first: 56 | funcdef += ", " 57 | else: 58 | first = False 59 | funcdef += p[1] + ":" + C_TO_BMX_TYPES[p[0]] 60 | funcdef += ")" 61 | funcdef += ' "win32" = GetProcAddress (SoloudLib, "'+x[1]+'")' 62 | fo.write(funcdef + "\n") 63 | 64 | fo.close() 65 | print("soloud.bmx generated") 66 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_ay.h: -------------------------------------------------------------------------------- 1 | /* 2 | AY module for SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef AY_H 26 | #define AY_H 27 | 28 | #include "soloud.h" 29 | 30 | class ChipPlayer; 31 | 32 | namespace SoLoud 33 | { 34 | class Ay; 35 | class File; 36 | class AyInstance : public AudioSourceInstance 37 | { 38 | public: 39 | Ay *mParent; 40 | ChipPlayer *mChip; 41 | int mPos; 42 | 43 | AyInstance(Ay *aParent); 44 | ~AyInstance(); 45 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 46 | virtual bool hasEnded(); 47 | virtual result rewind(); 48 | virtual float getInfo(unsigned int aInfoKey); 49 | }; 50 | 51 | class Ay : public AudioSource 52 | { 53 | public: 54 | bool mYm; 55 | int mChipspeed; 56 | int mCpuspeed; 57 | int mLooppos; 58 | int mLength; 59 | unsigned short* mOps; 60 | public: 61 | Ay(); 62 | ~Ay(); 63 | result load(const char *aFilename); 64 | result loadFile(File *aFile); 65 | result loadMem(const unsigned char* aMem, unsigned int aLength, bool aCopy, bool aTakeOwnership); 66 | virtual AudioSourceInstance *createInstance(); 67 | }; 68 | }; 69 | 70 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_noise.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_NOISE_H 26 | #define SOLOUD_NOISE_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_misc.h" 30 | 31 | namespace SoLoud 32 | { 33 | class Noise; 34 | 35 | class NoiseInstance : public AudioSourceInstance 36 | { 37 | public: 38 | NoiseInstance(Noise *aParent); 39 | ~NoiseInstance(); 40 | 41 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 42 | virtual bool hasEnded(); 43 | 44 | public: 45 | float mOctaveScale[10]; 46 | Misc::Prg mPrg; 47 | }; 48 | 49 | class Noise : public AudioSource 50 | { 51 | public: 52 | 53 | enum NOISETYPES 54 | { 55 | WHITE = 0, 56 | PINK, 57 | BROWNISH, 58 | BLUEISH 59 | }; 60 | 61 | Noise(); 62 | 63 | void setOctaveScale(float aOct0, float aOct1, float aOct2, float aOct3, float aOct4, float aOct5, float aOct6, float aOct7, float aOct8, float aOct9); 64 | void setType(int aType); 65 | 66 | virtual ~Noise(); 67 | 68 | public: 69 | virtual AudioSourceInstance *createInstance(); 70 | float mOctaveScale[10]; 71 | }; 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/lock/spinlock_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | // This has been shamelessly copied from boost... 15 | #if defined(_MSC_VER) && _MSC_VER >= 1310 && \ 16 | (defined(_M_IX86) || defined(_M_X64)) && !defined(__c2__) 17 | extern "C" void _mm_pause(); 18 | #define IMMER_SMT_PAUSE _mm_pause() 19 | #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 20 | #define IMMER_SMT_PAUSE __asm__ __volatile__("rep; nop" : : : "memory") 21 | #endif 22 | 23 | namespace immer { 24 | 25 | // This is an atomic spinlock similar to the one used by boost to provide 26 | // "atomic" shared_ptr operations. It also does not differ much from the one 27 | // from libc++ or libstdc++... 28 | struct spinlock_policy 29 | { 30 | std::atomic_flag v_{}; 31 | 32 | bool try_lock() { return !v_.test_and_set(std::memory_order_acquire); } 33 | 34 | void lock() 35 | { 36 | for (auto k = 0u; !try_lock(); ++k) { 37 | if (k < 4) 38 | continue; 39 | #ifdef IMMER_SMT_PAUSE 40 | else if (k < 16) 41 | IMMER_SMT_PAUSE; 42 | #endif 43 | else 44 | std::this_thread::yield(); 45 | } 46 | } 47 | 48 | void unlock() { v_.clear(std::memory_order_release); } 49 | 50 | struct scoped_lock 51 | { 52 | scoped_lock(const scoped_lock&) = delete; 53 | scoped_lock& operator=(const scoped_lock&) = delete; 54 | 55 | explicit scoped_lock(spinlock_policy& sp) 56 | : sp_{sp} 57 | { 58 | sp.lock(); 59 | } 60 | 61 | ~scoped_lock() { sp_.unlock(); } 62 | 63 | private: 64 | spinlock_policy& sp_; 65 | }; 66 | }; 67 | 68 | } // namespace immer 69 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/common/pool.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace immer::persist::detail { 11 | 12 | /** 13 | * This type is used in container-specific pools to refer to the actual data 14 | * from the leaf nodes. The values are serialized as a list. 15 | */ 16 | template 17 | struct values_save 18 | { 19 | const T* begin = nullptr; 20 | const T* end = nullptr; 21 | 22 | auto tie() const { return std::tie(begin, end); } 23 | 24 | friend bool operator==(const values_save& left, const values_save& right) 25 | { 26 | return left.tie() == right.tie(); 27 | } 28 | }; 29 | 30 | /** 31 | * This type is used in container-specific pools to contain the actual data for 32 | * the leaf nodes. The values are deserialized from a list. 33 | */ 34 | template 35 | struct values_load 36 | { 37 | immer::array data; 38 | 39 | values_load() = default; 40 | 41 | values_load(immer::array data_) 42 | : data{std::move(data_)} 43 | { 44 | } 45 | 46 | values_load(const values_save& save) 47 | : data{save.begin, save.end} 48 | { 49 | } 50 | 51 | friend bool operator==(const values_load& left, const values_load& right) 52 | { 53 | return left.data == right.data; 54 | } 55 | }; 56 | 57 | template 58 | void save(Archive& ar, const values_save& value) 59 | { 60 | ar(cereal::make_size_tag( 61 | static_cast(value.end - value.begin))); 62 | for (auto p = value.begin; p != value.end; ++p) { 63 | ar(*p); 64 | } 65 | } 66 | 67 | template 68 | void load(Archive& ar, values_load& m) 69 | { 70 | cereal::size_type size; 71 | ar(cereal::make_size_tag(size)); 72 | 73 | for (auto i = cereal::size_type{}; i < size; ++i) { 74 | T x; 75 | ar(x); 76 | m.data = std::move(m.data).push_back(std::move(x)); 77 | } 78 | } 79 | 80 | } // namespace immer::persist::detail 81 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/cereal/immer_vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace cereal { 7 | 8 | template 13 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, 14 | immer::vector& m) 15 | { 16 | size_type size; 17 | ar(make_size_tag(size)); 18 | m = {}; 19 | 20 | for (auto i = size_type{}; i < size; ++i) { 21 | T x; 22 | ar(x); 23 | m = std::move(m).push_back(std::move(x)); 24 | } 25 | } 26 | 27 | template 32 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, 33 | const immer::vector& m) 34 | { 35 | ar(make_size_tag(static_cast(m.size()))); 36 | for (auto&& v : m) 37 | ar(v); 38 | } 39 | 40 | template 45 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, 46 | immer::flex_vector& m) 47 | { 48 | size_type size; 49 | ar(make_size_tag(size)); 50 | m = {}; 51 | 52 | for (auto i = size_type{}; i < size; ++i) { 53 | T x; 54 | ar(x); 55 | m = std::move(m).push_back(std::move(x)); 56 | } 57 | } 58 | 59 | template 64 | void CEREAL_SAVE_FUNCTION_NAME( 65 | Archive& ar, const immer::flex_vector& m) 66 | { 67 | ar(make_size_tag(static_cast(m.size()))); 68 | for (auto&& v : m) 69 | ar(v); 70 | } 71 | 72 | } // namespace cereal 73 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/rbts/traits.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace immer::persist::detail { 8 | 9 | template 13 | struct container_traits> 14 | { 15 | using output_pool_t = rbts::output_pool; 16 | using input_pool_t = rbts::input_pool; 17 | using container_id = immer::persist::container_id; 18 | 19 | template 21 | using loader_t = 22 | rbts::vector_loader; 23 | 24 | // This function is used to determine the type of the container after 25 | // applying some transformation. 26 | template 27 | static auto transform(F&& func) 28 | { 29 | using U = std::decay_t()))>; 30 | return immer::vector{}; 31 | } 32 | }; 33 | 34 | template 38 | struct container_traits> 39 | { 40 | using output_pool_t = rbts::output_pool; 41 | using input_pool_t = rbts::input_pool; 42 | using container_id = immer::persist::container_id; 43 | 44 | template 46 | using loader_t = 47 | rbts::flex_vector_loader; 48 | 49 | template 50 | static auto transform(F&& func) 51 | { 52 | using U = std::decay_t()))>; 53 | return immer::flex_vector{}; 54 | } 55 | }; 56 | 57 | } // namespace immer::persist::detail 58 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/ay/sndbuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sndbuffer.h" 3 | #include "sndrender.h" 4 | #include 5 | 6 | SNDBUFFER::SNDBUFFER(unsigned aSize) { 7 | read_position = 0; 8 | samples_ready = 0; 9 | // size must be power of 2 for faster calc cyclic position: pos = (pos+1) & (size-1) 10 | if (aSize & (aSize-1)) { 11 | unsigned i = 1; 12 | while (i < aSize) i *= 2; 13 | aSize = i; 14 | } 15 | SNDBUFFER::size = aSize; 16 | buffer = (SNDSAMPLE*)malloc(aSize * sizeof(SNDSAMPLE)); 17 | reset(); 18 | } 19 | 20 | SNDBUFFER::~SNDBUFFER() 21 | { 22 | free(buffer); 23 | } 24 | 25 | void SNDBUFFER::reset() 26 | { 27 | read_position = 0; 28 | memset(buffer, 0, size * sizeof(SNDSAMPLE)); 29 | } 30 | 31 | void SNDBUFFER::get_buffers(bufptr_t& pos1, unsigned& size1, bufptr_t& pos2, unsigned& size2, unsigned count) 32 | { 33 | pos1 = read_position; 34 | pos2 = 0; 35 | size1 = size - read_position; 36 | if (count < size1) { 37 | size1 = count; 38 | size2 = 0; 39 | } else { 40 | size2 = count-size1; 41 | } 42 | } 43 | 44 | void SNDBUFFER::samples_read(unsigned count) 45 | { 46 | unsigned size1, size2, pos1, pos2; 47 | get_buffers(pos1, size1, pos2, size2, count); 48 | memset(buffer + pos1, 0, size1 * sizeof(SNDSAMPLE)); 49 | if (size2) { 50 | memset(buffer + pos2, 0, size2 * sizeof(SNDSAMPLE)); 51 | } 52 | read_position = (read_position + count) & (size-1); 53 | } 54 | 55 | void SNDBUFFER::count_start() 56 | { 57 | samples_ready = size; 58 | } 59 | 60 | unsigned SNDBUFFER::count_single(const SNDRENDER& render) 61 | { 62 | return (render.dstpos - read_position) & (size-1); 63 | } 64 | 65 | void SNDBUFFER::count(const SNDRENDER& render) 66 | { 67 | unsigned samples = count_single(render); 68 | if (samples < samples_ready) samples_ready = samples; 69 | } 70 | 71 | unsigned SNDBUFFER::count_end() 72 | { 73 | return samples_ready; 74 | } 75 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_tedsid.h: -------------------------------------------------------------------------------- 1 | /* 2 | TED/SID module for SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef TEDSID_H 26 | #define TEDSID_H 27 | 28 | #include "soloud.h" 29 | 30 | class SIDsound; 31 | class TED; 32 | 33 | namespace SoLoud 34 | { 35 | class TedSid; 36 | class File; 37 | 38 | class TedSidInstance : public AudioSourceInstance 39 | { 40 | TedSid *mParent; 41 | SIDsound *mSID; 42 | TED *mTED; 43 | int mPos; 44 | unsigned int mSampleCount; 45 | int mRegValues[128]; 46 | public: 47 | 48 | TedSidInstance(TedSid *aParent); 49 | ~TedSidInstance(); 50 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 51 | virtual void tick(); 52 | virtual bool hasEnded(); 53 | virtual float getInfo(unsigned int aInfoKey); 54 | }; 55 | 56 | class TedSid : public AudioSource 57 | { 58 | public: 59 | int mLooppos; 60 | int mLength; 61 | unsigned short* mOps; 62 | int mModel; 63 | TedSid(); 64 | ~TedSid(); 65 | result load(const char *aFilename); 66 | result loadMem(const unsigned char *aMem, unsigned int aLength, bool aCopy = false, bool aTakeOwnership = true); 67 | result loadFile(File *aFile); 68 | virtual AudioSourceInstance *createInstance(); 69 | }; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_waveshaperfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_WAVESHAPERFILTER_H 26 | #define SOLOUD_WAVESHAPERFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class WaveShaperFilter; 33 | 34 | class WaveShaperFilterInstance : public FilterInstance 35 | { 36 | WaveShaperFilter *mParent; 37 | public: 38 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 39 | virtual ~WaveShaperFilterInstance(); 40 | WaveShaperFilterInstance(WaveShaperFilter *aParent); 41 | }; 42 | 43 | class WaveShaperFilter : public Filter 44 | { 45 | public: 46 | enum FILTERPARAMS { 47 | WET = 0, 48 | AMOUNT 49 | }; 50 | float mAmount; 51 | virtual WaveShaperFilterInstance *createInstance(); 52 | result setParams(float aAmount); 53 | WaveShaperFilter(); 54 | virtual ~WaveShaperFilter(); 55 | virtual int getParamCount(); 56 | virtual const char* getParamName(unsigned int aParamIndex); 57 | virtual unsigned int getParamType(unsigned int aParamIndex); 58 | virtual float getParamMax(unsigned int aParamIndex); 59 | virtual float getParamMin(unsigned int aParamIndex); 60 | }; 61 | } 62 | 63 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_bassboostfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_BASSBOOSTFILTER_H 26 | #define SOLOUD_BASSBOOSTFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_fftfilter.h" 30 | 31 | namespace SoLoud 32 | { 33 | class BassboostFilter; 34 | 35 | class BassboostFilterInstance : public FFTFilterInstance 36 | { 37 | enum FILTERATTRIBUTE 38 | { 39 | WET = 0, 40 | BOOST = 1 41 | }; 42 | BassboostFilter *mParent; 43 | public: 44 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 45 | BassboostFilterInstance(BassboostFilter *aParent); 46 | }; 47 | 48 | class BassboostFilter : public FFTFilter 49 | { 50 | public: 51 | enum FILTERATTRIBUTE 52 | { 53 | WET = 0, 54 | BOOST = 1 55 | }; 56 | virtual int getParamCount(); 57 | virtual const char* getParamName(unsigned int aParamIndex); 58 | virtual unsigned int getParamType(unsigned int aParamIndex); 59 | virtual float getParamMax(unsigned int aParamIndex); 60 | virtual float getParamMin(unsigned int aParamIndex); 61 | float mBoost; 62 | result setParams(float aBoost); 63 | virtual FilterInstance *createInstance(); 64 | BassboostFilter(); 65 | }; 66 | } 67 | 68 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_flangerfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FLANGERFILTER_H 26 | #define SOLOUD_FLANGERFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class FlangerFilter; 33 | 34 | class FlangerFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | unsigned int mBufferLength; 38 | FlangerFilter *mParent; 39 | unsigned int mOffset; 40 | double mIndex; 41 | 42 | public: 43 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 44 | virtual ~FlangerFilterInstance(); 45 | FlangerFilterInstance(FlangerFilter *aParent); 46 | }; 47 | 48 | class FlangerFilter : public Filter 49 | { 50 | public: 51 | enum FILTERPARAMS 52 | { 53 | WET, 54 | DELAY, 55 | FREQ 56 | }; 57 | float mDelay; 58 | float mFreq; 59 | virtual int getParamCount(); 60 | virtual const char* getParamName(unsigned int aParamIndex); 61 | virtual unsigned int getParamType(unsigned int aParamIndex); 62 | virtual float getParamMax(unsigned int aParamIndex); 63 | virtual float getParamMin(unsigned int aParamIndex); 64 | virtual FilterInstance *createInstance(); 65 | FlangerFilter(); 66 | result setParams(float aDelay, float aFreq); 67 | }; 68 | } 69 | 70 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_echofilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_ECHOFILTER_H 26 | #define SOLOUD_ECHOFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class EchoFilter; 33 | 34 | class EchoFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | int mBufferLength; 38 | int mBufferMaxLength; 39 | int mOffset; 40 | 41 | public: 42 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 43 | virtual ~EchoFilterInstance(); 44 | EchoFilterInstance(EchoFilter *aParent); 45 | }; 46 | 47 | class EchoFilter : public Filter 48 | { 49 | public: 50 | enum FILTERATTRIBUTE 51 | { 52 | WET = 0, 53 | DELAY, 54 | DECAY, 55 | FILTER 56 | }; 57 | float mDelay; 58 | float mDecay; 59 | float mFilter; 60 | virtual int getParamCount(); 61 | virtual const char* getParamName(unsigned int aParamIndex); 62 | virtual unsigned int getParamType(unsigned int aParamIndex); 63 | virtual float getParamMax(unsigned int aParamIndex); 64 | virtual float getParamMin(unsigned int aParamIndex); 65 | virtual FilterInstance *createInstance(); 66 | EchoFilter(); 67 | result setParams(float aDelay, float aDecay = 0.7f, float aFilter = 0.0f); 68 | }; 69 | } 70 | 71 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_robotizefilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_ROBOTIZEFILTER_H 26 | #define SOLOUD_ROBOTIZEFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_filter.h" 30 | #include "soloud_misc.h" 31 | 32 | namespace SoLoud 33 | { 34 | class RobotizeFilter; 35 | 36 | class RobotizeFilterInstance : public FilterInstance 37 | { 38 | enum FILTERATTRIBUTE 39 | { 40 | WET = 0, 41 | FREQ, 42 | WAVE 43 | }; 44 | RobotizeFilter *mParent; 45 | public: 46 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 47 | RobotizeFilterInstance(RobotizeFilter *aParent); 48 | }; 49 | 50 | class RobotizeFilter : public Filter 51 | { 52 | public: 53 | enum FILTERATTRIBUTE 54 | { 55 | WET = 0, 56 | FREQ, 57 | WAVE 58 | }; 59 | float mFreq; 60 | int mWave; 61 | virtual int getParamCount(); 62 | virtual const char* getParamName(unsigned int aParamIndex); 63 | virtual unsigned int getParamType(unsigned int aParamIndex); 64 | virtual float getParamMax(unsigned int aParamIndex); 65 | virtual float getParamMin(unsigned int aParamIndex); 66 | void setParams(float aFreq, int aWaveform); 67 | virtual FilterInstance *createInstance(); 68 | RobotizeFilter(); 69 | }; 70 | } 71 | 72 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/speech/resonator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "resonator.h" 3 | 4 | #ifndef PI 5 | #define PI 3.1415926535897932384626433832795f 6 | #endif 7 | 8 | /* Convert formant freqencies and bandwidth into resonator difference equation coefficents 9 | */ 10 | void resonator::initResonator( 11 | int aFrequency, /* Frequency of resonator in Hz */ 12 | int aBandwidth, /* Bandwidth of resonator in Hz */ 13 | int aSamplerate) 14 | { 15 | float arg = (-PI / aSamplerate) * aBandwidth; 16 | float r = (float)exp(arg); 17 | mC = -(r * r); 18 | arg = (-2.0f * PI / aSamplerate) * aFrequency; 19 | mB = r * (float)cos(arg) * 2.0f; 20 | mA = 1.0f - mB - mC; 21 | } 22 | 23 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants 24 | */ 25 | void resonator::initAntiresonator( 26 | int aFrequency, /* Frequency of resonator in Hz */ 27 | int aBandwidth, /* Bandwidth of resonator in Hz */ 28 | int aSamplerate) 29 | { 30 | initResonator(aFrequency, aBandwidth, aSamplerate); /* First compute ordinary resonator coefficients */ 31 | /* Now convert to antiresonator coefficients */ 32 | mA = 1.0f / mA; /* a'= 1/a */ 33 | mB *= -mA; /* b'= -b/a */ 34 | mC *= -mA; /* c'= -c/a */ 35 | } 36 | 37 | /* Generic resonator function */ 38 | float resonator::resonate(float input) 39 | { 40 | float x = mA * input + mB * mP1 + mC * mP2; 41 | mP2 = mP1; 42 | mP1 = x; 43 | return x; 44 | } 45 | 46 | /* Generic anti-resonator function 47 | Same as resonator except that a,b,c need to be set with initAntiresonator() 48 | and we save inputs in p1/p2 rather than outputs. 49 | There is currently only one of these - "mNasalZero" 50 | */ 51 | /* Output = (mNasalZero.a * input) + (mNasalZero.b * oldin1) + (mNasalZero.c * oldin2) */ 52 | 53 | float resonator::antiresonate(float input) 54 | { 55 | float x = mA * input + mB * mP1 + mC * mP2; 56 | mP2 = mP1; 57 | mP1 = input; 58 | return x; 59 | } 60 | 61 | resonator::resonator() 62 | { 63 | mA = mB = mC = mP1 = mP2 = 0; 64 | } 65 | 66 | resonator::~resonator() 67 | { 68 | } 69 | 70 | void resonator::setGain(float aG) 71 | { 72 | mA *= aG; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/experimental/dvektor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace immer { 18 | 19 | template 20 | class dvektor 21 | { 22 | using impl_t = detail::dvektor::impl; 23 | 24 | public: 25 | using value_type = T; 26 | using reference = const T&; 27 | using size_type = std::size_t; 28 | using difference_type = std::ptrdiff_t; 29 | using const_reference = const T&; 30 | 31 | using iterator = detail::dvektor::iterator; 32 | using const_iterator = iterator; 33 | using reverse_iterator = std::reverse_iterator; 34 | 35 | dvektor() = default; 36 | 37 | iterator begin() const { return {impl_}; } 38 | iterator end() const { return {impl_, typename iterator::end_t{}}; } 39 | 40 | reverse_iterator rbegin() const { return reverse_iterator{end()}; } 41 | reverse_iterator rend() const { return reverse_iterator{begin()}; } 42 | 43 | std::size_t size() const { return impl_.size; } 44 | bool empty() const { return impl_.size == 0; } 45 | 46 | reference operator[](size_type index) const { return impl_.get(index); } 47 | 48 | dvektor push_back(value_type value) const 49 | { 50 | return {impl_.push_back(std::move(value))}; 51 | } 52 | 53 | dvektor assoc(std::size_t idx, value_type value) const 54 | { 55 | return {impl_.assoc(idx, std::move(value))}; 56 | } 57 | 58 | template 59 | dvektor update(std::size_t idx, FnT&& fn) const 60 | { 61 | return {impl_.update(idx, std::forward(fn))}; 62 | } 63 | 64 | private: 65 | dvektor(impl_t impl) 66 | : impl_(std::move(impl)) 67 | { 68 | } 69 | impl_t impl_ = detail::dvektor::empty; 70 | }; 71 | 72 | } // namespace immer 73 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/skia-unit/renderer.js: -------------------------------------------------------------------------------- 1 | function getLayout(node: any): [number, number, number, number] { 2 | // Use computed layout if available, otherwise fall back to props 3 | const layout = node._layout || node.props; 4 | const x = layout.x ?? node.props.x ?? 0; 5 | const y = layout.y ?? node.props.y ?? 0; 6 | const width = layout.width ?? node.props.width ?? 0; 7 | const height = layout.height ?? node.props.height ?? 0; 8 | return [x, y, width, height]; 9 | } 10 | 11 | function renderRect(node: any): void { 12 | const paint = allocTmp(_sizeof_SkPaint); 13 | 14 | _paint_set_color(paint, node.props.backgroundColor); 15 | 16 | const [x, y, width, height] = getLayout(node); 17 | 18 | if (node.props.borderRadius) { 19 | const r = node.props.borderRadius; 20 | _draw_round_rect(x, y, width, height, r, r, paint); 21 | } else { 22 | _draw_rect(x, y, width, height, paint); 23 | } 24 | } 25 | 26 | _create_font_manager( 27 | tmpUtf8( 28 | '/Users/romanliutikov/projects/cljs-static-hermes/imgui-react-runtime/external/skia/skia/resources/fonts/' 29 | ) 30 | ); 31 | 32 | const fontsCache: any = {}; 33 | 34 | function renderText(node: any): void { 35 | const paint = allocTmp(_sizeof_SkPaint); 36 | _paint_set_color(paint, node.props.color); 37 | const key = node.props.fontFamily + '_' + node.props.fontSize; 38 | fontsCache[key] = 39 | fontsCache[key] || 40 | _create_font( 41 | tmpUtf8(node.props.fontFamily), 42 | node.props.fontSize * globalThis.devicePixelRatio 43 | ); 44 | const font = fontsCache[key]; 45 | const [x, y, width, height] = getLayout(node); 46 | _draw_simple_text(tmpUtf8(node.props.children), x, y, font, paint); 47 | } 48 | 49 | function renderNode(node: any): void { 50 | if (!node) return; 51 | 52 | switch (node.type) { 53 | case 'rect': 54 | renderRect(node); 55 | break; 56 | case 'text': 57 | renderText(node); 58 | return; 59 | } 60 | 61 | for (let i = 0; i < node.children.length; i++) { 62 | renderNode(node.children[i]); 63 | } 64 | } 65 | 66 | globalThis.skiaUnit = { 67 | renderTree: function (): void { 68 | const reactApp = globalThis.reactApp; 69 | for (let i = 0; i < reactApp.rootChildren.length; i++) { 70 | renderNode(reactApp.rootChildren[i]); 71 | } 72 | }, 73 | }; 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | _This project demonstrates use of ClojureScript and UIx, together with React and a custom reconciler to drive a native GLFW window with Skia rendering library and Yoga layout via AOT compiled JavaScript with Static Hermes._ 2 | 3 | - Based off https://github.com/tmikov/imgui-react-runtime 4 | - Read more about [Static Hermes and imgui-react-runtime here](imgui-react-runtime/README.md) 5 | 6 | Differences from _tmikov/imgui-react-runtime_: 7 | 8 | - Bundles [UIx](https://github.com/pitch-io/uix) app written in ClojureScript 9 | - Exposes `WebSocket` interface to JS env via [libwebsockets](https://github.com/warmcat/libwebsockets), needed for REPL connection in dev 10 | - Supports hot-reloading cljs code in dev, via custom REPL client runtime 11 | - Supports state preserving hot-reloading via react-refresh 12 | - Runs `requestAnimationFrame` at device's refresh rate (60/120/144hz etc) 13 | - Skia example includes [Skia](https://skia.org/) graphics rendered in [GLFW](https://www.glfw.org/) window, with [Yoga](https://www.yogalayout.dev/) as flex box layout engine and DOM-like event propagation system 14 | 15 | ## Development 16 | 17 | _native dependencies + interpreted javascript for interactive development_ 18 | 19 | 1. Install NPM dependencies `npm i` 20 | 1. Run cljs dev build `clojure -M -m shadow.cljs.devtools.cli watch skia-app` 21 | 1. `cd imgui-react-runtime` 22 | 1. Configure hermes dev build `cmake -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug -G Ninja` 23 | 1. Build `cmake --build cmake-build-debug --target skia` 24 | 1. Run the binary `./cmake-build-debug/examples/skia/skia` 25 | 1. Make changes in cljs files to trigger hot-reload or/and connect to REPL server (run `(shadow/repl :skia-app)` from Clojure REPL to hook into JavaScript env) 26 | 27 | ## Release build 28 | 29 | _native dependencies + native AOT compiled javascript for maximum performance_ 30 | 31 | 1. Build cljs code `clojure -M -m shadow.cljs.devtools.cli release skia-app` 32 | 1. `cd imgui-react-runtime` 33 | 1. Configure hermes release build `cmake -B cmake-build-release -DCMAKE_BUILD_TYPE=Release -G Ninja` 34 | 1. Build `cmake --build cmake-build-release --target skia` 35 | 1. Run the binary `./cmake-build-release/examples/skia/skia` 36 | 37 | Output binary: 15MB 38 | 39 | - 3MB Hermes VM 40 | - 1.8MB React library 41 | - 10.2MB app/renderer/GLFW/Skia/Yoga 42 | -------------------------------------------------------------------------------- /imgui-react-runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(imgui-react-runtime) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | # Suppress C99 designator warnings for C++ files with GCC/Clang 7 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") 8 | add_compile_options($<$:-Wno-c99-designator>) 9 | endif() 10 | 11 | # Validate required variables 12 | if(NOT CMAKE_BUILD_TYPE) 13 | message(FATAL_ERROR "CMAKE_BUILD_TYPE must be set (e.g., Debug or Release)") 14 | endif() 15 | 16 | # Build Hermes as an external project (always in Release mode) 17 | # This sets HERMES_BUILD, HERMES_SRC, SHERMES, and HERMES variables 18 | include(cmake/HermesExternal.cmake) 19 | 20 | # Include Hermes compilation helper functions 21 | include(cmake/hermes.cmake) 22 | 23 | # Include React+ImGui app helper functions 24 | include(cmake/react-imgui.cmake) 25 | 26 | # React bundle mode: 27 | # 0 = Native compilation with shermes (default for Release, slowest build, fastest runtime) 28 | # 1 = Bytecode compilation with hermes (medium build speed, medium runtime) 29 | # 2 = Source bundle only (default for Debug, fastest build, slowest runtime) 30 | if(NOT DEFINED REACT_BUNDLE_MODE) 31 | if(CMAKE_BUILD_TYPE STREQUAL "Release") 32 | set(REACT_BUNDLE_MODE 0) 33 | else() 34 | set(REACT_BUNDLE_MODE 2) 35 | endif() 36 | endif() 37 | set(REACT_BUNDLE_MODE ${REACT_BUNDLE_MODE} CACHE STRING "React bundle compilation mode (0=native, 1=bytecode, 2=source)") 38 | 39 | message(STATUS "Hermes build: ${HERMES_BUILD}") 40 | message(STATUS "Hermes source: ${HERMES_SRC}") 41 | message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") 42 | message(STATUS "React bundle mode: ${REACT_BUNDLE_MODE} (0=native, 1=bytecode, 2=source)") 43 | 44 | # Collect reconciler library files for dependency tracking 45 | # This is defined at root level so it can be reused by multiple apps 46 | file(GLOB RECONCILER_FILES 47 | CONFIGURE_DEPENDS 48 | ${CMAKE_SOURCE_DIR}/lib/react-imgui-reconciler/*.js 49 | ) 50 | 51 | # Hermes include directories 52 | include_directories(${HERMES_BUILD}/lib/config) 53 | include_directories(${HERMES_SRC}/include) 54 | include_directories(${HERMES_SRC}/public) 55 | include_directories(${HERMES_SRC}/API) 56 | include_directories(${HERMES_SRC}/API/jsi) 57 | 58 | add_subdirectory(external) 59 | add_subdirectory(lib) 60 | add_subdirectory(examples) 61 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_duckfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2021 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_DUCKFILTER_H 26 | #define SOLOUD_DUCKFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class DuckFilter; 33 | 34 | class DuckFilterInstance : public FilterInstance 35 | { 36 | handle mListenTo; 37 | Soloud* mSoloud; 38 | float mCurrentLevel; 39 | public: 40 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 41 | virtual ~DuckFilterInstance(); 42 | DuckFilterInstance(DuckFilter *aParent); 43 | }; 44 | 45 | class DuckFilter : public Filter 46 | { 47 | public: 48 | enum FILTERATTRIBUTE 49 | { 50 | WET = 0, 51 | ONRAMP, 52 | OFFRAMP, 53 | LEVEL 54 | }; 55 | Soloud* mSoloud; 56 | float mOnRamp; 57 | float mOffRamp; 58 | float mLevel; 59 | handle mListenTo; 60 | virtual int getParamCount(); 61 | virtual const char* getParamName(unsigned int aParamIndex); 62 | virtual unsigned int getParamType(unsigned int aParamIndex); 63 | virtual float getParamMax(unsigned int aParamIndex); 64 | virtual float getParamMin(unsigned int aParamIndex); 65 | virtual FilterInstance *createInstance(); 66 | DuckFilter(); 67 | result setParams(Soloud* aSoloud, handle aListenTo, float aOnRamp = 0.1f, float aOffRamp = 0.5f, float aLevel = 0.1f); 68 | }; 69 | } 70 | 71 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_file_hack_on.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | /* 26 | This is a "hack" header to fool third party code to use our File stuff instead 27 | of stdio FILE* stuff. 28 | You can use soloud_file_hack_off.h to undef the stuff defined here. 29 | */ 30 | 31 | #ifndef SEEK_SET 32 | #error soloud_file_hack_on must be included after stdio, otherwise the #define hacks will break stdio. 33 | #endif 34 | 35 | typedef void* Soloud_Filehack; 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | extern int Soloud_Filehack_fgetc(Soloud_Filehack *f); 42 | extern int Soloud_Filehack_fread(void *dst, int s, int c, Soloud_Filehack *f); 43 | extern int Soloud_Filehack_fseek(Soloud_Filehack *f, int idx, int base); 44 | extern int Soloud_Filehack_ftell(Soloud_Filehack *f); 45 | extern int Soloud_Filehack_fclose(Soloud_Filehack *f); 46 | extern Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, char *aMode); 47 | extern int Soloud_Filehack_fopen_s(Soloud_Filehack **f, const char* aFilename, char* aMode); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #define FILE Soloud_Filehack 54 | #define fgetc Soloud_Filehack_fgetc 55 | #define fread Soloud_Filehack_fread 56 | #define fseek Soloud_Filehack_fseek 57 | #define ftell Soloud_Filehack_ftell 58 | #define fclose Soloud_Filehack_fclose 59 | #define fopen Soloud_Filehack_fopen 60 | #define fopen_s Soloud_Filehack_fopen_s 61 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/cereal/compact_map.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace immer::persist::detail { 8 | 9 | template 10 | struct compact_pair 11 | { 12 | K key; 13 | T value; 14 | }; 15 | 16 | template 17 | struct compact_map 18 | { 19 | immer::map& map; 20 | }; 21 | 22 | template 23 | compact_map make_compact_map(immer::map& map) 24 | { 25 | return compact_map{map}; 26 | } 27 | 28 | } // namespace immer::persist::detail 29 | 30 | namespace cereal { 31 | 32 | template 33 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, 34 | immer::persist::detail::compact_pair& m) 35 | { 36 | size_type size; 37 | ar(make_size_tag(size)); 38 | if (size != 2) { 39 | throw Exception{"A pair must be a list of 2 elements"}; 40 | } 41 | 42 | ar(m.key); 43 | ar(m.value); 44 | } 45 | 46 | template 47 | void CEREAL_SAVE_FUNCTION_NAME( 48 | Archive& ar, const immer::persist::detail::compact_pair& m) 49 | { 50 | ar(make_size_tag(static_cast(2))); 51 | ar(m.key); 52 | ar(m.value); 53 | } 54 | 55 | template 56 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, 57 | immer::persist::detail::compact_map& m) 58 | { 59 | size_type size; 60 | ar(make_size_tag(size)); 61 | m.map = {}; 62 | 63 | for (auto i = size_type{}; i < size; ++i) { 64 | auto pair = immer::persist::detail::compact_pair{}; 65 | ar(pair); 66 | 67 | m.map = 68 | std::move(m.map).set(std::move(pair.key), std::move(pair.value)); 69 | } 70 | if (size != m.map.size()) 71 | throw Exception{"duplicate ids?"}; 72 | } 73 | 74 | template 75 | void CEREAL_SAVE_FUNCTION_NAME( 76 | Archive& ar, const immer::persist::detail::compact_map& m) 77 | { 78 | ar(make_size_tag(static_cast(m.map.size()))); 79 | for (auto&& v : m.map) { 80 | ar(immer::persist::detail::compact_pair{v.first, v.second}); 81 | } 82 | } 83 | 84 | } // namespace cereal 85 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/react-imgui-reconciler/tree-printer.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Tzvetan Mikov and contributors 2 | // SPDX-License-Identifier: MIT 3 | // See LICENSE file for full license text 4 | 5 | /** 6 | * Pretty-print the tree structure to console. 7 | * This lets us visualize what React built. 8 | */ 9 | 10 | /** 11 | * Print the entire tree from a container. 12 | * 13 | * @param container - The container object from render() 14 | * @param indent - Starting indentation level (default 0) 15 | */ 16 | export function printTree(container, indent = 0) { 17 | console.log('\n=== Tree Structure ==='); 18 | 19 | if (!container.rootNode) { 20 | console.log('(empty tree)'); 21 | return; 22 | } 23 | 24 | printNode(container.rootNode, indent); 25 | console.log('======================\n'); 26 | } 27 | 28 | /** 29 | * Recursively print a node and its children. 30 | * 31 | * @param node - TreeNode or TextNode to print 32 | * @param indent - Current indentation level 33 | */ 34 | function printNode(node, indent) { 35 | const spaces = ' '.repeat(indent); 36 | 37 | if (node.text !== undefined) { 38 | // Text node 39 | console.log(`${spaces}"${node.text}"`); 40 | } else { 41 | // Element node 42 | const propsStr = formatProps(node.props); 43 | console.log(`${spaces}<${node.type}${propsStr}>`); 44 | 45 | // Print children 46 | for (const child of node.children) { 47 | printNode(child, indent + 1); 48 | } 49 | } 50 | } 51 | 52 | /** 53 | * Format props object as a string for display. 54 | * 55 | * @param props - Props object 56 | * @returns Formatted string like ' title="Hello" count="5"' 57 | */ 58 | function formatProps(props) { 59 | if (!props || Object.keys(props).length === 0) { 60 | return ''; 61 | } 62 | 63 | const parts = []; 64 | for (const [key, value] of Object.entries(props)) { 65 | // Skip children prop - it's handled separately 66 | if (key === 'children') continue; 67 | 68 | // Format the value 69 | let valueStr; 70 | if (typeof value === 'function') { 71 | valueStr = '[Function]'; 72 | } else if (typeof value === 'object') { 73 | valueStr = JSON.stringify(value); 74 | } else { 75 | valueStr = String(value); 76 | } 77 | 78 | parts.push(`${key}="${valueStr}"`); 79 | } 80 | 81 | return parts.length > 0 ? ' ' + parts.join(' ') : ''; 82 | } 83 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_QUEUE_H 26 | #define SOLOUD_QUEUE_H 27 | 28 | #include "soloud.h" 29 | 30 | #define SOLOUD_QUEUE_MAX 32 31 | 32 | namespace SoLoud 33 | { 34 | class Queue; 35 | 36 | class QueueInstance : public AudioSourceInstance 37 | { 38 | Queue *mParent; 39 | public: 40 | QueueInstance(Queue *aParent); 41 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 42 | virtual bool hasEnded(); 43 | virtual ~QueueInstance(); 44 | }; 45 | 46 | class Queue : public AudioSource 47 | { 48 | public: 49 | Queue(); 50 | virtual QueueInstance *createInstance(); 51 | // Play sound through the queue 52 | result play(AudioSource &aSound); 53 | // Number of audio sources queued for replay 54 | unsigned int getQueueCount(); 55 | // Is this audio source currently playing? 56 | bool isCurrentlyPlaying(AudioSource &aSound); 57 | // Set params by reading them from an audio source 58 | result setParamsFromAudioSource(AudioSource &aSound); 59 | // Set params manually 60 | result setParams(float aSamplerate, unsigned int aChannels = 2); 61 | 62 | public: 63 | unsigned int mReadIndex, mWriteIndex, mCount; 64 | AudioSourceInstance *mSource[SOLOUD_QUEUE_MAX]; 65 | QueueInstance *mInstance; 66 | handle mQueueHandle; 67 | void findQueueHandle(); 68 | 69 | }; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/src/audiosource/ay/sndbuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union SNDSAMPLE 4 | { 5 | unsigned sample; // left/right channels in low/high WORDs 6 | struct { unsigned short left, right; } ch; // or left/right separately 7 | }; 8 | 9 | typedef unsigned bufptr_t; 10 | class SNDRENDER; 11 | 12 | class SNDBUFFER 13 | { 14 | public: 15 | SNDBUFFER(unsigned size); 16 | ~SNDBUFFER(); 17 | 18 | void reset(); 19 | 20 | SNDSAMPLE* buffer; 21 | bufptr_t size; 22 | 23 | void count_start(); 24 | void count(const SNDRENDER& render); 25 | unsigned count_end(); 26 | 27 | unsigned count_single(const SNDRENDER& render); 28 | void get_buffers(bufptr_t& pos1, unsigned& size1, bufptr_t& pos2, unsigned& size2, unsigned count); 29 | 30 | // can read some samples starting from here, use count_start(), count(), count_end() to detect count of samples ready 31 | bufptr_t read_position; 32 | 33 | // called when application read `counts` samples from `read_position` 34 | // SNDBUFFER needs to zero buffer under read samples to continue mixing 35 | void samples_read(unsigned count); 36 | 37 | private: 38 | unsigned samples_ready; 39 | }; 40 | 41 | 42 | 43 | 44 | #if 0 // USAGE EXAMPLE 45 | 46 | #include "sndrender/*.h" 47 | 48 | SNDBUFFER buf(4096); 49 | SNDCHIP ay1(buf), ay2(buf); 50 | SNDRENDER beeper(buf); 51 | 52 | // global emulation loop 53 | for (;;) { 54 | ay1.start_frame(); 55 | ay2.start_frame(); 56 | beeper.start_frame(); 57 | 58 | // Z80 emulation before INT 59 | for (int t = 0; t < 71680; t++) { 60 | ay1.select(0); 61 | ay1.write(t, t % 100); 62 | ay2.select(3); 63 | ay2.write(t, t % 100); 64 | beeper.update(t, t % 4000, t % 400); 65 | } 66 | ay1.end_frame(t); 67 | ay2.end_frame(t); 68 | beeper.end_frame(t); 69 | 70 | buf.count_start(); 71 | buf.count(ay1); 72 | buf.count(ay2); 73 | buf.count(beeper); 74 | unsigned n_samples = buf.count_end(); 75 | 76 | bufptr_t pos1, pos2; 77 | unsigned size1, size2; 78 | buf.get_buffers(pos1, size1, pos2, size2, n_samples); 79 | 80 | wav_play(buf.buffer+pos1, size1); 81 | wav_play(buf.buffer+pos2, size2); 82 | buf.samples_read(n_samples); 83 | } 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/detail/cereal/input_archive_util.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace immer::persist::detail { 7 | 8 | template 9 | auto load_pools(std::istream& is, const WrapF& wrap) 10 | { 11 | const auto reload_pool = 12 | [wrap](std::istream& is, Pools pools, bool ignore_pool_exceptions) { 13 | auto restore = immer::util::istream_snapshot{is}; 14 | const auto original_pools = pools; 15 | auto ar = input_pools_cereal_archive_wrapper{ 19 | std::move(pools), wrap, is}; 20 | ar.ignore_pool_exceptions = ignore_pool_exceptions; 21 | /** 22 | * NOTE: Critical to clear the pools before loading into it 23 | * again. I hit a bug when pools contained a vector and every 24 | * load would append to it, instead of replacing the contents. 25 | */ 26 | pools = {}; 27 | ar(CEREAL_NVP(pools)); 28 | pools.merge_previous(original_pools); 29 | return pools; 30 | }; 31 | 32 | auto pools = Pools{}; 33 | if constexpr (detail::is_pool_empty()) { 34 | return pools; 35 | } 36 | 37 | auto prev = pools; 38 | while (true) { 39 | // Keep reloading until everything is loaded. 40 | // Reloading of the pool might trigger validation of some containers 41 | // (hash-based, for example) because the elements actually come from 42 | // other pools that are not yet loaded. 43 | constexpr bool ignore_pool_exceptions = true; 44 | pools = reload_pool(is, std::move(pools), ignore_pool_exceptions); 45 | if (prev == pools) { 46 | // Looks like we're done, reload one more time but do not ignore the 47 | // exceptions, for the final validation. 48 | pools = reload_pool(is, std::move(pools), false); 49 | break; 50 | } 51 | prev = pools; 52 | } 53 | 54 | return pools; 55 | } 56 | 57 | } // namespace immer::persist::detail 58 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_lofifilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_LOFIFILTER_H 26 | #define SOLOUD_LOFIFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class LofiFilter; 33 | 34 | struct LofiChannelData 35 | { 36 | float mSample; 37 | float mSamplesToSkip; 38 | }; 39 | 40 | class LofiFilterInstance : public FilterInstance 41 | { 42 | enum FILTERPARAMS 43 | { 44 | WET, 45 | SAMPLERATE, 46 | BITDEPTH 47 | }; 48 | LofiChannelData mChannelData[2]; 49 | 50 | LofiFilter *mParent; 51 | public: 52 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 53 | virtual ~LofiFilterInstance(); 54 | LofiFilterInstance(LofiFilter *aParent); 55 | }; 56 | 57 | class LofiFilter : public Filter 58 | { 59 | public: 60 | enum FILTERPARAMS 61 | { 62 | WET, 63 | SAMPLERATE, 64 | BITDEPTH 65 | }; 66 | float mSampleRate; 67 | float mBitdepth; 68 | virtual LofiFilterInstance *createInstance(); 69 | virtual int getParamCount(); 70 | virtual const char* getParamName(unsigned int aParamIndex); 71 | virtual unsigned int getParamType(unsigned int aParamIndex); 72 | virtual float getParamMax(unsigned int aParamIndex); 73 | virtual float getParamMin(unsigned int aParamIndex); 74 | LofiFilter(); 75 | result setParams(float aSampleRate, float aBitdepth); 76 | virtual ~LofiFilter(); 77 | }; 78 | } 79 | 80 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/errors.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace immer::persist { 10 | 11 | /** 12 | * @defgroup persist-exceptions 13 | */ 14 | 15 | /** 16 | * Base class from which all the exceptions in `immer::persist` are derived. 17 | * 18 | * @ingroup persist-exceptions 19 | */ 20 | class pool_exception : public std::invalid_argument 21 | { 22 | public: 23 | using invalid_argument::invalid_argument; 24 | }; 25 | 26 | /** 27 | * Thrown when a cycle is detected in the pool of vectors. 28 | * 29 | * @ingroup persist-exceptions 30 | */ 31 | class pool_has_cycles : public pool_exception 32 | { 33 | public: 34 | explicit pool_has_cycles(node_id id) 35 | : pool_exception{fmt::format("Cycle detected with node ID {}", id)} 36 | { 37 | } 38 | }; 39 | 40 | /** 41 | * Thrown when a non-existent node is mentioned. 42 | * 43 | * @ingroup persist-exceptions 44 | */ 45 | class invalid_node_id : public pool_exception 46 | { 47 | public: 48 | explicit invalid_node_id(node_id id) 49 | : pool_exception{fmt::format("Node ID {} is not found", id)} 50 | { 51 | } 52 | }; 53 | 54 | /** 55 | * Thrown when a non-existent container is mentioned. 56 | * 57 | * @ingroup persist-exceptions 58 | */ 59 | class invalid_container_id : public pool_exception 60 | { 61 | public: 62 | explicit invalid_container_id(container_id id) 63 | : pool_exception{fmt::format("Container ID {} is not found", id)} 64 | { 65 | } 66 | }; 67 | 68 | /** 69 | * Thrown when a node has more children than expected. 70 | * 71 | * @ingroup persist-exceptions 72 | */ 73 | class invalid_children_count : public pool_exception 74 | { 75 | public: 76 | explicit invalid_children_count(node_id id) 77 | : pool_exception{ 78 | fmt::format("Node ID {} has more children than allowed", id)} 79 | { 80 | } 81 | }; 82 | 83 | /** 84 | * Thrown when duplicate pool name is detected. 85 | * 86 | * @ingroup persist-exceptions 87 | */ 88 | class duplicate_name_pool_detected : public pool_exception 89 | { 90 | public: 91 | explicit duplicate_name_pool_detected(const std::string& pool_name) 92 | : pool_exception{ 93 | fmt::format("{} pool name has already been used", pool_name)} 94 | { 95 | } 96 | }; 97 | 98 | } // namespace immer::persist 99 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_eqfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_EQFILTER_H 26 | #define SOLOUD_EQFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_fftfilter.h" 30 | 31 | namespace SoLoud 32 | { 33 | class EqFilter; 34 | 35 | class EqFilterInstance : public FFTFilterInstance 36 | { 37 | enum FILTERATTRIBUTE 38 | { 39 | WET = 0, 40 | BAND1 = 1, 41 | BAND2 = 2, 42 | BAND3 = 3, 43 | BAND4 = 4, 44 | BAND5 = 5, 45 | BAND6 = 6, 46 | BAND7 = 7, 47 | BAND8 = 8 48 | }; 49 | EqFilter *mParent; 50 | public: 51 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 52 | EqFilterInstance(EqFilter *aParent); 53 | }; 54 | 55 | class EqFilter : public FFTFilter 56 | { 57 | public: 58 | enum FILTERATTRIBUTE 59 | { 60 | WET = 0, 61 | BAND1 = 1, 62 | BAND2 = 2, 63 | BAND3 = 3, 64 | BAND4 = 4, 65 | BAND5 = 5, 66 | BAND6 = 6, 67 | BAND7 = 7, 68 | BAND8 = 8 69 | }; 70 | virtual int getParamCount(); 71 | virtual const char* getParamName(unsigned int aParamIndex); 72 | virtual unsigned int getParamType(unsigned int aParamIndex); 73 | virtual float getParamMax(unsigned int aParamIndex); 74 | virtual float getParamMin(unsigned int aParamIndex); 75 | float mVolume[8]; 76 | result setParam(unsigned int aBand, float aVolume); 77 | virtual FilterInstance *createInstance(); 78 | EqFilter(); 79 | }; 80 | } 81 | 82 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/extra/persist/cereal/load.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace immer::persist { 9 | 10 | /** 11 | * @brief Load a value of the given type `T` from the provided stream using 12 | * pools. By default, `cereal::JSONInputArchive` is used but a different 13 | * `cereal` input archive can be provided. 14 | * 15 | * @ingroup persist-api 16 | */ 17 | template 21 | T cereal_load_with_pools(std::istream& is, 22 | const Policy& policy = Policy{}, 23 | Args&&... args) 24 | { 25 | using TypesSet = 26 | decltype(boost::hana::to_set(policy.get_pool_types(std::declval()))); 27 | using Pools = decltype(detail::generate_input_pools(TypesSet{})); 28 | 29 | using PoolNameFn = get_pool_name_fn_t; 30 | 31 | const auto wrap = 32 | detail::wrap_known_types(TypesSet{}, detail::wrap_for_loading); 33 | auto pools = load_pools(is, wrap); 34 | 35 | auto ar = immer::persist::input_pools_cereal_archive_wrapper{ 39 | std::move(pools), wrap, is, std::forward(args)...}; 40 | auto value0 = T{}; 41 | policy.load(ar, value0); 42 | return value0; 43 | } 44 | 45 | /** 46 | * @brief Load a value of the given type `T` from the provided string using 47 | * pools. By default, `cereal::JSONInputArchive` is used but a different 48 | * `cereal` input archive can be provided. 49 | * 50 | * @ingroup persist-api 51 | */ 52 | template 55 | T cereal_load_with_pools(const std::string& input, 56 | const Policy& policy = Policy{}) 57 | { 58 | auto is = std::istringstream{input}; 59 | return cereal_load_with_pools(is, policy); 60 | } 61 | 62 | } // namespace immer::persist 63 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_fftfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FFTFILTER_H 26 | #define SOLOUD_FFTFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class FFTFilter; 33 | 34 | class FFTFilterInstance : public FilterInstance 35 | { 36 | float *mTemp; 37 | float *mInputBuffer; 38 | float *mMixBuffer; 39 | float *mLastPhase; 40 | float *mSumPhase; 41 | unsigned int mInputOffset[MAX_CHANNELS]; 42 | unsigned int mMixOffset[MAX_CHANNELS]; 43 | unsigned int mReadOffset[MAX_CHANNELS]; 44 | FFTFilter *mParent; 45 | public: 46 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 47 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 48 | virtual ~FFTFilterInstance(); 49 | FFTFilterInstance(FFTFilter *aParent); 50 | FFTFilterInstance(); 51 | void comp2MagPhase(float* aFFTBuffer, unsigned int aSamples); 52 | void magPhase2MagFreq(float* aFFTBuffer, unsigned int aSamples, float aSamplerate, unsigned int aChannel); 53 | void magFreq2MagPhase(float* aFFTBuffer, unsigned int aSamples, float aSamplerate, unsigned int aChannel); 54 | void magPhase2Comp(float* aFFTBuffer, unsigned int aSamples); 55 | void init(); 56 | }; 57 | 58 | class FFTFilter : public Filter 59 | { 60 | public: 61 | virtual FilterInstance *createInstance(); 62 | FFTFilter(); 63 | }; 64 | } 65 | 66 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/lib/native/immer/heap/debug_size_heap.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // immer: immutable data structures for C++ 3 | // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente 4 | // 5 | // This software is distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace immer { 21 | 22 | #if IMMER_ENABLE_DEBUG_SIZE_HEAP 23 | 24 | /*! 25 | * A heap that in debug mode ensures that the sizes for allocation and 26 | * deallocation do match. 27 | */ 28 | template 29 | struct debug_size_heap 30 | { 31 | #if defined(__MINGW32__) && !defined(__MINGW64__) 32 | // There is a bug in MinGW 32bit: 33 | // https://sourceforge.net/p/mingw-w64/bugs/778/ It causes different 34 | // versions of std::max_align_t to be defined, depending on inclusion order 35 | // of stddef.h and stdint.h. As we have no control over the inclusion order 36 | // here (as it might be set in stone by the outside world), we can't easily 37 | // pin it to one of both versions of std::max_align_t. This means, we have 38 | // to hardcode extra_size for MinGW 32bit builds until the mentioned bug is 39 | // fixed. 40 | constexpr static auto extra_size = 8; 41 | #else 42 | constexpr static auto extra_size = 43 | sizeof(detail::aligned_storage_t); 45 | #endif 46 | 47 | template 48 | static void* allocate(std::size_t size, Tags... tags) 49 | { 50 | auto p = (std::size_t*) Base::allocate(size + extra_size, tags...); 51 | new (p) std::size_t{size}; 52 | return ((char*) p) + extra_size; 53 | } 54 | 55 | template 56 | static void deallocate(std::size_t size, void* data, Tags... tags) 57 | { 58 | auto p = (std::size_t*) (((char*) data) - extra_size); 59 | assert(*p == size); 60 | Base::deallocate(size + extra_size, p, tags...); 61 | } 62 | }; 63 | 64 | #else // IMMER_ENABLE_DEBUG_SIZE_HEAP 65 | 66 | template 67 | using debug_size_heap = identity_heap; 68 | 69 | #endif // !IMMER_ENABLE_DEBUG_SIZE_HEAP 70 | 71 | } // namespace immer 72 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_speech.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | #ifndef SOLOUD_SPEECH_H 25 | #define SOLOUD_SPEECH_H 26 | 27 | #include "soloud.h" 28 | #include "../src/audiosource/speech/darray.h" 29 | #include "../src/audiosource/speech/klatt.h" 30 | #include "../src/audiosource/speech/tts.h" 31 | 32 | namespace SoLoud 33 | { 34 | class Speech; 35 | 36 | class Speech : public AudioSource 37 | { 38 | // copy of the enum in klatt.h for codegen purposes 39 | enum KLATT_WAVEFORM 40 | { 41 | KW_SAW, 42 | KW_TRIANGLE, 43 | KW_SIN, 44 | KW_SQUARE, 45 | KW_PULSE, 46 | KW_NOISE, 47 | KW_WARBLE 48 | }; 49 | public: 50 | int mBaseFrequency; 51 | float mBaseSpeed; 52 | float mBaseDeclination; 53 | int mBaseWaveform; 54 | int mFrames; 55 | darray mElement; 56 | Speech(); 57 | result setText(const char *aText); 58 | result setParams(unsigned int aBaseFrequency = 1330, float aBaseSpeed = 10.0f, float aBaseDeclination = 0.5f, int aBaseWaveform = KW_TRIANGLE); 59 | virtual ~Speech(); 60 | virtual AudioSourceInstance *createInstance(); 61 | }; 62 | 63 | class SpeechInstance : public AudioSourceInstance 64 | { 65 | klatt mSynth; 66 | Speech *mParent; 67 | short *mSample; 68 | int mSampleCount; 69 | int mOffset; 70 | public: 71 | SpeechInstance(Speech *aParent); 72 | virtual ~SpeechInstance(); 73 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 74 | virtual result rewind(); 75 | virtual bool hasEnded(); 76 | }; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /imgui-react-runtime/external/soloud/include/soloud_freeverbfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FREEVERBFILTER_H 26 | #define SOLOUD_FREEVERBFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class FreeverbFilter; 33 | namespace FreeverbImpl 34 | { 35 | class Revmodel; 36 | } 37 | 38 | class FreeverbFilterInstance : public FilterInstance 39 | { 40 | enum FILTERPARAM { 41 | WET = 0, 42 | FREEZE, 43 | ROOMSIZE, 44 | DAMP, 45 | WIDTH 46 | }; 47 | 48 | FreeverbFilter *mParent; 49 | FreeverbImpl::Revmodel *mModel; 50 | public: 51 | virtual void filter(float* aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 52 | virtual ~FreeverbFilterInstance(); 53 | FreeverbFilterInstance(FreeverbFilter *aParent); 54 | }; 55 | 56 | class FreeverbFilter : public Filter 57 | { 58 | public: 59 | enum FILTERPARAM { 60 | WET = 0, 61 | FREEZE, 62 | ROOMSIZE, 63 | DAMP, 64 | WIDTH 65 | }; 66 | virtual int getParamCount(); 67 | virtual const char* getParamName(unsigned int aParamIndex); 68 | virtual unsigned int getParamType(unsigned int aParamIndex); 69 | virtual float getParamMax(unsigned int aParamIndex); 70 | virtual float getParamMin(unsigned int aParamIndex); 71 | 72 | float mMode; 73 | float mRoomSize; 74 | float mDamp; 75 | float mWidth; 76 | virtual FreeverbFilterInstance *createInstance(); 77 | FreeverbFilter(); 78 | result setParams(float aMode, float aRoomSize, float aDamp, float aWidth); 79 | virtual ~FreeverbFilter(); 80 | }; 81 | } 82 | 83 | #endif -------------------------------------------------------------------------------- /imgui-react-runtime/LICENSE_stb: -------------------------------------------------------------------------------- 1 | This software is available under 2 licenses -- choose whichever you prefer. 2 | ------------------------------------------------------------------------------ 3 | ALTERNATIVE A - MIT License 4 | Copyright (c) 2017 Sean Barrett 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 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 THE 19 | SOFTWARE. 20 | ------------------------------------------------------------------------------ 21 | ALTERNATIVE B - Public Domain (www.unlicense.org) 22 | This is free and unencumbered software released into the public domain. 23 | Anyone is free to copy, modify, publish, use, compile, sell, or distribute this 24 | software, either in source code form or as a compiled binary, for any purpose, 25 | commercial or non-commercial, and by any means. 26 | In jurisdictions that recognize copyright laws, the author or authors of this 27 | software dedicate any and all copyright interest in the software to the public 28 | domain. We make this dedication for the benefit of the public at large and to 29 | the detriment of our heirs and successors. We intend this dedication to be an 30 | overt act of relinquishment in perpetuity of all present and future rights to 31 | this software under copyright law. 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 36 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 37 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 | --------------------------------------------------------------------------------