Changeset 48029 in webkit
- Timestamp:
- Sep 3, 2009 12:38:11 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r48028 r48029 1 2009-09-03 Kevin Watters <kevinwatters@gmail.com> 2 3 Reviewed by Kevin Ollivier. 4 5 [wx] Frames support 6 https://bugs.webkit.org/show_bug.cgi?id=19041 7 8 * page/wx/EventHandlerWx.cpp: 9 (WebCore::EventHandler::passMousePressEventToSubframe): 10 (WebCore::EventHandler::passMouseMoveEventToSubframe): 11 (WebCore::EventHandler::passMouseReleaseEventToSubframe): 12 (WebCore::EventHandler::passWheelEventToWidget): 13 (WebCore::EventHandler::tabsToAllControls): 14 (WebCore::EventHandler::passSubframeEventToSubframe): 15 (WebCore::EventHandler::passMouseDownEventToWidget): 16 * platform/wx/RenderThemeWx.cpp: 17 (WebCore::nativeWindowForRenderObject): 18 (WebCore::RenderThemeWx::paintButton): 19 (WebCore::RenderThemeWx::paintTextField): 20 (WebCore::RenderThemeWx::paintMenuList): 21 (WebCore::RenderThemeWx::paintMenuListButton): 22 * platform/wx/ScrollbarThemeWx.cpp: Added. 23 (WebCore::ScrollbarTheme::nativeTheme): 24 (WebCore::ScrollbarThemeWx::~ScrollbarThemeWx): 25 (WebCore::ScrollbarThemeWx::scrollbarThickness): 26 (WebCore::ScrollbarThemeWx::hasThumb): 27 (WebCore::ScrollbarThemeWx::buttonSize): 28 (WebCore::ScrollbarThemeWx::backButtonRect): 29 (WebCore::ScrollbarThemeWx::forwardButtonRect): 30 (WebCore::ScrollbarThemeWx::trackRect): 31 (WebCore::ScrollbarThemeWx::paintScrollCorner): 32 (WebCore::ScrollbarThemeWx::paint): 33 * platform/wx/ScrollbarThemeWx.h: Added. 34 (WebCore::ScrollbarThemeWx::hasButtons): 35 * platform/wx/TemporaryLinkStubs.cpp: 36 * platform/wx/wxcode/gtk/scrollbar_render.cpp: Added. 37 (wxStyleForPart): 38 (GetButtonWidget): 39 (wxGetGdkWindowForDC): 40 (wxRenderer_DrawScrollbar): 41 * platform/wx/wxcode/mac/carbon/scrollbar_render.cpp: Added. 42 (wxScrollbarPartToHIPressedState): 43 (wxRenderer_DrawScrollbar): 44 * platform/wx/wxcode/scrollbar_render.h: Added. 45 (calcThumbStartAndLength): 46 * platform/wx/wxcode/win/non-kerned-drawing.cpp: 47 (WebCore::drawTextWithSpacing): 48 * platform/wx/wxcode/win/scrollbar_render.cpp: Added. 49 (GraphicsHDC::GraphicsHDC): 50 (GraphicsHDC::~GraphicsHDC): 51 (GraphicsHDC::operator HDC): 52 (getTSStateForPart): 53 (wxRenderer_DrawScrollbar): 54 * webcore-wx.bkl: 55 1 56 2009-09-03 Yael Aharon <yael.aharon@nokia.com> 2 57 -
trunk/WebCore/page/wx/EventHandlerWx.cpp
r46592 r48029 33 33 #include "KeyboardEvent.h" 34 34 #include "MouseEventWithHitTestResults.h" 35 #include "NotImplemented.h" 35 36 #include "Page.h" 36 37 #include "PlatformKeyboardEvent.h" … … 44 45 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) 45 46 { 46 return passSubframeEventToSubframe(mev, subframe); 47 subframe->eventHandler()->handleMousePressEvent(mev.event()); 48 return true; 47 49 } 48 50 49 51 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, WebCore::HitTestResult* hittest) 50 52 { 51 return passSubframeEventToSubframe(mev, subframe); 53 subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hittest); 54 return true; 52 55 } 53 56 54 57 bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) 55 58 { 56 return passSubframeEventToSubframe(mev, subframe); 59 subframe->eventHandler()->handleMouseReleaseEvent(mev.event()); 60 return true; 57 61 } 58 62 … … 69 73 { 70 74 return passMouseDownEventToWidget(renderWidget->widget()); 75 } 76 77 bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget) 78 { 79 if (!widget || !widget->isFrameView()) 80 return false; 81 82 return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(event); 83 } 84 85 bool EventHandler::tabsToAllControls(KeyboardEvent* event) const 86 { 87 notImplemented(); 88 return false; 89 } 90 91 bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult*) 92 { 93 notImplemented(); 94 return false; 95 } 96 97 bool EventHandler::passMouseDownEventToWidget(Widget*) 98 { 99 notImplemented(); 100 return false; 71 101 } 72 102 -
trunk/WebCore/platform/wx/RenderThemeWx.cpp
r44834 r48029 30 30 #include "FrameView.h" 31 31 #include "GraphicsContext.h" 32 #include "HostWindow.h" 32 33 #include "NotImplemented.h" 33 34 #include "RenderView.h" … … 138 139 return rt; 139 140 } 141 142 wxWindow* nativeWindowForRenderObject(RenderObject* o) 143 { 144 FrameView* frameView = o->view()->frameView(); 145 ASSERT(frameView); 146 ASSERT(frameView->hostWindow()); 147 return frameView->hostWindow()->platformWindow(); 148 } 149 140 150 141 151 bool RenderThemeWx::isControlStyled(const RenderStyle* style, const BorderData& border, … … 252 262 bool RenderThemeWx::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 253 263 { 254 wxWindow* window = o->view()->frameView()->platformWidget();264 wxWindow* window = nativeWindowForRenderObject(o); 255 265 wxDC* dc = static_cast<wxDC*>(i.context->platformContext()); 256 266 int flags = 0; 257 267 268 IntRect rect = r; 269 270 #if USE(WXGC) 271 double xtrans = 0; 272 double ytrans = 0; 273 274 wxGCDC* gcdc = static_cast<wxGCDC*>(dc); 275 wxGraphicsContext* gc = gcdc->GetGraphicsContext(); 276 gc->GetTransform().TransformPoint(&xtrans, &ytrans); 277 rect.setX(r.x() + (int)xtrans); 278 rect.setY(r.y() + (int)ytrans); 279 #endif 280 258 281 if (!isEnabled(o)) 259 282 flags |= wxCONTROL_DISABLED; … … 267 290 268 291 if (part == PushButtonPart || part == ButtonPart) 269 wxRendererNative::Get().DrawPushButton(window, *dc, r , flags);292 wxRendererNative::Get().DrawPushButton(window, *dc, rect, flags); 270 293 else if(part == RadioPart) { 271 294 if (isChecked(o)) 272 295 flags |= wxCONTROL_CHECKED; 273 296 #if wxCHECK_VERSION(2,9,0) 274 wxRendererNative::Get().DrawRadioButton(window, *dc, r , flags);275 #else 276 wxRenderer_DrawRadioButton(window, *dc, r , flags);297 wxRendererNative::Get().DrawRadioButton(window, *dc, rect, flags); 298 #else 299 wxRenderer_DrawRadioButton(window, *dc, rect, flags); 277 300 #endif 278 301 } … … 280 303 if (isChecked(o)) 281 304 flags |= wxCONTROL_CHECKED; 282 wxRendererNative::Get().DrawCheckBox(window, *dc, r , flags);305 wxRendererNative::Get().DrawCheckBox(window, *dc, rect, flags); 283 306 } 284 307 return false; … … 292 315 bool RenderThemeWx::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 293 316 { 294 wxWindow* window = o->view()->frameView()->platformWidget();317 wxWindow* window = nativeWindowForRenderObject(o); 295 318 wxDC* dc = static_cast<wxDC*>(i.context->platformContext()); 296 319 #if wxCHECK_VERSION(2,9,0) … … 314 337 bool RenderThemeWx::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 315 338 { 316 wxWindow* window = o->view()->frameView()->platformWidget();339 wxWindow* window = nativeWindowForRenderObject(o); 317 340 wxDC* dc = static_cast<wxDC*>(i.context->platformContext()); 318 341 … … 343 366 bool RenderThemeWx::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 344 367 { 345 wxWindow* window = o->view()->frameView()->platformWidget();368 wxWindow* window = nativeWindowForRenderObject(o); 346 369 wxDC* dc = static_cast<wxDC*>(i.context->platformContext()); 347 370 -
trunk/WebCore/platform/wx/TemporaryLinkStubs.cpp
r47980 r48029 114 114 void Image::drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, const FloatPoint& phase, CompositeOperator, const FloatRect& destRect) { notImplemented(); } 115 115 116 ScrollbarTheme* ScrollbarTheme::nativeTheme() { notImplemented(); static ScrollbarTheme theme; return &theme; }117 118 116 String FileChooser::basenameForWidth(const Font&, int width) const { notImplemented(); return String(); } 119 117 … … 126 124 void Editor::showFontPanel() { notImplemented(); } 127 125 void Editor::showStylesPanel() { notImplemented(); } 128 129 bool EventHandler::tabsToAllControls(KeyboardEvent* event) const { notImplemented(); return false; }130 bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult*) { notImplemented(); return false; }131 bool EventHandler::passMouseDownEventToWidget(Widget*) { notImplemented(); return false; }132 bool EventHandler::passWheelEventToWidget(PlatformWheelEvent&, Widget*) { notImplemented(); return false; }133 126 134 127 void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) { notImplemented(); } -
trunk/WebCore/platform/wx/wxcode/win/non-kerned-drawing.cpp
r43261 r48029 80 80 // get the native HDC handle to draw using native APIs 81 81 HDC hdc = 0; 82 float y = point.y() - font->ascent(); 83 float x = point.x(); 84 82 85 #if USE(WXGC) 86 // when going from GdiPlus -> Gdi, any GdiPlus transformations are lost 87 // so we need to alter the coordinates to reflect their transformed point. 88 double xtrans = 0; 89 double ytrans = 0; 90 83 91 wxGraphicsContext* gc = dc->GetGraphicsContext(); 92 gc->GetTransform().TransformPoint(&xtrans, &ytrans); 84 93 Gdiplus::Graphics* g; 85 94 if (gc) { … … 87 96 hdc = g->GetHDC(); 88 97 } 98 x += (int)xtrans; 99 y += (int)ytrans; 89 100 #else 90 101 hdc = static_cast<HDC>(dc->GetHDC()); … … 95 106 const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from); 96 107 const GlyphBufferAdvance* advances = glyphBuffer.advances(from); 97 98 float y = point.y() - font->ascent();99 float x = point.x();100 108 101 109 int* spacing = new int[numGlyphs - from]; -
trunk/WebCore/webcore-wx.bkl
r47127 r48029 112 112 platform/wx/wxcode/gtk/fontprops.cpp 113 113 platform/wx/wxcode/gtk/non-kerned-drawing.cpp 114 platform/wx/wxcode/gtk/scrollbar_render.cpp 114 115 platform/wx/SharedTimerWx.cpp 115 116 </if> … … 118 119 platform/wx/wxcode/mac/carbon/fontprops.cpp 119 120 platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp 121 platform/wx/wxcode/mac/carbon/scrollbar_render.cpp 120 122 platform/wx/SharedTimerWx.cpp 121 123 </if> … … 123 125 platform/wx/wxcode/win/fontprops.cpp 124 126 platform/wx/wxcode/win/non-kerned-drawing.cpp 127 platform/wx/wxcode/win/scrollbar_render.cpp 125 128 <!-- grab the windows port's SharedTimer implementation --> 126 129 platform/win/SharedTimerWin.cpp -
trunk/WebKit/wx/ChangeLog
r47983 r48029 1 2009-09-03 Kevin Watters <kevinwatters@gmail.com> 2 3 Reviewed by Kevin Ollivier. 4 5 [wx] Frames support 6 https://bugs.webkit.org/show_bug.cgi?id=19041 7 8 * WebFrame.cpp: 9 (wxWebFrame::wxWebFrame): 10 (wxWebFrame::~wxWebFrame): 11 (wxWebFrame::GetFrame): 12 * WebFrame.h: 13 * WebFramePrivate.h: 14 * WebKitSupport/ChromeClientWx.cpp: 15 (WebCore::ChromeClientWx::platformWindow): 16 (WebCore::ChromeClientWx::scroll): 17 * WebKitSupport/EditorClientWx.cpp: 18 (WebCore::EditorClientWx::isEditable): 19 (WebCore::EditorClientWx::registerCommandForUndo): 20 (WebCore::EditorClientWx::registerCommandForRedo): 21 (WebCore::EditorClientWx::clearUndoRedoOperations): 22 (WebCore::EditorClientWx::canUndo): 23 (WebCore::EditorClientWx::canRedo): 24 (WebCore::EditorClientWx::undo): 25 (WebCore::EditorClientWx::redo): 26 * WebKitSupport/FrameLoaderClientWx.cpp: 27 (WebCore::FrameLoaderClientWx::FrameLoaderClientWx): 28 (WebCore::FrameLoaderClientWx::setFrame): 29 (WebCore::FrameLoaderClientWx::dispatchWillSubmitForm): 30 (WebCore::FrameLoaderClientWx::frameLoaderDestroyed): 31 (WebCore::FrameLoaderClientWx::committedLoad): 32 (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForMIMEType): 33 (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNewWindowAction): 34 (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction): 35 (WebCore::FrameLoaderClientWx::createFrame): 36 (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage): 37 * WebKitSupport/FrameLoaderClientWx.h: 38 * WebView.h: 39 * WebViewPrivate.h: 40 1 41 2009-09-02 Kevin Ollivier <kevino@theolliviers.com> 2 42 -
trunk/WebKit/wx/WebFrame.cpp
r47977 r48029 75 75 m_isEditable(false), 76 76 m_isInitialized(false), 77 m_beingDestroyed(false), 78 m_title(wxEmptyString) 77 m_beingDestroyed(false) 79 78 { 80 79 … … 88 87 89 88 WebCore::FrameLoaderClientWx* loaderClient = new WebCore::FrameLoaderClientWx(); 90 91 m_impl->frame = WebCore::Frame::create(container->m_impl->page, parentFrame, loaderClient); 92 m_impl->frame ->deref();93 94 loaderClient->setFrame( m_impl->frame.get());89 RefPtr<WebCore::Frame> newFrame = WebCore::Frame::create(container->m_impl->page, parentFrame, loaderClient); 90 91 m_impl->frame = newFrame.get(); 92 93 loaderClient->setFrame(this); 95 94 loaderClient->setWebView(container); 96 95 96 if (data && data->ownerElement) 97 m_impl->frame->ref(); 98 97 99 m_impl->frame->init(); 98 100 … … 102 104 wxWebFrame::~wxWebFrame() 103 105 { 104 m_impl->frame->loader()->detachFromParent(); 106 if (m_impl) 107 delete m_impl; 105 108 } 106 109 … … 108 111 { 109 112 if (m_impl) 110 return m_impl->frame .get();113 return m_impl->frame; 111 114 112 115 return 0; -
trunk/WebKit/wx/WebFrame.h
r43260 r48029 147 147 void MakeEditable(bool enable); 148 148 bool IsEditable() const { return m_isEditable; } 149 150 wxString GetPageTitle() const { return m_title; }151 void SetPageTitle(const wxString& title) { m_title = title; }152 149 153 150 WebCore::Frame* GetFrame(); … … 161 158 bool m_beingDestroyed; 162 159 WebFramePrivate* m_impl; 163 wxString m_title;164 160 165 161 }; -
trunk/WebKit/wx/WebFramePrivate.h
r38687 r48029 31 31 32 32 #include "config.h" 33 #include "EditCommand.h"34 #include "EditCommandWx.h"35 33 #include "Frame.h" 36 #include " wtf/RefPtr.h"37 #include " wtf/Vector.h"34 #include "HTMLFrameOwnerElement.h" 35 #include "KURL.h" 38 36 39 37 class WebFramePrivate { … … 43 41 frame(0) 44 42 {} 43 44 WebCore::Frame* frame; 45 }; 45 46 46 WTF::Vector<EditCommandWx> undoStack; 47 WTF::Vector<EditCommandWx> redoStack; 47 class WebViewFrameData 48 { 49 public: 50 WebCore::KURL url; 51 WebCore::String name; 52 WebCore::HTMLFrameOwnerElement* ownerElement; 48 53 49 WTF::RefPtr<WebCore::Frame> frame; 54 WebCore::String referrer; 55 bool allowsScrolling; 56 int marginWidth; 57 int marginHeight; 50 58 }; 51 59 -
trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
r46344 r48029 341 341 PlatformWidget ChromeClientWx::platformWindow() const 342 342 { 343 return 0;343 return m_webView; 344 344 } 345 345 … … 394 394 void ChromeClientWx::scroll(const IntSize&, const IntRect&, const IntRect&) 395 395 { 396 m_webView->Refresh(); 396 397 notImplemented(); 397 398 } -
trunk/WebKit/wx/WebKitSupport/EditorClientWx.cpp
r43987 r48029 203 203 204 204 if (frame) { 205 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());205 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 206 206 if (webKitWin) 207 207 return webKitWin->IsEditable(); … … 286 286 287 287 if (frame) { 288 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());288 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 289 289 if (webKitWin) { 290 webKitWin-> GetMainFrame()->m_impl->undoStack.append(EditCommandWx(command));290 webKitWin->m_impl->undoStack.append(EditCommandWx(command)); 291 291 } 292 292 } … … 298 298 299 299 if (frame) { 300 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());300 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 301 301 if (webKitWin) { 302 webKitWin-> GetMainFrame()->m_impl->redoStack.insert(0, EditCommandWx(command));302 webKitWin->m_impl->redoStack.insert(0, EditCommandWx(command)); 303 303 } 304 304 } … … 307 307 void EditorClientWx::clearUndoRedoOperations() 308 308 { 309 notImplemented(); 309 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 310 311 if (frame) { 312 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 313 if (webKitWin) { 314 webKitWin->m_impl->redoStack.clear(); 315 webKitWin->m_impl->undoStack.clear(); 316 } 317 } 310 318 } 311 319 … … 315 323 316 324 if (frame) { 317 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());318 if (webKitWin && webKitWin->GetMainFrame()) {319 return webKitWin-> GetMainFrame()->m_impl->undoStack.size() != 0;325 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 326 if (webKitWin) { 327 return webKitWin->m_impl->undoStack.size() != 0; 320 328 } 321 329 } … … 328 336 329 337 if (frame) { 330 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());331 if (webKitWin && webKitWin ->GetMainFrame()) {332 return webKitWin-> GetMainFrame()->m_impl->redoStack.size() != 0;338 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 339 if (webKitWin && webKitWin) { 340 return webKitWin->m_impl->redoStack.size() != 0; 333 341 } 334 342 } … … 341 349 342 350 if (frame) { 343 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());344 if (webKitWin && webKitWin->GetMainFrame()) {345 webKitWin-> GetMainFrame()->m_impl->undoStack.last().editCommand()->unapply();346 webKitWin-> GetMainFrame()->m_impl->undoStack.removeLast();351 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 352 if (webKitWin) { 353 webKitWin->m_impl->undoStack.last().editCommand()->unapply(); 354 webKitWin->m_impl->undoStack.removeLast(); 347 355 } 348 356 } … … 353 361 Frame* frame = m_page->focusController()->focusedOrMainFrame(); 354 362 355 if (frame) { 356 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()-> platformWidget());357 if (webKitWin && webKitWin->GetMainFrame()) {358 webKitWin-> GetMainFrame()->m_impl->redoStack.first().editCommand()->reapply();359 webKitWin-> GetMainFrame()->m_impl->redoStack.remove(0);363 if (frame) { 364 wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformWindow()); 365 if (webKitWin) { 366 webKitWin->m_impl->redoStack.first().editCommand()->reapply(); 367 webKitWin->m_impl->redoStack.remove(0); 360 368 } 361 369 } -
trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
r45679 r48029 49 49 #include "ScriptController.h" 50 50 #include "ScriptString.h" 51 #include <wtf/PassRefPtr.h> 52 #include <wtf/RefPtr.h> 51 53 52 54 #include <stdio.h> 53 55 54 56 #include "WebFrame.h" 57 #include "WebFramePrivate.h" 55 58 #include "WebView.h" 56 59 #include "WebViewPrivate.h" … … 78 81 79 82 FrameLoaderClientWx::FrameLoaderClientWx() 80 : m_ frame(0)83 : m_webFrame(0) 81 84 { 82 85 } … … 87 90 } 88 91 89 void FrameLoaderClientWx::setFrame(Frame *frame) 90 { 91 m_frame = frame; 92 void FrameLoaderClientWx::setFrame(wxWebFrame *frame) 93 { 94 m_webFrame = frame; 95 m_frame = m_webFrame->m_impl->frame; 92 96 } 93 97 … … 95 99 { 96 100 m_webView = webview; 97 }98 99 void FrameLoaderClientWx::detachFrameLoader()100 {101 m_frame = 0;102 101 } 103 102 … … 340 339 { 341 340 // FIXME: Send an event to allow for alerts and cancellation 342 if (!m_ frame)341 if (!m_webFrame) 343 342 return; 344 343 (m_frame->loader()->*function)(PolicyUse); … … 506 505 void FrameLoaderClientWx::frameLoaderDestroyed() 507 506 { 507 if (m_webFrame) 508 delete m_webFrame; 509 m_webFrame = 0; 508 510 m_frame = 0; 509 511 delete this; … … 554 556 void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) 555 557 { 556 if (!m_ frame)558 if (!m_webFrame) 557 559 return; 558 560 FrameLoader* fl = loader->frameLoader(); … … 694 696 void FrameLoaderClientWx::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& mimetype, const ResourceRequest& request) 695 697 { 696 if (!m_ frame)698 if (!m_webFrame) 697 699 return; 698 700 … … 703 705 void FrameLoaderClientWx::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest& request, PassRefPtr<FormState>, const String& targetName) 704 706 { 705 if (!m_ frame)707 if (!m_webFrame) 706 708 return; 707 709 … … 723 725 void FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>) 724 726 { 725 if (!m_ frame)727 if (!m_webFrame) 726 728 return; 727 729 … … 753 755 const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) 754 756 { 755 /*756 FIXME: Temporarily disabling code for loading subframes. While most757 (i)frames load and are destroyed properly, the iframe created by758 google.com in its new homepage does not get destroyed when759 document()->detach() is called, as other (i)frames do. It is destroyed on760 app shutdown, but until that point, this 'in limbo' frame will do things761 like steal keyboard focus and crash when clicked on. (On some platforms,762 it is actually a visible object, even though it's not in a valid state.)763 764 Since just about every user is probably going to test against Google at765 some point, I'm disabling this functionality until I have time to track down766 why it is not being destroyed.767 */768 769 /*770 wxWindow* parent = m_webView;771 772 757 WebViewFrameData* data = new WebViewFrameData(); 773 758 data->name = name; … … 775 760 data->url = url; 776 761 data->referrer = referrer; 762 data->allowsScrolling = allowsScrolling; 777 763 data->marginWidth = marginWidth; 778 764 data->marginHeight = marginHeight; 779 765 780 wxWeb View* newWin = new wxWebView(parent, -1, wxDefaultPosition, wxDefaultSize, data);781 782 RefPtr<Frame> childFrame = newWin->m_impl->frame;783 784 // FIXME: All of the below should probably be moved over into WebCore766 wxWebFrame* newFrame = new wxWebFrame(m_webView, m_webFrame, data); 767 768 RefPtr<Frame> childFrame = adoptRef(newFrame->m_impl->frame); 769 770 m_frame->tree()->appendChild(childFrame); 785 771 childFrame->tree()->setName(name); 786 m_frame->tree()->appendChild(childFrame); 787 // ### set override encoding if we have one 788 789 FrameLoadType loadType = m_frame->loader()->loadType(); 790 FrameLoadType childLoadType = FrameLoadTypeInternal; 791 792 childFrame->loader()->load(url, referrer, childLoadType, 793 String(), 0, 0); 772 childFrame->init(); 773 774 // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. 775 if (!childFrame->page()) 776 return 0; 777 778 childFrame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get()); 794 779 795 780 // The frame's onload handler may have removed it from the document. … … 797 782 return 0; 798 783 799 delete data; 800 801 return childFrame.get(); 802 */ 803 notImplemented(); 804 return 0; 784 return childFrame.release(); 805 785 } 806 786 … … 881 861 void FrameLoaderClientWx::transitionToCommittedForNewPage() 882 862 { 863 ASSERT(m_webFrame); 883 864 ASSERT(m_frame); 884 865 ASSERT(m_webView); 885 866 886 Page* page = m_frame->page(); 887 ASSERT(page); 888 889 bool isMainFrame = m_frame == page->mainFrame(); 890 891 m_frame->setView(0); 892 893 RefPtr<FrameView> frameView; 894 if (isMainFrame) 895 frameView = FrameView::create(m_frame, IntRect(m_webView->GetRect()).size()); 896 else 897 frameView = FrameView::create(m_frame); 898 899 ASSERT(frameView); 900 m_frame->setView(frameView); 901 902 frameView->setPlatformWidget(m_webView); 903 904 if (HTMLFrameOwnerElement* owner = m_frame->ownerElement()) 905 m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode()); 906 } 907 908 } 867 IntSize size = IntRect(m_webView->GetRect()).size(); 868 // FIXME: This value should be gotten from m_webView->IsTransparent(); 869 // but transitionToCommittedForNewPage() can be called while m_webView is 870 // still being initialized. 871 bool transparent = false; 872 Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white; 873 874 if (m_frame) 875 m_frame->createView(size, backgroundColor, transparent, IntSize(), false); 876 } 877 878 } -
trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
r45679 r48029 34 34 #include "ResourceResponse.h" 35 35 36 class wxWebFrame; 36 37 class wxWebView; 37 38 … … 52 53 FrameLoaderClientWx(); 53 54 ~FrameLoaderClientWx(); 54 void setFrame( Frame *frame);55 void setFrame(wxWebFrame *frame); 55 56 void setWebView(wxWebView *webview); 56 virtual void detachFrameLoader();57 57 58 58 virtual bool hasWebView() const; // mainly for assertions … … 208 208 209 209 private: 210 Frame *m_frame; 210 wxWebFrame *m_webFrame; 211 Frame* m_frame; 211 212 wxWebView *m_webView; 212 213 ResourceResponse m_response; -
trunk/WebKit/wx/WebView.cpp
r47981 r48029 235 235 EVT_SET_FOCUS(wxWebView::OnSetFocus) 236 236 EVT_KILL_FOCUS(wxWebView::OnKillFocus) 237 EVT_ACTIVATE(wxWebView::OnActivate)238 237 END_EVENT_TABLE() 239 238 … … 267 266 if ( (style & wxBORDER_MASK) == 0) 268 267 style |= wxBORDER_NONE; 269 style |= wxHSCROLL | wxVSCROLL;270 268 271 269 if (!wxWindow::Create(parent, id, position, size, style, name)) … … 316 314 m_beingDestroyed = true; 317 315 318 delete m_mainFrame; 316 if (m_mainFrame && m_mainFrame->GetFrame()) 317 m_mainFrame->GetFrame()->loader()->detachFromParent(); 319 318 320 319 delete m_impl->page; … … 488 487 void wxWebView::OnPaint(wxPaintEvent& event) 489 488 { 490 491 489 if (m_beingDestroyed || !m_mainFrame) 492 490 return; 493 491 492 // WebView active state is based on TLW active state. 493 wxTopLevelWindow* tlw = dynamic_cast<wxTopLevelWindow*>(wxGetTopLevelParent(this)); 494 if (tlw && tlw->IsActive()) 495 m_impl->page->focusController()->setActive(true); 496 else { 497 m_impl->page->focusController()->setActive(false); 498 } 494 499 WebCore::Frame* frame = m_mainFrame->GetFrame(); 495 500 if (!frame || !frame->view()) … … 505 510 if (dc.IsOk()) { 506 511 wxRect paintRect = GetUpdateRegion().GetBox(); 507 508 WebCore::IntSize offset = frame->view()->scrollOffset();509 #if USE(WXGC)510 gcdc.SetDeviceOrigin(-offset.width(), -offset.height());511 #endif512 dc.SetDeviceOrigin(-offset.width(), -offset.height());513 paintRect.Offset(offset.width(), offset.height());514 512 515 513 #if USE(WXGC) … … 519 517 #endif 520 518 if (frame->contentRenderer()) { 521 if (frame->view()->needsLayout()) 522 frame->view()->layout(); 523 524 frame->view()->paintContents(&gc, paintRect); 519 frame->view()->layoutIfNeededRecursive(); 520 frame->view()->paint(&gc, paintRect); 525 521 } 526 522 } … … 540 536 if (m_isInitialized && m_mainFrame) { 541 537 WebCore::Frame* frame = m_mainFrame->GetFrame(); 542 frame-> eventHandler()->sendResizeEvent();543 frame->view()-> layout();544 frame->view()->adjust Scrollbars();538 frame->view()->setFrameRect(wxRect(wxPoint(0,0), event.GetSize())); 539 frame->view()->forceLayout(); 540 frame->view()->adjustViewSize(); 545 541 } 546 542 … … 561 557 event.Skip(); 562 558 563 if (m_beingDestroyed) 564 return; 565 566 if (!m_mainFrame) 559 if (!m_impl->page) 567 560 return; 568 561 … … 612 605 wxPoint localEventPoint = ScreenToClient(event.GetPosition()); 613 606 614 if (!m_ mainFrame)607 if (!m_impl->page) 615 608 return; 616 609 617 WebCore::Frame* focusedFrame = m_ mainFrame->GetFrame();610 WebCore::Frame* focusedFrame = m_impl->page->focusController()->focusedOrMainFrame(); 618 611 if (!focusedFrame->view()) 619 612 return; … … 695 688 { 696 689 WebCore::Frame* frame = 0; 697 if (m_ mainFrame)698 frame = m_ mainFrame->GetFrame();690 if (m_impl->page) 691 frame = m_impl->page->focusController()->focusedOrMainFrame(); 699 692 700 693 if (!(frame && frame->view())) … … 837 830 838 831 if (frame) { 839 m_impl->page->focusController()->setActive(true);840 832 frame->selection()->setFocused(true); 841 833 } … … 851 843 852 844 if (frame) { 853 m_impl->page->focusController()->setActive(false);854 845 frame->selection()->setFocused(false); 855 846 } … … 857 848 } 858 849 859 void wxWebView::OnActivate(wxActivateEvent& event)860 {861 if (m_impl->page)862 m_impl->page->focusController()->setActive(event.GetActive());863 864 event.Skip();865 }866 867 850 wxWebViewDOMElementInfo wxWebView::HitTest(const wxPoint& pos) const 868 851 { -
trunk/WebKit/wx/WebView.h
r44060 r48029 172 172 void OnSetFocus(wxFocusEvent& event); 173 173 void OnKillFocus(wxFocusEvent& event); 174 void OnActivate(wxActivateEvent& event);175 174 176 175 private: -
trunk/WebKit/wx/WebViewPrivate.h
r44060 r48029 31 31 32 32 #include "config.h" 33 #include "HTMLFrameOwnerElement.h" 33 #include "EditCommand.h" 34 #include "EditCommandWx.h" 34 35 #include "Page.h" 35 #include "wtf/RefPtr.h" 36 #include "KURL.h" 36 #include "wtf/Vector.h" 37 37 38 38 #include <wx/timer.h> … … 49 49 wxTimer tripleClickTimer; 50 50 wxPoint tripleClickPos; 51 };52 53 class WebViewFrameData54 {55 public:56 WebCore::KURL url;57 WebCore::String name;58 WebCore::HTMLFrameOwnerElement* ownerElement;59 51 60 WebCore::String referrer; 61 bool allowsScrolling; 62 int marginWidth; 63 int marginHeight; 52 WTF::Vector<EditCommandWx> undoStack; 53 WTF::Vector<EditCommandWx> redoStack; 64 54 }; 65 55 -
trunk/WebKitTools/ChangeLog
r48027 r48029 1 2009-09-03 Kevin Watters <kevinwatters@gmail.com> 2 3 Reviewed by Kevin Ollivier. 4 5 [wx] Frames support 6 https://bugs.webkit.org/show_bug.cgi?id=19041 7 8 * wx/build-wxwebkit: 9 1 10 2009-09-02 David Kilzer <ddkilzer@apple.com> 2 11 -
trunk/WebKitTools/wx/build-wxwebkit
r43844 r48029 369 369 PY_LIBDIR="$PY_LIBDIR\\Libs" 370 370 PY_LIB=`python -c "import sys; sys.stdout.write('python' + sys.version[:3])"` 371 PY_LIB=`python -c " sys.stdout.write('$PY_LIB'.replace('.', ''))"`371 PY_LIB=`python -c "import sys; sys.stdout.write('$PY_LIB'.replace('.', ''))"` 372 372 else 373 373 PY_LIB=`python-config --libs`
Note: See TracChangeset
for help on using the changeset viewer.