Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New platform: xcb (simplified X11) #303

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ option(COG_PLATFORM_FDO "Build the FDO platform module" ON)
option(COG_PLATFORM_DRM "Build the DRM platform module" ON)
option(COG_PLATFORM_X11 "Build the X11 platform module" OFF)
option(COG_PLATFORM_GTK4 "Build the GTK4 platform module" OFF)
option(COG_PLATFORM_XCB "Build the XCB (Simplified X11) platform module" OFF)

option(COG_BUILD_PROGRAMS "Build and install programs as well" ON)
option(INSTALL_MAN_PAGES "Install the man(1) pages if COG_BUILD_PROGRAMS is enabled" ON)
Expand Down Expand Up @@ -209,3 +210,6 @@ endif ()
if (COG_PLATFORM_GTK4)
add_subdirectory(platform/gtk4)
endif ()
if (COG_PLATFORM_XCB)
add_subdirectory(platform/xcb)
endif ()
6 changes: 5 additions & 1 deletion cog.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static struct {
} on_failure;
char *web_extensions_dir;
gboolean ignore_tls_errors;
char *platform_options;
} s_options = {
.scale_factor = 1.0,
.device_scale_factor = 1.0,
Expand Down Expand Up @@ -83,6 +84,9 @@ static GOptionEntry s_cli_options[] =
{ "platform", 'P', 0, G_OPTION_ARG_STRING, &s_options.platform_name,
"Platform plug-in to use.",
"NAME" },
{ "platform-options", 'O', 0, G_OPTION_ARG_STRING, &s_options.platform_options,
"custom options to pass to the platform shared object",
"OPT,OPT=VALUE" },
{ "web-extensions-dir", '\0', 0, G_OPTION_ARG_STRING, &s_options.web_extensions_dir,
"Load Web Extensions from given directory.",
"PATH"},
Expand Down Expand Up @@ -306,7 +310,7 @@ platform_setup (CogShell *shell)
}

g_autoptr(GError) error = NULL;
if (!cog_platform_setup (platform, shell, "", &error)) {
if (!cog_platform_setup (platform, shell, s_options.platform_options, &error)) {
g_warning ("Platform setup failed: %s", error->message);
return FALSE;
}
Expand Down
22 changes: 22 additions & 0 deletions platform/xcb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# libcogplaform-xcb

# libxcb-keysyms1-dev libxcb-image0-dev

pkg_check_modules(COGPLATFORM_XCB_DEPS IMPORTED_TARGET
REQUIRED wpebackend-fdo-1.0>=1.6.0 xcb xcb-image xcb-keysyms)

add_library(cogplatform-xcb MODULE cog-platform-xcb.c)
set_target_properties(cogplatform-xcb PROPERTIES
C_STANDARD 99
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
target_compile_definitions(cogplatform-xcb PRIVATE G_LOG_DOMAIN=\"Cog-XCB\")
target_link_libraries(cogplatform-xcb PRIVATE cogcore
PkgConfig::COGPLATFORM_XCB_DEPS
PkgConfig::WebKit
)

install(TARGETS cogplatform-xcb
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT "runtime"
)
Loading