commit 2c7db1b
Michael Forney
·
2014-02-24 09:27:02 +0000 UTC
parent ddda681
shell_surface: Drop swc_ prefix for non-public structures/functions
3 files changed,
+18,
-24
+2,
-2
1@@ -37,9 +37,9 @@ static void get_shell_surface(struct wl_client * client,
2 struct wl_resource * surface_resource)
3 {
4 struct swc_surface * surface = wl_resource_get_user_data(surface_resource);
5- struct swc_shell_surface * shell_surface;
6+ struct shell_surface * shell_surface;
7
8- shell_surface = swc_shell_surface_new(client, id, surface);
9+ shell_surface = shell_surface_new(client, id, surface);
10
11 if (!shell_surface)
12 wl_resource_post_no_memory(resource);
+13,
-19
1@@ -1,6 +1,6 @@
2 /* swc: libswc/shell_surface.c
3 *
4- * Copyright (c) 2013 Michael Forney
5+ * Copyright (c) 2013, 2014 Michael Forney
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9@@ -33,7 +33,7 @@
10
11 #include <stdlib.h>
12
13-struct swc_shell_surface
14+struct shell_surface
15 {
16 struct window window;
17
18@@ -59,8 +59,7 @@ static void pong(struct wl_client * client, struct wl_resource * resource,
19 static void move(struct wl_client * client, struct wl_resource * resource,
20 struct wl_resource * seat_resource, uint32_t serial)
21 {
22- struct swc_shell_surface * shell_surface
23- = wl_resource_get_user_data(resource);
24+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
25 struct button_press * button;
26
27 if (!(button = pointer_get_button_press(swc.seat->pointer, serial)))
28@@ -73,8 +72,7 @@ static void resize(struct wl_client * client, struct wl_resource * resource,
29 struct wl_resource * seat_resource, uint32_t serial,
30 uint32_t edges)
31 {
32- struct swc_shell_surface * shell_surface
33- = wl_resource_get_user_data(resource);
34+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
35 struct button_press * button;
36
37 if (!(button = pointer_get_button_press(swc.seat->pointer, serial)))
38@@ -86,8 +84,7 @@ static void resize(struct wl_client * client, struct wl_resource * resource,
39 static void set_toplevel(struct wl_client * client,
40 struct wl_resource * resource)
41 {
42- struct swc_shell_surface * shell_surface
43- = wl_resource_get_user_data(resource);
44+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
45
46 if (shell_surface->type == SHELL_SURFACE_TYPE_TOPLEVEL)
47 return;
48@@ -130,8 +127,7 @@ static void set_maximized(struct wl_client * client,
49 static void set_title(struct wl_client * client, struct wl_resource * resource,
50 const char * title)
51 {
52- struct swc_shell_surface * shell_surface
53- = wl_resource_get_user_data(resource);
54+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
55
56 window_set_title(&shell_surface->window, title, -1);
57 }
58@@ -139,8 +135,7 @@ static void set_title(struct wl_client * client, struct wl_resource * resource,
59 static void set_class(struct wl_client * client, struct wl_resource * resource,
60 const char * class)
61 {
62- struct swc_shell_surface * shell_surface
63- = wl_resource_get_user_data(resource);
64+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
65
66 window_set_class(&shell_surface->window, class);
67 }
68@@ -161,7 +156,7 @@ static const struct wl_shell_surface_interface shell_surface_implementation = {
69 static void configure(struct window * window,
70 const struct swc_rectangle * geometry)
71 {
72- struct swc_shell_surface * shell_surface
73+ struct shell_surface * shell_surface
74 = CONTAINER_OF(window, typeof(*shell_surface), window);
75
76 wl_shell_surface_send_configure(shell_surface->resource,
77@@ -175,7 +170,7 @@ static const struct window_impl shell_window_impl = {
78
79 static void handle_surface_destroy(struct wl_listener * listener, void * data)
80 {
81- struct swc_shell_surface * shell_surface = CONTAINER_OF
82+ struct shell_surface * shell_surface = CONTAINER_OF
83 (listener, typeof(*shell_surface), surface_destroy_listener);
84
85 wl_resource_destroy(shell_surface->resource);
86@@ -183,17 +178,16 @@ static void handle_surface_destroy(struct wl_listener * listener, void * data)
87
88 static void destroy_shell_surface(struct wl_resource * resource)
89 {
90- struct swc_shell_surface * shell_surface
91- = wl_resource_get_user_data(resource);
92+ struct shell_surface * shell_surface = wl_resource_get_user_data(resource);
93
94 window_finalize(&shell_surface->window);
95 free(shell_surface);
96 }
97
98-struct swc_shell_surface * swc_shell_surface_new
99- (struct wl_client * client, uint32_t id, struct swc_surface * surface)
100+struct shell_surface * shell_surface_new(struct wl_client * client, uint32_t id,
101+ struct swc_surface * surface)
102 {
103- struct swc_shell_surface * shell_surface;
104+ struct shell_surface * shell_surface;
105
106 shell_surface = malloc(sizeof *shell_surface);
107
+3,
-3
1@@ -1,6 +1,6 @@
2 /* swc: libswc/shell_surface.h
3 *
4- * Copyright (c) 2013 Michael Forney
5+ * Copyright (c) 2013, 2014 Michael Forney
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9@@ -29,8 +29,8 @@
10 struct swc_surface;
11 struct wl_client;
12
13-struct swc_shell_surface * swc_shell_surface_new
14- (struct wl_client * client, uint32_t id, struct swc_surface * surface);
15+struct shell_surface * shell_surface_new(struct wl_client * client, uint32_t id,
16+ struct swc_surface * surface);
17
18 #endif
19