Re: There to send patchs
- From: Alexey Kakunin <small arcadia spb ru>
- To: balsa-list gnome org
- Cc: Matthew Guenther <mguenthe attcanada ca>
- Subject: Re: There to send patchs
- Date: Mon, 29 May 2000 20:07:01 +0400
On ðÎÄ, 29 íÁÊ 2000 19:59:29 Matthew Guenther wrote:
> On Mon, May 29, 2000 at 10:55:29AM +0400, Alexey Kakunin wrote:
> > Hi!
> >
> > I make a patch for 0.8.0 for supporting KOI8-R in Composer.
> > Now, Russian users can write letters in Russian!
> > But, I don't know, there to send patch.
> > Please, tell me address for sending patch.
> >
>
> You can just send the patches to this mailing list, all the developers hang
> out here.
OK. I have attached it to this message.
>
> >
> > I have gotten cvs version from GNOME cvs, but can not build it.
> > There are no config.h file and after after ./autogen.sh ./configure
doesn't
> > work. It says
> > ./configure: line 532: syntax error near unexpected token
> > `AM_CONFIG_HEADER(config.h)'
> > ./configure: line 532: `AM+CONFIG_HEADER(config.h)'
> >
>
> Hmmm, can't help you there, my CVS configuration works fine. Do you have
> this problem with any other Gnome CVS modules?
I don't try any other Gnome CVS module.
But anyway, as I understand, config.h.in should be in repository, but it is not
there.
>
> MBG
>
> --
> Matthew Guenther Numeric stability is probably not all
> mguenthe@netcom.ca that important when you're guessing.
> http://www.netcom.ca/~mguenthe/
--
Best Regards.
Alexey Kakunin, M.Sc.
diff -r -c balsa-0.8.0/src/balsa-message.c balsa-0.8.0-new/src/balsa-message.c
*** balsa-0.8.0/src/balsa-message.c Thu May 18 04:26:16 2000
--- balsa-0.8.0-new/src/balsa-message.c Fri May 26 14:25:47 2000
***************
*** 931,936 ****
--- 931,971 ----
return res;
}
+ gchar*
+ get_koi_font_name(const gchar* base) {
+ static gchar type[] ="koi8";
+ gchar *res;
+ const gchar* ptr = base;
+ int dash_cnt = 0, len;
+
+ g_return_val_if_fail(base != NULL, NULL);
+
+ while(*ptr && dash_cnt<13) {
+ if(*ptr == '-') dash_cnt++;
+
+ if(two_const_fields_to_end(ptr)) break;
+ ptr++;
+ }
+
+ /* defense against a patologically short base font wildcard implemented
+ * in the chunk below
+ * extra space for dwo dashes and '\0' */
+ len = ptr-base;
+ /* if(dash_cnt>12) len--; */
+ if(len<1) len = 1;
+ res = (gchar*)g_malloc(len+sizeof(type)+4);
+ if(balsa_app.debug)
+ fprintf(stderr,"base font name: koi8-r\n"
+ "mallocating %d bytes\n", len+sizeof(type)+3 );
+
+ if(len>1) strncpy(res, base, len);
+ else { strncpy(res, "*", 1); len = 1; }
+
+ sprintf(res+len,"-%s-r", type);
+ return res;
+ }
+
+
/* HELPER FUNCTIONS ----------------------------------------------- */
static gchar*
find_body_font(BODY * bdy)
diff -r -c balsa-0.8.0/src/balsa-message.h balsa-0.8.0-new/src/balsa-message.h
*** balsa-0.8.0/src/balsa-message.h Thu Mar 9 13:12:56 2000
--- balsa-0.8.0-new/src/balsa-message.h Fri May 26 14:24:37 2000
***************
*** 58,63 ****
--- 58,64 ----
/* a helper functions; FIXME: find more proper location for them. */
gchar* get_font_name(const gchar* base, int code);
+ gchar* get_koi_font_name(const gchar* base);
void reflow_string(gchar* str, gint mode, gint *cur_pos, int width);
#ifdef __cplusplus
diff -r -c balsa-0.8.0/src/sendmsg-window.c balsa-0.8.0-new/src/sendmsg-window.c
*** balsa-0.8.0/src/sendmsg-window.c Thu May 18 04:26:16 2000
--- balsa-0.8.0-new/src/sendmsg-window.c Fri May 26 15:55:33 2000
***************
*** 79,84 ****
--- 79,85 ----
static gint iso_13_cb(GtkWidget* , BalsaSendmsg *);
static gint iso_14_cb(GtkWidget* , BalsaSendmsg *);
static gint iso_15_cb(GtkWidget* , BalsaSendmsg *);
+ static gint koi8_r_cb(GtkWidget* , BalsaSendmsg *);
/* Standard DnD types */
enum
***************
*** 230,235 ****
--- 231,238 ----
GNOMEUIINFO_ITEM_NONE( N_ ("_Turkish (ISO-8859-9)"), NULL, iso_9_cb),
#define ISO_CHARSET_14_POS 8
GNOMEUIINFO_ITEM_NONE( N_ ("_Celtic (ISO-8859-14)"), NULL, iso_14_cb),
+ #define KOI8_R_POS 9
+ GNOMEUIINFO_ITEM_NONE( N_ ("_Cy_rillic (KOi8-R)"), NULL, koi8_r_cb),
GNOMEUIINFO_END
};
***************
*** 245,251 ****
"ISO-8859-5",
"ISO-8859-8",
"ISO-8859-9",
! "ISO-8859-14"
};
typedef struct {
--- 248,255 ----
"ISO-8859-5",
"ISO-8859-8",
"ISO-8859-9",
! "ISO-8859-14",
! "KOI8-R"
};
typedef struct {
***************
*** 1626,1631 ****
--- 1630,1682 ----
return FALSE;
}
+ static gint
+ set_koi8_charset(BalsaSendmsg *msg, gint idx) {
+ guint point, txt_len;
+ gchar* str, *koi_font_name, *iso_font_name, *font_name;
+
+ if( ! GTK_CHECK_MENU_ITEM(iso_charset_menu[idx].widget)->active)
+ return TRUE;
+
+ msg->charset = iso_charset_names[idx];
+
+ koi_font_name = get_koi_font_name(balsa_app.message_font);
+ iso_font_name = get_font_name(balsa_app.message_font,1);
+
+ font_name = (gchar*)g_malloc(strlen(koi_font_name)+strlen(iso_font_name)+2);
+ sprintf(font_name,"%s,%s",koi_font_name,iso_font_name);
+ g_free(koi_font_name);
+ g_free(iso_font_name);
+
+ if(msg->font) gdk_font_unref(msg->font);
+
+ if( !( msg->font = gdk_fontset_load (font_name)) ) {
+ printf("Cannot find fond: %s\n", font_name);
+ g_free(font_name);
+ return TRUE;
+ }
+ if(balsa_app.debug)
+ fprintf(stderr,"loaded font with mask: %s\n", font_name);
+ g_free(font_name);
+
+
+ gtk_text_freeze( GTK_TEXT(msg->text) );
+ point = gtk_editable_get_position( GTK_EDITABLE(msg->text) );
+ txt_len = gtk_text_get_length( GTK_TEXT(msg->text) );
+ str = gtk_editable_get_chars( GTK_EDITABLE(msg->text), 0, txt_len);
+
+ gtk_text_set_point( GTK_TEXT(msg->text), 0);
+ gtk_text_forward_delete ( GTK_TEXT(msg->text), txt_len);
+
+ gtk_text_insert(GTK_TEXT(msg->text), msg->font , NULL, NULL, str, txt_len);
+ g_free(str);
+ gtk_text_thaw( GTK_TEXT(msg->text) );
+
+ gtk_editable_set_position( GTK_EDITABLE(msg->text), point);
+ return FALSE;
+
+ }
+
static gint iso_1_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
{return set_iso_charset(bsmsg, 1, ISO_CHARSET_1_POS); }
static gint iso_2_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
***************
*** 1644,1647 ****
--- 1695,1700 ----
{return set_iso_charset(bsmsg, 14, ISO_CHARSET_14_POS); }
static gint iso_15_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
{return set_iso_charset(bsmsg, 15, ISO_CHARSET_15_POS); }
+ static gint koi8_r_cb(GtkWidget* widget, BalsaSendmsg *bsmsg)
+ {return set_koi8_charset(bsmsg, KOI8_R_POS); }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]