GNOME Bugzilla – Bug 116322
RFE: /-style search
Last modified: 2007-12-19 18:52:34 UTC
I'd be very nice if devhelped had /-started `find-text-as-you-type' searches in the html text, as mozilla & others.
I'm not sure how much work this would be for Gtkhtml2. It is possible if you use Gecko but you need to do more than just use GtkMozEmbedd to get it right. Richard do you have any idea how much work this would be for Gtkhtml2 since you did the "normal search" in Yelp.
I don't think it would be very much more work than the regular search, and I agree that it would be very nice. BUT, I'm not sure it's worth it, since we're in feature freeze now, so we would have to target 2.6, at which point we might very well be able to use Gecko instead... I think we should wait a bit and see how things turn out.
Agreed. Since I want to drop using Gtkhtml2 as soon as possible it's probably not worth putting the effort into it. We can look into the possibility to add this support to gecko based Devhelp though. And perhaps bug the mozilla developers to add support for it in GtkMozEmbedd.
/search works for me in devhelp 0.9.1, for the first search. However devhelp doesn't support Control-G to repeat the search.
I'm not sure how to do this through gtkmozembedd, does anyone know?
Look at epiphany, in embed/mozilla/mozilla-embed.cpp:impl_find_next and its impl in embed/mozilla/EphyBrowser.cpp:Find .
*** Bug 144515 has been marked as a duplicate of this bug. ***
Both Galeon-2.0.1 and Epiphany from Gnome-2.14 work properly if and only if typeaheadfind extension is disabled in Firefox. As consequence, ability to search inside page/document was lost again in Devhelp (devhelp-0.10). Even for first-time searches. It would be very nice to restore type-ahead-find ability in the devhep.
*** Bug 350161 has been marked as a duplicate of this bug. ***
*** Bug 355109 has been marked as a duplicate of this bug. ***
Created attachment 84294 [details] [review] add find feature I write a demo code for finding in page. It's base on devhelp-0.13-4.fc7 in fedora code. Wish it would be helpful.
Ah, interesting! Does that search API in gecko provide typeahead search? It would be pretty cool to use eggfindbar for the UI parts of this bug, by the way.
(In reply to comment #12) > Ah, interesting! Does that search API in gecko provide typeahead search? > > It would be pretty cool to use eggfindbar for the UI parts of this bug, by the > way. > What is typeahead search? Is it like incsearch in vim? In this patch, you should press Enter Key to start searching. What is eggfindbar? Could you give some reference?
Typeahead search is what you get in firefox or epiphany when you press "/", it incrementally searches directly when you type. Eggfindbar is the bar that appears at the bottom with a search entry and prev/next buttons, can be seen in epiphany for example and other gnome apps. The source is in libegg in gnome svn.
(In reply to comment #14) > Ah, interesting! Does that search API in gecko provide typeahead search? It seams that mozilla provide the basic search function by C++, but the UI and search control logic is implemented by xul and javascript. I doubt whether devhelp could reference xul and js directly. Maybe it can reuse the findBar.js from mozilla. > Eggfindbar is the bar that appears at the bottom with a search entry and > prev/next buttons, can be seen in epiphany for example and other gnome apps. > The source is in libegg in gnome svn. Sorry I did not find the eggfind in public gnome svn. But the find bar that I implemented is similar with it firefox.
No, it's in the evince source code.
(In reply to comment #11) > Created an attachment (id=84294) [edit] > I write a demo code for finding in page. It's base on devhelp-0.13-4.fc7 in > fedora code. Wish it would be helpful. This isn't typeaheadfind. Look in epiphany embed/mozilla/EphyFind.cpp and src/ephy-find-toolbar.c; or in yelp's Yelper.cpp file for how to do typeaheadfind.
Created attachment 84490 [details] [review] Add TypeAhead I referred to yelp, and recreated the patch which uses nsITypeAheadfind. Wish it could meet this requirement.
Who can review this patch? Please view it. Thanks. I really want devhelp could support it. And I wish I can add zooming in/out and printing function base on this patch.
Thanks for the patch. I just tried it, it seems to work nicely! I have a few comments: * I would much rather put the GUI code in a separate file (or to use eggfindbar) instead of directly in the main window code, to make it easier to maintain. * The separation between the C and C++ code looks a bit weird to me, that the yelper object is kept in DhHtml but all the functions performed on it are in gecko-utils. And this looks a bit odd: +#ifndef __cplusplus +typedef gpointer Yelper; +#else +class Yelper; +#endif However, I'm not sure if there is a better way that let's us keep the C-only library that for example anjuta uses. * Also there are a few small issues with the style, we use a space before () and always put braces after if/for/while etc even if code block is just one line. If you want to do those changes that would be great, otherwise I'll try to do them when I find some time for it. Of course the cutnpasted Yelper files shouldn't be changed since that would make it harder to update them in the future. * Finally, what do you think about having Ctrl-g for "Find Next" and shift-ctrl-g for "Find Previous"?
Created attachment 85376 [details] [review] a new patch
(In reply to comment #20) > Thanks for the patch. I just tried it, it seems to work nicely! > > I have a few comments: > > * I would much rather put the GUI code in a separate file (or to use > eggfindbar) instead of directly in the main window code, to make it easier to > maintain. Findbar's actions need access dh-window's private data, if sparated it from dh-window, it will make thing complex, I need create a customized widget, and add several signals on it. So I think it is better that remain findbar in dh-window.c. BTW, I created a new function to create the findbar, wish it will be more clearer. > > * The separation between the C and C++ code looks a bit weird to me, that the > yelper object is kept in DhHtml but all the functions performed on it are in > gecko-utils. And this looks a bit odd: Fixed in the new patch. > * Also there are a few small issues with the style, we use a space before () > and always put braces after if/for/while etc even if code block is just one > line. If you want to do those changes that would be great, otherwise I'll try > to do them when I find some time for it. Of course the cutnpasted Yelper files > shouldn't be changed since that would make it harder to update them in the > future. Fixed some of them. > > * Finally, what do you think about having Ctrl-g for "Find Next" and > shift-ctrl-g for "Find Previous"? Added them in the menu. Please review it again. Thanks.
This latest version doesn't build for me: Yelper.cpp:419: error: redefinition of 'Yelper::Yelper(GtkMozEmbed*)' Yelper.cpp:71: error: 'Yelper::Yelper(GtkMozEmbed*)' previously defined here Yelper.cpp:428: error: redefinition of 'Yelper::~Yelper()' etc etc (About splitting out the findbar, an already created findbar widget exists, as previously mentioned in this bug, eggfindbar.c...)
(In reply to comment #23) > This latest version doesn't build for me: > > Yelper.cpp:419: error: redefinition of 'Yelper::Yelper(GtkMozEmbed*)' > Yelper.cpp:71: error: 'Yelper::Yelper(GtkMozEmbed*)' previously defined here > Yelper.cpp:428: error: redefinition of 'Yelper::~Yelper()' > etc etc The patch is based on HEAD. Did you cancel the old patch before apply this one? > (About splitting out the findbar, an already created findbar widget exists, as > previously mentioned in this bug, eggfindbar.c...) I will try it next day.
EphyFindToolbar is probably better suited than EggFindBar.
(In reply to comment #24) > (In reply to comment #23) > > This latest version doesn't build for me: > > > > Yelper.cpp:419: error: redefinition of 'Yelper::Yelper(GtkMozEmbed*)' > > Yelper.cpp:71: error: 'Yelper::Yelper(GtkMozEmbed*)' previously defined here > > Yelper.cpp:428: error: redefinition of 'Yelper::~Yelper()' > > etc etc > The patch is based on HEAD. Did you cancel the old patch before apply this one? Yep, I did.
Created attachment 85424 [details] [review] This patch using eggfindbar
Thanks, this is starting to look very nice :) I will look at applying the patch as soon as we have branched for GNOME 2.19/20.
Did we branched for 2.19/20? :)
Yes, I've committed this to trunk now with a few small style modifications. Thanks a lot, this feature is really nice!
*** Bug 330904 has been marked as a duplicate of this bug. ***