+2001-11-23 [darko] 0.6.5claws28
+
+ * src/compose.c
+ wrapping on send improvements
+ fix for GtkSText after last sync with main branch
+ GTK_TEXT -> GTK_STEXT
+
2001-11-23 [paul] 0.6.5claws27
* sync with sylpheed 0.6.5cvs14
MICRO_VERSION=5
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws27
+EXTRA_VERSION=claws28
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
if (prefs_common.auto_sig)
compose_insert_sig(compose);
+
+ if (prefs_common.linewrap_quote)
+ compose_wrap_line_all(compose);
+
gtk_editable_set_position(GTK_EDITABLE(compose->text), 0);
gtk_stext_set_point(GTK_STEXT(compose->text), 0);
if (prefs_common.auto_sig)
compose_insert_sig(compose);
+
+ if (prefs_common.linewrap_quote)
+ compose_wrap_line_all(compose);
+
gtk_editable_set_position(GTK_EDITABLE(compose->text), 0);
gtk_stext_set_point(GTK_STEXT(compose->text), 0);
gchar cb[MB_CUR_MAX];
#ifdef WRAP_DEBUG
- printf("found CR at %d\n", cur_pos);
+ printf("found CR at %d next line is ", cur_pos);
+ dump_text(text, cur_pos + 1, tlen, 1);
#endif
/* if it's just quotation + newline skip it */
if (i_len && (cur_pos + 1 < tlen)) {
do_delete = 0;
}
}
+ /* if it's just newline skip it */
+ else if (do_delete && (cur_pos + 1 < tlen)) {
+ if (text->use_wchar)
+ clen = wctomb(cb, (wchar_t)GTK_STEXT_INDEX(text, cur_pos + 1));
+ else {
+ cb[0] = GTK_STEXT_INDEX(text,
+ cur_pos + 1);
+ clen = 1;
+ }
+ /* no need to join the lines */
+ if ((clen == 1) && (cb[0] == '\n'))
+ do_delete = 0;
+ }
#ifdef WRAP_DEBUG
printf("qlen=%d l_len=%d wrap_len=%d do_del=%d\n",
qlen, line_len, linewrap_len, do_delete);
#endif
/* should we delete to perform smart wrapping */
- if (qlen && line_len < linewrap_len && do_delete) {
+ if (line_len < linewrap_len && do_delete) {
/* get rid of newline */
gtk_stext_set_point(text, cur_pos);
gtk_stext_forward_delete(text, 1);
gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
/* gtk_stext_compact_buffer(text); */
tlen++;
- cur_pos++;
line_pos++;
- cur_len = cur_len - line_len + ch_len;
+ /* for loop will increase it */
+ cur_pos = line_pos - 1;
+ /* start over with current line */
+ is_new_line = 1;
line_len = 0;
+ cur_len = 0;
+ do_delete = 1;
#ifdef WRAP_DEBUG
printf("after CR insert ");
dump_text(text, line_pos, tlen, 1);
+ dump_text(text, cur_pos, tlen, 1);
#endif
/* should we insert quotation ? */
/* gtk_stext_compact_buffer(text); */
tlen += ins_len;
}
-
- /* for loop will increase it */
- cur_pos = line_pos - 1;
- cur_len = 0;
- line_len = 0;
- /* start over with current line */
- is_new_line = 1;
- do_delete = 1;
#ifdef WRAP_DEBUG
printf("after quote insert ");
dump_text(text, line_pos, tlen, 1);
g_list_free(combo_items);
}
-gboolean gtkut_text_match_string(GtkText *text, gint pos, wchar_t *wcs,
+gboolean gtkut_text_match_string(GtkSText *text, gint pos, wchar_t *wcs,
gint len, gboolean case_sens)
{
gint match_count = 0;
for (; match_count < len; pos++, match_count++) {
if (case_sens) {
- if (GTK_TEXT_INDEX(text, pos) != wcs[match_count])
+ if (GTK_STEXT_INDEX(text, pos) != wcs[match_count])
break;
} else {
- if (towlower(GTK_TEXT_INDEX(text, pos)) !=
+ if (towlower(GTK_STEXT_INDEX(text, pos)) !=
towlower(wcs[match_count]))
break;
}
return FALSE;
}
-guint gtkut_text_str_compare_n(GtkText *text, guint pos1, guint pos2,
+guint gtkut_text_str_compare_n(GtkSText *text, guint pos1, guint pos2,
guint len, guint text_len)
{
guint i;
GdkWChar ch1, ch2;
for (i = 0; i < len && pos1 + i < text_len && pos2 + i < text_len; i++) {
- ch1 = GTK_TEXT_INDEX(text, pos1 + i);
- ch2 = GTK_TEXT_INDEX(text, pos2 + i);
+ ch1 = GTK_STEXT_INDEX(text, pos1 + i);
+ ch2 = GTK_STEXT_INDEX(text, pos2 + i);
if (ch1 != ch2)
break;
}
return i;
}
-guint gtkut_text_str_compare(GtkText *text, guint start_pos, guint text_len,
+guint gtkut_text_str_compare(GtkSText *text, guint start_pos, guint text_len,
const gchar *str)
{
wchar_t *wcs;
return result ? len : 0;
}
-gboolean gtkut_text_is_uri_string(GtkText *text,
+gboolean gtkut_text_is_uri_string(GtkSText *text,
guint start_pos, guint text_len)
{
if (gtkut_text_str_compare(text, start_pos, text_len, "http://") ||
#include <gtk/gtkwidget.h>
#include <gtk/gtkctree.h>
#include <gtk/gtkcombo.h>
-#include <gtk/gtktext.h>
+#include "gtkstext.h"
#include <stdlib.h>
#if HAVE_WCHAR_H
# include <wchar.h>
void gtkut_combo_set_items (GtkCombo *combo,
const gchar *str1, ...);
-gboolean gtkut_text_match_string (GtkText *text,
+gboolean gtkut_text_match_string (GtkSText *text,
gint pos,
wchar_t *wcs,
gint len,
gboolean case_sens);
-guint gtkut_text_str_compare_n (GtkText *text,
+guint gtkut_text_str_compare_n (GtkSText *text,
guint pos1,
guint pos2,
guint len,
guint text_len);
-guint gtkut_text_str_compare (GtkText *text,
+guint gtkut_text_str_compare (GtkSText *text,
guint start_pos,
guint text_len,
const gchar *str);
-gboolean gtkut_text_is_uri_string (GtkText *text,
+gboolean gtkut_text_is_uri_string (GtkSText *text,
guint start_pos,
guint text_len);