Split out types.h and wlr/types.h

TODO: Update the code accordingly and move other types into the same
paradigm
This commit is contained in:
Drew DeVault 2017-06-19 18:41:02 -04:00
parent fd5ad15894
commit 53a8b4f127
16 changed files with 499 additions and 427 deletions

View file

@ -0,0 +1,16 @@
#ifndef _WLR_INTERFACES_INPUT_DEVICE_H
#define _WLR_INTERFACES_INPUT_DEVICE_H
#include <wlr/types/wlr_input_device.h>
struct wlr_input_device_impl {
void (*destroy)(struct wlr_input_device_state *state);
};
struct wlr_input_device *wlr_input_device_create(
enum wlr_input_device_type type,
struct wlr_input_device_impl *impl,
struct wlr_input_device_state *state,
const char *name, int vendor, int product);
void wlr_input_device_destroy(struct wlr_input_device *dev);
#endif

View file

@ -0,0 +1,15 @@
#ifndef _WLR_INTERFACE_KEYBOARD_H
#define _WLR_INTERFACE_KEYBOARD_H
#include <wlr/types/wlr_keyboard.h>
#include <stdint.h>
struct wlr_keyboard_impl {
void (*destroy)(struct wlr_keyboard_state *state);
void (*led_update)(struct wlr_keyboard_state *state, uint32_t leds);
};
struct wlr_keyboard *wlr_keyboard_create(struct wlr_keyboard_impl *impl,
struct wlr_keyboard_state *state);
void wlr_keyboard_destroy(struct wlr_keyboard *keyboard);
#endif

View file

@ -0,0 +1,22 @@
#ifndef _WLR_INTERFACE_OUTPUT_H
#define _WLR_INTERFACE_OUTPUT_H
#include <wlr/interfaces/wlr_output.h>
#include <stdbool.h>
struct wlr_output_impl {
void (*enable)(struct wlr_output_state *state, bool enable);
bool (*set_mode)(struct wlr_output_state *state,
struct wlr_output_mode *mode);
void (*transform)(struct wlr_output_state *state,
enum wl_output_transform transform);
bool (*set_cursor)(struct wlr_output_state *state,
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height);
bool (*move_cursor)(struct wlr_output_state *state, int x, int y);
void (*destroy)(struct wlr_output_state *state);
};
struct wlr_output *wlr_output_create(struct wlr_output_impl *impl,
struct wlr_output_state *state);
void wlr_output_free(struct wlr_output *output);
#endif

View file

@ -0,0 +1,13 @@
#ifndef _WLR_INTERFACES_POINTER_H
#define _WLR_INTERFACES_POINTER_H
#include <wlr/types/wlr_pointer.h>
struct wlr_pointer_impl {
void (*destroy)(struct wlr_pointer_state *state);
};
struct wlr_pointer *wlr_pointer_create(struct wlr_pointer_impl *impl,
struct wlr_pointer_state *state);
void wlr_pointer_destroy(struct wlr_pointer *pointer);
#endif

View file

@ -0,0 +1,13 @@
#ifndef _WLR_INTERFACES_TABLET_PAD_H
#define _WLR_INTERFACES_TABLET_PAD_H
#include <wlr/types/wlr_tablet_pad.h>
struct wlr_tablet_pad_impl {
void (*destroy)(struct wlr_tablet_pad_state *pad);
};
struct wlr_tablet_pad *wlr_tablet_pad_create(struct wlr_tablet_pad_impl *impl,
struct wlr_tablet_pad_state *state);
void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad);
#endif

View file

@ -0,0 +1,13 @@
#ifndef _WLR_INTERFACES_TABLET_TOOL_H
#define _WLR_INTERFACES_TABLET_TOOL_H
#include <wlr/types/wlr_tablet_tool.h>
struct wlr_tablet_tool_impl {
void (*destroy)(struct wlr_tablet_tool_state *tool);
};
struct wlr_tablet_tool *wlr_tablet_tool_create(struct wlr_tablet_tool_impl *impl,
struct wlr_tablet_tool_state *state);
void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool);
#endif

View file

@ -0,0 +1,13 @@
#ifndef _WLR_INTERFACES_TOUCH_H
#define _WLR_INTERFACES_TOUCH_H
#include <wlr/types/wlr_touch.h>
struct wlr_touch_impl {
void (*destroy)(struct wlr_touch_state *state);
};
struct wlr_touch *wlr_touch_create(struct wlr_touch_impl *impl,
struct wlr_touch_state *state);
void wlr_touch_destroy(struct wlr_touch *touch);
#endif