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