changeset 3034:e8ab8597ac77

Automated merge from ssh://petrie/dev-src/audacious.
author nenolod@tiamat.local
date Wed, 11 Jul 2007 05:33:40 -0500
parents 2c17b008a532 (current diff) 6e98eedead3a (diff)
children bc862007dc1d 092f30bfae41
files
diffstat 4 files changed, 29 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Wed Jul 11 04:59:30 2007 -0500
+++ b/src/audacious/ui_skinned_button.c	Wed Jul 11 05:33:40 2007 -0500
@@ -41,7 +41,6 @@
 
 struct _UiSkinnedButtonPrivate {
     //Skinned part
-    GdkPixmap        *img;
     GdkGC            *gc;
     gint             w;
     gint             h;
@@ -172,7 +171,6 @@
     button->type = TYPE_NOT_SET;
     priv->move_x = 0;
     priv->move_y = 0;
-    priv->img = NULL;
 }
 
 static void ui_skinned_button_destroy (GtkObject *object) {
@@ -290,28 +288,29 @@
             break;
     }
 
-    if (priv->img)
-        g_object_unref(priv->img);
-    priv->img = gdk_pixmap_new(NULL, priv->w*(1+priv->double_size),
-                               priv->h*(1+priv->double_size),
-                               gdk_rgb_get_visual()->depth);
+    GdkPixmap *image;
+    image = gdk_pixmap_new(NULL, priv->w*(1+priv->double_size),
+                                 priv->h*(1+priv->double_size),
+                                 gdk_rgb_get_visual()->depth);
 
     if (priv->double_size) {
         GdkImage *img, *img2x;
         img = gdk_drawable_get_image(obj, 0, 0, priv->w, priv->h);
         img2x = create_dblsize_image(img);
-        gdk_draw_image (priv->img, gc, img2x, 0, 0, 0, 0, priv->w*2, priv->h*2);
+        gdk_draw_image (image, gc, img2x, 0, 0, 0, 0, priv->w*2, priv->h*2);
         g_object_unref(img2x);
         g_object_unref(img);
     } else
-        gdk_draw_drawable (priv->img, gc, obj, 0, 0, 0, 0, priv->w, priv->h);
+        gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, priv->w, priv->h);
 
     g_object_unref(obj);
 
-    gdk_draw_drawable (widget->window, gc, priv->img, 0, 0, 0, 0,
+    gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0,
                        priv->w*(1+priv->double_size), priv->h*(1+priv->double_size));
 
     g_object_unref(gc);
+    g_object_unref(image);
+
     return FALSE;
 }
 
--- a/src/audacious/ui_skinned_number.c	Wed Jul 11 04:59:30 2007 -0500
+++ b/src/audacious/ui_skinned_number.c	Wed Jul 11 05:33:40 2007 -0500
@@ -98,7 +98,6 @@
 static void ui_skinned_number_init(UiSkinnedNumber *number) {
     number->width = 9;
     number->height = 13;
-    number->img = NULL;
 }
 
 GtkWidget* ui_skinned_number_new(GtkWidget *fixed, gint x, gint y, SkinPixmapId si) {
@@ -198,27 +197,28 @@
                      number->skin_index, number->num * 9, 0,
                      0, 0, number->width, number->height);
 
-    if (number->img)
-        g_object_unref(number->img);
-    number->img = gdk_pixmap_new(NULL, number->width*(1+number->double_size),
-                                       number->height*(1+number->double_size),
-                                       gdk_rgb_get_visual()->depth);
+    GdkPixmap *image;
+    image = gdk_pixmap_new(NULL, number->width*(1+number->double_size),
+                                 number->height*(1+number->double_size),
+                                 gdk_rgb_get_visual()->depth);
 
     if (number->double_size) {
         GdkImage *img, *img2x;
         img = gdk_drawable_get_image(obj, 0, 0, number->width, number->height);
         img2x = create_dblsize_image(img);
-        gdk_draw_image (number->img, gc, img2x, 0, 0, 0, 0, number->width*2, number->height*2);
+        gdk_draw_image (image, gc, img2x, 0, 0, 0, 0, number->width*2, number->height*2);
         g_object_unref(img2x);
         g_object_unref(img);
     } else
-        gdk_draw_drawable (number->img, gc, obj, 0, 0, 0, 0, number->width, number->height);
+        gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, number->width, number->height);
 
     g_object_unref(obj);
 
-    gdk_draw_drawable (widget->window, gc, number->img, 0, 0, 0, 0,
+    gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0,
                        number->width*(1+number->double_size), number->height*(1+number->double_size));
     g_object_unref(gc);
+    g_object_unref(image);
+
     return FALSE;
 }
 
--- a/src/audacious/ui_skinned_number.h	Wed Jul 11 04:59:30 2007 -0500
+++ b/src/audacious/ui_skinned_number.h	Wed Jul 11 05:33:40 2007 -0500
@@ -40,7 +40,6 @@
     gint             x, y, width, height;
     gint             num;
     gboolean         double_size;
-    GdkPixmap        *img;
     SkinPixmapId     skin_index;
     GtkWidget        *fixed;
 };
--- a/src/audacious/ui_skinned_textbox.c	Wed Jul 11 04:59:30 2007 -0500
+++ b/src/audacious/ui_skinned_textbox.c	Wed Jul 11 05:33:40 2007 -0500
@@ -52,7 +52,6 @@
 };
 
 struct _UiSkinnedTextboxPrivate {
-    GdkPixmap        *img;
     SkinPixmapId     skin_index;
     GtkWidget        *fixed;
     gboolean         double_size;
@@ -176,7 +175,6 @@
     priv->resize_height = 0;
     priv->move_x = 0;
     priv->move_y = 0;
-    priv->img = NULL;
 }
 
 GtkWidget* ui_skinned_textbox_new(GtkWidget *fixed, gint x, gint y, gint w, gboolean allow_scroll, SkinPixmapId si) {
@@ -335,28 +333,29 @@
             }
 
         }
-    if (priv->img)
-        g_object_unref(priv->img);
-    priv->img = gdk_pixmap_new(NULL, textbox->width*(1+priv->double_size),
-                               textbox->height*(1+priv->double_size),
-                               gdk_rgb_get_visual()->depth);
+
+    GdkPixmap *image;
+    image = gdk_pixmap_new(NULL, textbox->width*(1+priv->double_size),
+                                 textbox->height*(1+priv->double_size),
+                                 gdk_rgb_get_visual()->depth);
 
     if (priv->double_size) {
         GdkImage *img, *img2x;
         img = gdk_drawable_get_image(obj, 0, 0, textbox->width, textbox->height);
         img2x = create_dblsize_image(img);
-        gdk_draw_image (priv->img, gc, img2x, 0, 0, 0, 0, textbox->width*2, textbox->height*2);
+        gdk_draw_image (image, gc, img2x, 0, 0, 0, 0, textbox->width*2, textbox->height*2);
         g_object_unref(img2x);
         g_object_unref(img);
     } else
-        gdk_draw_drawable (priv->img, gc, obj, 0, 0, 0, 0, textbox->width, textbox->height);
+        gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, textbox->width, textbox->height);
 
 
         g_object_unref(obj);
 
-        gdk_draw_drawable (widget->window, gc, priv->img, 0, 0, 0, 0,
+        gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0,
                            textbox->width*(1+priv->double_size), textbox->height*(1+priv->double_size));
         g_object_unref(gc);
+        g_object_unref(image);
     }
 
     return FALSE;
@@ -382,7 +381,8 @@
             } else
                 g_signal_emit(widget, textbox_signals[CLICKED], 0);
 
-        }
+        } else
+            priv->is_dragging = FALSE;
     } else if (event->type == GDK_2BUTTON_PRESS) {
         if (event->button == 1) {
             g_signal_emit(widget, textbox_signals[DOUBLE_CLICKED], 0);