[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:55:37 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a96c16a9373dd2679e6e10bf31e053f0bf975dce
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 11 14:43:42 2010 +0000
2010-08-11 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
Reviewed by Xan Lopez.
[GTK] Misc improvements to the scrolling code
https://bugs.webkit.org/show_bug.cgi?id=41926
Refactor code that uses deprecated ways of dealing with the
adjustments to use the GtkVersioning infrastructure.
* GNUmakefile.am:
* platform/gtk/GtkVersioning.cpp: Added.
* platform/gtk/GtkVersioning.h:
* platform/gtk/ScrollViewGtk.cpp:
* platform/gtk/ScrollbarGtk.cpp:
(ScrollbarGtk::detachAdjustment):
(ScrollbarGtk::updateThumbPosition):
(ScrollbarGtk::updateThumbProportion):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ac1bc79..305ee22 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Misc improvements to the scrolling code
+ https://bugs.webkit.org/show_bug.cgi?id=41926
+
+ Refactor code that uses deprecated ways of dealing with the
+ adjustments to use the GtkVersioning infrastructure.
+
+ * GNUmakefile.am:
+ * platform/gtk/GtkVersioning.cpp: Added.
+ * platform/gtk/GtkVersioning.h:
+ * platform/gtk/ScrollViewGtk.cpp:
+ * platform/gtk/ScrollbarGtk.cpp:
+ (ScrollbarGtk::detachAdjustment):
+ (ScrollbarGtk::updateThumbPosition):
+ (ScrollbarGtk::updateThumbProportion):
+
2010-08-11 Nate Chapin <japhet at chromium.org>
Chromium mac build fix (variables weren't being initialized).
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 1a61475..6efea85 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2481,6 +2481,7 @@ webcoregtk_sources += \
WebCore/platform/gtk/gtkdrawing.h \
WebCore/platform/gtk/GtkPluginWidget.cpp \
WebCore/platform/gtk/GtkPluginWidget.h \
+ WebCore/platform/gtk/GtkVersioning.cpp \
WebCore/platform/gtk/GtkVersioning.h \
WebCore/platform/gtk/KeyEventGtk.cpp \
WebCore/platform/gtk/KURLGtk.cpp \
diff --git a/WebCore/platform/gtk/GtkVersioning.cpp b/WebCore/platform/gtk/GtkVersioning.cpp
new file mode 100644
index 0000000..e7734a8
--- /dev/null
+++ b/WebCore/platform/gtk/GtkVersioning.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "GtkVersioning.h"
+
+#include <gtk/gtk.h>
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value)
+{
+ m_adjustment->value = m_currentPos;
+ gtk_adjustment_value_changed(m_adjustment);
+}
+
+void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
+ gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)
+{
+ g_object_freeze_notify(G_OBJECT(adjustment));
+
+ g_object_set(adjustment,
+ "lower", lower,
+ "upper", upper,
+ "step-increment", stepIncrement,
+ "page-increment", pageIncrement,
+ "page-size", pageSize,
+ NULL);
+
+ g_object_thaw_notify(G_OBJECT(adjustment));
+
+ gtk_adjustment_changed(adjustment);
+ gtk_adjustment_value_changed(adjustment);
+}
+#endif
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index ebb1645..6b45228 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -58,6 +58,11 @@
#define gtk_selection_data_get_data(data) (data)->data
#define gtk_selection_data_get_target(data) (data)->target
#define gtk_adjustment_set_page_size(adj, value) (adj)->page_size = value
+
+void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
+ gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize);
+
+void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
#endif // GTK_CHECK_VERSION(2, 14, 0)
#endif // GtkVersioning_h
diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp
index e705fe0..871a0bf 100644
--- a/WebCore/platform/gtk/ScrollViewGtk.cpp
+++ b/WebCore/platform/gtk/ScrollViewGtk.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
+#include "GtkVersioning.h"
#include "HostWindow.h"
#include "IntRect.h"
#include "Page.h"
@@ -72,29 +73,6 @@ PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientati
return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
}
-#if !GTK_CHECK_VERSION(2, 14, 0)
-#define gtk_adjustment_configure AdjustmentConfigure
-
-static void AdjustmentConfigure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
- gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)
-{
- g_object_freeze_notify(G_OBJECT(adjustment));
-
- g_object_set(adjustment,
- "lower", lower,
- "upper", upper,
- "step-increment", stepIncrement,
- "page-increment", pageIncrement,
- "page-size", pageSize,
- NULL);
-
- g_object_thaw_notify(G_OBJECT(adjustment));
-
- gtk_adjustment_changed(adjustment);
- gtk_adjustment_value_changed(adjustment);
-}
-#endif
-
/*
* The following is assumed:
* (hadj && vadj) || (!hadj && !vadj)
diff --git a/WebCore/platform/gtk/ScrollbarGtk.cpp b/WebCore/platform/gtk/ScrollbarGtk.cpp
index 8081fb8..3b86ec9 100644
--- a/WebCore/platform/gtk/ScrollbarGtk.cpp
+++ b/WebCore/platform/gtk/ScrollbarGtk.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007, 2009 Holger Hans Peter Freyther zecke at selfish.org
* Copyright (C) 2010 Gustavo Noronha Silva <gns at gnome.org>
+ * Copyright (C) 2010 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,10 +21,10 @@
#include "config.h"
#include "ScrollbarGtk.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
#include "GtkVersioning.h"
#include "IntRect.h"
-#include "GraphicsContext.h"
-#include "FrameView.h"
#include "ScrollbarTheme.h"
#include <gtk/gtk.h>
@@ -120,15 +121,8 @@ void ScrollbarGtk::detachAdjustment()
// For the case where we only operate on the GtkAdjustment it is best to
// reset the values so that the surrounding scrollbar gets updated, or
// e.g. for a GtkScrolledWindow the scrollbar gets hidden.
-#if GTK_CHECK_VERSION(2, 14, 0)
gtk_adjustment_configure(m_adjustment, 0, 0, 0, 0, 0, 0);
-#else
- m_adjustment->lower = 0;
- m_adjustment->upper = 0;
- m_adjustment->value = 0;
- gtk_adjustment_changed(m_adjustment);
- gtk_adjustment_value_changed(m_adjustment);
-#endif
+
g_object_unref(m_adjustment);
m_adjustment = 0;
}
@@ -162,19 +156,12 @@ void ScrollbarGtk::frameRectsChanged()
void ScrollbarGtk::updateThumbPosition()
{
- if (gtk_adjustment_get_value(m_adjustment) != m_currentPos) {
-#if GTK_CHECK_VERSION(2, 14, 0)
+ if (gtk_adjustment_get_value(m_adjustment) != m_currentPos)
gtk_adjustment_set_value(m_adjustment, m_currentPos);
-#else
- m_adjustment->value = m_currentPos;
- gtk_adjustment_value_changed(m_adjustment);
-#endif
- }
}
void ScrollbarGtk::updateThumbProportion()
{
-#if GTK_CHECK_VERSION(2, 14, 0)
gtk_adjustment_configure(m_adjustment,
gtk_adjustment_get_value(m_adjustment),
gtk_adjustment_get_lower(m_adjustment),
@@ -182,13 +169,6 @@ void ScrollbarGtk::updateThumbProportion()
m_lineStep,
m_pageStep,
m_visibleSize);
-#else
- m_adjustment->step_increment = m_lineStep;
- m_adjustment->page_increment = m_pageStep;
- m_adjustment->page_size = m_visibleSize;
- m_adjustment->upper = m_totalSize;
- gtk_adjustment_changed(m_adjustment);
-#endif
}
void ScrollbarGtk::setFrameRect(const IntRect& rect)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list