31 #ifndef FVTERMATTRIBUTE_H 32 #define FVTERMATTRIBUTE_H 34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) 35 #error "Only <final/final.h> can be included directly." 38 #include "final/ftypes.h" 39 #include "final/util/fstring.h" 40 #include "final/vterm/fcolorpair.h" 75 virtual auto getClassName()
const ->
FString;
76 static auto getTermForegroundColor() -> FColor;
77 static auto getTermBackgroundColor() -> FColor;
78 static auto getAttribute() ->
FChar&;
81 static void setColor (FColor, FColor);
83 static void setNormal();
84 static void setBold (
bool =
true);
85 static void unsetBold();
86 static void setDim (
bool =
true);
87 static void unsetDim();
88 static void setItalic (
bool =
true);
89 static void unsetItalic();
90 static void setUnderline (
bool =
true);
91 static void unsetUnderline();
92 static void setBlink (
bool =
true);
93 static void unsetBlink();
94 static void setReverse (
bool =
true);
95 static void unsetReverse();
96 static void setStandout (
bool =
true);
97 static void unsetStandout();
98 static void setInvisible (
bool =
true);
99 static void unsetInvisible();
100 static void setProtected (
bool =
true);
101 static void unsetProtected();
102 static void setCrossedOut (
bool =
true);
103 static void unsetCrossedOut();
104 static void setDoubleUnderline (
bool =
true);
105 static void unsetDoubleUnderline();
106 static void setAltCharset (
bool =
true);
107 static void unsetAltCharset();
108 static void setPCcharset (
bool =
true);
109 static void unsetPCcharset();
110 static void setTransparent (
bool =
true);
111 static void unsetTransparent();
112 static void setColorOverlay (
bool =
true);
113 static void unsetColorOverlay();
114 static void setInheritBackground (
bool =
true);
115 static void unsetInheritBackground();
118 static auto isBold() -> bool;
119 static auto isDim() -> bool;
120 static auto isItalic() -> bool;
121 static auto isUnderline() -> bool;
122 static auto isBlink() -> bool;
123 static auto isReverse() -> bool;
124 static auto isStandout() -> bool;
125 static auto isInvisible() -> bool;
126 static auto isProtected() -> bool;
127 static auto isCrossedOut() -> bool;
128 static auto isDoubleUnderline() -> bool;
129 static auto isAltCharset() -> bool;
130 static auto isPCcharset() -> bool;
131 static auto isTransparent() -> bool;
132 static auto isColorOverlay() -> bool;
133 static auto isInheritBackground() -> bool;
136 static void initAttribute();
137 static void print (
const FStyle&);
142 static FChar next_attribute;
148 inline auto FVTermAttribute::getClassName()
const ->
FString 149 {
return "FVTermAttribute"; }
152 inline auto FVTermAttribute::getTermForegroundColor() -> FColor
153 {
return next_attribute.fg_color; }
156 inline auto FVTermAttribute::getTermBackgroundColor() -> FColor
157 {
return next_attribute.bg_color; }
160 inline auto FVTermAttribute::getAttribute() ->
FChar&
161 {
return next_attribute; }
164 inline void FVTermAttribute::setColor (FColor fg, FColor bg)
167 next_attribute.fg_color = fg;
168 next_attribute.bg_color = bg;
172 inline void FVTermAttribute::setColor (
const FColorPair& pair)
174 setColor (pair.getForegroundColor(), pair.getBackgroundColor());
178 inline void FVTermAttribute::setNormal()
181 next_attribute.attr.byte[0] = 0;
182 next_attribute.attr.byte[1] = 0;
183 next_attribute.attr.bit.no_changes =
false;
184 next_attribute.fg_color = FColor::Default;
185 next_attribute.bg_color = FColor::Default;
189 inline void FVTermAttribute::setBold (
bool enable)
190 { next_attribute.attr.bit.bold = enable; }
193 inline void FVTermAttribute::unsetBold()
197 inline void FVTermAttribute::setDim (
bool enable)
198 { next_attribute.attr.bit.dim = enable; }
201 inline void FVTermAttribute::unsetDim()
205 inline void FVTermAttribute::setItalic (
bool enable)
206 { next_attribute.attr.bit.italic = enable; }
209 inline void FVTermAttribute::unsetItalic()
210 { setItalic(
false); }
213 inline void FVTermAttribute::setUnderline (
bool enable)
214 { next_attribute.attr.bit.underline = enable; }
217 inline void FVTermAttribute::unsetUnderline()
218 { setUnderline(
false); }
221 inline void FVTermAttribute::setBlink (
bool enable)
222 { next_attribute.attr.bit.blink = enable; }
225 inline void FVTermAttribute::unsetBlink()
229 inline void FVTermAttribute::setReverse (
bool enable)
230 { next_attribute.attr.bit.reverse = enable; }
233 inline void FVTermAttribute::unsetReverse()
234 { setReverse(
false); }
237 inline void FVTermAttribute::setStandout (
bool enable)
238 { next_attribute.attr.bit.standout = enable; }
241 inline void FVTermAttribute::unsetStandout()
242 { setStandout(
false); }
245 inline void FVTermAttribute::setInvisible (
bool enable)
246 { next_attribute.attr.bit.invisible = enable; }
249 inline void FVTermAttribute::unsetInvisible()
250 { setInvisible(
false); }
253 inline void FVTermAttribute::setProtected (
bool enable)
254 { next_attribute.attr.bit.protect = enable; }
257 inline void FVTermAttribute::unsetProtected()
258 { setProtected(
false); }
261 inline void FVTermAttribute::setCrossedOut (
bool enable)
262 { next_attribute.attr.bit.crossed_out = enable; }
265 inline void FVTermAttribute::unsetCrossedOut()
266 { setCrossedOut(
false); }
269 inline void FVTermAttribute::setDoubleUnderline (
bool enable)
270 { next_attribute.attr.bit.dbl_underline = enable; }
273 inline void FVTermAttribute::unsetDoubleUnderline()
274 { setDoubleUnderline(
false); }
277 inline void FVTermAttribute::setAltCharset (
bool enable)
278 { next_attribute.attr.bit.alt_charset = enable; }
281 inline void FVTermAttribute::unsetAltCharset()
282 { setAltCharset(
false); }
285 inline void FVTermAttribute::setPCcharset (
bool enable)
286 { next_attribute.attr.bit.pc_charset = enable; }
289 inline void FVTermAttribute::unsetPCcharset()
290 { setPCcharset(
false); }
293 inline void FVTermAttribute::setTransparent (
bool enable)
294 { next_attribute.attr.bit.transparent = enable; }
297 inline void FVTermAttribute::unsetTransparent()
298 { setTransparent(
false); }
301 inline void FVTermAttribute::setColorOverlay (
bool enable)
302 { next_attribute.attr.bit.color_overlay = enable; }
305 inline void FVTermAttribute::unsetColorOverlay()
306 { setColorOverlay(
false); }
309 inline void FVTermAttribute::setInheritBackground (
bool enable)
310 { next_attribute.attr.bit.inherit_background = enable; }
313 inline void FVTermAttribute::unsetInheritBackground()
314 { setInheritBackground(
false); }
317 inline auto FVTermAttribute::isBold() ->
bool 318 {
return next_attribute.attr.bit.bold; }
321 inline auto FVTermAttribute::isDim() ->
bool 322 {
return next_attribute.attr.bit.dim; }
325 inline auto FVTermAttribute::isItalic() ->
bool 326 {
return next_attribute.attr.bit.italic; }
329 inline auto FVTermAttribute::isUnderline() ->
bool 330 {
return next_attribute.attr.bit.underline; }
333 inline auto FVTermAttribute::isBlink() ->
bool 334 {
return next_attribute.attr.bit.blink; }
337 inline auto FVTermAttribute::isReverse() ->
bool 338 {
return next_attribute.attr.bit.reverse; }
341 inline auto FVTermAttribute::isStandout() ->
bool 342 {
return next_attribute.attr.bit.standout; }
345 inline auto FVTermAttribute::isInvisible() ->
bool 346 {
return next_attribute.attr.bit.invisible; }
349 inline auto FVTermAttribute::isProtected() ->
bool 350 {
return next_attribute.attr.bit.protect; }
353 inline auto FVTermAttribute::isCrossedOut() ->
bool 354 {
return next_attribute.attr.bit.crossed_out; }
357 inline auto FVTermAttribute::isDoubleUnderline() ->
bool 358 {
return next_attribute.attr.bit.dbl_underline; }
361 inline auto FVTermAttribute::isAltCharset() ->
bool 362 {
return next_attribute.attr.bit.alt_charset; }
365 inline auto FVTermAttribute::isPCcharset() ->
bool 366 {
return next_attribute.attr.bit.pc_charset; }
369 inline auto FVTermAttribute::isTransparent() ->
bool 370 {
return next_attribute.attr.bit.transparent; }
373 inline auto FVTermAttribute::isColorOverlay() ->
bool 374 {
return next_attribute.attr.bit.color_overlay; }
377 inline auto FVTermAttribute::isInheritBackground() ->
bool 378 {
return next_attribute.attr.bit.inherit_background; }
382 #endif // FVTERMATTRIBUTE_H Definition: class_template.cpp:25
Definition: fcolorpair.h:49
Definition: fvtermattribute.h:53