#ifndef NETBOARD_GUI_H
#define NETBOARD_GUI_H

#include <gtk/gtk.h>

#include "message.h"

enum {
	GUI_PAGE_DESK,
	GUI_PAGE_CHAT,
	GUI_PAGE_GAMELOG,
	GUI_PAGE_NETLOG,
	GUI_PAGE_MAX
};

enum {
	GUI_ICON_NONE = 0,
	GUI_ICON_TIP,
	GUI_ICON_INFO,
	GUI_ICON_QUESTION,
	GUI_ICON_WARNING,
	GUI_ICON_ERROR,
	GUI_ICON_MAX
};

struct s_gui {
	int is_online;
	int is_game;
	int is_paused;
	int is_locked;
	int is_onturn;
	int can_start_game;
	int can_end_game;
	int can_select_game;
	int can_select_role;
	int semafor;
};

extern struct s_gui gui;

extern GtkWidget *main_window;
extern GtkWidget *dialog_connect;
extern GtkWidget *dialog_game_select;
extern GtkWidget *dialog_option_browser;

void update_main_window(void);
void set_semaphore(int x);
void after_create_main_window(void);
void enable_board(void);
void disable_board(void);
void show_alert_icon(int page);
void erase_logs (void);
void append_to_chat(char *fmt, ...);
void append_to_netlog(char *fmt, ...);
void append_to_gamelog(char *fmt, ...);
void set_statusbar_text(gchar *fmt,...);
void set_statusbar_clock(int is_visible, int set_icon, gchar *fmt,...);
void set_statusbar_progress(int visible, gdouble fraction, gchar *fmt,...);
void show_error_message(char *title, char *fmt, ...);
void show_dialog_game_select(void);
void show_dialog_connect(void);
void switch_main_page(int page);
void wait_for_callback(void);
void show_option_browser(void);
void update_option_browser(void);
void update_playerlist(void);
void store_options_with_info(void);
void gui_role_clear(void);
void gui_role_add(char *role);
int gui_exit_question(void);

#endif
