[GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2013 16:11:20 +0000 (16:11 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2013 16:11:20 +0000 (16:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=115904

Reviewed by Martin Robinson.

Source/WebCore:

* bindings/gobject/WebKitDOMEventTarget.cpp:
* platform/gtk/GtkVersioning.c:
* platform/gtk/GtkVersioning.h:

Source/WebKit2:

* UIProcess/API/gtk/tests/TestInspectorServer.cpp:
(startTestServerMonitor):
* UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp:
(startTestServerMonitor):

Source/WTF:

* wtf/gobject/GRefPtr.cpp:

Tools:

* ImageDiff/gtk/ImageDiff.cpp:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/gobject/GRefPtr.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp
Source/WebCore/platform/gtk/GtkVersioning.c
Source/WebCore/platform/gtk/GtkVersioning.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp
Tools/ChangeLog
Tools/ImageDiff/gtk/ImageDiff.cpp

index 1ffaa47..3c0bd25 100644 (file)
@@ -1,3 +1,12 @@
+2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+        https://bugs.webkit.org/show_bug.cgi?id=115904
+
+        Reviewed by Martin Robinson.
+
+        * wtf/gobject/GRefPtr.cpp:
+
 2013-05-09  Darin Adler  <darin@apple.com>
 
         RenderQuote has giant function for language to quotes map
index 317139d..92554ab 100644 (file)
@@ -63,7 +63,6 @@ template <> void derefGPtr(GMainLoop* ptr)
         g_main_loop_unref(ptr);
 }
 
-#if GLIB_CHECK_VERSION(2, 32, 0)
 template <> GBytes* refGPtr(GBytes* ptr)
 {
     if (ptr)
@@ -77,24 +76,6 @@ template <> void derefGPtr(GBytes* ptr)
         g_bytes_unref(ptr);
 }
 
-# else
-
-typedef struct _GBytes {
-    bool fake;
-} GBytes;
-
-template <> GBytes* refGPtr(GBytes* ptr)
-{
-    return ptr;
-}
-
-template <> void derefGPtr(GBytes* ptr)
-{
-}
-
-#endif
-
-#if GLIB_CHECK_VERSION(2, 24, 0)
 template <> GVariant* refGPtr(GVariant* ptr)
 {
     if (ptr)
@@ -107,24 +88,6 @@ template <> void derefGPtr(GVariant* ptr)
     g_variant_unref(ptr);
 }
 
-#else
-
-// We do this so that we can avoid including the glib.h header in GRefPtr.h.
-typedef struct _GVariant {
-    bool fake;
-} GVariant; 
-
-template <> GVariant* refGPtr(GVariant* ptr)
-{
-    return ptr;
-}
-
-template <> void derefGPtr(GVariant* ptr)
-{
-}
-
-#endif
-
 template <> GSource* refGPtr(GSource* ptr)
 {
     if (ptr)
index 68122e8..d4c1d9e 100644 (file)
@@ -1,3 +1,14 @@
+2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+        https://bugs.webkit.org/show_bug.cgi?id=115904
+
+        Reviewed by Martin Robinson.
+
+        * bindings/gobject/WebKitDOMEventTarget.cpp:
+        * platform/gtk/GtkVersioning.c:
+        * platform/gtk/GtkVersioning.h:
+
 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
 
         Unreviewed. Fix the ENABLE(SHARED_WORKERS) build after r149864.
index e21ab46..d885b2c 100644 (file)
 #include "WebKitDOMPrivate.h"
 
 typedef WebKitDOMEventTargetIface WebKitDOMEventTargetInterface;
-#if GLIB_CHECK_VERSION(2, 24, 0)
-G_DEFINE_INTERFACE(WebKitDOMEventTarget, webkit_dom_event_target, G_TYPE_OBJECT)
-#else
-static void webkit_dom_event_target_default_init(WebKitDOMEventTargetIface*);
 
-GType webkit_dom_event_target_get_type(void)
-{
-    static volatile gsize typeIdVolatile = 0;
-
-    if (g_once_init_enter(&typeIdVolatile)) {
-        GType typeId = g_type_register_static_simple(G_TYPE_INTERFACE,
-                                                     g_intern_static_string("WebKitDOMEventTarget"),
-                                                     sizeof(WebKitDOMEventTargetInterface),
-                                                     (GClassInitFunc)webkit_dom_event_target_default_init,
-                                                     0,
-                                                     static_cast<GInstanceInitFunc>(0),
-                                                     static_cast<GTypeFlags>(0));
-        g_type_interface_add_prerequisite(typeId, G_TYPE_OBJECT);
-        g_once_init_leave(&typeIdVolatile, typeId);
-    }
-
-    return typeIdVolatile;
-}
-#endif
+G_DEFINE_INTERFACE(WebKitDOMEventTarget, webkit_dom_event_target, G_TYPE_OBJECT)
 
 static void webkit_dom_event_target_default_init(WebKitDOMEventTargetIface*)
 {
index ac2f84c..2c8f5d8 100644 (file)
@@ -289,14 +289,6 @@ void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)
 
 #endif // GTK_API_VERSION_2
 
-#if !GLIB_CHECK_VERSION(2, 27, 1)
-gboolean g_signal_accumulator_first_wins(GSignalInvocationHint *invocationHint, GValue *returnAccumulator, const GValue *handlerReturn, gpointer data)
-{
-    g_value_copy(handlerReturn, returnAccumulator);
-    return FALSE;
-}
-#endif
-
 #if !GTK_CHECK_VERSION(2, 22, 0)
 cairo_surface_t *gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height)
 {
index e3cac63..251ade2 100644 (file)
@@ -114,10 +114,6 @@ void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
 GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
 GdkCursor* blankCursor();
 
-#if !GLIB_CHECK_VERSION(2, 27, 1)
-gboolean g_signal_accumulator_first_wins(GSignalInvocationHint* invocationHint, GValue* returnAccumulator, const GValue* handlerReturn, gpointer data);
-#endif
-
 #if !GTK_CHECK_VERSION(3, 3, 6)
 void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area);
 #endif
index 3357cc1..4542b4a 100644 (file)
@@ -1,3 +1,15 @@
+2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+        https://bugs.webkit.org/show_bug.cgi?id=115904
+
+        Reviewed by Martin Robinson.
+
+        * UIProcess/API/gtk/tests/TestInspectorServer.cpp:
+        (startTestServerMonitor):
+        * UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp:
+        (startTestServerMonitor):
+
 2013-05-09  Anders Carlsson  <andersca@apple.com>
 
         Fix build.
index 48b4e2b..92b7f00 100644 (file)
@@ -73,12 +73,7 @@ static gpointer testServerMonitorThreadFunc(gpointer)
 static void startTestServerMonitor()
 {
     gChildIsReady = false;
-
-#if (!GLIB_CHECK_VERSION(2, 31, 0))
-    g_thread_create(testServerMonitorThreadFunc, 0, FALSE, 0);
-#else
     g_thread_new("TestServerMonitor", testServerMonitorThreadFunc, 0);
-#endif
 }
 
 static void startTestServer()
index 3db9094..d3750c0 100644 (file)
@@ -81,12 +81,7 @@ static gpointer testServerMonitorThreadFunc(gpointer)
 static void startTestServerMonitor()
 {
     kChildIsReady = false;
-
-#if (!GLIB_CHECK_VERSION(2, 31, 0))
-    g_thread_create(testServerMonitorThreadFunc, 0, FALSE, 0);
-#else
     g_thread_new("TestServerMonitor", testServerMonitorThreadFunc, 0);
-#endif
 }
 
 static void startTestServer()
index aa2f7b9..c4555e2 100644 (file)
@@ -1,3 +1,13 @@
+2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+        https://bugs.webkit.org/show_bug.cgi?id=115904
+
+        Reviewed by Martin Robinson.
+
+        * ImageDiff/gtk/ImageDiff.cpp:
+        (main):
+
 2013-05-10  Balazs Kelemen  <kbalazs@webkit.org>
 
         Add my new address to contributors.json. (Unreviewed)
index 7baa25e..84c4003 100644 (file)
@@ -177,10 +177,6 @@ void printImageDifferences(GdkPixbuf* baselineImage, GdkPixbuf* actualImage)
 
 int main(int argc, char* argv[])
 {
-#if !GLIB_CHECK_VERSION(2, 35, 0)
-    g_type_init();
-#endif
-
     GError* error = 0;
     GOptionContext* context = g_option_context_new("- compare two image files, printing their percentage difference and the difference image to stdout");
     g_option_context_add_main_entries(context, commandLineOptionEntries, 0);