equal
deleted
inserted
replaced
50 #include "Settings.h" |
50 #include "Settings.h" |
51 #include "npruntime_impl.h" |
51 #include "npruntime_impl.h" |
52 #include "runtime.h" |
52 #include "runtime.h" |
53 #include "runtime_root.h" |
53 #include "runtime_root.h" |
54 #include "QWebPageClient.h" |
54 #include "QWebPageClient.h" |
|
55 #include "qgraphicswebview.h" |
|
56 #include <QGraphicsProxyWidget> |
55 #include <QKeyEvent> |
57 #include <QKeyEvent> |
56 #include <QPixmap> |
58 #include <QPixmap> |
57 #include <QRegion> |
59 #include <QRegion> |
58 #include <QVector> |
60 #include <QVector> |
59 #include <QWidget> |
61 #include <QWidget> |
82 FrameView* frameView = static_cast<FrameView*>(parent()); |
84 FrameView* frameView = static_cast<FrameView*>(parent()); |
83 IntRect oldWindowRect = m_windowRect; |
85 IntRect oldWindowRect = m_windowRect; |
84 IntRect oldClipRect = m_clipRect; |
86 IntRect oldClipRect = m_clipRect; |
85 |
87 |
86 m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size()); |
88 m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size()); |
|
89 |
87 m_clipRect = windowClipRect(); |
90 m_clipRect = windowClipRect(); |
88 m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); |
91 m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); |
89 if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect) |
92 if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect) |
90 return; |
93 return; |
91 |
94 |
423 |
426 |
424 show(); |
427 show(); |
425 |
428 |
426 if (m_isWindowed) { |
429 if (m_isWindowed) { |
427 QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient(); |
430 QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient(); |
428 // FIXME this will not work for QGraphicsView. |
431 QGraphicsProxyWidget* proxy = 0; |
429 // But we cannot use winId because it will create a window and on S60, |
432 if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(client->pluginParent())) |
430 // QWidgets should not create a window. |
433 proxy = new QGraphicsProxyWidget(webView); |
431 Q_ASSERT(qobject_cast<QWidget*>(client->pluginParent())); |
434 |
432 setPlatformWidget(new PluginContainerSymbian(this, |
435 PluginContainerSymbian* container = new PluginContainerSymbian(this, proxy ? 0 : client->ownerWidget(), proxy); |
433 qobject_cast<QWidget*>(client->pluginParent()))); |
436 setPlatformWidget(container); |
|
437 if (proxy) |
|
438 proxy->setWidget(container); |
|
439 |
434 m_npWindow.type = NPWindowTypeWindow; |
440 m_npWindow.type = NPWindowTypeWindow; |
435 m_npWindow.window = (void*)platformPluginWidget(); |
441 m_npWindow.window = (void*)platformPluginWidget(); |
436 |
442 |
437 } else { |
443 } else { |
438 setPlatformWidget(0); |
444 setPlatformWidget(0); |
444 return true; |
450 return true; |
445 } |
451 } |
446 |
452 |
447 void PluginView::platformDestroy() |
453 void PluginView::platformDestroy() |
448 { |
454 { |
449 delete platformPluginWidget(); |
455 QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient(); |
|
456 if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(client->pluginParent())) |
|
457 delete static_cast<PluginContainerSymbian*>(platformPluginWidget())->proxy(); |
|
458 else |
|
459 delete platformPluginWidget(); |
450 } |
460 } |
451 |
461 |
452 void PluginView::halt() |
462 void PluginView::halt() |
453 { |
463 { |
454 } |
464 } |