本文整理汇总了C++中webcore::Settings::layoutAlgorithm方法的典型用法代码示例。如果您正苦于以下问题:C++ Settings::layoutAlgorithm方法的具体用法?C++ Settings::layoutAlgorithm怎么用?C++ Settings::layoutAlgorithm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::Settings
的用法示例。
在下文中一共展示了Settings::layoutAlgorithm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Sync
static void Sync(JNIEnv* env, jobject obj, jint frame)
{
WebCore::Frame* pFrame = (WebCore::Frame*)frame;
ALOG_ASSERT(pFrame, "%s must take a valid frame pointer!", __FUNCTION__);
WebCore::Settings* s = pFrame->settings();
if (!s)
return;
WebCore::CachedResourceLoader* cachedResourceLoader = pFrame->document()->cachedResourceLoader();
#ifdef ANDROID_LAYOUT
jobject layout = env->GetObjectField(obj, gFieldIds->mLayoutAlgorithm);
WebCore::Settings::LayoutAlgorithm l = (WebCore::Settings::LayoutAlgorithm)
env->CallIntMethod(layout, gFieldIds->mOrdinal);
if (s->layoutAlgorithm() != l) {
s->setLayoutAlgorithm(l);
if (pFrame->document()) {
pFrame->document()->styleSelectorChanged(WebCore::RecalcStyleImmediately);
if (pFrame->document()->renderer()) {
recursiveCleanupForFullLayout(pFrame->document()->renderer());
ALOG_ASSERT(pFrame->view(), "No view for this frame when trying to relayout");
pFrame->view()->layout();
// FIXME: This call used to scroll the page to put the focus into view.
// It worked on the WebViewCore, but now scrolling is done outside of the
// WebViewCore, on the UI side, so there needs to be a new way to do this.
//pFrame->makeFocusVisible();
}
}
}
#endif
jint textSize = env->GetIntField(obj, gFieldIds->mTextSize);
float zoomFactor = textSize / 100.0f;
if (pFrame->textZoomFactor() != zoomFactor)
pFrame->setTextZoomFactor(zoomFactor);
jstring str = (jstring)env->GetObjectField(obj, gFieldIds->mStandardFontFamily);
s->setStandardFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFixedFontFamily);
s->setFixedFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSansSerifFontFamily);
s->setSansSerifFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSerifFontFamily);
s->setSerifFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mCursiveFontFamily);
s->setCursiveFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFantasyFontFamily);
s->setFantasyFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mDefaultTextEncoding);
s->setDefaultTextEncodingName(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mUserAgent);
WebFrame::getWebFrame(pFrame)->setUserAgent(jstringToWtfString(env, str));
WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextUserAgent();
jint cacheMode = env->GetIntField(obj, gFieldIds->mOverrideCacheMode);
WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextCacheMode(cacheMode);
str = (jstring)env->GetObjectField(obj, gFieldIds->mAcceptLanguage);
WebRequestContext::setAcceptLanguage(jstringToWtfString(env, str));
jint size = env->GetIntField(obj, gFieldIds->mMinimumFontSize);
s->setMinimumFontSize(size);
size = env->GetIntField(obj, gFieldIds->mMinimumLogicalFontSize);
s->setMinimumLogicalFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFontSize);
s->setDefaultFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFixedFontSize);
s->setDefaultFixedFontSize(size);
jboolean flag = env->GetBooleanField(obj, gFieldIds->mLoadsImagesAutomatically);
s->setLoadsImagesAutomatically(flag);
if (flag)
cachedResourceLoader->setAutoLoadImages(true);
flag = env->GetBooleanField(obj, gFieldIds->mMediaPreloadEnabled);
s->setMediaPreloadEnabled(flag);
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
s->setBlockNetworkImage(flag);
if(!flag)
cachedResourceLoader->setBlockNetworkImage(false);
#endif
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkLoads);
WebFrame* webFrame = WebFrame::getWebFrame(pFrame);
webFrame->setBlockNetworkLoads(flag);
flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptEnabled);
s->setJavaScriptEnabled(flag);
flag = env->GetBooleanField(obj, gFieldIds->mAllowUniversalAccessFromFileURLs);
s->setAllowUniversalAccessFromFileURLs(flag);
//.........这里部分代码省略.........
示例2: Sync
static void Sync(JNIEnv* env, jobject obj, jint frame)
{
WebCore::Frame* pFrame = (WebCore::Frame*)frame;
ALOG_ASSERT(pFrame, "%s must take a valid frame pointer!", __FUNCTION__);
WebCore::Settings* s = pFrame->settings();
if (!s)
return;
WebCore::CachedResourceLoader* cachedResourceLoader = pFrame->document()->cachedResourceLoader();
#ifdef ANDROID_LAYOUT
jobject layout = env->GetObjectField(obj, gFieldIds->mLayoutAlgorithm);
WebCore::Settings::LayoutAlgorithm l = (WebCore::Settings::LayoutAlgorithm)
env->CallIntMethod(layout, gFieldIds->mOrdinal);
if (s->layoutAlgorithm() != l) {
s->setLayoutAlgorithm(l);
if (pFrame->document()) {
pFrame->document()->styleSelectorChanged(WebCore::RecalcStyleImmediately);
if (pFrame->document()->renderer()) {
recursiveCleanupForFullLayout(pFrame->document()->renderer());
ALOG_ASSERT(pFrame->view(), "No view for this frame when trying to relayout");
pFrame->view()->layout();
// FIXME: This call used to scroll the page to put the focus into view.
// It worked on the WebViewCore, but now scrolling is done outside of the
// WebViewCore, on the UI side, so there needs to be a new way to do this.
//pFrame->makeFocusVisible();
}
}
}
#endif
jint textSize = env->GetIntField(obj, gFieldIds->mTextSize);
float zoomFactor = textSize / 100.0f;
if (pFrame->textZoomFactor() != zoomFactor)
pFrame->setTextZoomFactor(zoomFactor);
jstring str = (jstring)env->GetObjectField(obj, gFieldIds->mStandardFontFamily);
s->setStandardFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFixedFontFamily);
s->setFixedFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSansSerifFontFamily);
s->setSansSerifFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSerifFontFamily);
s->setSerifFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mCursiveFontFamily);
s->setCursiveFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFantasyFontFamily);
s->setFantasyFontFamily(jstringToWtfString(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mDefaultTextEncoding);
//SAMSUNG Change >>
String defaultEncoding = jstringToWtfString(env, str);
if (defaultEncoding == "AutoDetect") {
s->setUsesEncodingDetector(true);
} else {
s->setUsesEncodingDetector(false);
s->setDefaultTextEncodingName(defaultEncoding);
}
//SAMSUNG Change <<
//s->setDefaultTextEncodingName(jstringToWtfString(env, str));
str = (jstring)env->CallObjectMethod(obj, gFieldIds->mGetUserAgentString);//4.2 Merge
WebFrame::getWebFrame(pFrame)->setUserAgent(jstringToWtfString(env, str));
WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextUserAgent();
jint cacheMode = env->GetIntField(obj, gFieldIds->mOverrideCacheMode);
WebViewCore::getWebViewCore(pFrame->view())->setWebRequestContextCacheMode(cacheMode);
str = (jstring)env->CallObjectMethod(obj, gFieldIds->mGetAcceptLanguage);//4.2 Merge
WebRequestContext::setAcceptLanguage(jstringToWtfString(env, str));
jint size = env->GetIntField(obj, gFieldIds->mMinimumFontSize);
s->setMinimumFontSize(size);
size = env->GetIntField(obj, gFieldIds->mMinimumLogicalFontSize);
s->setMinimumLogicalFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFontSize);
s->setDefaultFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFixedFontSize);
s->setDefaultFixedFontSize(size);
jboolean flag = env->GetBooleanField(obj, gFieldIds->mLoadsImagesAutomatically);
s->setLoadsImagesAutomatically(flag);
if (flag)
cachedResourceLoader->setAutoLoadImages(true);
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
s->setBlockNetworkImage(flag);
if(!flag)
cachedResourceLoader->setBlockNetworkImage(false);
#endif
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkLoads);
WebFrame* webFrame = WebFrame::getWebFrame(pFrame);
webFrame->setBlockNetworkLoads(flag);
//.........这里部分代码省略.........
示例3: Sync
static void Sync(JNIEnv* env, jobject obj, jint frame)
{
WebCore::Frame* pFrame = (WebCore::Frame*)frame;
LOG_ASSERT(pFrame, "%s must take a valid frame pointer!", __FUNCTION__);
WebCore::Settings* s = pFrame->settings();
if (!s)
return;
WebCore::DocLoader* docLoader = pFrame->document()->docLoader();
#ifdef ANDROID_LAYOUT
jobject layout = env->GetObjectField(obj, gFieldIds->mLayoutAlgorithm);
WebCore::Settings::LayoutAlgorithm l = (WebCore::Settings::LayoutAlgorithm)
env->CallIntMethod(layout, gFieldIds->mOrdinal);
if (s->layoutAlgorithm() != l) {
s->setLayoutAlgorithm(l);
if (pFrame->document()) {
pFrame->document()->updateStyleSelector();
if (pFrame->document()->renderer()) {
recursiveCleanupForFullLayout(pFrame->document()->renderer());
LOG_ASSERT(pFrame->view(), "No view for this frame when trying to relayout");
pFrame->view()->layout();
// FIXME: This call used to scroll the page to put the focus into view.
// It worked on the WebViewCore, but now scrolling is done outside of the
// WebViewCore, on the UI side, so there needs to be a new way to do this.
//pFrame->makeFocusVisible();
}
}
}
#endif
jobject textSize = env->GetObjectField(obj, gFieldIds->mTextSize);
float zoomFactor = env->GetIntField(textSize, gFieldIds->mTextSizeValue) / 100.0f;
if (pFrame->zoomFactor() != zoomFactor)
pFrame->setZoomFactor(zoomFactor, /*isTextOnly*/true);
jstring str = (jstring)env->GetObjectField(obj, gFieldIds->mStandardFontFamily);
s->setStandardFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFixedFontFamily);
s->setFixedFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSansSerifFontFamily);
s->setSansSerifFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSerifFontFamily);
s->setSerifFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mCursiveFontFamily);
s->setCursiveFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFantasyFontFamily);
s->setFantasyFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mDefaultTextEncoding);
s->setDefaultTextEncodingName(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mUserAgent);
WebFrame::getWebFrame(pFrame)->setUserAgent(to_string(env, str));
jint size = env->GetIntField(obj, gFieldIds->mMinimumFontSize);
s->setMinimumFontSize(size);
size = env->GetIntField(obj, gFieldIds->mMinimumLogicalFontSize);
s->setMinimumLogicalFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFontSize);
s->setDefaultFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFixedFontSize);
s->setDefaultFixedFontSize(size);
jboolean flag = env->GetBooleanField(obj, gFieldIds->mLoadsImagesAutomatically);
s->setLoadsImagesAutomatically(flag);
if (flag)
docLoader->setAutoLoadImages(true);
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
s->setBlockNetworkImage(flag);
if(!flag)
docLoader->setBlockNetworkImage(false);
#endif
flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptEnabled);
s->setJavaScriptEnabled(flag);
// ON = 0
// ON_DEMAND = 1
// OFF = 2
jobject pluginState = env->GetObjectField(obj, gFieldIds->mPluginState);
int state = env->CallIntMethod(pluginState, gFieldIds->mOrdinal);
s->setPluginsEnabled(state < 2);
#ifdef ANDROID_PLUGINS
s->setPluginsOnDemand(state == 1);
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
flag = env->GetBooleanField(obj, gFieldIds->mAppCacheEnabled);
s->setOfflineWebApplicationCacheEnabled(flag);
str = (jstring)env->GetObjectField(obj, gFieldIds->mAppCachePath);
if (str) {
//.........这里部分代码省略.........
示例4: Sync
static void Sync(JNIEnv* env, jobject obj, jint frame)
{
WebCore::Frame* pFrame = (WebCore::Frame*)frame;
LOG_ASSERT(pFrame, "%s must take a valid frame pointer!", __FUNCTION__);
WebCore::Settings* s = pFrame->settings();
if (!s)
return;
WebCore::DocLoader* docLoader = pFrame->document()->docLoader();
#ifdef ANDROID_LAYOUT
jobject layout = env->GetObjectField(obj, gFieldIds->mLayoutAlgorithm);
WebCore::Settings::LayoutAlgorithm l = (WebCore::Settings::LayoutAlgorithm)
env->CallIntMethod(layout, gFieldIds->mOrdinal);
if (s->layoutAlgorithm() != l) {
s->setLayoutAlgorithm(l);
if (pFrame->document()) {
pFrame->document()->updateStyleSelector();
if (pFrame->document()->renderer()) {
recursiveCleanupForFullLayout(pFrame->document()->renderer());
LOG_ASSERT(pFrame->view(), "No view for this frame when trying to relayout");
pFrame->view()->layout();
// FIXME: This call used to scroll the page to put the focus into view.
// It worked on the WebViewCore, but now scrolling is done outside of the
// WebViewCore, on the UI side, so there needs to be a new way to do this.
//pFrame->makeFocusVisible();
}
}
}
#endif
jobject textSize = env->GetObjectField(obj, gFieldIds->mTextSize);
float zoomFactor = env->GetIntField(textSize, gFieldIds->mTextSizeValue) / 100.0f;
if (pFrame->zoomFactor() != zoomFactor)
pFrame->setZoomFactor(zoomFactor, /*isTextOnly*/true);
jstring str = (jstring)env->GetObjectField(obj, gFieldIds->mStandardFontFamily);
s->setStandardFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFixedFontFamily);
s->setFixedFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSansSerifFontFamily);
s->setSansSerifFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mSerifFontFamily);
s->setSerifFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mCursiveFontFamily);
s->setCursiveFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mFantasyFontFamily);
s->setFantasyFontFamily(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mDefaultTextEncoding);
s->setDefaultTextEncodingName(to_string(env, str));
str = (jstring)env->GetObjectField(obj, gFieldIds->mUserAgent);
WebFrame::getWebFrame(pFrame)->setUserAgent(to_string(env, str));
jint size = env->GetIntField(obj, gFieldIds->mMinimumFontSize);
s->setMinimumFontSize(size);
size = env->GetIntField(obj, gFieldIds->mMinimumLogicalFontSize);
s->setMinimumLogicalFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFontSize);
s->setDefaultFontSize(size);
size = env->GetIntField(obj, gFieldIds->mDefaultFixedFontSize);
s->setDefaultFixedFontSize(size);
jboolean flag = env->GetBooleanField(obj, gFieldIds->mLoadsImagesAutomatically);
s->setLoadsImagesAutomatically(flag);
if (flag)
docLoader->setAutoLoadImages(true);
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
s->setBlockNetworkImage(flag);
if(!flag)
docLoader->setBlockNetworkImage(false);
#endif
flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptEnabled);
s->setJavaScriptEnabled(flag);
flag = env->GetBooleanField(obj, gFieldIds->mPluginsEnabled);
s->setPluginsEnabled(flag);
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
flag = env->GetBooleanField(obj, gFieldIds->mAppCacheEnabled);
s->setOfflineWebApplicationCacheEnabled(flag);
str = (jstring)env->GetObjectField(obj, gFieldIds->mAppCachePath);
if (str) {
WebCore::String path = to_string(env, str);
if (path.length() && WebCore::cacheStorage().cacheDirectory().isNull()) {
WebCore::cacheStorage().setCacheDirectory(path);
}
}
jlong maxsize = env->GetIntField(obj, gFieldIds->mAppCacheMaxSize);
WebCore::cacheStorage().setMaximumSize(maxsize);
//.........这里部分代码省略.........