commit 50e7d71

Michael Forney  ·  2013-09-05 08:53:26 +0000 UTC
parent 6b8e13e
Just use uint32_t instead of enum wld_format

Forward declarations of enum don't really make sense.
9 files changed,  +12, -20
+1, -1
1@@ -113,7 +113,7 @@ void wld_pixman_destroy_context(struct wld_pixman_context * context)
2 
3 struct wld_drawable * wld_pixman_create_drawable
4     (struct wld_pixman_context * context, uint32_t width, uint32_t height,
5-     void * data, uint32_t pitch, enum wld_format format)
6+     void * data, uint32_t pitch, uint32_t format)
7 {
8     struct pixman_drawable * pixman;
9 
+1, -2
 1@@ -28,7 +28,6 @@
 2 
 3 struct wld_pixman_context;
 4 struct wld_drawable;
 5-enum wld_format;
 6 
 7 /**
 8  * Create a new drawing context which uses Pixman to do software rendering on
 9@@ -48,7 +47,7 @@ void wld_pixman_destroy_context(struct wld_pixman_context * context);
10  */
11 struct wld_drawable * wld_pixman_create_drawable
12     (struct wld_pixman_context * context, uint32_t width, uint32_t height,
13-     void * data, uint32_t pitch, enum wld_format format);
14+     void * data, uint32_t pitch, uint32_t format);
15 
16 #endif
17 
+1, -1
1@@ -190,7 +190,7 @@ int wld_wayland_drm_get_fd(struct wld_wayland_drm_context * drm)
2 
3 struct wld_drawable * wld_wayland_drm_create_drawable
4     (struct wld_wayland_drm_context * drm, uint32_t width, uint32_t height,
5-     enum wld_format format, struct wl_buffer ** buffer)
6+     uint32_t format, struct wl_buffer ** buffer)
7 {
8     struct wld_drawable * drawable;
9 
+2, -3
 1@@ -29,7 +29,6 @@
 2 
 3 struct wld_wayland_drm_context;
 4 struct wld_drawable;
 5-enum wld_format;
 6 
 7 struct wl_display;
 8 struct wl_event_queue;
 9@@ -53,7 +52,7 @@ void wld_wayland_drm_destroy_context(struct wld_wayland_drm_context * context);
10  * @see enum wld_format
11  */
12 bool wld_wayland_drm_has_format(struct wld_wayland_drm_context * context,
13-                                enum wld_format format);
14+                                uint32_t format);
15 
16 /**
17  * Get the opened file descriptor for the DRM device.
18@@ -65,7 +64,7 @@ int wld_wayland_drm_get_fd(struct wld_wayland_drm_context * context);
19  */
20 struct wld_drawable * wld_wayland_drm_create_drawable
21     (struct wld_wayland_drm_context * context, uint32_t width, uint32_t height,
22-     enum wld_format format, struct wl_buffer ** buffer);
23+     uint32_t format, struct wl_buffer ** buffer);
24 
25 #endif
26 
+1, -2
 1@@ -27,7 +27,6 @@
 2 #include <stdint.h>
 3 
 4 struct wld_drawable;
 5-enum wld_format format;
 6 
 7 struct wl_display;
 8 struct wl_event_queue;
 9@@ -37,7 +36,7 @@ typedef void * (* wayland_create_context_func_t)(struct wl_display * display,
10                                                  struct wl_event_queue * queue);
11 typedef void (* wayland_destroy_context_func_t)(void * context);
12 typedef struct wld_drawable * (* wayland_create_drawable_func_t)
13-    (void * context, uint32_t width, uint32_t height, enum wld_format format,
14+    (void * context, uint32_t width, uint32_t height, uint32_t format,
15      struct wl_buffer ** buffer);
16 
17 struct wld_wayland_interface
+2, -2
 1@@ -64,7 +64,7 @@ const static struct wl_shm_listener shm_listener = {
 2     .format = &shm_format,
 3 };
 4 
 5-static inline uint32_t wayland_format(enum wld_format format)
 6+static inline uint32_t wayland_format(uint32_t format)
 7 {
 8     switch (format)
 9     {
10@@ -153,7 +153,7 @@ bool wld_shm_has_format(struct wld_shm_context * shm, uint32_t format)
11 
12 struct wld_drawable * wld_shm_create_drawable(struct wld_shm_context * shm,
13                                               uint32_t width, uint32_t height,
14-                                              enum wld_format format,
15+                                              uint32_t format,
16                                               struct wl_buffer ** buffer)
17 {
18     char name[] = "/tmp/wld-XXXXXX";
+2, -4
 1@@ -29,7 +29,6 @@
 2 
 3 struct wld_shm_context;
 4 struct wld_drawable;
 5-enum wld_format;
 6 
 7 struct wl_display;
 8 struct wl_event_queue;
 9@@ -52,15 +51,14 @@ void wld_shm_destroy_context(struct wld_shm_context * context);
10  *
11  * @see enum wld_format
12  */
13-bool wld_shm_has_format(struct wld_shm_context * context,
14-                        enum wld_format format);
15+bool wld_shm_has_format(struct wld_shm_context * context, uint32_t format);
16 
17 /**
18  * Create a new SHM drawable with the specified dimensions.
19  */
20 struct wld_drawable * wld_shm_create_drawable(struct wld_shm_context * context,
21                                               uint32_t width, uint32_t height,
22-                                              enum wld_format format,
23+                                              uint32_t format,
24                                               struct wl_buffer ** buffer);
25 
26 #endif
+1, -2
 1@@ -196,8 +196,7 @@ void wld_wayland_destroy_context(struct wld_wayland_context * wayland)
 2 
 3 struct wld_drawable * wld_wayland_create_drawable
 4     (struct wld_wayland_context * context, struct wl_surface * surface,
 5-     uint32_t width, uint32_t height, enum wld_format format,
 6-     uint32_t damage_flags)
 7+     uint32_t width, uint32_t height, uint32_t format, uint32_t damage_flags)
 8 {
 9     struct wayland_drawable * wayland;
10 
+1, -3
 1@@ -31,7 +31,6 @@ struct wl_surface;
 2 struct wl_buffer;
 3 
 4 struct wld_wayland_context;
 5-enum wld_format;
 6 
 7 enum wld_wayland_interface_id
 8 {
 9@@ -97,8 +96,7 @@ void wld_wayland_destroy_context(struct wld_wayland_context * context);
10  */
11 struct wld_drawable * wld_wayland_create_drawable
12     (struct wld_wayland_context * context, struct wl_surface * surface,
13-     uint32_t width, uint32_t height, enum wld_format format,
14-     uint32_t damage_flags);
15+     uint32_t width, uint32_t height, uint32_t format, uint32_t damage_flags);
16 
17 /**
18  * Enable or disable damage tracking on the specified Wayland drawable.