/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 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
gtk_container_remove(container, widget);
}
-gboolean gtkut_text_match_string(GtkSText *text, gint pos, wchar_t *wcs,
- gint len, gboolean case_sens)
+gboolean gtkut_stext_match_string(GtkSText *text, gint pos, wchar_t *wcs,
+ gint len, gboolean case_sens)
{
gint match_count = 0;
return FALSE;
}
-guint gtkut_text_str_compare_n(GtkSText *text, guint pos1, guint pos2,
- guint len, guint text_len)
+guint gtkut_stext_str_compare_n(GtkSText *text, guint pos1, guint pos2,
+ guint len, guint text_len)
{
guint i;
GdkWChar ch1, ch2;
return i;
}
-guint gtkut_text_str_compare(GtkSText *text, guint start_pos, guint text_len,
- const gchar *str)
+guint gtkut_stext_str_compare(GtkSText *text, guint start_pos, guint text_len,
+ const gchar *str)
{
wchar_t *wcs;
guint len;
if (len > text_len - start_pos)
result = FALSE;
else
- result = gtkut_text_match_string(text, start_pos, wcs, len,
- TRUE);
+ result = gtkut_stext_match_string(text, start_pos, wcs, len,
+ TRUE);
g_free(wcs);
return result ? len : 0;
}
-gboolean gtkut_text_is_uri_string(GtkSText *text,
- guint start_pos, guint text_len)
+gboolean gtkut_stext_is_uri_string(GtkSText *text,
+ guint start_pos, guint text_len)
{
- if (gtkut_text_str_compare(text, start_pos, text_len, "http://") ||
- gtkut_text_str_compare(text, start_pos, text_len, "ftp://") ||
- gtkut_text_str_compare(text, start_pos, text_len, "https://"))
+ if (gtkut_stext_str_compare(text, start_pos, text_len, "http://") ||
+ gtkut_stext_str_compare(text, start_pos, text_len, "ftp://") ||
+ gtkut_stext_str_compare(text, start_pos, text_len, "https://"))
return TRUE;
return FALSE;
}
+void gtk_stext_clear(GtkSText *text)
+{
+ gtk_stext_freeze(text);
+ gtk_stext_set_point(text, 0);
+ gtk_stext_forward_delete(text, gtk_stext_get_length(text));
+ gtk_stext_thaw(text);
+}
+
void gtkut_widget_disable_theme_engine(GtkWidget *widget)
{
GtkStyle *style, *new_style;