wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
input_observation.c File Reference
#include "input_observation.h"
#include <libbase/libbase.h>
#include <inttypes.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-server-protocol.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h>
#include "server.h"
#include "toolkit/toolkit.h"
#include "ext-input-observation-v1-server-protocol.h"
Include dependency graph for input_observation.c:

Classes

struct  _wlmaker_input_observation_manager_t
 
struct  _wlmaker_input_position_observer_t
 

Functions

static wlmaker_input_observation_manager_tinput_observation_manager_from_resource (struct wl_resource *wl_resource_ptr)
 
static void bind_input_observation (struct wl_client *wl_client_ptr, void *data_ptr, uint32_t version, uint32_t id)
 
static void handle_resource_destroy (struct wl_client *wl_client_ptr, struct wl_resource *wl_resource_ptr)
 
static void input_observation_manager_handle_create_pointer_observer (struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *pointer_wl_resource_ptr, struct wl_resource *surface)
 
static wlmaker_input_position_observer_twlmaker_input_position_observer_from_resource (struct wl_resource *wl_resource_ptr)
 
static wlmaker_input_position_observer_twlmaker_input_position_observer_create (struct wl_client *wl_client_ptr, wlmaker_input_observation_manager_t *manager_ptr, uint32_t id, int version, struct wl_resource *pointer_wl_resource_ptr, struct wlr_surface *wlr_surface_ptr)
 
static void wlmaker_input_position_observer_resource_destroy (struct wl_resource *wl_resource_ptr)
 
static void wlmaker_input_position_observer_destroy (wlmaker_input_position_observer_t *position_observer_ptr)
 
static void _wlmaker_input_position_observer_handle_surface_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_input_position_observer_handle_cursor_frame (struct wl_listener *listener_ptr, void *data_ptr)
 
wlmaker_input_observation_manager_twlmaker_input_observation_manager_create (struct wl_display *wl_display_ptr, struct wlr_seat *wlr_seat_ptr, struct wlr_cursor *wlr_cursor_ptr)
 
void wlmaker_input_observation_manager_destroy (wlmaker_input_observation_manager_t *manager_ptr)
 

Variables

static const struct ext_input_observation_manager_v1_interface input_observation_manager_v1_implementation
 
static const struct ext_input_position_observer_v1_interface input_position_observer_v1_implementation
 

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

◆ _wlmaker_input_position_observer_handle_cursor_frame()

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

Handles cursor frame events: Sends the current pointer position.

◆ _wlmaker_input_position_observer_handle_surface_destroy()

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

Handles surface destruction: Destroy the position observer.

◆ bind_input_observation()

void bind_input_observation ( struct wl_client *  wl_client_ptr,
void *  data_ptr,
uint32_t  version,
uint32_t  id 
)
static

Binds the position observation manager for the client.

Parameters
wl_client_ptr
data_ptr
version
id

◆ handle_resource_destroy()

void handle_resource_destroy ( struct wl_client *  wl_client_ptr,
struct wl_resource *  wl_resource_ptr 
)
static

Handler for the 'destroy' method: Destroys the resource.

Parameters
wl_client_ptr
wl_resource_ptr

◆ input_observation_manager_from_resource()

wlmaker_input_observation_manager_t * input_observation_manager_from_resource ( struct wl_resource *  wl_resource_ptr)
static

Returns the toplevel position observer from the resource, with type check.

Parameters
wl_resource_ptr
Returns
Position to the wlmaker_input_observation_manager_t.

◆ input_observation_manager_handle_create_pointer_observer()

void input_observation_manager_handle_create_pointer_observer ( struct wl_client *  wl_client_ptr,
struct wl_resource *  wl_resource_ptr,
uint32_t  id,
struct wl_resource *  pointer_wl_resource_ptr,
struct wl_resource *  surface_wl_resource_ptr 
)
static

Creates an observer, associated with the surface.

Requires that wlmaker_input_observation_manager_t::wlr_seat_ptr is set and has the WL_SEAT_CAPABILITY_POINTER capability.

Parameters
wl_client_ptr
wl_resource_ptr
id
pointer_wl_resource_ptrResource handle of the pointer.
surface_wl_resource_ptrResource handle of the surface.

◆ wlmaker_input_observation_manager_create()

wlmaker_input_observation_manager_t * wlmaker_input_observation_manager_create ( struct wl_display *  wl_display_ptr,
struct wlr_seat *  wlr_seat_ptr,
struct wlr_cursor *  wlr_cursor_ptr 
)

Creates an input observation manager.

Parameters
wl_display_ptr
wlr_seat_ptr
wlr_cursor_ptr
Returns
The handle of the input observation or NULL on error. Must be destroyed by calling wlmaker_input_observation_manager_destroy.

◆ wlmaker_input_observation_manager_destroy()

void wlmaker_input_observation_manager_destroy ( wlmaker_input_observation_manager_t manager_ptr)

Destroys the input observation manager.

Parameters
manager_ptr

◆ wlmaker_input_position_observer_create()

wlmaker_input_position_observer_t * wlmaker_input_position_observer_create ( struct wl_client *  wl_client_ptr,
wlmaker_input_observation_manager_t manager_ptr,
uint32_t  id,
int  version,
struct wl_resource *  pointer_wl_resource_ptr,
struct wlr_surface *  wlr_surface_ptr 
)
static

Ctor for the position observer.

◆ wlmaker_input_position_observer_destroy()

void wlmaker_input_position_observer_destroy ( wlmaker_input_position_observer_t position_observer_ptr)
static

Dtor.

◆ wlmaker_input_position_observer_from_resource()

wlmaker_input_position_observer_t * wlmaker_input_position_observer_from_resource ( struct wl_resource *  wl_resource_ptr)
static

Type-safe conversion from resource to position observer.

◆ wlmaker_input_position_observer_resource_destroy()

void wlmaker_input_position_observer_resource_destroy ( struct wl_resource *  wl_resource_ptr)
static

Dtor, from the resource.

Variable Documentation

◆ input_observation_manager_v1_implementation

const struct ext_input_observation_manager_v1_interface input_observation_manager_v1_implementation
static
Initial value:
= {
}
static void input_observation_manager_handle_create_pointer_observer(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *pointer_wl_resource_ptr, struct wl_resource *surface)
Definition input_observation.c:249
static void handle_resource_destroy(struct wl_client *wl_client_ptr, struct wl_resource *wl_resource_ptr)
Definition input_observation.c:229

Implementation of the position observation manager.

◆ input_position_observer_v1_implementation

const struct ext_input_position_observer_v1_interface input_position_observer_v1_implementation
static
Initial value:
= {
}

Implementation of the position (position) observer.