aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-activity-handler.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-02-22 10:18:05 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-02-22 10:18:05 +0800
commitea9489d8944c6c4a7095e92a47991df421140a4b (patch)
tree474af4ad21bc7bcd8684bd6151b6b16408e067dc /shell/e-activity-handler.c
parent5416d54dcfb902d7c84e8d16585a68822f54db0f (diff)
downloadgsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar.gz
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar.bz2
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar.lz
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar.xz
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.tar.zst
gsoc2013-evolution-ea9489d8944c6c4a7095e92a47991df421140a4b.zip
Set the icons for all the "New..." menu items from the specified one in
* e-shell-user-creatable-items-handler.c (ensure_menu_items): Set the icons for all the "New..." menu items from the specified one in the type definitions. * e-activity-handler.c (create_gdk_pixbuf_from_corba_icon): Removed. (impl_operationStarted): Just use `e_new_gdk_pixbuf_from_corba_icon()'. * e-shell-corba-icon-utils.c (e_new_gdk_pixbuf_from_corba_icon): New. svn path=/trunk/; revision=15786
Diffstat (limited to 'shell/e-activity-handler.c')
-rw-r--r--shell/e-activity-handler.c46
1 files changed, 3 insertions, 43 deletions
diff --git a/shell/e-activity-handler.c b/shell/e-activity-handler.c
index 98f75619aa..9e85e44afb 100644
--- a/shell/e-activity-handler.c
+++ b/shell/e-activity-handler.c
@@ -26,6 +26,8 @@
#include "e-activity-handler.h"
+#include "e-shell-corba-icon-utils.h"
+
#include <gtk/gtksignal.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -64,48 +66,6 @@ struct _EActivityHandlerPrivate {
/* Utility functions. */
-static GdkPixbuf *
-create_gdk_pixbuf_from_corba_icon (const GNOME_Evolution_Icon *icon)
-{
- GdkPixbuf *pixbuf;
- GdkPixbuf *scaled_pixbuf;
- unsigned char *p;
- int src_offset;
- int i, j;
- int rowstride;
- int total_width;
-
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, icon->hasAlpha, 8, icon->width, icon->height);
-
- if (icon->hasAlpha)
- total_width = 4 * icon->width;
- else
- total_width = 3 * icon->width;
-
- rowstride = gdk_pixbuf_get_rowstride (pixbuf);
- src_offset = 0;
- p = gdk_pixbuf_get_pixels (pixbuf);
-
- for (i = 0; i < icon->height; i++) {
- for (j = 0; j < total_width; j++)
- p[j] = icon->rgbaData._buffer[src_offset ++];
- p += rowstride;
- }
-
- if (icon->width == ICON_SIZE && icon->height == ICON_SIZE)
- return pixbuf;
-
- scaled_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, icon->hasAlpha, 8, ICON_SIZE, ICON_SIZE);
- gdk_pixbuf_scale (pixbuf, scaled_pixbuf,
- 0, 0, ICON_SIZE, ICON_SIZE,
- 0, 0, (double) ICON_SIZE / icon->width, (double) ICON_SIZE / icon->height,
- GDK_INTERP_HYPER);
-
- gdk_pixbuf_unref (pixbuf);
-
- return scaled_pixbuf;
-}
-
static unsigned int
get_new_activity_id (EActivityHandler *activity_handler)
{
@@ -421,7 +381,7 @@ impl_operationStarted (PortableServer_Servant servant,
if (icon->_length > 1)
g_warning ("Animated icons are not supported for activities (yet).");
- icon_pixbuf = create_gdk_pixbuf_from_corba_icon (icon->_buffer);
+ icon_pixbuf = e_new_gdk_pixbuf_from_corba_icon (icon->_buffer, ICON_SIZE, ICON_SIZE);
activity_id = get_new_activity_id (activity_handler);