home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / objects / window / h / winhandler < prev   
Encoding:
Text File  |  1996-07-31  |  2.2 KB  |  93 lines

  1.  
  2. // objects.window.h.winhandlers
  3.  
  4. // Dreamscape - C++ class library for RISC OS
  5. // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Library General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2 of the License, or (at your option) any later version.
  11. // See the Dreamscape documentation for more information.
  12.  
  13. #ifndef dreamscape_winhandler_H
  14. #define dreamscape_winhandler_H
  15.  
  16. #include "basewindow.h"
  17.  
  18. class Key;
  19.  
  20. class ClickHandler {
  21.   friend Window;
  22.   friend WindowInternal;
  23.   friend Button;
  24.   struct Temp {
  25.     unsigned is_drag: 1;
  26.     unsigned multi_drag: 4;
  27.   };
  28.   class ClickInfo;
  29.   static void process_click(const void *info, ClickInfo &click, Temp &temp);
  30.   bool window_click(const ClickInfo &info, const Temp &temp);
  31.   static int clicks;
  32.   static unsigned last_click_time;
  33.   static ScrCoords click_pos;
  34.   static wimp_w click_window;
  35.  
  36. public:
  37.   class ClickInfo {
  38.   public:
  39.     ClickInfo(): adjust(0), shift(0), control(0), alt(0) {}
  40.  
  41.     WinCoords pos;
  42.     unsigned adjust: 1;
  43.     unsigned shift: 1;
  44.     unsigned control: 1;
  45.     unsigned alt: 1;
  46.   };
  47.   virtual bool single_click(const ClickInfo &click);
  48.   virtual bool double_click(const ClickInfo &click);
  49.   virtual bool multi_click(const ClickInfo &click, int clicks);
  50.   virtual bool drag(const ClickInfo &click);
  51.   virtual bool multi_drag(const ClickInfo &click, int clicks);
  52. };
  53.  
  54. class DragHandler {
  55. public:
  56.   class DragInfo {
  57.   public:
  58.     DragInfo(): shift(0), control(0), alt(0) {}
  59.  
  60.     WinCoords pos;
  61.     unsigned shift: 1;
  62.     unsigned control: 1;
  63.     unsigned alt: 1;
  64.   };
  65.   virtual void drag_in_progress(const DragInfo &info);
  66.   virtual void drag_finished(const DragInfo &info);
  67.   virtual void drag_aborted();
  68. };
  69.  
  70. class KeyPressedHandler {
  71. public:
  72.   virtual bool key_pressed(Key key) = 0;
  73.   virtual void input_focus_lost();
  74. };
  75.  
  76. class WindowResizedHandler {
  77. public:
  78.   virtual void window_resized(const ScrCoords &old_size,
  79.     const ScrCoords &new_size) = 0;
  80. };
  81.  
  82. class WindowShower {
  83. public:
  84.   virtual void show_window(const BaseWindow::Position &position) = 0;
  85. };
  86.  
  87. class WindowHider {
  88. public:
  89.   virtual void hide_window() = 0;
  90. };
  91.  
  92. #endif
  93.