Skip to content

Commit 6cb6ecd

Browse files
committed
XCB: new platform (simplified X11)
Similar to the X11 platform plugin, but should work on bare-bone X11 server, without any special extensions or hardware requirements (e.g. GL/DRI/XKB). Works over SSH X11Forwarding tunnel and inside VNC servers. Downside: much higher CPU load than other platforms. Compilation requires the libxcb-keysyms and libxcb-image libraries Debian/Ubuntu: apt-get install libxcb-keysyms1-dev libxcb-image0-dev Usage: cog -P xcb https://example.com cog -P xcb -O "[options]" https://example.com [Options] is comma separated string with one or more of: fullscreen - start in fullscreen mode (not multi-monitor aware, default: not full screen). x=N,y=N - open window in position X,Y on screen width=N - set window width height=N - set window height (default for x,y,width,height: window manager decides) fps=N - screen update frequency (default: 10). higher values result in higher CPU load. scroll-delta=N - amount of pixels to scrool with mouse-wheel (default: 20). rev-scroll-direction - reverse mouse-whell scroll direction. ignore-keys - do not send keys to WebKit. ignore-mouse-movement - do not send mouse movement events to WebKit. ignore-mouse-buttons - do not send mouse button clicks and scroll wheel to WebKit. Example: cog -P xcb -O "fullscreen,fps=20,scroll-delta=100" https://example.com
1 parent b1e877c commit 6cb6ecd

File tree

3 files changed

+1150
-0
lines changed

3 files changed

+1150
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ option(COG_PLATFORM_FDO "Build the FDO platform module" ON)
5858
option(COG_PLATFORM_DRM "Build the DRM platform module" ON)
5959
option(COG_PLATFORM_X11 "Build the X11 platform module" OFF)
6060
option(COG_PLATFORM_GTK4 "Build the GTK4 platform module" OFF)
61+
option(COG_PLATFORM_XCB "Build the XCB (Simplified X11) platform module" OFF)
6162

6263
option(COG_BUILD_PROGRAMS "Build and install programs as well" ON)
6364
option(INSTALL_MAN_PAGES "Install the man(1) pages if COG_BUILD_PROGRAMS is enabled" ON)
@@ -209,3 +210,6 @@ endif ()
209210
if (COG_PLATFORM_GTK4)
210211
add_subdirectory(platform/gtk4)
211212
endif ()
213+
if (COG_PLATFORM_XCB)
214+
add_subdirectory(platform/xcb)
215+
endif ()

platform/xcb/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# libcogplaform-xcb
2+
3+
# libxcb-keysyms1-dev libxcb-image0-dev
4+
5+
pkg_check_modules(COGPLATFORM_XCB_DEPS IMPORTED_TARGET
6+
REQUIRED wpebackend-fdo-1.0>=1.6.0 xcb xcb-image xcb-keysyms)
7+
8+
add_library(cogplatform-xcb MODULE cog-platform-xcb.c)
9+
set_target_properties(cogplatform-xcb PROPERTIES
10+
C_STANDARD 99
11+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
12+
)
13+
target_compile_definitions(cogplatform-xcb PRIVATE G_LOG_DOMAIN=\"Cog-XCB\")
14+
target_link_libraries(cogplatform-xcb PRIVATE cogcore
15+
PkgConfig::COGPLATFORM_XCB_DEPS
16+
PkgConfig::WebKit
17+
)
18+
19+
install(TARGETS cogplatform-xcb
20+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
21+
COMPONENT "runtime"
22+
)

0 commit comments

Comments
 (0)