diff options
Diffstat (limited to 'WebCore/platform/Widget.h')
-rw-r--r-- | WebCore/platform/Widget.h | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h index 58d4e57..90d38a9 100644 --- a/WebCore/platform/Widget.h +++ b/WebCore/platform/Widget.h @@ -27,6 +27,22 @@ #ifndef Widget_h #define Widget_h +#include "IntRect.h" +#include <wtf/Forward.h> +#include <wtf/RefCounted.h> + +#if PLATFORM(CHROMIUM) +#include "PlatformWidget.h" +#endif + +#if PLATFORM(MAC) +#include <wtf/RetainPtr.h> +#endif + +#if PLATFORM(QT) +#include <qglobal.h> +#endif + #if PLATFORM(MAC) #ifdef __OBJC__ @class NSView; @@ -35,7 +51,7 @@ class NSView; class NSWindow; #endif -typedef NSView* PlatformWidget; +typedef NSView *PlatformWidget; #endif #if PLATFORM(ANDROID) @@ -56,7 +72,6 @@ typedef GtkWidget* PlatformWidget; #endif #if PLATFORM(QT) -#include <qglobal.h> QT_BEGIN_NAMESPACE class QWidget; QT_END_NAMESPACE @@ -77,10 +92,6 @@ typedef BView* PlatformWidget; typedef void* PlatformWidget; #endif -#if PLATFORM(CHROMIUM) -#include "PlatformWidget.h" -#endif - #if PLATFORM(EFL) typedef struct _Evas_Object Evas_Object; typedef struct _Evas Evas; @@ -95,13 +106,6 @@ typedef QWebPageClient* PlatformPageClient; typedef PlatformWidget PlatformPageClient; #endif -#include "IntPoint.h" -#include "IntRect.h" -#include "IntSize.h" - -#include <wtf/Forward.h> -#include <wtf/RefCounted.h> - namespace WebCore { class Cursor; @@ -132,15 +136,9 @@ public: Widget(PlatformWidget = 0); virtual ~Widget(); - PlatformWidget platformWidget() const { return m_widget; } - void setPlatformWidget(PlatformWidget widget) - { - if (widget != m_widget) { - releasePlatformWidget(); - m_widget = widget; - retainPlatformWidget(); - } - } + PlatformWidget platformWidget() const; + void setPlatformWidget(PlatformWidget); + #if PLATFORM(HAIKU) PlatformWidget topLevelPlatformWidget() const { return m_topLevelPlatformWidget; } void setTopLevelPlatformWidget(PlatformWidget widget) @@ -256,7 +254,11 @@ private: private: ScrollView* m_parent; +#if !PLATFORM(MAC) PlatformWidget m_widget; +#else + RetainPtr<NSView> m_widget; +#endif bool m_selfVisible; bool m_parentVisible; @@ -283,6 +285,36 @@ public: #endif }; +#if !PLATFORM(MAC) + +inline PlatformWidget Widget::platformWidget() const +{ + return m_widget; +} + +inline void Widget::setPlatformWidget(PlatformWidget widget) +{ + if (widget != m_widget) { + releasePlatformWidget(); + m_widget = widget; + retainPlatformWidget(); + } +} + +#endif + +#if !PLATFORM(GTK) + +inline void Widget::releasePlatformWidget() +{ +} + +inline void Widget::retainPlatformWidget() +{ +} + +#endif + } // namespace WebCore #endif // Widget_h |