summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/GtkVersioning.c
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-30 15:42:16 +0100
committerSteve Block <steveblock@google.com>2010-10-07 10:59:29 +0100
commitbec39347bb3bb5bf1187ccaf471d26247f28b585 (patch)
tree56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/platform/gtk/GtkVersioning.c
parent90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff)
downloadexternal_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/platform/gtk/GtkVersioning.c')
-rw-r--r--WebCore/platform/gtk/GtkVersioning.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/WebCore/platform/gtk/GtkVersioning.c b/WebCore/platform/gtk/GtkVersioning.c
index 7dd601e..f5466be 100644
--- a/WebCore/platform/gtk/GtkVersioning.c
+++ b/WebCore/platform/gtk/GtkVersioning.c
@@ -60,10 +60,41 @@ GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
}
#if !GTK_CHECK_VERSION(2, 17, 3)
-static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
+void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
{
gdk_window_get_root_origin(window, rootX, rootY);
*rootX = *rootX + x;
*rootY = *rootY + y;
}
#endif
+
+GdkCursor * blankCursor()
+{
+#if GTK_CHECK_VERSION(2, 16, 0)
+ return gdk_cursor_new(GDK_BLANK_CURSOR);
+#else
+ GdkCursor * cursor;
+ GdkPixmap * source;
+ GdkPixmap * mask;
+ GdkColor foreground = { 0, 65535, 0, 0 }; // Red.
+ GdkColor background = { 0, 0, 0, 65535 }; // Blue.
+ static gchar cursorBits[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+
+ source = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+ mask = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+ cursor = gdk_cursor_new_from_pixmap(source, mask, &foreground, &background, 8, 8);
+ gdk_pixmap_unref(source);
+ gdk_pixmap_unref(mask);
+ return cursor;
+#endif // GTK_CHECK_VERSION(2, 16, 0)
+}
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+const gchar* gtk_menu_item_get_label(GtkMenuItem* menuItem)
+{
+ GtkWidget * label = gtk_bin_get_child(GTK_BIN(menuItem));
+ if (GTK_IS_LABEL(label))
+ return gtk_label_get_text(GTK_LABEL(label));
+ return 0;
+}
+#endif // GTK_CHECK_VERSION(2, 16, 0)