types/wlr_input_device: move init and finish function to private API

This commit is contained in:
Simon Zeni 2022-03-03 09:43:38 -05:00 committed by Kirill Primak
parent 1bb2631c5c
commit cfed039c9a
20 changed files with 43 additions and 22 deletions

View file

@ -0,0 +1,20 @@
#ifndef INTERFACES_INPUT_DEVICE_H
#define INTERFACES_INPUT_DEVICE_H
#include <wlr/types/wlr_input_device.h>
/**
* Initializes a given wlr_input_device. Allocates memory for the name and sets
* its vendor and product id to 0.
* wlr_device must be non-NULL.
*/
void wlr_input_device_init(struct wlr_input_device *wlr_device,
enum wlr_input_device_type type, const char *name);
/**
* Cleans up all the memory owned by a given wlr_input_device and signals
* the destroy event.
*/
void wlr_input_device_finish(struct wlr_input_device *wlr_device);
#endif

View file

@ -10,7 +10,6 @@
#define WLR_BACKEND_HEADLESS_H
#include <wlr/backend.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h>
/**

View file

@ -13,7 +13,8 @@
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/backend/session.h>
#include <wlr/types/wlr_input_device.h>
struct wlr_input_device;
struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display,
struct wlr_session *session);

View file

@ -4,9 +4,10 @@
#include <wayland-client.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h>
struct wlr_input_device;
/**
* Creates a new wlr_wl_backend. This backend will be created with no outputs;
* you must use wlr_wl_output_create to add them.

View file

@ -6,9 +6,10 @@
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h>
struct wlr_input_device;
/**
* Creates a new wlr_x11_backend. This backend will be created with no outputs;
* you must use wlr_x11_output_create to add them.

View file

@ -10,10 +10,11 @@
#define WLR_TYPES_WLR_CURSOR_H
#include <wayland-server-core.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output.h>
struct wlr_input_device;
/**
* wlr_cursor implements the behavior of the "cursor", that is, the image on the
* screen typically moved about with a mouse or so. It provides tracking for

View file

@ -25,8 +25,6 @@ enum wlr_input_device_type {
WLR_INPUT_DEVICE_SWITCH,
};
struct wlr_input_device_impl;
struct wlr_input_device {
enum wlr_input_device_type type;
unsigned int vendor, product;
@ -53,12 +51,4 @@ struct wlr_input_device {
void *data;
};
void wlr_input_device_init(struct wlr_input_device *wlr_device,
enum wlr_input_device_type type, const char *name);
/**
* Clean up all of the provided wlr_input_device resources
*/
void wlr_input_device_finish(struct wlr_input_device *wlr_device);
#endif

View file

@ -11,13 +11,14 @@
#include <wayland-server-core.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_input_device.h>
#include "tablet-unstable-v2-protocol.h"
/* This can probably be even lower,the tools don't have a lot of buttons */
#define WLR_TABLET_V2_TOOL_BUTTONS_CAP 16
struct wlr_input_device;
struct wlr_tablet_pad_v2_grab_interface;
struct wlr_tablet_pad_v2_grab {