X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.h;h=4d92cb33c42b49242b97d32d1e858fcf55a5babd;hp=ebe9da29ba0c71e49aa99d58d70075f1f0126ee5;hb=e12f1118cca4997c895c5ece32900be74f59ecdd;hpb=245ccc8576d4bd29ab04d506ddb0c44b04a67e39 diff --git a/src/screen.h b/src/screen.h index ebe9da2..4d92cb3 100644 --- a/src/screen.h +++ b/src/screen.h @@ -3,6 +3,8 @@ #include +#include + namespace IPDF { /* @@ -24,14 +26,36 @@ 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 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_last_mouse_x; + int m_last_mouse_y; int m_viewport_width; int m_viewport_height; SDL_Window *m_window; SDL_GLContext m_gl_context; }; + } #endif // _SCREEN_H