wlmaker
Loading...
Searching...
No Matches
Macros | Functions
cursor.c File Reference
#include "cursor.h"
#include <libbase/libbase.h>
#include <inttypes.h>
#include <stdlib.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include "config.h"
#include "idle.h"
#include "toolkit/toolkit.h"
Include dependency graph for cursor.c:

Functions

static void handle_motion (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_motion_absolute (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_button (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_axis (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_frame (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_seat_request_set_cursor (struct wl_listener *listener_ptr, void *data_ptr)
 
static void process_motion (wlmaker_cursor_t *cursor_ptr, uint32_t time_msec)
 
wlmaker_cursor_twlmaker_cursor_create (wlmaker_server_t *server_ptr, struct wlr_output_layout *wlr_output_layout_ptr)
 
void wlmaker_cursor_destroy (wlmaker_cursor_t *cursor_ptr)
 
void wlmaker_cursor_attach_input_device (wlmaker_cursor_t *cursor_ptr, struct wlr_input_device *wlr_input_device_ptr)
 
void wlmaker_cursor_get_position (const wlmaker_cursor_t *cursor_ptr, double *x_ptr, double *y_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.

Function Documentation

◆ handle_axis()

void handle_axis ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the axis event of wlr_cursor.

Parameters
listener_ptr
data_ptrPoints to a wlr_pointer_axis_event.

◆ handle_button()

void handle_button ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the button event of wlr_cursor.

Parameters
listener_ptr
data_ptrPoints to a wlr_pointer_button_event.

◆ handle_frame()

void handle_frame ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the frame event of wlr_cursor.

Parameters
listener_ptr
data_ptr

◆ handle_motion()

void handle_motion ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the motion event of wlr_cursor.

Parameters
listener_ptr
data_ptrPoints to a wlr_pointer_motion_event.

◆ handle_motion_absolute()

void handle_motion_absolute ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the motion_absolute event of wlr_cursor.

Parameters
listener_ptr
data_ptrPoints to a wlr_pointer_motion_absolute_event.

◆ handle_seat_request_set_cursor()

void handle_seat_request_set_cursor ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_set_cursor event of wlr_seat.

This event is raised when a client provides a cursor image. It is accepted only if the client also has the pointer focus.

Parameters
listener_ptr
data_ptrPoints to a wlr_seat_pointer_request_set_cursor_event.

◆ process_motion()

void process_motion ( wlmaker_cursor_t cursor_ptr,
uint32_t  time_msec 
)
static

Processes the cursor motion: Lookups up the view & surface under the pointer and sets (respectively: clears) the pointer focus. Also sets the default cursor image, if no view is given (== no client-side cursor).

Parameters
cursor_ptr
time_msec

◆ wlmaker_cursor_attach_input_device()

void wlmaker_cursor_attach_input_device ( wlmaker_cursor_t cursor_ptr,
struct wlr_input_device *  wlr_input_device_ptr 
)

Attaches the input device. May be a pointer, touch or tablet_tool device.

Parameters
cursor_ptr
wlr_input_device_ptr

◆ wlmaker_cursor_create()

wlmaker_cursor_t * wlmaker_cursor_create ( wlmaker_server_t server_ptr,
struct wlr_output_layout *  wlr_output_layout_ptr 
)

Creates the cursor handlers.

Parameters
server_ptr
wlr_output_layout_ptr
Returns
The cursor handler or NULL on error.

◆ wlmaker_cursor_destroy()

void wlmaker_cursor_destroy ( wlmaker_cursor_t cursor_ptr)

Destroys the cursor handlers.

Parameters
cursor_ptr

◆ wlmaker_cursor_get_position()

void wlmaker_cursor_get_position ( const wlmaker_cursor_t cursor_ptr,
double *  x_ptr,
double *  y_ptr 
)

Retrieves the current pointer's position into |*x_ptr|, |*y_ptr|.

Parameters
cursor_ptr
x_ptrMay be NULL.
y_ptrMay be NULL.