Mercurial > pidgin
comparison src/gtkimhtml.c @ 7358:78c1fc730dc4
[gaim-migrate @ 7951]
Case-insensitive searching in gtkimhtml.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 28 Oct 2003 00:29:32 +0000 |
parents | 5a35881e9e89 |
children | 2ec21bff351b |
comparison
equal
deleted
inserted
replaced
7357:eb0acf8c8f1e | 7358:78c1fc730dc4 |
---|---|
21 | 21 |
22 #ifdef HAVE_CONFIG_H | 22 #ifdef HAVE_CONFIG_H |
23 #include <config.h> | 23 #include <config.h> |
24 #endif | 24 #endif |
25 #include "gtkimhtml.h" | 25 #include "gtkimhtml.h" |
26 #include "gtksourceiter.h" | |
26 #include <gtk/gtk.h> | 27 #include <gtk/gtk.h> |
27 #include <glib/gerror.h> | 28 #include <glib/gerror.h> |
28 #include <gdk/gdkkeysyms.h> | 29 #include <gdk/gdkkeysyms.h> |
29 #include <string.h> | 30 #include <string.h> |
30 #include <ctype.h> | 31 #include <ctype.h> |
1871 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, | 1872 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, |
1872 gtk_text_buffer_get_mark(imhtml->text_buffer, "search")); | 1873 gtk_text_buffer_get_mark(imhtml->text_buffer, "search")); |
1873 } | 1874 } |
1874 imhtml->search_string = g_strdup(text); | 1875 imhtml->search_string = g_strdup(text); |
1875 | 1876 |
1876 if (gtk_text_iter_forward_search(&iter, imhtml->search_string, | 1877 if (gtk_source_iter_forward_search(&iter, imhtml->search_string, |
1877 GTK_TEXT_SEARCH_VISIBLE_ONLY, | 1878 GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_CASE_INSENSITIVE, |
1878 &start, &end, NULL)) { | 1879 &start, &end, NULL)) { |
1879 | 1880 |
1880 gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(imhtml), &start, 0, TRUE, 0, 0); | 1881 gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(imhtml), &start, 0, TRUE, 0, 0); |
1881 gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &end, FALSE); | 1882 gtk_text_buffer_create_mark(imhtml->text_buffer, "search", &end, FALSE); |
1882 if (new_search) { | 1883 if (new_search) { |
1883 gtk_text_buffer_remove_tag_by_name(imhtml->text_buffer, "search", &iter, &end); | 1884 gtk_text_buffer_remove_tag_by_name(imhtml->text_buffer, "search", &iter, &end); |
1884 do | 1885 do |
1885 gtk_text_buffer_apply_tag_by_name(imhtml->text_buffer, "search", &start, &end); | 1886 gtk_text_buffer_apply_tag_by_name(imhtml->text_buffer, "search", &start, &end); |
1886 while (gtk_text_iter_forward_search(&end, imhtml->search_string, GTK_TEXT_SEARCH_VISIBLE_ONLY, | 1887 while (gtk_source_iter_forward_search(&end, imhtml->search_string, |
1888 GTK_SOURCE_SEARCH_VISIBLE_ONLY | | |
1889 GTK_SOURCE_SEARCH_CASE_INSENSITIVE, | |
1887 &start, &end, NULL)); | 1890 &start, &end, NULL)); |
1888 } | 1891 } |
1889 return TRUE; | 1892 return TRUE; |
1890 } | 1893 } |
1891 return FALSE; | 1894 return FALSE; |