[PATCH weston] window: rename enum pointer_type to cursor_type

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Fri May 25 06:01:41 PDT 2012


This avoids confusion with the pointer devices (struct wl_pointer).
---

I agree that cursor_type is a better name. Since it was called
pointer_type before I figure I just use the old name.

Anyway, this can be squashed into the previous patch or dropped or ...

Cheers,
Ander

 clients/clickdot.c      |    2 +-
 clients/desktop-shell.c |    4 ++--
 clients/dnd.c           |    8 ++++----
 clients/eventdemo.c     |    4 ++--
 clients/flower.c        |    2 +-
 clients/gears.c         |    2 +-
 clients/smoke.c         |    2 +-
 clients/terminal.c      |    2 +-
 clients/window.c        |   36 ++++++++++++++++++------------------
 clients/window.h        |   26 +++++++++++++-------------
 10 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/clients/clickdot.c b/clients/clickdot.c
index b9669d1..d935ae5 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -218,7 +218,7 @@ motion_handler(struct widget *widget,
 
 	window_schedule_redraw(clickdot->window);
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 7554df3..5a8b108 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -240,7 +240,7 @@ panel_launcher_enter_handler(struct widget *widget, struct input *input,
 	launcher->focused = 1;
 	widget_schedule_redraw(widget);
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
@@ -511,7 +511,7 @@ unlock_dialog_widget_enter_handler(struct widget *widget,
 	dialog->button_focused = 1;
 	widget_schedule_redraw(widget);
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
diff --git a/clients/dnd.c b/clients/dnd.c
index c4d6f7b..32dec96 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -318,7 +318,7 @@ create_drag_cursor(struct dnd_drag *dnd_drag,
 	cairo_pattern_t *pattern;
 	cairo_t *cr;
 
-	pointer = display_get_pointer_image(dnd->display, POINTER_DRAGGING);
+	pointer = display_get_pointer_image(dnd->display, CURSOR_DRAGGING);
 
 	rectangle.width = item_width + 2 * pointer->width;
 	rectangle.height = item_height + 2 * pointer->height;
@@ -410,7 +410,7 @@ dnd_button_handler(struct widget *widget,
 					  dnd_drag->drag_surface,
 					  serial);
 
-		input_set_pointer_image(input, time, POINTER_DRAGGING);
+		input_set_pointer_image(input, time, CURSOR_DRAGGING);
 
 		dnd_drag->opaque =
 			create_drag_cursor(dnd_drag, item, x, y, 1);
@@ -434,9 +434,9 @@ lookup_cursor(struct dnd *dnd, int x, int y)
 
 	item = dnd_get_item(dnd, x, y);
 	if (item)
-		return POINTER_HAND1;
+		return CURSOR_HAND1;
 	else
-		return POINTER_LEFT_PTR;
+		return CURSOR_LEFT_PTR;
 }
 
 static int
diff --git a/clients/eventdemo.c b/clients/eventdemo.c
index 8e63540..4781546 100644
--- a/clients/eventdemo.c
+++ b/clients/eventdemo.c
@@ -247,9 +247,9 @@ motion_handler(struct widget *widget, struct input *input, uint32_t time,
 
 	if (x > e->x && x < e->x + e->w)
 		if (y > e->y && y < e->y + e->h)
-			return POINTER_HAND1;
+			return CURSOR_HAND1;
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 /**
diff --git a/clients/flower.c b/clients/flower.c
index 2d54b38..9b22543 100644
--- a/clients/flower.c
+++ b/clients/flower.c
@@ -133,7 +133,7 @@ static int
 motion_handler(struct widget *widget, struct input *input,
 	       uint32_t time, float x, float y, void *data)
 {
-	return POINTER_HAND1;
+	return CURSOR_HAND1;
 }
 
 static void
diff --git a/clients/gears.c b/clients/gears.c
index ce8212a..5cfc298 100644
--- a/clients/gears.c
+++ b/clients/gears.c
@@ -243,7 +243,7 @@ motion_handler(struct widget *widget, struct input *input,
 			gears->view.rotx = gears->view.rotx + 360;
 	}
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
diff --git a/clients/smoke.c b/clients/smoke.c
index d730124..69d4f23 100644
--- a/clients/smoke.c
+++ b/clients/smoke.c
@@ -258,7 +258,7 @@ smoke_motion_handler(struct widget *widget, struct input *input,
 			smoke->b[0].d[k] += 1;
 		}
 
-	return POINTER_HAND1;
+	return CURSOR_HAND1;
 }
 
 static void
diff --git a/clients/terminal.c b/clients/terminal.c
index c7300e6..32648dd 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -2245,7 +2245,7 @@ motion_handler(struct widget *widget,
 		widget_schedule_redraw(widget);
 	}
 
-	return POINTER_IBEAM;
+	return CURSOR_IBEAM;
 }
 
 static struct terminal *
diff --git a/clients/window.c b/clients/window.c
index a41fa3d..7187fac 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -275,8 +275,8 @@ struct shm_pool {
 };
 
 enum {
-	POINTER_DEFAULT = 100,
-	POINTER_UNSET
+	CURSOR_DEFAULT = 100,
+	CURSOR_UNSET
 };
 
 enum window_location {
@@ -1144,7 +1144,7 @@ frame_button_enter_handler(struct widget *widget,
 	widget_schedule_redraw(frame_button->widget);
 	frame_button->state = FRAME_BUTTON_OVER;
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
@@ -1324,25 +1324,25 @@ frame_get_pointer_image_for_location(struct frame *frame, struct input *input)
 
 	switch (location) {
 	case THEME_LOCATION_RESIZING_TOP:
-		return POINTER_TOP;
+		return CURSOR_TOP;
 	case THEME_LOCATION_RESIZING_BOTTOM:
-		return POINTER_BOTTOM;
+		return CURSOR_BOTTOM;
 	case THEME_LOCATION_RESIZING_LEFT:
-		return POINTER_LEFT;
+		return CURSOR_LEFT;
 	case THEME_LOCATION_RESIZING_RIGHT:
-		return POINTER_RIGHT;
+		return CURSOR_RIGHT;
 	case THEME_LOCATION_RESIZING_TOP_LEFT:
-		return POINTER_TOP_LEFT;
+		return CURSOR_TOP_LEFT;
 	case THEME_LOCATION_RESIZING_TOP_RIGHT:
-		return POINTER_TOP_RIGHT;
+		return CURSOR_TOP_RIGHT;
 	case THEME_LOCATION_RESIZING_BOTTOM_LEFT:
-		return POINTER_BOTTOM_LEFT;
+		return CURSOR_BOTTOM_LEFT;
 	case THEME_LOCATION_RESIZING_BOTTOM_RIGHT:
-		return POINTER_BOTTOM_RIGHT;
+		return CURSOR_BOTTOM_RIGHT;
 	case THEME_LOCATION_EXTERIOR:
 	case THEME_LOCATION_TITLEBAR:
 	default:
-		return POINTER_LEFT_PTR;
+		return CURSOR_LEFT_PTR;
 	}
 }
 
@@ -1417,7 +1417,7 @@ frame_button_handler(struct widget *widget,
 		case THEME_LOCATION_TITLEBAR:
 			if (!window->shell_surface)
 				break;
-			input_set_pointer_image(input, time, POINTER_DRAGGING);
+			input_set_pointer_image(input, time, CURSOR_DRAGGING);
 			input_ungrab(input);
 			wl_shell_surface_move(window->shell_surface,
 					      input_get_seat(input),
@@ -1509,7 +1509,7 @@ input_set_focus_widget(struct input *input, struct widget *focus,
 		       float x, float y)
 {
 	struct widget *old, *widget;
-	int pointer = POINTER_LEFT_PTR;
+	int pointer = CURSOR_LEFT_PTR;
 
 	if (focus == input->focus_widget)
 		return;
@@ -1545,7 +1545,7 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
 	struct input *input = data;
 	struct window *window = input->pointer_focus;
 	struct widget *widget;
-	int cursor = POINTER_LEFT_PTR;
+	int cursor = CURSOR_LEFT_PTR;
 	float sx = wl_fixed_to_double(sx_w);
 	float sy = wl_fixed_to_double(sy_w);
 
@@ -1676,7 +1676,7 @@ input_remove_pointer_focus(struct input *input)
 	input_set_focus_widget(input, NULL, 0, 0);
 
 	input->pointer_focus = NULL;
-	input->current_cursor = POINTER_UNSET;
+	input->current_cursor = CURSOR_UNSET;
 }
 
 static void
@@ -2575,7 +2575,7 @@ menu_motion_handler(struct widget *widget,
 	if (widget == menu->widget)
 		menu_set_item(data, y);
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static int
@@ -2587,7 +2587,7 @@ menu_enter_handler(struct widget *widget,
 	if (widget == menu->widget)
 		menu_set_item(data, y);
 
-	return POINTER_LEFT_PTR;
+	return CURSOR_LEFT_PTR;
 }
 
 static void
diff --git a/clients/window.h b/clients/window.h
index db232e0..a79eb50 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -139,19 +139,19 @@ display_run(struct display *d);
 void
 display_exit(struct display *d);
 
-enum pointer_type {
-	POINTER_BOTTOM_LEFT,
-	POINTER_BOTTOM_RIGHT,
-	POINTER_BOTTOM,
-	POINTER_DRAGGING,
-	POINTER_LEFT_PTR,
-	POINTER_LEFT,
-	POINTER_RIGHT,
-	POINTER_TOP_LEFT,
-	POINTER_TOP_RIGHT,
-	POINTER_TOP,
-	POINTER_IBEAM,
-	POINTER_HAND1,
+enum cursor_type {
+	CURSOR_BOTTOM_LEFT,
+	CURSOR_BOTTOM_RIGHT,
+	CURSOR_BOTTOM,
+	CURSOR_DRAGGING,
+	CURSOR_LEFT_PTR,
+	CURSOR_LEFT,
+	CURSOR_RIGHT,
+	CURSOR_TOP_LEFT,
+	CURSOR_TOP_RIGHT,
+	CURSOR_TOP,
+	CURSOR_IBEAM,
+	CURSOR_HAND1,
 };
 
 typedef void (*window_key_handler_t)(struct window *window, struct input *input,
-- 
1.7.4.1



More information about the wayland-devel mailing list