/* ====================================================================
 * FTD4Linux Software License, Version 1.0
 *
 * Copyright (c) 2000-2004 The FTD4Linux Development Team.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        FTD4Linux Development Team (http://www.ftd4linux.2y.net/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "FTD" and "FTD4Linux" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact alguno@ftd4linux.2y.net.
 *
 * 5. Products derived from this software may not be called "FTD4Linux",
 *    nor may "FTD4Linux" appear in their name, without prior written
 *    permission of the FTD4Linux Development Team.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE FTD4LINUX DEVELOPMENT TEAM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include "ftd_gui_main.h"
#include "ftd_gui_pixbuf.h"
#include "ftd_gui_toolbar.h"

#if 0
static gboolean     ftd_gui_toolbar_updaten_enter(GtkWidget *, GdkEventFocus *, gpointer);
static gboolean     ftd_gui_toolbar_updaten_leave(GtkWidget *, GdkEventFocus *, gpointer);
static void         ftd_gui_toolbar_config_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_config_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_toevoegen_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_toevoegen_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_mail_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_mail_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_nieuw_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_nieuw_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_refresh_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_refresh_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_dayselector_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_dayselector_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_vrienden_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_vrienden_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_watchlist_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_watchlist_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_watcher_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_watcher_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_myftd_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_myftd_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_modje_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_modje_leave(GtkButton *, gpointer);
static void         ftd_gui_toolbar_hulp_enter(GtkButton *, gpointer);
static void         ftd_gui_toolbar_hulp_leave(GtkButton *, gpointer);
#endif

void
ftd_gui_toolbar_new(void)
{
    FtdGuiToolbar *toolbar;
    GtkWidget *separator1;
    GtkWidget *separator2;
    GtkWidget *vbox;
    GtkWidget *label;
    GdkPixbuf *pixbuf;
    GtkRequisition req;
    GtkToolItem *toolitem;

    g_assert(gui);

    toolbar = (FtdGuiToolbar *) g_malloc0(sizeof(FtdGuiToolbar));
    gui->toolbar = toolbar;
    toolbar->widget = gtk_toolbar_new ();
    gtk_toolbar_set_style (GTK_TOOLBAR (toolbar->widget), GTK_TOOLBAR_BOTH);
    gtk_toolbar_set_show_arrow(GTK_TOOLBAR (toolbar->widget), TRUE);

    pixbuf = ftd_gui_main_get_pixbuf("icon-updaten_off");
    toolbar->imgUpdaten = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemUpdaten = gtk_tool_button_new(toolbar->imgUpdaten, "Updaten");
    gtk_tool_item_set_homogeneous(toolbar->itemUpdaten, TRUE);
    gtk_tool_item_set_expand(toolbar->itemUpdaten, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemUpdaten, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-config_off");
    toolbar->imgConfig = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemConfig = gtk_tool_button_new(toolbar->imgConfig, "Config");
    gtk_tool_item_set_homogeneous(toolbar->itemConfig, TRUE);
    gtk_tool_item_set_expand(toolbar->itemConfig, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemConfig, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-toevoegen_off");
    toolbar->imgToevoegen = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemToevoegen = gtk_tool_button_new(toolbar->imgToevoegen, "Toevoegen");
    gtk_tool_item_set_homogeneous(toolbar->itemToevoegen, TRUE);
    gtk_tool_item_set_expand(toolbar->itemToevoegen, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemToevoegen, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-mail_off");
    toolbar->imgMail = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemMail = gtk_tool_button_new(toolbar->imgMail, "Mail");
    gtk_tool_item_set_homogeneous(toolbar->itemMail, TRUE);
    gtk_tool_item_set_expand(toolbar->itemMail, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemMail, -1);

    toolitem = gtk_separator_tool_item_new();
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolitem, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-nieuw_off");
    toolbar->imgNieuw = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemNieuw = gtk_tool_button_new(toolbar->imgNieuw, "Nieuw");
    gtk_tool_item_set_homogeneous(toolbar->itemNieuw, TRUE);
    gtk_tool_item_set_expand(toolbar->itemNieuw, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemNieuw, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");
    toolbar->imgWatchlist = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemWatchlist = gtk_tool_button_new(toolbar->imgWatchlist, "Watchlist");
    gtk_tool_item_set_homogeneous(toolbar->itemWatchlist, TRUE);
    gtk_tool_item_set_expand(toolbar->itemWatchlist, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemWatchlist, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-refresh_off");
    toolbar->imgRefresh = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemRefresh = gtk_tool_button_new(toolbar->imgRefresh, "Refresh");
    gtk_tool_item_set_homogeneous(toolbar->itemRefresh, TRUE);
    gtk_tool_item_set_expand(toolbar->itemRefresh, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemRefresh, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-dayselector_off");
    toolbar->imgDayselector = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemDayselector = gtk_tool_button_new(toolbar->imgDayselector, "Day Selector");
    gtk_tool_item_set_homogeneous(toolbar->itemDayselector, TRUE);
    gtk_tool_item_set_expand(toolbar->itemDayselector, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemDayselector, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-vrienden_off");
    toolbar->imgVrienden = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemVrienden = gtk_tool_button_new(toolbar->imgVrienden, "Vrienden van FTD");
    gtk_tool_item_set_homogeneous(toolbar->itemVrienden, TRUE);
    gtk_tool_item_set_expand(toolbar->itemVrienden, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemVrienden, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");
    toolbar->imgWatcher = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemWatcher = gtk_tool_button_new(toolbar->imgWatcher, "Watcher");
    gtk_tool_item_set_homogeneous(toolbar->itemWatcher, TRUE);
    gtk_tool_item_set_expand(toolbar->itemWatcher, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemWatcher, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-myftd_off");
    toolbar->imgMyFTD = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemMyFTD = gtk_tool_button_new(toolbar->imgMyFTD, "MyFTD");
    gtk_tool_item_set_homogeneous(toolbar->itemMyFTD, TRUE);
    gtk_tool_item_set_expand(toolbar->itemMyFTD, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemMyFTD, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-modje_off");
    toolbar->imgModje = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemModje = gtk_tool_button_new(toolbar->imgModje, "Modje");
    gtk_tool_item_set_homogeneous(toolbar->itemModje, TRUE);
    gtk_tool_item_set_expand(toolbar->itemModje, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemModje, -1);

    toolitem = gtk_separator_tool_item_new();
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolitem, -1);

    pixbuf = ftd_gui_main_get_pixbuf("icon-hulp_off");
    toolbar->imgHulp = gtk_image_new_from_pixbuf(pixbuf);
    toolbar->itemHulp = gtk_tool_button_new(toolbar->imgHulp, "Hulp");
    gtk_tool_item_set_homogeneous(toolbar->itemHulp, TRUE);
    gtk_tool_item_set_expand(toolbar->itemHulp, TRUE);
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar->widget), toolbar->itemHulp, -1);

    gtk_widget_show_all(toolbar->widget);

    /* updaten */
    g_signal_connect((gpointer) toolbar->itemUpdaten, "clicked",
                     G_CALLBACK(ftd_gui_callback_updaten), NULL);
#if 0
    g_signal_connect(GTK_WIDGET(toolbar->itemUpdaten), "enter-notify-event",
                     G_CALLBACK(ftd_gui_toolbar_updaten_enter), NULL);
    g_signal_connect(GTK_WIDGET(toolbar->itemUpdaten), "leave-notify-event",
                     G_CALLBACK(ftd_gui_toolbar_updaten_leave), NULL);
#endif

    /* config */
    g_signal_connect((gpointer) toolbar->itemConfig, "clicked",
                     G_CALLBACK(ftd_gui_callback_config), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemConfig, "enter",
                     G_CALLBACK(ftd_gui_toolbar_config_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemConfig, "leave",
                     G_CALLBACK(ftd_gui_toolbar_config_leave), NULL);
#endif

    /* toevoegen */
    g_signal_connect((gpointer) toolbar->itemToevoegen, "clicked",
                     G_CALLBACK(ftd_gui_callback_toevoegen), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemToevoegen, "enter",
                     G_CALLBACK(ftd_gui_toolbar_toevoegen_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemToevoegen, "leave",
                     G_CALLBACK(ftd_gui_toolbar_toevoegen_leave), NULL);
#endif

    /* FTD Mail */
    g_signal_connect((gpointer) toolbar->itemMail, "clicked",
                     G_CALLBACK(ftd_gui_callback_mail), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemMail, "enter",
                     G_CALLBACK(ftd_gui_toolbar_mail_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemMail, "leave",
                     G_CALLBACK(ftd_gui_toolbar_mail_leave), NULL);
#endif

    /* Nieuwe FTD Postings */
    g_signal_connect((gpointer) toolbar->itemNieuw, "clicked",
                     G_CALLBACK(ftd_gui_callback_nieuw), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemNieuw, "enter",
                     G_CALLBACK(ftd_gui_toolbar_nieuw_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemNieuw, "leave",
                     G_CALLBACK(ftd_gui_toolbar_nieuw_leave), NULL);
#endif

    /* Refresh */
    g_signal_connect((gpointer) toolbar->itemRefresh, "clicked",
                     G_CALLBACK(ftd_gui_callback_refresh), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemRefresh, "enter",
                     G_CALLBACK(ftd_gui_toolbar_refresh_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemRefresh, "leave",
                     G_CALLBACK(ftd_gui_toolbar_refresh_leave), NULL);
#endif

    /* Day Selector */
    g_signal_connect((gpointer) toolbar->itemDayselector, "clicked",
                     G_CALLBACK(ftd_gui_callback_dayselector), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemDayselector, "enter",
                     G_CALLBACK(ftd_gui_toolbar_dayselector_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemDayselector, "leave",
                     G_CALLBACK(ftd_gui_toolbar_dayselector_leave), NULL);
#endif

    /* Vrienden van FTD */
    g_signal_connect((gpointer) toolbar->itemVrienden, "clicked",
                     G_CALLBACK(ftd_gui_callback_vrienden), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemVrienden, "enter",
                     G_CALLBACK(ftd_gui_toolbar_vrienden_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemVrienden, "leave",
                     G_CALLBACK(ftd_gui_toolbar_vrienden_leave), NULL);
#endif

    /* Watchlist */
    g_signal_connect((gpointer) toolbar->itemWatchlist, "clicked",
                     G_CALLBACK(ftd_gui_callback_watchlist), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemWatchlist, "enter",
                     G_CALLBACK(ftd_gui_toolbar_watchlist_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemWatchlist, "leave",
                     G_CALLBACK(ftd_gui_toolbar_watchlist_leave), NULL);
#endif

    /* Watcher */
    g_signal_connect((gpointer) toolbar->itemWatcher, "clicked",
                     G_CALLBACK(ftd_gui_callback_watcher), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemWatcher, "enter",
                     G_CALLBACK(ftd_gui_toolbar_watcher_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemWatcher, "leave",
                     G_CALLBACK(ftd_gui_toolbar_watcher_leave), NULL);
#endif

    /* MyFTD */
    g_signal_connect((gpointer) toolbar->itemMyFTD, "clicked",
                     G_CALLBACK(ftd_gui_callback_myftd), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemMyFTD, "enter",
                     G_CALLBACK(ftd_gui_toolbar_myftd_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemMyFTD, "leave",
                     G_CALLBACK(ftd_gui_toolbar_myftd_leave), NULL);
#endif

    /* Modje */
    g_signal_connect((gpointer) toolbar->itemModje, "clicked",
                     G_CALLBACK(ftd_gui_callback_modje), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemModje, "enter",
                     G_CALLBACK(ftd_gui_toolbar_modje_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemModje, "leave",
                     G_CALLBACK(ftd_gui_toolbar_modje_leave), NULL);
#endif

    /* About */
    g_signal_connect((gpointer) toolbar->itemHulp, "clicked",
                     G_CALLBACK(ftd_gui_callback_about), NULL);
#if 0
    g_signal_connect((gpointer) toolbar->itemHulp, "enter",
                     G_CALLBACK(ftd_gui_toolbar_hulp_enter), NULL);
    g_signal_connect((gpointer) toolbar->itemHulp, "leave",
                     G_CALLBACK(ftd_gui_toolbar_hulp_leave), NULL);
#endif
}

gboolean
ftd_gui_toolbar_adjust_watchlist(gpointer data)
{
    GdkPixbuf *pixbuf = NULL;
    int newstate = -1;

    g_assert(gui);

    if (ftd_watchlist_get_state() == 0) {
        newstate = 1;
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_active");
    }

    if (ftd_watchlist_get_state() == 1) {
        newstate = 0;
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");
    }

    if (ftd_watchlist_get_state() == 2 || newstate == -1) {

        /* Herstel het icoon naar de originele staat */
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");
        gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatchlist), pixbuf);

        if (ftd_watchlist_get_state() != 2) {
            g_warning("ftd_gui_toolbar_adjust_watchlist(): invalid state : %i\n", ftd_watchlist_get_state());
        }

        return FALSE;
    }

    ftd_watchlist_set_state(newstate);
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatchlist), pixbuf);

    /* Zolang we TRUE retourneren wordt dit stuk om de x ms herhaalt */
    return TRUE;
}

gboolean
ftd_gui_toolbar_adjust_watcher(gpointer data)
{
    GdkPixbuf *pixbuf = NULL;
    int newstate = -1;

    g_assert(gui);

    if (ftd_watcher_get_state() == 0) {
        newstate = 1;
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_active");  // FIXME: Moet nieuw icoontje worden
    }

    if (ftd_watcher_get_state() == 1) {
        newstate = 0;
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");     // FIXME: Moet nieuw icoontje worden
    }

    if (ftd_watcher_get_state() == 2 || newstate == -1) {

        /* Herstel het icoon naar de originele staat */
        pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off"); // FIXME: Moet nieuw icoontje worden
        gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatcher), pixbuf);

        if (ftd_watcher_get_state() != 2) {
            g_warning("ftd_gui_toolbar_adjust_watcher(): invalid state : %i\n", ftd_watcher_get_state());
        }

        return FALSE;
    }

    ftd_watcher_set_state(newstate);
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatcher), pixbuf);

    /* Zolang we TRUE retourneren wordt dit stuk om de x ms herhaalt */
    return TRUE;
}

// Deze code is momenteel kaduuk
#if 0
static gboolean
ftd_gui_toolbar_updaten_enter(GtkWidget *sender, GdkEventFocus *event, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-updaten_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgUpdaten), pixbuf);

    return FALSE;
}

static gboolean
ftd_gui_toolbar_updaten_leave(GtkWidget *sender, GdkEventFocus *event, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-updaten_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgUpdaten), pixbuf);

    return FALSE;
}

static void
ftd_gui_toolbar_config_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-config_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgConfig), pixbuf);
}

static void
ftd_gui_toolbar_config_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-config_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgConfig), pixbuf);
}

static void
ftd_gui_toolbar_toevoegen_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-toevoegen_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgToevoegen), pixbuf);
}

static void
ftd_gui_toolbar_toevoegen_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-toevoegen_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgToevoegen), pixbuf);
}

static void
ftd_gui_toolbar_mail_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-mail_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgMail), pixbuf);
}

static void
ftd_gui_toolbar_mail_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-mail_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgMail), pixbuf);
}

static void
ftd_gui_toolbar_nieuw_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-nieuw_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgNieuw), pixbuf);
}

static void
ftd_gui_toolbar_nieuw_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-nieuw_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgNieuw), pixbuf);
}

static void
ftd_gui_toolbar_refresh_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-refresh_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgRefresh), pixbuf);
}

static void
ftd_gui_toolbar_refresh_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-refresh_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgRefresh), pixbuf);
}

static void
ftd_gui_toolbar_dayselector_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-dayselector_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgDayselector), pixbuf);
}

static void
ftd_gui_toolbar_dayselector_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-dayselector_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgDayselector), pixbuf);
}

static void
ftd_gui_toolbar_vrienden_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-vrienden_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgVrienden), pixbuf);
}

static void
ftd_gui_toolbar_vrienden_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-vrienden_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgVrienden), pixbuf);
}

static void
ftd_gui_toolbar_watchlist_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatchlist), pixbuf);
}

static void
ftd_gui_toolbar_watchlist_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatchlist), pixbuf);
}

static void
ftd_gui_toolbar_watcher_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_on");  // FIXME: Moet apart icoontje worden
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatcher), pixbuf);
}

static void
ftd_gui_toolbar_watcher_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-watchlist_off"); // FIXME: Moet apart icoontje worden
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgWatcher), pixbuf);
}

static void
ftd_gui_toolbar_myftd_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-myftd_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgMyFTD), pixbuf);
}

static void
ftd_gui_toolbar_myftd_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-myftd_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgMyFTD), pixbuf);
}

static void
ftd_gui_toolbar_modje_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-modje_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgModje), pixbuf);
}

static void
ftd_gui_toolbar_modje_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-modje_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgModje), pixbuf);
}

static void
ftd_gui_toolbar_hulp_enter(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-hulp_on");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgHulp), pixbuf);
}

static void
ftd_gui_toolbar_hulp_leave(GtkButton *sender, gpointer data)
{
    GdkPixbuf *pixbuf = NULL;

    g_assert(gui);

    pixbuf = ftd_gui_main_get_pixbuf("icon-hulp_off");
    gtk_image_set_from_pixbuf(GTK_IMAGE(gui->toolbar->imgHulp), pixbuf);
}
#endif
