~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to info/window.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* window.h -- Structure and flags used in manipulating Info windows.
2
 
   $Id: window.h,v 1.4 1997/07/15 18:45:47 karl Exp $
 
2
   $Id: window.h,v 1.3 2004/04/11 17:56:46 karl Exp $
3
3
 
4
4
   This file is part of GNU Info, a program for reading online documentation
5
5
   stored in Info format.
6
6
 
7
 
   Copyright (C) 1993, 97 Free Software Foundation, Inc.
 
7
   Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc.
8
8
 
9
9
   This program is free software; you can redistribute it and/or modify
10
10
   it under the terms of the GNU General Public License as published by
25
25
#ifndef INFO_WINDOW_H
26
26
#define INFO_WINDOW_H
27
27
 
 
28
#include "infomap.h"
28
29
#include "nodes.h"
29
 
#include "infomap.h"
30
30
 
31
31
/* Smallest number of visible lines in a window.  The actual height is
32
32
   always one more than this number because each window has a modeline. */
75
75
  WINDOW_STATE_DECL;            /* What gets saved. */
76
76
} WINDOW_STATE;
77
77
 
 
78
/* Structure defining the current state of an incremental search. */
 
79
typedef struct {
 
80
  WINDOW_STATE_DECL;    /* The node, pagetop and point. */
 
81
  int search_index;     /* Offset of the last char in the search string. */
 
82
  int direction;        /* The direction that this search is heading in. */
 
83
  int failing;          /* Whether or not this search failed. */
 
84
} SEARCH_STATE;
 
85
 
78
86
#define W_UpdateWindow  0x01    /* WINDOW needs updating. */
79
87
#define W_WindowIsPerm  0x02    /* This WINDOW is a permanent object. */
80
88
#define W_WindowVisible 0x04    /* This WINDOW is currently visible. */
95
103
extern int window_scroll_step;
96
104
 
97
105
 /* Make the modeline member for WINDOW. */
98
 
extern void window_make_modeline ();
 
106
extern void window_make_modeline (WINDOW *window);
99
107
 
100
108
/* Initalize the window system by creating THE_SCREEN and THE_ECHO_AREA.
101
109
   Create the first window ever, and make it permanent.
102
110
   You pass WIDTH and HEIGHT; the dimensions of the total screen size. */
103
 
extern void window_initialize_windows ();
 
111
extern void window_initialize_windows (int width, int height);
104
112
 
105
113
/* Make a new window showing NODE, and return that window structure.
106
114
   The new window is made to be the active window.  If NODE is passed
107
115
   as NULL, then show the node showing in the active window.  If the
108
116
   window could not be made return a NULL pointer.  The active window
109
117
   is not changed.*/
110
 
extern WINDOW *window_make_window ();
 
118
extern WINDOW *window_make_window (NODE *node);
111
119
 
112
120
/* Delete WINDOW from the list of known windows.  If this window was the
113
121
   active window, make the next window in the chain be the active window,
114
122
   or the previous window in the chain if there is no next window. */
115
 
extern void window_delete_window ();
 
123
extern void window_delete_window (WINDOW *window);
116
124
 
117
125
/* A function to call when the screen changes size, and some windows have
118
126
   to get deleted.  The function is called with the window to be deleted
121
129
extern VFunction *window_deletion_notifier;
122
130
 
123
131
/* Set WINDOW to display NODE. */
124
 
extern void window_set_node_of_window ();
 
132
extern void window_set_node_of_window (WINDOW *window, NODE *node);
125
133
 
126
134
/* Tell the window system that the size of the screen has changed.  This
127
135
   causes lots of interesting things to happen.  The permanent windows
128
136
   are resized, as well as every visible window.  You pass WIDTH and HEIGHT;
129
137
   the dimensions of the total screen size. */
130
 
extern void window_new_screen_size ();
 
138
extern void window_new_screen_size (int width, int height);
131
139
 
132
140
/* Change the height of WINDOW by AMOUNT.  This also automagically adjusts
133
141
   the previous and next windows in the chain.  If there is only one user
134
142
   window, then no change takes place. */
135
 
extern void window_change_window_height ();
 
143
extern void window_change_window_height (WINDOW *window, int amount);
136
144
 
137
145
/* Adjust the pagetop of WINDOW such that the cursor point will be visible. */
138
 
extern void window_adjust_pagetop ();
 
146
extern void window_adjust_pagetop (WINDOW *window);
139
147
 
140
148
/* Tile all of the windows currently displayed in the global variable
141
149
   WINDOWS.  If argument DO_INTERNALS is non-zero, tile windows displaying
142
150
   internal nodes as well. */
143
151
#define DONT_TILE_INTERNALS 0
144
152
#define TILE_INTERNALS      1
145
 
extern void window_tile_windows ();
 
153
extern void window_tile_windows (int style);
146
154
 
147
155
/* Toggle the state of line wrapping in WINDOW.  This can do a bit of fancy
148
156
   redisplay. */
149
 
extern void window_toggle_wrap ();
 
157
extern void window_toggle_wrap (WINDOW *window);
150
158
 
151
159
/* For every window in CHAIN, set the flags member to have FLAG set. */
152
 
extern void window_mark_chain ();
 
160
extern void window_mark_chain (WINDOW *chain, int flag);
153
161
 
154
162
/* For every window in CHAIN, clear the flags member of FLAG. */
155
 
extern void window_unmark_chain ();
 
163
extern void window_unmark_chain (WINDOW *chain, int flag);
156
164
 
157
165
/* Make WINDOW start displaying at PERCENT percentage of its node. */
158
 
extern void window_goto_percentage ();
 
166
extern void window_goto_percentage (WINDOW *window, int percent);
159
167
 
160
168
/* Build a new node which has FORMAT printed with ARG1 and ARG2 as the
161
169
   contents. */
162
 
extern NODE *build_message_node ();
 
170
extern NODE *build_message_node (char *format, void *arg1, void *arg2);
163
171
 
164
172
/* Useful functions can be called from outside of window.c. */
165
 
extern void initialize_message_buffer ();
 
173
extern void initialize_message_buffer (void);
166
174
 
167
175
/* Print FORMAT with ARG1,2 to the end of the current message buffer. */
168
 
extern void printf_to_message_buffer ();
 
176
extern void printf_to_message_buffer (char *format, void *arg1, void *arg2,
 
177
    void *arg3);
169
178
 
170
179
/* Convert the contents of the message buffer to a node. */
171
 
extern NODE *message_buffer_to_node ();
 
180
extern NODE *message_buffer_to_node (void);
172
181
 
173
182
/* Return the length of the most recently printed line in message buffer. */
174
 
extern int message_buffer_length_this_line ();
 
183
extern int message_buffer_length_this_line (void);
175
184
 
176
185
/* Pad STRING to COUNT characters by inserting blanks. */
177
 
extern int pad_to ();
 
186
extern int pad_to (int count, char *string);
178
187
 
179
188
/* Make a message appear in the echo area, built from FORMAT, ARG1 and ARG2.
180
189
   The arguments are treated similar to printf () arguments, but not all of
181
190
   printf () hair is present.  The message appears immediately.  If there was
182
191
   already a message appearing in the echo area, it is removed. */
183
 
extern void window_message_in_echo_area ();
 
192
extern void window_message_in_echo_area (char *format, void *arg1, void *arg2);
184
193
 
185
194
/* Place a temporary message in the echo area built from FORMAT, ARG1
186
195
   and ARG2.  The message appears immediately, but does not destroy
187
196
   any existing message.  A future call to unmessage_in_echo_area ()
188
197
   restores the old contents. */
189
 
extern void message_in_echo_area ();
190
 
extern void unmessage_in_echo_area ();
 
198
extern void message_in_echo_area (char *format, void *arg1, void *arg2);
 
199
extern void unmessage_in_echo_area (void);
191
200
 
192
201
/* Clear the echo area, removing any message that is already present.
193
202
   The echo area is cleared immediately. */
194
 
extern void window_clear_echo_area ();
 
203
extern void window_clear_echo_area (void);
195
204
 
196
205
/* Quickly guess the approximate number of lines to that NODE would
197
206
   take to display.  This really only counts carriage returns. */
198
 
extern int window_physical_lines ();
 
207
extern int window_physical_lines (NODE *node);
199
208
 
200
209
/* Calculate a list of line starts for the node belonging to WINDOW.  The line
201
210
   starts are pointers to the actual text within WINDOW->NODE. */
202
 
extern void calculate_line_starts ();
 
211
extern void calculate_line_starts (WINDOW *window);
203
212
 
204
213
/* Given WINDOW, recalculate the line starts for the node it displays. */
205
 
extern void recalculate_line_starts ();
 
214
extern void recalculate_line_starts (WINDOW *window);
206
215
 
207
216
/* Return the number of characters it takes to display CHARACTER on the
208
217
   screen at HPOS. */
209
 
extern int character_width ();
 
218
extern int character_width (int character, int hpos);
210
219
 
211
220
/* Return the number of characters it takes to display STRING on the
212
221
   screen at HPOS. */
213
 
extern int string_width ();
 
222
extern int string_width (char *string, int hpos);
214
223
 
215
224
/* Return the index of the line containing point. */
216
 
extern int window_line_of_point ();
 
225
extern int window_line_of_point (WINDOW *window);
217
226
 
218
227
/* Get and return the goal column for this window. */
219
 
extern int window_get_goal_column ();
 
228
extern int window_get_goal_column (WINDOW *window);
220
229
 
221
230
/* Get and return the printed column offset of the cursor in this window. */
222
 
extern int window_get_cursor_column ();
 
231
extern int window_get_cursor_column (WINDOW *window);
223
232
 
224
233
/* Get and Set the node, pagetop, and point of WINDOW. */
225
 
extern void window_get_state (), window_set_state ();
 
234
extern void window_get_state (WINDOW *window, SEARCH_STATE *state);
 
235
extern void window_set_state (WINDOW *window, SEARCH_STATE *state);
226
236
 
227
237
/* Count the number of characters in LINE that precede the printed column
228
238
   offset of GOAL. */
229
 
extern int window_chars_to_goal ();
 
239
extern int window_chars_to_goal (char *line, int goal);
230
240
 
231
241
#endif /* not INFO_WINDOW_H */