static void SaveStyles(FXSettings*reg, const char*section, StyleDef *style) { int i; for (i=0; style[i].key; i++) { SaveStyle(reg,section,&style[i]); } }
void StyleManager::Get(RichText& text) { SaveStyle(); for(int i = 0; i < dirty.GetCount(); i++) { Uuid id = dirty[i]; int q = style.Find(id); if(q >= 0) text.SetStyle(id, style.Get(id)); else text.RemoveStyle(id); } }
// ************************************************************* // HasStyleTable() // ************************************************************* bool OgrStyleHelper::SaveStyle(GDALDataset* dataset, IShapefile* shapefile, CStringW layerName, CStringW styleName) { CStringW xml = ShapeStyleHelper::GetSymbologyFileAsXml(shapefile); return SaveStyle(dataset, xml, layerName, styleName); }
Settings::~Settings() { LangStyle*ls; for (ls=languages; ls->name; ls++) { int i; SaveStyles(style_reg, ls->name, ls->styles); style_reg->writeStringEntry(ls->name,"FileMask",ls->mask?ls->mask:""); style_reg->writeStringEntry(ls->name,"ShebangApps",ls->apps?ls->apps:""); style_reg->writeIntEntry(ls->name,"TabPolicy", ls->tabs); style_reg->writeIntEntry(ls->name,"TabWidth", ls->tabwidth); for (i=0; ls->words[i]; i++) { char key[32]; snprintf(key, sizeof(key)-1, "words_%d", i+1); #ifdef FOX_1_6 // fox 1.6 will choke reading string entries > 2000 chars char buf[1952]; memset(buf,0,sizeof(buf)); strncpy(buf, ls->words[i], sizeof(buf)-1); style_reg->writeStringEntry(ls->name,key,buf); #else style_reg->writeStringEntry(ls->name,key,ls->words[i]); #endif } } SaveStyles(style_reg, global_sect, GlobalStyle); SaveStyle(style_reg, global_sect,&WhiteSpaceStyle); SaveStyle(style_reg, global_sect,&CaretLineStyle); SaveStyle(style_reg, global_sect,&RightMarginStyle); reg->deleteSection(keys_sect); reg->deleteSection(tbar_sect); WriteInt(ShowStatusBar); WriteInt(ShowWhiteSpace); WriteInt(ShowOutputPane); bool InvertColors=ColorFuncs::ColorsInverted(); WriteInt(InvertColors); WriteInt(SplitView); WriteInt(OutputPaneHeight); WriteInt(ShowLineNumbers); WriteInt(ShowToolbar); WriteInt(SmartHome); WriteInt(WrapAwareHomeEnd); WriteInt(AutoIndent); WriteInt(BraceMatch); WriteInt(UseTabs); WriteInt(CaretPastEOL); WriteInt(TabWidth); WriteInt(IndentWidth); WriteInt(CaretWidth); WriteInt(RightEdgeColumn); WriteInt(ShowRightEdge); WriteInt(ShowIndentGuides); WriteInt(ShowCaretLine); WriteInt(SmoothScroll); WriteInt(WheelLines); WriteInt(SearchWrap); WriteInt(SearchGui); WriteInt(SearchVerbose); WriteInt(SearchOptions); WriteInt(ZoomFactor); WriteInt(MaxFiles); WriteInt(PromptCloseMultiMenu); WriteInt(PromptCloseMultiExit); WriteInt(WatchExternChanges); WriteInt(Autosave); WriteInt(AutosaveInterval); WriteInt(SaveBeforeFilterSel); WriteInt(SaveBeforeInsCmd); WriteInt(SaveBeforeExecCmd); WriteInt(WhitespaceShowsEOL); WriteInt(DefaultFileFormat); WriteInt(WrapToolbar); WriteInt(WordWrap); WriteInt(ToolbarButtonSize); WriteInt(Left); WriteInt(Top); WriteInt(Width); WriteInt(Height); WriteInt(Maximize); WriteInt(FontSize); WriteInt(FontAscent); WriteInt(FontDescent); WriteInt(DefaultToAscii); WriteInt(DefaultToSbcs); WriteInt(KeepFileFilter); WriteInt(FileFilterIndex); WriteInt(FileOpenMulti); WriteInt(TabTitleMaxWidth); if (!(DocTabPosition && strchr("TBLR",DocTabPosition))) { DocTabPosition='T'; } char dtp[2]={DocTabPosition,'\0'}; reg->writeStringEntry(view_sect,"DocTabPosition",dtp); if (!(DocTabsPacked && strchr("UPA",DocTabsPacked))) { DocTabsPacked='T'; } dtp[0]=DocTabsPacked; reg->writeStringEntry(view_sect,"DocTabsPacked",dtp); WriteStr(FontName); WriteStr(FileFilters); WriteStr(ShellCommand); FreeAllKeywordLists(); mnumgr->WriteMenuSpecs(reg,keys_sect); mnumgr->WriteToolbarButtons(reg,tbar_sect); mnumgr->WritePopupMenu(reg,popup_sect); SaveErrorPatterns(reg); SaveSysIncPaths(reg); if (!style_reg->unparseFile(style_file)) { FXMessageBox::error(app,MBOX_OK, _("Configuration error"), "%s \n%s\n%s", _("Failed to save settings to"), style_file.text(), SystemErrorStr() ); } delete style_reg; ini_sort(style_file.text()); }