You can move around a document with Click+Drag!
[ipdf/code.git] / src / screen.h
index ebe9da2..8452efc 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <SDL.h>
 
+#include <functional>
+
 namespace IPDF
 {
        /*
@@ -24,14 +26,34 @@ namespace IPDF
                // Get the current width/height of the window's viewport.
                int ViewportWidth() { return m_viewport_width; }
                int ViewportHeight() { return m_viewport_height; }
+               
+               // Handle mouse input.
+               typedef std::function<void(int x, int y, int button, int wheel)> MouseHandler;
+               void SetMouseHandler(MouseHandler handler)
+               {
+                       m_mouse_handler = handler;
+               }
+               
+               enum MouseCursors
+               {
+                       CursorArrow,
+                       CursorWait,
+                       CursorWaitArrow,
+                       CursorMove,
+                       CursorHand
+               };
+               void SetMouseCursor(MouseCursors cursor);
        private:
                void ResizeViewport(int width, int height);
+               
+               MouseHandler m_mouse_handler;
 
                int m_viewport_width;
                int m_viewport_height;
                SDL_Window *m_window;
                SDL_GLContext m_gl_context;
        };
+
 }
 
 #endif // _SCREEN_H

UCC git Repository :: git.ucc.asn.au