Skip to content

Commit

Permalink
The big restructuring for RmlUi 4.0. This involves breaking changes b…
Browse files Browse the repository at this point in the history
…ut should benefit everyone using the library in the future.

- The old `Controls` plugin is now gone. But fear not! It has been merged into the `Core` project .
- The old `Rml::Core` and `Rml::Controls` namespaces are now located directly in the `Rml` namespace.
- The old `Controls` public header files have been moved to `<RmlUi/Core/Elements/...>`.
- The old `Controls` source files and private header files have been moved to `Source/Core/Elements/...`.
- The `Debugger` plugin remains as before at the same location and same namespace `Rml::Debugger`.

The Lua plugins have been changed to reflect the above changes.

- The old Lua plugins `RmlCoreLua` and `RmlControlsLua` have been merged into a single library `RmlLua`.
- The public header files are now located at `<RmlUi/Lua/...>`.
- The Lua plugin is now initialized by calling `Rml::Lua::Initialise()` located in `<RmlUi/Lua/Lua.h>`.
- Separated the Lua interpreter functions from initialization and the Lua plugin.
- Renamed macros in the Lua plugin, they now start with `RMLUI_`.

Related changes.

- Refactored slider widgets to avoid duplicate names in Core and Controls.
- Renamed header guard macros.
  • Loading branch information
mikke89 committed Jul 3, 2020
1 parent c09981b commit e9844e3
Show file tree
Hide file tree
Showing 680 changed files with 6,420 additions and 8,376 deletions.
367 changes: 168 additions & 199 deletions CMake/FileList.cmake

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions CMake/gen_filelists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,27 @@ printfontdefaultfiles() {

printluafiles() {
# Print headers
echo ${hdr/lib/Lua${1}} >>$file
find $srcpath/$1/$luapath -iname "*.h" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file
echo ${hdr/lib/Lua} >>$file
find $srcpath/$luapath$1 -iname "*.h" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file
echo -e ')\n' >>$file
# Print public headers
echo ${pubhdr/lib/Lua${1}} >>$file
find $hdrpath/$1/$luapath -iname "*.h" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file 2>/dev/null
echo ${pubhdr/lib/Lua} >>$file
find $hdrpath/$luapath$1 -iname "*.h" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file 2>/dev/null
echo -e ')\n' >>$file
# Print source files
echo ${src/lib/Lua${1}} >>$file
find $srcpath/$1/$luapath -iname "*.cpp" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file
echo ${src/lib/Lua} >>$file
find $srcpath/$luapath$1 -iname "*.cpp" -exec echo ' '$srcdir/{} \; 2>/dev/null | sort -f >>$file
echo -e ')\n' >>$file
}

pushd $basedir
echo -e "# This file was auto-generated with gen_filelists.sh\n" >$file
for lib in "Core" "Controls" "Debugger"; do
for lib in "Core" "Debugger"; do
printfiles $lib
done

printfontdefaultfiles "Core"

for lib in "Core" "Controls"; do
printluafiles $lib
done
popd
printluafiles

popd
67 changes: 25 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ endif()

#Lua
if(BUILD_LUA_BINDINGS)
find_package(Lua)
find_package(Lua REQUIRED)
if(LUA_FOUND)
include_directories(${LUA_INCLUDE_DIR})
list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES})
Expand All @@ -262,7 +262,7 @@ if(NOT BUILD_FRAMEWORK)
# Build libraries ==================
#===================================

set(LIBRARIES Core Controls Debugger)
set(LIBRARIES Core Debugger)

foreach(library ${LIBRARIES})
set(NAME Rml${library})
Expand Down Expand Up @@ -298,7 +298,6 @@ target_compile_definitions(RmlCore PRIVATE RMLUI_VERSION="${RMLUI_VERSION_SHORT}

if (PRECOMPILED_HEADERS_ENABLED)
target_precompile_headers(RmlCore PRIVATE ${PROJECT_SOURCE_DIR}/Source/Core/precompiled.h)
target_precompile_headers(RmlControls PRIVATE ${PROJECT_SOURCE_DIR}/Source/Controls/precompiled.h)
endif()


Expand All @@ -311,7 +310,6 @@ else(NOT BUILD_FRAMEWORK)

set(MASTER_PUB_HDR_FILES
${MASTER_Core_PUB_HDR_FILES}
${MASTER_Controls_PUB_HDR_FILES}
${MASTER_Debugger_PUB_HDR_FILES}
)

Expand All @@ -320,10 +318,6 @@ else(NOT BUILD_FRAMEWORK)
${MASTER_Core_PUB_HDR_FILES}
${Core_PUB_HDR_FILES}
${Core_SRC_FILES}
${Controls_HDR_FILES}
${MASTER_Controls_PUB_HDR_FILES}
${Controls_PUB_HDR_FILES}
${Controls_SRC_FILES}
${Debugger_HDR_FILES}
${MASTER_Debugger_PUB_HDR_FILES}
${Debugger_PUB_HDR_FILES}
Expand All @@ -341,9 +335,6 @@ else(NOT BUILD_FRAMEWORK)
set_property(SOURCE ${Core_PUB_HDR_FILES}
PROPERTY MACOSX_PACKAGE_LOCATION Headers/Core
)
set_property(SOURCE ${Controls_PUB_HDR_FILES}
PROPERTY MACOSX_PACKAGE_LOCATION Headers/Controls
)
set_property(SOURCE ${Debugger_PUB_HDR_FILES}
PROPERTY MACOSX_PACKAGE_LOCATION Headers/Debugger
)
Expand All @@ -370,30 +361,26 @@ endif(NOT BUILD_FRAMEWORK)

# Build Lua bindings
if(BUILD_LUA_BINDINGS)
set(LIBRARIES Core Controls)

foreach(library ${LIBRARIES})
set(NAME Rml${library}Lua)
set(NAME RmlLua)

add_library(${NAME} ${Lua${library}_SRC_FILES}
${Lua${library}_HDR_FILES}
${Lua${library}_PUB_HDR_FILES}
)
add_library(${NAME} ${Lua_SRC_FILES}
${Lua_HDR_FILES}
${Lua_PUB_HDR_FILES}
)

set_target_properties(${NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
set_target_properties(${NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)

install(TARGETS ${NAME}
EXPORT RmlUiTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
endforeach(library)
install(TARGETS ${NAME}
EXPORT RmlUiTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
endif()


Expand Down Expand Up @@ -423,19 +410,16 @@ endif()

if(NOT BUILD_FRAMEWORK)
target_link_libraries(RmlCore ${CORE_LINK_LIBS})
target_link_libraries(RmlControls RmlCore)
target_link_libraries(RmlDebugger RmlCore)
else(NOT BUILD_FRAMEWORK)
target_link_libraries(RmlUi ${CORE_LINK_LIBS})
endif(NOT BUILD_FRAMEWORK)

if(BUILD_LUA_BINDINGS)
if(NOT BUILD_FRAMEWORK)
target_link_libraries(RmlCoreLua RmlCore ${LUA_BINDINGS_LINK_LIBS})
target_link_libraries(RmlControlsLua RmlControls RmlCoreLua ${LUA_BINDINGS_LINK_LIBS})
target_link_libraries(RmlLua RmlCore ${LUA_BINDINGS_LINK_LIBS})
else(NOT BUILD_FRAMEWORK)
target_link_libraries(RmlCoreLua RmlUi ${LUA_BINDINGS_LINK_LIBS})
target_link_libraries(RmlControlsLua RmlUi RmlCoreLua ${LUA_BINDINGS_LINK_LIBS})
target_link_libraries(RmlLua RmlUi ${LUA_BINDINGS_LINK_LIBS})
endif(NOT BUILD_FRAMEWORK)
endif()

Expand Down Expand Up @@ -473,14 +457,13 @@ if(BUILD_SAMPLES)

if(NOT BUILD_FRAMEWORK)
set(sample_LIBRARIES
shell
RmlCore
RmlControls
shell
RmlCore
RmlDebugger
)
else(NOT BUILD_FRAMEWORK)
set(sample_LIBRARIES
shell
shell
RmlUi
)
endif(NOT BUILD_FRAMEWORK)
Expand Down Expand Up @@ -618,7 +601,7 @@ endif(NOT BUILD_FRAMEWORK)
BUNDLE DESTINATION ${SAMPLES_DIR})

if(BUILD_LUA_BINDINGS)
bl_sample(luainvaders RmlCoreLua RmlControlsLua ${sample_LIBRARIES} ${LUA_BINDINGS_LINK_LIBS})
bl_sample(luainvaders RmlLua ${sample_LIBRARIES} ${LUA_BINDINGS_LINK_LIBS})
install(DIRECTORY DESTINATION ${SAMPLES_DIR}/luainvaders)
install(TARGETS luainvaders
RUNTIME DESTINATION ${SAMPLES_DIR}/luainvaders
Expand Down
49 changes: 0 additions & 49 deletions Include/RmlUi/Controls.h

This file was deleted.

43 changes: 0 additions & 43 deletions Include/RmlUi/Controls/Controls.h

This file was deleted.

48 changes: 0 additions & 48 deletions Include/RmlUi/Controls/Header.h

This file was deleted.

19 changes: 17 additions & 2 deletions Include/RmlUi/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
*/

#ifndef RMLUICORE_H
#define RMLUICORE_H
#ifndef RMLUI_CORE_H
#define RMLUI_CORE_H

#include "Core/Core.h"

Expand Down Expand Up @@ -87,4 +87,19 @@
#include "Core/XMLNodeHandler.h"
#include "Core/XMLParser.h"

#include "Core/Elements/DataFormatter.h"
#include "Core/Elements/ElementDataGrid.h"
#include "Core/Elements/ElementDataGridCell.h"
#include "Core/Elements/ElementDataGridExpandButton.h"
#include "Core/Elements/ElementDataGridRow.h"
#include "Core/Elements/ElementForm.h"
#include "Core/Elements/ElementFormControl.h"
#include "Core/Elements/ElementFormControlDataSelect.h"
#include "Core/Elements/ElementFormControlInput.h"
#include "Core/Elements/ElementFormControlSelect.h"
#include "Core/Elements/ElementFormControlTextArea.h"
#include "Core/Elements/ElementProgressBar.h"
#include "Core/Elements/ElementTabSet.h"
#include "Core/Elements/SelectOption.h"

#endif
11 changes: 4 additions & 7 deletions Include/RmlUi/Core/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
*
*/

#ifndef RMLUICOREANIMATION_H
#define RMLUICOREANIMATION_H
#ifndef RMLUI_CORE_ANIMATION_H
#define RMLUI_CORE_ANIMATION_H

#include "Types.h"
#include "Tween.h"
#include "ID.h"

namespace Rml {
namespace Core {

/* Data parsed from the 'animation' property. */
struct Animation {
Expand Down Expand Up @@ -72,7 +71,5 @@ inline bool operator!=(const Transition& a, const Transition& b) { return !(a ==
inline bool operator==(const TransitionList& a, const TransitionList& b) { return a.none == b.none && a.all == b.all && a.transitions == b.transitions; }
inline bool operator!=(const TransitionList& a, const TransitionList& b) { return !(a == b); }

}
}

#endif
} // namespace Rml
#endif
Loading

0 comments on commit e9844e3

Please sign in to comment.