diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/platform/wx/WidgetWx.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/platform/wx/WidgetWx.cpp')
-rwxr-xr-x | WebCore/platform/wx/WidgetWx.cpp | 103 |
1 files changed, 21 insertions, 82 deletions
diff --git a/WebCore/platform/wx/WidgetWx.cpp b/WebCore/platform/wx/WidgetWx.cpp index 9626c7f..37097fe 100755 --- a/WebCore/platform/wx/WidgetWx.cpp +++ b/WebCore/platform/wx/WidgetWx.cpp @@ -28,128 +28,67 @@ #include "Cursor.h" #include "GraphicsContext.h" #include "IntRect.h" -#include "Font.h" #include <wx/defs.h> #include <wx/scrolwin.h> namespace WebCore { -class WidgetPrivate +Widget::Widget(PlatformWidget widget) { -public: - wxWindow* nativeWindow; - Font font; - WidgetClient* client; -}; - -Widget::Widget() - : data(new WidgetPrivate) -{ - data->nativeWindow = 0; - data->client = 0; -} - -Widget::Widget(wxWindow* win) - : data(new WidgetPrivate) -{ - setNativeWindow(win); + init(widget); } Widget::~Widget() { - delete data; -} - -wxWindow* Widget::nativeWindow() const -{ - return data->nativeWindow; -} - -void Widget::setNativeWindow(wxWindow* win) -{ - data->nativeWindow = win; -} - -void Widget::setClient(WidgetClient* c) -{ - data->client = c; -} - -WidgetClient* Widget::client() const -{ - return data->client; -} - -IntRect Widget::frameGeometry() const -{ - if (data->nativeWindow) - return IntRect(data->nativeWindow->GetRect()); - - return IntRect(); } void Widget::setFocus() { - if (data->nativeWindow) - data->nativeWindow->SetFocus(); + if (platformWidget()) + platformWidget()->SetFocus(); } void Widget::setCursor(const Cursor& cursor) { - if (data->nativeWindow && cursor.impl()) - data->nativeWindow->SetCursor(*cursor.impl()); + if (platformWidget() && cursor.impl()) + platformWidget()->SetCursor(*cursor.impl()); } void Widget::show() { - if (data->nativeWindow) - data->nativeWindow->Show(); + if (platformWidget()) + platformWidget()->Show(); } void Widget::hide() { - if (data->nativeWindow) - data->nativeWindow->Hide(); + if (platformWidget()) + platformWidget()->Hide(); } -void Widget::setFrameGeometry(const IntRect &rect) +IntRect Widget::frameRect() const { - if (data->nativeWindow) - data->nativeWindow->SetSize(rect); + if (platformWidget()) + return platformWidget()->GetRect(); + return m_frame; } -void Widget::setEnabled(bool enabled) +void Widget::setFrameRect(const IntRect& rect) { - if (data->nativeWindow) - data->nativeWindow->Enable(enabled); -} - -bool Widget::isEnabled() const -{ - if (data->nativeWindow) - return data->nativeWindow->IsEnabled(); - - return false; -} - -void Widget::invalidate() -{ - if (data->nativeWindow) - data->nativeWindow->Refresh(); + if (platformWidget()) + platformWidget()->SetSize(rect); + m_frame = rect; } void Widget::invalidateRect(const IntRect& r) { - if (data->nativeWindow) - data->nativeWindow->RefreshRect(r); + if (platformWidget()) + platformWidget()->RefreshRect(r); } void Widget::paint(GraphicsContext*,const IntRect& r) { - invalidateRect(r); - if (data->nativeWindow) - data->nativeWindow->Update(); } -}
\ No newline at end of file +} |