summaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2004-12-28 15:55:46 +0000
committerPeter Åstrand <astrand@cendio.se>2004-12-28 15:55:46 +0000
commit0b8702662a873bb8a9bd78fdfb5a6d6c2a14a928 (patch)
tree4a0395e988c7a20aabe2dec771a28faf8f5cecb9 /vncviewer
parent142e84dafdcaa7d3be8596317f3941e461b592a3 (diff)
downloadtigervnc-0b8702662a873bb8a9bd78fdfb5a6d6c2a14a928.tar.gz
tigervnc-0b8702662a873bb8a9bd78fdfb5a6d6c2a14a928.zip
Added new parameter NoJPEG, hooked up with GUI
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@57 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/CViewOptions.cxx12
-rw-r--r--vncviewer/CViewOptions.h1
-rw-r--r--vncviewer/OptionsDialog.cxx2
-rw-r--r--vncviewer/cview.cxx1
4 files changed, 14 insertions, 2 deletions
diff --git a/vncviewer/CViewOptions.cxx b/vncviewer/CViewOptions.cxx
index d4c647a1..199ddb5e 100644
--- a/vncviewer/CViewOptions.cxx
+++ b/vncviewer/CViewOptions.cxx
@@ -86,6 +86,10 @@ static IntParameter qualityLevel("QualityLevel",
"0 = Low, 9 = High",
5);
+static BoolParameter noJpeg("NoJPEG",
+ "Disable lossy JPEG compression in Tight encoding.",
+ false);
+
CViewOptions::CViewOptions()
: useLocalCursor(::useLocalCursor), useDesktopResize(::useDesktopResize),
autoSelect(::autoSelect), fullColour(::fullColour), fullScreen(::fullScreen),
@@ -93,7 +97,7 @@ shared(::sharedConnection), sendPtrEvents(::sendPtrEvents), sendKeyEvents(::send
preferredEncoding(encodingZRLE), clientCutText(::clientCutText), serverCutText(::serverCutText),
protocol3_3(::protocol3_3), acceptBell(::acceptBell), lowColourLevel(::lowColourLevel),
pointerEventInterval(ptrEventInterval), emulate3(::emulate3), monitor(::monitor.getData()),
-qualityLevel(::qualityLevel)
+qualityLevel(::qualityLevel), noJpeg(::noJpeg)
{
CharArray encodingName(::preferredEncoding.getData());
preferredEncoding = encodingNum(encodingName.buf);
@@ -195,7 +199,8 @@ void CViewOptions::readFromFile(const char* filename) {
setMenuKey(value.buf);
} else if (stricmp(name.buf, "QualityLevel") == 0) {
qualityLevel = atoi(value.buf);
-
+ } else if (stricmp(name.buf, "NoJPEG") == 0) {
+ noJpeg = atoi(value.buf);
// Legacy options
} else if (stricmp(name.buf, "Preferred_Encoding") == 0) {
preferredEncoding = atoi(value.buf);
@@ -280,6 +285,7 @@ void CViewOptions::writeToFile(const char* filename) {
fprintf(f, "Monitor=%s\n", monitor.buf);
fprintf(f, "MenuKey=%s\n", CharArray(menuKeyName()).buf);
fprintf(f, "QualityLevel=%d\n", qualityLevel);
+ fprintf(f, "NoJPEG=%d\n", noJpeg);
fclose(f); f=0;
setConfigFileName(filename);
@@ -313,6 +319,7 @@ void CViewOptions::writeDefaults() {
key.setString(_T("Monitor"), TStr(monitor.buf));
key.setString(_T("MenuKey"), TCharArray(menuKeyName()).buf);
key.setInt(_T("QualityLevel"), qualityLevel);
+ key.setInt(_T("NoJPEG"), noJpeg);
}
@@ -368,5 +375,6 @@ CViewOptions& CViewOptions::operator=(const CViewOptions& o) {
setMonitor(o.monitor.buf);
menuKey = o.menuKey;
qualityLevel = o.qualityLevel;
+ noJpeg = o.noJpeg;
return *this;
}
diff --git a/vncviewer/CViewOptions.h b/vncviewer/CViewOptions.h
index 31e4eada..88b659f0 100644
--- a/vncviewer/CViewOptions.h
+++ b/vncviewer/CViewOptions.h
@@ -78,6 +78,7 @@ namespace rfb {
void setMenuKey(const char* keyName);
char* menuKeyName();
int qualityLevel;
+ bool noJpeg;
};
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx
index 49a19c30..4ff4600c 100644
--- a/vncviewer/OptionsDialog.cxx
+++ b/vncviewer/OptionsDialog.cxx
@@ -93,12 +93,14 @@ public:
case encodingHextile: setItemChecked(IDC_ENCODING_HEXTILE, true); break;
case encodingRaw: setItemChecked(IDC_ENCODING_RAW, true); break;
}
+ setItemChecked(IDC_ALLOW_JPEG, !dlg->options.noJpeg);
setItemInt(IDC_QUALITYLEVEL, dlg->options.qualityLevel);
onCommand(IDC_ENCODING_AUTO, 0 /* ? */); // Force enableItem status to refresh
}
virtual bool onOk() {
dlg->options.autoSelect = isItemChecked(IDC_ENCODING_AUTO);
dlg->options.fullColour = isItemChecked(IDC_FORMAT_FULLCOLOUR);
+ dlg->options.noJpeg = !isItemChecked(IDC_ALLOW_JPEG);
dlg->options.qualityLevel = getItemInt(IDC_QUALITYLEVEL);
if (isItemChecked(IDC_FORMAT_VERYLOWCOLOUR))
dlg->options.lowColourLevel = 0;
diff --git a/vncviewer/cview.cxx b/vncviewer/cview.cxx
index a9a15ff2..ef0aa3ea 100644
--- a/vncviewer/cview.cxx
+++ b/vncviewer/cview.cxx
@@ -253,6 +253,7 @@ CView::applyOptions(CViewOptions& opt) {
cp.supportsLocalCursor = options.useLocalCursor = opt.useLocalCursor;
cp.supportsDesktopResize = options.useDesktopResize = opt.useDesktopResize;
cp.qualityLevel = options.qualityLevel = opt.qualityLevel;
+ cp.noJpeg = options.noJpeg = opt.noJpeg;
if (cursorAvailable)
hideLocalCursor();
cursorAvailable = cursorAvailable && options.useLocalCursor;