Exemplo n.º 1
0
void MarkerSection::preParse(const INIConfigSection& section,
		ValidationList& validation) {
	name_long.setDefault(getSectionName());
	title_format.setDefault("%(text)");
	match_empty.setDefault(false);
	show_default.setDefault(true);
}
Exemplo n.º 2
0
void MapSection::preParse(const INIConfigSection& section,
		ValidationList& validation) {
	name_short = getSectionName();
	name_long = name_short;

	// set some default configuration values
	render_view.setDefault(renderer::RenderViewType::ISOMETRIC);
	render_mode.setDefault(renderer::RenderModeType::DAYLIGHT);
	overlay.setDefault(renderer::OverlayType::NONE);
	rotations.setDefault("top-left");

	// check if we can find a default texture directory
	fs::path texture_dir_found = util::findTextureDir();
	if (!texture_dir_found.empty())
		texture_dir.setDefault(texture_dir_found);
	texture_size.setDefault(12);
	texture_blur.setDefault(0);
	water_opacity.setDefault(1.0);
	tile_width.setDefault(1);

	image_format.setDefault(ImageFormat::PNG);
	png_indexed.setDefault(false);
	jpeg_quality.setDefault(85);

	lighting_intensity.setDefault(1.0);
	lighting_water_intensity.setDefault(1.0);
	render_unknown_blocks.setDefault(false);
	render_leaves_transparent.setDefault(true);
	render_biomes.setDefault(true);
	use_image_mtimes.setDefault(true);
}
void LatexDocVisitor::visitPre(DocHtmlHeader *header)
{
   if (m_hide) {
      return;
   }
   m_t << "\\" << getSectionName(header->level()) << "*{";
}
Exemplo n.º 4
0
void LatexDocVisitor::visitPre(DocSection *s)
{
  if (m_hide) return;
  if (Config_getBool("PDF_HYPERLINKS"))
  {
    m_t << "\\hypertarget{" << stripPath(s->file()) << "_" << s->anchor() << "}{}";
  }
  m_t << "\\" << getSectionName(s->level()) << "{";
  filter(convertCharEntitiesToUTF8(s->title().data()));
  m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}" << endl;
}
static Bool
ccsReadGlobalConfig (ConfigOption option,
		     char         **value)
{
    IniDictionary *iniFile;
    char          *entry = NULL;
    char          *section;
    Bool          ret;
    FILE          *fp;

    /* check if the global config file exists - if it doesn't, exit
       to avoid it being created by ccsIniOpen */
    fp = fopen (SYSCONFDIR "/compizconfig/config", "r");
    if (!fp)
	return FALSE;
    fclose (fp);

    iniFile = ccsIniOpen (SYSCONFDIR "/compizconfig/config");
    if (!iniFile)
	return FALSE;

    switch (option)
    {
    case OptionProfile:
	entry = "profile";
	break;
    case OptionBackend:
	entry = "backend";
	break;
    case OptionIntegration:
	entry = "integration";
	break;
    case OptionAutoSort:
	entry = "plugin_list_autosort";
	break;
    default:
	break;
    }

    if (!entry)
    {
	ccsIniClose (iniFile);
	return FALSE;
    }

    *value = NULL;
    section = getSectionName();
    ret = ccsIniGetString (iniFile, section, entry, value);
    free (section);
    ccsIniClose (iniFile);

    return ret;
}
void LatexDocVisitor::visitPre(DocSection *s)
{
   if (m_hide) {
      return;
   }
   if (Config::getBool("latex-hyper-pdf")) {
      m_t << "\\hypertarget{" << stripPath(s->file()) << "_" << s->anchor() << "}{}";
   }
   m_t << "\\" << getSectionName(s->level()) << "{";
   filter(convertCharEntities(s->title()));
   m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}" << endl;
}
Bool
ccsReadConfig (ConfigOption option,
	       char         **value)

{
    IniDictionary *iniFile;
    char          *entry = NULL;
    char          *section;
    Bool          ret;

    iniFile = getConfigFile();
    if (!iniFile)
	return ccsReadGlobalConfig (option, value);

    switch (option)
    {
    case OptionProfile:
	entry = "profile";
	break;
    case OptionBackend:
	entry = "backend";
	break;
    case OptionIntegration:
	entry = "integration";
	break;
    case OptionAutoSort:
	entry = "plugin_list_autosort";
	break;
    default:
	break;
    }

    if (!entry)
    {
	ccsIniClose (iniFile);
	return FALSE;
    }

    *value = NULL;
    section = getSectionName();
    ret = ccsIniGetString (iniFile, section, entry, value);
    free (section);
    ccsIniClose (iniFile);

    if (!ret)
	ret = ccsReadGlobalConfig (option, value);

    return ret;
}
Exemplo n.º 8
0
void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable)
{
	mask->szMaskUpper = NULL;

	if (mask->hIcolibItem)
		IcoLib_RemoveIcon(mask->szIconName);
	mask->hIcolibItem = NULL;

	if (!mask->szMask || !bEnable)
		return;

	size_t iMaskLen = mir_tstrlen(mask->szMask) + 1;
	LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(TCHAR));
	_tcscpy_s(pszNewMask, iMaskLen, mask->szMask);
	_tcsupr_s(pszNewMask, iMaskLen);
	mask->szMaskUpper = pszNewMask;

	TCHAR destfile[MAX_PATH];
	if (mask->iIconIndex == IDI_NOTFOUND || mask->iIconIndex == IDI_UNKNOWN || mask->iIconIndex == IDI_UNDETECTED)
		GetModuleFileName(g_hInst, destfile, MAX_PATH);
	else {
		_tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE);

		struct _stat64i32 stFileInfo;
		if (_tstat(destfile, &stFileInfo) == -1)
			return;
	}

	LPTSTR SectName = getSectionName(mask->iSectionFlag);
	if (SectName == NULL)
		return;

	SKINICONDESC sid = { 0 };
	sid.flags = SIDF_ALL_TCHAR;
	sid.section.t = SectName;
	sid.pszName = mask->szIconName;
	sid.description.t = mask->szClientDescription;
	sid.defaultFile.t = destfile;
	sid.iDefaultIndex = -mask->iIconIndex;
	mask->hIcolibItem = IcoLib_AddIcon(&sid);
}
Exemplo n.º 9
0
std::string WorldSection::getShortName() {
	return getSectionName();
}
Exemplo n.º 10
0
std::string WorldSection::getPrettyName() const {
	if (isGlobal())
		return "Global world section";
	return "World section '" + getSectionName() + "'";
}
Bool
ccsWriteConfig (ConfigOption option,
		char         *value)
{
    IniDictionary *iniFile;
    char          *entry = NULL;
    char          *section;
    char          *fileName;
    char          *curVal;
    Bool          changed = TRUE;

    /* don't change config if nothing changed */
    if (ccsReadConfig (option, &curVal))
    {
	changed = (strcmp (value, curVal) != 0);
	free (curVal);
    }

    if (!changed)
	return TRUE;

    iniFile = getConfigFile();
    if (!iniFile)
	return FALSE;

    switch (option)
    {
    case OptionProfile:
	entry = "profile";
	break;
    case OptionBackend:
	entry = "backend";
	break;
    case OptionIntegration:
	entry = "integration";
	break;
    case OptionAutoSort:
	entry = "plugin_list_autosort";
	break;
    default:
	break;
    }

    if (!entry)
    {
	ccsIniClose (iniFile);
	return FALSE;
    }

    section = getSectionName();
    ccsIniSetString (iniFile, section, entry, value);
    free (section);

    fileName = getConfigFileName();
    if (!fileName)
    {
	ccsIniClose (iniFile);
	return FALSE;
    }

    ccsIniSave (iniFile, fileName);
    ccsIniClose (iniFile);
    free (fileName);

    return TRUE;
}
Exemplo n.º 12
0
std::string MarkerSection::getShortName() const {
	return getSectionName();
}
Exemplo n.º 13
0
std::string MarkerSection::getPrettyName() const {
	if (isGlobal())
		return "Global marker section";
	return "Marker section '" + getSectionName() + "'";
}