Improved clipboard API

Change the internal clipboard API to use a request based model in
order to be prepared for more advanced clipboard transfers.
diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h
index 8b9b469..1fb93c6 100644
--- a/vncviewer/Viewport.h
+++ b/vncviewer/Viewport.h
@@ -45,9 +45,6 @@
   // Flush updates to screen
   void updateWindow();
 
-  // Incoming clipboard from server
-  void serverCutText(const char* str);
-
   // New image for the locally rendered cursor
   void setCursor(int width, int height, const rfb::Point& hotspot,
                  const rdr::U8* data);
@@ -57,6 +54,11 @@
 
   void draw(Surface* dst);
 
+  // Clipboard events
+  void handleClipboardRequest();
+  void handleClipboardAnnounce(bool available);
+  void handleClipboardData(const char* data);
+
   // Fl_Widget callback methods
 
   void draw();
@@ -72,7 +74,6 @@
 
   static void handleClipboardChange(int source, void *data);
 
-  void clearPendingClipboard();
   void flushPendingClipboard();
 
   void handlePointerEvent(const rfb::Point& pos, int buttonMask);
@@ -114,8 +115,10 @@
 
   bool firstLEDState;
 
-  char* pendingServerCutText;
-  char* pendingClientCutText;
+  bool pendingServerClipboard;
+  bool pendingClientClipboard;
+
+  int clipboardSource;
 
   rdr::U32 menuKeySym;
   int menuKeyCode, menuKeyFLTK;