commit 7a244e5b80e5336a968ed9f6f81be5d71f40b5a3
parent 653f0762e351a8cbba099ee8557df3666c29c5d5
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 15 Jul 2014 18:53:23 -0700
data{,_device{,_manager}}: Drop swc_ prefix for non-public structures/functions
Diffstat:
9 files changed, 45 insertions(+), 46 deletions(-)
diff --git a/libswc/data.c b/libswc/data.c
@@ -139,7 +139,7 @@ static struct data * data_new()
return data;
}
-struct wl_resource * swc_data_source_new(struct wl_client * client, uint32_t id)
+struct wl_resource * data_source_new(struct wl_client * client, uint32_t id)
{
struct data * data;
@@ -158,8 +158,8 @@ struct wl_resource * swc_data_source_new(struct wl_client * client, uint32_t id)
return data->source;
}
-struct wl_resource * swc_data_offer_new(struct wl_client * client,
- struct wl_resource * source)
+struct wl_resource * data_offer_new(struct wl_client * client,
+ struct wl_resource * source)
{
struct data * data = wl_resource_get_user_data(source);
struct wl_resource * offer;
@@ -172,8 +172,8 @@ struct wl_resource * swc_data_offer_new(struct wl_client * client,
return offer;
}
-void swc_data_send_mime_types(struct wl_resource * source,
- struct wl_resource * offer)
+void data_send_mime_types(struct wl_resource * source,
+ struct wl_resource * offer)
{
struct data * data = wl_resource_get_user_data(source);
char ** mime_type;
diff --git a/libswc/data.h b/libswc/data.h
@@ -28,14 +28,13 @@
struct wl_client;
-struct wl_resource * swc_data_source_new(struct wl_client * client,
- uint32_t id);
+struct wl_resource * data_source_new(struct wl_client * client, uint32_t id);
-struct wl_resource * swc_data_offer_new(struct wl_client * client,
- struct wl_resource * source);
+struct wl_resource * data_offer_new(struct wl_client * client,
+ struct wl_resource * source);
-void swc_data_send_mime_types(struct wl_resource * source,
- struct wl_resource * offer);
+void data_send_mime_types(struct wl_resource * source,
+ struct wl_resource * offer);
#endif
diff --git a/libswc/data_device.c b/libswc/data_device.c
@@ -37,7 +37,7 @@ static void set_selection(struct wl_client * client,
struct wl_resource * resource,
struct wl_resource * data_source, uint32_t serial)
{
- struct swc_data_device * data_device = wl_resource_get_user_data(resource);
+ struct data_device * data_device = wl_resource_get_user_data(resource);
/* Check if this data source is already the current selection. */
if (data_source == data_device->selection)
@@ -58,7 +58,7 @@ static void set_selection(struct wl_client * client,
}
swc_send_event(&data_device->event_signal,
- SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
+ DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
}
static struct wl_data_device_interface data_device_implementation = {
@@ -68,15 +68,15 @@ static struct wl_data_device_interface data_device_implementation = {
static void handle_selection_destroy(struct wl_listener * listener, void * data)
{
- struct swc_data_device * data_device = CONTAINER_OF
+ struct data_device * data_device = CONTAINER_OF
(listener, typeof(*data_device), selection_destroy_listener);
data_device->selection = NULL;
swc_send_event(&data_device->event_signal,
- SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
+ DATA_DEVICE_EVENT_SELECTION_CHANGED, NULL);
}
-bool swc_data_device_initialize(struct swc_data_device * data_device)
+bool data_device_initialize(struct data_device * data_device)
{
data_device->selection_destroy_listener.notify = &handle_selection_destroy;
wl_signal_init(&data_device->event_signal);
@@ -85,7 +85,7 @@ bool swc_data_device_initialize(struct swc_data_device * data_device)
return true;
}
-void swc_data_device_finalize(struct swc_data_device * data_device)
+void data_device_finalize(struct data_device * data_device)
{
struct wl_resource * resource, * tmp;
@@ -93,7 +93,7 @@ void swc_data_device_finalize(struct swc_data_device * data_device)
wl_resource_destroy(resource);
}
-void swc_data_device_bind(struct swc_data_device * data_device,
+void data_device_bind(struct data_device * data_device,
struct wl_client * client, uint32_t id)
{
struct wl_resource * resource;
@@ -110,15 +110,15 @@ static struct wl_resource * new_offer(struct wl_resource * resource,
{
struct wl_resource * offer;
- offer = swc_data_offer_new(client, source);
+ offer = data_offer_new(client, source);
wl_data_device_send_data_offer(resource, offer);
- swc_data_send_mime_types(source, offer);
+ data_send_mime_types(source, offer);
return offer;
}
-void swc_data_device_offer_selection(struct swc_data_device * data_device,
- struct wl_client * client)
+void data_device_offer_selection(struct data_device * data_device,
+ struct wl_client * client)
{
struct wl_resource * resource;
struct wl_resource * offer;
diff --git a/libswc/data_device.h b/libswc/data_device.h
@@ -31,10 +31,10 @@
enum
{
- SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED
+ DATA_DEVICE_EVENT_SELECTION_CHANGED
};
-struct swc_data_device
+struct data_device
{
/* The data source corresponding to the current selection. */
struct wl_resource * selection;
@@ -44,14 +44,14 @@ struct swc_data_device
struct wl_list resources;
};
-bool swc_data_device_initialize(struct swc_data_device * data_device);
-void swc_data_device_finalize(struct swc_data_device * data_device);
+bool data_device_initialize(struct data_device * data_device);
+void data_device_finalize(struct data_device * data_device);
-void swc_data_device_bind(struct swc_data_device * data_device,
- struct wl_client * client, uint32_t id);
+void data_device_bind(struct data_device * data_device,
+ struct wl_client * client, uint32_t id);
-void swc_data_device_offer_selection(struct swc_data_device * data_device,
- struct wl_client * client);
+void data_device_offer_selection(struct data_device * data_device,
+ struct wl_client * client);
#endif
diff --git a/libswc/data_device_manager.c b/libswc/data_device_manager.c
@@ -37,7 +37,7 @@ static void create_data_source(struct wl_client * client,
{
struct wl_resource * data_source;
- data_source = swc_data_source_new(client, id);
+ data_source = data_source_new(client, id);
if (!data_source)
wl_resource_post_no_memory(resource);
@@ -47,7 +47,7 @@ static void get_data_device(struct wl_client * client,
struct wl_resource * resource, uint32_t id,
struct wl_resource * seat_resource)
{
- swc_data_device_bind(swc.seat->data_device, client, id);
+ data_device_bind(swc.seat->data_device, client, id);
}
static struct wl_data_device_manager_interface
@@ -67,7 +67,7 @@ static void bind_data_device_manager(struct wl_client * client, void * data,
(resource, &data_device_manager_implementation, NULL, NULL);
}
-bool swc_data_device_manager_initialize()
+bool data_device_manager_initialize()
{
data_device_manager.global
= wl_global_create(swc.display, &wl_data_device_manager_interface, 1,
@@ -76,7 +76,7 @@ bool swc_data_device_manager_initialize()
return data_device_manager.global != NULL;
}
-void swc_data_device_manager_finalize()
+void data_device_manager_finalize()
{
wl_global_destroy(data_device_manager.global);
}
diff --git a/libswc/data_device_manager.h b/libswc/data_device_manager.h
@@ -26,8 +26,8 @@
#include <stdbool.h>
-bool swc_data_device_manager_initialize();
-void swc_data_device_manager_finalize();
+bool data_device_manager_initialize();
+void data_device_manager_finalize();
#endif
diff --git a/libswc/seat.c b/libswc/seat.c
@@ -58,7 +58,7 @@ static struct
struct keyboard keyboard;
struct pointer pointer;
- struct swc_data_device data_device;
+ struct data_device data_device;
struct wl_global * global;
struct wl_list resources;
@@ -105,7 +105,7 @@ static void handle_keyboard_focus_event(struct wl_listener * listener,
(event_data->new->surface->resource);
/* Offer the selection to the new focus. */
- swc_data_device_offer_selection(&seat.data_device, client);
+ data_device_offer_selection(&seat.data_device, client);
}
break;
}
@@ -121,12 +121,12 @@ static void handle_data_device_event(struct wl_listener * listener, void * data)
switch (event->type)
{
- case SWC_DATA_DEVICE_EVENT_SELECTION_CHANGED:
+ case DATA_DEVICE_EVENT_SELECTION_CHANGED:
if (seat.keyboard.focus.resource)
{
struct wl_client * client
= wl_resource_get_client(seat.keyboard.focus.resource);
- swc_data_device_offer_selection(&seat.data_device, client);
+ data_device_offer_selection(&seat.data_device, client);
}
break;
}
@@ -426,7 +426,7 @@ bool swc_seat_initialize(const char * seat_name)
wl_list_init(&seat.resources);
wl_signal_add(&swc.launch->event_signal, &launch_listener);
- if (!swc_data_device_initialize(&seat.data_device))
+ if (!data_device_initialize(&seat.data_device))
{
ERROR("Could not initialize data device\n");
goto error2;
@@ -465,7 +465,7 @@ bool swc_seat_initialize(const char * seat_name)
error4:
keyboard_finalize(&seat.keyboard);
error3:
- swc_data_device_finalize(&seat.data_device);
+ data_device_finalize(&seat.data_device);
error2:
wl_global_destroy(seat.global);
error1:
diff --git a/libswc/seat.h b/libswc/seat.h
@@ -30,7 +30,7 @@ struct swc_seat
{
struct pointer * pointer;
struct keyboard * keyboard;
- struct swc_data_device * data_device;
+ struct data_device * data_device;
};
bool swc_seat_initialize(const char * seat_name);
diff --git a/libswc/swc.c b/libswc/swc.c
@@ -137,7 +137,7 @@ bool swc_initialize(struct wl_display * display,
goto error5;
}
- if (!swc_data_device_manager_initialize())
+ if (!data_device_manager_initialize())
{
ERROR("Could not initialize data device manager\n");
goto error6;
@@ -182,7 +182,7 @@ bool swc_initialize(struct wl_display * display,
error8:
swc_seat_finalize();
error7:
- swc_data_device_manager_finalize();
+ data_device_manager_finalize();
error6:
swc_compositor_finalize();
error5:
@@ -208,7 +208,7 @@ void swc_finalize()
panel_manager_finalize();
swc_shell_finalize();
swc_seat_finalize();
- swc_data_device_manager_finalize();
+ data_device_manager_finalize();
swc_compositor_finalize();
screens_finalize();
swc_bindings_finalize();