home *** CD-ROM | disk | FTP | other *** search
-
- // objects.window.h.winhandlers
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_winhandler_H
- #define dreamscape_winhandler_H
-
- #include "basewindow.h"
-
- class Key;
-
- class ClickHandler {
- friend Window;
- friend WindowInternal;
- friend Button;
- struct Temp {
- unsigned is_drag: 1;
- unsigned multi_drag: 4;
- };
- class ClickInfo;
- static void process_click(const void *info, ClickInfo &click, Temp &temp);
- bool window_click(const ClickInfo &info, const Temp &temp);
- static int clicks;
- static unsigned last_click_time;
- static ScrCoords click_pos;
- static wimp_w click_window;
-
- public:
- class ClickInfo {
- public:
- ClickInfo(): adjust(0), shift(0), control(0), alt(0) {}
-
- WinCoords pos;
- unsigned adjust: 1;
- unsigned shift: 1;
- unsigned control: 1;
- unsigned alt: 1;
- };
- virtual bool single_click(const ClickInfo &click);
- virtual bool double_click(const ClickInfo &click);
- virtual bool multi_click(const ClickInfo &click, int clicks);
- virtual bool drag(const ClickInfo &click);
- virtual bool multi_drag(const ClickInfo &click, int clicks);
- };
-
- class DragHandler {
- public:
- class DragInfo {
- public:
- DragInfo(): shift(0), control(0), alt(0) {}
-
- WinCoords pos;
- unsigned shift: 1;
- unsigned control: 1;
- unsigned alt: 1;
- };
- virtual void drag_in_progress(const DragInfo &info);
- virtual void drag_finished(const DragInfo &info);
- virtual void drag_aborted();
- };
-
- class KeyPressedHandler {
- public:
- virtual bool key_pressed(Key key) = 0;
- virtual void input_focus_lost();
- };
-
- class WindowResizedHandler {
- public:
- virtual void window_resized(const ScrCoords &old_size,
- const ScrCoords &new_size) = 0;
- };
-
- class WindowShower {
- public:
- virtual void show_window(const BaseWindow::Position &position) = 0;
- };
-
- class WindowHider {
- public:
- virtual void hide_window() = 0;
- };
-
- #endif
-