blob: b25de1a00a2a9af5aba773a11a243dfeb37aba22 [file] [log] [blame]
Marius Vladd98c7e82021-03-08 18:02:32 +02001/*
2 * Copyright 2021 Collabora, Ltd.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 */
24
25#include "config.h"
26#include "shared/helpers.h"
27#include <libweston/libweston.h>
28
Marius Vlad2be09372021-03-08 22:45:52 +020029/* parameter for create_solid_color_surface() */
30struct weston_solid_color_surface {
31 int (*get_label)(struct weston_surface *es, char *buf, size_t len);
32 void (*surface_committed)(struct weston_surface *es, int32_t sx, int32_t sy);
33 void *surface_private;
34 float r, g, b;
35};
36
Marius Vladd98c7e82021-03-08 18:02:32 +020037struct weston_output *
38get_default_output(struct weston_compositor *compositor);
39
40struct weston_output *
41get_focused_output(struct weston_compositor *compositor);
42
43void
44center_on_output(struct weston_view *view, struct weston_output *output);
45
46void
47surface_subsurfaces_boundingbox(struct weston_surface *surface, int32_t *x,
48 int32_t *y, int32_t *w, int32_t *h);
Marius Vlad2be09372021-03-08 22:45:52 +020049
50int
51surface_get_label(struct weston_surface *surface, char *buf, size_t len);
52
53/* helper to create a view w/ a color
54 */
55struct weston_view *
56create_solid_color_surface(struct weston_compositor *compositor,
57 struct weston_solid_color_surface *ss,
58 float x, float y, int w, int h);