diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c new file mode 100644 index 00000000..b46c3b17 --- /dev/null +++ b/sway/tree/view.c | |||
@@ -0,0 +1,53 @@ | |||
1 | #include "sway/view.h" | ||
2 | |||
3 | const char *view_get_title(struct sway_view *view) { | ||
4 | if (view->iface.get_prop) { | ||
5 | return view->iface.get_prop(view, VIEW_PROP_TITLE); | ||
6 | } | ||
7 | return NULL; | ||
8 | } | ||
9 | |||
10 | const char *view_get_app_id(struct sway_view *view) { | ||
11 | if (view->iface.get_prop) { | ||
12 | return view->iface.get_prop(view, VIEW_PROP_APP_ID); | ||
13 | } | ||
14 | return NULL; | ||
15 | } | ||
16 | |||
17 | const char *view_get_class(struct sway_view *view) { | ||
18 | if (view->iface.get_prop) { | ||
19 | return view->iface.get_prop(view, VIEW_PROP_CLASS); | ||
20 | } | ||
21 | return NULL; | ||
22 | } | ||
23 | |||
24 | const char *view_get_instance(struct sway_view *view) { | ||
25 | if (view->iface.get_prop) { | ||
26 | return view->iface.get_prop(view, VIEW_PROP_INSTANCE); | ||
27 | } | ||
28 | return NULL; | ||
29 | } | ||
30 | |||
31 | void view_set_size(struct sway_view *view, int width, int height) { | ||
32 | if (view->iface.set_size) { | ||
33 | view->iface.set_size(view, width, height); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | void view_set_position(struct sway_view *view, double ox, double oy) { | ||
38 | if (view->iface.set_position) { | ||
39 | view->iface.set_position(view, ox, oy); | ||
40 | } | ||
41 | } | ||
42 | |||
43 | void view_set_activated(struct sway_view *view, bool activated) { | ||
44 | if (view->iface.set_activated) { | ||
45 | view->iface.set_activated(view, activated); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | void view_close(struct sway_view *view) { | ||
50 | if (view->iface.close) { | ||
51 | view->iface.close(view); | ||
52 | } | ||
53 | } | ||