diff options
author | Steve Block <steveblock@google.com> | 2010-08-27 11:02:25 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-02 17:17:20 +0100 |
commit | e8b154fd68f9b33be40a3590e58347f353835f5c (patch) | |
tree | 0733ce26384183245aaa5656af26c653636fe6c1 /WebCore/platform/gtk | |
parent | da56157816334089526a7a115a85fd85a6e9a1dc (diff) | |
download | external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2 |
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebCore/platform/gtk')
-rw-r--r-- | WebCore/platform/gtk/ClipboardGtk.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/CursorGtk.cpp | 70 | ||||
-rw-r--r-- | WebCore/platform/gtk/CursorGtk.h | 50 | ||||
-rw-r--r-- | WebCore/platform/gtk/DataObjectGtk.h | 4 | ||||
-rw-r--r-- | WebCore/platform/gtk/GRefPtrGtk.cpp | 8 | ||||
-rw-r--r-- | WebCore/platform/gtk/GRefPtrGtk.h | 8 | ||||
-rw-r--r-- | WebCore/platform/gtk/GtkVersioning.h | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/PasteboardGtk.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/PasteboardHelper.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/PopupMenuGtk.h | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/RenderThemeGtk.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/gtk/RenderThemeGtk.h | 2 | ||||
-rw-r--r-- | WebCore/platform/gtk/ScrollViewGtk.cpp | 18 | ||||
-rw-r--r-- | WebCore/platform/gtk/ScrollbarGtk.cpp | 18 | ||||
-rw-r--r-- | WebCore/platform/gtk/gtk2drawing.c | 54 | ||||
-rw-r--r-- | WebCore/platform/gtk/gtkdrawing.h | 3 |
16 files changed, 163 insertions, 88 deletions
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp index 21ebe4c..b2c32a4 100644 --- a/WebCore/platform/gtk/ClipboardGtk.cpp +++ b/WebCore/platform/gtk/ClipboardGtk.cpp @@ -330,7 +330,7 @@ void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, c if (!image || !image->isLoaded()) return; - GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->image()->getGdkPixbuf()); + PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->image()->getGdkPixbuf()); if (!pixbuf) return; diff --git a/WebCore/platform/gtk/CursorGtk.cpp b/WebCore/platform/gtk/CursorGtk.cpp index 41b0800..d1f1293 100644 --- a/WebCore/platform/gtk/CursorGtk.cpp +++ b/WebCore/platform/gtk/CursorGtk.cpp @@ -37,25 +37,39 @@ namespace WebCore { -static GRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType) +static GdkPixmap* createPixmapFromBits(const unsigned char* bits, const IntSize& size) +{ + cairo_surface_t* dataSurface = cairo_image_surface_create_for_data(const_cast<unsigned char*>(bits), CAIRO_FORMAT_A1, size.width(), size.height(), size.width() / 8); + GdkPixmap* pixmap = gdk_pixmap_new(0, size.width(), size.height(), 1); + cairo_t* cr = gdk_cairo_create(pixmap); + cairo_set_source_surface(cr, dataSurface, 0, 0); + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_paint(cr); + cairo_destroy(cr); + cairo_surface_destroy(dataSurface); + return pixmap; +} + +static PlatformRefPtr<GdkCursor> createNamedCursor(CustomCursorType cursorType) { CustomCursor cursor = CustomCursors[cursorType]; - GRefPtr<GdkCursor> c = adoptGRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name)); + PlatformRefPtr<GdkCursor> c = adoptPlatformRef(gdk_cursor_new_from_name(gdk_display_get_default(), cursor.name)); if (c) return c; const GdkColor fg = { 0, 0, 0, 0 }; const GdkColor bg = { 65535, 65535, 65535, 65535 }; - GRefPtr<GdkPixmap> source = adoptGRef(gdk_bitmap_create_from_data(0, cursor.bits, 32, 32)); - GRefPtr<GdkPixmap> mask = adoptGRef(gdk_bitmap_create_from_data(0, cursor.mask_bits, 32, 32)); - return adoptGRef(gdk_cursor_new_from_pixmap(source.get(), mask.get(), &fg, &bg, cursor.hot_x, cursor.hot_y)); + IntSize cursorSize = IntSize(32, 32); + PlatformRefPtr<GdkPixmap> source = adoptPlatformRef(createPixmapFromBits(cursor.bits, cursorSize)); + PlatformRefPtr<GdkPixmap> mask = adoptPlatformRef(createPixmapFromBits(cursor.mask_bits, cursorSize)); + return adoptPlatformRef(gdk_cursor_new_from_pixmap(source.get(), mask.get(), &fg, &bg, cursor.hot_x, cursor.hot_y)); } -static GRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot) +static PlatformRefPtr<GdkCursor> createCustomCursor(Image* image, const IntPoint& hotSpot) { IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot); - GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf()); - return adoptGRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y())); + PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf()); + return adoptPlatformRef(gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf.get(), effectiveHotSpot.x(), effectiveHotSpot.y())); } void Cursor::ensurePlatformCursor() const @@ -69,77 +83,77 @@ void Cursor::ensurePlatformCursor() const m_platformCursor = 0; break; case Cursor::Cross: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_CROSS)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_CROSS)); break; case Cursor::Hand: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_HAND2)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_HAND2)); break; case Cursor::IBeam: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_XTERM)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_XTERM)); break; case Cursor::Wait: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_WATCH)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_WATCH)); break; case Cursor::Help: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_QUESTION_ARROW)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_QUESTION_ARROW)); break; case Cursor::Move: case Cursor::MiddlePanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_FLEUR)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_FLEUR)); break; case Cursor::EastResize: case Cursor::EastPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_RIGHT_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_RIGHT_SIDE)); break; case Cursor::NorthResize: case Cursor::NorthPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_SIDE)); break; case Cursor::NorthEastResize: case Cursor::NorthEastPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE)); break; case Cursor::NorthWestResize: case Cursor::NorthWestPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_LEFT_CORNER)); break; case Cursor::SouthResize: case Cursor::SouthPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_SIDE)); break; case Cursor::SouthEastResize: case Cursor::SouthEastPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER)); break; case Cursor::SouthWestResize: case Cursor::SouthWestPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER)); break; case Cursor::WestResize: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE)); break; case Cursor::NorthSouthResize: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_TOP_TEE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_TOP_TEE)); break; case Cursor::EastWestResize: case Cursor::WestPanning: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_LEFT_SIDE)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_LEFT_SIDE)); break; case Cursor::NorthEastSouthWestResize: case Cursor::NorthWestSouthEastResize: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SIZING)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SIZING)); break; case Cursor::ColumnResize: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW)); break; case Cursor::RowResize: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW)); break; case Cursor::VerticalText: m_platformCursor = createNamedCursor(CustomCursorVerticalText); break; case Cursor::Cell: - m_platformCursor = adoptGRef(gdk_cursor_new(GDK_PLUS)); + m_platformCursor = adoptPlatformRef(gdk_cursor_new(GDK_PLUS)); break; case Cursor::ContextMenu: m_platformCursor = createNamedCursor(CustomCursorContextMenu); diff --git a/WebCore/platform/gtk/CursorGtk.h b/WebCore/platform/gtk/CursorGtk.h index 85aaefa..568919b 100644 --- a/WebCore/platform/gtk/CursorGtk.h +++ b/WebCore/platform/gtk/CursorGtk.h @@ -47,7 +47,7 @@ */ /* MOZ_CURSOR_VERTICAL_TEXT */ -static const char moz_vertical_text_bits[] = { +static const unsigned char moz_vertical_text_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -60,7 +60,7 @@ static const char moz_vertical_text_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_vertical_text_mask_bits[] = { +static const unsigned char moz_vertical_text_mask_bits[] = { 0x07, 0xe0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, @@ -74,7 +74,7 @@ static const char moz_vertical_text_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_CONTEXT_MENU */ -static const char moz_menu_bits[] = { +static const unsigned char moz_menu_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0xfd, 0x00, 0x00, @@ -87,7 +87,7 @@ static const char moz_menu_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_menu_mask_bits[] = { +static const unsigned char moz_menu_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0xfd, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, @@ -101,7 +101,7 @@ static const char moz_menu_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_COPY */ -static const char moz_copy_bits[] = { +static const unsigned char moz_copy_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, @@ -114,7 +114,7 @@ static const char moz_copy_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_copy_mask_bits[] = { +static const unsigned char moz_copy_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, @@ -128,7 +128,7 @@ static const char moz_copy_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_ALIAS */ -static const char moz_alias_bits[] = { +static const unsigned char moz_alias_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, @@ -141,7 +141,7 @@ static const char moz_alias_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_alias_mask_bits[] = { +static const unsigned char moz_alias_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, @@ -155,7 +155,7 @@ static const char moz_alias_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_ZOOM_IN */ -static const char moz_zoom_in_bits[] = { +static const unsigned char moz_zoom_in_bits[] = { 0xf0, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x62, 0x04, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0x62, 0x04, 0x00, 0x00, @@ -168,7 +168,7 @@ static const char moz_zoom_in_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_zoom_in_mask_bits[] = { +static const unsigned char moz_zoom_in_mask_bits[] = { 0xf0, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, @@ -182,7 +182,7 @@ static const char moz_zoom_in_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_ZOOM_OUT */ -static const char moz_zoom_out_bits[] = { +static const unsigned char moz_zoom_out_bits[] = { 0xf0, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00, 0xf9, 0x09, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, @@ -195,7 +195,7 @@ static const char moz_zoom_out_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_zoom_out_mask_bits[] = { +static const unsigned char moz_zoom_out_mask_bits[] = { 0xf0, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, @@ -209,7 +209,7 @@ static const char moz_zoom_out_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_NOT_ALLOWED */ -static const char moz_not_allowed_bits[] = { +static const unsigned char moz_not_allowed_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x38, 0xc0, 0x01, 0x00, 0x7c, 0x80, 0x03, 0x00, 0xec, 0x00, 0x03, 0x00, 0xce, 0x01, 0x07, 0x00, 0x86, 0x03, 0x06, 0x00, @@ -222,7 +222,7 @@ static const char moz_not_allowed_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_not_allowed_mask_bits[] = { +static const unsigned char moz_not_allowed_mask_bits[] = { 0x80, 0x1f, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0xfc, 0xf0, 0x03, 0x00, 0xfe, 0xc0, 0x07, 0x00, 0xfe, 0x81, 0x07, 0x00, 0xff, 0x83, 0x0f, 0x00, 0xcf, 0x07, 0x0f, 0x00, @@ -236,7 +236,7 @@ static const char moz_not_allowed_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_SPINNING */ -static const char moz_spinning_bits[] = { +static const unsigned char moz_spinning_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, @@ -249,7 +249,7 @@ static const char moz_spinning_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_spinning_mask_bits[] = { +static const unsigned char moz_spinning_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x3b, 0x00, 0x00, @@ -263,7 +263,7 @@ static const char moz_spinning_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_NONE */ -static const char moz_none_bits[] = { +static const unsigned char moz_none_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -276,7 +276,7 @@ static const char moz_none_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_none_mask_bits[] = { +static const unsigned char moz_none_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -290,7 +290,7 @@ static const char moz_none_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_HAND_GRAB */ -static const char moz_hand_grab_bits[] = { +static const unsigned char moz_hand_grab_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x60, 0x39, 0x00, 0x00, 0x90, 0x49, 0x00, 0x00, 0x90, 0x49, 0x01, 0x00, 0x20, 0xc9, 0x02, 0x00, 0x20, 0x49, 0x02, 0x00, 0x58, 0x40, 0x02, 0x00, @@ -303,7 +303,7 @@ static const char moz_hand_grab_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_hand_grab_mask_bits[] = { +static const unsigned char moz_hand_grab_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x60, 0x3f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0xf8, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf8, 0xff, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00, @@ -317,7 +317,7 @@ static const char moz_hand_grab_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* MOZ_CURSOR_HAND_GRABBING */ -static const char moz_hand_grabbing_bits[] = { +static const unsigned char moz_hand_grabbing_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x36, 0x00, 0x00, 0x20, 0xc9, 0x00, 0x00, 0x20, 0x40, 0x01, 0x00, @@ -330,7 +330,7 @@ static const char moz_hand_grabbing_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const char moz_hand_grabbing_mask_bits[] = { +static const unsigned char moz_hand_grabbing_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x36, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00, @@ -359,8 +359,8 @@ enum CustomCursorType { typedef struct { const char* name; - const char* bits; - const char* mask_bits; + const unsigned char* bits; + const unsigned char* mask_bits; int hot_x; int hot_y; } CustomCursor; @@ -374,7 +374,7 @@ static const CustomCursor CustomCursors[] = { { "zoom-out", moz_zoom_out_bits, moz_zoom_out_mask_bits, 6, 6 }, { "vertical-text", moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4 }, { "dnd-no-drop", moz_not_allowed_bits, moz_not_allowed_mask_bits, 9, 9 }, - { "progress", moz_spinning_bits, moz_spinning_mask_bits, 2, 2}, + { "left_ptr_watch", moz_spinning_bits, moz_spinning_mask_bits, 2, 2}, { "none", moz_none_bits, moz_none_mask_bits, 0, 0 }, { "grab", moz_hand_grab_bits, moz_hand_grab_mask_bits, 10, 10 }, { "grabbing", moz_hand_grabbing_bits, moz_hand_grabbing_mask_bits, 10, 10 } diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h index a7d8baf..6f7149c 100644 --- a/WebCore/platform/gtk/DataObjectGtk.h +++ b/WebCore/platform/gtk/DataObjectGtk.h @@ -73,8 +73,8 @@ private: String m_text; String m_markup; Vector<KURL> m_uriList; - GRefPtr<GdkPixbuf> m_image; - GRefPtr<GdkDragContext> m_dragContext; + PlatformRefPtr<GdkPixbuf> m_image; + PlatformRefPtr<GdkDragContext> m_dragContext; RefPtr<Range> m_range; }; diff --git a/WebCore/platform/gtk/GRefPtrGtk.cpp b/WebCore/platform/gtk/GRefPtrGtk.cpp index 6647b99..83129cc 100644 --- a/WebCore/platform/gtk/GRefPtrGtk.cpp +++ b/WebCore/platform/gtk/GRefPtrGtk.cpp @@ -25,27 +25,27 @@ namespace WTF { -template <> GtkTargetList* refGPtr(GtkTargetList* ptr) +template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr) { if (ptr) gtk_target_list_ref(ptr); return ptr; } -template <> void derefGPtr(GtkTargetList* ptr) +template <> void derefPlatformPtr(GtkTargetList* ptr) { if (ptr) gtk_target_list_unref(ptr); } -template <> GdkCursor* refGPtr(GdkCursor* ptr) +template <> GdkCursor* refPlatformPtr(GdkCursor* ptr) { if (ptr) gdk_cursor_ref(ptr); return ptr; } -template <> void derefGPtr(GdkCursor* ptr) +template <> void derefPlatformPtr(GdkCursor* ptr) { if (ptr) gdk_cursor_unref(ptr); diff --git a/WebCore/platform/gtk/GRefPtrGtk.h b/WebCore/platform/gtk/GRefPtrGtk.h index 77941f5..ea1b089 100644 --- a/WebCore/platform/gtk/GRefPtrGtk.h +++ b/WebCore/platform/gtk/GRefPtrGtk.h @@ -28,11 +28,11 @@ typedef struct _GdkCursor GdkCursor; namespace WTF { -template <> GtkTargetList* refGPtr(GtkTargetList* ptr); -template <> void derefGPtr(GtkTargetList* ptr); +template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr); +template <> void derefPlatformPtr(GtkTargetList* ptr); -template <> GdkCursor* refGPtr(GdkCursor* ptr); -template <> void derefGPtr(GdkCursor* ptr); +template <> GdkCursor* refPlatformPtr(GdkCursor* ptr); +template <> void derefPlatformPtr(GdkCursor* ptr); } diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h index 6b45228..34e6081 100644 --- a/WebCore/platform/gtk/GtkVersioning.h +++ b/WebCore/platform/gtk/GtkVersioning.h @@ -47,6 +47,8 @@ #define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE) #define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window) #define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS) +#define gtk_widget_get_allocation(widget, alloc) (*(alloc) = (widget)->allocation) +#define gtk_widget_set_allocation(widget, alloc) ((widget)->allocation = *(alloc)) #endif // GTK_CHECK_VERSION(2, 18, 0) #if !GTK_CHECK_VERSION(2, 14, 0) diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp index a0069cf..ddb9768 100644 --- a/WebCore/platform/gtk/PasteboardGtk.cpp +++ b/WebCore/platform/gtk/PasteboardGtk.cpp @@ -103,7 +103,7 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&) Image* image = cachedImage->image(); ASSERT(image); - GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->getGdkPixbuf()); + PlatformRefPtr<GdkPixbuf> pixbuf = adoptPlatformRef(image->getGdkPixbuf()); DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); dataObject->setImage(pixbuf.get()); m_helper->writeClipboardContents(clipboard); diff --git a/WebCore/platform/gtk/PasteboardHelper.cpp b/WebCore/platform/gtk/PasteboardHelper.cpp index 2babe91..95df25f 100644 --- a/WebCore/platform/gtk/PasteboardHelper.cpp +++ b/WebCore/platform/gtk/PasteboardHelper.cpp @@ -245,7 +245,7 @@ Vector<GdkAtom> PasteboardHelper::dropAtomsForContext(GtkWidget* widget, GdkDrag dropAtoms.append(netscapeURLAtom); // For images, try to find the most applicable image type. - GRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0)); + PlatformRefPtr<GtkTargetList> list(gtk_target_list_new(0, 0)); gtk_target_list_add_image_targets(list.get(), getIdForTargetType(TargetTypeImage), TRUE); GdkAtom atom = gtk_drag_dest_find_target(widget, context, list.get()); if (atom != GDK_NONE) diff --git a/WebCore/platform/gtk/PopupMenuGtk.h b/WebCore/platform/gtk/PopupMenuGtk.h index fb4e7dd..d63e6d9 100644 --- a/WebCore/platform/gtk/PopupMenuGtk.h +++ b/WebCore/platform/gtk/PopupMenuGtk.h @@ -58,7 +58,7 @@ private: PopupMenuClient* m_popupClient; IntPoint m_menuPosition; - GRefPtr<GtkMenu> m_popup; + PlatformRefPtr<GtkMenu> m_popup; HashMap<GtkWidget*, int> m_indexMap; }; diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp index 36fccf0..5019f35 100644 --- a/WebCore/platform/gtk/RenderThemeGtk.cpp +++ b/WebCore/platform/gtk/RenderThemeGtk.cpp @@ -148,7 +148,7 @@ RenderThemeGtk::RenderThemeGtk() , m_pauseButton(0) , m_seekBackButton(0) , m_seekForwardButton(0) - , m_partsTable(adoptGRef(g_hash_table_new_full(0, 0, 0, g_free))) + , m_partsTable(adoptPlatformRef(g_hash_table_new_full(0, 0, 0, g_free))) { if (!mozGtkRefCount) { moz_gtk_init(); @@ -317,7 +317,7 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp else if (type == MOZ_GTK_CHECKBUTTON || type == MOZ_GTK_RADIOBUTTON) flags = theme->isChecked(o); - GRefPtr<GdkDrawable> drawable(i.context->gdkDrawable()); + PlatformRefPtr<GdkDrawable> drawable(i.context->gdkDrawable()); GdkRectangle paintRect, clipRect; if (drawable) { AffineTransform ctm = i.context->getCTM(); @@ -342,7 +342,7 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp // In some situations, like during print previews, this GraphicsContext is not // backed by a GdkDrawable. In those situations, we render onto a pixmap and then // copy the rendered data back to the GraphicsContext via Cairo. - drawable = adoptGRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_depth(gdk_visual_get_system()))); + drawable = adoptPlatformRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_depth(gdk_visual_get_system()))); paintRect = clipRect = IntRect(0, 0, rect.width(), rect.height()); } diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h index 71338d4..b9c076d 100644 --- a/WebCore/platform/gtk/RenderThemeGtk.h +++ b/WebCore/platform/gtk/RenderThemeGtk.h @@ -190,7 +190,7 @@ private: RefPtr<Image> m_seekBackButton; RefPtr<Image> m_seekForwardButton; Page* m_page; - GRefPtr<GHashTable> m_partsTable; + PlatformRefPtr<GHashTable> m_partsTable; }; diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp index 871a0bf..565123c 100644 --- a/WebCore/platform/gtk/ScrollViewGtk.cpp +++ b/WebCore/platform/gtk/ScrollViewGtk.cpp @@ -65,12 +65,20 @@ void ScrollView::platformDestroy() PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation) { - if (orientation == HorizontalScrollbar && m_horizontalAdjustment) - return ScrollbarGtk::createScrollbar(this, orientation, m_horizontalAdjustment); - else if (orientation == VerticalScrollbar && m_verticalAdjustment) - return ScrollbarGtk::createScrollbar(this, orientation, m_verticalAdjustment); - else + // If this is an interior frame scrollbar, we want to create a scrollbar without + // passing a GtkAdjustment. This will cause the Scrollbar to create a native GTK+ + // scrollbar. + if (parent()) return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar); + + // If this is the main frame, we want to create a Scrollbar that does no painting + // and defers to our GtkAdjustment for all of its state. Note that the GtkAdjustment + // may be null here. + if (orientation == HorizontalScrollbar) + return ScrollbarGtk::createScrollbar(this, orientation, m_horizontalAdjustment); + + // VerticalScrollbar + return ScrollbarGtk::createScrollbar(this, orientation, m_verticalAdjustment); } /* diff --git a/WebCore/platform/gtk/ScrollbarGtk.cpp b/WebCore/platform/gtk/ScrollbarGtk.cpp index 3b86ec9..8a1c4fa 100644 --- a/WebCore/platform/gtk/ScrollbarGtk.cpp +++ b/WebCore/platform/gtk/ScrollbarGtk.cpp @@ -81,8 +81,10 @@ ScrollbarGtk::ScrollbarGtk(ScrollbarClient* client, ScrollbarOrientation orienta : Scrollbar(client, orientation, RegularScrollbar) , m_adjustment(adjustment) { - g_object_ref(m_adjustment); - g_signal_connect(m_adjustment, "value-changed", G_CALLBACK(ScrollbarGtk::gtkValueChanged), this); + if (m_adjustment) { + g_object_ref(m_adjustment); + g_signal_connect(m_adjustment, "value-changed", G_CALLBACK(ScrollbarGtk::gtkValueChanged), this); + } // We have nothing to show as we are solely operating on the GtkAdjustment resize(0, 0); @@ -104,8 +106,10 @@ void ScrollbarGtk::attachAdjustment(GtkAdjustment* adjustment) m_adjustment = adjustment; - g_object_ref(m_adjustment); - g_signal_connect(m_adjustment, "value-changed", G_CALLBACK(ScrollbarGtk::gtkValueChanged), this); + if (m_adjustment) { + g_object_ref(m_adjustment); + g_signal_connect(m_adjustment, "value-changed", G_CALLBACK(ScrollbarGtk::gtkValueChanged), this); + } updateThumbProportion(); updateThumbPosition(); @@ -156,12 +160,18 @@ void ScrollbarGtk::frameRectsChanged() void ScrollbarGtk::updateThumbPosition() { + if (!m_adjustment) + return; + if (gtk_adjustment_get_value(m_adjustment) != m_currentPos) gtk_adjustment_set_value(m_adjustment, m_currentPos); } void ScrollbarGtk::updateThumbProportion() { + if (!m_adjustment) + return; + gtk_adjustment_configure(m_adjustment, gtk_adjustment_get_value(m_adjustment), gtk_adjustment_get_lower(m_adjustment), diff --git a/WebCore/platform/gtk/gtk2drawing.c b/WebCore/platform/gtk/gtk2drawing.c index 80e2c2a..349bde0 100644 --- a/WebCore/platform/gtk/gtk2drawing.c +++ b/WebCore/platform/gtk/gtk2drawing.c @@ -732,6 +732,7 @@ ConvertGtkState(GtkWidgetState* state) return GTK_STATE_NORMAL; } +#ifdef GTK_API_VERSION_2 static gint TSOffsetStyleGCArray(GdkGC** gcs, gint xorigin, gint yorigin) { @@ -741,10 +742,12 @@ TSOffsetStyleGCArray(GdkGC** gcs, gint xorigin, gint yorigin) gdk_gc_set_ts_origin(gcs[i], xorigin, yorigin); return MOZ_GTK_SUCCESS; } +#endif static gint TSOffsetStyleGCs(GtkStyle* style, gint xorigin, gint yorigin) { +#ifdef GTK_API_VERSION_2 TSOffsetStyleGCArray(style->fg_gc, xorigin, yorigin); TSOffsetStyleGCArray(style->bg_gc, xorigin, yorigin); TSOffsetStyleGCArray(style->light_gc, xorigin, yorigin); @@ -754,6 +757,7 @@ TSOffsetStyleGCs(GtkStyle* style, gint xorigin, gint yorigin) TSOffsetStyleGCArray(style->base_gc, xorigin, yorigin); gdk_gc_set_ts_origin(style->black_gc, xorigin, yorigin); gdk_gc_set_ts_origin(style->white_gc, xorigin, yorigin); +#endif return MOZ_GTK_SUCCESS; } @@ -1094,6 +1098,34 @@ calculate_arrow_rect(GtkWidget* arrow, GdkRectangle* rect, } static gint +moz_gtk_scrolled_window_paint(GdkDrawable* drawable, GdkRectangle* rect, + GdkRectangle* cliprect, GtkWidgetState* state) +{ + GtkStateType state_type = ConvertGtkState(state); + GtkShadowType shadow_type = (state->active) ? GTK_SHADOW_IN : GTK_SHADOW_OUT; + GtkStyle* style; + GtkAllocation allocation; + GtkWidget* widget; + + ensure_scrolled_window_widget(); + widget = gParts->scrolledWindowWidget; + + gtk_widget_get_allocation(widget, &allocation); + allocation.x = rect->x; + allocation.y = rect->y; + allocation.width = rect->width; + allocation.height = rect->height; + gtk_widget_set_allocation(widget, &allocation); + + style = gtk_widget_get_style(widget); + TSOffsetStyleGCs(style, rect->x - 1, rect->y - 1); + gtk_paint_box(style, drawable, state_type, shadow_type, cliprect, + widget, "scrolled_window", rect->x - 1, rect->y - 1, + rect->width + 2, rect->height + 2); + return MOZ_GTK_SUCCESS; +} + +static gint moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect, GdkRectangle* cliprect, GtkWidgetState* state, GtkScrollbarButtonFlags flags, @@ -1124,11 +1156,7 @@ moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect, to determine where it should paint rounded corners on the buttons. We need to trick them into drawing the buttons the way we want them. */ -#if GTK_CHECK_VERSION(2, 18, 0) gtk_widget_get_allocation(scrollbar, &allocation); -#else - allocation = scrollbar->allocation; -#endif allocation.x = rect->x; allocation.y = rect->y; allocation.width = rect->width; @@ -1163,6 +1191,7 @@ moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect, } } + gtk_widget_set_allocation(scrollbar, &allocation); style = gtk_widget_get_style(scrollbar); TSOffsetStyleGCs(style, rect->x, rect->y); @@ -1214,10 +1243,6 @@ moz_gtk_scrollbar_trough_paint(GtkThemeWidgetType widget, style = gtk_widget_get_style(GTK_WIDGET(scrollbar)); TSOffsetStyleGCs(style, rect->x, rect->y); - gtk_style_apply_default_background(style, drawable, TRUE, GTK_STATE_ACTIVE, - cliprect, rect->x, rect->y, - rect->width, rect->height); - gtk_paint_box(style, drawable, GTK_STATE_ACTIVE, GTK_SHADOW_IN, cliprect, GTK_WIDGET(scrollbar), "trough", rect->x, rect->y, rect->width, rect->height); @@ -1557,8 +1582,17 @@ moz_gtk_entry_paint(GdkDrawable* drawable, GdkRectangle* rect, if (theme_honors_transparency) { g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE)); } else { +#ifndef GTK_API_VERSION_2 + cairo_t* cr = gdk_cairo_create(drawable); + gdk_cairo_set_source_color(cr, (const GdkColor*)&style->base[bg_state]); + cairo_pattern_set_extend (cairo_get_source(cr), CAIRO_EXTEND_REPEAT); + gdk_cairo_rectangle(cr, cliprect); + cairo_fill(cr); + cairo_destroy(cr); +#else gdk_draw_rectangle(drawable, style->base_gc[bg_state], TRUE, cliprect->x, cliprect->y, cliprect->width, cliprect->height); +#endif g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(FALSE)); } @@ -3047,6 +3081,7 @@ moz_gtk_get_scrollbar_metrics(MozGtkScrollbarMetrics *metrics) "trough_border", &metrics->trough_border, "stepper_size", &metrics->stepper_size, "stepper_spacing", &metrics->stepper_spacing, + "trough_under_steppers", &metrics->trough_under_steppers, NULL); metrics->min_slider_size = gtk_range_get_min_slider_size(GTK_RANGE(gParts->horizScrollbarWidget)); @@ -3109,6 +3144,9 @@ moz_gtk_widget_paint(GtkThemeWidgetType widget, GdkDrawable* drawable, return moz_gtk_scrollbar_thumb_paint(widget, drawable, rect, cliprect, state, direction); break; + case MOZ_GTK_SCROLLED_WINDOW: + return moz_gtk_scrolled_window_paint(drawable, rect, cliprect, state); + break; case MOZ_GTK_SCALE_HORIZONTAL: case MOZ_GTK_SCALE_VERTICAL: return moz_gtk_scale_paint(drawable, rect, cliprect, state, diff --git a/WebCore/platform/gtk/gtkdrawing.h b/WebCore/platform/gtk/gtkdrawing.h index b5a7feb..9d06d5d 100644 --- a/WebCore/platform/gtk/gtkdrawing.h +++ b/WebCore/platform/gtk/gtkdrawing.h @@ -75,6 +75,7 @@ typedef struct { gint stepper_size; gint stepper_spacing; gint min_slider_size; + gboolean trough_under_steppers; } MozGtkScrollbarMetrics; typedef struct _GtkThemeParts { @@ -180,6 +181,8 @@ typedef enum { /* Paints the slider (thumb) of a GtkScrollbar. */ MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL, MOZ_GTK_SCROLLBAR_THUMB_VERTICAL, + /* Paints the background of a scrolled window */ + MOZ_GTK_SCROLLED_WINDOW, /* Paints a GtkScale. */ MOZ_GTK_SCALE_HORIZONTAL, MOZ_GTK_SCALE_VERTICAL, |