2015-08-18 17:28:44 +10:00
|
|
|
#ifndef _SWAY_FOCUS_H
|
|
|
|
#define _SWAY_FOCUS_H
|
|
|
|
enum movement_direction {
|
|
|
|
MOVE_LEFT,
|
|
|
|
MOVE_RIGHT,
|
|
|
|
MOVE_UP,
|
|
|
|
MOVE_DOWN,
|
2016-07-28 12:42:45 +10:00
|
|
|
MOVE_PARENT,
|
2016-12-23 04:46:00 +11:00
|
|
|
MOVE_CHILD,
|
|
|
|
MOVE_NEXT,
|
2017-01-02 05:53:53 +11:00
|
|
|
MOVE_PREV,
|
|
|
|
MOVE_FIRST
|
2015-08-18 17:28:44 +10:00
|
|
|
};
|
|
|
|
|
2015-08-20 13:22:15 +10:00
|
|
|
#include "container.h"
|
|
|
|
|
2015-08-18 21:19:20 +10:00
|
|
|
// 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.
|
|
|
|
// ---
|
2015-08-18 17:28:44 +10:00
|
|
|
|
|
|
|
swayc_t *get_focused_container(swayc_t *parent);
|
|
|
|
swayc_t *get_focused_view(swayc_t *parent);
|
2015-08-26 06:29:33 +10:00
|
|
|
swayc_t *get_focused_float(swayc_t *ws);
|
2015-08-18 17:28:44 +10:00
|
|
|
|
2016-07-04 03:22:10 +10:00
|
|
|
// a special-case function to get the focused view, regardless
|
2016-07-04 03:11:21 +10:00
|
|
|
// of whether it's tiled or floating
|
|
|
|
swayc_t *get_focused_view_include_floating(swayc_t *parent);
|
|
|
|
|
2015-10-23 23:32:17 +11:00
|
|
|
bool set_focused_container(swayc_t *container);
|
|
|
|
bool set_focused_container_for(swayc_t *ancestor, swayc_t *container);
|
2015-08-18 17:28:44 +10:00
|
|
|
|
2015-08-18 21:19:20 +10:00
|
|
|
// lock focused container/view. locked by windows with OVERRIDE attribute
|
|
|
|
// and unlocked when they are destroyed
|
2015-08-18 17:28:44 +10:00
|
|
|
|
|
|
|
extern bool locked_container_focus;
|
|
|
|
|
2016-07-12 05:27:13 +10:00
|
|
|
// Prevents wss from being destroyed on focus switch
|
|
|
|
extern bool suspend_workspace_cleanup;
|
2015-08-18 17:28:44 +10:00
|
|
|
|
|
|
|
bool move_focus(enum movement_direction direction);
|
|
|
|
|
|
|
|
#endif
|