本文整理汇总了C++中webcore::Frame::view方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::view方法的具体用法?C++ Frame::view怎么用?C++ Frame::view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::Frame
的用法示例。
在下文中一共展示了Frame::view方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
void wxWebView::OnPaint(wxPaintEvent& event)
{
if (m_beingDestroyed || !m_mainFrame)
return;
WebCore::Frame* frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
wxAutoBufferedPaintDC dc(this);
if (IsShown() && frame->document()) {
#if USE(WXGC)
wxGCDC gcdc(dc);
#endif
if (dc.IsOk()) {
wxRect paintRect = GetUpdateRegion().GetBox();
#if USE(WXGC)
WebCore::GraphicsContext gc(&gcdc);
#else
WebCore::GraphicsContext gc(&dc);
#endif
if (frame->contentRenderer()) {
frame->view()->layoutIfNeededRecursive();
frame->view()->paint(&gc, paintRect);
}
}
}
}
示例2: OnSize
void WebView::OnSize(wxSizeEvent& event)
{
if (m_isInitialized && m_mainFrame) {
WebCore::Frame* frame = m_mainFrame->GetFrame();
frame->view()->resize(event.GetSize());
frame->view()->adjustViewSize();
}
event.Skip();
}
示例3: OnSize
void wxWebView::OnSize(wxSizeEvent& event)
{
if (m_isInitialized && m_mainFrame) {
WebCore::Frame* frame = m_mainFrame->GetFrame();
frame->view()->setFrameRect(wxRect(wxPoint(0,0), event.GetSize()));
frame->view()->forceLayout();
frame->view()->adjustViewSize();
}
event.Skip();
}
示例4: webkit_web_view_size_allocate
static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
{
GTK_WIDGET_CLASS(webkit_web_view_parent_class)->size_allocate(widget,allocation);
//WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebCore::Frame* frame = core(webView_s->mainFrame());
frame->view()->resize(allocation->width, allocation->height);
frame->view()->forceLayout();
frame->view()->adjustViewSize();
}
示例5: SetTransparent
void wxWebView::SetTransparent(bool transparent)
{
WebCore::Frame* frame = 0;
if (m_mainFrame)
frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
frame->view()->setTransparent(transparent);
}
示例6: IsTransparent
bool wxWebView::IsTransparent() const
{
WebCore::Frame* frame = 0;
if (m_mainFrame)
frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return false;
return frame->view()->isTransparent();
}
示例7: OnSize
void wxWebView::OnSize(wxSizeEvent& event)
{
if (m_isInitialized && m_mainFrame) {
WebCore::Frame* frame = m_mainFrame->GetFrame();
frame->eventHandler()->sendResizeEvent();
frame->view()->layout();
frame->view()->adjustScrollbars();
}
event.Skip();
}
示例8: OnPaint
void WebView::OnPaint(wxPaintEvent& event)
{
if (m_beingDestroyed || !m_mainFrame)
return;
WebCore::Frame* frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
// we can't use wxAutoBufferedPaintDC here because it will not create
// a 32-bit bitmap for its buffer.
#if __WXMSW__
wxPaintDC paintdc(this);
int width, height;
paintdc.GetSize(&width, &height);
wxBitmap bitmap(width, height, 32);
wxMemoryDC dc(bitmap);
#else
wxPaintDC dc(this);
#endif
if (IsShown() && frame->document()) {
#if USE(WXGC)
#if wxCHECK_VERSION(2, 9, 2) && defined(wxUSE_CAIRO) && wxUSE_CAIRO
wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetCairoRenderer();
if (!renderer)
renderer = wxGraphicsRenderer::GetDefaultRenderer();
wxGraphicsContext* context = renderer->CreateContext(dc);
wxGCDC gcdc(context);
#else
wxGCDC gcdc(dc);
#endif
#endif
if (dc.IsOk()) {
wxRect paintRect = GetUpdateRegion().GetBox();
#if USE(WXGC)
WebCore::GraphicsContext gc(&gcdc);
#else
WebCore::GraphicsContext gc(&dc);
#endif
if (frame->contentRenderer()) {
frame->view()->updateLayoutAndStyleIfNeededRecursive();
frame->view()->paint(&gc, paintRect);
#if __WXMSW__
dc.SelectObject(wxNullBitmap);
paintdc.DrawBitmap(bitmap, 0, 0);
#endif
}
}
}
}
示例9: kit
WebKitHitTestResult* kit(const WebCore::HitTestResult& result)
{
guint context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
GOwnPtr<char> linkURI(0);
GOwnPtr<char> imageURI(0);
GOwnPtr<char> mediaURI(0);
WebKitDOMNode* node = 0;
WebCore::Frame* targetFrame;
WebCore::IntPoint point;
if (!result.absoluteLinkURL().isEmpty()) {
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
linkURI.set(g_strdup(result.absoluteLinkURL().string().utf8().data()));
}
if (!result.absoluteImageURL().isEmpty()) {
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
imageURI.set(g_strdup(result.absoluteImageURL().string().utf8().data()));
}
if (!result.absoluteMediaURL().isEmpty()) {
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
mediaURI.set(g_strdup(result.absoluteMediaURL().string().utf8().data()));
}
if (result.isSelected())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;
if (result.isContentEditable())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
if (result.innerNonSharedNode())
node = kit(result.innerNonSharedNode());
targetFrame = result.targetFrame();
if (targetFrame && targetFrame->view()) {
// Convert document coords to widget coords.
point = targetFrame->view()->contentsToWindow(result.point());
} else
point = result.point();
return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,
"link-uri", linkURI.get(),
"image-uri", imageURI.get(),
"media-uri", mediaURI.get(),
"context", context,
"inner-node", node,
"x", point.x(),
"y", point.y(),
NULL));
}
示例10: OnMouseEvents
void wxWebView::OnMouseEvents(wxMouseEvent& event)
{
event.Skip();
if (!m_mainFrame)
return;
WebCore::Frame* frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
wxPoint globalPoint = ClientToScreen(event.GetPosition());
wxEventType type = event.GetEventType();
if (type == wxEVT_MOUSEWHEEL) {
WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
frame->eventHandler()->handleWheelEvent(wkEvent);
return;
}
WebCore::PlatformMouseEvent wkEvent(event, globalPoint);
if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type == wxEVT_RIGHT_DOWN ||
type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK || type == wxEVT_RIGHT_DCLICK)
frame->eventHandler()->handleMousePressEvent(wkEvent);
else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_UP)
frame->eventHandler()->handleMouseReleaseEvent(wkEvent);
else if (type == wxEVT_MOTION)
frame->eventHandler()->mouseMoved(wkEvent);
}
示例11: OnContextMenuEvents
void wxWebView::OnContextMenuEvents(wxContextMenuEvent& event)
{
m_impl->page->contextMenuController()->clearContextMenu();
wxPoint localEventPoint = ScreenToClient(event.GetPosition());
if (!m_mainFrame)
return;
WebCore::Frame* focusedFrame = m_mainFrame->GetFrame();
if (!focusedFrame->view())
return;
//Create WebCore mouse event from the wxContextMenuEvent
wxMouseEvent mouseEvent(wxEVT_RIGHT_DOWN);
mouseEvent.m_x = localEventPoint.x;
mouseEvent.m_y = localEventPoint.y;
WebCore::PlatformMouseEvent wkEvent(mouseEvent, event.GetPosition());
bool handledEvent = focusedFrame->eventHandler()->sendContextMenuEvent(wkEvent);
if (!handledEvent)
return;
WebCore::ContextMenu* coreMenu = m_impl->page->contextMenuController()->contextMenu();
if (!coreMenu)
return;
WebCore::PlatformMenuDescription menuWx = coreMenu->platformDescription();
if (!menuWx)
return;
PopupMenu(menuWx, localEventPoint);
}
示例12: OnContextMenuEvents
void wxWebView::OnContextMenuEvents(wxContextMenuEvent& event)
{
Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxWebView::OnMenuSelectEvents), NULL, this);
m_impl->page->contextMenuController()->clearContextMenu();
wxPoint localEventPoint = ScreenToClient(event.GetPosition());
if (!m_impl->page)
return;
WebCore::Frame* focusedFrame = m_impl->page->focusController()->focusedOrMainFrame();
if (!focusedFrame->view())
return;
//Create WebCore mouse event from the wxContextMenuEvent
wxMouseEvent mouseEvent(wxEVT_RIGHT_DOWN);
mouseEvent.m_x = localEventPoint.x;
mouseEvent.m_y = localEventPoint.y;
WebCore::PlatformMouseEvent wkEvent(mouseEvent, event.GetPosition(), 1);
bool handledEvent = focusedFrame->eventHandler()->sendContextMenuEvent(wkEvent);
if (!handledEvent)
return;
WebCore::ContextMenu* coreMenu = m_impl->page->contextMenuController()->contextMenu();
if (!coreMenu)
return;
WebCore::PlatformMenuDescription menuWx = coreMenu->platformDescription();
if (!menuWx)
return;
PopupMenu(menuWx, localEventPoint);
Disconnect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxWebView::OnMenuSelectEvents), NULL, this);
}
示例13: printFrames
static void printFrames(const WebCore::Frame& frame, const WebCore::Frame* targetFrame, int indent)
{
if (&frame == targetFrame) {
printf("--> ");
printIndent(indent - 1);
} else
printIndent(indent);
WebCore::FrameView* view = frame.view();
printf("Frame %p %dx%d\n", &frame, view ? view->width() : 0, view ? view->height() : 0);
printIndent(indent);
printf(" ownerElement=%p\n", frame.ownerElement());
printIndent(indent);
printf(" frameView=%p (needs layout %d)\n", view, view ? view->needsLayout() : false);
printIndent(indent);
printf(" renderView=%p\n", view ? view->renderView() : nullptr);
printIndent(indent);
printf(" ownerRenderer=%p\n", frame.ownerRenderer());
printIndent(indent);
printf(" document=%p (needs style recalc %d)\n", frame.document(), frame.document() ? frame.document()->childNeedsStyleRecalc() : false);
printIndent(indent);
printf(" uri=%s\n", frame.document()->documentURI().utf8().data());
for (WebCore::Frame* child = frame.tree().firstChild(); child; child = child->tree().nextSibling())
printFrames(*child, targetFrame, indent + 1);
}
示例14: setMediaType
void DumpRenderTreeSupportQt::setMediaType(QWebFrame* frame, const QString& type)
{
WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
WebCore::FrameView* view = coreFrame->view();
view->setMediaType(type);
coreFrame->document()->styleSelectorChanged(RecalcStyleImmediately);
view->layout();
}
示例15: hideHighlight
void InspectorClientQt::hideHighlight()
{
WebCore::Frame* frame = m_inspectedWebPage->page->mainFrame();
if (frame) {
QRect rect = m_inspectedWebPage->mainFrameAdapter()->frameRect();
if (!rect.isEmpty())
frame->view()->invalidateRect(rect);
}
}