howm
howm
|
Helper functions for dealing with an entire workspace or being able to correctly calculate a workspace index. More...
#include <xcb/xcb_ewmh.h>
#include <xcb/xproto.h>
#include "client.h"
#include "helper.h"
#include "howm.h"
#include "monitor.h"
#include "types.h"
#include "workspace.h"
#include "xcb_help.h"
Functions | |
void | kill_ws (monitor_t *m, workspace_t *ws) |
Kills the given workspace. More... | |
int | correct_ws (unsigned int ws) |
Correctly wrap a workspace number. More... | |
workspace_t * | offset_ws (workspace_t *ws, int offset) |
Return a workspace after offsetting. More... | |
void | focus_prev_ws (void) |
Focus the previous workspace. More... | |
void | focus_last_ws (void) |
Focus the last focused workspace. More... | |
void | focus_next_ws (void) |
Focus the next workspace. More... | |
void | change_ws (const workspace_t *ws) |
Change to a different workspace and map the correct windows. More... | |
uint32_t | workspace_to_index (const workspace_t *ws) |
Find and return a workspace's index in the workspace list. More... | |
workspace_t * | index_to_workspace (const monitor_t *m, uint32_t index) |
Convert a workspace's index in a workspace list to an index. More... | |
void | add_ws (monitor_t *m) |
Create a new workspace and update global state. More... | |
void | remove_ws (monitor_t *m, workspace_t *ws) |
Remove a workspace and update the global state. More... | |
Helper functions for dealing with an entire workspace or being able to correctly calculate a workspace index.
void add_ws | ( | monitor_t * | m | ) |
Create a new workspace and update global state.
m | The monitor that the workspace should be added on. |
|
inline |
Correctly wrap a workspace number.
This prevents workspace numbers from being greater than workspace_cnt or less than 1.
ws | The value that needs to be corrected. |
workspace_t* index_to_workspace | ( | const monitor_t * | m, |
uint32_t | index | ||
) |
Convert a workspace's index in a workspace list to an index.
m | The monitor to search for the workspace on. |
index | The index to search for. |
void kill_ws | ( | monitor_t * | m, |
workspace_t * | ws | ||
) |
Kills the given workspace.
m | The monitor that the workspace to be killed is on. |
ws | The workspace to be killed. |
|
inline |
Return a workspace after offsetting.
Use this to safely traverse the workspace list - instead of doing:
ws->next->next
do:
offset_ws(ws, 2)
ws | The workspace to be offset from. |
offset | The offset to apply |
void remove_ws | ( | monitor_t * | m, |
workspace_t * | ws | ||
) |
Remove a workspace and update the global state.
m | The monitor that the workspace is on. |
ws | The workspace to be removed. |
uint32_t workspace_to_index | ( | const workspace_t * | ws | ) |
Find and return a workspace's index in the workspace list.
ws | The workspace to search for. |