grim/guifications1

update so I can recode the heart of this in anjuta...
/*
Guifications - The notification plugin to end all notification plugins!
Copyright (C) 2003 Gary Kramlich
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.
*/
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "debug.h"
#ifdef _WIN32
#include "win32dep.h"
#endif
#include "gf_pngs.h"
#include "gf_types.h"
/***********************************************************************
* Statics
**********************************************************************/
static gchar *
gf_get_image_dir() {
return g_build_filename(DATADIR, "pixmaps", "gaim", "guifications", NULL);
}
/***********************************************************************
* Exports
**********************************************************************/
GdkPixbuf *
get_def_background_image() {
GdkPixbuf *ret;
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "backgrounds", "background_default.png", NULL), NULL);
return ret;
}
GdkPixbuf *
get_text_clipping_image(gf_text_clipping clipping) {
GdkPixbuf *ret;
switch(clipping) {
case text_clipping_elipse_start:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "text_clipping_elipse_start.png", NULL), NULL);
break;
case text_clipping_elipse_middle:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "text_clipping_elipse_middle.png", NULL), NULL);
break;
case text_clipping_elipse_end:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "text_clipping_elipse_end.png", NULL), NULL);
break;
case text_clipping_truncate:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "text_clipping_truncate.png", NULL), NULL);
break;
default:
ret = NULL;
break;
}
return ret;
}
GdkPixbuf *
get_item_position_image(gf_item_position position) {
GdkPixbuf *ret;
switch (position)
{
case item_position_nw:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_north_west.png", NULL), NULL);
break;
case item_position_n:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_north.png", NULL), NULL);
break;
case item_position_ne:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_north_east.png", NULL), NULL);
break;
case item_position_w:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_west.png", NULL), NULL);
break;
case item_position_c:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_center.png", NULL), NULL);
break;
case item_position_e:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_east.png", NULL), NULL);
break;
case item_position_sw:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_south_west.png", NULL), NULL);
break;
case item_position_s:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_south.png", NULL), NULL);
break;
case item_position_se:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "item_position_south_east.png", NULL), NULL);
break;
default:
ret = NULL;
break;
}
return ret;
}
GdkPixbuf *
get_icon_size_image(gf_icon_size size) {
GdkPixbuf *ret;
switch(size) {
case icon_size_huge:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "icon_size_huge.png", NULL), NULL);
break;
case icon_size_large:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "icon_size_large.png", NULL), NULL);
break;
case icon_size_normal:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "icon_size_normal.png", NULL), NULL);
break;
case icon_size_small:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "icon_size_small.png", NULL), NULL);
break;
case icon_size_tiny:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "icon_size_tiny.png", NULL), NULL);
break;
default:
ret = NULL;
break;
}
return ret;
}
GdkPixbuf *
get_window_position_image(gf_window_position position) {
GdkPixbuf *ret;
switch(position) {
case window_position_nw:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_north_west.png", NULL), NULL);
break;
case window_position_ne:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_north_east.png", NULL), NULL);
break;
case window_position_sw:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_south_west.png", NULL), NULL);
break;
case window_position_se:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_position_south_east.png", NULL), NULL);
break;
default:
ret = NULL;
break;
}
return ret;
}
GdkPixbuf *
get_window_zoom_image(gf_window_zoom zoom) {
GdkPixbuf *ret;
switch(zoom) {
case window_zoom_200:
case window_zoom_175:
case window_zoom_150:
case window_zoom_125:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_zoom_in.png", NULL), NULL);
break;
case window_zoom_100:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_zoom_normal.png", NULL), NULL);
break;
case window_zoom_75:
case window_zoom_50:
case window_zoom_25:
ret = gdk_pixbuf_new_from_file(g_build_filename(gf_get_image_dir(), "conf", "window_zoom_out.png", NULL), NULL);
break;
default:
ret = NULL;
break;
}
return ret;
}