/*
 * DWN - Desktop Window Manager
 * retoor <retoor@molodetz.nl>
 * Client (window) management
 */

#ifndef DWN_CLIENT_H
#define DWN_CLIENT_H

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

Client *client_create(Window window);
void client_destroy(Client *client);

Client *client_manage(Window window);
void client_unmanage(Client *client);
Client *client_find_by_window(Window window);
Client *client_find_by_frame(Window frame);

void client_focus(Client *client, bool update_mru);
void client_unfocus(Client *client);
void client_raise(Client *client);
void client_lower(Client *client);
void client_minimize(Client *client);
void client_restore(Client *client);

void client_move(Client *client, int x, int y);
void client_resize(Client *client, int width, int height);
void client_move_resize(Client *client, int x, int y, int width, int height);
void client_configure(Client *client);
void client_apply_size_hints(Client *client, int *width, int *height);

void client_update_title(Client *client);
void client_update_class(Client *client);
void client_set_fullscreen(Client *client, bool fullscreen);
void client_toggle_fullscreen(Client *client);
void client_set_maximize(Client *client, bool maximized);
void client_toggle_maximize(Client *client);
void client_set_floating(Client *client, bool floating);
void client_toggle_floating(Client *client);

bool client_is_floating(Client *client);
bool client_is_fullscreen(Client *client);
bool client_is_maximized(Client *client);
bool client_is_minimized(Client *client);
bool client_is_dialog(Window window);
bool client_is_dock(Window window);
bool client_is_desktop(Window window);

void client_create_frame(Client *client);
void client_destroy_frame(Client *client);
void client_reparent_to_frame(Client *client);
void client_reparent_from_frame(Client *client);

void client_show(Client *client);
void client_hide(Client *client);
bool client_is_visible(Client *client);

void client_close(Client *client);
void client_kill(Client *client);

void client_add_to_list(Client *client);
void client_remove_from_list(Client *client);
int client_count(void);
int client_count_on_workspace(int workspace);

Client *client_get_next(Client *client);
Client *client_get_prev(Client *client);
Client *client_get_first(void);
Client *client_get_last(void);

void client_start_focus_animation(Client *client, bool gaining_focus);
unsigned long client_get_animated_title_color(Client *client);
unsigned long client_get_glow_text_color(Client *client);
void client_update_animations(void);

#endif
