Changeset 36647 in webkit
- Timestamp:
- Sep 18, 2008 8:16:26 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r36645 r36647 1 2008-09-18 David Hyatt <hyatt@apple.com> 2 3 Move to only one constructor for Widgets. Rename data to m_data and make 4 it have an #ifdef only for platforms that have platform-specific data (Mac 5 and Gtk). 6 7 Reviewed by Sam Weinig 8 9 * WebCore.base.exp: 10 * platform/Widget.cpp: 11 (WebCore::Widget::init): 12 * platform/Widget.h: 13 * platform/gtk/WidgetGtk.cpp: 14 (WebCore::Widget::Widget): 15 (WebCore::Widget::~Widget): 16 (WebCore::Widget::cursor): 17 (WebCore::Widget::setCursor): 18 * platform/mac/WidgetMac.mm: 19 (WebCore::Widget::Widget): 20 (WebCore::Widget::~Widget): 21 (WebCore::Widget::addToSuperview): 22 (WebCore::Widget::removeFromSuperview): 23 (WebCore::Widget::beforeMouseDown): 24 (WebCore::Widget::afterMouseDown): 25 * platform/qt/WidgetQt.cpp: 26 (WebCore::Widget::Widget): 27 * platform/win/WidgetWin.cpp: 28 (WebCore::Widget::Widget): 29 * platform/wx/WidgetWx.cpp: 30 (WebCore::Widget::Widget): 31 1 32 2008-09-18 David Hyatt <hyatt@apple.com> 2 33 -
trunk/WebCore/WebCore.base.exp
r36620 r36647 543 543 __ZN7WebCore6Widget8setFocusEv 544 544 __ZN7WebCore6WidgetC1EP6NSView 545 __ZN7WebCore6WidgetC1Ev546 545 __ZN7WebCore6WidgetC2EP6NSView 547 546 __ZN7WebCore6WidgetD2Ev -
trunk/WebCore/platform/Widget.cpp
r36646 r36647 34 34 namespace WebCore { 35 35 36 void Widget::init( )36 void Widget::init(PlatformWidget widget) 37 37 { 38 38 m_parent = 0; 39 m_widget = 0;40 39 m_selfVisible = false; 41 40 m_parentVisible = false; 42 41 m_containingWindow = 0; 42 m_widget = widget; 43 if (m_widget) 44 retainPlatformWidget(); 43 45 } 44 46 -
trunk/WebCore/platform/Widget.h
r36645 r36647 103 103 class Widget { 104 104 public: 105 Widget(); 106 Widget(PlatformWidget); 105 Widget(PlatformWidget = 0); 107 106 virtual ~Widget(); 108 107 … … 188 187 189 188 private: 190 void init( ); // Must be called by all Widget constructors to initialize cross-platform data.189 void init(PlatformWidget); // Must be called by all Widget constructors to initialize cross-platform data. 191 190 192 191 void releasePlatformWidget(); … … 203 202 204 203 #if PLATFORM(MAC) || PLATFORM(GTK) 205 WidgetPrivate* data;204 WidgetPrivate* m_data; 206 205 #endif 207 206 }; -
trunk/WebCore/platform/gtk/WidgetGtk.cpp
r36643 r36647 46 46 }; 47 47 48 Widget::Widget( )49 : data(new WidgetPrivate)48 Widget::Widget(PlatformWidget widget) 49 : m_data(new WidgetPrivate) 50 50 { 51 init(); 52 data->cursor = 0; 53 } 54 55 Widget::Widget(PlatformWidget widget) 56 : data(new WidgetPrivate) 57 { 58 init(); 59 m_widget = widget; 60 data->cursor = 0; 51 init(widget); 52 m_data->cursor = 0; 61 53 } 62 54 … … 64 56 { 65 57 ASSERT(!parent()); 66 delete data;58 delete m_data; 67 59 } 68 60 … … 79 71 Cursor Widget::cursor() 80 72 { 81 return Cursor( data->cursor);73 return Cursor(m_data->cursor); 82 74 } 83 75 … … 97 89 // expensive operation, so avoid it if possible. 98 90 99 if (pcur == data->cursor)91 if (pcur == m_data->cursor) 100 92 return; 101 93 102 94 gdk_window_set_cursor(gdkDrawable(platformWidget()) ? GDK_WINDOW(gdkDrawable(platformWidget())) : GTK_WIDGET(containingWindow())->window, pcur); 103 data->cursor = pcur;95 m_data->cursor = pcur; 104 96 } 105 97 -
trunk/WebCore/platform/mac/WidgetMac.mm
r36642 r36647 76 76 } 77 77 78 Widget::Widget() : data(new WidgetPrivate) 79 { 80 init(); 81 data->mustStayInWindow = false; 82 data->removeFromSuperviewSoon = false; 83 } 84 85 Widget::Widget(NSView* view) : data(new WidgetPrivate) 86 { 87 init(); 88 setPlatformWidget(view); 89 data->mustStayInWindow = false; 90 data->removeFromSuperviewSoon = false; 78 Widget::Widget(NSView* view) 79 : m_data(new WidgetPrivate) 80 { 81 init(view); 82 m_data->mustStayInWindow = false; 83 m_data->removeFromSuperviewSoon = false; 91 84 } 92 85 … … 94 87 { 95 88 releasePlatformWidget(); 96 delete data;89 delete m_data; 97 90 } 98 91 … … 269 262 if ([subview superview] != view) 270 263 [view addSubview:subview]; 271 data->removeFromSuperviewSoon = false;264 m_data->removeFromSuperviewSoon = false; 272 265 [window _setNeedsToResetDragMargins:resetDragMargins]; 273 266 … … 277 270 void Widget::removeFromSuperview() 278 271 { 279 if ( data->mustStayInWindow)280 data->removeFromSuperviewSoon = true;272 if (m_data->mustStayInWindow) 273 m_data->removeFromSuperviewSoon = true; 281 274 else { 282 data->removeFromSuperviewSoon = false;275 m_data->removeFromSuperviewSoon = false; 283 276 BEGIN_BLOCK_OBJC_EXCEPTIONS; 284 277 safeRemoveFromSuperview(getOuterView()); … … 291 284 if (widget) { 292 285 ASSERT(view == widget->getOuterView()); 293 ASSERT(!widget-> data->mustStayInWindow);294 widget-> data->mustStayInWindow = true;286 ASSERT(!widget->m_data->mustStayInWindow); 287 widget->m_data->mustStayInWindow = true; 295 288 } 296 289 } … … 303 296 END_BLOCK_OBJC_EXCEPTIONS; 304 297 } else { 305 ASSERT(widget-> data->mustStayInWindow);306 widget-> data->mustStayInWindow = false;307 if (widget-> data->removeFromSuperviewSoon)298 ASSERT(widget->m_data->mustStayInWindow); 299 widget->m_data->mustStayInWindow = false; 300 if (widget->m_data->removeFromSuperviewSoon) 308 301 widget->removeFromSuperview(); 309 302 } -
trunk/WebCore/platform/qt/WidgetQt.cpp
r36645 r36647 54 54 namespace WebCore { 55 55 56 Widget::Widget()57 {58 init();59 }60 61 56 Widget::Widget(QWidget* widget) 62 57 { 63 init(); 64 m_widget = widget; 58 init(widget); 65 59 } 66 60 -
trunk/WebCore/platform/win/WidgetWin.cpp
r36645 r36647 39 39 namespace WebCore { 40 40 41 Widget::Widget()42 {43 init();44 }45 46 41 Widget::Widget(PlatformWidget widget) 47 42 { 48 init(); 49 m_widget = widget; 43 init(widget); 50 44 } 51 45 -
trunk/WebCore/platform/wx/WidgetWx.cpp
r36645 r36647 35 35 namespace WebCore { 36 36 37 Widget::Widget()38 {39 init();40 }41 42 37 Widget::Widget(PlatformWidget widget) 43 38 { 44 init(); 45 m_widget = widget; 39 init(widget); 46 40 } 47 41
Note: See TracChangeset
for help on using the changeset viewer.