]> git.0d.be Git - empathy.git/commitdiff
Fix some build errors when GSEAL is enabled
authorXavier Claessens <xclaesse@gmail.com>
Tue, 13 Apr 2010 14:27:12 +0000 (16:27 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Mon, 19 Apr 2010 09:55:58 +0000 (11:55 +0200)
configure.ac
libempathy-gtk/empathy-chat-text-view.c

index f9db12d01388fbdb0c6de4468ff789e6812f4933..b30abc186b5fb1008bd089f5d5b9781de38226b1 100644 (file)
@@ -47,10 +47,14 @@ KEYRING_REQUIRED=2.22
 NETWORK_MANAGER_REQUIRED=0.7.0
 NAUTILUS_SENDTO_REQUIRED=2.28.1
 
-# Use --enable-maintainer-mode to disable deprecated symbols and single include.
-# If this is not a released empathy, maintainer mode is forced
+# Use --enable-maintainer-mode to disable deprecated symbols,
+# disable single include and enable GSEAL. If this is not a released empathy,
+# maintainer mode is forced
 ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"])
 GNOME_MAINTAINER_MODE_DEFINES
+#if test $USE_MAINTAINER_MODE = yes; then
+#  AC_DEFINE(GSEAL_ENABLE, [], [Seal public structs to force usage of accessors])
+#fi
 
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
index 491b61333b3d84b9cd3714ffbd2f74006e1abbbb..9e31e49872449b4c8fa7e391fc55bf8b42320e79 100644 (file)
@@ -493,8 +493,13 @@ chat_text_view_size_allocate (GtkWidget     *widget,
 
        if (down) {
                GtkAdjustment *adj;
+               GtkWidget *sw;
 
-               adj = GTK_TEXT_VIEW (widget)->vadjustment;
+               sw = gtk_widget_get_parent (widget);
+               if (!GTK_IS_SCROLLED_WINDOW (sw))
+                       return;
+
+               adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
                gtk_adjustment_set_value (adj,
                                          gtk_adjustment_get_upper (adj) -
                                          gtk_adjustment_get_page_size (adj));
@@ -653,6 +658,18 @@ empathy_chat_text_view_init (EmpathyChatTextView *view)
                          NULL);
 }
 
+static void
+chat_text_view_scroll_stop (EmpathyChatTextView *view)
+{
+       EmpathyChatTextViewPriv *priv = GET_PRIV (view);
+
+       g_timer_destroy (priv->scroll_time);
+       priv->scroll_time = NULL;
+
+       g_source_remove (priv->scroll_timeout);
+       priv->scroll_timeout = 0;
+}
+
 /* Code stolen from pidgin/gtkimhtml.c */
 static gboolean
 chat_text_view_scroll_cb (EmpathyChatTextView *view)
@@ -660,9 +677,17 @@ chat_text_view_scroll_cb (EmpathyChatTextView *view)
        EmpathyChatTextViewPriv *priv;
        GtkAdjustment      *adj;
        gdouble             max_val;
+       GtkWidget          *sw;
 
        priv = GET_PRIV (view);
-       adj = GTK_TEXT_VIEW (view)->vadjustment;
+
+       sw = gtk_widget_get_parent (GTK_WIDGET (view));
+       if (!GTK_IS_SCROLLED_WINDOW (sw)) {
+               chat_text_view_scroll_stop (view);
+               return FALSE;
+       }
+
+       adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
        max_val = gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj);
 
        g_return_val_if_fail (priv->scroll_time != NULL, FALSE);
@@ -670,9 +695,7 @@ chat_text_view_scroll_cb (EmpathyChatTextView *view)
        if (g_timer_elapsed (priv->scroll_time, NULL) > MAX_SCROLL_TIME) {
                /* time's up. jump to the end and kill the timer */
                gtk_adjustment_set_value (adj, max_val);
-               g_timer_destroy (priv->scroll_time);
-               priv->scroll_time = NULL;
-               priv->scroll_timeout = 0;
+               chat_text_view_scroll_stop (view);
                return FALSE;
        }