1 /** \file mcviewer.h
2  *  \brief Header: internal file viewer
3  */
4 
5 #ifndef MC__VIEWER_H
6 #define MC__VIEWER_H
7 
8 #include "lib/global.h"
9 
10 /*** typedefs(not structures) and defined constants **********************************************/
11 
12 /*** enums ***************************************************************************************/
13 
14 /*** structures declarations (and typedefs of structures)*****************************************/
15 
16 struct WView;
17 typedef struct WView WView;
18 
19 typedef struct
20 {
21     gboolean wrap;              /* Wrap text lines to fit them on the screen */
22     gboolean hex;               /* Plainview or hexview */
23     gboolean magic;             /* Preprocess the file using external programs */
24     gboolean nroff;             /* Nroff-style highlighting */
25 } mcview_mode_flags_t;
26 
27 /*** global variables defined in .c file *********************************************************/
28 
29 extern mcview_mode_flags_t mcview_global_flags;
30 extern mcview_mode_flags_t mcview_altered_flags;
31 
32 extern gboolean mcview_remember_file_position;
33 extern int mcview_max_dirt_limit;
34 
35 extern gboolean mcview_mouse_move_pages;
36 extern char *mcview_show_eof;
37 
38 /*** declarations of public functions ************************************************************/
39 
40 /* Creates a new WView object with the given properties. Caveat: the
41  * origin is in y-x order, while the extent is in x-y order. */
42 extern WView *mcview_new (int y, int x, int lines, int cols, gboolean is_panel);
43 
44 
45 /* Shows {file} or the output of {command} in the internal viewer,
46  * starting in line {start_line}.
47  */
48 extern gboolean mcview_viewer (const char *command, const vfs_path_t * file_vpath, int start_line,
49                                off_t search_start, off_t search_end);
50 
51 extern gboolean mcview_load (WView * view, const char *command, const char *file, int start_line,
52                              off_t search_start, off_t search_end);
53 
54 extern void mcview_clear_mode_flags (mcview_mode_flags_t * flags);
55 
56 /*** inline functions ****************************************************************************/
57 #endif /* MC__VIEWER_H */
58