// -*- C++ -*-
//
//  This file is part of Siena, a wide-area event notification system.
//  See http://www.cs.colorado.edu/serl/siena/
//
//  Author: Antonio Carzaniga <carzanig@cs.colorado.edu>
//  See the file AUTHORS for full details. 
//
//  Copyright (C) 1998-2001  University of Colorado
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
//  USA, or send email to serl@cs.colorado.edu.
//
//
// $Id: Icons.cc,v 1.2 2001/09/02 17:55:14 carzanig Exp $
//
#include <map>

#include <gtk/gtk.h>
#include "Image.h"

#include "pixmaps/adv.xpm"
#include "pixmaps/notif.xpm"
#include "pixmaps/pub.xpm"
#include "pixmaps/obj1.xpm"
#include "pixmaps/obj2.xpm"
#include "pixmaps/siena.xpm"
#include "pixmaps/sub.xpm"
#include "pixmaps/unadv.xpm"
#include "pixmaps/unsub.xpm"
#include "pixmaps/anto.xpm"
#include "pixmaps/inventory.xpm"
#include "pixmaps/adapt.xpm"
#include "pixmaps/reconfigure.xpm"
#include "pixmaps/remove.xpm"
#include "pixmaps/update.xpm"
#include "pixmaps/constrain.xpm"
#include "pixmaps/rick.xpm"

Image * IMG_siena;
Image * IMG_obj1;
Image * IMG_obj2;
Image * IMG_anto;
Image * IMG_adapt;
Image * IMG_update;
Image * IMG_reconfigure;
Image * IMG_inventory;
Image * IMG_remove;
Image * IMG_constrain;
Image * IMG_rick;
Image * IMG_notif;
Image * IMG_pub;
Image * IMG_sub;
Image * IMG_unsub;
Image * IMG_adv;
Image * IMG_unadv;

typedef map<string, Image *> IconsMap;

IconsMap Imap;

void icons_init(GtkWidget * w) {
    IMG_siena = new PixmapImage(w, siena_xpm, 40, 40);
    IMG_obj1 = new PixmapImage(w, obj1_xpm, 32, 32);
    IMG_obj2 = new PixmapImage(w, obj2_xpm, 32, 32);
    IMG_anto = new PixmapImage(w, anto_xpm, 40, 60);
    IMG_adapt = new PixmapImage(w, adapt, 25, 25);
    IMG_update = new PixmapImage(w, update, 25, 25);
    IMG_reconfigure = new PixmapImage(w, reconfigure, 25, 25);
    IMG_inventory = new PixmapImage(w, inventory, 25, 25);
    IMG_remove = new PixmapImage(w, remove_xpm, 25, 25);
    IMG_constrain = new PixmapImage(w, constrain, 25, 25);
    IMG_rick = new PixmapImage(w, rick_xpm, 42, 60);
    IMG_notif = new PixmapImage(w, notif_xpm, 45, 30);
    IMG_pub = new PixmapImage(w, pub_xpm, 45, 30);
    IMG_sub = new PixmapImage(w, sub_xpm, 45, 30);
    IMG_unsub = new PixmapImage(w, unsub_xpm, 45, 30);
    IMG_adv = new PixmapImage(w, adv_xpm, 45, 30);
    IMG_unadv = new PixmapImage(w, unadv_xpm, 45, 30);

    Imap.insert(IconsMap::value_type("siena", IMG_siena));
    Imap.insert(IconsMap::value_type("thinclient", IMG_obj1));
    Imap.insert(IconsMap::value_type("object", IMG_obj2));
    Imap.insert(IconsMap::value_type("anto", IMG_anto));
    Imap.insert(IconsMap::value_type("adapt", IMG_adapt));
    Imap.insert(IconsMap::value_type("update", IMG_update));
    Imap.insert(IconsMap::value_type("reconfigure", IMG_reconfigure));
    Imap.insert(IconsMap::value_type("inventory", IMG_inventory));
    Imap.insert(IconsMap::value_type("remove", IMG_remove));
    Imap.insert(IconsMap::value_type("constrain", IMG_constrain));
    Imap.insert(IconsMap::value_type("rick", IMG_rick));
    Imap.insert(IconsMap::value_type("notif", IMG_notif));
    Imap.insert(IconsMap::value_type("pub", IMG_pub));
    Imap.insert(IconsMap::value_type("sub", IMG_sub));
    Imap.insert(IconsMap::value_type("unsub", IMG_unsub));
    Imap.insert(IconsMap::value_type("adv", IMG_adv));
    Imap.insert(IconsMap::value_type("unadv", IMG_unadv));
}

Image * icons_find(const char * iname) {
    IconsMap::const_iterator i = Imap.find(iname);
    if (i == Imap.end()) return NULL;
    return (*i).second;
}




