2017-11-04 07:03:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* fvterm.h - Virtual terminal implementation *
|
|
|
|
* *
|
|
|
|
* This file is part of the Final Cut widget toolkit *
|
|
|
|
* *
|
2018-01-02 20:38:45 +01:00
|
|
|
* Copyright 2016-2018 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
|
|
|
|
|
|
|
/* Inheritance diagram
|
|
|
|
* ═══════════════════
|
|
|
|
*
|
2017-10-29 14:27:50 +01:00
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FTerm ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* ▲
|
|
|
|
* │
|
|
|
|
* ▕▔▔▔▔▔▔▔▔▔▏1 *▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
* ▕ FVTerm ▏- - -┬- - -▕ FString ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : *▕▔▔▔▔▔▔▔▔▏
|
|
|
|
* :- - -▕ FPoint ▏
|
|
|
|
* : ▕▁▁▁▁▁▁▁▁▏
|
|
|
|
* :
|
|
|
|
* : *▕▔▔▔▔▔▔▔▏
|
|
|
|
* └- - -▕ FRect ▏
|
|
|
|
* ▕▁▁▁▁▁▁▁▏
|
2017-10-02 07:32:33 +02:00
|
|
|
*/
|
2016-10-11 04:57:36 +02:00
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#ifndef FVTERM_H
|
|
|
|
#define FVTERM_H
|
2016-10-11 04:57:36 +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
|
|
|
|
|
2018-01-22 19:47:20 +01:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
#include "final/fconfig.h" // includes _GNU_SOURCE for wcwidth()
|
|
|
|
#endif
|
|
|
|
|
2018-10-24 00:16:45 +02:00
|
|
|
#include <queue>
|
2016-12-26 01:15:32 +01:00
|
|
|
#include <sstream> // std::stringstream
|
2018-10-24 00:16:45 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-10-11 04:57:36 +02:00
|
|
|
|
2017-09-17 21:32:46 +02:00
|
|
|
#include "final/fterm.h"
|
|
|
|
|
2018-10-08 04:14:20 +02:00
|
|
|
|
2017-01-15 19:48:27 +01:00
|
|
|
// Preprocessing handler macro
|
2017-04-09 20:08:53 +02:00
|
|
|
#define F_PREPROC_HANDLER(i,h) \
|
2017-10-27 23:28:37 +02:00
|
|
|
static_cast<FVTerm*>((i)) \
|
2017-01-15 19:48:27 +01:00
|
|
|
, reinterpret_cast<FVTerm::FPreprocessingHandler>((h))
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
namespace finalcut
|
|
|
|
{
|
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
// class forward declaration
|
|
|
|
class FWidget;
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FVTerm
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
class FVTerm
|
2016-10-11 04:57:36 +02:00
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Typedefs and Enumeration
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uInt xmin; // X-position with the first change
|
|
|
|
uInt xmax; // X-position with the last change
|
|
|
|
uInt trans_count; // Number of transparent characters
|
|
|
|
} line_changes;
|
|
|
|
|
2018-06-25 00:14:53 +02:00
|
|
|
typedef FOptiAttr::charData charData;
|
2017-09-11 03:06:02 +02:00
|
|
|
typedef void (FVTerm::*FPreprocessingHandler)();
|
|
|
|
|
2017-10-02 07:32:33 +02:00
|
|
|
struct term_area; // forward declaration
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
struct vterm_preprocessing
|
|
|
|
{
|
|
|
|
FVTerm* instance;
|
|
|
|
FPreprocessingHandler handler;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<vterm_preprocessing> FPreprocessing;
|
|
|
|
|
|
|
|
enum covered_state
|
|
|
|
{
|
|
|
|
non_covered,
|
|
|
|
half_covered,
|
|
|
|
fully_covered
|
|
|
|
};
|
|
|
|
|
2018-02-03 00:04:24 +01:00
|
|
|
enum terminal_update
|
|
|
|
{
|
|
|
|
stop_refresh,
|
|
|
|
continue_refresh,
|
|
|
|
start_refresh
|
|
|
|
};
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Constructor
|
2017-10-27 23:28:37 +02:00
|
|
|
explicit FVTerm (bool, bool = false);
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Destructor
|
2018-09-24 04:02:35 +02:00
|
|
|
virtual ~FVTerm();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Overloaded operators
|
2018-10-20 22:50:35 +02:00
|
|
|
template <typename type>
|
|
|
|
FVTerm& operator << (const type&);
|
2018-06-25 00:14:53 +02:00
|
|
|
FVTerm& operator << (const std::vector<charData>&);
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Accessors
|
2018-10-29 00:45:45 +01:00
|
|
|
virtual const char* getClassName() const;
|
|
|
|
static short getTermForegroundColor();
|
|
|
|
static short getTermBackgroundColor();
|
|
|
|
term_area* getVWin() const;
|
|
|
|
FPoint getPrintCursor();
|
|
|
|
static charData getAttribute();
|
|
|
|
static int getMaxColor();
|
|
|
|
static int getTabstop();
|
|
|
|
static fc::encoding getEncoding();
|
|
|
|
static std::string getEncodingString();
|
|
|
|
static const FString getKeyName (int);
|
|
|
|
FTerm& getFTerm();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Mutators
|
2018-10-29 00:45:45 +01:00
|
|
|
void setTermXY (int, int);
|
2018-10-29 02:59:41 +01:00
|
|
|
void hideCursor (bool);
|
|
|
|
void hideCursor();
|
|
|
|
void showCursor();
|
2018-10-29 00:45:45 +01:00
|
|
|
void setPrintCursor (const FPoint&);
|
|
|
|
void setPrintCursor (int, int);
|
|
|
|
void setColor (short, short);
|
|
|
|
static void setNormal();
|
|
|
|
|
|
|
|
static bool setBold (bool);
|
|
|
|
static bool setBold();
|
|
|
|
static bool unsetBold();
|
|
|
|
|
|
|
|
static bool setDim (bool);
|
|
|
|
static bool setDim();
|
|
|
|
static bool unsetDim();
|
|
|
|
|
|
|
|
static bool setItalic (bool);
|
|
|
|
static bool setItalic();
|
|
|
|
static bool unsetItalic();
|
|
|
|
|
|
|
|
static bool setUnderline (bool);
|
|
|
|
static bool setUnderline();
|
|
|
|
static bool unsetUnderline();
|
|
|
|
|
|
|
|
static bool setBlink (bool);
|
|
|
|
static bool setBlink();
|
|
|
|
static bool unsetBlink();
|
|
|
|
|
|
|
|
static bool setReverse (bool);
|
|
|
|
static bool setReverse();
|
|
|
|
static bool unsetReverse();
|
|
|
|
|
|
|
|
static bool setStandout (bool);
|
|
|
|
static bool setStandout();
|
|
|
|
static bool unsetStandout();
|
|
|
|
|
|
|
|
static bool setInvisible (bool);
|
|
|
|
static bool setInvisible();
|
|
|
|
static bool unsetInvisible();
|
|
|
|
|
|
|
|
static bool setProtected (bool);
|
|
|
|
static bool setProtected();
|
|
|
|
static bool unsetProtected();
|
|
|
|
|
|
|
|
static bool setCrossedOut (bool);
|
|
|
|
static bool setCrossedOut();
|
|
|
|
static bool unsetCrossedOut();
|
|
|
|
|
|
|
|
static bool setDoubleUnderline (bool);
|
|
|
|
static bool setDoubleUnderline();
|
|
|
|
static bool unsetDoubleUnderline();
|
|
|
|
|
|
|
|
static bool setAltCharset (bool);
|
|
|
|
static bool setAltCharset();
|
|
|
|
static bool unsetAltCharset();
|
|
|
|
|
|
|
|
static bool setPCcharset (bool);
|
|
|
|
static bool setPCcharset();
|
|
|
|
static bool unsetPCcharset();
|
|
|
|
|
|
|
|
static bool setTransparent (bool);
|
|
|
|
static bool setTransparent();
|
|
|
|
static bool unsetTransparent();
|
|
|
|
|
|
|
|
static bool setTransShadow (bool);
|
|
|
|
static bool setTransShadow();
|
|
|
|
static bool unsetTransShadow();
|
|
|
|
|
|
|
|
static bool setInheritBackground (bool);
|
|
|
|
static bool setInheritBackground();
|
|
|
|
static bool unsetInheritBackground();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Inquiries
|
2018-10-29 00:45:45 +01:00
|
|
|
static bool isBold();
|
|
|
|
static bool isDim();
|
|
|
|
static bool isItalic();
|
|
|
|
static bool isUnderline();
|
|
|
|
static bool isBlink();
|
|
|
|
static bool isReverse();
|
|
|
|
static bool isStandout();
|
|
|
|
static bool isInvisible();
|
|
|
|
static bool isProtected();
|
|
|
|
static bool isCrossedOut();
|
|
|
|
static bool isDoubleUnderline();
|
|
|
|
static bool isAltCharset();
|
|
|
|
static bool isPCcharset();
|
|
|
|
static bool isTransparent();
|
|
|
|
static bool isTransShadow();
|
|
|
|
static bool isInheritBackground();
|
|
|
|
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();
|
|
|
|
static bool isCursorHideable();
|
|
|
|
static bool hasChangedTermSize();
|
|
|
|
static bool hasUTF8();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Methods
|
2018-10-29 00:45:45 +01:00
|
|
|
virtual void clearArea (int = ' ');
|
|
|
|
void createVTerm (const FRect&);
|
|
|
|
void createVTerm (int, int);
|
|
|
|
void resizeVTerm (const FRect&);
|
|
|
|
void resizeVTerm (int, int);
|
|
|
|
void putVTerm();
|
|
|
|
void updateTerminal (terminal_update);
|
|
|
|
void updateTerminal();
|
|
|
|
virtual void addPreprocessingHandler ( FVTerm*
|
|
|
|
, FPreprocessingHandler );
|
|
|
|
virtual void delPreprocessingHandler (FVTerm*);
|
|
|
|
|
|
|
|
int printf (const FString, ...);
|
|
|
|
int print (const FString&);
|
|
|
|
int print (term_area*, const FString&);
|
|
|
|
int print (const std::vector<charData>&);
|
|
|
|
int print (term_area*, const std::vector<charData>&);
|
|
|
|
int print (int);
|
|
|
|
int print (term_area*, int);
|
|
|
|
int print (charData&);
|
|
|
|
int print (term_area*, charData&);
|
|
|
|
FVTerm& print();
|
|
|
|
static void beep();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Enumeration
|
|
|
|
enum character_type
|
|
|
|
{
|
|
|
|
overlapped_character,
|
|
|
|
covered_character
|
|
|
|
};
|
|
|
|
|
|
|
|
// Accessor
|
2018-10-29 00:45:45 +01:00
|
|
|
virtual term_area* getPrintArea();
|
|
|
|
std::size_t getLineNumber();
|
|
|
|
std::size_t getColumnNumber();
|
|
|
|
static bool charEncodable (uInt);
|
|
|
|
static FKeyboard* getKeyboard();
|
|
|
|
static FMouseControl* getMouseControl();
|
|
|
|
FTerm::initializationValues& getInitValues();
|
|
|
|
|
|
|
|
// Mutators
|
|
|
|
static void setInsertCursor (bool on);
|
|
|
|
static void setInsertCursor();
|
|
|
|
static void unsetInsertCursor();
|
|
|
|
static bool setUTF8 (bool);
|
|
|
|
static bool setUTF8();
|
|
|
|
static bool unsetUTF8();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Inquiries
|
2018-10-29 00:45:45 +01:00
|
|
|
bool hasPrintArea() const;
|
|
|
|
bool hasChildPrintArea() const;
|
|
|
|
bool isVirtualWindow() const;
|
|
|
|
static bool hasHalfBlockCharacter();
|
|
|
|
static bool hasShadowCharacter();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Methods
|
2018-10-29 00:45:45 +01:00
|
|
|
void createArea ( const FRect&
|
|
|
|
, const FPoint&
|
|
|
|
, term_area*& );
|
|
|
|
|
|
|
|
void createArea ( int, int, int, int
|
|
|
|
, int, int
|
|
|
|
, term_area*& );
|
|
|
|
|
|
|
|
void resizeArea ( const FRect&
|
|
|
|
, const FPoint&
|
|
|
|
, term_area* );
|
|
|
|
|
|
|
|
void resizeArea ( int, int, int, int
|
|
|
|
, int, int
|
|
|
|
, term_area* );
|
|
|
|
|
|
|
|
static void removeArea (term_area*&);
|
|
|
|
static void restoreVTerm (const FRect&);
|
|
|
|
static void restoreVTerm (int, int, int, int);
|
|
|
|
void setTextToDefault (term_area*, int, int);
|
|
|
|
static bool reallocateTextArea ( term_area*
|
|
|
|
, std::size_t
|
|
|
|
, std::size_t );
|
|
|
|
static bool reallocateTextArea ( term_area*
|
|
|
|
, std::size_t );
|
|
|
|
|
|
|
|
static covered_state isCovered ( const FPoint&
|
2017-09-11 03:06:02 +02:00
|
|
|
, term_area* );
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
static covered_state isCovered ( int, int
|
2017-09-11 03:06:02 +02:00
|
|
|
, term_area* );
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
static void updateOverlappedColor ( term_area*
|
|
|
|
, int, int, int, int );
|
|
|
|
static void updateOverlappedCharacter (term_area*, int, int);
|
|
|
|
static void updateShadedCharacter ( term_area*
|
|
|
|
, int, int, int, int );
|
|
|
|
static void updateInheritBackground ( term_area*
|
|
|
|
, int, int, int, int );
|
|
|
|
static void updateCharacter ( term_area*
|
|
|
|
, int, int, int, int );
|
|
|
|
static bool updateVTermCharacter ( term_area*
|
2017-12-02 18:52:51 +01:00
|
|
|
, int, int, int, int );
|
2018-10-29 00:45:45 +01:00
|
|
|
static void callPreprocessingHandler (term_area*);
|
|
|
|
void updateVTerm();
|
|
|
|
void updateVTerm (term_area*);
|
|
|
|
bool updateVTermCursor (term_area*);
|
|
|
|
static bool isInsideArea (int, int, term_area*);
|
|
|
|
|
|
|
|
static void setAreaCursor ( const FPoint&
|
|
|
|
, bool, term_area* );
|
|
|
|
|
|
|
|
static void setAreaCursor ( int, int
|
|
|
|
, bool, term_area*);
|
|
|
|
|
|
|
|
static void getArea (const FPoint&, term_area*);
|
|
|
|
static void getArea (int, int, term_area*);
|
|
|
|
static void getArea (const FRect&, term_area*);
|
|
|
|
static void getArea (int, int, int, int, term_area*);
|
|
|
|
static void putArea (const FPoint&, term_area*);
|
|
|
|
static void putArea (int, int, term_area*);
|
|
|
|
void scrollAreaForward (term_area*);
|
|
|
|
void scrollAreaReverse (term_area*);
|
|
|
|
void clearArea (term_area*, int = ' ');
|
|
|
|
|
|
|
|
static charData generateCharacter (const FPoint&);
|
|
|
|
static charData generateCharacter (int, int);
|
|
|
|
|
|
|
|
static charData getCharacter ( character_type
|
|
|
|
, const FPoint&
|
|
|
|
, FVTerm* );
|
|
|
|
|
|
|
|
static charData getCharacter ( character_type
|
|
|
|
, int
|
|
|
|
, int, FVTerm* );
|
|
|
|
|
|
|
|
static charData getCoveredCharacter (const FPoint&, FVTerm*);
|
|
|
|
static charData getCoveredCharacter (int, int, FVTerm*);
|
|
|
|
static charData getOverlappedCharacter (const FPoint&, FVTerm*);
|
|
|
|
static charData getOverlappedCharacter (int, int, FVTerm*);
|
|
|
|
void processTerminalUpdate();
|
|
|
|
static void startTerminalUpdate();
|
|
|
|
static void finishTerminalUpdate();
|
|
|
|
static void flush_out();
|
|
|
|
static void initScreenSettings();
|
|
|
|
static void changeTermSizeFinished();
|
|
|
|
static void exitWithMessage (const FString&)
|
|
|
|
#if defined(__clang__) || defined(__GNUC__)
|
|
|
|
__attribute__((noreturn))
|
|
|
|
#endif
|
|
|
|
;
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Data Members
|
|
|
|
static term_area* vterm; // virtual terminal
|
|
|
|
static term_area* vdesktop; // virtual desktop
|
|
|
|
static term_area* active_area; // active area
|
|
|
|
term_area* print_area; // print area for this object
|
|
|
|
term_area* child_print_area; // print area for children
|
|
|
|
term_area* vwin; // virtual window
|
|
|
|
|
|
|
|
private:
|
2017-11-30 02:38:55 +01:00
|
|
|
// Typedef and Enumeration
|
2017-09-11 03:06:02 +02:00
|
|
|
typedef FTermcap::tcap_map termcap_map;
|
|
|
|
|
2017-11-30 02:38:55 +01:00
|
|
|
enum exit_state
|
|
|
|
{
|
|
|
|
not_used,
|
|
|
|
used,
|
|
|
|
line_completely_printed
|
|
|
|
};
|
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Constants
|
|
|
|
static const uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768;
|
|
|
|
// Buffer size for character output on the terminal
|
|
|
|
|
|
|
|
// Disable copy constructor
|
|
|
|
FVTerm (const FVTerm&);
|
|
|
|
|
|
|
|
// Disable assignment operator (=)
|
|
|
|
FVTerm& operator = (const FVTerm&);
|
|
|
|
|
|
|
|
// Mutators
|
2018-10-29 00:45:45 +01:00
|
|
|
void setPrintArea (term_area*);
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Methods
|
2018-10-29 00:45:45 +01:00
|
|
|
void init (bool);
|
|
|
|
static void init_characterLengths (FOptiMove*);
|
|
|
|
void finish();
|
|
|
|
static void putAreaLine (charData*, charData*, int);
|
|
|
|
static void putAreaCharacter ( int, int, FVTerm*
|
|
|
|
, charData*, charData* );
|
|
|
|
static void getAreaCharacter ( int, int, term_area*
|
|
|
|
, charData*& );
|
|
|
|
bool clearTerm (int = ' ');
|
|
|
|
bool clearFullArea (term_area*, charData&);
|
|
|
|
static void clearAreaWithShadow (term_area*, charData&);
|
|
|
|
static bool canClearToEOL (uInt, uInt);
|
|
|
|
static bool canClearLeadingWS (uInt&, uInt);
|
|
|
|
static bool canClearTrailingWS (uInt&, uInt);
|
|
|
|
bool skipUnchangedCharacters (uInt&, uInt, uInt);
|
|
|
|
void printRange (uInt, uInt, uInt, bool);
|
|
|
|
exit_state eraseCharacters (uInt&, uInt, uInt, bool);
|
|
|
|
exit_state repeatCharacter (uInt&, uInt, uInt);
|
|
|
|
static void cursorWrap();
|
|
|
|
bool printWrap (term_area*);
|
|
|
|
void updateTerminalLine (uInt);
|
|
|
|
bool updateTerminalCursor();
|
|
|
|
bool isInsideTerminal (int, int);
|
|
|
|
static void markAsPrinted (uInt, uInt);
|
|
|
|
static void markAsPrinted (uInt, uInt, uInt);
|
|
|
|
static void newFontChanges (charData*&);
|
|
|
|
static void charsetChanges (charData*&);
|
|
|
|
void appendCharacter (charData*&);
|
|
|
|
void appendChar (charData*&);
|
|
|
|
void appendAttributes (charData*&);
|
|
|
|
int appendLowerRight (charData*&);
|
|
|
|
static void appendOutputBuffer (const std::string&);
|
|
|
|
static void appendOutputBuffer (const char[]);
|
2017-12-17 01:06:53 +01:00
|
|
|
|
|
|
|
#if defined(__sun) && defined(__SVR4)
|
2018-10-29 00:45:45 +01:00
|
|
|
static int appendOutputBuffer (char);
|
2017-12-19 02:06:27 +01:00
|
|
|
#endif
|
2018-10-29 00:45:45 +01:00
|
|
|
static int appendOutputBuffer (int);
|
2018-01-25 09:31:59 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Data Members
|
2018-10-29 00:45:45 +01:00
|
|
|
static FTerm* fterm;
|
2017-09-11 03:06:02 +02:00
|
|
|
static std::queue<int>* output_buffer;
|
2018-07-01 14:48:53 +02:00
|
|
|
static charData term_attribute;
|
|
|
|
static charData next_attribute;
|
|
|
|
static charData s_ch; // shadow character
|
|
|
|
static charData i_ch; // inherit background character
|
2017-09-11 03:06:02 +02:00
|
|
|
static FPoint* term_pos; // terminal cursor position
|
2018-10-01 22:27:54 +02:00
|
|
|
static FTermcap::tcap_map* tcap;
|
2018-07-15 19:52:59 +02:00
|
|
|
static FKeyboard* keyboard;
|
2017-09-11 03:06:02 +02:00
|
|
|
static bool terminal_update_complete;
|
|
|
|
static bool terminal_update_pending;
|
|
|
|
static bool force_terminal_update;
|
|
|
|
static bool stop_terminal_updates;
|
|
|
|
static int skipped_terminal_update;
|
2018-07-01 14:48:53 +02:00
|
|
|
static uInt erase_char_length;
|
|
|
|
static uInt repeat_char_length;
|
|
|
|
static uInt clr_bol_length;
|
|
|
|
static uInt clr_eol_length;
|
|
|
|
static uInt cursor_address_length;
|
2016-10-11 04:57:36 +02:00
|
|
|
};
|
2017-10-02 07:32:33 +02:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// struct FVTerm::term_area
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
2016-10-11 04:57:36 +02:00
|
|
|
|
2017-10-02 07:32:33 +02:00
|
|
|
struct FVTerm::term_area // define virtual terminal character properties
|
|
|
|
{
|
|
|
|
public:
|
2018-01-02 20:38:45 +01:00
|
|
|
term_area()
|
2018-01-03 08:42:10 +01:00
|
|
|
: offset_left (0)
|
|
|
|
, offset_top (0)
|
|
|
|
, width (-1)
|
|
|
|
, height (-1)
|
|
|
|
, right_shadow (0)
|
|
|
|
, bottom_shadow (0)
|
|
|
|
, cursor_x (0)
|
|
|
|
, cursor_y (0)
|
|
|
|
, input_cursor_x (-1)
|
|
|
|
, input_cursor_y (-1)
|
|
|
|
, widget()
|
|
|
|
, preprocessing_call()
|
|
|
|
, changes (0)
|
|
|
|
, text (0)
|
|
|
|
, input_cursor_visible (false)
|
|
|
|
, has_changes (false)
|
|
|
|
, visible (false)
|
2018-01-02 20:38:45 +01:00
|
|
|
{ }
|
|
|
|
|
|
|
|
~term_area()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
int offset_left; // Distance from left terminal side
|
|
|
|
int offset_top; // Distance from top of the terminal
|
|
|
|
int width; // Window width
|
|
|
|
int height; // Window height
|
|
|
|
int right_shadow; // Right window shadow
|
|
|
|
int bottom_shadow; // Bottom window shadow
|
|
|
|
int cursor_x; // X-position for the next write operation
|
|
|
|
int cursor_y; // Y-position for the next write operation
|
|
|
|
int input_cursor_x; // X-position input cursor
|
|
|
|
int input_cursor_y; // Y-position input cursor
|
|
|
|
FWidget* widget; // Widget that owns this term_area
|
|
|
|
FPreprocessing preprocessing_call;
|
|
|
|
line_changes* changes;
|
2018-06-25 00:14:53 +02:00
|
|
|
charData* text; // Text data for the output
|
2018-01-02 20:38:45 +01:00
|
|
|
bool input_cursor_visible;
|
|
|
|
bool has_changes;
|
|
|
|
bool visible;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Disable copy constructor
|
|
|
|
term_area (const term_area&);
|
|
|
|
// Disable assignment operator (=)
|
|
|
|
term_area& operator = (const term_area&);
|
2017-10-02 07:32:33 +02:00
|
|
|
};
|
2016-10-11 04:57:36 +02:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2017-10-02 07:32:33 +02:00
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
// FVTerm inline functions
|
2016-12-26 01:15:32 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-10-20 22:50:35 +02:00
|
|
|
template <typename type>
|
2016-12-26 01:15:32 +01:00
|
|
|
inline FVTerm& FVTerm::operator << (const type& s)
|
|
|
|
{
|
2017-08-06 17:02:19 +02:00
|
|
|
std::wostringstream outstream;
|
2016-12-26 01:15:32 +01:00
|
|
|
outstream << s;
|
2018-10-29 23:10:48 +01:00
|
|
|
|
|
|
|
if ( ! outstream.str().empty() )
|
|
|
|
print (outstream.str());
|
|
|
|
|
2016-12-26 01:15:32 +01:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2017-08-06 17:02:19 +02:00
|
|
|
//----------------------------------------------------------------------
|
2018-10-24 00:16:45 +02:00
|
|
|
inline FVTerm& FVTerm::operator << \
|
|
|
|
(const std::vector<FVTerm::charData>& termString)
|
2017-08-06 17:02:19 +02:00
|
|
|
{
|
|
|
|
print (termString);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const char* FVTerm::getClassName() const
|
|
|
|
{ return "FVTerm"; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline short FVTerm::getTermForegroundColor()
|
|
|
|
{ return next_attribute.fg_color; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline short FVTerm::getTermBackgroundColor()
|
|
|
|
{ return next_attribute.bg_color; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FVTerm::term_area* FVTerm::getVWin() const
|
|
|
|
{ return vwin; }
|
|
|
|
|
2017-07-12 01:16:57 +02:00
|
|
|
//----------------------------------------------------------------------
|
2018-06-25 00:14:53 +02:00
|
|
|
inline FVTerm::charData FVTerm::getAttribute()
|
2017-07-12 01:16:57 +02:00
|
|
|
{ return next_attribute; }
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline int FVTerm::getMaxColor()
|
|
|
|
{ return fterm->getMaxColor(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline int FVTerm::getTabstop()
|
|
|
|
{ return fterm->getTabstop(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline fc::encoding FVTerm::getEncoding()
|
|
|
|
{ return fterm->getEncoding(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline std::string FVTerm::getEncodingString()
|
|
|
|
{ return fterm->getEncodingString(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const FString FVTerm::getKeyName (int keynum)
|
|
|
|
{ return fterm->getKeyName(keynum); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FTerm& FVTerm::getFTerm()
|
|
|
|
{ return *fterm; }
|
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-05-20 15:15:42 +02:00
|
|
|
inline void FVTerm::hideCursor()
|
2016-11-02 00:37:58 +01:00
|
|
|
{ return hideCursor(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-05-20 15:15:42 +02:00
|
|
|
inline void FVTerm::showCursor()
|
2016-11-02 00:37:58 +01:00
|
|
|
{ return hideCursor(false); }
|
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::setPrintCursor (const FPoint& pos)
|
|
|
|
{ setPrintCursor (pos.getX(), pos.getY()); }
|
|
|
|
|
2016-10-13 02:16:51 +02:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline void FVTerm::setColor (short fg, short bg)
|
2016-10-13 02:16:51 +02:00
|
|
|
{
|
|
|
|
// Changes colors
|
|
|
|
next_attribute.fg_color = fg;
|
|
|
|
next_attribute.bg_color = bg;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::setNormal()
|
|
|
|
{
|
|
|
|
// reset all character attributes
|
2018-02-10 17:35:09 +01:00
|
|
|
next_attribute.attr.byte[0] = 0;
|
|
|
|
next_attribute.attr.byte[1] = 0;
|
|
|
|
next_attribute.attr.bit.no_changes = false;
|
2017-08-20 17:30:30 +02:00
|
|
|
next_attribute.fg_color = fc::Default;
|
|
|
|
next_attribute.bg_color = fc::Default;
|
2016-10-13 02:16:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setBold (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.bold = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setBold()
|
|
|
|
{ return setBold(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetBold()
|
|
|
|
{ return setBold(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setDim (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.dim = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setDim()
|
|
|
|
{ return setDim(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetDim()
|
|
|
|
{ return setDim(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setItalic (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.italic = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setItalic()
|
|
|
|
{ return setItalic(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetItalic()
|
|
|
|
{ return setItalic(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setUnderline (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.underline = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setUnderline()
|
|
|
|
{ return setUnderline(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetUnderline()
|
|
|
|
{ return setUnderline(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setBlink (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.blink = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setBlink()
|
|
|
|
{ return setBlink(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetBlink()
|
|
|
|
{ return setBlink(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setReverse (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.reverse = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setReverse()
|
|
|
|
{ return setReverse(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetReverse()
|
|
|
|
{ return setReverse(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setStandout (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.standout = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setStandout()
|
|
|
|
{ return setStandout(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetStandout()
|
|
|
|
{ return setStandout(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setInvisible (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.invisible = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setInvisible()
|
|
|
|
{ return setInvisible(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetInvisible()
|
|
|
|
{ return setInvisible(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setProtected (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.protect = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setProtected()
|
|
|
|
{ return setProtected(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetProtected()
|
|
|
|
{ return setProtected(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setCrossedOut (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.crossed_out = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setCrossedOut()
|
|
|
|
{ return setCrossedOut(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetCrossedOut()
|
|
|
|
{ return setCrossedOut(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setDoubleUnderline (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.dbl_underline = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setDoubleUnderline()
|
|
|
|
{ return setDoubleUnderline(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetDoubleUnderline()
|
|
|
|
{ return setDoubleUnderline(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setAltCharset (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.alt_charset = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setAltCharset()
|
|
|
|
{ return setAltCharset(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetAltCharset()
|
|
|
|
{ return setAltCharset(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setPCcharset (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.pc_charset = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setPCcharset()
|
|
|
|
{ return setPCcharset(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetPCcharset()
|
|
|
|
{ return setPCcharset(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setTransparent (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.transparent = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setTransparent()
|
|
|
|
{ return setTransparent(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetTransparent()
|
|
|
|
{ return setTransparent(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setTransShadow (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.trans_shadow = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setTransShadow()
|
|
|
|
{ return setTransShadow(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetTransShadow()
|
|
|
|
{ return setTransShadow(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-12 22:51:15 +02:00
|
|
|
inline bool FVTerm::setInheritBackground (bool on)
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return (next_attribute.attr.bit.inherit_bg = on); }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setInheritBackground()
|
|
|
|
{ return setInheritBackground(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetInheritBackground()
|
|
|
|
{ return setInheritBackground(false); }
|
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isBold()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.bold; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isDim()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.dim; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isItalic()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.italic; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isUnderline()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.underline; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isBlink()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.blink; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isReverse()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.reverse; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isStandout()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.standout; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isInvisible()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.invisible; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isProtected()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.protect; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isCrossedOut()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.crossed_out; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isDoubleUnderline()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.dbl_underline; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isAltCharset()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.alt_charset; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isPCcharset()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.pc_charset; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isTransparent()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.transparent; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isTransShadow()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.trans_shadow; }
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2016-10-13 02:16:51 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isInheritBackground()
|
2017-08-20 17:30:30 +02:00
|
|
|
{ return next_attribute.attr.bit.inherit_bg; }
|
2016-10-13 02:16:51 +02:00
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isMonochron()
|
|
|
|
{ return fterm->isMonochron(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isXTerminal()
|
|
|
|
{ return fterm->isXTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isAnsiTerminal()
|
|
|
|
{ return fterm->isAnsiTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isRxvtTerminal()
|
|
|
|
{ return fterm->isRxvtTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isUrxvtTerminal()
|
|
|
|
{ return fterm->isUrxvtTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isMltermTerminal()
|
|
|
|
{ return fterm->isMltermTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isPuttyTerminal()
|
|
|
|
{ return fterm->isPuttyTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isKdeTerminal()
|
|
|
|
{ return fterm->isKdeTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isGnomeTerminal()
|
|
|
|
{ return fterm->isGnomeTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isKtermTerminal()
|
|
|
|
{ return fterm->isKtermTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isTeraTerm()
|
|
|
|
{ return fterm->isTeraTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isSunTerminal()
|
|
|
|
{ return fterm->isSunTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isCygwinTerminal()
|
|
|
|
{ return fterm->isCygwinTerminal(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isMinttyTerm()
|
|
|
|
{ return fterm->isMinttyTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isLinuxTerm()
|
|
|
|
{ return fterm->isLinuxTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isFreeBSDTerm()
|
|
|
|
{ return fterm->isFreeBSDTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isNetBSDTerm()
|
|
|
|
{ return fterm->isNetBSDTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isOpenBSDTerm()
|
|
|
|
{ return fterm->isOpenBSDTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isScreenTerm()
|
|
|
|
{ return fterm->isScreenTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isTmuxTerm()
|
|
|
|
{ return fterm->isTmuxTerm(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isNewFont()
|
|
|
|
{ return fterm->isNewFont(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isCursorHideable()
|
|
|
|
{ return fterm->isCursorHideable(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasChangedTermSize()
|
|
|
|
{ return fterm->hasChangedTermSize(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasUTF8()
|
|
|
|
{ return fterm->hasUTF8(); }
|
|
|
|
|
2016-12-26 01:15:32 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FVTerm& FVTerm::print()
|
|
|
|
{ return *this; }
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::beep()
|
|
|
|
{ return fterm->beep(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline std::size_t FVTerm::getLineNumber()
|
|
|
|
{ return fterm->getLineNumber(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline std::size_t FVTerm::getColumnNumber()
|
|
|
|
{ return fterm->getColumnNumber(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::charEncodable (uInt c)
|
|
|
|
{ return fterm->charEncodable(c); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FKeyboard* FVTerm::getKeyboard()
|
|
|
|
{ return fterm->getKeyboard(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FMouseControl* FVTerm::getMouseControl()
|
|
|
|
{ return fterm->getMouseControl(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline FTerm::initializationValues& FVTerm::getInitValues()
|
|
|
|
{ return fterm->getInitValues(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::setInsertCursor (bool on)
|
|
|
|
{ return fterm->setInsertCursor(on); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::setInsertCursor()
|
|
|
|
{ return fterm->setInsertCursor(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::unsetInsertCursor()
|
|
|
|
{ return fterm->setInsertCursor(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setUTF8 (bool on)
|
|
|
|
{ return fterm->setUTF8(on); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::setUTF8()
|
|
|
|
{ return fterm->setUTF8(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::unsetUTF8()
|
|
|
|
{ return fterm->setUTF8(false); }
|
|
|
|
|
2017-01-22 23:04:40 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasPrintArea() const
|
|
|
|
{ return print_area; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasChildPrintArea() const
|
|
|
|
{ return child_print_area; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::isVirtualWindow() const
|
|
|
|
{ return vwin; }
|
|
|
|
|
2018-10-29 00:45:45 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasHalfBlockCharacter()
|
|
|
|
{ return fterm->hasHalfBlockCharacter(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FVTerm::hasShadowCharacter()
|
|
|
|
{ return fterm->hasShadowCharacter(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::initScreenSettings()
|
|
|
|
{ fterm->initScreenSettings(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::changeTermSizeFinished()
|
|
|
|
{ fterm->changeTermSizeFinished(); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::exitWithMessage (const FString& message)
|
|
|
|
{ fterm->exitWithMessage(message); }
|
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline void FVTerm::setPrintArea (term_area* area)
|
|
|
|
{ print_area = area; }
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
} // namespace finalcut
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#endif // FVTERM_H
|