removed STD archeus, moved console and ssh into linux folder. also added libdbus
This commit is contained in:
parent
119d1b2c64
commit
8fe402e04e
27 changed files with 622 additions and 145 deletions
124
CMakeLists.txt
124
CMakeLists.txt
|
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.25)
|
cmake_minimum_required(VERSION 3.25)
|
||||||
|
|
||||||
set(ARCHEUS_STD_VERSION 0.0.0)
|
set(ARCHEUS_VERSION 0.0.0)
|
||||||
project(archeus_std LANGUAGES C VERSION ${ARCHEUS_STD_VERSION} DESCRIPTION "libarcheus_std standard archeus c library")
|
project(archeus LANGUAGES C VERSION ${ARCHEUS_VERSION} DESCRIPTION "libarcheus c library")
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ endfunction()
|
||||||
|
|
||||||
#TODO: Might want to remove this
|
#TODO: Might want to remove this
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message("[Archeus C STD] Build Type not set, defaulting to Debug")
|
message("[Archeus] Build Type not set, defaulting to Debug")
|
||||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default to Debug" FORCE)
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default to Debug" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -24,39 +24,44 @@ add_compile_options(
|
||||||
)
|
)
|
||||||
|
|
||||||
# ~ OPTIONS ~ #
|
# ~ OPTIONS ~ #
|
||||||
option(ARCHEUS_STD_DEFAULT_CONFIG "Build with default config keys" ON)
|
option(ARCHEUS_DEFAULT_CONFIG "Build with default config keys" ON)
|
||||||
option(ARCHEUS_STD_TESTS "Build with tests" OFF)
|
option(ARCHEUS_TESTS "Build with tests" OFF)
|
||||||
|
|
||||||
set(ARCHEUS_STD_CONSOLE_BACKEND "NONE" CACHE STRING "Console Backend to build with")
|
set(ARCHEUS_WINDOW_BACKEND "NONE" CACHE STRING "Window Backend to build with")
|
||||||
set_property(CACHE ARCHEUS_STD_CONSOLE_BACKEND PROPERTY STRINGS NONE NCURSES)
|
set_property(CACHE ARCHEUS_WINDOW_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
||||||
|
|
||||||
set(ARCHEUS_STD_WINDOW_BACKEND "NONE" CACHE STRING "Window Backend to build with")
|
set(ARCHEUS_INPUT_BACKEND "NONE" CACHE STRING "Input Backend to build with, most likely should match Window Backend")
|
||||||
set_property(CACHE ARCHEUS_STD_WINDOW_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
set_property(CACHE ARCHEUS_INPUT_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
||||||
|
|
||||||
set(ARCHEUS_STD_INPUT_BACKEND "NONE" CACHE STRING "Input Backend to build with, most likely should match Window Backend")
|
set(ARCHEUS_GRAPHICS_BACKEND "NONE" CACHE STRING "Graphics Backend to build with")
|
||||||
set_property(CACHE ARCHEUS_STD_INPUT_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
set_property(CACHE ARCHEUS_GRAPHICS_BACKEND PROPERTY STRINGS NONE SDL2 OPENGL)
|
||||||
|
|
||||||
set(ARCHEUS_STD_GRAPHICS_BACKEND "NONE" CACHE STRING "Graphics Backend to build with")
|
if(UNIX)
|
||||||
set_property(CACHE ARCHEUS_STD_GRAPHICS_BACKEND PROPERTY STRINGS NONE SDL2 OPENGL)
|
set(ARCHEUS_CONSOLE_BACKEND "NONE" CACHE STRING "Console Backend to build with")
|
||||||
|
set_property(CACHE ARCHEUS_CONSOLE_BACKEND PROPERTY STRINGS NONE NCURSES)
|
||||||
|
|
||||||
set(ARCHEUS_STD_SSH_BACKEND "NONE" CACHE STRING "SSH Backend to build with")
|
set(ARCHEUS_SSH_BACKEND "NONE" CACHE STRING "SSH Backend to build with")
|
||||||
set_property(CACHE ARCHEUS_STD_GRAPHICS_BACKEND PROPERTY STRINGS NONE LIBSSH)
|
set_property(CACHE ARCHEUS_SSH_BACKEND PROPERTY STRINGS NONE LIBSSH)
|
||||||
|
|
||||||
|
set(ARCHEUS_DBUS_BACKEND "NONE" CACHE STRING "DBus Backend to build with")
|
||||||
|
set_property(CACHE ARCHEUS_DBUS_BACKEND PROPERTY STRINGS NONE LIBDBUS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# ~ INIT VARIABLES ~ #
|
# ~ INIT VARIABLES ~ #
|
||||||
set(ARCHEUS_STD_FLAGS "")
|
set(ARCHEUS_FLAGS "")
|
||||||
set(ARCHEUS_STD_LIBRARIES "")
|
set(ARCHEUS_LIBRARIES "")
|
||||||
|
|
||||||
set(ARCHEUS_STD_INCLUDE_DIRECTORIES
|
set(ARCHEUS_INCLUDE_DIRECTORIES
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_LINK_LIBRARIES
|
set(ARCHEUS_LINK_LIBRARIES
|
||||||
PUBLIC m
|
PUBLIC m
|
||||||
)
|
)
|
||||||
|
|
||||||
# ~ ARCHEUS_SOURCES ~ #
|
# ~ ARCHEUS_SOURCES ~ #
|
||||||
set(ARCHEUS_STD_SOURCES
|
set(ARCHEUS_SOURCES
|
||||||
src/std/chemical.c
|
src/std/chemical.c
|
||||||
src/std/errno.c
|
src/std/errno.c
|
||||||
src/std/handler.c
|
src/std/handler.c
|
||||||
|
|
@ -83,46 +88,43 @@ set(ARCHEUS_STD_SOURCES
|
||||||
src/engine/state.c
|
src/engine/state.c
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g -ggdb -DARC_DEBUG ")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO: replace this with a better system
|
|
||||||
if(ARCHEUS_STD_DEFAULT_CONFIG)
|
|
||||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_DEFAULT_CONFIG ")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ~ NONE ~ #
|
# ~ NONE ~ #
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_none.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_none.cmake)
|
||||||
none_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
|
none_check_and_init_needed(ARCHEUS_FLAGS ARCHEUS_SOURCES ${ARCHEUS_WINDOW_BACKEND} ${ARCHEUS_INPUT_BACKEND} ${ARCHEUS_GRAPHICS_BACKEND})
|
||||||
|
|
||||||
# ~ NCURSES ~ #
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_ncurses.cmake)
|
|
||||||
ncurses_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_CONSOLE_BACKEND})
|
|
||||||
|
|
||||||
# ~ SDL2 ~ #
|
# ~ SDL2 ~ #
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_sdl2.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_sdl2.cmake)
|
||||||
sdl2_check_and_init_needed(ARCHEUS_STD_SOURCES ARCHEUS_STD_INCLUDE_DIRECTORIES ARCHEUS_STD_LINK_LIBRARIES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
|
sdl2_check_and_init_needed(ARCHEUS_SOURCES ARCHEUS_INCLUDE_DIRECTORIES ARCHEUS_LINK_LIBRARIES ${ARCHEUS_WINDOW_BACKEND} ${ARCHEUS_INPUT_BACKEND} ${ARCHEUS_GRAPHICS_BACKEND})
|
||||||
|
|
||||||
# ~ OPENGL ~ #
|
# ~ OPENGL ~ #
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_opengl.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_opengl.cmake)
|
||||||
opengl_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_GRAPHICS_BACKEND})
|
opengl_check_and_init_needed(ARCHEUS_FLAGS ARCHEUS_SOURCES ${ARCHEUS_GRAPHICS_BACKEND})
|
||||||
|
|
||||||
# ~ GLFW ~ #
|
# ~ GLFW ~ #
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_glfw.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_glfw.cmake)
|
||||||
glfw_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND})
|
glfw_check_and_init_needed(ARCHEUS_FLAGS ARCHEUS_SOURCES ${ARCHEUS_WINDOW_BACKEND} ${ARCHEUS_INPUT_BACKEND})
|
||||||
|
|
||||||
# ~ LIBSSH ~ #
|
if(UNIX)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_libssh.cmake)
|
# ~ NCURSES ~ #
|
||||||
libssh_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_SSH_BACKEND})
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_ncurses.cmake)
|
||||||
|
ncurses_check_and_init_needed(ARCHEUS_FLAGS ARCHEUS_SOURCES ${ARCHEUS_CONSOLE_BACKEND})
|
||||||
|
|
||||||
#if(ARCHEUS_STD_GLEW)
|
# ~ LIBSSH ~ #
|
||||||
# string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ")
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_libssh.cmake)
|
||||||
|
libssh_check_and_init_needed(ARCHEUS_FLAGS ARCHEUS_SOURCES ${ARCHEUS_SSH_BACKEND})
|
||||||
|
|
||||||
|
# ~ LIBDBUS ~ #
|
||||||
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_libdbus.cmake)
|
||||||
|
libdbus_check_and_init_needed(ARCHEUS_SOURCES ARCHEUS_INCLUDE_DIRECTORIES ARCHEUS_LINK_LIBRARIES ${ARCHEUS_DBUS_BACKEND})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#if(ARCHEUS_GLEW)
|
||||||
|
# string(APPEND ARCHEUS_FLAGS "-DARC_GLEW ")
|
||||||
#endif()
|
#endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS})
|
set(CMAKE_C_FLAGS ${ARCHEUS_FLAGS})
|
||||||
|
|
||||||
if(ARCHEUS_STD_TESTS)
|
if(ARCHEUS_TESTS)
|
||||||
add_executable(tests
|
add_executable(tests
|
||||||
tests/test.c
|
tests/test.c
|
||||||
|
|
||||||
|
|
@ -133,32 +135,32 @@ if(ARCHEUS_STD_TESTS)
|
||||||
tests/std/parser/csv.c
|
tests/std/parser/csv.c
|
||||||
tests/std/parser/parserlang.c
|
tests/std/parser/parserlang.c
|
||||||
|
|
||||||
${ARCHEUS_STD_SOURCES}
|
${ARCHEUS_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(tests PUBLIC "-DARC_DEBUG_LOG_STREAM_OVERRIDE")
|
target_compile_options(tests PUBLIC "-DARC_DEBUG_LOG_STREAM_OVERRIDE")
|
||||||
target_include_directories(tests ${ARCHEUS_STD_INCLUDE_DIRECTORIES})
|
target_include_directories(tests ${ARCHEUS_INCLUDE_DIRECTORIES})
|
||||||
target_link_libraries(tests ${ARCHEUS_STD_LINK_LIBRARIES})
|
target_link_libraries(tests ${ARCHEUS_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 AND NOT MSVC)
|
if(WIN32 AND NOT MSVC)
|
||||||
add_library(archeus_std STATIC ${ARCHEUS_STD_SOURCES})
|
add_library(archeus STATIC ${ARCHEU_SOURCES})
|
||||||
else()
|
else()
|
||||||
add_library(archeus_std SHARED ${ARCHEUS_STD_SOURCES})
|
add_library(archeus SHARED ${ARCHEUS_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(archeus_std ${ARCHEUS_STD_INCLUDE_DIRECTORIES})
|
target_include_directories(archeus ${ARCHEUS_INCLUDE_DIRECTORIES})
|
||||||
|
|
||||||
target_link_libraries(archeus_std ${ARCHEUS_STD_LINK_LIBRARIES})
|
target_link_libraries(archeus ${ARCHEUS_LINK_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS archeus_std EXPORT archeus_std_Exports
|
install(TARGETS archeus EXPORT archeus_Exports
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(EXPORT archeus_std_Exports
|
install(EXPORT archeus_Exports
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/archeus_std-${PROJECT_VERSION}
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/archeus-${PROJECT_VERSION}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
|
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
|
||||||
|
|
@ -172,22 +174,22 @@ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
set(LIBRARY_INSTALL_BIN ${CMAKE_INSTALL_LIBDIR})
|
set(LIBRARY_INSTALL_BIN ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
configure_package_config_file(
|
configure_package_config_file(
|
||||||
"${PROJECT_SOURCE_DIR}/cmake/archeus_std-config.cmake.in"
|
"${PROJECT_SOURCE_DIR}/cmake/archeus-config.cmake.in"
|
||||||
"${PROJECT_BINARY_DIR}/archeus_std-config.cmake"
|
"${PROJECT_BINARY_DIR}/archeus-config.cmake"
|
||||||
|
|
||||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/archeus_std-${PROJECT_VERSION}
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/archeus-${PROJECT_VERSION}
|
||||||
PATH_VARS INCLUDE_INSTALL_DIR LIBRARY_INSTALL_BIN
|
PATH_VARS INCLUDE_INSTALL_DIR LIBRARY_INSTALL_BIN
|
||||||
)
|
)
|
||||||
|
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"archeus_std-ConfigVersion.cmake"
|
"archeus-ConfigVersion.cmake"
|
||||||
VERSION {PROJECT_VERSION}
|
VERSION {PROJECT_VERSION}
|
||||||
COMPATIBILITY SameMajorVersion
|
COMPATIBILITY SameMajorVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/archeus_std-config.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/archeus-config.cmake
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/archeus_std-ConfigVersion.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/archeus-ConfigVersion.cmake
|
||||||
DESTINATION
|
DESTINATION
|
||||||
${CMAKE_INSTALL_LIBDIR}/cmake/archeus_std-${PROJECT_VERSION}
|
${CMAKE_INSTALL_LIBDIR}/cmake/archeus-${PROJECT_VERSION}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
9
cmake/archeus-config.cmake.in
Normal file
9
cmake/archeus-config.cmake.in
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@_Exports.cmake")
|
||||||
|
|
||||||
|
set_and_check(ARCHEUS_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
||||||
|
set_and_check(ARCHEUS_LINK_DIRS "@PACKAGE_LIBRARY_INSTALL_BIN@")
|
||||||
|
set(ARCHEUS_LIBRARIES "@PROJECT_NAME@")
|
||||||
|
|
||||||
|
check_required_components("@PROJECT_NAME@")
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
set(ARCHEUS_STD_GLFW_WINDOW_SOURCES
|
set(ARCHEUS_GLFW_WINDOW_SOURCES
|
||||||
src/graphics/glfw/config.c
|
src/graphics/glfw/config.c
|
||||||
src/graphics/glfw/renderer.c
|
src/graphics/glfw/renderer.c
|
||||||
src/graphics/glfw/window.c
|
src/graphics/glfw/window.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_GLFW_INPUT_SOURCES
|
set(ARCHEUS_GLFW_INPUT_SOURCES
|
||||||
src/input/glfw/keyboard.c
|
src/input/glfw/keyboard.c
|
||||||
src/input/glfw/mouse.c
|
src/input/glfw/mouse.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(glfw_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND)
|
function(glfw_check_and_init_needed _ARCHEUS_FLAGS _ARCHEUS_SOURCES ARCHEUS_WINDOW_BACKEND ARCHEUS_INPUT_BACKEND)
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "GLFW")
|
if(${ARCHEUS_WINDOW_BACKEND} STREQUAL "GLFW")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -DARC_GLFW_WINDOW ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-lglfw -DARC_GLFW_WINDOW ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_WINDOW_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_GLFW_WINDOW_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "GLFW")
|
if(${ARCHEUS_INPUT_BACKEND} STREQUAL "GLFW")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -lGLEW -DARC_GLFW_INPUT ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-lglfw -lGLEW -DARC_GLFW_INPUT ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_INPUT_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_GLFW_INPUT_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
set(${_ARCHEUS_FLAGS} ${${_ARCHEUS_FLAGS}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
27
cmake/archeus_libdbus.cmake
Normal file
27
cmake/archeus_libdbus.cmake
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
set(ARCHEUS_LIBDBUS_DBUS_SOURCES
|
||||||
|
packages/linux/dbus/libdbus/dbus.c
|
||||||
|
packages/linux/dbus/libdbus/helpers.c
|
||||||
|
)
|
||||||
|
|
||||||
|
function(libdbus_check_and_init_needed _ARCHEUS_SOURCES _ARCHEUS_INCLUDE_DIRECTORIES _ARCHEUS_LINK_LIBRARIES ARCHEUS_DBUS_BACKEND)
|
||||||
|
#add matching files for the selected backends
|
||||||
|
if(${ARCHEUS_DBUS_BACKEND} STREQUAL "LIBDBUS")
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(DBUS REQUIRED dbus-1)
|
||||||
|
|
||||||
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_LIBDBUS_DBUS_SOURCES})
|
||||||
|
|
||||||
|
#add to include directories
|
||||||
|
list(APPEND ${_ARCHEUS_INCLUDE_DIRECTORIES}
|
||||||
|
PUBLIC ${DBUS_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND ${_ARCHEUS_LINK_LIBRARIES}
|
||||||
|
PUBLIC ${DBUS_LIBRARIES}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
|
set(${_ARCHEUS_INCLUDE_DIRECTORIES} ${${_ARCHEUS_INCLUDE_DIRECTORIES}} PARENT_SCOPE)
|
||||||
|
set(${_ARCHEUS_LINK_LIBRARIES} ${${_ARCHEUS_LINK_LIBRARIES}} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
set(ARCHEUS_STD_LIBSSH_SSH_SOURCES
|
set(ARCHEUS_LIBSSH_SSH_SOURCES
|
||||||
packages/networking/libssh/ssh.c
|
packages/linux/ssh/libssh/ssh.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(libssh_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_SSH_BACKEND)
|
function(libssh_check_and_init_needed _ARCHEUS_FLAGS _ARCHEUS_SOURCES ARCHEUS_SSH_BACKEND)
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_SSH_BACKEND} STREQUAL "LIBSSH")
|
if(${ARCHEUS_SSH_BACKEND} STREQUAL "LIBSSH")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lssh ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-lssh ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_LIBSSH_SSH_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_LIBSSH_SSH_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
set(${_ARCHEUS_FLAGS} ${${_ARCHEUS_FLAGS}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
set(ARCHEUS_STD_NCURSES_CONSOLE_SOURCES
|
set(ARCHEUS_NCURSES_CONSOLE_SOURCES
|
||||||
packages/console/ncurses/element.c
|
packages/linux/console/ncurses/element.c
|
||||||
packages/console/ncurses/key.c
|
packages/linux/console/ncurses/key.c
|
||||||
packages/console/ncurses/view.c
|
packages/linux/console/ncurses/view.c
|
||||||
|
|
||||||
packages/console/ncurses/shell.c
|
packages/linux/console/ncurses/shell.c
|
||||||
packages/console/ncurses/buffer.c
|
packages/linux/console/ncurses/buffer.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(ncurses_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_CONSOLE_BACKEND)
|
function(ncurses_check_and_init_needed _ARCHEUS_FLAGS _ARCHEUS_SOURCES ARCHEUS_CONSOLE_BACKEND)
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_CONSOLE_BACKEND} STREQUAL "NCURSES")
|
if(${ARCHEUS_CONSOLE_BACKEND} STREQUAL "NCURSES")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lncurses ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-lncurses ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NCURSES_CONSOLE_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_NCURSES_CONSOLE_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
set(${_ARCHEUS_FLAGS} ${${_ARCHEUS_FLAGS}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
set(ARCHEUS_STD_NONE_WINDOW_SOURCES
|
set(ARCHEUS_NONE_WINDOW_SOURCES
|
||||||
src/graphics/window.c
|
src/graphics/window.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_NONE_INPUT_SOURCES
|
set(ARCHEUS_NONE_INPUT_SOURCES
|
||||||
src/input/input.c
|
src/input/input.c
|
||||||
src/input/keyboard.c
|
src/input/keyboard.c
|
||||||
src/input/mouse.c
|
src/input/mouse.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_NONE_GRAPHICS_SOURCES
|
set(ARCHEUS_NONE_GRAPHICS_SOURCES
|
||||||
src/graphics/circle.c
|
src/graphics/circle.c
|
||||||
src/graphics/config.c
|
src/graphics/config.c
|
||||||
src/graphics/line.c
|
src/graphics/line.c
|
||||||
|
|
@ -20,23 +20,23 @@ set(ARCHEUS_STD_NONE_GRAPHICS_SOURCES
|
||||||
src/graphics/text.c
|
src/graphics/text.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(none_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND ARCHEUS_STD_GRAPHICS_BACKEND)
|
function(none_check_and_init_needed _ARCHEUS_FLAGS _ARCHEUS_SOURCES ARCHEUS_WINDOW_BACKEND ARCHEUS_INPUT_BACKEND ARCHEUS_GRAPHICS_BACKEND)
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "NONE")
|
if(${ARCHEUS_WINDOW_BACKEND} STREQUAL "NONE")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_WINDOW ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-DARC_NONE_WINDOW ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_WINDOW_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_NONE_WINDOW_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "NONE")
|
if(${ARCHEUS_INPUT_BACKEND} STREQUAL "NONE")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_INPUT ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-DARC_NONE_INPUT ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_INPUT_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_NONE_INPUT_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "NONE")
|
if(${ARCHEUS_GRAPHICS_BACKEND} STREQUAL "NONE")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_GRAPHICS ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-DARC_NONE_GRAPHICS ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_GRAPHICS_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_NONE_GRAPHICS_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
set(${_ARCHEUS_FLAGS} ${${_ARCHEUS_FLAGS}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
set(ARCHEUS_STD_OPENGL_GRAPHICS_SOURCES
|
set(ARCHEUS_OPENGL_GRAPHICS_SOURCES
|
||||||
packages/graphics/opengl/circle.c
|
packages/graphics/opengl/circle.c
|
||||||
packages/graphics/opengl/line.c
|
packages/graphics/opengl/line.c
|
||||||
packages/graphics/opengl/obround.c
|
packages/graphics/opengl/obround.c
|
||||||
|
|
@ -8,13 +8,13 @@ set(ARCHEUS_STD_OPENGL_GRAPHICS_SOURCES
|
||||||
packages/graphics/opengl/text.c
|
packages/graphics/opengl/text.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(opengl_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_GRAPHICS_BACKEND)
|
function(opengl_check_and_init_needed _ARCHEUS_FLAGS _ARCHEUS_SOURCES ARCHEUS_GRAPHICS_BACKEND)
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "OPENGL")
|
if(${ARCHEUS_GRAPHICS_BACKEND} STREQUAL "OPENGL")
|
||||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lGL -DARC_OPENGL_GRAPHICS ")
|
string(APPEND ${_ARCHEUS_FLAGS} "-lGL -DARC_OPENGL_GRAPHICS ")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_OPENGL_GRAPHICS_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_OPENGL_GRAPHICS_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
set(${_ARCHEUS_FLAGS} ${${_ARCHEUS_FLAGS}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
set(ARCHEUS_STD_SDL2_WINDOW_SOURCES
|
set(ARCHEUS_SDL2_WINDOW_SOURCES
|
||||||
packages/graphics/sdl/window.c
|
packages/graphics/sdl/window.c
|
||||||
packages/graphics/sdl/renderer.c
|
packages/graphics/sdl/renderer.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_SDL2_INPUT_SOURCES
|
set(ARCHEUS_SDL2_INPUT_SOURCES
|
||||||
packages/input/sdl/input.c
|
packages/input/sdl/input.c
|
||||||
packages/input/sdl/keyboard.c
|
packages/input/sdl/keyboard.c
|
||||||
packages/input/sdl/mouse.c
|
packages/input/sdl/mouse.c
|
||||||
|
|
@ -12,7 +12,7 @@ set(ARCHEUS_STD_SDL2_INPUT_SOURCES
|
||||||
packages/audio/sdl/config.c
|
packages/audio/sdl/config.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ARCHEUS_STD_SDL2_GRAPHICS_SOURCES
|
set(ARCHEUS_SDL2_GRAPHICS_SOURCES
|
||||||
packages/graphics/sdl/circle.c
|
packages/graphics/sdl/circle.c
|
||||||
packages/graphics/sdl/config.c
|
packages/graphics/sdl/config.c
|
||||||
packages/graphics/sdl/line.c
|
packages/graphics/sdl/line.c
|
||||||
|
|
@ -23,9 +23,9 @@ set(ARCHEUS_STD_SDL2_GRAPHICS_SOURCES
|
||||||
packages/graphics/sdl/text.c
|
packages/graphics/sdl/text.c
|
||||||
)
|
)
|
||||||
|
|
||||||
function(sdl2_check_and_init_needed _ARCHEUS_STD_SOURCES _ARCHEUS_STD_INCLUDE_DIRECTORIES _ARCHEUS_STD_LINK_LIBRARIES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND ARCHEUS_STD_GRAPHICS_BACKEND)
|
function(sdl2_check_and_init_needed _ARCHEUS_SOURCES _ARCHEUS_INCLUDE_DIRECTORIES _ARCHEUS_LINK_LIBRARIES ARCHEUS_WINDOW_BACKEND ARCHEUS_INPUT_BACKEND ARCHEUS_GRAPHICS_BACKEND)
|
||||||
#if no backend uses sdl return
|
#if no backend uses sdl return
|
||||||
if(NOT ${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "SDL2" AND NOT ${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "SDL2" AND NOT ${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "SDL2")
|
if(NOT ${ARCHEUS_WINDOW_BACKEND} STREQUAL "SDL2" AND NOT ${ARCHEUS_INPUT_BACKEND} STREQUAL "SDL2" AND NOT ${ARCHEUS_GRAPHICS_BACKEND} STREQUAL "SDL2")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -33,51 +33,51 @@ function(sdl2_check_and_init_needed _ARCHEUS_STD_SOURCES _ARCHEUS_STD_INCLUDE_DI
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
|
|
||||||
#add to include directories
|
#add to include directories
|
||||||
list(APPEND ${_ARCHEUS_STD_INCLUDE_DIRECTORIES}
|
list(APPEND ${_ARCHEUS_INCLUDE_DIRECTORIES}
|
||||||
PRIVATE ${SDL2_INCLUDE_DIRS}
|
PRIVATE ${SDL2_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
#add to link libraries
|
#add to link libraries
|
||||||
list(APPEND ${_ARCHEUS_STD_LINK_LIBRARIES}
|
list(APPEND ${_ARCHEUS_LINK_LIBRARIES}
|
||||||
PUBLIC ${SDL2_LIBRARIES}
|
PUBLIC ${SDL2_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
#add matching files for the selected backends
|
#add matching files for the selected backends
|
||||||
if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "SDL2")
|
if(${ARCHEUS_WINDOW_BACKEND} STREQUAL "SDL2")
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_SDL2_WINDOW_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_SDL2_WINDOW_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "SDL2")
|
if(${ARCHEUS_INPUT_BACKEND} STREQUAL "SDL2")
|
||||||
#TODO: remove this
|
#TODO: remove this
|
||||||
find_package(SDL2_mixer REQUIRED)
|
find_package(SDL2_mixer REQUIRED)
|
||||||
|
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_SDL2_INPUT_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_SDL2_INPUT_SOURCES})
|
||||||
|
|
||||||
#TODO: remove this
|
#TODO: remove this
|
||||||
list(APPEND ${_ARCHEUS_STD_LINK_LIBRARIES}
|
list(APPEND ${_ARCHEUS_LINK_LIBRARIES}
|
||||||
PUBLIC SDL2_mixer::SDL2_mixer
|
PUBLIC SDL2_mixer::SDL2_mixer
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "SDL2")
|
if(${ARCHEUS_GRAPHICS_BACKEND} STREQUAL "SDL2")
|
||||||
find_package(SDL2_image REQUIRED)
|
find_package(SDL2_image REQUIRED)
|
||||||
find_package(SDL2_ttf REQUIRED)
|
find_package(SDL2_ttf REQUIRED)
|
||||||
|
|
||||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_SDL2_GRAPHICS_SOURCES})
|
list(APPEND ${_ARCHEUS_SOURCES} ${ARCHEUS_SDL2_GRAPHICS_SOURCES})
|
||||||
|
|
||||||
#add to include directories
|
#add to include directories
|
||||||
list(APPEND ${_ARCHEUS_STD_INCLUDE_DIRECTORIES}
|
list(APPEND ${_ARCHEUS_INCLUDE_DIRECTORIES}
|
||||||
PRIVATE ${SDL2IMAGE_INCLUDE_DIRS}
|
PRIVATE ${SDL2IMAGE_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
#add to link libraries
|
#add to link libraries
|
||||||
list(APPEND ${_ARCHEUS_STD_LINK_LIBRARIES}
|
list(APPEND ${_ARCHEUS_LINK_LIBRARIES}
|
||||||
PUBLIC SDL2_image::SDL2_image
|
PUBLIC SDL2_image::SDL2_image
|
||||||
PUBLIC SDL2_ttf::SDL2_ttf
|
PUBLIC SDL2_ttf::SDL2_ttf
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
set(${_ARCHEUS_SOURCES} ${${_ARCHEUS_SOURCES}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_INCLUDE_DIRECTORIES} ${${_ARCHEUS_STD_INCLUDE_DIRECTORIES}} PARENT_SCOPE)
|
set(${_ARCHEUS_INCLUDE_DIRECTORIES} ${${_ARCHEUS_INCLUDE_DIRECTORIES}} PARENT_SCOPE)
|
||||||
set(${_ARCHEUS_STD_LINK_LIBRARIES} ${${_ARCHEUS_STD_LINK_LIBRARIES}} PARENT_SCOPE)
|
set(${_ARCHEUS_LINK_LIBRARIES} ${${_ARCHEUS_LINK_LIBRARIES}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
@PACKAGE_INIT@
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@_Exports.cmake")
|
|
||||||
|
|
||||||
set_and_check(ARCHEUS_STD_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
|
||||||
set_and_check(ARCHEUS_STD_LINK_DIRS "@PACKAGE_LIBRARY_INSTALL_BIN@")
|
|
||||||
set(ARCHEUS_STD_LIBRARIES "@PROJECT_NAME@")
|
|
||||||
|
|
||||||
check_required_components("@PROJECT_NAME@")
|
|
||||||
38
include/arc/linux/dbus/dbus.h
Normal file
38
include/arc/linux/dbus/dbus.h
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#ifndef ARC_DBUS_H_
|
||||||
|
#define ARC_DBUS_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <dbus/dbus.h>
|
||||||
|
#include <arc/std/vector.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*/
|
||||||
|
typedef struct ARC_DBus ARC_DBus;
|
||||||
|
|
||||||
|
void ARC_DBus_Create(ARC_DBus **dbus);
|
||||||
|
|
||||||
|
void ARC_DBus_Destroy(ARC_DBus *dbus);
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Request.html#org-freedesktop-portal-request-response
|
||||||
|
void ARC_DBus_RequestResponse();
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-createsession
|
||||||
|
void ARC_DBus_InitSession(ARC_DBus *dbus);
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-bindshortcuts
|
||||||
|
//NOTE: this is a vector of ARC_DBusShortcut
|
||||||
|
void ARC_DBus_BindShortcuts(ARC_DBus *dbus, ARC_Vector *dbusShortcutVector);
|
||||||
|
|
||||||
|
//NOTE: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-listshortcuts
|
||||||
|
void ARC_DBus_ListShortcuts(ARC_DBus *dbus);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // !ARC_DBUS_H_
|
||||||
55
include/arc/linux/dbus/helpers.h
Normal file
55
include/arc/linux/dbus/helpers.h
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
#ifndef ARC_DBUS_HELPER_H_
|
||||||
|
#define ARC_DBUS_HELPER_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <dbus/dbus.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*/
|
||||||
|
typedef struct ARC_DBus ARC_DBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in] dbus
|
||||||
|
* @param[in] interface
|
||||||
|
* @param[in] objectPath
|
||||||
|
*/
|
||||||
|
void ARC_DBusHelper_BusRequestName(ARC_DBus *dbus, const char *interface, const char *objectPath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in] dbus
|
||||||
|
* @param[in] interface
|
||||||
|
* @param[in] objectPath
|
||||||
|
* @param[in] member
|
||||||
|
*/
|
||||||
|
void ARC_DBusHelper_BusAddMatch(ARC_DBus *dbus, const char *interface, const char *objectPath, const char *member);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in] message
|
||||||
|
*/
|
||||||
|
void ARC_DBusHelper_HandleSignal(DBusMessage *message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param[in] dictonaryIter
|
||||||
|
* @param[in] stringKey
|
||||||
|
* @param[in] varientStringValue
|
||||||
|
*/
|
||||||
|
void ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(DBusMessageIter *dictonaryIter, const char *stringKey, const char *varientStringValue);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // !ARC_DBUS_HELPER_H_
|
||||||
292
packages/linux/dbus/libdbus/dbus.c
Normal file
292
packages/linux/dbus/libdbus/dbus.c
Normal file
|
|
@ -0,0 +1,292 @@
|
||||||
|
#include "arc/linux/dbus/dbus.h"
|
||||||
|
#include "arc/linux/dbus/helpers.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
static const char *handleCStr = "ARC_Controller";
|
||||||
|
static const char *sessionHandleCStr = "arc_controller";
|
||||||
|
|
||||||
|
static const char *busNameCStr = "org.freedesktop.portal.Desktop";
|
||||||
|
static const char *requestInterfaceCStr = "org.freedesktop.portal.Request";
|
||||||
|
static const char *shortcutInterfaceCStr = "org.freedesktop.portal.GlobalShortcuts";
|
||||||
|
static const char *objectPathCStr = "/org/freedesktop/portal/desktop";
|
||||||
|
|
||||||
|
typedef struct ARC_DBus {
|
||||||
|
DBusConnection *connection;
|
||||||
|
DBusError error;
|
||||||
|
|
||||||
|
const char *handle;
|
||||||
|
} ARC_DBus;
|
||||||
|
|
||||||
|
typedef struct ARC_DBusShortcut {
|
||||||
|
const char *id;
|
||||||
|
const char *description;
|
||||||
|
const char *preferredTrigger;
|
||||||
|
} ARC_DBusShortcut;
|
||||||
|
|
||||||
|
void ARC_DBus_Create(ARC_DBus **dbus){
|
||||||
|
*dbus = (ARC_DBus *)malloc(sizeof(ARC_DBus));
|
||||||
|
|
||||||
|
dbus_error_init(&((*dbus)->error));
|
||||||
|
|
||||||
|
(*dbus)->connection = dbus_bus_get(DBUS_BUS_SESSION, &((*dbus)->error));
|
||||||
|
if((*dbus)->connection == NULL){
|
||||||
|
printf("Connection to D-Bus failed %s\n", ((*dbus)->error).message);
|
||||||
|
dbus_error_free(&((*dbus)->error));
|
||||||
|
|
||||||
|
free(*dbus);
|
||||||
|
*dbus = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARC_DBus_Destroy(ARC_DBus *dbus){
|
||||||
|
dbus_error_free(&(dbus->error));
|
||||||
|
|
||||||
|
dbus_connection_unref(dbus->connection);
|
||||||
|
free(dbus);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Request.html#org-freedesktop-portal-request-response
|
||||||
|
void ARC_DBus_RequestResponse(){
|
||||||
|
//create the create session message
|
||||||
|
DBusMessage *message = dbus_message_new_method_call(busNameCStr, objectPathCStr, requestInterfaceCStr, "Response");
|
||||||
|
if(!message){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("Message creation failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//initialize the message arguments
|
||||||
|
DBusMessageIter arguments;
|
||||||
|
dbus_message_iter_init_append(message, &arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-createsession
|
||||||
|
void ARC_DBus_InitSession(ARC_DBus *dbus){
|
||||||
|
//create the create session message
|
||||||
|
DBusMessage *message = dbus_message_new_method_call(busNameCStr, objectPathCStr, shortcutInterfaceCStr, "CreateSession");
|
||||||
|
if(!message){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("Message creation failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//initialize the message arguments
|
||||||
|
DBusMessageIter arguments;
|
||||||
|
dbus_message_iter_init_append(message, &arguments);
|
||||||
|
|
||||||
|
//create the dictionary to add the message arguments to and make sure it can open
|
||||||
|
DBusMessageIter dictonaryIter;
|
||||||
|
if(!dbus_message_iter_open_container(&arguments, DBUS_TYPE_ARRAY, "{sv}", &dictonaryIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//init variable container for handle and session handle
|
||||||
|
ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(&dictonaryIter, "handle_token" , handleCStr);
|
||||||
|
ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(&dictonaryIter, "session_handle_token", sessionHandleCStr);
|
||||||
|
|
||||||
|
//close to be able to send the message
|
||||||
|
dbus_message_iter_close_container(&arguments, &dictonaryIter);
|
||||||
|
|
||||||
|
//send the message and store the handle response in a reply message
|
||||||
|
DBusMessage *reply = dbus_connection_send_with_reply_and_block(dbus->connection, message, -1, &(dbus->error));
|
||||||
|
if(reply == NULL){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("ERROR: %s\n", dbus->error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
//wait until message queue is empty then clean up the message
|
||||||
|
dbus_connection_flush(dbus->connection);
|
||||||
|
dbus_message_unref(message);
|
||||||
|
|
||||||
|
//get the reply message iterator and make sure it stores an object (this will be a handle on success)
|
||||||
|
DBusMessageIter replyIter;
|
||||||
|
dbus_message_iter_init(reply, &replyIter);
|
||||||
|
if(dbus_message_iter_get_arg_type(&replyIter) != 'o'){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("object expected, but recieved something else, '%c'\n", (char)dbus_message_iter_get_arg_type(&replyIter));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//store the handle from the iterator into the dbus type
|
||||||
|
//TODO: probably want to warn if dbus->handle already stores something
|
||||||
|
dbus_message_iter_get_basic(&replyIter, &(dbus->handle));
|
||||||
|
|
||||||
|
//request response shit?
|
||||||
|
// dbus_connection_read_write(dbus->connection, 0);
|
||||||
|
//
|
||||||
|
// DBusMessage *message = dbus_connection_pop_message(dbus->connection);
|
||||||
|
// if(message == NULL){
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
//cleanup
|
||||||
|
dbus_message_unref(reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-bindshortcuts
|
||||||
|
//NOTE: this is a vector of ARC_DBusShortcut
|
||||||
|
void ARC_DBus_BindShortcuts(ARC_DBus *dbus, ARC_Vector *dbusShortcutVector){
|
||||||
|
//create the create session message
|
||||||
|
DBusMessage *message = dbus_message_new_method_call(busNameCStr, objectPathCStr, shortcutInterfaceCStr, "BindShortcuts");
|
||||||
|
if(!message){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("Message creation failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//initialize the message arguments
|
||||||
|
DBusMessageIter arguments;
|
||||||
|
dbus_message_iter_init_append(message, &arguments);
|
||||||
|
|
||||||
|
/* ~ session handle ~ */
|
||||||
|
dbus_message_iter_append_basic(&arguments, DBUS_TYPE_OBJECT_PATH, &(dbus->handle));
|
||||||
|
|
||||||
|
/* ~ shortcuts ~ */
|
||||||
|
//create the dictionary to add the message arguments to and make sure it can open
|
||||||
|
DBusMessageIter shortcutsIter;
|
||||||
|
if(!dbus_message_iter_open_container(&arguments, DBUS_TYPE_ARRAY, "(sa{sv})", &shortcutsIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//add all the shortcuts from the vector to the shortcuts
|
||||||
|
for(uint32_t index = 0; index < ARC_Vector_GetSize(dbusShortcutVector); index++){
|
||||||
|
DBusMessageIter shortcutStructIter;
|
||||||
|
if(!dbus_message_iter_open_container(&shortcutsIter, DBUS_TYPE_STRUCT, NULL, &shortcutStructIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ARC_DBusShortcut *shortcut = ARC_Vector_Get(dbusShortcutVector, index);
|
||||||
|
dbus_message_iter_append_basic(&shortcutStructIter, DBUS_TYPE_STRING, &shortcut->id);
|
||||||
|
|
||||||
|
DBusMessageIter shortcutItemIter;
|
||||||
|
if(!dbus_message_iter_open_container(&shortcutStructIter, DBUS_TYPE_ARRAY, "{sv}", &shortcutItemIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//add the shortcut to the dictionary
|
||||||
|
ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(&shortcutItemIter, shortcut->description, shortcut->preferredTrigger);
|
||||||
|
|
||||||
|
//close to be able to send the message
|
||||||
|
dbus_message_iter_close_container(&shortcutStructIter, &shortcutItemIter);
|
||||||
|
dbus_message_iter_close_container(&shortcutsIter, &shortcutStructIter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//close to be able to send the message
|
||||||
|
dbus_message_iter_close_container(&arguments, &shortcutsIter);
|
||||||
|
|
||||||
|
/* ~ parent window ~ */
|
||||||
|
const char *parentWindow = "";
|
||||||
|
dbus_message_iter_append_basic(&arguments, DBUS_TYPE_STRING, &parentWindow);
|
||||||
|
|
||||||
|
/* ~ options ~ */
|
||||||
|
DBusMessageIter optionsIter;
|
||||||
|
if(!dbus_message_iter_open_container(&arguments, DBUS_TYPE_ARRAY, "{sv}", &optionsIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus_message_iter_close_container(&arguments, &optionsIter);
|
||||||
|
|
||||||
|
//send the message and store the handle response in a reply message
|
||||||
|
DBusMessage *reply = dbus_connection_send_with_reply_and_block(dbus->connection, message, -1, &(dbus->error));
|
||||||
|
if(reply == NULL){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("ERROR: %s\n", dbus->error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
//wait until message queue is empty then clean up the message
|
||||||
|
dbus_connection_flush(dbus->connection);
|
||||||
|
dbus_message_unref(message);
|
||||||
|
|
||||||
|
//get the reply message iterator and make sure it stores an object (this will be a handle on success)
|
||||||
|
DBusMessageIter replyIter;
|
||||||
|
dbus_message_iter_init(reply, &replyIter);
|
||||||
|
if(dbus_message_iter_get_arg_type(&replyIter) != 'o'){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("object expected, but recieved something else, '%c'\n", (char)dbus_message_iter_get_arg_type(&replyIter));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the request handle. not sure what to do with this yet...
|
||||||
|
const char *requestHandle;
|
||||||
|
dbus_message_iter_get_basic(&replyIter, &requestHandle);
|
||||||
|
printf("Request Handle: %s\n", requestHandle);
|
||||||
|
|
||||||
|
//cleanup
|
||||||
|
dbus_message_unref(reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
//NOTE: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-listshortcuts
|
||||||
|
void ARC_DBus_ListShortcuts(ARC_DBus *dbus){
|
||||||
|
//create the create session message
|
||||||
|
DBusMessage *message = dbus_message_new_method_call(busNameCStr, objectPathCStr, shortcutInterfaceCStr, "ListShortcuts");
|
||||||
|
if(!message){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("Message creation failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//initialize the message arguments
|
||||||
|
DBusMessageIter arguments;
|
||||||
|
dbus_message_iter_init_append(message, &arguments);
|
||||||
|
|
||||||
|
/* ~ session handle ~ */
|
||||||
|
dbus_message_iter_append_basic(&arguments, DBUS_TYPE_OBJECT_PATH, &(dbus->handle));
|
||||||
|
|
||||||
|
/* ~ options ~ */
|
||||||
|
DBusMessageIter optionsIter;
|
||||||
|
if(!dbus_message_iter_open_container(&arguments, DBUS_TYPE_ARRAY, "{sv}", &optionsIter)){
|
||||||
|
printf("Failed to append array to the message\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus_message_iter_close_container(&arguments, &optionsIter);
|
||||||
|
|
||||||
|
//send the message and store the handle response in a reply message
|
||||||
|
DBusMessage *reply = dbus_connection_send_with_reply_and_block(dbus->connection, message, -1, &(dbus->error));
|
||||||
|
if(reply == NULL){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("ERROR: %s\n", dbus->error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
//wait until message queue is empty then clean up the message
|
||||||
|
dbus_connection_flush(dbus->connection);
|
||||||
|
dbus_message_unref(message);
|
||||||
|
|
||||||
|
/*
|
||||||
|
//get the reply message iterator and make sure it stores an object (this will be a handle on success)
|
||||||
|
DBusMessageIter replyIter;
|
||||||
|
dbus_message_iter_init(reply, &replyIter);
|
||||||
|
if(dbus_message_iter_get_arg_type(&replyIter) != 'o'){
|
||||||
|
//TODO: arc errno stuff here
|
||||||
|
printf("object expected, but recieved something else, '%c'\n", (char)dbus_message_iter_get_arg_type(&replyIter));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the request handle. not sure what to do with this yet...
|
||||||
|
const char *requestHandle;
|
||||||
|
dbus_message_iter_get_basic(&replyIter, &requestHandle);
|
||||||
|
printf("Request Handle: %s\n", requestHandle);
|
||||||
|
*/
|
||||||
|
|
||||||
|
//cleanup
|
||||||
|
dbus_message_unref(reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
ARC_DBusShortcut *ARC_DBusShortcut_CreateAndReturn(const char *id, const char *description, const char *preferredTrigger){
|
||||||
|
ARC_DBusShortcut *shortcut = (ARC_DBusShortcut *)malloc(sizeof(ARC_DBusShortcut));
|
||||||
|
|
||||||
|
*shortcut = (ARC_DBusShortcut){
|
||||||
|
id,
|
||||||
|
description,
|
||||||
|
preferredTrigger
|
||||||
|
};
|
||||||
|
|
||||||
|
return shortcut;
|
||||||
|
}
|
||||||
63
packages/linux/dbus/libdbus/helpers.c
Normal file
63
packages/linux/dbus/libdbus/helpers.c
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
#include "arc/linux/dbus/helpers.h"
|
||||||
|
#include "arc/linux/dbus/dbus.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
typedef struct ARC_DBus {
|
||||||
|
DBusConnection *connection;
|
||||||
|
DBusError error;
|
||||||
|
|
||||||
|
const char *handle;
|
||||||
|
} ARC_DBus;
|
||||||
|
|
||||||
|
void ARC_DBusHelper_BusRequestName(ARC_DBus *dbus, const char *interface, const char *objectPath){
|
||||||
|
int32_t response = dbus_bus_request_name(dbus->connection, interface, DBUS_NAME_FLAG_REPLACE_EXISTING, &(dbus->error));
|
||||||
|
if(response == -1){
|
||||||
|
printf("Request name failed %s\n", (dbus->error).message);
|
||||||
|
dbus_error_free(&(dbus->error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARC_DBusHelper_BusAddMatch(ARC_DBus *dbus, const char *interface, const char *objectPath, const char *member){
|
||||||
|
//add response signal
|
||||||
|
const char *matchRuleCStr = "type='signal',interface='%s',path='%s',member='%s'";
|
||||||
|
uint32_t matchRuleLen = strlen(matchRuleCStr) + strlen(interface) + strlen(objectPath) + strlen(member);
|
||||||
|
char matchRule[matchRuleLen];
|
||||||
|
snprintf(matchRule, matchRuleLen, matchRuleCStr, interface, objectPath, member);
|
||||||
|
|
||||||
|
dbus_bus_add_match(dbus->connection, matchRule, &(dbus->error));
|
||||||
|
if(dbus_error_is_set(&(dbus->error))){
|
||||||
|
printf("failed to add match rule: %s\n", matchRuleCStr);
|
||||||
|
dbus_error_free(&(dbus->error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARC_DBusHelper_HandleSignal(DBusMessage *message){
|
||||||
|
DBusError error;
|
||||||
|
dbus_error_init(&error);
|
||||||
|
|
||||||
|
uint32_t response;
|
||||||
|
|
||||||
|
DBusMessageIter argumentsIter;
|
||||||
|
dbus_message_iter_init(message, &argumentsIter);
|
||||||
|
dbus_message_iter_get_basic(&argumentsIter, &response);
|
||||||
|
|
||||||
|
printf("Response signal: %u\n", response);
|
||||||
|
|
||||||
|
dbus_error_free(&error);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(DBusMessageIter *dictonaryIter, const char *stringKey, const char *varientStringValue){
|
||||||
|
//TODO: should add arc error checks here
|
||||||
|
DBusMessageIter keyIter;
|
||||||
|
dbus_message_iter_open_container(dictonaryIter, DBUS_TYPE_DICT_ENTRY, NULL, &keyIter);
|
||||||
|
dbus_message_iter_append_basic(&keyIter, DBUS_TYPE_STRING, &stringKey);
|
||||||
|
|
||||||
|
DBusMessageIter valueIter;
|
||||||
|
dbus_message_iter_open_container(&keyIter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &valueIter);
|
||||||
|
dbus_message_iter_append_basic(&valueIter, DBUS_TYPE_STRING, &varientStringValue);
|
||||||
|
|
||||||
|
dbus_message_iter_close_container(&keyIter, &valueIter);
|
||||||
|
dbus_message_iter_close_container(dictonaryIter, &keyIter);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue