~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to src/Edit/Interface/edit_cursor.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : cursor.hpp
 
4
* DESCRIPTION: for cursor handling in TeXmacs
 
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
 
6
*******************************************************************************
 
7
* This software falls under the GNU general public license and comes WITHOUT
 
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
 
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
 
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
11
******************************************************************************/
 
12
 
 
13
#ifndef EDIT_CURSOR_H
 
14
#define EDIT_CURSOR_H
 
15
#include "editor.hpp"
 
16
 
 
17
#define DIRECT 0
 
18
#define CENTER 1
 
19
#define HORIZONTAL 2
 
20
#define VERTICAL 3
 
21
 
 
22
class edit_cursor_rep: virtual public editor_rep {
 
23
protected:
 
24
  cursor cu;         // the cursor
 
25
  cursor mv;         // "ghost cursor" position when moving cursor
 
26
  int    mv_status;  // cursor status during movements
 
27
 
 
28
protected:
 
29
  cursor& the_cursor ();
 
30
  cursor& the_ghost_cursor ();
 
31
 
 
32
  path tree_path (SI x, SI y, SI delta);
 
33
  bool cursor_move_sub (SI& x0, SI& y0, SI& delta, SI dx, SI dy);
 
34
  void cursor_move (SI dx, SI dy);
 
35
  void adjust_ghost_cursor (int status);
 
36
  void notify_cursor_moved (int status);
 
37
 
 
38
public:
 
39
  edit_cursor_rep ();
 
40
  ~edit_cursor_rep ();
 
41
 
 
42
  /* visual cursor movement */
 
43
  void go_to (SI x, SI y);
 
44
  void go_left ();
 
45
  void go_right ();
 
46
  void go_up ();
 
47
  void go_down ();
 
48
  void go_page_up ();
 
49
  void go_page_down ();
 
50
 
 
51
  /* logical cursor movement */
 
52
  path current_position ();
 
53
  void go_to (path p);
 
54
  void go_to_correct (path p);
 
55
  void go_to_start (path p);
 
56
  void go_to_end (path p);
 
57
  void go_to_border (path p, bool at_start);
 
58
  void go_to_here ();
 
59
  void go_start ();
 
60
  void go_end ();
 
61
  void go_start_line ();
 
62
  void go_end_line ();
 
63
  void go_start_of (string what);
 
64
  void go_end_of (string what);
 
65
  void go_start_with (string var, string val);
 
66
  void go_end_with (string var, string val);
 
67
 
 
68
  /* other cursor routines */
 
69
  void go_to_label (string s);
 
70
  tree get_labels ();
 
71
};
 
72
 
 
73
#endif // defined EDIT_CURSOR_H