Added 3 new parameters to the vncviewer options:
-autoScaling,
-scaling,
-scale.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@595 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncviewer/CConnOptions.cxx b/win/vncviewer/CConnOptions.cxx
index 4ea0ada..bf2ba5a 100644
--- a/win/vncviewer/CConnOptions.cxx
+++ b/win/vncviewer/CConnOptions.cxx
@@ -116,6 +116,13 @@
"0 = Low, 9 = High",
6);
+static BoolParameter autoScaling("AutoScaling",
+ "Auto rescale local copy of the remote desktop to the client window.",
+ false);
+static IntParameter scale("Scale",
+ "Scale local copy of the remote desktop, in percent",
+ 100);
+
CConnOptions::CConnOptions()
: useLocalCursor(::useLocalCursor), useDesktopResize(::useDesktopResize),
autoSelect(::autoSelect), fullColour(::fullColour), fullScreen(::fullScreen),
@@ -126,7 +133,7 @@
emulate3(::emulate3), monitor(::monitor.getData()), showToolbar(::showToolbar),
customCompressLevel(::customCompressLevel), compressLevel(::compressLevel),
noJpeg(::noJpeg), qualityLevel(::qualityLevel), passwordFile(::passwordFile.getData()),
-autoReconnect(::autoReconnect)
+autoReconnect(::autoReconnect), autoScaling(::autoScaling), scale(::scale)
{
if (autoSelect) {
preferredEncoding = encodingZRLE;
@@ -146,6 +153,9 @@
// Default to CustomCompressLevel=1 if CompressLevel is used.
customCompressLevel = ::compressLevel.hasBeenSet();
}
+
+ if (scale != 100) scaling = true;
+ else scaling = false;
}
@@ -264,6 +274,10 @@
sendPtrEvents = sendKeyEvents = !atoi(value.buf);
} else if (stricmp(name.buf, "DisableClipboard") == 0) {
clientCutText = serverCutText = !atoi(value.buf);
+ } else if (stricmp(name.buf, "AutoScaling") == 0) {
+ autoScaling = atoi(value.buf);
+ } else if (stricmp(name.buf, "Scale") == 0) {
+ scale = atoi(value.buf);
}
}
}
@@ -287,6 +301,9 @@
if (autoSelect)
preferredEncoding = encodingZRLE;
+ if (scale == 100) scaling = false;
+ else scaling = true;
+
setConfigFileName(filename);
} catch (rdr::Exception&) {
if (f) fclose(f);
@@ -345,6 +362,8 @@
fprintf(f, "CompressLevel=%d\n", compressLevel);
fprintf(f, "NoJPEG=%d\n", noJpeg);
fprintf(f, "QualityLevel=%d\n", qualityLevel);
+ fprintf(f, "AutoScaling=%d\n", (int)autoScaling);
+ fprintf(f, "Scale=%d\n", scale);
fclose(f); f=0;
setConfigFileName(filename);
@@ -384,6 +403,8 @@
key.setInt(_T("CompressLevel"), compressLevel);
key.setInt(_T("NoJPEG"), noJpeg);
key.setInt(_T("QualityLevel"), qualityLevel);
+ key.setBool(_T("AutoScaling"), autoScaling);
+ key.setInt(_T("Scale"), scale);
}
@@ -445,6 +466,9 @@
compressLevel = o.compressLevel;
noJpeg = o.noJpeg;
qualityLevel = o.qualityLevel;
+ autoScaling = o.autoScaling;
+ scale = o.scale;
+ scaling = o.scaling;
return *this;
}
diff --git a/win/vncviewer/CConnOptions.h b/win/vncviewer/CConnOptions.h
index 59fd0a3..5f8f00d 100644
--- a/win/vncviewer/CConnOptions.h
+++ b/win/vncviewer/CConnOptions.h
@@ -66,6 +66,9 @@
int pointerEventInterval;
bool protocol3_3;
bool acceptBell;
+ bool autoScaling;
+ bool scaling;
+ int scale;
CharArray userName;
void setUserName(const char* user);
PlainPasswd password;