aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-21 09:09:53 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-21 09:09:53 -0500
commit0e3eae4baa7717321ec87cf2c46f6798e89e3ded (patch)
treed6624a2fa66f344d9db09e43af0fb293f2ab2d3a /sway/tree/view.c
parentrun all commands with focused container context (diff)
downloadsway-0e3eae4baa7717321ec87cf2c46f6798e89e3ded.tar.gz
sway-0e3eae4baa7717321ec87cf2c46f6798e89e3ded.tar.zst
sway-0e3eae4baa7717321ec87cf2c46f6798e89e3ded.zip
view interface
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c53
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
3const 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
10const 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
17const 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
24const 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
31void 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
37void 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
43void 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
49void view_close(struct sway_view *view) {
50 if (view->iface.close) {
51 view->iface.close(view);
52 }
53}