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
diff --git a/win/vncviewer/CConn.cxx b/win/vncviewer/CConn.cxx
index ccf80f3..388014f 100644
--- a/win/vncviewer/CConn.cxx
+++ b/win/vncviewer/CConn.cxx
@@ -62,6 +62,9 @@
 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 @@
     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) {