34 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)    35   #error "Only <final/final.h> can be included directly."    38 #if defined(__linux__)    41   #if defined(__arm__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)    43     #if !__GLIBC_PREREQ(2,30)    44       #define ARM_ISA_SYSCTL    48   #if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)    49     #define ISA_SYSCTL_SUPPORT    51   #endif  // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)    56   struct console_font_op;
    58 #endif  // defined(__linux__)    60 #include <sys/ioctl.h>    66 #include <unordered_map>    70 #include "final/output/tty/ftermdata.h"    71 #include "final/util/fstring.h"    84     using CursorStyle = LinuxConsoleCursorStyle;
   105     auto  getClassName() 
const -> 
FString;
   107     auto  getCursorStyle() 
const -> CursorStyle;
   108     auto  getCursorStyleString() -> 
char*;
   109     auto  getFramebufferBpp() 
const noexcept -> int;
   112     auto  setCursorStyle (CursorStyle) -> bool;
   113     auto  setPalette (FColor, 
int, 
int, 
int) -> bool;
   114     void  setUTF8 (
bool = 
true) 
const;
   117     static auto isLinuxConsole() -> bool;
   118     auto isVGAFontUsed() 
const noexcept -> bool;
   119     auto isNewFontUsed() 
const noexcept -> bool;
   123     void  initCharMap() 
const;
   125     auto  loadVGAFont() -> bool;
   126     auto  loadNewFont() -> bool;
   127     auto  loadOldFont() -> bool;
   128     auto  saveColorMap() -> bool;
   129     auto  resetColorMap() -> bool;
   130     void  setBeep (
int, 
int) 
const;
   131     void  resetBeep() 
const;
   132     auto  modifierKeyCorrection (
const FKey&) -> FKey;
   144     struct ModifierKeyHash
   146       auto operator () (
const ModifierKey& m_key) 
const noexcept -> std::size_t
   149         std::memcpy(&m, &m_key, 
sizeof(uChar));
   150         return std::hash<uChar>{}(m);
   163       std::array<RGB, 16> color;
   168       ModifierKey modifier;
   174       auto operator () (
const Pair& pair) 
const noexcept -> std::size_t
   177         const auto hash1 = ModifierKeyHash{}(pair.modifier);
   179         seed ^= hash1 + 0x9e3779b9 + (seed << 6u) + (seed >> 2u);
   180         seed ^= hash2 + 0x9e3779b9 + (seed << 6u) + (seed >> 2u);
   187       auto operator () (
const Pair& lhs, 
const Pair& rhs) 
const noexcept -> 
bool   189         return std::memcmp(&lhs.modifier, &rhs.modifier, 
sizeof(ModifierKey)) == 0
   190             && lhs.key == rhs.key;
   195     using KeyMap = std::unordered_map<Pair, FKey, PairHash, PairEqual>;
   196     using FontData = std::vector<uChar>;
   197     using UnicodeEntries = std::vector<struct unipair>;
   200     auto  getFramebuffer_bpp() 
const -> int;
   201     auto  getScreenFont() -> bool;
   202     auto  getUnicodeMap () -> bool;
   203     auto  getModifierKey() & -> ModifierKey&;
   206     auto  isLinuxTerm() 
const -> bool;
   209     auto  setScreenFont ( 
const uChar[], uInt, uInt, uInt
   210                         , 
bool = 
false ) -> int;
   211     auto  setUnicodeMap (
struct unimapdesc*) 
const -> int;
   212     void  setLinuxCursorStyle (LinuxConsoleCursorStyle) 
const;
   215 #if defined(ISA_SYSCTL_SUPPORT)   216     auto  getInputStatusRegisterOne() 
const -> uInt16;
   217     auto  readAttributeController (uChar) 
const -> uChar;
   218     void  writeAttributeController (uChar, uChar) 
const;
   219     auto  getAttributeMode() 
const -> uChar;
   220     void  setAttributeMode (uChar) 
const;
   221     auto  setBlinkAsIntensity (
bool = 
true) 
const -> int;
   222     auto  has9BitCharacters() 
const -> bool;
   223     void  getVGAPalette();
   224     void  setVGADefaultPalette();
   225     auto  setVGAPalette (FColor, 
int, 
int, 
int) -> bool;
   226     auto  saveVGAPalette() -> bool;
   227     auto  resetVGAPalette() -> bool;
   228 #endif  // defined(ISA_SYSCTL_SUPPORT)   230     void  keyCorrection();
   231     void  shiftKeyCorrection();
   232     void  ctrlKeyCorrection();
   233     void  altKeyCorrection();
   234     void  shiftCtrlKeyCorrection();
   235     void  shiftAltKeyCorrection();
   236     void  ctrlAltKeyCorrection();
   237     void  shiftCtrlAltKeyCorrection();
   238     void  initSpecialCharacter() 
const;
   239     auto  getFontPos (
wchar_t ucs) 
const -> sInt16;
   240     void  deleteFontData (console_font_op&);
   241     void  deleteUnicodeMapEntries (unimapdesc&);
   242     void  characterFallback (
wchar_t, 
const std::vector<wchar_t>&) 
const;
   245 #if defined(__linux__)   248     bool             has_saved_palette{};
   249     int              framebuffer_bpp{-1};
   250     CursorStyle      linux_console_cursor_style{};
   251     console_font_op  screen_font{};
   252     unimapdesc       screen_unicode_map{};
   253     FontData         font_data{};
   254     FontData         screen_font_data{};
   255     UnicodeEntries   unicode_entries{};
   256     ColorMap         saved_color_map{};
   259     ModifierKey      mod_key{};
   260 #endif  // defined(__linux__)   266 inline auto FTermLinux::getClassName() 
const -> 
FString   267 { 
return "FTermLinux"; }
   270 #if defined(__linux__)   271 inline auto FTermLinux::getFramebufferBpp() 
const noexcept -> 
int   272 { 
return framebuffer_bpp; }
   275 inline auto FTermLinux::isVGAFontUsed() 
const noexcept -> 
bool   279 inline auto FTermLinux::isNewFontUsed() 
const noexcept -> 
bool   281 #endif  // defined(__linux__)   285 #endif  // FTERMLINUX_H Definition: ftermlinux.h:80
 
Definition: class_template.cpp:25