grim/guifications1
Clone
Summary
Browse
Changes
Graph
close this branch since the hg conversion opened it again (this was the original branch name from my initial cvs import back in 2003)
grim
2010-12-15, Gary Kramlich
8b1160fe3870
close this branch since the hg conversion opened it again (this was the original branch name from my initial cvs import back in 2003)
/*
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
"guifications.h"
/**********************************************************************/
gchar
*
gf_get_image_dir
()
{
return
g_build_filename
(
DATADIR
,
"pixmaps"
,
"gaim"
,
"guifications"
,
NULL
);
}
/**********************************************************************/
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_clipping_image
(
gf_clip
clip
)
{
GdkPixbuf
*
ret
;
switch
(
clip
)
{
case
clip_elipse_start
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"clip_elipse_start.png"
,
NULL
),
NULL
);
break
;
case
clip_elipse_middle
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"clip_elipse_middle.png"
,
NULL
),
NULL
);
break
;
case
clip_elipse_end
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"clip_elipse_end.png"
,
NULL
),
NULL
);
break
;
case
clip_truncate
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"clip_truncate.png"
,
NULL
),
NULL
);
break
;
default
:
ret
=
NULL
;
break
;
}
return
ret
;
}
/**********************************************************************/
GdkPixbuf
*
get_text_position_image
(
gf_tpos
pos
)
{
GdkPixbuf
*
ret
;
switch
(
pos
)
{
case
tpos_nw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north_west.png"
,
NULL
),
NULL
);
break
;
case
tpos_n
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north.png"
,
NULL
),
NULL
);
break
;
case
tpos_ne
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north_east.png"
,
NULL
),
NULL
);
break
;
case
tpos_w
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_west.png"
,
NULL
),
NULL
);
break
;
case
tpos_c
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_center.png"
,
NULL
),
NULL
);
break
;
case
tpos_e
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_east.png"
,
NULL
),
NULL
);
break
;
case
tpos_sw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_south_west.png"
,
NULL
),
NULL
);
break
;
case
tpos_s
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_south.png"
,
NULL
),
NULL
);
break
;
case
tpos_se
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_south_east.png"
,
NULL
),
NULL
);
break
;
default
:
ret
=
NULL
;
break
;
}
return
ret
;
}
/**********************************************************************/
GdkPixbuf
*
get_icon_position_image
(
gf_ipos
pos
)
{
GdkPixbuf
*
ret
;
switch
(
pos
)
{
case
ipos_none
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_none.png"
,
NULL
),
NULL
);
break
;
case
ipos_nw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north_west.png"
,
NULL
),
NULL
);
break
;
case
ipos_n
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north.png"
,
NULL
),
NULL
);
break
;
case
ipos_ne
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_north_east.png"
,
NULL
),
NULL
);
break
;
case
ipos_w
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_west.png"
,
NULL
),
NULL
);
break
;
case
ipos_c
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_center.png"
,
NULL
),
NULL
);
break
;
case
ipos_e
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_east.png"
,
NULL
),
NULL
);
break
;
case
ipos_sw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_south_west.png"
,
NULL
),
NULL
);
break
;
case
ipos_s
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"position_south.png"
,
NULL
),
NULL
);
break
;
case
ipos_se
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"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
isize_huge
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"protocol_size_huge.png"
,
NULL
),
NULL
);
break
;
case
isize_large
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"protocol_size_large.png"
,
NULL
),
NULL
);
break
;
case
isize_normal
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"protocol_size_normal.png"
,
NULL
),
NULL
);
break
;
case
isize_small
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"protocol_size_small.png"
,
NULL
),
NULL
);
break
;
case
isize_tiny
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"protocol_size_tiny.png"
,
NULL
),
NULL
);
break
;
default
:
ret
=
NULL
;
break
;
}
return
ret
;
}
/**********************************************************************/
GdkPixbuf
*
get_window_image
(
gf_gfpos
pos
)
{
GdkPixbuf
*
ret
;
switch
(
pos
)
{
case
gfpos_nw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"window_position_north_west.png"
,
NULL
),
NULL
);
break
;
case
gfpos_ne
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"window_position_north_east.png"
,
NULL
),
NULL
);
break
;
case
gfpos_sw
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"window_position_south_west.png"
,
NULL
),
NULL
);
break
;
case
gfpos_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_zoom_image
(
gf_zoom
zoom
)
{
GdkPixbuf
*
ret
;
switch
(
zoom
)
{
case
zoom_200
:
case
zoom_175
:
case
zoom_150
:
case
zoom_125
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"zoom_in.png"
,
NULL
),
NULL
);
break
;
case
zoom_100
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"zoom_normal.png"
,
NULL
),
NULL
);
break
;
case
zoom_75
:
case
zoom_50
:
case
zoom_25
:
ret
=
gdk_pixbuf_new_from_file
(
g_build_filename
(
gf_get_image_dir
(),
"conf"
,
"zoom_out.png"
,
NULL
),
NULL
);
break
;
default
:
ret
=
NULL
;
break
;
}
return
ret
;
}
/**********************************************************************/