From 27ca8eaced73ee6478c42c2b4083c5fe81fc8ff8 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 28 Sep 2017 12:38:41 +0200 Subject: Fix typo: s/transcient/transient/ --- include/wlr/types/wlr_wl_shell.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index 11d30d95..60398629 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -32,7 +32,7 @@ struct wlr_wl_shell_surface_popup_state { enum wlr_wl_shell_surface_role { WLR_WL_SHELL_SURFACE_ROLE_NONE, WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL, - WLR_WL_SHELL_SURFACE_ROLE_TRANSCIENT, + WLR_WL_SHELL_SURFACE_ROLE_TRANSIENT, WLR_WL_SHELL_SURFACE_ROLE_POPUP, }; -- cgit v1.2.3 From 3d03ef2d024add0cb663ab69946da310cd2338ab Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 28 Sep 2017 12:45:47 +0200 Subject: role -> state --- include/wlr/types/wlr_wl_shell.h | 14 +++++++------- types/wlr_wl_shell.c | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index 60398629..d6791247 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -29,11 +29,11 @@ struct wlr_wl_shell_surface_popup_state { uint32_t serial; }; -enum wlr_wl_shell_surface_role { - WLR_WL_SHELL_SURFACE_ROLE_NONE, - WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL, - WLR_WL_SHELL_SURFACE_ROLE_TRANSIENT, - WLR_WL_SHELL_SURFACE_ROLE_POPUP, +enum wlr_wl_shell_surface_state { + WLR_WL_SHELL_SURFACE_STATE_NONE, + WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL, + WLR_WL_SHELL_SURFACE_STATE_TRANSIENT, + WLR_WL_SHELL_SURFACE_STATE_POPUP, }; struct wlr_wl_shell_surface { @@ -46,7 +46,7 @@ struct wlr_wl_shell_surface { uint32_t ping_serial; struct wl_event_source *ping_timer; - enum wlr_wl_shell_surface_role role; + enum wlr_wl_shell_surface_state state; struct wlr_wl_shell_surface_transient_state *transient_state; struct wlr_wl_shell_surface_popup_state *popup_state; @@ -64,7 +64,7 @@ struct wlr_wl_shell_surface { struct wl_signal request_set_fullscreen; struct wl_signal request_set_maximized; - struct wl_signal set_role; + struct wl_signal set_state; struct wl_signal set_title; struct wl_signal set_class; } events; diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c index 5c78deff..4abec95e 100644 --- a/types/wlr_wl_shell.c +++ b/types/wlr_wl_shell.c @@ -77,13 +77,13 @@ static void shell_surface_set_toplevel(struct wl_client *client, wlr_log(L_DEBUG, "got shell surface toplevel"); struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource); - if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) { + if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) { return; } - surface->role = WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL; + surface->state = WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL; - wl_signal_emit(&surface->events.set_role, surface); + wl_signal_emit(&surface->events.set_state, surface); } static void shell_surface_set_transient(struct wl_client *client, @@ -95,7 +95,7 @@ static void shell_surface_set_transient(struct wl_client *client, wl_resource_get_user_data(parent_resource); // TODO: check if parent_resource == NULL? - if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) { + if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) { return; } @@ -114,9 +114,9 @@ static void shell_surface_set_transient(struct wl_client *client, free(surface->transient_state); surface->transient_state = state; - surface->role = WLR_WL_SHELL_SURFACE_ROLE_TRANSIENT; + surface->state = WLR_WL_SHELL_SURFACE_STATE_TRANSIENT; - wl_signal_emit(&surface->events.set_role, surface); + wl_signal_emit(&surface->events.set_state, surface); } static void shell_surface_set_fullscreen(struct wl_client *client, @@ -129,7 +129,7 @@ static void shell_surface_set_fullscreen(struct wl_client *client, output = wl_resource_get_user_data(output_resource); } - if (surface->role == WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL) { + if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) { return; } @@ -163,7 +163,7 @@ static void shell_surface_set_popup(struct wl_client *client, wl_resource_get_user_data(parent_resource); // TODO: check if parent_resource == NULL? - if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) { + if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) { return; } @@ -195,9 +195,9 @@ static void shell_surface_set_popup(struct wl_client *client, free(surface->popup_state); surface->popup_state = popup_state; - surface->role = WLR_WL_SHELL_SURFACE_ROLE_POPUP; + surface->state = WLR_WL_SHELL_SURFACE_STATE_POPUP; - wl_signal_emit(&surface->events.set_role, surface); + wl_signal_emit(&surface->events.set_state, surface); } static void shell_surface_set_maximized(struct wl_client *client, @@ -209,7 +209,7 @@ static void shell_surface_set_maximized(struct wl_client *client, output = wl_resource_get_user_data(output_resource); } - if (surface->role == WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL) { + if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) { return; } @@ -336,7 +336,7 @@ static void wl_shell_get_shell_surface(struct wl_client *client, wl_signal_init(&wl_surface->events.request_resize); wl_signal_init(&wl_surface->events.request_set_fullscreen); wl_signal_init(&wl_surface->events.request_set_maximized); - wl_signal_init(&wl_surface->events.set_role); + wl_signal_init(&wl_surface->events.set_state); wl_signal_init(&wl_surface->events.set_title); wl_signal_init(&wl_surface->events.set_class); -- cgit v1.2.3 From 9d405cffa79d8de6378eca84fcd3881a5f68107c Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 28 Sep 2017 13:12:01 +0200 Subject: Use enums instead of uint32_t where applicable --- include/wlr/types/wlr_wl_shell.h | 6 +++--- types/wlr_wl_shell.c | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index d6791247..0b18a131 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -21,7 +21,7 @@ struct wlr_wl_shell_surface_transient_state { struct wlr_wl_shell_surface *parent; int32_t x; int32_t y; - uint32_t flags; + enum wl_shell_surface_transient flags; }; struct wlr_wl_shell_surface_popup_state { @@ -84,13 +84,13 @@ struct wlr_wl_shell_surface_resize_event { struct wlr_wl_shell_surface *surface; struct wlr_seat_handle *seat_handle; uint32_t serial; - uint32_t edges; + enum wl_shell_surface_resize edges; }; struct wlr_wl_shell_surface_set_fullscreen_event { struct wl_client *client; struct wlr_wl_shell_surface *surface; - uint32_t method; + enum wl_shell_surface_fullscreen_method method; uint32_t framerate; struct wlr_output *output; }; diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c index 5bf1ec80..9283a635 100644 --- a/types/wlr_wl_shell.c +++ b/types/wlr_wl_shell.c @@ -47,7 +47,7 @@ static void shell_surface_move(struct wl_client *client, static void shell_surface_resize(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, - uint32_t serial, uint32_t edges) { + uint32_t serial, enum wl_shell_surface_resize edges) { wlr_log(L_DEBUG, "got shell surface resize"); struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource); struct wlr_seat_handle *seat_handle = @@ -93,7 +93,7 @@ static void shell_surface_set_toplevel(struct wl_client *client, static void shell_surface_set_transient(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource, - int32_t x, int32_t y, uint32_t flags) { + int32_t x, int32_t y, enum wl_shell_surface_transient flags) { wlr_log(L_DEBUG, "got shell surface transient"); struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource); struct wlr_wl_shell_surface *parent = @@ -116,7 +116,8 @@ static void shell_surface_set_transient(struct wl_client *client, } static void shell_surface_set_fullscreen(struct wl_client *client, - struct wl_resource *resource, uint32_t method, uint32_t framerate, + struct wl_resource *resource, + enum wl_shell_surface_fullscreen_method method, uint32_t framerate, struct wl_resource *output_resource) { wlr_log(L_DEBUG, "got shell surface fullscreen"); struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource); @@ -149,7 +150,7 @@ static void shell_surface_set_fullscreen(struct wl_client *client, static void shell_surface_set_popup(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, struct wl_resource *parent_resource, int32_t x, int32_t y, - uint32_t flags) { + enum wl_shell_surface_transient flags) { wlr_log(L_DEBUG, "got shell surface popup"); struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource); struct wlr_seat_handle *seat_handle = -- cgit v1.2.3