vnc: Orientation change support

 * Detect orientation changes and reconfigure appropriately.
 * Clean up the uinput code.
 * FIXME: The virtual mouse isn't reconfiguring correctly yet.
diff --git a/src/VNCFlinger.h b/src/VNCFlinger.h
index a446c81..0682a2f 100644
--- a/src/VNCFlinger.h
+++ b/src/VNCFlinger.h
@@ -32,7 +32,8 @@
     VNCFlinger(int argc, char **argv) :
             mArgc(argc),
             mArgv(argv),
-            mClientCount(0) {
+            mClientCount(0),
+            mOrientation(-1) {
     }
 
     virtual ~VNCFlinger() {}
@@ -60,11 +61,15 @@
     virtual void eventLoop();
 
     virtual status_t createVirtualDisplay();
-    virtual status_t destroyVirtualDisplay();
+    virtual status_t destroyVirtualDisplayLocked();
     virtual status_t createVNCServer();
 
     virtual void processFrame();
 
+    virtual bool isDeviceRotated(int orientation);
+    virtual bool updateDisplayProjection();
+    virtual status_t updateFBSize(int width, int height, int stride);
+
     // vncserver callbacks
     static ClientGoneHookPtr onClientGone(rfbClientPtr cl);
     static enum rfbNewClientAction onNewClient(rfbClientPtr cl);
@@ -74,6 +79,9 @@
 
     bool mRunning;
     bool mFrameAvailable;
+    bool mRotate;
+    bool mVDSActive;
+    bool mInputReconfigPending;
 
     Mutex mEventMutex;
     Mutex mUpdateMutex;
@@ -83,16 +91,17 @@
     rfbScreenInfoPtr mVNCScreen;
     uint8_t *mVNCBuf;
 
-    uint32_t mWidth, mHeight;
+    int mWidth, mHeight;
 
     sp<IBinder> mMainDpy;
-    DisplayInfo mMainDpyInfo;
 
     int mArgc;
     char **mArgv;
 
     size_t mClientCount;
 
+    int mOrientation;
+
     sp<FrameListener> mListener;
 
     // Producer side of queue, passed into the virtual display.