static AwtGraphicsConfigDataPtr copyGraphicsConfigToMenuBarPeer( JNIEnv *env, jobject frame, jobject thisMenuBar) { jobject gc_object; AwtGraphicsConfigDataPtr adata; /* GraphicsConfiguration object of Component */ gc_object = (*env)->GetObjectField(env, frame, mComponentPeerIDs.graphicsConfig); if (gc_object != NULL) { /* Set graphicsConfig field of MComponentPeer */ (*env)->SetObjectField (env, thisMenuBar, mMenuBarPeerIDs.graphicsConfig, gc_object); adata = (AwtGraphicsConfigDataPtr) JNU_GetLongFieldAsPtr(env, gc_object, x11GraphicsConfigIDs.aData); } else { /* Component was not constructed with a GraphicsConfiguration object */ adata = getDefaultConfig(DefaultScreen(awt_display)); } return adata; }
/* * Class: sun_awt_X11_XToolkit * Method: getDefaultXColormap * Signature: ()J */ JNIEXPORT jlong JNICALL Java_sun_awt_X11_XToolkit_getDefaultXColormap (JNIEnv *env, jclass clazz) { AwtGraphicsConfigDataPtr defaultConfig = getDefaultConfig(DefaultScreen(awt_display)); return (jlong) defaultConfig->awt_cmap; }
QVariant VConfigManager::resetDefaultConfig(const QString &p_section, const QString &p_key) { QVariant defaultValue = getDefaultConfig(p_section, p_key); setConfigToSettings(p_section, p_key, defaultValue); return defaultValue; }
const char *Config::getUdfAccess() { static Firebird::GlobalPtr<Firebird::Mutex> udfMutex; static Firebird::GlobalPtr<Firebird::string> udfValue; static const char* volatile value = 0; if (value) { return value; } Firebird::MutexLockGuard guard(udfMutex, "Config::getUdfAccess"); if (value) { return value; } const char* v = (const char*) getDefaultConfig()->values[KEY_UDF_ACCESS]; if (CASE_SENSITIVITY ? (! strcmp(v, UDF_DEFAULT_CONFIG_VALUE) && FB_UDFDIR[0]) : (! fb_utils::stricmp(v, UDF_DEFAULT_CONFIG_VALUE) && FB_UDFDIR[0])) { udfValue->printf("Restrict %s", FB_UDFDIR); value = udfValue->c_str(); } else { value = v; } return value; }
void Config::merge(Firebird::RefPtr<Config>& config, const Firebird::string* dpbConfig) { if (dpbConfig && dpbConfig->hasData()) { ConfigFile txtStream(ConfigFile::USE_TEXT, dpbConfig->c_str()); config = new Config(txtStream, *(config.hasData() ? config : getDefaultConfig())); } }
Widget awt_util_createWarningWindow(Widget parent, char *warning) { Widget warningWindow; #ifdef NETSCAPE extern Widget FE_MakeAppletSecurityChrome(Widget parent, char* message); warningWindow = FE_MakeAppletSecurityChrome(parent, warning); #else Widget label; int32_t argc; #define MAX_ARGC 10 Arg args[MAX_ARGC]; int32_t screen = 0; int32_t i; AwtGraphicsConfigDataPtr adata; extern int32_t awt_numScreens; Pixel gray; Pixel black; for (i = 0; i < awt_numScreens; i++) { if (ScreenOfDisplay(awt_display, i) == XtScreen(parent)) { screen = i; break; } } adata = getDefaultConfig(screen); gray = adata->AwtColorMatch(192, 192, 192, adata); black = adata->AwtColorMatch(0, 0, 0, adata); argc = 0; XtSetArg(args[argc], XmNbackground, gray); argc++; XtSetArg(args[argc], XmNmarginHeight, 0); argc++; XtSetArg(args[argc], XmNmarginWidth, 0); argc++; XtSetArg (args[argc], XmNscreen, XtScreen(parent)); argc++; DASSERT(!(argc > MAX_ARGC)); warningWindow = XmCreateForm(parent, "main", args, argc); XtManageChild(warningWindow); label = XtVaCreateManagedWidget(warning, xmLabelWidgetClass, warningWindow, XmNhighlightThickness, 0, XmNbackground, gray, XmNforeground, black, XmNalignment, XmALIGNMENT_CENTER, XmNrecomputeSize, False, NULL); XtVaSetValues(label, XmNbottomAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); #endif return warningWindow; }
JNIEXPORT int32_t JNICALL awt_GetColor(JAWT_DrawingSurface* ds, int32_t r, int32_t g, int32_t b) { JNIEnv* env; jobject target, peer; jclass componentClass; AwtGraphicsConfigDataPtr adata; int32_t result; jobject gc_object; if (ds == NULL) { #ifdef DEBUG fprintf(stderr, "Drawing Surface is NULL\n"); #endif return (int32_t) 0; } env = ds->env; target = ds->target; /* Make sure the target is a java.awt.Component */ componentClass = (*env)->FindClass(env, "java/awt/Component"); if (!(*env)->IsInstanceOf(env, target, componentClass)) { #ifdef DEBUG fprintf(stderr, "DrawingSurface target must be a component\n"); #endif return (int32_t) 0; } if (!awtLockInited) { return (int32_t) 0; } AWT_LOCK(); /* Get the peer of the target component */ peer = (*env)->GetObjectField(env, target, componentIDs.peer); if (JNU_IsNull(env, peer)) { #ifdef DEBUG fprintf(stderr, "Component peer is NULL\n"); #endif AWT_UNLOCK(); return (int32_t) 0; } /* GraphicsConfiguration object of MComponentPeer */ gc_object = (*env)->GetObjectField(env, peer, graphicsConfigID); if (gc_object != NULL) { adata = (AwtGraphicsConfigDataPtr) JNU_GetLongFieldAsPtr(env, gc_object, x11GraphicsConfigIDs.aData); } else { adata = getDefaultConfig(DefaultScreen(awt_display)); } result = adata->AwtColorMatch(r, g, b, adata); AWT_UNLOCK(); return result; }
int Config::getTcpRemoteBufferSize() { int rc = (int) getDefaultConfig()->values[KEY_TCP_REMOTE_BUFFER_SIZE]; if (rc < 1448) rc = 1448; if (rc > MAX_SSHORT) rc = MAX_SSHORT; return rc; }
FB_UINT64 Config::getTempCacheLimit() { SINT64 v = (SINT64) getDefaultConfig()->values[KEY_TEMP_CACHE_LIMIT]; if (v < 0) { v = getServerMode() != MODE_SUPER ? 8388608 : 67108864; // bytes } return v; }
FB_UINT64 Config::getTempCacheLimit() { SINT64 v = (SINT64) getDefaultConfig()->values[KEY_TEMP_CACHE_LIMIT]; if (v < 0) { v = getSharedDatabase() ? 8388608 : 67108864; // bytes } return v; }
QString VConfigManager::getThemeFile() const { auto it = m_themes.find(m_theme); if (it != m_themes.end()) { return it.value(); } else { qWarning() << "use default theme due to missing specified theme" << m_theme; const_cast<VConfigManager *>(this)->m_theme = getDefaultConfig("global", "theme").toString(); return m_themes[m_theme]; } }
QVariant VConfigManager::getConfigFromSettings(const QString §ion, const QString &key) const { // First, look up the user-scoped config file QVariant value = getConfigFromSettingsBySectionKey(userSettings, section, key); if (!value.isNull()) { qDebug() << "user config:" << (section + "/" + key) << value; return value; } // Second, look up the default config file return getDefaultConfig(section, key); }
AwtGraphicsConfigDataPtr getGraphicsConfigFromMenuBarPeer(JNIEnv *env, jobject menubarPeer) { jobject gc_object; AwtGraphicsConfigDataPtr adata; /* GraphicsConfiguration object of Component */ gc_object = (*env)->GetObjectField(env, menubarPeer, mMenuBarPeerIDs.graphicsConfig); if (gc_object != NULL) { adata = (AwtGraphicsConfigDataPtr) JNU_GetLongFieldAsPtr(env, gc_object, x11GraphicsConfigIDs.aData); } else { adata = getDefaultConfig(DefaultScreen(awt_display)); } return adata; }
void VConfigManager::initDocSuffixes() { m_docSuffixes.clear(); QStringList mdSuffix = getConfigFromSettings("global", "markdown_suffix").toStringList(); if (mdSuffix.isEmpty()) { mdSuffix = getDefaultConfig("global", "markdown_suffix").toStringList(); } for (auto it = mdSuffix.begin(); it != mdSuffix.end();) { if (it->isEmpty()) { it = mdSuffix.erase(it); } else { *it = it->toLower(); ++it; } } Q_ASSERT(!mdSuffix.isEmpty()); mdSuffix.removeDuplicates(); m_docSuffixes[(int)DocType::Markdown] = mdSuffix; QList<QString> list; list << "ls" << "list"; m_docSuffixes[(int)DocType::List] = list; QList<QString> container; container << "co" << "container" << "con"; m_docSuffixes[(int)DocType::Container] = container; QList<QString> html; html << "html"; m_docSuffixes[(int)DocType::Html] = html; qDebug() << "doc suffixes" << m_docSuffixes; }
void getExtAwtData(Display *display, int32_t screen, int32_t *awt_depth, Colormap *awt_cmap, Visual **awt_visual, int32_t *awt_num_colors, void *pReserved) { AwtGraphicsConfigDataPtr defaultConfig = NULL; #ifdef DEBUG if (pReserved != NULL) { jio_fprintf(stderr, "getExtAwtData: warning: reserved pointer is not null\n"); } #endif if (screen >= 0) { defaultConfig = getDefaultConfig(screen); } if (defaultConfig) { if (awt_depth != NULL) { *awt_depth = defaultConfig->awt_depth; } if (awt_cmap != NULL) { *awt_cmap = defaultConfig->awt_cmap; } if (awt_visual != NULL) { *awt_visual = defaultConfig->awt_visInfo.visual; } if (awt_num_colors != NULL) { *awt_num_colors = defaultConfig->awt_num_colors; } } }
int Config::getServerMode() { static int rc = -1; if (rc >= 0) return rc; const char* textMode = (const char*) (getDefaultConfig()->values[KEY_SERVER_MODE]); const char* modes[6] = {"Super", "ThreadedDedicated", "SuperClassic", "ThreadedShared", "Classic", "MultiProcess"}; for (int x = 0; x < 6; ++x) { if (fb_utils::stricmp(textMode, modes[x]) == 0) { rc = x / 2; return rc; } } // use default rc = MODE_SUPER; return rc; }
FB_UINT64 Config::getMaxUserTraceLogSize() { return (FB_UINT64)(SINT64) getDefaultConfig()->values[KEY_MAX_TRACELOG_SIZE]; }
const char *Config::getAuditTraceConfigFile() { return (const char*) getDefaultConfig()->values[KEY_TRACE_CONFIG]; }
FB_UINT64 Config::getFileSystemCacheSize() { return (FB_UINT64)(SINT64) getDefaultConfig()->values[KEY_FILESYSTEM_CACHE_SIZE]; }
bool Config::getRelaxedAliasChecking() { return (bool) getDefaultConfig()->values[KEY_RELAXED_ALIAS_CHECKING]; }
bool Config::getRedirection() { return (bool) getDefaultConfig()->values[KEY_REDIRECTION]; }
bool Config::getLegacyHash() { return (bool) getDefaultConfig()->values[KEY_LEGACY_HASH]; }
int Config::getTraceDSQL() { return (int) getDefaultConfig()->values[KEY_TRACE_DSQL]; }
bool Config::getBugcheckAbort() { return (bool) getDefaultConfig()->values[KEY_BUGCHECK_ABORT]; }
const char *Config::getTempDirectories() { return (const char*) getDefaultConfig()->values[KEY_TEMP_DIRECTORIES]; }
bool Config::getSharedCache() { return (bool) getDefaultConfig()->values[KEY_SHARED_CACHE]; }
const char *Config::getDatabaseAccess() { return (const char*) getDefaultConfig()->values[KEY_DATABASE_ACCESS]; }
const char *Config::getRemoteBindAddress() { return (const char*) getDefaultConfig()->values[KEY_REMOTE_BIND_ADDRESS]; }
bool Config::getSharedDatabase() { return (bool) getDefaultConfig()->values[KEY_SHARED_DATABASE]; }
int Config::getProcessPriorityLevel() { return (int) getDefaultConfig()->values[KEY_PROCESS_PRIORITY_LEVEL]; }