[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-434-g14f1e8bb6

paul at claws-mail.org paul at claws-mail.org
Thu Mar 24 10:49:53 UTC 2022


The branch, gtk3 has been updated
       via  14f1e8bb6a968698e6ef6b93a3f723d39492bcff (commit)
      from  8889f77355843df2a36d17c7a3a43277e6493de3 (commit)

Summary of changes:
 src/gtk/about.c                                |  2 +-
 src/gtk/gtkutils.c                             |  6 +-
 src/main.c                                     |  2 +-
 src/plugins/notification/notification_pixbuf.c |  4 +-
 src/stock_pixmap.c                             | 80 +++++++++++++++++++++++---
 src/stock_pixmap.h                             | 18 ++++--
 src/wizard.c                                   |  8 +--
 7 files changed, 97 insertions(+), 23 deletions(-)


- Log -----------------------------------------------------------------
commit 14f1e8bb6a968698e6ef6b93a3f723d39492bcff
Author: paul <paul at claws-mail.org>
Date:   Thu Mar 24 10:49:46 2022 +0000

    prevent claws-mail logo from being themed

diff --git a/src/gtk/about.c b/src/gtk/about.c
index c43c670d2..fd6ab8275 100644
--- a/src/gtk/about.c
+++ b/src/gtk/about.c
@@ -830,7 +830,7 @@ static void about_create(void)
 	gtk_grid_set_column_spacing(GTK_GRID(grid1), 8);
 	gtk_container_add(GTK_CONTAINER(window), grid1);
 
-	image = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+	image = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_LOGO);
 	gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
 	gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
 	gtk_grid_attach(GTK_GRID(grid1), image, 0, row, 1, 1);
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 65382b94f..cf97cfd31 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -696,8 +696,8 @@ void gtkut_widget_set_app_icon(GtkWidget *widget)
 	cm_return_if_fail(gtk_widget_get_window(widget) != NULL);
 	if (!icon_list) {
 		GdkPixbuf *icon = NULL, *big_icon = NULL;
-		stock_pixbuf_gdk(STOCK_PIXMAP_CLAWS_MAIL_ICON, &icon);
-		stock_pixbuf_gdk(STOCK_PIXMAP_CLAWS_MAIL_LOGO, &big_icon);
+		priv_pixbuf_gdk(PRIV_PIXMAP_CLAWS_MAIL_ICON, &icon);
+		priv_pixbuf_gdk(PRIV_PIXMAP_CLAWS_MAIL_LOGO, &big_icon);
 		if (icon)
 			icon_list = g_list_append(icon_list, icon);
 		if (big_icon)
diff --git a/src/main.c b/src/main.c
index c9961cca2..a9351b052 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1346,7 +1346,7 @@ int main(int argc, char *argv[])
 	}
 #endif
 	gtkut_widget_init();
-	stock_pixbuf_gdk(STOCK_PIXMAP_CLAWS_MAIL_ICON, &icon);
+	priv_pixbuf_gdk(PRIV_PIXMAP_CLAWS_MAIL_ICON, &icon);
 	gtk_window_set_default_icon(icon);
 
 	folderview_initialize();
diff --git a/src/plugins/notification/notification_pixbuf.c b/src/plugins/notification/notification_pixbuf.c
index 153404817..e09343d31 100644
--- a/src/plugins/notification/notification_pixbuf.c
+++ b/src/plugins/notification/notification_pixbuf.c
@@ -1,5 +1,5 @@
 /* Notification plugin for Claws Mail
- * Copyright (C) 2005-2007 Holger Berndt
+ * Copyright (C) 2005-2022 Holger Berndt and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ GdkPixbuf* notification_pixbuf_get(NotificationPixbuf wanted)
   if(!notification_pixbuf[wanted]) {
     switch(wanted) {
     case NOTIFICATION_CM_LOGO_64x64:
-			stock_pixbuf_gdk(STOCK_PIXMAP_CLAWS_MAIL_ICON_64, &(notification_pixbuf[wanted]));
+			priv_pixbuf_gdk(PRIV_PIXMAP_CLAWS_MAIL_ICON_64, &(notification_pixbuf[wanted]));
       g_object_ref(notification_pixbuf[wanted]);
       break;
     case NOTIFICATION_TRAYICON_NEWMAIL:
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
index 08e7458d5..b41532994 100644
--- a/src/stock_pixmap.c
+++ b/src/stock_pixmap.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -236,6 +236,18 @@
 #include "pixmaps/mark_read.xpm"
 #include "pixmaps/mark_unread.xpm"
 
+typedef struct _PrivPixmapData	PrivPixmapData;
+
+struct _PrivPixmapData
+{
+	gchar **data;
+	cairo_surface_t *pixmap;
+	cairo_pattern_t *mask;
+	gchar *file;
+	gchar *icon_path;
+	GdkPixbuf *pixbuf;
+};
+
 typedef struct _StockPixmapData	StockPixmapData;
 
 struct _StockPixmapData
@@ -267,6 +279,18 @@ struct _OverlayData
 
 static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname);
 
+static PrivPixmapData privpixmaps[] =
+{
+    {claws_mail_icon_xpm              , NULL, NULL, "claws_mail_icon", NULL, NULL},
+    {claws_mail_icon_64_xpm           , NULL, NULL, "claws_mail_icon_64", NULL, NULL},
+#ifndef GENERIC_UMPC
+    {claws_mail_logo_xpm              , NULL, NULL, "claws_mail_logo", NULL, NULL},
+#else
+    {claws_mail_logo_small_xpm        , NULL, NULL, "claws_mail_logo_small", NULL, NULL},
+#endif
+    {empty_xpm                        , NULL, NULL, "empty", NULL, NULL}
+};
+
 static StockPixmapData pixmaps[] =
 {
     {addr_one_xpm                     , NULL, NULL, "addr_one", NULL, NULL},
@@ -408,19 +432,12 @@ static StockPixmapData pixmaps[] =
     {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},
-#ifndef GENERIC_UMPC
-    {claws_mail_logo_xpm              , NULL, NULL, "claws_mail_logo", NULL, NULL},
-#else
-    {claws_mail_logo_small_xpm        , NULL, NULL, "claws_mail_logo_small", NULL, NULL},
-#endif
     {dir_noselect_close_xpm           , NULL, NULL, "dir_noselect_close", NULL, NULL},
     {dir_noselect_close_mark_xpm      , NULL, NULL, "dir_noselect_close_mark", NULL, NULL},
     {dir_noselect_open_xpm            , NULL, NULL, "dir_noselect_open", NULL, NULL},
@@ -487,6 +504,18 @@ const char **stock_pixmap_theme_extensions(void)
 }
 
 /* return newly constructed GtkPixmap from GdkPixmap */
+GtkWidget *priv_pixmap_widget(PrivPixmap icon)
+{
+	GdkPixbuf *pixbuf;
+
+	cm_return_val_if_fail(icon < N_PRIV_PIXMAPS, NULL);
+
+	if (priv_pixbuf_gdk(icon, &pixbuf) != -1)
+		return gtk_image_new_from_pixbuf(pixbuf);
+
+	return NULL;
+}
+
 GtkWidget *stock_pixmap_widget(StockPixmap icon)
 {
 	GdkPixbuf *pixbuf;
@@ -676,6 +705,30 @@ GdkPixbuf *pixbuf_from_svg_like_icon(char *filename, GError **error, StockPixmap
 /*!
  *\brief
  */
+gint priv_pixbuf_gdk(PrivPixmap icon, GdkPixbuf **pixbuf)
+{
+	PrivPixmapData *pix_d;
+
+	if (pixbuf)
+		*pixbuf = NULL;
+
+	cm_return_val_if_fail(icon < N_PRIV_PIXMAPS, -1);
+
+	pix_d = &privpixmaps[icon];
+
+	if (!pix_d->pixbuf)
+		pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **) pix_d->data);
+
+	cm_return_val_if_fail(pix_d->pixbuf != NULL, -1);
+
+	if (pixbuf)
+		*pixbuf = pix_d->pixbuf;
+
+	/* pixbuf should have one ref outstanding */
+
+	return 0;
+}
+
 gint stock_pixbuf_gdk(StockPixmap icon, GdkPixbuf **pixbuf)
 {
 	StockPixmapData *pix_d;
@@ -878,6 +931,17 @@ gchar *stock_pixmap_get_name (StockPixmap icon)
 
 }
 
+PrivPixmap priv_pixmap_get_icon (gchar *file)
+{
+	gint i;
+
+	for (i = 0; i < N_PRIV_PIXMAPS; i++) {
+		if (strcmp (pixmaps[i].file, file) == 0)
+			return i;
+	}
+	return -1;
+}
+
 StockPixmap stock_pixmap_get_icon (gchar *file)
 {
 	gint i;
diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h
index cf3d35120..35565933a 100644
--- a/src/stock_pixmap.h
+++ b/src/stock_pixmap.h
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,6 +22,15 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+typedef enum
+{
+	PRIV_PIXMAP_CLAWS_MAIL_ICON,
+	PRIV_PIXMAP_CLAWS_MAIL_ICON_64,
+	PRIV_PIXMAP_CLAWS_MAIL_LOGO,
+	PRIV_PIXMAP_EMPTY,              /* last entry */
+	N_PRIV_PIXMAPS
+} PrivPixmap;
+
 typedef enum
 {
 	STOCK_PIXMAP_ADDR_ONE,
@@ -163,15 +172,12 @@ typedef enum
 	STOCK_PIXMAP_PRIVACY_EMBLEM_FAILED,
 	STOCK_PIXMAP_PRIVACY_EMBLEM_WARN,
 	STOCK_PIXMAP_MIME_MESSAGE,
-	STOCK_PIXMAP_CLAWS_MAIL_ICON,
-	STOCK_PIXMAP_CLAWS_MAIL_ICON_64,
 	STOCK_PIXMAP_READ,
 	STOCK_PIXMAP_DELETE,
 	STOCK_PIXMAP_DELETE_DUP,
 	STOCK_PIXMAP_CANCEL,
 	STOCK_PIXMAP_TRASH,
 	STOCK_PIXMAP_MAIL_COMPOSE_LOGO,
-	STOCK_PIXMAP_CLAWS_MAIL_LOGO,
 	STOCK_PIXMAP_DIR_NOSELECT_CLOSE, 
 	STOCK_PIXMAP_DIR_NOSELECT_CLOSE_MARK, 
 	STOCK_PIXMAP_DIR_NOSELECT_OPEN, 
@@ -235,6 +241,10 @@ typedef enum {
 	OVERLAY_BOTTOM_RIGHT
 } OverlayPosition;
 
+GtkWidget *priv_pixmap_widget	(PrivPixmap	  icon);
+PrivPixmap priv_pixmap_get_icon    (gchar *file);
+gint priv_pixbuf_gdk		(PrivPixmap icon, GdkPixbuf **pixbuf);
+
 GtkWidget *stock_pixmap_widget	(StockPixmap	  icon);
 gint stock_pixbuf_gdk		(StockPixmap icon, GdkPixbuf **pixbuf);
 
diff --git a/src/wizard.c b/src/wizard.c
index 0c31ed555..d37f624c4 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2021 the Claws Mail team and Colin Leroy
+ * Copyright (C) 1999-2022 the Claws Mail team and Colin Leroy
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -848,7 +848,7 @@ static GtkWidget* create_page (WizardWindow *wizard, const char * title)
 
 	/* create the titlebar */
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-	image = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_ICON);
+	image = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_ICON);
 	gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 0);
      	title_string = g_strconcat ("<span size=\"xx-large\" weight=\"ultrabold\">", title ? title : "", "</span>", NULL);
 	w = gtk_label_new (title_string);
@@ -1862,7 +1862,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
 	page = create_page(wizard, _("Welcome to Claws Mail"));
 	
 	wizard->pages = g_slist_append(wizard->pages, page);
-	widget = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+	widget = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_LOGO);
 
 	gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
 	
@@ -1940,7 +1940,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
 	page = create_page(wizard, _("Configuration finished"));
 	
 	wizard->pages = g_slist_append(wizard->pages, page);
-	widget = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+	widget = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_LOGO);
 
 	gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
 	

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list