[patch] GtkSourceView Searching
| From: | Bob Majdak Jr | Date: | Sun, 20 Jan 2008 22:44:17 +0000 |
| Subject: | [patch] GtkSourceView Searching | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-4054@lists.php.net to get a copy of this message | ||
Probably too late to sneak this in to 2.0.0.
This patch fixes/adds to the GtkSourceView currently non-generated functions. It
allows for the use of the special search feature allowing case insensitive
searching (a built in part of GtkSourceView)
I spent a lot of time on this, ended up rewriting some of the defintions. GtkSourceView has a fake type GtkSourceIter, which is /just/ a GtkTextIter, and in fact GtkSourceIter is not even in the GtkSourceView code as a type, just the documentation. However, it does have gtk_source_iter_forward_search() which when bound to a GBoxed of GtkSourceIter breaks *all* GtkTextIter methods. My solution to this was to drop _forward_search() and _backward_search() on the main GtkSourceView class, in addition to some new flags.
Screenshot:
http://www.opsat.net/temp/sourceview-search.jpg
Example Code:
http://p.opsat.net/v/172/54
(not the best for example)
(it is a copy paste from the project I am working on but eh)
Added Methods:
array/bool GtkSourceView::forward_search(
GtkTreeIter start, string text,
int flags[, GtkTreeIter stop]
);
array/bool GtkSourceView::backward_search(
GtkTreeIter start, string text,
int flags[, GtkTreeIter stop]
);
Both return array(GtkTreeIter, GtkTreeIter), the start/stop of the match when a match is found, and Boolean false when no match was found.
Added Flags:
GtkSourceView::SEARCH_VISIBLE_ONLY
GtkSourceView::SEARCH_TEXT_ONLY
GtkSourceView::SEARCH_CASE_INSENSITIVE
--
Bob Majdak Jr
KateOS Rofflecopter Pilot
http://www.kateos.org
Attachment: [text/x-patch] gtksourceview-search-20080120a.diff
Attachment: [text/x-patch] gtksourceview-search-20080120a.diff