& curr_key,
const string& def_key1,
45 const string& def_key2,
const string& def_key3)
48 if( !def_key3.empty()) {
49keys.push_back(def_key3);
51 if( !def_key2.empty() && def_key2 != def_key3 ) {
52keys.push_back(def_key2);
54 if( !def_key1.empty() && def_key1 != def_key2) {
55keys.push_back(def_key1);
57 if(curr_key != def_key1) {
58keys.push_back(curr_key);
66 const string& curr_key,
const string& def_key1,
67 const string& def_key2,
const string& def_key3)
70 if( !def_key3.empty()) {
71keys.push_back(def_key3);
73 if( !def_key2.empty() && def_key2 != def_key3 ) {
74keys.push_back(def_key2);
76 if( !def_key1.empty() && def_key1 != def_key2) {
77keys.push_back(def_key1);
79 if(curr_key != def_key1) {
80keys.push_back(curr_key);
89 typedefvector<string>
TTokens;
92 ITERATE(vector<string>, iter, tokens) {
95 if(pair.size() == 2) {
96settings[pair[0]] = pair[1];
105 if(!settings.
empty()) {
106 autoit = settings.
begin();
110 while(++it != settings.
end()) {
122 const string& face_key,
const string& size_key,
126view.
GetString(face_key,
"Helvetica"));
127 unsigned intfont_size = (
unsigned int)view.
GetInt(size_key, 10);
129 f.SetFontFace(font_face);
130 f.SetFontSize(font_size);
135 const string& face_key,
const string& size_key,
139view.
Set(size_key, (
int)
f.GetFontSize());
144 const string& face_key,
const string& size_key,
148view.
GetString(face_key,
"Helvetica"));
149 unsigned intfont_size = (
unsigned int)view.
GetInt(size_key, 10);
151 f.SetFontFace(font_face);
152 f.SetFontSize(font_size);
157 const string& face_key,
const string& size_key,
161view.
Set(size_key, (
int)
f.GetFontSize());
167 switch(
f.GetData().Which()) {
170vector<int> cvi =
f.GetData().GetInts();
171 if(cvi.size() > 2 ) {
172vector<int>::const_iterator cv_it = cvi.begin();
173c.
SetRed(
static_cast<unsigned char>(*cv_it++));
174c.
SetGreen(
static_cast<unsigned char>(*cv_it++));
175c.
SetBlue(
static_cast<unsigned char>(*cv_it++));
176 if(cv_it != cvi.end()) {
177c.
SetAlpha(
static_cast<unsigned char>(*cv_it));
185vector<double> cvd =
f.GetData().GetReals();
186 if(cvd.size() > 2 ) {
187vector<double>::const_iterator cv_it = cvd.begin();
188c.
SetRed(
static_cast<float>(*cv_it++));
189c.
SetGreen(
static_cast<float>(*cv_it++));
190c.
SetBlue(
static_cast<float>(*cv_it++));
191 if(cv_it != cvd.end()) {
192c.
SetAlpha(
static_cast<float>(*cv_it));
200 stringcs =
f.GetData().GetStr();
220 f.SetData().SetInts() =
val;
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
string GetString(const string &key, const string &default_val=kEmptyStr) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
class CRgbaColor provides a simple abstraction for managing colors.
static void GetTexFont(const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
static void SetTexFont(CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
static void GetFont(const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
static bool x_UserFieldToColor(const objects::CUser_field &f, CRgbaColor &c)
static string ComposeProfileString(const TKeyValuePairs &settings)
static CRegistryReadView GetReadView(const CGuiRegistry ®, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
read/readwrite view creation helper methods.
static CRegistryWriteView GetWriteView(CGuiRegistry ®, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
static void x_ColorToUserField(const CRgbaColor &c, objects::CUser_field &f)
static string m_CommonDefaultStyleName
static void ParseProfileString(const string &profile_str, TKeyValuePairs &settings)
static void SetFont(CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
const_iterator begin() const
const_iterator end() const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static string FaceToString(EFontFace face)
funtions below provide conversion of font parameters to strings and back.
EFontFace
Set of pre-defined fonts for which we know we have valid font files.
static EFontFace FaceFromString(const string &str)
Selects a font face given a string or eFontFace_LastFont on failure.
unsigned char GetRedUC(void) const
Get specific channels in unsigned char values.
unsigned char GetGreenUC(void) const
unsigned char GetAlphaUC(void) const
void FromString(const string &str)
Assign color values encoded in a string.
unsigned char GetBlueUC(void) const
static void TokenizeWithEscape(const string &str, const string &delim, vector< string > &tokens, bool remove_escape=false)
Tokenize a string using the delim.
void SetRed(float r)
Set specific channels from floating point values.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
list< STokenInfo > TTokens
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4