[empathy] added case sensitive highlighting for adium themes



commit d128e3a36e43a08a9dfe4a2c42b9485e146faeae
Author: Thomas Meire <blackskad gmail com>
Date:   Sat Jan 16 23:41:32 2010 +0100

    added case sensitive highlighting for adium themes

 libempathy-gtk/empathy-chat-text-view.c |    4 +++-
 libempathy-gtk/empathy-chat-view.c      |    5 +++--
 libempathy-gtk/empathy-chat-view.h      |    6 ++++--
 libempathy-gtk/empathy-log-window.c     |    4 ++--
 libempathy-gtk/empathy-search-bar.c     |    6 +++---
 libempathy-gtk/empathy-theme-adium.c    |    5 +++--
 6 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index fcd6ebb..278a63f 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -1120,8 +1120,10 @@ chat_text_view_find_abilities (EmpathyChatView *view,
 
 static void
 chat_text_view_highlight (EmpathyChatView *view,
-			    const gchar     *text)
+			    const gchar     *text,
+			    gboolean         match_case)
 {
+	// TODO: do something useful with the match_case var
 	GtkTextBuffer *buffer;
 	GtkTextIter    iter;
 	GtkTextIter    iter_start;
diff --git a/libempathy-gtk/empathy-chat-view.c b/libempathy-gtk/empathy-chat-view.c
index ed5740a..7072ca0 100644
--- a/libempathy-gtk/empathy-chat-view.c
+++ b/libempathy-gtk/empathy-chat-view.c
@@ -175,12 +175,13 @@ empathy_chat_view_find_abilities (EmpathyChatView *view,
 
 void
 empathy_chat_view_highlight (EmpathyChatView *view,
-			     const gchar     *text)
+			     const gchar     *text,
+			     gboolean         match_case)
 {
 	g_return_if_fail (EMPATHY_IS_CHAT_VIEW (view));
 
 	if (EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->highlight) {
-		EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->highlight (view, text);
+		EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->highlight (view, text, match_case);
 	}
 }
 
diff --git a/libempathy-gtk/empathy-chat-view.h b/libempathy-gtk/empathy-chat-view.h
index f3478be..52b39d1 100644
--- a/libempathy-gtk/empathy-chat-view.h
+++ b/libempathy-gtk/empathy-chat-view.h
@@ -62,7 +62,8 @@ struct _EmpathyChatViewIface {
 						  gboolean        *can_do_previous,
 						  gboolean        *can_do_next);
 	void             (*highlight)            (EmpathyChatView *view,
-						  const gchar     *text);
+						  const gchar     *text,
+						  gboolean         match_case);
 	void             (*copy_clipboard)       (EmpathyChatView *view);
 };
 
@@ -87,7 +88,8 @@ void             empathy_chat_view_find_abilities       (EmpathyChatView *view,
 							 gboolean        *can_do_previous,
 							 gboolean        *can_do_next);
 void             empathy_chat_view_highlight            (EmpathyChatView *view,
-							 const gchar     *text);
+							 const gchar     *text,
+							 gboolean         match_case);
 void             empathy_chat_view_copy_clipboard       (EmpathyChatView *view);
 
 G_END_DECLS
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 09b3abd..c8785e2 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -407,7 +407,7 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
 
 	/* Highlight and find messages */
 	empathy_chat_view_highlight (window->chatview_find,
-				    window->last_find);
+				    window->last_find, FALSE);
 	empathy_chat_view_find_next (window->chatview_find,
 				    window->last_find,
 				    TRUE);
@@ -1108,7 +1108,7 @@ log_window_entry_chats_changed_cb (GtkWidget       *entry,
 	const gchar *str;
 
 	str = gtk_entry_get_text (GTK_ENTRY (window->entry_chats));
-	empathy_chat_view_highlight (window->chatview_chats, str);
+	empathy_chat_view_highlight (window->chatview_chats, str, FALSE);
 
 	if (str) {
 		empathy_chat_view_find_next (window->chatview_chats,
diff --git a/libempathy-gtk/empathy-search-bar.c b/libempathy-gtk/empathy-search-bar.c
index 1bf3c54..42c8716 100644
--- a/libempathy-gtk/empathy-search-bar.c
+++ b/libempathy-gtk/empathy-search-bar.c
@@ -127,7 +127,7 @@ empathy_search_bar_show (EmpathySearchBar *self)
   EmpathySearchBarPriv *priv = GET_PRIV (self);
 
   search = gtk_editable_get_chars (GTK_EDITABLE (priv->search_entry), 0, -1);
-  empathy_chat_view_highlight (priv->chat_view, search);
+  empathy_chat_view_highlight (priv->chat_view, search, TRUE);
   empathy_search_bar_update_buttons (self, search);
 
   /* grab the focus to the search entry */
@@ -143,7 +143,7 @@ empathy_search_bar_close_cb (GtkButton *button,
 {
   EmpathySearchBarPriv *priv = GET_PRIV (user_data);
 
-  empathy_chat_view_highlight (priv->chat_view, "");
+  empathy_chat_view_highlight (priv->chat_view, "", FALSE);
   gtk_widget_hide (GTK_WIDGET (user_data));
 
   /* give the focus back to the focus-chain with the chat view */
@@ -168,7 +168,7 @@ empathy_search_bar_search (EmpathySearchBar *self,
 
   /* highlight & search */
   // TODO: add case parameter
-  empathy_chat_view_highlight (priv->chat_view, search);
+  empathy_chat_view_highlight (priv->chat_view, search, match_case);
   if (next)
     {
       found = empathy_chat_view_find_next (priv->chat_view, search, new_search);
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 0a9fb98..0a505eb 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -739,11 +739,12 @@ theme_adium_find_abilities (EmpathyChatView *view,
 
 static void
 theme_adium_highlight (EmpathyChatView *view,
-		       const gchar     *text)
+		       const gchar     *text,
+		       gboolean         match_case)
 {
 	webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (view));
 	webkit_web_view_mark_text_matches (WEBKIT_WEB_VIEW (view),
-					   text, FALSE, 0);
+					   text, match_case, 0);
 	webkit_web_view_set_highlight_text_matches (WEBKIT_WEB_VIEW (view),
 						    TRUE);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]