Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2021-12-31 00:27:16 +0300
committerelfmz <fenix1905@tut.by>2021-12-31 02:27:02 +0300
commita14dc1a81c797928d4f1b7d6a6b46ecc63f98308 (patch)
treec27c61ac33582bc4d469c6608cd042add388f230 /far2l/src/ViewerPrinter.hpp
parentd5f1bf245e96834d44390d1723cfef3dfbb1fb02 (diff)
shuffle a bit far2l sources
Diffstat (limited to 'far2l/src/ViewerPrinter.hpp')
-rw-r--r--far2l/src/ViewerPrinter.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/far2l/src/ViewerPrinter.hpp b/far2l/src/ViewerPrinter.hpp
new file mode 100644
index 00000000..392ed74e
--- /dev/null
+++ b/far2l/src/ViewerPrinter.hpp
@@ -0,0 +1,33 @@
+#pragma once
+#include <stdint.h>
+#include <stdlib.h>
+
+struct ViewerPrinter
+{
+ void PrintSpaces(size_t cnt);
+ void EnableBOMSkip();
+ void SetSelection(bool selection);
+
+ virtual ~ViewerPrinter() {};
+
+ virtual int Length(const wchar_t *str, int limit = -1) = 0;
+ virtual void Print(int skip_len, int print_len, const wchar_t *str) = 0;
+
+protected:
+ bool ShouldSkip(wchar_t ch);
+
+ bool _bom_skip = false;
+ bool _selection = false;
+};
+
+struct PlainViewerPrinter : ViewerPrinter
+{
+ PlainViewerPrinter(int color);
+ virtual ~PlainViewerPrinter();
+
+ virtual int Length(const wchar_t *str, int limit = -1);
+ virtual void Print(int skip_len, int print_len, const wchar_t *str);
+
+private:
+ int _color;
+};