示例#1
0
// static
String Environment::GetEnvironmentVariable(StringIn name)
{
	DWORD len = ::GetEnvironmentVariableW(name.c_strw(), nullptr, 0);

	WCHAR* value = new WCHAR[len+1];
	::GetEnvironmentVariableW(name.c_strw(), value, (len+1));
	return String::FromRaw(value, len);
}
示例#2
0
void Node::set_nodeName(StringIn qualifiedName)
{
	m_nodeName = qualifiedName;

// Set prefix and localName
	size_t ncolon = qualifiedName.find(':');
	if (ncolon != String::npos)
	{
		m_prefix = qualifiedName.LeftOf(ncolon);
		m_localName = qualifiedName.RightOf(ncolon+1);
	}
	else
	{
		m_prefix = nullptr;
		m_localName = m_nodeName;
	}
}
示例#3
0
void Timeline::gotoAndPlay(StringIn label)
{
//	int nframe = ((_Timeline*)(_Sprite*)Sprite(m_character).m_p)->m_labels[label]-1;
	int nframe = m_labels[label]-1;

	if (nframe >= 0)
	{
	}
	else
	{
		TRACE("gotoAndPlay(%s) : unspecified label\n", label->c_str());
	}
}
示例#4
0
// static
void Environment::SetEnvironmentVariable(StringIn name, StringIn value)
{
	::SetEnvironmentVariableW(name.c_strw(), value.c_strw());
}
void SVGTransformList::ParseTransform(StringIn s)
{

	if (s.IsEmpty()) return;

	ASSERT(0);
#if 0

	const WCHAR* p = s->c_str();
	if (p == NULL) THROW(std::exception("null pointer"));

	while (*p)
	{
		while (*p && std::isspace(*p)) p++;	// Skip spaces

		// Get type
		const WCHAR* transformType = p;
		int transformTypeLength = 0;

		while (*p && std::isalpha(*p))
		{
			transformTypeLength++;
			p++;
		}

		while (*p && std::isspace(*p)) p++;	// Skip spaces

	// Get string inside ( )
		if (*p++ != L'(') break;	// Error

		const WCHAR* start = p;
		while (*p && *p != L')')
		{
			p++;
		}
		System::StringW* param_string = new System::StringW(string_copy(start, p - start));

		if (*p++ != L')') break; // Error
		while (*p && std::isspace(*p)) p++;	// Skip spaces

		SVGTransform* transform = NULL;

#if WIN32
		if (!_wcsnicmp(transformType, L"translate", transformTypeLength))
		{
			double x, y;
			GetTranslateValues(param_string->c_str(), x, y);

			transform = new SVGTransformMutable;
			transform->SetTranslate(x, y);
		}
		else if (!_wcsnicmp(transformType, L"rotate", transformTypeLength))
		{
			double deg, cx, cy;
			GetRotateValues(param_string->c_str(), deg, cx, cy);

			transform = new SVGTransformMutable;
			transform->SetRotate(deg, cx, cy);
		}
		else if (!_wcsnicmp(transformType, L"scale", transformTypeLength))
		{
			double sx, sy;
			GetScaleValues(param_string->c_str(), sx, sy);

			transform = new SVGTransformMutable;
			transform->SetScale(sx, sy);
		}
		else if (!_wcsnicmp(transformType, L"skewX", transformTypeLength))
		{
			double deg;
			GetSkewValues(param_string->c_str(), deg);

			transform = new SVGTransformMutable;
			transform->SetSkewX(deg);
		}
		else if (!_wcsnicmp(transformType, L"skewY", transformTypeLength))
		{
			double deg;
			GetSkewValues(param_string->c_str(), deg);

			transform = new SVGTransformMutable;
			transform->SetSkewY(deg);
		}
		else if (!_wcsnicmp(transformType, L"matrix", transformTypeLength))
		{
			transform = new SVGTransformMutable;

			transform->m_type = SVG_TRANSFORM_MATRIX;
			GetMatrixValues(param_string->c_str(), transform->m_matrix);
		}
#else
		ASSERT(0);
#endif

		if (transform != NULL)
		{
			transform->m_owner = this;
		//	transform->m_pListener = this;
			m_p->m_items.Add(transform);
		}

		if (*p == ',') p++;
		while (*p && std::isspace(*p)) p++;	// Skip spaces
	}
#endif
}