[PATCH] input: define winput_dev as convention name for wl_input_device type
Tiago Vignatti
vignatti at freedesktop.org
Mon Dec 12 08:55:42 PST 2011
From: Tiago Vignatti <tiago.vignatti at intel.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
src/wayland-server.c | 120 +++++++++++++++++++++++++-------------------------
src/wayland-server.h | 14 +++---
2 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 421c3f0..1e76df8 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -381,34 +381,34 @@ static void
lose_pointer_focus(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wl_input_device *device =
+ struct wl_input_device *winput_dev =
container_of(listener, struct wl_input_device,
pointer_focus_listener);
- device->pointer_focus_resource = NULL;
+ winput_dev->pointer_focus_resource = NULL;
}
static void
lose_keyboard_focus(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wl_input_device *device =
+ struct wl_input_device *winput_dev =
container_of(listener, struct wl_input_device,
keyboard_focus_listener);
- device->keyboard_focus_resource = NULL;
+ winput_dev->keyboard_focus_resource = NULL;
}
WL_EXPORT void
-wl_input_device_init(struct wl_input_device *device)
+wl_input_device_init(struct wl_input_device *winput_dev)
{
- memset(device, 0, sizeof *device);
- wl_list_init(&device->resource_list);
- device->pointer_focus_listener.func = lose_pointer_focus;
- device->keyboard_focus_listener.func = lose_keyboard_focus;
+ memset(winput_dev, 0, sizeof *winput_dev);
+ wl_list_init(&winput_dev->resource_list);
+ winput_dev->pointer_focus_listener.func = lose_pointer_focus;
+ winput_dev->keyboard_focus_listener.func = lose_keyboard_focus;
- device->x = 100;
- device->y = 100;
+ winput_dev->x = 100;
+ winput_dev->y = 100;
}
static struct wl_resource *
@@ -428,7 +428,7 @@ find_resource_for_surface(struct wl_list *list, struct wl_surface *surface)
}
WL_EXPORT void
-wl_input_device_set_pointer_focus(struct wl_input_device *device,
+wl_input_device_set_pointer_focus(struct wl_input_device *winput_dev,
struct wl_surface *surface,
uint32_t time,
int32_t x, int32_t y,
@@ -436,120 +436,120 @@ wl_input_device_set_pointer_focus(struct wl_input_device *device,
{
struct wl_resource *resource;
- if (device->pointer_focus == surface)
+ if (winput_dev->pointer_focus == surface)
return;
- if (device->pointer_focus_resource &&
+ if (winput_dev->pointer_focus_resource &&
(!surface ||
- device->pointer_focus->resource.client != surface->resource.client))
- wl_resource_post_event(device->pointer_focus_resource,
+ winput_dev->pointer_focus->resource.client != surface->resource.client))
+ wl_resource_post_event(winput_dev->pointer_focus_resource,
WL_INPUT_DEVICE_POINTER_FOCUS,
time, NULL, 0, 0, 0, 0);
- if (device->pointer_focus_resource)
- wl_list_remove(&device->pointer_focus_listener.link);
+ if (winput_dev->pointer_focus_resource)
+ wl_list_remove(&winput_dev->pointer_focus_listener.link);
- resource = find_resource_for_surface(&device->resource_list, surface);
+ resource = find_resource_for_surface(&winput_dev->resource_list, surface);
if (resource) {
wl_resource_post_event(resource,
WL_INPUT_DEVICE_POINTER_FOCUS,
time, surface, x, y, sx, sy);
wl_list_insert(resource->destroy_listener_list.prev,
- &device->pointer_focus_listener.link);
+ &winput_dev->pointer_focus_listener.link);
}
- device->pointer_focus_resource = resource;
- device->pointer_focus = surface;
- device->pointer_focus_time = time;
+ winput_dev->pointer_focus_resource = resource;
+ winput_dev->pointer_focus = surface;
+ winput_dev->pointer_focus_time = time;
}
WL_EXPORT void
-wl_input_device_set_keyboard_focus(struct wl_input_device *device,
+wl_input_device_set_keyboard_focus(struct wl_input_device *winput_dev,
struct wl_surface *surface,
uint32_t time)
{
struct wl_resource *resource;
- if (device->keyboard_focus == surface)
+ if (winput_dev->keyboard_focus == surface)
return;
- if (device->keyboard_focus_resource &&
+ if (winput_dev->keyboard_focus_resource &&
(!surface ||
- device->keyboard_focus->resource.client != surface->resource.client))
- wl_resource_post_event(device->keyboard_focus_resource,
+ winput_dev->keyboard_focus->resource.client != surface->resource.client))
+ wl_resource_post_event(winput_dev->keyboard_focus_resource,
WL_INPUT_DEVICE_KEYBOARD_FOCUS,
- time, NULL, &device->keys);
- if (device->keyboard_focus_resource)
- wl_list_remove(&device->keyboard_focus_listener.link);
+ time, NULL, &winput_dev->keys);
+ if (winput_dev->keyboard_focus_resource)
+ wl_list_remove(&winput_dev->keyboard_focus_listener.link);
- resource = find_resource_for_surface(&device->resource_list, surface);
+ resource = find_resource_for_surface(&winput_dev->resource_list, surface);
if (resource) {
wl_resource_post_event(resource,
WL_INPUT_DEVICE_KEYBOARD_FOCUS,
- time, surface, &device->keys);
+ time, surface, &winput_dev->keys);
wl_list_insert(resource->destroy_listener_list.prev,
- &device->keyboard_focus_listener.link);
+ &winput_dev->keyboard_focus_listener.link);
}
- device->keyboard_focus_resource = resource;
- device->keyboard_focus = surface;
- device->keyboard_focus_time = time;
+ winput_dev->keyboard_focus_resource = resource;
+ winput_dev->keyboard_focus = surface;
+ winput_dev->keyboard_focus_time = time;
}
WL_EXPORT void
-wl_input_device_end_grab(struct wl_input_device *device, uint32_t time)
+wl_input_device_end_grab(struct wl_input_device *winput_dev, uint32_t time)
{
const struct wl_grab_interface *interface;
- interface = device->grab->interface;
- interface->end(device->grab, time);
- device->grab = NULL;
+ interface = winput_dev->grab->interface;
+ interface->end(winput_dev->grab, time);
+ winput_dev->grab = NULL;
- wl_list_remove(&device->grab_listener.link);
+ wl_list_remove(&winput_dev->grab_listener.link);
}
static void
lose_grab_surface(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wl_input_device *device =
+ struct wl_input_device *winput_dev =
container_of(listener,
struct wl_input_device, grab_listener);
- wl_input_device_end_grab(device, time);
+ wl_input_device_end_grab(winput_dev, time);
}
WL_EXPORT void
-wl_input_device_start_grab(struct wl_input_device *device,
+wl_input_device_start_grab(struct wl_input_device *winput_dev,
struct wl_grab *grab,
uint32_t button, uint32_t time)
{
- struct wl_surface *focus = device->pointer_focus;
+ struct wl_surface *focus = winput_dev->pointer_focus;
- device->grab = grab;
- device->grab_button = button;
- device->grab_time = time;
- device->grab_x = device->x;
- device->grab_y = device->y;
+ winput_dev->grab = grab;
+ winput_dev->grab_button = button;
+ winput_dev->grab_time = time;
+ winput_dev->grab_x = winput_dev->x;
+ winput_dev->grab_y = winput_dev->y;
- device->grab_listener.func = lose_grab_surface;
+ winput_dev->grab_listener.func = lose_grab_surface;
wl_list_insert(focus->resource.destroy_listener_list.prev,
- &device->grab_listener.link);
+ &winput_dev->grab_listener.link);
- grab->input_device = device;
+ grab->winput_dev = winput_dev;
}
WL_EXPORT int
-wl_input_device_update_grab(struct wl_input_device *device,
+wl_input_device_update_grab(struct wl_input_device *winput_dev,
struct wl_grab *grab,
struct wl_surface *surface, uint32_t time)
{
- if (device->grab != &device->implicit_grab ||
- device->grab_time != time ||
- device->pointer_focus != surface)
+ if (winput_dev->grab != &winput_dev->implicit_grab ||
+ winput_dev->grab_time != time ||
+ winput_dev->pointer_focus != surface)
return -1;
- device->grab = grab;
- grab->input_device = device;
+ winput_dev->grab = grab;
+ grab->winput_dev = winput_dev;
return 0;
}
diff --git a/src/wayland-server.h b/src/wayland-server.h
index 8019c56..42dcc4d 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -156,7 +156,7 @@ struct wl_grab_interface {
struct wl_grab {
const struct wl_grab_interface *interface;
- struct wl_input_device *input_device;
+ struct wl_input_device *winput_dev;
};
struct wl_input_device {
@@ -220,28 +220,28 @@ void
wl_resource_destroy(struct wl_resource *resource, uint32_t time);
void
-wl_input_device_init(struct wl_input_device *device);
+wl_input_device_init(struct wl_input_device *winput_dev);
void
-wl_input_device_set_pointer_focus(struct wl_input_device *device,
+wl_input_device_set_pointer_focus(struct wl_input_device *winput_dev,
struct wl_surface *surface,
uint32_t time,
int32_t x, int32_t y,
int32_t sx, int32_t sy);
void
-wl_input_device_set_keyboard_focus(struct wl_input_device *device,
+wl_input_device_set_keyboard_focus(struct wl_input_device *winput_dev,
struct wl_surface *surface,
uint32_t time);
void
-wl_input_device_end_grab(struct wl_input_device *device, uint32_t time);
+wl_input_device_end_grab(struct wl_input_device *winput_dev, uint32_t time);
void
-wl_input_device_start_grab(struct wl_input_device *device,
+wl_input_device_start_grab(struct wl_input_device *winput_dev,
struct wl_grab *grab,
uint32_t button, uint32_t time);
int
-wl_input_device_update_grab(struct wl_input_device *device,
+wl_input_device_update_grab(struct wl_input_device *winput_dev,
struct wl_grab *grab,
struct wl_surface *surface, uint32_t time);
--
1.7.5.4
More information about the wayland-devel
mailing list