File: input.h

package info (click to toggle)
oleo 1.6-16
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,640 kB
  • ctags: 3,139
  • sloc: ansic: 39,221; yacc: 1,737; sh: 362; makefile: 88
file content (98 lines) | stat: -rw-r--r-- 3,076 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef INPUTH
#define INPUTH

/*	Copyright (C) 1993 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
/*  t. lord	Mon Feb 15 14:11:13 1993	*/



/* Display-generic updating logic for the input area. */

typedef int (*text_measure) (char * str, int len);

/* These are for the field REDRAW_NEEDED */
#define NO_REDRAW		-2
#define FULL_REDRAW		-1

struct input_view
{
  /* If this is less than 0, see the #defines above.
   * >= 0, this is the index of a character in the 
   * input string.  All characters at that index and 
   * greater need to be redrawn.
   */
  int redraw_needed;

  /* These are provided by io-{curses,x11} and tell how to convert
   * strings to widths.
   */
  text_measure prompt_metric;
  text_measure input_metric;
  
  /* If the currently mapped keymap has a prompt, the display of that
   * prompt takes precedence.
   */
  char * keymap_prompt;
  char * expanded_keymap_prompt;

  /* This is the width of either the keymap_prompt or the input text
   * prompt, whichever is current (0 if neither is).
   */

  int prompt_wid;
  
  /* The parameters below are a cache.  If this flag is true,
   * the cache is known to be wrong.
   */
  int must_fix_input;

  struct line * input_area;	/* The text editted in the input area or 0. */
  char * prompt;
  int visibility_begin;		/* Index of first visible char or 0. */
  int visibility_end;		/* Index of last visible char or 0. */
  int input_cursor;		/* Index of the cursor position or 0. */
  int vis_wid;			/* This is the width of the visible text 
				 * with extra space for the cursor, if it 
				 * happens to be past the end of the string.
				 */

  /* A command_arg can specify an info buffer which should be displayed 
   * while prompting for that arg.
   */
  struct info_buffer * current_info;
  int info_pos;		/* In the current info, the first vis. line */ 
  int info_redraw_needed;	/* != 0 if redraw needed */
};


#if PROTOTYPES
extern void iv_fix_input (struct input_view * this_iv);
extern void iv_move_cursor (struct input_view * this_iv);
extern void iv_erase (struct input_view * this_iv, int len);
extern void iv_insert (struct input_view * this_iv, int len);
extern void iv_over (struct input_view * this_iv, int len);
#else /* PROTOTYPES */
extern void iv_fix_input ();
extern void iv_move_cursor ();
extern void iv_erase ();
extern void iv_insert ();
extern void iv_over ();
#endif /* PROTOTYPES */

#endif  /* INPUTH */