Пример #1
0
void init_llui()
{
	// Font lookup needs directory support
#if LL_DARWIN
	const char* newview_path = "../../../../newview";
#else
	const char* newview_path = "../../../newview";
#endif
	gDirUtilp->initAppDirs("GIS", newview_path);
	gDirUtilp->setSkinFolder("default");
	
	// colors are no longer stored in a LLControlGroup file
	LLUIColorTable::instance().loadFromSettings();

	std::string config_filename = gDirUtilp->getExpandedFilename(
																 LL_PATH_APP_SETTINGS, "settings.xml");
	gSavedSettings.loadFromFile(config_filename);
	
	// See LLAppViewer::init()
	LLUI::settings_map_t settings;
	settings["config"] = &gSavedSettings;
	settings["ignores"] = &gWarningSettings;
	settings["floater"] = &gSavedSettings;
	settings["account"] = &gSavedPerAccountSettings;
	
	// Don't use real images as we don't have a GL context
	LLUI::initClass(settings, &gTestImageProvider);
	
	const bool no_register_widgets = false;
	LLWidgetReg::initClass( no_register_widgets );
	
	// Unclear if this is needed
	LLUI::setupPaths();
	// Otherwise we get translation warnings when setting up floaters
	// (tooltips for buttons)
	std::set<std::string> default_args;
	LLTransUtil::parseStrings("strings.xml", default_args);
	LLTransUtil::parseLanguageStrings("language_settings.xml");
	LLFontManager::initClass();
	
	// Creating widgets apparently requires fonts to be initialized,
	// otherwise it crashes.
	LLFontGL::initClass(96.f, 1.f, 1.f,
						gDirUtilp->getAppRODataDir(),
						LLUI::getXUIPaths(),
						false );	// don't create gl textures
	
	LLFloaterView::Params fvparams;
	fvparams.name("Floater View");
	fvparams.rect( LLRect(0,480,640,0) );
	fvparams.mouse_opaque(false);
	fvparams.follows.flags(FOLLOWS_ALL);
	fvparams.tab_stop(false);
	gFloaterView = LLUICtrlFactory::create<LLFloaterView> (fvparams);
}