aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-11-03 20:37:15 +0800
committerChristian Persch <chpe@src.gnome.org>2005-11-03 20:37:15 +0800
commit1c87d0af88f833fff85b468ef57a7cb660805fb7 (patch)
treed15be9bdc630e4f3a43e104f0d891554ff9ce126 /embed/mozilla
parent5304b565cd6192c80bae5473d3ac2364dc0de7bb (diff)
downloadgsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar.gz
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar.bz2
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar.lz
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar.xz
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.tar.zst
gsoc2013-epiphany-1c87d0af88f833fff85b468ef57a7cb660805fb7.zip
More detailed result code from find backend.
2005-11-03 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed-find.c: * embed/ephy-embed-find.h: * embed/mozilla/EphyFind.cpp: * embed/mozilla/EphyFind.h: * embed/mozilla/mozilla-embed-find.cpp: More detailed result code from find backend. * src/ephy-find-toolbar.c: (set_status), (clear_status), (entry_changed_cb), (ephy_find_toolbar_init), (ephy_find_toolbar_find_next), (ephy_find_toolbar_find_previous), (ephy_find_toolbar_open): Add status text to the find toolbar. Reverse Next/Previous button order.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/EphyFind.cpp20
-rw-r--r--embed/mozilla/EphyFind.h7
-rw-r--r--embed/mozilla/mozilla-embed-find.cpp4
3 files changed, 17 insertions, 14 deletions
diff --git a/embed/mozilla/EphyFind.cpp b/embed/mozilla/EphyFind.cpp
index 5221be417..c6b9b7c9b 100644
--- a/embed/mozilla/EphyFind.cpp
+++ b/embed/mozilla/EphyFind.cpp
@@ -147,11 +147,11 @@ EphyFind::SetFindProperties (const char *aSearchString,
#endif /* TYPEAHEADFIND */
}
-PRBool
+EphyEmbedFindResult
EphyFind::Find (const char *aSearchString,
PRBool aLinksOnly)
{
- if (!mFinder) return PR_FALSE;
+ if (!mFinder) return EPHY_EMBED_FIND_NOTFOUND;
nsEmbedString uSearchString;
NS_CStringToUTF16 (nsEmbedCString (aSearchString ? aSearchString : ""),
@@ -162,7 +162,7 @@ EphyFind::Find (const char *aSearchString,
PRUint16 found = nsITypeAheadFind::FIND_NOTFOUND;
rv = mFinder->Find (uSearchString, aLinksOnly, &found);
- return NS_SUCCEEDED (rv) && found != nsITypeAheadFind::FIND_NOTFOUND;
+ return (EphyEmbedFindResult) found;
#else
mFinder->SetSearchString (uSearchString.get ());
mFinder->SetFindBackwards (PR_FALSE);
@@ -171,14 +171,15 @@ EphyFind::Find (const char *aSearchString,
PRBool didFind = PR_FALSE;
rv = mFinder->FindNext (&didFind);
- return NS_SUCCEEDED (rv) && didFind;
+ return NS_SUCCEEDED (rv) && didFind ? EPHY_EMBED_FIND_FOUND :
+ EPHY_EMBED_FIND_NOTFOUND;
#endif /* HAVE_TYPEAHEADFIND */
}
-PRBool
+EphyEmbedFindResult
EphyFind::FindAgain (PRBool aForward)
{
- if (!mFinder) return PR_FALSE;
+ if (!mFinder) return EPHY_EMBED_FIND_NOTFOUND;
#ifdef HAVE_TYPEAHEADFIND
nsresult rv;
@@ -189,15 +190,16 @@ EphyFind::FindAgain (PRBool aForward)
rv = mFinder->FindPrevious (&found);
}
- return NS_SUCCEEDED (rv) && found != nsITypeAheadFind::FIND_NOTFOUND;
+ return (EphyEmbedFindResult) found;
#else
mFinder->SetFindBackwards (!aForward);
nsresult rv;
PRBool didFind = PR_FALSE;
rv = mFinder->FindNext (&didFind);
-
- return NS_SUCCEEDED (rv) && didFind;
+
+ return NS_SUCCEEDED (rv) && didFind ? EPHY_EMBED_FIND_FOUND :
+ EPHY_EMBED_FIND_NOTFOUND;
#endif /* HAVE_TYPEAHEADFIND */
}
diff --git a/embed/mozilla/EphyFind.h b/embed/mozilla/EphyFind.h
index 8e85356cb..d5dd8e239 100644
--- a/embed/mozilla/EphyFind.h
+++ b/embed/mozilla/EphyFind.h
@@ -22,6 +22,7 @@
#define TYPEAHEADFIND_H
#include "ephy-embed.h"
+#include "ephy-embed-find.h"
#include <nsCOMPtr.h>
#include <gdk/gdktypes.h>
@@ -40,9 +41,9 @@ class EphyFind
void SetFindProperties (const char *aSearchString,
PRBool aCaseSensitive);
- PRBool Find (const char *aSearchString,
- PRBool aLinksOnly);
- PRBool FindAgain (PRBool aForward);
+ EphyEmbedFindResult Find (const char *aSearchString,
+ PRBool aLinksOnly);
+ EphyEmbedFindResult FindAgain (PRBool aForward);
PRBool ActivateLink (GdkModifierType aMask);
private:
diff --git a/embed/mozilla/mozilla-embed-find.cpp b/embed/mozilla/mozilla-embed-find.cpp
index f8f4e6c60..3026a3934 100644
--- a/embed/mozilla/mozilla-embed-find.cpp
+++ b/embed/mozilla/mozilla-embed-find.cpp
@@ -62,7 +62,7 @@ impl_set_properties (EphyEmbedFind *efind,
priv->find->SetFindProperties (find_string, case_sensitive);
}
-static gboolean
+static EphyEmbedFindResult
impl_find (EphyEmbedFind *efind,
const char *find_string,
gboolean links_only)
@@ -73,7 +73,7 @@ impl_find (EphyEmbedFind *efind,
return priv->find->Find (find_string, links_only);
}
-static gboolean
+static EphyEmbedFindResult
impl_find_again (EphyEmbedFind *efind,
gboolean forward)
{