├── .copr ├── Makefile └── adawebpack.spec ├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE.BSD3 ├── LICENSE.GPL3 ├── Makefile ├── README.md ├── documentation └── Standard_Ada_Library.md ├── examples ├── .gitignore ├── Makefile ├── call_ada │ ├── Makefile │ ├── demo.adb │ ├── demo.ads │ ├── index.html │ ├── main.adb │ └── test.gpr ├── toggle_hidden │ ├── Makefile │ ├── demo.adb │ ├── demo.ads │ ├── index.html │ ├── main.adb │ └── test.gpr └── webgl_basic │ ├── Makefile │ ├── gl_demo.adb │ ├── gl_demo.ads │ ├── index.html │ ├── main.adb │ └── test.gpr ├── gnat ├── adawebpack.gpr └── adawebpack_config.gpr ├── packages ├── Fedora │ └── llvm.xml └── msys2 │ └── PKGBUILD ├── patches ├── gnat-llvm.patch └── llvm_wrapper2.patch ├── source ├── adawebpack.mjs ├── bom │ ├── web-window.adb │ └── web-window.ads ├── core │ ├── web-characters.ads │ ├── web-strings-wasm_helpers.adb │ ├── web-strings-wasm_helpers.ads │ ├── web-strings.adb │ ├── web-strings.ads │ ├── web-unicode.ads │ ├── web-utilities.adb │ ├── web-utilities.ads │ └── web.ads ├── dom │ ├── web-dom-character_datas.ads │ ├── web-dom-document_fragments.adb │ ├── web-dom-document_fragments.ads │ ├── web-dom-documents.adb │ ├── web-dom-documents.ads │ ├── web-dom-elements.adb │ ├── web-dom-elements.ads │ ├── web-dom-event_listeners.ads │ ├── web-dom-event_targets.ads │ ├── web-dom-events.adb │ ├── web-dom-events.ads │ ├── web-dom-nodes.adb │ ├── web-dom-nodes.ads │ ├── web-dom-non_element_parent_nodes.ads │ ├── web-dom-texts.ads │ ├── web-dom-token_lists.adb │ ├── web-dom-token_lists.ads │ └── web-dom.ads ├── html │ ├── web-dom-string_maps.adb │ ├── web-dom-string_maps.ads │ ├── web-html-buttons.adb │ ├── web-html-buttons.ads │ ├── web-html-canvases.adb │ ├── web-html-canvases.ads │ ├── web-html-documents.adb │ ├── web-html-documents.ads │ ├── web-html-elements.adb │ ├── web-html-elements.ads │ ├── web-html-images.ads │ ├── web-html-inputs.adb │ ├── web-html-inputs.ads │ ├── web-html-labels.adb │ ├── web-html-labels.ads │ ├── web-html-opt_groups.adb │ ├── web-html-opt_groups.ads │ ├── web-html-options.adb │ ├── web-html-options.ads │ ├── web-html-scripts.adb │ ├── web-html-scripts.ads │ ├── web-html-selects.adb │ ├── web-html-selects.ads │ ├── web-html-spans.ads │ ├── web-html-templates.adb │ ├── web-html-templates.ads │ ├── web-html-validity_states.adb │ ├── web-html-validity_states.ads │ └── web-html.ads ├── rtl │ ├── Makefile.target │ ├── a-elchha__wasm.adb │ ├── a-except.adb │ ├── a-except.ads │ ├── s-builti.adb │ ├── s-builti.ads │ ├── s-finmas__wasm.adb │ ├── s-init.adb │ ├── s-io__wasm.adb │ ├── s-memory__wasm.adb │ ├── s-parame.ads │ ├── s-soflin.adb │ ├── s-soflin.ads │ ├── s-stposu__wasm.adb │ ├── s-wchcnv.adb │ ├── s-wchcon.adb │ ├── s-wchcon.ads │ ├── s-wchstw__wasm.adb │ ├── system.ads │ └── wasm32.atp ├── sockets │ ├── web-message_events.adb │ ├── web-message_events.ads │ ├── web-sockets.adb │ └── web-sockets.ads ├── ui_events │ ├── web-ui_events-mouse_events.adb │ ├── web-ui_events-mouse_events.ads │ ├── web-ui_events-ui_events.ads │ └── web-ui_events.ads ├── url │ ├── web-url-url_search_params.adb │ ├── web-url-url_search_params.ads │ └── web-url.ads ├── wasm-abort_execution.adb ├── wasm-abort_execution.ads ├── wasm-attributes.ads ├── wasm-classes.ads ├── wasm-console.adb ├── wasm-console.ads ├── wasm-methods.ads ├── wasm-objects-attributes.adb ├── wasm-objects-attributes.ads ├── wasm-objects-constructors.adb ├── wasm-objects-constructors.ads ├── wasm-objects-methods.adb ├── wasm-objects-methods.ads ├── wasm-objects.adb ├── wasm-objects.ads ├── wasm-stringifiers.adb ├── wasm-stringifiers.ads ├── wasm-strings.adb ├── wasm-strings.ads ├── wasm.ads ├── webgl │ ├── web-gl-buffers.ads │ ├── web-gl-framebuffers.ads │ ├── web-gl-objects.ads │ ├── web-gl-programs.ads │ ├── web-gl-renderbuffers.ads │ ├── web-gl-rendering_contexts.adb │ ├── web-gl-rendering_contexts.ads │ ├── web-gl-shaders.ads │ ├── web-gl-textures.ads │ ├── web-gl-uniform_locations.ads │ └── web-gl.ads └── xhr │ ├── web-xhr-requests.adb │ ├── web-xhr-requests.ads │ └── web-xhr.ads ├── templates └── ada └── utilities ├── update-alternatives-clang.sh └── update-alternatives-gcc-11.sh /.copr/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021-2022 Max Reznik 2 | # 3 | # SPDX-License-Identifier: MIT 4 | # 5 | 6 | # To check run with 7 | # make -f .copr/Makefile srpm spec=$PWD/.copr/adawebpack.spec outdir=/tmp/ 8 | 9 | srpm: 10 | mkdir /tmp/.copr 11 | cp -v `dirname $(spec)`/../patches/*.patch /tmp/.copr 12 | tar cavf /tmp/.copr/`grep ^Source0: $(spec)| sed -e 's/^.* //'` \ 13 | --exclude-vcs -C .. `basename $(realpath .)` 14 | curl -L -o /tmp/.copr/gnat-llvm.zip https://github.com/AdaCore/gnat-llvm/archive/66e36d929524972353600db5d604d0189cf0308f.zip 15 | curl -L -o /tmp/.copr/bb-runtimes.zip https://github.com/Fabien-Chouteau/bb-runtimes/archive/e59080e0c4b49d12e00538595052dea2dceb5a6e.zip 16 | curl -L -o /tmp/.copr/gcc.zip https://github.com/gcc-mirror/gcc/archive/cd0059a1976303638cea95f216de129334fc04d1.zip 17 | rpmbuild -bs $(spec) --define="_sourcedir /tmp/.copr" --define="_srcrpmdir $(outdir)" 18 | -------------------------------------------------------------------------------- /.copr/adawebpack.spec: -------------------------------------------------------------------------------- 1 | %undefine _hardened_build 2 | %define _gprdir %_GNAT_project_dir 3 | %define rtl_version 0.1 4 | 5 | #brp-strip-static-archive stips index from libgnat.a 6 | %define __os_install_post %{nil} 7 | 8 | Name: adawebpack 9 | Version: 24.0.0 10 | Release: git%{?dist} 11 | Summary: Ada WASM Runtime and Bindings for Web API 12 | Group: Development/Libraries 13 | License: MIT 14 | URL: https://github.com/godunko/adawebpack 15 | Source0: adawebpack.tar.gz 16 | Source1: gnat-llvm.zip 17 | Source2: bb-runtimes.zip 18 | Source3: gcc.zip 19 | Patch0: gnat-llvm.patch 20 | Patch1: llvm_wrapper2.patch 21 | BuildRequires: bsdtar 22 | BuildRequires: gcc-gnat 23 | BuildRequires: fedora-gnat-project-common >= 3 24 | BuildRequires: gprbuild 25 | BuildRequires: gcc-c++ 26 | BuildRequires: libstdc++-static 27 | BuildRequires: lld 28 | BuildRequires: llvm16-devel 29 | BuildRequires: clang16-devel 30 | BuildRequires: chrpath 31 | 32 | # gprbuild only available on these: 33 | ExclusiveArch: %GPRbuild_arches 34 | 35 | %description 36 | Ada WASM Runtime and Bindings for Web API 37 | 38 | %prep 39 | %setup -T -b1 -a 0 -a 2 -n gnat-llvm-66e36d929524972353600db5d604d0189cf0308f/ 40 | #export LANG=C.utf8 41 | LANG=C.utf8 bsdtar -x -f %{S:3} gcc-*/gcc/ada 42 | mv -v gcc-*/gcc/ada llvm-interface/gnat_src 43 | mv %{name} llvm-interface/%{name}_src 44 | mv -v bb-runtimes-*/gnat_rts_sources/include/rts-sources llvm-interface/ 45 | ln -s %{name}_src/source/rtl/Makefile.target llvm-interface/ 46 | %patch 0 -p0 47 | %patch 1 -p0 48 | 49 | 50 | %build 51 | for J in /usr/bin/{llvm-config,opt,llvm-dis,llvm-ranlib}-16; do ln -v -s $J `basename $J -16`; done 52 | export PATH=$PWD:$PATH 53 | 54 | ln -s /usr/lib64/llvm16/lib/libclang-cpp.so ./libclangBasic.so 55 | 56 | export LIBRARY_PATH=$PWD 57 | 58 | make -C llvm-interface/ wasm 59 | rm -v -f llvm-config opt llvm-dis llvm-ranlib 60 | for J in /usr/bin/*-16; do ln -v -s $J `basename $J -16`; done 61 | PATH=`pwd`/llvm-interface/bin:$PATH make -C llvm-interface/%{name}_src GPRBUILD_FLAGS=--db\ `pwd`/llvm-interface/%{name}_src/packages/Fedora 62 | 63 | %install 64 | cd llvm-interface 65 | find -D exec bin -size +100k -exec chrpath -d {} \; 66 | mkdir -p %{buildroot}/usr/share/gprconfig 67 | mkdir -p %{buildroot}/usr/lib/gnat 68 | mkdir -p %{buildroot}/usr/share/%{name} 69 | cp %{name}_src/packages/Fedora/llvm.xml %{buildroot}/usr/share/gprconfig/ 70 | cp %{name}_src/gnat/%{name}_config.gpr %{buildroot}/usr/lib/gnat/ 71 | cp -r bin lib %{buildroot}/usr 72 | cp -v %{name}_src/source/%{name}.mjs %{buildroot}/usr/share/%{name}/ 73 | cp -v %{name}_src/utilities/update-alternatives-clang.sh %{buildroot}/usr/share/%{name}/ 74 | PATH=$PATH:`pwd`/bin gprconfig --batch -o /tmp/llvm.cgpr --db `pwd`/%{name}_src/packages/Fedora --target=llvm --config=ada,, 75 | PATH=$PATH:`pwd`/bin gprinstall --target=llvm --prefix=%{buildroot}/usr --project-subdir=%{buildroot}/usr/lib/gnat -P %{name}_src/gnat/%{name}.gpr -p --config=/tmp/llvm.cgpr 76 | 77 | %files 78 | %dir /usr/include/%{name} 79 | %dir /usr/lib/%{name} 80 | %dir /usr/share/%{name} 81 | %dir /usr/lib/rts-native 82 | %dir /usr/lib/gnat 83 | /usr/bin/llvm-* 84 | /usr/bin/target.atp 85 | /usr/include/%{name}/*.ad[sb] 86 | /usr/lib/%{name}/*.{ali,o} 87 | /usr/lib/rts-native/adainclude/*.ad[sb] 88 | /usr/lib/rts-native/adalib/*.ali 89 | /usr/lib/rts-native/adalib/libgnat.a 90 | /usr/lib/gnat/%{name}*.gpr 91 | /usr/lib/gnat/manifests/%{name} 92 | /usr/share/gprconfig/llvm.xml 93 | /usr/share/%{name}/%{name}.mjs 94 | /usr/share/%{name}/update-alternatives-clang.sh 95 | 96 | %changelog 97 | * Thu Jun 27 2024 Maxim Reznik - 24.0.0-git 98 | - Update to LLVM 16 and GCC 14 99 | 100 | * Fri Feb 21 2020 Maxim Reznik - 0.1.0-git 101 | - Initial package 102 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .objs 2 | *.wasm 3 | -------------------------------------------------------------------------------- /LICENSE.BSD3: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Vadim Godunko 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GPRBUILD_FLAGS ?= 2 | 3 | all: build build_examples 4 | 5 | build: 6 | gprbuild $(GPRBUILD_FLAGS) -p -P gnat/adawebpack.gpr 7 | 8 | build_examples: 9 | make -C examples 10 | 11 | clean: 12 | rm -rf .objs 13 | make -C examples clean 14 | -------------------------------------------------------------------------------- /documentation/Standard_Ada_Library.md: -------------------------------------------------------------------------------- 1 | # Supported packages of the standard Ada library 2 | 3 | * Ada 4 | * Assertions 5 | * Characters 6 | * Wide_Wide_Latin_1 7 | * Exceptions 8 | * Finalization 9 | * IO_Exceptions 10 | * Numerics 11 | * Elementary_Functions 12 | * Generic_Elementary_Functions 13 | * Long_Elementary_Functions 14 | * Long_Long_Elementary_Functions 15 | * Streams 16 | * Tags 17 | * Unchecked_Conversion 18 | * Unchecked_Deallocation 19 | * Interfaces 20 | * System 21 | * Address_To_Access_Conversions 22 | * Machine_Code 23 | * Storage_Elements 24 | * Storage_Pools 25 | * Subpools 26 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | adawebpack.js 2 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | EXAMPLE_DIRS = \ 2 | call_ada \ 3 | toggle_hidden \ 4 | webgl_basic 5 | 6 | all: 7 | for d in $(EXAMPLE_DIRS); do make -C $$d; done 8 | 9 | clean: 10 | for d in $(EXAMPLE_DIRS); do make -C $$d clean; done 11 | -------------------------------------------------------------------------------- /examples/call_ada/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: adawebpack.mjs 3 | gprbuild $(GPRBUILD_FLAGS) -p -P test.gpr 4 | 5 | adawebpack.mjs: 6 | ln -s ../../source/adawebpack.mjs 7 | 8 | clean: 9 | rm -rf .objs main.wasm adawebpack.mjs 10 | -------------------------------------------------------------------------------- /examples/call_ada/demo.adb: -------------------------------------------------------------------------------- 1 | 2 | with Ada.Numerics.Generic_Elementary_Functions; 3 | 4 | package body Demo is 5 | 6 | package Elementary_Functions is 7 | new Ada.Numerics.Generic_Elementary_Functions (Interfaces.IEEE_Float_64); 8 | 9 | --------------------------- 10 | -- Calculate_Square_Root -- 11 | --------------------------- 12 | 13 | function Calculate_Square_Root 14 | (Value : Interfaces.IEEE_Float_64) return Interfaces.IEEE_Float_64 is 15 | begin 16 | return Elementary_Functions.Sqrt (Value); 17 | end Calculate_Square_Root; 18 | 19 | end Demo; 20 | -------------------------------------------------------------------------------- /examples/call_ada/demo.ads: -------------------------------------------------------------------------------- 1 | 2 | with Interfaces; 3 | 4 | package Demo is 5 | 6 | function Calculate_Square_Root 7 | (Value : Interfaces.IEEE_Float_64) return Interfaces.IEEE_Float_64 8 | with Export => True, 9 | Convention => C, 10 | Link_Name => "Calculate_Square_Root"; 11 | 12 | end Demo; 13 | -------------------------------------------------------------------------------- /examples/call_ada/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | 27 | 28 | 29 |
30 | 31 | 32 |
33 | 34 |
35 | 36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/call_ada/main.adb: -------------------------------------------------------------------------------- 1 | 2 | with Demo; 3 | 4 | procedure Main is 5 | begin 6 | null; 7 | end Main; 8 | -------------------------------------------------------------------------------- /examples/call_ada/test.gpr: -------------------------------------------------------------------------------- 1 | 2 | with "../../gnat/adawebpack_config.gpr"; 3 | with "../../gnat/adawebpack.gpr"; 4 | 5 | project Test is 6 | 7 | for Target use "llvm"; 8 | for Object_Dir use ".objs"; 9 | for Source_Dirs use ("."); 10 | for Main use ("main.adb"); 11 | for Exec_Dir use "."; 12 | 13 | package Compiler renames AdaWebPack_Config.Compiler; 14 | 15 | package Binder is 16 | for Switches ("Ada") use ("-z"); 17 | end Binder; 18 | 19 | package Linker is 20 | for Switches ("Ada") use ("--target=wasm32", "-nostdlib", "-Wl,--export-all", "-Wl,--allow-undefined", "-Wl,--no-entry"); 21 | end Linker; 22 | 23 | package Builder is 24 | for Executable ("main.adb") use "main.wasm"; 25 | end Builder; 26 | 27 | end Test; 28 | -------------------------------------------------------------------------------- /examples/toggle_hidden/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: adawebpack.mjs 3 | gprbuild $(GPRBUILD_FLAGS) -p -P test.gpr 4 | 5 | adawebpack.mjs: 6 | ln -s ../../source/adawebpack.mjs 7 | 8 | clean: 9 | rm -rf .objs main.wasm adawebpack.mjs 10 | -------------------------------------------------------------------------------- /examples/toggle_hidden/demo.adb: -------------------------------------------------------------------------------- 1 | 2 | with Web.DOM.Event_Listeners; 3 | with Web.DOM.Events; 4 | with Web.HTML.Buttons; 5 | with Web.HTML.Elements; 6 | with Web.Strings; 7 | with Web.Window; 8 | 9 | package body Demo is 10 | 11 | function "+" (Item : Wide_Wide_String) return Web.Strings.Web_String 12 | renames Web.Strings.To_Web_String; 13 | 14 | type Listener is 15 | limited new Web.DOM.Event_Listeners.Event_Listener with null record; 16 | 17 | overriding procedure Handle_Event 18 | (Self : in out Listener; 19 | Event : in out Web.DOM.Events.Event'Class); 20 | 21 | L : aliased Listener; 22 | 23 | ------------------ 24 | -- Handle_Event -- 25 | ------------------ 26 | 27 | overriding procedure Handle_Event 28 | (Self : in out Listener; 29 | Event : in out Web.DOM.Events.Event'Class) 30 | is 31 | X : Web.HTML.Elements.HTML_Element 32 | := Web.Window.Document.Get_Element_By_Id (+"toggle_label"); 33 | 34 | begin 35 | X.Set_Hidden (not X.Get_Hidden); 36 | end Handle_Event; 37 | 38 | --------------------- 39 | -- Initialize_Demo -- 40 | --------------------- 41 | 42 | procedure Initialize_Demo is 43 | B : Web.HTML.Buttons.HTML_Button_Element 44 | := Web.Window.Document.Get_Element_By_Id 45 | (+"toggle_button").As_HTML_Button; 46 | 47 | begin 48 | B.Add_Event_Listener (+"click", L'Access); 49 | B.Set_Disabled (False); 50 | end Initialize_Demo; 51 | 52 | begin 53 | Initialize_Demo; 54 | end Demo; 55 | -------------------------------------------------------------------------------- /examples/toggle_hidden/demo.ads: -------------------------------------------------------------------------------- 1 | 2 | package Demo is 3 | 4 | procedure Initialize_Demo; 5 | 6 | end Demo; 7 | -------------------------------------------------------------------------------- /examples/toggle_hidden/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/toggle_hidden/main.adb: -------------------------------------------------------------------------------- 1 | -- with Hello; 2 | with Demo; 3 | 4 | procedure Main is 5 | begin 6 | null; 7 | end Main; 8 | -------------------------------------------------------------------------------- /examples/toggle_hidden/test.gpr: -------------------------------------------------------------------------------- 1 | 2 | with "../../gnat/adawebpack_config.gpr"; 3 | with "../../gnat/adawebpack.gpr"; 4 | 5 | project Test is 6 | 7 | for Target use "llvm"; 8 | for Object_Dir use ".objs"; 9 | for Source_Dirs use ("."); 10 | for Main use ("main.adb"); 11 | for Exec_Dir use "."; 12 | 13 | package Compiler renames AdaWebPack_Config.Compiler; 14 | 15 | package Binder is 16 | for Switches ("Ada") use ("-z"); 17 | end Binder; 18 | 19 | package Linker is 20 | for Switches ("Ada") use ("--target=wasm32", "-nostdlib", "-Wl,--export-all", "-Wl,--allow-undefined", "-Wl,--no-entry"); 21 | end Linker; 22 | 23 | package Builder is 24 | for Executable ("main.adb") use "main.wasm"; 25 | end Builder; 26 | 27 | end Test; 28 | -------------------------------------------------------------------------------- /examples/webgl_basic/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: adawebpack.mjs 3 | gprbuild $(GPRBUILD_FLAGS) -p -P test.gpr 4 | 5 | adawebpack.mjs: 6 | ln -s ../../source/adawebpack.mjs 7 | 8 | clean: 9 | rm -rf .objs main.wasm adawebpack.mjs 10 | -------------------------------------------------------------------------------- /examples/webgl_basic/gl_demo.ads: -------------------------------------------------------------------------------- 1 | 2 | package GL_Demo is 3 | 4 | pragma Elaborate_Body; 5 | 6 | end GL_Demo; 7 | -------------------------------------------------------------------------------- /examples/webgl_basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 20 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/webgl_basic/main.adb: -------------------------------------------------------------------------------- 1 | with GL_Demo; 2 | 3 | procedure Main is 4 | begin 5 | null; 6 | end Main; 7 | -------------------------------------------------------------------------------- /examples/webgl_basic/test.gpr: -------------------------------------------------------------------------------- 1 | 2 | with "../../gnat/adawebpack_config.gpr"; 3 | with "../../gnat/adawebpack.gpr"; 4 | 5 | project Test is 6 | 7 | for Target use "llvm"; 8 | for Object_Dir use ".objs"; 9 | for Source_Dirs use ("."); 10 | for Main use ("main.adb"); 11 | for Exec_Dir use "."; 12 | 13 | package Compiler renames AdaWebPack_Config.Compiler; 14 | 15 | package Binder is 16 | for Switches ("Ada") use ("-z"); 17 | end Binder; 18 | 19 | package Linker is 20 | for Switches ("Ada") use ("--target=wasm32", "-nostdlib", "-Wl,--export-all", "-Wl,--allow-undefined", "-Wl,--no-entry"); 21 | end Linker; 22 | 23 | package Builder is 24 | for Executable ("main.adb") use "main.wasm"; 25 | end Builder; 26 | 27 | end Test; 28 | -------------------------------------------------------------------------------- /gnat/adawebpack_config.gpr: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | abstract project AdaWebPack_Config is 38 | 39 | for Object_Dir use "../.objs/"; 40 | 41 | package Compiler is 42 | for Switches ("Ada") use ("--target=wasm32", "-O1"); 43 | end Compiler; 44 | 45 | end AdaWebPack_Config; 46 | -------------------------------------------------------------------------------- /packages/msys2/PKGBUILD: -------------------------------------------------------------------------------- 1 | _realname=adawebpack 2 | pkgbase=mingw-w64-${_realname} 3 | pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} 4 | pkgver=22.1.0 5 | pkgrel=1 6 | pkgdesc="AdaWebPack is a toolchain, RTL and WebAPI binding for Ada on WebAssembly" 7 | arch=('any') 8 | mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') 9 | url="https://github.com/godunko/adawebpack" 10 | license=('GPL3' 'BSD3') 11 | makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada" 12 | "${MINGW_PACKAGE_PREFIX}-gprbuild" 13 | "${MINGW_PACKAGE_PREFIX}-clang<15.0.0" 14 | "${MINGW_PACKAGE_PREFIX}-lld<15.0.0" 15 | "${MINGW_PACKAGE_PREFIX}-llvm<15.0.0") 16 | depends=("${MINGW_PACKAGE_PREFIX}-llvm<15.0.0") 17 | source=("gnat-llvm.zip::https://github.com/AdaCore/gnat-llvm/archive/28c91e94c4227e6d9eabb2aeed4c0c12f6a4f3de.zip" 18 | "bb-runtimes.zip::https://github.com/Fabien-Chouteau/bb-runtimes/archive/c1d089bd8880cec250266cf71d6a22cc74fdba79.zip" 19 | "gcc.zip::https://github.com/gcc-mirror/gcc/archive/64d5610f44c995b88261bf83f53a200355cb530f.zip" 20 | "${_realname}.tar.gz") 21 | md5sums=( SKIP SKIP SKIP SKIP ) 22 | noextract=( "gcc.zip" ) 23 | 24 | prepare() { 25 | cd ${srcdir}/ 26 | bsdtar -x -f gcc.zip gcc-*/gcc/ada 27 | mv -v gnat-llvm-* gnat-llvm 28 | mv -v gcc-*/gcc/ada gnat-llvm/llvm-interface/gnat_src 29 | mv -v bb-runtimes-*/gnat_rts_sources/include/rts-sources gnat-llvm/llvm-interface/ 30 | mv -v adawebpack gnat-llvm/llvm-interface/adawebpack_src 31 | cd gnat-llvm 32 | patch -p0 < llvm-interface/adawebpack_src/patches/gnat-llvm.patch 33 | cd llvm-interface/ 34 | cp -v adawebpack_src/source/rtl/Makefile.target . 35 | rm -rf gcc-* 36 | rm -rf bb-runtimes-* 37 | } 38 | 39 | 40 | build() { 41 | cd ${srcdir}/gnat-llvm/llvm-interface/ 42 | make wasm 43 | export PATH=$PWD/bin:$PATH 44 | gprconfig --batch -o /tmp/llvm.cgpr --db `pwd`/adawebpack_src/packages/Fedora --target=llvm --config=ada,, 45 | gprbuild --target=llvm -P adawebpack_src/gnat/adawebpack.gpr -p --config=/tmp/llvm.cgpr 46 | } 47 | 48 | package() { 49 | cd ${srcdir}/gnat-llvm/llvm-interface/ 50 | export PATH=$PWD/bin:$PATH 51 | PREFIX=${pkgdir} 52 | mkdir -p ${pkgdir}${MINGW_PREFIX}/share/gprconfig 53 | mkdir -p ${pkgdir}${MINGW_PREFIX}/lib/gnat 54 | mkdir -p ${pkgdir}${MINGW_PREFIX}/share/adawebpack 55 | cp adawebpack_src/packages/Fedora/llvm.xml ${pkgdir}${MINGW_PREFIX}/share/gprconfig/ 56 | cp adawebpack_src/gnat/adawebpack_config.gpr ${pkgdir}${MINGW_PREFIX}/lib/gnat/ 57 | cp -r bin lib ${pkgdir}${MINGW_PREFIX} 58 | cp -v adawebpack_src/source/adawebpack.mjs ${pkgdir}${MINGW_PREFIX}/share/adawebpack/ 59 | gprinstall --target=llvm --prefix=${pkgdir}${MINGW_PREFIX} --project-subdir=${pkgdir}${MINGW_PREFIX}/lib/gnat -P adawebpack_src/gnat/adawebpack.gpr -p --config=/tmp/llvm.cgpr 60 | } -------------------------------------------------------------------------------- /patches/gnat-llvm.patch: -------------------------------------------------------------------------------- 1 | diff -aur llvm-interface/gnatllvm-instructions.adb llvm-interface/gnatllvm-instructions.adb 2 | --- llvm-interface/gnatllvm-instructions.adb 3 | +++ llvm-interface/gnatllvm-instructions.adb 4 | @@ -1548,29 +1548,23 @@ 5 | Args : GL_Value_Array; 6 | Name : String := "") return Value_T 7 | is 8 | - function To_Param_Num (Idx : Nat) return unsigned; 9 | - -- Map index in Args array to LLVM parameter number 10 | - 11 | LLVM_Func : constant Value_T := +Func; 12 | No_Raise : constant Boolean := 13 | No_Exception_Propagation_Active 14 | or else (Is_A_Function (Func) and then Does_Not_Throw (Func)); 15 | Lpad : constant Basic_Block_T := 16 | (if No_Raise then No_BB_T else Get_Landing_Pad); 17 | + Act_Param : Int := -1; 18 | Arg_Values : aliased Value_Array (Args'Range); 19 | Next_BB : Basic_Block_T; 20 | Call_Inst : Value_T; 21 | 22 | - ------------------ 23 | - -- To_Param_Num -- 24 | - ------------------ 25 | - 26 | - function To_Param_Num (Idx : Nat) return unsigned is 27 | - (unsigned (Idx - Args'First)); 28 | - 29 | begin 30 | for J in Args'Range loop 31 | Arg_Values (J) := +Args (J); 32 | + if Relationship (Args (J)) = Reference_To_Activation_Record then 33 | + Act_Param := J - Args'First; 34 | + end if; 35 | end loop; 36 | 37 | -- If we have a landing pad, use an invoke instruction, first creating 38 | @@ -1587,32 +1581,22 @@ 39 | Arg_Values'Address, Arg_Values'Length, Name); 40 | end if; 41 | 42 | - -- Set some parameter attributes based on the called function. 43 | - -- It is peculiar that the two LLVM calls to set attributes of 44 | - -- the call instruction have a different value for the first 45 | - -- parameter. 46 | + -- If we found a parameter that was an activation record, mark it 47 | 48 | - for J in Args'Range loop 49 | + if Act_Param >= 0 50 | + and then not Restrictions_On_Target.Set (No_Implicit_Dynamic_Code) 51 | + then 52 | + Add_Nest_Attribute (Call_Inst, unsigned (Act_Param)); 53 | + end if; 54 | 55 | - -- For each parameter that's a pointer, set the alignment. 56 | + -- For each parameter that's a pointer, set the alignment and 57 | 58 | + for J in Args'Range loop 59 | if Get_Type_Kind (Type_Of (Args (J))) = Pointer_Type_Kind then 60 | - Set_Instr_Param_Alignment (Call_Inst, To_Param_Num (J) + 1, 61 | + Set_Instr_Param_Alignment (Call_Inst, unsigned (J), 62 | unsigned (To_Bytes (Alignment 63 | (Args (J))))); 64 | end if; 65 | - 66 | - -- If this is a direct call and we have a parameter of the function 67 | - -- that's an activation record, mark it in the call too. 68 | - 69 | - if (Is_A_Function (Func) 70 | - and then not Restrictions_On_Target.Set 71 | - (No_Implicit_Dynamic_Code) 72 | - and then Has_Nest_Attribute (LLVM_Func, To_Param_Num (J))) 73 | - or else Relationship (Args (J)) = Reference_To_Activation_Record 74 | - then 75 | - Add_Nest_Attribute (Call_Inst, To_Param_Num (J)); 76 | - end if; 77 | end loop; 78 | 79 | return Call_Inst; 80 | Only in new/gnat-llvm/llvm-interface: gnatllvm-instructions.adb.orig 81 | -------------------------------------------------------------------------------- /patches/llvm_wrapper2.patch: -------------------------------------------------------------------------------- 1 | diff -Naur llvm-interface/llvm_wrapper2.cc llvm-interface/llvm_wrapper2.cc 2 | --- llvm-interface/llvm_wrapper2.cc 1970-01-01 03:00:00.000000000 +0300 3 | +++ llvm-interface/llvm_wrapper2.cc 2024-06-26 12:52:10.915250001 +0300 4 | @@ -0,0 +1,85 @@ 5 | +#include "llvm-c/Core.h" 6 | +#include "llvm-c/TargetMachine.h" 7 | +#include "llvm/Analysis/TargetTransformInfo.h" 8 | +#include "llvm/IR/DataLayout.h" 9 | +#include "llvm/IR/LegacyPassManager.h" 10 | +#include "llvm/IR/Module.h" 11 | +#include "llvm/MC/SubtargetFeature.h" 12 | +#include "llvm/MC/TargetRegistry.h" 13 | +#include "llvm/Support/FileSystem.h" 14 | +#include "llvm/Support/Host.h" 15 | +#include "llvm/Support/raw_ostream.h" 16 | +#include "llvm/Target/CodeGenCWrappers.h" 17 | +#include "llvm/Target/TargetMachine.h" 18 | +#include 19 | +#include 20 | + 21 | +using namespace llvm; 22 | + 23 | +static TargetMachine *unwrap(LLVMTargetMachineRef P) { 24 | + return reinterpret_cast(P); 25 | +} 26 | +static Target *unwrap(LLVMTargetRef P) { 27 | + return reinterpret_cast(P); 28 | +} 29 | +static LLVMTargetMachineRef wrap(const TargetMachine *P) { 30 | + return reinterpret_cast(const_cast(P)); 31 | +} 32 | +static LLVMTargetRef wrap(const Target * P) { 33 | + return reinterpret_cast(const_cast(P)); 34 | +} 35 | + 36 | +extern "C" 37 | +LLVMTargetMachineRef LLVMCreateTargetMachineWithABI(LLVMTargetRef T, 38 | + const char *Triple, const char *CPU, const char *Features, 39 | + const char *ABI, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, 40 | + LLVMCodeModel CodeModel) { 41 | + std::optional RM; 42 | + switch (Reloc){ 43 | + case LLVMRelocStatic: 44 | + RM = Reloc::Static; 45 | + break; 46 | + case LLVMRelocPIC: 47 | + RM = Reloc::PIC_; 48 | + break; 49 | + case LLVMRelocDynamicNoPic: 50 | + RM = Reloc::DynamicNoPIC; 51 | + break; 52 | + case LLVMRelocROPI: 53 | + RM = Reloc::ROPI; 54 | + break; 55 | + case LLVMRelocRWPI: 56 | + RM = Reloc::RWPI; 57 | + break; 58 | + case LLVMRelocROPI_RWPI: 59 | + RM = Reloc::ROPI_RWPI; 60 | + break; 61 | + default: 62 | + break; 63 | + } 64 | + 65 | + bool JIT; 66 | + std::optional CM = unwrap(CodeModel, JIT); 67 | + 68 | + CodeGenOpt::Level OL; 69 | + switch (Level) { 70 | + case LLVMCodeGenLevelNone: 71 | + OL = CodeGenOpt::None; 72 | + break; 73 | + case LLVMCodeGenLevelLess: 74 | + OL = CodeGenOpt::Less; 75 | + break; 76 | + case LLVMCodeGenLevelAggressive: 77 | + OL = CodeGenOpt::Aggressive; 78 | + break; 79 | + default: 80 | + OL = CodeGenOpt::Default; 81 | + break; 82 | + } 83 | + 84 | + TargetOptions opt; 85 | + opt.MCOptions.ABIName = ABI; 86 | + return wrap(unwrap(T)->createTargetMachine(Triple, CPU, Features, opt, RM, CM, 87 | + OL, JIT)); 88 | +} 89 | + 90 | -------------------------------------------------------------------------------- /source/core/web-characters.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | private with Interfaces; 38 | 39 | package Web.Characters is 40 | 41 | pragma Preelaborate; 42 | 43 | type Web_Character is private; 44 | 45 | private 46 | 47 | type Web_Character is 48 | new Interfaces.Unsigned_32 range 16#00_0000# .. 16#10_FFFF#; 49 | 50 | end Web.Characters; 51 | -------------------------------------------------------------------------------- /source/core/web-strings-wasm_helpers.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Internal package for interfacing between JavaScript and WASM. 37 | ------------------------------------------------------------------------------ 38 | 39 | with Interfaces; 40 | with System; 41 | 42 | package Web.Strings.WASM_Helpers is 43 | 44 | pragma Preelaborate; 45 | 46 | procedure To_JS 47 | (Item : Web_String; 48 | Address : out System.Address; 49 | Size : out Interfaces.Unsigned_32); 50 | -- Returns address and size of the string data for given string object. 51 | -- Address is valid till string object exists and immutable. 52 | 53 | function To_Ada (Item : System.Address) return Web.Strings.Web_String; 54 | -- Validate and wrap given by address shared data object. 55 | 56 | end Web.Strings.WASM_Helpers; 57 | -------------------------------------------------------------------------------- /source/core/web-unicode.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Internal root package for Unicode support 37 | ------------------------------------------------------------------------------ 38 | 39 | with Interfaces; 40 | 41 | package Web.Unicode is 42 | 43 | pragma Pure; 44 | 45 | type Unicode_Code_Point is 46 | new Interfaces.Unsigned_32 range 16#00_0000# .. 16#10_FFFF#; 47 | 48 | ----------- 49 | -- UTF16 -- 50 | ----------- 51 | 52 | type UTF16_Code_Unit is new Interfaces.Unsigned_16; 53 | 54 | type UTF16_Code_Unit_Array is 55 | array (Interfaces.Unsigned_32 range <>) of UTF16_Code_Unit; 56 | 57 | end Web.Unicode; 58 | -------------------------------------------------------------------------------- /source/core/web-utilities.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Interfaces; 38 | with System; 39 | 40 | with Web.Strings.WASM_Helpers; 41 | 42 | package body Web.Utilities is 43 | 44 | -------------------- 45 | -- Is_Instance_Of -- 46 | -------------------- 47 | 48 | function Is_Instance_Of 49 | (Object : WASM.Objects.Object_Reference'Class; 50 | Class_Name : Web.Strings.Web_String) return Boolean 51 | is 52 | use type Interfaces.Unsigned_32; 53 | 54 | function Imported 55 | (Identifier : WASM.Objects.Object_Identifier; 56 | Address : System.Address; 57 | Size : Interfaces.Unsigned_32) return Interfaces.Unsigned_32 58 | with Import => True, 59 | Convention => C, 60 | Link_Name => "__adawebpack__is_instance_of"; 61 | 62 | A : System.Address; 63 | S : Interfaces.Unsigned_32; 64 | 65 | begin 66 | Web.Strings.WASM_Helpers.To_JS (Class_Name, A, S); 67 | 68 | return Imported (Object.Identifier, A, S) /= 0; 69 | end Is_Instance_Of; 70 | 71 | end Web.Utilities; 72 | -------------------------------------------------------------------------------- /source/core/web-utilities.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Objects; 38 | 39 | with Web.Strings; 40 | 41 | package Web.Utilities is 42 | 43 | pragma Preelaborate; 44 | 45 | function Is_Instance_Of 46 | (Object : WASM.Objects.Object_Reference'Class; 47 | Class_Name : Web.Strings.Web_String) return Boolean; 48 | -- Returns True when Object is instance of Class_Name class. 49 | 50 | end Web.Utilities; 51 | -------------------------------------------------------------------------------- /source/core/web.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020-2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Interfaces; 38 | 39 | package Web is 40 | 41 | pragma Pure; 42 | 43 | subtype DOM_Long is Interfaces.Integer_32; 44 | 45 | subtype DOM_Short is Interfaces.Integer_16; 46 | 47 | subtype DOM_Unsigned_Short is Interfaces.Unsigned_16; 48 | 49 | subtype DOM_Unsigned_Long is Interfaces.Unsigned_32; 50 | 51 | subtype DOM_Double is Interfaces.IEEE_Float_64; 52 | 53 | ---------------------------------- 54 | -- High Resolution Time Level 2 -- 55 | ---------------------------------- 56 | 57 | type DOM_High_Res_Time_Stamp is new DOM_Double; 58 | 59 | private 60 | 61 | use type DOM_Long; 62 | use type DOM_Unsigned_Long; 63 | use type DOM_Unsigned_Short; 64 | use type DOM_Double; 65 | -- Use all subtypes to provide default operators in all children 66 | -- packages. 67 | 68 | end Web; 69 | -------------------------------------------------------------------------------- /source/dom/web-dom-document_fragments.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Methods; 38 | with WASM.Objects.Methods; 39 | 40 | package body Web.DOM.Document_Fragments is 41 | 42 | ----------------------- 43 | -- Get_Element_By_Id -- 44 | ----------------------- 45 | 46 | overriding function Get_Element_By_Id 47 | (Self : Document_Fragment; 48 | Element_Id : Web.Strings.Web_String) return Web.DOM.Elements.Element is 49 | begin 50 | return 51 | Web.DOM.Elements.Instantiate 52 | (WASM.Objects.Methods.Call_Object_String 53 | (Self, WASM.Methods.Get_Element_By_Id, Element_Id)); 54 | end Get_Element_By_Id; 55 | 56 | end Web.DOM.Document_Fragments; 57 | -------------------------------------------------------------------------------- /source/dom/web-dom-event_listeners.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Events; 38 | 39 | package Web.DOM.Event_Listeners is 40 | 41 | pragma Preelaborate; 42 | 43 | type Event_Listener is limited interface; 44 | 45 | type Event_Listener_Access is access all Event_Listener'Class; 46 | 47 | not overriding procedure Handle_Event 48 | (Self : in out Event_Listener; 49 | Event : in out Web.DOM.Events.Event'Class) is abstract; 50 | 51 | end Web.DOM.Event_Listeners; 52 | -------------------------------------------------------------------------------- /source/dom/web-dom-event_targets.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Event_Listeners; 38 | with Web.Strings; 39 | 40 | package Web.DOM.Event_Targets is 41 | 42 | pragma Preelaborate; 43 | 44 | type Event_Target is limited interface; 45 | 46 | not overriding procedure Add_Event_Listener 47 | (Self : in out Event_Target; 48 | Name : Web.Strings.Web_String; 49 | Callback : not null Web.DOM.Event_Listeners.Event_Listener_Access; 50 | Capture : Boolean := False) is abstract; 51 | 52 | end Web.DOM.Event_Targets; 53 | -------------------------------------------------------------------------------- /source/dom/web-dom-events.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Objects; 38 | 39 | limited with Web.Message_Events; 40 | limited with Web.UI_Events.Mouse_Events; 41 | 42 | package Web.DOM.Events is 43 | 44 | pragma Preelaborate; 45 | 46 | type Event is new WASM.Objects.Object_Reference with null record; 47 | 48 | function As_Mouse_Event 49 | (Self : Event'Class) return Web.UI_Events.Mouse_Events.Mouse_Event; 50 | 51 | function As_Message_Event 52 | (Self : Event'Class) return Web.Message_Events.Message_Event; 53 | 54 | end Web.DOM.Events; 55 | -------------------------------------------------------------------------------- /source/dom/web-dom-non_element_parent_nodes.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Elements; 38 | with Web.Strings; 39 | 40 | package Web.DOM.Non_Element_Parent_Nodes is 41 | 42 | pragma Preelaborate; 43 | 44 | type Non_Element_Parent_Node is limited interface; 45 | 46 | not overriding function Get_Element_By_Id 47 | (Self : Non_Element_Parent_Node; 48 | Element_Id : Web.Strings.Web_String) 49 | return Web.DOM.Elements.Element is abstract; 50 | -- Returns the first element within node's descendants whose ID is 51 | -- Element_Id. 52 | 53 | end Web.DOM.Non_Element_Parent_Nodes; 54 | -------------------------------------------------------------------------------- /source/dom/web-dom-texts.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- Matreshka Project -- 4 | -- -- 5 | -- Web Framework -- 6 | -- -- 7 | -- Web API Definition -- 8 | -- -- 9 | ------------------------------------------------------------------------------ 10 | -- -- 11 | -- Copyright © 2014-2020, Vadim Godunko -- 12 | -- All rights reserved. -- 13 | -- -- 14 | -- Redistribution and use in source and binary forms, with or without -- 15 | -- modification, are permitted provided that the following conditions -- 16 | -- are met: -- 17 | -- -- 18 | -- * Redistributions of source code must retain the above copyright -- 19 | -- notice, this list of conditions and the following disclaimer. -- 20 | -- -- 21 | -- * Redistributions in binary form must reproduce the above copyright -- 22 | -- notice, this list of conditions and the following disclaimer in the -- 23 | -- documentation and/or other materials provided with the distribution. -- 24 | -- -- 25 | -- * Neither the name of the Vadim Godunko, IE nor the names of its -- 26 | -- contributors may be used to endorse or promote products derived from -- 27 | -- this software without specific prior written permission. -- 28 | -- -- 29 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 30 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 31 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 32 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 33 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 34 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- 35 | -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- 36 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- 37 | -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- 38 | -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- 39 | -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 40 | -- -- 41 | ------------------------------------------------------------------------------ 42 | -- $Revision: 5324 $ $Date: 2015-05-20 16:26:45 +0300 (Wed, 20 May 2015) $ 43 | ------------------------------------------------------------------------------ 44 | 45 | with Web.DOM.Character_Datas; 46 | 47 | package Web.DOM.Texts is 48 | 49 | pragma Preelaborate; 50 | 51 | type Text is new Web.DOM.Character_Datas.Character_Data with null record; 52 | 53 | end Web.DOM.Texts; 54 | -------------------------------------------------------------------------------- /source/dom/web-dom.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | package Web.DOM is 38 | 39 | pragma Pure; 40 | 41 | end Web.DOM; 42 | -------------------------------------------------------------------------------- /source/html/web-dom-string_maps.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with System; 38 | 39 | with Web.Strings.WASM_Helpers; 40 | 41 | package body Web.DOM.String_Maps is 42 | 43 | --------- 44 | -- Get -- 45 | --------- 46 | 47 | function Get 48 | (Self : DOM_String_Map'Class; 49 | Name : Web.Strings.Web_String) return Web.Strings.Web_String 50 | is 51 | function Imported 52 | (Identifier : WASM.Objects.Object_Identifier; 53 | Address : System.Address; 54 | Length : Interfaces.Unsigned_32) 55 | return System.Address 56 | with Import => True, 57 | Convention => C, 58 | Link_Name => "__adawebpack__dom__StringMap__getter"; 59 | 60 | A : System.Address; 61 | S : Interfaces.Unsigned_32; 62 | 63 | begin 64 | Web.Strings.WASM_Helpers.To_JS (Name, A, S); 65 | 66 | return 67 | Web.Strings.WASM_Helpers.To_Ada (Imported (Self.Identifier, A, S)); 68 | end Get; 69 | 70 | end Web.DOM.String_Maps; 71 | -------------------------------------------------------------------------------- /source/html/web-dom-string_maps.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- This package provides binding for interface DOMStringMap. 37 | ------------------------------------------------------------------------------ 38 | 39 | with WASM.Objects; 40 | 41 | with Web.Strings; 42 | 43 | package Web.DOM.String_Maps is 44 | 45 | pragma Preelaborate; 46 | 47 | type DOM_String_Map is new WASM.Objects.Object_Reference with null record; 48 | 49 | -- interface DOMStringMap { 50 | -- [CEReactions] setter void (DOMString name , DOMString value); 51 | -- [CEReactions] deleter void (DOMString name); 52 | -- }; 53 | 54 | function Get 55 | (Self : DOM_String_Map'Class; 56 | Name : Web.Strings.Web_String) return Web.Strings.Web_String; 57 | 58 | end Web.DOM.String_Maps; 59 | -------------------------------------------------------------------------------- /source/html/web-html-buttons.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020-2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Attributes; 38 | with WASM.Objects.Attributes; 39 | 40 | package body Web.HTML.Buttons is 41 | 42 | ------------------ 43 | -- Get_Disabled -- 44 | ------------------ 45 | 46 | function Get_Disabled (Self : HTML_Button_Element'Class) return Boolean is 47 | begin 48 | return 49 | WASM.Objects.Attributes.Get_Boolean (Self, WASM.Attributes.Disabled); 50 | end Get_Disabled; 51 | 52 | ------------------ 53 | -- Set_Disabled -- 54 | ------------------ 55 | 56 | procedure Set_Disabled 57 | (Self : in out HTML_Button_Element'Class; To : Boolean) is 58 | begin 59 | WASM.Objects.Attributes.Set_Boolean (Self, WASM.Attributes.Disabled, To); 60 | end Set_Disabled; 61 | 62 | end Web.HTML.Buttons; 63 | -------------------------------------------------------------------------------- /source/html/web-html-buttons.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | 39 | package Web.HTML.Buttons is 40 | 41 | pragma Preelaborate; 42 | 43 | type HTML_Button_Element is 44 | new Web.HTML.Elements.HTML_Element with null record; 45 | 46 | function Get_Disabled (Self : HTML_Button_Element'Class) return Boolean; 47 | procedure Set_Disabled 48 | (Self : in out HTML_Button_Element'Class; To : Boolean); 49 | -- Whether the form control is disabled 50 | 51 | end Web.HTML.Buttons; 52 | -------------------------------------------------------------------------------- /source/html/web-html-documents.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Elements; 38 | 39 | package body Web.HTML.Documents is 40 | 41 | ----------------------- 42 | -- Get_Element_By_Id -- 43 | ----------------------- 44 | 45 | function Get_Element_By_Id 46 | (Self : Document'Class; 47 | Element_Id : Web.Strings.Web_String) 48 | return Web.HTML.Elements.HTML_Element is 49 | begin 50 | return 51 | Web.HTML.Elements.Instantiate 52 | (Web.DOM.Elements.Element' 53 | (Self.Get_Element_By_Id (Element_Id)).Identifier); 54 | end Get_Element_By_Id; 55 | 56 | end Web.HTML.Documents; 57 | -------------------------------------------------------------------------------- /source/html/web-html-documents.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Documents; 38 | with Web.HTML.Elements; 39 | with Web.Strings; 40 | 41 | package Web.HTML.Documents is 42 | 43 | type Document is new Web.DOM.Documents.Document with null record; 44 | 45 | function Get_Element_By_Id 46 | (Self : Document'Class; 47 | Element_Id : Web.Strings.Web_String) 48 | return Web.HTML.Elements.HTML_Element; 49 | -- Conventional overloading of Get_Element_By_Id. 50 | 51 | end Web.HTML.Documents; 52 | -------------------------------------------------------------------------------- /source/html/web-html-images.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | with Web.Strings; 39 | 40 | package Web.HTML.Images is 41 | 42 | pragma Preelaborate; 43 | 44 | type HTML_Image_Element is 45 | new Web.HTML.Elements.HTML_Element with null record; 46 | 47 | end Web.HTML.Images; 48 | -------------------------------------------------------------------------------- /source/html/web-html-labels.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Attributes; 38 | with WASM.Objects.Attributes; 39 | 40 | package body Web.HTML.Labels is 41 | 42 | ------------------ 43 | -- Get_HTML_For -- 44 | ------------------ 45 | 46 | function Get_HTML_For 47 | (Self : HTML_Label_Element'Class) return Web.Strings.Web_String is 48 | begin 49 | return 50 | WASM.Objects.Attributes.Get_String (Self, WASM.Attributes.HTML_For); 51 | end Get_HTML_For; 52 | 53 | ------------------ 54 | -- Set_HTML_For -- 55 | ------------------ 56 | 57 | procedure Set_HTML_For 58 | (Self : in out HTML_Label_Element'Class; 59 | To : Web.Strings.Web_String) is 60 | begin 61 | WASM.Objects.Attributes.Set_String (Self, WASM.Attributes.HTML_For, To); 62 | end Set_HTML_For; 63 | 64 | end Web.HTML.Labels; 65 | -------------------------------------------------------------------------------- /source/html/web-html-labels.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | with Web.Strings; 39 | 40 | package Web.HTML.Labels is 41 | 42 | pragma Preelaborate; 43 | 44 | type HTML_Label_Element is 45 | new Web.HTML.Elements.HTML_Element with null record; 46 | -- interface HTMLLabelElement : HTMLElement { 47 | -- [HTMLConstructor] constructor(); 48 | -- 49 | -- readonly attribute HTMLFormElement? form; 50 | -- readonly attribute HTMLElement? control; 51 | -- }; 52 | 53 | function Get_HTML_For 54 | (Self : HTML_Label_Element'Class) return Web.Strings.Web_String; 55 | procedure Set_HTML_For 56 | (Self : in out HTML_Label_Element'Class; 57 | To : Web.Strings.Web_String); 58 | 59 | end Web.HTML.Labels; 60 | -------------------------------------------------------------------------------- /source/html/web-html-opt_groups.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Attributes; 38 | with WASM.Objects.Attributes; 39 | 40 | package body Web.HTML.Opt_Groups is 41 | 42 | ------------------ 43 | -- Get_Disabled -- 44 | ------------------ 45 | 46 | function Get_Disabled (Self : HTML_Opt_Group_Element'Class) return Boolean is 47 | begin 48 | return 49 | WASM.Objects.Attributes.Get_Boolean (Self, WASM.Attributes.Disabled); 50 | end Get_Disabled; 51 | 52 | ------------------ 53 | -- Set_Disabled -- 54 | ------------------ 55 | 56 | procedure Set_Disabled 57 | (Self : in out HTML_Opt_Group_Element'Class; To : Boolean) is 58 | begin 59 | WASM.Objects.Attributes.Set_Boolean (Self, WASM.Attributes.Disabled, To); 60 | end Set_Disabled; 61 | 62 | end Web.HTML.Opt_Groups; 63 | -------------------------------------------------------------------------------- /source/html/web-html-opt_groups.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | 39 | package Web.HTML.Opt_Groups is 40 | 41 | pragma Preelaborate; 42 | 43 | type HTML_Opt_Group_Element is 44 | new Web.HTML.Elements.HTML_Element with null record; 45 | 46 | function Get_Disabled (Self : HTML_Opt_Group_Element'Class) return Boolean; 47 | procedure Set_Disabled 48 | (Self : in out HTML_Opt_Group_Element'Class; To : Boolean); 49 | -- Whether the form control is disabled 50 | 51 | end Web.HTML.Opt_Groups; 52 | -------------------------------------------------------------------------------- /source/html/web-html-scripts.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | with Web.Strings; 39 | 40 | package Web.HTML.Scripts is 41 | 42 | pragma Preelaborate; 43 | 44 | type HTML_Script_Element is 45 | new Web.HTML.Elements.HTML_Element with null record; 46 | 47 | function Get_Text 48 | (Self : HTML_Script_Element'Class) return Web.Strings.Web_String; 49 | procedure Set_Text 50 | (Self : in out HTML_Script_Element'Class; 51 | To : Web.Strings.Web_String); 52 | 53 | end Web.HTML.Scripts; 54 | -------------------------------------------------------------------------------- /source/html/web-html-spans.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.HTML.Elements; 38 | with Web.Strings; 39 | 40 | package Web.HTML.Spans is 41 | 42 | pragma Preelaborate; 43 | 44 | type HTML_Span_Element is 45 | new Web.HTML.Elements.HTML_Element with null record; 46 | 47 | end Web.HTML.Spans; 48 | -------------------------------------------------------------------------------- /source/html/web-html-templates.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Attributes; 38 | with WASM.Objects.Attributes; 39 | 40 | package body Web.HTML.Templates is 41 | 42 | ----------------- 43 | -- Get_Content -- 44 | ----------------- 45 | 46 | function Get_Content 47 | (Self : HTML_Template_Element'Class) 48 | return Web.DOM.Document_Fragments.Document_Fragment is 49 | begin 50 | return 51 | Web.DOM.Document_Fragments.Instantiate 52 | (WASM.Objects.Attributes.Get_Object (Self, WASM.Attributes.Content)); 53 | end Get_Content; 54 | 55 | end Web.HTML.Templates; 56 | -------------------------------------------------------------------------------- /source/html/web-html-templates.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Document_Fragments; 38 | with Web.HTML.Elements; 39 | 40 | package Web.HTML.Templates is 41 | 42 | pragma Preelaborate; 43 | 44 | type HTML_Template_Element is 45 | new Web.HTML.Elements.HTML_Element with null record; 46 | 47 | function Get_Content 48 | (Self : HTML_Template_Element'Class) 49 | return Web.DOM.Document_Fragments.Document_Fragment; 50 | -- Returns the template contents (a DocumentFragment). 51 | 52 | end Web.HTML.Templates; 53 | -------------------------------------------------------------------------------- /source/html/web-html.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | package Web.HTML is 38 | 39 | pragma Pure; 40 | 41 | end Web.HTML; 42 | -------------------------------------------------------------------------------- /source/rtl/a-except.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME COMPONENTS -- 4 | -- -- 5 | -- A D A . E X C E P T I O N S -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- This specification is derived from the Ada Reference Manual for use with -- 10 | -- GNAT. In accordance with the copyright of that document, you can freely -- 11 | -- copy and modify this specification, provided that if you redistribute a -- 12 | -- modified version, any changes that you have made are clearly indicated. -- 13 | -- -- 14 | ------------------------------------------------------------------------------ 15 | -- 16 | -- Version is for use when there are no handlers in the partition (i.e. either 17 | -- of Restriction No_Exception_Handlers or No_Exception_Propagation is set). 18 | 19 | -- This is the WASM version of this package 20 | -- XXX GNATLLVM: Raise_Exception is incorrectly inlined in s-fatflt.ads 21 | 22 | with System; 23 | with Ada.Streams; 24 | 25 | package Ada.Exceptions is 26 | pragma Preelaborate; 27 | -- In accordance with Ada 2005 AI-362 28 | 29 | type Exception_Id is private; 30 | pragma Preelaborable_Initialization (Exception_Id); 31 | 32 | Null_Id : constant Exception_Id; 33 | 34 | procedure Raise_Exception (E : Exception_Id; Message : String := ""); 35 | pragma No_Return (Raise_Exception); 36 | -- Unconditionally call __gnat_last_chance_handler. 37 | -- Note that the exception is still raised even if E is the null exception 38 | -- id. This is a deliberate simplification for this profile (the use of 39 | -- Raise_Exception with a null id is very rare in any case, and this way 40 | -- we avoid introducing Raise_Exception_Always and we also avoid the if 41 | -- test in Raise_Exception). 42 | 43 | type Exception_Occurrence is limited private; 44 | pragma Preelaborable_Initialization (Exception_Occurrence); 45 | 46 | procedure Reraise_Occurrence (X : Exception_Occurrence); 47 | Null_Occurrence : constant Exception_Occurrence; 48 | 49 | private 50 | 51 | ------------------ 52 | -- Exception_Id -- 53 | ------------------ 54 | 55 | type Exception_Id is access all System.Address; 56 | Null_Id : constant Exception_Id := null; 57 | 58 | -- pragma Inline_Always (Raise_Exception); 59 | 60 | type Exception_Occurrence is access String; 61 | 62 | procedure Read_Exception_Occurrence 63 | (Stream : not null access Ada.Streams.Root_Stream_Type'Class; 64 | Item : out Exception_Occurrence); 65 | 66 | procedure Write_Exception_Occurrence 67 | (Stream : not null access Ada.Streams.Root_Stream_Type'Class; 68 | Item : Exception_Occurrence); 69 | 70 | for Exception_Occurrence'Read use Read_Exception_Occurrence; 71 | for Exception_Occurrence'Write use Write_Exception_Occurrence; 72 | 73 | Null_Occurrence : constant Exception_Occurrence := null; 74 | 75 | procedure Raise_From_Controlled_Operation (X : Exception_Occurrence); 76 | pragma No_Return (Raise_From_Controlled_Operation); 77 | pragma Export 78 | (Ada, Raise_From_Controlled_Operation, 79 | "__gnat_raise_from_controlled_operation"); 80 | -- Raise Program_Error, providing information about X (an exception raised 81 | -- during a controlled operation) in the exception message. 82 | 83 | end Ada.Exceptions; 84 | -------------------------------------------------------------------------------- /source/rtl/s-builti.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- 4 | -- -- 5 | -- S Y S T E M . I N I T -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- Copyright (C) 2020, Free Software Foundation, Inc. -- 10 | -- -- 11 | -- GNAT is free software; you can redistribute it and/or modify it under -- 12 | -- terms of the GNU General Public License as published by the Free Soft- -- 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- 14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 17 | -- -- 18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- 19 | -- additional permissions described in the GCC Runtime Library Exception, -- 20 | -- version 3.1, as published by the Free Software Foundation. -- 21 | -- -- 22 | -- You should have received a copy of the GNU General Public License and -- 23 | -- a copy of the GCC Runtime Library Exception along with this program; -- 24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25 | -- . -- 26 | -- -- 27 | -- GNARL was developed by the GNARL team at Florida State University. -- 28 | -- Extensive contributions were provided by AdaCore. -- 29 | -- -- 30 | ------------------------------------------------------------------------------ 31 | 32 | with Ada.Unchecked_Conversion; 33 | 34 | package body System.Builtins is 35 | 36 | ----------------- 37 | -- Builtin_Inf -- 38 | ----------------- 39 | 40 | function Builtin_Inf return Interfaces.IEEE_Float_64 is 41 | function To is 42 | new Ada.Unchecked_Conversion 43 | (Interfaces.Unsigned_64, Interfaces.IEEE_Float_64); 44 | 45 | begin 46 | return To (16#7FF0_0000_0000_0000#); 47 | end Builtin_Inf; 48 | 49 | ------------------ 50 | -- Builtin_Inff -- 51 | ------------------ 52 | 53 | function Builtin_Inff return Interfaces.IEEE_Float_32 is 54 | function To is 55 | new Ada.Unchecked_Conversion 56 | (Interfaces.Unsigned_32, Interfaces.IEEE_Float_32); 57 | 58 | begin 59 | return To (16#7F80_0000#); 60 | end Builtin_Inff; 61 | 62 | end System.Builtins; 63 | -------------------------------------------------------------------------------- /source/rtl/s-builti.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- 4 | -- -- 5 | -- S Y S T E M . I N I T -- 6 | -- -- 7 | -- S p e c -- 8 | -- -- 9 | -- Copyright (C) 2020, Free Software Foundation, Inc. -- 10 | -- -- 11 | -- GNAT is free software; you can redistribute it and/or modify it under -- 12 | -- terms of the GNU General Public License as published by the Free Soft- -- 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- 14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 17 | -- -- 18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- 19 | -- additional permissions described in the GCC Runtime Library Exception, -- 20 | -- version 3.1, as published by the Free Software Foundation. -- 21 | -- -- 22 | -- You should have received a copy of the GNU General Public License and -- 23 | -- a copy of the GCC Runtime Library Exception along with this program; -- 24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25 | -- . -- 26 | -- -- 27 | -- GNARL was developed by the GNARL team at Florida State University. -- 28 | -- Extensive contributions were provided by AdaCore. -- 29 | -- -- 30 | ------------------------------------------------------------------------------ 31 | 32 | -- This package provides implementation of some builtins functions missing 33 | -- in GNATLLVM compiler, but used by runtime. 34 | 35 | with Interfaces; 36 | 37 | package System.Builtins is 38 | 39 | function Builtin_Inf return Interfaces.IEEE_Float_64 40 | with Export, Convention => C, External_Name => "__builtin_inf"; 41 | 42 | function Builtin_Inff return Interfaces.IEEE_Float_32 43 | with Export, Convention => C, External_Name => "__builtin_inff"; 44 | 45 | end System.Builtins; 46 | -------------------------------------------------------------------------------- /source/rtl/s-wchcon.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- GNAT COMPILER COMPONENTS -- 4 | -- -- 5 | -- S Y S T E M . W C H _ C O N -- 6 | -- -- 7 | -- B o d y -- 8 | -- -- 9 | -- Copyright (C) 2005-2021, Free Software Foundation, Inc. -- 10 | -- -- 11 | -- GNAT is free software; you can redistribute it and/or modify it under -- 12 | -- terms of the GNU General Public License as published by the Free Soft- -- 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- 14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- 17 | -- -- 18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- 19 | -- additional permissions described in the GCC Runtime Library Exception, -- 20 | -- version 3.1, as published by the Free Software Foundation. -- 21 | -- -- 22 | -- You should have received a copy of the GNU General Public License and -- 23 | -- a copy of the GCC Runtime Library Exception along with this program; -- 24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25 | -- . -- 26 | -- -- 27 | -- GNAT was originally developed by the GNAT team at New York University. -- 28 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- 29 | -- -- 30 | ------------------------------------------------------------------------------ 31 | 32 | package body System.WCh_Con is 33 | 34 | ---------------------------- 35 | -- Get_WC_Encoding_Method -- 36 | ---------------------------- 37 | 38 | function Get_WC_Encoding_Method (C : Character) return WC_Encoding_Method is 39 | begin 40 | for Method in WC_Encoding_Method loop 41 | if C = WC_Encoding_Letters (Method) then 42 | return Method; 43 | end if; 44 | end loop; 45 | 46 | raise Constraint_Error; 47 | end Get_WC_Encoding_Method; 48 | 49 | function Get_WC_Encoding_Method (S : String) return WC_Encoding_Method is 50 | begin 51 | if S = "utf8" then 52 | return WCEM_UTF8; 53 | elsif S = "brackets" then 54 | return WCEM_Brackets; 55 | else 56 | raise Constraint_Error; 57 | end if; 58 | end Get_WC_Encoding_Method; 59 | 60 | -------------------------- 61 | -- Is_Start_Of_Encoding -- 62 | -------------------------- 63 | 64 | function Is_Start_Of_Encoding 65 | (C : Character; 66 | EM : WC_Encoding_Method) return Boolean 67 | is 68 | begin 69 | return (EM in WC_Upper_Half_Encoding_Method 70 | and then Character'Pos (C) >= 16#80#); 71 | end Is_Start_Of_Encoding; 72 | 73 | end System.WCh_Con; 74 | -------------------------------------------------------------------------------- /source/rtl/wasm32.atp: -------------------------------------------------------------------------------- 1 | Bits_BE 0 2 | Bits_Per_Unit 8 3 | Bits_Per_Word 32 4 | Bytes_BE 0 5 | Char_Size 8 6 | Double_Float_Alignment 0 7 | Double_Scalar_Alignment 0 8 | Double_Size 64 9 | Float_Size 32 10 | Float_Words_BE 0 11 | Int_Size 32 12 | Long_Double_Size 64 13 | Long_Long_Size 64 14 | Long_Size 32 15 | Maximum_Alignment 16 16 | Max_Unaligned_Field 64 17 | Pointer_Size 32 18 | Short_Enums 0 19 | Short_Size 16 20 | Strict_Alignment 0 21 | System_Allocator_Alignment 16 22 | Wchar_T_Size 32 23 | Words_BE 0 24 | 25 | float 6 I 32 32 26 | double 15 I 64 64 27 | long double 15 I 64 64 28 | -------------------------------------------------------------------------------- /source/sockets/web-message_events.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Ada.Streams; 38 | 39 | with Web.DOM.Events; 40 | 41 | package Web.Message_Events is 42 | 43 | pragma Preelaborate; 44 | 45 | type Message_Event is new Web.DOM.Events.Event with null record; 46 | -- Messages in server-sent events, Web sockets, cross-document messaging, 47 | -- channel messaging, and broadcast channels use the MessageEvent interface 48 | -- for their message events. 49 | 50 | -- readonly attribute any data; 51 | 52 | function Data_Byte_Length 53 | (Self : Message_Event) return Ada.Streams.Stream_Element_Count; 54 | -- If `data` is an ArrayBuffer then return its length in bytes, like 55 | -- Event.data.byteLength 56 | 57 | procedure Read 58 | (Self : Message_Event; 59 | Data : out Ada.Streams.Stream_Element_Array; 60 | Offset : Ada.Streams.Stream_Element_Offset := 0); 61 | -- If `data` is an ArrayBuffer then return slice of data. Use Offset to 62 | -- read data starting from an arbitrary index. 63 | 64 | end Web.Message_Events; 65 | -------------------------------------------------------------------------------- /source/ui_events/web-ui_events-ui_events.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.DOM.Events; 38 | 39 | package Web.UI_Events.UI_Events is 40 | 41 | pragma Preelaborate; 42 | 43 | type UI_Event is new Web.DOM.Events.Event with null record; 44 | 45 | end Web.UI_Events.UI_Events; 46 | -------------------------------------------------------------------------------- /source/ui_events/web-ui_events.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Root package for API defined by "UI Events" specification. 37 | ------------------------------------------------------------------------------ 38 | 39 | package Web.UI_Events is 40 | 41 | pragma Preelaborate; 42 | 43 | end Web.UI_Events; 44 | -------------------------------------------------------------------------------- /source/url/web-url.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Root package for API defined by "URL" specification. 37 | ------------------------------------------------------------------------------ 38 | 39 | package Web.URL is 40 | 41 | pragma Preelaborate; 42 | 43 | end Web.URL; 44 | -------------------------------------------------------------------------------- /source/wasm-abort_execution.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | procedure WASM.Abort_Execution is 38 | begin 39 | -- This will raise a JavaScrip exception and destroy whole stack. 40 | raise Program_Error with "do silent abort"; 41 | end WASM.Abort_Execution; 42 | -------------------------------------------------------------------------------- /source/wasm-abort_execution.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | procedure WASM.Abort_Execution 38 | with Preelaborate; 39 | -- This procedure terminates current execution and destroys stack content. It's 40 | -- implemented as a throw of JavaScript exception. 41 | -------------------------------------------------------------------------------- /source/wasm-classes.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- This package define indicies of known object's classes to be used with 37 | -- helper functions to create objects. See WASM.Objects.Constructtors for 38 | -- more information. 39 | 40 | with Interfaces; 41 | 42 | package WASM.Classes is 43 | 44 | pragma Pure; 45 | 46 | type Class_Index is new Interfaces.Unsigned_32; 47 | 48 | -- This declaration must be synchronized with list of class's names in 49 | -- adawebpack.mjs file. 50 | 51 | URL_Search_Params : constant := 0; 52 | XML_Http_Request : constant := 1; 53 | 54 | end WASM.Classes; 55 | -------------------------------------------------------------------------------- /source/wasm-console.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020-2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with System; 38 | 39 | with Web.Strings.WASM_Helpers; 40 | 41 | package body WASM.Console is 42 | 43 | --------- 44 | -- Log -- 45 | --------- 46 | 47 | procedure Log (Item : Web.Strings.Web_String) is 48 | procedure Imported 49 | (Address : System.Address; 50 | Size : Interfaces.Unsigned_32) 51 | with Import, 52 | Convention => C, 53 | Link_Name => "__gnat_put_string"; 54 | 55 | A : System.Address; 56 | S : Interfaces.Unsigned_32; 57 | 58 | begin 59 | Web.Strings.WASM_Helpers.To_JS (Item, A, S); 60 | Imported (A, S); 61 | end Log; 62 | 63 | end WASM.Console; 64 | -------------------------------------------------------------------------------- /source/wasm-console.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020-2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Utilities to output information into bowser's console. 37 | ------------------------------------------------------------------------------ 38 | 39 | with Interfaces; 40 | 41 | with Web.Strings; 42 | 43 | package WASM.Console is 44 | 45 | pragma Preelaborate; 46 | 47 | procedure Log (Item : Interfaces.Integer_32) 48 | with Import, 49 | Convention => C, 50 | Link_Name => "__gnat_put_int"; 51 | 52 | procedure Log (Item : Interfaces.Unsigned_32) 53 | with Import, 54 | Convention => C, 55 | Link_Name => "__gnat_put_int"; 56 | 57 | procedure Log (Item : Interfaces.IEEE_Float_32) 58 | with Import, 59 | Convention => C, 60 | Link_Name => "__gnat_put_f32"; 61 | 62 | procedure Log (Item : Interfaces.IEEE_Float_64) 63 | with Import, 64 | Convention => C, 65 | Link_Name => "__gnat_put_f64"; 66 | 67 | procedure Log (Item : Web.Strings.Web_String); 68 | 69 | end WASM.Console; 70 | -------------------------------------------------------------------------------- /source/wasm-objects-constructors.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Helper subprograms to create objects at JavaScript side. 37 | 38 | with WASM.Classes; 39 | 40 | with Web.Strings; 41 | 42 | package WASM.Objects.Constructors is 43 | 44 | pragma Preelaborate; 45 | 46 | function New_Object 47 | (Class : WASM.Classes.Class_Index) 48 | return WASM.Objects.Object_Identifier; 49 | 50 | function New_Object_String 51 | (Class : WASM.Classes.Class_Index; 52 | Parameter : Web.Strings.Web_String) 53 | return WASM.Objects.Object_Identifier; 54 | 55 | end WASM.Objects.Constructors; 56 | -------------------------------------------------------------------------------- /source/wasm-stringifiers.adb: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Methods; 38 | with WASM.Objects.Methods; 39 | 40 | package body WASM.Stringifiers is 41 | 42 | --------------- 43 | -- To_String -- 44 | --------------- 45 | 46 | function To_String 47 | (Object : Expose_Stringifier'Class) return Web.Strings.Web_String is 48 | begin 49 | return 50 | WASM.Objects.Methods.Call_String 51 | (WASM.Objects.Object_Reference'Class (Object), 52 | WASM.Methods.To_String); 53 | end To_String; 54 | 55 | end WASM.Stringifiers; 56 | -------------------------------------------------------------------------------- /source/wasm-stringifiers.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2022, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- An interface to expose toString() function. 37 | 38 | with Web.Strings; 39 | 40 | package WASM.Stringifiers is 41 | 42 | pragma Preelaborate; 43 | 44 | type Expose_Stringifier is limited interface; 45 | 46 | function To_String 47 | (Object : Expose_Stringifier'Class) return Web.Strings.Web_String; 48 | 49 | end WASM.Stringifiers; 50 | -------------------------------------------------------------------------------- /source/wasm-strings.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Low level support for passing string data 37 | ------------------------------------------------------------------------------ 38 | 39 | with Interfaces; 40 | with System; 41 | 42 | package WASM.Strings is 43 | 44 | pragma Preelaborate; 45 | 46 | procedure To_JS 47 | (Item : Wide_String; 48 | Data : out System.Address; 49 | Length : out Interfaces.Unsigned_32); 50 | 51 | procedure Release 52 | (Data : in out System.Address; 53 | Length : in out Interfaces.Unsigned_32); 54 | 55 | end WASM.Strings; 56 | -------------------------------------------------------------------------------- /source/wasm.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -- Root package for WASM interface support. 37 | ------------------------------------------------------------------------------ 38 | 39 | package WASM is 40 | 41 | pragma Pure; 42 | 43 | end WASM; 44 | -------------------------------------------------------------------------------- /source/webgl/web-gl-buffers.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2016-2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Buffers is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Buffer is new Web.GL.Objects.WebGL_Object with null record; 44 | 45 | end Web.GL.Buffers; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-framebuffers.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Framebuffers is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Framebuffer is new Web.GL.Objects.WebGL_Object with null record; 44 | 45 | end Web.GL.Framebuffers; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-objects.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with WASM.Objects; 38 | 39 | package Web.GL.Objects is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Object is new WASM.Objects.Object_Reference with null record; 44 | 45 | end Web.GL.Objects; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-programs.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2016-2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Programs is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Program is new Web.GL.Objects.WebGL_Object with null record; 44 | 45 | end Web.GL.Programs; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-renderbuffers.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2021, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Renderbuffers is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Renderbuffer is new Web.GL.Objects.WebGL_Object with null record; 44 | 45 | end Web.GL.Renderbuffers; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-shaders.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2016-2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Shaders is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Shader is new Web.GL.Objects.WebGL_Object with null record; 44 | 45 | end Web.GL.Shaders; 46 | -------------------------------------------------------------------------------- /source/webgl/web-gl-textures.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- Matreshka Project -- 4 | -- -- 5 | -- Web Framework -- 6 | -- -- 7 | -- Web API Definition -- 8 | -- -- 9 | ------------------------------------------------------------------------------ 10 | -- -- 11 | -- Copyright © 2016-2020, Vadim Godunko -- 12 | -- All rights reserved. -- 13 | -- -- 14 | -- Redistribution and use in source and binary forms, with or without -- 15 | -- modification, are permitted provided that the following conditions -- 16 | -- are met: -- 17 | -- -- 18 | -- * Redistributions of source code must retain the above copyright -- 19 | -- notice, this list of conditions and the following disclaimer. -- 20 | -- -- 21 | -- * Redistributions in binary form must reproduce the above copyright -- 22 | -- notice, this list of conditions and the following disclaimer in the -- 23 | -- documentation and/or other materials provided with the distribution. -- 24 | -- -- 25 | -- * Neither the name of the Vadim Godunko, IE nor the names of its -- 26 | -- contributors may be used to endorse or promote products derived from -- 27 | -- this software without specific prior written permission. -- 28 | -- -- 29 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 30 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 31 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 32 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 33 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 34 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- 35 | -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- 36 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- 37 | -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- 38 | -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- 39 | -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 40 | -- -- 41 | ------------------------------------------------------------------------------ 42 | -- $Revision: 5549 $ $Date: 2016-03-20 14:52:06 +0300 (Sun, 20 Mar 2016) $ 43 | ------------------------------------------------------------------------------ 44 | 45 | with Web.GL.Objects; 46 | 47 | package Web.GL.Textures is 48 | 49 | pragma Preelaborate; 50 | 51 | type WebGL_Texture is new Web.GL.Objects.WebGL_Object with null record; 52 | 53 | end Web.GL.Textures; 54 | -------------------------------------------------------------------------------- /source/webgl/web-gl-uniform_locations.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2016-2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | 37 | with Web.GL.Objects; 38 | 39 | package Web.GL.Uniform_Locations is 40 | 41 | pragma Preelaborate; 42 | 43 | type WebGL_Uniform_Location is 44 | new Web.GL.Objects.WebGL_Object with null record; 45 | 46 | end Web.GL.Uniform_Locations; 47 | -------------------------------------------------------------------------------- /source/xhr/web-xhr.ads: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- Matreshka Project -- 4 | -- -- 5 | -- Web Framework -- 6 | -- -- 7 | -- Web API Definition -- 8 | -- -- 9 | ------------------------------------------------------------------------------ 10 | -- -- 11 | -- Copyright © 2016-2020, Vadim Godunko -- 12 | -- All rights reserved. -- 13 | -- -- 14 | -- Redistribution and use in source and binary forms, with or without -- 15 | -- modification, are permitted provided that the following conditions -- 16 | -- are met: -- 17 | -- -- 18 | -- * Redistributions of source code must retain the above copyright -- 19 | -- notice, this list of conditions and the following disclaimer. -- 20 | -- -- 21 | -- * Redistributions in binary form must reproduce the above copyright -- 22 | -- notice, this list of conditions and the following disclaimer in the -- 23 | -- documentation and/or other materials provided with the distribution. -- 24 | -- -- 25 | -- * Neither the name of the Vadim Godunko, IE nor the names of its -- 26 | -- contributors may be used to endorse or promote products derived from -- 27 | -- this software without specific prior written permission. -- 28 | -- -- 29 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 30 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 31 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 32 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 33 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 34 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- 35 | -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- 36 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- 37 | -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- 38 | -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- 39 | -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 40 | -- -- 41 | ------------------------------------------------------------------------------ 42 | -- $Revision: 5594 $ $Date: 2016-06-30 13:34:47 +0300 (Thu, 30 Jun 2016) $ 43 | ------------------------------------------------------------------------------ 44 | -- This is root package to expose XMLHttpRequest API to Ada applications. 45 | 46 | package Web.XHR is 47 | 48 | pragma Preelaborate; 49 | 50 | end Web.XHR; 51 | -------------------------------------------------------------------------------- /templates/ada: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- -- 3 | -- AdaWebPack -- 4 | -- -- 5 | ------------------------------------------------------------------------------ 6 | -- Copyright © 2020, Vadim Godunko -- 7 | -- All rights reserved. -- 8 | -- -- 9 | -- Redistribution and use in source and binary forms, with or without -- 10 | -- modification, are permitted provided that the following conditions are -- 11 | -- met: -- 12 | -- -- 13 | -- 1. Redistributions of source code must retain the above copyright -- 14 | -- notice, this list of conditions and the following disclaimer. -- 15 | -- -- 16 | -- 2. Redistributions in binary form must reproduce the above copyright -- 17 | -- notice, this list of conditions and the following disclaimer in the -- 18 | -- documentation and/or other materials provided with the distribution. -- 19 | -- -- 20 | -- 3. Neither the name of the copyright holder nor the names of its -- 21 | -- contributors may be used to endorse or promote products derived -- 22 | -- from this software without specific prior written permission. -- 23 | -- -- 24 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 25 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 26 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 27 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 28 | -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 29 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- 30 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- 31 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- 32 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- 33 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- 34 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 35 | ------------------------------------------------------------------------------ 36 | -------------------------------------------------------------------------------- /utilities/update-alternatives-gcc-11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 4 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 5 | --------------------------------------------------------------------------------