本文整理汇总了C++中HostWindow类的典型用法代码示例。如果您正苦于以下问题:C++ HostWindow类的具体用法?C++ HostWindow怎么用?C++ HostWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HostWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screenDepthPerComponent
int screenDepthPerComponent(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return 0;
return hostWindow->screenInfo().depthPerComponent;
}
示例2: getPangoLayoutForAtk
static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
{
AccessibilityObject* coreObject = core(textObject);
HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
if (!hostWindow)
return 0;
PlatformPageClient webView = hostWindow->platformPageClient();
if (!webView)
return 0;
GString* str = g_string_new(NULL);
AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject);
if (!accObject)
return 0;
RenderText* renderText = toRenderText(accObject->renderer());
if (!renderText)
return 0;
// Create a string with the layout as it appears on the screen
InlineTextBox* box = renderText->firstTextBox();
while (box) {
gchar *text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
g_string_append(str, text);
g_string_append(str, "\n");
box = box->nextTextBox();
}
PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), g_string_free(str, FALSE));
g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-pango-layout", layout, g_object_unref);
return layout;
}
示例3: screenOrientationType
WebScreenOrientationType screenOrientationType(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return WebScreenOrientationUndefined;
return hostWindow->screenInfo().orientationType;
}
示例4: screenOrientationAngle
uint16_t screenOrientationAngle(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return 0;
return hostWindow->screenInfo().orientationAngle;
}
示例5: screenAvailableRect
FloatRect screenAvailableRect(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return FloatRect();
return IntRect(hostWindow->screenInfo().availableRect);
}
示例6: screenIsMonochrome
bool screenIsMonochrome(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return false;
return hostWindow->screenInfo().isMonochrome;
}
示例7: onMessageReceived
void IpcClientHost::onMessageReceived(const PIpcMessage& msg)
{
if (msg.routing_id() != MSG_ROUTING_CONTROL) {
// ROUTED MESSAGE, forward it to the correct host window
HostWindow* win = static_cast<HostWindow*>(findWindow(msg.routing_id()));
if (!win) {
return;
}
win->onMessageReceived(msg);
} else {
// CONTROL MESSAGE, Handle it here
bool msgIsOk;
IPC_BEGIN_MESSAGE_MAP(IpcClientHost, msg, msgIsOk)
IPC_MESSAGE_HANDLER(View_Host_ReturnedKeyEvent, onReturnedInputEvent)
IPC_MESSAGE_HANDLER(ViewHost_PrepareAddWindow, onPrepareAddWindow)
IPC_MESSAGE_HANDLER(ViewHost_AddWindow, onAddWindow)
IPC_MESSAGE_HANDLER(ViewHost_RemoveWindow, onRemoveWindow)
IPC_MESSAGE_HANDLER(ViewHost_SetWindowProperties, onSetWindowProperties)
IPC_MESSAGE_HANDLER(ViewHost_FocusWindow, onFocusWindow)
IPC_MESSAGE_HANDLER(ViewHost_UnfocusWindow, onUnfocusWindow)
IPC_MESSAGE_UNHANDLED( g_critical("%s (%d). IPC Message Not Handled: (0x%x : 0x%x : 0x%x)",
__PRETTY_FUNCTION__, __LINE__, msg.routing_id(), msg.type(), msg.message_id()));
IPC_END_MESSAGE_MAP()
}
}
示例8: screenDepth
int screenDepth(Widget* widget)
{
HostWindow* hostWindow = toHostWindow(widget);
if (!hostWindow)
return 0;
return hostWindow->screenInfo().depth;
}
示例9: GetHostWindow
void Sprite::TrackMouseLeave()
{
HostWindow *wnd = GetHostWindow();
if (wnd)
{
wnd->TrackMouseLeave(this);
}
}
示例10: platformPageClient
QWebPageClient* PluginView::platformPageClient() const
{
FrameView* view = m_parentFrame->view();
if (!view)
return 0;
HostWindow* hostWindow = view->hostWindow();
if (!hostWindow)
return 0;
return hostWindow->platformPageClient();
}
示例11: TEST
TEST(WebViewDestruction, DestroyHostWindow)
{
COMPtr<IWebView> webView;
HostWindow window;
HWND viewWindow;
createAndInitializeWebView(webView, window, viewWindow);
DestroyWindow(window.window());
finishWebViewDestructionTest(webView, viewWindow);
}
示例12: EXPECT_TRUE
void WebViewDestructionWithHostWindow::SetUp()
{
WebViewDestruction::SetUp();
EXPECT_TRUE(m_window.initialize());
EXPECT_HRESULT_SUCCEEDED(m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_window.window())));
EXPECT_HRESULT_SUCCEEDED(m_webView->initWithFrame(m_window.clientRect(), 0, 0));
COMPtr<IWebViewPrivate> viewPrivate(Query, m_webView);
ASSERT_NOT_NULL(viewPrivate);
EXPECT_HRESULT_SUCCEEDED(viewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&m_viewWindow)));
EXPECT_TRUE(::IsWindow(m_viewWindow));
}
示例13: shouldCreateMainFrameScrollbar
static bool shouldCreateMainFrameScrollbar(const ScrollView* scrollView)
{
// Interior frame ScrollViews never have MainFrameScrollbars.
if (scrollView->parent())
return false;
// If we don't have a host window or a containing widget (ala WebKit2).
HostWindow* hostWindow = scrollView->hostWindow();
if (!hostWindow || !hostWindow->platformPageClient())
return false;
gboolean selfScrolling = FALSE;
g_object_get(hostWindow->platformPageClient(), "self-scrolling", &selfScrolling, NULL);
return !selfScrolling;
}
示例14: createAndInitializeWebView
static void createAndInitializeWebView(COMPtr<IWebView>& outWebView, HostWindow& window, HWND& viewWindow)
{
COMPtr<IWebView> webView;
TEST_ASSERT(SUCCEEDED(WebKitCreateInstance(__uuidof(WebView), &webView)));
TEST_ASSERT(window.initialize());
TEST_ASSERT(SUCCEEDED(webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(window.window()))));
TEST_ASSERT(SUCCEEDED(webView->initWithFrame(window.clientRect(), 0, 0)));
COMPtr<IWebViewPrivate> viewPrivate(Query, webView);
TEST_ASSERT(viewPrivate);
TEST_ASSERT(SUCCEEDED(viewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow))));
TEST_ASSERT(IsWindow(viewWindow));
outWebView.adoptRef(webView.releaseRef());
}
示例15: getPangoLayoutForAtk
static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
{
AccessibilityObject* coreObject = core(textObject);
Document* document = coreObject->document();
if (!document)
return 0;
HostWindow* hostWindow = document->view()->hostWindow();
if (!hostWindow)
return 0;
PlatformPageClient webView = hostWindow->platformPageClient();
if (!webView)
return 0;
// Create a string with the layout as it appears on the screen
PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), textForObject(coreObject));
return layout;
}