~ubuntu-branches/ubuntu/jaunty/transmission/jaunty-security

« back to all changes in this revision

Viewing changes to gtk/sexy-icon-entry.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2008-11-28 15:33:48 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20081128153348-it70trfnxiroblmc
Tags: 1.40-0ubuntu1
* New upstream release (LP: #302672)
  - Tracker communication uses fewer resources
  - More accurate bandwidth limits
  - Reduce disk fragmentation by preallocating files (LP: #287726)
  - Stability, security and performance improvements to the RPC /
    Web UI server (closes LP: #290423)
  - Support compression when serving Web UI and RPC responses
  - Simplify the RPC whitelist
  - Fix bug that prevented handshakes with encrypted BitComet peers
  - Fix 1.3x bug that could re-download some data unnecessarily
    (LP: #295040)
  - Option to automatically update the blocklist weekly
  - Added off-hour bandwidth scheduling
  - Simplify file/priority selection in the details dialog
  - Fix a couple of crashes
  - New / updated translations
  - Don't inhibit hibernation by default (LP: #292929)
  - Use "close" animation when sending to notification area (LP: #130811)
  - Fix resize problems (LP: #269872)
  - Support "--version" option when launching from command line
    (LP: #292011)
  - Correctly parse announce URLs that have leading or trailing
    spaces (LP: #262411)
  - Display an error when "Open Torrent" fails (LP: #281463)
* Dropped 10_fix_crasher_from_upstream.dpatch: Fix is in this
  upstream release.
* debian/control: Don't just build-depend on libcurl-dev, which is
  a virtual package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
#include <string.h>
22
22
#include <gtk/gtk.h>
 
23
 
23
24
#include "sexy-icon-entry.h"
 
25
#include "sexy-marshal.h"
24
26
 
25
27
#define ICON_MARGIN 2
26
28
#define MAX_ICONS 2
89
91
        GObjectClass *gobject_class;
90
92
        GtkObjectClass *object_class;
91
93
        GtkWidgetClass *widget_class;
 
94
        GtkEntryClass *entry_class;
92
95
 
93
96
        parent_class = g_type_class_peek_parent(klass);
94
97
 
95
98
        gobject_class = G_OBJECT_CLASS(klass);
96
99
        object_class  = GTK_OBJECT_CLASS(klass);
97
100
        widget_class  = GTK_WIDGET_CLASS(klass);
 
101
        entry_class   = GTK_ENTRY_CLASS(klass);
98
102
 
99
103
        gobject_class->finalize = sexy_icon_entry_finalize;
100
104
 
126
130
                                         G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
127
131
                                         G_STRUCT_OFFSET(SexyIconEntryClass, icon_pressed),
128
132
                                         NULL, NULL,
129
 
                                         gtk_marshal_VOID__INT_INT,
 
133
                                         sexy_marshal_VOID__INT_INT,
130
134
                                         G_TYPE_NONE, 2,
131
135
                                         G_TYPE_INT,
132
136
                                         G_TYPE_INT);
146
150
                                         G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
147
151
                                         G_STRUCT_OFFSET(SexyIconEntryClass, icon_released),
148
152
                                         NULL, NULL,
149
 
                                         gtk_marshal_VOID__INT_INT,
 
153
                                         sexy_marshal_VOID__INT_INT,
150
154
                                         G_TYPE_NONE, 2,
151
155
                                         G_TYPE_INT,
152
156
                                         G_TYPE_INT);
153
157
}
154
158
 
155
159
static void
156
 
sexy_icon_entry_editable_init(GtkEditableClass *iface G_GNUC_UNUSED )
 
160
sexy_icon_entry_editable_init(GtkEditableClass *iface G_GNUC_UNUSED)
157
161
{
158
162
};
159
163
 
387
391
static void
388
392
sexy_icon_entry_size_request(GtkWidget *widget, GtkRequisition *requisition)
389
393
{
 
394
        GtkEntry *gtkentry;
390
395
        SexyIconEntry *entry;
391
396
        gint icon_widths = 0;
392
397
        int i;
393
398
 
 
399
        gtkentry = GTK_ENTRY(widget);
394
400
        entry    = SEXY_ICON_ENTRY(widget);
395
401
 
396
402
        for (i = 0; i < MAX_ICONS; i++)
464
470
get_pixbuf_from_icon(SexyIconEntry *entry, SexyIconEntryPosition icon_pos)
465
471
{
466
472
        GdkPixbuf *pixbuf = NULL;
467
 
        gchar *stock_id;
 
473
        const gchar *stock_id;
468
474
        SexyIconInfo *icon_info = &entry->priv->icons[icon_pos];
469
475
        GtkIconSize size;
 
476
        int w, h;
470
477
 
471
478
        switch (gtk_image_get_storage_type(GTK_IMAGE(icon_info->icon)))
472
479
        {
476
483
                        break;
477
484
 
478
485
                case GTK_IMAGE_STOCK:
479
 
                        gtk_image_get_stock(GTK_IMAGE(icon_info->icon), &stock_id, &size);
 
486
                        gtk_image_get_stock(GTK_IMAGE(icon_info->icon), (char**)&stock_id, &size);
480
487
                        pixbuf = gtk_widget_render_icon(GTK_WIDGET(entry),
481
488
                                                                                        stock_id, size, NULL);
482
489
                        break;
483
490
 
 
491
                case GTK_IMAGE_ICON_NAME:
 
492
                        gtk_image_get_icon_name (GTK_IMAGE(icon_info->icon), &stock_id, &size);
 
493
                        gtk_icon_size_lookup (size, &w, &h);
 
494
                        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), stock_id, size, 0, NULL);
 
495
                        break;
 
496
          
484
497
                default:
485
498
                        return NULL;
486
499
        }
566
579
 
567
580
                scale = height - (2 * ICON_MARGIN);
568
581
 
569
 
                temp_pixbuf = gdk_pixbuf_scale_simple(pixbuf, scale, scale, GDK_INTERP_BILINEAR);
 
582
                temp_pixbuf = gdk_pixbuf_scale_simple(pixbuf, scale, scale,
 
583
                                                                                          GDK_INTERP_BILINEAR);
570
584
 
571
585
                g_object_unref(pixbuf);
572
586
 
650
664
 
651
665
                if (strcmp(name, "pixbuf")   && strcmp(name, "stock")  &&
652
666
                        strcmp(name, "image")    && strcmp(name, "pixmap") &&
653
 
                        strcmp(name, "icon_set") && strcmp(name, "pixbuf_animation"))
 
667
                        strcmp(name, "icon-set") && strcmp(name, "pixbuf-animation") &&
 
668
                        strcmp(name, "icon-name"))
654
669
                {
655
670
                        return;
656
671
                }