commit c396572

Michael Forney  ·  2014-02-24 08:35:16 +0000 UTC
parent 5234b83
view: Drop swc_ prefix for non-public structures/functions
16 files changed,  +134, -139
+19, -19
  1@@ -54,7 +54,7 @@ struct target
  2 {
  3     struct wld_surface * surface;
  4     struct wld_buffer * next_buffer, * current_buffer;
  5-    struct swc_view * view;
  6+    struct view * view;
  7     struct wl_listener view_listener;
  8     uint32_t mask;
  9 
 10@@ -118,11 +118,11 @@ static struct target * target_get(struct screen * screen)
 11 static void handle_screen_view_event(struct wl_listener * listener, void * data)
 12 {
 13     struct swc_event * event = data;
 14-    struct swc_view_event_data * event_data = event->data;
 15+    struct view_event_data * event_data = event->data;
 16 
 17     switch (event->type)
 18     {
 19-        case SWC_VIEW_EVENT_FRAME:
 20+        case VIEW_EVENT_FRAME:
 21         {
 22             struct screen * screen = CONTAINER_OF
 23                 (event_data->view, typeof(*screen), planes.framebuffer.view);
 24@@ -137,7 +137,7 @@ static void handle_screen_view_event(struct wl_listener * listener, void * data)
 25             wl_list_for_each(view, &compositor.views, link)
 26             {
 27                 if (view->base.screens & screen_mask(screen))
 28-                    swc_view_frame(&view->base, event_data->frame.time);
 29+                    view_frame(&view->base, event_data->frame.time);
 30             }
 31 
 32             if (target->current_buffer)
 33@@ -158,7 +158,7 @@ static bool target_swap_buffers(struct target * target)
 34 {
 35     target->next_buffer = wld_surface_take(target->surface);
 36 
 37-    if (!swc_view_attach(target->view, target->next_buffer))
 38+    if (!view_attach(target->view, target->next_buffer))
 39     {
 40         ERROR("Failed to attach next frame to screen\n");
 41         return false;
 42@@ -402,7 +402,7 @@ static void schedule_updates(uint32_t screens)
 43     compositor.scheduled_updates |= screens;
 44 }
 45 
 46-static bool update(struct swc_view * base)
 47+static bool update(struct view * base)
 48 {
 49     struct compositor_view * view = (void *) base;
 50 
 51@@ -414,7 +414,7 @@ static bool update(struct swc_view * base)
 52     return true;
 53 }
 54 
 55-static bool attach(struct swc_view * base, struct wld_buffer * buffer)
 56+static bool attach(struct view * base, struct wld_buffer * buffer)
 57 {
 58     struct compositor_view * view = (void *) base;
 59 
 60@@ -427,12 +427,12 @@ static bool attach(struct swc_view * base, struct wld_buffer * buffer)
 61         update(&view->base);
 62     }
 63 
 64-    swc_view_set_size_from_buffer(&view->base, buffer);
 65+    view_set_size_from_buffer(&view->base, buffer);
 66 
 67     return true;
 68 }
 69 
 70-static bool move(struct swc_view * base, int32_t x, int32_t y)
 71+static bool move(struct view * base, int32_t x, int32_t y)
 72 {
 73     struct compositor_view * view = (void *) base;
 74 
 75@@ -442,12 +442,12 @@ static bool move(struct swc_view * base, int32_t x, int32_t y)
 76         update(&view->base);
 77     }
 78 
 79-    swc_view_set_position(&view->base, x, y);
 80+    view_set_position(&view->base, x, y);
 81 
 82     return true;
 83 }
 84 
 85-const static struct swc_view_impl view_impl = {
 86+const static struct view_impl view_impl = {
 87     .update = &update,
 88     .attach = &attach,
 89     .move = &move
 90@@ -461,7 +461,7 @@ static void handle_view_event(struct wl_listener * listener, void * data)
 91 
 92     switch (event->type)
 93     {
 94-        case SWC_VIEW_EVENT_MOVED:
 95+        case VIEW_EVENT_MOVED:
 96             update_extents(view);
 97 
 98             if (view->visible)
 99@@ -471,17 +471,17 @@ static void handle_view_event(struct wl_listener * listener, void * data)
100                 pixman_region32_init(&view->clip);
101 
102                 damage_below_view(view);
103-                swc_view_update_screens(&view->base);
104+                view_update_screens(&view->base);
105                 update(&view->base);
106             }
107             break;
108-        case SWC_VIEW_EVENT_RESIZED:
109+        case VIEW_EVENT_RESIZED:
110             update_extents(view);
111 
112             if (view->visible)
113             {
114                 damage_below_view(view);
115-                swc_view_update_screens(&view->base);
116+                view_update_screens(&view->base);
117                 update(&view->base);
118             }
119             break;
120@@ -498,7 +498,7 @@ struct compositor_view * swc_compositor_create_view
121     if (!view)
122         return NULL;
123 
124-    swc_view_initialize(&view->base, &view_impl);
125+    view_initialize(&view->base, &view_impl);
126     view->event_listener.notify = &handle_view_event;
127     wl_signal_add(&view->base.event_signal, &view->event_listener);
128     view->surface = surface;
129@@ -521,7 +521,7 @@ void compositor_view_destroy(struct compositor_view * view)
130 {
131     compositor_view_hide(view);
132     swc_surface_set_view(view->surface, NULL);
133-    swc_view_finalize(&view->base);
134+    view_finalize(&view->base);
135     pixman_region32_fini(&view->clip);
136     free(view);
137 }
138@@ -536,7 +536,7 @@ void compositor_view_show(struct compositor_view * view)
139     pixman_region32_clear(&view->clip);
140 
141     view->visible = true;
142-    swc_view_update_screens(&view->base);
143+    view_update_screens(&view->base);
144 
145     damage_view(view);
146     update(&view->base);
147@@ -553,7 +553,7 @@ void compositor_view_hide(struct compositor_view * view)
148     damage_below_view(view);
149 
150     wl_list_remove(&view->link);
151-    swc_view_set_screens(&view->base, 0);
152+    view_set_screens(&view->base, 0);
153     view->visible = false;
154 }
155 
+1, -1
1@@ -39,7 +39,7 @@ void swc_compositor_finalize();
2 
3 struct compositor_view
4 {
5-    struct swc_view base;
6+    struct view base;
7     struct wl_listener event_listener;
8     struct swc_surface * surface;
9     struct wld_buffer * buffer;
+7, -7
 1@@ -33,12 +33,12 @@
 2 #include <wld/drm.h>
 3 #include <xf86drmMode.h>
 4 
 5-static bool update(struct swc_view * view)
 6+static bool update(struct view * view)
 7 {
 8     return true;
 9 }
10 
11-static bool attach(struct swc_view * view, struct wld_buffer * buffer)
12+static bool attach(struct view * view, struct wld_buffer * buffer)
13 {
14     struct cursor_plane * plane = CONTAINER_OF(view, typeof(*plane), view);
15 
16@@ -68,12 +68,12 @@ static bool attach(struct swc_view * view, struct wld_buffer * buffer)
17         }
18     }
19 
20-    swc_view_set_size_from_buffer(view, buffer);
21+    view_set_size_from_buffer(view, buffer);
22 
23     return true;
24 }
25 
26-static bool move(struct swc_view * view, int32_t x, int32_t y)
27+static bool move(struct view * view, int32_t x, int32_t y)
28 {
29     struct cursor_plane * plane = CONTAINER_OF(view, typeof(*plane), view);
30 
31@@ -84,12 +84,12 @@ static bool move(struct swc_view * view, int32_t x, int32_t y)
32         return false;
33     }
34 
35-    swc_view_set_position(view, x, y);
36+    view_set_position(view, x, y);
37 
38     return true;
39 }
40 
41-static const struct swc_view_impl view_impl = {
42+static const struct view_impl view_impl = {
43     .update = &update,
44     .attach = &attach,
45     .move = &move
46@@ -120,7 +120,7 @@ bool cursor_plane_initialize(struct cursor_plane * plane, uint32_t crtc,
47     plane->crtc = crtc;
48     plane->launch_listener.notify = &handle_launch_event;
49     wl_signal_add(&swc.launch->event_signal, &plane->launch_listener);
50-    swc_view_initialize(&plane->view, &view_impl);
51+    view_initialize(&plane->view, &view_impl);
52 
53     return true;
54 }
+1, -1
1@@ -28,7 +28,7 @@
2 
3 struct cursor_plane
4 {
5-    struct swc_view view;
6+    struct view view;
7     const struct swc_rectangle * origin;
8     uint32_t crtc;
9     struct wl_listener launch_listener;
+8, -8
 1@@ -71,7 +71,7 @@ static void framebuffer_destroy(struct wld_destructor * destructor)
 2     free(framebuffer);
 3 }
 4 
 5-static bool update(struct swc_view * view)
 6+static bool update(struct view * view)
 7 {
 8     return true;
 9 }
10@@ -80,10 +80,10 @@ static void send_frame(void * data)
11 {
12     struct framebuffer_plane * plane = data;
13 
14-    swc_view_frame(&plane->view, swc_time());
15+    view_frame(&plane->view, swc_time());
16 }
17 
18-static bool attach(struct swc_view * view, struct wld_buffer * buffer)
19+static bool attach(struct view * view, struct wld_buffer * buffer)
20 {
21     struct framebuffer_plane * plane
22         = CONTAINER_OF(view, typeof(*plane), view);
23@@ -146,14 +146,14 @@ static bool attach(struct swc_view * view, struct wld_buffer * buffer)
24     return true;
25 }
26 
27-static bool move(struct swc_view * view, int32_t x, int32_t y)
28+static bool move(struct view * view, int32_t x, int32_t y)
29 {
30-    swc_view_set_position(view, x, y);
31+    view_set_position(view, x, y);
32 
33     return true;
34 }
35 
36-const static struct swc_view_impl view_impl = {
37+const static struct view_impl view_impl = {
38     .update = &update,
39     .attach = &attach,
40     .move = &move
41@@ -164,7 +164,7 @@ static void handle_page_flip(struct swc_drm_handler * handler, uint32_t time)
42     struct framebuffer_plane * plane
43         = CONTAINER_OF(handler, typeof(*plane), drm_handler);
44 
45-    swc_view_frame(&plane->view, time);
46+    view_frame(&plane->view, time);
47 }
48 
49 bool framebuffer_plane_initialize(struct framebuffer_plane * plane,
50@@ -203,7 +203,7 @@ bool framebuffer_plane_initialize(struct framebuffer_plane * plane,
51     plane->crtc = crtc;
52     plane->drm_handler.page_flip = &handle_page_flip;
53     plane->need_modeset = true;
54-    swc_view_initialize(&plane->view, &view_impl);
55+    view_initialize(&plane->view, &view_impl);
56     plane->view.geometry.width = mode->width;
57     plane->view.geometry.height = mode->height;
58     plane->mode = *mode;
+1, -1
1@@ -34,7 +34,7 @@ struct framebuffer_plane
2     uint32_t crtc;
3     drmModeCrtcPtr original_crtc_state;
4     struct swc_mode mode;
5-    struct swc_view view;
6+    struct view view;
7     struct wl_array connectors;
8     bool need_modeset;
9     struct swc_drm_handler drm_handler;
+2, -2
 1@@ -78,7 +78,7 @@ static void update_position(struct panel * panel)
 2         default: return;
 3     }
 4 
 5-    swc_view_move(&panel->view->base, x, y);
 6+    view_move(&panel->view->base, x, y);
 7 }
 8 
 9 static void dock(struct wl_client * client, struct wl_resource * resource,
10@@ -229,7 +229,7 @@ static void handle_view_event(struct wl_listener * listener, void * data)
11 
12     switch (event->type)
13     {
14-        case SWC_VIEW_EVENT_RESIZED:
15+        case VIEW_EVENT_RESIZED:
16             update_position(panel);
17             break;
18     }
+24, -24
  1@@ -74,15 +74,15 @@ static void handle_cursor_surface_destroy(struct wl_listener * listener,
  2     struct pointer * pointer
  3         = CONTAINER_OF(listener, typeof(*pointer), cursor.destroy_listener);
  4 
  5-    swc_view_attach(&pointer->cursor.view, NULL);
  6+    view_attach(&pointer->cursor.view, NULL);
  7 }
  8 
  9-static bool update(struct swc_view * view)
 10+static bool update(struct view * view)
 11 {
 12     return true;
 13 }
 14 
 15-static bool attach(struct swc_view * view, struct wld_buffer * buffer)
 16+static bool attach(struct view * view, struct wld_buffer * buffer)
 17 {
 18     struct pointer * pointer
 19         = CONTAINER_OF(view, typeof(*pointer), cursor.view);
 20@@ -102,19 +102,19 @@ static bool attach(struct swc_view * view, struct wld_buffer * buffer)
 21 
 22     /* TODO: Send an early release to the buffer */
 23 
 24-    swc_view_set_size_from_buffer(view, buffer);
 25+    view_set_size_from_buffer(view, buffer);
 26 
 27     return true;
 28 }
 29 
 30-static bool move(struct swc_view * view, int32_t x, int32_t y)
 31+static bool move(struct view * view, int32_t x, int32_t y)
 32 {
 33-    swc_view_set_position(view, x, y);
 34+    view_set_position(view, x, y);
 35 
 36     return true;
 37 }
 38 
 39-static const struct swc_view_impl view_impl = {
 40+static const struct view_impl view_impl = {
 41     .update = &update,
 42     .attach = &attach,
 43     .move = &move,
 44@@ -125,34 +125,34 @@ static void handle_view_event(struct wl_listener * listener, void * data)
 45     struct pointer * pointer
 46         = CONTAINER_OF(listener, typeof(*pointer), cursor.view_listener);
 47     struct swc_event * event = data;
 48-    struct swc_view_event_data * event_data = event->data;
 49-    struct swc_view * view = event_data->view;
 50+    struct view_event_data * event_data = event->data;
 51+    struct view * view = event_data->view;
 52     struct screen * screen;
 53 
 54     switch (event->type)
 55     {
 56-        case SWC_VIEW_EVENT_MOVED:
 57+        case VIEW_EVENT_MOVED:
 58             wl_list_for_each(screen, &swc.screens, link)
 59             {
 60-                swc_view_move(&screen->planes.cursor.view,
 61-                              view->geometry.x, view->geometry.y);
 62+                view_move(&screen->planes.cursor.view,
 63+                          view->geometry.x, view->geometry.y);
 64             }
 65 
 66-            swc_view_update_screens(view);
 67+            view_update_screens(view);
 68             break;
 69-        case SWC_VIEW_EVENT_RESIZED:
 70-            swc_view_update_screens(view);
 71+        case VIEW_EVENT_RESIZED:
 72+            view_update_screens(view);
 73             break;
 74-        case SWC_VIEW_EVENT_SCREENS_CHANGED:
 75+        case VIEW_EVENT_SCREENS_CHANGED:
 76             wl_list_for_each(screen, &swc.screens, link)
 77             {
 78                 if (event_data->screens_changed.entered & screen_mask(screen))
 79                 {
 80-                    swc_view_attach(&screen->planes.cursor.view,
 81-                                    pointer->cursor.buffer);
 82+                    view_attach(&screen->planes.cursor.view,
 83+                                pointer->cursor.buffer);
 84                 }
 85                 else if (event_data->screens_changed.left & screen_mask(screen))
 86-                    swc_view_attach(&screen->planes.cursor.view, NULL);
 87+                    view_attach(&screen->planes.cursor.view, NULL);
 88             }
 89             break;
 90     }
 91@@ -160,9 +160,9 @@ static void handle_view_event(struct wl_listener * listener, void * data)
 92 
 93 static inline void update_cursor(struct pointer * pointer)
 94 {
 95-    swc_view_move(&pointer->cursor.view,
 96-                  wl_fixed_to_int(pointer->x) - pointer->cursor.hotspot.x,
 97-                  wl_fixed_to_int(pointer->y) - pointer->cursor.hotspot.y);
 98+    view_move(&pointer->cursor.view,
 99+              wl_fixed_to_int(pointer->x) - pointer->cursor.hotspot.x,
100+              wl_fixed_to_int(pointer->y) - pointer->cursor.hotspot.y);
101 }
102 
103 void pointer_set_cursor(struct pointer * pointer, uint32_t id)
104@@ -186,7 +186,7 @@ void pointer_set_cursor(struct pointer * pointer, uint32_t id)
105     pointer->cursor.hotspot.x = cursor->hotspot_x;
106     pointer->cursor.hotspot.y = cursor->hotspot_y;
107     update_cursor(pointer);
108-    swc_view_attach(&pointer->cursor.view, pointer->cursor.internal_buffer);
109+    view_attach(&pointer->cursor.view, pointer->cursor.internal_buffer);
110 }
111 
112 static bool client_handle_button(struct pointer_handler * handler,
113@@ -257,7 +257,7 @@ bool pointer_initialize(struct pointer * pointer)
114     wl_list_insert(&pointer->handlers, &pointer->client_handler.link);
115     wl_array_init(&pointer->buttons);
116 
117-    swc_view_initialize(&pointer->cursor.view, &view_impl);
118+    view_initialize(&pointer->cursor.view, &view_impl);
119     pointer->cursor.view_listener.notify = &handle_view_event;
120     wl_signal_add(&pointer->cursor.view.event_signal,
121                   &pointer->cursor.view_listener);
+1, -1
1@@ -57,7 +57,7 @@ struct pointer
2 
3     struct
4     {
5-        struct swc_view view;
6+        struct view view;
7         struct wl_listener view_listener;
8         struct swc_surface * surface;
9         struct wl_listener destroy_listener;
+1, -1
1@@ -87,7 +87,7 @@ struct screen * screen_new(uint32_t crtc, struct swc_output * output)
2         goto error2;
3     }
4 
5-    swc_view_move(&screen->planes.framebuffer.view, x, 0);
6+    view_move(&screen->planes.framebuffer.view, x, 0);
7     screen->base.geometry = screen->planes.framebuffer.view.geometry;
8     screen->base.usable_geometry = screen->base.geometry;
9 
+9, -9
 1@@ -247,8 +247,8 @@ static void commit(struct wl_client * client, struct wl_resource * resource)
 2     if (surface->view)
 3     {
 4         if (surface->pending.commit & SWC_SURFACE_COMMIT_ATTACH)
 5-            swc_view_attach(surface->view, surface->state.buffer);
 6-        swc_view_update(surface->view);
 7+            view_attach(surface->view, surface->state.buffer);
 8+        view_update(surface->view);
 9     }
10 
11     surface->pending.commit = 0;
12@@ -297,11 +297,11 @@ static void handle_view_event(struct wl_listener * listener, void * data)
13     struct swc_surface * surface
14         = CONTAINER_OF(listener, typeof(*surface), view_listener);
15     struct swc_event * event = data;
16-    struct swc_view_event_data * event_data = event->data;
17+    struct view_event_data * event_data = event->data;
18 
19     switch (event->type)
20     {
21-        case SWC_VIEW_EVENT_FRAME:
22+        case VIEW_EVENT_FRAME:
23         {
24             struct wl_resource * resource, * tmp;
25 
26@@ -315,7 +315,7 @@ static void handle_view_event(struct wl_listener * listener, void * data)
27             wl_list_init(&surface->state.frame_callbacks);
28             break;
29         }
30-        case SWC_VIEW_EVENT_SCREENS_CHANGED:
31+        case VIEW_EVENT_SCREENS_CHANGED:
32         {
33             struct screen * screen;
34             struct swc_output * output;
35@@ -347,7 +347,7 @@ static void handle_view_event(struct wl_listener * listener, void * data)
36             }
37             break;
38         }
39-        case SWC_VIEW_EVENT_RESIZED:
40+        case VIEW_EVENT_RESIZED:
41             pixman_region32_intersect_rect
42                 (&surface->state.opaque, &surface->state.opaque, 0, 0,
43                  surface->view->geometry.width, surface->view->geometry.height);
44@@ -393,7 +393,7 @@ struct swc_surface * swc_surface_new(struct wl_client * client,
45     return surface;
46 }
47 
48-void swc_surface_set_view(struct swc_surface * surface, struct swc_view * view)
49+void swc_surface_set_view(struct swc_surface * surface, struct view * view)
50 {
51     if (surface->view == view)
52         return;
53@@ -406,8 +406,8 @@ void swc_surface_set_view(struct swc_surface * surface, struct swc_view * view)
54     if (view)
55     {
56         wl_signal_add(&view->event_signal, &surface->view_listener);
57-        swc_view_attach(view, surface->state.buffer);
58-        swc_view_update(surface->view);
59+        view_attach(view, surface->state.buffer);
60+        view_update(surface->view);
61     }
62 }
63 
+2, -2
 1@@ -69,7 +69,7 @@ struct swc_surface
 2     } pending;
 3 
 4     struct window * window;
 5-    struct swc_view * view;
 6+    struct view * view;
 7     struct wl_listener view_listener;
 8 
 9     struct wl_list link;
10@@ -78,7 +78,7 @@ struct swc_surface
11 struct swc_surface * swc_surface_new(struct wl_client * client,
12                                      uint32_t version, uint32_t id);
13 
14-void swc_surface_set_view(struct swc_surface * surface, struct swc_view * view);
15+void swc_surface_set_view(struct swc_surface * surface, struct view * view);
16 
17 #endif
18 
+22, -24
  1@@ -29,8 +29,7 @@
  2 
  3 #include <wld/wld.h>
  4 
  5-void swc_view_initialize(struct swc_view * view,
  6-                         const struct swc_view_impl * impl)
  7+void view_initialize(struct view * view, const struct view_impl * impl)
  8 {
  9     view->impl = impl;
 10     view->geometry.x = 0;
 11@@ -42,13 +41,13 @@ void swc_view_initialize(struct swc_view * view,
 12     wl_signal_init(&view->event_signal);
 13 }
 14 
 15-void swc_view_finalize(struct swc_view * view)
 16+void view_finalize(struct view * view)
 17 {
 18     if (view->buffer)
 19         wld_buffer_unreference(view->buffer);
 20 }
 21 
 22-bool swc_view_attach(struct swc_view * view, struct wld_buffer * buffer)
 23+bool view_attach(struct view * view, struct wld_buffer * buffer)
 24 {
 25     if (view->impl->attach(view, buffer))
 26     {
 27@@ -65,55 +64,54 @@ bool swc_view_attach(struct swc_view * view, struct wld_buffer * buffer)
 28         return false;
 29 }
 30 
 31-bool swc_view_update(struct swc_view * view)
 32+bool view_update(struct view * view)
 33 {
 34     return view->impl->update(view);
 35 }
 36 
 37-bool swc_view_move(struct swc_view * view, int32_t x, int32_t y)
 38+bool view_move(struct view * view, int32_t x, int32_t y)
 39 {
 40     return view->impl->move(view, x, y);
 41 }
 42 
 43-void swc_view_set_position(struct swc_view * view, int32_t x, int32_t y)
 44+void view_set_position(struct view * view, int32_t x, int32_t y)
 45 {
 46-    struct swc_view_event_data data = { .view = view };
 47+    struct view_event_data data = { .view = view };
 48 
 49     if (x == view->geometry.x && y == view->geometry.y)
 50         return;
 51 
 52     view->geometry.x = x;
 53     view->geometry.y = y;
 54-    swc_send_event(&view->event_signal, SWC_VIEW_EVENT_MOVED, &data);
 55+    swc_send_event(&view->event_signal, VIEW_EVENT_MOVED, &data);
 56 }
 57 
 58-void swc_view_set_size(struct swc_view * view, uint32_t width, uint32_t height)
 59+void view_set_size(struct view * view, uint32_t width, uint32_t height)
 60 {
 61-    struct swc_view_event_data data = { .view = view };
 62+    struct view_event_data data = { .view = view };
 63 
 64     if (view->geometry.width == width && view->geometry.height == height)
 65         return;
 66 
 67     view->geometry.width = width;
 68     view->geometry.height = height;
 69-    swc_send_event(&view->event_signal, SWC_VIEW_EVENT_RESIZED, &data);
 70+    swc_send_event(&view->event_signal, VIEW_EVENT_RESIZED, &data);
 71 }
 72 
 73-void swc_view_set_size_from_buffer(struct swc_view * view,
 74-                                   struct wld_buffer * buffer)
 75+void view_set_size_from_buffer(struct view * view, struct wld_buffer * buffer)
 76 {
 77     if (buffer)
 78-        swc_view_set_size(view, buffer->width, buffer->height);
 79+        view_set_size(view, buffer->width, buffer->height);
 80     else
 81-        swc_view_set_size(view, 0, 0);
 82+        view_set_size(view, 0, 0);
 83 }
 84 
 85-void swc_view_set_screens(struct swc_view * view, uint32_t screens)
 86+void view_set_screens(struct view * view, uint32_t screens)
 87 {
 88     if (view->screens == screens)
 89         return;
 90 
 91-    struct swc_view_event_data data = {
 92+    struct view_event_data data = {
 93         .view = view,
 94         .screens_changed = {
 95             .entered = screens & ~view->screens,
 96@@ -122,10 +120,10 @@ void swc_view_set_screens(struct swc_view * view, uint32_t screens)
 97     };
 98 
 99     view->screens = screens;
100-    swc_send_event(&view->event_signal, SWC_VIEW_EVENT_SCREENS_CHANGED, &data);
101+    swc_send_event(&view->event_signal, VIEW_EVENT_SCREENS_CHANGED, &data);
102 }
103 
104-void swc_view_update_screens(struct swc_view * view)
105+void view_update_screens(struct view * view)
106 {
107     uint32_t screens = 0;
108     struct screen * screen;
109@@ -136,13 +134,13 @@ void swc_view_update_screens(struct swc_view * view)
110             screens |= screen_mask(screen);
111     }
112 
113-    swc_view_set_screens(view, screens);
114+    view_set_screens(view, screens);
115 }
116 
117-void swc_view_frame(struct swc_view * view, uint32_t time)
118+void view_frame(struct view * view, uint32_t time)
119 {
120-    struct swc_view_event_data data = { .view = view, .frame = { time } };
121+    struct view_event_data data = { .view = view, .frame = { time } };
122 
123-    swc_send_event(&view->event_signal, SWC_VIEW_EVENT_FRAME, &data);
124+    swc_send_event(&view->event_signal, VIEW_EVENT_FRAME, &data);
125 }
126 
+32, -34
  1@@ -29,16 +29,16 @@
  2 enum
  3 {
  4     /* Sent when the view has displayed the next frame. */
  5-    SWC_VIEW_EVENT_FRAME,
  6+    VIEW_EVENT_FRAME,
  7 
  8     /* Sent when the origin of the view has moved. */
  9-    SWC_VIEW_EVENT_MOVED,
 10+    VIEW_EVENT_MOVED,
 11 
 12     /* Sent when the view's size changes. */
 13-    SWC_VIEW_EVENT_RESIZED,
 14+    VIEW_EVENT_RESIZED,
 15 
 16     /* Sent when the set of screens the view is visible on changes. */
 17-    SWC_VIEW_EVENT_SCREENS_CHANGED
 18+    VIEW_EVENT_SCREENS_CHANGED
 19 };
 20 
 21 /**
 22@@ -47,9 +47,9 @@ enum
 23  * Extra data correspending to the particular event is stored in the
 24  * corresponding struct inside the union.
 25  */
 26-struct swc_view_event_data
 27+struct view_event_data
 28 {
 29-    struct swc_view * view;
 30+    struct view * view;
 31     union
 32     {
 33         struct
 34@@ -76,9 +76,9 @@ struct swc_view_event_data
 35  * way, allowing operations like setting the output view of a surface directly
 36  * to an output's framebuffer plane, bypassing the compositor.
 37  */
 38-struct swc_view
 39+struct view
 40 {
 41-    const struct swc_view_impl * impl;
 42+    const struct view_impl * impl;
 43 
 44     struct wl_signal event_signal;
 45     struct swc_rectangle geometry;
 46@@ -90,26 +90,15 @@ struct swc_view
 47 /**
 48  * Every view must have an implementation containing these functions.
 49  *
 50- * For descriptions, see the corresponding swc_view_* function.
 51+ * For descriptions, see the corresponding view_* function.
 52  */
 53-struct swc_view_impl
 54+struct view_impl
 55 {
 56-    bool (* update)(struct swc_view * view);
 57-    bool (* attach)(struct swc_view * view, struct wld_buffer * buffer);
 58-    bool (* move)(struct swc_view * view, int32_t x, int32_t y);
 59+    bool (* update)(struct view * view);
 60+    bool (* attach)(struct view * view, struct wld_buffer * buffer);
 61+    bool (* move)(struct view * view, int32_t x, int32_t y);
 62 };
 63 
 64-/**
 65- * Initialize a new view with the specified implementation.
 66- */
 67-void swc_view_initialize(struct swc_view * view,
 68-                         const struct swc_view_impl * impl);
 69-
 70-/**
 71- * Release any resources associated with this view.
 72- */
 73-void swc_view_finalize(struct swc_view * view);
 74-
 75 /**
 76  * Attach a new buffer to the view.
 77  *
 78@@ -117,30 +106,39 @@ void swc_view_finalize(struct swc_view * view);
 79  *
 80  * @return Whether or not the buffer was successfully attached to the view.
 81  */
 82-bool swc_view_attach(struct swc_view * view, struct wld_buffer * buffer);
 83+bool view_attach(struct view * view, struct wld_buffer * buffer);
 84 
 85 /**
 86  * Display a new frame consisting of the currently attached buffer.
 87  *
 88  * @return Whether or not the update succeeds.
 89  */
 90-bool swc_view_update(struct swc_view * view);
 91+bool view_update(struct view * view);
 92 
 93 /**
 94  * Move the view to the specified coordinates, if supported.
 95  *
 96  * @return Whether or not the move succeeds.
 97  */
 98-bool swc_view_move(struct swc_view * view, int32_t x, int32_t y);
 99+bool view_move(struct view * view, int32_t x, int32_t y);
100 
101 /**** For internal view use only ****/
102 
103-void swc_view_set_position(struct swc_view * view, int32_t x, int32_t y);
104-void swc_view_set_size(struct swc_view * view, uint32_t width, uint32_t height);
105-void swc_view_set_size_from_buffer(struct swc_view * view,
106-                                   struct wld_buffer * bufer);
107-void swc_view_set_screens(struct swc_view * view, uint32_t screens);
108-void swc_view_update_screens(struct swc_view * view);
109+/**
110+ * Initialize a new view with the specified implementation.
111+ */
112+void view_initialize(struct view * view, const struct view_impl * impl);
113+
114+/**
115+ * Release any resources associated with this view.
116+ */
117+void view_finalize(struct view * view);
118+
119+void view_set_position(struct view * view, int32_t x, int32_t y);
120+void view_set_size(struct view * view, uint32_t width, uint32_t height);
121+void view_set_size_from_buffer(struct view * view, struct wld_buffer * bufer);
122+void view_set_screens(struct view * view, uint32_t screens);
123+void view_update_screens(struct view * view);
124 
125 /**
126  * Send a new frame event through the view's event signal.
127@@ -149,7 +147,7 @@ void swc_view_update_screens(struct swc_view * view);
128  * the user. If time information is not available, swc_time() can be passed
129  * instead.
130  */
131-void swc_view_frame(struct swc_view * view, uint32_t time);
132+void view_frame(struct view * view, uint32_t time);
133 
134 #endif
135 
+3, -4
 1@@ -99,7 +99,7 @@ void swc_window_set_geometry(struct swc_window * base,
 2     if (window->impl->configure)
 3         window->impl->configure(window, geometry);
 4 
 5-    swc_view_move(&window->view->base, geometry->x, geometry->y);
 6+    view_move(&window->view->base, geometry->x, geometry->y);
 7 }
 8 
 9 EXPORT
10@@ -190,9 +190,8 @@ static bool move_motion(struct pointer_handler * handler, uint32_t time,
11     struct window * window
12         = CONTAINER_OF(handler, typeof(*window), move.interaction.handler);
13 
14-    swc_view_move(&window->view->base,
15-                  wl_fixed_to_int(fx) + window->move.offset.x,
16-                  wl_fixed_to_int(fy) + window->move.offset.y);
17+    view_move(&window->view->base, wl_fixed_to_int(fx) + window->move.offset.x,
18+                                   wl_fixed_to_int(fy) + window->move.offset.y);
19 
20     return true;
21 }
+1, -1
1@@ -344,7 +344,7 @@ void swc_xwm_manage_window(xcb_window_t id, struct swc_surface * surface)
2     if ((geometry_reply = xcb_get_geometry_reply(xwm.connection,
3                                                  geometry_cookie, NULL)))
4     {
5-        swc_view_move(surface->view, geometry_reply->x, geometry_reply->y);
6+        view_move(surface->view, geometry_reply->x, geometry_reply->y);
7         free(geometry_reply);
8     }
9