├── .gitattributes ├── .gitignore ├── LICENSE ├── examples ├── cpp │ ├── .gitignore │ ├── zefir_cpp_example.sln │ └── zefir_cpp_example │ │ ├── dllmain.cpp │ │ ├── framework.h │ │ ├── pch.cpp │ │ ├── pch.h │ │ ├── zefir_cpp_example.vcxproj │ │ └── zefir_cpp_example.vcxproj.filters └── zig │ ├── .gitignore │ ├── build.zig │ ├── build.zig.zon │ └── src │ ├── dllmain.zig │ └── winxtra.zig └── include └── zefir_ui_api.h /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2025, adafcaefc 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /examples/cpp/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 298 | *.vbp 299 | 300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 301 | *.dsw 302 | *.dsp 303 | 304 | # Visual Studio 6 technical files 305 | *.ncb 306 | *.aps 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # Visual Studio History (VSHistory) files 365 | .vshistory/ 366 | 367 | # BeatPulse healthcheck temp database 368 | healthchecksdb 369 | 370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 371 | MigrationBackup/ 372 | 373 | # Ionide (cross platform F# VS Code tools) working folder 374 | .ionide/ 375 | 376 | # Fody - auto-generated XML schema 377 | FodyWeavers.xsd 378 | 379 | # VS Code files for those working on multiple tools 380 | .vscode/* 381 | !.vscode/settings.json 382 | !.vscode/tasks.json 383 | !.vscode/launch.json 384 | !.vscode/extensions.json 385 | *.code-workspace 386 | 387 | # Local History for Visual Studio Code 388 | .history/ 389 | 390 | # Windows Installer files from build outputs 391 | *.cab 392 | *.msi 393 | *.msix 394 | *.msm 395 | *.msp 396 | 397 | # JetBrains Rider 398 | *.sln.iml -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.13.35931.197 d17.13 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zefir_cpp_example", "zefir_cpp_example\zefir_cpp_example.vcxproj", "{903A2837-8785-49E6-8E28-F2B3F194A2E8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Debug|x64.ActiveCfg = Debug|x64 17 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Debug|x64.Build.0 = Debug|x64 18 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Debug|x86.ActiveCfg = Debug|Win32 19 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Debug|x86.Build.0 = Debug|Win32 20 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Release|x64.ActiveCfg = Release|x64 21 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Release|x64.Build.0 = Release|x64 22 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Release|x86.ActiveCfg = Release|Win32 23 | {903A2837-8785-49E6-8E28-F2B3F194A2E8}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {6C50B895-3D5D-4854-8A4F-61CC0FD11126} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "pch.h" 3 | #include "../../../include/zefir_ui_api.h" 4 | 5 | #ifdef __cplusplus 6 | 7 | static void ZEFIR_CALLBACK showMessageBoxCpp() 8 | { 9 | zefir::api::popup::text({ 10 | .m_title = "Cpp Popup", 11 | .m_text = "Hello from C++", 12 | .m_alignment = {.m_value = Zefir_TextBlock_Alignment_Center, .m_hasValue = true} }); 13 | } 14 | 15 | static void ZEFIR_CALLBACK renderContentCpp() 16 | { 17 | zefir::api::cm::text("Hello from C++"); 18 | zefir::api::cm::text("This is a test window"); 19 | 20 | zefir::api::cm::button({ 21 | .m_uniqueId = ZEFIR_NEW_UID(), 22 | .m_label = "Click me", 23 | .m_onActivate = {.m_value = &showMessageBoxCpp, .m_hasValue = true} }); 24 | } 25 | 26 | static void ZEFIR_CALLBACK addWindowCpp() 27 | { 28 | zefir::api::window::add({ 29 | .m_id = "CppTest.TestWindowCpp", 30 | .m_title = "CPP Window", 31 | .m_onRenderContent = {.m_value = &renderContentCpp, .m_hasValue = true} }); 32 | } 33 | 34 | #endif 35 | 36 | static void ZEFIR_CALLBACK showMessageBoxC() 37 | { 38 | Zefir_MessageBoxTextData data{ 39 | .m_title = "C Popup", 40 | .m_text = "Hello from C! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 41 | .m_customWidth = {.m_value = 450, .m_hasValue = true}, 42 | .m_alignment = {.m_value = Zefir_TextBlock_Alignment_Left, .m_hasValue = true} }; 43 | 44 | Zefir_openMessageBoxText(&data); 45 | } 46 | 47 | static void ZEFIR_CALLBACK renderContentC() 48 | { 49 | Zefir_renderText("Hello from C!"); 50 | Zefir_renderText("This is a test of the C API."); 51 | 52 | Zefir_ButtonData data{ 53 | .m_uniqueId = ZEFIR_NEW_UID(), 54 | .m_label = "Click me", 55 | .m_onActivate = {.m_value = &showMessageBoxC, .m_hasValue = true} }; 56 | 57 | Zefir_renderButton(&data); 58 | } 59 | 60 | static void ZEFIR_CALLBACK addWindowC() 61 | { 62 | Zefir_WindowData windowData = { 63 | .m_id = "CppTest.TestWindowC", 64 | .m_title = "C Window", 65 | .m_onRenderContent = {.m_value = &renderContentC, .m_hasValue = true} }; 66 | 67 | Zefir_addWindow(&windowData); 68 | } 69 | 70 | DWORD WINAPI mainThread(LPVOID lpParam) 71 | { 72 | if (Zefir_initializeAPI_Create("ToastedMarshmellow.dll")) 73 | { 74 | # ifdef __cplusplus 75 | addWindowCpp(); 76 | # endif 77 | addWindowC(); 78 | } 79 | return S_OK; 80 | } 81 | 82 | BOOL APIENTRY DllMain(HMODULE hModule, 83 | DWORD ul_reason_for_call, 84 | LPVOID lpReserved 85 | ) 86 | { 87 | switch (ul_reason_for_call) 88 | { 89 | case DLL_PROCESS_ATTACH: 90 | CreateThread(NULL, 0, mainThread, NULL, 0, NULL); 91 | break; 92 | case DLL_THREAD_ATTACH: 93 | break; 94 | case DLL_THREAD_DETACH: 95 | break; 96 | case DLL_PROCESS_DETACH: 97 | break; 98 | } 99 | return TRUE; 100 | } 101 | 102 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/zefir_cpp_example.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 17.0 23 | Win32Proj 24 | {903a2837-8785-49e6-8e28-f2b3f194a2e8} 25 | zefircppexample 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | WIN32;_DEBUG;ZEFIRCPPEXAMPLE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 78 | true 79 | Use 80 | pch.h 81 | stdcpp20 82 | 83 | 84 | Windows 85 | true 86 | false 87 | 88 | 89 | 90 | 91 | Level3 92 | true 93 | true 94 | true 95 | WIN32;NDEBUG;ZEFIRCPPEXAMPLE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 96 | true 97 | Use 98 | pch.h 99 | stdcpp20 100 | 101 | 102 | Windows 103 | true 104 | true 105 | true 106 | false 107 | 108 | 109 | 110 | 111 | Level3 112 | true 113 | _DEBUG;ZEFIRCPPEXAMPLE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 114 | true 115 | Use 116 | pch.h 117 | stdcpp20 118 | 119 | 120 | Windows 121 | true 122 | false 123 | 124 | 125 | 126 | 127 | Level3 128 | true 129 | true 130 | true 131 | NDEBUG;ZEFIRCPPEXAMPLE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 132 | true 133 | Use 134 | pch.h 135 | stdcpp20 136 | 137 | 138 | Windows 139 | true 140 | true 141 | true 142 | false 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | Create 153 | Create 154 | Create 155 | Create 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /examples/cpp/zefir_cpp_example/zefir_cpp_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/zig/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Build artifacts 3 | *.o 4 | *.exe 5 | *.dll 6 | *.so 7 | *.dylib 8 | *.a 9 | *.lib 10 | *.obj 11 | 12 | # Zig build files 13 | zig-out/ 14 | 15 | # Zig cache files 16 | .zig-cache/ 17 | *.zig-cache 18 | *.zig-cache-* -------------------------------------------------------------------------------- /examples/zig/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn build(b: *std.Build) void { 4 | const target = b.standardTargetOptions(.{}); 5 | const optimize = .ReleaseFast; 6 | const dll = b.addSharedLibrary(.{ 7 | .name = "dllmain", 8 | .root_source_file = b.path("src/dllmain.zig"), 9 | .target = target, 10 | .optimize = optimize, 11 | }); 12 | dll.addIncludePath(b.path("../../include")); 13 | dll.linkLibC(); 14 | b.installArtifact(dll); 15 | } 16 | -------------------------------------------------------------------------------- /examples/zig/build.zig.zon: -------------------------------------------------------------------------------- 1 | .{ 2 | .name = .zefir_zig_example, 3 | .version = "1.0.0", 4 | .fingerprint = 0x7c9c31e753b2d6ed, 5 | .minimum_zig_version = "0.14.0", 6 | .dependencies = .{}, 7 | .paths = .{ "build.zig", "build.zig.zon", "src" }, 8 | } 9 | -------------------------------------------------------------------------------- /examples/zig/src/dllmain.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const windows = std.os.windows; 3 | const winxtra = @import("winxtra.zig"); 4 | 5 | const c = @cImport({ 6 | @cInclude("zefir_ui_api.h"); 7 | }); 8 | 9 | fn hashSourceLocation(comptime loc: std.builtin.SourceLocation) comptime_int { 10 | var hasher = std.hash.Fnv1a_64.init(); 11 | hasher.update(loc.module); 12 | hasher.update(loc.file); 13 | hasher.update(loc.fn_name); 14 | hasher.update(std.mem.asBytes(&loc.line)); 15 | hasher.update(std.mem.asBytes(&loc.column)); 16 | return hasher.final(); 17 | } 18 | 19 | // Callback for button activation 20 | fn buttonOnActivate() callconv(std.builtin.CallingConvention.winapi) void { 21 | // Set up message box data 22 | var messageBoxData = std.mem.zeroInit(c.Zefir_MessageBoxTextData, .{ .m_title = "Button Released".ptr, .m_text = "Button was released".ptr, .m_alignment = .{ 23 | .m_value = c.Zefir_TextBlock_Alignment_Left, 24 | .m_hasValue = true, 25 | } }); 26 | // Open message box 27 | _ = c.Zefir_openMessageBoxText.?(&messageBoxData); 28 | } 29 | 30 | // Callback for rendering window content 31 | fn renderContent() callconv(std.builtin.CallingConvention.winapi) void { 32 | // Render a button 33 | var buttonData = std.mem.zeroInit(c.Zefir_ButtonData, .{ 34 | .m_uniqueId = comptime hashSourceLocation(@src()), 35 | .m_label = "Test Button".ptr, 36 | .m_info = .{ 37 | .m_value = "This is a test button".ptr, 38 | .m_hasValue = true, 39 | }, 40 | .m_onActivate = .{ 41 | .m_value = buttonOnActivate, 42 | .m_hasValue = true, 43 | }, 44 | }); 45 | 46 | // Render the button 47 | _ = c.Zefir_renderButton.?(&buttonData); 48 | } 49 | 50 | fn mainEntry(_: windows.LPVOID) callconv(std.builtin.CallingConvention.winapi) windows.DWORD { 51 | // Initialize the Zefir API 52 | // Replace "ToastedMarshmellow.dll" with the name of the zefir UI DLL you want to use 53 | const success = c.Zefir_initializeAPI_Create("ToastedMarshmellow.dll"); 54 | if (success) { 55 | var windowData = std.mem.zeroInit(c.Zefir_WindowData, .{ 56 | .m_id = "ZigTest.TestWindow".ptr, 57 | .m_title = "Zig Window".ptr, 58 | .m_onRenderContent = .{ 59 | .m_value = renderContent, 60 | .m_hasValue = true, 61 | }, 62 | }); 63 | 64 | // Add the window 65 | _ = c.Zefir_addWindow.?(&windowData); 66 | } 67 | return std.os.windows.S_OK; 68 | } 69 | 70 | pub fn DllMain( 71 | _: windows.HINSTANCE, 72 | fdwReason: windows.DWORD, 73 | _: windows.LPVOID, 74 | ) callconv(std.builtin.CallingConvention.winapi) windows.BOOL { 75 | switch (fdwReason) { 76 | winxtra.DLL_PROCESS_ATTACH => { 77 | _ = winxtra.CreateThread(null, 0, mainEntry, null, 0, null); 78 | }, 79 | winxtra.DLL_PROCESS_DETACH => {}, 80 | winxtra.DLL_THREAD_ATTACH => {}, 81 | winxtra.DLL_THREAD_DETACH => {}, 82 | else => {}, 83 | } 84 | 85 | return windows.TRUE; 86 | } 87 | -------------------------------------------------------------------------------- /examples/zig/src/winxtra.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const windows = std.os.windows; 3 | 4 | pub extern "kernel32" fn CreateThread( 5 | lpThreadAttributes: ?*windows.SECURITY_ATTRIBUTES, 6 | dwStackSize: usize, 7 | lpStartAddress: *const fn (windows.LPVOID) callconv(std.builtin.CallingConvention.winapi) windows.DWORD, 8 | lpParameter: ?*anyopaque, 9 | dwCreationFlags: windows.DWORD, 10 | lpThreadId: ?*windows.DWORD, 11 | ) callconv(std.builtin.CallingConvention.winapi) windows.HANDLE; 12 | 13 | pub const DLL_PROCESS_ATTACH: windows.DWORD = 1; 14 | pub const DLL_PROCESS_DETACH: windows.DWORD = 0; 15 | pub const DLL_THREAD_ATTACH: windows.DWORD = 2; 16 | pub const DLL_THREAD_DETACH: windows.DWORD = 3; 17 | 18 | pub const VK_LBUTTON = 0x01; 19 | pub const VK_RBUTTON = 0x02; 20 | pub const VK_TAB = 0x09; 21 | pub const VK_ESCAPE = 0x1B; 22 | pub const VK_LEFT = 0x25; 23 | pub const VK_UP = 0x26; 24 | pub const VK_RIGHT = 0x27; 25 | pub const VK_DOWN = 0x28; 26 | pub const VK_PRIOR = 0x21; 27 | pub const VK_NEXT = 0x22; 28 | pub const VK_END = 0x23; 29 | pub const VK_HOME = 0x24; 30 | pub const VK_DELETE = 0x2E; 31 | pub const VK_BACK = 0x08; 32 | pub const VK_RETURN = 0x0D; 33 | pub const VK_CONTROL = 0x11; 34 | pub const VK_SHIFT = 0x10; 35 | pub const VK_MENU = 0x12; 36 | pub const VK_SPACE = 0x20; 37 | pub const VK_INSERT = 0x2D; 38 | pub const VK_LSHIFT = 0xA0; 39 | pub const VK_RSHIFT = 0xA1; 40 | pub const VK_LCONTROL = 0xA2; 41 | pub const VK_RCONTROL = 0xA3; 42 | pub const VK_LMENU = 0xA4; 43 | pub const VK_RMENU = 0xA5; 44 | pub const VK_LWIN = 0x5B; 45 | pub const VK_RWIN = 0x5C; 46 | pub const VK_APPS = 0x5D; 47 | pub const VK_OEM_1 = 0xBA; 48 | pub const VK_OEM_PLUS = 0xBB; 49 | pub const VK_OEM_COMMA = 0xBC; 50 | pub const VK_OEM_MINUS = 0xBD; 51 | pub const VK_OEM_PERIOD = 0xBE; 52 | pub const VK_OEM_2 = 0xBF; 53 | pub const VK_OEM_3 = 0xC0; 54 | pub const VK_OEM_4 = 0xDB; 55 | pub const VK_OEM_5 = 0xDC; 56 | pub const VK_OEM_6 = 0xDD; 57 | pub const VK_OEM_7 = 0xDE; 58 | pub const VK_CAPITAL = 0x14; 59 | pub const VK_SCROLL = 0x91; 60 | pub const VK_NUMLOCK = 0x90; 61 | pub const VK_SNAPSHOT = 0x2C; 62 | pub const VK_PAUSE = 0x13; 63 | pub const VK_NUMPAD0 = 0x60; 64 | pub const VK_NUMPAD1 = 0x61; 65 | pub const VK_NUMPAD2 = 0x62; 66 | pub const VK_NUMPAD3 = 0x63; 67 | pub const VK_NUMPAD4 = 0x64; 68 | pub const VK_NUMPAD5 = 0x65; 69 | pub const VK_NUMPAD6 = 0x66; 70 | pub const VK_NUMPAD7 = 0x67; 71 | pub const VK_NUMPAD8 = 0x68; 72 | pub const VK_NUMPAD9 = 0x69; 73 | pub const VK_MULTIPLY = 0x6A; 74 | pub const VK_ADD = 0x6B; 75 | pub const VK_SEPARATOR = 0x6C; 76 | pub const VK_SUBTRACT = 0x6D; 77 | pub const VK_DECIMAL = 0x6E; 78 | pub const VK_DIVIDE = 0x6F; 79 | pub const VK_F1 = 0x70; 80 | pub const VK_F2 = 0x71; 81 | pub const VK_F3 = 0x72; 82 | pub const VK_F4 = 0x73; 83 | pub const VK_F5 = 0x74; 84 | pub const VK_F6 = 0x75; 85 | pub const VK_F7 = 0x76; 86 | pub const VK_F8 = 0x77; 87 | pub const VK_F9 = 0x78; 88 | pub const VK_F10 = 0x79; 89 | pub const VK_F11 = 0x7A; 90 | pub const VK_F12 = 0x7B; 91 | -------------------------------------------------------------------------------- /include/zefir_ui_api.h: -------------------------------------------------------------------------------- 1 | #ifndef ZEFIR_UI_API_H 2 | #define ZEFIR_UI_API_H 3 | 4 | #define WIN32_LEAN_AND_MEAN 5 | #define NOMINMAX 6 | #include 7 | #include 8 | #include 9 | 10 | #define ZEFIR_CALLCONV WINAPI 11 | #define ZEFIR_CALLBACK ZEFIR_CALLCONV 12 | 13 | #define ZEFIR_EXPORT __declspec(dllexport) 14 | #define ZEFIR_IMPORT __declspec(dllimport) 15 | #define ZEFIR_DLL ZEFIR_IMPORT 16 | 17 | #define ZEFIR_API(type) ZEFIR_DLL type ZEFIR_CALLCONV 18 | 19 | typedef uint64_t Zefir_UId64; 20 | typedef void* Zefir_PImFont; 21 | 22 | /* Define TextBlock alignment enum */ 23 | 24 | typedef enum { 25 | Zefir_TextBlock_Alignment_Left, 26 | Zefir_TextBlock_Alignment_Center, 27 | Zefir_TextBlock_Alignment_Right, 28 | Zefir_TextBlock_Alignment_Justify 29 | } Zefir_TextBlock_Alignment; 30 | 31 | /* Define ImVec4 and ImVec2 structures */ 32 | 33 | typedef struct { 34 | float x, y, z, w; 35 | } Zefir_ImVec4; 36 | 37 | typedef struct { 38 | float x, y; 39 | } Zefir_ImVec2; 40 | 41 | /* Define optional structures */ 42 | 43 | typedef struct { 44 | int m_value; 45 | bool m_hasValue; 46 | } Zefir_Optional_Int; 47 | 48 | typedef struct { 49 | bool m_value; 50 | bool m_hasValue; 51 | } Zefir_Optional_Bool; 52 | 53 | typedef struct { 54 | Zefir_TextBlock_Alignment m_value; 55 | bool m_hasValue; 56 | } Zefir_Optional_TextBlock_Alignment; 57 | 58 | typedef struct { 59 | float m_value; 60 | bool m_hasValue; 61 | } Zefir_Optional_Float; 62 | 63 | typedef struct { 64 | const char* m_value; 65 | bool m_hasValue; 66 | } Zefir_Optional_String; 67 | 68 | typedef struct { 69 | uint8_t* m_value; 70 | bool m_hasValue; 71 | } Zefir_Optional_PUInt8; 72 | 73 | typedef struct { 74 | bool* m_value; 75 | bool m_hasValue; 76 | } Zefir_Optional_PBool; 77 | 78 | typedef struct { 79 | uint8_t m_value; 80 | bool m_hasValue; 81 | } Zefir_Optional_UInt8; 82 | 83 | typedef struct { 84 | Zefir_PImFont m_value; 85 | bool m_hasValue; 86 | } Zefir_Optional_PImFont; 87 | 88 | typedef struct { 89 | Zefir_ImVec4 m_value; 90 | bool m_hasValue; 91 | } Zefir_Optional_ImVec4; 92 | 93 | typedef struct { 94 | void (ZEFIR_CALLBACK* m_value)(void); 95 | bool m_hasValue; 96 | } Zefir_Optional_ZefirCallback; 97 | 98 | typedef struct { 99 | void (ZEFIR_CALLBACK* m_value)(int); 100 | bool m_hasValue; 101 | } Zefir_Optional_ZefirCallback_Int; 102 | 103 | typedef struct { 104 | void (ZEFIR_CALLBACK* m_value)(const char*); 105 | bool m_hasValue; 106 | } Zefir_Optional_ZefirCallback_String; 107 | 108 | typedef struct { 109 | void (ZEFIR_CALLBACK* m_value)(float); 110 | bool m_hasValue; 111 | } Zefir_Optional_ZefirCallback_Float; 112 | 113 | /* Data structure for Button parameters */ 114 | 115 | typedef struct { 116 | Zefir_UId64 m_uniqueId; 117 | const char* m_label; 118 | Zefir_Optional_PUInt8 m_key; 119 | Zefir_Optional_String m_info; 120 | Zefir_Optional_PImFont m_customInfoFont; 121 | Zefir_Optional_ZefirCallback m_onActivate; 122 | Zefir_Optional_ZefirCallback m_onHotkeySet; 123 | Zefir_Optional_ZefirCallback m_renderPopup; 124 | } Zefir_ButtonData; 125 | 126 | /* Data structure for Checkbox parameters */ 127 | 128 | typedef struct { 129 | Zefir_UId64 m_uniqueId; 130 | const char* m_label; 131 | bool* m_value; 132 | Zefir_Optional_PUInt8 m_key; 133 | Zefir_Optional_String m_info; 134 | Zefir_Optional_PImFont m_customInfoFont; 135 | Zefir_Optional_ZefirCallback m_onActivate; 136 | Zefir_Optional_ZefirCallback m_onHotkeySet; 137 | Zefir_Optional_ZefirCallback m_renderPopup; 138 | Zefir_Optional_String m_popupTitle; 139 | Zefir_Optional_Float m_popupWidth; 140 | } Zefir_CheckboxData; 141 | 142 | /* Data structure for ColorPicker parameters */ 143 | 144 | typedef struct { 145 | Zefir_UId64 m_uniqueId; 146 | const char* m_label; 147 | Zefir_ImVec4* m_colorValue; 148 | Zefir_Optional_PBool m_value; 149 | Zefir_Optional_PUInt8 m_key; 150 | Zefir_Optional_String m_info; 151 | Zefir_Optional_PImFont m_customInfoFont; 152 | Zefir_Optional_ZefirCallback m_onActivate; 153 | Zefir_Optional_ZefirCallback m_onColorPick; 154 | Zefir_Optional_ZefirCallback m_onHotkeySet; 155 | Zefir_Optional_ZefirCallback m_renderPopup; 156 | Zefir_Optional_String m_popupTitle; 157 | Zefir_Optional_Float m_popupWidth; 158 | } Zefir_ColorPickerData; 159 | 160 | /* Data structure for HintedColorPicker parameters */ 161 | 162 | typedef struct { 163 | Zefir_UId64 m_uniqueId; 164 | const char* m_label; 165 | Zefir_ImVec4* m_colorValue; 166 | const char** m_hintKeys; /* Array of hint keys */ 167 | Zefir_ImVec4* m_hintValues; /* Array of hint values */ 168 | size_t m_hintCount; /* Number of hints */ 169 | Zefir_Optional_PBool m_value; 170 | Zefir_Optional_PUInt8 m_key; 171 | Zefir_Optional_String m_info; 172 | Zefir_Optional_PImFont m_customInfoFont; 173 | Zefir_Optional_ZefirCallback m_onActivate; 174 | Zefir_Optional_ZefirCallback m_onColorPick; 175 | Zefir_Optional_ZefirCallback m_onHotkeySet; 176 | Zefir_Optional_ZefirCallback m_renderPopup; 177 | Zefir_Optional_String m_popupTitle; 178 | Zefir_Optional_Float m_popupWidth; 179 | Zefir_Optional_ZefirCallback m_onSelectHint; 180 | } Zefir_HintedColorPickerData; 181 | 182 | /* Data structure for Listbox parameters */ 183 | 184 | typedef struct { 185 | Zefir_UId64 m_uniqueId; 186 | const char** m_list; /* Array of strings */ 187 | size_t m_listCount; /* Number of items in list */ 188 | uint8_t* m_value; 189 | Zefir_Optional_ZefirCallback m_onActivate; 190 | Zefir_Optional_ZefirCallback m_onRelease; 191 | } Zefir_ListboxData; 192 | 193 | /* Data structure for InputInt parameters */ 194 | 195 | typedef struct { 196 | Zefir_UId64 m_uniqueId; 197 | const char* m_label; 198 | int* m_value; 199 | Zefir_Optional_Float m_speed; 200 | Zefir_Optional_Int m_min; 201 | Zefir_Optional_Int m_max; 202 | Zefir_Optional_ZefirCallback m_onActive; 203 | Zefir_Optional_ZefirCallback m_onRelease; 204 | } Zefir_InputIntData; 205 | 206 | /* Data structure for InputFloat parameters */ 207 | 208 | typedef struct { 209 | Zefir_UId64 m_uniqueId; 210 | const char* m_label; 211 | float* m_value; 212 | Zefir_Optional_Float m_speed; 213 | Zefir_Optional_Float m_min; 214 | Zefir_Optional_Float m_max; 215 | Zefir_Optional_String m_format; 216 | Zefir_Optional_ZefirCallback m_onActive; 217 | Zefir_Optional_ZefirCallback m_onRelease; 218 | } Zefir_InputFloatData; 219 | 220 | 221 | /* Data structure for InputText parameters */ 222 | 223 | typedef struct { 224 | Zefir_UId64 m_uniqueId; 225 | char* m_text; /* Mutable buffer for text */ 226 | size_t m_bufferSize; /* Length of the text buffer */ 227 | Zefir_Optional_Float m_width; 228 | Zefir_Optional_ZefirCallback m_onActive; 229 | Zefir_Optional_ZefirCallback m_onRelease; 230 | } Zefir_InputTextData; 231 | 232 | 233 | /* Data structure for InputHintedText parameters */ 234 | 235 | typedef struct { 236 | Zefir_UId64 m_uniqueId; 237 | char* m_text; 238 | size_t m_bufferSize; /* Length of the text buffer */ 239 | const char** m_hints; /* Array of hint strings */ 240 | size_t m_hintCount; /* Number of hints */ 241 | Zefir_Optional_Float m_width; 242 | Zefir_Optional_ZefirCallback m_onActive; 243 | Zefir_Optional_ZefirCallback m_onRelease; 244 | } Zefir_InputHintedTextData; 245 | 246 | /* Data structure for TextBlock parameters */ 247 | 248 | typedef struct { 249 | Zefir_UId64 m_uniqueId; 250 | const char* m_text; 251 | Zefir_Optional_TextBlock_Alignment m_alignment; /* Using int for TextBlock_Alignment */ 252 | Zefir_Optional_Float m_maxHeight; 253 | Zefir_Optional_Float m_contentRatio; 254 | Zefir_Optional_Bool m_wordWrap; 255 | } Zefir_TextBlockData; 256 | 257 | /* Data structure for Hotkey parameters */ 258 | 259 | typedef struct { 260 | Zefir_UId64 m_uniqueId; 261 | const char* m_label; 262 | uint8_t* m_key; 263 | Zefir_Optional_UInt8 m_restartKey; 264 | Zefir_Optional_ImVec4 m_colorText; 265 | Zefir_Optional_ImVec4 m_colorBorder; 266 | Zefir_Optional_ImVec4 m_colorTextActiveMultiplier; 267 | Zefir_Optional_ImVec4 m_colorBorderActiveMultiplier; 268 | Zefir_Optional_Float m_size; 269 | } Zefir_HotkeyData; 270 | 271 | /* Data structure for HorizontalBox parameters */ 272 | 273 | typedef struct { 274 | Zefir_UId64 m_uniqueId; 275 | float m_size; 276 | Zefir_Optional_Float m_verticalMultiplier; 277 | Zefir_Optional_ZefirCallback m_renderFunction; 278 | } Zefir_HorizontalBoxData; 279 | 280 | 281 | /* Data structure for PopupCustom parameters */ 282 | 283 | typedef struct { 284 | const char* m_title; 285 | void (ZEFIR_CALLBACK* m_content)(void); 286 | Zefir_Optional_Float m_customWidth; 287 | Zefir_Optional_ZefirCallback m_onDismiss; 288 | } Zefir_PopupCustomData; 289 | 290 | /* Data structure for MessageBoxText parameters */ 291 | 292 | typedef struct { 293 | const char* m_title; 294 | const char* m_text; 295 | Zefir_Optional_Float m_customWidth; 296 | Zefir_Optional_PImFont m_customFont; 297 | Zefir_Optional_TextBlock_Alignment m_alignment; 298 | Zefir_Optional_ZefirCallback m_onDismiss; 299 | } Zefir_MessageBoxTextData; 300 | 301 | /* Data structure for MessageBoxYesNo parameters */ 302 | 303 | typedef struct { 304 | const char* m_title; 305 | const char* m_text; 306 | Zefir_Optional_Float m_customWidth; 307 | Zefir_Optional_PImFont m_customFont; 308 | Zefir_Optional_TextBlock_Alignment m_alignment; 309 | Zefir_Optional_ZefirCallback m_onConfirm; 310 | Zefir_Optional_ZefirCallback m_onDismiss; 311 | } Zefir_MessageBoxYesNoData; 312 | 313 | /* Data structure for InputBoxInt parameters */ 314 | 315 | typedef struct { 316 | const char* m_title; 317 | const char* m_label; 318 | const char* m_text; 319 | Zefir_Optional_Float m_customWidth; 320 | Zefir_Optional_PImFont m_customFont; 321 | Zefir_Optional_TextBlock_Alignment m_alignment; 322 | Zefir_Optional_ZefirCallback_Int m_onConfirm; 323 | Zefir_Optional_ZefirCallback_Int m_onDismiss; 324 | Zefir_Optional_Float m_speed; 325 | Zefir_Optional_Int m_min; 326 | Zefir_Optional_Int m_max; 327 | Zefir_Optional_ZefirCallback m_onInputActive; 328 | Zefir_Optional_ZefirCallback m_onInputRelease; 329 | } Zefir_InputBoxIntData; 330 | 331 | /* Data structure for InputBoxFloat parameters */ 332 | 333 | typedef struct { 334 | const char* m_title; 335 | const char* m_label; 336 | const char* m_text; 337 | Zefir_Optional_Float m_customWidth; 338 | Zefir_Optional_PImFont m_customFont; 339 | Zefir_Optional_TextBlock_Alignment m_alignment; 340 | Zefir_Optional_ZefirCallback_Float m_onConfirm; 341 | Zefir_Optional_ZefirCallback_Float m_onDismiss; 342 | Zefir_Optional_Float m_speed; 343 | Zefir_Optional_Float m_min; 344 | Zefir_Optional_Float m_max; 345 | Zefir_Optional_ZefirCallback m_onInputActive; 346 | Zefir_Optional_ZefirCallback m_onInputRelease; 347 | } Zefir_InputBoxFloatData; 348 | 349 | /* Data structure for InputBoxText parameters */ 350 | 351 | typedef struct { 352 | const char* m_title; 353 | const char* m_text; 354 | Zefir_Optional_Float m_customWidth; 355 | Zefir_Optional_PImFont m_customFont; 356 | Zefir_Optional_TextBlock_Alignment m_alignment; 357 | Zefir_Optional_ZefirCallback_String m_onConfirm; 358 | Zefir_Optional_ZefirCallback_String m_onDismiss; 359 | Zefir_Optional_ZefirCallback m_onInputActive; 360 | Zefir_Optional_ZefirCallback m_onInputRelease; 361 | } Zefir_InputBoxTextData; 362 | 363 | /* Data structure for InputBoxHintedText parameters */ 364 | 365 | typedef struct { 366 | const char* m_title; 367 | const char* m_text; 368 | const char** m_hints; 369 | size_t m_hintCount; 370 | Zefir_Optional_Float m_customWidth; 371 | Zefir_Optional_PImFont m_customFont; 372 | Zefir_Optional_TextBlock_Alignment m_alignment; 373 | Zefir_Optional_ZefirCallback_String m_onConfirm; 374 | Zefir_Optional_ZefirCallback_String m_onDismiss; 375 | Zefir_Optional_ZefirCallback m_onInputActive; 376 | Zefir_Optional_ZefirCallback m_onInputRelease; 377 | } Zefir_InputBoxHintedTextData; 378 | 379 | /* Data structure for Window parameters */ 380 | 381 | typedef struct { 382 | const char* m_id; 383 | const char* m_title; 384 | Zefir_Optional_PBool m_handle; 385 | Zefir_Optional_ZefirCallback m_onInit; 386 | Zefir_Optional_ZefirCallback m_onRenderHeader; 387 | Zefir_Optional_ZefirCallback m_onRenderContent; 388 | Zefir_Optional_ZefirCallback m_onRenderFooter; 389 | } Zefir_WindowData; 390 | 391 | /* Data structure for Version */ 392 | 393 | typedef enum { 394 | Zefir_Version_Unknown, 395 | Zefir_Version_Alpha, 396 | Zefir_Version_Beta, 397 | Zefir_Version_Release 398 | } Zefir_VersionType; 399 | 400 | typedef struct { 401 | int m_major; 402 | int m_minor; 403 | int m_preRelease; 404 | Zefir_VersionType m_type; 405 | } Zefir_VersionData; 406 | 407 | /* Data structure for Scheduler */ 408 | 409 | typedef enum { 410 | Zefir_Scheduler_PreRenderScheduler, 411 | Zefir_Scheduler_PostRenderScheduler, 412 | Zefir_Scheduler_GameThreadScheduler, 413 | } Zefir_SchedulerType; 414 | 415 | typedef struct { 416 | Zefir_SchedulerType m_schedulerType; 417 | void (ZEFIR_CALLBACK* m_callback)(void); 418 | Zefir_Optional_Int m_delayMs; 419 | } Zefir_ScheduleOnceData; 420 | 421 | typedef struct { 422 | Zefir_UId64 m_uniqueId; 423 | Zefir_SchedulerType m_schedulerType; 424 | void (ZEFIR_CALLBACK* m_callback)(void); 425 | Zefir_Optional_Int m_delayMs; 426 | } Zefir_ScheduleRepeatData; 427 | 428 | /* 429 | * 430 | * Functions declarations 431 | * Here we declare the functions that will be used in the API. 432 | * 433 | */ 434 | 435 | #ifdef __cplusplus 436 | extern "C" { /* extern "C" */ 437 | #endif 438 | 439 | #ifdef ZEFIR_API_USE_LIB 440 | 441 | /* Common functions */ 442 | ZEFIR_API(bool) Zefir_initializeAPI(); 443 | ZEFIR_API(Zefir_VersionData) Zefir_getAppVersion(); 444 | ZEFIR_API(Zefir_VersionData) Zefir_getLatestStableVersion(); 445 | ZEFIR_API(Zefir_VersionData) Zefir_getLatestBetaVersion(); 446 | 447 | /* Font functions */ 448 | ZEFIR_API(Zefir_PImFont) Zefir_getTitleFont(); 449 | ZEFIR_API(Zefir_PImFont) Zefir_getContentFont(); 450 | ZEFIR_API(Zefir_PImFont) Zefir_getCustomFont(const char* const name); 451 | 452 | /* Logging functions */ 453 | ZEFIR_API(void) Zefir_logInfo(const char* const message); 454 | ZEFIR_API(void) Zefir_logError(const char* const message); 455 | 456 | /* Scheduling functions */ 457 | ZEFIR_API(bool) Zefir_scheduleOnce(const Zefir_ScheduleOnceData* const data); 458 | ZEFIR_API(bool) Zefir_scheduleRepeat(const Zefir_ScheduleRepeatData* const data); 459 | ZEFIR_API(bool) Zefir_removeScheduleRepeat(const Zefir_SchedulerType type, const Zefir_UId64 uniqueId); 460 | 461 | /* Id functions */ 462 | ZEFIR_API(Zefir_UId64) Zefir_hashId_String(const char* const string); 463 | ZEFIR_API(Zefir_UId64) Zefir_hashId_UId64(Zefir_UId64 value); 464 | ZEFIR_API(Zefir_UId64) Zefir_autoRegisterId(Zefir_UId64 value); /* only for c++ macro use, otherwise use Zefir_hashId_Type */ 465 | 466 | /* Component functions */ 467 | ZEFIR_API(void) Zefir_renderText(const char* const text); 468 | ZEFIR_API(bool) Zefir_renderButton(const Zefir_ButtonData* const data); 469 | ZEFIR_API(bool) Zefir_renderCheckbox(const Zefir_CheckboxData* const data); 470 | ZEFIR_API(bool) Zefir_renderColorPicker(const Zefir_ColorPickerData* const data); 471 | ZEFIR_API(bool) Zefir_renderHintedColorPicker(const Zefir_HintedColorPickerData* const data); 472 | ZEFIR_API(bool) Zefir_renderListbox(const Zefir_ListboxData* const data); 473 | ZEFIR_API(bool) Zefir_renderTextBlock(const Zefir_TextBlockData* const data); 474 | ZEFIR_API(bool) Zefir_renderHotkey(const Zefir_HotkeyData* const data); 475 | ZEFIR_API(bool) Zefir_renderHorizontalBox(const Zefir_HorizontalBoxData* const data); 476 | ZEFIR_API(bool) Zefir_renderInputInt(const Zefir_InputIntData* const data); 477 | ZEFIR_API(bool) Zefir_renderInputFloat(const Zefir_InputFloatData* const data); 478 | ZEFIR_API(bool) Zefir_renderInputText(const Zefir_InputTextData* const data); 479 | ZEFIR_API(bool) Zefir_renderInputTextHinted(const Zefir_InputHintedTextData* const data); 480 | 481 | /* Popup functions */ 482 | ZEFIR_API(bool) Zefir_openPopupCustom(const Zefir_PopupCustomData* const data); 483 | ZEFIR_API(bool) Zefir_openMessageBoxText(const Zefir_MessageBoxTextData* const data); 484 | ZEFIR_API(bool) Zefir_openMessageBoxYesNo(const Zefir_MessageBoxYesNoData* const data); 485 | ZEFIR_API(bool) Zefir_openInputBoxInt(const Zefir_InputBoxIntData* const data); 486 | ZEFIR_API(bool) Zefir_openInputBoxFloat(const Zefir_InputBoxFloatData* const data); 487 | ZEFIR_API(bool) Zefir_openInputBoxText(const Zefir_InputBoxTextData* const data); 488 | ZEFIR_API(bool) Zefir_openInputBoxTextHinted(const Zefir_InputBoxHintedTextData* const data); 489 | 490 | /* Window functions */ 491 | ZEFIR_API(bool) Zefir_addWindow(const Zefir_WindowData* const data); 492 | ZEFIR_API(bool) Zefir_removeWindow(const char* const id); 493 | ZEFIR_API(void) Zefir_resetWindowPosition(); 494 | 495 | #else /* ZEFIR_API_USE_LIB */ 496 | 497 | #define ZEFIR_CREATE_STRINGIFY(x) #x 498 | #define ZEFIR_CREATE_CONCAT(a, b) ZEFIR_CREATE_CONCAT_INNER(a, b) 499 | #define ZEFIR_CREATE_CONCAT_INNER(a, b) a##b 500 | 501 | #define ZEFIR_CREATE_DECLARATION_HELPER(rtype, name, ...) \ 502 | typedef rtype (ZEFIR_CALLCONV* ZEFIR_CREATE_CONCAT(name, _t))(__VA_ARGS__); ZEFIR_CREATE_CONCAT(name, _t) name = 0; 503 | 504 | #define ZEFIR_CREATE_RESOLVE_HELPER(mod, rtype, name) \ 505 | name = (ZEFIR_CREATE_CONCAT(name, _t))GetProcAddress(mod, ZEFIR_CREATE_STRINGIFY(name)); 506 | 507 | /* Common functions */ 508 | /* This is now local because you are not supposed to call this */ 509 | /* ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_initializeAPI, void); */ 510 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_VersionData, Zefir_getAppVersion, void); 511 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_VersionData, Zefir_getLatestStableVersion, void); 512 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_VersionData, Zefir_getLatestBetaVersion, void); 513 | 514 | /* Font functions */ 515 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_PImFont, Zefir_getTitleFont, void); 516 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_PImFont, Zefir_getContentFont, void); 517 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_PImFont, Zefir_getCustomFont, const char* const name); 518 | 519 | /* Logging functions */ 520 | ZEFIR_CREATE_DECLARATION_HELPER(void, Zefir_logInfo, const char* const message); 521 | ZEFIR_CREATE_DECLARATION_HELPER(void, Zefir_logError, const char* const message); 522 | 523 | /* Scheduling functions */ 524 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_scheduleOnce, const Zefir_ScheduleOnceData* const data); 525 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_scheduleRepeat, const Zefir_ScheduleRepeatData* const data); 526 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_removeScheduleRepeat, const Zefir_SchedulerType type, const Zefir_UId64 uniqueId); 527 | 528 | /* Id functions */ 529 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_UId64, Zefir_hashId_String, const char* const string); 530 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_UId64, Zefir_hashId_UId64, Zefir_UId64 value); 531 | ZEFIR_CREATE_DECLARATION_HELPER(Zefir_UId64, Zefir_autoRegisterId, Zefir_UId64 value); /* only for c++ macro use, otherwise use Zefir_hashId_Type */ 532 | 533 | /* Component functions */ 534 | ZEFIR_CREATE_DECLARATION_HELPER(void, Zefir_renderText, const char* const text); 535 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderButton, const Zefir_ButtonData* const data); 536 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderCheckbox, const Zefir_CheckboxData* const data); 537 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderColorPicker, const Zefir_ColorPickerData* const data); 538 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderHintedColorPicker, const Zefir_HintedColorPickerData* const data); 539 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderListbox, const Zefir_ListboxData* const data); 540 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderTextBlock, const Zefir_TextBlockData* const data); 541 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderHotkey, const Zefir_HotkeyData* const data); 542 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderHorizontalBox, const Zefir_HorizontalBoxData* const data); 543 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderInputInt, const Zefir_InputIntData* const data); 544 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderInputFloat, const Zefir_InputFloatData* const data); 545 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderInputText, const Zefir_InputTextData* const data); 546 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_renderInputTextHinted, const Zefir_InputHintedTextData* const data); 547 | 548 | /* Popup functions */ 549 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openPopupCustom, const Zefir_PopupCustomData* const data); 550 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openMessageBoxText, const Zefir_MessageBoxTextData* const data); 551 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openMessageBoxYesNo, const Zefir_MessageBoxYesNoData* const data); 552 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openInputBoxInt, const Zefir_InputBoxIntData* const data); 553 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openInputBoxFloat, const Zefir_InputBoxFloatData* const data); 554 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openInputBoxText, const Zefir_InputBoxTextData* const data); 555 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_openInputBoxTextHinted, const Zefir_InputBoxHintedTextData* const data); 556 | 557 | /* Window functions */ 558 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_addWindow, const Zefir_WindowData* const data); 559 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_removeWindow, const char* const id); 560 | ZEFIR_CREATE_DECLARATION_HELPER(void, Zefir_resetWindowPosition, void); 561 | 562 | static inline bool Zefir_initializeAPI_Create(const char* const moduleName) 563 | { 564 | HMODULE hZefir = GetModuleHandleA(moduleName); 565 | if (hZefir) 566 | { 567 | ZEFIR_CREATE_DECLARATION_HELPER(bool, Zefir_initializeAPI, void); 568 | 569 | /* Common functions */ 570 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_initializeAPI); 571 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_VersionData, Zefir_getAppVersion); 572 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_VersionData, Zefir_getLatestStableVersion); 573 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_VersionData, Zefir_getLatestBetaVersion); 574 | 575 | /* Font functions */ 576 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_PImFont, Zefir_getTitleFont); 577 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_PImFont, Zefir_getContentFont); 578 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_PImFont, Zefir_getCustomFont); 579 | 580 | /* Logging functions */ 581 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, void, Zefir_logInfo); 582 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, void, Zefir_logError); 583 | 584 | /* Scheduling functions */ 585 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_scheduleOnce); 586 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_scheduleRepeat); 587 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_removeScheduleRepeat); 588 | 589 | /* Id functions */ 590 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_UId64, Zefir_hashId_String); 591 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_UId64, Zefir_hashId_UId64); 592 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, Zefir_UId64, Zefir_autoRegisterId); 593 | 594 | /* Component functions */ 595 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, void, Zefir_renderText); 596 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderButton); 597 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderCheckbox); 598 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderColorPicker); 599 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderHintedColorPicker); 600 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderListbox); 601 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderTextBlock); 602 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderHotkey); 603 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderHorizontalBox); 604 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderInputInt); 605 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderInputFloat); 606 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderInputText); 607 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_renderInputTextHinted); 608 | 609 | /* Popup functions */ 610 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openPopupCustom); 611 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openMessageBoxText); 612 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openMessageBoxYesNo); 613 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openInputBoxInt); 614 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openInputBoxFloat); 615 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openInputBoxText); 616 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_openInputBoxTextHinted); 617 | 618 | /* Window functions */ 619 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_addWindow); 620 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, bool, Zefir_removeWindow); 621 | ZEFIR_CREATE_RESOLVE_HELPER(hZefir, void, Zefir_resetWindowPosition); 622 | 623 | return Zefir_initializeAPI(); 624 | } 625 | return false; 626 | } 627 | 628 | #endif /* ZEFIR_API_USE_LIB */ 629 | 630 | #ifdef __cplusplus 631 | } /* extern "C" */ 632 | #endif 633 | 634 | /* 635 | * 636 | * C++ wrappers for the C API 637 | * Recommended version is C++17 or higher 638 | * 639 | */ 640 | 641 | #ifdef __cplusplus 642 | 643 | #include 644 | #include 645 | #include 646 | #include 647 | 648 | /* This needs to be separated from the internal zefir:: namespace */ 649 | namespace zefir::api 650 | { 651 | namespace app /* Common functions */ 652 | { 653 | /* call Zefir_initializeAPI() or Zefir_initializeAPI_Create() instead */ 654 | /* inline bool initializeAPI() { return Zefir_initializeAPI(); } */ 655 | inline Zefir_VersionData getVersion() { return Zefir_getAppVersion(); } 656 | inline Zefir_VersionData getLatestStableVersion() { return Zefir_getLatestStableVersion(); } 657 | inline Zefir_VersionData getLatestBetaVersion() { return Zefir_getLatestBetaVersion(); } 658 | } 659 | 660 | namespace log /* Logging functions */ 661 | { 662 | inline void info(const std::string& message) { Zefir_logInfo(message.c_str()); } 663 | inline void error(const std::string& message) { Zefir_logError(message.c_str()); } 664 | } 665 | 666 | namespace schedule /* Scheduling functions */ 667 | { 668 | inline bool once(const Zefir_ScheduleOnceData& data) { return Zefir_scheduleOnce(&data); } 669 | inline bool repeat(const Zefir_ScheduleRepeatData& data) { return Zefir_scheduleRepeat(&data); } 670 | inline bool remove(const Zefir_SchedulerType type, const Zefir_UId64 uniqueId) { return Zefir_removeScheduleRepeat(type, uniqueId); } 671 | } 672 | 673 | namespace hash /* Id functions */ 674 | { 675 | inline Zefir_UId64 value(const std::string& string) { return Zefir_hashId_String(string.c_str()); } 676 | inline Zefir_UId64 value(Zefir_UId64 value) { return Zefir_hashId_UId64(value); } 677 | inline Zefir_UId64 autoRegister(Zefir_UId64 value) { return Zefir_autoRegisterId(value); } /* only for c++ macro use, otherwise use Zefir_hashId_Type */ 678 | } 679 | 680 | namespace cm /* Component functions */ 681 | { 682 | inline void text(const std::string& text) { Zefir_renderText(text.c_str()); } 683 | inline bool button(const Zefir_ButtonData& data) { return Zefir_renderButton(&data); } 684 | inline bool checkbox(const Zefir_CheckboxData& data) { return Zefir_renderCheckbox(&data); } 685 | inline bool colorPicker(const Zefir_ColorPickerData& data) { return Zefir_renderColorPicker(&data); } 686 | inline bool colorPickerHinted(const Zefir_HintedColorPickerData& data, const std::unordered_map& hints = {}) 687 | { 688 | if (hints.size()) 689 | { 690 | auto dataCopy = data; 691 | std::vector hintKeys; 692 | std::vector hintValues; 693 | for (const auto& [key, value] : hints) 694 | { 695 | hintKeys.push_back(key.c_str()); 696 | hintValues.push_back(value); 697 | } 698 | dataCopy.m_hintKeys = hintKeys.data(); 699 | dataCopy.m_hintValues = hintValues.data(); 700 | dataCopy.m_hintCount = hintKeys.size(); 701 | return Zefir_renderHintedColorPicker(&dataCopy); 702 | } 703 | return Zefir_renderHintedColorPicker(&data); 704 | } 705 | inline bool listbox(const Zefir_ListboxData& data, const std::vector& list = {}) 706 | { 707 | if (list.size()) 708 | { 709 | auto dataCopy = data; 710 | std::vector listPtrs; 711 | for (const auto& item : list) 712 | { 713 | listPtrs.push_back(item.c_str()); 714 | } 715 | dataCopy.m_list = listPtrs.data(); 716 | dataCopy.m_listCount = listPtrs.size(); 717 | return Zefir_renderListbox(&dataCopy); 718 | } 719 | return Zefir_renderListbox(&data); 720 | } 721 | inline bool textBlock(const Zefir_TextBlockData& data) { return Zefir_renderTextBlock(&data); } 722 | inline bool hotkey(const Zefir_HotkeyData& data) { return Zefir_renderHotkey(&data); } 723 | inline bool horizontalBox(const Zefir_HorizontalBoxData& data) { return Zefir_renderHorizontalBox(&data); } 724 | inline bool inputInt(const Zefir_InputIntData& data) { return Zefir_renderInputInt(&data); } 725 | inline bool inputFloat(const Zefir_InputFloatData& data) { return Zefir_renderInputFloat(&data); } 726 | inline bool inputText(const Zefir_InputTextData& data) { return Zefir_renderInputText(&data); } 727 | inline bool inputTextHinted(const Zefir_InputHintedTextData& data, const std::vector& hints = {}) 728 | { 729 | if (hints.size()) 730 | { 731 | auto dataCopy = data; 732 | std::vector hintPtrs; 733 | for (const auto& hint : hints) 734 | { 735 | hintPtrs.push_back(hint.c_str()); 736 | } 737 | dataCopy.m_hints = hintPtrs.data(); 738 | dataCopy.m_hintCount = hintPtrs.size(); 739 | return Zefir_renderInputTextHinted(&dataCopy); 740 | 741 | } 742 | return Zefir_renderInputTextHinted(&data); 743 | } 744 | } 745 | 746 | namespace popup /* Popup functions */ 747 | { 748 | inline bool custom(const Zefir_PopupCustomData& data) { return Zefir_openPopupCustom(&data); } 749 | inline bool text(const Zefir_MessageBoxTextData& data) { return Zefir_openMessageBoxText(&data); } 750 | inline bool yesNo(const Zefir_MessageBoxYesNoData& data) { return Zefir_openMessageBoxYesNo(&data); } 751 | inline bool inputInt(const Zefir_InputBoxIntData& data) { return Zefir_openInputBoxInt(&data); } 752 | inline bool inputFloat(const Zefir_InputBoxFloatData& data) { return Zefir_openInputBoxFloat(&data); } 753 | inline bool inputText(const Zefir_InputBoxTextData& data) { return Zefir_openInputBoxText(&data); } 754 | inline bool inputTextHinted(const Zefir_InputBoxHintedTextData& data) { return Zefir_openInputBoxTextHinted(&data); } 755 | } 756 | 757 | namespace window /* Window functions */ 758 | { 759 | inline bool add(const Zefir_WindowData& data) { return Zefir_addWindow(&data); } 760 | inline bool remove(const std::string& id) { return Zefir_removeWindow(id.c_str()); } 761 | inline void resetPosition() { Zefir_resetWindowPosition(); } 762 | } 763 | } 764 | 765 | #endif 766 | 767 | /* 768 | * 769 | * Macros for generating unique IDs 770 | * This macro generates a unique ID based on the current time and a counter. 771 | * Use ZEFIR_NEW_UID() to generate a new unique ID, every usage of the macro 772 | * has a consistent UId. 773 | * 774 | */ 775 | 776 | #ifdef __cplusplus 777 | #define ZEFIR_NEW_UID \ 778 | []() -> Zefir_UId64 \ 779 | { \ 780 | static const Zefir_UId64 result = \ 781 | Zefir_autoRegisterId(Zefir_hashId_UId64(Zefir_hashId_String(__TIME__) ^ Zefir_hashId_UId64(__COUNTER__))); \ 782 | return result; \ 783 | } 784 | #else 785 | #define ZEFIR_NEW_UID() (Zefir_hashId_UId64(Zefir_hashId_String(__TIMESTAMP__) ^ Zefir_hashId_String(__TIME__) ^ Zefir_hashId_UId64(__COUNTER__))) 786 | #endif 787 | 788 | #endif /* ZEFIR_UI_API_H */ 789 | 790 | /* 791 | * Zefir UI API Documentation 792 | * 793 | * This header provides the interface for the Zefir UI API, which allows creating 794 | * user interfaces with various components, popups, and windows. 795 | * 796 | * The API is available in both C and C++ versions. The C functions are prefixed 797 | * with "Zefir_", and the C++ wrappers are under the "zefir::api" namespace. 798 | * 799 | * Below is a list of all functions with their descriptions, parameters, return types, 800 | * and related data structures. 801 | 802 | * ----- Common Functions ----- 803 | * 804 | * These functions handle initialization and version information. 805 | * 806 | * Zefir_initializeAPI_Create 807 | * C: bool Zefir_initializeAPI_Create(const char* const moduleName) 808 | * C++: bool Zefir_initializeAPI_Create(const char* const moduleName) 809 | * Description: Initializes the Zefir API. 810 | * Parameters: 811 | * - const char* const moduleName: Name of the zefir dll to initialize 812 | * Returns: bool (true if initialization was successful) 813 | * 814 | * Zefir_getAppVersion 815 | * C: Zefir_VersionData Zefir_getAppVersion() 816 | * C++: Zefir_VersionData zefir::api::app::getVersion() 817 | * Description: Retrieves the current version of the application. 818 | * Parameters: None 819 | * Returns: Zefir_VersionData 820 | * Related Structures: 821 | * Zefir_VersionData 822 | * - int m_major: Major version number 823 | * - int m_minor: Minor version number 824 | * - int m_preRelease: Pre-release version number 825 | * - Zefir_VersionType m_type: Version type (Unknown, Alpha, Beta, Release) 826 | * 827 | * Zefir_getLatestStableVersion 828 | * C: Zefir_VersionData Zefir_getLatestStableVersion() 829 | * C++: Zefir_VersionData zefir::api::app::getLatestStableVersion() 830 | * Description: Gets the latest stable version available. 831 | * Parameters: None 832 | * Returns: Zefir_VersionData 833 | * Related Structures: 834 | * Zefir_VersionData (see above) 835 | * 836 | * Zefir_getLatestBetaVersion 837 | * C: Zefir_VersionData Zefir_getLatestBetaVersion() 838 | * C++: Zefir_VersionData zefir::api::app::getLatestBetaVersion() 839 | * Description: Gets the latest beta version available. 840 | * Parameters: None 841 | * Returns: Zefir_VersionData 842 | * Related Structures: 843 | * Zefir_VersionData (see above) 844 | 845 | * ----- Font Functions ----- 846 | * 847 | * These functions provide access to fonts used in the UI. 848 | * 849 | * Zefir_getTitleFont 850 | * C: Zefir_PImFont Zefir_getTitleFont() 851 | * C++: Not available 852 | * Description: Returns the title font. 853 | * Parameters: None 854 | * Returns: Zefir_PImFont (pointer to font) 855 | * 856 | * Zefir_getContentFont 857 | * C: Zefir_PImFont Zefir_getContentFont() 858 | * C++: Not available 859 | * Description: Returns the content font. 860 | * Parameters: None 861 | * Returns: Zefir_PImFont (pointer to font) 862 | * 863 | * Zefir_getCustomFont 864 | * C: Zefir_PImFont Zefir_getCustomFont(const char* const name) 865 | * C++: Not available 866 | * Description: Returns a custom font by name. 867 | * Parameters: 868 | * - const char* const name: Name of the custom font 869 | * Returns: Zefir_PImFont (pointer to font) 870 | 871 | * ----- Logging Functions ----- 872 | * 873 | * These functions allow logging messages. 874 | * 875 | * Zefir_logInfo 876 | * C: void Zefir_logInfo(const char* const message) 877 | * C++: void zefir::api::log::info(const std::string& message) 878 | * Description: Logs an informational message. 879 | * Parameters: 880 | * - const char* const message (C): Message to log 881 | * - const std::string& message (C++): Message to log 882 | * Returns: void 883 | * 884 | * Zefir_logError 885 | * C: void Zefir_logError(const char* const message) 886 | * C++: void zefir::api::log::error(const std::string& message) 887 | * Description: Logs an error message. 888 | * Parameters: 889 | * - const char* const message (C): Message to log 890 | * - const std::string& message (C++): Message to log 891 | * Returns: void 892 | 893 | * ----- Scheduling Functions ----- 894 | * 895 | * These functions manage scheduling callbacks on different threads. 896 | * 897 | * Zefir_scheduleOnce 898 | * C: bool Zefir_scheduleOnce(const Zefir_ScheduleOnceData* const data) 899 | * C++: bool zefir::api::schedule::once(const Zefir_ScheduleOnceData& data) 900 | * Description: Schedules a callback to run once. 901 | * Parameters: 902 | * - const Zefir_ScheduleOnceData* const data (C): Scheduling data 903 | * - const Zefir_ScheduleOnceData& data (C++): Scheduling data 904 | * Returns: bool (true if scheduled successfully) 905 | * Related Structures: 906 | * Zefir_ScheduleOnceData 907 | * - Zefir_SchedulerType m_schedulerType: Scheduler type (PreRender, PostRender, GameThread) 908 | * - void (ZEFIR_CALLBACK* m_callback)(void): Callback function 909 | * - Zefir_Optional_Int m_delayMs: Optional delay in milliseconds 910 | * 911 | * Zefir_scheduleRepeat 912 | * C: bool Zefir_scheduleRepeat(const Zefir_ScheduleRepeatData* const data) 913 | * C++: bool zefir::api::schedule::repeat(const Zefir_ScheduleRepeatData& data) 914 | * Description: Schedules a callback to run repeatedly. 915 | * Parameters: 916 | * - const Zefir_ScheduleRepeatData* const data (C): Scheduling data 917 | * - const Zefir_ScheduleRepeatData& data (C++): Scheduling data 918 | * Returns: bool (true if scheduled successfully) 919 | * Related Structures: 920 | * Zefir_ScheduleRepeatData 921 | * - Zefir_UId64 m_uniqueId: Unique identifier 922 | * - Zefir_SchedulerType m_schedulerType: Scheduler type 923 | * - void (ZEFIR_CALLBACK* m_callback)(void): Callback function 924 | * - Zefir_Optional_Int m_delayMs: Optional delay in milliseconds 925 | * 926 | * Zefir_removeScheduleRepeat 927 | * C: bool Zefir_removeScheduleRepeat(const Zefir_SchedulerType type, const Zefir_UId64 uniqueId) 928 | * C++: bool zefir::api::schedule::remove(const Zefir_SchedulerType type, const Zefir_UId64 uniqueId) 929 | * Description: Removes a repeating schedule. 930 | * Parameters: 931 | * - const Zefir_SchedulerType type: Scheduler type 932 | * - const Zefir_UId64 uniqueId: Unique ID of the schedule 933 | * Returns: bool (true if removed successfully) 934 | 935 | * ----- ID Functions ----- 936 | * 937 | * These functions generate unique IDs for UI elements. 938 | * 939 | * Zefir_hashId_String 940 | * C: Zefir_UId64 Zefir_hashId_String(const char* const string) 941 | * C++: Zefir_UId64 zefir::api::hash::value(const std::string& string) 942 | * Description: Generates a unique ID from a string. 943 | * Parameters: 944 | * - const char* const string (C): String to hash 945 | * - const std::string& string (C++): String to hash 946 | * Returns: Zefir_UId64 947 | * 948 | * Zefir_hashId_UId64 949 | * C: Zefir_UId64 Zefir_hashId_UId64(Zefir_UId64 value) 950 | * C++: Zefir_UId64 zefir::api::hash::value(Zefir_UId64 value) 951 | * Description: Generates a unique ID from a uint64_t value. 952 | * Parameters: 953 | * - Zefir_UId64 value: Value to hash 954 | * Returns: Zefir_UId64 955 | * 956 | * Zefir_autoRegisterId 957 | * C: Zefir_UId64 Zefir_autoRegisterId(Zefir_UId64 value) 958 | * C++: Zefir_UId64 zefir::api::hash::autoRegister(Zefir_UId64 value) 959 | * Description: Auto-registers an ID (for C++ macro use). 960 | * Parameters: 961 | * - Zefir_UId64 value: Value to register 962 | * Returns: Zefir_UId64 963 | 964 | * ----- Component Functions ----- 965 | * 966 | * These functions render various UI components. 967 | * 968 | * Zefir_renderText 969 | * C: void Zefir_renderText(const char* const text) 970 | * C++: void zefir::api::cm::text(const std::string& text) 971 | * Description: Renders text on the UI. 972 | * Parameters: 973 | * - const char* const text (C): Text to render 974 | * - const std::string& text (C++): Text to render 975 | * Returns: void 976 | * 977 | * Zefir_renderButton 978 | * C: bool Zefir_renderButton(const Zefir_ButtonData* const data) 979 | * C++: bool zefir::api::cm::button(const Zefir_ButtonData& data) 980 | * Description: Renders a button. 981 | * Parameters: 982 | * - const Zefir_ButtonData* const data (C): Button configuration data 983 | * - const Zefir_ButtonData& data (C++): Button configuration data 984 | * Returns: bool (true if clicked) 985 | * Related Structures: 986 | * Zefir_ButtonData 987 | * - Zefir_UId64 m_uniqueId: Unique identifier 988 | * - const char* m_label: Button label 989 | * - Zefir_Optional_PUInt8 m_key: Optional hotkey 990 | * - Zefir_Optional_String m_info: Optional info text 991 | * - Zefir_Optional_PImFont m_customInfoFont: Optional custom font 992 | * - Zefir_Optional_ZefirCallback m_onActivate: Optional callback on activation 993 | * - Zefir_Optional_ZefirCallback m_onHotkeySet: Optional callback on hotkey set 994 | * - Zefir_Optional_ZefirCallback m_renderPopup: Optional extra render callback 995 | * 996 | * Zefir_renderCheckbox 997 | * C: bool Zefir_renderCheckbox(const Zefir_CheckboxData* const data) 998 | * C++: bool zefir::api::cm::checkbox(const Zefir_CheckboxData& data) 999 | * Description: Renders a checkbox. 1000 | * Parameters: 1001 | * - const Zefir_CheckboxData* const data (C): Checkbox configuration data 1002 | * - const Zefir_CheckboxData& data (C++): Checkbox configuration data 1003 | * Returns: bool (true if state changed) 1004 | * Related Structures: 1005 | * Zefir_CheckboxData 1006 | * - Zefir_UId64 m_uniqueId: Unique identifier 1007 | * - const char* m_label: Checkbox label 1008 | * - bool* m_value: Pointer to checkbox value 1009 | * - Zefir_Optional_PUInt8 m_key: Optional hotkey 1010 | * - Zefir_Optional_String m_info: Optional info text 1011 | * - Zefir_Optional_PImFont m_customInfoFont: Optional custom font 1012 | * - Zefir_Optional_ZefirCallback m_onActivate: Optional callback on activation 1013 | * - Zefir_Optional_ZefirCallback m_onHotkeySet: Optional callback on hotkey set 1014 | * - Zefir_Optional_ZefirCallback m_renderPopup: Optional extra render callback 1015 | * 1016 | * Zefir_renderColorPicker 1017 | * C: bool Zefir_renderColorPicker(const Zefir_ColorPickerData* const data) 1018 | * C++: bool zefir::api::cm::colorPicker(const Zefir_ColorPickerData& data) 1019 | * Description: Renders a color picker. 1020 | * Parameters: 1021 | * - const Zefir_ColorPickerData* const data (C): Color picker configuration data 1022 | * - const Zefir_ColorPickerData& data (C++): Color picker configuration data 1023 | * Returns: bool (true if color changed) 1024 | * Related Structures: 1025 | * Zefir_ColorPickerData 1026 | * - Zefir_UId64 m_uniqueId: Unique identifier 1027 | * - const char* m_label: Color picker label 1028 | * - Zefir_ImVec4* m_colorValue: Pointer to color value 1029 | * - Zefir_Optional_PUInt8 m_key: Optional hotkey 1030 | * - Zefir_Optional_String m_info: Optional info text 1031 | * - Zefir_Optional_PImFont m_customInfoFont: Optional custom font 1032 | * - Zefir_Optional_ZefirCallback m_onActivate: Optional callback on activation 1033 | * - Zefir_Optional_ZefirCallback m_onHotkeySet: Optional callback on hotkey set 1034 | * - Zefir_Optional_ZefirCallback m_renderPopup: Optional extra render callback 1035 | * 1036 | * Zefir_renderHintedColorPicker 1037 | * C: bool Zefir_renderHintedColorPicker(const Zefir_HintedColorPickerData* const data) 1038 | * C++: bool zefir::api::cm::colorPickerHinted(const Zefir_HintedColorPickerData& data, const std::unordered_map& hints = {}) 1039 | * Description: Renders a color picker with hints. 1040 | * Parameters: 1041 | * - const Zefir_HintedColorPickerData* const data (C): Hinted color picker configuration data 1042 | * - const Zefir_HintedColorPickerData& data (C++): Hinted color picker configuration data 1043 | * - const std::unordered_map& hints (C++): Optional hints map 1044 | * Returns: bool (true if color changed) 1045 | * Related Structures: 1046 | * Zefir_HintedColorPickerData 1047 | * - Zefir_UId64 m_uniqueId: Unique identifier 1048 | * - const char* m_label: Color picker label 1049 | * - Zefir_ImVec4* m_colorValue: Pointer to color value 1050 | * - const char** m_hintKeys: Array of hint keys 1051 | * - Zefir_ImVec4* m_hintValues: Array of hint values 1052 | * - size_t m_hintCount: Number of hints 1053 | * - Zefir_Optional_PUInt8 m_key: Optional hotkey 1054 | * - Zefir_Optional_String m_info: Optional info text 1055 | * - Zefir_Optional_PImFont m_customInfoFont: Optional custom font 1056 | * - Zefir_Optional_ZefirCallback m_onActivate: Optional callback on activation 1057 | * - Zefir_Optional_ZefirCallback m_onHotkeySet: Optional callback on hotkey set 1058 | * - Zefir_Optional_ZefirCallback m_renderPopup: Optional extra render callback 1059 | * - Zefir_Optional_ZefirCallback m_onSelectHint: Optional callback on hint selection 1060 | * 1061 | * Zefir_renderListbox 1062 | * C: bool Zefir_renderListbox(const Zefir_ListboxData* const data) 1063 | * C++: bool zefir::api::cm::listbox(const Zefir_ListboxData& data, const std::vector& list = {}) 1064 | * Description: Renders a listbox. 1065 | * Parameters: 1066 | * - const Zefir_ListboxData* const data (C): Listbox configuration data 1067 | * - const Zefir_ListboxData& data (C++): Listbox configuration data 1068 | * - const std::vector& list (C++): Optional list of items 1069 | * Returns: bool (true if selection changed) 1070 | * Related Structures: 1071 | * Zefir_ListboxData 1072 | * - Zefir_UId64 m_uniqueId: Unique identifier 1073 | * - const char** m_list: Array of strings 1074 | * - size_t m_listCount: Number of items in list 1075 | * - uint8_t* m_value: Pointer to selected value 1076 | * - Zefir_Optional_ZefirCallback m_onActivate: Optional callback on activation 1077 | * - Zefir_Optional_ZefirCallback m_onRelease: Optional callback on release 1078 | * 1079 | * Zefir_renderTextBlock 1080 | * C: bool Zefir_renderTextBlock(const Zefir_TextBlockData* const data) 1081 | * C++: bool zefir::api::cm::textBlock(const Zefir_TextBlockData& data) 1082 | * Description: Renders a text block. 1083 | * Parameters: 1084 | * - const Zefir_TextBlockData* const data (C): Text block configuration data 1085 | * - const Zefir_TextBlockData& data (C++): Text block configuration data 1086 | * Returns: bool (true if rendered successfully) 1087 | * Related Structures: 1088 | * Zefir_TextBlockData 1089 | * - Zefir_UId64 m_uniqueId: Unique identifier 1090 | * - const char* m_text: Text to display 1091 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1092 | * - Zefir_Optional_Float m_maxHeight: Optional maximum height 1093 | * - Zefir_Optional_Float m_contentRatio: Optional content ratio 1094 | * - Zefir_Optional_Bool m_wordWrap: Optional word wrap setting 1095 | * 1096 | * Zefir_renderHotkey 1097 | * C: bool Zefir_renderHotkey(const Zefir_HotkeyData* const data) 1098 | * C++: bool zefir::api::cm::hotkey(const Zefir_HotkeyData& data) 1099 | * Description: Renders a hotkey input. 1100 | * Parameters: 1101 | * - const Zefir_HotkeyData* const data (C): Hotkey configuration data 1102 | * - const Zefir_HotkeyData& data (C++): Hotkey configuration data 1103 | * Returns: bool (true if hotkey set) 1104 | * Related Structures: 1105 | * Zefir_HotkeyData 1106 | * - Zefir_UId64 m_uniqueId: Unique identifier 1107 | * - const char* m_label: Hotkey label 1108 | * - uint8_t* m_key: Pointer to hotkey value 1109 | * - Zefir_Optional_UInt8 m_restartKey: Optional restart key 1110 | * - Zefir_Optional_ImVec4 m_colorText: Optional text color 1111 | * - Zefir_Optional_ImVec4 m_colorBorder: Optional border color 1112 | * - Zefir_Optional_ImVec4 m_colorTextActiveMultiplier: Optional active text color multiplier 1113 | * - Zefir_Optional_ImVec4 m_colorBorderActiveMultiplier: Optional active border color multiplier 1114 | * - Zefir_Optional_Float m_size: Optional size 1115 | * 1116 | * Zefir_renderHorizontalBox 1117 | * C: bool Zefir_renderHorizontalBox(const Zefir_HorizontalBoxData* const data) 1118 | * C++: bool zefir::api::cm::horizontalBox(const Zefir_HorizontalBoxData& data) 1119 | * Description: Renders a horizontal box for layout. 1120 | * Parameters: 1121 | * - const Zefir_HorizontalBoxData* const data (C): Horizontal box configuration data 1122 | * - const Zefir_HorizontalBoxData& data (C++): Horizontal box configuration data 1123 | * Returns: bool (true if rendered successfully) 1124 | * Related Structures: 1125 | * Zefir_HorizontalBoxData 1126 | * - Zefir_UId64 m_uniqueId: Unique identifier 1127 | * - float m_size: Box size 1128 | * - Zefir_Optional_Float m_verticalMultiplier: Optional vertical multiplier 1129 | * - Zefir_Optional_ZefirCallback m_renderFunction: Optional render function 1130 | * 1131 | * Zefir_renderInputInt 1132 | * C: bool Zefir_renderInputInt(const Zefir_InputIntData* const data) 1133 | * C++: bool zefir::api::cm::inputInt(const Zefir_InputIntData& data) 1134 | * Description: Renders an integer input field. 1135 | * Parameters: 1136 | * - const Zefir_InputIntData* const data (C): Input int configuration data 1137 | * - const Zefir_InputIntData& data (C++): Input int configuration data 1138 | * Returns: bool (true if value changed) 1139 | * Related Structures: 1140 | * Zefir_InputIntData 1141 | * - Zefir_UId64 m_uniqueId: Unique identifier 1142 | * - const char* m_label: Input label 1143 | * - int* m_value: Pointer to integer value 1144 | * - Zefir_Optional_Float m_speed: Optional input speed 1145 | * - Zefir_Optional_Int m_min: Optional minimum value 1146 | * - Zefir_Optional_Int m_max: Optional maximum value 1147 | * - Zefir_Optional_ZefirCallback m_onActive: Optional callback on active 1148 | * - Zefir_Optional_ZefirCallback m_onRelease: Optional callback on release 1149 | * 1150 | * Zefir_renderInputFloat 1151 | * C: bool Zefir_renderInputFloat(const Zefir_InputFloatData* const data) 1152 | * C++: bool zefir::api::cm::inputFloat(const Zefir_InputFloatData& data) 1153 | * Description: Renders a float input field. 1154 | * Parameters: 1155 | * - const Zefir_InputFloatData* const data (C): Input float configuration data 1156 | * - const Zefir_InputFloatData& data (C++): Input float configuration data 1157 | * Returns: bool (true if value changed) 1158 | * Related Structures: 1159 | * Zefir_InputFloatData 1160 | * - Zefir_UId64 m_uniqueId: Unique identifier 1161 | * - const char* m_label: Input label 1162 | * - float* m_value: Pointer to float value 1163 | * - Zefir_Optional_Float m_speed: Optional input speed 1164 | * - Zefir_Optional_Float m_min: Optional minimum value 1165 | * - Zefir_Optional_Float m_max: Optional maximum value 1166 | * - Zefir_Optional_String m_format: Optional format string 1167 | * - Zefir_Optional_ZefirCallback m_onActive: Optional callback on active 1168 | * - Zefir_Optional_ZefirCallback m_onRelease: Optional callback on release 1169 | * 1170 | * Zefir_renderInputText 1171 | * C: bool Zefir_renderInputText(const Zefir_InputTextData* const data) 1172 | * C++: bool zefir::api::cm::inputText(const Zefir_InputTextData& data) 1173 | * Description: Renders a text input field. 1174 | * Parameters: 1175 | * - const Zefir_InputTextData* const data (C): Input text configuration data 1176 | * - const Zefir_InputTextData& data (C++): Input text configuration data 1177 | * Returns: bool (true if text changed) 1178 | * Related Structures: 1179 | * Zefir_InputTextData 1180 | * - Zefir_UId64 m_uniqueId: Unique identifier 1181 | * - char* m_text: Mutable text buffer 1182 | * - size_t m_bufferSize: Length of the text buffer 1183 | * - Zefir_Optional_Float m_width: Optional input width 1184 | * - Zefir_Optional_ZefirCallback m_onActive: Optional callback on active 1185 | * - Zefir_Optional_ZefirCallback m_onRelease: Optional callback on release 1186 | * 1187 | * Zefir_renderInputTextHinted 1188 | * C: bool Zefir_renderInputTextHinted(const Zefir_InputHintedTextData* const data) 1189 | * C++: bool zefir::api::cm::inputTextHinted(const Zefir_InputHintedTextData& data, const std::vector& hints = {}) 1190 | * Description: Renders a text input field with hints. 1191 | * Parameters: 1192 | * - const Zefir_InputHintedTextData* const data (C): Hinted input text configuration data 1193 | * - const Zefir_InputHintedTextData& data (C++): Hinted input text configuration data 1194 | * - const std::vector& hints (C++): Optional hints list 1195 | * Returns: bool (true if text changed) 1196 | * Related Structures: 1197 | * Zefir_InputHintedTextData 1198 | * - Zefir_UId64 m_uniqueId: Unique identifier 1199 | * - char* m_text: Mutable text buffer 1200 | * - size_t m_bufferSize: Length of the text buffer 1201 | * - const char** m_hints: Array of hint strings 1202 | * - size_t m_hintCount: Number of hints 1203 | * - Zefir_Optional_Float m_width: Optional input width 1204 | * - Zefir_Optional_ZefirCallback m_onActive: Optional callback on active 1205 | * - Zefir_Optional_ZefirCallback m_onRelease: Optional callback on release 1206 | 1207 | * ----- Popup Functions ----- 1208 | * 1209 | * These functions open various types of popups. 1210 | * 1211 | * Zefir_openPopupCustom 1212 | * C: bool Zefir_openPopupCustom(const Zefir_PopupCustomData* const data) 1213 | * C++: bool zefir::api::popup::custom(const Zefir_PopupCustomData& data) 1214 | * Description: Opens a custom popup. 1215 | * Parameters: 1216 | * - const Zefir_PopupCustomData* const data (C): Custom popup configuration data 1217 | * - const Zefir_PopupCustomData& data (C++): Custom popup configuration data 1218 | * Returns: bool (true if opened successfully) 1219 | * Related Structures: 1220 | * Zefir_PopupCustomData 1221 | * - const char* m_title: Popup title 1222 | * - void (ZEFIR_CALLBACK* m_content)(void): Content rendering callback 1223 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1224 | * - Zefir_Optional_ZefirCallback m_onDismiss: Optional callback on dismiss 1225 | * 1226 | * Zefir_openMessageBoxText 1227 | * C: bool Zefir_openMessageBoxText(const Zefir_MessageBoxTextData* const data) 1228 | * C++: bool zefir::api::popup::text(const Zefir_MessageBoxTextData& data) 1229 | * Description: Opens a message box with text. 1230 | * Parameters: 1231 | * - const Zefir_MessageBoxTextData* const data (C): Message box configuration data 1232 | * - const Zefir_MessageBoxTextData& data (C++): Message box configuration data 1233 | * Returns: bool (true if opened successfully) 1234 | * Related Structures: 1235 | * Zefir_MessageBoxTextData 1236 | * - const char* m_title: Message box title 1237 | * - const char* m_text: Message text 1238 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1239 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1240 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1241 | * - Zefir_Optional_ZefirCallback m_onDismiss: Optional callback on dismiss 1242 | * 1243 | * Zefir_openMessageBoxYesNo 1244 | * C: bool Zefir_openMessageBoxYesNo(const Zefir_MessageBoxYesNoData* const data) 1245 | * C++: bool zefir::api::popup::yesNo(const Zefir_MessageBoxYesNoData& data) 1246 | * Description: Opens a yes/no message box. 1247 | * Parameters: 1248 | * - const Zefir_MessageBoxYesNoData* const data (C): Yes/no message box configuration data 1249 | * - const Zefir_MessageBoxYesNoData& data (C++): Yes/no message box configuration data 1250 | * Returns: bool (true if opened successfully) 1251 | * Related Structures: 1252 | * Zefir_MessageBoxYesNoData 1253 | * - const char* m_title: Message box title 1254 | * - const char* m_text: Message text 1255 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1256 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1257 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1258 | * - Zefir_Optional_ZefirCallback m_onConfirm: Optional callback on confirm 1259 | * - Zefir_Optional_ZefirCallback m_onDismiss: Optional callback on dismiss 1260 | * 1261 | * Zefir_openInputBoxInt 1262 | * C: bool Zefir_openInputBoxInt(const Zefir_InputBoxIntData* const data) 1263 | * C++: bool zefir::api::popup::inputInt(const Zefir_InputBoxIntData& data) 1264 | * Description: Opens an input box for integers. 1265 | * Parameters: 1266 | * - const Zefir_InputBoxIntData* const data (C): Input box int configuration data 1267 | * - const Zefir_InputBoxIntData& data (C++): Input box int configuration data 1268 | * Returns: bool (true if opened successfully) 1269 | * Related Structures: 1270 | * Zefir_InputBoxIntData 1271 | * - const char* m_title: Input box title 1272 | * - const char* m_label: Input label 1273 | * - const char* m_text: Descriptive text 1274 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1275 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1276 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1277 | * - Zefir_Optional_ZefirCallback_Int m_onConfirm: Optional callback on confirm 1278 | *რ: Optional callback on dismiss 1279 | * - Zefir_Optional_ZefirCallback_Int m_onDismiss: Optional callback on dismiss 1280 | * - Zefir_Optional_Float m_speed: Optional input speed 1281 | * - Zefir_Optional_Int m_min: Optional minimum value 1282 | * - Zefir_Optional_Int m_max: Optional maximum value 1283 | * - Zefir_Optional_ZefirCallback m_onInputActive: Optional callback on input active 1284 | * - Zefir_Optional_ZefirCallback m_onInputRelease: Optional callback on input release 1285 | * 1286 | * Zefir_openInputBoxFloat 1287 | * C: bool Zefir_openInputBoxFloat(const Zefir_InputBoxFloatData* const data) 1288 | * C++: bool zefir::api::popup::inputFloat(const Zefir_InputBoxFloatData& data) 1289 | * Description: Opens an input box for floats. 1290 | * Parameters: 1291 | * - const Zefir_InputBoxFloatData* const data (C): Input box float configuration data 1292 | * - const Zefir_InputBoxFloatData& data (C++): Input box float configuration data 1293 | * Returns: bool (true if opened successfully) 1294 | * Related Structures: 1295 | * Zefir_InputBoxFloatData 1296 | * - const char* m_title: Input box title 1297 | * - const char* m_label: Input label 1298 | * - const char* m_text: Descriptive text 1299 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1300 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1301 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1302 | * - Zefir_Optional_ZefirCallback_Float m_onConfirm: Optional callback on confirm 1303 | * - Zefir_Optional_ZefirCallback_Float m_onDismiss: Optional callback on dismiss 1304 | * - Zefir_Optional_Float m_speed: Optional input speed 1305 | * - Zefir_Optional_Float m_min: Optional minimum value 1306 | * - Zefir_Optional_Float m_max: Optional maximum value 1307 | * - Zefir_Optional_ZefirCallback m_onInputActive: Optional callback on input active 1308 | * - Zefir_Optional_ZefirCallback m_onInputRelease: Optional callback on input release 1309 | * 1310 | * Zefir_openInputBoxText 1311 | * C: bool Zefir_openInputBoxText(const Zefir_InputBoxTextData* const data) 1312 | * C++: bool zefir::api::popup::inputText(const Zefir_InputBoxTextData& data) 1313 | * Description: Opens an input box for text. 1314 | * Parameters: 1315 | * - const Zefir_InputBoxTextData* const data (C): Input box text configuration data 1316 | * - const Zefir_InputBoxTextData& data (C++): Input box text configuration data 1317 | * Returns: bool (true if opened successfully) 1318 | * Related Structures: 1319 | * Zefir_InputBoxTextData 1320 | * - const char* m_title: Input box title 1321 | * - const char* m_text: Descriptive text 1322 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1323 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1324 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1325 | * - Zefir_Optional_ZefirCallback_String m_onConfirm: Optional callback on confirm 1326 | * - Zefir_Optional_ZefirCallback_String m_onDismiss: Optional callback on dismiss 1327 | * - Zefir_Optional_ZefirCallback m_onInputActive: Optional callback on input active 1328 | * - Zefir_Optional_ZefirCallback m_onInputRelease: Optional callback on input release 1329 | * 1330 | * Zefir_openInputBoxTextHinted 1331 | * C: bool Zefir_openInputBoxTextHinted(const Zefir_InputBoxHintedTextData* const data) 1332 | * C++: bool zefir::api::popup::inputTextHinted(const Zefir_InputBoxHintedTextData& data) 1333 | * Description: Opens an input box for text with hints. 1334 | * Parameters: 1335 | * - const Zefir_InputBoxHintedTextData* const data (C): Hinted input box text configuration data 1336 | * - const Zefir_InputBoxHintedTextData& data (C++): Hinted input box text configuration data 1337 | * Returns: bool (true if opened successfully) 1338 | * Related Structures: 1339 | * Zefir_InputBoxHintedTextData 1340 | * - const char* m_title: Input box title 1341 | * - const char* m_text: Descriptive text 1342 | * - const char** m_hints: Array of hint strings 1343 | * - size_t m_hintCount: Number of hints 1344 | * - Zefir_Optional_Float m_customWidth: Optional custom width 1345 | * - Zefir_Optional_PImFont m_customFont: Optional custom font 1346 | * - Zefir_Optional_TextBlock_Alignment m_alignment: Optional text alignment 1347 | * - Zefir_Optional_ZefirCallback_String m_onConfirm: Optional callback on confirm 1348 | * - Zefir_Optional_ZefirCallback_String m_onDismiss: Optional callback on dismiss 1349 | * - Zefir_Optional_ZefirCallback m_onInputActive: Optional callback on input active 1350 | * - Zefir_Optional_ZefirCallback m_onInputRelease: Optional callback on input release 1351 | 1352 | * ----- Window Functions ----- 1353 | * 1354 | * These functions manage windows in the UI. 1355 | * 1356 | * Zefir_addWindow 1357 | * C: bool Zefir_addWindow(const Zefir_WindowData* const data) 1358 | * C++: bool zefir::api::window::add(const Zefir_WindowData& data) 1359 | * Description: Adds a new window. 1360 | * Parameters: 1361 | * - const Zefir_WindowData* const data (C): Window configuration data 1362 | * - const Zefir_WindowData& data (C++): Window configuration data 1363 | * Returns: bool (true if added successfully) 1364 | * Related Structures: 1365 | * Zefir_WindowData 1366 | * - const char* m_id: Window identifier 1367 | * - const char* m_title: Window title 1368 | * - Zefir_Optional_PBool m_handle: Optional handle pointer 1369 | * - Zefir_Optional_ZefirCallback m_onInit: Optional initialization callback 1370 | * - Zefir_Optional_ZefirCallback m_onRenderHeader: Optional header render callback 1371 | * - Zefir_Optional_ZefirCallback m_onRenderContent: Optional content render callback 1372 | * - Zefir_Optional_ZefirCallback m_onRenderFooter: Optional footer render callback 1373 | * 1374 | * Zefir_removeWindow 1375 | * Romansh 1376 | * C: bool Zefir_removeWindow(const char* const id) 1377 | * C++: bool zefir::api::window::remove(const std::string& id) 1378 | * Description: Removes a window by ID. 1379 | * Parameters: 1380 | * - const char* const id (C): ID of the window to remove 1381 | * - const std::string& id (C++): ID of the window to remove 1382 | * Returns: bool (true if removed successfully) 1383 | * 1384 | * Zefir_resetWindowPosition 1385 | * C: void Zefir_resetWindowPosition() 1386 | * C++: void zefir::api::window::resetPosition() 1387 | * Description: Resets the position of the window. 1388 | * Parameters: None 1389 | * Returns: void 1390 | 1391 | * ----- Macros ----- 1392 | * 1393 | * ZEFIR_NEW_UID 1394 | * Description: Macro to generate a new unique ID. 1395 | * In C, it combines timestamps and counter. 1396 | * In C++, it uses a lambda to register the ID. 1397 | */ --------------------------------------------------------------------------------