/*
 * DWN - Desktop Window Manager
 * retoor <retoor@molodetz.nl>
 * Workspace (tag/virtual desktop) management
 */

#ifndef DWN_WORKSPACE_H
#define DWN_WORKSPACE_H

#include "dwn.h"
#include <stdbool.h>

void workspace_init(void);
void workspace_cleanup(void);

Workspace *workspace_get(int index);
Workspace *workspace_get_current(void);
int workspace_get_current_index(void);

void workspace_switch(int index);
void workspace_switch_next(void);
void workspace_switch_prev(void);

void workspace_add_client(int workspace, Client *client);
void workspace_remove_client(int workspace, Client *client);
void workspace_move_client(Client *client, int new_workspace);
Client *workspace_get_first_client(int workspace);
Client *workspace_get_focused_client(int workspace);

void workspace_set_layout(int workspace, LayoutType layout);
LayoutType workspace_get_layout(int workspace);
void workspace_cycle_layout(int workspace);
void workspace_set_master_ratio(int workspace, float ratio);
void workspace_adjust_master_ratio(int workspace, float delta);
void workspace_set_master_count(int workspace, int count);
void workspace_adjust_master_count(int workspace, int delta);

void workspace_arrange(int workspace);
void workspace_arrange_current(void);

void workspace_show(int workspace);
void workspace_hide(int workspace);

void workspace_set_name(int workspace, const char *name);
const char *workspace_get_name(int workspace);
int workspace_client_count(int workspace);
bool workspace_is_empty(int workspace);

void workspace_focus_next(void);
void workspace_focus_prev(void);
void workspace_focus_master(void);

void workspace_alt_tab_next(void);
void workspace_alt_tab_prev(void);
void workspace_end_alt_tab(void);

void workspace_mru_push(int workspace, Client *client);
void workspace_mru_remove(int workspace, Client *client);
Client *workspace_mru_get_previous(int workspace, Client *current);

#endif
