2012-08-12 12:18:43 +02:00
|
|
|
#undef I3__FILE__
|
|
|
|
#define I3__FILE__ "output.c"
|
2011-02-21 01:43:39 +01:00
|
|
|
/*
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
2011-10-23 00:40:02 +02:00
|
|
|
*
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
2013-01-25 14:53:15 +01:00
|
|
|
* © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
|
2011-10-23 00:40:02 +02:00
|
|
|
*
|
|
|
|
* output.c: Output (monitor) related functions.
|
|
|
|
*
|
2011-02-21 01:43:39 +01:00
|
|
|
*/
|
|
|
|
#include "all.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns the output container below the given output container.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
Con *output_get_content(Con *output) {
|
|
|
|
Con *child;
|
|
|
|
|
2014-06-19 11:20:32 +02:00
|
|
|
TAILQ_FOREACH(child, &(output->nodes_head), nodes)
|
|
|
|
if (child->type == CT_CON)
|
|
|
|
return child;
|
2011-02-21 01:43:39 +01:00
|
|
|
|
2013-01-25 14:53:15 +01:00
|
|
|
return NULL;
|
2011-02-21 01:43:39 +01:00
|
|
|
}
|
2015-03-04 09:22:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns an 'output' corresponding to one of left/right/down/up or a specific
|
|
|
|
* output name.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
Output *get_output_from_string(Output *current_output, const char *output_str) {
|
|
|
|
Output *output;
|
|
|
|
|
|
|
|
if (strcasecmp(output_str, "left") == 0)
|
|
|
|
output = get_output_next_wrap(D_LEFT, current_output);
|
|
|
|
else if (strcasecmp(output_str, "right") == 0)
|
|
|
|
output = get_output_next_wrap(D_RIGHT, current_output);
|
|
|
|
else if (strcasecmp(output_str, "up") == 0)
|
|
|
|
output = get_output_next_wrap(D_UP, current_output);
|
|
|
|
else if (strcasecmp(output_str, "down") == 0)
|
|
|
|
output = get_output_next_wrap(D_DOWN, current_output);
|
|
|
|
else
|
|
|
|
output = get_output_by_name(output_str);
|
|
|
|
|
|
|
|
return output;
|
|
|
|
}
|