2017-11-04 07:03:53 +01:00
|
|
|
/***********************************************************************
|
2019-05-17 15:48:09 +02:00
|
|
|
* fterm.h - Base class for terminal control *
|
2017-11-04 07:03:53 +01:00
|
|
|
* *
|
|
|
|
* This file is part of the Final Cut widget toolkit *
|
|
|
|
* *
|
2019-01-02 03:00:07 +01:00
|
|
|
* Copyright 2012-2019 Markus Gans *
|
2017-11-04 07:03:53 +01:00
|
|
|
* *
|
|
|
|
* The Final Cut is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* The Final Cut is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this program. If not, see *
|
|
|
|
* <http://www.gnu.org/licenses/>. *
|
|
|
|
***********************************************************************/
|
2017-10-02 07:32:33 +02:00
|
|
|
|
|
|
|
/* Base class
|
|
|
|
* ══════════
|
|
|
|
*
|
2018-05-20 15:15:42 +02:00
|
|
|
* ▕▔▔▔▔▔▔▔▏1 1▕▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FTerm ▏-┬- - - -▕ FTermios ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermcap ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermcapQuirks ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermDetection ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermXTerminal ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2018-06-12 16:37:48 +02:00
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermLinux ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermFreeBSD ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FTermOpenBSD ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2018-05-20 15:15:42 +02:00
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FColorPalette ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
2017-10-02 07:32:33 +02:00
|
|
|
* :
|
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FOptiAttr ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2018-05-20 15:15:42 +02:00
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FOptiMove ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2018-07-15 19:52:59 +02:00
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FKeyboard ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2018-07-22 23:07:49 +02:00
|
|
|
* : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FMouseControl ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
2017-10-02 07:32:33 +02:00
|
|
|
* : *▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FString ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : *▕▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - - -▕ FPoint ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : *▕▔▔▔▔▔▔▔▏
|
|
|
|
* └- - - -▕ FRect ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▏
|
|
|
|
*/
|
2015-05-23 13:35:12 +02:00
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#ifndef FTERM_H
|
|
|
|
#define FTERM_H
|
2015-05-23 13:35:12 +02:00
|
|
|
|
2017-10-31 00:41:59 +01:00
|
|
|
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
|
|
|
|
#error "Only <final/final.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2017-09-17 21:32:46 +02:00
|
|
|
#include "final/fconfig.h"
|
2015-08-22 18:53:52 +02:00
|
|
|
|
2015-08-09 23:39:12 +02:00
|
|
|
#include <sys/ioctl.h>
|
2016-10-14 13:02:35 +02:00
|
|
|
#include <sys/stat.h>
|
2015-05-23 13:35:12 +02:00
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <langinfo.h>
|
2018-01-14 21:21:08 +01:00
|
|
|
|
2017-12-14 00:35:10 +01:00
|
|
|
#if F_HAVE_GETTTYNAM && F_HAVE_TTYENT_H
|
|
|
|
#include <ttyent.h>
|
|
|
|
#endif
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#include <clocale>
|
2015-05-23 13:35:12 +02:00
|
|
|
#include <cmath>
|
|
|
|
#include <csignal>
|
|
|
|
#include <map>
|
|
|
|
#include <queue>
|
2017-09-11 03:06:02 +02:00
|
|
|
#include <string>
|
2015-05-23 13:35:12 +02:00
|
|
|
|
2017-09-17 21:32:46 +02:00
|
|
|
#include "final/fc.h"
|
|
|
|
#include "final/fstring.h"
|
2019-07-21 23:31:21 +02:00
|
|
|
|
|
|
|
namespace finalcut
|
|
|
|
{
|
|
|
|
|
|
|
|
// class forward declaration
|
|
|
|
class FKeyboard;
|
|
|
|
class FMouseControl;
|
|
|
|
class FOptiAttr;
|
|
|
|
class FOptiMove;
|
|
|
|
class FSize;
|
|
|
|
class FString;
|
|
|
|
class FSystem;
|
|
|
|
class FTermData;
|
|
|
|
class FTermDebugData;
|
|
|
|
class FTermDetection;
|
|
|
|
class FTermXTerminal;
|
2018-05-27 19:43:18 +02:00
|
|
|
|
2019-07-14 18:30:35 +02:00
|
|
|
#if defined(UNIT_TEST)
|
2019-07-21 23:31:21 +02:00
|
|
|
class FTermLinux;
|
|
|
|
class FTermFreeBSD;
|
|
|
|
class FTermOpenBSD;
|
2019-07-14 18:30:35 +02:00
|
|
|
#elif defined(__linux__)
|
2019-07-21 23:31:21 +02:00
|
|
|
class FTermLinux;
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
2019-07-21 23:31:21 +02:00
|
|
|
class FTermFreeBSD;
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
2019-07-21 23:31:21 +02:00
|
|
|
class FTermOpenBSD;
|
2018-05-27 19:43:18 +02:00
|
|
|
#endif
|
|
|
|
|
2015-05-23 13:35:12 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FTerm
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2019-01-04 02:18:54 +01:00
|
|
|
class FTerm final
|
2015-05-23 13:35:12 +02:00
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
2018-10-29 00:45:45 +01:00
|
|
|
struct initializationValues; // forward declaration
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Constructor
|
|
|
|
explicit FTerm (bool = false);
|
2018-12-24 18:11:16 +01:00
|
|
|
|
2018-12-09 22:04:55 +01:00
|
|
|
// Disable copy constructor
|
|
|
|
FTerm (const FTerm&) = delete;
|
2018-12-24 18:11:16 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Destructor
|
|
|
|
virtual ~FTerm();
|
|
|
|
|
2018-12-09 22:04:55 +01:00
|
|
|
// Disable assignment operator (=)
|
|
|
|
FTerm& operator = (const FTerm&) = delete;
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Accessors
|
2018-10-01 22:27:54 +02:00
|
|
|
virtual const char* getClassName() const;
|
2018-10-14 06:25:33 +02:00
|
|
|
static std::size_t getLineNumber();
|
|
|
|
static std::size_t getColumnNumber();
|
2018-11-21 20:07:08 +01:00
|
|
|
static const FString getKeyName (FKey);
|
2018-10-01 22:27:54 +02:00
|
|
|
static int getTTYFileDescriptor();
|
|
|
|
static char* getTermType();
|
|
|
|
static char* getTermFileName();
|
|
|
|
static int getTabstop();
|
|
|
|
static int getMaxColor();
|
2018-10-29 00:45:45 +01:00
|
|
|
initializationValues& getInitValues();
|
2019-07-21 23:31:21 +02:00
|
|
|
charSubstitution& getCharSubstitutionMap();
|
2017-04-06 01:31:21 +02:00
|
|
|
|
2019-05-17 15:48:09 +02:00
|
|
|
static FTermData* getFTermData();
|
2019-05-27 00:50:11 +02:00
|
|
|
static FSystem* getFSystem();
|
|
|
|
static FOptiMove* getFOptiMove();
|
|
|
|
static FOptiAttr* getFOptiAttr();
|
2019-05-17 15:48:09 +02:00
|
|
|
static FTermDetection* getFTermDetection();
|
2019-05-27 00:50:11 +02:00
|
|
|
static FTermXTerminal* getFTermXTerminal();
|
|
|
|
static FKeyboard* getFKeyboard();
|
|
|
|
static FMouseControl* getFMouseControl();
|
|
|
|
|
2019-07-14 18:30:35 +02:00
|
|
|
#if defined(UNIT_TEST)
|
|
|
|
static FTermLinux* getFTermLinux();
|
|
|
|
static FTermFreeBSD* getFTermFreeBSD();
|
|
|
|
static FTermOpenBSD* getFTermOpenBSD();
|
|
|
|
#elif defined(__linux__)
|
2019-05-27 00:50:11 +02:00
|
|
|
static FTermLinux* getFTermLinux();
|
|
|
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
|
|
|
static FTermFreeBSD* getFTermFreeBSD();
|
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
|
|
static FTermOpenBSD* getFTermOpenBSD();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if DEBUG
|
2019-07-28 23:12:01 +02:00
|
|
|
static FTermDebugData& getFTermDebugData();
|
2018-11-01 21:29:54 +01:00
|
|
|
#endif
|
2017-03-26 20:40:04 +02:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Inquiries
|
2018-10-01 22:27:54 +02:00
|
|
|
static bool isNormal (charData*&);
|
|
|
|
static bool isRaw();
|
|
|
|
static bool hasUTF8();
|
|
|
|
static bool hasVT100();
|
|
|
|
static bool hasASCII();
|
|
|
|
static bool isMonochron();
|
|
|
|
static bool isXTerminal();
|
|
|
|
static bool isAnsiTerminal();
|
|
|
|
static bool isRxvtTerminal();
|
|
|
|
static bool isUrxvtTerminal();
|
|
|
|
static bool isMltermTerminal();
|
|
|
|
static bool isPuttyTerminal();
|
|
|
|
static bool isKdeTerminal();
|
|
|
|
static bool isGnomeTerminal();
|
|
|
|
static bool isKtermTerminal();
|
|
|
|
static bool isTeraTerm();
|
|
|
|
static bool isSunTerminal();
|
|
|
|
static bool isCygwinTerminal();
|
|
|
|
static bool isMinttyTerm();
|
|
|
|
static bool isLinuxTerm();
|
|
|
|
static bool isFreeBSDTerm();
|
|
|
|
static bool isNetBSDTerm();
|
|
|
|
static bool isOpenBSDTerm();
|
|
|
|
static bool isScreenTerm();
|
|
|
|
static bool isTmuxTerm();
|
|
|
|
static bool isNewFont();
|
2018-10-29 00:45:45 +01:00
|
|
|
static bool isCursorHideable();
|
|
|
|
static bool hasChangedTermSize();
|
|
|
|
static bool hasShadowCharacter();
|
|
|
|
static bool hasHalfBlockCharacter();
|
|
|
|
static bool hasAlternateScreen();
|
2019-01-03 20:56:09 +01:00
|
|
|
static bool canChangeColorPalette();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Mutators
|
2019-05-27 00:50:11 +02:00
|
|
|
static void setFSystem (FSystem*);
|
2018-10-01 22:27:54 +02:00
|
|
|
static void setTermType (const char[]);
|
2018-12-22 23:50:10 +01:00
|
|
|
static void setInsertCursor (bool);
|
2018-10-01 22:27:54 +02:00
|
|
|
static void redefineDefaultColors (bool);
|
2018-12-28 22:57:43 +01:00
|
|
|
static void setDblclickInterval (const uInt64);
|
2018-10-01 22:27:54 +02:00
|
|
|
static bool setUTF8 (bool);
|
|
|
|
static bool setUTF8();
|
|
|
|
static bool unsetUTF8();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Methods
|
2018-10-01 22:27:54 +02:00
|
|
|
static bool setVGAFont();
|
|
|
|
static bool setNewFont();
|
|
|
|
static bool setOldFont();
|
|
|
|
static int openConsole();
|
|
|
|
static int closeConsole();
|
|
|
|
static char* moveCursor (int, int, int, int);
|
|
|
|
static char* cursorsVisibility (bool);
|
|
|
|
static void printMoveDurations();
|
|
|
|
static char* enableCursor();
|
|
|
|
static char* disableCursor();
|
|
|
|
static void detectTermSize();
|
2019-01-21 03:42:18 +01:00
|
|
|
static void setTermSize (const FSize&);
|
2018-10-29 00:45:45 +01:00
|
|
|
static void setTermTitle (const FString&);
|
2018-10-01 22:27:54 +02:00
|
|
|
static void setKDECursor (fc::kdeKonsoleCursorShape);
|
|
|
|
static void saveColorMap();
|
|
|
|
static void resetColorMap();
|
2018-11-07 22:06:58 +01:00
|
|
|
static void setPalette (FColor, int, int, int);
|
2018-10-01 22:27:54 +02:00
|
|
|
static void setBeep (int, int);
|
|
|
|
static void resetBeep();
|
|
|
|
static void beep();
|
|
|
|
|
|
|
|
static void setEncoding (fc::encoding);
|
|
|
|
static fc::encoding getEncoding();
|
|
|
|
static std::string getEncodingString();
|
2019-01-02 03:00:07 +01:00
|
|
|
static bool charEncodable (wchar_t);
|
|
|
|
static wchar_t charEncode (wchar_t);
|
|
|
|
static wchar_t charEncode (wchar_t, fc::encoding);
|
|
|
|
static wchar_t cp437_to_unicode (uChar);
|
|
|
|
static uChar unicode_to_cp437 (wchar_t);
|
2018-10-01 22:27:54 +02:00
|
|
|
|
|
|
|
static bool scrollTermForward();
|
|
|
|
static bool scrollTermReverse();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// function pointer -> static function
|
2018-10-01 22:27:54 +02:00
|
|
|
static int (*Fputchar)(int);
|
2017-09-11 03:06:02 +02:00
|
|
|
|
2018-10-01 22:27:54 +02:00
|
|
|
static void putstringf (const char[], ...)
|
2017-09-11 03:06:02 +02:00
|
|
|
#if defined(__clang__)
|
2018-11-24 02:59:56 +01:00
|
|
|
__attribute__ ((__format__ (__printf__, 1, 2)))
|
2017-09-11 03:06:02 +02:00
|
|
|
#elif defined(__GNUC__)
|
|
|
|
__attribute__ ((format (printf, 1, 2)))
|
|
|
|
#endif
|
2018-10-01 22:27:54 +02:00
|
|
|
;
|
|
|
|
static void putstring (const char[], int = 1);
|
|
|
|
static int putchar_ASCII (int);
|
|
|
|
static int putchar_UTF8 (int);
|
2017-03-26 20:40:04 +02:00
|
|
|
|
2018-10-01 22:27:54 +02:00
|
|
|
static void initScreenSettings();
|
|
|
|
static char* changeAttribute ( charData*&
|
|
|
|
, charData*& );
|
|
|
|
static void changeTermSizeFinished();
|
|
|
|
static void exitWithMessage (const FString&)
|
2017-12-10 15:36:02 +01:00
|
|
|
#if defined(__clang__) || defined(__GNUC__)
|
|
|
|
__attribute__((noreturn))
|
|
|
|
#endif
|
2018-10-01 22:27:54 +02:00
|
|
|
;
|
2017-09-11 03:06:02 +02:00
|
|
|
// Data Members
|
2017-11-18 02:34:41 +01:00
|
|
|
static struct initializationValues
|
|
|
|
{
|
|
|
|
public:
|
2017-12-10 15:36:02 +01:00
|
|
|
void setDefault()
|
|
|
|
{
|
|
|
|
cursor_optimisation = true;
|
2018-06-17 23:25:32 +02:00
|
|
|
mouse_support = true;
|
|
|
|
terminal_detection = true;
|
2017-12-10 15:36:02 +01:00
|
|
|
color_change = true;
|
|
|
|
vgafont = false;
|
|
|
|
newfont = false;
|
|
|
|
encoding = fc::UNKNOWN;
|
2018-06-17 23:25:32 +02:00
|
|
|
|
2019-07-14 18:30:35 +02:00
|
|
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
|
2018-06-17 23:25:32 +02:00
|
|
|
meta_sends_escape = true;
|
|
|
|
change_cursorstyle = true;
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
2018-06-17 23:25:32 +02:00
|
|
|
meta_sends_escape = true;
|
|
|
|
#endif
|
2017-12-10 15:36:02 +01:00
|
|
|
}
|
2017-11-18 02:34:41 +01:00
|
|
|
|
|
|
|
uInt8 cursor_optimisation : 1;
|
2018-06-17 23:25:32 +02:00
|
|
|
uInt8 mouse_support : 1;
|
|
|
|
uInt8 terminal_detection : 1;
|
2017-11-18 02:34:41 +01:00
|
|
|
uInt8 color_change : 1;
|
|
|
|
uInt8 vgafont : 1;
|
|
|
|
uInt8 newfont : 1;
|
2018-06-17 23:25:32 +02:00
|
|
|
uInt8 : 2; // padding bits
|
2017-11-18 02:34:41 +01:00
|
|
|
fc::encoding encoding;
|
2018-06-17 23:25:32 +02:00
|
|
|
|
2019-07-14 18:30:35 +02:00
|
|
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
|
2018-06-17 23:25:32 +02:00
|
|
|
uInt8 meta_sends_escape : 1;
|
|
|
|
uInt8 change_cursorstyle : 1;
|
|
|
|
uInt8 : 6; // padding bits
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
2018-06-17 23:25:32 +02:00
|
|
|
uInt8 meta_sends_escape : 1;
|
|
|
|
uInt8 : 7; // padding bits
|
|
|
|
#endif
|
2017-11-18 02:34:41 +01:00
|
|
|
} init_values;
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
private:
|
|
|
|
// Methods
|
2018-10-01 22:27:54 +02:00
|
|
|
static void init_global_values (bool);
|
|
|
|
static void init_terminal_device_path();
|
|
|
|
static void oscPrefix();
|
|
|
|
static void oscPostfix();
|
|
|
|
static void init_alt_charset();
|
|
|
|
static void init_pc_charset();
|
|
|
|
static void init_cygwin_charmap();
|
|
|
|
static void init_teraterm_charmap();
|
|
|
|
static void init_fixed_max_color();
|
|
|
|
static void init_keyboard();
|
|
|
|
static void init_termcap();
|
2018-10-08 04:14:20 +02:00
|
|
|
static void init_quirks();
|
|
|
|
static void init_optiMove();
|
|
|
|
static void init_optiAttr();
|
2018-10-01 22:27:54 +02:00
|
|
|
static void init_font();
|
|
|
|
static void init_locale();
|
|
|
|
static void init_encoding();
|
|
|
|
static void init_encoding_set();
|
|
|
|
static void init_term_encoding();
|
|
|
|
static void init_individual_term_encoding();
|
|
|
|
static void init_force_vt100_encoding();
|
|
|
|
static void init_utf8_without_alt_charset();
|
|
|
|
static void init_tab_quirks();
|
|
|
|
static void init_captureFontAndTitle();
|
2018-10-09 00:33:26 +02:00
|
|
|
static bool hasNoFontSettingOption();
|
2018-10-01 22:27:54 +02:00
|
|
|
static void redefineColorPalette();
|
|
|
|
static void restoreColorPalette();
|
|
|
|
static void setInsertCursorStyle();
|
|
|
|
static void setOverwriteCursorStyle();
|
|
|
|
static void enableMouse();
|
|
|
|
static void disableMouse();
|
2018-10-09 00:33:26 +02:00
|
|
|
static void enableApplicationEscKey();
|
|
|
|
static void disableApplicationEscKey();
|
|
|
|
static void enableKeypad();
|
|
|
|
static void disableKeypad();
|
|
|
|
static void enableAlternateCharset();
|
2018-10-01 22:27:54 +02:00
|
|
|
static void useAlternateScreenBuffer();
|
|
|
|
static void useNormalScreenBuffer();
|
|
|
|
void allocationValues();
|
|
|
|
void deallocationValues();
|
|
|
|
void init (bool);
|
|
|
|
void initOSspecifics();
|
2018-10-02 01:03:44 +02:00
|
|
|
void initTermspecifics();
|
2018-10-09 00:33:26 +02:00
|
|
|
void initBaudRate();
|
2018-10-01 22:27:54 +02:00
|
|
|
void finish();
|
|
|
|
void finishOSspecifics1();
|
|
|
|
void finish_encoding();
|
|
|
|
static void setSignalHandler();
|
|
|
|
static void resetSignalHandler();
|
|
|
|
static void signal_handler (int);
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Data Members
|
2018-10-01 22:27:54 +02:00
|
|
|
static FTermData* data;
|
2019-05-17 15:48:09 +02:00
|
|
|
static FSystem* fsys;
|
2018-05-27 19:43:18 +02:00
|
|
|
static FOptiMove* opti_move;
|
|
|
|
static FOptiAttr* opti_attr;
|
|
|
|
static FTermDetection* term_detection;
|
|
|
|
static FTermXTerminal* xterm;
|
2018-07-15 19:52:59 +02:00
|
|
|
static FKeyboard* keyboard;
|
2018-10-01 22:27:54 +02:00
|
|
|
static FMouseControl* mouse;
|
2018-05-27 19:43:18 +02:00
|
|
|
|
2019-07-14 18:30:35 +02:00
|
|
|
#if defined(UNIT_TEST)
|
|
|
|
#undef linux
|
|
|
|
static FTermLinux* linux;
|
|
|
|
static FTermFreeBSD* freebsd;
|
|
|
|
static FTermOpenBSD* openbsd;
|
|
|
|
#elif defined(__linux__)
|
2018-06-12 16:37:48 +02:00
|
|
|
#undef linux
|
|
|
|
static FTermLinux* linux;
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
2018-05-27 19:43:18 +02:00
|
|
|
static FTermFreeBSD* freebsd;
|
2018-10-08 04:14:20 +02:00
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
2018-05-27 19:43:18 +02:00
|
|
|
static FTermOpenBSD* openbsd;
|
2017-04-14 23:55:44 +02:00
|
|
|
#endif
|
2018-11-01 21:29:54 +01:00
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
static FTermDebugData* debug_data;
|
|
|
|
#endif
|
2016-11-02 00:37:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
2015-10-17 19:40:43 +02:00
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
// FTerm inline functions
|
2015-05-23 13:35:12 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const char* FTerm::getClassName() const
|
|
|
|
{ return "FTerm"; }
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FTerm::initializationValues& FTerm::getInitValues()
|
|
|
|
{ return init_values; }
|
|
|
|
|
2019-05-27 00:50:11 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FTerm::setFSystem (FSystem* fsystem)
|
|
|
|
{ fsys = fsystem; }
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FTerm::setUTF8()
|
|
|
|
{ return setUTF8(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FTerm::unsetUTF8()
|
|
|
|
{ return setUTF8(false); }
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
} // namespace finalcut
|
|
|
|
|
2018-12-06 02:28:24 +01:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline std::ostream& operator << ( std::ostream& os
|
|
|
|
, finalcut::fc::SpecialCharacter c )
|
|
|
|
{
|
|
|
|
return os << static_cast<char>(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline std::wostream& operator << ( std::wostream& os
|
|
|
|
, finalcut::fc::SpecialCharacter c )
|
|
|
|
{
|
|
|
|
return os << static_cast<wchar_t>(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#endif // FTERM_H
|