From 1409f7c2d4e9c86c4aa666210f37f6291228e7f0 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sat, 2 Nov 2024 15:13:31 +0000 Subject: [PATCH] build based on 2e9a506 --- dev/.documenter-siteinfo.json | 2 +- dev/api/index.html | 23 ++++++++++++----------- dev/index.html | 2 +- dev/interface/index.html | 2 +- dev/intro/index.html | 2 +- dev/objects.inv | Bin 662 -> 662 bytes dev/search_index.js | 2 +- dev/troubleshooting/index.html | 2 +- dev/utility/index.html | 2 +- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 086af37..ec755ec 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-29T11:27:07","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-11-02T15:13:26","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index 7d6c440..be12356 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,6 +1,6 @@ -API · XCB.jl

API

XCB.ConnectionType

Connection to the X server.

mutable struct Connection <: XCB.Handle
  • h::Ptr{Nothing}: Opaque handle to the connection, used for API calls.
source
XCB.ConnectionMethod

Initialize a connection to the X server.

Connection(; display) -> Connection
-
source
XCB.ConnectionErrorType

The X Server reported a connection error.

struct ConnectionError <: Exception
  • msg::Any

  • code::Any

source
XCB.FlushErrorType

Error when flushing a connection to the X Server.

struct FlushError <: Exception
  • code::Any
source
XCB.GraphicsContextType

Graphics context attached to a window. Used to register drawing commands on the window surface.

mutable struct GraphicsContext
  • conn::Connection

  • id::UInt32

source
XCB.HandleType

Structures which contain a handle (opaque pointer) as primary data. Those structures are usually defined as mutable so that a finalizer can be registered. Any Handle structure is automatically converted to its handle data on ccalls, through unsafe_convert.

abstract type Handle
source
XCB.RequestErrorType

A request to the X Server returned with an error.

struct RequestError <: Exception
  • msg::Any
source
XCB.SetupType

Connection setup handle and data.

struct Setup <: XCB.Handle
  • h::Ptr{xcb_setup_t}: Handle to the setup, used for API calls.
  • value::xcb_setup_t: Setup value, obtained when dereferencing its handle.
source
XCB.XCBWindowType

Window type used with the XCB API.

mutable struct XCBWindow <: AbstractWindow
  • conn::Connection

  • id::UInt32

  • screen::xcb_screen_t

  • delete_request::UInt32

  • gc::Union{Nothing, GraphicsContext}

source
XCB.XCBWindowMethod

Create a new window on the provided screen.

XCBWindow(
+API · XCB.jl

API

XCB.ConnectionType

Connection to the X server.

mutable struct Connection <: XCB.Handle
  • h::Ptr{Nothing}: Opaque handle to the connection, used for API calls.
source
XCB.ConnectionMethod

Initialize a connection to the X server.

Connection(; display) -> Connection
+
source
XCB.ConnectionErrorType

The X Server reported a connection error.

struct ConnectionError <: Exception
  • msg::Any

  • code::Any

source
XCB.FlushErrorType

Error when flushing a connection to the X Server.

struct FlushError <: Exception
  • code::Any
source
XCB.GraphicsContextType

Graphics context attached to a window. Used to register drawing commands on the window surface.

mutable struct GraphicsContext
  • conn::Connection

  • id::UInt32

source
XCB.HandleType

Structures which contain a handle (opaque pointer) as primary data. Those structures are usually defined as mutable so that a finalizer can be registered. Any Handle structure is automatically converted to its handle data on ccalls, through unsafe_convert.

abstract type Handle
source
XCB.RequestErrorType

A request to the X Server returned with an error.

struct RequestError <: Exception
  • msg::Any
source
XCB.SetupType

Connection setup handle and data.

struct Setup <: XCB.Handle
  • h::Ptr{xcb_setup_t}: Handle to the setup, used for API calls.
  • value::xcb_setup_t: Setup value, obtained when dereferencing its handle.
source
XCB.XCBWindowType

Window type used with the XCB API.

mutable struct XCBWindow <: AbstractWindow
  • conn::Connection

  • id::UInt32

  • screen::xcb_screen_t

  • delete_request::UInt32

  • gc::Union{Nothing, GraphicsContext}

source
XCB.XCBWindowMethod

Create a new window on the provided screen.

XCBWindow(
     conn,
     screen::xcb_screen_t;
     depth,
@@ -14,17 +14,18 @@
     icon_title,
     map,
     attributes,
-    values
+    values,
+    with_decorations
 ) -> XCBWindow
-
source
XCB.XCBWindowMethod

Create a new window on the current screen.

XCBWindow(conn::Connection; kwargs...) -> XCBWindow
-
source
XCB.checkMethod

Check that the connection to the X server was successful. Throws a ConnectionError if the connection failed.

check(connection::Connection) -> Connection
-
source
XCB.check_requestMethod

Check that the request was successfully handled by the server, throwing a RequestError if the request failed.

The severity level can be set via level with one of the two following values:

- `:warn`: logs a warning with `@warn` (default).
+
source
XCB.XCBWindowMethod

Create a new window on the current screen.

XCBWindow(conn::Connection; kwargs...) -> XCBWindow
+
source
XCB.checkMethod

Check that the connection to the X server was successful. Throws a ConnectionError if the connection failed.

check(connection::Connection) -> Connection
+
source
XCB.check_requestMethod

Check that the request was successfully handled by the server, throwing a RequestError if the request failed.

The severity level can be set via level with one of the two following values:

- `:warn`: logs a warning with `@warn` (default).
 - `:error`: raise a `RequestError`.
check_request(conn, request; level)
-
source
XCB.state_xcbMethod

Translate mouse or modifier state into the corresponding XCB value.

state_xcb(event::Event) -> Any
-
source
XCB.@checkMacro

Check the value returned by the function call request with check_request.

The severity level (:error or :warn) can be supplied as first argument. By default, the severity level is :warn.

Wraps request with check_request. The Connection argument is taken as the first argument of the function call expression request. The request is transformed to be checkable, through the functions xcb*checked (or xcb* if there exists a xcb*_unchecked version). If no checkable substitute is found, an ArgumentError is raised.

TODO: @macroexpand example

source
XCB.@flushMacro

Flush a connection attached to a request expr.

The connection is taken to be the first argument of expr. expr can be a call to XCB.@check.

Examples

julia> @macroexpand @flush xcb_unmap_window(win.conn, win.id)
+
source
XCB.state_xcbMethod

Translate mouse or modifier state into the corresponding XCB value.

state_xcb(event::Event) -> Any
+
source
XCB.@checkMacro

Check the value returned by the function call request with check_request.

The severity level (:error or :warn) can be supplied as first argument. By default, the severity level is :warn.

Wraps request with check_request. The Connection argument is taken as the first argument of the function call expression request. The request is transformed to be checkable, through the functions xcb*checked (or xcb* if there exists a xcb*_unchecked version). If no checkable substitute is found, an ArgumentError is raised.

TODO: @macroexpand example

source
XCB.@flushMacro

Flush a connection attached to a request expr.

The connection is taken to be the first argument of expr. expr can be a call to XCB.@check.

Examples

julia> @macroexpand @flush xcb_unmap_window(win.conn, win.id)
 quote
     xcb_unmap_window(win.conn, win.id)
     (flush)(win.conn)
-end
source
+end
source
diff --git a/dev/index.html b/dev/index.html index 36725d6..c020b60 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · XCB.jl

XCB.jl

This package wraps the XCB library and exposes bindings for the WindowAbstractions.jl package.

The core API was generated with Clang.jl, from which abstractions were derived.

If you want to use a high-level windowing API, you should see the documentation for the WindowAbstractions package. This documentation is aimed at developers who want to know more about XCB-specific utilities that this package exposes. It also contains a developer documentation, which covers the implementation of the WindowAbstractions interface among other things.

+Home · XCB.jl

XCB.jl

This package wraps the XCB library and exposes bindings for the WindowAbstractions.jl package.

The core API was generated with Clang.jl, from which abstractions were derived.

If you want to use a high-level windowing API, you should see the documentation for the WindowAbstractions package. This documentation is aimed at developers who want to know more about XCB-specific utilities that this package exposes. It also contains a developer documentation, which covers the implementation of the WindowAbstractions interface among other things.

diff --git a/dev/interface/index.html b/dev/interface/index.html index 76dcd63..f74e19e 100644 --- a/dev/interface/index.html +++ b/dev/interface/index.html @@ -1,2 +1,2 @@ -WindowAbstractions Interface · XCB.jl

WindowAbstractions Interface

Events

A large portion of this package is dedicated to handling the events reported by the X server and interfacing them into Event instances.

In order to receive events from the server, we need to tell the X server which types of event we want to be reported. This is done per-window, at their instantiation, through so-called event masks. Currently, all events are included by default; if this proves to be a source of performance issues, this may be revisited in the future.

Input events

Input events can be classified into different types:

  • Key events which are generated by pressing or releasing a key from a keyboard,
  • Mouse events originating from pressing or releasing mouse buttons,
  • Pointer events such as moving out of or entering a window with the pointer, or moving around inside the window.

Although drag actions are technically just of combination of mouse state and pointer events, they are reported as separate events.

Key events

X and XCB do not offer much keystroke-related utilities, unless we look at some extensions such as XKB, which was used here for processing key inputs. It allows the storage of keyboard and keymap states, as well as functions to translate keystrokes into characters. The input processing is performed using XKB via XKeyboard.jl.

Mouse events

It is a lot simpler to handle mouse events. Mouse state (e.g. which buttons were already pressed before the current mouse event) and pressed/released buttons are simply extracted from related X events, exposed in XCB via xcb_button_press_release_event_t and xcb_button_release_event_t.

Pointer events

Pointer events are handled similarly to mouse events. Moving the pointer in the window, as well as leaving or entering it send a X event from which the relevant data is extracted.

+WindowAbstractions Interface · XCB.jl

WindowAbstractions Interface

Events

A large portion of this package is dedicated to handling the events reported by the X server and interfacing them into Event instances.

In order to receive events from the server, we need to tell the X server which types of event we want to be reported. This is done per-window, at their instantiation, through so-called event masks. Currently, all events are included by default; if this proves to be a source of performance issues, this may be revisited in the future.

Input events

Input events can be classified into different types:

  • Key events which are generated by pressing or releasing a key from a keyboard,
  • Mouse events originating from pressing or releasing mouse buttons,
  • Pointer events such as moving out of or entering a window with the pointer, or moving around inside the window.

Although drag actions are technically just of combination of mouse state and pointer events, they are reported as separate events.

Key events

X and XCB do not offer much keystroke-related utilities, unless we look at some extensions such as XKB, which was used here for processing key inputs. It allows the storage of keyboard and keymap states, as well as functions to translate keystrokes into characters. The input processing is performed using XKB via XKeyboard.jl.

Mouse events

It is a lot simpler to handle mouse events. Mouse state (e.g. which buttons were already pressed before the current mouse event) and pressed/released buttons are simply extracted from related X events, exposed in XCB via xcb_button_press_release_event_t and xcb_button_release_event_t.

Pointer events

Pointer events are handled similarly to mouse events. Moving the pointer in the window, as well as leaving or entering it send a X event from which the relevant data is extracted.

diff --git a/dev/intro/index.html b/dev/intro/index.html index 746dbd3..ad56c67 100644 --- a/dev/intro/index.html +++ b/dev/intro/index.html @@ -1,2 +1,2 @@ -Introduction · XCB.jl

Introduction

XCB is a windowing API bound to the X Server and the X11 protocol on Unix-based systems. It simplifies the older X library that was traditionally used for interacting with the X Server.

+Introduction · XCB.jl

Introduction

XCB is a windowing API bound to the X Server and the X11 protocol on Unix-based systems. It simplifies the older X library that was traditionally used for interacting with the X Server.

diff --git a/dev/objects.inv b/dev/objects.inv index e6fd8eb71519e2c44f64c5a38590b872a69621c7..cdf447f429b449fe67e93539b582ebcaab0a6397 100644 GIT binary patch delta 12 TcmbQnI*oOL9i!Ps`*0=z7|R2N delta 12 TcmbQnI*oOL9i!<+`*0=z7{&vH diff --git a/dev/search_index.js b/dev/search_index.js index ac67739..dfd7b41 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"utility/#Utility-tools","page":"Utility tools","title":"Utility tools","text":"","category":"section"},{"location":"utility/#Visualizing-X-events","page":"Utility tools","title":"Visualizing X events","text":"","category":"section"},{"location":"utility/","page":"Utility tools","title":"Utility tools","text":"xev is a command-line tool that setups a toy window and prints all incoming X events. It is a very useful tool to experiment with when trying to determine which events are sent upon which actions.","category":"page"},{"location":"utility/#Keyboard-configuration","page":"Utility tools","title":"Keyboard configuration","text":"","category":"section"},{"location":"utility/","page":"Utility tools","title":"Utility tools","text":"xmodmap allows one to query information about various input-related keyboard elements. Notably, it lists all the keycodes and corresponding key symbols as interpreted by the X Server.","category":"page"},{"location":"api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/","page":"API","title":"API","text":"Modules = [XCB]\nPrivate = true","category":"page"},{"location":"api/#XCB.Connection","page":"API","title":"XCB.Connection","text":"Connection to the X server.\n\nmutable struct Connection <: XCB.Handle\n\nh::Ptr{Nothing}: Opaque handle to the connection, used for API calls.\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Connection-Tuple{}","page":"API","title":"XCB.Connection","text":"Initialize a connection to the X server.\n\nConnection(; display) -> Connection\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.ConnectionError","page":"API","title":"XCB.ConnectionError","text":"The X Server reported a connection error.\n\nstruct ConnectionError <: Exception\n\nmsg::Any\ncode::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.FlushError","page":"API","title":"XCB.FlushError","text":"Error when flushing a connection to the X Server.\n\nstruct FlushError <: Exception\n\ncode::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.GraphicsContext","page":"API","title":"XCB.GraphicsContext","text":"Graphics context attached to a window. Used to register drawing commands on the window surface.\n\nmutable struct GraphicsContext\n\nconn::Connection\nid::UInt32\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Handle","page":"API","title":"XCB.Handle","text":"Structures which contain a handle (opaque pointer) as primary data. Those structures are usually defined as mutable so that a finalizer can be registered. Any Handle structure is automatically converted to its handle data on ccalls, through unsafe_convert.\n\nabstract type Handle\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.RequestError","page":"API","title":"XCB.RequestError","text":"A request to the X Server returned with an error.\n\nstruct RequestError <: Exception\n\nmsg::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Setup","page":"API","title":"XCB.Setup","text":"Connection setup handle and data.\n\nstruct Setup <: XCB.Handle\n\nh::Ptr{xcb_setup_t}: Handle to the setup, used for API calls.\n\nvalue::xcb_setup_t: Setup value, obtained when dereferencing its handle.\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.XCBWindow","page":"API","title":"XCB.XCBWindow","text":"Window type used with the XCB API.\n\nmutable struct XCBWindow <: AbstractWindow\n\nconn::Connection\nid::UInt32\nscreen::xcb_screen_t\ndelete_request::UInt32\ngc::Union{Nothing, GraphicsContext}\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.XCBWindow-Tuple{Any, xcb_screen_t}","page":"API","title":"XCB.XCBWindow","text":"Create a new window on the provided screen.\n\nXCBWindow(\n conn,\n screen::xcb_screen_t;\n depth,\n x,\n y,\n width,\n height,\n border_width,\n class,\n window_title,\n icon_title,\n map,\n attributes,\n values\n) -> XCBWindow\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.XCBWindow-Tuple{Connection}","page":"API","title":"XCB.XCBWindow","text":"Create a new window on the current screen.\n\nXCBWindow(conn::Connection; kwargs...) -> XCBWindow\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check-Tuple{Connection}","page":"API","title":"XCB.check","text":"Check that the connection to the X server was successful. Throws a ConnectionError if the connection failed.\n\ncheck(connection::Connection) -> Connection\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check_flush-Tuple{Any}","page":"API","title":"XCB.check_flush","text":"Check that the flush was successful, throwing a FlushError if the code is negative.\n\ncheck_flush(code)\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check_request-Tuple{Any, Any}","page":"API","title":"XCB.check_request","text":"Check that the request was successfully handled by the server, throwing a RequestError if the request failed.\n\nThe severity level can be set via level with one of the two following values:\n\n- `:warn`: logs a warning with `@warn` (default).\n- `:error`: raise a `RequestError`.\n\ncheck_request(conn, request; level)\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.response_type_xcb-Tuple{Event}","page":"API","title":"XCB.response_type_xcb","text":"Translate an action into its corresponding XCB value.\n\nresponse_type_xcb(event::Event) -> Int64\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.state_xcb-Tuple{Event}","page":"API","title":"XCB.state_xcb","text":"Translate mouse or modifier state into the corresponding XCB value.\n\nstate_xcb(event::Event) -> Any\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.@check-Tuple{Any, Any}","page":"API","title":"XCB.@check","text":"Check the value returned by the function call request with check_request.\n\nThe severity level (:error or :warn) can be supplied as first argument. By default, the severity level is :warn.\n\nWraps request with check_request. The Connection argument is taken as the first argument of the function call expression request. The request is transformed to be checkable, through the functions xcb*checked (or xcb* if there exists a xcb*_unchecked version). If no checkable substitute is found, an ArgumentError is raised.\n\nTODO: @macroexpand example\n\n\n\n\n\n","category":"macro"},{"location":"api/#XCB.@flush-Tuple{Any}","page":"API","title":"XCB.@flush","text":"Flush a connection attached to a request expr.\n\nThe connection is taken to be the first argument of expr. expr can be a call to XCB.@check.\n\nExamples\n\njulia> @macroexpand @flush xcb_unmap_window(win.conn, win.id)\nquote\n xcb_unmap_window(win.conn, win.id)\n (flush)(win.conn)\nend\n\n\n\n\n\n","category":"macro"},{"location":"intro/#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"intro/","page":"Introduction","title":"Introduction","text":"XCB is a windowing API bound to the X Server and the X11 protocol on Unix-based systems. It simplifies the older X library that was traditionally used for interacting with the X Server.","category":"page"},{"location":"interface/#interface","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"","category":"section"},{"location":"interface/#Events","page":"WindowAbstractions Interface","title":"Events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"A large portion of this package is dedicated to handling the events reported by the X server and interfacing them into Event instances.","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"In order to receive events from the server, we need to tell the X server which types of event we want to be reported. This is done per-window, at their instantiation, through so-called event masks. Currently, all events are included by default; if this proves to be a source of performance issues, this may be revisited in the future.","category":"page"},{"location":"interface/#Input-events","page":"WindowAbstractions Interface","title":"Input events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Input events can be classified into different types:","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Key events which are generated by pressing or releasing a key from a keyboard,\nMouse events originating from pressing or releasing mouse buttons,\nPointer events such as moving out of or entering a window with the pointer, or moving around inside the window.","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Although drag actions are technically just of combination of mouse state and pointer events, they are reported as separate events.","category":"page"},{"location":"interface/#Key-events","page":"WindowAbstractions Interface","title":"Key events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"X and XCB do not offer much keystroke-related utilities, unless we look at some extensions such as XKB, which was used here for processing key inputs. It allows the storage of keyboard and keymap states, as well as functions to translate keystrokes into characters. The input processing is performed using XKB via XKeyboard.jl.","category":"page"},{"location":"interface/#Mouse-events","page":"WindowAbstractions Interface","title":"Mouse events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"It is a lot simpler to handle mouse events. Mouse state (e.g. which buttons were already pressed before the current mouse event) and pressed/released buttons are simply extracted from related X events, exposed in XCB via xcb_button_press_release_event_t and xcb_button_release_event_t.","category":"page"},{"location":"interface/#Pointer-events","page":"WindowAbstractions Interface","title":"Pointer events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Pointer events are handled similarly to mouse events. Moving the pointer in the window, as well as leaving or entering it send a X event from which the relevant data is extracted.","category":"page"},{"location":"troubleshooting/#Troubleshooting","page":"Troubleshooting","title":"Troubleshooting","text":"","category":"section"},{"location":"troubleshooting/#ConnectionError","page":"Troubleshooting","title":"ConnectionError","text":"","category":"section"},{"location":"troubleshooting/","page":"Troubleshooting","title":"Troubleshooting","text":"If the X Server returns an error when establishing a connection, an exception of type ConnectionError is raised. One common source of error is a badly set DISPLAY environment variable. Common values are :0 or :1.","category":"page"},{"location":"#XCB.jl","page":"Home","title":"XCB.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package wraps the XCB library and exposes bindings for the WindowAbstractions.jl package.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The core API was generated with Clang.jl, from which abstractions were derived.","category":"page"},{"location":"","page":"Home","title":"Home","text":"If you want to use a high-level windowing API, you should see the documentation for the WindowAbstractions package. This documentation is aimed at developers who want to know more about XCB-specific utilities that this package exposes. It also contains a developer documentation, which covers the implementation of the WindowAbstractions interface among other things.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Pages = [\"intro.md\", \"api.md\", \"troubleshooting.md\", \"developer.md\"]","category":"page"}] +[{"location":"utility/#Utility-tools","page":"Utility tools","title":"Utility tools","text":"","category":"section"},{"location":"utility/#Visualizing-X-events","page":"Utility tools","title":"Visualizing X events","text":"","category":"section"},{"location":"utility/","page":"Utility tools","title":"Utility tools","text":"xev is a command-line tool that setups a toy window and prints all incoming X events. It is a very useful tool to experiment with when trying to determine which events are sent upon which actions.","category":"page"},{"location":"utility/#Keyboard-configuration","page":"Utility tools","title":"Keyboard configuration","text":"","category":"section"},{"location":"utility/","page":"Utility tools","title":"Utility tools","text":"xmodmap allows one to query information about various input-related keyboard elements. Notably, it lists all the keycodes and corresponding key symbols as interpreted by the X Server.","category":"page"},{"location":"api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/","page":"API","title":"API","text":"Modules = [XCB]\nPrivate = true","category":"page"},{"location":"api/#XCB.Connection","page":"API","title":"XCB.Connection","text":"Connection to the X server.\n\nmutable struct Connection <: XCB.Handle\n\nh::Ptr{Nothing}: Opaque handle to the connection, used for API calls.\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Connection-Tuple{}","page":"API","title":"XCB.Connection","text":"Initialize a connection to the X server.\n\nConnection(; display) -> Connection\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.ConnectionError","page":"API","title":"XCB.ConnectionError","text":"The X Server reported a connection error.\n\nstruct ConnectionError <: Exception\n\nmsg::Any\ncode::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.FlushError","page":"API","title":"XCB.FlushError","text":"Error when flushing a connection to the X Server.\n\nstruct FlushError <: Exception\n\ncode::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.GraphicsContext","page":"API","title":"XCB.GraphicsContext","text":"Graphics context attached to a window. Used to register drawing commands on the window surface.\n\nmutable struct GraphicsContext\n\nconn::Connection\nid::UInt32\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Handle","page":"API","title":"XCB.Handle","text":"Structures which contain a handle (opaque pointer) as primary data. Those structures are usually defined as mutable so that a finalizer can be registered. Any Handle structure is automatically converted to its handle data on ccalls, through unsafe_convert.\n\nabstract type Handle\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.RequestError","page":"API","title":"XCB.RequestError","text":"A request to the X Server returned with an error.\n\nstruct RequestError <: Exception\n\nmsg::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.Setup","page":"API","title":"XCB.Setup","text":"Connection setup handle and data.\n\nstruct Setup <: XCB.Handle\n\nh::Ptr{xcb_setup_t}: Handle to the setup, used for API calls.\n\nvalue::xcb_setup_t: Setup value, obtained when dereferencing its handle.\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.XCBWindow","page":"API","title":"XCB.XCBWindow","text":"Window type used with the XCB API.\n\nmutable struct XCBWindow <: AbstractWindow\n\nconn::Connection\nid::UInt32\nscreen::xcb_screen_t\ndelete_request::UInt32\ngc::Union{Nothing, GraphicsContext}\n\n\n\n\n\n","category":"type"},{"location":"api/#XCB.XCBWindow-Tuple{Any, xcb_screen_t}","page":"API","title":"XCB.XCBWindow","text":"Create a new window on the provided screen.\n\nXCBWindow(\n conn,\n screen::xcb_screen_t;\n depth,\n x,\n y,\n width,\n height,\n border_width,\n class,\n window_title,\n icon_title,\n map,\n attributes,\n values,\n with_decorations\n) -> XCBWindow\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.XCBWindow-Tuple{Connection}","page":"API","title":"XCB.XCBWindow","text":"Create a new window on the current screen.\n\nXCBWindow(conn::Connection; kwargs...) -> XCBWindow\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check-Tuple{Connection}","page":"API","title":"XCB.check","text":"Check that the connection to the X server was successful. Throws a ConnectionError if the connection failed.\n\ncheck(connection::Connection) -> Connection\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check_flush-Tuple{Any}","page":"API","title":"XCB.check_flush","text":"Check that the flush was successful, throwing a FlushError if the code is negative.\n\ncheck_flush(code)\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.check_request-Tuple{Any, Any}","page":"API","title":"XCB.check_request","text":"Check that the request was successfully handled by the server, throwing a RequestError if the request failed.\n\nThe severity level can be set via level with one of the two following values:\n\n- `:warn`: logs a warning with `@warn` (default).\n- `:error`: raise a `RequestError`.\n\ncheck_request(conn, request; level)\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.response_type_xcb-Tuple{Event}","page":"API","title":"XCB.response_type_xcb","text":"Translate an action into its corresponding XCB value.\n\nresponse_type_xcb(event::Event) -> Int64\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.state_xcb-Tuple{Event}","page":"API","title":"XCB.state_xcb","text":"Translate mouse or modifier state into the corresponding XCB value.\n\nstate_xcb(event::Event) -> Any\n\n\n\n\n\n\n","category":"method"},{"location":"api/#XCB.@check-Tuple{Any, Any}","page":"API","title":"XCB.@check","text":"Check the value returned by the function call request with check_request.\n\nThe severity level (:error or :warn) can be supplied as first argument. By default, the severity level is :warn.\n\nWraps request with check_request. The Connection argument is taken as the first argument of the function call expression request. The request is transformed to be checkable, through the functions xcb*checked (or xcb* if there exists a xcb*_unchecked version). If no checkable substitute is found, an ArgumentError is raised.\n\nTODO: @macroexpand example\n\n\n\n\n\n","category":"macro"},{"location":"api/#XCB.@flush-Tuple{Any}","page":"API","title":"XCB.@flush","text":"Flush a connection attached to a request expr.\n\nThe connection is taken to be the first argument of expr. expr can be a call to XCB.@check.\n\nExamples\n\njulia> @macroexpand @flush xcb_unmap_window(win.conn, win.id)\nquote\n xcb_unmap_window(win.conn, win.id)\n (flush)(win.conn)\nend\n\n\n\n\n\n","category":"macro"},{"location":"intro/#Introduction","page":"Introduction","title":"Introduction","text":"","category":"section"},{"location":"intro/","page":"Introduction","title":"Introduction","text":"XCB is a windowing API bound to the X Server and the X11 protocol on Unix-based systems. It simplifies the older X library that was traditionally used for interacting with the X Server.","category":"page"},{"location":"interface/#interface","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"","category":"section"},{"location":"interface/#Events","page":"WindowAbstractions Interface","title":"Events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"A large portion of this package is dedicated to handling the events reported by the X server and interfacing them into Event instances.","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"In order to receive events from the server, we need to tell the X server which types of event we want to be reported. This is done per-window, at their instantiation, through so-called event masks. Currently, all events are included by default; if this proves to be a source of performance issues, this may be revisited in the future.","category":"page"},{"location":"interface/#Input-events","page":"WindowAbstractions Interface","title":"Input events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Input events can be classified into different types:","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Key events which are generated by pressing or releasing a key from a keyboard,\nMouse events originating from pressing or releasing mouse buttons,\nPointer events such as moving out of or entering a window with the pointer, or moving around inside the window.","category":"page"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Although drag actions are technically just of combination of mouse state and pointer events, they are reported as separate events.","category":"page"},{"location":"interface/#Key-events","page":"WindowAbstractions Interface","title":"Key events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"X and XCB do not offer much keystroke-related utilities, unless we look at some extensions such as XKB, which was used here for processing key inputs. It allows the storage of keyboard and keymap states, as well as functions to translate keystrokes into characters. The input processing is performed using XKB via XKeyboard.jl.","category":"page"},{"location":"interface/#Mouse-events","page":"WindowAbstractions Interface","title":"Mouse events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"It is a lot simpler to handle mouse events. Mouse state (e.g. which buttons were already pressed before the current mouse event) and pressed/released buttons are simply extracted from related X events, exposed in XCB via xcb_button_press_release_event_t and xcb_button_release_event_t.","category":"page"},{"location":"interface/#Pointer-events","page":"WindowAbstractions Interface","title":"Pointer events","text":"","category":"section"},{"location":"interface/","page":"WindowAbstractions Interface","title":"WindowAbstractions Interface","text":"Pointer events are handled similarly to mouse events. Moving the pointer in the window, as well as leaving or entering it send a X event from which the relevant data is extracted.","category":"page"},{"location":"troubleshooting/#Troubleshooting","page":"Troubleshooting","title":"Troubleshooting","text":"","category":"section"},{"location":"troubleshooting/#ConnectionError","page":"Troubleshooting","title":"ConnectionError","text":"","category":"section"},{"location":"troubleshooting/","page":"Troubleshooting","title":"Troubleshooting","text":"If the X Server returns an error when establishing a connection, an exception of type ConnectionError is raised. One common source of error is a badly set DISPLAY environment variable. Common values are :0 or :1.","category":"page"},{"location":"#XCB.jl","page":"Home","title":"XCB.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This package wraps the XCB library and exposes bindings for the WindowAbstractions.jl package.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The core API was generated with Clang.jl, from which abstractions were derived.","category":"page"},{"location":"","page":"Home","title":"Home","text":"If you want to use a high-level windowing API, you should see the documentation for the WindowAbstractions package. This documentation is aimed at developers who want to know more about XCB-specific utilities that this package exposes. It also contains a developer documentation, which covers the implementation of the WindowAbstractions interface among other things.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Pages = [\"intro.md\", \"api.md\", \"troubleshooting.md\", \"developer.md\"]","category":"page"}] } diff --git a/dev/troubleshooting/index.html b/dev/troubleshooting/index.html index 4ffd8fb..4c2f11c 100644 --- a/dev/troubleshooting/index.html +++ b/dev/troubleshooting/index.html @@ -1,2 +1,2 @@ -Troubleshooting · XCB.jl

Troubleshooting

ConnectionError

If the X Server returns an error when establishing a connection, an exception of type ConnectionError is raised. One common source of error is a badly set DISPLAY environment variable. Common values are :0 or :1.

+Troubleshooting · XCB.jl

Troubleshooting

ConnectionError

If the X Server returns an error when establishing a connection, an exception of type ConnectionError is raised. One common source of error is a badly set DISPLAY environment variable. Common values are :0 or :1.

diff --git a/dev/utility/index.html b/dev/utility/index.html index 100692a..bcf9e99 100644 --- a/dev/utility/index.html +++ b/dev/utility/index.html @@ -1,2 +1,2 @@ -Utility tools · XCB.jl

Utility tools

Visualizing X events

xev is a command-line tool that setups a toy window and prints all incoming X events. It is a very useful tool to experiment with when trying to determine which events are sent upon which actions.

Keyboard configuration

xmodmap allows one to query information about various input-related keyboard elements. Notably, it lists all the keycodes and corresponding key symbols as interpreted by the X Server.

+Utility tools · XCB.jl

Utility tools

Visualizing X events

xev is a command-line tool that setups a toy window and prints all incoming X events. It is a very useful tool to experiment with when trying to determine which events are sent upon which actions.

Keyboard configuration

xmodmap allows one to query information about various input-related keyboard elements. Notably, it lists all the keycodes and corresponding key symbols as interpreted by the X Server.