diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-07-20 19:05:16 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-07-20 19:05:16 +0800 |
commit | 370874c6ca4c695eeba57ec7f7d059830287e637 (patch) | |
tree | 83c191b8b9d5607404f405ec58511f383a6b0537 /embed/mozilla/EphyWrapper.cpp | |
parent | ba9c622c3574f82c1662aa9f0c3d676a217a1066 (diff) | |
download | gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar.gz gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar.bz2 gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar.lz gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar.xz gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.tar.zst gsoc2013-epiphany-370874c6ca4c695eeba57ec7f7d059830287e637.zip |
Rework find implementation to integrate better with type ahead and to
2003-07-20 Marco Pesenti Gritti <marco@it.gnome.org>
* embed/ephy-embed.c: (ephy_embed_find_set_properties),
(ephy_embed_find_next):
* embed/ephy-embed.h:
* embed/find-dialog.c: (update_navigation_controls), (impl_show),
(find_dialog_class_init), (set_properties), (sync_page_change),
(sync_embed), (find_dialog_init), (find_dialog_finalize),
(find_dialog_go_next), (find_dialog_go_prev),
(find_close_button_clicked_cb), (find_next_button_clicked_cb),
(find_prev_button_clicked_cb), (find_entry_changed_cb),
(find_check_toggled_cb):
* embed/find-dialog.h:
* embed/mozilla/EphyWrapper.cpp:
* embed/mozilla/EphyWrapper.h:
* embed/mozilla/Makefile.am:
* embed/mozilla/mozilla-embed.cpp:
* lib/ephy-dialog.h:
* src/ephy-window.c: (ephy_window_find):
* src/ephy-window.h:
* src/window-commands.c: (window_cmd_edit_find),
(window_cmd_edit_find_next), (window_cmd_edit_find_prev):
Rework find implementation to integrate better
with type ahead and to simplify the code.
Do not try to set menus sensitivity because
mozilla doesnt provide an api for it and it breaks
with type ahead.
* lib/ephy-dialog.c: (ephy_dialog_class_init),
(ephy_dialog_finalize), (dialog_destroy_cb), (impl_construct),
(ephy_dialog_construct):
Remove no more used destruct crap.
Diffstat (limited to 'embed/mozilla/EphyWrapper.cpp')
-rw-r--r-- | embed/mozilla/EphyWrapper.cpp | 55 |
1 files changed, 14 insertions, 41 deletions
diff --git a/embed/mozilla/EphyWrapper.cpp b/embed/mozilla/EphyWrapper.cpp index 1252f7ece..fc306898b 100644 --- a/embed/mozilla/EphyWrapper.cpp +++ b/embed/mozilla/EphyWrapper.cpp @@ -68,8 +68,6 @@ #include "nsIDeviceContext.h" #include "nsIPresContext.h" #include "ContentHandler.h" -#include "nsITypeAheadFind.h" -#include "nsSupportsPrimitives.h" #include "EphyEventListener.h" EphyWrapper::EphyWrapper () @@ -499,50 +497,25 @@ nsresult EphyWrapper::GetSHUrlAtIndex (PRInt32 index, nsCString &url) return NS_OK; } -nsresult EphyWrapper::Find (const PRUnichar *search_string, - PRBool interactive, - PRBool matchcase, PRBool search_backwards, - PRBool search_wrap_around, - PRBool search_for_entire_word, - PRBool search_in_frames, - PRBool *didFind) +nsresult EphyWrapper::FindSetProperties (const PRUnichar *search_string, + PRBool case_sensitive, + PRBool wrap_around) { - if (!interactive) - { - nsresult rv; - nsCOMPtr<nsITypeAheadFind> tAFinder - (do_GetService(NS_TYPEAHEADFIND_CONTRACTID, &rv)); - if (NS_SUCCEEDED(rv)) - { - nsCOMPtr<nsIDOMWindow> aFocusedWindow; - rv = GetFocusedDOMWindow(getter_AddRefs(aFocusedWindow)); - if (NS_SUCCEEDED(rv)) - { - nsSupportsInterfacePointerImpl windowPtr; - windowPtr.SetData(aFocusedWindow); - - tAFinder->FindNext(search_backwards, &windowPtr); - - nsCOMPtr<nsISupports> retValue; - rv = windowPtr.GetData(getter_AddRefs(retValue)); - if (NS_SUCCEEDED(rv) && !retValue) - { - *didFind = PR_TRUE; - return NS_OK; - } - } - } + nsCOMPtr<nsIWebBrowserFind> finder (do_GetInterface(mWebBrowser)); + + finder->SetSearchString (search_string); + finder->SetMatchCase (case_sensitive); - } + return NS_OK; +} +nsresult EphyWrapper::Find (PRBool backwards, + PRBool *didFind) +{ nsCOMPtr<nsIWebBrowserFind> finder (do_GetInterface(mWebBrowser)); - finder->SetSearchString (search_string); - finder->SetFindBackwards (search_backwards); - finder->SetWrapFind (search_wrap_around); - finder->SetEntireWord (search_for_entire_word); - finder->SetMatchCase (matchcase); - finder->SetSearchFrames (search_in_frames); + finder->SetFindBackwards (backwards); + return finder->FindNext(didFind); } |