├── .appveyor.yml ├── .clang-format ├── .editorconfig ├── .github └── workflows │ ├── build.yml │ └── package.yml ├── .gitignore ├── Backends ├── CMakeLists.txt ├── RmlUi_Backend.h ├── RmlUi_Backend_GLFW_GL2.cpp ├── RmlUi_Backend_GLFW_GL3.cpp ├── RmlUi_Backend_GLFW_VK.cpp ├── RmlUi_Backend_SDL_GL2.cpp ├── RmlUi_Backend_SDL_GL3.cpp ├── RmlUi_Backend_SDL_SDLrenderer.cpp ├── RmlUi_Backend_SDL_VK.cpp ├── RmlUi_Backend_SFML_GL2.cpp ├── RmlUi_Backend_Win32_GL2.cpp ├── RmlUi_Backend_Win32_VK.cpp ├── RmlUi_Backend_X11_GL2.cpp ├── RmlUi_BackwardCompatible │ ├── RmlUi_Backend_BackwardCompatible_GLFW_GL2.cpp │ ├── RmlUi_Backend_BackwardCompatible_GLFW_GL3.cpp │ ├── RmlUi_Renderer_BackwardCompatible_GL2.cpp │ ├── RmlUi_Renderer_BackwardCompatible_GL2.h │ ├── RmlUi_Renderer_BackwardCompatible_GL3.cpp │ └── RmlUi_Renderer_BackwardCompatible_GL3.h ├── RmlUi_Include_GL3.h ├── RmlUi_Include_Vulkan.h ├── RmlUi_Include_Windows.h ├── RmlUi_Include_Xlib.h ├── RmlUi_Platform_GLFW.cpp ├── RmlUi_Platform_GLFW.h ├── RmlUi_Platform_SDL.cpp ├── RmlUi_Platform_SDL.h ├── RmlUi_Platform_SFML.cpp ├── RmlUi_Platform_SFML.h ├── RmlUi_Platform_Win32.cpp ├── RmlUi_Platform_Win32.h ├── RmlUi_Platform_X11.cpp ├── RmlUi_Platform_X11.h ├── RmlUi_Renderer_GL2.cpp ├── RmlUi_Renderer_GL2.h ├── RmlUi_Renderer_GL3.cpp ├── RmlUi_Renderer_GL3.h ├── RmlUi_Renderer_SDL.cpp ├── RmlUi_Renderer_SDL.h ├── RmlUi_Renderer_VK.cpp ├── RmlUi_Renderer_VK.h └── RmlUi_Vulkan │ ├── .clang-format │ ├── LICENSE.txt │ ├── ShadersCompiledSPV.h │ ├── compile_shaders.py │ ├── shader_frag_color.frag │ ├── shader_frag_texture.frag │ ├── shader_vert.vert │ ├── vk_mem_alloc.h │ └── vulkan.h ├── CMake ├── BackendAutoSelection.cmake ├── Dependencies.cmake ├── DependenciesForBackends.cmake ├── DependenciesForShell.cmake ├── DependenciesForTests.cmake ├── Modules │ ├── Emscripten │ │ ├── FindFreetype.cmake │ │ ├── FindOpenGL.cmake │ │ ├── FindSDL2.cmake │ │ ├── FindSDL2_image.cmake │ │ └── Findglfw3.cmake │ ├── FindHarfBuzz.cmake │ ├── FindLuaJIT.cmake │ ├── FindSDL2_image.cmake │ └── Findlunasvg.cmake ├── OptionsLists.cmake ├── PackageUtilities.cmake ├── RmlUiConfig.cmake.in ├── RuntimeUtilities.cmake └── Utilities.cmake ├── CMakeLists.txt ├── CMakePresets.json ├── Dependencies └── .gitignore ├── Include └── RmlUi │ ├── Config │ └── Config.h │ ├── Core.h │ ├── Core │ ├── Animation.h │ ├── BaseXMLParser.h │ ├── Box.h │ ├── CallbackTexture.h │ ├── Colour.h │ ├── Colour.inl │ ├── CompiledFilterShader.h │ ├── ComputedValues.h │ ├── Containers │ │ ├── LICENSE.txt │ │ ├── itlib │ │ │ ├── flat_map.hpp │ │ │ └── flat_set.hpp │ │ └── robin_hood.h │ ├── Context.h │ ├── ContextInstancer.h │ ├── ConvolutionFilter.h │ ├── Core.h │ ├── DataModelHandle.h │ ├── DataStructHandle.h │ ├── DataTypeRegister.h │ ├── DataTypes.h │ ├── DataVariable.h │ ├── Debug.h │ ├── DecorationTypes.h │ ├── Decorator.h │ ├── Dictionary.h │ ├── EffectSpecification.h │ ├── Element.h │ ├── Element.inl │ ├── ElementDocument.h │ ├── ElementInstancer.h │ ├── ElementScroll.h │ ├── ElementText.h │ ├── ElementUtilities.h │ ├── Elements │ │ ├── ElementForm.h │ │ ├── ElementFormControl.h │ │ ├── ElementFormControlInput.h │ │ ├── ElementFormControlSelect.h │ │ ├── ElementFormControlTextArea.h │ │ ├── ElementProgress.h │ │ └── ElementTabSet.h │ ├── Event.h │ ├── EventInstancer.h │ ├── EventListener.h │ ├── EventListenerInstancer.h │ ├── Factory.h │ ├── FileInterface.h │ ├── Filter.h │ ├── FontEffect.h │ ├── FontEffectInstancer.h │ ├── FontEngineInterface.h │ ├── FontGlyph.h │ ├── FontMetrics.h │ ├── Geometry.h │ ├── Header.h │ ├── ID.h │ ├── Input.h │ ├── Log.h │ ├── Math.h │ ├── Matrix4.h │ ├── Matrix4.inl │ ├── Mesh.h │ ├── MeshUtilities.h │ ├── NumericValue.h │ ├── ObserverPtr.h │ ├── Platform.h │ ├── Plugin.h │ ├── Profiling.h │ ├── PropertiesIteratorView.h │ ├── Property.h │ ├── PropertyDefinition.h │ ├── PropertyDictionary.h │ ├── PropertyIdSet.h │ ├── PropertyParser.h │ ├── PropertySpecification.h │ ├── Rectangle.h │ ├── RenderBox.h │ ├── RenderInterface.h │ ├── RenderInterfaceCompatibility.h │ ├── RenderManager.h │ ├── ScriptInterface.h │ ├── ScrollTypes.h │ ├── Span.h │ ├── Spritesheet.h │ ├── StableVector.h │ ├── Stream.h │ ├── StreamMemory.h │ ├── StringUtilities.h │ ├── StyleSheet.h │ ├── StyleSheetContainer.h │ ├── StyleSheetSpecification.h │ ├── StyleSheetTypes.h │ ├── StyleTypes.h │ ├── SystemInterface.h │ ├── TextInputContext.h │ ├── TextInputHandler.h │ ├── TextShapingContext.h │ ├── Texture.h │ ├── Traits.h │ ├── Transform.h │ ├── TransformPrimitive.h │ ├── Tween.h │ ├── TypeConverter.h │ ├── TypeConverter.inl │ ├── Types.h │ ├── URL.h │ ├── UniqueRenderResource.h │ ├── Unit.h │ ├── Utilities.h │ ├── Variant.h │ ├── Variant.inl │ ├── Vector2.h │ ├── Vector2.inl │ ├── Vector3.h │ ├── Vector3.inl │ ├── Vector4.h │ ├── Vector4.inl │ ├── Vertex.h │ ├── XMLNodeHandler.h │ └── XMLParser.h │ ├── Debugger.h │ ├── Debugger │ ├── Debugger.h │ └── Header.h │ ├── Lottie │ └── ElementLottie.h │ ├── Lua.h │ ├── Lua │ ├── Header.h │ ├── IncludeLua.h │ ├── Interpreter.h │ ├── Lua.h │ ├── LuaType.h │ ├── LuaType.inl │ └── Utilities.h │ └── SVG │ └── ElementSVG.h ├── LICENSE.txt ├── Samples ├── CMakeLists.txt ├── assets │ ├── LICENSE.txt │ ├── LatoLatin-Bold.ttf │ ├── LatoLatin-BoldItalic.ttf │ ├── LatoLatin-Italic.ttf │ ├── LatoLatin-Regular.ttf │ ├── NotoEmoji-Regular.ttf │ ├── alien_small.tga │ ├── demo.rml │ ├── hello_world.png │ ├── high_scores_alien_1.tga │ ├── high_scores_alien_2.tga │ ├── high_scores_alien_3.tga │ ├── high_scores_defender.tga │ ├── invader.rcss │ ├── invader.tga │ ├── present.tga │ ├── rml.rcss │ └── window.rml ├── basic │ ├── CMakeLists.txt │ ├── animation │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── animation.rml │ │ └── src │ │ │ └── main.cpp │ ├── benchmark │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── benchmark.rml │ │ └── src │ │ │ └── main.cpp │ ├── bitmap_font │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── Comfortaa_Regular_22.fnt │ │ │ ├── Comfortaa_Regular_22.tga │ │ │ ├── LICENSE.txt │ │ │ └── bitmap_font.rml │ │ └── src │ │ │ ├── FontEngineBitmap.cpp │ │ │ ├── FontEngineBitmap.h │ │ │ ├── FontEngineInterfaceBitmap.cpp │ │ │ ├── FontEngineInterfaceBitmap.h │ │ │ └── main.cpp │ ├── custom_log │ │ ├── CMakeLists.txt │ │ └── src │ │ │ ├── SystemInterface.cpp │ │ │ ├── SystemInterface.h │ │ │ └── main.cpp │ ├── data_binding │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── data_binding.rml │ │ └── src │ │ │ └── main.cpp │ ├── demo │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── demo.rml │ │ └── src │ │ │ ├── DemoEventListener.cpp │ │ │ ├── DemoEventListener.h │ │ │ ├── DemoWindow.cpp │ │ │ ├── DemoWindow.h │ │ │ └── main.cpp │ ├── drag │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── icon.rcss │ │ │ └── inventory.rml │ │ └── src │ │ │ ├── DragListener.cpp │ │ │ ├── DragListener.h │ │ │ ├── Inventory.cpp │ │ │ ├── Inventory.h │ │ │ └── main.cpp │ ├── effects │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── effects.rml │ │ │ └── effects_style.rcss │ │ └── src │ │ │ └── main.cpp │ ├── harfbuzz │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── Cairo-Regular.ttf │ │ │ ├── LICENSE.txt │ │ │ ├── Poppins-Regular.ttf │ │ │ └── harfbuzz.rml │ │ └── src │ │ │ ├── FontEngineInterfaceHarfBuzz.cpp │ │ │ ├── FontEngineInterfaceHarfBuzz.h │ │ │ ├── FontFace.cpp │ │ │ ├── FontFace.h │ │ │ ├── FontFaceHandleHarfBuzz.cpp │ │ │ ├── FontFaceHandleHarfBuzz.h │ │ │ ├── FontFaceLayer.cpp │ │ │ ├── FontFaceLayer.h │ │ │ ├── FontFamily.cpp │ │ │ ├── FontFamily.h │ │ │ ├── FontGlyph.h │ │ │ ├── FontProvider.cpp │ │ │ ├── FontProvider.h │ │ │ ├── FreeTypeInterface.cpp │ │ │ ├── FreeTypeInterface.h │ │ │ ├── LanguageData.h │ │ │ ├── TextureLayout.cpp │ │ │ ├── TextureLayout.h │ │ │ ├── TextureLayoutRectangle.cpp │ │ │ ├── TextureLayoutRectangle.h │ │ │ ├── TextureLayoutRow.cpp │ │ │ ├── TextureLayoutRow.h │ │ │ ├── TextureLayoutTexture.cpp │ │ │ ├── TextureLayoutTexture.h │ │ │ └── main.cpp │ ├── ime │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── ime.rml │ │ └── src │ │ │ ├── SystemFontWin32.cpp │ │ │ ├── SystemFontWin32.h │ │ │ └── main.cpp │ ├── load_document │ │ ├── CMakeLists.txt │ │ └── src │ │ │ └── main.cpp │ ├── lottie │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── LICENSE.txt │ │ │ ├── a_mountain.json │ │ │ └── lottie.rml │ │ └── src │ │ │ └── main.cpp │ ├── svg │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── LICENSE.txt │ │ │ ├── svg_decorator.rml │ │ │ ├── svg_element.rml │ │ │ └── tiger.svg │ │ └── src │ │ │ └── main.cpp │ ├── transform │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ └── transform.rml │ │ └── src │ │ │ └── main.cpp │ └── tree_view │ │ ├── CMakeLists.txt │ │ ├── data │ │ └── tree_view.rml │ │ └── src │ │ ├── FileBrowser.cpp │ │ ├── FileBrowser.h │ │ └── main.cpp ├── invaders │ ├── CMakeLists.txt │ ├── data │ │ ├── background.rml │ │ ├── background.tga │ │ ├── game.rml │ │ ├── help.rml │ │ ├── help_defender.tga │ │ ├── help_invader_mothership.tga │ │ ├── help_invader_rank1.tga │ │ ├── help_invader_rank2.tga │ │ ├── help_invader_rank3.tga │ │ ├── high_score.rml │ │ ├── high_scores_defender.tga │ │ ├── invaders.tga │ │ ├── logo.rml │ │ ├── logo.tga │ │ ├── main_menu.rml │ │ ├── options.rml │ │ ├── pause.rml │ │ └── start_game.rml │ └── src │ │ ├── DecoratorDefender.cpp │ │ ├── DecoratorDefender.h │ │ ├── DecoratorStarfield.cpp │ │ ├── DecoratorStarfield.h │ │ ├── Defender.cpp │ │ ├── Defender.h │ │ ├── ElementGame.cpp │ │ ├── ElementGame.h │ │ ├── EventHandler.cpp │ │ ├── EventHandler.h │ │ ├── EventHandlerHighScore.cpp │ │ ├── EventHandlerHighScore.h │ │ ├── EventHandlerOptions.cpp │ │ ├── EventHandlerOptions.h │ │ ├── EventHandlerStartGame.cpp │ │ ├── EventHandlerStartGame.h │ │ ├── EventListener.cpp │ │ ├── EventListener.h │ │ ├── EventListenerInstancer.cpp │ │ ├── EventListenerInstancer.h │ │ ├── EventManager.cpp │ │ ├── EventManager.h │ │ ├── Game.cpp │ │ ├── Game.h │ │ ├── GameDetails.cpp │ │ ├── GameDetails.h │ │ ├── HighScores.cpp │ │ ├── HighScores.h │ │ ├── Invader.cpp │ │ ├── Invader.h │ │ ├── Mothership.cpp │ │ ├── Mothership.h │ │ ├── Shield.cpp │ │ ├── Shield.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ └── main.cpp ├── lua_invaders │ ├── CMakeLists.txt │ ├── data │ │ ├── background.rml │ │ ├── background.tga │ │ ├── game.rml │ │ ├── help.rml │ │ ├── help_defender.tga │ │ ├── help_invader_mothership.tga │ │ ├── help_invader_rank1.tga │ │ ├── help_invader_rank2.tga │ │ ├── help_invader_rank3.tga │ │ ├── high_score.rml │ │ ├── high_scores_defender.tga │ │ ├── invaders.tga │ │ ├── logo.rml │ │ ├── logo.tga │ │ ├── main_menu.rml │ │ ├── options.rml │ │ ├── pause.rml │ │ ├── start_game.rml │ │ └── window.rml │ ├── lua │ │ └── start.lua │ └── src │ │ ├── DecoratorDefender.cpp │ │ ├── DecoratorDefender.h │ │ ├── DecoratorStarfield.cpp │ │ ├── DecoratorStarfield.h │ │ ├── Defender.cpp │ │ ├── Defender.h │ │ ├── ElementGame.cpp │ │ ├── ElementGame.h │ │ ├── ElementGameInstancer.cpp │ │ ├── ElementGameInstancer.h │ │ ├── Game.cpp │ │ ├── Game.h │ │ ├── GameDetails.cpp │ │ ├── GameDetails.h │ │ ├── HighScores.cpp │ │ ├── HighScores.h │ │ ├── Invader.cpp │ │ ├── Invader.h │ │ ├── LuaInterface.cpp │ │ ├── LuaInterface.h │ │ ├── Mothership.cpp │ │ ├── Mothership.h │ │ ├── Shield.cpp │ │ ├── Shield.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ └── main.cpp ├── readme.md ├── shell │ ├── CMakeLists.txt │ ├── include │ │ ├── PlatformExtensions.h │ │ ├── RendererExtensions.h │ │ ├── Shell.h │ │ └── ShellFileInterface.h │ └── src │ │ ├── PlatformExtensions.cpp │ │ ├── RendererExtensions.cpp │ │ ├── Shell.cpp │ │ └── ShellFileInterface.cpp └── tutorial │ ├── CMakeLists.txt │ ├── drag │ ├── CMakeLists.txt │ ├── data │ │ ├── inventory.rml │ │ └── tutorial.rcss │ └── src │ │ ├── Inventory.cpp │ │ ├── Inventory.h │ │ └── main.cpp │ └── template │ ├── CMakeLists.txt │ ├── data │ ├── tutorial.rcss │ └── tutorial.rml │ └── src │ └── main.cpp ├── Source ├── CMakeLists.txt ├── Core │ ├── BaseXMLParser.cpp │ ├── Box.cpp │ ├── CMakeLists.txt │ ├── CallbackTexture.cpp │ ├── Clock.cpp │ ├── Clock.h │ ├── CompiledFilterShader.cpp │ ├── ComputeProperty.cpp │ ├── ComputeProperty.h │ ├── ComputedValues.cpp │ ├── Context.cpp │ ├── ContextInstancer.cpp │ ├── ContextInstancerDefault.cpp │ ├── ContextInstancerDefault.h │ ├── ControlledLifetimeResource.h │ ├── ConvolutionFilter.cpp │ ├── Core.cpp │ ├── DataController.cpp │ ├── DataController.h │ ├── DataControllerDefault.cpp │ ├── DataControllerDefault.h │ ├── DataExpression.cpp │ ├── DataExpression.h │ ├── DataModel.cpp │ ├── DataModel.h │ ├── DataModelHandle.cpp │ ├── DataTypeRegister.cpp │ ├── DataVariable.cpp │ ├── DataView.cpp │ ├── DataView.h │ ├── DataViewDefault.cpp │ ├── DataViewDefault.h │ ├── Decorator.cpp │ ├── DecoratorGradient.cpp │ ├── DecoratorGradient.h │ ├── DecoratorNinePatch.cpp │ ├── DecoratorNinePatch.h │ ├── DecoratorShader.cpp │ ├── DecoratorShader.h │ ├── DecoratorText.cpp │ ├── DecoratorText.h │ ├── DecoratorTiled.cpp │ ├── DecoratorTiled.h │ ├── DecoratorTiledBox.cpp │ ├── DecoratorTiledBox.h │ ├── DecoratorTiledHorizontal.cpp │ ├── DecoratorTiledHorizontal.h │ ├── DecoratorTiledImage.cpp │ ├── DecoratorTiledImage.h │ ├── DecoratorTiledVertical.cpp │ ├── DecoratorTiledVertical.h │ ├── DecoratorUtilities.cpp │ ├── DecoratorUtilities.h │ ├── DocumentHeader.cpp │ ├── DocumentHeader.h │ ├── EffectSpecification.cpp │ ├── Element.cpp │ ├── ElementAnimation.cpp │ ├── ElementAnimation.h │ ├── ElementBackgroundBorder.cpp │ ├── ElementBackgroundBorder.h │ ├── ElementDefinition.cpp │ ├── ElementDefinition.h │ ├── ElementDocument.cpp │ ├── ElementEffects.cpp │ ├── ElementEffects.h │ ├── ElementHandle.cpp │ ├── ElementHandle.h │ ├── ElementInstancer.cpp │ ├── ElementMeta.cpp │ ├── ElementMeta.h │ ├── ElementScroll.cpp │ ├── ElementStyle.cpp │ ├── ElementStyle.h │ ├── ElementText.cpp │ ├── ElementUtilities.cpp │ ├── Elements │ │ ├── CMakeLists.txt │ │ ├── ElementForm.cpp │ │ ├── ElementFormControl.cpp │ │ ├── ElementFormControlInput.cpp │ │ ├── ElementFormControlSelect.cpp │ │ ├── ElementFormControlTextArea.cpp │ │ ├── ElementImage.cpp │ │ ├── ElementImage.h │ │ ├── ElementLabel.cpp │ │ ├── ElementLabel.h │ │ ├── ElementProgress.cpp │ │ ├── ElementTabSet.cpp │ │ ├── ElementTextSelection.cpp │ │ ├── ElementTextSelection.h │ │ ├── InputType.cpp │ │ ├── InputType.h │ │ ├── InputTypeButton.cpp │ │ ├── InputTypeButton.h │ │ ├── InputTypeCheckbox.cpp │ │ ├── InputTypeCheckbox.h │ │ ├── InputTypeRadio.cpp │ │ ├── InputTypeRadio.h │ │ ├── InputTypeRange.cpp │ │ ├── InputTypeRange.h │ │ ├── InputTypeSubmit.cpp │ │ ├── InputTypeSubmit.h │ │ ├── InputTypeText.cpp │ │ ├── InputTypeText.h │ │ ├── WidgetDropDown.cpp │ │ ├── WidgetDropDown.h │ │ ├── WidgetSlider.cpp │ │ ├── WidgetSlider.h │ │ ├── WidgetTextInput.cpp │ │ ├── WidgetTextInput.h │ │ ├── WidgetTextInputMultiLine.cpp │ │ ├── WidgetTextInputMultiLine.h │ │ ├── WidgetTextInputSingleLine.cpp │ │ ├── WidgetTextInputSingleLine.h │ │ ├── WidgetTextInputSingleLinePassword.cpp │ │ ├── WidgetTextInputSingleLinePassword.h │ │ ├── XMLNodeHandlerSelect.cpp │ │ ├── XMLNodeHandlerSelect.h │ │ ├── XMLNodeHandlerTabSet.cpp │ │ ├── XMLNodeHandlerTabSet.h │ │ ├── XMLNodeHandlerTextArea.cpp │ │ └── XMLNodeHandlerTextArea.h │ ├── Event.cpp │ ├── EventDispatcher.cpp │ ├── EventDispatcher.h │ ├── EventInstancer.cpp │ ├── EventInstancerDefault.cpp │ ├── EventInstancerDefault.h │ ├── EventListenerInstancer.cpp │ ├── EventSpecification.cpp │ ├── EventSpecification.h │ ├── Factory.cpp │ ├── FileInterface.cpp │ ├── FileInterfaceDefault.cpp │ ├── FileInterfaceDefault.h │ ├── Filter.cpp │ ├── FilterBasic.cpp │ ├── FilterBasic.h │ ├── FilterBlur.cpp │ ├── FilterBlur.h │ ├── FilterDropShadow.cpp │ ├── FilterDropShadow.h │ ├── FontEffect.cpp │ ├── FontEffectBlur.cpp │ ├── FontEffectBlur.h │ ├── FontEffectGlow.cpp │ ├── FontEffectGlow.h │ ├── FontEffectInstancer.cpp │ ├── FontEffectOutline.cpp │ ├── FontEffectOutline.h │ ├── FontEffectShadow.cpp │ ├── FontEffectShadow.h │ ├── FontEngineDefault │ │ ├── CMakeLists.txt │ │ ├── FontEngineInterfaceDefault.cpp │ │ ├── FontEngineInterfaceDefault.h │ │ ├── FontFace.cpp │ │ ├── FontFace.h │ │ ├── FontFaceHandleDefault.cpp │ │ ├── FontFaceHandleDefault.h │ │ ├── FontFaceLayer.cpp │ │ ├── FontFaceLayer.h │ │ ├── FontFamily.cpp │ │ ├── FontFamily.h │ │ ├── FontProvider.cpp │ │ ├── FontProvider.h │ │ ├── FontTypes.h │ │ ├── FreeTypeInterface.cpp │ │ └── FreeTypeInterface.h │ ├── FontEngineInterface.cpp │ ├── Geometry.cpp │ ├── GeometryBackgroundBorder.cpp │ ├── GeometryBackgroundBorder.h │ ├── GeometryBoxShadow.cpp │ ├── GeometryBoxShadow.h │ ├── IdNameMap.h │ ├── Layout │ │ ├── BlockContainer.cpp │ │ ├── BlockContainer.h │ │ ├── BlockFormattingContext.cpp │ │ ├── BlockFormattingContext.h │ │ ├── CMakeLists.txt │ │ ├── ContainerBox.cpp │ │ ├── ContainerBox.h │ │ ├── FlexFormattingContext.cpp │ │ ├── FlexFormattingContext.h │ │ ├── FloatedBoxSpace.cpp │ │ ├── FloatedBoxSpace.h │ │ ├── FormattingContext.cpp │ │ ├── FormattingContext.h │ │ ├── InlineBox.cpp │ │ ├── InlineBox.h │ │ ├── InlineContainer.cpp │ │ ├── InlineContainer.h │ │ ├── InlineLevelBox.cpp │ │ ├── InlineLevelBox.h │ │ ├── InlineTypes.h │ │ ├── LayoutBox.cpp │ │ ├── LayoutBox.h │ │ ├── LayoutDetails.cpp │ │ ├── LayoutDetails.h │ │ ├── LayoutEngine.cpp │ │ ├── LayoutEngine.h │ │ ├── LayoutPools.cpp │ │ ├── LayoutPools.h │ │ ├── LineBox.cpp │ │ ├── LineBox.h │ │ ├── ReplacedFormattingContext.cpp │ │ ├── ReplacedFormattingContext.h │ │ ├── TableFormattingContext.cpp │ │ ├── TableFormattingContext.h │ │ ├── TableFormattingDetails.cpp │ │ └── TableFormattingDetails.h │ ├── Log.cpp │ ├── LogDefault.cpp │ ├── LogDefault.h │ ├── Math.cpp │ ├── Memory.cpp │ ├── Memory.h │ ├── MeshUtilities.cpp │ ├── ObserverPtr.cpp │ ├── Plugin.cpp │ ├── PluginRegistry.cpp │ ├── PluginRegistry.h │ ├── Pool.h │ ├── Pool.inl │ ├── Profiling.cpp │ ├── PropertiesIterator.h │ ├── PropertiesIteratorView.cpp │ ├── Property.cpp │ ├── PropertyDefinition.cpp │ ├── PropertyDictionary.cpp │ ├── PropertyParserAnimation.cpp │ ├── PropertyParserAnimation.h │ ├── PropertyParserBoxShadow.cpp │ ├── PropertyParserBoxShadow.h │ ├── PropertyParserColorStopList.cpp │ ├── PropertyParserColorStopList.h │ ├── PropertyParserColour.cpp │ ├── PropertyParserColour.h │ ├── PropertyParserDecorator.cpp │ ├── PropertyParserDecorator.h │ ├── PropertyParserFilter.cpp │ ├── PropertyParserFilter.h │ ├── PropertyParserFontEffect.cpp │ ├── PropertyParserFontEffect.h │ ├── PropertyParserKeyword.cpp │ ├── PropertyParserKeyword.h │ ├── PropertyParserNumber.cpp │ ├── PropertyParserNumber.h │ ├── PropertyParserRatio.cpp │ ├── PropertyParserRatio.h │ ├── PropertyParserString.cpp │ ├── PropertyParserString.h │ ├── PropertyParserTransform.cpp │ ├── PropertyParserTransform.h │ ├── PropertyShorthandDefinition.h │ ├── PropertySpecification.cpp │ ├── RenderInterface.cpp │ ├── RenderInterfaceCompatibility.cpp │ ├── RenderManager.cpp │ ├── RenderManagerAccess.cpp │ ├── RenderManagerAccess.h │ ├── ScrollController.cpp │ ├── ScrollController.h │ ├── Spritesheet.cpp │ ├── Stream.cpp │ ├── StreamFile.cpp │ ├── StreamFile.h │ ├── StreamMemory.cpp │ ├── StringUtilities.cpp │ ├── StyleSheet.cpp │ ├── StyleSheetContainer.cpp │ ├── StyleSheetFactory.cpp │ ├── StyleSheetFactory.h │ ├── StyleSheetNode.cpp │ ├── StyleSheetNode.h │ ├── StyleSheetParser.cpp │ ├── StyleSheetParser.h │ ├── StyleSheetSelector.cpp │ ├── StyleSheetSelector.h │ ├── StyleSheetSpecification.cpp │ ├── SystemInterface.cpp │ ├── Template.cpp │ ├── Template.h │ ├── TemplateCache.cpp │ ├── TemplateCache.h │ ├── Texture.cpp │ ├── TextureDatabase.cpp │ ├── TextureDatabase.h │ ├── TextureLayout.cpp │ ├── TextureLayout.h │ ├── TextureLayoutRectangle.cpp │ ├── TextureLayoutRectangle.h │ ├── TextureLayoutRow.cpp │ ├── TextureLayoutRow.h │ ├── TextureLayoutTexture.cpp │ ├── TextureLayoutTexture.h │ ├── Traits.cpp │ ├── Transform.cpp │ ├── TransformPrimitive.cpp │ ├── TransformState.cpp │ ├── TransformState.h │ ├── TransformUtilities.cpp │ ├── TransformUtilities.h │ ├── Tween.cpp │ ├── TypeConverter.cpp │ ├── URL.cpp │ ├── Variant.cpp │ ├── WidgetScroll.cpp │ ├── WidgetScroll.h │ ├── XMLNodeHandler.cpp │ ├── XMLNodeHandlerBody.cpp │ ├── XMLNodeHandlerBody.h │ ├── XMLNodeHandlerDefault.cpp │ ├── XMLNodeHandlerDefault.h │ ├── XMLNodeHandlerHead.cpp │ ├── XMLNodeHandlerHead.h │ ├── XMLNodeHandlerTemplate.cpp │ ├── XMLNodeHandlerTemplate.h │ ├── XMLParseTools.cpp │ ├── XMLParseTools.h │ ├── XMLParser.cpp │ └── precompiled.h ├── Debugger │ ├── .clang-format │ ├── BeaconSource.h │ ├── CMakeLists.txt │ ├── CommonSource.h │ ├── Debugger.cpp │ ├── DebuggerPlugin.cpp │ ├── DebuggerPlugin.h │ ├── DebuggerSystemInterface.cpp │ ├── DebuggerSystemInterface.h │ ├── ElementContextHook.cpp │ ├── ElementContextHook.h │ ├── ElementDebugDocument.cpp │ ├── ElementDebugDocument.h │ ├── ElementInfo.cpp │ ├── ElementInfo.h │ ├── ElementLog.cpp │ ├── ElementLog.h │ ├── FontSource.h │ ├── Geometry.cpp │ ├── Geometry.h │ ├── InfoSource.h │ ├── LICENSE.txt │ ├── LogSource.h │ └── MenuSource.h ├── Lottie │ ├── CMakeLists.txt │ ├── ElementLottie.cpp │ ├── LottiePlugin.cpp │ └── LottiePlugin.h ├── Lua │ ├── .clang-format │ ├── CMakeLists.txt │ ├── Colourb.cpp │ ├── Colourb.h │ ├── Colourf.cpp │ ├── Colourf.h │ ├── Context.cpp │ ├── Context.h │ ├── ContextDocumentsProxy.cpp │ ├── ContextDocumentsProxy.h │ ├── Document.cpp │ ├── Document.h │ ├── Element.cpp │ ├── Element.h │ ├── ElementAttributesProxy.cpp │ ├── ElementAttributesProxy.h │ ├── ElementChildNodesProxy.cpp │ ├── ElementChildNodesProxy.h │ ├── ElementInstancer.cpp │ ├── ElementInstancer.h │ ├── ElementStyleProxy.cpp │ ├── ElementStyleProxy.h │ ├── ElementText.cpp │ ├── ElementText.h │ ├── Elements │ │ ├── As.h │ │ ├── CMakeLists.txt │ │ ├── ElementForm.cpp │ │ ├── ElementForm.h │ │ ├── ElementFormControl.cpp │ │ ├── ElementFormControl.h │ │ ├── ElementFormControlInput.cpp │ │ ├── ElementFormControlInput.h │ │ ├── ElementFormControlSelect.cpp │ │ ├── ElementFormControlSelect.h │ │ ├── ElementFormControlTextArea.cpp │ │ ├── ElementFormControlTextArea.h │ │ ├── ElementTabSet.cpp │ │ ├── ElementTabSet.h │ │ ├── SelectOptionsProxy.cpp │ │ └── SelectOptionsProxy.h │ ├── Event.cpp │ ├── Event.h │ ├── EventParametersProxy.cpp │ ├── EventParametersProxy.h │ ├── GlobalLuaFunctions.cpp │ ├── GlobalLuaFunctions.h │ ├── Interpreter.cpp │ ├── Log.cpp │ ├── Log.h │ ├── Lua.cpp │ ├── LuaDataModel.cpp │ ├── LuaDataModel.h │ ├── LuaDocument.cpp │ ├── LuaDocument.h │ ├── LuaDocumentElementInstancer.cpp │ ├── LuaDocumentElementInstancer.h │ ├── LuaElementInstancer.cpp │ ├── LuaElementInstancer.h │ ├── LuaEventListener.cpp │ ├── LuaEventListener.h │ ├── LuaEventListenerInstancer.cpp │ ├── LuaEventListenerInstancer.h │ ├── LuaPlugin.cpp │ ├── LuaPlugin.h │ ├── LuaType.cpp │ ├── Pairs.h │ ├── RmlUi.cpp │ ├── RmlUi.h │ ├── RmlUiContextsProxy.cpp │ ├── RmlUiContextsProxy.h │ ├── Utilities.cpp │ ├── Vector2f.cpp │ ├── Vector2f.h │ ├── Vector2i.cpp │ └── Vector2i.h └── SVG │ ├── CMakeLists.txt │ ├── DecoratorSVG.cpp │ ├── DecoratorSVG.h │ ├── ElementSVG.cpp │ ├── SVGCache.cpp │ ├── SVGCache.h │ ├── SVGPlugin.cpp │ └── SVGPlugin.h ├── Tests ├── CMakeLists.txt ├── Data │ ├── UnitTests │ │ ├── Specificity_Basic.rcss │ │ ├── Specificity_MediaQuery.rcss │ │ ├── data-title.rml │ │ └── template_basic.rml │ ├── VisualTests │ │ ├── LICENSE.txt │ │ ├── acid1.rml │ │ ├── border_radius.rml │ │ ├── box_sizing.rml │ │ ├── clip_mask.rml │ │ ├── color_interpolation.rml │ │ ├── css1_clear.rml │ │ ├── display_block_inside_inline.rml │ │ ├── document_position.rml │ │ ├── drag.rml │ │ ├── element_label.rml │ │ ├── filter_backdrop_filter_box_shadow.rml │ │ ├── filter_blur_area.rml │ │ ├── filter_blur_orb.rml │ │ ├── filter_drop_shadow.rml │ │ ├── filter_overflow.rml │ │ ├── filter_with_backdrop.rml │ │ ├── flex_01.rml │ │ ├── flex_02.rml │ │ ├── flex_03_scroll.rml │ │ ├── flex_04.rml │ │ ├── flex_05.rml │ │ ├── flex_06.rml │ │ ├── flex_absolutely_positioned.rml │ │ ├── flex_direction.rml │ │ ├── flex_inline.rml │ │ ├── flex_nested.rml │ │ ├── flex_shrink_to_fit_01.rml │ │ ├── flex_shrink_to_fit_02.rml │ │ ├── flex_wrap_column_reverse.rml │ │ ├── float_basic.rml │ │ ├── float_excluded_by_flow_root.rml │ │ ├── float_overflow.rml │ │ ├── float_placement.rml │ │ ├── float_text_wrap.rml │ │ ├── fractional-dimensions-01.rml │ │ ├── fractional-dimensions-02.rml │ │ ├── fractional-dimensions-03.rml │ │ ├── gap-001.rml │ │ ├── gap-002.rml │ │ ├── gap-003.rml │ │ ├── gap-004.rml │ │ ├── gap-005.rml │ │ ├── gap-006.rml │ │ ├── gap-007.rml │ │ ├── gap-008.rml │ │ ├── gap-009.rml │ │ ├── handle_target_anchor.rml │ │ ├── image_ratio.rml │ │ ├── ink_overflow_bounding_box.rml │ │ ├── inline_block.rml │ │ ├── inline_formatting_01.rml │ │ ├── inline_formatting_02.rml │ │ ├── inline_formatting_03.rml │ │ ├── inline_formatting_04.rml │ │ ├── inline_formatting_05.rml │ │ ├── inline_formatting_06.rml │ │ ├── inline_formatting_07.rml │ │ ├── inline_formatting_aligned_subtree.rml │ │ ├── issue_143_overflow_in_absolutely_positioned_input.rml │ │ ├── issue_452_scrollbar_resets.rml │ │ ├── letter_spacing.rml │ │ ├── mask_image.rml │ │ ├── media_query_01.rml │ │ ├── media_query_02.rml │ │ ├── navigation_01.rml │ │ ├── navigation_02.rml │ │ ├── opacity.rml │ │ ├── overflow_clip_transform.rml │ │ ├── overflow_hidden.rml │ │ ├── overflow_nested.rml │ │ ├── position_01_normal_flow.rml │ │ ├── position_02_relative_positioning.rml │ │ ├── position_03_floating_a_box.rml │ │ ├── position_04_floating_a_box_sibling.rml │ │ ├── position_05_floating_a_box_clear.rml │ │ ├── position_06_absolute_positioning.rml │ │ ├── position_07_absolute_positioning_relative.rml │ │ ├── position_08_absolute_positioning_no_relative.rml │ │ ├── position_09_absolute_positioning_change_bars.rml │ │ ├── position_absolute_static_position.rml │ │ ├── position_absolute_transform.rml │ │ ├── position_relative.rml │ │ ├── reference │ │ │ ├── flex_05-ref.rml │ │ │ ├── flex_06-ref.rml │ │ │ ├── flex_direction-ref.rml │ │ │ ├── flex_nested-ref.rml │ │ │ ├── flex_wrap_column_reverse-ref.rml │ │ │ ├── fractional-dimensions-02-ref.rml │ │ │ ├── gap-001-ref.rml │ │ │ ├── gap-002-ref.rml │ │ │ ├── gap-003-ref.rml │ │ │ ├── gap-004-ref.rml │ │ │ ├── gap-005-ref.rml │ │ │ ├── gap-006-ref.rml │ │ │ ├── gap-007-ref.rml │ │ │ ├── gap-008-ref.rml │ │ │ ├── gap-009-ref.rml │ │ │ ├── overflow_hidden-ref.rml │ │ │ ├── position_absolute_static_position-ref.rml │ │ │ └── table_01-ref.rml │ │ ├── renderer_alpha_blending_01.rml │ │ ├── renderer_alpha_blending_02.rml │ │ ├── renderer_alpha_blending_03.rml │ │ ├── replaced_display.rml │ │ ├── replaced_elements.rml │ │ ├── shader_conic_gradient.rml │ │ ├── shader_linear_gradient.rml │ │ ├── shader_radial_gradient.rml │ │ ├── shrink_to_fit_01.rml │ │ ├── shrink_to_fit_02.rml │ │ ├── shrink_to_fit_03.rml │ │ ├── shrink_to_fit_04.rml │ │ ├── stacking_context_01.rml │ │ ├── stacking_context_02.rml │ │ ├── table_01.rml │ │ ├── table_02.rml │ │ ├── table_03.rml │ │ ├── table_04.rml │ │ ├── table_05.rml │ │ ├── table_inline.rml │ │ ├── text_alignment.rml │ │ ├── text_decorator.rml │ │ ├── text_input_overflow.rml │ │ ├── white_space.rml │ │ └── word_break.rml │ ├── description.rml │ ├── style.rcss │ ├── view_source.rml │ └── visual_tests_help.rml ├── Dependencies │ ├── LICENSE.txt │ ├── doctest │ │ ├── cmake │ │ │ ├── Config.cmake.in │ │ │ ├── assemble_single_header.cmake │ │ │ ├── common.cmake │ │ │ ├── doctest.cmake │ │ │ ├── doctestAddTests.cmake │ │ │ └── exec_test.cmake │ │ └── doctest.h │ ├── lodepng │ │ ├── lodepng.cpp │ │ └── lodepng.h │ ├── nanobench │ │ └── nanobench.h │ └── trompeloeil │ │ ├── doctest │ │ └── trompeloeil.hpp │ │ ├── trompeloeil.hpp │ │ └── trompeloeil │ │ ├── coro.hpp │ │ ├── cpp11_shenanigans.hpp │ │ ├── lifetime.hpp │ │ ├── matcher.hpp │ │ ├── matcher │ │ ├── any.hpp │ │ ├── compare.hpp │ │ ├── deref.hpp │ │ ├── not.hpp │ │ └── re.hpp │ │ ├── mock.hpp │ │ ├── sequence.hpp │ │ └── stream_tracer.hpp ├── Output │ └── .gitignore ├── Source │ ├── Benchmarks │ │ ├── BackgroundBorder.cpp │ │ ├── CMakeLists.txt │ │ ├── DataBinding.cpp │ │ ├── DataExpression.cpp │ │ ├── Element.cpp │ │ ├── ElementDocument.cpp │ │ ├── Flexbox.cpp │ │ ├── FontEffect.cpp │ │ ├── Selectors.cpp │ │ ├── Table.cpp │ │ ├── WidgetTextInput.cpp │ │ └── main.cpp │ ├── CMakeLists.txt │ ├── Common │ │ ├── CMakeLists.txt │ │ ├── Mocks.h │ │ ├── TestsInterface.cpp │ │ ├── TestsInterface.h │ │ ├── TestsShell.cpp │ │ ├── TestsShell.h │ │ └── TypesToString.h │ ├── UnitTests │ │ ├── Animation.cpp │ │ ├── CMakeLists.txt │ │ ├── Core.cpp │ │ ├── DataBinding.cpp │ │ ├── DataExpression.cpp │ │ ├── DataModel.cpp │ │ ├── Debugger.cpp │ │ ├── Decorator.cpp │ │ ├── Element.cpp │ │ ├── ElementBackgroundBorder.cpp │ │ ├── ElementDocument.cpp │ │ ├── ElementFormControlSelect.cpp │ │ ├── ElementHandle.cpp │ │ ├── ElementImage.cpp │ │ ├── ElementStyle.cpp │ │ ├── EventListener.cpp │ │ ├── Filter.cpp │ │ ├── FlexFormatting.cpp │ │ ├── Layout.cpp │ │ ├── Localization.cpp │ │ ├── Math.cpp │ │ ├── MediaQuery.cpp │ │ ├── Properties.cpp │ │ ├── PropertySpecification.cpp │ │ ├── Selectors.cpp │ │ ├── Specificity_Basic.cpp │ │ ├── Specificity_MediaQuery.cpp │ │ ├── StableVector.cpp │ │ ├── StringUtilities.cpp │ │ ├── StyleSheetParser.cpp │ │ ├── Template.cpp │ │ ├── URL.cpp │ │ ├── Variant.cpp │ │ ├── XMLParser.cpp │ │ └── main.cpp │ └── VisualTests │ │ ├── CMakeLists.txt │ │ ├── CaptureScreen.cpp │ │ ├── CaptureScreen.h │ │ ├── TestConfig.cpp │ │ ├── TestConfig.h │ │ ├── TestNavigator.cpp │ │ ├── TestNavigator.h │ │ ├── TestSuite.h │ │ ├── TestViewer.cpp │ │ ├── TestViewer.h │ │ ├── XmlNodeHandlers.cpp │ │ ├── XmlNodeHandlers.h │ │ └── main.cpp ├── Tools │ └── convert_css_test_suite_to_rml.py └── readme.md ├── Utilities └── natvis │ └── RmlUi.natvis ├── changelog.md ├── contributing.md └── readme.md /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build.{build} 2 | 3 | image: Visual Studio 2017 4 | 5 | environment: 6 | FREETYPE_VER: 2.11.1 7 | VS_GENERATOR: Visual Studio 15 2017 Win64 8 | 9 | install: 10 | - cmd: |- 11 | cd Dependencies 12 | appveyor DownloadFile https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v%FREETYPE_VER%.zip 13 | unzip -o v%FREETYPE_VER%.zip 14 | mv "freetype-windows-binaries-%FREETYPE_VER%/include" include 15 | mv "freetype-windows-binaries-%FREETYPE_VER%/release dll/win64" lib 16 | cd .. 17 | 18 | cmake -B Build -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DRMLUI_WARNINGS_AS_ERRORS=ON 19 | 20 | build_script: 21 | - cmd: |- 22 | cmake --build Build --config Debug -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 23 | cmake --build Build --config Release -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 24 | 25 | after_build: 26 | - cmd: |- 27 | ls Build/*/*.dll -s -h -X 28 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [{CMakeLists.txt,*.cmake,*.cmake.in}] 4 | indent_style = tab 5 | indent_size = 4 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [CMakePresets.json] 10 | indent_style = tab 11 | indent_size = 4 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.{rcss,rml}] 16 | indent_style = tab 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.yml] 21 | indent_style = space 22 | indent_size = 2 23 | trim_trailing_whitespace = true 24 | insert_final_newline = true 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Primary CMake build target 2 | /Build/ 3 | 4 | # Primary CMake install target for development 5 | /Install/ 6 | 7 | # Other common build targets 8 | /build*/ 9 | /Build*/ 10 | /Bin/ 11 | /bin/ 12 | /Lib/ 13 | /lib/ 14 | /out/ 15 | /Install*/ 16 | /install*/ 17 | 18 | # Distribution target 19 | /Distribution/ 20 | 21 | # macOS directory info file 22 | .DS_Store 23 | 24 | # Hidden folders 25 | .*/ 26 | 27 | # Not ignore .github/ 28 | !.github/ 29 | 30 | # CMake user files 31 | CMakeUserPresets.json 32 | 33 | # Visual Studio project files 34 | *.suo 35 | *.user 36 | *.opensdf 37 | *.dir/ 38 | Win32/ 39 | x64/ 40 | vcpkg/ 41 | CMakeSettings.json 42 | compile_commands.json 43 | -------------------------------------------------------------------------------- /Backends/RmlUi_Include_Vulkan.h: -------------------------------------------------------------------------------- 1 | #ifndef RMLUI_BACKENDS_INCLUDE_VULKAN_H 2 | #define RMLUI_BACKENDS_INCLUDE_VULKAN_H 3 | 4 | #if defined RMLUI_PLATFORM_UNIX 5 | #define VK_USE_PLATFORM_XCB_KHR 1 6 | #endif 7 | #define VMA_STATIC_VULKAN_FUNCTIONS 0 8 | #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 9 | #endif 10 | 11 | #if defined _MSC_VER 12 | #pragma warning(push, 0) 13 | #elif defined __clang__ 14 | #pragma clang diagnostic push 15 | #pragma clang diagnostic ignored "-Wall" 16 | #pragma clang diagnostic ignored "-Wextra" 17 | #pragma clang diagnostic ignored "-Wnullability-extension" 18 | #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" 19 | #pragma clang diagnostic ignored "-Wnullability-completeness" 20 | #elif defined __GNUC__ 21 | #pragma GCC system_header 22 | #endif 23 | 24 | #include "RmlUi_Vulkan/vulkan.h" 25 | // Always include "vulkan.h" first, this comment prevents clang-format from reordering the includes. 26 | #include "RmlUi_Vulkan/vk_mem_alloc.h" 27 | 28 | #if defined _MSC_VER 29 | #pragma warning(pop) 30 | #elif defined __clang__ 31 | #pragma clang diagnostic pop 32 | #endif 33 | -------------------------------------------------------------------------------- /Backends/RmlUi_Vulkan/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: Never 3 | -------------------------------------------------------------------------------- /Backends/RmlUi_Vulkan/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The Vulkan backend for RmlUi includes the third-party dependency: 2 | 3 | Vulkan Memory Allocator 4 | https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator 5 | 6 | This dependency is located in the file 'vk_mem_alloc.h' and is licensed 7 | separately from Rmlui. The license of this dependency is recited below. 8 | 9 | ---- 10 | 11 | Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | -------------------------------------------------------------------------------- /Backends/RmlUi_Vulkan/shader_frag_color.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | #extension GL_ARB_separate_shader_objects : enable 4 | #extension GL_ARB_shading_language_420pack : enable 5 | 6 | layout (location = 0) in vec2 fragTexCoord; 7 | layout (location = 1) in vec4 fragColor; 8 | layout (location = 0) out vec4 finalColor; 9 | 10 | void main() { 11 | finalColor = fragColor; 12 | } -------------------------------------------------------------------------------- /Backends/RmlUi_Vulkan/shader_frag_texture.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | #extension GL_ARB_separate_shader_objects : enable 4 | #extension GL_ARB_shading_language_420pack : enable 5 | 6 | layout(set=1, binding=2) uniform sampler2D _tex; 7 | layout (location = 0) in vec2 fragTexCoord; 8 | layout (location = 1) in vec4 fragColor; 9 | 10 | layout (location = 0) out vec4 finalColor; 11 | 12 | void main() { 13 | vec4 texColor = texture(_tex, fragTexCoord); 14 | finalColor = fragColor * texColor; 15 | } -------------------------------------------------------------------------------- /Backends/RmlUi_Vulkan/shader_vert.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | #extension GL_ARB_separate_shader_objects : enable 4 | #extension GL_ARB_shading_language_420pack : enable 5 | 6 | layout(set=0, binding=1) uniform UserData 7 | { 8 | mat4 m_transform; 9 | vec2 m_translate; 10 | } userdata; 11 | 12 | layout (location = 0) in vec2 inPosition; 13 | layout (location = 1) in vec4 inColor0; 14 | layout (location = 2) in vec2 inTexCoord0; 15 | 16 | layout (location = 0) out vec2 fragTexCoord; 17 | layout (location = 1) out vec4 fragColor; 18 | 19 | void main() { 20 | fragTexCoord = inTexCoord0; 21 | fragColor = inColor0; 22 | vec2 translatedPos = inPosition + userdata.m_translate.xy; 23 | vec4 outPos = userdata.m_transform * vec4(translatedPos, 0, 1); 24 | gl_Position = outPos; 25 | } -------------------------------------------------------------------------------- /CMake/BackendAutoSelection.cmake: -------------------------------------------------------------------------------- 1 | function(backends_auto_selection_error) 2 | message(FATAL_ERROR 3 | "RmlUi ${RMLUI_BACKEND} backend for ${CMAKE_SYSTEM_NAME} is not available. " 4 | "Please select a backend that is available on the system. " 5 | "Possible options for RMLUI_BACKEND are: ${RMLUI_BACKEND_OPTIONS}" 6 | ) 7 | endfunction() 8 | 9 | if(RMLUI_BACKEND STREQUAL "auto") 10 | if(EMSCRIPTEN) 11 | set(RMLUI_BACKEND SDL_GL3) 12 | elseif(WIN32) 13 | set(RMLUI_BACKEND GLFW_GL3) 14 | elseif(APPLE) 15 | set(RMLUI_BACKEND SDL_SDLrenderer) 16 | elseif(UNIX) 17 | set(RMLUI_BACKEND GLFW_GL3) 18 | else() 19 | backends_auto_selection_error() 20 | endif() 21 | elseif(RMLUI_BACKEND STREQUAL "native") 22 | if(EMSCRIPTEN) 23 | set(RMLUI_BACKEND SDL_GL3) 24 | elseif(WIN32) 25 | set(RMLUI_BACKEND WIN32_GL2) 26 | elseif(UNIX AND NOT APPLE) 27 | set(RMLUI_BACKEND X11_GL2) 28 | else() 29 | backends_auto_selection_error() 30 | endif() 31 | endif() 32 | 33 | message(STATUS "Using RmlUi backend ${RMLUI_BACKEND} for samples") 34 | -------------------------------------------------------------------------------- /CMake/DependenciesForShell.cmake: -------------------------------------------------------------------------------- 1 | #[[ 2 | Set up external dependencies required by the shell utility library used by the samples. 3 | ]] 4 | 5 | # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE: 6 | # CMake >= 3.18 introduces the REQUIRED option for find_library() calls. Guaranteeing the presence of the platform SDK 7 | # by making these calls to find_library() REQUIRED should be investigated. 8 | # More info: https://cmake.org/cmake/help/latest/command/find_library.html 9 | 10 | # Link against required libraries from Windows 11 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 12 | # Required to use the functions from the shlwapi.h header 13 | find_library(Shlwapi NAMES "Shlwapi" "Shlwapi.lib" "Shlwapi.dll") 14 | if(NOT Shlwapi) 15 | # Many platform libraries are still available to linkers even if CMake cannot find them 16 | # Ignore the fact that the Shlwapi wasn't found and try to link against it anyway 17 | set(Shlwapi "Shlwapi") 18 | endif() 19 | 20 | # Set up wrapper target 21 | add_library(Windows::Shell::LightweightUtility INTERFACE IMPORTED) 22 | target_link_libraries(Windows::Shell::LightweightUtility INTERFACE ${Shlwapi}) 23 | 24 | # Link against required libraries from macOS 25 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") 26 | # Required to use the functions from the Cocoa framework 27 | find_library(Cocoa NAMES "Cocoa" "Cocoa.framework") 28 | if(NOT Cocoa) 29 | # Many platform libraries are still available to linkers even if CMake cannot find them 30 | # Ignore the fact that the Cocoa wasn't found and try to link against it anyway 31 | set(Cocoa "Cocoa") 32 | endif() 33 | 34 | # Set up wrapper target 35 | add_library(macOS::Cocoa INTERFACE IMPORTED) 36 | target_link_libraries(macOS::Cocoa INTERFACE ${Cocoa}) 37 | endif() 38 | -------------------------------------------------------------------------------- /CMake/DependenciesForTests.cmake: -------------------------------------------------------------------------------- 1 | #[[ 2 | Set up dependencies for the RmlUi tests. The dependencies are all built-in header-only libraries. 3 | ]] 4 | function(add_builtin_header_only_tests_dependency NAME) 5 | set(DEPENDENCY_PATH "${PROJECT_SOURCE_DIR}/Tests/Dependencies/${NAME}") 6 | set(DEPENDENCY_TARGET "${NAME}::${NAME}") 7 | add_library(${DEPENDENCY_TARGET} IMPORTED INTERFACE) 8 | set_property(TARGET ${DEPENDENCY_TARGET} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${DEPENDENCY_PATH}") 9 | endfunction() 10 | 11 | add_builtin_header_only_tests_dependency("doctest") 12 | add_builtin_header_only_tests_dependency("nanobench") 13 | add_builtin_header_only_tests_dependency("lodepng") 14 | add_builtin_header_only_tests_dependency("trompeloeil") 15 | 16 | # Include doctest's discovery module 17 | include("${PROJECT_SOURCE_DIR}/Tests/Dependencies/doctest/cmake/doctest.cmake") 18 | 19 | if(MSVC) 20 | target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_USE_STD_HEADERS) 21 | endif() 22 | if(NOT RMLUI_RTTI_AND_EXCEPTIONS) 23 | target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS) 24 | endif() 25 | -------------------------------------------------------------------------------- /CMake/Modules/FindHarfBuzz.cmake: -------------------------------------------------------------------------------- 1 | # Try to find HarfBuzz include and library directories. 2 | # 3 | # The following CMake variables are required: 4 | # HARFBUZZ_DIR - directories to search for the HarfBuzz source directory. 5 | # HARFBUZZ_LIB_DIRS - directories to search for the compiled HarfBuzz library. 6 | # 7 | # After a successful discovery, this will set the following: 8 | # HARFBUZZ_INCLUDE_DIR - directory containing the HarfBuzz header files. 9 | # HARFBUZZ_LIBRARY - the compiled HarfBuzz library. 10 | # In addition, the following IMPORTED target is created: 11 | # harfbuzz::harfbuzz 12 | 13 | # Look for the library in config mode first. 14 | find_package(harfbuzz CONFIG QUIET) 15 | if(TARGET harfbuzz::harfbuzz) 16 | message(STATUS "Found HarfBuzz in config mode.") 17 | set(HARFBUZZ_LIBRARY "harfbuzz::harfbuzz") 18 | return() 19 | else() 20 | message(STATUS "Looking for HarfBuzz in module mode.") 21 | endif() 22 | 23 | find_path(HARFBUZZ_INCLUDE_DIR 24 | NAMES hb.h 25 | HINTS ${HARFBUZZ_DIR} 26 | PATH_SUFFIXES harfbuzz) 27 | 28 | find_library(HARFBUZZ_LIBRARY 29 | NAMES harfbuzz 30 | HINTS ${HARFBUZZ_DIR} ${HARFBUZZ_LIB_DIRS}) 31 | 32 | include(FindPackageHandleStandardArgs) 33 | find_package_handle_standard_args(HarfBuzz DEFAULT_MSG HARFBUZZ_LIBRARY HARFBUZZ_INCLUDE_DIR) 34 | 35 | if(HARFBUZZ_FOUND AND NOT TARGET harfbuzz::harfbuzz) 36 | add_library(harfbuzz::harfbuzz INTERFACE IMPORTED) 37 | set_target_properties(harfbuzz::harfbuzz PROPERTIES 38 | INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIR}" 39 | INTERFACE_LINK_LIBRARIES "${HARFBUZZ_LIBRARY}") 40 | endif() 41 | -------------------------------------------------------------------------------- /CMake/Modules/FindLuaJIT.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the lua library 2 | # LUAJIT_FOUND - system has lua 3 | # LUAJIT_INCLUDE_DIR - the lua include directory 4 | # LUAJIT_LIBRARY - the lua library 5 | 6 | FIND_PATH(LUAJIT_INCLUDE_DIR NAMES luajit.h PATH_SUFFIXES luajit luajit-2.0 luajit-2.1) 7 | SET(_LUAJIT_STATIC_LIBS libluajit-5.1.a libluajit.a liblua51.a) 8 | SET(_LUAJIT_SHARED_LIBS luajit-5.1 luajit lua51) 9 | IF(USE_STATIC_LIBS) 10 | FIND_LIBRARY(LUAJIT_LIBRARY NAMES ${_LUAJIT_STATIC_LIBS} ${_LUAJIT_SHARED_LIBS}) 11 | ELSE() 12 | FIND_LIBRARY(LUAJIT_LIBRARY NAMES ${_LUAJIT_SHARED_LIBS} ${_LUAJIT_STATIC_LIBS}) 13 | ENDIF() 14 | INCLUDE(FindPackageHandleStandardArgs) 15 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) 16 | MARK_AS_ADVANCED(LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR) 17 | -------------------------------------------------------------------------------- /CMake/OptionsLists.cmake: -------------------------------------------------------------------------------- 1 | #[[ 2 | Lists of options available to configure certain aspects of the project. 3 | ]] 4 | 5 | set(RMLUI_BACKEND_OPTIONS 6 | "auto" 7 | "native" 8 | "Win32_GL2" 9 | "Win32_VK" 10 | "X11_GL2" 11 | "SDL_GL2" 12 | "SDL_GL3" 13 | "SDL_VK" 14 | "SDL_SDLrenderer" 15 | "SFML_GL2" 16 | "GLFW_GL2" 17 | "GLFW_GL3" 18 | "GLFW_VK" 19 | "BackwardCompatible_GLFW_GL2" 20 | "BackwardCompatible_GLFW_GL3" 21 | ) 22 | 23 | set(RMLUI_FONT_ENGINE_OPTIONS 24 | "none" 25 | "freetype" 26 | ) 27 | 28 | set(RMLUI_LUA_BINDINGS_LIBRARY_OPTIONS 29 | "lua" 30 | "lua_as_cxx" 31 | "luajit" 32 | ) 33 | -------------------------------------------------------------------------------- /CMake/RmlUiConfig.cmake.in: -------------------------------------------------------------------------------- 1 | set(RMLUI_IS_CONFIG_FILE TRUE) 2 | set(RMLUI_SVG_PLUGIN @RMLUI_SVG_PLUGIN@) 3 | set(RMLUI_LOTTIE_PLUGIN @RMLUI_LOTTIE_PLUGIN@) 4 | set(RMLUI_FONT_ENGINE "@RMLUI_FONT_ENGINE@") 5 | set(RMLUI_LUA_BINDINGS @RMLUI_LUA_BINDINGS@) 6 | set(RMLUI_LUA_BINDINGS_LIBRARY "@RMLUI_LUA_BINDINGS_LIBRARY@") 7 | set(RMLUI_TRACY_PROFILING "@RMLUI_TRACY_PROFILING@") 8 | 9 | macro(report_dependency_not_found friendly_name package_name target_name) 10 | if(RmlUi_FIND_REQUIRED) 11 | message(FATAL_ERROR 12 | "${friendly_name} could not be found.\n" 13 | "Please ensure that ${friendly_name} can be found by CMake, or linked to using \"${target_name}\" as its " 14 | "target name. The location of the build directory of the dependency can be provided by setting the " 15 | "\"${package_name}_ROOT\" CMake variable. If you are consuming RmlUi from another CMake project, you can " 16 | "create an ALIAS target to offer an alternative name for a CMake target." 17 | ) 18 | endif() 19 | return() 20 | endmacro() 21 | macro(report_dependency_found_or_error friendly_name package_name target_name) 22 | if(NOT TARGET ${target_name}) 23 | report_dependency_not_found(${friendly_name} ${package_name} ${target_name}) 24 | endif() 25 | set(success_message "") 26 | if(${ARGC} GREATER 3) 27 | set(success_message " - ${ARGV3}") 28 | endif() 29 | message(STATUS "Found ${friendly_name} target ${target_name}${success_message}") 30 | endmacro() 31 | 32 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") 33 | 34 | include("${CMAKE_CURRENT_LIST_DIR}/Dependencies.cmake") 35 | 36 | include("${CMAKE_CURRENT_LIST_DIR}/RmlUiTargets.cmake") 37 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "samples", 6 | "description": "Enable samples but only those without extra dependencies.", 7 | "cacheVariables": { 8 | "RMLUI_SAMPLES": true 9 | } 10 | }, 11 | { 12 | "name": "samples-all", 13 | "description": "Enable all samples, also those with extra dependencies.", 14 | "inherits": "samples", 15 | "cacheVariables": { 16 | "RMLUI_HARFBUZZ_SAMPLE": true, 17 | "RMLUI_LOTTIE_PLUGIN": true, 18 | "RMLUI_SVG_PLUGIN": true, 19 | "RMLUI_LUA_BINDINGS": true 20 | } 21 | }, 22 | { 23 | "name": "standalone", 24 | "description": "Build the library completely without any dependencies, features the `bitmap_font` sample.", 25 | "cacheVariables": { 26 | "RMLUI_SAMPLES": true, 27 | "RMLUI_FONT_ENGINE": "none", 28 | "RMLUI_BACKEND": "native" 29 | } 30 | }, 31 | { 32 | "name": "dev", 33 | "description": "Enable testing in addition to samples.", 34 | "installDir": "Install", 35 | "cacheVariables": { 36 | "RMLUI_SAMPLES": true, 37 | "BUILD_TESTING": true 38 | }, 39 | "warnings": { 40 | "dev": true 41 | }, 42 | "errors": { 43 | "dev": true 44 | } 45 | }, 46 | { 47 | "name": "dev-all", 48 | "description": "Enable testing in addition to samples, including those that require extra dependencies.", 49 | "inherits": "dev", 50 | "cacheVariables": { 51 | "RMLUI_HARFBUZZ_SAMPLE": true, 52 | "RMLUI_LOTTIE_PLUGIN": true, 53 | "RMLUI_SVG_PLUGIN": true, 54 | "RMLUI_LUA_BINDINGS": true 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /Dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | include/ 2 | lib/ 3 | tracy/ 4 | */ 5 | -------------------------------------------------------------------------------- /Include/RmlUi/Debugger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_DEBUGGER_H 30 | #define RMLUI_DEBUGGER_H 31 | 32 | #include "Debugger/Debugger.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Include/RmlUi/Lua.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_LUA_H 30 | #define RMLUI_LUA_H 31 | 32 | #include "Lua/Lua.h" 33 | 34 | // Helper utilities 35 | #include "Lua/IncludeLua.h" 36 | #include "Lua/Interpreter.h" 37 | #include "Lua/LuaType.h" 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Include/RmlUi/Lua/IncludeLua.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_LUA_INCLUDELUA_H 30 | #define RMLUI_LUA_INCLUDELUA_H 31 | 32 | #ifndef RMLUI_LUA_AS_CXX 33 | extern "C" { 34 | #endif 35 | 36 | // The standard Lua headers 37 | #include 38 | #include 39 | #include 40 | 41 | #ifndef RMLUI_LUA_AS_CXX 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2008-2014 CodePoint Ltd, Shift Technology Ltd, and contributors 4 | Copyright (c) 2019-2025 The RmlUi Team, and contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /Samples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RMLUI_SAMPLE_PREFIX "rmlui_sample_") 2 | 3 | if(RMLUI_BACKEND MATCHES "VK$") 4 | option(RMLUI_VK_DEBUG "Enable debugging mode for Vulkan renderer." OFF) 5 | mark_as_advanced(RMLUI_VK_DEBUG) 6 | if(RMLUI_VK_DEBUG) 7 | target_compile_definitions(rmlui_backend_${RMLUI_BACKEND} INTERFACE "RMLUI_VK_DEBUG") 8 | endif() 9 | endif() 10 | 11 | if(RMLUI_SHELL) 12 | include("${PROJECT_SOURCE_DIR}/CMake/DependenciesForShell.cmake") 13 | add_subdirectory("shell") 14 | endif() 15 | 16 | if(RMLUI_SAMPLES) 17 | if(NOT RMLUI_FONT_ENGINE_ENABLED) 18 | message(NOTICE "Building samples without any font engine selected - most samples will be disabled.") 19 | endif() 20 | 21 | add_subdirectory("basic") 22 | 23 | if(RMLUI_FONT_ENGINE_ENABLED) 24 | add_subdirectory("invaders") 25 | add_subdirectory("tutorial") 26 | endif() 27 | if(RMLUI_FONT_ENGINE_ENABLED AND RMLUI_LUA_BINDINGS) 28 | add_subdirectory("lua_invaders") 29 | endif() 30 | 31 | install(DIRECTORY assets shell 32 | DESTINATION "${CMAKE_INSTALL_DATADIR}/Samples" 33 | PATTERN "CMakeLists.txt" EXCLUDE 34 | ) 35 | endif() 36 | -------------------------------------------------------------------------------- /Samples/assets/LatoLatin-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/LatoLatin-Bold.ttf -------------------------------------------------------------------------------- /Samples/assets/LatoLatin-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/LatoLatin-BoldItalic.ttf -------------------------------------------------------------------------------- /Samples/assets/LatoLatin-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/LatoLatin-Italic.ttf -------------------------------------------------------------------------------- /Samples/assets/LatoLatin-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/LatoLatin-Regular.ttf -------------------------------------------------------------------------------- /Samples/assets/NotoEmoji-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/NotoEmoji-Regular.ttf -------------------------------------------------------------------------------- /Samples/assets/alien_small.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/alien_small.tga -------------------------------------------------------------------------------- /Samples/assets/demo.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 24 | 25 | 26 | This is a sample. 27 | 28 | 29 | -------------------------------------------------------------------------------- /Samples/assets/hello_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/hello_world.png -------------------------------------------------------------------------------- /Samples/assets/high_scores_alien_1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/high_scores_alien_1.tga -------------------------------------------------------------------------------- /Samples/assets/high_scores_alien_2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/high_scores_alien_2.tga -------------------------------------------------------------------------------- /Samples/assets/high_scores_alien_3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/high_scores_alien_3.tga -------------------------------------------------------------------------------- /Samples/assets/high_scores_defender.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/high_scores_defender.tga -------------------------------------------------------------------------------- /Samples/assets/invader.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/invader.tga -------------------------------------------------------------------------------- /Samples/assets/present.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/assets/present.tga -------------------------------------------------------------------------------- /Samples/assets/rml.rcss: -------------------------------------------------------------------------------- 1 | /* 2 | * Default styles for all the basic elements. 3 | */ 4 | 5 | div 6 | { 7 | display: block; 8 | } 9 | 10 | p 11 | { 12 | display: block; 13 | } 14 | 15 | h1 16 | { 17 | display: block; 18 | } 19 | 20 | em 21 | { 22 | font-style: italic; 23 | } 24 | 25 | strong 26 | { 27 | font-weight: bold; 28 | } 29 | 30 | select 31 | { 32 | text-align: left; 33 | } 34 | 35 | tabset tabs 36 | { 37 | display: block; 38 | } 39 | 40 | table { 41 | box-sizing: border-box; 42 | display: table; 43 | } 44 | tr { 45 | box-sizing: border-box; 46 | display: table-row; 47 | } 48 | td { 49 | box-sizing: border-box; 50 | display: table-cell; 51 | } 52 | col { 53 | box-sizing: border-box; 54 | display: table-column; 55 | } 56 | colgroup { 57 | display: table-column-group; 58 | } 59 | thead, tbody, tfoot { 60 | display: table-row-group; 61 | } 62 | -------------------------------------------------------------------------------- /Samples/assets/window.rml: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /Samples/basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following sample does not require any default font engine. 2 | add_subdirectory("bitmap_font") 3 | 4 | # Only enable the remaining samples if a default font engine is selected. 5 | if(RMLUI_FONT_ENGINE_ENABLED) 6 | add_subdirectory("animation") 7 | add_subdirectory("benchmark") 8 | add_subdirectory("custom_log") 9 | add_subdirectory("data_binding") 10 | add_subdirectory("demo") 11 | add_subdirectory("drag") 12 | add_subdirectory("effects") 13 | add_subdirectory("load_document") 14 | add_subdirectory("transform") 15 | add_subdirectory("tree_view") 16 | 17 | if(RMLUI_HARFBUZZ_SAMPLE) 18 | add_subdirectory("harfbuzz") 19 | else() 20 | message(STATUS "HarfBuzz sample disabled due to RMLUI_HARFBUZZ_SAMPLE=OFF") 21 | endif() 22 | if(RMLUI_LOTTIE_PLUGIN) 23 | add_subdirectory("lottie") 24 | else() 25 | message(STATUS "Lottie sample disabled due to RMLUI_LOTTIE_PLUGIN=OFF") 26 | endif() 27 | if(RMLUI_SVG_PLUGIN) 28 | add_subdirectory("svg") 29 | else() 30 | message(STATUS "SVG sample disabled due to RMLUI_SVG_PLUGIN=OFF") 31 | endif() 32 | 33 | # Enable the IME sample only for Windows backends; no other platform backend is currently supported. 34 | if(RMLUI_BACKEND MATCHES "^Win32") 35 | add_subdirectory("ime") 36 | else() 37 | message(STATUS "IME sample disabled - only available with Win32 backends, see RMLUI_BACKEND") 38 | endif() 39 | endif() 40 | -------------------------------------------------------------------------------- /Samples/basic/animation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "animation") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "benchmark") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/benchmark/data/benchmark.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Benchmark Sample 5 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /Samples/basic/bitmap_font/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "bitmap_font") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/FontEngineBitmap.cpp 6 | src/FontEngineBitmap.h 7 | src/FontEngineInterfaceBitmap.cpp 8 | src/FontEngineInterfaceBitmap.h 9 | src/main.cpp 10 | ) 11 | 12 | set_common_target_options(${TARGET_NAME}) 13 | 14 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 15 | 16 | install_sample_target(${TARGET_NAME}) 17 | -------------------------------------------------------------------------------- /Samples/basic/bitmap_font/data/Comfortaa_Regular_22.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/basic/bitmap_font/data/Comfortaa_Regular_22.tga -------------------------------------------------------------------------------- /Samples/basic/custom_log/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "custom_log") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | src/SystemInterface.cpp 7 | src/SystemInterface.h 8 | ) 9 | 10 | set_common_target_options(${TARGET_NAME}) 11 | 12 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 13 | 14 | install_sample_target(${TARGET_NAME}) 15 | -------------------------------------------------------------------------------- /Samples/basic/data_binding/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "data_binding") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/demo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "demo") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | src/DemoEventListener.cpp 7 | src/DemoEventListener.h 8 | src/DemoWindow.cpp 9 | src/DemoWindow.h 10 | ) 11 | 12 | set_common_target_options(${TARGET_NAME}) 13 | 14 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 15 | 16 | install_sample_target(${TARGET_NAME}) 17 | 18 | if(MSVC) 19 | # Set UTF-8 on MSVC to properly encode emoji characters. 20 | target_compile_options(${TARGET_NAME} PRIVATE /utf-8) 21 | endif() 22 | -------------------------------------------------------------------------------- /Samples/basic/drag/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "drag") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/DragListener.cpp 6 | src/DragListener.h 7 | src/Inventory.cpp 8 | src/Inventory.h 9 | src/main.cpp 10 | ) 11 | 12 | set_common_target_options(${TARGET_NAME}) 13 | 14 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 15 | 16 | install_sample_target(${TARGET_NAME}) 17 | -------------------------------------------------------------------------------- /Samples/basic/drag/data/icon.rcss: -------------------------------------------------------------------------------- 1 | icon 2 | { 3 | /* The icons are floated left so they appear left-to-right. */ 4 | float: left; 5 | 6 | /* The padding is added to push the text down to the bottom of the element. */ 7 | box-sizing: border-box; 8 | width: 100dp; 9 | height: 100dp; 10 | padding: 60dp 10dp 0 10dp; 11 | margin: 10dp; 12 | 13 | decorator: image( ../../../assets/present.tga ); 14 | 15 | font-size: 12dp; 16 | text-align: center; 17 | font-effect: shadow(1dp 1dp black); 18 | 19 | cursor: move; 20 | 21 | drag: clone; 22 | } 23 | -------------------------------------------------------------------------------- /Samples/basic/drag/data/inventory.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Inventory 6 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Samples/basic/effects/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(NOT RMLUI_BACKEND MATCHES "GL3$") 2 | message(STATUS "Effects sample disabled - only available on GL3 backends") 3 | return() 4 | endif() 5 | 6 | set(SAMPLE_NAME "effects") 7 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 8 | 9 | add_executable(${TARGET_NAME} WIN32 10 | src/main.cpp 11 | ) 12 | 13 | set_common_target_options(${TARGET_NAME}) 14 | 15 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 16 | 17 | install_sample_target(${TARGET_NAME}) 18 | -------------------------------------------------------------------------------- /Samples/basic/harfbuzz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "harfbuzz") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/FontEngineInterfaceHarfBuzz.cpp 6 | src/FontEngineInterfaceHarfBuzz.h 7 | src/FontFace.cpp 8 | src/FontFace.h 9 | src/FontFaceHandleHarfBuzz.cpp 10 | src/FontFaceHandleHarfBuzz.h 11 | src/FontFaceLayer.cpp 12 | src/FontFaceLayer.h 13 | src/FontFamily.cpp 14 | src/FontFamily.h 15 | src/FontGlyph.h 16 | src/FontProvider.cpp 17 | src/FontProvider.h 18 | src/FreeTypeInterface.cpp 19 | src/FreeTypeInterface.h 20 | src/LanguageData.h 21 | src/TextureLayout.cpp 22 | src/TextureLayout.h 23 | src/TextureLayoutRectangle.cpp 24 | src/TextureLayoutRectangle.h 25 | src/TextureLayoutRow.cpp 26 | src/TextureLayoutRow.h 27 | src/TextureLayoutTexture.cpp 28 | src/TextureLayoutTexture.h 29 | src/main.cpp 30 | ) 31 | 32 | set_common_target_options(${TARGET_NAME}) 33 | 34 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell Freetype::Freetype harfbuzz::harfbuzz) 35 | 36 | # Use private Core headers as a workaround for now, until we merge the HarfBuzz font engine into Core. 37 | target_include_directories(${TARGET_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/Source/Core) 38 | # Remove this check once the HarfBuzz font engine has been merged into Core. 39 | if(WIN32 AND BUILD_SHARED_LIBS) 40 | message(FATAL_ERROR "The HarfBuzz sample cannot be built when using shared libraries on Windows. Please disable either BUILD_SHARED_LIBS or RMLUI_HARFBUZZ_SAMPLE.") 41 | endif() 42 | 43 | install_sample_target(${TARGET_NAME}) 44 | -------------------------------------------------------------------------------- /Samples/basic/harfbuzz/data/Cairo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/basic/harfbuzz/data/Cairo-Regular.ttf -------------------------------------------------------------------------------- /Samples/basic/harfbuzz/data/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/basic/harfbuzz/data/Poppins-Regular.ttf -------------------------------------------------------------------------------- /Samples/basic/ime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "ime") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/SystemFontWin32.cpp 6 | src/SystemFontWin32.h 7 | src/main.cpp 8 | ) 9 | 10 | set_common_target_options(${TARGET_NAME}) 11 | 12 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 13 | 14 | install_sample_target(${TARGET_NAME}) 15 | -------------------------------------------------------------------------------- /Samples/basic/ime/src/SystemFontWin32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_SAMPLES_IME_SYSTEMFONTWIN32_H 30 | #define RMLUI_SAMPLES_IME_SYSTEMFONTWIN32_H 31 | 32 | #include 33 | 34 | Rml::Vector GetSelectedSystemFonts(); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Samples/basic/load_document/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "load_document") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/lottie/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "lottie") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/lottie/data/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The file 'a_mountain.json' included in this directory is from the rlottie project [1], licensed under MIT. The license is restated below. 2 | [1] https://github.com/Samsung/rlottie 3 | 4 | ---------------------------- 5 | 6 | Copyright 2020 (see AUTHORS) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 13 | -------------------------------------------------------------------------------- /Samples/basic/lottie/data/lottie.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/basic/svg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "svg") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/svg/data/svg_decorator.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 22 | 23 | 24 |
25 | 26 |
27 | -------------------------------------------------------------------------------- /Samples/basic/svg/data/svg_element.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Demo 4 | 5 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Samples/basic/transform/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "transform") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/basic/tree_view/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "tree_view") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/FileBrowser.cpp 6 | src/FileBrowser.h 7 | src/main.cpp 8 | ) 9 | 10 | set_common_target_options(${TARGET_NAME}) 11 | 12 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 13 | 14 | install_sample_target(${TARGET_NAME}) 15 | -------------------------------------------------------------------------------- /Samples/basic/tree_view/data/tree_view.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tree View 5 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 |
46 | 47 | 48 | {{ file.name }} 49 |
53 | 54 |
55 | -------------------------------------------------------------------------------- /Samples/basic/tree_view/src/FileBrowser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef FILEBROWSER_H 30 | #define FILEBROWSER_H 31 | 32 | #include 33 | 34 | namespace FileBrowser { 35 | 36 | bool Initialise(Rml::Context* context, const Rml::String& root_dir); 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Samples/invaders/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "invaders") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/DecoratorDefender.cpp 6 | src/DecoratorDefender.h 7 | src/DecoratorStarfield.cpp 8 | src/DecoratorStarfield.h 9 | src/Defender.cpp 10 | src/Defender.h 11 | src/ElementGame.cpp 12 | src/ElementGame.h 13 | src/EventHandler.cpp 14 | src/EventHandler.h 15 | src/EventHandlerHighScore.cpp 16 | src/EventHandlerHighScore.h 17 | src/EventHandlerOptions.cpp 18 | src/EventHandlerOptions.h 19 | src/EventHandlerStartGame.cpp 20 | src/EventHandlerStartGame.h 21 | src/EventListener.cpp 22 | src/EventListener.h 23 | src/EventListenerInstancer.cpp 24 | src/EventListenerInstancer.h 25 | src/EventManager.cpp 26 | src/EventManager.h 27 | src/Game.cpp 28 | src/Game.h 29 | src/GameDetails.cpp 30 | src/GameDetails.h 31 | src/HighScores.cpp 32 | src/HighScores.h 33 | src/Invader.cpp 34 | src/Invader.h 35 | src/main.cpp 36 | src/Mothership.cpp 37 | src/Mothership.h 38 | src/Shield.cpp 39 | src/Shield.h 40 | src/Sprite.cpp 41 | src/Sprite.h 42 | ) 43 | 44 | set_common_target_options(${TARGET_NAME}) 45 | 46 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 47 | 48 | install_sample_target(${TARGET_NAME}) 49 | -------------------------------------------------------------------------------- /Samples/invaders/data/background.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Samples/invaders/data/background.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/background.tga -------------------------------------------------------------------------------- /Samples/invaders/data/help_defender.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/help_defender.tga -------------------------------------------------------------------------------- /Samples/invaders/data/help_invader_mothership.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/help_invader_mothership.tga -------------------------------------------------------------------------------- /Samples/invaders/data/help_invader_rank1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/help_invader_rank1.tga -------------------------------------------------------------------------------- /Samples/invaders/data/help_invader_rank2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/help_invader_rank2.tga -------------------------------------------------------------------------------- /Samples/invaders/data/help_invader_rank3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/help_invader_rank3.tga -------------------------------------------------------------------------------- /Samples/invaders/data/high_scores_defender.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/high_scores_defender.tga -------------------------------------------------------------------------------- /Samples/invaders/data/invaders.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/invaders.tga -------------------------------------------------------------------------------- /Samples/invaders/data/logo.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Samples/invaders/data/logo.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/invaders/data/logo.tga -------------------------------------------------------------------------------- /Samples/invaders/data/main_menu.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Main Menu 4 | 5 | 19 | 20 | 21 |
22 |
23 |
24 |
25 | 26 | 27 |
28 | -------------------------------------------------------------------------------- /Samples/invaders/data/options.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options 4 | 5 | 26 | 27 | 28 |
29 |
30 |

31 | Graphics
32 |
33 |
34 |
35 |

36 | 37 |

38 | Audio
39 |
40 | 41 |

42 |
43 | Accept 44 | Cancel 45 |
46 | 47 |
48 | -------------------------------------------------------------------------------- /Samples/invaders/data/pause.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Quit? 4 | 5 | 19 | 20 | 21 |
22 |

Are you sure you want to end this game?

23 | 24 | 25 | 26 |
27 | -------------------------------------------------------------------------------- /Samples/invaders/src/EventHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "EventHandler.h" 30 | 31 | EventHandler::~EventHandler() {} 32 | -------------------------------------------------------------------------------- /Samples/invaders/src/EventHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_INVADERS_EVENTHANDLER_H 30 | #define RMLUI_INVADERS_EVENTHANDLER_H 31 | 32 | #include 33 | 34 | /** 35 | @author Peter Curry 36 | */ 37 | 38 | class EventHandler { 39 | public: 40 | virtual ~EventHandler(); 41 | virtual void ProcessEvent(Rml::Event& event, const Rml::String& value) = 0; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Samples/lua_invaders/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SAMPLE_NAME "lua_invaders") 2 | set(TARGET_NAME "${RMLUI_SAMPLE_PREFIX}${SAMPLE_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/DecoratorDefender.cpp 6 | src/DecoratorDefender.h 7 | src/DecoratorStarfield.cpp 8 | src/DecoratorStarfield.h 9 | src/Defender.cpp 10 | src/Defender.h 11 | src/ElementGame.cpp 12 | src/ElementGame.h 13 | src/ElementGameInstancer.cpp 14 | src/ElementGameInstancer.h 15 | src/Game.cpp 16 | src/Game.h 17 | src/GameDetails.cpp 18 | src/GameDetails.h 19 | src/HighScores.cpp 20 | src/HighScores.h 21 | src/Invader.cpp 22 | src/Invader.h 23 | src/LuaInterface.cpp 24 | src/LuaInterface.h 25 | src/main.cpp 26 | src/Mothership.cpp 27 | src/Mothership.h 28 | src/Shield.cpp 29 | src/Shield.h 30 | src/Sprite.cpp 31 | src/Sprite.h 32 | ) 33 | 34 | set_common_target_options(${TARGET_NAME}) 35 | 36 | target_link_libraries(${TARGET_NAME} PRIVATE 37 | rmlui_shell 38 | rmlui_lua 39 | RmlUi::External::Lua 40 | ) 41 | 42 | install_sample_target(${TARGET_NAME}) 43 | -------------------------------------------------------------------------------- /Samples/lua_invaders/data/background.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Samples/lua_invaders/data/background.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/background.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/help_defender.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/help_defender.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/help_invader_mothership.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/help_invader_mothership.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/help_invader_rank1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/help_invader_rank1.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/help_invader_rank2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/help_invader_rank2.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/help_invader_rank3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/help_invader_rank3.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/high_scores_defender.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/high_scores_defender.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/invaders.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/invaders.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/logo.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Samples/lua_invaders/data/logo.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikke89/RmlUi/0c96c0eed25c5d86ae300887eae4a0333b34b22b/Samples/lua_invaders/data/logo.tga -------------------------------------------------------------------------------- /Samples/lua_invaders/data/main_menu.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Main Menu 4 | 5 | 19 | 29 | 30 | 31 |
32 |
33 |
34 |
35 | 36 | 37 |
38 | -------------------------------------------------------------------------------- /Samples/lua_invaders/data/pause.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Quit? 4 | 5 | 19 | 20 | 21 |
22 |

Are you sure you want to end this game?

23 | 24 | 25 | 26 |
27 | -------------------------------------------------------------------------------- /Samples/lua_invaders/data/window.rml: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /Samples/lua_invaders/lua/start.lua: -------------------------------------------------------------------------------- 1 | function Startup() 2 | maincontext = rmlui.contexts["main"] 3 | maincontext:LoadDocument("lua_invaders/data/background.rml"):Show() 4 | maincontext:LoadDocument("lua_invaders/data/main_menu.rml"):Show() 5 | end 6 | 7 | Startup() 8 | -------------------------------------------------------------------------------- /Samples/lua_invaders/src/ElementGameInstancer.cpp: -------------------------------------------------------------------------------- 1 | #include "ElementGameInstancer.h" 2 | #include "ElementGame.h" 3 | 4 | ElementGameInstancer::~ElementGameInstancer() {} 5 | 6 | Rml::ElementPtr ElementGameInstancer::InstanceElement(Rml::Element* /*parent*/, const Rml::String& tag, const Rml::XMLAttributes& /*attributes*/) 7 | { 8 | return Rml::ElementPtr(new ElementGame(tag)); 9 | } 10 | 11 | void ElementGameInstancer::ReleaseElement(Rml::Element* element) 12 | { 13 | delete element; 14 | } 15 | -------------------------------------------------------------------------------- /Samples/lua_invaders/src/ElementGameInstancer.h: -------------------------------------------------------------------------------- 1 | #ifndef RMLUI_LUAINVADERS_ELEMENTGAMEINSTANCER_H 2 | #define RMLUI_LUAINVADERS_ELEMENTGAMEINSTANCER_H 3 | 4 | #include 5 | 6 | class ElementGameInstancer : public Rml::ElementInstancer { 7 | public: 8 | virtual ~ElementGameInstancer(); 9 | 10 | /// Instances an element given the tag name and attributes 11 | /// @param tag Name of the element to instance 12 | /// @param attributes vector of name value pairs 13 | Rml::ElementPtr InstanceElement(Rml::Element* parent, const Rml::String& tag, const Rml::XMLAttributes& attributes) override; 14 | 15 | /// Releases the given element 16 | /// @param element to release 17 | void ReleaseElement(Rml::Element* element) override; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Samples/lua_invaders/src/LuaInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef RMLUI_LUAINVADERS_LUAINTERFACE_H 2 | #define RMLUI_LUAINVADERS_LUAINTERFACE_H 3 | /* 4 | This will define the "Game" global table in Lua and some functions with it. 5 | 6 | In Lua, the skeleton definition of Game with the fake function definitions (because it calls c++ code) would look something like 7 | 8 | Game = Game or {} --so if something else made a "Game" table, we would save the previous table, and just add on to it 9 | Game.Shutdown = function() Shell::RequestExit() end 10 | Game.SetPaused = function(paused) GameDetails::SetPaused(paused) end --where paused is a bool 11 | Game.SetDifficulty = function(difficulty) GameDetails::SetDifficulty(difficulty) end --difficulty is a value from Game.difficulty 12 | Game.SetDefenderColour = function(colour) GameDetails::SetDefenderColour(colour) end --colour is of type Colourb 13 | Game.SubmitHighScore = function() HighScores::SubmitScore(stuff from GameDetails) end 14 | Game.SetHighScoreName = function(name) HighScore::SubmitName(name) end -- name is a string 15 | Game.difficulty = { "HARD" = GameDetails::HARD, "EASY" = GameDetails::EASY } 16 | */ 17 | 18 | struct lua_State; 19 | class Game; 20 | class LuaInterface { 21 | public: 22 | static void Initialise(lua_State* L); 23 | static void InitGame(lua_State* L); 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Samples/shell/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[ 2 | Note: rmlui_shell is NOT a sample. It's a utility static library with code common to the RmlUi samples. 3 | ]] 4 | 5 | add_library(rmlui_shell STATIC 6 | src/PlatformExtensions.cpp 7 | src/RendererExtensions.cpp 8 | src/Shell.cpp 9 | src/ShellFileInterface.cpp 10 | 11 | include/PlatformExtensions.h 12 | include/RendererExtensions.h 13 | include/Shell.h 14 | include/ShellFileInterface.h 15 | ) 16 | 17 | set_common_target_options(rmlui_shell) 18 | 19 | target_link_libraries(rmlui_shell PRIVATE rmlui_backend_${RMLUI_BACKEND}) 20 | 21 | target_include_directories(rmlui_shell PUBLIC "include" "${PROJECT_SOURCE_DIR}/Backends") 22 | 23 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 24 | target_link_libraries(rmlui_shell PRIVATE Windows::Shell::LightweightUtility) 25 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") 26 | target_link_libraries(rmlui_shell PRIVATE macOS::Cocoa) 27 | endif() 28 | 29 | target_link_libraries(rmlui_shell PUBLIC rmlui_core rmlui_debugger) 30 | 31 | if(RMLUI_BACKEND MATCHES "GL2$") 32 | target_compile_definitions(rmlui_shell PRIVATE "RMLUI_RENDERER_GL2") 33 | endif() 34 | if(RMLUI_BACKEND MATCHES "GL3$") 35 | target_compile_definitions(rmlui_shell PRIVATE "RMLUI_RENDERER_GL3") 36 | endif() 37 | -------------------------------------------------------------------------------- /Samples/tutorial/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RMLUI_TUTORIAL_PREFIX "rmlui_tutorial_") 2 | 3 | add_subdirectory("drag") 4 | add_subdirectory("template") 5 | -------------------------------------------------------------------------------- /Samples/tutorial/drag/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TUTORIAL_NAME "drag") 2 | set(TARGET_NAME "${RMLUI_TUTORIAL_PREFIX}${TUTORIAL_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/Inventory.cpp 6 | src/Inventory.h 7 | src/main.cpp 8 | ) 9 | 10 | set_common_target_options(${TARGET_NAME}) 11 | 12 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 13 | 14 | install_sample_target(${TARGET_NAME}) 15 | -------------------------------------------------------------------------------- /Samples/tutorial/drag/data/inventory.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Inventory 6 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Samples/tutorial/drag/data/tutorial.rcss: -------------------------------------------------------------------------------- 1 | /* Hide the window icon. */ 2 | div#title_bar div#icon 3 | { 4 | display: none; 5 | } 6 | 7 | icon 8 | { 9 | /* The icons are floated left so they appear left-to-right. */ 10 | float: left; 11 | 12 | /* The padding is added to push the text down to the bottom of the element. */ 13 | box-sizing: border-box; 14 | width: 100dp; 15 | height: 100dp; 16 | padding: 60dp 10dp 0dp 10dp; 17 | margin: 10dp; 18 | 19 | decorator: image( /assets/present.tga ); 20 | 21 | font-size: 12dp; 22 | text-align: center; 23 | font-effect: shadow(1dp 1dp black); 24 | } 25 | -------------------------------------------------------------------------------- /Samples/tutorial/drag/src/Inventory.cpp: -------------------------------------------------------------------------------- 1 | #include "Inventory.h" 2 | #include 3 | 4 | Inventory::Inventory(const Rml::String& title, const Rml::Vector2f& position, Rml::Context* context) 5 | { 6 | document = context->LoadDocument("tutorial/drag/data/inventory.rml"); 7 | if (document) 8 | { 9 | document->GetElementById("title")->SetInnerRML(title); 10 | document->SetProperty(Rml::PropertyId::Left, Rml::Property(position.x, Rml::Unit::DP)); 11 | document->SetProperty(Rml::PropertyId::Top, Rml::Property(position.y, Rml::Unit::DP)); 12 | document->Show(); 13 | } 14 | } 15 | 16 | Inventory::~Inventory() 17 | { 18 | if (document) 19 | document->Close(); 20 | } 21 | 22 | void Inventory::AddItem(const Rml::String& name) 23 | { 24 | if (!document) 25 | return; 26 | 27 | Rml::Element* content = document->GetElementById("content"); 28 | if (!content) 29 | return; 30 | 31 | // Create the new 'icon' element. 32 | Rml::ElementPtr icon = Rml::Factory::InstanceElement(content, "icon", "icon", Rml::XMLAttributes()); 33 | icon->SetInnerRML(name); 34 | content->AppendChild(std::move(icon)); 35 | } 36 | -------------------------------------------------------------------------------- /Samples/tutorial/drag/src/Inventory.h: -------------------------------------------------------------------------------- 1 | #ifndef INVENTORY_H 2 | #define INVENTORY_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | /** 9 | @author Peter Curry 10 | */ 11 | 12 | class Inventory { 13 | public: 14 | /// Constructs a new inventory and opens its window. 15 | /// @param[in] title The title of the new inventory. 16 | /// @param[in] position The position of the inventory window. 17 | /// @param[in] context The context to open the inventory window in. 18 | Inventory(const Rml::String& title, const Rml::Vector2f& position, Rml::Context* context); 19 | /// Destroys the inventory and closes its window. 20 | ~Inventory(); 21 | 22 | /// Adds a brand-new item into this inventory. 23 | /// @param[in] name The name of this item. 24 | void AddItem(const Rml::String& name); 25 | 26 | private: 27 | Rml::ElementDocument* document; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Samples/tutorial/template/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TUTORIAL_NAME "template") 2 | set(TARGET_NAME "${RMLUI_TUTORIAL_PREFIX}${TUTORIAL_NAME}") 3 | 4 | add_executable(${TARGET_NAME} WIN32 5 | src/main.cpp 6 | ) 7 | 8 | set_common_target_options(${TARGET_NAME}) 9 | 10 | target_link_libraries(${TARGET_NAME} PRIVATE rmlui_shell) 11 | 12 | install_sample_target(${TARGET_NAME}) 13 | -------------------------------------------------------------------------------- /Samples/tutorial/template/data/tutorial.rcss: -------------------------------------------------------------------------------- 1 | @spritesheet theme 2 | { 3 | src: /assets/invader.tga; 4 | 5 | window-tl: 0px 0px 133px 140px; 6 | window-t: 134px 0px 1px 140px; 7 | window-tr: 136px 0px 10px 140px; 8 | window-l: 0px 139px 10px 1px; 9 | window-c: 11px 139px 1px 1px; 10 | window-r: 10px 139px -10px 1px; /* mirrored left */ 11 | window-bl: 0px 140px 11px 11px; 12 | window-b: 11px 140px 1px 11px; 13 | window-br: 136px 140px 10px 11px; 14 | } 15 | 16 | body 17 | { 18 | font-family: LatoLatin; 19 | font-weight: normal; 20 | font-style: normal; 21 | font-size: 15dp; 22 | color: white; 23 | } 24 | 25 | body.window 26 | { 27 | decorator: tiled-box( 28 | window-tl, window-t, window-tr, 29 | window-l, window-c, window-r, 30 | window-bl, window-b, window-br 31 | ); 32 | } 33 | 34 | div 35 | { 36 | display: block; 37 | } 38 | -------------------------------------------------------------------------------- /Samples/tutorial/template/data/tutorial.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Window 5 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory("Core") 2 | 3 | if(RMLUI_LOTTIE_PLUGIN) 4 | add_subdirectory("Lottie") 5 | endif() 6 | if(RMLUI_SVG_PLUGIN) 7 | add_subdirectory("SVG") 8 | endif() 9 | 10 | add_subdirectory("Debugger") 11 | 12 | if(RMLUI_LUA_BINDINGS) 13 | add_subdirectory("Lua") 14 | endif() 15 | -------------------------------------------------------------------------------- /Source/Core/ContextInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/ContextInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | ContextInstancer::~ContextInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /Source/Core/EventInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/EventInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | EventInstancer::~EventInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /Source/Core/EventListenerInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/EventListenerInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | EventListenerInstancer::~EventListenerInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /Source/Core/FontEngineDefault/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE: 2 | # Using absolute paths to prevent improper interpretation of relative paths Relative paths can be used once the minimum 3 | # CMake version is greater or equal than CMake 3.13 4 | target_sources(rmlui_core PRIVATE 5 | "${CMAKE_CURRENT_SOURCE_DIR}/FontEngineInterfaceDefault.cpp" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/FontEngineInterfaceDefault.h" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFace.cpp" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFace.h" 9 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceHandleDefault.cpp" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceHandleDefault.h" 11 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceLayer.cpp" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceLayer.h" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFamily.cpp" 14 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFamily.h" 15 | "${CMAKE_CURRENT_SOURCE_DIR}/FontProvider.cpp" 16 | "${CMAKE_CURRENT_SOURCE_DIR}/FontProvider.h" 17 | "${CMAKE_CURRENT_SOURCE_DIR}/FontTypes.h" 18 | "${CMAKE_CURRENT_SOURCE_DIR}/FreeTypeInterface.cpp" 19 | "${CMAKE_CURRENT_SOURCE_DIR}/FreeTypeInterface.h" 20 | ) 21 | 22 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_FONT_ENGINE_FREETYPE") 23 | -------------------------------------------------------------------------------- /Source/Core/Traits.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | * 26 | */ 27 | 28 | #include "../../Include/RmlUi/Core/Traits.h" 29 | 30 | namespace Rml { 31 | 32 | int FamilyBase::GetNewId() 33 | { 34 | static int id = 0; 35 | return id++; 36 | } 37 | 38 | } // namespace Rml 39 | -------------------------------------------------------------------------------- /Source/Core/XMLNodeHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/XMLNodeHandler.h" 30 | 31 | namespace Rml { 32 | 33 | XMLNodeHandler::~XMLNodeHandler() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /Source/Core/precompiled.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_PRECOMPILED_H 30 | #define RMLUI_CORE_PRECOMPILED_H 31 | 32 | #include "../../Include/RmlUi/Core.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Source/Debugger/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: InheritParentConfig 2 | NamespaceIndentation: None 3 | -------------------------------------------------------------------------------- /Source/Debugger/ElementDebugDocument.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "ElementDebugDocument.h" 30 | 31 | namespace Rml { 32 | namespace Debugger { 33 | 34 | ElementDebugDocument::ElementDebugDocument(const String& tag) : ElementDocument(tag) 35 | { 36 | SetFocusableFromModal(true); 37 | } 38 | 39 | } // namespace Debugger 40 | } // namespace Rml 41 | -------------------------------------------------------------------------------- /Source/Lottie/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This plugin targets rmlui_core directly and is incorporated into the core library when enabled. 2 | 3 | target_sources(rmlui_core PRIVATE 4 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementLottie.cpp" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/LottiePlugin.cpp" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/LottiePlugin.h" 7 | "${PROJECT_SOURCE_DIR}/Include/RmlUi/Lottie/ElementLottie.h" 8 | ) 9 | 10 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_LOTTIE_PLUGIN") 11 | -------------------------------------------------------------------------------- /Source/Lottie/LottiePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_LOTTIE_LOTTIE_PLUGIN_H 30 | #define RMLUI_LOTTIE_LOTTIE_PLUGIN_H 31 | 32 | namespace Rml { 33 | namespace Lottie { 34 | 35 | void Initialise(); 36 | 37 | } 38 | } // namespace Rml 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Source/Lua/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: InheritParentConfig 2 | NamespaceIndentation: None 3 | -------------------------------------------------------------------------------- /Source/Lua/Elements/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE: 2 | # Using absolute paths to prevent improper interpretation of relative paths. Relative paths can be used once the minimum 3 | # CMake version is greater or equal than CMake 3.13 4 | target_sources(rmlui_lua PRIVATE 5 | "${CMAKE_CURRENT_SOURCE_DIR}/As.h" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementForm.cpp" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementForm.h" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControl.cpp" 9 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControl.h" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlInput.cpp" 11 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlInput.h" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlSelect.cpp" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlSelect.h" 14 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlTextArea.cpp" 15 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementFormControlTextArea.h" 16 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementTabSet.cpp" 17 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementTabSet.h" 18 | "${CMAKE_CURRENT_SOURCE_DIR}/SelectOptionsProxy.cpp" 19 | "${CMAKE_CURRENT_SOURCE_DIR}/SelectOptionsProxy.h" 20 | ) 21 | -------------------------------------------------------------------------------- /Source/Lua/Lua.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "LuaPlugin.h" 30 | #include 31 | #include 32 | 33 | namespace Rml { 34 | namespace Lua { 35 | 36 | void Initialise() 37 | { 38 | ::Rml::Lua::Initialise(nullptr); 39 | } 40 | 41 | void Initialise(lua_State* lua_state) 42 | { 43 | ::Rml::RegisterPlugin(new LuaPlugin(lua_state)); 44 | } 45 | 46 | } // namespace Lua 47 | } // namespace Rml 48 | -------------------------------------------------------------------------------- /Source/SVG/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This plugin targets rmlui_core directly and is incorporated into the core library when enabled. 2 | 3 | target_sources(rmlui_core PRIVATE 4 | "${CMAKE_CURRENT_SOURCE_DIR}/DecoratorSVG.cpp" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/DecoratorSVG.h" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementSVG.cpp" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGCache.cpp" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGCache.h" 9 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGPlugin.cpp" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGPlugin.h" 11 | "${PROJECT_SOURCE_DIR}/Include/RmlUi/SVG/ElementSVG.h" 12 | ) 13 | 14 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_SVG_PLUGIN") 15 | -------------------------------------------------------------------------------- /Source/SVG/SVGPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019- The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_SVG_SVG_PLUGIN_H 30 | #define RMLUI_SVG_SVG_PLUGIN_H 31 | 32 | namespace Rml { 33 | namespace SVG { 34 | 35 | void Initialise(); 36 | 37 | } 38 | } // namespace Rml 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Enable some extra testing code in the core library. 2 | target_compile_definitions(rmlui_core PUBLIC RMLUI_TESTS_ENABLED) 3 | 4 | include("${PROJECT_SOURCE_DIR}/CMake/DependenciesForTests.cmake") 5 | 6 | if(EMSCRIPTEN) 7 | # Add data for tests to emscripten targets 8 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sLLD_REPORT_UNDEFINED") 9 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --preload-file \"${CMAKE_CURRENT_SOURCE_DIR}/Data/@/Tests/Data/\"") 10 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --preload-file \"${PROJECT_SOURCE_DIR}/Samples/basic/demo/data/@/basic/demo/data/\"") 11 | endif() 12 | 13 | add_subdirectory("Source") 14 | -------------------------------------------------------------------------------- /Tests/Data/UnitTests/Specificity_Basic.rcss: -------------------------------------------------------------------------------- 1 | body { 2 | display: block; 3 | width: 10px; 4 | height: 100px; 5 | background: #ccc; 6 | } 7 | 8 | .a { 9 | width: 80px; 10 | } 11 | .b { 12 | width: 90px; 13 | } 14 | .c { 15 | width: 100px; 16 | } 17 | -------------------------------------------------------------------------------- /Tests/Data/UnitTests/Specificity_MediaQuery.rcss: -------------------------------------------------------------------------------- 1 | body { 2 | display:block; 3 | width: 100px; 4 | height: 100px; 5 | background: #ccc; 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Data/UnitTests/data-title.rml: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /Tests/Data/UnitTests/template_basic.rml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/border_radius.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Border-radius 4 | 5 | 6 | 7 | 46 | 47 | 48 | 49 |

The following boxes should produce curved borders. There should be no overlapping triangles, and their backgrounds should not be visible outside their borders.

50 |
51 |
52 |
53 |

The following text should wrap down to the
next line
and produce borders on each line.

54 | 55 | 56 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/box_sizing.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Box-sizing property 4 | 5 | 6 | 7 | 40 | 41 | 42 | 43 |

Setting the 'box-sizing' property on elements using the same width and height.

44 |
45 |
box-sizing: content-box
46 |
box-sizing: border-box
47 |
48 |
49 |

The following boxes should line up side-by-side.

50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |

There should be no scrollbars, and no red visible.

62 |
63 |
64 |
65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/clip_mask.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Clip mask 4 | 5 | 6 | 50 | 51 | 52 | 53 |
54 | Duck aloft 55 | 56 | A 57 | 58 | X 59 |
60 |
61 | Y 62 | 63 | C 64 | 65 | Some long text 66 | 67 | Z 68 | 69 | W 70 |
71 | 72 |
73 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/display_block_inside_inline.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Display: Block box within inline 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 |
Y
16 |
17 | Z 18 |
19 | 20 | 50 | 51 |
52 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/document_position.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Document position 4 | 5 | 6 | 7 | 57 | 58 | 59 | 60 |

Document

61 | 62 |
63 |

Block

64 | 65 | 66 | 67 |
68 | 69 | 70 | 71 | 72 |
73 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/drag.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Drag 4 | 5 | 6 | 7 | 8 | 9 | 46 | 47 | 48 | 49 |
50 |
51 |
52 |
53 |
54 |
55 | 56 | 57 |
58 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/filter_backdrop_filter_box_shadow.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Filter, backdrop filter, and box shadow combinations 4 | 5 | 6 | 27 | 28 | 29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 | 39 |
40 |
41 | 42 | 43 | 44 |
45 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/filter_blur_area.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Filter: blur area 4 | 5 | 6 | 7 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/filter_blur_orb.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Filter: blur orb 4 | 5 | 6 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/filter_drop_shadow.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Filter: drop-shadow 4 | 5 | 6 | 23 | 24 | 25 | 26 |
27 | 28 | 29 |
30 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/filter_overflow.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Filter: overflowing content 4 | 5 | 6 | 7 | 8 | 27 | 28 | 29 | 30 |
31 |
32 |
33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/flex_absolutely_positioned.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flex - Absolutely positioned 4 | 5 | 6 | 28 | 29 | 30 | 31 |
32 |
1
33 |
2
34 |
3
35 |
36 |
37 |
38 |
1
39 |
2
40 |
3
41 |
42 |
43 |
44 |
1
45 |
2
46 |
3
47 |
48 | 49 | 50 |
51 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/flex_inline.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline flexboxes 4 | 5 | 6 | 7 | 36 | 37 | 38 | 39 |

40 | Can we 41 |

42 |
A
43 |
B
44 |
C
45 |
46 | play 47 |
48 |
A
49 |
B
50 |
C
51 |
52 | Tetris 53 |
54 |
A
55 |
B
56 |
C
57 |
58 | 59 | with flexboxes 60 |
61 |
A
62 |
B
63 |
C
64 |
65 | ? 66 | 67 |

68 | 69 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/flex_nested.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flex - Nested flex boxes 4 | 5 | 6 | 7 | 8 | 9 | 29 | 30 | 31 | 32 |
33 |
34 |
1
35 |
2
36 |
3
37 |
38 |
39 |
1
40 |
2
41 |
3
42 |
43 |
44 | 45 | 46 |
47 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/float_overflow.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Floats: overflow 4 | 5 | 6 | 7 | 29 | 30 | 31 | 32 |
33 |
float: left
34 |

The float to the left should extend past the background of the containing '.box' element.

35 |
36 |
37 |
38 |
float: left
39 |

Using 'overflow: auto' on the containing '.box' element. This should establish a new block formatting context (thereby resolving all floats) so that the background wraps around the entire float.

40 |
41 |
42 |
43 |
float: left
44 |

Using 'display: flow-root' on the containing '.box' element. This also establishes a new block formatting context, and should be equivalent to the previous box.

45 |
46 | 47 | 48 |
49 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/float_text_wrap.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Text wrapping around floats 4 | 5 | 6 | 7 | 33 | 34 | 35 | 36 |
37 |
Try to resize this outer float
38 |

AA B CCC

39 |
40 | 41 | 42 |
43 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/fractional-dimensions-01.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fractional dimensions 01 5 | 6 | 7 | 25 | 26 | 27 |

Borders should be placed edge-to-edge, and there should be no red.

28 | 29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | 65 |
66 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-001.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - horizontal 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 26 | 27 | 28 |

Test passes if there is a green vertical line between boxes.

29 |
30 |
31 |
32 |
33 |
34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-002.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - vertical 5 | 6 | 7 | 8 | 9 | 10 | 25 | 26 | 27 |

Test passes if there is a green horizontal line between boxes.

28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-003.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - rows and columns 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 27 | 28 | 29 |

Test passes if there are green lines between boxes.

30 |
31 |
32 |
33 |
34 |
35 |
36 | 37 |
38 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-004.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - intrinsic horizontal 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 | 27 |

Test passes if there are green lines between boxes.

28 |
29 |
Black Panther
30 |
Wonder Woman
31 |
Storm
32 |
Flash
33 |
34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-005.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - intrinsic vertical 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 | 27 |

Test passes if there are green lines between boxes.

28 |
29 |
Black Panther
30 |
Wonder Woman
31 |
Storm
32 |
Flash
33 |
34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-006.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - wrap horizontal 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 40 | 41 | 42 |

Test passes if there are green lines between boxes.

43 |
44 |
Black Panther
45 |
Wonder Woman
46 |
Storm
47 |
Flash
48 |
49 | 50 |
51 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-007.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - wrap vertical 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 | 30 |

Test passes if there are green lines between boxes.

31 |
32 |
Black Panther
33 |
Wonder Woman
34 |
Storm
35 |
Flash
36 |
37 | 38 |
39 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-008.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - row and column gap 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 27 | 28 | 29 |

30 | Test passes if there are 40px horizontal green lines and 20px vertical green lines between 31 | boxes. 32 |

33 |
34 |
35 |
36 |
37 |
38 |
39 | 40 |
41 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/gap-009.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - mixed units 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 27 | 28 | 29 |

30 | Test passes if there are 50% horizontal green line and 1rem vertical green line between boxes. 31 |

32 |
33 |
34 |
35 |
36 |
37 |
38 | 39 |
40 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/image_ratio.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Image Ratio Sizing - Attribute 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
AttributeCSS
Original size (square 100x100):
no width/height set
Set height to 50, width auto, expect half sized square:
height 50 only, attribute
Set width to 50, height auto, expect half sized square:
width 50 only, attribute
Set width to 50 and height to 100 (via attributes), expect rectangular:
height 100, width 50, attribute
39 | 40 |
41 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/ink_overflow_bounding_box.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ink overflow bounding box 4 | 5 | 6 | 7 | 39 | 40 | 41 | 42 |
Hello, do you feel the funk?
43 |
Hello, do you feel the funk?
44 |
Hello, do you feel the funk?
45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_block.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline-block 4 | 5 | 6 | 7 | 8 | 30 | 31 | 32 | 33 |
The following text
is an inline-block
and should flow naturally.
34 |
35 |
Left filler text
meets an inline-block
with a line-break
right filler text.
36 |
37 |
Left filler text.
An inline-block.

A paragraph

Filler text.
Right filler text.
38 |
39 |
Left filler text.
An inline-block.
Float right
Float left
Filler text.
Right filler text.
40 |
41 |
Nesting inline-blocks: 42 |
A
B
C
43 |
D
E
F
44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_formatting_02.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline formatting 02 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | A B C D 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_formatting_03.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline formatting 03 4 | 5 | 6 | 7 | 23 | 24 | 25 | 26 | 27 |
In consecteturA metus Quisque maximus urna in congue placerat. In hac habitasse platea dictumst. Mauris a fringilla augue.
28 | 29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_formatting_04.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline formatting 04 4 | 5 | 6 | 7 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 36 | Before Inner After 37 | 38 | 39 |
40 | 41 | 42 | 43 | 44 |
Y
45 |
46 | Z 47 |
48 |
49 | 50 |
51 | 52 | 53 |
54 | Z 55 |
56 | 57 |
58 | 59 | 60 |
Y
61 | Z 62 |
63 | 64 | 65 | 66 |
67 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_formatting_05.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline formatting 05 4 | 5 | 6 | 7 | 8 | 38 | 39 | 40 | 41 |

vertical-align: baseline

42 |
43 | A BCdEF G 44 |
45 | 46 |

vertical-align: middle

47 |
48 | A BCdEF G 49 |
50 | 51 |

vertical-align: text-top

52 |
53 | A BCdEF G 54 |
55 | 56 | 57 | 58 |
59 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/inline_formatting_07.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline formatting 07 4 | 5 | 6 | 7 | 23 | 24 | 25 | 26 |
Big
27 |
28 | First line
29 | Second line ABC DEF 30 |
X
Y
31 | GHI JKL MNO PQRS TUV 32 |
33 | 34 |
35 | 36 |
Big
37 |
38 | First line
39 | Second line 40 |
X
Y
Z
41 | ABC DEF GHI JKL MNO PQRS TUV 42 |
43 | 44 |
45 | 46 |
Big
47 |
48 | First line
49 | Second line ABC DEF GHI JKL MNO PQRS TUV
X
Y
Z
50 | ABC DEF GHI JKL MNO PQRS TUV ABC DEF GHI JKL MNO PQRS TUV ABC DEF GHI JKL MNO PQRS TUV
Z
51 |
52 | 53 | 54 | 55 |
56 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/issue_143_overflow_in_absolutely_positioned_input.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Overflow in absolutely positioned input 4 | 5 | 6 | 7 | 25 | 26 | 27 | 28 | 29 |

30 |
hover here
31 | 32 |
33 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/media_query_02.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Media query: Sprite sheets 4 | 5 | 6 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/opacity.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Opacity 4 | 5 | 6 | 7 | 36 | 37 | 38 | 39 |

Reference.

40 |

This is some text.

41 |

This is some text.

42 | 43 |

Translucent.

44 |

This is some text.

45 |

This is some text.

46 | 47 |

Invisible, there should be no red text below.

48 | 49 | 50 | 51 |

Color with alpha channel.

52 |

This is some text.

53 |

This is some text.

54 | 55 |

Color with alpha channel and translucency.

56 |

This is some text.

57 |

This is some text.

58 | 59 |
60 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/overflow_nested.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nested overflow 4 | 5 | 6 | 39 | 40 | 41 | 42 |

There should should only be one scroll bar visible, inside the black border.

43 |
44 |
45 |
Wide element
46 |
47 |
48 | 49 |

There should should only be one scroll bar visible, inside the white border.

50 |
51 |
52 |
Wide element
53 |
54 |
55 | 56 |
57 |
58 | The text in this box should overflow its scroll container, thereby producing a scrollbar inside the white border. 59 |
60 |
61 | 62 |
63 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_01_normal_flow.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Normal flow 4 | 5 | 6 | 7 | 8 | 19 | 20 | 21 |

22 | Beginning of p contents. 23 | Start of outer contents. 24 | Inner contents. 25 | End of outer contents. 26 | End of p contents. 27 |

28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_02_relative_positioning.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Relative positioning 4 | 5 | 6 | 7 | 8 | 19 | 20 | 21 |

22 | Beginning of p contents. 23 | Start of outer contents. 24 | Inner contents. 25 | End of outer contents. 26 | End of p contents. 27 |

28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_03_floating_a_box.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Floating a box 4 | 5 | 6 | 7 | 8 | 19 | 20 | 21 |

22 | Beginning of p contents. 23 | Start of outer contents. 24 | Inner contents. 25 | End of outer contents. 26 | End of p contents. 27 |

28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_04_floating_a_box_sibling.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Floating a box - Sibling 4 | 5 | 6 | 7 | 8 | 19 | 20 | 21 |

22 | Beginning of p contents. 23 | Start of outer contents. 24 | Inner contents. 25 | Sibling contents. 26 | End of outer contents. 27 | End of p contents. 28 |

29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_05_floating_a_box_clear.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Floating a box - Clear 4 | 5 | 6 | 7 | 8 | 19 | 20 | 21 |

22 | Beginning of p contents. 23 | Start of outer contents. 24 | Inner contents. 25 | Sibling contents. 26 | End of outer contents. 27 | End of p contents. 28 |

29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_06_absolute_positioning.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Absolute positioning 4 | 5 | 6 | 7 | 8 | 24 | 25 | 26 |

27 | Beginning of p contents. 28 | Start of outer contents. 29 | Inner contents. 30 | End of outer contents. 31 | End of p contents. 32 |

33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_07_absolute_positioning_relative.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Absolute positioning - Relative 4 | 5 | 6 | 7 | 8 | 27 | 28 | 29 |

30 | Beginning of p contents. 31 | Start of outer contents. 32 | Inner contents. 33 | End of outer contents. 34 | End of p contents. 35 |

36 | 37 | 38 |
39 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_08_absolute_positioning_no_relative.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Absolute positioning - No relative 4 | 5 | 6 | 7 | 8 | 24 | 25 | 26 |

27 | Beginning of p contents. 28 | Start of outer contents. 29 | Inner contents. 30 | End of outer contents. 31 | End of p contents. 32 |

33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/position_09_absolute_positioning_change_bars.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSS Position: Absolute positioning - Change bars 4 | 5 | 6 | 7 | 8 | 17 | 18 | 19 |

20 | I used two red hyphens to serve as a change bar. They 21 | will "float" to the left of the line containing THIS 22 | -- 23 | word. 24 |

25 | 26 | 27 |
28 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/flex_05-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flex 05 ref 4 | 5 | 6 | 37 | 38 | 39 | 40 |

height, rows

41 |
42 |
43 |
44 |
45 |

height, columns

46 |
47 |
48 |
49 |
50 |

min-height, rows

51 |
52 |
53 |
54 |
55 |

min-height, columns

56 |
57 |
58 |
59 |
60 |

max-height, rows

61 |
62 |
63 |
64 |
65 |

max-height, columns

66 |
67 |
68 |
69 |
70 | 71 | 72 |
73 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/flex_nested-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flex nested ref 4 | 5 | 6 | 26 | 27 | 28 | 29 |
30 |
31 |
32 |
1
33 |
2
34 |
3
35 |
36 |
37 |
38 |
39 |
1
40 |
2
41 |
3
42 |
43 |
44 |
45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/flex_wrap_column_reverse-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Test Reference: flex container multiline wrapping in column-reverse direction 5 | 6 | 7 | 55 | 56 | 57 |
58 |

1-1

59 |

1-2

60 |

1-3

61 |
62 |
63 |

2-1

64 |

2-2

65 |
66 |
67 |

3-1

68 |
69 |
70 | 71 |
72 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/fractional-dimensions-02-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 |

You should see no red below, just a green square with a green border.

16 |
17 | 18 |
19 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-001-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - horizontal 5 | 7 | 8 | 25 | 26 | 27 |

Test passes if there is a green vertical line between boxes.

28 |
29 |
30 |
31 |
32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-002-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - vertical 5 | 7 | 8 | 26 | 27 | 28 |

Test passes if there is a green horizontal line between boxes.

29 |
30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-003-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - rows and columns 5 | 7 | 8 | 32 | 33 | 34 |

Test passes if there are green lines between boxes.

35 |
36 |
37 |
38 |
39 |
40 |
41 | 42 |
43 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-004-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - intrinsic horizontal 5 | 7 | 8 | 24 | 25 | 26 |

Test passes if there are green lines between boxes.

27 |
28 |
Black Panther
29 |
Wonder Woman
30 |
Storm
31 |
Flash
32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-005-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - intrinsic vertical 5 | 7 | 8 | 24 | 25 | 26 |

Test passes if there are green lines between boxes.

27 |
28 |
Black Panther
29 |
Wonder Woman
30 |
Storm
31 |
Flash
32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-006-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - wrap horizontal 5 | 7 | 8 | 40 | 41 | 42 |

Test passes if there are green lines between boxes.

43 |
44 |
Black Panther
45 |
Wonder Woman
46 |
Storm
47 |
Flash
48 |
49 | 50 |
51 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-007-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - wrap vertical 5 | 7 | 8 | 32 | 33 | 34 |

Test passes if there are green lines between boxes.

35 |
36 |
Black Panther
37 |
Wonder Woman
38 |
Storm
39 |
Flash
40 |
41 | 42 |
43 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-008-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - row and column gap 5 | 7 | 8 | 32 | 33 | 34 |

35 | Test passes if there are 40px horizontal green lines and 20px vertical green lines between boxes. 36 |

37 |
38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/reference/gap-009-ref.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS Flexbox Test: gap - mixed units 5 | 7 | 8 | 35 | 36 | 37 |

38 | Test passes if there are 50% horizontal green line and 1rem vertical green line between boxes. 39 |

40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/shrink_to_fit_01.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shrink-to-fit 4 | 5 | 6 | 7 | 35 | 36 | 37 | 38 |

The following boxes should all appear the same, with the background and border tightly packed around the words 'A BOX'.

39 |
40 | A BOX 41 |
42 |
43 |
A BOX
44 |
45 |
46 |
A BOX
47 |
48 |
49 | A BOX 50 |
51 |
52 |
A BOX
53 |
54 |
55 |
A BOX
56 |
57 | 58 |
59 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/shrink_to_fit_04.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shrink-to-fit 4 4 | 5 | 6 | 7 | 32 | 33 | 34 | 35 |

The following boxes should all appear the same, with a border wrapped all the way around the background and no red visible.

36 | 37 |
38 |
39 |
Hello
40 |
41 |
42 |
43 |
44 |
45 |
Hello
46 |
47 |
48 |
49 |
50 |
51 |
Hello
52 |
53 |
54 |
55 |
56 |
57 |
Hello
58 |
59 |
60 |
61 |
62 |
63 |
Hello
64 |
65 |
66 | 67 |
68 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/stacking_context_01.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Stacking context and paint order 4 | 5 | 6 | 7 | 23 | 24 | 25 | 26 | 27 |

In the following, 'AA' should overflow and be painted over the 'B' boxes.

28 | 29 |
30 |
A
AA
31 |
B
32 |
33 | 34 |
35 |
A
AA
36 |
B
37 |
38 | 39 |
40 | 41 |

In the following, 'B' boxes should be painted over the overflowing 'AA' text.

42 | 43 |
44 |
A
AA
45 |
B
46 |
47 | 48 |
49 |
A
AA
50 |
B
51 |
52 | 53 |
54 |
A
AA
55 |
B
56 |
57 | 58 |
59 |
A
AA
60 |
B
61 |
62 | 63 | 64 | 65 |
66 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/table_04.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Table 04 - Table height algorithm 4 | 5 | 6 | 7 | 8 | 9 | 10 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
AB1
B2
C
DEF
GH
50 | 51 | 52 |
53 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/table_05.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Table 05 4 | 5 | 6 | 7 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
ABC
DEF
GH
38 | 39 | 40 |
41 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/table_inline.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inline tables 4 | 5 | 6 | 7 | 24 | 25 | 26 | 27 |

28 | Inline tables 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
ABC
ABC
41 | can be located 42 | 43 | 44 | 45 | 46 | 47 | 48 |
ABC
49 | in-between 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
AB
AB
AB
64 | text 65 | 66 | 67 | 68 | 69 |
A
B
70 | . 71 |

72 | 73 | 74 |
75 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/text_alignment.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Text-alignment property 4 | 5 | 6 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 44 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/white_space.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | White space collapsing 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 33 | 34 | 35 |
I
36 |
I
37 | 38 |
I
39 |
40 | I 41 |
42 | 43 |
ABC ABC ABC ABC
44 |
45 | 46 |

Hello World!

47 |

Hello 48 | World!

49 | 50 |

Duck! Duck! Duck!

51 |

Duck! Duck! Duck!

52 |

Duck! Duck! Duck!

53 | 54 | 55 | -------------------------------------------------------------------------------- /Tests/Data/VisualTests/word_break.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Word-break property 4 | 5 | 6 | 7 | 34 | 35 | 36 | 37 |

Fixed-width box

38 |

word-break: normal

39 |
A very veeery veeeeeeeeeeeery long word.
40 |

word-break: break-all

41 |
A very veeery veeeeeeeeeeeery long word.
42 |

word-break: break-word

43 |
A very veeery veeeeeeeeeeeery long word.
44 |
45 |

Zero-width box

46 |

word-break: normal

47 |
€ WORD
48 |

word-break: break-all

49 |
€ WORD
50 |

word-break: break-word

51 |
€ WORD
52 | 53 |
54 | -------------------------------------------------------------------------------- /Tests/Data/view_source.rml: -------------------------------------------------------------------------------- 1 | 2 | 3 | RCSS Test description 4 | 5 | 27 | 28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /Tests/Dependencies/doctest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT TARGET doctest::doctest) 2 | # Provide path for scripts 3 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") 4 | 5 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 6 | endif() 7 | -------------------------------------------------------------------------------- /Tests/Dependencies/doctest/cmake/assemble_single_header.cmake: -------------------------------------------------------------------------------- 1 | set(doctest_include_folder "${CMAKE_CURRENT_LIST_DIR}/../../doctest/") 2 | 3 | file(READ ${doctest_include_folder}/parts/doctest_fwd.h fwd) 4 | file(READ ${doctest_include_folder}/parts/doctest.cpp impl) 5 | 6 | file(WRITE ${doctest_include_folder}/doctest.h "// ====================================================================== lgtm [cpp/missing-header-guard]\n") 7 | file(APPEND ${doctest_include_folder}/doctest.h "// == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! ==\n") 8 | file(APPEND ${doctest_include_folder}/doctest.h "// ======================================================================\n") 9 | file(APPEND ${doctest_include_folder}/doctest.h "${fwd}\n") 10 | file(APPEND ${doctest_include_folder}/doctest.h "#ifndef DOCTEST_SINGLE_HEADER\n") 11 | file(APPEND ${doctest_include_folder}/doctest.h "#define DOCTEST_SINGLE_HEADER\n") 12 | file(APPEND ${doctest_include_folder}/doctest.h "#endif // DOCTEST_SINGLE_HEADER\n") 13 | file(APPEND ${doctest_include_folder}/doctest.h "\n${impl}") 14 | -------------------------------------------------------------------------------- /Tests/Dependencies/trompeloeil/doctest/trompeloeil.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Trompeloeil C++ mocking framework 3 | * 4 | * Copyright Björn Fahller 2014-2022 5 | * 6 | * Use, modification and distribution is subject to the 7 | * Boost Software License, Version 1.0. (See accompanying 8 | * file LICENSE_1_0.txt or copy at 9 | * http://www.boost.org/LICENSE_1_0.txt) 10 | * 11 | * Project home: https://github.com/rollbear/trompeloeil 12 | */ 13 | 14 | 15 | #ifndef TROMPELOEIL_DOCTEST_HPP_ 16 | #define TROMPELOEIL_DOCTEST_HPP_ 17 | 18 | #ifndef DOCTEST_VERSION_MAJOR 19 | #error " must be included before " 20 | #endif 21 | 22 | #include "../trompeloeil.hpp" 23 | 24 | namespace trompeloeil 25 | { 26 | template <> 27 | inline void reporter::send( 28 | severity s, 29 | const char* file, 30 | unsigned long line, 31 | const char* msg) 32 | { 33 | doctest::String msgstr(msg); 34 | auto f = line ? file : "[file/line unavailable]"; 35 | if (s == severity::fatal) 36 | { 37 | DOCTEST_ADD_FAIL_AT(f, line, msgstr); 38 | } 39 | else 40 | { 41 | DOCTEST_ADD_FAIL_CHECK_AT(f, line, msgstr); 42 | } 43 | } 44 | 45 | template <> 46 | inline void reporter::sendOk( 47 | const char* trompeloeil_mock_calls_done_correctly) 48 | { 49 | #ifdef DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING 50 | DOCTEST_REQUIRE_UNARY(trompeloeil_mock_calls_done_correctly); 51 | #else 52 | DOCTEST_REQUIRE_NE(doctest::String(trompeloeil_mock_calls_done_correctly), ""); 53 | #endif 54 | } 55 | } 56 | 57 | 58 | #endif //TROMPELOEIL_DOCTEST_HPP_ 59 | -------------------------------------------------------------------------------- /Tests/Dependencies/trompeloeil/trompeloeil.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Trompeloeil C++ mocking framework 3 | * 4 | * Copyright (C) Björn Fahller 2014-2021 5 | * 6 | * Use, modification and distribution is subject to the 7 | * Boost Software License, Version 1.0. (See accompanying 8 | * file LICENSE_1_0.txt or copy atl 9 | * http://www.boost.org/LICENSE_1_0.txt) 10 | * 11 | * Project home: https://github.com/rollbear/trompeloeil 12 | */ 13 | 14 | #ifndef TROMPELOEIL_HPP_ 15 | #define TROMPELOEIL_HPP_ 16 | 17 | 18 | // trompe l'oeil noun (Concise Encyclopedia) 19 | // Style of representation in which a painted object is intended 20 | // to deceive the viewer into believing it is the object itself... 21 | 22 | // project home: https://github.com/rollbear/trompeloeil 23 | 24 | 25 | // Deficiencies and missing features 26 | // * Mocking function templates is not supported 27 | // * If a macro kills a kitten, this threatens extinction of all felines! 28 | 29 | #include "trompeloeil/mock.hpp" 30 | #include "trompeloeil/lifetime.hpp" 31 | #include "trompeloeil/matcher.hpp" 32 | #include "trompeloeil/matcher/any.hpp" 33 | #include "trompeloeil/matcher/compare.hpp" 34 | #include "trompeloeil/matcher/deref.hpp" 35 | #include "trompeloeil/matcher/not.hpp" 36 | #include "trompeloeil/matcher/re.hpp" 37 | #include "trompeloeil/sequence.hpp" 38 | #include "trompeloeil/stream_tracer.hpp" 39 | #ifdef __cpp_impl_coroutine 40 | #include "trompeloeil/coro.hpp" 41 | #endif 42 | #endif // include guard 43 | -------------------------------------------------------------------------------- /Tests/Dependencies/trompeloeil/trompeloeil/stream_tracer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Trompeloeil C++ mocking framework 3 | * 4 | * Copyright (C) Björn Fahller 5 | * 6 | * Use, modification and distribution is subject to the 7 | * Boost Software License, Version 1.0. (See accompanying 8 | * file LICENSE_1_0.txt or copy atl 9 | * http://www.boost.org/LICENSE_1_0.txt) 10 | * 11 | * Project home: https://github.com/rollbear/trompeloeil 12 | */ 13 | 14 | #ifndef TROMPELOEIL_STREAM_TRACER_HPP 15 | #define TROMPELOEIL_STREAM_TRACER_HPP 16 | 17 | #ifndef TROMPELOEIL_MOCK_HPP_ 18 | #include "mock.hpp" 19 | #endif 20 | 21 | namespace trompeloeil { 22 | 23 | class stream_tracer : public tracer 24 | { 25 | public: 26 | explicit 27 | stream_tracer( 28 | std::ostream& stream_) 29 | : stream(stream_) {} 30 | void 31 | trace( 32 | char const *file, 33 | unsigned long line, 34 | std::string const &call) 35 | override 36 | { 37 | stream << location{file, line} << '\n' << call << '\n'; 38 | } 39 | private: 40 | std::ostream& stream; 41 | }; 42 | 43 | } 44 | #endif //TROMPELOEIL_STREAM_TRACER_HPP 45 | -------------------------------------------------------------------------------- /Tests/Output/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | *.log 3 | -------------------------------------------------------------------------------- /Tests/Source/Benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME "rmlui_benchmarks") 2 | 3 | add_executable(${TARGET_NAME} 4 | DataExpression.cpp 5 | Element.cpp 6 | BackgroundBorder.cpp 7 | ElementDocument.cpp 8 | Table.cpp 9 | Selectors.cpp 10 | main.cpp 11 | DataBinding.cpp 12 | Flexbox.cpp 13 | FontEffect.cpp 14 | WidgetTextInput.cpp 15 | ) 16 | 17 | set_common_target_options(${TARGET_NAME}) 18 | 19 | target_link_libraries(${TARGET_NAME} PRIVATE 20 | rmlui_tests_common 21 | rmlui_core 22 | doctest::doctest 23 | nanobench::nanobench 24 | ) 25 | 26 | if(NOT EMSCRIPTEN) 27 | doctest_discover_tests(${TARGET_NAME}) 28 | endif() 29 | 30 | if(EMSCRIPTEN) 31 | # The benchmarks additionally use data from the benchmark sample. 32 | target_link_libraries(${TARGET_NAME} PRIVATE "--preload-file \"${PROJECT_SOURCE_DIR}/Samples/basic/benchmark/data/@/Samples/basic/benchmark/data/\"") 33 | endif() 34 | 35 | if(MSVC) 36 | # Set UTF-8 on MSVC to properly encode non-ascii characters. 37 | target_compile_options(${TARGET_NAME} PRIVATE /utf-8) 38 | endif() 39 | -------------------------------------------------------------------------------- /Tests/Source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory("Common") 2 | 3 | add_subdirectory("Benchmarks") 4 | add_subdirectory("UnitTests") 5 | add_subdirectory("VisualTests") 6 | -------------------------------------------------------------------------------- /Tests/Source/Common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(rmlui_tests_common STATIC 2 | Mocks.h 3 | TestsInterface.cpp 4 | TestsInterface.h 5 | TestsShell.cpp 6 | TestsShell.h 7 | TypesToString.h 8 | ) 9 | 10 | set_common_target_options(rmlui_tests_common) 11 | 12 | target_include_directories(rmlui_tests_common INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") 13 | 14 | target_link_libraries(rmlui_tests_common PUBLIC 15 | rmlui_core 16 | rmlui_shell 17 | doctest::doctest 18 | trompeloeil::trompeloeil 19 | ) 20 | -------------------------------------------------------------------------------- /Tests/Source/Common/Mocks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class MockEventListener : public trompeloeil::mock_interface { 10 | public: 11 | IMPLEMENT_MOCK1(OnAttach); 12 | IMPLEMENT_MOCK1(OnDetach); 13 | IMPLEMENT_MOCK1(ProcessEvent); 14 | }; 15 | 16 | class MockEventListenerInstancer : public trompeloeil::mock_interface { 17 | public: 18 | IMPLEMENT_MOCK2(InstanceEventListener); 19 | }; 20 | 21 | class MockRenderInterface : public trompeloeil::mock_interface { 22 | public: 23 | IMPLEMENT_MOCK2(CompileGeometry); 24 | IMPLEMENT_MOCK3(RenderGeometry); 25 | IMPLEMENT_MOCK1(ReleaseGeometry); 26 | 27 | IMPLEMENT_MOCK2(LoadTexture); 28 | IMPLEMENT_MOCK2(GenerateTexture); 29 | IMPLEMENT_MOCK1(ReleaseTexture); 30 | 31 | IMPLEMENT_MOCK1(EnableScissorRegion); 32 | IMPLEMENT_MOCK1(SetScissorRegion); 33 | 34 | IMPLEMENT_MOCK2(CompileShader); 35 | IMPLEMENT_MOCK4(RenderShader); 36 | IMPLEMENT_MOCK1(ReleaseShader); 37 | }; 38 | -------------------------------------------------------------------------------- /Tests/Source/UnitTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME "rmlui_unit_tests") 2 | 3 | add_executable(${TARGET_NAME} 4 | Animation.cpp 5 | Core.cpp 6 | DataBinding.cpp 7 | DataExpression.cpp 8 | DataModel.cpp 9 | Debugger.cpp 10 | Decorator.cpp 11 | Element.cpp 12 | ElementBackgroundBorder.cpp 13 | ElementDocument.cpp 14 | ElementHandle.cpp 15 | ElementFormControlSelect.cpp 16 | ElementImage.cpp 17 | ElementStyle.cpp 18 | EventListener.cpp 19 | Filter.cpp 20 | FlexFormatting.cpp 21 | Layout.cpp 22 | Localization.cpp 23 | main.cpp 24 | Math.cpp 25 | MediaQuery.cpp 26 | Properties.cpp 27 | PropertySpecification.cpp 28 | Selectors.cpp 29 | Specificity_Basic.cpp 30 | Specificity_MediaQuery.cpp 31 | StableVector.cpp 32 | StringUtilities.cpp 33 | StyleSheetParser.cpp 34 | Template.cpp 35 | URL.cpp 36 | Variant.cpp 37 | XMLParser.cpp 38 | ) 39 | 40 | set_common_target_options(${TARGET_NAME}) 41 | 42 | target_link_libraries(${TARGET_NAME} PRIVATE 43 | rmlui_tests_common 44 | rmlui_core 45 | doctest::doctest 46 | trompeloeil::trompeloeil 47 | ) 48 | 49 | if(NOT EMSCRIPTEN) 50 | doctest_discover_tests(${TARGET_NAME}) 51 | endif() 52 | -------------------------------------------------------------------------------- /Tests/Source/UnitTests/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 30 | #include 31 | 32 | // Include common tests source 33 | #include "../Common/TestsInterface.cpp" 34 | #include "../Common/TestsShell.cpp" 35 | -------------------------------------------------------------------------------- /Tests/Source/VisualTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TARGET_NAME "rmlui_visual_tests") 2 | 3 | add_executable(${TARGET_NAME} WIN32 4 | XmlNodeHandlers.h 5 | XmlNodeHandlers.cpp 6 | TestViewer.h 7 | TestViewer.cpp 8 | TestSuite.h 9 | TestConfig.h 10 | TestConfig.cpp 11 | TestNavigator.h 12 | main.cpp 13 | CaptureScreen.h 14 | TestNavigator.cpp 15 | CaptureScreen.cpp 16 | ) 17 | 18 | set_common_target_options(${TARGET_NAME}) 19 | 20 | target_link_libraries(${TARGET_NAME} PRIVATE 21 | rmlui_tests_common 22 | rmlui_core 23 | rmlui_shell 24 | lodepng::lodepng 25 | ) 26 | -------------------------------------------------------------------------------- /Tests/Source/VisualTests/TestConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_TESTS_VISUALTESTS_TESTCONFIG_H 30 | #define RMLUI_TESTS_VISUALTESTS_TESTCONFIG_H 31 | 32 | #include 33 | 34 | Rml::String GetCompareInputDirectory(); 35 | Rml::String GetCaptureOutputDirectory(); 36 | Rml::StringList GetTestInputDirectories(); 37 | 38 | #endif 39 | --------------------------------------------------------------------------------