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/mozilla-embed.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/mozilla-embed.cpp')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index b0fbda45b..fa78a245b 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -145,10 +145,6 @@ impl_get_security_level (EphyEmbed *embed, EmbedSecurityLevel *level, char **description); static gresult -impl_find (EphyEmbed *embed, - EmbedFindInfo *info); - -static gresult impl_set_encoding (EphyEmbed *embed, const char *encoding); @@ -295,6 +291,42 @@ mozilla_embed_get_type (void) return mozilla_embed_type; } +static gresult +impl_find_next (EphyEmbed *embed, + gboolean backwards) +{ + nsresult result = NS_OK; + EphyWrapper *wrapper; + + wrapper = MOZILLA_EMBED(embed)->priv->wrapper; + g_return_val_if_fail (wrapper != NULL, G_FAILED); + + PRBool didFind; + + result = wrapper->Find (backwards, &didFind); + + return didFind ? G_OK : G_FAILED; +} + +static gresult +impl_find_set_properties (EphyEmbed *embed, + char *search_string, + gboolean case_sensitive, + gboolean wrap_around) +{ + nsresult result = NS_OK; + EphyWrapper *wrapper; + + wrapper = MOZILLA_EMBED(embed)->priv->wrapper; + g_return_val_if_fail (wrapper != NULL, G_FAILED); + + result = wrapper->FindSetProperties + ((NS_ConvertUTF8toUCS2(search_string)).get(), + case_sensitive, wrap_around); + + return result ? G_OK : G_FAILED; +} + static void ephy_embed_init (EphyEmbedClass *embed_class) { @@ -330,7 +362,8 @@ ephy_embed_init (EphyEmbedClass *embed_class) embed_class->shistory_go_nth = impl_shistory_go_nth; embed_class->shistory_copy = impl_shistory_copy; embed_class->get_security_level = impl_get_security_level; - embed_class->find = impl_find; + embed_class->find_next = impl_find_next; + embed_class->find_set_properties = impl_find_set_properties; embed_class->set_encoding = impl_set_encoding; embed_class->select_all = impl_select_all; embed_class->print = impl_print; @@ -1140,28 +1173,6 @@ impl_print_preview_navigate (EphyEmbed *embed, } static gresult -impl_find (EphyEmbed *embed, - EmbedFindInfo *info) -{ - nsresult result = NS_OK; - EphyWrapper *wrapper; - - wrapper = MOZILLA_EMBED(embed)->priv->wrapper; - g_return_val_if_fail (wrapper != NULL, G_FAILED); - - PRBool didFind; - - result = wrapper->Find ((NS_ConvertUTF8toUCS2(info->search_string)).get(), - info->interactive, - info->match_case, - info->backwards, info->wrap, - info->entire_word, info->search_frames, - &didFind); - - return didFind ? G_OK : G_FAILED; -} - -static gresult impl_set_encoding (EphyEmbed *embed, const char *encoding) { |