view: reorder functions

It had gotten a bit messy. Now functions are grouped together (i.e.,
getters, queries, etc).
This commit is contained in:
Jente Hidskes 2019-01-30 17:04:15 +01:00
parent 64b971a665
commit 7175100d0d
4 changed files with 95 additions and 95 deletions

View file

@ -30,6 +30,33 @@ get_title(struct cg_view *view)
return xwayland_view->xwayland_surface->title;
}
static void
get_geometry(struct cg_view *view, int *width_out, int *height_out)
{
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
*width_out = xwayland_view->xwayland_surface->surface->current.width;
*height_out = xwayland_view->xwayland_surface->surface->current.height;
}
static bool
is_primary(struct cg_view *view)
{
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
struct wlr_xwayland_surface *parent = xwayland_view->xwayland_surface->parent;
return parent == NULL;
}
static bool
is_parent(struct cg_view *parent, struct cg_view *child)
{
if (child->type != CAGE_XWAYLAND_VIEW) {
return false;
}
struct cg_xwayland_view *_parent = xwayland_view_from_view(parent);
struct cg_xwayland_view *_child = xwayland_view_from_view(child);
return _child->xwayland_surface->parent == _parent->xwayland_surface;
}
static void
activate(struct cg_view *view, bool activate)
{
@ -52,14 +79,6 @@ destroy(struct cg_view *view)
free(xwayland_view);
}
static void
get_geometry(struct cg_view *view, int *width_out, int *height_out)
{
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
*width_out = xwayland_view->xwayland_surface->surface->current.width;
*height_out = xwayland_view->xwayland_surface->surface->current.height;
}
static void
for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data)
{
@ -72,25 +91,6 @@ wlr_surface_at(struct cg_view *view, double sx, double sy, double *sub_x, double
return wlr_surface_surface_at(view->wlr_surface, sx, sy, sub_x, sub_y);
}
static bool
is_primary(struct cg_view *view)
{
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
struct wlr_xwayland_surface *parent = xwayland_view->xwayland_surface->parent;
return parent == NULL;
}
static bool
is_parent(struct cg_view *parent, struct cg_view *child)
{
if (child->type != CAGE_XWAYLAND_VIEW) {
return false;
}
struct cg_xwayland_view *_parent = xwayland_view_from_view(parent);
struct cg_xwayland_view *_child = xwayland_view_from_view(child);
return _child->xwayland_surface->parent == _parent->xwayland_surface;
}
static void
handle_xwayland_surface_unmap(struct wl_listener *listener, void *data)
{