commit 7a244e5

Michael Forney  ·  2014-07-16 01:53:23 +0000 UTC
parent 653f076
data{,_device{,_manager}}: Drop swc_ prefix for non-public structures/functions
9 files changed,  +45, -46
+5, -5
 1@@ -139,7 +139,7 @@ static struct data * data_new()
 2     return data;
 3 }
 4 
 5-struct wl_resource * swc_data_source_new(struct wl_client * client, uint32_t id)
 6+struct wl_resource * data_source_new(struct wl_client * client, uint32_t id)
 7 {
 8     struct data * data;
 9 
10@@ -158,8 +158,8 @@ struct wl_resource * swc_data_source_new(struct wl_client * client, uint32_t id)
11     return data->source;
12 }
13 
14-struct wl_resource * swc_data_offer_new(struct wl_client * client,
15-                                        struct wl_resource * source)
16+struct wl_resource * data_offer_new(struct wl_client * client,
17+                                    struct wl_resource * source)
18 {
19     struct data * data = wl_resource_get_user_data(source);
20     struct wl_resource * offer;
21@@ -172,8 +172,8 @@ struct wl_resource * swc_data_offer_new(struct wl_client * client,
22     return offer;
23 }
24 
25-void swc_data_send_mime_types(struct wl_resource * source,
26-                              struct wl_resource * offer)
27+void data_send_mime_types(struct wl_resource * source,
28+                          struct wl_resource * offer)
29 {
30     struct data * data = wl_resource_get_user_data(source);
31     char ** mime_type;
+5, -6
 1@@ -28,14 +28,13 @@
 2 
 3 struct wl_client;
 4 
 5-struct wl_resource * swc_data_source_new(struct wl_client * client,
 6-                                         uint32_t id);
 7+struct wl_resource * data_source_new(struct wl_client * client, uint32_t id);
 8 
 9-struct wl_resource * swc_data_offer_new(struct wl_client * client,
10-                                        struct wl_resource * source);
11+struct wl_resource * data_offer_new(struct wl_client * client,
12+                                    struct wl_resource * source);
13 
14-void swc_data_send_mime_types(struct wl_resource * source,
15-                              struct wl_resource * offer);
16+void data_send_mime_types(struct wl_resource * source,
17+                          struct wl_resource * offer);
18 
19 #endif
20 
+11, -11
 1@@ -37,7 +37,7 @@ static void set_selection(struct wl_client * client,
 2                           struct wl_resource * resource,
 3                           struct wl_resource * data_source, uint32_t serial)
 4 {
 5-    struct swc_data_device * data_device = wl_resource_get_user_data(resource);
 6+    struct data_device * data_device = wl_resource_get_user_data(resource);
 7 
 8     /* Check if this data source is already the current selection. */
 9     if (data_source == data_device->selection)
10@@ -58,7 +58,7 @@ static void set_selection(struct wl_client * client,
11     }
12 
13     swc_send_event(&data_device->event_signal,
14-                   SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
15+                   DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
16 }
17 
18 static struct wl_data_device_interface data_device_implementation = {
19@@ -68,15 +68,15 @@ static struct wl_data_device_interface data_device_implementation = {
20 
21 static void handle_selection_destroy(struct wl_listener * listener, void * data)
22 {
23-    struct swc_data_device * data_device = CONTAINER_OF
24+    struct data_device * data_device = CONTAINER_OF
25         (listener, typeof(*data_device), selection_destroy_listener);
26 
27     data_device->selection = NULL;
28     swc_send_event(&data_device->event_signal,
29-                   SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
30+                   DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
31 }
32 
33-bool swc_data_device_initialize(struct swc_data_device * data_device)
34+bool data_device_initialize(struct data_device * data_device)
35 {
36     data_device->selection_destroy_listener.notify = &handle_selection_destroy;
37     wl_signal_init(&data_device->event_signal);
38@@ -85,7 +85,7 @@ bool swc_data_device_initialize(struct swc_data_device * data_device)
39     return true;
40 }
41 
42-void swc_data_device_finalize(struct swc_data_device * data_device)
43+void data_device_finalize(struct data_device * data_device)
44 {
45     struct wl_resource * resource, * tmp;
46 
47@@ -93,7 +93,7 @@ void swc_data_device_finalize(struct swc_data_device * data_device)
48         wl_resource_destroy(resource);
49 }
50 
51-void swc_data_device_bind(struct swc_data_device * data_device,
52+void data_device_bind(struct data_device * data_device,
53                           struct wl_client * client, uint32_t id)
54 {
55     struct wl_resource * resource;
56@@ -110,15 +110,15 @@ static struct wl_resource * new_offer(struct wl_resource * resource,
57 {
58     struct wl_resource * offer;
59 
60-    offer = swc_data_offer_new(client, source);
61+    offer = data_offer_new(client, source);
62     wl_data_device_send_data_offer(resource, offer);
63-    swc_data_send_mime_types(source, offer);
64+    data_send_mime_types(source, offer);
65 
66     return offer;
67 }
68 
69-void swc_data_device_offer_selection(struct swc_data_device * data_device,
70-                                     struct wl_client * client)
71+void data_device_offer_selection(struct data_device * data_device,
72+                                 struct wl_client * client)
73 {
74     struct wl_resource * resource;
75     struct wl_resource * offer;
+8, -8
 1@@ -31,10 +31,10 @@
 2 
 3 enum
 4 {
 5-    SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED
 6+    DATA_DEVICE_EVENT_SELECTION_CHANGED
 7 };
 8 
 9-struct swc_data_device
10+struct data_device
11 {
12     /* The data source corresponding to the current selection. */
13     struct wl_resource * selection;
14@@ -44,14 +44,14 @@ struct swc_data_device
15     struct wl_list resources;
16 };
17 
18-bool swc_data_device_initialize(struct swc_data_device * data_device);
19-void swc_data_device_finalize(struct swc_data_device * data_device);
20+bool data_device_initialize(struct data_device * data_device);
21+void data_device_finalize(struct data_device * data_device);
22 
23-void swc_data_device_bind(struct swc_data_device * data_device,
24-                          struct wl_client * client, uint32_t id);
25+void data_device_bind(struct data_device * data_device,
26+                      struct wl_client * client, uint32_t id);
27 
28-void swc_data_device_offer_selection(struct swc_data_device * data_device,
29-                                     struct wl_client * client);
30+void data_device_offer_selection(struct data_device * data_device,
31+                                 struct wl_client * client);
32 
33 #endif
34 
+4, -4
 1@@ -37,7 +37,7 @@ static void create_data_source(struct wl_client * client,
 2 {
 3     struct wl_resource * data_source;
 4 
 5-    data_source = swc_data_source_new(client, id);
 6+    data_source = data_source_new(client, id);
 7 
 8     if (!data_source)
 9         wl_resource_post_no_memory(resource);
10@@ -47,7 +47,7 @@ static void get_data_device(struct wl_client * client,
11                             struct wl_resource * resource, uint32_t id,
12                             struct wl_resource * seat_resource)
13 {
14-    swc_data_device_bind(swc.seat->data_device, client, id);
15+    data_device_bind(swc.seat->data_device, client, id);
16 }
17 
18 static struct wl_data_device_manager_interface
19@@ -67,7 +67,7 @@ static void bind_data_device_manager(struct wl_client * client, void * data,
20         (resource, &data_device_manager_implementation, NULL, NULL);
21 }
22 
23-bool swc_data_device_manager_initialize()
24+bool data_device_manager_initialize()
25 {
26     data_device_manager.global
27         = wl_global_create(swc.display, &wl_data_device_manager_interface, 1,
28@@ -76,7 +76,7 @@ bool swc_data_device_manager_initialize()
29     return data_device_manager.global != NULL;
30 }
31 
32-void swc_data_device_manager_finalize()
33+void data_device_manager_finalize()
34 {
35     wl_global_destroy(data_device_manager.global);
36 }
+2, -2
 1@@ -26,8 +26,8 @@
 2 
 3 #include <stdbool.h>
 4 
 5-bool swc_data_device_manager_initialize();
 6-void swc_data_device_manager_finalize();
 7+bool data_device_manager_initialize();
 8+void data_device_manager_finalize();
 9 
10 #endif
11 
+6, -6
 1@@ -58,7 +58,7 @@ static struct
 2 
 3     struct keyboard keyboard;
 4     struct pointer pointer;
 5-    struct swc_data_device data_device;
 6+    struct data_device data_device;
 7 
 8     struct wl_global * global;
 9     struct wl_list resources;
10@@ -105,7 +105,7 @@ static void handle_keyboard_focus_event(struct wl_listener * listener,
11                     (event_data->new->surface->resource);
12 
13                 /* Offer the selection to the new focus. */
14-                swc_data_device_offer_selection(&seat.data_device, client);
15+                data_device_offer_selection(&seat.data_device, client);
16             }
17             break;
18     }
19@@ -121,12 +121,12 @@ static void handle_data_device_event(struct wl_listener * listener, void * data)
20 
21     switch (event->type)
22     {
23-        case SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED:
24+        case DATA_DEVICE_EVENT_SELECTION_CHANGED:
25             if (seat.keyboard.focus.resource)
26             {
27                 struct wl_client * client
28                     = wl_resource_get_client(seat.keyboard.focus.resource);
29-                swc_data_device_offer_selection(&seat.data_device, client);
30+                data_device_offer_selection(&seat.data_device, client);
31             }
32             break;
33     }
34@@ -426,7 +426,7 @@ bool swc_seat_initialize(const char * seat_name)
35     wl_list_init(&seat.resources);
36     wl_signal_add(&swc.launch->event_signal, &launch_listener);
37 
38-    if (!swc_data_device_initialize(&seat.data_device))
39+    if (!data_device_initialize(&seat.data_device))
40     {
41         ERROR("Could not initialize data device\n");
42         goto error2;
43@@ -465,7 +465,7 @@ bool swc_seat_initialize(const char * seat_name)
44   error4:
45     keyboard_finalize(&seat.keyboard);
46   error3:
47-    swc_data_device_finalize(&seat.data_device);
48+    data_device_finalize(&seat.data_device);
49   error2:
50     wl_global_destroy(seat.global);
51   error1:
+1, -1
1@@ -30,7 +30,7 @@ struct swc_seat
2 {
3     struct pointer * pointer;
4     struct keyboard * keyboard;
5-    struct swc_data_device * data_device;
6+    struct data_device * data_device;
7 };
8 
9 bool swc_seat_initialize(const char * seat_name);
+3, -3
 1@@ -137,7 +137,7 @@ bool swc_initialize(struct wl_display * display,
 2         goto error5;
 3     }
 4 
 5-    if (!swc_data_device_manager_initialize())
 6+    if (!data_device_manager_initialize())
 7     {
 8         ERROR("Could not initialize data device manager\n");
 9         goto error6;
10@@ -182,7 +182,7 @@ bool swc_initialize(struct wl_display * display,
11   error8:
12     swc_seat_finalize();
13   error7:
14-    swc_data_device_manager_finalize();
15+    data_device_manager_finalize();
16   error6:
17     swc_compositor_finalize();
18   error5:
19@@ -208,7 +208,7 @@ void swc_finalize()
20     panel_manager_finalize();
21     swc_shell_finalize();
22     swc_seat_finalize();
23-    swc_data_device_manager_finalize();
24+    data_device_manager_finalize();
25     swc_compositor_finalize();
26     screens_finalize();
27     swc_bindings_finalize();