コード例 #1
0
ファイル: window_config.cpp プロジェクト: fossamikom/TideSDK
/*static*/
AutoPtr<WindowConfig> WindowConfig::FromProperties(KObjectRef properties)
{
	WindowConfig* c = new WindowConfig();
	c->SetID(properties->GetString("id", c->GetID()));
	c->SetURL(properties->GetString("url", c->GetURL()));
	c->SetURLRegex(properties->GetString("urlRegex", c->GetURLRegex()));
	c->SetTitle(properties->GetString("title", c->GetTitle()));
	c->SetContents(properties->GetString("contents", c->GetContents()));
	c->SetURLRegex(properties->GetString("baseURL", c->GetBaseURL()));
	c->SetX(properties->GetInt("x", c->GetX()));
	c->SetY(properties->GetInt("y", c->GetY()));
	c->SetWidth(properties->GetInt("width", c->GetWidth()));
	c->SetMinWidth(properties->GetInt("minWidth", c->GetMinWidth()));
	c->SetMaxWidth(properties->GetInt("maxWidth", c->GetMaxWidth()));
	c->SetHeight(properties->GetInt("height", c->GetHeight()));
	c->SetMinHeight(properties->GetInt("minHeight", c->GetMinHeight()));
	c->SetMaxHeight(properties->GetInt("maxHeight", c->GetMaxHeight()));
	c->SetMaximizable(CoerceBool(properties, "maximizable", c->IsMaximizable()));
	c->SetMinimizable(CoerceBool(properties, "minimizable", c->IsMinimizable()));
	c->SetCloseable(CoerceBool(properties, "closeable", c->IsCloseable()));
	c->SetResizable(CoerceBool(properties, "resizable", c->IsResizable()));
	c->SetFullscreen(CoerceBool(properties, "fullscreen", c->IsFullscreen()));
	c->SetMaximized(CoerceBool(properties, "maximized", c->IsMaximized()));
	c->SetMinimized(CoerceBool(properties, "minimized", c->IsMinimized()));
	c->SetUsingChrome(CoerceBool(properties, "usingChrome", c->IsUsingChrome()));
	c->SetToolWindow(CoerceBool(properties, "toolWindow", c->IsToolWindow()));
	c->SetTopMost(CoerceBool(properties, "topMost", c->IsTopMost()));
	c->SetVisible(CoerceBool(properties, "visible", c->IsVisible()));
	c->SetTransparentBackground(CoerceBool(properties,
		"transparentBackground", c->HasTransparentBackground()));
	c->SetTransparency(properties->GetDouble("transparency", c->GetTransparency()));

#ifdef OS_OSX
	c->SetTexturedBackground(properties->GetDouble("texturedBackground", c->HasTexturedBackground()));
#endif

	EnforceMaxMinConstraints(c);
	EnforceTransparentBackgroundSettings(c);
	return c;
}