| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. | 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef Widget_h | 27 #ifndef Widget_h |
| 28 #define Widget_h | 28 #define Widget_h |
| 29 | 29 |
| 30 #include "IntRect.h" | 30 #include "IntRect.h" |
| 31 #include "PageClientChromium.h" | 31 #include "PageClientChromium.h" |
| 32 #include <wtf/Forward.h> | 32 #include <wtf/Forward.h> |
| 33 #include <wtf/RefCounted.h> | 33 #include <wtf/RefCounted.h> |
| 34 | 34 |
| 35 #if PLATFORM(MAC) | |
| 36 #include <wtf/RetainPtr.h> | |
| 37 #endif | |
| 38 | |
| 39 #if PLATFORM(QT) | |
| 40 #include <QPointer> | |
| 41 #include <qglobal.h> | |
| 42 #endif | |
| 43 | |
| 44 typedef WebCore::PageClientChromium* PlatformPageClient; | 35 typedef WebCore::PageClientChromium* PlatformPageClient; |
| 45 | 36 |
| 46 namespace WebCore { | 37 namespace WebCore { |
| 47 | 38 |
| 48 class AXObjectCache; | 39 class AXObjectCache; |
| 49 class Cursor; | 40 class Cursor; |
| 50 class Event; | 41 class Event; |
| 51 class Font; | 42 class Font; |
| 52 class GraphicsContext; | 43 class GraphicsContext; |
| 53 class PlatformMouseEvent; | 44 class PlatformMouseEvent; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Notifies this widget that other widgets on the page have been repositione
d. | 130 // Notifies this widget that other widgets on the page have been repositione
d. |
| 140 virtual void widgetPositionsUpdated() {} | 131 virtual void widgetPositionsUpdated() {} |
| 141 | 132 |
| 142 // Notifies this widget that its clip rect changed. | 133 // Notifies this widget that its clip rect changed. |
| 143 virtual void clipRectChanged() { } | 134 virtual void clipRectChanged() { } |
| 144 | 135 |
| 145 // Whether transforms affect the frame rect. FIXME: We get rid of this and h
ave | 136 // Whether transforms affect the frame rect. FIXME: We get rid of this and h
ave |
| 146 // the frame rects be the same no matter what transforms are applied. | 137 // the frame rects be the same no matter what transforms are applied. |
| 147 virtual bool transformsAffectFrameRect() { return true; } | 138 virtual bool transformsAffectFrameRect() { return true; } |
| 148 | 139 |
| 149 #if PLATFORM(MAC) | |
| 150 NSView* getOuterView() const; | |
| 151 | |
| 152 void removeFromSuperview(); | |
| 153 #endif | |
| 154 | |
| 155 #if PLATFORM(CHROMIUM) | |
| 156 virtual bool isPluginContainer() const { return false; } | 140 virtual bool isPluginContainer() const { return false; } |
| 157 #endif | |
| 158 | |
| 159 #if PLATFORM(QT) | |
| 160 QObject* bindingObject() const; | |
| 161 void setBindingObject(QObject*); | |
| 162 #endif | |
| 163 | 141 |
| 164 // Virtual methods to convert points to/from the containing ScrollView | 142 // Virtual methods to convert points to/from the containing ScrollView |
| 165 virtual IntRect convertToContainingView(const IntRect&) const; | 143 virtual IntRect convertToContainingView(const IntRect&) const; |
| 166 virtual IntRect convertFromContainingView(const IntRect&) const; | 144 virtual IntRect convertFromContainingView(const IntRect&) const; |
| 167 virtual IntPoint convertToContainingView(const IntPoint&) const; | 145 virtual IntPoint convertToContainingView(const IntPoint&) const; |
| 168 virtual IntPoint convertFromContainingView(const IntPoint&) const; | 146 virtual IntPoint convertFromContainingView(const IntPoint&) const; |
| 169 | 147 |
| 170 // A means to access the AX cache when this object can get a pointer to it. | 148 // A means to access the AX cache when this object can get a pointer to it. |
| 171 virtual AXObjectCache* axObjectCache() const { return 0; } | 149 virtual AXObjectCache* axObjectCache() const { return 0; } |
| 172 | 150 |
| 173 private: | 151 private: |
| 174 void init(); // Must be called by all Widget constructors to initialize cros
s-platform data. | 152 void init(); // Must be called by all Widget constructors to initialize cros
s-platform data. |
| 175 | 153 |
| 176 // These methods are used to convert from the root widget to the containing
window, | 154 // These methods are used to convert from the root widget to the containing
window, |
| 177 // which has behavior that may differ between platforms (e.g. Mac uses flipp
ed window coordinates). | 155 // which has behavior that may differ between platforms (e.g. Mac uses flipp
ed window coordinates). |
| 178 static IntRect convertFromRootToContainingWindow(const Widget* rootWidget, c
onst IntRect&); | 156 static IntRect convertFromRootToContainingWindow(const Widget* rootWidget, c
onst IntRect&); |
| 179 static IntRect convertFromContainingWindowToRoot(const Widget* rootWidget, c
onst IntRect&); | 157 static IntRect convertFromContainingWindowToRoot(const Widget* rootWidget, c
onst IntRect&); |
| 180 | 158 |
| 181 static IntPoint convertFromRootToContainingWindow(const Widget* rootWidget,
const IntPoint&); | 159 static IntPoint convertFromRootToContainingWindow(const Widget* rootWidget,
const IntPoint&); |
| 182 static IntPoint convertFromContainingWindowToRoot(const Widget* rootWidget,
const IntPoint&); | 160 static IntPoint convertFromContainingWindowToRoot(const Widget* rootWidget,
const IntPoint&); |
| 183 | 161 |
| 184 private: | 162 private: |
| 185 ScrollView* m_parent; | 163 ScrollView* m_parent; |
| 186 bool m_selfVisible; | 164 bool m_selfVisible; |
| 187 bool m_parentVisible; | 165 bool m_parentVisible; |
| 188 | 166 |
| 189 IntRect m_frame; // Not used when a native widget exists. | 167 IntRect m_frame; // Not used when a native widget exists. |
| 190 | |
| 191 #if PLATFORM(MAC) | |
| 192 WidgetPrivate* m_data; | |
| 193 #endif | |
| 194 | |
| 195 #if PLATFORM(QT) | |
| 196 QPointer<QObject> m_bindingObject; | |
| 197 #endif | |
| 198 | |
| 199 }; | 168 }; |
| 200 | 169 |
| 201 } // namespace WebCore | 170 } // namespace WebCore |
| 202 | 171 |
| 203 #endif // Widget_h | 172 #endif // Widget_h |
| OLD | NEW |