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

Go to the source code of this file.

Classes

struct  wlmim_events
 
struct  wlmim_keybinding_combo
 

Typedefs

typedef struct _wlmim_t wlmim_t
 
typedef struct _wlmtk_root_t wlmtk_root_t
 
typedef struct _wlmim_keybinding_t wlmim_keybinding_t
 
typedef bool(* wlmim_keybinding_callback_t) (const struct wlmim_keybinding_combo *kc)
 

Functions

wlmim_twlmim_input_manager_create (struct wlr_backend *wlr_backend_ptr, struct wlr_output_layout *wlr_output_layout_ptr, struct wlr_seat *wlr_seat_ptr, bspl_dict_t *config_dict_ptr, const struct wlmim_cursor_style *cursor_style_ptr, wlmtk_root_t *root_ptr)
 
void wlmim_input_manager_destroy (wlmim_t *input_manager_ptr)
 
struct wlmim_eventswlmim_events (wlmim_t *input_manager_ptr)
 
struct wlr_cursor * wlmim_wlr_cursor (wlmim_t *input_manager_ptr)
 
void wlmim_report_activity (wlmim_t *input_manager_ptr)
 
void wlmim_set_keyboard_group_index (wlmim_t *input_manager_ptr, uint32_t index)
 
uint32_t wlmim_get_keyboard_group_index (wlmim_t *input_manager_ptr)
 
wlmim_keybinding_twlmim_bind_key (wlmim_t *input_manager_ptr, const struct wlmim_keybinding_combo *key_combo_ptr, wlmim_keybinding_callback_t callback)
 
void wlmim_unbind_key (wlmim_t *input_manager_ptr, wlmim_keybinding_t *keybinding_ptr)
 
bool wlmim_process_key (wlmim_t *input_manager_ptr, xkb_keysym_t keysym, uint32_t modifiers)
 

Variables

const uint32_t wlmim_modifiers_default_mask
 
const bs_test_set_t wlmim_test_set
 

Detailed Description

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Minor cleanups:

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

◆ wlmim_keybinding_callback_t

typedef bool(* wlmim_keybinding_callback_t) (const struct wlmim_keybinding_combo *kc)

Callback for a key binding.

Parameters
kcThe key combo that triggered the callback.
Returns
true if the key can be considered "consumed".

◆ wlmim_keybinding_t

Handle for a key binding.

◆ wlmim_t

typedef struct _wlmim_t wlmim_t

Forward declaration.

◆ wlmtk_root_t

typedef struct _wlmtk_root_t wlmtk_root_t

Forward declaration.

Function Documentation

◆ wlmim_bind_key()

wlmim_keybinding_t * wlmim_bind_key ( wlmim_t input_manager_ptr,
const struct wlmim_keybinding_combo key_combo_ptr,
wlmim_keybinding_callback_t  callback 
)

Binds a particular key combination to a callback.

Parameters
input_manager_ptr
key_combo_ptr
callback
Returns
The key binding handle or NULL on error.

◆ wlmim_events()

struct wlmim_events * wlmim_events ( wlmim_t input_manager_ptr)
Returns
Pointer to wlmim_t::events.

◆ wlmim_get_keyboard_group_index()

uint32_t wlmim_get_keyboard_group_index ( wlmim_t input_manager_ptr)

◆ wlmim_input_manager_create()

wlmim_t * wlmim_input_manager_create ( struct wlr_backend *  wlr_backend_ptr,
struct wlr_output_layout *  wlr_output_layout_ptr,
struct wlr_seat *  wlr_seat_ptr,
bspl_dict_t *  config_dict_ptr,
const struct wlmim_cursor_style cursor_style_ptr,
wlmtk_root_t root_ptr 
)

Creates an input manager: Registers input devices and ensures event routing will be set up as desired.

Parameters
wlr_backend_ptr
wlr_output_layout_ptr
wlr_seat_ptr
config_dict_ptr
cursor_style_ptr
root_ptr
Returns
Pointer to the input manager handle.

◆ wlmim_input_manager_destroy()

void wlmim_input_manager_destroy ( wlmim_t input_manager_ptr)

Destroys the input manager.

Parameters
input_manager_ptr

◆ wlmim_process_key()

bool wlmim_process_key ( wlmim_t input_manager_ptr,
xkb_keysym_t  keysym,
uint32_t  modifiers 
)

Processes key combo: Call back if a matching binding is found.

Parameters
input_manager_ptr
keysym
modifiers
Returns
true if a binding was found AND the callback returned true.

◆ wlmim_report_activity()

void wlmim_report_activity ( wlmim_t input_manager_ptr)

Reports input activity. Used to reset idle timers.

Parameters
input_manager_ptr

◆ wlmim_set_keyboard_group_index()

void wlmim_set_keyboard_group_index ( wlmim_t input_manager_ptr,
uint32_t  index 
)

◆ wlmim_unbind_key()

void wlmim_unbind_key ( wlmim_t input_manager_ptr,
wlmim_keybinding_t keybinding_ptr 
)

Releases a key binding.

See also
wlmim_bind_key.
Parameters
input_manager_ptr
keybinding_ptr

◆ wlmim_wlr_cursor()

struct wlr_cursor * wlmim_wlr_cursor ( wlmim_t input_manager_ptr)
Returns
Pointer to struct wlr_cursor of wlmim_t::cursor_ptr.

Variable Documentation

◆ wlmim_modifiers_default_mask

const uint32_t wlmim_modifiers_default_mask
extern

All modifiers to use by default.

◆ wlmim_test_set

const bs_test_set_t wlmim_test_set
extern

Unit test set.