/**
 * config_changed:
 * @gpointer cb_data: the callback data
 *
 * Callback funtion which is called when the configuration is updated
 */
static void
config_changed(gpointer cb_data)
{
    i3WorkspacesPlugin *i3_workspaces = (i3WorkspacesPlugin *) cb_data;
    remove_workspaces(i3_workspaces);
    add_workspaces(i3_workspaces);
}
/**
 * on_workspace_created:
 * @workspace: the workspace
 * @data: the workspaces plugin
 *
 * Workspace created event handler.
 */
static void
on_workspace_created(i3workspace *workspace, gpointer data)
{
    i3WorkspacesPlugin *i3_workspaces = (i3WorkspacesPlugin *) data;

    remove_workspaces(i3_workspaces);
    add_workspaces(i3_workspaces);
}
static void
on_ipc_shutdown(gpointer i3_w)
{
    i3WorkspacesPlugin *i3_workspaces = (i3WorkspacesPlugin *) i3_w;

    remove_workspaces(i3_workspaces);
    i3wm_destruct(i3_workspaces->i3wm);
    i3_workspaces->i3wm = NULL;

    recover_from_disconnect(i3_workspaces);

    connect_callbacks(i3_workspaces);

    add_workspaces(i3_workspaces);
}
static void
on_ipc_shutdown(gpointer i3_w)
{
    i3WorkspacesPlugin *i3_workspaces = (i3WorkspacesPlugin *) i3_w;

    remove_workspaces(i3_workspaces);
    i3wm_destruct(i3_workspaces->i3wm);
    i3_workspaces->i3wm = NULL;

    //FIXME fix this
    //TODO: error_state_on();
    //recover_from_disconnect(i3_workspaces);
    //TODO: error_state_off();

    //connect_callbacks(i3_workspaces);

    //add_workspaces(i3_workspaces);
}