31 #ifndef FTERMXTERMINAL_H 32 #define FTERMXTERMINAL_H 34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) 35 #error "Only <final/final.h> can be included directly." 38 #include "final/util/fstring.h" 57 void redefineDefaultColors (
bool =
true) noexcept;
58 void setCursorStyle (XTermCursorStyle);
61 void setTermSize (
const FSize&);
62 void setForeground (
const FString&);
63 void setBackground (
const FString&);
64 void setCursorColor (
const FString&);
65 void setMouseForeground (
const FString&);
66 void setMouseBackground (
const FString&);
67 void setHighlightBackground (
const FString&);
68 void setMouseSupport (
bool =
true);
69 void unsetMouseSupport();
70 void setFocusSupport (
bool enable =
true);
71 void unsetFocusSupport();
72 void metaSendsESC (
bool =
true);
75 auto getClassName()
const ->
FString;
77 auto getCursorStyle()
const noexcept -> XTermCursorStyle;
78 auto getFont()
const ->
FString;
79 auto getTitle()
const ->
FString;
80 auto getForeground()
const ->
FString;
81 auto getBackground()
const ->
FString;
82 auto getCursorColor()
const ->
FString;
83 auto getMouseForeground()
const ->
FString;
84 auto getMouseBackground()
const ->
FString;
85 auto getHighlightBackground()
const ->
FString;
88 auto hasFont()
const -> bool;
89 auto hasTitle()
const -> bool;
93 void resetColorMap()
const;
94 void resetForeground();
95 void resetBackground();
96 void resetCursorColor();
97 void resetMouseForeground();
98 void resetMouseBackground();
99 void resetHighlightBackground();
100 void resetDefaults();
102 void captureFontAndTitle();
106 void warnNotInitialized()
const;
107 auto canResetDefaults()
const -> bool;
108 auto canCaptureFontAndTitle()
const -> bool;
109 auto canSetXTermCursorStyle()
const -> bool;
110 void setXTermCursorStyle();
111 auto canSetXTermTitle()
const -> bool;
112 void setXTermTitle();
113 auto canSetXTermSize()
const -> bool;
114 void setXTermSize()
const;
115 auto canSetXTermFont()
const -> bool;
117 auto canSetXTermColor()
const -> bool;
118 auto canSetXTermForeground()
const -> bool;
119 void setXTermForeground();
120 auto canSetXTermBackground()
const -> bool;
121 void setXTermBackground();
122 auto canSetXTermCursorColor()
const -> bool;
123 void setXTermCursorColor();
124 auto canSetXTermMouseForeground()
const -> bool;
125 void setXTermMouseForeground();
126 auto canSetXTermMouseBackground()
const -> bool;
127 void setXTermMouseBackground();
128 auto canSetXTermHighlightBackground()
const -> bool;
129 void setXTermHighlightBackground();
130 auto canSetXTermColors()
const -> bool;
131 void setXTerm8ColorDefaults();
132 void setXTerm16ColorDefaults();
133 auto canSetXTermDefaultsMouseCursor()
const -> bool;
134 void setXTermDefaultsMouseCursor();
135 auto needsFullReset()
const -> bool;
136 auto canOnlyResetColorSeparately()
const -> bool;
137 auto canResetColor()
const -> bool;
138 void resetXTermColorMap()
const;
139 void resetXTermForeground()
const;
140 void resetXTermBackground()
const;
141 void resetXTermCursorColor()
const;
142 void resetXTermMouseForeground()
const;
143 void resetXTermMouseBackground()
const;
144 void resetXTermHighlightBackground()
const;
145 void oscPrefix()
const;
146 void oscPostfix()
const;
147 auto canCaptureXTermFont()
const -> bool;
148 auto captureXTermFont()
const ->
FString;
149 auto canCaptureXTermTitle()
const -> bool;
150 auto captureXTermTitle()
const ->
FString;
151 void enableXTermMouse();
152 void disableXTermMouse();
153 void enableXTermFocus();
154 void disableXTermFocus();
155 auto canUseXTermMetaSendsESC()
const -> bool;
156 void enableXTermMetaSendsESC();
157 void disableXTermMetaSendsESC();
160 bool mouse_support{
false};
161 bool focus_support{
false};
162 bool meta_sends_esc{
false};
163 bool xterm_default_colors{
false};
164 bool title_was_changed{
false};
165 std::size_t term_width{80};
166 std::size_t term_height{24};
172 FString mouse_foreground_color{};
173 FString mouse_background_color{};
174 FString highlight_background_color{};
175 XTermCursorStyle cursor_style{XTermCursorStyle::UnknownCursorStyle};
181 inline auto FTermXTerminal::getClassName()
const ->
FString 182 {
return "FTermXTerminal"; }
185 inline void FTermXTerminal::redefineDefaultColors (
bool enable) noexcept
186 { xterm_default_colors = enable; }
189 inline auto FTermXTerminal::getCursorStyle()
const noexcept -> XTermCursorStyle
190 {
return cursor_style; }
193 inline auto FTermXTerminal::getFont()
const ->
FString 194 {
return xterm_font; }
197 inline auto FTermXTerminal::getTitle()
const ->
FString 198 {
return xterm_title; }
201 inline auto FTermXTerminal::getForeground()
const ->
FString 202 {
return foreground_color; }
205 inline auto FTermXTerminal::getBackground()
const ->
FString 206 {
return background_color; }
209 inline auto FTermXTerminal::getCursorColor()
const ->
FString 210 {
return cursor_color; }
213 inline auto FTermXTerminal::getMouseForeground()
const ->
FString 214 {
return mouse_foreground_color; }
217 inline auto FTermXTerminal::getMouseBackground()
const ->
FString 218 {
return mouse_background_color; }
221 inline auto FTermXTerminal::getHighlightBackground()
const ->
FString 222 {
return highlight_background_color; }
225 inline auto FTermXTerminal::hasFont()
const ->
bool 226 {
return xterm_font.getLength() > 2; }
229 inline auto FTermXTerminal::hasTitle()
const ->
bool 230 {
return xterm_title.getLength() > 0; }
233 inline void FTermXTerminal::unsetMouseSupport()
234 { setMouseSupport (
false); }
237 inline void FTermXTerminal::unsetFocusSupport()
238 { setFocusSupport (
false); }
242 #endif // FTERMXTERMINAL_H Definition: class_template.cpp:25
Definition: ftermxterminal.h:50