Beispiel #1
0
int CIEProxy::ReadReg()
{
	SetEnable(0);
	SetHost("");
	SetPort2(-1);
	SetOverride("");

	HKEY hKeyIn = HKEY_CURRENT_USER, hKeyOut;
	if( ERROR_SUCCESS != RegOpenKeyExA(hKeyIn, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", 0, KEY_CREATE_LINK | KEY_WRITE | KEY_READ | KEY_NOTIFY, &hKeyOut))
	{
		return -1;
	}
	
	DWORD proxyEnable = 0;
	ULONG regSize = sizeof(DWORD);
	if(ERROR_SUCCESS != RegQueryValueExA(hKeyOut, "ProxyEnable", NULL, NULL, (BYTE *)&proxyEnable, &regSize))
	{
		return 0;
	}

	SetEnable(proxyEnable);

	char proxyServer[1024] = { 0 };
	regSize = sizeof(proxyServer);
	if(ERROR_SUCCESS != RegQueryValueExA(hKeyOut, "ProxyServer", NULL, NULL, (BYTE *)&proxyServer, &regSize))
	{
		return 0;
	}

	string strProxyServer = proxyServer;
	if(strProxyServer.find("://") != string::npos)
	{
		strProxyServer = strProxyServer.substr(strProxyServer.find("://") + 3);
	}

	if(strProxyServer.find(":") != string::npos)
	{
		SetHost(strProxyServer.substr(0, strProxyServer.find(":")));
		SetPort2(atoi(strProxyServer.substr(strProxyServer.find(":") + 1).c_str()));
	}
	else
	{
		SetHost(strProxyServer);
		SetPort2(80);
	}

	char proxyOverride[1024] = { 0 };
	regSize = sizeof(proxyOverride);
	if(ERROR_SUCCESS == RegQueryValueExA(hKeyOut, "ProxyOverride", NULL, NULL, (BYTE *)&proxyOverride, &regSize))
	{
		SetOverride(proxyOverride);
	}

	return 0;
}
Beispiel #2
0
void VisualToolDrag::UpdateDrag(feature_iterator feature) {
	if (feature->type == DRAG_ORIGIN) {
		SetOverride(feature->line, "\\org", ToScriptCoords(feature->pos).PStr());
		return;
	}

	feature_iterator end_feature = feature->parent;
	if (feature->type == DRAG_END)
		std::swap(feature, end_feature);

	if (feature->parent == features.end())
		SetOverride(feature->line, "\\pos", ToScriptCoords(feature->pos).PStr());
	else
		SetOverride(feature->line, "\\move",
			str(boost::format("(%s,%s,%d,%d)")
				% ToScriptCoords(feature->pos).Str()
				% ToScriptCoords(end_feature->pos).Str()
				% feature->time % end_feature->time));
}
void VisualToolRotateXY::UpdateDrag(Feature *feature) {
	auto org = GetLineOrigin(active_line);
	if (!org) org = GetLinePosition(active_line);
	auto d = ToScriptCoords(feature->pos) - org;

	for (auto line : c->selectionController->GetSelectedSet()) {
		org = GetLineOrigin(line);
		if (!org) org = GetLinePosition(line);
		SetOverride(line, "\\org", (d + org).PStr());
	}
}
void VisualToolCross::OnDoubleClick() {
	Vector2D d = ToScriptCoords(mouse_pos) - GetLinePosition(active_line);

	for (auto line : c->selectionController->GetSelectedSet()) {
		Vector2D p1, p2;
		int t1, t2;
		if (GetLineMove(line, p1, p2, t1, t2)) {
			if (t1 > 0 || t2 > 0)
				SetOverride(line, "\\move", str(boost::format("(%s,%s,%d,%d)") % Text(p1 + d) % Text(p2 + d) % t1 % t2));
			else
				SetOverride(line, "\\move", str(boost::format("(%s,%s)") % Text(p1 + d) % Text(p2 + d)));
		}
		else
			SetOverride(line, "\\pos", "(" + Text(GetLinePosition(line) + d) + ")");

		if (Vector2D org = GetLineOrigin(line))
			SetOverride(line, "\\org", "(" + Text(org + d) + ")");
	}

	Commit(_("positioning"));
}
Beispiel #5
0
void VisualToolDrag::OnDoubleClick() {
	Vector2D d = ToScriptCoords(mouse_pos) - (primary ? ToScriptCoords(primary->pos) : GetLinePosition(active_line));

	for (auto line : c->selectionController->GetSelectedSet()) {
		Vector2D p1, p2;
		int t1, t2;
		if (GetLineMove(line, p1, p2, t1, t2)) {
			if (t1 > 0 || t2 > 0)
				SetOverride(line, "\\move", str(boost::format("(%s,%s,%d,%d)") % (p1 + d).Str() % (p2 + d).Str() % t1 % t2));
			else
				SetOverride(line, "\\move", str(boost::format("(%s,%s)") % (p1 + d).Str() % (p2 + d).Str()));
		}
		else
			SetOverride(line, "\\pos", (GetLinePosition(line) + d).PStr());

		if (Vector2D org = GetLineOrigin(line))
			SetOverride(line, "\\org", (org + d).PStr());
	}

	Commit(_("positioning"));

	OnFileChanged();
}
Beispiel #6
0
void VisualToolDrag::OnSubTool(wxCommandEvent &) {
	// Toggle \move <-> \pos
	VideoContext *vc = c->videoController;
	for (auto line : selection) {
		Vector2D p1, p2;
		int t1, t2;

		bool has_move = GetLineMove(line, p1, p2, t1, t2);

		if (has_move)
			SetOverride(line, "\\pos", p1.PStr());
		else {
			p1 = GetLinePosition(line);
			// Round the start and end times to exact frames
			int start = vc->TimeAtFrame(vc->FrameAtTime(line->Start, agi::vfr::START)) - line->Start;
			int end = vc->TimeAtFrame(vc->FrameAtTime(line->Start, agi::vfr::END)) - line->Start;
			SetOverride(line, "\\move", str(boost::format("(%s,%s,%d,%d)") % p1.Str() % p1.Str() % start % end));
		}
	}

	Commit();
	OnFileChanged();
	UpdateToggleButtons();
}
void VisualToolRotateXY::UpdateDrag(Feature *feature) {
	SetOverride(active_line, "\\org", ToScriptCoords(feature->pos).PStr());
}
Beispiel #8
0
void VisualToolBase::SetSelectedOverride(std::string const& tag, std::string const& value) {
	for (auto line : c->selectionController->GetSelectedSet())
		SetOverride(line, tag, value);
}