sync with 0.8.5cvs17
authorPaul Mangan <paul@claws-mail.org>
Tue, 5 Nov 2002 09:24:27 +0000 (09:24 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 5 Nov 2002 09:24:27 +0000 (09:24 +0000)
13 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/alertpanel.c
src/compose.c
src/folderview.c
src/gtkutils.c
src/gtkutils.h
src/headerview.c
src/sourcewindow.c
src/summaryview.c
src/textview.c

index 442057cd78b0e65e7cce32434cd9f993d7e574f0..a435580947fc01e1066731db8d0b137aef64c6c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,36 @@
+2002-11-05
+
+       * src/gtkutils.[ch]:
+         gtkut_font_load(): new. It automatically choose font or fontset
+         by current locale.
+         gtkut_font_load_from_fontset(): new. It tries to load single font
+         instead of fontset from a fontset string.
+       * src/alertpanel.c
+         src/folderview.c
+         src/headerview.c
+         src/summaryview.c: workaround for the problem that couldn't display
+         8-bit characters in C or POSIX locale (use font instead of fontset).
+       * src/compose.c
+         src/sourcewindow.c
+         src/textview.c: made code cleanup using gtkut_font_load*().
+
+2002-10-29
+
+       * src/mh.c: mh_get_msginfo(): set correct message number.
+
+2002-10-29
+
+       * src/folder.[ch]: added a new virtual method Folder::get_msginfo().
+         It returns a new MsgInfo associated to a message number.
+         folder_item_get_msginfo(): new.
+       * src/imap.[ch]: imap_get_msginfo(): new.
+       * src/mh.[ch]: mh_get_msginfo(): new.
+       * src/news.[ch]: news_get_msginfo(): new.
+
 2002-10-28
 
        * src/codeconv.c: conv_euctojis(): fixed a bug which will cause
-         infinite loop if a invalid code appeared.
+         infinite loop if an invalid code appeared.
 
 2002-10-25
 
index 3e908d530e90296721064082bdc01de36a1ece48..f070fa11d64478f52b9f0330b1d74fd64836a148 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-05 [paul]      0.8.5claws71
+
+       * sync with 0.8.5cvs17
+               see ChangeLog 2002-11-05
+
 2002-11-04 [paul]      0.8.5claws70
 
        * sylpheed-128x128.png
index 12892e52cc5416d83535f702bf0f287041aa6b47..cf06005578a80918bed334ab026e2946d3566a06 100644 (file)
@@ -1,3 +1,32 @@
+2002-11-05
+
+       * src/gtkutils.[ch]:
+         gtkut_font_load(): ¿·µ¬¡£¸½ºß¤Î locale ¤Ë¤è¤Ã¤Æ font ¤Þ¤¿¤Ï fontset
+         ¤ò¼«Æ°Åª¤ËÁªÂò¤¹¤ë¡£
+         gtkut_font_load_from_fontset(): ¿·µ¬¡£¥Õ¥©¥ó¥È¥»¥Ã¥Èʸ»úÎ󤫤é
+         ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ÎÂå¤ï¤ê¤Ëñ°ì¤Î¥Õ¥©¥ó¥È¤ÎÆɤ߹þ¤ß¤ò»î¤ß¤ë¡£
+       * src/alertpanel.c
+         src/folderview.c
+         src/headerview.c
+         src/summaryview.c: C ¤Þ¤¿¤Ï POSIX locale ¤Ç 8-bit Ê¸»ú¤òɽ¼¨
+         ¤Ç¤­¤Ê¤¤ÌäÂê¤ËÂнè(fontset ¤ÎÂå¤ï¤ê¤Ë font ¤ò»ÈÍÑ)¡£
+       * src/compose.c
+         src/sourcewindow.c
+         src/textview.c: gtkut_font_load*() ¤ò»ÈÍѤ·¤Æ¥³¡¼¥É¤òÀ°Íý¡£
+
+2002-10-29
+
+       * src/mh.c: mh_get_msginfo(): Àµ¤·¤¤¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤ò¥»¥Ã¥È¡£
+
+2002-10-29
+
+       * src/folder.[ch]: ¿·µ¬²¾Áۥ᥽¥Ã¥É Folder::get_msginfo() ¤òÄɲá£
+         ¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤ËÂбþ¤¹¤ë¿·µ¬ MsgInfo ¤òÊÖ¤¹¡£
+         folder_item_get_msginfo(): ¿·µ¬¡£
+       * src/imap.[ch]: imap_get_msginfo(): ¿·µ¬¡£
+       * src/mh.[ch]: mh_get_msginfo(): ¿·µ¬¡£
+       * src/news.[ch]: news_get_msginfo(): ¿·µ¬¡£
+
 2002-10-28
 
        * src/codeconv.c: conv_euctojis(): ÉÔÀµ¤Ê¥³¡¼¥É¤¬½Ð¸½¤·¤¿¤é̵¸Â
index 03e8f3afee7e9db74eab2962c414135c3f802bd9..32d4bff0c678b8a09d4e3f5c27b130dc50003f11 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws70
+EXTRA_VERSION=claws71
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 0c7d37058fbdb80b0a8218582e844e6d6172ae02..47c4600b63cfa7310a6183fbcf478f6859862688 100644 (file)
@@ -236,7 +236,7 @@ static void alertpanel_create(const gchar *title,
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
        style = gtk_style_copy(gtk_widget_get_style(label));
        if (!titlefont)
-               titlefont = gdk_fontset_load(TITLE_FONT);
+               titlefont = gtkut_font_load(TITLE_FONT);
        if (titlefont)
                style->font = titlefont;
        gtk_widget_set_style(label, style);
index d7fb48cd7748e6ffc658199f890062ca0df6938b..6430d8f43499daa44d748316fdda92239fd2ad01 100644 (file)
@@ -4598,7 +4598,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        GdkColormap *cmap;
        GdkColor color[1];
        gboolean success[1];
-       GdkFont   *font;
        GtkWidget *popupmenu;
        GtkItemFactory *popupfactory;
        GtkItemFactory *ifactory;
@@ -4789,16 +4788,9 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                new_style = gtk_style_copy(style);
 
        if (prefs_common.textfont) {
-               if (MB_CUR_MAX == 1) {
-                       gchar *fontstr, *p;
+               GdkFont *font;
 
-                       Xstrdup_a(fontstr, prefs_common.textfont, );
-                       if (fontstr && (p = strchr(fontstr, ',')) != NULL)
-                               *p = '\0';
-                       font = gdk_font_load(fontstr);
-               } else
-                       font = gdk_fontset_load(prefs_common.textfont);
-               if (font) {
+               if ((font = gtkut_font_load(prefs_common.textfont)) != NULL) {
                        gdk_font_unref(new_style->font);
                        new_style->font = font;
                }
index 183dec10a85f7aa13380e6145e7a5abb6048b9b9..e92ddda54f6fd60f8bcebd150e8534489c2d01d1 100644 (file)
@@ -537,9 +537,9 @@ void folderview_init(FolderView *folderview)
 
 
        if (!normalfont)
-               normalfont = gdk_fontset_load(NORMAL_FONT);
+               normalfont = gtkut_font_load(NORMAL_FONT);
        if (!boldfont)
-               boldfont = gdk_fontset_load(BOLD_FONT);
+               boldfont = gtkut_font_load(BOLD_FONT);
 
        if (!bold_style) {
                bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
index 2bcc4b1c4d7405a44535f7dd23f461cdafc6c06f..f0276b01f7dffae36df090ca0be8bdd19ea7ebb1 100644 (file)
@@ -31,6 +31,7 @@
 #include <gtk/gtkcombo.h>
 #include <gtk/gtkthemes.h>
 #include <gtk/gtkbindings.h>
+#include <stdlib.h>
 #include <stdarg.h>
 #include <sys/stat.h>
 
@@ -79,6 +80,42 @@ gint gtkut_get_font_height(GdkFont *font)
        return height;
 }
 
+GdkFont *gtkut_font_load(const gchar *fontset_name)
+{
+       GdkFont *font;
+
+       g_return_val_if_fail(fontset_name != NULL, NULL);
+
+       if (MB_CUR_MAX == 1)
+               font = gtkut_font_load_from_fontset(fontset_name);
+       else
+               font = gdk_fontset_load(fontset_name);
+
+       return font;
+}
+
+GdkFont *gtkut_font_load_from_fontset(const gchar *fontset_name)
+{
+       GdkFont *font = NULL;
+
+       if (strchr(fontset_name, ',') == NULL) {
+               font = gdk_font_load(fontset_name);
+       } else {
+               gchar **fonts;
+               gint i;
+
+               fonts = g_strsplit(fontset_name, ",", -1);
+               for (i = 0; fonts[i] != NULL && fonts[i][0] != '\0';
+                    i++) {
+                       font = gdk_font_load(fonts[i]);
+                       if (font) break;
+               }
+               g_strfreev(fonts);
+       }
+
+       return font;
+}
+
 void gtkut_convert_int_to_gdk_color(gint rgbvalue, GdkColor *color)
 {
        g_return_if_fail(color != NULL);
index c464b678590e7e564ebac96a951d9baad59ef708..40915ab35aceed3a3ab3bb3b19e68ccfd79a2586 100644 (file)
@@ -80,6 +80,9 @@
 gint gtkut_get_font_width              (GdkFont        *font);
 gint gtkut_get_font_height             (GdkFont        *font);
 
+GdkFont *gtkut_font_load               (const gchar    *fontset_name);
+GdkFont *gtkut_font_load_from_fontset  (const gchar    *fontset_name);
+
 void gtkut_convert_int_to_gdk_color    (gint            rgbvalue,
                                         GdkColor       *color);
 
index 495c72254b699df3ced9274b1f82cff096619569..4d9c6359dfdd8282aefab896063bf64fc6f86e2f 100644 (file)
@@ -134,7 +134,7 @@ HeaderView *headerview_create(void)
 void headerview_init(HeaderView *headerview)
 {
        if (!boldfont)
-               boldfont = gdk_fontset_load(BOLD_FONT);
+               boldfont = gtkut_font_load(BOLD_FONT);
 
 #define SET_FONT_STYLE(wid) \
 { \
index de636ded051c1b2d6a0e219afea2a3cc5dc7166d..3266e99c70b49444146379f571d88a384ff05c4c 100644 (file)
@@ -45,25 +45,10 @@ static void key_pressed                     (GtkWidget      *widget,
 
 static GdkFont *msgfont = NULL;
 
-#define FONT_LOAD(font, s) \
-{ \
-       gchar *fontstr, *p; \
- \
-       Xstrdup_a(fontstr, s, ); \
-       if ((p = strchr(fontstr, ',')) != NULL) *p = '\0'; \
-       font = gdk_font_load(fontstr); \
-}
-
 static void source_window_init()
 {
-       if (msgfont != NULL || prefs_common.textfont == NULL)
-               return;
-
-       if (MB_CUR_MAX == 1) {
-               FONT_LOAD(msgfont, prefs_common.textfont);
-       } else {
-               msgfont = gdk_fontset_load(prefs_common.textfont);
-       }
+       if (!msgfont && prefs_common.textfont)
+               msgfont = gtkut_font_load(prefs_common.textfont);
 }
 
 SourceWindow *source_window_create(void)
index 8b2c2f203a1d7d9e526ff31d8de95226f3905a20..dea703041091b6bf2292e42ff8e5b32d1a04e08d 100644 (file)
@@ -646,7 +646,7 @@ void summary_init(SummaryView *summaryview)
                small_style = gtk_style_copy
                        (gtk_widget_get_style(summaryview->ctree));
                if (!smallfont)
-                       smallfont = gdk_fontset_load(SMALL_FONT);
+                       smallfont = gtkut_font_load(SMALL_FONT);
                small_style->font = smallfont;
                small_marked_style = gtk_style_copy(small_style);
                small_marked_style->fg[GTK_STATE_NORMAL] =
@@ -659,7 +659,7 @@ void summary_init(SummaryView *summaryview)
                bold_style = gtk_style_copy
                        (gtk_widget_get_style(summaryview->ctree));
                if (!boldfont)
-                       boldfont = gdk_fontset_load(BOLD_FONT);
+                       boldfont = gtkut_font_load(BOLD_FONT);
                bold_style->font = boldfont;
                bold_marked_style = gtk_style_copy(bold_style);
                bold_marked_style->fg[GTK_STATE_NORMAL] =
index 07c38167d8579f743c4e59546eba98a1e555de5f..309633efaaa0da283f991907a8ba565a2bb5666a 100644 (file)
 #include "account.h"
 #include "mimeview.h"
 
-#define FONT_LOAD(font, s) \
-{ \
-       gchar *fontstr, *p; \
- \
-       Xstrdup_a(fontstr, s, ); \
-       if ((p = strchr(fontstr, ',')) != NULL) *p = '\0'; \
-       font = gdk_font_load(fontstr); \
-       if (!font) \
-               g_warning("Couldn't load the font '%s'\n", fontstr); \
-}
-
 typedef struct _RemoteURI      RemoteURI;
 
 struct _RemoteURI
@@ -203,7 +192,7 @@ TextView *textview_create(void)
                GtkStyle *style;
                GdkFont *font;
 
-               FONT_LOAD(font, prefs_common.normalfont);
+               font = gtkut_font_load_from_fontset(prefs_common.normalfont);
                if (font) {
                        style = gtk_style_copy(text_sb->style);
                        gdk_font_unref(style->font);
@@ -1229,11 +1218,11 @@ void textview_set_font(TextView *textview, const gchar *codeset)
                                text_sb_font->ascent = text_sb_font_orig_ascent;
                                text_sb_font->descent = text_sb_font_orig_descent;
                        }
-                       if (MB_CUR_MAX > 1) {
-                               FONT_LOAD(font, "-*-courier-medium-r-normal--14-*-*-*-*-*-iso8859-1");
-                       } else {
-                               FONT_LOAD(font, prefs_common.textfont);
-                       }
+                       if (MB_CUR_MAX > 1)
+                               font = gdk_font_load("-*-courier-medium-r-normal--14-*-*-*-*-*-iso8859-1");
+                       else
+                               font = gtkut_font_load_from_fontset
+                                       (prefs_common.textfont);
                        if (font && text_sb_font != font) {
                                if (text_sb_font)
                                        gdk_font_unref(text_sb_font);
@@ -1259,7 +1248,7 @@ void textview_set_font(TextView *textview, const gchar *codeset)
        }
 
        if (!textview->boldfont && prefs_common.boldfont)
-               FONT_LOAD(textview->boldfont, prefs_common.boldfont);
+               textview->boldfont = gtkut_font_load(prefs_common.boldfont);
        if (!spacingfont)
                spacingfont = gdk_font_load("-*-*-medium-r-normal--6-*");
 }