wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
pointer.c File Reference
#include "pointer.h"
#include <inttypes.h>
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <libinput.h>
#include <stddef.h>
#include <stdlib.h>
#include <wlr/backend/libinput.h>
#include <wlr/types/wlr_input_device.h>
Include dependency graph for pointer.c:

Classes

struct  _wlmim_pointer_t
 

Functions

void _wlmim_pointer_apply (wlmim_pointer_t *pointer_ptr, const struct wlmim_pointer_param *param_ptr)
 
wlmim_pointer_twlmim_pointer_create (struct wlr_input_device *wlr_input_device_ptr, const struct wlmim_pointer_param *param_ptr)
 
void wlmim_pointer_destroy (wlmim_pointer_t *pointer_ptr)
 
bool wlmim_pointer_parse_config (bspl_dict_t *config_dict_ptr, struct wlmim_pointer_param *param_ptr)
 
bool wlmim_pointer_enabled (wlmim_pointer_t *pointer_ptr)
 
static void _wlmim_pointer_test_parse (bs_test_t *test_ptr)
 

Variables

static const bspl_enum_desc_t _wlmim_pointer_click_methods []
 
static const bspl_enum_desc_t _wlmim_pointer_scroll_methods []
 
static const bspl_desc_t _wlmim_pointer_config_touchpad []
 
static const bspl_desc_t _wlmim_pointer_config []
 
static const bs_test_case_t wlmim_pointer_test_cases []
 
const bs_test_set_t wlmim_pointer_test_set
 

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.

Function Documentation

◆ _wlmim_pointer_apply()

void _wlmim_pointer_apply ( wlmim_pointer_t p,
const struct wlmim_pointer_param param_ptr 
)

Applies the touchpad configuration to the pointer input device.

A no-op if the device is not a touchpad, ie. has zero 'tap fingers'.

Parameters
p
param_ptr

◆ _wlmim_pointer_test_parse()

void _wlmim_pointer_test_parse ( bs_test_t *  test_ptr)
static

Tests parsing the dict.

◆ wlmim_pointer_create()

wlmim_pointer_t * wlmim_pointer_create ( struct wlr_input_device *  wlr_input_device_ptr,
const struct wlmim_pointer_param param_ptr 
)

Creates a pointer, and configures it as specified.

Parameters
wlr_input_device_ptr
param_ptr
Returns
A pointer handle or NULL on error.

◆ wlmim_pointer_destroy()

void wlmim_pointer_destroy ( wlmim_pointer_t pointer_ptr)

Destroys the pointer.

Parameters
pointer_ptr

◆ wlmim_pointer_enabled()

bool wlmim_pointer_enabled ( wlmim_pointer_t pointer_ptr)

◆ wlmim_pointer_parse_config()

bool wlmim_pointer_parse_config ( bspl_dict_t *  config_dict_ptr,
struct wlmim_pointer_param param_ptr 
)

Parses the pointer-specific parts of the config dict.

Parameters
config_dict_ptr
param_ptr
Returns
true on success

Variable Documentation

◆ _wlmim_pointer_click_methods

const bspl_enum_desc_t _wlmim_pointer_click_methods[]
static
Initial value:
= {
BSPL_ENUM("None", LIBINPUT_CONFIG_CLICK_METHOD_NONE),
BSPL_ENUM("ButtonAreas", LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS),
BSPL_ENUM("ClickFinger", LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER),
}

Enum values for "ClickMethod"

◆ _wlmim_pointer_config

const bspl_desc_t _wlmim_pointer_config[]
static
Initial value:
= {
BSPL_DESC_DICT(
"Touchpad",
false,
touchpad,
touchpad,
}
static const bspl_desc_t _wlmim_pointer_config_touchpad[]
Definition pointer.c:64
Definition pointer.h:35

Enum definition for pointer-related config section(s).

◆ _wlmim_pointer_config_touchpad

const bspl_desc_t _wlmim_pointer_config_touchpad[]
static

Plist descriptor for the "Touchpad" section.

◆ _wlmim_pointer_scroll_methods

const bspl_enum_desc_t _wlmim_pointer_scroll_methods[]
static
Initial value:
= {
BSPL_ENUM("NoScroll", LIBINPUT_CONFIG_SCROLL_NO_SCROLL),
BSPL_ENUM("TwoFingers", LIBINPUT_CONFIG_SCROLL_2FG),
BSPL_ENUM("Edge", LIBINPUT_CONFIG_SCROLL_EDGE),
BSPL_ENUM("OnButtonDown", LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN),
}

Enum values for "ScrollMethod"

◆ wlmim_pointer_test_cases

const bs_test_case_t wlmim_pointer_test_cases[]
static
Initial value:
= {
{ true, "parse", _wlmim_pointer_test_parse },
}
static void _wlmim_pointer_test_parse(bs_test_t *test_ptr)
Definition pointer.c:302

Unit test cases.

◆ wlmim_pointer_test_set

const bs_test_set_t wlmim_pointer_test_set
Initial value:
= BS_TEST_SET(
true, "pointer", wlmim_pointer_test_cases)
static const bs_test_case_t wlmim_pointer_test_cases[]
Definition pointer.c:292

Unit test set for pointers.