]> git.0d.be Git - empathy.git/commitdiff
live-search: export few more functions
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 31 May 2011 13:20:10 +0000 (15:20 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 31 May 2011 13:20:10 +0000 (15:20 +0200)
libempathy-gtk/empathy-live-search.c
libempathy-gtk/empathy-live-search.h

index bc7cfb10fd2a38410e2814309e0dac6a4195121b..422bfcb73094765a0f7b6e61d61445d2a1886e88 100644 (file)
@@ -139,8 +139,8 @@ append_word (GPtrArray **word_array,
     }
 }
 
-static GPtrArray *
-strip_utf8_string (const gchar *string)
+GPtrArray *
+empathy_live_search_strip_utf8_string (const gchar *string)
 {
   GPtrArray *word_array = NULL;
   GString *word = NULL;
@@ -230,8 +230,8 @@ live_search_match_prefix (const gchar *string,
   return FALSE;
 }
 
-static gboolean
-live_search_match_words (const gchar *string,
+gboolean
+empathy_live_search_match_words (const gchar *string,
     GPtrArray *words)
 {
   guint i;
@@ -309,7 +309,7 @@ live_search_text_changed (GtkEntry *entry,
   if (priv->stripped_words != NULL)
     g_ptr_array_unref (priv->stripped_words);
 
-  priv->stripped_words = strip_utf8_string (text);
+  priv->stripped_words = empathy_live_search_strip_utf8_string (text);
 
   g_object_notify (G_OBJECT (self), "text");
 }
@@ -702,7 +702,7 @@ empathy_live_search_match (EmpathyLiveSearch *self,
 
   priv = GET_PRIV (self);
 
-  return live_search_match_words (string, priv->stripped_words);
+  return empathy_live_search_match_words (string, priv->stripped_words);
 }
 
 gboolean
@@ -712,11 +712,18 @@ empathy_live_search_match_string (const gchar *string,
   GPtrArray *words;
   gboolean match;
 
-  words = strip_utf8_string (prefix);
-  match = live_search_match_words (string, words);
+  words = empathy_live_search_strip_utf8_string (prefix);
+  match = empathy_live_search_match_words (string, words);
   if (words != NULL)
     g_ptr_array_unref (words);
 
   return match;
 }
 
+GPtrArray *
+empathy_live_search_get_words (EmpathyLiveSearch *self)
+{
+  EmpathyLiveSearchPriv *priv = GET_PRIV (self);
+
+  return priv->stripped_words;
+}
index 78dc236c044596ae0a67831b9031d77d046bddbb..9f068396c2bcc4e9a7ef5b224c300612fd1d0f82 100644 (file)
@@ -65,6 +65,13 @@ void empathy_live_search_set_text (EmpathyLiveSearch *self,
 gboolean empathy_live_search_match (EmpathyLiveSearch *self,
     const gchar *string);
 
+GPtrArray * empathy_live_search_strip_utf8_string (const gchar *string);
+
+gboolean empathy_live_search_match_words (const gchar *string,
+    GPtrArray *words);
+
+GPtrArray * empathy_live_search_get_words (EmpathyLiveSearch *self);
+
 /* Made public for unit tests */
 gboolean empathy_live_search_match_string (const gchar *string,
    const gchar *prefix);