wlmaker
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
wlclient.h File Reference
#include <inttypes.h>
#include <stdbool.h>
#include <wayland-server-core.h>
#include <xkbcommon/xkbcommon.h>
Include dependency graph for wlclient.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wlmcl_client_attributes
 
struct  wlmcl_client_events
 
struct  wlmcl_client_key_event
 

Typedefs

typedef struct _wlmcl_client_t wlmcl_client_t
 
typedef void(* wlmcl_client_callback_t) (wlmcl_client_t *wlmcl_client_ptr, void *ud_ptr)
 

Functions

wlmcl_client_t * wlmcl_client_create (const char *app_id_ptr)
 
void wlmcl_client_destroy (wlmcl_client_t *wlmcl_client_ptr)
 
struct wlmcl_client_interface * wlmcl_client_register_interface (wlmcl_client_t *client_ptr, const struct wl_interface *wl_interface_ptr, uint32_t desired_version, bool required, void(*setup)(void *bound_interface_ptr, void *userdata_ptr), void *userdata_ptr)
 
bool wlmcl_client_initialize (wlmcl_client_t *client_ptr)
 
struct xkb_keymap * wlmcl_client_get_keymap (wlmcl_client_t *wlmcl_client_ptr)
 
bool wlmcl_client_get_repeat_info (wlmcl_client_t *wlmcl_client_ptr, int32_t *rate_ptr, int32_t *delay_ptr)
 
const struct wlmcl_client_attributes * wlmcl_client_attributes (const wlmcl_client_t *wlmcl_client_ptr)
 
struct wlmcl_client_events * wlmcl_client_events (wlmcl_client_t *wlmcl_client_ptr)
 
int wlmcl_client_signal_fd (wlmcl_client_t *wlmcl_client_ptr)
 
void wlmcl_client_run (wlmcl_client_t *wlmcl_client_ptr)
 
void wlmcl_client_request_terminate (wlmcl_client_t *wlmcl_client_ptr)
 
bool wlmcl_client_register_timer (wlmcl_client_t *wlmcl_client_ptr, uint64_t target_usec, wlmcl_client_callback_t callback, void *callback_ud_ptr)
 

Detailed Description

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ wlmcl_client_callback_t

typedef void(* wlmcl_client_callback_t) (wlmcl_client_t *wlmcl_client_ptr, void *ud_ptr)

A client's callback, as used in wlmcl_client_register_timer.

Parameters
wlmcl_client_ptr
ud_ptr

◆ wlmcl_client_t

Forward declaration: Wayland client handle.

Function Documentation

◆ wlmcl_client_attributes()

const struct wlmcl_client_attributes * wlmcl_client_attributes ( const wlmcl_client_t *  wlmcl_client_ptr)

Gets the client attributes.

Parameters
wlmcl_client_ptr
Returns
A pointer to the attributes.

◆ wlmcl_client_create()

wlmcl_client_t * wlmcl_client_create ( const char *  app_id_ptr)

Creates a wayland client for simple buffer interactions.

Parameters
app_id_ptrApplication ID or NULL if not set.
Returns
The client state, or NULL on error. The state needs to be free'd via wlmcl_client_destroy.

◆ wlmcl_client_destroy()

void wlmcl_client_destroy ( wlmcl_client_t *  wlmcl_client_ptr)

Destroys the wayland client, as created by wlmcl_client_create.

Parameters
wlmcl_client_ptr

◆ wlmcl_client_events()

struct wlmcl_client_events * wlmcl_client_events ( wlmcl_client_t *  wlmcl_client_ptr)
Returns
A pointer to wlmcl_client_t::events.

◆ wlmcl_client_get_keymap()

struct xkb_keymap * wlmcl_client_get_keymap ( wlmcl_client_t *  wlmcl_client_ptr)

Gets the active keymap of the client.

Parameters
wlmcl_client_ptr
Returns
Pointer to struct xkb_keymap or NULL if not set.

◆ wlmcl_client_get_repeat_info()

bool wlmcl_client_get_repeat_info ( wlmcl_client_t *  wlmcl_client_ptr,
int32_t *  rate_ptr,
int32_t *  delay_ptr 
)

Gets keyboard repeat information.

Parameters
wlmcl_client_ptr
rate_ptr
delay_ptr
Returns
false, if repat_info has not been set by the compositor yet.

◆ wlmcl_client_initialize()

bool wlmcl_client_initialize ( wlmcl_client_t *  client_ptr)

Performs wl_display_roundtrip for initializing the interfaces.

Parameters
client_ptr
Returns
whether all registered required interfaces were initialized.

◆ wlmcl_client_register_interface()

struct wlmcl_client_interface * wlmcl_client_register_interface ( wlmcl_client_t *  client_ptr,
const struct wl_interface *  wl_interface_ptr,
uint32_t  desired_version,
bool  required,
void(*)(void *bound_interface_ptr, void *userdata_ptr)  setup,
void *  userdata_ptr 
)

Registers an interface to be set up by the client.

Parameters
client_ptr
wl_interface_ptr
desired_version
required
setup
userdata_ptr
Returns
The bound interface, or NULL on errror.

◆ wlmcl_client_register_timer()

bool wlmcl_client_register_timer ( wlmcl_client_t *  wlmcl_client_ptr,
uint64_t  target_usec,
wlmcl_client_callback_t  callback,
void *  callback_ud_ptr 
)

Registers a timer with the client.

Once the system clock reaches (or has passed) target_usec, callback will be called with the provided arguments. This is a one-time registration. For repeated calls, clients need to re-register.

Parameters
wlmcl_client_ptr
target_usec
callback
callback_ud_ptr
Returns
true on success.

◆ wlmcl_client_request_terminate()

void wlmcl_client_request_terminate ( wlmcl_client_t *  wlmcl_client_ptr)

Requests termination of the client-s mainloop. This takes effect only once the mainloop wraps up an iteration.

Parameters
wlmcl_client_ptr

◆ wlmcl_client_run()

void wlmcl_client_run ( wlmcl_client_t *  wlmcl_client_ptr)

Runs the client's mainloop.

Parameters
wlmcl_client_ptr

◆ wlmcl_client_signal_fd()

int wlmcl_client_signal_fd ( wlmcl_client_t *  wlmcl_client_ptr)
Returns
The signal file descriptor monitored by the client.