Changeset 149952 in webkit
- Timestamp:
- May 12, 2013 2:05:54 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r149951 r149952 1 2013-05-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs 4 https://bugs.webkit.org/show_bug.cgi?id=115914 5 6 Reviewed by Martin Robinson. 7 8 * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: 9 (WebCore::FullscreenVideoControllerGtk::hideHud): 10 (WebCore::FullscreenVideoControllerGtk::initializeWindow): 11 * platform/gtk/GtkVersioning.c: 12 * platform/gtk/GtkVersioning.h: 13 * platform/gtk/WidgetRenderingContext.cpp: 14 (WebCore::WidgetRenderingContext::WidgetRenderingContext): 15 * plugins/gtk/gtk2xtbin.c: 16 (gtk_xtbin_realize): 17 1 18 2013-05-11 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp
r142406 r149952 198 198 199 199 GdkWindow* window = gtk_widget_get_window(m_window); 200 G dkCursor* cursor = blankCursor();201 gdk_window_set_cursor(window, cursor );200 GRefPtr<GdkCursor> cursor = adoptGRef(gdk_cursor_new(GDK_BLANK_CURSOR)); 201 gdk_window_set_cursor(window, cursor.get()); 202 202 203 203 gtk_widget_hide(m_hudWindow); … … 256 256 257 257 GdkWindow* window = gtk_widget_get_window(m_window); 258 GRefPtr<GdkCursor> cursor (adoptGRef(blankCursor()));258 GRefPtr<GdkCursor> cursor = adoptGRef(gdk_cursor_new(GDK_BLANK_CURSOR)); 259 259 gdk_window_set_cursor(window, cursor.get()); 260 260 -
trunk/Source/WebCore/platform/gtk/GtkVersioning.c
r149879 r149952 26 26 #include <X11/Xatom.h> 27 27 #include <gdk/gdkx.h> 28 #endif29 30 #if !GTK_CHECK_VERSION(2, 14, 0)31 void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value)32 {33 m_adjustment->value = m_currentPos;34 gtk_adjustment_value_changed(m_adjustment);35 }36 37 void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,38 gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)39 {40 g_object_freeze_notify(G_OBJECT(adjustment));41 42 g_object_set(adjustment,43 "lower", lower,44 "upper", upper,45 "step-increment", stepIncrement,46 "page-increment", pageIncrement,47 "page-size", pageSize,48 NULL);49 50 g_object_thaw_notify(G_OBJECT(adjustment));51 52 gtk_adjustment_changed(adjustment);53 gtk_adjustment_value_changed(adjustment);54 }55 28 #endif 56 29 … … 64 37 #endif // GTK_API_VERSION_2 65 38 } 66 67 #if !GTK_CHECK_VERSION(2, 17, 3)68 void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)69 {70 gdk_window_get_root_origin(window, rootX, rootY);71 *rootX = *rootX + x;72 *rootY = *rootY + y;73 }74 #endif75 76 GdkCursor * blankCursor()77 {78 #if GTK_CHECK_VERSION(2, 16, 0)79 return gdk_cursor_new(GDK_BLANK_CURSOR);80 #else81 GdkCursor * cursor;82 GdkPixmap * source;83 GdkPixmap * mask;84 GdkColor foreground = { 0, 65535, 0, 0 }; // Red.85 GdkColor background = { 0, 0, 0, 65535 }; // Blue.86 static gchar cursorBits[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};87 88 source = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);89 mask = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);90 cursor = gdk_cursor_new_from_pixmap(source, mask, &foreground, &background, 8, 8);91 gdk_pixmap_unref(source);92 gdk_pixmap_unref(mask);93 return cursor;94 #endif // GTK_CHECK_VERSION(2, 16, 0)95 }96 97 #if !GTK_CHECK_VERSION(2, 16, 0)98 const gchar* gtk_menu_item_get_label(GtkMenuItem* menuItem)99 {100 GtkWidget * label = gtk_bin_get_child(GTK_BIN(menuItem));101 if (GTK_IS_LABEL(label))102 return gtk_label_get_text(GTK_LABEL(label));103 return 0;104 }105 #endif // GTK_CHECK_VERSION(2, 16, 0)106 39 107 40 #ifdef GTK_API_VERSION_2 … … 267 200 } 268 201 269 #if GTK_CHECK_VERSION(2, 24, 0)270 void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)271 {272 g_return_if_fail(GDK_IS_PIXMAP(drawable) || GDK_IS_WINDOW(drawable));273 274 if (GDK_IS_PIXMAP(drawable)) {275 gdk_pixmap_get_size(GDK_PIXMAP(drawable), width, height);276 return;277 }278 279 GdkWindow *window = GDK_WINDOW(drawable);280 *width = gdk_window_get_width(window);281 *height = gdk_window_get_height(window);282 }283 #else284 void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)285 {286 gdk_drawable_get_size(drawable, width, height);287 }288 #endif // GTK_CHECK_VERSION(2, 24, 0)289 290 #endif // GTK_API_VERSION_2291 292 #if !GTK_CHECK_VERSION(2, 22, 0)293 cairo_surface_t *gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height)294 {295 cairo_t *cairoContext = gdk_cairo_create(window);296 cairo_surface_t *cairoSurface = cairo_get_target(cairoContext);297 cairo_surface_t *newSurface = cairo_surface_create_similar(cairoSurface, content, width, height);298 cairo_destroy(cairoContext);299 return newSurface;300 }301 #endif // GTK_CHECK_VERSION(2, 22, 0)302 303 #if !GTK_CHECK_VERSION(3, 3, 6)304 202 #ifdef GDK_WINDOWING_X11 305 203 static int getScreenCurrentDesktop(GdkScreen *screen) … … 371 269 #endif 372 270 } 373 #endif // GTK_ CHECK_VERSION(3, 3, 6)271 #endif // GTK_API_VERSION_2 -
trunk/Source/WebCore/platform/gtk/GtkVersioning.h
r149879 r149952 37 37 GdkPixbuf* gdk_pixbuf_get_from_surface(cairo_surface_t* surface, int srcX, int srcY, 38 38 int width, int height); 39 void g etGdkDrawableSize(GdkDrawable* drawable, int* width, int* height);39 void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area); 40 40 #endif 41 41 42 #if !GTK_CHECK_VERSION(2, 23, 4)43 #define gdk_pixmap_get_size gdk_drawable_get_size44 #endif // GTK_CHECK_VERSION(2, 23, 4)45 46 #if !GTK_CHECK_VERSION(2, 23, 0)47 #define gdk_window_get_display(window) gdk_drawable_get_display(window)48 #define gdk_window_get_visual gdk_drawable_get_visual49 #endif // GTK_CHECK_VERSION(2, 23, 0)50 51 #if !GTK_CHECK_VERSION(2, 22, 0)52 cairo_surface_t* gdk_window_create_similar_surface(GdkWindow* window, cairo_content_t content, int width, int height);53 #endif // GTK_CHECK_VERSION(2, 22, 0)54 55 #if !GTK_CHECK_VERSION(2, 21, 2)56 #define gdk_visual_get_depth(visual) (visual)->depth57 #define gdk_visual_get_bits_per_rgb(visual) (visual)->bits_per_rgb58 #define gdk_drag_context_get_selected_action(context) (context)->action59 #define gdk_drag_context_get_actions(context) (context)->actions60 #endif // GTK_CHECK_VERSION(2, 21, 2)61 62 #if !GTK_CHECK_VERSION(2, 20, 0)63 #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)64 #define gtk_widget_set_realized(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_REALIZED)65 #define gtk_range_get_min_slider_size(range) (range)->min_slider_size66 #endif // GTK_CHECK_VERSION(2, 20, 0)67 68 #if !GTK_CHECK_VERSION(2, 19, 0)69 #define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget)70 #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)71 #define gtk_widget_get_has_window(widget) !GTK_WIDGET_NO_WINDOW(widget)72 #define gtk_widget_get_can_focus(widget) GTK_WIDGET_CAN_FOCUS(widget)73 #define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget)74 #endif // GTK_CHECK_VERSION(2, 19, 0)75 76 #if !GTK_CHECK_VERSION(2, 18, 0)77 #define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE)78 #define gtk_widget_get_visible(widget) (GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE)79 80 #define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window)81 #define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS)82 #define gtk_widget_get_allocation(widget, alloc) (*(alloc) = (widget)->allocation)83 #define gtk_widget_set_allocation(widget, alloc) ((widget)->allocation = *(alloc))84 #endif // GTK_CHECK_VERSION(2, 18, 0)85 86 #if !GTK_CHECK_VERSION(2, 17, 3)87 void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);88 #endif // GTK_CHECK_VERSION(2, 17, 3)89 90 #if !GTK_CHECK_VERSION(2, 16, 0)91 const gchar* gtk_menu_item_get_label(GtkMenuItem*);92 #endif // GTK_CHECK_VERSION(2, 16, 0)93 94 95 #if !GTK_CHECK_VERSION(2, 14, 0)96 #define gtk_widget_get_window(widget) (widget)->window97 #define gtk_adjustment_get_value(adj) (adj)->value98 #define gtk_dialog_get_content_area(dialog) (dialog)->vbox99 #define gtk_dialog_get_action_area(dialog) (dialog)->action_area100 #define gtk_selection_data_get_length(data) (data)->length101 #define gtk_selection_data_get_data(data) (data)->data102 #define gtk_selection_data_get_target(data) (data)->target103 #define gtk_adjustment_set_page_size(adj, newValue) ((adj)->page_size = newValue)104 #define gtk_adjustment_set_value(adj, newValue) ((adj)->value = newValue)105 #define gtk_adjustment_set_lower(adj, newValue) ((adj)->lower = newValue)106 #define gtk_adjustment_set_upper(adj, newValue) ((adj)->upper = newValue)107 108 void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,109 gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize);110 111 void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);112 #endif // GTK_CHECK_VERSION(2, 14, 0)113 114 42 GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window); 115 GdkCursor* blankCursor();116 117 #if !GTK_CHECK_VERSION(3, 3, 6)118 void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area);119 #endif120 43 121 44 G_END_DECLS -
trunk/Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
r143973 r149952 86 86 // This prevents giant pixmap allocations for very large widgets in smaller views. 87 87 // FIXME: We need to implement this check for WebKit2 as well. 88 if ( graphicsContext->gdkWindow()) {88 if (GdkDrawable* drawable = graphicsContext->gdkWindow()) { 89 89 int maxWidth = 0, maxHeight = 0; 90 getGdkDrawableSize(graphicsContext->gdkWindow(), &maxWidth, &maxHeight); 90 91 if (GDK_IS_PIXMAP(drawable)) 92 gdk_pixmap_get_size(GDK_PIXMAP(drawable), &maxWidth, &maxHeight); 93 else if (GDK_IS_WINDOW(drawable)) { 94 maxWidth = gdk_window_get_width(GDK_WINDOW(drawable)); 95 maxHeight = gdk_window_get_height(GDK_WINDOW(drawable)); 96 } 91 97 m_targetRect.setSize(m_targetRect.size().shrunkTo(IntSize(maxWidth, maxHeight))); 92 98 } -
trunk/Source/WebCore/plugins/gtk/gtk2xtbin.c
r124318 r149952 274 274 GtkXtBin *xtbin; 275 275 GtkAllocation allocation = { 0, 0, 200, 200 }; 276 #if GTK_CHECK_VERSION(2, 18, 0)277 276 GtkAllocation widget_allocation; 278 #endif279 277 280 278 #ifdef DEBUG_XTBIN … … 287 285 288 286 /* caculate the allocation before realize */ 289 #if GTK_CHECK_VERSION(2, 24, 0)290 287 allocation.width = gdk_window_get_width(xtbin->parent_window); 291 288 allocation.height = gdk_window_get_height(xtbin->parent_window); 292 #else293 gint x, y, w, h, d; /* geometry of window */294 gdk_window_get_geometry(xtbin->parent_window, &x, &y, &w, &h, &d);295 allocation.width = w;296 allocation.height = h;297 #endif298 289 gtk_widget_size_allocate (widget, &allocation); 299 290 … … 302 293 #endif 303 294 304 #if GTK_CHECK_VERSION(2, 18, 0)305 295 gtk_widget_get_allocation(widget, &widget_allocation); 306 296 xtbin->width = widget_allocation.width; 307 297 xtbin->height = widget_allocation.height; 308 #else309 xtbin->width = widget->allocation.width;310 xtbin->height = widget->allocation.height;311 #endif312 298 313 299 /* use GtkSocket's realize */ -
trunk/Source/WebKit/gtk/ChangeLog
r149666 r149952 1 2013-05-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs 4 https://bugs.webkit.org/show_bug.cgi?id=115914 5 6 Reviewed by Martin Robinson. 7 8 * WebCoreSupport/ChromeClientGtk.cpp: 9 (WebKit::ChromeClient::contentsSizeChanged): 10 * WebCoreSupport/FrameLoaderClientGtk.cpp: 11 (WebKit::FrameLoaderClient::transitionToCommittedForNewPage): 12 * tests/testapplicationcache.c: 13 * tests/testatk.c: 14 * tests/testatkroles.c: 15 (main): 16 * tests/testcontextmenu.c: 17 * tests/testcopyandpaste.c: 18 (main): 19 * tests/testdomdocument.c: 20 * tests/testdomdomwindow.c: 21 * tests/testdomnode.c: 22 * tests/testdownload.c: 23 (main): 24 * tests/testfavicondatabase.c: 25 (main): 26 * tests/testglobals.c: 27 * tests/testhittestresult.c: 28 * tests/testhttpbackend.c: 29 (main): 30 * tests/testkeyevents.c: 31 (main): 32 * tests/testloading.c: 33 * tests/testmimehandling.c: 34 (main): 35 * tests/testnetworkrequest.c: 36 (main): 37 * tests/testnetworkresponse.c: 38 (main): 39 * tests/testwebbackforwardlist.c: 40 (main): 41 * tests/testwebdatasource.c: 42 (main): 43 * tests/testwebframe.c: 44 (main): 45 * tests/testwebhistoryitem.c: 46 (main): 47 * tests/testwebinspector.c: 48 (main): 49 * tests/testwebplugindatabase.c: 50 (main): 51 * tests/testwebresource.c: 52 (main): 53 * tests/testwebsettings.c: 54 (main): 55 * tests/testwebview.c: 56 * tests/testwindow.c: 57 (main): 58 * webkit/webkitwebview.cpp: 59 (webkit_web_view_realize): 60 (webkit_web_view_show_help): 61 (webkit_web_view_class_init): 62 (webkit_web_view_set_tooltip_text): 63 1 64 2013-05-07 Tomas Popela <tpopela@redhat.com> 2 65 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r149125 r149952 721 721 GtkWidget* widget = GTK_WIDGET(m_webView); 722 722 GtkRequisition requisition; 723 #if GTK_CHECK_VERSION(2, 20, 0)724 723 gtk_widget_get_requisition(widget, &requisition); 725 #else726 requisition = widget->requisition;727 #endif728 724 if (gtk_widget_get_realized(widget) 729 725 && (requisition.height != size.height()) -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r148294 r149952 1251 1251 WebKitWebView* containingWindow = getViewFromFrame(m_frame); 1252 1252 GtkAllocation allocation; 1253 #if GTK_CHECK_VERSION(2, 18, 0)1254 1253 gtk_widget_get_allocation(GTK_WIDGET(containingWindow), &allocation); 1255 #else1256 allocation = GTK_WIDGET(containingWindow)->allocation;1257 #endif1258 1254 IntSize size = IntSize(allocation.width, allocation.height); 1259 1255 bool transparent = webkit_web_view_get_transparent(containingWindow); -
trunk/Source/WebKit/gtk/tests/testapplicationcache.c
r143869 r149952 24 24 #include <webkit/webkit.h> 25 25 26 #if GTK_CHECK_VERSION(2, 14, 0)27 28 26 static void test_application_cache_maximum_size() 29 27 { … … 50 48 } 51 49 52 #else53 int main(int argc, char** argv)54 {55 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");56 return 0;57 }58 59 #endif -
trunk/Source/WebKit/gtk/tests/testatk.c
r143869 r149952 26 26 #include <unistd.h> 27 27 #include <webkit/webkit.h> 28 29 #if GTK_CHECK_VERSION(2, 14, 0)30 28 31 29 static const char* centeredContents = "<html><body><p style='text-align: center;'>Short line</p><p style='text-align: center;'>Long-size line with some foo bar baz content</p><p style='text-align: center;'>Short line</p><p style='text-align: center;'>This is a multi-line paragraph<br />where the first line<br />is the biggest one</p></body></html>"; … … 2031 2029 } 2032 2030 2033 #else2034 int main(int argc, char** argv)2035 {2036 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");2037 return 0;2038 }2039 2040 #endif -
trunk/Source/WebKit/gtk/tests/testatkroles.c
r143869 r149952 25 25 #include <webkit/webkit.h> 26 26 27 #if GTK_CHECK_VERSION(2, 14, 0)28 29 27 /* Non form roles */ 30 28 #define HTML_DOCUMENT_FRAME "<html><body>This is a test.</body></html>" … … 427 425 return g_test_run(); 428 426 } 429 430 #else431 int main(int argc, char** argv)432 {433 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");434 return 0;435 }436 437 #endif -
trunk/Source/WebKit/gtk/tests/testcontextmenu.c
r143869 r149952 20 20 #include "autotoolsconfig.h" 21 21 #include <webkit/webkit.h> 22 23 #if GTK_CHECK_VERSION(2, 14, 0)24 22 25 23 typedef struct { … … 315 313 } 316 314 317 #else318 319 int main(int argc, char **argv)320 {321 g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");322 return 0;323 }324 325 #endif -
trunk/Source/WebKit/gtk/tests/testcopyandpaste.c
r143869 r149952 27 27 #include <JavaScriptCore/JSContextRef.h> 28 28 29 #if GTK_CHECK_VERSION(2, 14, 0)30 31 29 typedef struct { 32 30 char* page; … … 267 265 return g_test_run(); 268 266 } 269 270 #else271 272 int main(int argc, char** argv)273 {274 g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");275 return 0;276 }277 278 #endif -
trunk/Source/WebKit/gtk/tests/testdomdocument.c
r146721 r149952 26 26 #include <webkit/webkit.h> 27 27 28 #if GTK_CHECK_VERSION(2, 14, 0)29 30 28 #define HTML_DOCUMENT_TITLE "<html><head><title>This is the title</title></head><body></body></html>" 31 29 #define HTML_DOCUMENT_ELEMENTS "<html><body><ul><li>1</li><li>2</li><li>3</li></ul></body></html>" … … 392 390 } 393 391 394 #else395 int main(int argc, char** argv)396 {397 g_critical("You will gtk-2.14.0 to run the unit tests. Doing nothing now.");398 return 0;399 }400 401 #endif -
trunk/Source/WebKit/gtk/tests/testdomdomwindow.c
r143869 r149952 26 26 #include <webkit/webkit.h> 27 27 28 #if GTK_CHECK_VERSION(2, 14, 0)29 30 28 #define HTML_DOCUMENT "<html><head><title>This is the title</title></head><body><p id='test'>test</p></body></html>" 31 29 … … 218 216 } 219 217 220 #else221 int main(int argc, char** argv)222 {223 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");224 return 0;225 }226 227 #endif -
trunk/Source/WebKit/gtk/tests/testdomnode.c
r143869 r149952 25 25 #include <gtk/gtk.h> 26 26 #include <webkit/webkit.h> 27 28 #if GTK_CHECK_VERSION(2, 14, 0)29 27 30 28 #define HTML_DOCUMENT_HIERARCHY_NAVIGATION "<html><head><title>This is the title</title></head><body><p>1</p><p>2</p><p>3</p></body></html>" … … 195 193 } 196 194 197 #else198 int main(int argc, char** argv)199 {200 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");201 return 0;202 }203 204 #endif -
trunk/Source/WebKit/gtk/tests/testdownload.c
r143869 r149952 24 24 #include <webkit/webkit.h> 25 25 26 #if GTK_CHECK_VERSION(2, 14, 0)27 28 26 GMainLoop* loop; 29 27 char* temporaryFilename = NULL; … … 323 321 return g_test_run (); 324 322 } 325 326 #else327 328 int main(int argc, char** argv)329 {330 g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");331 return 0;332 }333 334 #endif -
trunk/Source/WebKit/gtk/tests/testfavicondatabase.c
r143869 r149952 27 27 const int gIconSize = 16; 28 28 29 #if GTK_CHECK_VERSION(2, 14, 0)30 29 GMainLoop *loop; 31 30 char *baseURI; … … 276 275 return g_test_run(); 277 276 } 278 #else279 int main(int argc, char **argv)280 {281 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");282 return 0;283 }284 285 #endif -
trunk/Source/WebKit/gtk/tests/testglobals.c
r143869 r149952 22 22 #include <libsoup/soup.h> 23 23 #include <webkit/webkit.h> 24 25 #if GTK_CHECK_VERSION(2, 14, 0)26 24 27 25 // Make sure the session is initialized properly when webkit_get_default_session() is called. … … 111 109 } 112 110 113 #else114 int main(int argc, char** argv)115 {116 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");117 return 0;118 }119 120 #endif -
trunk/Source/WebKit/gtk/tests/testhittestresult.c
r143869 r149952 23 23 #include <glib/gstdio.h> 24 24 #include <webkit/webkit.h> 25 26 #if GTK_CHECK_VERSION(2, 14, 0)27 25 28 26 typedef struct { … … 170 168 } 171 169 172 #else173 174 int main(int argc, char** argv)175 {176 g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");177 return 0;178 }179 180 #endif -
trunk/Source/WebKit/gtk/tests/testhttpbackend.c
r143869 r149952 25 25 #include <gtk/gtk.h> 26 26 #include <webkit/webkit.h> 27 28 #if GTK_CHECK_VERSION(2, 14, 0)29 27 30 28 // Not yet public API … … 76 74 return g_test_run (); 77 75 } 78 79 #else80 int main(int argc, char** argv)81 {82 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");83 return 0;84 }85 86 #endif -
trunk/Source/WebKit/gtk/tests/testkeyevents.c
r143869 r149952 27 27 #include <JavaScriptCore/JSContextRef.h> 28 28 29 30 #if GTK_CHECK_VERSION(2, 14, 0)31 32 29 typedef struct { 33 30 char* page; … … 252 249 } 253 250 254 #if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)251 #if defined(GDK_WINDOWING_X11) 255 252 static void test_xim_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data) 256 253 { … … 376 373 test_blocking, 377 374 key_event_fixture_teardown); 378 #if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)375 #if defined(GDK_WINDOWING_X11) 379 376 g_test_add("/webkit/keyevent/xim-textinput", KeyEventFixture, 380 377 test_info_new(textinput_html, TRUE), … … 392 389 } 393 390 394 #else395 396 int main(int argc, char** argv)397 {398 g_critical("You will need at least GTK+ 2.14.0 to run the unit tests.");399 return 0;400 }401 402 #endif -
trunk/Source/WebKit/gtk/tests/testloading.c
r143869 r149952 24 24 #include <string.h> 25 25 #include <webkit/webkit.h> 26 27 #if GTK_CHECK_VERSION(2, 14, 0)28 26 29 27 /* This string has to be rather big because of the cancelled test - it … … 436 434 } 437 435 438 #else439 int main(int argc, char** argv)440 {441 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");442 return 0;443 }444 445 #endif -
trunk/Source/WebKit/gtk/tests/testmimehandling.c
r143869 r149952 29 29 #include <unistd.h> 30 30 31 #if GTK_CHECK_VERSION(2, 14, 0)32 33 31 GMainLoop* loop; 34 32 SoupSession *session; … … 204 202 return g_test_run(); 205 203 } 206 207 #else208 int main(int argc, char** argv)209 {210 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");211 return 0;212 }213 214 #endif -
trunk/Source/WebKit/gtk/tests/testnetworkrequest.c
r143869 r149952 26 26 #include <stdlib.h> 27 27 #include <webkit/webkit.h> 28 29 #if GTK_CHECK_VERSION(2, 14, 0)30 28 31 29 static void test_network_request_create_destroy() … … 97 95 return g_test_run (); 98 96 } 99 100 #else101 int main(int argc, char** argv)102 {103 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");104 return 0;105 }106 107 #endif -
trunk/Source/WebKit/gtk/tests/testnetworkresponse.c
r143869 r149952 27 27 #include <stdlib.h> 28 28 #include <webkit/webkit.h> 29 30 #if GTK_CHECK_VERSION(2, 14, 0)31 29 32 30 static void test_network_response_create_destroy() … … 98 96 return g_test_run (); 99 97 } 100 101 #else102 int main(int argc, char** argv)103 {104 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");105 return 0;106 }107 108 #endif -
trunk/Source/WebKit/gtk/tests/testwebbackforwardlist.c
r143869 r149952 23 23 #include <webkit/webkit.h> 24 24 25 #if GTK_CHECK_VERSION(2, 14, 0)26 27 25 static void test_webkit_web_history_item_lifetime(void) 28 26 { … … 327 325 return g_test_run (); 328 326 } 329 330 #else331 int main(int argc, char** argv)332 {333 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");334 return 0;335 }336 337 #endif -
trunk/Source/WebKit/gtk/tests/testwebdatasource.c
r143869 r149952 23 23 #include <webkit/webkit.h> 24 24 25 #if GTK_CHECK_VERSION(2, 14, 0)26 27 25 static const gshort defaultTimeout = 10; 28 26 guint waitTimer; … … 243 241 return g_test_run (); 244 242 } 245 246 #else247 int main(int argc, char** argv)248 {249 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");250 return 0;251 }252 253 #endif -
trunk/Source/WebKit/gtk/tests/testwebframe.c
r143869 r149952 27 27 #include <webkit/webkit.h> 28 28 29 #if GTK_CHECK_VERSION(2, 14, 0)30 31 29 static int numberOfFramesCreated = 0; 32 30 … … 221 219 return g_test_run (); 222 220 } 223 224 #else225 int main(int argc, char** argv)226 {227 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");228 return 0;229 }230 231 #endif -
trunk/Source/WebKit/gtk/tests/testwebhistoryitem.c
r143869 r149952 22 22 #include <gtk/gtk.h> 23 23 #include <webkit/webkit.h> 24 25 #if GTK_CHECK_VERSION(2, 14, 0)26 24 27 25 typedef struct { … … 71 69 return g_test_run (); 72 70 } 73 74 #else75 int main(int argc, char** argv)76 {77 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");78 return 0;79 }80 81 #endif -
trunk/Source/WebKit/gtk/tests/testwebinspector.c
r143869 r149952 25 25 #include <gtk/gtk.h> 26 26 #include <webkit/webkit.h> 27 28 #if GTK_CHECK_VERSION(2, 14, 0)29 27 30 28 GMainLoop *loop; … … 173 171 return g_test_run(); 174 172 } 175 176 #else177 int main(int argc, char** argv)178 {179 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");180 return 0;181 }182 183 #endif -
trunk/Source/WebKit/gtk/tests/testwebplugindatabase.c
r143869 r149952 24 24 #include <gtk/gtk.h> 25 25 #include <webkit/webkit.h> 26 27 #if GTK_CHECK_VERSION(2, 14, 0)28 26 29 27 /* This function is not public, so we need an extern declaration */ … … 79 77 return g_test_run (); 80 78 } 81 82 #else83 int main(int argc, char** argv)84 {85 g_critical("You will need at least gtk-2.14.0 to run the unit tests. Doing nothing now.");86 return 0;87 }88 89 #endif -
trunk/Source/WebKit/gtk/tests/testwebresource.c
r143869 r149952 25 25 #include <webkit/webkit.h> 26 26 27 #if GTK_CHECK_VERSION(2, 14, 0)28 29 27 #define INDEX_HTML "<html></html>" 30 28 #define MAIN_HTML "<html><head><script language=\"javascript\" src=\"/javascript.js\"></script></head><body><h1>hah</h1></html>" … … 332 330 return g_test_run (); 333 331 } 334 335 #else336 int main(int argc, char** argv)337 {338 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");339 return 0;340 }341 342 #endif -
trunk/Source/WebKit/gtk/tests/testwebsettings.c
r143869 r149952 22 22 #include <gtk/gtk.h> 23 23 #include <webkit/webkit.h> 24 25 #if GTK_CHECK_VERSION(2, 14, 0)26 24 27 25 /* Private API */ … … 154 152 return g_test_run (); 155 153 } 156 157 #else158 int main(int argc, char **argv)159 {160 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");161 return 0;162 }163 164 #endif -
trunk/Source/WebKit/gtk/tests/testwebview.c
r143869 r149952 34 34 #include <webkit/webkit.h> 35 35 36 #if GTK_CHECK_VERSION(2, 14, 0)37 38 36 GMainLoop* loop; 39 37 SoupSession *session; … … 725 723 return g_test_run (); 726 724 } 727 728 #else729 int main(int argc, char** argv)730 {731 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");732 return 0;733 }734 735 #endif -
trunk/Source/WebKit/gtk/tests/testwindow.c
r143869 r149952 21 21 #include <gtk/gtk.h> 22 22 #include <webkit/webkit.h> 23 24 #if GTK_CHECK_VERSION(2, 14, 0)25 23 26 24 static void notify_load_status_cb(WebKitWebView* web_view, GParamSpec* pspec, gpointer data) … … 120 118 return g_test_run (); 121 119 } 122 123 #else124 int main(int argc, char** argv)125 {126 g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");127 return 0;128 }129 130 #endif -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r149371 r149952 964 964 965 965 GtkAllocation allocation; 966 #if GTK_CHECK_VERSION(2, 18, 0)967 966 gtk_widget_get_allocation(widget, &allocation); 968 #else969 allocation = widget->allocation;970 #endif971 967 972 968 GdkWindowAttr attributes; … … 1007 1003 1008 1004 #ifdef GTK_API_VERSION_2 1009 #if GTK_CHECK_VERSION(2, 20, 0)1010 1005 gtk_widget_style_attach(widget); 1011 #else1012 widget->style = gtk_style_attach(gtk_widget_get_style(widget), window);1013 #endif1014 1006 gtk_style_set_background(gtk_widget_get_style(widget), window, GTK_STATE_NORMAL); 1015 1007 #else … … 1588 1580 #endif // ENABLE(DRAG_SUPPORT) 1589 1581 1590 #if GTK_CHECK_VERSION(2, 12, 0)1591 1582 static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip) 1592 1583 { … … 1645 1636 return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->show_help(widget, help_type); 1646 1637 } 1647 #endif1648 1638 1649 1639 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) … … 3118 3108 widgetClass->drag_data_received = NULL; 3119 3109 #endif 3120 #if GTK_CHECK_VERSION(2, 12, 0)3121 3110 widgetClass->query_tooltip = webkit_web_view_query_tooltip; 3122 3111 widgetClass->show_help = webkit_web_view_show_help; 3123 #endif3124 3112 widgetClass->map = webkitWebViewMap; 3125 3113 … … 5292 5280 void webkit_web_view_set_tooltip_text(WebKitWebView* webView, const char* tooltip) 5293 5281 { 5294 #if GTK_CHECK_VERSION(2, 12, 0)5295 5282 WebKitWebViewPrivate* priv = webView->priv; 5296 5283 if (tooltip && *tooltip != '\0') { … … 5303 5290 5304 5291 gtk_widget_trigger_tooltip_query(GTK_WIDGET(webView)); 5305 #else5306 // TODO: Support older GTK+ versions5307 // See http://bugs.webkit.org/show_bug.cgi?id=157935308 notImplemented();5309 #endif5310 5292 } 5311 5293 -
trunk/Source/WebKit2/ChangeLog
r149945 r149952 1 2013-05-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs 4 https://bugs.webkit.org/show_bug.cgi?id=115914 5 6 Reviewed by Martin Robinson. 7 8 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 9 (webkitWebViewBaseRealize): 10 1 11 2013-05-12 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 12 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r148351 r149952 246 246 | GDK_BUTTON_RELEASE_MASK 247 247 | GDK_SCROLL_MASK 248 #if GTK_CHECK_VERSION(3, 3, 18)249 248 | GDK_SMOOTH_SCROLL_MASK 250 #endif251 249 | GDK_POINTER_MOTION_MASK 252 250 | GDK_KEY_PRESS_MASK -
trunk/Tools/ChangeLog
r149933 r149952 1 2013-05-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs 4 https://bugs.webkit.org/show_bug.cgi?id=115914 5 6 Reviewed by Martin Robinson. 7 8 * GtkLauncher/main.c: 9 (createToolbar): 10 * MiniBrowser/gtk/BrowserWindow.c: 11 (_BrowserWindow): 12 (browserWindowSetStatusText): 13 (fullScreenMessageTimeoutCallback): 14 (webViewEnterFullScreen): 15 (webViewLeaveFullScreen): 16 (browserWindowFinalize): 17 (browserWindowConstructed): 18 * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: 19 (WTR::EventSenderProxy::mouseScrollBy): 20 (WTR::EventSenderProxy::continuousMouseScrollBy): 21 1 22 2013-05-11 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Tools/GtkLauncher/main.c
r146019 r149952 265 265 GtkWidget *toolbar = gtk_toolbar_new(); 266 266 267 #if GTK_CHECK_VERSION(2, 15, 0)268 267 gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL); 269 #else270 gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);271 #endif272 268 gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ); 273 269 -
trunk/Tools/MiniBrowser/gtk/BrowserWindow.c
r147624 r149952 53 53 GtkWidget *downloadsBar; 54 54 GdkPixbuf *favicon; 55 #if GTK_CHECK_VERSION(3, 2, 0)56 55 GtkWidget *fullScreenMessageLabel; 57 56 guint fullScreenMessageLabelId; 58 #endif59 57 }; 60 58 … … 92 90 static void browserWindowSetStatusText(BrowserWindow *window, const char *text) 93 91 { 94 #if GTK_CHECK_VERSION(3, 2, 0)95 92 gtk_label_set_text(GTK_LABEL(window->statusLabel), text); 96 93 gtk_widget_set_visible(window->statusLabel, !!text); 97 #endif98 94 } 99 95 … … 287 283 } 288 284 289 #if GTK_CHECK_VERSION(3, 2, 0)290 285 static gboolean fullScreenMessageTimeoutCallback(BrowserWindow *window) 291 286 { … … 294 289 return FALSE; 295 290 } 296 #endif297 291 298 292 static gboolean webViewEnterFullScreen(WebKitWebView *webView, BrowserWindow *window) 299 293 { 300 #if GTK_CHECK_VERSION(3, 2, 0)301 294 gchar *titleOrURI = g_strdup(webkit_web_view_get_title(window->webView)); 302 295 if (!titleOrURI) … … 310 303 311 304 window->fullScreenMessageLabelId = g_timeout_add_seconds(2, (GSourceFunc)fullScreenMessageTimeoutCallback, window); 312 #endif313 314 305 gtk_widget_hide(window->toolbar); 315 306 … … 319 310 static gboolean webViewLeaveFullScreen(WebKitWebView *webView, BrowserWindow *window) 320 311 { 321 #if GTK_CHECK_VERSION(3, 2, 0)322 312 if (window->fullScreenMessageLabelId) { 323 313 g_source_remove(window->fullScreenMessageLabelId); … … 325 315 } 326 316 gtk_widget_hide(window->fullScreenMessageLabel); 327 #endif328 329 317 gtk_widget_show(window->toolbar); 330 318 … … 467 455 } 468 456 469 #if GTK_CHECK_VERSION(3, 2, 0)470 457 if (window->fullScreenMessageLabelId) 471 458 g_source_remove(window->fullScreenMessageLabelId); 472 #endif473 459 474 460 G_OBJECT_CLASS(browser_window_parent_class)->finalize(gObject); … … 597 583 g_signal_connect(backForwadlist, "changed", G_CALLBACK(backForwadlistChanged), window); 598 584 599 #if GTK_CHECK_VERSION(3, 2, 0)600 585 GtkWidget *overlay = gtk_overlay_new(); 601 586 gtk_box_pack_start(GTK_BOX(window->mainBox), overlay, TRUE, TRUE, 0); … … 618 603 gtk_widget_set_no_show_all(window->fullScreenMessageLabel, TRUE); 619 604 gtk_overlay_add_overlay(GTK_OVERLAY(overlay), window->fullScreenMessageLabel); 620 #else621 gtk_box_pack_start(GTK_BOX(window->mainBox), GTK_WIDGET(window->webView), TRUE, TRUE, 0);622 #endif623 605 gtk_widget_show(GTK_WIDGET(window->webView)); 624 606 } -
trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
r133676 r149952 388 388 389 389 // For more than one tick in a scroll, we need smooth scroll event 390 #if GTK_CHECK_VERSION(3, 3, 18)391 390 if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) { 392 391 event->scroll.direction = GDK_SCROLL_SMOOTH; … … 397 396 return; 398 397 } 399 #endif400 398 401 399 if (horizontal < 0) … … 418 416 g_return_if_fail(!paged); 419 417 420 #if GTK_CHECK_VERSION(3, 3, 18)421 418 GdkEvent* event = gdk_event_new(GDK_SCROLL); 422 419 event->scroll.x = m_position.x; … … 432 429 433 430 sendOrQueueEvent(event); 434 #endif435 431 } 436 432
Note: See TracChangeset
for help on using the changeset viewer.