/* void setPreferences (in nsIWindowsHooksSettings prefs); */ NS_IMETHODIMP nsWindowsHooks::SetSettings(nsIWindowsHooksSettings *prefs) { nsresult rv = NS_ERROR_FAILURE; putPRBoolIntoRegistry( "isHandlingHTTP", prefs, &nsIWindowsHooksSettings::GetIsHandlingHTTP ); putPRBoolIntoRegistry( "isHandlingHTTPS", prefs, &nsIWindowsHooksSettings::GetIsHandlingHTTPS ); putPRBoolIntoRegistry( "isHandlingFTP", prefs, &nsIWindowsHooksSettings::GetIsHandlingFTP ); putPRBoolIntoRegistry( "isHandlingCHROME", prefs, &nsIWindowsHooksSettings::GetIsHandlingCHROME ); putPRBoolIntoRegistry( "isHandlingGOPHER", prefs, &nsIWindowsHooksSettings::GetIsHandlingGOPHER ); putPRBoolIntoRegistry( "isHandlingHTML", prefs, &nsIWindowsHooksSettings::GetIsHandlingHTML ); putPRBoolIntoRegistry( "isHandlingJPEG", prefs, &nsIWindowsHooksSettings::GetIsHandlingJPEG ); putPRBoolIntoRegistry( "isHandlingGIF", prefs, &nsIWindowsHooksSettings::GetIsHandlingGIF ); putPRBoolIntoRegistry( "isHandlingPNG", prefs, &nsIWindowsHooksSettings::GetIsHandlingPNG ); putPRBoolIntoRegistry( "isHandlingXBM", prefs, &nsIWindowsHooksSettings::GetIsHandlingXBM ); putPRBoolIntoRegistry( "isHandlingBMP", prefs, &nsIWindowsHooksSettings::GetIsHandlingBMP ); putPRBoolIntoRegistry( "isHandlingICO", prefs, &nsIWindowsHooksSettings::GetIsHandlingICO ); putPRBoolIntoRegistry( "isHandlingXML", prefs, &nsIWindowsHooksSettings::GetIsHandlingXML ); putPRBoolIntoRegistry( "isHandlingXHTML", prefs, &nsIWindowsHooksSettings::GetIsHandlingXHTML ); putPRBoolIntoRegistry( "isHandlingXUL", prefs, &nsIWindowsHooksSettings::GetIsHandlingXUL ); putPRBoolIntoRegistry( "showDialog", prefs, &nsIWindowsHooksSettings::GetShowDialog ); // Indicate that these settings have indeed been set. BoolRegistryEntry( "haveBeenSet" ).set(); rv = SetRegistry(); return rv; }
//---------------------------------------------------------------------------------------------- // SetSettingName //---------------------------------------------------------------------------------------------- VOID CSetting::SetSettingName( LONG Index ,WCHAR * SettingName ) { // コントローラーの設定を設定する WCHAR KeyName[MAX_PATH]; swprintf_s( KeyName, SETTING_NAME, Index ); SetRegistry( SettingName, REG_SZ, sizeof( WCHAR ) * wcslen( SettingName ) + 1, KeyName ); }
//---------------------------------------------------------------------------------------------- // SetSetting //---------------------------------------------------------------------------------------------- VOID CSetting::SetSetting( LONG Index ,SETTING * Setting ) { // コントローラーの設定を設定する WCHAR KeyName[MAX_PATH]; swprintf_s( KeyName, SETTING_DATA, Index ); SetRegistry( Setting, REG_BINARY, sizeof( SETTING ), KeyName ); }
//---------------------------------------------------------------------------------------------- // SaveRegistry //---------------------------------------------------------------------------------------------- VOID CSetting::SaveRegistry() { // 現在のコントローラーの設定を更新する SetRegistry( &CurrentSetting, REG_BINARY, sizeof( SETTING ), CURRENT_SETTING ); // 現在のコントローラーの設定の順番を更新する SetRegistry( &CurrentSettingIndex, REG_DWORD, sizeof( LONG ), CURRENT_SETTING_INDEX ); // コントローラーの設定数を取得しておく LONG OldSettingCount = 0; GetRegistry( &OldSettingCount, REG_DWORD, sizeof( LONG ), SETTING_COUNT ); // コントローラーの設定数を更新する SetRegistry( &SettingCount, REG_DWORD, sizeof( LONG ), SETTING_COUNT ); // コントローラーの設定、設定の名称を更新する for( LONG Index = 1; Index < SettingCount; Index ++ ) { SetSetting( Index, &Setting[Index] ); SetSettingName( Index, SettingName[Index] ); } // 余分なコントローラーの設定、設定の名称を削除する if( OldSettingCount > SettingCount ) { for( LONG Index = SettingCount; Index < OldSettingCount; Index ++ ) { DelSetting( Index ); DelSettingName( Index ); } } // 変更済みフラグを更新する SetRegistry( &ModifiedFlag, REG_BINARY, sizeof( BOOLEAN ), MODIFIED_FLAG ); // 設定の自動切換えを更新する SetRegistry( &AutoSettingChange, REG_BINARY, sizeof( BOOLEAN ), AUTO_SETTING_CHANGE ); }
lua_State * Lua::NewBasicState() { lua_State *L = luaL_newstate(); SetRegistry(L, "LUA_NOENV", true); for (auto l : loadedlibs) { luaL_requiref(L, l.name, l.func, 1); lua_pop(L, 1); } /* create the "xcsoar" namespace */ lua_newtable(L); SetField(L, -2, "VERSION", WideToUTF8Converter(XCSoar_Version)); lua_setglobal(L, "xcsoar"); return L; }
void pybase::Reload() { ThrLock lock; PyObject *reg = GetRegistry(REGNAME); if(reg) { PyObject *key; Py_ssize_t pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key); FLEXT_ASSERT(th); th->Unload(); } UnloadModule(); } bool ok = ReloadModule(); if(ok) { LoadModule(); if(reg) { SetRegistry(REGNAME,reg); PyObject *key; Py_ssize_t pos = 0; while(PyDict_Next(reg,&pos,&key,NULL)) { pybase *th = (pybase *)PyLong_AsLong(key); FLEXT_ASSERT(th); th->Load(); } } else Load(); } Report(); }