aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/shortcut-bar/Makefile.am5
-rw-r--r--widgets/shortcut-bar/e-icon-bar.c38
-rw-r--r--widgets/shortcut-bar/e-icon-bar.h7
-rw-r--r--widgets/shortcut-bar/e-shortcut-bar.c21
-rw-r--r--widgets/shortcut-bar/test-shortcut-bar.c4
5 files changed, 40 insertions, 35 deletions
diff --git a/widgets/shortcut-bar/Makefile.am b/widgets/shortcut-bar/Makefile.am
index c60c57e872..bf41fcfc15 100644
--- a/widgets/shortcut-bar/Makefile.am
+++ b/widgets/shortcut-bar/Makefile.am
@@ -27,4 +27,7 @@ test_shortcut_bar_SOURCES = \
test_shortcut_bar_LDADD = \
./libshortcut-bar.a \
- $(EXTRA_GNOME_LIBS) \
+ $(EXTRA_GNOME_LIBS)
+
+test_shortcut_bar_LDFLAGS = \
+ `gnome-config --libs gdk_pixbuf`
diff --git a/widgets/shortcut-bar/e-icon-bar.c b/widgets/shortcut-bar/e-icon-bar.c
index 6bb32ed2a2..93fe4bb79c 100644
--- a/widgets/shortcut-bar/e-icon-bar.c
+++ b/widgets/shortcut-bar/e-icon-bar.c
@@ -29,8 +29,7 @@
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
-#include <libgnomeui/gnome-canvas-image.h>
-
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include "e-icon-bar.h"
#include "e-icon-bar-bg-item.h"
#include "e-icon-bar-text-item.h"
@@ -397,10 +396,14 @@ e_icon_bar_recalc_item_positions (EIconBar *icon_bar)
NULL);
gnome_canvas_item_set (item->image,
- "GnomeCanvasImage::x", (gdouble)icon_bar->icon_x,
- "GnomeCanvasImage::y", (gdouble)item->icon_y,
- "GnomeCanvasImage::width", (gdouble)icon_bar->icon_w,
- "GnomeCanvasImage::height", (gdouble)icon_bar->icon_h,
+ "GnomeCanvasPixbuf::x", (gdouble)icon_bar->icon_x,
+ "GnomeCanvasPixbuf::x_set", TRUE,
+ "GnomeCanvasPixbuf::y", (gdouble)item->icon_y,
+ "GnomeCanvasPixbuf::width", (gdouble)icon_bar->icon_w,
+ "GnomeCanvasPixbuf::width_set", TRUE,
+ "GnomeCanvasPixbuf::y_set", TRUE,
+ "GnomeCanvasPixbuf::height", (gdouble)icon_bar->icon_h,
+ "GnomeCanvasPixbuf::height_set", TRUE,
NULL);
y += item->item_height + icon_bar->spacing;
@@ -523,7 +526,7 @@ e_icon_bar_set_view_type (EIconBar *icon_bar,
**/
gint
e_icon_bar_add_item (EIconBar *icon_bar,
- GdkImlibImage *image,
+ GdkPixbuf *image,
gchar *text,
gint position)
{
@@ -570,11 +573,10 @@ e_icon_bar_add_item (EIconBar *icon_bar,
icon_bar);
item.image = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (icon_bar)->root),
- gnome_canvas_image_get_type (),
- "GnomeCanvasImage::image", image,
- "GnomeCanvasImage::anchor", GTK_ANCHOR_NORTH_WEST,
- "GnomeCanvasImage::width", (gdouble) icon_bar->icon_w,
- "GnomeCanvasImage::height", (gdouble) icon_bar->icon_h,
+ gnome_canvas_pixbuf_get_type (),
+ "GnomeCanvasPixbuf::pixbuf", image,
+ "GnomeCanvasPixbuf::width", (gdouble) icon_bar->icon_w,
+ "GnomeCanvasPixbuf::height", (gdouble) icon_bar->icon_h,
NULL);
gtk_signal_connect (GTK_OBJECT (item.image), "event",
GTK_SIGNAL_FUNC (e_icon_bar_on_item_event),
@@ -675,12 +677,12 @@ e_icon_bar_remove_item (EIconBar *icon_bar,
*
* Returns the icon used for the given item.
**/
-GdkImlibImage*
+GdkPixbuf *
e_icon_bar_get_item_image (EIconBar *icon_bar,
gint item_num)
{
EIconBarItem *item;
- GdkImlibImage *image;
+ GdkPixbuf *image = NULL;
g_return_val_if_fail (E_IS_ICON_BAR (icon_bar), NULL);
g_return_val_if_fail (item_num >= 0, NULL);
@@ -688,7 +690,7 @@ e_icon_bar_get_item_image (EIconBar *icon_bar,
item = &g_array_index (icon_bar->items, EIconBarItem, item_num);
gtk_object_get (GTK_OBJECT (item->image),
- "GnomeCanvasImage::image", image,
+ "GnomeCanvasPixbuf::pixbuf", image,
NULL);
return image;
}
@@ -705,7 +707,7 @@ e_icon_bar_get_item_image (EIconBar *icon_bar,
void
e_icon_bar_set_item_image (EIconBar *icon_bar,
gint item_num,
- GdkImlibImage *image)
+ GdkPixbuf *image)
{
EIconBarItem *item;
@@ -715,7 +717,7 @@ e_icon_bar_set_item_image (EIconBar *icon_bar,
item = &g_array_index (icon_bar->items, EIconBarItem, item_num);
gnome_canvas_item_set (item->image,
- "GnomeCanvasImage::image", image,
+ "GnomeCanvasPixbuf::pixbuf", image,
NULL);
}
@@ -1028,7 +1030,7 @@ e_icon_bar_find_item_at_position (EIconBar *icon_bar,
gint y,
gint *before_item)
{
- EIconBarItem *item;
+ EIconBarItem *item = NULL;
gint item_num;
if (before_item)
diff --git a/widgets/shortcut-bar/e-icon-bar.h b/widgets/shortcut-bar/e-icon-bar.h
index 74b7507384..65ab69f23f 100644
--- a/widgets/shortcut-bar/e-icon-bar.h
+++ b/widgets/shortcut-bar/e-icon-bar.h
@@ -26,6 +26,7 @@
#include <gdk_imlib.h>
#include <libgnomeui/gnome-canvas.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
#ifdef __cplusplus
extern "C" {
@@ -150,7 +151,7 @@ void e_icon_bar_set_view_type (EIconBar *icon_bar,
/* Adds a new item to a group at the given position. If position is -1 it is
added at the end. It returns the index of the item. */
gint e_icon_bar_add_item (EIconBar *icon_bar,
- GdkImlibImage *image,
+ GdkPixbuf *image,
gchar *text,
gint position);
@@ -163,11 +164,11 @@ void e_icon_bar_reorder_item (EIconBar *icon_bar,
void e_icon_bar_remove_item (EIconBar *icon_bar,
gint item_num);
-GdkImlibImage* e_icon_bar_get_item_image (EIconBar *icon_bar,
+GdkPixbuf * e_icon_bar_get_item_image (EIconBar *icon_bar,
gint item_num);
void e_icon_bar_set_item_image (EIconBar *icon_bar,
gint item_num,
- GdkImlibImage *image);
+ GdkPixbuf *image);
gchar* e_icon_bar_get_item_text (EIconBar *icon_bar,
gint item_num);
diff --git a/widgets/shortcut-bar/e-shortcut-bar.c b/widgets/shortcut-bar/e-shortcut-bar.c
index 7ad00feb78..842a8927f9 100644
--- a/widgets/shortcut-bar/e-shortcut-bar.c
+++ b/widgets/shortcut-bar/e-shortcut-bar.c
@@ -48,7 +48,7 @@ typedef struct _EShortcutBarBuiltinType EShortcutBarBuiltinType;
struct _EShortcutBarBuiltinType {
gchar *name;
gchar *filename;
- GdkImlibImage *image;
+ GdkPixbuf *image;
};
EShortcutBarBuiltinType e_shortcut_bar_builtin_types[] = {
@@ -60,7 +60,7 @@ EShortcutBarBuiltinType e_shortcut_bar_builtin_types[] = {
static gint e_shortcut_bar_num_builtin_types = sizeof (e_shortcut_bar_builtin_types) / sizeof (EShortcutBarBuiltinType);
gboolean e_shortcut_bar_default_type_image_loaded = FALSE;
-GdkImlibImage *e_shortcut_bar_default_type_image = NULL;
+GdkPixbuf *e_shortcut_bar_default_type_image = NULL;
gchar *e_shortcut_bar_default_type_filename = "gnome-balsa2.png";
static void e_shortcut_bar_class_init (EShortcutBarClass *class);
@@ -95,9 +95,9 @@ static void e_shortcut_bar_on_drag_data_delete (GtkWidget *widget,
EShortcutBar *shortcut_bar);
static void e_shortcut_bar_stop_editing (GtkWidget *button,
EShortcutBar *shortcut_bar);
-static GdkImlibImage* e_shortcut_bar_get_image_from_url (EShortcutBar *shortcut_bar,
+static GdkPixbuf* e_shortcut_bar_get_image_from_url (EShortcutBar *shortcut_bar,
gchar *item_url);
-static GdkImlibImage* e_shortcut_bar_load_image (gchar *filename);
+static GdkPixbuf* e_shortcut_bar_load_image (gchar *filename);
enum
@@ -280,7 +280,7 @@ e_shortcut_bar_add_item (EShortcutBar *shortcut_bar, gint group_num,
gchar *item_url, gchar *item_name)
{
EShortcutBarGroup *group;
- GdkImlibImage *image;
+ GdkPixbuf *image;
gint item_num;
g_return_val_if_fail (E_IS_SHORTCUT_BAR (shortcut_bar), -1);
@@ -290,7 +290,6 @@ e_shortcut_bar_add_item (EShortcutBar *shortcut_bar, gint group_num,
g_return_val_if_fail (item_name != NULL, -1);
image = e_shortcut_bar_get_image_from_url (shortcut_bar, item_url);
-
group = &g_array_index (shortcut_bar->groups,
EShortcutBarGroup, group_num);
@@ -437,7 +436,7 @@ e_shortcut_bar_on_drag_data_received (GtkWidget *widget,
EShortcutBarGroup *group;
gchar *item_name, *item_url;
EIconBar *icon_bar;
- GdkImlibImage *image;
+ GdkPixbuf *image;
gint group_num, item_num;
icon_bar = E_ICON_BAR (widget);
@@ -518,7 +517,7 @@ e_shortcut_bar_stop_editing (GtkWidget *button,
}
-static GdkImlibImage*
+static GdkPixbuf *
e_shortcut_bar_get_image_from_url (EShortcutBar *shortcut_bar,
gchar *item_url)
{
@@ -547,15 +546,15 @@ e_shortcut_bar_get_image_from_url (EShortcutBar *shortcut_bar,
}
-static GdkImlibImage*
+static GdkPixbuf *
e_shortcut_bar_load_image (gchar *filename)
{
gchar *pathname;
- GdkImlibImage *image = NULL;
+ GdkPixbuf *image = NULL;
pathname = gnome_pixmap_file (filename);
if (pathname)
- image = gdk_imlib_load_image (pathname);
+ image = gdk_pixbuf_new_from_file (pathname);
else
g_warning ("Couldn't find pixmap: %s", filename);
diff --git a/widgets/shortcut-bar/test-shortcut-bar.c b/widgets/shortcut-bar/test-shortcut-bar.c
index 186bf3ed8a..a86ec2a772 100644
--- a/widgets/shortcut-bar/test-shortcut-bar.c
+++ b/widgets/shortcut-bar/test-shortcut-bar.c
@@ -74,8 +74,8 @@ main (int argc, char *argv[])
gnome_init ("test-shortcut-bar", "0.1", argc, argv);
- gtk_widget_push_visual (gdk_imlib_get_visual ());
- gtk_widget_push_colormap (gdk_imlib_get_colormap ());
+ gtk_widget_push_visual (gdk_rgb_get_visual ());
+ gtk_widget_push_colormap (gdk_rgb_get_cmap ());
window = gnome_app_new ("TestShortcutBar", "TestShortCutBar");
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);