Update of /cvsroot/gaim/gaim/src
In directory usw-pr-cvs1:/tmp/cvs-serv22299
Modified Files:
applet.c
Log Message:
handle size changes better.
Index: applet.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/applet.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- applet.c 2001/10/11 21:11:22 1.15
+++ applet.c 2001/10/11 22:53:19 1.16
@@ -55,7 +55,7 @@
GdkPixmap *cache;
GdkGC *gc;
char *path;
- GdkPixbuf *pb;
+ GdkPixbuf *pb, *scale;
guchar *dst, *p;
double affine[6];
int r,g,b,i;
@@ -66,17 +66,18 @@
gdk_gc_copy(gc, applet->style->bg_gc[GTK_WIDGET_STATE(applet)]);
path = gnome_pixmap_file(name);
- pb = gdk_pixbuf_new_from_file(path);
+ scale = gdk_pixbuf_new_from_file(path);
g_free(path);
- if (!pb)
+ if (!scale)
return NULL;
+ pb = gdk_pixbuf_scale_simple(scale, sizehint, sizehint, GDK_INTERP_HYPER);
dst = g_new0(guchar, sizehint*sizehint*3);
r = applet->style->bg[GTK_WIDGET_STATE(applet)].red>>8;
g = applet->style->bg[GTK_WIDGET_STATE(applet)].green>>8;
b = applet->style->bg[GTK_WIDGET_STATE(applet)].blue>>8;
p = dst;
- for (i = 0; i < 48*48; i++) {
+ for (i = 0; i < sizehint * sizehint; i++) {
*p++ = r;
*p++ = g;
*p++ = b;
@@ -319,11 +320,6 @@
GdkPixmap *pm;
applet_widget_init("GAIM", VERSION, argc, argv, NULL, 0, NULL);
-
- /*init imlib for graphics */
- gdk_imlib_init();
- gtk_widget_push_visual(gdk_imlib_get_visual());
- gtk_widget_push_colormap(gdk_imlib_get_colormap());
applet = applet_widget_new("gaim_applet");
if (!applet)
|