commit 45e4f3a350bd91e65b18db464eba0ff1126e23c7
parent 5c420fe27923118f2657a3c59fede6a47489036a
Author: Michael Forney <mforney@mforney.org>
Date: Sun, 16 Feb 2014 15:18:39 -0800
panel{,_manager}: Drop swc_ prefix for non-public structures/functions
Diffstat:
5 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/libswc/panel.c b/libswc/panel.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdlib.h>
-struct swc_panel
+struct panel
{
struct wl_resource * resource;
@@ -51,7 +51,7 @@ struct swc_panel
bool docked;
};
-static void update_position(struct swc_panel * panel)
+static void update_position(struct panel * panel)
{
int32_t x, y;
struct swc_rectangle * screen = &panel->screen->base.geometry,
@@ -85,7 +85,7 @@ static void dock(struct wl_client * client, struct wl_resource * resource,
uint32_t edge, struct wl_resource * output_resource,
uint32_t focus)
{
- struct swc_panel * panel = wl_resource_get_user_data(resource);
+ struct panel * panel = wl_resource_get_user_data(resource);
struct swc_output * output = output_resource
? wl_resource_get_user_data(output_resource) : NULL;
struct screen * screen = output
@@ -140,7 +140,7 @@ static void dock(struct wl_client * client, struct wl_resource * resource,
static void set_offset(struct wl_client * client, struct wl_resource * resource,
uint32_t offset)
{
- struct swc_panel * panel = wl_resource_get_user_data(resource);
+ struct panel * panel = wl_resource_get_user_data(resource);
panel->offset = offset;
@@ -151,7 +151,7 @@ static void set_offset(struct wl_client * client, struct wl_resource * resource,
static void set_strut(struct wl_client * client, struct wl_resource * resource,
uint32_t size, uint32_t begin, uint32_t end)
{
- struct swc_panel * panel = wl_resource_get_user_data(resource);
+ struct panel * panel = wl_resource_get_user_data(resource);
panel->strut_size = size;
@@ -169,7 +169,7 @@ static void modify(struct screen_modifier * modifier,
const struct swc_rectangle * geometry,
pixman_region32_t * usable)
{
- struct swc_panel * panel = CONTAINER_OF(modifier, typeof(*panel), modifier);
+ struct panel * panel = CONTAINER_OF(modifier, typeof(*panel), modifier);
pixman_box32_t box = {
.x1 = geometry->x, .y1 = geometry->y,
.x2 = geometry->x + geometry->width,
@@ -207,7 +207,7 @@ static void modify(struct screen_modifier * modifier,
static void destroy_panel(struct wl_resource * resource)
{
- struct swc_panel * panel = wl_resource_get_user_data(resource);
+ struct panel * panel = wl_resource_get_user_data(resource);
if (panel->docked)
{
@@ -222,7 +222,7 @@ static void destroy_panel(struct wl_resource * resource)
static void handle_view_event(struct wl_listener * listener, void * data)
{
- struct swc_panel * panel;
+ struct panel * panel;
struct swc_event * event = data;
panel = CONTAINER_OF(listener, typeof(*panel), view_listener);
@@ -237,16 +237,16 @@ static void handle_view_event(struct wl_listener * listener, void * data)
static void handle_surface_destroy(struct wl_listener * listener, void * data)
{
- struct swc_panel * panel;
+ struct panel * panel;
panel = CONTAINER_OF(listener, typeof(*panel), surface_destroy_listener);
wl_resource_destroy(panel->resource);
}
-struct swc_panel * swc_panel_new(struct wl_client * client, uint32_t id,
- struct swc_surface * surface)
+struct panel * panel_new(struct wl_client * client, uint32_t id,
+ struct swc_surface * surface)
{
- struct swc_panel * panel;
+ struct panel * panel;
panel = malloc(sizeof *panel);
diff --git a/libswc/panel.h b/libswc/panel.h
@@ -29,8 +29,8 @@
#include <stdbool.h>
#include <wayland-server.h>
-struct swc_panel * swc_panel_new(struct wl_client * client, uint32_t id,
- struct swc_surface * surface);
+struct panel * panel_new(struct wl_client * client, uint32_t id,
+ struct swc_surface * surface);
#endif
diff --git a/libswc/panel_manager.c b/libswc/panel_manager.c
@@ -38,11 +38,8 @@ static void create_panel(struct wl_client * client,
struct wl_resource * surface_resource)
{
struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
- struct swc_panel * panel;
- panel = swc_panel_new(client, id, surface);
-
- if (!panel)
+ if (!panel_new(client, id, surface))
wl_client_post_no_memory(client);
}
@@ -60,7 +57,7 @@ static void bind_panel_manager(struct wl_client * client, void * data,
NULL, NULL);
}
-bool swc_panel_manager_initialize()
+bool panel_manager_initialize()
{
panel_manager.global = wl_global_create(swc.display,
&swc_panel_manager_interface, 1,
@@ -72,7 +69,7 @@ bool swc_panel_manager_initialize()
return true;
}
-void swc_panel_manager_finalize()
+void panel_manager_finalize()
{
wl_global_destroy(panel_manager.global);
}
diff --git a/libswc/panel_manager.h b/libswc/panel_manager.h
@@ -26,8 +26,8 @@
#include <stdbool.h>
-bool swc_panel_manager_initialize();
-void swc_panel_manager_finalize();
+bool panel_manager_initialize();
+void panel_manager_finalize();
#endif
diff --git a/libswc/swc.c b/libswc/swc.c
@@ -148,7 +148,7 @@ bool swc_initialize(struct wl_display * display,
goto error8;
}
- if (!swc_panel_manager_initialize())
+ if (!panel_manager_initialize())
{
ERROR("Could not initialize panel manager\n");
goto error9;
@@ -168,7 +168,7 @@ bool swc_initialize(struct wl_display * display,
#ifdef ENABLE_XWAYLAND
error10:
- swc_panel_manager_finalize();
+ panel_manager_finalize();
#endif
error9:
swc_shell_finalize();
@@ -198,7 +198,7 @@ void swc_finalize()
#ifdef ENABLE_XWAYLAND
swc_xserver_finalize();
#endif
- swc_panel_manager_finalize();
+ panel_manager_finalize();
swc_shell_finalize();
swc_seat_finalize();
swc_data_device_manager_finalize();