本文整理汇总了C++中WebPageProxy::viewWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ WebPageProxy::viewWidget方法的具体用法?C++ WebPageProxy::viewWidget怎么用?C++ WebPageProxy::viewWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebPageProxy
的用法示例。
在下文中一共展示了WebPageProxy::viewWidget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WebColorPicker
WebColorPickerGtk::WebColorPickerGtk(WebPageProxy& page, const Color& initialColor, const IntRect&)
: WebColorPicker(&page)
, m_initialColor(initialColor)
, m_webView(page.viewWidget())
, m_colorChooser(nullptr)
{
}
示例2: Gesture
GestureController::ZoomGesture::ZoomGesture(WebPageProxy& page)
: Gesture(gtk_gesture_zoom_new(page.viewWidget()), page)
, m_initialScale(0)
, m_scale(0)
{
g_signal_connect_swapped(m_gesture.get(), "begin", G_CALLBACK(begin), this);
g_signal_connect_swapped(m_gesture.get(), "scale-changed", G_CALLBACK(scaleChanged), this);
}
示例3: ASSERT
std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(WebPageProxy& webPage, const IntSize& initialSize, std::function<void()>&& damageNotify)
{
GdkWindow* parentWindow = gtk_widget_get_parent_window(webPage.viewWidget());
ASSERT(GDK_IS_WINDOW(parentWindow));
if (!supportsXDamageAndXComposite(parentWindow))
return nullptr;
return std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(webPage, initialSize, WTFMove(damageNotify)));
}
示例4: colormap
RedirectedXCompositeWindow::RedirectedXCompositeWindow(WebPageProxy& webPage, const IntSize& initialSize, std::function<void()>&& damageNotify)
: m_webPage(webPage)
, m_display(GDK_DISPLAY_XDISPLAY(gdk_window_get_display(gtk_widget_get_parent_window(webPage.viewWidget()))))
, m_size(initialSize)
{
m_size.scale(m_webPage.deviceScaleFactor());
ASSERT(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native() == m_display);
Screen* screen = DefaultScreenOfDisplay(m_display);
GdkVisual* visual = gdk_window_get_visual(gtk_widget_get_parent_window(webPage.viewWidget()));
XUniqueColormap colormap(XCreateColormap(m_display, RootWindowOfScreen(screen), GDK_VISUAL_XVISUAL(visual), AllocNone));
// This is based on code from Chromium: src/content/common/gpu/image_transport_surface_linux.cc
XSetWindowAttributes windowAttributes;
windowAttributes.override_redirect = True;
windowAttributes.colormap = colormap.get();
// CWBorderPixel must be present when the depth doesn't match the parent's one.
// See http://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c?id=xorg-server-1.16.0#n703.
windowAttributes.border_pixel = 0;
m_parentWindow = XCreateWindow(m_display,
RootWindowOfScreen(screen),
WidthOfScreen(screen) + 1, 0, 1, 1,
0,
gdk_visual_get_depth(visual),
InputOutput,
GDK_VISUAL_XVISUAL(visual),
CWOverrideRedirect | CWColormap | CWBorderPixel,
&windowAttributes);
XMapWindow(m_display, m_parentWindow.get());
windowAttributes.event_mask = StructureNotifyMask;
windowAttributes.override_redirect = False;
// Create the window of at last 1x1 since X doesn't allow to create empty windows.
m_window = XCreateWindow(m_display,
m_parentWindow.get(),
0, 0,
std::max(1, m_size.width()),
std::max(1, m_size.height()),
0,
CopyFromParent,
InputOutput,
CopyFromParent,
CWEventMask,
&windowAttributes);
XMapWindow(m_display, m_window.get());
xDamageNotifier().add(m_window.get(), WTFMove(damageNotify));
while (1) {
XEvent event;
XWindowEvent(m_display, m_window.get(), StructureNotifyMask, &event);
if (event.type == MapNotify && event.xmap.window == m_window.get())
break;
}
XSelectInput(m_display, m_window.get(), NoEventMask);
XCompositeRedirectWindow(m_display, m_window.get(), CompositeRedirectManual);
if (!m_size.isEmpty())
createNewPixampAndPixampSurface();
m_damage = XDamageCreate(m_display, m_window.get(), XDamageReportNonEmpty);
}