Commit e8249bf2 authored by kenneth@webkit.org's avatar kenneth@webkit.org

Make PlatformWindow return something else than PlatformWidget

https://bugs.webkit.org/show_bug.cgi?id=29085

Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> on 2009-09-17
Reviewed by Simon Hausmann.

WebCore:

Make platformWindow return a PlatformPageClient
(for now typedef'ed to PlatformWidget)

Also, change the name of platformWindow to platformPageClient()

* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(getPangoLayoutForAtk):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* loader/EmptyClients.h:
(WebCore::EmptyChromeClient::platformPageClient):
* page/Chrome.cpp:
(WebCore::Chrome::platformPageClient):
* page/Chrome.h:
* page/ChromeClient.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::wheelEvent):
(WebCore::EventHandler::currentPlatformMouseEvent):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::eventMayStartDrag):
* platform/HostWindow.h:
* platform/Widget.h:
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getVisual):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/gtk/PopupMenuGtk.cpp:
(WebCore::PopupMenu::show):
* platform/gtk/ScrollViewGtk.cpp:
(WebCore::ScrollView::platformAddChild):
(WebCore::ScrollView::platformRemoveChild):
(WebCore::ScrollView::visibleContentRect):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::setFocus):
(WebCore::Widget::setCursor):
* platform/qt/PlatformScreenQt.cpp:
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/qt/PopupMenuQt.cpp:
(WebCore::PopupMenu::show):
* platform/qt/WidgetQt.cpp:
(WebCore::Widget::setCursor):
* platform/win/PlatformScreenWin.cpp:
(WebCore::monitorInfoForWidget):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::show):
(WebCore::PopupMenu::calculatePositionAndSize):
(WebCore::PopupMenu::wndProc):
* platform/wx/RenderThemeWx.cpp:
(WebCore::nativeWindowForRenderObject):
* platform/wx/ScrollbarThemeWx.cpp:
(WebCore::ScrollbarThemeWx::paint):
* plugins/gtk/PluginViewGtk.cpp:
(WebCore::PluginView::getValue):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::platformStart):
* plugins/mac/PluginViewMac.cpp:
(WebCore::PluginView::platformStart):
* plugins/qt/PluginViewQt.cpp:
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::getValue):
(WebCore::PluginView::platformStart):
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginView::getValue):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::platformStart):

WebKit/gtk:

Reflect the rename of platformWindow and it's return type.

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::platformPageClient):
(WebKit::ChromeClient::runOpenPanel):
* WebCoreSupport/ChromeClientGtk.h:
* webkit/webkitprivate.cpp:
(currentToplevelCallback):
* webkit/webkitwebview.cpp:
(webkit_web_view_popup_menu_handler):

WebKit/haiku:

Reflect the rename of platformWindow and it's return type.

* WebCoreSupport/ChromeClientHaiku.cpp:
(WebCore::ChromeClientHaiku::platformPageClient):
* WebCoreSupport/ChromeClientHaiku.h:

WebKit/mac:

Reflect the rename of platformWindow and it's return type.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::platformPageClient):

WebKit/qt:

Reflect the rename of platformWindow and it's return type.

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::platformPageClient):
* WebCoreSupport/ChromeClientQt.h:

WebKit/win:

Reflect the rename of platformWindow and it's return type.

* AccessibleBase.cpp:
(AccessibleBase::get_accParent):
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::platformPageClient):
* WebCoreSupport/WebChromeClient.h:

WebKit/wx:

Reflect the rename of platformWindow and it's return type.

* WebKitSupport/ChromeClientWx.cpp:
(WebCore::ChromeClientWx::platformPageClient):
* WebKitSupport/ChromeClientWx.h:
* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::isEditable):
(WebCore::EditorClientWx::registerCommandForUndo):
(WebCore::EditorClientWx::registerCommandForRedo):
(WebCore::EditorClientWx::clearUndoRedoOperations):
(WebCore::EditorClientWx::canUndo):
(WebCore::EditorClientWx::canRedo):
(WebCore::EditorClientWx::undo):
(WebCore::EditorClientWx::redo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent daa9f964
2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Make PlatformWindow return something else than PlatformWidget
https://bugs.webkit.org/show_bug.cgi?id=29085
Make platformWindow return a PlatformPageClient
(for now typedef'ed to PlatformWidget)
Also, change the name of platformWindow to platformPageClient()
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(getPangoLayoutForAtk):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* loader/EmptyClients.h:
(WebCore::EmptyChromeClient::platformPageClient):
* page/Chrome.cpp:
(WebCore::Chrome::platformPageClient):
* page/Chrome.h:
* page/ChromeClient.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::wheelEvent):
(WebCore::EventHandler::currentPlatformMouseEvent):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::eventMayStartDrag):
* platform/HostWindow.h:
* platform/Widget.h:
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getVisual):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/gtk/PopupMenuGtk.cpp:
(WebCore::PopupMenu::show):
* platform/gtk/ScrollViewGtk.cpp:
(WebCore::ScrollView::platformAddChild):
(WebCore::ScrollView::platformRemoveChild):
(WebCore::ScrollView::visibleContentRect):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::setFocus):
(WebCore::Widget::setCursor):
* platform/qt/PlatformScreenQt.cpp:
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/qt/PopupMenuQt.cpp:
(WebCore::PopupMenu::show):
* platform/qt/WidgetQt.cpp:
(WebCore::Widget::setCursor):
* platform/win/PlatformScreenWin.cpp:
(WebCore::monitorInfoForWidget):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::show):
(WebCore::PopupMenu::calculatePositionAndSize):
(WebCore::PopupMenu::wndProc):
* platform/wx/RenderThemeWx.cpp:
(WebCore::nativeWindowForRenderObject):
* platform/wx/ScrollbarThemeWx.cpp:
(WebCore::ScrollbarThemeWx::paint):
* plugins/gtk/PluginViewGtk.cpp:
(WebCore::PluginView::getValue):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::platformStart):
* plugins/mac/PluginViewMac.cpp:
(WebCore::PluginView::platformStart):
* plugins/qt/PluginViewQt.cpp:
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::getValue):
(WebCore::PluginView::platformStart):
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginView::getValue):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::platformStart):
2009-09-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
......@@ -556,7 +556,7 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
if (!hostWindow)
return 0;
PlatformWidget webView = hostWindow->platformWindow();
PlatformPageClient webView = hostWindow->platformPageClient();
if (!webView)
return 0;
......
......@@ -68,7 +68,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
return;
Page* page = document->page();
if (!page || !page->chrome()->platformWindow())
if (!page || !page->chrome()->platformPageClient())
return;
DWORD msaaEvent;
......@@ -93,7 +93,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
ASSERT(obj->axObjectID() >= 1);
ASSERT(obj->axObjectID() <= numeric_limits<LONG>::max());
NotifyWinEvent(msaaEvent, page->chrome()->platformWindow(), OBJID_CLIENT, -static_cast<LONG>(obj->axObjectID()));
NotifyWinEvent(msaaEvent, page->chrome()->platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->axObjectID()));
}
AXID AXObjectCache::platformGenerateAXID() const
......@@ -121,7 +121,7 @@ void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* n
return;
Page* page = newFocusedRenderer->document()->page();
if (!page || !page->chrome()->platformWindow())
if (!page || !page->chrome()->platformPageClient())
return;
AccessibilityObject* focusedObject = focusedUIElementForPage(page);
......
......@@ -120,7 +120,7 @@ public:
virtual void scroll(const IntSize&, const IntRect&, const IntRect&) { }
virtual IntPoint screenToWindow(const IntPoint& p) const { return p; }
virtual IntRect windowToScreen(const IntRect& r) const { return r; }
virtual PlatformWidget platformWindow() const { return 0; }
virtual PlatformPageClient platformPageClient() const { return 0; }
virtual void contentsSizeChanged(Frame*, const IntSize&) const { }
virtual void scrollbarsModeDidChange() const { }
......
......@@ -87,9 +87,9 @@ IntRect Chrome::windowToScreen(const IntRect& rect) const
return m_client->windowToScreen(rect);
}
PlatformWidget Chrome::platformWindow() const
PlatformPageClient Chrome::platformPageClient() const
{
return m_client->platformWindow();
return m_client->platformPageClient();
}
void Chrome::contentsSizeChanged(Frame* frame, const IntSize& size) const
......
......@@ -63,7 +63,7 @@ namespace WebCore {
virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
virtual IntPoint screenToWindow(const IntPoint&) const;
virtual IntRect windowToScreen(const IntRect&) const;
virtual PlatformWidget platformWindow() const;
virtual PlatformPageClient platformPageClient() const;
virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const;
virtual void scrollbarsModeDidChange() const;
......
......@@ -128,7 +128,7 @@ namespace WebCore {
virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
virtual IntPoint screenToWindow(const IntPoint&) const = 0;
virtual IntRect windowToScreen(const IntRect&) const = 0;
virtual PlatformWidget platformWindow() const = 0;
virtual PlatformPageClient platformPageClient() const = 0;
virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Currently only Mac has a non empty implementation.
// End methods used by HostWindow.
......
......@@ -112,7 +112,7 @@ bool EventHandler::wheelEvent(NSEvent *event)
m_useLatchedWheelEventNode = wkIsLatchingWheelEvent(event);
PlatformWheelEvent wheelEvent(event, page->chrome()->platformWindow());
PlatformWheelEvent wheelEvent(event, page->chrome()->platformPageClient());
handleWheelEvent(wheelEvent);
return wheelEvent.isAccepted();
......@@ -712,7 +712,7 @@ PlatformMouseEvent EventHandler::currentPlatformMouseEvent() const
{
NSView *windowView = nil;
if (Page* page = m_frame->page())
windowView = page->chrome()->platformWindow();
windowView = page->chrome()->platformPageClient();
return PlatformMouseEvent(currentNSEvent(), windowView);
}
......@@ -722,7 +722,7 @@ bool EventHandler::sendContextMenuEvent(NSEvent *event)
Page* page = m_frame->page();
if (!page)
return false;
return sendContextMenuEvent(PlatformMouseEvent(event, page->chrome()->platformWindow()));
return sendContextMenuEvent(PlatformMouseEvent(event, page->chrome()->platformPageClient()));
}
#endif // ENABLE(CONTEXT_MENUS)
......@@ -732,7 +732,7 @@ bool EventHandler::eventMayStartDrag(NSEvent *event)
Page* page = m_frame->page();
if (!page)
return false;
return eventMayStartDrag(PlatformMouseEvent(event, page->chrome()->platformWindow()));
return eventMayStartDrag(PlatformMouseEvent(event, page->chrome()->platformPageClient()));
}
#endif // ENABLE(DRAG_SUPPORT)
......
......@@ -48,8 +48,8 @@ public:
virtual IntPoint screenToWindow(const IntPoint&) const = 0;
virtual IntRect windowToScreen(const IntRect&) const = 0;
// Method for retrieving the native window.
virtual PlatformWidget platformWindow() const = 0;
// Method for retrieving the native client of the page.
virtual PlatformPageClient platformPageClient() const = 0;
// For scrolling a rect into view recursively. Useful in the cases where a WebView is embedded inside some containing
// platform-specific ScrollView.
......
......@@ -74,6 +74,8 @@ typedef BView* PlatformWidget;
#include "PlatformWidget.h"
#endif
typedef PlatformWidget PlatformPageClient;
#include "IntPoint.h"
#include "IntRect.h"
#include "IntSize.h"
......
......@@ -49,7 +49,7 @@ static GdkVisual* getVisual(Widget* widget)
if (!widget)
return 0;
GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformWindow());
GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformPageClient());
if (!container)
return 0;
......@@ -93,7 +93,7 @@ FloatRect screenRect(Widget* widget)
if (!widget)
return FloatRect();
GtkWidget* container = gtk_widget_get_toplevel(GTK_WIDGET(widget->root()->hostWindow()->platformWindow()));
GtkWidget* container = gtk_widget_get_toplevel(GTK_WIDGET(widget->root()->hostWindow()->platformPageClient()));
if (!GTK_WIDGET_TOPLEVEL(container))
return FloatRect();
......@@ -114,7 +114,7 @@ FloatRect screenAvailableRect(Widget* widget)
return FloatRect();
#if PLATFORM(X11)
GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformWindow());
GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformPageClient());
if (!container)
return FloatRect();
......
......@@ -60,7 +60,7 @@ void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
gtk_container_foreach(GTK_CONTAINER(m_popup), reinterpret_cast<GtkCallback>(menuRemoveItem), this);
int x, y;
gdk_window_get_origin(GTK_WIDGET(view->hostWindow()->platformWindow())->window, &x, &y);
gdk_window_get_origin(GTK_WIDGET(view->hostWindow()->platformPageClient())->window, &x, &y);
m_menuPosition = view->contentsToWindow(rect.location());
m_menuPosition = IntPoint(m_menuPosition.x() + x, m_menuPosition.y() + y + rect.height());
m_indexMap.clear();
......
......@@ -107,7 +107,7 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj)
void ScrollView::platformAddChild(Widget* child)
{
if (!GTK_IS_SOCKET(child->platformWidget()))
gtk_container_add(GTK_CONTAINER(hostWindow()->platformWindow()), child->platformWidget());
gtk_container_add(GTK_CONTAINER(hostWindow()->platformPageClient()), child->platformWidget());
}
void ScrollView::platformRemoveChild(Widget* child)
......@@ -117,7 +117,7 @@ void ScrollView::platformRemoveChild(Widget* child)
// HostWindow can be NULL here. If that's the case
// let's grab the child's parent instead.
if (hostWindow())
parent = GTK_WIDGET(hostWindow()->platformWindow());
parent = GTK_WIDGET(hostWindow()->platformPageClient());
else
parent = GTK_WIDGET(child->platformWidget()->parent);
......@@ -133,7 +133,7 @@ IntRect ScrollView::visibleContentRect(bool includeScrollbars) const
max(0, height() - (horizontalScrollbar() && !includeScrollbars ? horizontalScrollbar()->height() : 0))));
// Main frame.
GtkWidget* measuredWidget = hostWindow()->platformWindow();
GtkWidget* measuredWidget = hostWindow()->platformPageClient();
GtkWidget* parent = gtk_widget_get_parent(measuredWidget);
// We may not be in a widget that displays scrollbars, but we may
......
......@@ -55,7 +55,7 @@ Widget::~Widget()
void Widget::setFocus()
{
gtk_widget_grab_focus(platformWidget() ? platformWidget() : GTK_WIDGET(root()->hostWindow()->platformWindow()));
gtk_widget_grab_focus(platformWidget() ? platformWidget() : GTK_WIDGET(root()->hostWindow()->platformPageClient()));
}
static GdkDrawable* gdkDrawable(PlatformWidget widget)
......@@ -76,7 +76,7 @@ void Widget::setCursor(const Cursor& cursor)
if (platformCursor == lastSetCursor)
return;
gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(root()->hostWindow()->platformWindow())->window, platformCursor);
gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(root()->hostWindow()->platformPageClient())->window, platformCursor);
lastSetCursor = platformCursor;
}
......
......@@ -44,34 +44,34 @@ namespace WebCore {
int screenDepth(Widget* w)
{
QDesktopWidget* d = QApplication::desktop();
QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
QWidget *view = w ? w->root()->hostWindow()->platformPageClient() : 0;
int screenNumber = view ? d->screenNumber(view) : 0;
return d->screen(screenNumber)->depth();
}
int screenDepthPerComponent(Widget* w)
{
QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
QWidget *view = w ? w->root()->hostWindow()->platformPageClient() : 0;
return view ? view->depth() : QApplication::desktop()->screen(0)->depth();
}
bool screenIsMonochrome(Widget* w)
{
QDesktopWidget* d = QApplication::desktop();
QWidget *view = w ? w->root()->hostWindow()->platformWindow(): 0;
QWidget *view = w ? w->root()->hostWindow()->platformPageClient(): 0;
int screenNumber = view ? d->screenNumber(view) : 0;
return d->screen(screenNumber)->numColors() < 2;
}
FloatRect screenRect(Widget* w)
{
QRect r = QApplication::desktop()->screenGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
QRect r = QApplication::desktop()->screenGeometry(w ? w->root()->hostWindow()->platformPageClient(): 0);
return FloatRect(r.x(), r.y(), r.width(), r.height());
}
FloatRect screenAvailableRect(Widget* w)
{
QRect r = QApplication::desktop()->availableGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
QRect r = QApplication::desktop()->availableGeometry(w ? w->root()->hostWindow()->platformPageClient(): 0);
return FloatRect(r.x(), r.y(), r.width(), r.height());
}
......
......@@ -85,7 +85,7 @@ void PopupMenu::populate(const IntRect& r)
void PopupMenu::show(const IntRect& r, FrameView* v, int index)
{
QWidget* window = v->hostWindow()->platformWindow();
QWidget* window = v->hostWindow()->platformPageClient();
populate(r);
QRect rect = r;
rect.moveTopLeft(v->contentsToWindow(r.topLeft()));
......
......@@ -81,7 +81,7 @@ void Widget::setFocus()
void Widget::setCursor(const Cursor& cursor)
{
#ifndef QT_NO_CURSOR
QWidget* widget = root()->hostWindow()->platformWindow();
QWidget* widget = root()->hostWindow()->platformPageClient();
if (!widget)
return;
......
......@@ -39,7 +39,7 @@ namespace WebCore {
// Returns info for the default monitor if widget is NULL
static MONITORINFOEX monitorInfoForWidget(Widget* widget)
{
HWND window = widget ? widget->root()->hostWindow()->platformWindow() : 0;
HWND window = widget ? widget->root()->hostWindow()->platformPageClient() : 0;
HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY);
MONITORINFOEX monitorInfo;
......
......@@ -111,7 +111,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
if (clientRect().isEmpty())
return;
HWND hostWindow = view->hostWindow()->platformWindow();
HWND hostWindow = view->hostWindow()->platformPageClient();
if (!m_scrollbar && visibleItems() < client()->listSize()) {
// We need a scroll bar
......@@ -272,7 +272,7 @@ void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
// Then, translate to screen coordinates
POINT location(rScreenCoords.location());
if (!::ClientToScreen(v->hostWindow()->platformWindow(), &location))
if (!::ClientToScreen(v->hostWindow()->platformPageClient(), &location))
return;
rScreenCoords.setLocation(location);
......@@ -817,7 +817,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
break;
}
case VK_TAB:
::SendMessage(client()->hostWindow()->platformWindow(), message, wParam, lParam);
::SendMessage(client()->hostWindow()->platformPageClient(), message, wParam, lParam);
hide();
break;
case VK_ESCAPE:
......
......@@ -144,7 +144,7 @@ wxWindow* nativeWindowForRenderObject(RenderObject* o)
FrameView* frameView = o->view()->frameView();
ASSERT(frameView);
ASSERT(frameView->hostWindow());
return frameView->hostWindow()->platformWindow();
return frameView->hostWindow()->platformPageClient();
}
......
......@@ -171,7 +171,7 @@ bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, con
if (!root)
return false;
wxWindow* webview = root->hostWindow()->platformWindow();
wxWindow* webview = root->hostWindow()->platformPageClient();
wxRenderer_DrawScrollbar(webview, *dc, scrollbar->frameRect(), orientation, scrollbar->currentPos(), static_cast<wxScrollbarPart>(scrollbar->pressedPart()),
static_cast<wxScrollbarPart>(scrollbar->hoveredPart()), scrollbar->maximum(), scrollbar->pageStep(), flags);
......
......@@ -382,11 +382,11 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
case NPNVnetscapeWindow: {
#if defined(XP_UNIX)
void* w = reinterpret_cast<void*>(value);
*((XID *)w) = GDK_WINDOW_XWINDOW(m_parentFrame->view()->hostWindow()->platformWindow()->window);
*((XID *)w) = GDK_WINDOW_XWINDOW(m_parentFrame->view()->hostWindow()->platformPageClient()->window);
#endif
#ifdef GDK_WINDOWING_WIN32
HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value);
*w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformWindow()->window);
*w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformPageClient()->window);
#endif
return NPERR_NO_ERROR;
}
......@@ -428,7 +428,7 @@ void PluginView::forceRedraw()
if (m_isWindowed)
gtk_widget_queue_draw(platformPluginWidget());
else
gtk_widget_queue_draw(m_parentFrame->view()->hostWindow()->platformWindow());
gtk_widget_queue_draw(m_parentFrame->view()->hostWindow()->platformPageClient());
}
static gboolean
......@@ -454,13 +454,13 @@ bool PluginView::platformStart()
#if defined(XP_UNIX)
if (m_needsXEmbed) {
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformWindow()), platformPluginWidget());
gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformPageClient()), platformPluginWidget());
g_signal_connect(platformPluginWidget(), "plug_removed", G_CALLBACK(plug_removed_cb), NULL);
} else if (m_isWindowed)
setPlatformWidget(gtk_xtbin_new(m_parentFrame->view()->hostWindow()->platformWindow()->window, 0));
setPlatformWidget(gtk_xtbin_new(m_parentFrame->view()->hostWindow()->platformPageClient()->window, 0));
#else
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformWindow()), platformPluginWidget());
gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformPageClient()), platformPluginWidget());
#endif
show();
......
......@@ -171,7 +171,7 @@ bool PluginView::platformStart()
return false;
}
setPlatformPluginWidget(m_parentFrame->view()->hostWindow()->platformWindow());
setPlatformPluginWidget(m_parentFrame->view()->hostWindow()->platformPageClient());
show();
......
......@@ -212,7 +212,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event)
XEvent npEvent; // On UNIX NPEvent is a typedef for XEvent.
npEvent.type = (event->type() == "keydown") ? 2 : 3; // ints as Qt unsets KeyPress and KeyRelease
setSharedXEventFields(npEvent, m_parentFrame->view()->hostWindow()->platformWindow());
setSharedXEventFields(npEvent, m_parentFrame->view()->hostWindow()->platformPageClient());
setXKeyEventSpecificFields(npEvent, event);
if (!dispatchNPEvent(npEvent))
......@@ -351,7 +351,7 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
if (platformPluginWidget())
*(void **)value = platformPluginWidget()->x11Info().display();
else
*(void **)value = m_parentFrame->view()->hostWindow()->platformWindow()->x11Info().display();
*(void **)value = m_parentFrame->view()->hostWindow()->platformPageClient()->x11Info().display();
return NPERR_NO_ERROR;
case NPNVxtAppContext:
......@@ -396,7 +396,7 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
case NPNVnetscapeWindow: {
void* w = reinterpret_cast<void*>(value);
*((XID *)w) = m_parentFrame->view()->hostWindow()->platformWindow()->winId();
*((XID *)w) = m_parentFrame->view()->hostWindow()->platformPageClient()->winId();
return NPERR_NO_ERROR;
}
......@@ -451,7 +451,7 @@ bool PluginView::platformStart()
}
if (m_needsXEmbed) {
setPlatformWidget(new PluginContainerQt(this, m_parentFrame->view()->hostWindow()->platformWindow()));
setPlatformWidget(new PluginContainerQt(this, m_parentFrame->view()->hostWindow()->platformPageClient()));
} else {
notImplemented();
return false;
......
......@@ -880,7 +880,7 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
case NPNVnetscapeWindow: {
HWND* w = reinterpret_cast<HWND*>(value);
*w = windowHandleForPlatformWidget(parent() ? parent()->hostWindow()->platformWindow() : 0);
*w = windowHandleForPlatformWidget(parent() ? parent()->hostWindow()->platformPageClient() : 0);
return NPERR_NO_ERROR;
}
......@@ -952,7 +952,7 @@ void PluginView::forceRedraw()
if (m_isWindowed)
::UpdateWindow(platformPluginWidget());
else
::UpdateWindow(windowHandleForPlatformWidget(parent() ? parent()->hostWindow()->platformWindow() : 0));
::UpdateWindow(windowHandleForPlatformWidget(parent() ? parent()->hostWindow()->platformPageClient() : 0));
}
bool PluginView::platformStart()
......@@ -970,7 +970,7 @@ bool PluginView::platformStart()
if (isSelfVisible())
flags |= WS_VISIBLE;
HWND parentWindowHandle = windowHandleForPlatformWidget(m_parentFrame->view()->hostWindow()->platformWindow());
HWND parentWindowHandle = windowHandleForPlatformWidget(m_parentFrame->view()->hostWindow()->platformPageClient());
HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
0, 0, 0, 0, parentWindowHandle, 0, Page::instanceHandle(), 0);
......
2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Make PlatformWindow return something else than PlatformWidget
https://bugs.webkit.org/show_bug.cgi?id=29085
Reflect the rename of platformWindow and it's return type.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::platformPageClient):
(WebKit::ChromeClient::runOpenPanel):
* WebCoreSupport/ChromeClientGtk.h:
* webkit/webkitprivate.cpp:
(currentToplevelCallback):
* webkit/webkitwebview.cpp:
(webkit_web_view_popup_menu_handler):
2009-09-18 Xan Lopez <xlopez@igalia.com>
Reviewed by Jan Alonzo.
......
......@@ -386,7 +386,7 @@ IntPoint ChromeClient::screenToWindow(const IntPoint& point) const
return result;
}
PlatformWidget ChromeClient::platformWindow() const
PlatformPageClietn ChromeClient::platformPageClient() const
{
return GTK_WIDGET(m_webView);
}
......@@ -523,7 +523,7 @@ void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
RefPtr<FileChooser> chooser = prpFileChooser;
GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"),
GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(platformWindow()))),
GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(platformPageClient()))),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
......
......@@ -89,7 +89,7 @@ namespace WebKit {
virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
virtual PlatformWidget platformWindow() const;
virtual PlatformPageClient platformPageClient() const;
virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
virtual void scrollbarsModeDidChange() const;
......
......@@ -201,7 +201,7 @@ static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMes
if (!frame)
return NULL;
GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformWindow()));
GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformPageClient()));
if (GTK_WIDGET_TOPLEVEL(toplevel))
return toplevel;
else
......
......@@ -276,7 +276,7 @@ static gboolean webkit_web_view_popup_menu_handler(GtkWidget* widget)
}
int x, y;
gdk_window_get_origin(GTK_WIDGET(view->hostWindow()->platformWindow())->window, &x, &y);
gdk_window_get_origin(GTK_WIDGET(view->hostWindow()->platformPageClient())->window, &x, &y);
// FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in the selected element.
// Ideally we'd have the position of a context menu event be separate from its target node.
......
2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Make PlatformWindow return something else than PlatformWidget
https://bugs.webkit.org/show_bug.cgi?id=29085
Reflect the rename of platformWindow and it's return type.
* WebCoreSupport/ChromeClientHaiku.cpp:
(WebCore::ChromeClientHaiku::platformPageClient):