libRocket - The HTML/CSS User Interface library

Overview

libRocket - The HTML/CSS User Interface Library

http://librocket.com (!!! malicious domain !!!, last checked 23/feb/2020)

libRocket is the C++ user interface package based on the HTML and CSS standards. It is designed as a complete solution for any project's interface needs.

libRocket uses the time-tested open standards XHTML1.0 and CSS2.0 (while borrowing features from HTML5 and CSS3), and extends them with features suited towards real-time applications. Because of this, you don't have to learn a whole new proprietary technology like other libraries in this space.

Features

  • Cross platform architecture: Windows, macOS, Linux, iOS, etc.
  • Dynamic layout system.
  • Efficient application-wide styling, with a custom-built templating engine.
  • Fully featured control set: buttons, sliders, drop-downs, etc.
  • Runtime visual debugging suite.
  • Easily integrated and extensible with Python or Lua scripting.

Extensible

  • Abstracted interfaces for plugging in to any game engine.
  • Decorator engine allowing custom application-specific effects that can be applied to any element.
  • Generic event system that binds seamlessly into existing projects.

License (MIT)

Copyright (c) 2008-2014 CodePoint Ltd, Shift Technology Ltd, and contributors

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.

Comments
  • (pre)release tags

    (pre)release tags

    Can we get a current release tag? Creating packages for in-the-middle commits is not good. If you don't feel like creating a real release, just make it a prerelease. The last one is 2 years old.

    opened by hasufell 55
  • Lua binding

    Lua binding

    Forum thread: http://forums.librocket.com/viewtopic.php?f=2&t=874

    The only thing that I changed in the base library is exposing Rocket::Core::ElementStyle as dllimport/export. That isn't completely necessary, but it is convenient; I can undo that if you want.

    What I don't have is CMake scripts.

    opened by Gambini 26
  • Do not precalculate kerning

    Do not precalculate kerning

    Precalculating kerning for all character pairs consumed a lot of RAM (O(N*N) complexity). For CJK fonts that contain tens thousands of glyphs it was a highly unpractical approach, resulting libRocket consuming >1.5GB of RAM. Instead, encapsulate FT_Get_Kerning call in FontFaceHandle::GetKerning and let FreeType handle kerning on the fly. In my measurements the performance difference is negligible, especially in conjunction with compiled geometry.

    opened by viciious 22
  • Decorators not working for dynamically created element

    Decorators not working for dynamically created element

    Hey,

    I'm trying to add decorator at runtime for new dynamic elements. And seems that decorators definitions in style or via properties is just ignored.

    Element* newItem = document->CreateElement("div"); newItem->SetProperty("background-image", "invader.png"); newItem->SetProperty("background-decorator","image");

    opened by umek 17
  • Bring back PPI-based units

    Bring back PPI-based units

    The main developer of the game engine I'm working on accidentally removed PPI-based RCSS unit support. I need them in the engine now, so I'm adding them back here.

    enhancement 
    opened by Triang3l 15
  • Create a font provider interface, create a RocketTrueType lib and implement a new font provider

    Create a font provider interface, create a RocketTrueType lib and implement a new font provider

    This request contains the ability to have different font providers. Rocket core does not depend from truetype anymore and a RocketTrueTypeLib has been created. A BMFont provider ( font create with AngelCode's BMFont tool ) is also provided.

    This implementation does not support effects for the moment.

    opened by crazyjul 15
  • Lua binding failed with lua 5.2.3

    Lua binding failed with lua 5.2.3

    I try to run the luainvader sample (VS2012, Win7). I can compile everything with lua 5.2.3, but I cannot run the sample. There is an error in line 101:

    Rocket::Controls::Lua::RegisterTypes(Rocket::Core::Lua::Interpreter::GetLuaState());
    

    All these functions failed:

    LuaType<ElementForm>::Register(L);
    LuaType<ElementFormControl>::Register(L);
    //Inherits from ElementFormControl
    LuaType<ElementFormControlSelect>::Register(L);
    LuaType<ElementFormControlDataSelect>::Register(L);
    LuaType<ElementFormControlInput>::Register(L);
    LuaType<ElementFormControlTextArea>::Register(L);
    LuaType<DataFormatter>::Register(L);
    LuaType<DataSource>::Register(L);
    LuaType<ElementDataGrid>::Register(L);
    LuaType<ElementDataGridRow>::Register(L);
    LuaType<ElementTabSet>::Register(L);
    //proxy tables
    LuaType<SelectOptionsProxy>::Register(L);
    

    Call stack:

    RocketCoreLua.dll!luaH_newkey(lua_State * L, Table * t, const lua_TValue * key) Zeile 436   C
    RocketCoreLua.dll!luaV_settable(lua_State * L, const lua_TValue * t, lua_TValue * key, lua_TValue * val) Zeile 152  C
    RocketCoreLua.dll!lua_setfield(lua_State * L, int idx, const char * k) Zeile 764    C
    > RocketCoreLua.dll!Rocket::Core::Lua::ExtraInit<Rocket::Core::Element>(lua_State * L, int metatable_index) Zeile 50    C++
    RocketControlsLua.dll!Rocket::Core::Lua::ExtraInit<Rocket::Controls::ElementForm>(lua_State * L, int metatable_index) Zeile 80  C++
    RocketControlsLua.dll!Rocket::Core::Lua::LuaType<Rocket::Controls::ElementForm>::Register(lua_State * L) Zeile 69   C++
    RocketControlsLua.dll!Rocket::Controls::Lua::RegisterTypes(lua_State * L) Zeile 63  C++
    
    not-a-bug 
    opened by OgreTransporter 11
  • Numerous performance and correctness changes to string handling. Require...

    Numerous performance and correctness changes to string handling. Require...

    ...s C++11.

    • Formatting - change design to favour fixing thread and exception safety over performance.
    • Increase performance in some situations by the provision of move constructors and move assignment functions.
    • Attempt to reduce string memory reallocations for replacement and concatenation by avoiding temporaries.
    • Clear hash value where required such as in Erase.
    • Don't clear hash value if not required for Replace.
    • Null terminate in clear as if one does Assign("X") then Clear then CString() one expects null terminated string.
    • Don't use Clear in StringBase itself to favour concatenation performance, only release memory on destruction.
    • Hopefully make tolower/touppwer simpler/faster and reduce memory reallocation potential and preserve hash more often.
    • Add exception to replace assert for out of memory condition. Both could be used if assert is debug only.
    • Some small changes to reduce the need to cast to T* so much..
    • Use T() in preference to '\0' in an attempt to get proper character type for wide char types etc..
    • c++11 required. I use Windows but did try g++ and cmake with -DCMAKE_CXX_FLAGS=-std=c++11 which worked.

    Sorry for single commit.

    opened by gmcode 10
  • Package binaries or build step documentation

    Package binaries or build step documentation

    I'm aware that 1.3.0 is tagged as a "pseudo" release, but it would be nice if the dev and runtime binaries were packaged for use with that release (or a more recent one if it's coming soon). Right now, when a project takes a dependency on libRocket, the project developers need to build libRocket from source on their respective platforms. For someone new to building libRocket, the process looks something like this on Windows 8 with Visual Studio 12:

    1. Download libRocket source (or clone using GitHub app).
    2. In the shell of your choice, find the CMakeLists.txt (it's in Build) and run cmake.
    3. Oh, looks like it has a Freetype dependency. Let's go to http://www.freetype.org/download.html and find the binaries we need.
    4. Alright, binaries unpacked and put in my Visual Studio "VC" folder.
    5. Oh, CMake still can't find it. Let's read FindFreetype.cmake and see what happened.
    6. Hm, it doesn't include VC/lib/freetype2 and VC/include/freetype2. Let's run CMake Config to set those paths, or set a FREETYPE_DIR environment variable.
    7. Alright! Now CMake works and produces libRocket.sln for VS2013. Hit "Build Solution" and away we go!
    8. ...or not. Why do I have so many build errors? What does "error LNK2026: module unsafe for SAFESEH image" mean and why does it appear 10 times in a row?
    9. According to StackOverflow (here: http://stackoverflow.com/questions/10599940/module-unsafe-for-safeseh-image-c), the Windows binary that I just downloaded for Freetype2 is out of date. Lo and behold, it's 2.4.2, while the latest version is actually 2.5.3. Guess now I need to build Freetype from source too...

    ...and so on.

    Other libraries I depend on simply require that I download lib and include files and extract them someplace that CMake can find them. By comparison, I end up spending an order of magnitude longer getting libRocket set up on my machines (OS X and Windows 8). There are no binaries, and I can't actually find much documentation on the process (in fact, the only documentation assumes that you've already got binaries: http://librocket.com/wiki/documentation/C%2B%2BManual/GettingStarted). I'm patient enough to do this for my own project, but it's hard to convince other developers to volunteer on my project if the process looks like the one above just for one of my project's dependencies.

    To demonstrate that this isn't a Windows-specific problem: Issue #90 produced a cryptic error that could have been avoided by knowing how to properly build Freetype on OS X, or by having the binaries available as a download on GitHub.

    I appreciate that packaging these binaries for a series of platforms (and, in the process, determining which platforms do and don't get binary packages) isn't easy or quick. If supplying binaries is not feasible, then a list of steps would still save a lot of time, as new developers on libRocket-dependent projects could just read those instructions instead of learning the hard way how to get the binaries they need on each of their environments.

    not-a-bug 
    opened by noam-c 9
  • CSS2 Specification satisfaction (in some degree)

    CSS2 Specification satisfaction (in some degree)

    I encountered a problem with display: block and position: absolute and figured out that libRocket doesn't handle it at all (HTML + CSS code in browser shows one result and analogous code in RML + RCSS shows completely different one). So I tried to fix it (reading CSS2 Specification section 10.3.7). Hope these patches will be useful.

    bug-fix 
    opened by ghost 8
  • Rocket::Controls Python bindings not importing on OS X

    Rocket::Controls Python bindings not importing on OS X

    I've managed to get the Rocket Python bindings to compile on OS X but now _rocketcontrols.so will not import.

    The modules are imported like so:

    boost::python::import("_rocketcore");
    boost::python::import("_rocketcontrols");
    

    Only if the second import is present does the code throw an exception with the message RuntimeError: extension class wrapper for base class Rocket::Core::Element has not been created yet

    The same thing happens in a Python interpreter:

    $ python
    Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
    [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import _rocketcore
    >>> import _rocketcontrols
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    RuntimeError: extension class wrapper for base class Rocket::Core::Element has not been created yet
    

    Does anyone have any idea about how I can debug this?

    opened by afinetapestry 8
  • Unable to build on MSYS2 (Deprecated CMAKE '-f' argument)

    Unable to build on MSYS2 (Deprecated CMAKE '-f' argument)

    From an MSYS2 shell:

    [email protected] MINGW64 ~/libRocket/Build 
    $ cmake -G "MSYS Makefiles" -D CMAKE_MAKE_PROGRAM="/usr/bin/cmake.exe" -D FREETYPE_INCLUDE_DIRS="..\Dependencies\freetype\include;..\Dependencies\freetype\include\freetype2" -D FREETYPE_LIBRARY="..\Dependencies\freetype\lib\libfreetype.dll.a" .
    

    Error:

    CMake Error at C:/Users/robotogre/dev/msys64/mingw64/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
      The C compiler
    
        C:/Users/robotogre/dev/msys64/mingw64/bin/cc.exe
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: C:/Users/robotogre/dev/msys64/home/tomsh/libRocket/Build/CMakeFiles/CMakeTmp
    
        Run Build Command(s):C:/Users/robotogre/dev/msys64/usr/bin/cmake.exe -f Makefile cmTC_95166/fast && CMake Warning:
          Ignoring extra path from command line:
    
           
           cmTC_95166/fast
    
    
        CMake Error: Unknown argument -f
        CMake Error: Run 'cmake --help' for all supported options.
    
    
    
    
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:52 (project)
    

    The issue appears to be that the cmake '-f' argument has been deprecated:

    remove [-f] <file>...
                Deprecated since version 3.17.
    
                Remove the file(s). The planned behaviour was that  if  any  of  the  listed  files
                already  do  not exist, the command returns a non-zero exit code, but no message is
                logged. The -f option changes the  behavior  to  return  a  zero  exit  code  (i.e.
                success)  in  such situations instead.  remove does not follow symlinks. That means
                it remove only symlinks and not files it point to.
    
                The implementation was buggy and always returned 0.  It  cannot  be  fixed  without
                breaking backwards compatibility. Use rm instead.
    
    opened by robotogre 0
  • Irrlicht Based WebBrowser

    Irrlicht Based WebBrowser

    https://github.com/netpipe/RocketShip

    may start my own fork of this to fix the scrollbar issue and hopefully start development back up again. what a useful API!

    opened by netpipe 1
  • Windows VS2019 Build for loaddocument sample fails

    Windows VS2019 Build for loaddocument sample fails

    The error says missing DoAllocConsole(); at line 70 in main.cpp Also, there is a semicolon missing at line 122 in the file libRocket\Samples\shell\src\win32\ShellRenderInterfaceExtensionsOpenGL_Win32.cpp

    opened by BhayanakMoth 0
  • Font-charset WORKAROUND

    Font-charset WORKAROUND

    I have tried modifying the font support to just create textures as required. They shouldn't all be pre-created.

    You save memory this way and only create what is required.

    There should be no limitations and I wish to use any UCS2 character...

    Is anyone else working on removing the font-charset workaround?

    So far I managed to make it build textures as required but it has caused weird issues such as the text size not being applied or the styles.

    Please do not close this saying its not a workaround as any Unicode character should work without specifying a list of required characters...

    Might need a separate post but for a feature emoji should be on the list I reckon!

    opened by jack9267 0
Ultra-lightweight web browser based on Qt Ultralight webview, powered by Ultralight HTML renderer

Qt Ultralight Browser This is an ultra-lightweight web browser powered by the Ultralight web engine embedded in Qt 5 app as a custom webview widget -

niu tech 43 Jan 7, 2023
Wrapper library for the BSD sockets API with a nicer C99 interface

A wrapper library for the BSD sockets API. Why? This library trades the series of getaddrinfo, socket, connect, bind, listen, etc. functions and their

Scott Vokes 136 Dec 10, 2022
Header-only C++14 library for getting network addresses associated with network interface without name lookups on Windows, macOS, Linux, and FreeBSD

NetIF Get addresses associated with network interfaces on a system without using name lookups. Header-only, requires C++14. Usage Add the header file

GMLC-TDC 9 Oct 17, 2022
Netif - Header-only C++14 library for getting network addresses associated with network interface without name lookups on Windows, macOS, Linux, and FreeBSD

NetIF Get addresses associated with network interfaces on a system without using name lookups. Header-only, requires C++14. Usage Add the header file

GMLC-TDC 9 Oct 17, 2022
mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems

README mTCP is a highly scalable user-level TCP stack for multicore systems. mTCP source code is distributed under the Modified BSD License. For more

null 1.8k Dec 27, 2022
Simu5G - 5G NR and LTE/LTE-A user-plane simulation model for OMNeT++ & INET

5G NR and LTE/LTE-A user-plane simulation model, compatible with the INET Framework

Università di Pisa 87 Dec 19, 2022
Login and send instagram direct message to any user ;)

DM-THIS-USER Very simple instagram tool,The idea is not in the tool, but in how to deal with the C language, especially with the openssl library and c

0xDADDY 6 May 14, 2022
SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications

SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++, and JavaScript.

SixtyFPS 5.5k Jan 2, 2023
the LIBpcap interface to various kernel packet capture mechanism

LIBPCAP 1.x.y by The Tcpdump Group To report a security issue please send an e-mail to [email protected] To report bugs and other problems, contri

The Tcpdump Group 2.1k Dec 29, 2022
Dynamic patch `wslhost.exe` to listen port on any interface.

WSLHostPatcher Dynamic patch wslhost.exe to listen port on any interfaces. How it work The localhost port actually forward by wslhost.exe on Windows,

CzBiX 404 Dec 25, 2022
Winpcap-based network packet capture tool, support TLS (part), UDP, ICMP, TCP, ARP, DNS and other protocol analysis, interface reference wireshark.

Winpcap-based network packet capture tool, support TLS (part), UDP, ICMP, TCP, ARP, DNS and other protocol analysis, interface reference wireshark.

null 54 Dec 26, 2022
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 9k Jan 1, 2023
C Hypertext Library - A library for writing web applications in C

CHL C Hypertext Library - A library for writing web applications in C #include <chl/chl.h> int main() { chl_set_default_headers(); chl_print_header

null 271 Nov 14, 2022
The C++ Network Library Project -- cross-platform, standards compliant networking library.

C++ Network Library Modern C++ network programming libraries. Join us on Slack: http://slack.cpp-netlib.org/ Subscribe to the mailing list: https://gr

C++ Network Library 1.9k Dec 27, 2022
C++ peer to peer library, built on the top of boost

Breep What is Breep? Breep is a c++ bridged peer to peer library. What does that mean? It means that even though the network is constructed as a peer

Lucas Lazare 110 Nov 24, 2022
Cross-platform, efficient, customizable, and robust asynchronous HTTP/WebSocket server C++14 library with the right balance between performance and ease of use

What Is RESTinio? RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server. It is based on standalone version of ASIO

Stiffstream 924 Jan 6, 2023
A C library for asynchronous DNS requests

c-ares This is c-ares, an asynchronous resolver library. It is intended for applications which need to perform DNS queries without blocking, or need t

c-ares 1.5k Jan 3, 2023
A C++ header-only HTTP/HTTPS server and client library

cpp-httplib A C++11 single-file header-only cross platform HTTP/HTTPS library. It's extremely easy to setup. Just include the httplib.h file in your c

null 8.3k Dec 31, 2022
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution

CppServer Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and

Ivan Shynkarenka 958 Jan 3, 2023