summaryrefslogtreecommitdiffstats
path: root/win/vncviewer
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-09-11 07:00:59 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2006-09-11 07:00:59 +0000
commitb6d87aa651fa5b06c03eb42f291f398233ff8a15 (patch)
tree3bfa80d4c0b22b0fe06d157eee354b07ae2f2825 /win/vncviewer
parente297baffa7ac255ce54cca937a1cd6d02e481044 (diff)
downloadtigervnc-b6d87aa651fa5b06c03eb42f291f398233ff8a15.tar.gz
tigervnc-b6d87aa651fa5b06c03eb42f291f398233ff8a15.zip
Added implementation of the ZOOM IN and ZOOM OUT vncviewer
toolbar buttons. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@660 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'win/vncviewer')
-rw-r--r--win/vncviewer/CConn.cxx26
-rw-r--r--win/vncviewer/DesktopWindow.h1
2 files changed, 26 insertions, 1 deletions
diff --git a/win/vncviewer/CConn.cxx b/win/vncviewer/CConn.cxx
index ccf80f36..388014ff 100644
--- a/win/vncviewer/CConn.cxx
+++ b/win/vncviewer/CConn.cxx
@@ -62,6 +62,9 @@ const int IDM_AUTO_SIZE = ID_AUTO_SIZE;
static IntParameter debugDelay("DebugDelay","Milliseconds to display inverted "
"pixel data - a debugging feature", 0);
+const int scaleValues[9] = {10, 25, 50, 75, 90, 100, 125, 150, 200};
+const int scaleCount = 9;
+
//
// -=- CConn implementation
@@ -187,8 +190,29 @@ CConn::sysCommand(WPARAM wParam, LPARAM lParam) {
window->setFullscreen(options.fullScreen);
return true;
case IDM_ZOOM_IN:
- return true;
case IDM_ZOOM_OUT:
+ {
+ if (options.autoScaling) {
+ options.scale = window->getDesktopScale();
+ options.autoScaling = false;
+ window->setAutoScaling(false);
+ }
+ if (wParam == IDM_ZOOM_IN) {
+ for (int i = 0; i < scaleCount; i++)
+ if (options.scale < scaleValues[i]) {
+ options.scale = scaleValues[i];
+ break;
+ }
+ } else {
+ for (int i = scaleCount-1; i >= 0; i--)
+ if (options.scale > scaleValues[i]) {
+ options.scale = scaleValues[i];
+ break;
+ }
+ }
+ if (options.scale != window->getDesktopScale())
+ window->setDesktopScale(options.scale);
+ }
return true;
case IDM_ACTUAL_SIZE:
if (options.autoScaling) {
diff --git a/win/vncviewer/DesktopWindow.h b/win/vncviewer/DesktopWindow.h
index c24b0ced..8e82083e 100644
--- a/win/vncviewer/DesktopWindow.h
+++ b/win/vncviewer/DesktopWindow.h
@@ -88,6 +88,7 @@ namespace rfb {
}
bool isAutoScaling() const { return autoScaling; }
void setDesktopScale(int scale);
+ int getDesktopScale() const { return buffer->getScale(); }
void fitBufferToWindow(bool repaint = true);
// - Set the cursor to render when the pointer is within the desktop buffer