Skip to content

Commit

Permalink
Remove xcb_util_keysyms
Browse files Browse the repository at this point in the history
XKB covers the functionality of xcb_util_keysyms, so we can remove that as a dependency
  • Loading branch information
serenity4 committed Dec 30, 2020
1 parent 636b33d commit 6232722
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 70 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
WindowAbstractions = "e18202ca-4a7d-4de8-b056-fa6bbd7de157"
Xorg_libxcb_jll = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b"
Xorg_xcb_util_jll = "2def613f-5ad1-5310-b15b-b15d46f528f5"
Xorg_xcb_util_keysyms_jll = "975044d2-76e6-5fbe-bf08-97ce7c6574c7"
xkbcommon_jll = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd"

[compat]
Expand All @@ -19,7 +18,6 @@ Parameters = "0.12.1"
WindowAbstractions = "0.2.2"
Xorg_libxcb_jll = "1.13.0"
Xorg_xcb_util_jll = "0.4.0"
Xorg_xcb_util_keysyms_jll = "0.4.0"
julia = "1.5"
xkbcommon_jll = "0.9.1"

Expand Down
1 change: 0 additions & 1 deletion gen/Libxcb.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Libxcb

import Xorg_libxcb_jll: libxcb, libxcb_xkb
import Xorg_xcb_util_keysyms_jll: libxcb_keysyms
import Xorg_xcb_util_jll: libxcb_util

using CEnum
Expand Down
10 changes: 4 additions & 6 deletions gen/generator.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
using Clang
import Xorg_libxcb_jll
import Xorg_xcb_util_keysyms_jll
import Xorg_xcb_util_jll
import xkbcommon_jll

xcb_include_dir = joinpath(Xorg_libxcb_jll.artifact_dir, "include", "xcb")
xcb_util_dir = joinpath(dirname(dirname(Xorg_xcb_util_jll.libxcb_util_path)), "include", "xcb")
xcb_util_keysims_dir = joinpath(Xorg_xcb_util_keysyms_jll.artifact_dir, "include", "xcb")
xkb_include_dir = joinpath(xkbcommon_jll.artifact_dir, "include", "xkbcommon")
xkb_headers = joinpath.(Ref(xkb_include_dir), ["xkbcommon.h", "xkbcommon-x11.h"])
xcb_headers = [joinpath.(Ref(xcb_include_dir), ["xkb.h"])..., joinpath(xcb_util_keysims_dir, "xcb_keysyms.h"), joinpath(xcb_util_dir, "xcb_event.h")]
xcb_headers = [joinpath.(Ref(xcb_include_dir), ["xkb.h"])..., joinpath(xcb_util_dir, "xcb_event.h")]

# Set up include paths
clang_xcb_includes = [xcb_include_dir, xcb_util_keysims_dir, xcb_util_dir]
clang_xcb_includes = [xcb_include_dir, xcb_util_dir]
clang_xkb_includes = [xkb_include_dir]

# Clang arguments
Expand All @@ -30,8 +28,8 @@ wc_xcb = init(;
clang_includes=clang_xcb_includes,
clang_args=clang_extraargs,
header_wrapped=wrap_header,
header_library=x -> basename(x) == "xcb_keysyms.h" ? "libxcb_keysyms" : basename(x) == "xkb.h" ? "libxcb_xkb" : basename(x) == "xcb_event.h" ? "libxcb_util" : "libxcb",
clang_diagnostics=true,
header_library=x -> basename(x) == "xkb.h" ? "libxcb_xkb" : basename(x) == "xcb_event.h" ? "libxcb_util" : "libxcb",
clang_diagnostics=false,
)
run(wc_xcb)

Expand Down
59 changes: 0 additions & 59 deletions gen/xcb_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4565,65 +4565,6 @@ end
function xcb_xkb_set_debugging_flags_reply(c, cookie, e)
ccall((:xcb_xkb_set_debugging_flags_reply, libxcb_xkb), Ptr{xcb_xkb_set_debugging_flags_reply_t}, (Ptr{xcb_connection_t}, xcb_xkb_set_debugging_flags_cookie_t, Ptr{Ptr{xcb_generic_error_t}}), c, cookie, e)
end
# Julia wrapper for header: xcb_keysyms.h
# Automatically generated using Clang.jl


function xcb_key_symbols_alloc(c)
ccall((:xcb_key_symbols_alloc, libxcb_keysyms), Ptr{xcb_key_symbols_t}, (Ptr{xcb_connection_t},), c)
end

function xcb_key_symbols_free(syms)
ccall((:xcb_key_symbols_free, libxcb_keysyms), Cvoid, (Ptr{xcb_key_symbols_t},), syms)
end

function xcb_key_symbols_get_keysym(syms, keycode, col)
ccall((:xcb_key_symbols_get_keysym, libxcb_keysyms), xcb_keysym_t, (Ptr{xcb_key_symbols_t}, xcb_keycode_t, Cint), syms, keycode, col)
end

function xcb_key_symbols_get_keycode(syms, keysym)
ccall((:xcb_key_symbols_get_keycode, libxcb_keysyms), Ptr{xcb_keycode_t}, (Ptr{xcb_key_symbols_t}, xcb_keysym_t), syms, keysym)
end

function xcb_key_press_lookup_keysym(syms, event, col)
ccall((:xcb_key_press_lookup_keysym, libxcb_keysyms), xcb_keysym_t, (Ptr{xcb_key_symbols_t}, Ptr{xcb_key_press_event_t}, Cint), syms, event, col)
end

function xcb_key_release_lookup_keysym(syms, event, col)
ccall((:xcb_key_release_lookup_keysym, libxcb_keysyms), xcb_keysym_t, (Ptr{xcb_key_symbols_t}, Ptr{xcb_key_release_event_t}, Cint), syms, event, col)
end

function xcb_refresh_keyboard_mapping(syms, event)
ccall((:xcb_refresh_keyboard_mapping, libxcb_keysyms), Cint, (Ptr{xcb_key_symbols_t}, Ptr{xcb_mapping_notify_event_t}), syms, event)
end

function xcb_is_keypad_key(keysym)
ccall((:xcb_is_keypad_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_private_keypad_key(keysym)
ccall((:xcb_is_private_keypad_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_cursor_key(keysym)
ccall((:xcb_is_cursor_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_pf_key(keysym)
ccall((:xcb_is_pf_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_function_key(keysym)
ccall((:xcb_is_function_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_misc_function_key(keysym)
ccall((:xcb_is_misc_function_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end

function xcb_is_modifier_key(keysym)
ccall((:xcb_is_modifier_key, libxcb_keysyms), Cint, (xcb_keysym_t,), keysym)
end
# Julia wrapper for header: xcb_event.h
# Automatically generated using Clang.jl

Expand Down
2 changes: 0 additions & 2 deletions gen/xcb_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5810,8 +5810,6 @@ struct xcb_xkb_extension_device_notify_event_t
pad1::NTuple{2, UInt8}
end

const _XCBKeySymbols = Cvoid
const xcb_key_symbols_t = _XCBKeySymbols
const XCB_EVENT_RESPONSE_TYPE_MASK = Float32(0x07)

# Skipping MacroDefinition: XCB_EVENT_RESPONSE_TYPE ( e ) ( e -> response_type & XCB_EVENT_RESPONSE_TYPE_MASK )
Expand Down

0 comments on commit 6232722

Please sign in to comment.