comparison src/audacious/ui_skinned_equalizer_slider.c @ 4195:2281da647da9

beggining of GdkPixbuf transition
author Tomasz Mon <desowin@gmail.com>
date Sat, 19 Jan 2008 06:03:03 +0100
parents 9d4b5cdae3ba
children 47352b34dbdf
comparison
equal deleted inserted replaced
4191:3d8b2bbcb555 4195:2281da647da9
204 204
205 UiSkinnedEqualizerSlider *es = UI_SKINNED_EQUALIZER_SLIDER (widget); 205 UiSkinnedEqualizerSlider *es = UI_SKINNED_EQUALIZER_SLIDER (widget);
206 UiSkinnedEqualizerSliderPrivate *priv = UI_SKINNED_EQUALIZER_SLIDER_GET_PRIVATE(es); 206 UiSkinnedEqualizerSliderPrivate *priv = UI_SKINNED_EQUALIZER_SLIDER_GET_PRIVATE(es);
207 g_return_val_if_fail (priv->width > 0 && priv->height > 0, FALSE); 207 g_return_val_if_fail (priv->width > 0 && priv->height > 0, FALSE);
208 208
209 GdkPixmap *obj = NULL; 209 GdkPixbuf *obj = NULL;
210 GdkGC *gc; 210 obj = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, priv->width, priv->height);
211
212 obj = gdk_pixmap_new(NULL, priv->width, priv->height, gdk_rgb_get_visual()->depth);
213 gc = gdk_gc_new(obj);
214 211
215 gint frame; 212 gint frame;
216 frame = 27 - ((priv->position * 27) / 50); 213 frame = 27 - ((priv->position * 27) / 50);
217 if (frame < 14) 214 if (frame < 14)
218 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, priv->skin_index, (frame * 15) + 13, 164, 0, 0, priv->width, priv->height); 215 skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, (frame * 15) + 13, 164, 0, 0, priv->width, priv->height);
219 else 216 else
220 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, priv->skin_index, ((frame - 14) * 15) + 13, 229, 0, 0, priv->width, priv->height); 217 skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, ((frame - 14) * 15) + 13, 229, 0, 0, priv->width, priv->height);
221 218
222 if (priv->pressed) 219 if (priv->pressed)
223 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, priv->skin_index, 0, 176, 1, priv->position, 11, 11); 220 skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, 0, 176, 1, priv->position, 11, 11);
224 else 221 else
225 skin_draw_pixmap(widget, bmp_active_skin, obj, gc, priv->skin_index, 0, 164, 1, priv->position, 11, 11); 222 skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, 0, 164, 1, priv->position, 11, 11);
226 223
227 GdkPixmap *image = NULL; 224 GdkPixbuf *image = NULL;
228
229 if (priv->double_size) { 225 if (priv->double_size) {
230 image = create_dblsize_pixmap(obj); 226 image = gdk_pixbuf_scale_simple(obj, priv->width*2, priv->height*2, GDK_INTERP_NEAREST);
231 } else { 227 } else {
232 image = gdk_pixmap_new(NULL, priv->width, priv->height, gdk_rgb_get_visual()->depth); 228 image = gdk_pixbuf_copy(obj);
233 gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, priv->width, priv->height); 229 }
234 } 230
231 gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
232 priv->width*(1+priv->double_size), priv->height*(1+priv->double_size),
233 GDK_RGB_DITHER_NONE, 0, 0);
235 234
236 g_object_unref(obj); 235 g_object_unref(obj);
237
238 gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0,
239 priv->width*(1+priv->double_size), priv->height*(1+priv->double_size));
240 g_object_unref(gc);
241 g_object_unref(image); 236 g_object_unref(image);
242 237
243 return FALSE; 238 return FALSE;
244 } 239 }
245 240