FreeRDP
uwac-input.c File Reference
#include "uwac-priv.h"
#include "uwac-utils.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/timerfd.h>
#include <sys/epoll.h>
#include "uwac-os.h"
#include "wayland-cursor.h"
#include "wayland-client-protocol.h"

Functions

static struct wl_buffer * create_pointer_buffer (UwacSeat *seat, const void *src, size_t size)
 
static void on_buffer_release (void *data, struct wl_buffer *wl_buffer)
 
static UwacReturnCode set_cursor_image (UwacSeat *seat, uint32_t serial)
 
static void keyboard_repeat_func (UwacTask *task, uint32_t events)
 
static void keyboard_handle_keymap (void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size)
 
static void keyboard_handle_key (void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w)
 
static void keyboard_handle_enter (void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
 
static void keyboard_handle_leave (void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface)
 
static int update_key_pressed (UwacSeat *seat, uint32_t key)
 
static int update_key_released (UwacSeat *seat, uint32_t key)
 
static void keyboard_handle_modifiers (void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
 
static void set_repeat_info (UwacSeat *input, int32_t rate, int32_t delay)
 
static void keyboard_handle_repeat_info (void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay)
 
static bool touch_send_start_frame (UwacSeat *seat)
 
static void touch_handle_down (void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
 
static void touch_handle_up (void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id)
 
static void touch_handle_motion (void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
 
static void touch_handle_frame (void *data, struct wl_touch *wl_touch)
 
static void touch_handle_cancel (void *data, struct wl_touch *wl_touch)
 
static void pointer_handle_enter (void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w)
 
static void pointer_handle_leave (void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface)
 
static void pointer_handle_motion (void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
 
static void pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w)
 
static void pointer_handle_axis (void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value)
 
static void pointer_frame (void *data, struct wl_pointer *wl_pointer)
 
static void pointer_axis_source (void *data, struct wl_pointer *wl_pointer, uint32_t axis_source)
 
static void pointer_axis_stop (void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis)
 
static void pointer_axis_discrete (void *data, struct wl_pointer *wl_pointer, uint32_t axis, int32_t discrete)
 
static void seat_handle_capabilities (void *data, struct wl_seat *seat, enum wl_seat_capability caps)
 
static void seat_handle_name (void *data, struct wl_seat *seat, const char *name)
 
UwacSeat * UwacSeatNew (UwacDisplay *d, uint32_t id, uint32_t version)
 
void UwacSeatDestroy (UwacSeat *s)
 
const char * UwacSeatGetName (const UwacSeat *seat)
 
UwacSeatId UwacSeatGetId (const UwacSeat *seat)
 
UwacReturnCode UwacSeatInhibitShortcuts (UwacSeat *s, bool inhibit)
 
UwacReturnCode UwacSeatSetMouseCursor (UwacSeat *seat, const void *data, size_t length, size_t width, size_t height, size_t hot_x, size_t hot_y)
 UwacSeatSetMouseCursor Sets the specified image as the new mouse cursor. Special values: If data == NULL && lenght == 0 the cursor is hidden, if data == NULL && length != 0 the default system cursor is used. More...
 

Variables

const struct wl_buffer_listener buffer_release_listener
 
static const struct wl_keyboard_listener keyboard_listener
 
static const struct wl_touch_listener touch_listener
 
static const struct wl_pointer_listener pointer_listener
 
static const struct wl_seat_listener seat_listener
 

Function Documentation

static struct wl_buffer* create_pointer_buffer ( UwacSeat *  seat,
const void src,
size_t  size 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void keyboard_handle_enter ( void data,
struct wl_keyboard *  keyboard,
uint32_t  serial,
struct wl_surface *  surface,
struct wl_array *  keys 
)
static

Here is the call graph for this function:

static void keyboard_handle_key ( void data,
struct wl_keyboard *  keyboard,
uint32_t  serial,
uint32_t  time,
uint32_t  key,
uint32_t  state_w 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void keyboard_handle_keymap ( void data,
struct wl_keyboard *  keyboard,
uint32_t  format,
int  fd,
uint32_t  size 
)
static

Here is the call graph for this function:

static void keyboard_handle_leave ( void data,
struct wl_keyboard *  keyboard,
uint32_t  serial,
struct wl_surface *  surface 
)
static

Here is the call graph for this function:

static void keyboard_handle_modifiers ( void data,
struct wl_keyboard *  keyboard,
uint32_t  serial,
uint32_t  mods_depressed,
uint32_t  mods_latched,
uint32_t  mods_locked,
uint32_t  group 
)
static
static void keyboard_handle_repeat_info ( void data,
struct wl_keyboard *  keyboard,
int32_t  rate,
int32_t  delay 
)
static

Here is the call graph for this function:

static void keyboard_repeat_func ( UwacTask *  task,
uint32_t  events 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_buffer_release ( void data,
struct wl_buffer *  wl_buffer 
)
static

Here is the call graph for this function:

static void pointer_axis_discrete ( void data,
struct wl_pointer *  wl_pointer,
uint32_t  axis,
int32_t  discrete 
)
static
static void pointer_axis_source ( void data,
struct wl_pointer *  wl_pointer,
uint32_t  axis_source 
)
static
static void pointer_axis_stop ( void data,
struct wl_pointer *  wl_pointer,
uint32_t  time,
uint32_t  axis 
)
static
static void pointer_frame ( void data,
struct wl_pointer *  wl_pointer 
)
static
static void pointer_handle_axis ( void data,
struct wl_pointer *  pointer,
uint32_t  time,
uint32_t  axis,
wl_fixed_t  value 
)
static

Here is the call graph for this function:

static void pointer_handle_button ( void data,
struct wl_pointer *  pointer,
uint32_t  serial,
uint32_t  time,
uint32_t  button,
uint32_t  state_w 
)
static

Here is the call graph for this function:

static void pointer_handle_enter ( void data,
struct wl_pointer *  pointer,
uint32_t  serial,
struct wl_surface *  surface,
wl_fixed_t  sx_w,
wl_fixed_t  sy_w 
)
static

Here is the call graph for this function:

static void pointer_handle_leave ( void data,
struct wl_pointer *  pointer,
uint32_t  serial,
struct wl_surface *  surface 
)
static

Here is the call graph for this function:

static void pointer_handle_motion ( void data,
struct wl_pointer *  pointer,
uint32_t  time,
wl_fixed_t  sx_w,
wl_fixed_t  sy_w 
)
static

Here is the call graph for this function:

static void seat_handle_capabilities ( void data,
struct wl_seat *  seat,
enum wl_seat_capability  caps 
)
static

Here is the call graph for this function:

static void seat_handle_name ( void data,
struct wl_seat *  seat,
const char *  name 
)
static

Here is the call graph for this function:

static UwacReturnCode set_cursor_image ( UwacSeat *  seat,
uint32_t  serial 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_repeat_info ( UwacSeat *  input,
int32_t  rate,
int32_t  delay 
)
static

Here is the caller graph for this function:

static void touch_handle_cancel ( void data,
struct wl_touch *  wl_touch 
)
static

Here is the call graph for this function:

static void touch_handle_down ( void data,
struct wl_touch *  wl_touch,
uint32_t  serial,
uint32_t  time,
struct wl_surface *  surface,
int32_t  id,
wl_fixed_t  x_w,
wl_fixed_t  y_w 
)
static

Here is the call graph for this function:

static void touch_handle_frame ( void data,
struct wl_touch *  wl_touch 
)
static

Here is the call graph for this function:

static void touch_handle_motion ( void data,
struct wl_touch *  wl_touch,
uint32_t  time,
int32_t  id,
wl_fixed_t  x_w,
wl_fixed_t  y_w 
)
static

Here is the call graph for this function:

static void touch_handle_up ( void data,
struct wl_touch *  wl_touch,
uint32_t  serial,
uint32_t  time,
int32_t  id 
)
static

Here is the call graph for this function:

static bool touch_send_start_frame ( UwacSeat *  seat)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int update_key_pressed ( UwacSeat *  seat,
uint32_t  key 
)
static

Here is the caller graph for this function:

static int update_key_released ( UwacSeat *  seat,
uint32_t  key 
)
static

Here is the caller graph for this function:

void UwacSeatDestroy ( UwacSeat *  s)

Here is the call graph for this function:

Here is the caller graph for this function:

UwacSeatId UwacSeatGetId ( const UwacSeat *  seat)

returns the id of the given UwacSeat

Parameters
seatthe UwacSeat
Returns
the id of the seat
const char* UwacSeatGetName ( const UwacSeat *  seat)

returns the name of the given UwacSeat

Parameters
seatthe UwacSeat
Returns
the name of the seat
UwacReturnCode UwacSeatInhibitShortcuts ( UwacSeat *  seat,
bool  inhibit 
)

Inhibits or restores keyboard shortcuts.

Parameters
seatThe UwacSeat to inhibit the shortcuts for
inhibitInhibit or restore keyboard shortcuts
Returns
UWAC_SUCCESS or an appropriate error code.

Here is the caller graph for this function:

UwacSeat* UwacSeatNew ( UwacDisplay *  d,
uint32_t  id,
uint32_t  version 
)

Here is the call graph for this function:

Here is the caller graph for this function:

UwacReturnCode UwacSeatSetMouseCursor ( UwacSeat *  seat,
const void data,
size_t  length,
size_t  width,
size_t  height,
size_t  hot_x,
size_t  hot_y 
)

UwacSeatSetMouseCursor Sets the specified image as the new mouse cursor. Special values: If data == NULL && lenght == 0 the cursor is hidden, if data == NULL && length != 0 the default system cursor is used.

Parameters
seatThe UwacSeat to apply the cursor image to
dataA pointer to the image data
lengthThe size of the image data
widthThe image width in pixel
heightThe image height in pixel
hot_xThe hotspot horizontal offset in pixel
hot_yThe hotspot vertical offset in pixel
Returns
UWAC_SUCCESS if successful, an appropriate error otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const struct wl_buffer_listener buffer_release_listener
Initial value:
= {
}
static void on_buffer_release(void *data, struct wl_buffer *wl_buffer)
Definition: uwac-input.c:79
const struct wl_keyboard_listener keyboard_listener
static
Initial value:
= {
}
static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size)
Definition: uwac-input.c:172
static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay)
Definition: uwac-input.c:437
static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface)
Definition: uwac-input.c:268
static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
Definition: uwac-input.c:395
static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
Definition: uwac-input.c:230
static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w)
Definition: uwac-input.c:330
const struct wl_pointer_listener pointer_listener
static
Initial value:
= {
}
static void pointer_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source)
Definition: uwac-input.c:802
static void pointer_axis_stop(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis)
Definition: uwac-input.c:807
static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface)
Definition: uwac-input.c:709
static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value)
Definition: uwac-input.c:775
static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w)
Definition: uwac-input.c:754
static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
Definition: uwac-input.c:728
static void pointer_frame(void *data, struct wl_pointer *wl_pointer)
Definition: uwac-input.c:797
static void pointer_axis_discrete(void *data, struct wl_pointer *wl_pointer, uint32_t axis, int32_t discrete)
Definition: uwac-input.c:812
static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w)
Definition: uwac-input.c:672
const struct wl_seat_listener seat_listener
static
Initial value:
= {
}
static void seat_handle_name(void *data, struct wl_seat *seat, const char *name)
Definition: uwac-input.c:897
static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps)
Definition: uwac-input.c:831
const struct wl_touch_listener touch_listener
static
Initial value:
= {
NULL
}
static void touch_handle_down(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
Definition: uwac-input.c:465
static void touch_handle_motion(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
Definition: uwac-input.c:570
static void touch_handle_frame(void *data, struct wl_touch *wl_touch)
Definition: uwac-input.c:615
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static void touch_handle_cancel(void *data, struct wl_touch *wl_touch)
Definition: uwac-input.c:628
static void touch_handle_up(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id)
Definition: uwac-input.c:528