]> git.0d.be Git - empathy.git/commitdiff
chat-window: most of the functions can be static
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 22 Sep 2010 09:55:45 +0000 (11:55 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 29 Sep 2010 10:52:10 +0000 (12:52 +0200)
src/empathy-chat-window.c
src/empathy-chat-window.h

index 4b181d3dd3ad79bbf253a754e701246fe43a9e77..bc50355a5abfd767c0b6ba07fd51ab8cbfeb65d5 100644 (file)
@@ -146,6 +146,20 @@ static const GtkTargetEntry drag_types_dest_file[] = {
 
 static void chat_window_update (EmpathyChatWindow *window);
 
+static void empathy_chat_window_add_chat (EmpathyChatWindow *window,
+                             EmpathyChat       *chat);
+
+static void empathy_chat_window_remove_chat (EmpathyChatWindow *window,
+                                EmpathyChat       *chat);
+
+static void empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
+                              EmpathyChatWindow *new_window,
+                              EmpathyChat       *chat);
+
+static void empathy_chat_window_get_nb_chats (EmpathyChatWindow *self,
+                              guint *nb_rooms,
+                              guint *nb_private);
+
 G_DEFINE_TYPE (EmpathyChatWindow, empathy_chat_window, G_TYPE_OBJECT);
 
 static void
@@ -1154,6 +1168,12 @@ chat_window_tabs_right_activate_cb (GtkAction         *action,
        chat_window_menu_context_update (priv, num_pages);
 }
 
+static EmpathyChatWindow *
+empathy_chat_window_new (void)
+{
+       return EMPATHY_CHAT_WINDOW (g_object_new (EMPATHY_TYPE_CHAT_WINDOW, NULL));
+}
+
 static void
 chat_window_detach_activate_cb (GtkAction         *action,
                                EmpathyChatWindow *window)
@@ -1348,6 +1368,21 @@ chat_window_set_highlight_room_tab_label (EmpathyChat *chat)
        g_free (markup);
 }
 
+static gboolean
+empathy_chat_window_has_focus (EmpathyChatWindow *window)
+{
+       EmpathyChatWindowPriv *priv;
+       gboolean              has_focus;
+
+       g_return_val_if_fail (EMPATHY_IS_CHAT_WINDOW (window), FALSE);
+
+       priv = GET_PRIV (window);
+
+       g_object_get (priv->dialog, "has-toplevel-focus", &has_focus, NULL);
+
+       return has_focus;
+}
+
 static void
 chat_window_new_message_cb (EmpathyChat       *chat,
                            EmpathyMessage    *message,
@@ -2062,17 +2097,23 @@ empathy_chat_window_init (EmpathyChatWindow *window)
                                                   window);
 }
 
-EmpathyChatWindow *
-empathy_chat_window_new (void)
+static GtkWidget *
+empathy_chat_window_get_dialog (EmpathyChatWindow *window)
 {
-       return EMPATHY_CHAT_WINDOW (g_object_new (EMPATHY_TYPE_CHAT_WINDOW, NULL));
+       EmpathyChatWindowPriv *priv;
+
+       g_return_val_if_fail (window != NULL, NULL);
+
+       priv = GET_PRIV (window);
+
+       return priv->dialog;
 }
 
 /* Returns the window to open a new tab in if there is only one window
  * visble, otherwise, returns NULL indicating that a new window should
  * be added.
  */
-EmpathyChatWindow *
+static EmpathyChatWindow *
 empathy_chat_window_get_default (gboolean room)
 {
        GSettings *gsettings = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
@@ -2118,19 +2159,7 @@ empathy_chat_window_get_default (gboolean room)
        return NULL;
 }
 
-GtkWidget *
-empathy_chat_window_get_dialog (EmpathyChatWindow *window)
-{
-       EmpathyChatWindowPriv *priv;
-
-       g_return_val_if_fail (window != NULL, NULL);
-
-       priv = GET_PRIV (window);
-
-       return priv->dialog;
-}
-
-void
+static void
 empathy_chat_window_add_chat (EmpathyChatWindow *window,
                              EmpathyChat       *chat)
 {
@@ -2199,7 +2228,7 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
        DEBUG ("Chat added (%d references)", G_OBJECT (chat)->ref_count);
 }
 
-void
+static void
 empathy_chat_window_remove_chat (EmpathyChatWindow *window,
                                 EmpathyChat       *chat)
 {
@@ -2237,7 +2266,7 @@ empathy_chat_window_remove_chat (EmpathyChatWindow *window,
        g_object_unref (chat);
 }
 
-void
+static void
 empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
                               EmpathyChatWindow *new_window,
                               EmpathyChat       *chat)
@@ -2266,7 +2295,7 @@ empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
        g_object_unref (chat);
 }
 
-void
+static void
 empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
                                    EmpathyChat       *chat)
 {
@@ -2284,21 +2313,6 @@ empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
                                       page_num);
 }
 
-gboolean
-empathy_chat_window_has_focus (EmpathyChatWindow *window)
-{
-       EmpathyChatWindowPriv *priv;
-       gboolean              has_focus;
-
-       g_return_val_if_fail (EMPATHY_IS_CHAT_WINDOW (window), FALSE);
-
-       priv = GET_PRIV (window);
-
-       g_object_get (priv->dialog, "has-toplevel-focus", &has_focus, NULL);
-
-       return has_focus;
-}
-
 EmpathyChat *
 empathy_chat_window_find_chat (TpAccount   *account,
                               const gchar *id)
@@ -2380,7 +2394,7 @@ empathy_chat_window_present_chat (EmpathyChat *chat,
        gtk_widget_grab_focus (chat->input_text_view);
 }
 
-void
+static void
 empathy_chat_window_get_nb_chats (EmpathyChatWindow *self,
                               guint *nb_rooms,
                               guint *nb_private)
index 4cbd2094a762110dbac2c9494d514ffdacf49bce..5477479ac8c7344d41aa2b8e75b8131afd4a9854 100644 (file)
@@ -57,28 +57,12 @@ struct _EmpathyChatWindowClass {
 };
 
 GType              empathy_chat_window_get_type       (void);
-EmpathyChatWindow *empathy_chat_window_get_default    (gboolean room);
-EmpathyChatWindow *empathy_chat_window_new            (void);
-GtkWidget *        empathy_chat_window_get_dialog     (EmpathyChatWindow *window);
-void               empathy_chat_window_add_chat       (EmpathyChatWindow *window,
-                                                      EmpathyChat       *chat);
-void               empathy_chat_window_remove_chat    (EmpathyChatWindow *window,
-                                                      EmpathyChat       *chat);
-void               empathy_chat_window_move_chat      (EmpathyChatWindow *old_window,
-                                                      EmpathyChatWindow *new_window,
-                                                      EmpathyChat       *chat);
-void               empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
-                                                      EmpathyChat       *chat);
-gboolean           empathy_chat_window_has_focus      (EmpathyChatWindow *window);
+
 EmpathyChat *      empathy_chat_window_find_chat      (TpAccount        *account,
                                                       const gchar      *id);
 void               empathy_chat_window_present_chat   (EmpathyChat      *chat,
                                                       gint64 timestamp);
 
-void               empathy_chat_window_get_nb_chats   (EmpathyChatWindow *window,
-                                                      guint *nb_rooms,
-                                                      guint *nb_private);
-
 G_END_DECLS
 
 #endif /* __EMPATHY_CHAT_WINDOW_H__ */