From a2b4bd58ae95132a62001a7054a8d9b563738a4a Mon Sep 17 00:00:00 2001 From: buffet Date: Wed, 8 Jan 2020 16:39:20 +0000 Subject: [PATCH] Rename view_resize to view_set_size --- include/desktop/view.h | 4 ++-- kiwmi/desktop/view.c | 16 ++++++++-------- kiwmi/desktop/xdg_shell.c | 14 +++++++------- kiwmi/luak/kiwmi_view.c | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/desktop/view.h b/include/desktop/view.h index a2268af..927c639 100644 --- a/include/desktop/view.h +++ b/include/desktop/view.h @@ -53,8 +53,8 @@ struct kiwmi_view_impl { struct kiwmi_view *view, wlr_surface_iterator_func_t iterator, void *user_data); - void (*resize)(struct kiwmi_view *view, uint32_t width, uint32_t height); void (*set_activated)(struct kiwmi_view *view, bool activated); + void (*set_size)(struct kiwmi_view *view, uint32_t width, uint32_t height); void (*set_tiled)(struct kiwmi_view *view, bool tiled); struct wlr_surface *(*surface_at)( struct kiwmi_view *view, @@ -69,8 +69,8 @@ void view_for_each_surface( struct kiwmi_view *view, wlr_surface_iterator_func_t iterator, void *user_data); -void view_resize(struct kiwmi_view *view, uint32_t width, uint32_t height); void view_set_activated(struct kiwmi_view *view, bool activated); +void view_set_size(struct kiwmi_view *view, uint32_t width, uint32_t height); void view_set_tiled(struct kiwmi_view *view, bool tiled); struct wlr_surface *view_surface_at( struct kiwmi_view *view, diff --git a/kiwmi/desktop/view.c b/kiwmi/desktop/view.c index d7473dd..cf4a21c 100644 --- a/kiwmi/desktop/view.c +++ b/kiwmi/desktop/view.c @@ -31,14 +31,6 @@ view_for_each_surface( } } -void -view_resize(struct kiwmi_view *view, uint32_t width, uint32_t height) -{ - if (view->impl->resize) { - view->impl->resize(view, width, height); - } -} - void view_set_activated(struct kiwmi_view *view, bool activated) { @@ -47,6 +39,14 @@ view_set_activated(struct kiwmi_view *view, bool activated) } } +void +view_set_size(struct kiwmi_view *view, uint32_t width, uint32_t height) +{ + if (view->impl->set_size) { + view->impl->set_size(view, width, height); + } +} + void view_set_tiled(struct kiwmi_view *view, bool tiled) { diff --git a/kiwmi/desktop/xdg_shell.c b/kiwmi/desktop/xdg_shell.c index 09f4265..44d3f9e 100644 --- a/kiwmi/desktop/xdg_shell.c +++ b/kiwmi/desktop/xdg_shell.c @@ -70,18 +70,18 @@ xdg_shell_view_for_each_surface( wlr_xdg_surface_for_each_surface(view->xdg_surface, iterator, user_data); } -static void -xdg_shell_view_resize(struct kiwmi_view *view, uint32_t width, uint32_t height) -{ - wlr_xdg_toplevel_set_size(view->xdg_surface, width, height); -} - static void xdg_shell_view_set_activated(struct kiwmi_view *view, bool activated) { wlr_xdg_toplevel_set_activated(view->xdg_surface, activated); } +static void +xdg_shell_view_set_size(struct kiwmi_view *view, uint32_t width, uint32_t height) +{ + wlr_xdg_toplevel_set_size(view->xdg_surface, width, height); +} + static void xdg_shell_view_set_tiled(struct kiwmi_view *view, bool tiled) { @@ -110,8 +110,8 @@ xdg_shell_view_surface_at( static const struct kiwmi_view_impl xdg_shell_view_impl = { .close = xdg_shell_view_close, .for_each_surface = xdg_shell_view_for_each_surface, - .resize = xdg_shell_view_resize, .set_activated = xdg_shell_view_set_activated, + .set_size = xdg_shell_view_set_size, .set_tiled = xdg_shell_view_set_tiled, .surface_at = xdg_shell_view_surface_at, }; diff --git a/kiwmi/luak/kiwmi_view.c b/kiwmi/luak/kiwmi_view.c index e8afe38..3babb85 100644 --- a/kiwmi/luak/kiwmi_view.c +++ b/kiwmi/luak/kiwmi_view.c @@ -96,7 +96,7 @@ l_kiwmi_view_resize(lua_State *L) double w = lua_tonumber(L, 2); double h = lua_tonumber(L, 3); - view_resize(view, w, h); + view_set_size(view, w, h); return 0; }