[PATCH wayland 1/2] wayland-cursor: remove enum wl_cursor_type

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Thu May 24 06:17:47 PDT 2012


Defining a list of all cursors a theme, client or toolkit should have
is not the purpose of libwayland-cursor. The cursor type enum existed
for making lookups faster, but this kind of optmization belongs in the
toolkits.
---
 cursor/wayland-cursor.c |   21 ++-------------------
 cursor/wayland-cursor.h |   21 +--------------------
 2 files changed, 3 insertions(+), 39 deletions(-)

diff --git a/cursor/wayland-cursor.c b/cursor/wayland-cursor.c
index cad725f..bfacc71 100644
--- a/cursor/wayland-cursor.c
+++ b/cursor/wayland-cursor.c
@@ -305,23 +305,6 @@ wl_cursor_theme_destroy(struct wl_cursor_theme *theme)
 	free(theme);
 }
 
-/** Get the cursor for a given type from a cursor theme
- *
- * \param theme The cursor theme
- * \patam type The desired cursor type
- * \return The theme's cursor of the given type or %NULL if there is no
- * such cursor
- */
-WL_EXPORT struct wl_cursor *
-wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
-			   enum wl_cursor_type type)
-{
-	if (type < theme->cursor_count)
-		return theme->cursors[type];
-
-	return NULL;
-}
-
 /** Get the cursor for a given name from a cursor theme
  *
  * \param theme The cursor theme
@@ -330,8 +313,8 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
  * such cursor
  */
 WL_EXPORT struct wl_cursor *
-wl_cursor_theme_get_cursor_by_name(struct wl_cursor_theme *theme,
-				   const char *name)
+wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
+			   const char *name)
 {
 	unsigned int i;
 	struct wl_cursor *cursor;
diff --git a/cursor/wayland-cursor.h b/cursor/wayland-cursor.h
index f8bf8d1..355cdb4 100644
--- a/cursor/wayland-cursor.h
+++ b/cursor/wayland-cursor.h
@@ -29,21 +29,6 @@
 extern "C" {
 #endif
 
-enum wl_cursor_type {
-	WL_CURSOR_BOTTOM_LEFT,
-	WL_CURSOR_BOTTOM_RIGHT,
-	WL_CURSOR_BOTTOM,
-	WL_CURSOR_DRAGGING,
-	WL_CURSOR_LEFT_PTR,
-	WL_CURSOR_LEFT,
-	WL_CURSOR_RIGHT,
-	WL_CURSOR_TOP_LEFT,
-	WL_CURSOR_TOP_RIGHT,
-	WL_CURSOR_TOP,
-	WL_CURSOR_IBEAM,
-	WL_CURSOR_HAND1,
-};
-
 struct wl_cursor_theme;
 
 struct wl_cursor_image {
@@ -70,11 +55,7 @@ wl_cursor_theme_destroy(struct wl_cursor_theme *theme);
 
 struct wl_cursor *
 wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
-			   enum wl_cursor_type type);
-
-struct wl_cursor *
-wl_cursor_theme_get_cursor_by_name(struct wl_cursor_theme *theme,
-				   const char *name);
+			   const char *name);
 
 struct wl_buffer *
 wl_cursor_image_get_buffer(struct wl_cursor_image *image);
-- 
1.7.4.1



More information about the wayland-devel mailing list