summaryrefslogtreecommitdiffstats
path: root/src/viewer/mcviewer.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
commitffccd5b2b05243e7976db80f90f453dccfae9886 (patch)
tree39a43152d27f7390d8f7a6fb276fa6887f87c6e8 /src/viewer/mcviewer.h
parentInitial commit. (diff)
downloadmc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.tar.xz
mc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.zip
Adding upstream version 3:4.8.30.upstream/3%4.8.30
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/viewer/mcviewer.h')
-rw-r--r--src/viewer/mcviewer.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/viewer/mcviewer.h b/src/viewer/mcviewer.h
new file mode 100644
index 0000000..d90716c
--- /dev/null
+++ b/src/viewer/mcviewer.h
@@ -0,0 +1,57 @@
+/** \file mcviewer.h
+ * \brief Header: internal file viewer
+ */
+
+#ifndef MC__VIEWER_H
+#define MC__VIEWER_H
+
+#include "lib/global.h"
+
+/*** typedefs(not structures) and defined constants **********************************************/
+
+/*** enums ***************************************************************************************/
+
+/*** structures declarations (and typedefs of structures)*****************************************/
+
+struct WView;
+typedef struct WView WView;
+
+typedef struct
+{
+ gboolean wrap; /* Wrap text lines to fit them on the screen */
+ gboolean hex; /* Plainview or hexview */
+ gboolean magic; /* Preprocess the file using external programs */
+ gboolean nroff; /* Nroff-style highlighting */
+} mcview_mode_flags_t;
+
+/*** global variables defined in .c file *********************************************************/
+
+extern mcview_mode_flags_t mcview_global_flags;
+extern mcview_mode_flags_t mcview_altered_flags;
+
+extern gboolean mcview_remember_file_position;
+extern int mcview_max_dirt_limit;
+
+extern gboolean mcview_mouse_move_pages;
+extern char *mcview_show_eof;
+
+/*** declarations of public functions ************************************************************/
+
+/* Creates a new WView object with the given properties. Caveat: the
+ * origin is in y-x order, while the extent is in x-y order. */
+extern WView *mcview_new (int y, int x, int lines, int cols, gboolean is_panel);
+
+
+/* Shows {file} or the output of {command} in the internal viewer,
+ * starting in line {start_line}.
+ */
+extern gboolean mcview_viewer (const char *command, const vfs_path_t * file_vpath, int start_line,
+ off_t search_start, off_t search_end);
+
+extern gboolean mcview_load (WView * view, const char *command, const char *file, int start_line,
+ off_t search_start, off_t search_end);
+
+extern void mcview_clear_mode_flags (mcview_mode_flags_t * flags);
+
+/*** inline functions ****************************************************************************/
+#endif /* MC__VIEWER_H */