aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/container.h2
-rw-r--r--include/focus.h36
-rw-r--r--include/handlers.h5
-rw-r--r--include/movement.h17
4 files changed, 40 insertions, 20 deletions
diff --git a/include/container.h b/include/container.h
index e395a55b..5f386368 100644
--- a/include/container.h
+++ b/include/container.h
@@ -45,6 +45,8 @@ struct sway_container {
bool is_floating;
+ bool is_focused;
+
int weight;
char *name;
diff --git a/include/focus.h b/include/focus.h
new file mode 100644
index 00000000..185910f3
--- /dev/null
+++ b/include/focus.h
@@ -0,0 +1,36 @@
+#ifndef _SWAY_FOCUS_H
+#define _SWAY_FOCUS_H
+#include "container.h"
+
+enum movement_direction {
+ MOVE_LEFT,
+ MOVE_RIGHT,
+ MOVE_UP,
+ MOVE_DOWN,
+ MOVE_PARENT
+};
+
+//focused_container - the container found by following the `focused` pointer
+//from a given container to a container with `is_focused` boolean set
+//---
+//focused_view - the container found by following the `focused` pointer from a
+//given container to a view.
+//---
+
+swayc_t *get_focused_container(swayc_t *parent);
+swayc_t *get_focused_view(swayc_t *parent);
+
+void set_focused_container(swayc_t *container);
+void set_focused_container_for(swayc_t *ancestor, swayc_t *container);
+
+//lock focused container/view. locked by windows with OVERRIDE attribute
+//and unlocked when they are destroyed
+
+extern bool locked_container_focus;
+extern bool locked_view_focus;
+
+
+bool move_focus(enum movement_direction direction);
+
+#endif
+
diff --git a/include/handlers.h b/include/handlers.h
index d1742cce..6ea4bbf1 100644
--- a/include/handlers.h
+++ b/include/handlers.h
@@ -1,12 +1,11 @@
#ifndef _SWAY_HANDLERS_H
#define _SWAY_HANDLERS_H
-
+#include "container.h"
#include <stdbool.h>
#include <wlc/wlc.h>
extern struct wlc_interface interface;
-//set focus to current pointer location and return focused container
-swayc_t *focus_pointer(void);
+swayc_t *container_under_pointer(void);
#endif
diff --git a/include/movement.h b/include/movement.h
deleted file mode 100644
index dd701877..00000000
--- a/include/movement.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _SWAY_MOVEMENT_H
-#define _SWAY_MOVEMENT_H
-
-#include <wlc/wlc.h>
-#include "list.h"
-
-enum movement_direction {
- MOVE_LEFT,
- MOVE_RIGHT,
- MOVE_UP,
- MOVE_DOWN,
- MOVE_PARENT
-};
-
-bool move_focus(enum movement_direction direction);
-
-#endif