Back to index

tetex-bin  3.0
session.h
Go to the documentation of this file.
00001 /* session.h -- Functions found in session.c.
00002    $Id: session.h,v 1.3 2004/04/11 17:56:46 karl Exp $
00003 
00004    Copyright (C) 1993, 1998, 1999, 2001, 2002, 2004 Free Software
00005    Foundation, Inc.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 
00021    Written by Brian Fox (bfox@ai.mit.edu). */
00022 
00023 #ifndef SESSION_H
00024 #define SESSION_H
00025 
00026 #include "info.h"
00027 #include "dribble.h"
00028 
00029 /* All commands that can be invoked from within info_session () receive
00030    arguments in the same way.  This simple define declares the header
00031    of a function named NAME, with associated documentation DOC.  The
00032    documentation string is groveled out of the source files by the
00033    utility program `makedoc', which is also responsible for making
00034    the documentation/function-pointer maps. */
00035 #define DECLARE_INFO_COMMAND(name, doc) \
00036 void name (WINDOW *window, int count, unsigned char key)
00037 
00038 /* Variables found in session.h. */
00039 extern VFunction *info_last_executed_command;
00040 
00041 /* Variable controlling the garbage collection of files briefly visited
00042    during searches.  Such files are normally gc'ed, unless they were
00043    compressed to begin with.  If this variable is non-zero, it says
00044    to gc even those file buffer contents which had to be uncompressed. */
00045 extern int gc_compressed_files;
00046 
00047 /* When non-zero, tiling takes place automatically when info_split_window
00048    is called. */
00049 extern int auto_tiling_p;
00050 
00051 /* Variable controlling the behaviour of default scrolling when you are
00052    already at the bottom of a node. */
00053 extern int info_scroll_behaviour;
00054 extern char *info_scroll_choices[];
00055 
00056 /* Values for info_scroll_behaviour. */
00057 #define IS_Continuous 0 /* Try to get first menu item, or failing that, the
00058                            "Next:" pointer, or failing that, the "Up:" and
00059                            "Next:" of the up. */
00060 #define IS_NextOnly   1 /* Try to get "Next:" menu item. */
00061 #define IS_PageOnly   2 /* Simply give up at the bottom of a node. */
00062 
00063 /* Utility functions found in session.c */
00064 extern void info_dispatch_on_key (unsigned char key, Keymap map);
00065 extern unsigned char info_get_input_char (void);
00066 extern unsigned char info_get_another_input_char (void);
00067 extern unsigned char info_input_pending_p (void);
00068 extern void remember_window_and_node (WINDOW *window, NODE *node);
00069 extern void set_remembered_pagetop_and_point (WINDOW *window);
00070 extern void set_window_pagetop (WINDOW *window, int desired_top);
00071 extern void info_set_node_of_window (int remember, WINDOW *window,
00072     NODE *node);
00073 extern void initialize_keyseq (void);
00074 extern void add_char_to_keyseq (char character);
00075 extern void info_gather_typeahead (void);
00076 extern FILE_BUFFER *file_buffer_of_window (WINDOW *window);
00077 extern long info_search_in_node (char *string, NODE *node,
00078     long int start, WINDOW *window, int dir, int case_sensitive);
00079 extern long info_target_search_node (NODE *node, char *string,
00080     long int start);
00081 extern void info_select_reference (WINDOW *window, REFERENCE *entry);
00082 extern int info_any_buffered_input_p (void);
00083 extern void print_node (NODE *node);
00084 extern void dump_node_to_file (NODE *node, char *filename,
00085     int dump_subnodes);
00086 extern void dump_nodes_to_file (char *filename, char **nodenames,
00087     char *output_filename, int dump_subnodes);
00088 extern char *program_name_from_file_name (char *file_name);
00089 
00090 /* Do the physical deletion of WINDOW, and forget this window and
00091    associated nodes. */
00092 extern void info_delete_window_internal (WINDOW *window);
00093 
00094 /* Tell Info that input is coming from the file FILENAME. */
00095 extern void info_set_input_from_file (char *filename);
00096 
00097 #define return_if_control_g(val) \
00098   do { \
00099     info_gather_typeahead (); \
00100     if (info_input_pending_p () == Control ('g')) \
00101       return (val); \
00102   } while (0)
00103 
00104 /* The names of the functions that run an info session. */
00105 
00106 /* Starting an info session. */
00107 extern void begin_multiple_window_info_session (char *filename,
00108     char **nodenames);
00109 extern void begin_info_session (NODE *initial_node);
00110 extern void begin_info_session_with_error (NODE *initial_node,
00111     char *format, void *arg1, void *arg2);
00112 extern void info_session (void);
00113 extern void initialize_info_session (NODE *node, int clear_screen);
00114 extern void info_read_and_dispatch (void);
00115 extern void info_intuit_options_node (WINDOW *window,
00116     NODE *initial_node, char *program);
00117 
00118 /* Moving the point within a node. */
00119 extern void info_next_line (WINDOW *window, int count, unsigned char key);
00120 extern void info_prev_line (WINDOW *window, int count, unsigned char key);
00121 extern void info_end_of_line (WINDOW *window, int count, unsigned char key);
00122 extern void info_beginning_of_line (WINDOW *window, int count, unsigned char key);
00123 extern void info_forward_char (WINDOW *window, int count, unsigned char key);
00124 extern void info_backward_char (WINDOW *window, int count, unsigned char key);
00125 extern void info_forward_word (WINDOW *window, int count, unsigned char key);
00126 extern void info_backward_word (WINDOW *window, int count, unsigned char key);
00127 extern void info_beginning_of_node (WINDOW *window, int count, unsigned char key);
00128 extern void info_end_of_node (WINDOW *window, int count, unsigned char key);
00129 extern void info_move_to_prev_xref (WINDOW *window, int count, unsigned char key);
00130 extern void info_move_to_next_xref (WINDOW *window, int count, unsigned char key);
00131 
00132 /* Scrolling text within a window. */
00133 extern void info_scroll_forward (WINDOW *window, int count, unsigned char key);
00134 extern void info_scroll_backward (WINDOW *window, int count, unsigned char key);
00135 extern void info_redraw_display (WINDOW *window, int count, unsigned char key);
00136 extern void info_toggle_wrap (WINDOW *window, int count, unsigned char key);
00137 extern void info_move_to_window_line (WINDOW *window, int count,
00138     unsigned char key);
00139 extern void info_up_line (WINDOW *window, int count, unsigned char key);
00140 extern void info_down_line (WINDOW *window, int count, unsigned char key);
00141 extern void info_scroll_half_screen_down (WINDOW *window, int count,
00142     unsigned char key);
00143 extern void info_scroll_half_screen_up (WINDOW *window, int count,
00144     unsigned char key);
00145 extern void info_scroll_forward_set_window (WINDOW *window, int count,
00146     unsigned char key);
00147 extern void info_scroll_forward_page_only (WINDOW *window, int count,
00148     unsigned char key);
00149 extern void info_scroll_forward_page_only_set_window (WINDOW *window, int count,
00150     unsigned char key);
00151 extern void info_scroll_backward_set_window (WINDOW *window, int count,
00152     unsigned char key);
00153 extern void info_scroll_backward_page_only (WINDOW *window, int count,
00154     unsigned char key);
00155 extern void info_scroll_backward_page_only_set_window (WINDOW *window, int count,
00156     unsigned char key);
00157 extern void info_scroll_other_window_backward (WINDOW *window, int count,
00158     unsigned char key);
00159 
00160 /* Manipulating multiple windows. */
00161 extern void info_split_window (WINDOW *window, int count, unsigned char key);
00162 extern void info_delete_window (WINDOW *window, int count, unsigned char key);
00163 extern void info_keep_one_window (WINDOW *window, int count, unsigned char key);
00164 extern void info_grow_window (WINDOW *window, int count, unsigned char key);
00165 extern void info_scroll_other_window (WINDOW *window, int count,
00166     unsigned char key);
00167 extern void info_tile_windows (WINDOW *window, int count, unsigned char key);
00168 extern void info_next_window (WINDOW *window, int count, unsigned char key);
00169 extern void info_prev_window (WINDOW *window, int count, unsigned char key);
00170 
00171 /* Selecting nodes. */
00172 extern void info_next_node (WINDOW *window, int count, unsigned char key);
00173 extern void info_prev_node (WINDOW *window, int count, unsigned char key);
00174 extern void info_up_node (WINDOW *window, int count, unsigned char key);
00175 extern void info_last_node (WINDOW *window, int count, unsigned char key);
00176 extern void info_first_node (WINDOW *window, int count, unsigned char key);
00177 extern void info_history_node (WINDOW *window, int count, unsigned char key);
00178 extern void info_goto_node (WINDOW *window, int count, unsigned char key);
00179 extern void info_goto_invocation_node (WINDOW *window, int count,
00180     unsigned char key);
00181 extern void info_top_node (WINDOW *window, int count, unsigned char key);
00182 extern void info_dir_node (WINDOW *window, int count, unsigned char key);
00183 extern void info_global_next_node (WINDOW *window, int count, unsigned char key);
00184 extern void info_global_prev_node (WINDOW *window, int count, unsigned char key);
00185 extern void info_kill_node (WINDOW *window, int count, unsigned char key);
00186 extern void info_view_file (WINDOW *window, int count, unsigned char key);
00187 extern void info_menu_sequence (WINDOW *window, int count, unsigned char key);
00188 extern NODE *info_follow_menus (NODE *initial_node, char **menus,
00189     const char **errstr, char **errarg1, char **errarg2);
00190 extern void info_man (WINDOW *window, int count, unsigned char key);
00191 extern void list_visited_nodes (WINDOW *window, int count, unsigned char key);
00192 extern void select_visited_node (WINDOW *window, int count, unsigned char key);
00193 
00194 /* Selecting cross references. */
00195 extern void info_menu_digit (WINDOW *window, int count, unsigned char key);
00196 extern void info_menu_item (WINDOW *window, int count, unsigned char key);
00197 extern void info_xref_item (WINDOW *window, int count, unsigned char key);
00198 extern void info_find_menu (WINDOW *window, int count, unsigned char key);
00199 extern void info_select_reference_this_line (WINDOW *window, int count,
00200     unsigned char key);
00201 extern void info_last_menu_item (WINDOW *window, int count, unsigned char key);
00202 extern void info_visit_menu (WINDOW *window, int count, unsigned char key);
00203 
00204 /* Hacking numeric arguments. */
00205 extern int info_explicit_arg, info_numeric_arg, info_numeric_arg_sign;
00206 
00207 extern void info_add_digit_to_numeric_arg (WINDOW *window, int count,
00208     unsigned char key);
00209 extern void info_universal_argument (WINDOW *window, int count,
00210     unsigned char key);
00211 extern void info_initialize_numeric_arg (void);
00212 extern void info_numeric_arg_digit_loop (WINDOW *window, int count,
00213     unsigned char key);
00214 
00215 /* Searching commands. */
00216 extern void info_search (WINDOW *window, int count, unsigned char key);
00217 extern void isearch_forward (WINDOW *window, int count, unsigned char key);
00218 extern void isearch_backward (WINDOW *window, int count, unsigned char key);
00219 extern void info_search_case_sensitively (WINDOW *window, int count,
00220     unsigned char key);
00221 extern void info_search_backward (WINDOW *window, int count, unsigned char key);
00222 extern void info_search_next (WINDOW *window, int count, unsigned char key);
00223 extern void info_search_previous (WINDOW *window, int count, unsigned char key);
00224 
00225 /* Dumping and printing nodes. */
00226 extern void info_print_node (WINDOW *window, int count, unsigned char key);
00227 
00228 /* Footnotes.  */
00229 extern void info_show_footnotes (WINDOW *window, int count, unsigned char key);
00230 
00231 /* Miscellaneous commands. */
00232 extern void info_abort_key (WINDOW *window, int count, unsigned char key);
00233 extern void info_quit (WINDOW *window, int count, unsigned char key);
00234 extern void info_do_lowercase_version (WINDOW *window, int count,
00235     unsigned char key);
00236 
00237 #endif /* not SESSION_H */