Beispiel #1
0
bool NUIRenderHandler::GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect)
{
	NUIWindow* window = m_owner->GetWindow();
	rect.Set(0, 0, window->GetWidth(), window->GetHeight());

	return true;
}
Beispiel #2
0
bool PhantomJSHandler::GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect)
{
  qCDebug(handler) << browser->GetIdentifier() << m_viewRects.value(browser->GetIdentifier());
  const auto size = m_viewRects.value(browser->GetIdentifier(), qMakePair(800, 600));
  rect.Set(0, 0, size.first, size.second);
  return true;
}
Beispiel #3
0
CefRect GetJNIRect(JNIEnv* env, jobject obj) {
  CefRect rect;

  jclass cls = env->FindClass("java/awt/Rectangle");
  if (!cls)
    return rect;

  int x, y, width, height;
  if (GetJNIFieldInt(env, cls, obj, "x", &x) &&
      GetJNIFieldInt(env, cls, obj, "y", &y) &&
      GetJNIFieldInt(env, cls, obj, "width", &width) &&
      GetJNIFieldInt(env, cls, obj, "height", &height)) {
    rect.Set(x, y, width, height);
    return rect;
  }

  return rect;
}