From 3a397337db0fcaff8e5e765630b49fe6996eee3e Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 22 Aug 2024 16:57:14 +0000 Subject: [PATCH] build based on baadaa0 --- dev/.documenter-siteinfo.json | 2 +- dev/api/index.html | 22 +++++++------- dev/assets/documenter.js | 53 +++++++++++++++++++--------------- dev/index.html | 2 +- dev/interface/index.html | 2 +- dev/intro/index.html | 2 +- dev/troubleshooting/index.html | 2 +- dev/utility/index.html | 2 +- 8 files changed, 46 insertions(+), 41 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 179f8b8..b171b57 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-18T10:07:05","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-22T16:57:11","documenter_version":"1.6.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index f07a8ef..497f2d4 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

  • parent_id::UInt32

  • visual_id::UInt32

  • delete_request::UInt32

  • gc::Union{Nothing, GraphicsContext}

source
XCB.XCBWindowMethod

Create a new window whose parent is given by parent_id and visual by visual_id.

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

  • parent_id::UInt32

  • visual_id::UInt32

  • delete_request::UInt32

  • gc::Union{Nothing, GraphicsContext}

source
XCB.XCBWindowMethod

Create a new window whose parent is given by parent_id and visual by visual_id.

XCBWindow(
     conn,
     parent_id,
     visual_id;
@@ -17,18 +17,18 @@
     attributes,
     values
 ) -> XCBWindow
-
source
XCB.XCBWindowMethod

Create a new window on the provided screen.

XCBWindow(conn::Connection, screen; kwargs...) -> 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 provided screen.

XCBWindow(conn::Connection, screen; kwargs...) -> 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).
 - `: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(
+
source
XCB.state_xcbMethod

Translate mouse or modifier state into the corresponding XCB value.

state_xcb(
     event::Event
 ) -> Union{Int64, UInt64, xcb_mod_mask_t}
-
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.@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/assets/documenter.js b/dev/assets/documenter.js index b2bdd43..82252a1 100644 --- a/dev/assets/documenter.js +++ b/dev/assets/documenter.js @@ -77,30 +77,35 @@ require(['jquery'], function($) { let timer = 0; var isExpanded = true; -$(document).on("click", ".docstring header", function () { - let articleToggleTitle = "Expand docstring"; - - debounce(() => { - if ($(this).siblings("section").is(":visible")) { - $(this) - .find(".docstring-article-toggle-button") - .removeClass("fa-chevron-down") - .addClass("fa-chevron-right"); - } else { - $(this) - .find(".docstring-article-toggle-button") - .removeClass("fa-chevron-right") - .addClass("fa-chevron-down"); +$(document).on( + "click", + ".docstring .docstring-article-toggle-button", + function () { + let articleToggleTitle = "Expand docstring"; + const parent = $(this).parent(); + + debounce(() => { + if (parent.siblings("section").is(":visible")) { + parent + .find("a.docstring-article-toggle-button") + .removeClass("fa-chevron-down") + .addClass("fa-chevron-right"); + } else { + parent + .find("a.docstring-article-toggle-button") + .removeClass("fa-chevron-right") + .addClass("fa-chevron-down"); - articleToggleTitle = "Collapse docstring"; - } + articleToggleTitle = "Collapse docstring"; + } - $(this) - .find(".docstring-article-toggle-button") - .prop("title", articleToggleTitle); - $(this).siblings("section").slideToggle(); - }); -}); + parent + .children(".docstring-article-toggle-button") + .prop("title", articleToggleTitle); + parent.siblings("section").slideToggle(); + }); + } +); $(document).on("click", ".docs-article-toggle-button", function (event) { let articleToggleTitle = "Expand docstring"; @@ -110,7 +115,7 @@ $(document).on("click", ".docs-article-toggle-button", function (event) { debounce(() => { if (isExpanded) { $(this).removeClass("fa-chevron-up").addClass("fa-chevron-down"); - $(".docstring-article-toggle-button") + $("a.docstring-article-toggle-button") .removeClass("fa-chevron-down") .addClass("fa-chevron-right"); @@ -119,7 +124,7 @@ $(document).on("click", ".docs-article-toggle-button", function (event) { $(".docstring section").slideUp(animationSpeed); } else { $(this).removeClass("fa-chevron-down").addClass("fa-chevron-up"); - $(".docstring-article-toggle-button") + $("a.docstring-article-toggle-button") .removeClass("fa-chevron-right") .addClass("fa-chevron-down"); diff --git a/dev/index.html b/dev/index.html index 054a79e..d710412 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 a1057b3..6b2cbc5 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 f33b46c..810e2ad 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/troubleshooting/index.html b/dev/troubleshooting/index.html index e54c136..2de372c 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 e094812..0c1e2f6 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.