* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "defs.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "claws-features.h"
+#endif
+
#include <glib.h>
#include <gtk/gtk.h>
#include <string.h>
#include <dirent.h>
+#ifdef HAVE_SVG
+#include <librsvg/rsvg.h>
+#include <math.h>
+#endif
-#include "config.h"
+#include "defs.h"
#include "stock_pixmap.h"
#include "gtkutils.h"
#include "utils.h"
#include "pixmaps/down_arrow.xpm"
#include "pixmaps/up_arrow.xpm"
#include "pixmaps/exec.xpm"
-#include "pixmaps/mail.xpm"
+#include "pixmaps/mail_draft.xpm"
#include "pixmaps/mail_attach.xpm"
#include "pixmaps/mail_compose.xpm"
#include "pixmaps/mail_forward.xpm"
+#include "pixmaps/mail_privacy_encrypted.xpm"
+#include "pixmaps/mail_privacy_signed.xpm"
#include "pixmaps/mail_receive.xpm"
#include "pixmaps/mail_receive_all.xpm"
#include "pixmaps/mail_reply.xpm"
#include "pixmaps/mime_calendar.xpm"
#include "pixmaps/mime_pgpsig.xpm"
#include "pixmaps/printer.xpm"
+#include "pixmaps/printer_btn.xpm"
#include "pixmaps/privacy_signed.xpm"
#include "pixmaps/privacy_passed.xpm"
#include "pixmaps/privacy_failed.xpm"
#include "pixmaps/mime_message.xpm"
#include "pixmaps/address_search.xpm"
#include "pixmaps/check_spelling.xpm"
-
#include "pixmaps/dir_close.xpm"
#include "pixmaps/dir_close_hrm.xpm"
#include "pixmaps/dir_open.xpm"
#include "pixmaps/trash_open.xpm"
#include "pixmaps/trash_close.xpm"
#include "pixmaps/delete_btn.xpm"
+#include "pixmaps/delete_dup_btn.xpm"
#include "pixmaps/cancel.xpm"
#include "pixmaps/trash_btn.xpm"
#include "pixmaps/trash_open_hrm.xpm"
#include "pixmaps/mark_unmark.xpm"
#include "pixmaps/mark_locked.xpm"
#include "pixmaps/mark_unlocked.xpm"
-#include "pixmaps/mark_allread.xpm"
-#include "pixmaps/mark_allunread.xpm"
-#include "pixmaps/mark_read.xpm"
+#include "pixmaps/mark_allread.xpm"
+#include "pixmaps/mark_allunread.xpm"
+#include "pixmaps/mark_read.xpm"
#include "pixmaps/mark_unread.xpm"
typedef struct _StockPixmapData StockPixmapData;
gboolean is_pixmap;
cairo_surface_t *base_pixmap;
cairo_surface_t *overlay_pixmap;
-
+
GdkPixbuf *base_pixbuf;
GdkPixbuf *overlay_pixbuf;
-
+
guint base_height;
guint base_width;
guint overlay_height;
{linewrapcurrent_xpm , NULL, NULL, "linewrapcurrent", NULL, NULL},
{linewrap_xpm , NULL, NULL, "linewrap", NULL, NULL},
{locked_xpm , NULL, NULL, "locked", NULL, NULL},
- {mail_xpm , NULL, NULL, "mail", NULL, NULL},
+ {mail_draft_xpm , NULL, NULL, "mail_draft", NULL, NULL},
{mail_attach_xpm , NULL, NULL, "mail_attach", NULL, NULL},
{mail_compose_xpm , NULL, NULL, "mail_compose", NULL, NULL},
{mail_forward_xpm , NULL, NULL, "mail_forward", NULL, NULL},
+ {mail_privacy_encrypted_xpm , NULL, NULL, "mail_privacy_encrypted", NULL, NULL},
+ {mail_privacy_signed_xpm , NULL, NULL, "mail_privacy_signed", NULL, NULL},
{mail_receive_xpm , NULL, NULL, "mail_receive", NULL, NULL},
{mail_receive_all_xpm , NULL, NULL, "mail_receive_all", NULL, NULL},
{mail_reply_xpm , NULL, NULL, "mail_reply", NULL, NULL},
{mime_image_xpm , NULL, NULL, "mime_image", NULL, NULL},
{mime_audio_xpm , NULL, NULL, "mime_audio", NULL, NULL},
{mime_text_enriched_xpm , NULL, NULL, "mime_text_enriched", NULL, NULL},
- {mime_unknown_xpm , NULL, NULL, "mime_unknown", NULL, NULL},
- {mime_pdf_xpm , NULL, NULL, "mime_pdf", NULL, NULL},
- {mime_ps_xpm , NULL, NULL, "mime_ps", NULL, NULL},
- {mime_calendar_xpm , NULL, NULL, "mime_calendar", NULL, NULL},
- {mime_pgpsig_xpm , NULL, NULL, "mime_pgpsig", NULL, NULL},
+ {mime_unknown_xpm , NULL, NULL, "mime_unknown", NULL, NULL},
+ {mime_pdf_xpm , NULL, NULL, "mime_pdf", NULL, NULL},
+ {mime_ps_xpm , NULL, NULL, "mime_ps", NULL, NULL},
+ {mime_calendar_xpm , NULL, NULL, "mime_calendar", NULL, NULL},
+ {mime_pgpsig_xpm , NULL, NULL, "mime_pgpsig", NULL, NULL},
+ {printer_btn_xpm , NULL, NULL, "printer_btn", NULL, NULL},
{printer_xpm , NULL, NULL, "printer", NULL, NULL},
{privacy_signed_xpm , NULL, NULL, "privacy_signed", NULL, NULL},
{privacy_passed_xpm , NULL, NULL, "privacy_passed", NULL, NULL},
- {privacy_failed_xpm , NULL, NULL, "privacy_failed", NULL, NULL},
+ {privacy_failed_xpm , NULL, NULL, "privacy_failed", NULL, NULL},
{privacy_unknown_xpm , NULL, NULL, "privacy_unknown", NULL, NULL},
{privacy_expired_xpm , NULL, NULL, "privacy_expired", NULL, NULL},
{privacy_warn_xpm , NULL, NULL, "privacy_warn", NULL, NULL},
{privacy_emblem_encrypted_xpm , NULL, NULL, "privacy_emblem_encrypted", NULL, NULL},
{privacy_emblem_signed_xpm , NULL, NULL, "privacy_emblem_signed", NULL, NULL},
{privacy_emblem_passed_xpm , NULL, NULL, "privacy_emblem_passed", NULL, NULL},
- {privacy_emblem_failed_xpm , NULL, NULL, "privacy_emblem_failed", NULL, NULL},
+ {privacy_emblem_failed_xpm , NULL, NULL, "privacy_emblem_failed", NULL, NULL},
{privacy_emblem_warn_xpm , NULL, NULL, "privacy_emblem_warn", NULL, NULL},
{mime_message_xpm , NULL, NULL, "mime_message", NULL, NULL},
{claws_mail_icon_xpm , NULL, NULL, "claws_mail_icon", NULL, NULL},
{claws_mail_icon_64_xpm , NULL, NULL, "claws_mail_icon_64", NULL, NULL},
{read_xpm , NULL, NULL, "read", NULL, NULL},
{delete_btn_xpm , NULL, NULL, "delete_btn", NULL, NULL},
+ {delete_dup_btn_xpm , NULL, NULL, "delete_dup_btn", NULL, NULL},
{cancel_xpm , NULL, NULL, "cancel", NULL, NULL},
{trash_btn_xpm , NULL, NULL, "trash_btn", NULL, NULL},
{claws_mail_compose_logo_xpm , NULL, NULL, "claws_mail_compose_logo", NULL, NULL},
{tray_unreadmail_xpm , NULL, NULL, "tray_unreadmail", NULL, NULL},
{tray_unreadmarkedmail_offline_xpm, NULL, NULL, "tray_unreadmarkedmail_offline", NULL, NULL},
{tray_unreadmarkedmail_xpm , NULL, NULL, "tray_unreadmarkedmail", NULL, NULL},
- {doc_index_xpm , NULL, NULL, "doc_index", NULL, NULL,},
- {doc_index_close_xpm , NULL, NULL, "doc_index_close", NULL, NULL,},
- {doc_info_xpm , NULL, NULL, "doc_info", NULL, NULL,},
+ {doc_index_xpm , NULL, NULL, "doc_index", NULL, NULL},
+ {doc_index_close_xpm , NULL, NULL, "doc_index_close", NULL, NULL},
+ {doc_info_xpm , NULL, NULL, "doc_info", NULL, NULL},
{first_arrow_xpm , NULL, NULL, "first_arrow", NULL, NULL},
{last_arrow_xpm , NULL, NULL, "last_arrow", NULL, NULL},
{left_arrow_xpm , NULL, NULL, "left_arrow", NULL, NULL},
{zoom_in_xpm , NULL, NULL, "zoom_in", NULL, NULL},
{zoom_out_xpm , NULL, NULL, "zoom_out", NULL, NULL},
{zoom_width_xpm , NULL, NULL, "zoom_width", NULL, NULL},
- {mark_ignorethread_xpm , NULL, NULL, "mark_ignorethread", NULL},
- {mark_watchthread_xpm , NULL, NULL, "mark_watchthread", NULL},
+ {mark_ignorethread_xpm , NULL, NULL, "mark_ignorethread", NULL, NULL},
+ {mark_watchthread_xpm , NULL, NULL, "mark_watchthread", NULL, NULL},
{mark_mark_xpm , NULL, NULL, "mark_mark", NULL, NULL},
{mark_unmark_xpm , NULL, NULL, "mark_unmark", NULL, NULL},
{mark_locked_xpm , NULL, NULL, "mark_locked", NULL, NULL},
{empty_xpm , NULL, NULL, "empty", NULL, NULL}
};
+/* Supported theme extensions */
+static const char *extension[] = {
+ ".png",
+ ".xpm",
+#ifdef HAVE_SVG
+ ".svg",
+#endif
+ NULL
+};
+
+/* return current supported extensions */
+const char **stock_pixmap_theme_extensions(void)
+{
+ return extension;
+}
+
/* return newly constructed GtkPixmap from GdkPixmap */
GtkWidget *stock_pixmap_widget(StockPixmap icon)
{
GdkPixbuf *pixbuf;
- cm_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, NULL);
+ cm_return_val_if_fail(icon < N_STOCK_PIXMAPS, NULL);
if (stock_pixbuf_gdk(icon, &pixbuf) != -1)
return gtk_image_new_from_pixbuf(pixbuf);
-
+
return NULL;
}
+#ifdef HAVE_SVG
+/*
+ * Renders a SVG into a Cairo context at the given dimensions keeping
+ * the aspect ratio.
+ *
+ * Adapted from https://developer.gnome.org/rsvg/2.40/RsvgHandle.html
+ * #rsvg-handle-set-size-callback
+ */
+void render_scaled_proportionally(RsvgHandle *handle, cairo_t *cr, int width, int height)
+{
+ RsvgDimensionData dimensions;
+ double x_factor, y_factor;
+ double scale_factor;
+
+ rsvg_handle_get_dimensions(handle, &dimensions);
+
+ x_factor = (double) width / dimensions.width;
+ y_factor = (double) height / dimensions.height;
+
+ scale_factor = MIN(x_factor, y_factor);
+
+ cairo_scale(cr, scale_factor, scale_factor);
+
+ rsvg_handle_render_cairo(handle, cr);
+}
+
+/*
+ * Generates a new Pixbuf from a Cairo context of the given dimensions.
+ *
+ * Adapted from https://gist.github.com/bert/985903
+ */
+GdkPixbuf *pixbuf_from_cairo(cairo_t *cr, gboolean alpha, int width, int height)
+{
+ gint p_stride, /* Pixbuf stride value */
+ p_n_channels, /* RGB -> 3, RGBA -> 4 */
+ s_stride; /* Surface stride value */
+ guchar *p_pixels, /* Pixbuf's pixel data */
+ *s_pixels; /* Surface's pixel data */
+ cairo_surface_t *surface; /* Temporary image surface */
+ GdkPixbuf *pixbuf; /* Returned pixbuf */
+
+ /* Create pixbuf */
+ pixbuf = gdk_pixbuf_new
+ (GDK_COLORSPACE_RGB, alpha, 8, width, height);
+ if (pixbuf == NULL) {
+ g_warning("failed to create a new %d x %d pixbuf", width, height);
+ return NULL;
+ }
+ /* Obtain surface from where pixel values will be copied */
+ surface = cairo_get_target(cr);
+ if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
+ g_warning("invalid cairo surface for copying");
+ return NULL;
+ }
+ /* Inspect pixbuf */
+ g_object_get(G_OBJECT(pixbuf),
+ "rowstride", &p_stride,
+ "n-channels", &p_n_channels,
+ "pixels", &p_pixels,
+ NULL);
+ /* and surface */
+ s_stride = cairo_image_surface_get_stride(surface);
+ s_pixels = cairo_image_surface_get_data(surface);
+
+ /* Copy pixel data from surface to pixbuf */
+ while (height--) {
+ gint i;
+ guchar *p_iter = p_pixels, *s_iter = s_pixels;
+ for (i = 0; i < width; i++) {
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+ /* Pixbuf: RGB(A) - Surface: BGRA */
+ gdouble alpha_factor = (gdouble)0xff / s_iter[3];
+ p_iter[0] = (guchar)( s_iter[2] * alpha_factor + .5 );
+ p_iter[1] = (guchar)( s_iter[1] * alpha_factor + .5 );
+ p_iter[2] = (guchar)( s_iter[0] * alpha_factor + .5 );
+ if (p_n_channels == 4)
+ p_iter[3] = s_iter[3];
+#elif G_BYTE_ORDER == G_BIG_ENDIAN
+ /* Pixbuf: RGB(A) - Surface: ARGB */
+ gdouble alpha_factor = (gdouble)0xff / s_iter[0];
+ p_iter[0] = (guchar)( s_iter[1] * alpha_factor + .5 );
+ p_iter[1] = (guchar)( s_iter[2] * alpha_factor + .5 );
+ p_iter[2] = (guchar)( s_iter[3] * alpha_factor + .5 );
+ if (p_n_channels == 4)
+ p_iter[3] = s_iter[0];
+#else /* PDP endianness */
+ /* Pixbuf: RGB(A) - Surface: RABG */
+ gdouble alpha_factor = (gdouble)0xff / s_iter[1];
+ p_iter[0] = (guchar)( s_iter[0] * alpha_factor + .5 );
+ p_iter[1] = (guchar)( s_iter[3] * alpha_factor + .5 );
+ p_iter[2] = (guchar)( s_iter[2] * alpha_factor + .5 );
+ if (p_n_channels == 4)
+ p_iter[3] = s_iter[1];
+#endif
+ s_iter += 4;
+ p_iter += p_n_channels;
+ }
+ s_pixels += s_stride;
+ p_pixels += p_stride;
+ }
+ /* Destroy context */
+ cairo_destroy(cr);
+
+ return pixbuf;
+}
+
+/*
+ * Renders a SVG file into a pixbuf with the dimensions of the
+ * given pixmap data (optionally with alpha channel).
+ */
+GdkPixbuf *pixbuf_from_svg_like_icon(char *filename, GError **error, StockPixmapData *icondata, gboolean alpha)
+{
+ int width, height;
+ cairo_surface_t *surface;
+ cairo_t *context;
+ RsvgHandle *handle;
+
+ cm_return_val_if_fail(filename != NULL, NULL);
+ cm_return_val_if_fail(icondata != NULL, NULL);
+
+ /* load SVG file */
+ handle = rsvg_handle_new_from_file(filename, error);
+ if (handle == NULL) {
+ g_warning("failed loading SVG '%s': %s (%d)", filename,
+ (*error)->message, (*error)->code);
+ return NULL;
+ }
+
+ /* scale dimensions */
+ if (prefs_common.enable_pixmap_scaling) {
+ /* default is pixmap icon size */
+ if (sscanf((icondata->data)[0], "%d %d ", &width, &height) != 2) {
+ g_warning("failed reading icondata width and height");
+ return NULL;
+ }
+ /* which can be modified by some factor */
+ if (prefs_common.pixmap_scaling_ppi > 0) {
+ gdouble factor = (gdouble) prefs_common.pixmap_scaling_ppi / MIN_PPI;
+ width = (int) floor(factor * width);
+ height = (int) floor(factor * height);
+ }
+ } else { /* render using SVG size */
+ RsvgDimensionData dimension;
+
+ rsvg_handle_get_dimensions (handle, &dimension);
+ width = dimension.width;
+ height = dimension.height;
+ }
+
+ /* create drawing context */
+ surface = cairo_image_surface_create(
+ alpha? CAIRO_FORMAT_ARGB32: CAIRO_FORMAT_RGB24,
+ width, height);
+ if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
+ g_warning("failed to create a cairo surface: %s",
+ cairo_status_to_string(cairo_surface_status(surface)));
+ g_object_unref(handle);
+ return NULL;
+ }
+ context = cairo_create(surface);
+ cairo_surface_destroy(surface);
+ if (cairo_status(context) != CAIRO_STATUS_SUCCESS) {
+ g_warning("failed to create a cairo context: %s",
+ cairo_status_to_string(cairo_status(context)));
+ cairo_destroy(context);
+ return NULL;
+ }
+ /* render SVG */
+ render_scaled_proportionally(handle, context, width, height);
+ /* build result and destroy context */
+ return pixbuf_from_cairo(context, alpha, width, height);
+}
+#endif
+
/*!
- *\brief
+ *\brief
*/
gint stock_pixbuf_gdk(StockPixmap icon, GdkPixbuf **pixbuf)
{
StockPixmapData *pix_d;
- static const char *extension[]={".png", ".xpm", NULL};
int i = 0;
gboolean theme_changed = FALSE;
if (pixbuf)
*pixbuf = NULL;
-
- cm_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, -1);
+
+ cm_return_val_if_fail(icon < N_STOCK_PIXMAPS, -1);
pix_d = &pixmaps[icon];
theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
if (!pix_d->pixbuf || theme_changed) {
GdkPixbuf *pix = NULL;
-
+
if (theme_changed && pix_d->pixmap) {
g_object_unref(pix_d->pixmap);
pix_d->pixmap = NULL;
if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
if (is_dir_exist(prefs_common.pixmap_theme_path)) {
- char *icon_file_name;
-try_next_extension:
+ char *icon_file_name;
+try_next_extension:
icon_file_name = g_strconcat(prefs_common.pixmap_theme_path,
G_DIR_SEPARATOR_S,
pix_d->file,
NULL);
if (is_file_exist(icon_file_name)) {
GError *err = NULL;
- pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+#ifdef HAVE_SVG
+ if (!strncmp(extension[i], ".svg", 4)) {
+ pix = pixbuf_from_svg_like_icon(icon_file_name, &err, pix_d,
+ prefs_common.enable_alpha_svg);
+ } else {
+ pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+ }
+#else
+ pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+#endif
if (err) g_error_free(err);
- }
+ }
if (pix) {
g_free(pix_d->icon_path);
pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **) pix_d->data);
if (pix_d->pixbuf) {
g_free(pix_d->icon_path);
- pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);
+ pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);
}
}
if (pixbuf)
*pixbuf = pix_d->pixbuf;
- /* pixbuf should have one ref outstanding */
+ /* pixbuf should have one ref outstanding */
return 0;
}
gchar *fullentry;
GDir *dp;
GError *error = NULL;
- static const char *extension[]={".png", ".xpm", NULL};
-
+
if ((dp = g_dir_open(dirname, 0, &error)) == NULL) {
debug_print("skipping theme scan, dir %s could not be opened: %s (%d)\n",
dirname ? dirname : "(null)", error->message, error->code);
g_error_free(error);
return;
}
-
+
while ((entry = g_dir_read_name(dp)) != NULL) {
fullentry = g_strconcat(dirname, G_DIR_SEPARATOR_S, entry, NULL);
-
+
if (strcmp(entry, ".") != 0 && strcmp(entry, "..") != 0 && is_dir_exist(fullentry)) {
gchar *filetoexist;
gboolean found = FALSE;
g_free(filetoexist);
}
}
- if (i == N_STOCK_PIXMAPS)
+ if (i == N_STOCK_PIXMAPS)
g_free(fullentry);
- } else
+ } else
g_free(fullentry);
}
g_dir_close(dp);
gchar *userthemes;
gchar *systemthemes;
GList *list = NULL;
-
+
defaulttheme = g_strdup(DEFAULT_PIXMAP_THEME);
- userthemes = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+ userthemes = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
PIXMAP_THEME_DIR, NULL);
systemthemes = stock_pixmap_get_system_theme_dir_for_theme(NULL);
{
GList *ptr;
- for (ptr = g_list_first(list); ptr != NULL; ptr = g_list_next(ptr))
+ cm_return_if_fail(list != NULL);
+
+ for (ptr = g_list_first(list); ptr != NULL; ptr = g_list_next(ptr))
g_free(ptr->data);
- g_list_free(list);
+ g_list_free(list);
+}
+
+void stock_pixmap_invalidate_all_icons(void)
+{
+ StockPixmapData *pix_d;
+ int i = 0;
+
+ while (i < N_STOCK_PIXMAPS) {
+ pix_d = &pixmaps[i];
+ if (pix_d->pixbuf) {
+ g_object_unref(G_OBJECT(pix_d->pixbuf));
+ pix_d->pixbuf = NULL;
+ }
+ if (pix_d->pixmap) {
+ g_object_unref(G_OBJECT(pix_d->pixmap));
+ pix_d->pixmap = NULL;
+ }
+ i++;
+ }
}
gchar *stock_pixmap_get_name (StockPixmap icon)
{
- if (icon < 0 || icon >= N_STOCK_PIXMAPS)
+ if (icon >= N_STOCK_PIXMAPS)
return NULL;
-
+
return pixmaps[icon].file;
}
StockPixmap stock_pixmap_get_icon (gchar *file)
{
gint i;
-
+
for (i = 0; i < N_STOCK_PIXMAPS; i++) {
if (strcmp (pixmaps[i].file, file) == 0)
return i;
}
static gboolean do_pix_draw(GtkWidget *widget, cairo_t *cr,
- OverlayData *data)
+ OverlayData *data)
{
- GdkWindow *drawable = gtk_widget_get_window(widget);
+ GdkWindow *drawable = gtk_widget_get_window(widget);
gint left = 0;
gint top = 0;
case OVERLAY_MID_RIGHT:
top = (data->base_height + data->border_y * 2 - data->overlay_height)/2;
break;
-
+
case OVERLAY_BOTTOM_LEFT:
case OVERLAY_BOTTOM_CENTER:
case OVERLAY_BOTTOM_RIGHT:
#if !GTK_CHECK_VERSION(3,0,0)
static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventExpose *expose,
- OverlayData *data)
+ OverlayData *data)
#else
static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, cairo_t *cr,
- OverlayData *data)
+ OverlayData *data)
#endif
{
#if !GTK_CHECK_VERSION(3,0,0)
cairo_t *cr;
- GdkWindow *drawable = gtk_widget_get_window(widget);
+ GdkWindow *drawable = gtk_widget_get_window(widget);
gboolean result;
cr = gdk_cairo_create(drawable);
#endif
}
-static void pixmap_with_overlay_destroy_cb(GtkWidget *object, OverlayData *data)
+static void pixmap_with_overlay_destroy_cb(GtkWidget *object, OverlayData *data)
{
if (data->is_pixmap) {
cairo_surface_destroy(data->base_pixmap);
GtkWidget *stock_wid = NULL;
GtkRequisition requisition;
OverlayData *data = NULL;
-
+
data = g_new0(OverlayData, 1);
stock_wid = stock_pixmap_widget(icon);
data->highlight = FALSE;
widget = gtk_drawing_area_new();
- gtk_widget_set_size_request(widget, data->base_width + border_x * 2,
+ gtk_widget_set_size_request(widget, data->base_width + border_x * 2,
data->base_height + border_y * 2);
#if !GTK_CHECK_VERSION(3, 0, 0)
- g_signal_connect(G_OBJECT(widget), "expose_event",
+ g_signal_connect(G_OBJECT(widget), "expose_event",
G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
#else
- g_signal_connect(G_OBJECT(widget), "draw",
+ g_signal_connect(G_OBJECT(widget), "draw",
G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
#endif
g_signal_connect(G_OBJECT(widget), "destroy",