Looser coupling between examples and FTerm

This commit is contained in:
Markus Gans 2018-10-30 01:13:32 +01:00
parent c1b304e429
commit 77ad698c45
4 changed files with 10 additions and 6 deletions

View File

@ -74,7 +74,7 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent)
, back_button("< &Back", this) , back_button("< &Back", this)
{ {
setText ( "A terminal attributes test (" setText ( "A terminal attributes test ("
+ finalcut::FString(getFTerm().getTermType()) + finalcut::FString(getTermType())
+ ")"); + ")");
next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1); next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1);

View File

@ -316,9 +316,8 @@ int main (int argc, char* argv[])
finalcut::FTermcap::tcap_map* tcap = 0; finalcut::FTermcap::tcap_map* tcap = 0;
tcap = finalcut::FTermcap::getTermcapMap(); tcap = finalcut::FTermcap::getTermcapMap();
finalcut::FTerm& fterm = TermApp.getFTerm();
std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; std::cout << "--------\r\nFTermcap\r\n--------\r\n\n";
std::cout << "Terminal: " << fterm.getTermType() << "\r\n"; std::cout << "Terminal: " << TermApp.getTermType() << "\r\n";
debug (TermApp); debug (TermApp);

View File

@ -836,8 +836,8 @@ void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr)
( (
"Environment" "Environment"
, finalcut::FString() , finalcut::FString()
<< " Type: " << getFTerm().getTermType() << "\n" << " Type: " << getTermType() << "\n"
<< " Name: " << getFTerm().getTermFileName() << "\n" << " Name: " << getTermFileName() << "\n"
<< " Mode: " << getEncodingString() << "\n" << " Mode: " << getEncodingString() << "\n"
<< " Size: " << x << wchar_t(finalcut::fc::Times) << " Size: " << x << wchar_t(finalcut::fc::Times)
<< y << "\n" << y << "\n"
@ -943,7 +943,7 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr)
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(widget); finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(widget);
finalcut::FString title; finalcut::FString title;
*lineedit >> title; *lineedit >> title;
getFTerm().setTermTitle (title); setTermTitle (title);
setText (title); setText (title);
redraw(); redraw();
} }

View File

@ -140,6 +140,7 @@ class FVTerm
static std::string getEncodingString(); static std::string getEncodingString();
static const FString getKeyName (int); static const FString getKeyName (int);
static char* getTermType(); static char* getTermType();
static char* getTermFileName();
FTerm& getFTerm(); FTerm& getFTerm();
// Mutators // Mutators
@ -635,6 +636,10 @@ inline const FString FVTerm::getKeyName (int keynum)
inline char* FVTerm::getTermType() inline char* FVTerm::getTermType()
{ return FTerm::getTermType(); } { return FTerm::getTermType(); }
//----------------------------------------------------------------------
inline char* FVTerm::getTermFileName()
{ return FTerm::getTermFileName(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FTerm& FVTerm::getFTerm() inline FTerm& FVTerm::getFTerm()
{ return *fterm; } { return *fterm; }