/TeXmacs-1.0.7.11-src/src/Edit/Interface/edit_cursor.hpp

# · C++ Header · 78 lines · 55 code · 11 blank · 12 comment · 0 complexity · d3eff1cece835fda76bd59f6cd4b2fb1 MD5 · raw file

  1. /******************************************************************************
  2. * MODULE : cursor.hpp
  3. * DESCRIPTION: for cursor handling in TeXmacs
  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 EDIT_CURSOR_H
  11. #define EDIT_CURSOR_H
  12. #include "editor.hpp"
  13. #define DIRECT 0
  14. #define CENTER 1
  15. #define HORIZONTAL 2
  16. #define VERTICAL 3
  17. class edit_cursor_rep: virtual public editor_rep {
  18. protected:
  19. cursor cu; // the cursor
  20. cursor mv; // "ghost cursor" position when moving cursor
  21. int mv_status; // cursor status during movements
  22. protected:
  23. cursor& the_cursor ();
  24. cursor& the_ghost_cursor ();
  25. path make_cursor_accessible (path p, bool forwards);
  26. path tree_path (path sp, SI x, SI y, SI delta);
  27. bool cursor_move_sub (SI& x0, SI& y0, SI& delta, SI dx, SI dy);
  28. void cursor_move (SI dx, SI dy);
  29. void adjust_ghost_cursor (int status);
  30. void notify_cursor_moved (int status);
  31. void show_cursor_if_hidden ();
  32. public:
  33. edit_cursor_rep ();
  34. ~edit_cursor_rep ();
  35. /* visual cursor movement */
  36. void go_to (SI x, SI y, bool absolute= true);
  37. void go_left_physical ();
  38. void go_right_physical ();
  39. void go_left ();
  40. void go_right ();
  41. void go_up ();
  42. void go_down ();
  43. void go_start_line ();
  44. void go_end_line ();
  45. void go_page_up ();
  46. void go_page_down ();
  47. /* logical cursor movement */
  48. void adjust_cursor ();
  49. void go_to_here ();
  50. void go_to (path p);
  51. void go_to_correct (path p);
  52. void go_to_start (path p);
  53. void go_to_end (path p);
  54. void go_to_border (path p, bool at_start);
  55. void go_start ();
  56. void go_end ();
  57. void go_start_paragraph ();
  58. void go_end_paragraph ();
  59. void go_start_of (tree_label what);
  60. void go_end_of (tree_label what);
  61. void go_start_with (string var, string val);
  62. void go_end_with (string var, string val);
  63. /* other cursor routines */
  64. void go_to_label (string s);
  65. tree get_labels ();
  66. };
  67. #endif // defined EDIT_CURSOR_H