PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/TeXmacs-1.0.7.11-src/src/Plugins/Widkit/basic_widget.hpp

#
C++ Header | 59 lines | 43 code | 7 blank | 9 comment | 0 complexity | 204e4ba3afcbc010e5fcb38a2b62c57b MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, MPL-2.0-no-copyleft-exception
  1. /******************************************************************************
  2. * MODULE : basic_widget.hpp
  3. * DESCRIPTION: Basic widgets can handle the most common events
  4. * COPYRIGHT : (C) 1999 Joris van der Hoeven
  5. *******************************************************************************
  6. * This software falls under the GNU general public license version 3 or later.
  7. * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
  8. * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
  9. ******************************************************************************/
  10. #ifndef BASIC_WIDGET_H
  11. #define BASIC_WIDGET_H
  12. #include "Widkit/wk_widget.hpp"
  13. #include "Widkit/Event/basic_event.hpp"
  14. class basic_widget_rep: public wk_widget_rep {
  15. protected:
  16. int ptr_focus; // subwidget where the pointer is (-1 if none)
  17. public:
  18. basic_widget_rep (gravity grav= north_west);
  19. basic_widget_rep (array<wk_widget> a, gravity grav= north_west);
  20. basic_widget_rep (array<wk_widget> a, array<string> name,
  21. gravity grav= north_west);
  22. event emit_position (SI ox, SI oy, SI w, SI h, gravity grav= north_west);
  23. event emit_invalidate (SI x1, SI y1, SI x2, SI y2);
  24. event emit_mouse (mouse_event ev);
  25. event emit_mouse (mouse_event ev, string type);
  26. event emit_mouse (mouse_event ev, string type, SI x, SI y);
  27. event emit_clear (SI x1, SI y1, SI x2, SI y2);
  28. event emit_repaint (SI x1, SI y1, SI x2, SI y2, bool& stop);
  29. event emit_find_child (SI x, SI y, int& which);
  30. virtual void handle_get_size (get_size_event ev);
  31. virtual void handle_get_widget (get_widget_event ev);
  32. virtual void handle_set_widget (set_widget_event ev);
  33. virtual void handle_attach_window (attach_window_event ev);
  34. virtual void handle_position (position_event ev);
  35. virtual void handle_move (move_event ev);
  36. virtual void handle_resize (resize_event ev);
  37. virtual void handle_destroy (destroy_event ev);
  38. virtual void handle_keypress (keypress_event ev);
  39. virtual void handle_keyboard_focus (keyboard_focus_event ev);
  40. virtual void handle_mouse (mouse_event ev);
  41. virtual void handle_alarm (alarm_event ev);
  42. virtual void handle_clear (clear_event ev);
  43. virtual void handle_repaint (repaint_event ev);
  44. virtual void handle_update (update_event ev);
  45. virtual void handle_invalidate (invalidate_event ev);
  46. virtual void handle_keyboard_grab (keyboard_grab_event ev);
  47. virtual void handle_mouse_grab (mouse_grab_event ev);
  48. virtual void handle_request_alarm (request_alarm_event ev);
  49. virtual void handle_find_child (find_child_event ev);
  50. virtual bool handle (event ev);
  51. };
  52. #endif // defined BASIC_WIDGET_H