After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 116322 - RFE: /-style search
RFE: /-style search
Status: RESOLVED FIXED
Product: devhelp
Classification: Applications
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Mikael Hallendal
Mikael Hallendal
: 144515 330904 350161 355109 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-06-30 06:43 UTC by Mariano Suárez-Alvarez
Modified: 2007-12-19 18:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add find feature (14.51 KB, patch)
2007-03-09 06:48 UTC, Peng Huang
none Details | Review
Add TypeAhead (25.68 KB, patch)
2007-03-13 08:58 UTC, Peng Huang
none Details | Review
a new patch (26.56 KB, patch)
2007-03-27 09:30 UTC, Peng Huang
none Details | Review
This patch using eggfindbar (49.19 KB, patch)
2007-03-28 04:00 UTC, Peng Huang
none Details | Review

Description Mariano Suárez-Alvarez 2003-06-30 06:43:20 UTC
I'd be very nice if devhelped had /-started `find-text-as-you-type'
searches in the html text, as mozilla & others.
Comment 1 Mikael Hallendal 2003-07-01 09:34:56 UTC
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.
Comment 2 Richard Hult 2003-07-01 09:39:01 UTC
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.

Comment 3 Mikael Hallendal 2003-07-01 09:44:13 UTC
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.
Comment 4 Christian Persch 2004-08-05 14:10:28 UTC
/search works for me in devhelp 0.9.1, for the first search. However devhelp
doesn't support Control-G to repeat the search.
Comment 5 Mikael Hallendal 2004-08-05 14:35:15 UTC
I'm not sure how to do this through gtkmozembedd, does anyone know?
Comment 6 Christian Persch 2004-11-18 14:16:49 UTC
Look at epiphany, in embed/mozilla/mozilla-embed.cpp:impl_find_next and its impl
in embed/mozilla/EphyBrowser.cpp:Find .
Comment 7 Richard Hult 2005-09-26 20:55:21 UTC
*** Bug 144515 has been marked as a duplicate of this bug. ***
Comment 8 Andrew W. Nosenko 2006-06-08 12:13:30 UTC
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.
Comment 9 Richard Hult 2006-08-08 12:58:38 UTC
*** Bug 350161 has been marked as a duplicate of this bug. ***
Comment 10 Richard Hult 2006-09-10 20:03:42 UTC
*** Bug 355109 has been marked as a duplicate of this bug. ***
Comment 11 Peng Huang 2007-03-09 06:48:39 UTC
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.
Comment 12 Richard Hult 2007-03-09 07:53:12 UTC
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.
Comment 13 Peng Huang 2007-03-09 08:00:37 UTC
(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?
Comment 14 Richard Hult 2007-03-09 08:04:25 UTC
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.
Comment 15 Peng Huang 2007-03-09 09:46:33 UTC
(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.
Comment 16 Sven Herzberg 2007-03-09 12:12:21 UTC
No, it's in the evince source code.
Comment 17 Christian Persch 2007-03-09 12:23:35 UTC
(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.
Comment 18 Peng Huang 2007-03-13 08:58:20 UTC
Created attachment 84490 [details] [review]
Add TypeAhead

I referred to yelp, and recreated the patch which uses nsITypeAheadfind. Wish it could meet this requirement.
Comment 19 Peng Huang 2007-03-27 05:54:21 UTC
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.
Comment 20 Richard Hult 2007-03-27 07:27:59 UTC
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"?
Comment 21 Peng Huang 2007-03-27 09:30:03 UTC
Created attachment 85376 [details] [review]
a new patch
Comment 22 Peng Huang 2007-03-27 09:47:34 UTC
(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.
Comment 23 Richard Hult 2007-03-27 11:14:29 UTC
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...)

Comment 24 Peng Huang 2007-03-27 12:19:48 UTC
(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.

Comment 25 Christian Persch 2007-03-27 12:21:39 UTC
EphyFindToolbar is probably better suited than EggFindBar.
Comment 26 Richard Hult 2007-03-27 13:07:52 UTC
(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.
Comment 27 Peng Huang 2007-03-28 04:00:41 UTC
Created attachment 85424 [details] [review]
This patch using eggfindbar
Comment 28 Richard Hult 2007-03-28 07:46:31 UTC
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.
Comment 29 Peng Huang 2007-04-15 00:38:55 UTC
Did we branched for 2.19/20? :)
Comment 30 Richard Hult 2007-04-17 17:19:55 UTC
Yes, I've committed this to trunk now with a few small style modifications. Thanks a lot, this feature is really nice!
Comment 31 Richard Hult 2007-12-19 18:52:34 UTC
*** Bug 330904 has been marked as a duplicate of this bug. ***