diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-14 10:33:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 10:33:46 -0400 |
commit | 53052b3f6e457f35d46fc3a71bd7eac96e55a484 (patch) | |
tree | c51bfcd472cf38df7528eab9330bb0e44981ffbb /include | |
parent | 1e1e9887fba15291256a806aca6cc6f94a8f671e (diff) | |
parent | e922e62924314866620cce662756ff09c8092cc2 (diff) |
Merge pull request #85 from martinetd/refactor_states
Refactor states
Diffstat (limited to 'include')
-rw-r--r-- | include/backend/libinput.h | 5 | ||||
-rw-r--r-- | include/backend/wayland.h | 8 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_input_device.h | 6 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_keyboard.h | 7 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_pointer.h | 6 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_tablet_pad.h | 6 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_tablet_tool.h | 6 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_touch.h | 6 | ||||
-rw-r--r-- | include/wlr/types/wlr_input_device.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_pointer.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_tablet_pad.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_tablet_tool.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_touch.h | 2 |
14 files changed, 27 insertions, 35 deletions
diff --git a/include/backend/libinput.h b/include/backend/libinput.h index 3ff714c2..e0f762a7 100644 --- a/include/backend/libinput.h +++ b/include/backend/libinput.h @@ -2,6 +2,7 @@ #define _WLR_BACKEND_LIBINPUT_INTERNAL_H #include <libinput.h> #include <wayland-server-core.h> +#include <wlr/types/wlr_input_device.h> #include <wlr/backend/interface.h> #include <wlr/interfaces/wlr_input_device.h> #include <wlr/util/list.h> @@ -22,7 +23,9 @@ struct wlr_libinput_backend { list_t *wlr_device_lists; }; -struct wlr_input_device_state { +struct wlr_libinput_input_device { + struct wlr_input_device wlr_input_device; + struct libinput_device *handle; }; diff --git a/include/backend/wayland.h b/include/backend/wayland.h index da4465fa..d930f21b 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -41,13 +41,15 @@ struct wlr_wl_backend_output { void *egl_surface; }; -struct wlr_input_device_state { +struct wlr_wl_input_device { + struct wlr_input_device wlr_input_device; + struct wlr_wl_backend *backend; - struct wlr_input_device *wlr_device; void *resource; }; -struct wlr_pointer_state { +struct wlr_wl_pointer { + struct wlr_pointer wlr_pointer; enum wlr_axis_source axis_source; struct wlr_wl_backend_output *current_output; }; diff --git a/include/wlr/interfaces/wlr_input_device.h b/include/wlr/interfaces/wlr_input_device.h index 26729c7c..b236a24a 100644 --- a/include/wlr/interfaces/wlr_input_device.h +++ b/include/wlr/interfaces/wlr_input_device.h @@ -3,13 +3,13 @@ #include <wlr/types/wlr_input_device.h> struct wlr_input_device_impl { - void (*destroy)(struct wlr_input_device_state *state); + void (*destroy)(struct wlr_input_device *wlr_device); }; -struct wlr_input_device *wlr_input_device_create( +void wlr_input_device_init( + struct wlr_input_device *wlr_device, 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); diff --git a/include/wlr/interfaces/wlr_keyboard.h b/include/wlr/interfaces/wlr_keyboard.h index 1acc6428..779b302f 100644 --- a/include/wlr/interfaces/wlr_keyboard.h +++ b/include/wlr/interfaces/wlr_keyboard.h @@ -4,12 +4,11 @@ #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); + void (*destroy)(struct wlr_keyboard *keyboard); + void (*led_update)(struct wlr_keyboard *keyboard, uint32_t leds); }; -struct wlr_keyboard *wlr_keyboard_create(struct wlr_keyboard_impl *impl, - struct wlr_keyboard_state *state); +void wlr_keyboard_init(struct wlr_keyboard *keyboard, struct wlr_keyboard_impl *impl); void wlr_keyboard_destroy(struct wlr_keyboard *keyboard); #endif diff --git a/include/wlr/interfaces/wlr_pointer.h b/include/wlr/interfaces/wlr_pointer.h index 8c3f7e0d..8d4bf703 100644 --- a/include/wlr/interfaces/wlr_pointer.h +++ b/include/wlr/interfaces/wlr_pointer.h @@ -3,11 +3,11 @@ #include <wlr/types/wlr_pointer.h> struct wlr_pointer_impl { - void (*destroy)(struct wlr_pointer_state *state); + void (*destroy)(struct wlr_pointer *pointer); }; -struct wlr_pointer *wlr_pointer_create(struct wlr_pointer_impl *impl, - struct wlr_pointer_state *state); +void wlr_pointer_init(struct wlr_pointer *pointer, + struct wlr_pointer_impl *impl); void wlr_pointer_destroy(struct wlr_pointer *pointer); #endif diff --git a/include/wlr/interfaces/wlr_tablet_pad.h b/include/wlr/interfaces/wlr_tablet_pad.h index 09274c6c..81af3c3f 100644 --- a/include/wlr/interfaces/wlr_tablet_pad.h +++ b/include/wlr/interfaces/wlr_tablet_pad.h @@ -3,11 +3,11 @@ #include <wlr/types/wlr_tablet_pad.h> struct wlr_tablet_pad_impl { - void (*destroy)(struct wlr_tablet_pad_state *pad); + void (*destroy)(struct wlr_tablet_pad *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_init(struct wlr_tablet_pad *pad, + struct wlr_tablet_pad_impl *impl); void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad); #endif diff --git a/include/wlr/interfaces/wlr_tablet_tool.h b/include/wlr/interfaces/wlr_tablet_tool.h index cd326878..43a24fd0 100644 --- a/include/wlr/interfaces/wlr_tablet_tool.h +++ b/include/wlr/interfaces/wlr_tablet_tool.h @@ -3,11 +3,11 @@ #include <wlr/types/wlr_tablet_tool.h> struct wlr_tablet_tool_impl { - void (*destroy)(struct wlr_tablet_tool_state *tool); + void (*destroy)(struct wlr_tablet_tool *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_init(struct wlr_tablet_tool *tool, + struct wlr_tablet_tool_impl *impl); void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool); #endif diff --git a/include/wlr/interfaces/wlr_touch.h b/include/wlr/interfaces/wlr_touch.h index d83ad558..b5fcef18 100644 --- a/include/wlr/interfaces/wlr_touch.h +++ b/include/wlr/interfaces/wlr_touch.h @@ -3,11 +3,11 @@ #include <wlr/types/wlr_touch.h> struct wlr_touch_impl { - void (*destroy)(struct wlr_touch_state *state); + void (*destroy)(struct wlr_touch *touch); }; -struct wlr_touch *wlr_touch_create(struct wlr_touch_impl *impl, - struct wlr_touch_state *state); +void wlr_touch_init(struct wlr_touch *touch, + struct wlr_touch_impl *impl); void wlr_touch_destroy(struct wlr_touch *touch); #endif diff --git a/include/wlr/types/wlr_input_device.h b/include/wlr/types/wlr_input_device.h index 17b26d45..642892ff 100644 --- a/include/wlr/types/wlr_input_device.h +++ b/include/wlr/types/wlr_input_device.h @@ -21,11 +21,9 @@ enum wlr_input_device_type { #include <wlr/types/wlr_tablet_tool.h> #include <wlr/types/wlr_tablet_pad.h> -struct wlr_input_device_state; struct wlr_input_device_impl; struct wlr_input_device { - struct wlr_input_device_state *state; struct wlr_input_device_impl *impl; enum wlr_input_device_type type; diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index bef064e5..ce7d6659 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -10,11 +10,9 @@ enum WLR_KEYBOARD_LED { WLR_LED_LAST }; -struct wlr_keyboard_state; struct wlr_keyboard_impl; struct wlr_keyboard { - struct wlr_keyboard_state *state; struct wlr_keyboard_impl *impl; struct { diff --git a/include/wlr/types/wlr_pointer.h b/include/wlr/types/wlr_pointer.h index 139ba868..13a2d045 100644 --- a/include/wlr/types/wlr_pointer.h +++ b/include/wlr/types/wlr_pointer.h @@ -4,11 +4,9 @@ #include <wayland-server.h> #include <stdint.h> -struct wlr_pointer_state; struct wlr_pointer_impl; struct wlr_pointer { - struct wlr_pointer_state *state; struct wlr_pointer_impl *impl; struct { diff --git a/include/wlr/types/wlr_tablet_pad.h b/include/wlr/types/wlr_tablet_pad.h index d2365086..6c14c669 100644 --- a/include/wlr/types/wlr_tablet_pad.h +++ b/include/wlr/types/wlr_tablet_pad.h @@ -11,11 +11,9 @@ */ struct wlr_tablet_pad_impl; -struct wlr_tablet_pad_state; struct wlr_tablet_pad { struct wlr_tablet_pad_impl *impl; - struct wlr_tablet_pad_state *state; struct { struct wl_signal button; diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h index f99cd065..dcb9c191 100644 --- a/include/wlr/types/wlr_tablet_tool.h +++ b/include/wlr/types/wlr_tablet_tool.h @@ -5,11 +5,9 @@ #include <stdint.h> struct wlr_tablet_tool_impl; -struct wlr_tablet_tool_state; struct wlr_tablet_tool { struct wlr_tablet_tool_impl *impl; - struct wlr_tablet_tool_state *state; struct { struct wl_signal axis; diff --git a/include/wlr/types/wlr_touch.h b/include/wlr/types/wlr_touch.h index 740d70f6..93069fcb 100644 --- a/include/wlr/types/wlr_touch.h +++ b/include/wlr/types/wlr_touch.h @@ -3,11 +3,9 @@ #include <wayland-server.h> #include <stdint.h> -struct wlr_touch_state; struct wlr_touch_impl; struct wlr_touch { - struct wlr_touch_state *state; struct wlr_touch_impl *impl; struct { |