commit 5009ed3

Michael Forney  ·  2015-03-21 18:53:31 +0000 UTC
parent 83c6548
Drop swc_ prefix from internal structures and functions
53 files changed,  +257, -263
+2, -2
 1@@ -147,7 +147,7 @@ bool handle_button(struct pointer_handler * handler, uint32_t time,
 2     return handle_binding(time, &button->press, state, &find_button_binding);
 3 }
 4 
 5-bool swc_bindings_initialize(void)
 6+bool bindings_initialize(void)
 7 {
 8     wl_array_init(&key_bindings);
 9     wl_array_init(&button_bindings);
10@@ -155,7 +155,7 @@ bool swc_bindings_initialize(void)
11     return true;
12 }
13 
14-void swc_bindings_finalize(void)
15+void bindings_finalize(void)
16 {
17     wl_array_release(&key_bindings);
18     wl_array_release(&button_bindings);
+2, -2
 1@@ -32,8 +32,8 @@ struct swc_bindings
 2     struct pointer_handler * pointer_handler;
 3 };
 4 
 5-bool swc_bindings_initialize(void);
 6-void swc_bindings_finalize(void);
 7+bool bindings_initialize(void);
 8+void bindings_finalize(void);
 9 
10 #endif
11 
+11, -12
 1@@ -456,8 +456,7 @@ const static struct view_impl view_impl = {
 2     .move = &move
 3 };
 4 
 5-struct compositor_view * swc_compositor_create_view
 6-    (struct swc_surface * surface)
 7+struct compositor_view * compositor_create_view(struct surface * surface)
 8 {
 9     struct compositor_view * view;
10 
11@@ -481,7 +480,7 @@ struct compositor_view * swc_compositor_create_view
12     view->border.damaged = false;
13     pixman_region32_init(&view->clip);
14     wl_signal_init(&view->destroy_signal);
15-    swc_surface_set_view(surface, &view->base);
16+    surface_set_view(surface, &view->base);
17     wl_list_insert(&compositor.views, &view->link);
18 
19     return view;
20@@ -491,7 +490,7 @@ void compositor_view_destroy(struct compositor_view * view)
21 {
22     wl_signal_emit(&view->destroy_signal, NULL);
23     compositor_view_hide(view);
24-    swc_surface_set_view(view->surface, NULL);
25+    surface_set_view(view->surface, NULL);
26     view_finalize(&view->base);
27     pixman_region32_fini(&view->clip);
28     wl_list_remove(&view->link);
29@@ -741,7 +740,7 @@ bool handle_motion(struct pointer_handler * handler, uint32_t time,
30         if (!view->visible)
31             continue;
32 
33-        if (swc_rectangle_contains_point(&view->base.geometry, x, y)
34+        if (rectangle_contains_point(&view->base.geometry, x, y)
35             && pixman_region32_contains_point(&view->surface->state.input,
36                                               x - view->base.geometry.x,
37                                               y - view->base.geometry.y, NULL))
38@@ -774,7 +773,7 @@ static void handle_switch_vt(void * data, uint32_t time,
39 
40 static void handle_swc_event(struct wl_listener * listener, void * data)
41 {
42-    struct swc_event * event = data;
43+    struct event * event = data;
44 
45     switch (event->type)
46     {
47@@ -790,10 +789,10 @@ static void handle_swc_event(struct wl_listener * listener, void * data)
48 static void create_surface(struct wl_client * client,
49                            struct wl_resource * resource, uint32_t id)
50 {
51-    struct swc_surface * surface;
52+    struct surface * surface;
53 
54     /* Initialize surface. */
55-    surface = swc_surface_new(client, wl_resource_get_version(resource), id);
56+    surface = surface_new(client, wl_resource_get_version(resource), id);
57 
58     if (!surface)
59     {
60@@ -807,9 +806,9 @@ static void create_surface(struct wl_client * client,
61 static void create_region(struct wl_client * client,
62                           struct wl_resource * resource, uint32_t id)
63 {
64-    struct swc_region * region;
65+    struct region * region;
66 
67-    region = swc_region_new(client, wl_resource_get_version(resource), id);
68+    region = region_new(client, wl_resource_get_version(resource), id);
69 
70     if (!region)
71         wl_resource_post_no_memory(resource);
72@@ -834,7 +833,7 @@ static void bind_compositor(struct wl_client * client, void * data,
73                                    NULL, NULL);
74 }
75 
76-bool swc_compositor_initialize(void)
77+bool compositor_initialize(void)
78 {
79     struct screen * screen;
80     uint32_t keysym;
81@@ -874,7 +873,7 @@ bool swc_compositor_initialize(void)
82     return true;
83 }
84 
85-void swc_compositor_finalize(void)
86+void compositor_finalize(void)
87 {
88     pixman_region32_fini(&compositor.damage);
89     pixman_region32_fini(&compositor.opaque);
+6, -7
 1@@ -37,20 +37,20 @@ struct swc_compositor
 2         /**
 3          * Emitted when a new surface is created.
 4          *
 5-         * The data argument of the signal refers to the swc_surface that has
 6-         * been created.
 7+         * The data argument of the signal refers to the surface that has been
 8+         * created.
 9          */
10         struct wl_signal new_surface;
11     } signal;
12 };
13 
14-bool swc_compositor_initialize(void);
15-void swc_compositor_finalize(void);
16+bool compositor_initialize(void);
17+void compositor_finalize(void);
18 
19 struct compositor_view
20 {
21     struct view base;
22-    struct swc_surface * surface;
23+    struct surface * surface;
24     struct wld_buffer * buffer;
25     struct window * window;
26     struct compositor_view * parent;
27@@ -76,8 +76,7 @@ struct compositor_view
28     struct wl_signal destroy_signal;
29 };
30 
31-struct compositor_view * swc_compositor_create_view
32-    (struct swc_surface * surface);
33+struct compositor_view * compositor_create_view(struct surface * surface);
34 
35 void compositor_view_destroy(struct compositor_view * view);
36 
+1, -1
1@@ -98,7 +98,7 @@ static const struct view_impl view_impl = {
2 
3 static void handle_swc_event(struct wl_listener * listener, void * data)
4 {
5-    struct swc_event * event = data;
6+    struct event * event = data;
7     struct cursor_plane * plane
8         = wl_container_of(listener, plane, swc_listener);
9 
+1, -1
1@@ -169,7 +169,7 @@ struct wl_resource * data_offer_new(struct wl_client * client,
2 
3     offer = wl_resource_create(client, &wl_data_offer_interface, version, 0);
4     wl_resource_set_implementation(offer, &data_offer_implementation,
5-                                   data, &swc_remove_resource);
6+                                   data, &remove_resource);
7     wl_list_insert(&data->offers, wl_resource_get_link(offer));
8 
9     return offer;
+5, -5
 1@@ -57,8 +57,8 @@ static void set_selection(struct wl_client * client,
 2             (data_source, &data_device->selection_destroy_listener);
 3     }
 4 
 5-    swc_send_event(&data_device->event_signal,
 6-                   DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
 7+    send_event(&data_device->event_signal,
 8+               DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
 9 }
10 
11 static struct wl_data_device_interface data_device_implementation = {
12@@ -72,8 +72,8 @@ static void handle_selection_destroy(struct wl_listener * listener, void * data)
13         = wl_container_of(listener, data_device, selection_destroy_listener);
14 
15     data_device->selection = NULL;
16-    swc_send_event(&data_device->event_signal,
17-                   DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
18+    send_event(&data_device->event_signal,
19+               DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
20 }
21 
22 bool data_device_initialize(struct data_device * data_device)
23@@ -101,7 +101,7 @@ void data_device_bind(struct data_device * data_device,
24     resource = wl_resource_create(client, &wl_data_device_interface,
25                                   version, id);
26     wl_resource_set_implementation(resource, &data_device_implementation,
27-                                   data_device, &swc_remove_resource);
28+                                   data_device, &remove_resource);
29     wl_list_insert(&data_device->resources, &resource->link);
30 }
31 
+7, -7
 1@@ -103,7 +103,7 @@ static void create_prime_buffer(struct wl_client * client,
 2     if (!buffer)
 3         goto error0;
 4 
 5-    buffer_resource = swc_wayland_buffer_create_resource
 6+    buffer_resource = wayland_buffer_create_resource
 7         (client, wl_resource_get_version(resource), id, buffer);
 8 
 9     if (!buffer_resource)
10@@ -231,7 +231,7 @@ static void handle_vblank(int fd, unsigned int sequence, unsigned int sec,
11 static void handle_page_flip(int fd, unsigned int sequence, unsigned int sec,
12                              unsigned int usec, void * data)
13 {
14-    struct swc_drm_handler * handler = data;
15+    struct drm_handler * handler = data;
16 
17     handler->page_flip(handler, sec * 1000 + usec / 1000);
18 }
19@@ -268,7 +268,7 @@ static void bind_drm(struct wl_client * client, void * data, uint32_t version,
20     wl_drm_send_format(resource, WL_DRM_FORMAT_ARGB8888);
21 }
22 
23-bool swc_drm_initialize(void)
24+bool drm_initialize(void)
25 {
26     struct stat master, render;
27 
28@@ -361,7 +361,7 @@ bool swc_drm_initialize(void)
29     return false;
30 }
31 
32-void swc_drm_finalize(void)
33+void drm_finalize(void)
34 {
35     if (drm.global)
36         wl_global_destroy(drm.global);
37@@ -371,12 +371,12 @@ void swc_drm_finalize(void)
38     close(swc.drm->fd);
39 }
40 
41-bool swc_drm_create_screens(struct wl_list * screens)
42+bool drm_create_screens(struct wl_list * screens)
43 {
44     drmModeRes * resources;
45     drmModeConnector * connector;
46     uint32_t index;
47-    struct swc_output * output;
48+    struct output * output;
49     uint32_t taken_crtcs = 0;
50 
51     if (!(resources = drmModeGetResources(swc.drm->fd)))
52@@ -410,7 +410,7 @@ bool swc_drm_create_screens(struct wl_list * screens)
53                 break;
54             }
55 
56-            if (!(output = swc_output_new(connector)))
57+            if (!(output = output_new(connector)))
58                 continue;
59 
60             output->screen = screen_new(resources->crtcs[crtc_index], output);
+5, -5
 1@@ -5,9 +5,9 @@
 2 #include <stdint.h>
 3 #include <wayland-server.h>
 4 
 5-struct swc_drm_handler
 6+struct drm_handler
 7 {
 8-    void (* page_flip)(struct swc_drm_handler * handler, uint32_t time);
 9+    void (* page_flip)(struct drm_handler * handler, uint32_t time);
10 };
11 
12 struct swc_drm
13@@ -17,10 +17,10 @@ struct swc_drm
14     struct wld_renderer * renderer;
15 };
16 
17-bool swc_drm_initialize(void);
18-void swc_drm_finalize(void);
19+bool drm_initialize(void);
20+void drm_finalize(void);
21 
22-bool swc_drm_create_screens(struct wl_list * screens);
23+bool drm_create_screens(struct wl_list * screens);
24 
25 #endif
26 
+13, -13
  1@@ -48,7 +48,7 @@ static inline uint32_t timeval_to_msec(struct timeval * time)
  2     return time->tv_sec * 1000 + time->tv_usec / 1000;
  3 }
  4 
  5-static void handle_key_event(struct swc_evdev_device * device,
  6+static void handle_key_event(struct evdev_device * device,
  7                              struct input_event * input_event)
  8 {
  9     uint32_t time = timeval_to_msec(&input_event->time);
 10@@ -69,7 +69,7 @@ static void handle_key_event(struct swc_evdev_device * device,
 11     }
 12 }
 13 
 14-static void handle_rel_event(struct swc_evdev_device * device,
 15+static void handle_rel_event(struct evdev_device * device,
 16                              struct input_event * input_event)
 17 {
 18     uint32_t time = timeval_to_msec(&input_event->time);
 19@@ -99,12 +99,12 @@ static void handle_rel_event(struct swc_evdev_device * device,
 20     device->handler->axis(time, axis, amount);
 21 }
 22 
 23-static void handle_abs_event(struct swc_evdev_device * device,
 24+static void handle_abs_event(struct evdev_device * device,
 25                              struct input_event * input_event)
 26 {
 27 }
 28 
 29-static void (* event_handlers[])(struct swc_evdev_device * device,
 30+static void (* event_handlers[])(struct evdev_device * device,
 31                                  struct input_event * input_event) = {
 32     [EV_KEY] = &handle_key_event,
 33     [EV_REL] = &handle_rel_event,
 34@@ -117,7 +117,7 @@ static bool is_motion_event(struct input_event * event)
 35         || (event->type == EV_ABS && (event->code == ABS_X || event->code == ABS_Y));
 36 }
 37 
 38-static void handle_motion_events(struct swc_evdev_device * device,
 39+static void handle_motion_events(struct evdev_device * device,
 40                                  uint32_t time)
 41 {
 42     if (device->motion.rel.pending)
 43@@ -133,7 +133,7 @@ static void handle_motion_events(struct swc_evdev_device * device,
 44     }
 45 }
 46 
 47-static void handle_event(struct swc_evdev_device * device,
 48+static void handle_event(struct evdev_device * device,
 49                          struct input_event * event)
 50 {
 51     if (!is_motion_event(event))
 52@@ -146,7 +146,7 @@ static void handle_event(struct swc_evdev_device * device,
 53     }
 54 }
 55 
 56-static void close_device(struct swc_evdev_device * device)
 57+static void close_device(struct evdev_device * device)
 58 {
 59     wl_event_source_remove(device->source);
 60     close(device->fd);
 61@@ -156,7 +156,7 @@ static void close_device(struct swc_evdev_device * device)
 62 
 63 static int handle_data(int fd, uint32_t mask, void * data)
 64 {
 65-    struct swc_evdev_device * device = data;
 66+    struct evdev_device * device = data;
 67     struct input_event event;
 68     unsigned flags = device->needs_sync ? LIBEVDEV_READ_FLAG_FORCE_SYNC
 69                                         : LIBEVDEV_READ_FLAG_NORMAL;
 70@@ -196,10 +196,10 @@ static int handle_data(int fd, uint32_t mask, void * data)
 71     return 1;
 72 }
 73 
 74-struct swc_evdev_device * swc_evdev_device_new
 75-    (const char * path, const struct swc_evdev_device_handler * handler)
 76+struct evdev_device * evdev_device_new
 77+    (const char * path, const struct evdev_device_handler * handler)
 78 {
 79-    struct swc_evdev_device * device;
 80+    struct evdev_device * device;
 81 
 82     if (!(device = malloc(sizeof *device)))
 83         goto error0;
 84@@ -267,7 +267,7 @@ struct swc_evdev_device * swc_evdev_device_new
 85     return NULL;
 86 }
 87 
 88-void swc_evdev_device_destroy(struct swc_evdev_device * device)
 89+void evdev_device_destroy(struct evdev_device * device)
 90 {
 91     if (device->source)
 92         close_device(device);
 93@@ -277,7 +277,7 @@ void swc_evdev_device_destroy(struct swc_evdev_device * device)
 94     free(device);
 95 }
 96 
 97-bool swc_evdev_device_reopen(struct swc_evdev_device * device)
 98+bool evdev_device_reopen(struct evdev_device * device)
 99 {
100     if (device->source)
101         close_device(device);
+8, -8
 1@@ -32,10 +32,10 @@
 2 #include <linux/input.h>
 3 #include <wayland-util.h>
 4 
 5-struct swc_evdev_device;
 6+struct evdev_device;
 7 struct wl_event_loop;
 8 
 9-struct swc_evdev_device_handler
10+struct evdev_device_handler
11 {
12     void (* key)(uint32_t time, uint32_t key, uint32_t state);
13     void (* button)(uint32_t time, uint32_t key, uint32_t state);
14@@ -43,14 +43,14 @@ struct swc_evdev_device_handler
15     void (* relative_motion)(uint32_t time, wl_fixed_t dx, wl_fixed_t dy);
16 };
17 
18-struct swc_evdev_device
19+struct evdev_device
20 {
21     char * path;
22     int fd;
23     struct libevdev * dev;
24     bool needs_sync;
25 
26-    const struct swc_evdev_device_handler * handler;
27+    const struct evdev_device_handler * handler;
28 
29     struct
30     {
31@@ -78,12 +78,12 @@ struct swc_evdev_device
32     struct wl_list link;
33 };
34 
35-struct swc_evdev_device * swc_evdev_device_new
36-    (const char * path, const struct swc_evdev_device_handler * handler);
37+struct evdev_device * evdev_device_new
38+    (const char * path, const struct evdev_device_handler * handler);
39 
40-void swc_evdev_device_destroy(struct swc_evdev_device * device);
41+void evdev_device_destroy(struct evdev_device * device);
42 
43-bool swc_evdev_device_reopen(struct swc_evdev_device * device);
44+bool evdev_device_reopen(struct evdev_device * device);
45 
46 #endif
47 
+4, -4
 1@@ -10,7 +10,7 @@
 2  * An event is the data passed to the listeners of the event_signals of various
 3  * objects.
 4  */
 5-struct swc_event
 6+struct event
 7 {
 8     /**
 9      * The type of event that was sent.
10@@ -29,10 +29,10 @@ struct swc_event
11     void * data;
12 };
13 
14-static inline void swc_send_event(struct wl_signal * signal, uint32_t type,
15-                                  void * event_data)
16+static inline void send_event(struct wl_signal * signal, uint32_t type,
17+                              void * event_data)
18 {
19-    struct swc_event event = { .type = type, .data = event_data };
20+    struct event event = { .type = type, .data = event_data };
21 
22     wl_signal_emit(signal, &event);
23 }
+4, -4
 1@@ -82,7 +82,7 @@ static void send_frame(void * data)
 2 {
 3     struct framebuffer_plane * plane = data;
 4 
 5-    view_frame(&plane->view, swc_time());
 6+    view_frame(&plane->view, get_time());
 7 }
 8 
 9 static int attach(struct view * view, struct wld_buffer * buffer)
10@@ -167,7 +167,7 @@ const static struct view_impl view_impl = {
11     .move = &move
12 };
13 
14-static void handle_page_flip(struct swc_drm_handler * handler, uint32_t time)
15+static void handle_page_flip(struct drm_handler * handler, uint32_t time)
16 {
17     struct framebuffer_plane * plane
18         = wl_container_of(handler, plane, drm_handler);
19@@ -177,7 +177,7 @@ static void handle_page_flip(struct swc_drm_handler * handler, uint32_t time)
20 
21 static void handle_swc_event(struct wl_listener * listener, void * data)
22 {
23-    struct swc_event * event = data;
24+    struct event * event = data;
25     struct framebuffer_plane * plane
26         = wl_container_of(listener, plane, swc_listener);
27 
28@@ -190,7 +190,7 @@ static void handle_swc_event(struct wl_listener * listener, void * data)
29 }
30 
31 bool framebuffer_plane_initialize(struct framebuffer_plane * plane,
32-                                  uint32_t crtc, struct swc_mode * mode,
33+                                  uint32_t crtc, struct mode * mode,
34                                   uint32_t * connectors,
35                                   uint32_t num_connectors)
36 {
+3, -3
 1@@ -33,16 +33,16 @@ struct framebuffer_plane
 2 {
 3     uint32_t crtc;
 4     drmModeCrtcPtr original_crtc_state;
 5-    struct swc_mode mode;
 6+    struct mode mode;
 7     struct view view;
 8     struct wl_array connectors;
 9     bool need_modeset;
10-    struct swc_drm_handler drm_handler;
11+    struct drm_handler drm_handler;
12     struct wl_listener swc_listener;
13 };
14 
15 bool framebuffer_plane_initialize(struct framebuffer_plane * plane,
16-                                  uint32_t crtc, struct swc_mode * mode,
17+                                  uint32_t crtc, struct mode * mode,
18                                   uint32_t * connectors,
19                                   uint32_t num_connectors);
20 
+2, -3
 1@@ -121,7 +121,7 @@ void input_focus_remove_resource(struct input_focus * input_focus,
 2     if (resource == input_focus->resource)
 3         input_focus->resource = NULL;
 4 
 5-    swc_remove_resource(resource);
 6+    remove_resource(resource);
 7 }
 8 
 9 void input_focus_set(struct input_focus * input_focus,
10@@ -141,8 +141,7 @@ void input_focus_set(struct input_focus * input_focus,
11     /* Focus new view, if given. */
12     focus(input_focus, view);
13 
14-    swc_send_event(&input_focus->event_signal, INPUT_FOCUS_EVENT_CHANGED,
15-                   &data);
16+    send_event(&input_focus->event_signal, INPUT_FOCUS_EVENT_CHANGED, &data);
17 
18     return;
19 }
+3, -3
 1@@ -80,7 +80,7 @@ static bool client_handle_key(struct keyboard * keyboard, uint32_t time,
 2         {
 3             if (*value == key->press.value)
 4             {
 5-                swc_array_remove(&keyboard->client_keys, value, sizeof *value);
 6+                array_remove(&keyboard->client_keys, value, sizeof *value);
 7                 break;
 8             }
 9         }
10@@ -156,7 +156,7 @@ void keyboard_finalize(struct keyboard * keyboard)
11 void keyboard_reset(struct keyboard * keyboard)
12 {
13     struct key * key;
14-    uint32_t time = swc_time();
15+    uint32_t time = get_time();
16 
17     /* Send simulated key release events for all current key handlers. */
18     wl_array_for_each(key, &keyboard->keys)
19@@ -259,7 +259,7 @@ void keyboard_handle_key(struct keyboard * keyboard, uint32_t time,
20                 key->handler->key(keyboard, time, key, state);
21             }
22 
23-            swc_array_remove(&keyboard->keys, key, sizeof *key);
24+            array_remove(&keyboard->keys, key, sizeof *key);
25             goto update_xkb_state;
26         }
27     }
+3, -3
 1@@ -23,7 +23,7 @@
 2 
 3 #include "mode.h"
 4 
 5-bool swc_mode_initialize(struct swc_mode * mode, drmModeModeInfo * mode_info)
 6+bool mode_initialize(struct mode * mode, drmModeModeInfo * mode_info)
 7 {
 8     mode->width = mode_info->hdisplay;
 9     mode->height = mode_info->vdisplay;
10@@ -35,11 +35,11 @@ bool swc_mode_initialize(struct swc_mode * mode, drmModeModeInfo * mode_info)
11     return true;
12 }
13 
14-void swc_mode_finish(struct swc_mode * mode)
15+void mode_finish(struct mode * mode)
16 {
17 }
18 
19-bool swc_mode_equal(const struct swc_mode * mode1, const struct swc_mode * mode2)
20+bool mode_equal(const struct mode * mode1, const struct mode * mode2)
21 {
22     return mode1->width == mode2->width
23         && mode1->height == mode2->height
+4, -4
 1@@ -31,7 +31,7 @@
 2 
 3 #include <wayland-util.h>
 4 
 5-struct swc_mode
 6+struct mode
 7 {
 8     uint16_t width, height;
 9     uint32_t refresh;
10@@ -41,10 +41,10 @@ struct swc_mode
11     drmModeModeInfo info;
12 };
13 
14-bool swc_mode_initialize(struct swc_mode * mode, drmModeModeInfo * mode_info);
15-void swc_mode_finish(struct swc_mode * mode);
16+bool mode_initialize(struct mode * mode, drmModeModeInfo * mode_info);
17+void mode_finish(struct mode * mode);
18 
19-bool swc_mode_equal(const struct swc_mode * mode1, const struct swc_mode * mode2);
20+bool mode_equal(const struct mode * mode1, const struct mode * mode2);
21 
22 #endif
23 
+11, -12
 1@@ -14,9 +14,9 @@
 2 static void bind_output(struct wl_client * client, void * data,
 3                         uint32_t version, uint32_t id)
 4 {
 5-    struct swc_output * output = data;
 6+    struct output * output = data;
 7     struct screen * screen = output->screen;
 8-    struct swc_mode * mode;
 9+    struct mode * mode;
10     struct wl_resource * resource;
11     uint32_t flags;
12 
13@@ -31,8 +31,7 @@ static void bind_output(struct wl_client * client, void * data,
14         return;
15     }
16 
17-    wl_resource_set_implementation(resource, NULL, output,
18-                                   &swc_remove_resource);
19+    wl_resource_set_implementation(resource, NULL, output, &remove_resource);
20     wl_list_insert(&output->resources, wl_resource_get_link(resource));
21 
22     wl_output_send_geometry
23@@ -45,7 +44,7 @@ static void bind_output(struct wl_client * client, void * data,
24         flags = 0;
25         if (mode->preferred)
26             flags |= WL_OUTPUT_MODE_PREFERRED;
27-        if (swc_mode_equal(&screen->planes.framebuffer.mode, mode))
28+        if (mode_equal(&screen->planes.framebuffer.mode, mode))
29             flags |= WL_OUTPUT_MODE_CURRENT;
30 
31         wl_output_send_mode(resource, flags,
32@@ -56,10 +55,10 @@ static void bind_output(struct wl_client * client, void * data,
33         wl_output_send_done(resource);
34 }
35 
36-struct swc_output * swc_output_new(drmModeConnectorPtr connector)
37+struct output * output_new(drmModeConnectorPtr connector)
38 {
39-    struct swc_output * output;
40-    struct swc_mode * modes;
41+    struct output * output;
42+    struct mode * modes;
43     uint32_t index;
44 
45     if (!(output = malloc(sizeof *output)))
46@@ -94,7 +93,7 @@ struct swc_output * swc_output_new(drmModeConnectorPtr connector)
47 
48     for (index = 0; index < connector->count_modes; ++index)
49     {
50-        swc_mode_initialize(&modes[index], &connector->modes[index]);
51+        mode_initialize(&modes[index], &connector->modes[index]);
52 
53         if (modes[index].preferred)
54             output->preferred_mode = &modes[index];
55@@ -110,12 +109,12 @@ struct swc_output * swc_output_new(drmModeConnectorPtr connector)
56     return NULL;
57 }
58 
59-void swc_output_destroy(struct swc_output * output)
60+void output_destroy(struct output * output)
61 {
62-    struct swc_mode * mode;
63+    struct mode * mode;
64 
65     wl_array_for_each(mode, &output->modes)
66-        swc_mode_finish(mode);
67+        mode_finish(mode);
68     wl_array_release(&output->modes);
69 
70     wl_global_destroy(output->global);
+4, -4
 1@@ -8,7 +8,7 @@
 2 
 3 struct wl_display;
 4 
 5-struct swc_output
 6+struct output
 7 {
 8     struct screen * screen;
 9 
10@@ -16,7 +16,7 @@ struct swc_output
11     uint32_t physical_width, physical_height;
12 
13     struct wl_array modes;
14-    struct swc_mode * preferred_mode;
15+    struct mode * preferred_mode;
16 
17     pixman_region32_t current_damage, previous_damage;
18 
19@@ -28,8 +28,8 @@ struct swc_output
20     struct wl_list link;
21 };
22 
23-struct swc_output * swc_output_new(drmModeConnector * connector);
24-void swc_output_destroy(struct swc_output * output);
25+struct output * output_new(drmModeConnector * connector);
26+void output_destroy(struct output * output);
27 
28 #endif
29 
+2, -2
 1@@ -227,7 +227,7 @@ static void handle_surface_destroy(struct wl_listener * listener, void * data)
 2 }
 3 
 4 struct panel * panel_new(struct wl_client * client, uint32_t version,
 5-                         uint32_t id, struct swc_surface * surface)
 6+                         uint32_t id, struct surface * surface)
 7 {
 8     struct panel * panel;
 9 
10@@ -242,7 +242,7 @@ struct panel * panel_new(struct wl_client * client, uint32_t version,
11     if (!panel->resource)
12         goto error1;
13 
14-    if (!(panel->view = swc_compositor_create_view(surface)))
15+    if (!(panel->view = compositor_create_view(surface)))
16         goto error2;
17 
18     wl_resource_set_implementation(panel->resource, &panel_implementation,
+1, -1
1@@ -30,7 +30,7 @@
2 #include <wayland-server.h>
3 
4 struct panel * panel_new(struct wl_client * client, uint32_t version,
5-                         uint32_t id, struct swc_surface * surface);
6+                         uint32_t id, struct surface * surface);
7 
8 #endif
9 
+1, -1
1@@ -37,7 +37,7 @@ static void create_panel(struct wl_client * client,
2                          struct wl_resource * resource, uint32_t id,
3                          struct wl_resource * surface_resource)
4 {
5-    struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
6+    struct surface * surface = wl_resource_get_user_data(surface_resource);
7 
8     if (!panel_new(client, wl_resource_get_version(resource), id, surface))
9         wl_client_post_no_memory(client);
+4, -4
 1@@ -76,7 +76,7 @@ static bool update(struct view * view)
 2 static int attach(struct view * view, struct wld_buffer * buffer)
 3 {
 4     struct pointer * pointer = wl_container_of(view, pointer, cursor.view);
 5-    struct swc_surface * surface = pointer->cursor.surface;
 6+    struct surface * surface = pointer->cursor.surface;
 7 
 8     if (surface && !pixman_region32_not_empty(&surface->state.damage))
 9         return 0;
10@@ -292,7 +292,7 @@ static void set_cursor(struct wl_client * client,
11                        int32_t hotspot_x, int32_t hotspot_y)
12 {
13     struct pointer * pointer = wl_resource_get_user_data(resource);
14-    struct swc_surface * surface;
15+    struct surface * surface;
16 
17     if (pointer->cursor.surface)
18         wl_list_remove(&pointer->cursor.destroy_listener.link);
19@@ -305,7 +305,7 @@ static void set_cursor(struct wl_client * client,
20 
21     if (surface)
22     {
23-        swc_surface_set_view(surface, &pointer->cursor.view);
24+        surface_set_view(surface, &pointer->cursor.view);
25         wl_resource_add_destroy_listener(surface->resource,
26                                          &pointer->cursor.destroy_listener);
27         update_cursor(pointer);
28@@ -379,7 +379,7 @@ void pointer_handle_button(struct pointer * pointer, uint32_t time,
29                                             button, state);
30                 }
31 
32-                swc_array_remove(&pointer->buttons, button, sizeof *button);
33+                array_remove(&pointer->buttons, button, sizeof *button);
34                 break;
35             }
36         }
+1, -1
1@@ -57,7 +57,7 @@ struct pointer
2     struct
3     {
4         struct view view;
5-        struct swc_surface * surface;
6+        struct surface * surface;
7         struct wl_listener destroy_listener;
8         struct wld_buffer * buffer;
9 
+6, -6
 1@@ -11,7 +11,7 @@ static void destroy(struct wl_client * client, struct wl_resource * resource)
 2 static void add(struct wl_client * client, struct wl_resource * resource,
 3                 int32_t x, int32_t y, int32_t width, int32_t height)
 4 {
 5-    struct swc_region * region = wl_resource_get_user_data(resource);
 6+    struct region * region = wl_resource_get_user_data(resource);
 7 
 8     pixman_region32_union_rect(&region->region, &region->region,
 9                                x, y, width, height);
10@@ -20,7 +20,7 @@ static void add(struct wl_client * client, struct wl_resource * resource,
11 static void subtract(struct wl_client * client, struct wl_resource * resource,
12                      int32_t x, int32_t y, int32_t width, int32_t height)
13 {
14-    struct swc_region * region = wl_resource_get_user_data(resource);
15+    struct region * region = wl_resource_get_user_data(resource);
16     pixman_region32_t operand;
17 
18     pixman_region32_init_rect(&operand, x, y, width, height);
19@@ -35,7 +35,7 @@ static const struct wl_region_interface region_implementation = {
20 
21 static void region_destroy(struct wl_resource * resource)
22 {
23-    struct swc_region * region = wl_resource_get_user_data(resource);
24+    struct region * region = wl_resource_get_user_data(resource);
25 
26     /* Finish the region. */
27     pixman_region32_fini(&region->region);
28@@ -43,10 +43,10 @@ static void region_destroy(struct wl_resource * resource)
29     free(region);
30 }
31 
32-struct swc_region * swc_region_new(struct wl_client * client,
33-                                   uint32_t version, uint32_t id)
34+struct region * region_new(struct wl_client * client,
35+                           uint32_t version, uint32_t id)
36 {
37-    struct swc_region * region;
38+    struct region * region;
39 
40     region = malloc(sizeof *region);
41 
+3, -3
 1@@ -6,14 +6,14 @@
 2 
 3 struct wl_client;
 4 
 5-struct swc_region
 6+struct region
 7 {
 8     struct wl_resource * resource;
 9     pixman_region32_t region;
10 };
11 
12-struct swc_region * swc_region_new(struct wl_client * client,
13-                                   uint32_t version, uint32_t id);
14+struct region * region_new(struct wl_client * client,
15+                           uint32_t version, uint32_t id);
16 
17 #endif
18 
+6, -7
 1@@ -61,7 +61,7 @@ bool screens_initialize(void)
 2 {
 3     wl_list_init(&swc.screens);
 4 
 5-    if (!swc_drm_create_screens(&swc.screens))
 6+    if (!drm_create_screens(&swc.screens))
 7         return false;
 8 
 9     if (wl_list_empty(&swc.screens))
10@@ -95,12 +95,11 @@ static void bind_screen(struct wl_client * client, void * data,
11         return;
12     }
13 
14-    wl_resource_set_implementation(resource, NULL,
15-                                   screen, &swc_remove_resource);
16+    wl_resource_set_implementation(resource, NULL, screen, &remove_resource);
17     wl_list_insert(&screen->resources, wl_resource_get_link(resource));
18 }
19 
20-struct screen * screen_new(uint32_t crtc, struct swc_output * output)
21+struct screen * screen_new(uint32_t crtc, struct output * output)
22 {
23     struct screen * screen;
24     int32_t x = 0;
25@@ -163,7 +162,7 @@ struct screen * screen_new(uint32_t crtc, struct swc_output * output)
26 
27 void screen_destroy(struct screen * screen)
28 {
29-    struct swc_output * output, * next;
30+    struct output * output, * next;
31 
32     if (active_screen == screen)
33         active_screen = NULL;
34@@ -171,7 +170,7 @@ void screen_destroy(struct screen * screen)
35         screen->handler->destroy(screen->handler_data);
36     wl_signal_emit(&screen->destroy_signal, NULL);
37     wl_list_for_each_safe(output, next, &screen->outputs, link)
38-        swc_output_destroy(output);
39+        output_destroy(output);
40     framebuffer_plane_finalize(&screen->planes.framebuffer);
41     cursor_plane_finalize(&screen->planes.cursor);
42     free(screen);
43@@ -222,7 +221,7 @@ bool handle_motion(struct pointer_handler * handler, uint32_t time,
44 
45     wl_list_for_each(screen, &swc.screens, link)
46     {
47-        if (swc_rectangle_contains_point(&screen->base.geometry, x, y))
48+        if (rectangle_contains_point(&screen->base.geometry, x, y))
49         {
50             if (screen != active_screen)
51             {
+2, -2
 1@@ -30,7 +30,7 @@
 2 
 3 #include <wayland-util.h>
 4 
 5-struct swc_output;
 6+struct output;
 7 struct pixman_region32;
 8 
 9 struct screen_modifier
10@@ -72,7 +72,7 @@ struct screen
11 bool screens_initialize(void);
12 void screens_finalize(void);
13 
14-struct screen * screen_new(uint32_t crtc, struct swc_output * output);
15+struct screen * screen_new(uint32_t crtc, struct output * output);
16 void screen_destroy(struct screen * screen);
17 
18 static inline uint32_t screen_mask(struct screen * screen)
+14, -14
  1@@ -95,7 +95,7 @@ static void handle_relative_motion(uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
  2 static void handle_keyboard_focus_event(struct wl_listener * listener,
  3                                         void * data)
  4 {
  5-    struct swc_event * event = data;
  6+    struct event * event = data;
  7     struct input_focus_event_data * event_data = event->data;
  8 
  9     switch (event->type)
 10@@ -119,7 +119,7 @@ static struct wl_listener keyboard_focus_listener = {
 11 
 12 static void handle_data_device_event(struct wl_listener * listener, void * data)
 13 {
 14-    struct swc_event * event = data;
 15+    struct event * event = data;
 16 
 17     switch (event->type)
 18     {
 19@@ -140,7 +140,7 @@ static struct wl_listener data_device_listener = {
 20 
 21 static void handle_swc_event(struct wl_listener * listener, void * data)
 22 {
 23-    struct swc_event * event = data;
 24+    struct event * event = data;
 25 
 26     switch (event->type)
 27     {
 28@@ -156,15 +156,15 @@ static void handle_swc_event(struct wl_listener * listener, void * data)
 29             if (libinput_resume(seat.libinput) != 0)
 30                 WARNING("Failed to resume libinput context\n");
 31 #else
 32-            struct swc_evdev_device * device, * next;
 33+            struct evdev_device * device, * next;
 34 
 35             /* Re-open all input devices */
 36             wl_list_for_each_safe(device, next, &seat.devices, link)
 37             {
 38-                if (!swc_evdev_device_reopen(device))
 39+                if (!evdev_device_reopen(device))
 40                 {
 41                     wl_list_remove(&device->link);
 42-                    swc_evdev_device_destroy(device);
 43+                    evdev_device_destroy(device);
 44                 }
 45             }
 46 #endif
 47@@ -209,7 +209,7 @@ static void bind_seat(struct wl_client * client, void * data, uint32_t version,
 48 
 49     resource = wl_resource_create(client, &wl_seat_interface, version, id);
 50     wl_resource_set_implementation(resource, &seat_implementation, NULL,
 51-                                   &swc_remove_resource);
 52+                                   &remove_resource);
 53     wl_list_insert(&seat.resources, wl_resource_get_link(resource));
 54 
 55     if (version >= 2)
 56@@ -404,7 +404,7 @@ void finalize_libinput(void)
 57     udev_unref(seat.udev);
 58 }
 59 #else
 60-const static struct swc_evdev_device_handler evdev_handler = {
 61+const static struct evdev_device_handler evdev_handler = {
 62     .key = &handle_key,
 63     .button = &handle_button,
 64     .axis = &handle_axis,
 65@@ -413,9 +413,9 @@ const static struct swc_evdev_device_handler evdev_handler = {
 66 
 67 static void add_device(const char * path)
 68 {
 69-    struct swc_evdev_device * device;
 70+    struct evdev_device * device;
 71 
 72-    if (!(device = swc_evdev_device_new(path, &evdev_handler)))
 73+    if (!(device = evdev_device_new(path, &evdev_handler)))
 74     {
 75         ERROR("Could not create evdev device\n");
 76         return;
 77@@ -460,7 +460,7 @@ static bool add_devices(void)
 78 }
 79 #endif
 80 
 81-bool swc_seat_initialize(const char * seat_name)
 82+bool seat_initialize(const char * seat_name)
 83 {
 84     if (!(seat.name = strdup(seat_name)))
 85     {
 86@@ -527,14 +527,14 @@ bool swc_seat_initialize(const char * seat_name)
 87     return false;
 88 }
 89 
 90-void swc_seat_finalize(void)
 91+void seat_finalize(void)
 92 {
 93 #ifdef ENABLE_LIBINPUT
 94     finalize_libinput();
 95 #else
 96-    struct swc_evdev_device * device, * tmp;
 97+    struct evdev_device * device, * tmp;
 98     wl_list_for_each_safe(device, tmp, &seat.devices, link)
 99-        swc_evdev_device_destroy(device);
100+        evdev_device_destroy(device);
101 #endif
102 
103     pointer_finalize(&seat.pointer);
+3, -3
 1@@ -33,9 +33,9 @@ struct swc_seat
 2     struct data_device * data_device;
 3 };
 4 
 5-bool swc_seat_initialize(const char * seat_name);
 6-void swc_seat_finalize(void);
 7-void swc_seat_reopen_devices(void);
 8+bool seat_initialize(const char * seat_name);
 9+void seat_finalize(void);
10+void seat_reopen_devices(void);
11 
12 #endif
13 
+3, -3
 1@@ -36,7 +36,7 @@ static void get_shell_surface(struct wl_client * client,
 2                               struct wl_resource * resource, uint32_t id,
 3                               struct wl_resource * surface_resource)
 4 {
 5-    struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
 6+    struct surface * surface = wl_resource_get_user_data(surface_resource);
 7     struct shell_surface * shell_surface;
 8 
 9     shell_surface = shell_surface_new(client, wl_resource_get_version(resource),
10@@ -62,7 +62,7 @@ static void bind_shell(struct wl_client * client, void * data,
11     wl_resource_set_implementation(resource, &shell_implementation, NULL, NULL);
12 }
13 
14-bool swc_shell_initialize(void)
15+bool shell_initialize(void)
16 {
17     shell.global = wl_global_create(swc.display, &wl_shell_interface, 1,
18                                     NULL, &bind_shell);
19@@ -70,7 +70,7 @@ bool swc_shell_initialize(void)
20     return shell.global;
21 }
22 
23-void swc_shell_finalize(void)
24+void shell_finalize(void)
25 {
26     wl_global_destroy(shell.global);
27 }
+2, -2
 1@@ -26,8 +26,8 @@
 2 
 3 #include <stdbool.h>
 4 
 5-bool swc_shell_initialize(void);
 6-void swc_shell_finalize(void);
 7+bool shell_initialize(void);
 8+void shell_finalize(void);
 9 
10 #endif
11 
+4, -4
 1@@ -118,7 +118,7 @@ static void set_transient(struct wl_client * client,
 2                           int32_t x, int32_t y, uint32_t flags)
 3 {
 4     struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
 5-    struct swc_surface * parent_surface
 6+    struct surface * parent_surface
 7         = wl_resource_get_user_data(parent_resource);
 8     struct compositor_view * parent_view
 9         = compositor_view(parent_surface->view);
10@@ -136,7 +136,7 @@ static void set_fullscreen(struct wl_client * client,
11                            struct wl_resource * output_resource)
12 {
13     struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
14-    struct swc_output * output = output_resource
15+    struct output * output = output_resource
16         ? wl_resource_get_user_data(output_resource) : NULL;
17     struct screen * screen;
18 
19@@ -155,7 +155,7 @@ static void set_popup(struct wl_client * client, struct wl_resource * resource,
20                       int32_t x, int32_t y, uint32_t flags)
21 {
22     struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
23-    struct swc_surface * parent_surface
24+    struct surface * parent_surface
25         = wl_resource_get_user_data(parent_resource);
26     struct compositor_view * parent_view
27         = compositor_view(parent_surface->view);
28@@ -229,7 +229,7 @@ static void destroy_shell_surface(struct wl_resource * resource)
29 
30 struct shell_surface * shell_surface_new(struct wl_client * client,
31                                          uint32_t version, uint32_t id,
32-                                         struct swc_surface * surface)
33+                                         struct surface * surface)
34 {
35     struct shell_surface * shell_surface;
36 
+2, -2
 1@@ -26,12 +26,12 @@
 2 
 3 #include <stdint.h>
 4 
 5-struct swc_surface;
 6+struct surface;
 7 struct wl_client;
 8 
 9 struct shell_surface * shell_surface_new(struct wl_client * client,
10                                          uint32_t version, uint32_t id,
11-                                         struct swc_surface * surface);
12+                                         struct surface * surface);
13 
14 #endif
15 
+3, -3
 1@@ -121,7 +121,7 @@ static void create_buffer(struct wl_client * client,
 2     if (!buffer)
 3         goto error0;
 4 
 5-    buffer_resource = swc_wayland_buffer_create_resource
 6+    buffer_resource = wayland_buffer_create_resource
 7         (client, wl_resource_get_version(resource), id, buffer);
 8 
 9     if (!buffer_resource)
10@@ -237,7 +237,7 @@ static void bind_shm(struct wl_client * client, void * data, uint32_t version,
11     wl_shm_send_format(resource, WL_SHM_FORMAT_ARGB8888);
12 }
13 
14-bool swc_shm_initialize(void)
15+bool shm_initialize(void)
16 {
17     if (!(swc.shm->context = wld_pixman_create_context()))
18         goto error0;
19@@ -261,7 +261,7 @@ bool swc_shm_initialize(void)
20     return false;
21 }
22 
23-void swc_shm_finalize(void)
24+void shm_finalize(void)
25 {
26     wl_global_destroy(shm.global);
27     wld_destroy_renderer(swc.shm->renderer);
+2, -2
 1@@ -32,9 +32,9 @@ struct swc_shm
 2     struct wld_renderer * renderer;
 3 };
 4 
 5-bool swc_shm_initialize(void);
 6+bool shm_initialize(void);
 7 
 8-void swc_shm_finalize(void);
 9+void shm_finalize(void);
10 
11 #endif
12 
+33, -34
  1@@ -40,13 +40,13 @@
  2  */
  3 static void handle_buffer_destroy(struct wl_listener * listener, void * data)
  4 {
  5-    struct swc_surface_state * state;
  6+    struct surface_state * state;
  7 
  8     state = wl_container_of(listener, state, buffer_destroy_listener);
  9     state->buffer = NULL;
 10 }
 11 
 12-static void state_initialize(struct swc_surface_state * state)
 13+static void state_initialize(struct surface_state * state)
 14 {
 15     state->buffer = NULL;
 16     state->buffer_destroy_listener.notify = &handle_buffer_destroy;
 17@@ -58,7 +58,7 @@ static void state_initialize(struct swc_surface_state * state)
 18     wl_list_init(&state->frame_callbacks);
 19 }
 20 
 21-static void state_finalize(struct swc_surface_state * state)
 22+static void state_finalize(struct surface_state * state)
 23 {
 24     struct wl_resource * resource, * tmp;
 25 
 26@@ -81,11 +81,10 @@ static void state_finalize(struct swc_surface_state * state)
 27  * In order to set the buffer of a surface state (current or pending), we need
 28  * to manage the destroy listeners we have for the new and old buffer.
 29  */
 30-static void state_set_buffer(struct swc_surface_state * state,
 31+static void state_set_buffer(struct surface_state * state,
 32                              struct wl_resource * resource)
 33 {
 34-    struct wld_buffer * buffer = resource ? swc_wayland_buffer_get(resource)
 35-                                          : NULL;
 36+    struct wld_buffer * buffer = resource ? wayland_buffer_get(resource) : NULL;
 37 
 38     if (state->buffer)
 39     {
 40@@ -107,7 +106,7 @@ static void state_set_buffer(struct swc_surface_state * state,
 41 
 42 static void handle_frame(struct view_handler * handler, uint32_t time)
 43 {
 44-    struct swc_surface * surface
 45+    struct surface * surface
 46         = wl_container_of(handler, surface, view_handler);
 47     struct wl_resource * resource, * tmp;
 48 
 49@@ -124,10 +123,10 @@ static void handle_frame(struct view_handler * handler, uint32_t time)
 50 static void handle_screens(struct view_handler * handler,
 51                            uint32_t entered, uint32_t left)
 52 {
 53-    struct swc_surface * surface
 54+    struct surface * surface
 55         = wl_container_of(handler, surface, view_handler);
 56     struct screen * screen;
 57-    struct swc_output * output;
 58+    struct output * output;
 59     struct wl_client * client;
 60     struct wl_resource * resource;
 61 
 62@@ -167,9 +166,9 @@ static void destroy(struct wl_client * client, struct wl_resource * resource)
 63 static void attach(struct wl_client * client, struct wl_resource * resource,
 64                    struct wl_resource * buffer_resource, int32_t x, int32_t y)
 65 {
 66-    struct swc_surface * surface = wl_resource_get_user_data(resource);
 67+    struct surface * surface = wl_resource_get_user_data(resource);
 68 
 69-    surface->pending.commit |= SWC_SURFACE_COMMIT_ATTACH;
 70+    surface->pending.commit |= SURFACE_COMMIT_ATTACH;
 71 
 72     state_set_buffer(&surface->pending.state, buffer_resource);
 73     surface->pending.x = x;
 74@@ -179,9 +178,9 @@ static void attach(struct wl_client * client, struct wl_resource * resource,
 75 static void damage(struct wl_client * client, struct wl_resource * resource,
 76                    int32_t x, int32_t y, int32_t width, int32_t height)
 77 {
 78-    struct swc_surface * surface = wl_resource_get_user_data(resource);
 79+    struct surface * surface = wl_resource_get_user_data(resource);
 80 
 81-    surface->pending.commit |= SWC_SURFACE_COMMIT_DAMAGE;
 82+    surface->pending.commit |= SURFACE_COMMIT_DAMAGE;
 83 
 84     pixman_region32_union_rect(&surface->pending.state.damage,
 85                                &surface->pending.state.damage,
 86@@ -191,15 +190,15 @@ static void damage(struct wl_client * client, struct wl_resource * resource,
 87 static void frame(struct wl_client * client, struct wl_resource * resource,
 88                   uint32_t id)
 89 {
 90-    struct swc_surface * surface = wl_resource_get_user_data(resource);
 91+    struct surface * surface = wl_resource_get_user_data(resource);
 92     struct wl_resource * callback_resource;
 93 
 94-    surface->pending.commit |= SWC_SURFACE_COMMIT_FRAME;
 95+    surface->pending.commit |= SURFACE_COMMIT_FRAME;
 96 
 97     callback_resource = wl_resource_create(client, &wl_callback_interface,
 98                                            1, id);
 99     wl_resource_set_implementation(callback_resource, NULL, NULL,
100-                                   &swc_remove_resource);
101+                                   &remove_resource);
102     wl_list_insert(surface->pending.state.frame_callbacks.prev,
103                    wl_resource_get_link(callback_resource));
104 }
105@@ -208,13 +207,13 @@ static void set_opaque_region(struct wl_client * client,
106                               struct wl_resource * resource,
107                               struct wl_resource * region_resource)
108 {
109-    struct swc_surface * surface = wl_resource_get_user_data(resource);
110+    struct surface * surface = wl_resource_get_user_data(resource);
111 
112-    surface->pending.commit |= SWC_SURFACE_COMMIT_OPAQUE;
113+    surface->pending.commit |= SURFACE_COMMIT_OPAQUE;
114 
115     if (region_resource)
116     {
117-        struct swc_region * region = wl_resource_get_user_data(region_resource);
118+        struct region * region = wl_resource_get_user_data(region_resource);
119 
120         pixman_region32_copy(&surface->pending.state.opaque, &region->region);
121     }
122@@ -226,13 +225,13 @@ static void set_input_region(struct wl_client * client,
123                              struct wl_resource * resource,
124                              struct wl_resource * region_resource)
125 {
126-    struct swc_surface * surface = wl_resource_get_user_data(resource);
127+    struct surface * surface = wl_resource_get_user_data(resource);
128 
129-    surface->pending.commit |= SWC_SURFACE_COMMIT_INPUT;
130+    surface->pending.commit |= SURFACE_COMMIT_INPUT;
131 
132     if (region_resource)
133     {
134-        struct swc_region * region = wl_resource_get_user_data(region_resource);
135+        struct region * region = wl_resource_get_user_data(region_resource);
136 
137         pixman_region32_copy(&surface->pending.state.input, &region->region);
138     }
139@@ -250,11 +249,11 @@ static inline void trim_region(pixman_region32_t * region,
140 
141 static void commit(struct wl_client * client, struct wl_resource * resource)
142 {
143-    struct swc_surface * surface = wl_resource_get_user_data(resource);
144+    struct surface * surface = wl_resource_get_user_data(resource);
145     struct wld_buffer * buffer;
146 
147     /* Attach */
148-    if (surface->pending.commit & SWC_SURFACE_COMMIT_ATTACH)
149+    if (surface->pending.commit & SURFACE_COMMIT_ATTACH)
150     {
151         if (surface->state.buffer
152             && surface->state.buffer != surface->pending.state.buffer)
153@@ -269,7 +268,7 @@ static void commit(struct wl_client * client, struct wl_resource * resource)
154     buffer = surface->state.buffer;
155 
156     /* Damage */
157-    if (surface->pending.commit & SWC_SURFACE_COMMIT_DAMAGE)
158+    if (surface->pending.commit & SURFACE_COMMIT_DAMAGE)
159     {
160         pixman_region32_union(&surface->state.damage, &surface->state.damage,
161                               &surface->pending.state.damage);
162@@ -277,21 +276,21 @@ static void commit(struct wl_client * client, struct wl_resource * resource)
163     }
164 
165     /* Opaque */
166-    if (surface->pending.commit & SWC_SURFACE_COMMIT_OPAQUE)
167+    if (surface->pending.commit & SURFACE_COMMIT_OPAQUE)
168     {
169         pixman_region32_copy(&surface->state.opaque,
170                              &surface->pending.state.opaque);
171     }
172 
173     /* Input */
174-    if (surface->pending.commit & SWC_SURFACE_COMMIT_INPUT)
175+    if (surface->pending.commit & SURFACE_COMMIT_INPUT)
176     {
177         pixman_region32_copy(&surface->state.input,
178                              &surface->pending.state.input);
179     }
180 
181     /* Frame */
182-    if (surface->pending.commit & SWC_SURFACE_COMMIT_FRAME)
183+    if (surface->pending.commit & SURFACE_COMMIT_FRAME)
184     {
185         wl_list_insert_list(&surface->state.frame_callbacks,
186                             &surface->pending.state.frame_callbacks);
187@@ -303,7 +302,7 @@ static void commit(struct wl_client * client, struct wl_resource * resource)
188 
189     if (surface->view)
190     {
191-        if (surface->pending.commit & SWC_SURFACE_COMMIT_ATTACH)
192+        if (surface->pending.commit & SURFACE_COMMIT_ATTACH)
193             view_attach(surface->view, buffer);
194         view_update(surface->view);
195     }
196@@ -337,7 +336,7 @@ static struct wl_surface_interface surface_implementation = {
197 
198 static void surface_destroy(struct wl_resource * resource)
199 {
200-    struct swc_surface * surface = wl_resource_get_user_data(resource);
201+    struct surface * surface = wl_resource_get_user_data(resource);
202 
203     state_finalize(&surface->state);
204     state_finalize(&surface->pending.state);
205@@ -355,10 +354,10 @@ static void surface_destroy(struct wl_resource * resource)
206  *
207  * @return The newly allocated surface.
208  */
209-struct swc_surface * swc_surface_new(struct wl_client * client,
210-                                     uint32_t version, uint32_t id)
211+struct surface * surface_new(struct wl_client * client,
212+                             uint32_t version, uint32_t id)
213 {
214-    struct swc_surface * surface;
215+    struct surface * surface;
216 
217     surface = malloc(sizeof *surface);
218 
219@@ -382,7 +381,7 @@ struct swc_surface * swc_surface_new(struct wl_client * client,
220     return surface;
221 }
222 
223-void swc_surface_set_view(struct swc_surface * surface, struct view * view)
224+void surface_set_view(struct surface * surface, struct view * view)
225 {
226     if (surface->view == view)
227         return;
+12, -12
 1@@ -32,14 +32,14 @@
 2 
 3 enum
 4 {
 5-    SWC_SURFACE_COMMIT_ATTACH = (1 << 0),
 6-    SWC_SURFACE_COMMIT_DAMAGE = (1 << 1),
 7-    SWC_SURFACE_COMMIT_OPAQUE = (1 << 2),
 8-    SWC_SURFACE_COMMIT_INPUT = (1 << 3),
 9-    SWC_SURFACE_COMMIT_FRAME = (1 << 4)
10+    SURFACE_COMMIT_ATTACH = (1 << 0),
11+    SURFACE_COMMIT_DAMAGE = (1 << 1),
12+    SURFACE_COMMIT_OPAQUE = (1 << 2),
13+    SURFACE_COMMIT_INPUT = (1 << 3),
14+    SURFACE_COMMIT_FRAME = (1 << 4)
15 };
16 
17-struct swc_surface_state
18+struct surface_state
19 {
20     struct wld_buffer * buffer;
21     struct wl_resource * buffer_resource;
22@@ -57,15 +57,15 @@ struct swc_surface_state
23     struct wl_list frame_callbacks;
24 };
25 
26-struct swc_surface
27+struct surface
28 {
29     struct wl_resource * resource;
30 
31-    struct swc_surface_state state;
32+    struct surface_state state;
33 
34     struct
35     {
36-        struct swc_surface_state state;
37+        struct surface_state state;
38         uint32_t commit;
39         int32_t x, y;
40     } pending;
41@@ -74,10 +74,10 @@ struct swc_surface
42     struct view_handler view_handler;
43 };
44 
45-struct swc_surface * swc_surface_new(struct wl_client * client,
46-                                     uint32_t version, uint32_t id);
47+struct surface * surface_new(struct wl_client * client,
48+                             uint32_t version, uint32_t id);
49 
50-void swc_surface_set_view(struct swc_surface * surface, struct view * view);
51+void surface_set_view(struct surface * surface, struct view * view);
52 
53 #endif
54 
+21, -21
  1@@ -101,13 +101,13 @@ static void setup_compositor(void)
  2 void swc_activate(void)
  3 {
  4     swc.active = true;
  5-    swc_send_event(&swc.event_signal, SWC_EVENT_ACTIVATED, NULL);
  6+    send_event(&swc.event_signal, SWC_EVENT_ACTIVATED, NULL);
  7 }
  8 
  9 void swc_deactivate(void)
 10 {
 11     swc.active = false;
 12-    swc_send_event(&swc.event_signal, SWC_EVENT_DEACTIVATED, NULL);
 13+    send_event(&swc.event_signal, SWC_EVENT_DEACTIVATED, NULL);
 14 }
 15 
 16 EXPORT
 17@@ -121,25 +121,25 @@ bool swc_initialize(struct wl_display * display,
 18     const char * default_seat = "seat0";
 19     wl_signal_init(&swc.event_signal);
 20 
 21-    if (!(launch_initialize()))
 22+    if (!launch_initialize())
 23     {
 24         ERROR("Could not connect to swc-launch\n");
 25         goto error0;
 26     }
 27 
 28-    if (!swc_drm_initialize())
 29+    if (!drm_initialize())
 30     {
 31         ERROR("Could not initialize DRM\n");
 32         goto error1;
 33     }
 34 
 35-    if (!swc_shm_initialize())
 36+    if (!shm_initialize())
 37     {
 38         ERROR("Could not initialize SHM\n");
 39         goto error2;
 40     }
 41 
 42-    if (!swc_bindings_initialize())
 43+    if (!bindings_initialize())
 44     {
 45         ERROR("Could not initialize bindings\n");
 46         goto error3;
 47@@ -151,7 +151,7 @@ bool swc_initialize(struct wl_display * display,
 48         goto error4;
 49     }
 50 
 51-    if (!swc_compositor_initialize())
 52+    if (!compositor_initialize())
 53     {
 54         ERROR("Could not initialize compositor\n");
 55         goto error5;
 56@@ -163,13 +163,13 @@ bool swc_initialize(struct wl_display * display,
 57         goto error6;
 58     }
 59 
 60-    if (!swc_seat_initialize(default_seat))
 61+    if (!seat_initialize(default_seat))
 62     {
 63         ERROR("Could not initialize seat\n");
 64         goto error7;
 65     }
 66 
 67-    if (!swc_shell_initialize())
 68+    if (!shell_initialize())
 69     {
 70         ERROR("Could not initialize shell\n");
 71         goto error8;
 72@@ -206,21 +206,21 @@ bool swc_initialize(struct wl_display * display,
 73   error10:
 74     xdg_shell_finalize();
 75   error9:
 76-    swc_shell_finalize();
 77+    shell_finalize();
 78   error8:
 79-    swc_seat_finalize();
 80+    seat_finalize();
 81   error7:
 82     data_device_manager_finalize();
 83   error6:
 84-    swc_compositor_finalize();
 85+    compositor_finalize();
 86   error5:
 87     screens_finalize();
 88   error4:
 89-    swc_bindings_finalize();
 90+    bindings_finalize();
 91   error3:
 92-    swc_shm_finalize();
 93+    shm_finalize();
 94   error2:
 95-    swc_drm_finalize();
 96+    drm_finalize();
 97   error1:
 98     launch_finalize();
 99   error0:
100@@ -234,14 +234,14 @@ void swc_finalize(void)
101     xserver_finalize();
102 #endif
103     panel_manager_finalize();
104-    swc_shell_finalize();
105-    swc_seat_finalize();
106+    shell_finalize();
107+    seat_finalize();
108     data_device_manager_finalize();
109-    swc_compositor_finalize();
110+    compositor_finalize();
111     screens_finalize();
112-    swc_bindings_finalize();
113-    swc_shm_finalize();
114-    swc_drm_finalize();
115+    bindings_finalize();
116+    shm_finalize();
117+    drm_finalize();
118     launch_finalize();
119 }
120 
+1, -1
1@@ -30,7 +30,7 @@ pixman_box32_t infinite_extents = {
2     .x2 = INT32_MAX, .y2 = INT32_MAX
3 };
4 
5-void swc_remove_resource(struct wl_resource * resource)
6+void remove_resource(struct wl_resource * resource)
7 {
8     wl_list_remove(wl_resource_get_link(resource));
9 }
+7, -7
 1@@ -62,9 +62,9 @@
 2 
 3 struct wl_resource;
 4 
 5-void swc_remove_resource(struct wl_resource * resource);
 6+void remove_resource(struct wl_resource * resource);
 7 
 8-static inline uint32_t swc_time(void)
 9+static inline uint32_t get_time(void)
10 {
11     struct timeval timeval;
12 
13@@ -74,15 +74,15 @@ static inline uint32_t swc_time(void)
14 
15 extern pixman_box32_t infinite_extents;
16 
17-static inline bool swc_rectangle_contains_point
18+static inline bool rectangle_contains_point
19     (const struct swc_rectangle * rectangle, int32_t x, int32_t y)
20 {
21     return x > rectangle->x && x < rectangle->x + rectangle->width
22         && y > rectangle->y && y < rectangle->y + rectangle->height;
23 }
24 
25-static inline bool swc_rectangle_overlap
26-    (const struct swc_rectangle * r1, const struct swc_rectangle * r2)
27+static inline bool rectangle_overlap(const struct swc_rectangle * r1,
28+                                     const struct swc_rectangle * r2)
29 {
30     return (MAX(r1->x + r1->width, r2->x + r2->width) - MIN(r1->x, r2->x)
31             < r1->width + r2->width)
32@@ -90,8 +90,8 @@ static inline bool swc_rectangle_overlap
33             < r1->height + r2->height);
34 }
35 
36-static inline void swc_array_remove(struct wl_array * array,
37-                                    void * item, size_t size)
38+static inline void array_remove(struct wl_array * array,
39+                                void * item, size_t size)
40 {
41     size_t bytes = array->size - ((intptr_t) item + size - (intptr_t) array->data);
42     if (bytes > 0)
+1, -1
1@@ -144,7 +144,7 @@ void view_update_screens(struct view * view)
2 
3     wl_list_for_each(screen, &swc.screens, link)
4     {
5-        if (swc_rectangle_overlap(&screen->base.geometry, &view->geometry))
6+        if (rectangle_overlap(&screen->base.geometry, &view->geometry))
7             screens |= screen_mask(screen);
8     }
9 
+2, -2
 1@@ -38,7 +38,7 @@ static const struct wl_buffer_interface buffer_implementation = {
 2     .destroy = &destroy
 3 };
 4 
 5-struct wld_buffer * swc_wayland_buffer_get(struct wl_resource * resource)
 6+struct wld_buffer * wayland_buffer_get(struct wl_resource * resource)
 7 {
 8     if (wl_resource_instance_of(resource, &wl_buffer_interface,
 9                                 &buffer_implementation))
10@@ -56,7 +56,7 @@ static void destroy_buffer(struct wl_resource * resource)
11     wld_buffer_unreference(buffer);
12 }
13 
14-struct wl_resource * swc_wayland_buffer_create_resource
15+struct wl_resource * wayland_buffer_create_resource
16     (struct wl_client * client, uint32_t version, uint32_t id,
17      struct wld_buffer * buffer)
18 {
+2, -2
 1@@ -29,9 +29,9 @@
 2 struct wl_client;
 3 struct wl_resource;
 4 
 5-struct wld_buffer * swc_wayland_buffer_get(struct wl_resource * resource);
 6+struct wld_buffer * wayland_buffer_get(struct wl_resource * resource);
 7 
 8-struct wl_resource * swc_wayland_buffer_create_resource
 9+struct wl_resource * wayland_buffer_create_resource
10     (struct wl_client * client, uint32_t version, uint32_t id,
11      struct wld_buffer * buffer);
12 
+4, -4
 1@@ -40,7 +40,7 @@ static const struct swc_window_handler null_handler;
 2 
 3 static void handle_window_enter(struct wl_listener * listener, void * data)
 4 {
 5-    struct swc_event * event = data;
 6+    struct event * event = data;
 7     struct input_focus_event_data * event_data = event->data;
 8     struct window * window;
 9 
10@@ -96,7 +96,7 @@ static void end_interaction(struct window_pointer_interaction * interaction,
11         }
12 
13         interaction->original_handler->button(interaction->original_handler,
14-                                              swc_time(), button,
15+                                              get_time(), button,
16                                               WL_POINTER_BUTTON_STATE_RELEASED);
17     }
18 
19@@ -384,7 +384,7 @@ static const struct view_handler_impl view_handler_impl = {
20 };
21 
22 bool window_initialize(struct window * window, const struct window_impl * impl,
23-                       struct swc_surface * surface)
24+                       struct surface * surface)
25 {
26     DEBUG("Initializing window, %p\n", window);
27 
28@@ -392,7 +392,7 @@ bool window_initialize(struct window * window, const struct window_impl * impl,
29     window->base.app_id = NULL;
30     window->base.parent = NULL;
31 
32-    if (!(window->view = swc_compositor_create_view(surface)))
33+    if (!(window->view = compositor_create_view(surface)))
34         return false;
35 
36     window->impl = impl;
+1, -1
1@@ -92,7 +92,7 @@ struct window_impl
2 extern struct wl_listener window_enter_listener;
3 
4 bool window_initialize(struct window * window, const struct window_impl * impl,
5-                       struct swc_surface * surface);
6+                       struct surface * surface);
7 
8 void window_finalize(struct window * window);
9 
+3, -3
 1@@ -65,8 +65,8 @@ static void destroy_popup(struct wl_resource * resource)
 2 
 3 struct xdg_popup * xdg_popup_new(struct wl_client * client,
 4                                  uint32_t version, uint32_t id,
 5-                                 struct swc_surface * surface,
 6-                                 struct swc_surface * parent_surface,
 7+                                 struct surface * surface,
 8+                                 struct surface * parent_surface,
 9                                  int32_t x, int32_t y)
10 {
11     struct xdg_popup * popup;
12@@ -92,7 +92,7 @@ struct xdg_popup * xdg_popup_new(struct wl_client * client,
13     wl_resource_set_implementation(popup->resource, &xdg_popup_implementation,
14                                    popup, &destroy_popup);
15 
16-    if (!(popup->view = swc_compositor_create_view(surface)))
17+    if (!(popup->view = compositor_create_view(surface)))
18         goto error2;
19 
20     view_move(&popup->view->base,
+3, -3
 1@@ -26,13 +26,13 @@
 2 
 3 #include <stdint.h>
 4 
 5-struct swc_surface;
 6+struct surface;
 7 struct wl_client;
 8 
 9 struct xdg_popup * xdg_popup_new(struct wl_client * client,
10                                  uint32_t version, uint32_t id,
11-                                 struct swc_surface * surface,
12-                                 struct swc_surface * parent,
13+                                 struct surface * surface,
14+                                 struct surface * parent,
15                                  int32_t x, int32_t y);
16 
17 #endif
+3, -3
 1@@ -54,7 +54,7 @@ static void get_xdg_surface(struct wl_client * client,
 2                             struct wl_resource * resource, uint32_t id,
 3                             struct wl_resource * surface_resource)
 4 {
 5-    struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
 6+    struct surface * surface = wl_resource_get_user_data(surface_resource);
 7     struct xdg_surface * xdg_surface;
 8 
 9     xdg_surface = xdg_surface_new(client, wl_resource_get_version(resource), id,
10@@ -71,8 +71,8 @@ static void get_xdg_popup(struct wl_client * client,
11                           struct wl_resource * seat_resource,
12                           uint32_t serial, int32_t x, int32_t y)
13 {
14-    struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
15-    struct swc_surface * parent = wl_resource_get_user_data(parent_resource);
16+    struct surface * surface = wl_resource_get_user_data(surface_resource);
17+    struct surface * parent = wl_resource_get_user_data(parent_resource);
18     struct xdg_popup * popup;
19 
20     popup = xdg_popup_new(client, wl_resource_get_version(resource), id,
+2, -2
 1@@ -70,7 +70,7 @@ static bool remove_state(struct xdg_surface * xdg_surface, uint32_t state)
 2     {
 3         if (*current_state == state)
 4         {
 5-            swc_array_remove(&xdg_surface->states, current_state, sizeof state);
 6+            array_remove(&xdg_surface->states, current_state, sizeof state);
 7             return true;
 8         }
 9     }
10@@ -303,7 +303,7 @@ static void destroy_xdg_surface(struct wl_resource * resource)
11 
12 struct xdg_surface * xdg_surface_new(struct wl_client * client,
13                                      uint32_t version, uint32_t id,
14-                                     struct swc_surface * surface)
15+                                     struct surface * surface)
16 {
17     struct xdg_surface * xdg_surface;
18 
+2, -2
 1@@ -26,12 +26,12 @@
 2 
 3 #include <stdint.h>
 4 
 5-struct swc_surface;
 6+struct surface;
 7 struct wl_client;
 8 
 9 struct xdg_surface * xdg_surface_new(struct wl_client * client,
10                                      uint32_t version, uint32_t id,
11-                                     struct swc_surface * surface);
12+                                     struct surface * surface);
13 
14 #endif
15 
+2, -2
 1@@ -260,7 +260,7 @@ static void handle_surface_destroy(struct wl_listener * listener, void * data)
 2 static bool manage_window(struct xwl_window * xwl_window)
 3 {
 4     struct wl_resource * resource;
 5-    struct swc_surface * surface;
 6+    struct surface * surface;
 7     xcb_get_geometry_cookie_t geometry_cookie;
 8     xcb_get_geometry_reply_t * geometry_reply;
 9 
10@@ -311,7 +311,7 @@ static bool manage_window(struct xwl_window * xwl_window)
11 
12 static void handle_new_surface(struct wl_listener * listener, void * data)
13 {
14-    struct swc_surface * surface = data;
15+    struct surface * surface = data;
16     struct xwl_window * window;
17 
18     window = find_window_by_surface_id(&xwm.unpaired_windows,