]> git.0d.be Git - empathy.git/commitdiff
Replace _get_selection_bounds by _get_has_selection
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 16 Dec 2008 09:23:59 +0000 (09:23 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 16 Dec 2008 09:23:59 +0000 (09:23 +0000)
svn path=/trunk/; revision=1984

libempathy-gtk/empathy-chat-simple-view.c
libempathy-gtk/empathy-chat-view.c
libempathy-gtk/empathy-chat-view.h
libempathy-gtk/empathy-chat.c
src/empathy-chat-window.c

index 13cce79b426a70b157e2675ea2c63e823c77a8c6..186317d579bf4aa9c0497ff628c2b1aa85e1a407 100644 (file)
@@ -746,9 +746,7 @@ chat_simple_view_scroll (EmpathyChatView *view,
 }
 
 static gboolean
 }
 
 static gboolean
-chat_simple_view_get_selection_bounds (EmpathyChatView *view,
-                                      GtkTextIter     *start,
-                                      GtkTextIter     *end)
+chat_simple_view_get_has_selection (EmpathyChatView *view)
 {
        GtkTextBuffer *buffer;
        
 {
        GtkTextBuffer *buffer;
        
@@ -756,7 +754,7 @@ chat_simple_view_get_selection_bounds (EmpathyChatView *view,
        
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
        
        
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
        
-       return gtk_text_buffer_get_selection_bounds (buffer, start, end);
+       return gtk_text_buffer_get_has_selection (buffer);
 }
 
 static void
 }
 
 static void
@@ -1223,7 +1221,7 @@ chat_view_iface_init (EmpathyChatViewIface *iface)
        iface->set_margin = chat_simple_view_set_margin;
        iface->scroll = chat_simple_view_scroll;
        iface->scroll_down = chat_simple_view_scroll_down;
        iface->set_margin = chat_simple_view_set_margin;
        iface->scroll = chat_simple_view_scroll;
        iface->scroll_down = chat_simple_view_scroll_down;
-       iface->get_selection_bounds = chat_simple_view_get_selection_bounds;
+       iface->get_has_selection = chat_simple_view_get_has_selection;
        iface->clear = chat_simple_view_clear;
        iface->find_previous = chat_simple_view_find_previous;
        iface->find_next = chat_simple_view_find_next;
        iface->clear = chat_simple_view_clear;
        iface->find_previous = chat_simple_view_find_previous;
        iface->find_next = chat_simple_view_find_next;
index dbf9cafcb89d0d281114f8e88e66276500951825..bb0db85e1cf042f08c53cdeb0416467ad0c85d0c 100644 (file)
@@ -106,16 +106,12 @@ empathy_chat_view_scroll (EmpathyChatView *view,
 }
 
 gboolean
 }
 
 gboolean
-empathy_chat_view_get_selection_bounds (EmpathyChatView *view,
-                                       GtkTextIter    *start,
-                                       GtkTextIter    *end)
+empathy_chat_view_get_has_selection (EmpathyChatView *view)
 {
        g_return_val_if_fail (EMPATHY_IS_CHAT_VIEW (view), FALSE);
        
 {
        g_return_val_if_fail (EMPATHY_IS_CHAT_VIEW (view), FALSE);
        
-       if (EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->get_selection_bounds) {
-               return EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->get_selection_bounds (view, 
-                                                                                     start, 
-                                                                                     end);
+       if (EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->get_has_selection) {
+               return EMPATHY_TYPE_CHAT_VIEW_GET_IFACE (view)->get_has_selection (view);
        }
        return FALSE;
 }
        }
        return FALSE;
 }
index a96b114b228c158d7e0aaf03d9625d38ef272f69..1c4bd32cbb0aae11f4978346a164673453c5258d 100644 (file)
@@ -53,9 +53,7 @@ struct _EmpathyChatViewIface {
        void             (*scroll)               (EmpathyChatView *view,
                                                  gboolean         allow_scrolling);
        void             (*scroll_down)          (EmpathyChatView *view);
        void             (*scroll)               (EmpathyChatView *view,
                                                  gboolean         allow_scrolling);
        void             (*scroll_down)          (EmpathyChatView *view);
-       gboolean         (*get_selection_bounds) (EmpathyChatView *view,
-                                                 GtkTextIter     *start,
-                                                 GtkTextIter     *end);
+       gboolean         (*get_has_selection)    (EmpathyChatView *view);
        void             (*clear)                (EmpathyChatView *view);
        gboolean         (*find_previous)        (EmpathyChatView *view,
                                                  const gchar     *search_criteria,
        void             (*clear)                (EmpathyChatView *view);
        gboolean         (*find_previous)        (EmpathyChatView *view,
                                                  const gchar     *search_criteria,
@@ -88,9 +86,7 @@ void             empathy_chat_view_append_event         (EmpathyChatView *view,
 void             empathy_chat_view_scroll               (EmpathyChatView *view,
                                                         gboolean         allow_scrolling);
 void             empathy_chat_view_scroll_down          (EmpathyChatView *view);
 void             empathy_chat_view_scroll               (EmpathyChatView *view,
                                                         gboolean         allow_scrolling);
 void             empathy_chat_view_scroll_down          (EmpathyChatView *view);
-gboolean         empathy_chat_view_get_selection_bounds (EmpathyChatView *view,
-                                                        GtkTextIter     *start,
-                                                        GtkTextIter     *end);
+gboolean         empathy_chat_view_get_has_selection    (EmpathyChatView *view);
 void             empathy_chat_view_clear                (EmpathyChatView *view);
 gboolean         empathy_chat_view_find_previous        (EmpathyChatView *view,
                                                         const gchar     *search_criteria,
 void             empathy_chat_view_clear                (EmpathyChatView *view);
 gboolean         empathy_chat_view_find_previous        (EmpathyChatView *view,
                                                         const gchar     *search_criteria,
index 6d2cb0118dfe097d25ba5f26a806cd76521aff55..ec6a466641d74597ba8ead3b31601ec647de2a5c 100644 (file)
@@ -1740,7 +1740,7 @@ empathy_chat_cut (EmpathyChat *chat)
        g_return_if_fail (EMPATHY_IS_CHAT (chat));
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
        g_return_if_fail (EMPATHY_IS_CHAT (chat));
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
-       if (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)) {
+       if (gtk_text_buffer_get_has_selection (buffer)) {
                GtkClipboard *clipboard;
 
                clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
                GtkClipboard *clipboard;
 
                clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
@@ -1756,13 +1756,13 @@ empathy_chat_copy (EmpathyChat *chat)
 
        g_return_if_fail (EMPATHY_IS_CHAT (chat));
 
 
        g_return_if_fail (EMPATHY_IS_CHAT (chat));
 
-       if (empathy_chat_view_get_selection_bounds (chat->view, NULL, NULL)) {
+       if (empathy_chat_view_get_has_selection (chat->view)) {
                empathy_chat_view_copy_clipboard (chat->view);
                return;
        }
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
                empathy_chat_view_copy_clipboard (chat->view);
                return;
        }
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
-       if (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)) {
+       if (gtk_text_buffer_get_has_selection (buffer)) {
                GtkClipboard *clipboard;
 
                clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
                GtkClipboard *clipboard;
 
                clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
index 5a8cb104819178911e910524de028b7a8c2d2c41..ae63b894e8a4996dd38c8aa3f0d4a5b463a1ae5b 100644 (file)
@@ -656,14 +656,13 @@ chat_window_edit_activate_cb (GtkWidget        *menuitem,
        }
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->current_chat->input_text_view));
        }
 
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->current_chat->input_text_view));
-       if (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)) {
+       if (gtk_text_buffer_get_has_selection (buffer)) {
                gtk_widget_set_sensitive (priv->menu_edit_copy, TRUE);
                gtk_widget_set_sensitive (priv->menu_edit_cut, TRUE);
        } else {
                gboolean selection;
 
                gtk_widget_set_sensitive (priv->menu_edit_copy, TRUE);
                gtk_widget_set_sensitive (priv->menu_edit_cut, TRUE);
        } else {
                gboolean selection;
 
-               selection = empathy_chat_view_get_selection_bounds (priv->current_chat->view, 
-                                                                  NULL, NULL);
+               selection = empathy_chat_view_get_has_selection (priv->current_chat->view);
 
                gtk_widget_set_sensitive (priv->menu_edit_cut, FALSE);
                gtk_widget_set_sensitive (priv->menu_edit_copy, selection);
 
                gtk_widget_set_sensitive (priv->menu_edit_cut, FALSE);
                gtk_widget_set_sensitive (priv->menu_edit_copy, selection);