aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-22 01:16:23 +0100
committerGitHub <noreply@github.com>2018-01-22 01:16:23 +0100
commit0c58673c6a108ba241419a0f1d5fecd47f22370e (patch)
treec3e19af6dd70f04fc5c617e932b4afcc7a1b41d9 /sway/tree/view.c
parenta6bc46eea9d7dec6a2b93f85bac2e3737e0c6725 (diff)
parentbeb3805cf0300bc2640290233aa763d757c12466 (diff)
Merge pull request #1574 from acrisci/config-refactor
Command criteria
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 @@
+#include "sway/view.h"
+
+const char *view_get_title(struct sway_view *view) {
+ if (view->iface.get_prop) {
+ return view->iface.get_prop(view, VIEW_PROP_TITLE);
+ }
+ return NULL;
+}
+
+const char *view_get_app_id(struct sway_view *view) {
+ if (view->iface.get_prop) {
+ return view->iface.get_prop(view, VIEW_PROP_APP_ID);
+ }
+ return NULL;
+}
+
+const char *view_get_class(struct sway_view *view) {
+ if (view->iface.get_prop) {
+ return view->iface.get_prop(view, VIEW_PROP_CLASS);
+ }
+ return NULL;
+}
+
+const char *view_get_instance(struct sway_view *view) {
+ if (view->iface.get_prop) {
+ return view->iface.get_prop(view, VIEW_PROP_INSTANCE);
+ }
+ return NULL;
+}
+
+void view_set_size(struct sway_view *view, int width, int height) {
+ if (view->iface.set_size) {
+ view->iface.set_size(view, width, height);
+ }
+}
+
+void view_set_position(struct sway_view *view, double ox, double oy) {
+ if (view->iface.set_position) {
+ view->iface.set_position(view, ox, oy);
+ }
+}
+
+void view_set_activated(struct sway_view *view, bool activated) {
+ if (view->iface.set_activated) {
+ view->iface.set_activated(view, activated);
+ }
+}
+
+void view_close(struct sway_view *view) {
+ if (view->iface.close) {
+ view->iface.close(view);
+ }
+}