The entire library source code is now encapsulated under the namespace finalcut

This commit is contained in:
Markus Gans 2018-09-20 23:59:01 +02:00
parent 7b2257e538
commit b0039e78c4
148 changed files with 3040 additions and 2441 deletions

View File

@ -1,5 +1,8 @@
2018-09-20 Markus Gans <guru.mail@muenster.de>
* Added pkg-config file finalcut.pc
* The entire library source code is now encapsulated under
the namespace finalcut. All examples and tests have been
modified to fit the namespace.
2018-09-16 Markus Gans <guru.mail@muenster.de>
* Implement a ttytype test for the FTermDetection unit test

View File

@ -22,6 +22,9 @@
#include "final/fclassname.h"
namespace finalcut
{
// static class attributes
@ -49,3 +52,5 @@ FClassName::~FClassName() // destructor
// private methods of FClassName
//----------------------------------------------------------------------
} // namespace finalcut

View File

@ -37,6 +37,8 @@
//#include ...
namespace finalcut
{
//----------------------------------------------------------------------
// class FClassName
@ -124,6 +126,7 @@ class FClassName
// FClassName inline functions
//----------------------------------------------------------------------
} // namespace finalcut
#endif // FCLASSNAME_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2016-2017 Markus Gans *
* Copyright 2016-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -39,7 +39,7 @@ const lDouble PI = 3.141592653589793238L;
#pragma pack(push)
#pragma pack(1)
class Button : public FButton
class Button : public finalcut::FButton
{
public:
// Constructor
@ -49,7 +49,7 @@ class Button : public FButton
void setChecked(bool);
// Event handler
void onKeyPress (FKeyEvent*);
void onKeyPress (finalcut::FKeyEvent*);
private:
// Data Member
@ -58,8 +58,8 @@ class Button : public FButton
#pragma pack(pop)
//----------------------------------------------------------------------
Button::Button (FWidget* parent)
: FButton(parent)
Button::Button (finalcut::FWidget* parent)
: finalcut::FButton(parent)
, checked(false)
{ }
@ -73,9 +73,9 @@ void Button::setChecked (bool on)
if ( checked )
{
setBackgroundColor(fc::Cyan);
setFocusForegroundColor(fc::White);
setFocusBackgroundColor(fc::Cyan);
setBackgroundColor(finalcut::fc::Cyan);
setFocusForegroundColor(finalcut::fc::White);
setFocusBackgroundColor(finalcut::fc::Cyan);
}
else
{
@ -88,15 +88,16 @@ void Button::setChecked (bool on)
}
//----------------------------------------------------------------------
void Button::onKeyPress (FKeyEvent* ev)
void Button::onKeyPress (finalcut::FKeyEvent* ev)
{
int key = ev->key();
// catch the enter key
if ( key == fc::Fkey_return || key == fc::Fkey_enter )
if ( key == finalcut::fc::Fkey_return
|| key == finalcut::fc::Fkey_enter )
return;
FButton::onKeyPress(ev);
finalcut::FButton::onKeyPress(ev);
}
@ -107,22 +108,22 @@ void Button::onKeyPress (FKeyEvent* ev)
#pragma pack(push)
#pragma pack(1)
class Calc : public FDialog
class Calc : public finalcut::FDialog
{
public:
// Constructor
explicit Calc (FWidget* parent = 0);
explicit Calc (finalcut::FWidget* parent = 0);
// Destructor
~Calc();
// Event handlers
void onKeyPress (FKeyEvent*);
void onAccel (FAccelEvent*);
void onClose (FCloseEvent*);
void onKeyPress (finalcut::FKeyEvent*);
void onAccel (finalcut::FAccelEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback method
void cb_buttonClicked (FWidget*, data_ptr);
void cb_buttonClicked (finalcut::FWidget*, data_ptr);
private:
// Typedef and Enumeration
@ -219,14 +220,13 @@ class Calc : public FDialog
bool error;
bool arcus_mode;
bool hyperbolic_mode;
lDouble a, b;
lDouble infinity;
uInt max_char;
int last_key;
char infix_operator;
char last_infix_operator;
FString input;
finalcut::FString input;
int button_no[Calc::NUM_OF_BUTTONS];
struct stack_data
@ -243,7 +243,7 @@ class Calc : public FDialog
//----------------------------------------------------------------------
Calc::Calc (FWidget* parent)
: FDialog(parent)
: finalcut::FDialog(parent)
, error(false)
, arcus_mode(false)
, hyperbolic_mode(false)
@ -285,8 +285,8 @@ Calc::Calc (FWidget* parent)
btn->setFlat();
btn->setNoUnderline();
btn->setText(getButtonText(key));
btn->setDoubleFlatLine(fc::top);
btn->setDoubleFlatLine(fc::bottom);
btn->setDoubleFlatLine(finalcut::fc::top);
btn->setDoubleFlatLine(finalcut::fc::bottom);
if ( isNewFont() )
btn->unsetClickAnimation();
@ -301,7 +301,7 @@ Calc::Calc (FWidget* parent)
calculator_buttons[button(key)] = btn;
}
calculator_buttons[On]->addAccelerator(fc::Fkey_dc); // Del key
calculator_buttons[On]->addAccelerator(finalcut::fc::Fkey_dc); // Del key
calculator_buttons[On]->setFocus();
calculator_buttons[Pi]->addAccelerator('p');
calculator_buttons[Power]->addAccelerator('^');
@ -310,8 +310,8 @@ Calc::Calc (FWidget* parent)
calculator_buttons[Multiply]->addAccelerator('*');
calculator_buttons[Decimal_point]->addAccelerator(',');
calculator_buttons[Change_sign]->addAccelerator('#');
calculator_buttons[Equals]->addAccelerator(fc::Fkey_return);
calculator_buttons[Equals]->addAccelerator(fc::Fkey_enter);
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_return);
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_enter);
}
//----------------------------------------------------------------------
@ -322,7 +322,7 @@ Calc::~Calc()
//----------------------------------------------------------------------
void Calc::drawDispay()
{
FString display = input;
finalcut::FString display = input;
if ( display.isNull() || display.isEmpty() )
display = L'0';
@ -334,7 +334,7 @@ void Calc::drawDispay()
display = display.left(display.getLength() - 1);
if ( ! display.isEmpty() && display.getLength() < max_char )
display.insert(FString(max_char - display.getLength(), L' '), 0);
display.insert(finalcut::FString(max_char - display.getLength(), L' '), 0);
if ( display.getLength() > max_char )
display = display.left(max_char);
@ -345,7 +345,7 @@ void Calc::drawDispay()
if ( error )
display = " Error ";
setColor(fc::Black, fc::LightGray);
setColor(finalcut::fc::Black, finalcut::fc::LightGray);
if ( isMonochron() )
setReverse(false);
@ -360,27 +360,34 @@ void Calc::drawDispay()
if ( isNewFont() )
{
FString bottom_line (33, wchar_t(fc::NF_border_line_bottom));
wchar_t bottom_line = wchar_t(finalcut::fc::NF_border_line_bottom);
wchar_t top_bottom_line = wchar_t(finalcut::fc::NF_border_line_up_and_down);
wchar_t top_line = wchar_t(finalcut::fc::NF_border_line_upper);
wchar_t right_line = wchar_t(finalcut::fc::NF_rev_border_line_right);
wchar_t left_line = wchar_t(finalcut::fc::NF_border_line_left);
setPrintPos (3, 2);
print (bottom_line);
print (finalcut::FString(33, bottom_line));
setPrintPos (2, 3);
print (wchar_t(fc::NF_rev_border_line_right));
print (right_line);
setPrintPos (36, 3);
print (wchar_t(fc::NF_border_line_left));
FString top_bottom_line_5 (5, wchar_t(fc::NF_border_line_up_and_down));
FString top_line_2 (2, wchar_t(fc::NF_border_line_upper));
print (left_line);
setPrintPos (3, 4);
finalcut::FString top_bottom_line_5 (5, top_bottom_line);
finalcut::FString top_line_2 (2, top_line);
print ( top_bottom_line_5 + top_line_2
+ top_bottom_line_5 + top_line_2
+ top_bottom_line_5 + top_line_2
+ top_bottom_line_5 + top_line_2
+ top_bottom_line_5);
+ top_bottom_line_5 );
}
else
{
FString separator = FString(wchar_t(fc::BoxDrawingsVerticalAndRight))
+ FString(35, wchar_t(fc::BoxDrawingsHorizontal))
+ FString(wchar_t(fc::BoxDrawingsVerticalAndLeft));
wchar_t vertical_and_right = wchar_t(finalcut::fc::BoxDrawingsVerticalAndRight);
wchar_t horizontal = wchar_t(finalcut::fc::BoxDrawingsHorizontal);
wchar_t vertical_and_left = wchar_t(finalcut::fc::BoxDrawingsVerticalAndLeft);
finalcut::FString separator = finalcut::FString(vertical_and_right)
+ finalcut::FString(35, horizontal)
+ finalcut::FString(vertical_and_left);
setPrintPos (1, 4);
print(separator);
}
@ -848,10 +855,10 @@ void Calc::tangent (lDouble& x)
void Calc::draw()
{
setBold();
setColor (fc::Blue, fc::Cyan);
clearArea (vdesktop, fc::MediumShade);
setColor (finalcut::fc::Blue, finalcut::fc::Cyan);
clearArea (vdesktop, finalcut::fc::MediumShade);
unsetBold();
FDialog::draw();
finalcut::FDialog::draw();
drawDispay();
}
@ -998,15 +1005,15 @@ void Calc::calcInfixOperator()
}
//----------------------------------------------------------------------
void Calc::onKeyPress (FKeyEvent* ev)
void Calc::onKeyPress (finalcut::FKeyEvent* ev)
{
int len = int(input.getLength());
int key = ev->key();
switch ( key )
{
case fc::Fkey_erase:
case fc::Fkey_backspace:
case finalcut::fc::Fkey_erase:
case finalcut::fc::Fkey_backspace:
if ( len > 0 )
{
lDouble& x = getValue();
@ -1029,36 +1036,37 @@ void Calc::onKeyPress (FKeyEvent* ev)
ev->accept();
break;
case fc::Fkey_escape:
case fc::Fkey_escape_mintty:
case finalcut::fc::Fkey_escape:
case finalcut::fc::Fkey_escape_mintty:
{
FAccelEvent a_ev(fc::Accelerator_Event, getFocusWidget());
finalcut::FAccelEvent a_ev( finalcut::fc::Accelerator_Event
, getFocusWidget() );
calculator_buttons[On]->onAccel(&a_ev);
}
ev->accept();
break;
default:
FDialog::onKeyPress(ev);
finalcut::FDialog::onKeyPress(ev);
break;
}
}
//----------------------------------------------------------------------
void Calc::onAccel (FAccelEvent* ev)
void Calc::onAccel (finalcut::FAccelEvent* ev)
{
close();
ev->accept();
}
//----------------------------------------------------------------------
void Calc::onClose (FCloseEvent* ev)
void Calc::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void Calc::cb_buttonClicked (FWidget*, data_ptr data)
void Calc::cb_buttonClicked (finalcut::FWidget*, data_ptr data)
{
lDouble& x = getValue();
Calc::button key = *(static_cast<Calc::button*>(data));
@ -1096,7 +1104,7 @@ void Calc::adjustSize()
int ph = getParentWidget()->getHeight();
setX (1 + (pw - getWidth()) / 2, false);
setY (1 + (ph - getHeight()) / 2, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
@ -1189,7 +1197,7 @@ void Calc::mapKeyFunctions()
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a calculator object
Calc calculator(&app);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2017 Markus Gans *
* Copyright 2017-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -24,35 +24,36 @@
// function prototypes
void cb_quit (FWidget*, FWidget::data_ptr);
void populateChoice (std::vector<FRadioButton*>&, FButtonGroup*);
void preset (std::vector<FRadioButton*>&);
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
void populateChoice (std::vector<finalcut::FRadioButton*>&, finalcut::FButtonGroup*);
void preset (std::vector<finalcut::FRadioButton*>&);
//----------------------------------------------------------------------
// callback functions
//----------------------------------------------------------------------
void cb_quit (FWidget*, FWidget::data_ptr data)
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
{
FDialog* dlg = static_cast<FDialog*>(data);
finalcut::FDialog* dlg = static_cast<finalcut::FDialog*>(data);
dlg->close();
}
//----------------------------------------------------------------------
void populateChoice (std::vector<FRadioButton*>& os, FButtonGroup* group)
void populateChoice ( std::vector<finalcut::FRadioButton*>& os
, finalcut::FButtonGroup* group )
{
os[0] = new FRadioButton("AIX", group);
os[1] = new FRadioButton("Cygwin", group);
os[2] = new FRadioButton("FreeBSD", group);
os[3] = new FRadioButton("HP-UX", group);
os[4] = new FRadioButton("Linux", group);
os[5] = new FRadioButton("Mac OS X", group);
os[6] = new FRadioButton("NetBSD", group);
os[7] = new FRadioButton("OpenBSD", group);
os[8] = new FRadioButton("Solaris", group);
os[0] = new finalcut::FRadioButton("AIX", group);
os[1] = new finalcut::FRadioButton("Cygwin", group);
os[2] = new finalcut::FRadioButton("FreeBSD", group);
os[3] = new finalcut::FRadioButton("HP-UX", group);
os[4] = new finalcut::FRadioButton("Linux", group);
os[5] = new finalcut::FRadioButton("Mac OS X", group);
os[6] = new finalcut::FRadioButton("NetBSD", group);
os[7] = new finalcut::FRadioButton("OpenBSD", group);
os[8] = new finalcut::FRadioButton("Solaris", group);
}
//----------------------------------------------------------------------
void preset (std::vector<FRadioButton*>& os)
void preset (std::vector<finalcut::FRadioButton*>& os)
{
#if defined(_AIX)
os[0]->setChecked();
@ -90,13 +91,13 @@ void preset (std::vector<FRadioButton*>& os)
int main (int argc, char* argv[])
{
int x, y, w, h;
FString label_text = "no OS";
finalcut::FString label_text = "no OS";
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple modal dialog box
FDialog* dgl = new FDialog(&app);
finalcut::FDialog* dgl = new finalcut::FDialog(&app);
dgl->setModal();
dgl->setText ("UNIX select");
w = 20;
@ -106,11 +107,11 @@ int main (int argc, char* argv[])
dgl->setGeometry (x, y, w, h);
// Create a button group
FButtonGroup* checkButtonGroup = new FButtonGroup("choice", dgl);
finalcut::FButtonGroup* checkButtonGroup = new finalcut::FButtonGroup("choice", dgl);
checkButtonGroup->setGeometry (2, 1, 16, 7);
// Create radio buttons
std::vector<FRadioButton*> os (9);
std::vector<finalcut::FRadioButton*> os (9);
populateChoice (os, checkButtonGroup);
// Set the radio button geometry
@ -122,11 +123,11 @@ int main (int argc, char* argv[])
preset(os);
// Scroll to the focused child element
FFocusEvent cfi (fc::ChildFocusIn_Event);
FApplication::sendEvent(checkButtonGroup, &cfi);
finalcut::FFocusEvent cfi (finalcut::fc::ChildFocusIn_Event);
finalcut::FApplication::sendEvent(checkButtonGroup, &cfi);
// Create a OK button
FButton* ok = new FButton("&OK", dgl);
finalcut::FButton* ok = new finalcut::FButton("&OK", dgl);
ok->setGeometry (10, 9, 8, 1);
// Connect the button signal "clicked" with the callback function
@ -154,7 +155,7 @@ int main (int argc, char* argv[])
delete dgl;
// Create and show tooltip for two seconds
FToolTip* tooltip = new FToolTip(&app);
finalcut::FToolTip* tooltip = new finalcut::FToolTip(&app);
tooltip->setText ("You have chosen " + label_text);
tooltip->show();
sleep(2);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -23,15 +23,15 @@
#include <final/final.h>
// function prototype
void cb_quit (FWidget*, FWidget::data_ptr);
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
//----------------------------------------------------------------------
// callback function
//----------------------------------------------------------------------
void cb_quit (FWidget*, FWidget::data_ptr data)
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
{
FApplication* app = static_cast<FApplication*>(data);
finalcut::FApplication* app = static_cast<finalcut::FApplication*>(data);
app->quit();
}
@ -42,21 +42,21 @@ void cb_quit (FWidget*, FWidget::data_ptr data)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
FDialog dgl(&app);
finalcut::FDialog dgl(&app);
dgl.setText ("FDialog");
dgl.setGeometry (4, 3, 41, 11);
// Create text labels
FLabel label_1(&dgl);
FLabel label_2(&dgl);
finalcut::FLabel label_1(&dgl);
finalcut::FLabel label_2(&dgl);
label_1 << wchar_t(fc::BlackUpPointingTriangle)
label_1 << wchar_t(finalcut::fc::BlackUpPointingTriangle)
<< std::wstring(L"\n")
<< wchar_t(fc::BoxDrawingsUpAndRight)
<< FString(2, wchar_t(fc::BoxDrawingsHorizontal))
<< wchar_t(finalcut::fc::BoxDrawingsUpAndRight)
<< finalcut::FString(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal))
<< " Double click the title bar button,";
label_2 << "press Q on the keyboard,\n"
<< "or push the button below to exit\n"
@ -66,7 +66,7 @@ int main (int argc, char* argv[])
label_2.setGeometry (5, 3, 34, 3);
// Create the quit button
FButton btn("&Quit", &dgl);
finalcut::FButton btn("&Quit", &dgl);
btn.setGeometry (16, 7, 9, 1);
// Connect the button signal "clicked" with the callback function

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -26,10 +26,10 @@
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
FMessageBox mbox(&app);
finalcut::FMessageBox mbox(&app);
mbox.setText("Hello world");
// Start the application

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -24,22 +24,22 @@
// function prototypes
void cb_quit (FWidget*, FWidget::data_ptr);
void cb_publish (FWidget*, FWidget::data_ptr);
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
void cb_publish (finalcut::FWidget*, finalcut::FWidget::data_ptr);
//----------------------------------------------------------------------
// callback functions
//----------------------------------------------------------------------
void cb_quit (FWidget*, FWidget::data_ptr data)
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
{
FApplication* app = static_cast<FApplication*>(data);
finalcut::FApplication* app = static_cast<finalcut::FApplication*>(data);
app->quit();
}
void cb_publish (FWidget* widget, FWidget::data_ptr data)
void cb_publish (finalcut::FWidget* widget, finalcut::FWidget::data_ptr data)
{
FCheckBox* cbox1 = static_cast<FCheckBox*>(widget);
FCheckBox* cbox2 = static_cast<FCheckBox*>(data);
finalcut::FCheckBox* cbox1 = static_cast<finalcut::FCheckBox*>(widget);
finalcut::FCheckBox* cbox2 = static_cast<finalcut::FCheckBox*>(data);
if ( cbox1->isChecked() )
cbox2->setEnable();
@ -57,21 +57,21 @@ void cb_publish (FWidget* widget, FWidget::data_ptr data)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
FDialog dgl(&app);
finalcut::FDialog dgl(&app);
dgl.setText ("Data input");
dgl.setGeometry (4, 2, 37, 22);
dgl.setShadow();
// Create input fields
FLineEdit* name_field = new FLineEdit(&dgl);
FLineEdit* email_field = new FLineEdit(&dgl);
FLineEdit* org_field = new FLineEdit(&dgl);
FLineEdit* city_field = new FLineEdit(&dgl);
FLineEdit* st_field = new FLineEdit(&dgl);
FLineEdit* c_field = new FLineEdit(&dgl);
finalcut::FLineEdit* name_field = new finalcut::FLineEdit(&dgl);
finalcut::FLineEdit* email_field = new finalcut::FLineEdit(&dgl);
finalcut::FLineEdit* org_field = new finalcut::FLineEdit(&dgl);
finalcut::FLineEdit* city_field = new finalcut::FLineEdit(&dgl);
finalcut::FLineEdit* st_field = new finalcut::FLineEdit(&dgl);
finalcut::FLineEdit* c_field = new finalcut::FLineEdit(&dgl);
name_field->setLabelText(L"&Name");
email_field->setLabelText(L"&Email");
@ -88,28 +88,34 @@ int main (int argc, char* argv[])
c_field->setGeometry(15, 11, 4, 1);
// Create the button group
FButtonGroup* radioButtonGroup = new FButtonGroup("Sex", &dgl);
finalcut::FButtonGroup* radioButtonGroup = \
new finalcut::FButtonGroup("Sex", &dgl);
radioButtonGroup->setGeometry(2, 13, 13, 4);
// Create radio buttons
FRadioButton* male = new FRadioButton("&Male", radioButtonGroup);
FRadioButton* female = new FRadioButton("&Female", radioButtonGroup);
finalcut::FRadioButton* male = \
new finalcut::FRadioButton("&Male", radioButtonGroup);
finalcut::FRadioButton* female = \
new finalcut::FRadioButton("&Female", radioButtonGroup);
male->setGeometry(1, 1, 8, 1);
female->setGeometry(1, 2, 10, 1);
// Create another button group
FButtonGroup* checkButtonGroup = new FButtonGroup("&Data options", &dgl);
finalcut::FButtonGroup* checkButtonGroup = \
new finalcut::FButtonGroup("&Data options", &dgl);
checkButtonGroup->setGeometry(16, 13, 19, 4);
// Create checkbox buttons
FCheckBox* check1 = new FCheckBox("Save data", checkButtonGroup);
FCheckBox* check2 = new FCheckBox("Encrypt data", checkButtonGroup);
finalcut::FCheckBox* check1 = \
new finalcut::FCheckBox("Save data", checkButtonGroup);
finalcut::FCheckBox* check2 = \
new finalcut::FCheckBox("Encrypt data", checkButtonGroup);
check1->setGeometry(1, 1, 13, 1);
check2->setGeometry(1, 2, 16, 1);
check2->setDisable();
// Create a OK button
FButton btn("&OK", &dgl);
finalcut::FButton btn("&OK", &dgl);
btn.setGeometry (24, 18, 10, 1);
// Connect checkbox signal "clicked" with a callback function

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -26,30 +26,30 @@
// class Keyboard
//----------------------------------------------------------------------
class Keyboard : public FWidget
class Keyboard : public finalcut::FWidget
{
public:
// Constructor
explicit Keyboard (FWidget* = 0);
explicit Keyboard (finalcut::FWidget* = 0);
protected:
// Event handlers
void onKeyPress (FKeyEvent*);
void onAccel (FAccelEvent*);
void onKeyPress (finalcut::FKeyEvent*);
void onAccel (finalcut::FAccelEvent*);
void draw();
};
//----------------------------------------------------------------------
Keyboard::Keyboard (FWidget* parent)
: FWidget(parent)
Keyboard::Keyboard (finalcut::FWidget* parent)
: finalcut::FWidget(parent)
{
wc.term_fg = fc::Default;
wc.term_bg = fc::Default;
wc.term_fg = finalcut::fc::Default;
wc.term_bg = finalcut::fc::Default;
}
//----------------------------------------------------------------------
void Keyboard::onKeyPress (FKeyEvent* ev)
void Keyboard::onKeyPress (finalcut::FKeyEvent* ev)
{
int key_id = ev->key();
bool is_last_line = false;
@ -67,7 +67,7 @@ void Keyboard::onKeyPress (FKeyEvent* ev)
}
//----------------------------------------------------------------------
void Keyboard::onAccel (FAccelEvent* ev)
void Keyboard::onAccel (finalcut::FAccelEvent* ev)
{
quit();
ev->accept();
@ -89,9 +89,9 @@ void Keyboard::draw()
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
app.setForegroundColor(fc::Default);
app.setBackgroundColor(fc::Default);
finalcut::FApplication app(argc, argv);
app.setForegroundColor(finalcut::fc::Default);
app.setBackgroundColor(finalcut::fc::Default);
// Create a keyboard object
Keyboard key(&app);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2017 Markus Gans *
* Copyright 2017-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -29,31 +29,38 @@
// Global application object
static FString* temp_str = 0;
static finalcut::FString* temp_str = 0;
// Function prototypes
void doubleToItem (FListBoxItem&, FWidget::data_ptr container, int index);
FString& doubleToString (std::list<double>::const_iterator iter);
FString& mapToString (std::map<FString, FString>::const_iterator iter);
void doubleToItem ( finalcut::FListBoxItem&
, finalcut::FWidget::data_ptr container
, int index) ;
finalcut::FString& doubleToString (std::list<double>::const_iterator iter);
finalcut::FString& mapToString ( std::map<finalcut::FString
, finalcut::FString>::const_iterator iter );
// Lazy conversion import function
void doubleToItem (FListBoxItem& item, FWidget::data_ptr container, int index)
void doubleToItem ( finalcut::FListBoxItem& item
, finalcut::FWidget::data_ptr container, int index)
{
typedef std::list<double>* double_list_ptr;
double_list_ptr dbllist = static_cast<double_list_ptr>(container);
std::list<double>::iterator iter = dbllist->begin();
std::advance (iter, index);
item.setText (FString() << *iter);
item.setData (FWidget::data_ptr(&(*iter)));
item.setText (finalcut::FString() << *iter);
item.setData (finalcut::FWidget::data_ptr(&(*iter)));
}
// Import converter functions
FString& doubleToString (std::list<double>::const_iterator iter)
finalcut::FString& doubleToString (std::list<double>::const_iterator iter)
{
return temp_str->setNumber(*iter);
}
FString& mapToString (std::map<FString, FString>::const_iterator iter)
finalcut::FString& mapToString ( std::map<finalcut::FString
, finalcut::FString>::const_iterator iter )
{
return *temp_str = iter->first + ": " + iter->second;
}
@ -66,7 +73,7 @@ FString& mapToString (std::map<FString, FString>::const_iterator iter)
#pragma pack(push)
#pragma pack(1)
class Listbox : public FDialog
class Listbox : public finalcut::FDialog
{
public:
// Constructor
@ -81,7 +88,7 @@ class Listbox : public FDialog
Listbox& operator = (const Listbox&);
// Event handlers
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Data Member
std::list<double>* double_list;
@ -89,19 +96,19 @@ class Listbox : public FDialog
#pragma pack(pop)
//----------------------------------------------------------------------
Listbox::Listbox (FWidget* parent)
: FDialog(parent)
Listbox::Listbox (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, double_list()
{
temp_str = new FString;
temp_str = new finalcut::FString;
// listbox 1
FListBox* list1 = new FListBox (this);
finalcut::FListBox* list1 = new finalcut::FListBox (this);
list1->setGeometry(2, 1, 18, 10);
list1->setText ("FListBoxItem");
for (int i = 1; i < 30; i++)
list1->insert (L"----- " + (FString() << i) + L" -----");
list1->insert (L"----- " + (finalcut::FString() << i) + L" -----");
// listbox 2
double_list = new std::list<double>;
@ -109,7 +116,7 @@ Listbox::Listbox (FWidget* parent)
for (double i = 1; i<=15; i++)
double_list->push_back(2 * i + (i / 100));
FListBox* list2 = new FListBox (this);
finalcut::FListBox* list2 = new finalcut::FListBox (this);
list2->setGeometry(21, 1, 10, 10);
list2->setText ("double");
@ -124,20 +131,20 @@ Listbox::Listbox (FWidget* parent)
//list2->insert (double_list->begin(), double_list->end(), doubleToString);
// listbox 3
std::map<FString, FString> TLD;
std::map<finalcut::FString, finalcut::FString> TLD;
TLD["com"] = "Commercial";
TLD["org"] = "Organization";
TLD["net"] = "Network";
TLD["edu"] = "Education";
TLD["gov"] = "Government";
FListBox* list3;
list3 = new FListBox (TLD.begin(), TLD.end(), mapToString, this);
finalcut::FListBox* list3;
list3 = new finalcut::FListBox (TLD.begin(), TLD.end(), mapToString, this);
list3->setGeometry(32, 1, 21, 10);
list3->setText ("key: value");
// Quit button
FButton* Quit = new FButton (this);
finalcut::FButton* Quit = new finalcut::FButton (this);
Quit->setGeometry(42, 12, 10, 1);
Quit->setText (L"&Quit");
@ -145,7 +152,7 @@ Listbox::Listbox (FWidget* parent)
Quit->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
@ -157,9 +164,9 @@ Listbox::~Listbox() // destructor
}
//----------------------------------------------------------------------
void Listbox::onClose (FCloseEvent* ev)
void Listbox::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
@ -170,7 +177,7 @@ void Listbox::onClose (FCloseEvent* ev)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create main dialog object
Listbox d(&app);

View File

@ -35,11 +35,11 @@
#pragma pack(push)
#pragma pack(1)
class Listview : public FDialog
class Listview : public finalcut::FDialog
{
public:
// Constructor
explicit Listview (FWidget* = 0);
explicit Listview (finalcut::FWidget* = 0);
// Destructor
~Listview();
@ -50,22 +50,22 @@ class Listview : public FDialog
Listview& operator = (const Listview&);
// Method
void populate (FListView*);
void populate (finalcut::FListView*);
// Event handlers
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback method
void cb_showInMessagebox (FWidget*, data_ptr);
void cb_showInMessagebox (finalcut::FWidget*, data_ptr);
};
#pragma pack(pop)
//----------------------------------------------------------------------
Listview::Listview (FWidget* parent)
: FDialog(parent)
Listview::Listview (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
{
// Create FListView object
FListView* listView = new FListView (this);
finalcut::FListView* listView = new finalcut::FListView (this);
listView->setGeometry(2, 1, 33, 14);
// Add columns to the view
@ -76,15 +76,15 @@ Listview::Listview (FWidget* parent)
listView->addColumn ("Pressure", 10);
// Set right alignment for the third, fourth, and fifth column
listView->setColumnAlignment (3, fc::alignRight);
listView->setColumnAlignment (4, fc::alignRight);
listView->setColumnAlignment (5, fc::alignRight);
listView->setColumnAlignment (3, finalcut::fc::alignRight);
listView->setColumnAlignment (4, finalcut::fc::alignRight);
listView->setColumnAlignment (5, finalcut::fc::alignRight);
// Populate FListView with a list of items
populate (listView);
// Quit button
FButton* Quit = new FButton (this);
finalcut::FButton* Quit = new finalcut::FButton (this);
Quit->setGeometry(24, 16, 10, 1);
Quit->setText (L"&Quit");
@ -92,7 +92,7 @@ Listview::Listview (FWidget* parent)
Quit->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
listView->addCallback
@ -107,7 +107,7 @@ Listview::~Listview() // destructor
{ }
//----------------------------------------------------------------------
void Listview::populate (FListView* listView)
void Listview::populate (finalcut::FListView* listView)
{
std::string weather[][5] =
{
@ -158,31 +158,32 @@ void Listview::populate (FListView* listView)
for (int i = 0; i <= lastItem; i++)
{
FStringList line (&weather[i][0], &weather[i][0] + 5);
finalcut::FStringList line (&weather[i][0], &weather[i][0] + 5);
listView->insert (line);
}
}
//----------------------------------------------------------------------
void Listview::onClose (FCloseEvent* ev)
void Listview::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void Listview::cb_showInMessagebox (FWidget* widget, data_ptr)
void Listview::cb_showInMessagebox (finalcut::FWidget* widget, data_ptr)
{
FListView* listView = static_cast<FListView*>(widget);
FListViewItem* item = listView->getCurrentItem();
FMessageBox info ( "Weather in " + item->getText(1)
finalcut::FListView* listView = static_cast<finalcut::FListView*>(widget);
finalcut::FListViewItem* item = listView->getCurrentItem();
finalcut::FMessageBox info ( "Weather in " + item->getText(1)
, " Condition: " + item->getText(2) + "\n"
"Temperature: " + item->getText(3) + "\n"
" Humidity: " + item->getText(4) + "\n"
" Pressure: " + item->getText(5)
, FMessageBox::Ok, 0, 0, this );
, finalcut::FMessageBox::Ok, 0, 0, this );
info.show();
}
//----------------------------------------------------------------------
// main part
//----------------------------------------------------------------------
@ -190,7 +191,7 @@ void Listview::cb_showInMessagebox (FWidget* widget, data_ptr)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create main dialog object
Listview d(&app);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -30,18 +30,18 @@
#pragma pack(push)
#pragma pack(1)
class Mandelbrot : public FDialog
class Mandelbrot : public finalcut::FDialog
{
public:
// Constructor
explicit Mandelbrot (FWidget* = 0);
explicit Mandelbrot (finalcut::FWidget* = 0);
// Destructor
~Mandelbrot();
// Event handlers
void onAccel (FAccelEvent*);
void onClose (FCloseEvent*);
void onAccel (finalcut::FAccelEvent*);
void onClose (finalcut::FCloseEvent*);
private:
// Methods
@ -51,8 +51,8 @@ class Mandelbrot : public FDialog
#pragma pack(pop)
//----------------------------------------------------------------------
Mandelbrot::Mandelbrot (FWidget* parent)
: FDialog(parent)
Mandelbrot::Mandelbrot (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
{
setText ("Mandelbrot set");
}
@ -69,7 +69,7 @@ void Mandelbrot::draw()
double x, y, xtemp, x0, y0, dX, dY;
double x_min, x_max, y_min, y_max;
FDialog::draw();
finalcut::FDialog::draw();
x_min = -2.20;
x_max = 1.00;
@ -106,9 +106,9 @@ void Mandelbrot::draw()
}
if ( iter < max_iter )
setColor(fc::Black, iter % 16);
setColor(finalcut::fc::Black, iter % 16);
else
setColor(fc::Black, 0);
setColor(finalcut::fc::Black, 0);
print(' ');
}
@ -116,16 +116,16 @@ void Mandelbrot::draw()
}
//----------------------------------------------------------------------
void Mandelbrot::onAccel (FAccelEvent* ev)
void Mandelbrot::onAccel (finalcut::FAccelEvent* ev)
{
close();
ev->accept();
}
//----------------------------------------------------------------------
void Mandelbrot::onClose (FCloseEvent* ev)
void Mandelbrot::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
@ -134,7 +134,7 @@ void Mandelbrot::adjustSize()
int h = getParentWidget()->getHeight() - 1;
int w = getParentWidget()->getWidth() - 10;
setGeometry(6, 1, w, h, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
@ -143,7 +143,7 @@ void Mandelbrot::adjustSize()
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
Mandelbrot mb(&app);

View File

@ -30,11 +30,11 @@
#pragma pack(push)
#pragma pack(1)
class Menu : public FDialog
class Menu : public finalcut::FDialog
{
public:
// Constructor
explicit Menu (FWidget* = 0);
explicit Menu (finalcut::FWidget* = 0);
// Destructor
~Menu();
@ -47,42 +47,47 @@ class Menu : public FDialog
Menu& operator = (const Menu&);
// Methods
void createFileMenuItems (FMenu*);
void createEditMenuItems (FMenu*);
void createChoiceMenuItems (FMenu*);
void createColorMenuItems (FMenu*);
void createStyleMenuItems (FMenu*);
void createBorderMenuItems (FMenu*);
void createBorderColorMenuItems (FMenu*);
void createBorderStyleMenuItems (FMenu*);
void defaultCallback (FMenuList*);
void createFileMenuItems (finalcut::FMenu*);
void createEditMenuItems (finalcut::FMenu*);
void createChoiceMenuItems (finalcut::FMenu*);
void createColorMenuItems (finalcut::FMenu*);
void createStyleMenuItems (finalcut::FMenu*);
void createBorderMenuItems (finalcut::FMenu*);
void createBorderColorMenuItems (finalcut::FMenu*);
void createBorderStyleMenuItems (finalcut::FMenu*);
void defaultCallback (finalcut::FMenuList*);
void adjustSize();
// Event handler
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback method
void cb_message (FWidget*, data_ptr);
void cb_message (finalcut::FWidget*, data_ptr);
};
#pragma pack(pop)
//----------------------------------------------------------------------
Menu::Menu (FWidget* parent)
: FDialog(parent)
Menu::Menu (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
{
// Menu bar
FMenuBar* Menubar = new FMenuBar (this);
finalcut::FMenuBar* Menubar = new finalcut::FMenuBar(this);
// Menu bar items
FMenu* File = new FMenu ("&File", Menubar);
finalcut::FMenu* File = \
new finalcut::FMenu ("&File", Menubar);
File->setStatusbarMessage ("File management commands");
FMenu* Edit = new FMenu ("&Edit", Menubar);
finalcut::FMenu* Edit = \
new finalcut::FMenu ("&Edit", Menubar);
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
FMenu* Choice = new FMenu ("&Choice", Menubar);
finalcut::FMenu* Choice = \
new finalcut::FMenu ("&Choice", Menubar);
Choice->setStatusbarMessage ("Choice menu");
FMenuItem* Window = new FMenuItem ("&Window", Menubar);
finalcut::FMenuItem* Window = \
new finalcut::FMenuItem ("&Window", Menubar);
Window->setDisable();
FMenuItem* Help = new FMenuItem ("&Help", Menubar);
finalcut::FMenuItem* Help = \
new finalcut::FMenuItem ("&Help", Menubar);
Help->setStatusbarMessage ("Show version and copyright information");
// Menu items
@ -94,24 +99,28 @@ Menu::Menu (FWidget* parent)
defaultCallback (Menubar);
// Statusbar at the bottom
FStatusBar* Statusbar = new FStatusBar (this);
finalcut::FStatusBar* Statusbar = \
new finalcut::FStatusBar (this);
Statusbar->setMessage("Status bar message");
// Headline labels
FLabel* Headline1 = new FLabel(" Key ", this);
finalcut::FLabel* Headline1 = \
new finalcut::FLabel(" Key ", this);
Headline1->ignorePadding();
Headline1->setGeometry(3, 2, 5, 1);
Headline1->setEmphasis();
FLabel* Headline2 = new FLabel(" Function ", this);
finalcut::FLabel* Headline2 = \
new finalcut::FLabel(" Function ", this);
Headline2->ignorePadding();
Headline2->setGeometry(19, 2, 10, 1);
Headline2->setEmphasis();
// Info label
FLabel* Info = new FLabel("<F10> Activate menu bar\n"
finalcut::FLabel* Info = \
new finalcut::FLabel( "<F10> Activate menu bar\n"
"<Ctrl>+<Space> Activate menu bar\n"
"<Meta>+<X> Exit", this);
"<Meta>+<X> Exit", this );
Info->setGeometry(2, 1, 36, 3);
}
@ -120,80 +129,100 @@ Menu::~Menu()
{ }
//----------------------------------------------------------------------
void Menu::createFileMenuItems (FMenu* File)
void Menu::createFileMenuItems (finalcut::FMenu* File)
{
// "File" menu items
FMenuItem* New = new FMenuItem ("&New", File);
New->addAccelerator (fc::Fckey_n); // Ctrl + N
finalcut::FMenuItem* New = \
new finalcut::FMenuItem ("&New", File);
New->addAccelerator (finalcut::fc::Fckey_n); // Ctrl + N
New->setStatusbarMessage ("Create a new file");
FMenuItem* Open = new FMenuItem ("&Open...", File);
Open->addAccelerator (fc::Fckey_o); // Ctrl + O
finalcut::FMenuItem* Open = \
new finalcut::FMenuItem ("&Open...", File);
Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
Open->setStatusbarMessage ("Locate and open a text file");
FMenuItem* Save = new FMenuItem ("&Save", File);
Save->addAccelerator (fc::Fckey_s); // Ctrl + S
finalcut::FMenuItem* Save = \
new finalcut::FMenuItem ("&Save", File);
Save->addAccelerator (finalcut::fc::Fckey_s); // Ctrl + S
Save->setStatusbarMessage ("Save the file");
FMenuItem* SaveAs = new FMenuItem ("&Save as...", File);
finalcut::FMenuItem* SaveAs = \
new finalcut::FMenuItem ("&Save as...", File);
SaveAs->setStatusbarMessage ("Save the current file under a different name");
FMenuItem* Close = new FMenuItem ("&Close", File);
Close->addAccelerator (fc::Fckey_w); // Ctrl + W
finalcut::FMenuItem* Close = \
new finalcut::FMenuItem ("&Close", File);
Close->addAccelerator (finalcut::fc::Fckey_w); // Ctrl + W
Close->setStatusbarMessage ("Close the current file");
FMenuItem* Line1 = new FMenuItem (File);
finalcut::FMenuItem* Line1 = \
new finalcut::FMenuItem (File);
Line1->setSeparator();
FMenuItem* Print = new FMenuItem ("&Print", File);
Print->addAccelerator (fc::Fckey_p); // Ctrl + P
finalcut::FMenuItem* Print = \
new finalcut::FMenuItem ("&Print", File);
Print->addAccelerator (finalcut::fc::Fckey_p); // Ctrl + P
Print->setStatusbarMessage ("Print the current file");
FMenuItem* Line2 = new FMenuItem (File);
finalcut::FMenuItem* Line2 = \
new finalcut::FMenuItem (File);
Line2->setSeparator();
FMenuItem* Quit = new FMenuItem ("&Quit", File);
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
finalcut::FMenuItem* Quit = \
new finalcut::FMenuItem ("&Quit", File);
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit->setStatusbarMessage ("Exit the program");
// Add quit menu item callback
Quit->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
//----------------------------------------------------------------------
void Menu::createEditMenuItems (FMenu* Edit)
void Menu::createEditMenuItems (finalcut::FMenu* Edit)
{
// "Edit" menu items
FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "&Undo", Edit);
finalcut::FMenuItem* Undo = \
new finalcut::FMenuItem (finalcut::fc::Fckey_z, "&Undo", Edit);
Undo->setStatusbarMessage ("Undo the previous operation");
FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "&Redo", Edit);
finalcut::FMenuItem* Redo = \
new finalcut::FMenuItem (finalcut::fc::Fckey_y, "&Redo", Edit);
Redo->setDisable();
FMenuItem* Line3 = new FMenuItem (Edit);
finalcut::FMenuItem* Line3 = \
new finalcut::FMenuItem (Edit);
Line3->setSeparator();
FMenuItem* Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit);
finalcut::FMenuItem* Cut = \
new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit);
Cut->setStatusbarMessage ( "Remove the input text "
"and put it in the clipboard" );
FMenuItem* Copy = new FMenuItem (fc::Fckey_c, "&Copy", Edit);
finalcut::FMenuItem* Copy = \
new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit);
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
FMenuItem* Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit);
finalcut::FMenuItem* Paste = \
new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit);
Paste->setStatusbarMessage ("Insert text form clipboard");
FMenuItem* Line4 = new FMenuItem (Edit);
finalcut::FMenuItem* Line4 = \
new finalcut::FMenuItem (Edit);
Line4->setSeparator();
FMenuItem* Search = new FMenuItem (fc::Fckey_f, "&Search", Edit);
finalcut::FMenuItem* Search = \
new finalcut::FMenuItem (finalcut::fc::Fckey_f, "&Search", Edit);
Search->setStatusbarMessage ("Search for text");
FMenuItem* Next = new FMenuItem (fc::Fkey_f3, "Search &next", Edit);
finalcut::FMenuItem* Next = \
new finalcut::FMenuItem (finalcut::fc::Fkey_f3, "Search &next", Edit);
Next->setStatusbarMessage ("Repeat the last search command");
FMenuItem* Line5 = new FMenuItem (Edit);
finalcut::FMenuItem* Line5 = \
new finalcut::FMenuItem (Edit);
Line5->setSeparator();
FMenuItem* SelectAll = new FMenuItem (fc::Fckey_a, "Select &all", Edit);
finalcut::FMenuItem* SelectAll = \
new finalcut::FMenuItem (finalcut::fc::Fckey_a, "Select &all", Edit);
SelectAll->setStatusbarMessage ("Select the whole text");
}
//----------------------------------------------------------------------
void Menu::createChoiceMenuItems (FMenu* Choice)
void Menu::createChoiceMenuItems (finalcut::FMenu* Choice)
{
// "Choice" menu items
FMenu* Color = new FMenu ("&Color", Choice);
finalcut::FMenu* Color = new finalcut::FMenu ("&Color", Choice);
Color->setStatusbarMessage ("Choose a color");
FMenu* Style = new FMenu ("&Style", Choice);
finalcut::FMenu* Style = new finalcut::FMenu ("&Style", Choice);
Style->setStatusbarMessage ("Choose a Style");
FMenu* Border = new FMenu ("&Border", Choice);
finalcut::FMenu* Border = new finalcut::FMenu ("&Border", Choice);
Border->setStatusbarMessage ("Choose Border");
createColorMenuItems (Color);
@ -202,39 +231,46 @@ void Menu::createChoiceMenuItems (FMenu* Choice)
}
//----------------------------------------------------------------------
void Menu::createColorMenuItems (FMenu* Color)
void Menu::createColorMenuItems (finalcut::FMenu* Color)
{
// "Color" menu items
FRadioMenuItem* Color1 = new FRadioMenuItem ("Red", Color);
finalcut::FRadioMenuItem* Color1 = \
new finalcut::FRadioMenuItem ("Red", Color);
Color1->setStatusbarMessage ("Set text red");
FRadioMenuItem* Color2 = new FRadioMenuItem ("Green", Color);
finalcut::FRadioMenuItem* Color2 = \
new finalcut::FRadioMenuItem ("Green", Color);
Color2->setStatusbarMessage ("Set text green");
FRadioMenuItem* Color3 = new FRadioMenuItem ("Yellow", Color);
finalcut::FRadioMenuItem* Color3 = \
new finalcut::FRadioMenuItem ("Yellow", Color);
Color3->setStatusbarMessage ("Set text yellow");
FRadioMenuItem* Color4 = new FRadioMenuItem ("Brue", Color);
finalcut::FRadioMenuItem* Color4 = \
new finalcut::FRadioMenuItem ("Brue", Color);
Color4->setStatusbarMessage ("Set text brue");
FRadioMenuItem* Color5 = new FRadioMenuItem ("Black", Color);
finalcut::FRadioMenuItem* Color5 = \
new finalcut::FRadioMenuItem ("Black", Color);
Color5->setStatusbarMessage ("Set text black");
Color5->setChecked();
}
//----------------------------------------------------------------------
void Menu::createStyleMenuItems (FMenu* Style)
void Menu::createStyleMenuItems (finalcut::FMenu* Style)
{
// "Style" menu items
FCheckMenuItem* Bold = new FCheckMenuItem ("Bold", Style);
finalcut::FCheckMenuItem* Bold = \
new finalcut::FCheckMenuItem ("Bold", Style);
Bold->setStatusbarMessage ("Set text bold");
FCheckMenuItem* Italic = new FCheckMenuItem ("Italic", Style);
finalcut::FCheckMenuItem* Italic = \
new finalcut::FCheckMenuItem ("Italic", Style);
Italic->setStatusbarMessage ("Set text italic");
}
//----------------------------------------------------------------------
void Menu::createBorderMenuItems (FMenu* Border)
void Menu::createBorderMenuItems (finalcut::FMenu* Border)
{
// "Border" menu items
FMenu* BColor = new FMenu ("&Color", Border);
finalcut::FMenu* BColor = new finalcut::FMenu ("&Color", Border);
BColor->setStatusbarMessage ("Choose the border color");
FMenu* BStyle = new FMenu ("&Style", Border);
finalcut::FMenu* BStyle = new finalcut::FMenu ("&Style", Border);
BStyle->setStatusbarMessage ("Choose the border Style");
createBorderColorMenuItems (BColor);
@ -242,37 +278,43 @@ void Menu::createBorderMenuItems (FMenu* Border)
}
//----------------------------------------------------------------------
void Menu::createBorderColorMenuItems (FMenu* BColor)
void Menu::createBorderColorMenuItems (finalcut::FMenu* BColor)
{
// "BColor" menu items
FRadioMenuItem* BColor1 = new FRadioMenuItem ("Red", BColor);
finalcut::FRadioMenuItem* BColor1 = \
new finalcut::FRadioMenuItem ("Red", BColor);
BColor1->setStatusbarMessage ("Set red border");
FRadioMenuItem* BColor2 = new FRadioMenuItem ("Blue", BColor);
finalcut::FRadioMenuItem* BColor2 = \
new finalcut::FRadioMenuItem ("Blue", BColor);
BColor2->setStatusbarMessage ("Set blue border");
}
//----------------------------------------------------------------------
void Menu::createBorderStyleMenuItems (FMenu* BStyle)
void Menu::createBorderStyleMenuItems (finalcut::FMenu* BStyle)
{
// "BStyle" menu items
FString line(13, wchar_t(fc::BoxDrawingsHorizontal));
FRadioMenuItem* BStyle1 = new FRadioMenuItem (line, BStyle);
finalcut::FString line(13, wchar_t(finalcut::fc::BoxDrawingsHorizontal));
finalcut::FRadioMenuItem* BStyle1 = \
new finalcut::FRadioMenuItem (line, BStyle);
BStyle1->setChecked();
BStyle1->setStatusbarMessage ("Set border 1");
FRadioMenuItem* BStyle2 = new FRadioMenuItem ("-------------", BStyle);
finalcut::FRadioMenuItem* BStyle2 = \
new finalcut::FRadioMenuItem ("-------------", BStyle);
BStyle2->setStatusbarMessage ("Set border 2");
FRadioMenuItem* BStyle3 = new FRadioMenuItem ("- - - - - - -", BStyle);
finalcut::FRadioMenuItem* BStyle3 = \
new finalcut::FRadioMenuItem ("- - - - - - -", BStyle);
BStyle3->setStatusbarMessage ("Set border 3");
FRadioMenuItem* BStyle4 = new FRadioMenuItem ("- - - - -", BStyle);
finalcut::FRadioMenuItem* BStyle4 = \
new finalcut::FRadioMenuItem ("- - - - -", BStyle);
BStyle4->setStatusbarMessage ("Set border 4");
}
//----------------------------------------------------------------------
void Menu::defaultCallback (FMenuList* mb)
void Menu::defaultCallback (finalcut::FMenuList* mb)
{
for (uInt i = 1; i <= mb->getCount(); i++)
{
FMenuItem* item = mb->getItem(int(i));
finalcut::FMenuItem* item = mb->getItem(int(i));
if ( item
&& item->isEnabled()
@ -302,22 +344,25 @@ void Menu::adjustSize()
int ph = getParentWidget()->getHeight();
setX (1 + (pw - getWidth()) / 2, false);
setY (1 + (ph - getHeight()) / 4, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
void Menu::onClose (FCloseEvent* ev)
void Menu::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void Menu::cb_message (FWidget* widget, data_ptr)
void Menu::cb_message (finalcut::FWidget* widget, data_ptr)
{
FMenuItem* menuitem = static_cast<FMenuItem*>(widget);
FString text = menuitem->getText();
finalcut::FMenuItem* menuitem = \
static_cast<finalcut::FMenuItem*>(widget);
finalcut::FString text = menuitem->getText();
text = text.replace('&', "");
FMessageBox::info (this, "Info", "You have chosen \"" + text + "\"");
finalcut::FMessageBox::info ( this
, "Info"
, "You have chosen \"" + text + "\"" );
}
@ -328,7 +373,7 @@ void Menu::cb_message (FWidget* widget, data_ptr)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app (argc, argv);
finalcut::FApplication app (argc, argv);
// Create main dialog object
Menu main_dlg (&app);

View File

@ -30,11 +30,11 @@
#pragma pack(push)
#pragma pack(1)
class ColorChooser : public FWidget
class ColorChooser : public finalcut::FWidget
{
public:
// Constructor
explicit ColorChooser (FWidget* = 0);
explicit ColorChooser (finalcut::FWidget* = 0);
// Destructor
~ColorChooser();
@ -53,7 +53,7 @@ class ColorChooser : public FWidget
void draw();
// Event handler
void onMouseDown (FMouseEvent*);
void onMouseDown (finalcut::FMouseEvent*);
// Data Members
short fg_color;
@ -62,10 +62,10 @@ class ColorChooser : public FWidget
#pragma pack(pop)
//----------------------------------------------------------------------
ColorChooser::ColorChooser (FWidget* parent)
ColorChooser::ColorChooser (finalcut::FWidget* parent)
: FWidget(parent)
, fg_color(fc::White)
, bg_color(fc::Black)
, fg_color(finalcut::fc::White)
, bg_color(finalcut::fc::Black)
{
setSize (8, 12);
setFixedSize (8, 12);
@ -78,10 +78,10 @@ ColorChooser::ColorChooser (FWidget* parent)
}
// Text label
FLabel* headline = new FLabel (this);
finalcut::FLabel* headline = new finalcut::FLabel (this);
headline->setGeometry(1, 1, 8, 1);
headline->setEmphasis();
headline->setAlignment (fc::alignCenter);
headline->setAlignment (finalcut::fc::alignCenter);
*headline << "Color";
}
@ -90,12 +90,12 @@ ColorChooser::~ColorChooser()
{ }
//----------------------------------------------------------------------
void ColorChooser::onMouseDown (FMouseEvent* ev)
void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
{
int mouse_x = ev->getX();
int mouse_y = ev->getY();
if ( ev->getButton() == fc::MiddleButton )
if ( ev->getButton() == finalcut::fc::MiddleButton )
return;
for (int c = 0; c < 16; c++)
@ -106,9 +106,9 @@ void ColorChooser::onMouseDown (FMouseEvent* ev)
if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y )
{
if ( ev->getButton() == fc::LeftButton )
if ( ev->getButton() == finalcut::fc::LeftButton )
bg_color = short(c);
else if ( ev->getButton() == fc::RightButton )
else if ( ev->getButton() == finalcut::fc::RightButton )
fg_color = short(c);
redraw();
@ -121,23 +121,23 @@ void ColorChooser::onMouseDown (FMouseEvent* ev)
void ColorChooser::draw()
{
setColor();
FWidget::drawBorder (1, 2, 8, 11);
finalcut::FWidget::drawBorder (1, 2, 8, 11);
for (short c = 0; c < 16; c++)
{
setPrintPos (2 + (c / 8) * 3, 3 + c % 8);
if ( c < 6 )
setColor (fc::LightGray, c);
setColor (finalcut::fc::LightGray, c);
else if ( c > 8 )
setColor (fc::DarkGray, c);
setColor (finalcut::fc::DarkGray, c);
else
setColor (fc::White, c);
setColor (finalcut::fc::White, c);
if ( c == bg_color )
{
print (' ');
print (fc::Times);
print (finalcut::fc::Times);
print (' ');
}
else
@ -165,11 +165,11 @@ inline short ColorChooser::getBackground()
#pragma pack(push)
#pragma pack(1)
class Brushes : public FWidget
class Brushes : public finalcut::FWidget
{
public:
// Constructor
explicit Brushes (FWidget* = 0);
explicit Brushes (finalcut::FWidget* = 0);
// Destructor
~Brushes();
@ -191,7 +191,7 @@ class Brushes : public FWidget
void draw();
// Event handler
void onMouseDown (FMouseEvent*);
void onMouseDown (finalcut::FMouseEvent*);
// Data Members
wchar_t brush;
@ -201,11 +201,11 @@ class Brushes : public FWidget
#pragma pack(pop)
//----------------------------------------------------------------------
Brushes::Brushes (FWidget* parent)
Brushes::Brushes (finalcut::FWidget* parent)
: FWidget(parent)
, brush(L' ')
, fg_color(fc::White)
, bg_color(fc::Black)
, fg_color(finalcut::fc::White)
, bg_color(finalcut::fc::Black)
{
setSize (8, 4);
setFixedSize (8, 4);
@ -218,10 +218,10 @@ Brushes::Brushes (FWidget* parent)
}
// Text label
FLabel* headline = new FLabel (this);
finalcut::FLabel* headline = new finalcut::FLabel (this);
headline->setGeometry(1, 1, 8, 1);
headline->setEmphasis();
headline->setAlignment (fc::alignCenter);
headline->setAlignment (finalcut::fc::alignCenter);
*headline << "Brush";
}
@ -235,11 +235,11 @@ void Brushes::draw()
{
int pos;
setColor();
FWidget::drawBorder (1, 2, 8, 4);
finalcut::FWidget::drawBorder (1, 2, 8, 4);
setColor (fg_color, bg_color);
setPrintPos (2, 3);
print(" ");
print(FString(3, wchar_t(fc::MediumShade)));
print(finalcut::FString(3, wchar_t(finalcut::fc::MediumShade)));
if ( brush == L' ' )
pos = 0;
@ -248,18 +248,18 @@ void Brushes::draw()
setColor();
setPrintPos (3 + pos, 2);
print(wchar_t(fc::BlackDownPointingTriangle));
print(wchar_t(finalcut::fc::BlackDownPointingTriangle));
setPrintPos (3 + pos, 4);
print(wchar_t(fc::BlackUpPointingTriangle));
print(wchar_t(finalcut::fc::BlackUpPointingTriangle));
}
//----------------------------------------------------------------------
void Brushes::onMouseDown (FMouseEvent* ev)
void Brushes::onMouseDown (finalcut::FMouseEvent* ev)
{
int mouse_x = ev->getX();
int mouse_y = ev->getY();
if ( ev->getButton() != fc::LeftButton )
if ( ev->getButton() != finalcut::fc::LeftButton )
return;
if ( mouse_x >= 2 && mouse_x <= 4 && mouse_y == 3 )
@ -269,7 +269,7 @@ void Brushes::onMouseDown (FMouseEvent* ev)
}
else if ( mouse_x >= 5 && mouse_x <= 7 && mouse_y == 3 )
{
brush = wchar_t(fc::MediumShade);
brush = wchar_t(finalcut::fc::MediumShade);
redraw();
}
}
@ -300,14 +300,14 @@ inline void Brushes::setBackground (short color)
#pragma pack(push)
#pragma pack(1)
class MouseDraw : public FDialog
class MouseDraw : public finalcut::FDialog
{
public:
// Using-declaration
using FWidget::setGeometry;
// Constructor
explicit MouseDraw (FWidget* = 0);
explicit MouseDraw (finalcut::FWidget* = 0);
// Destructor
~MouseDraw();
@ -316,8 +316,8 @@ class MouseDraw : public FDialog
void setGeometry (int, int, int, int, bool = true);
// Event handlers
void onAccel (FAccelEvent*);
void onClose (FCloseEvent*);
void onAccel (finalcut::FAccelEvent*);
void onClose (finalcut::FCloseEvent*);
private:
// Disable copy constructor
@ -332,11 +332,11 @@ class MouseDraw : public FDialog
void adjustSize();
// Event handler
void onMouseDown (FMouseEvent*);
void onMouseMove (FMouseEvent*);
void onMouseDown (finalcut::FMouseEvent*);
void onMouseMove (finalcut::FMouseEvent*);
// Callback methods
void cb_colorChanged (FWidget*, data_ptr);
void cb_colorChanged (finalcut::FWidget*, data_ptr);
// Data Members
term_area* canvas;
@ -346,8 +346,8 @@ class MouseDraw : public FDialog
#pragma pack(pop)
//----------------------------------------------------------------------
MouseDraw::MouseDraw (FWidget* parent)
: FDialog(parent)
MouseDraw::MouseDraw (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, canvas(0)
, c_chooser()
, brush()
@ -364,8 +364,8 @@ MouseDraw::MouseDraw (FWidget* parent)
brush = new Brushes(this);
brush->setPos (1, 12);
FPoint no_shadow(0,0);
FRect scroll_geometry(0, 0, 1, 1);
finalcut::FPoint no_shadow(0,0);
finalcut::FRect scroll_geometry(0, 0, 1, 1);
createArea (scroll_geometry, no_shadow, canvas);
}
@ -377,10 +377,10 @@ MouseDraw::~MouseDraw()
void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust)
{
int old_w, old_h;
FDialog::setGeometry (x, y, w, h, adjust);
finalcut::FDialog::setGeometry (x, y, w, h, adjust);
FPoint no_shadow(0,0);
FRect scroll_geometry (0, 0, w - 11, h - 3);
finalcut::FPoint no_shadow(0,0);
finalcut::FRect scroll_geometry (0, 0, w - 11, h - 3);
old_w = canvas->width;
old_h = canvas->height;
resizeArea (scroll_geometry, no_shadow, canvas);
@ -393,23 +393,23 @@ void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust)
}
//----------------------------------------------------------------------
void MouseDraw::onAccel (FAccelEvent* ev)
void MouseDraw::onAccel (finalcut::FAccelEvent* ev)
{
close();
ev->accept();
}
//----------------------------------------------------------------------
void MouseDraw::onClose (FCloseEvent* ev)
void MouseDraw::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void MouseDraw::draw()
{
int y_max = getHeight();
FDialog::draw();
finalcut::FDialog::draw();
setColor();
if ( isNewFont() )
@ -417,25 +417,25 @@ void MouseDraw::draw()
for (int y = 2; y < y_max; y++)
{
setPrintPos (10, y);
print (wchar_t(fc::NF_rev_border_line_right));
print (wchar_t(finalcut::fc::NF_rev_border_line_right));
}
setPrintPos (10, y_max);
print (wchar_t(fc::NF_rev_border_corner_lower_right));
print (wchar_t(finalcut::fc::NF_rev_border_corner_lower_right));
}
else
{
setPrintPos (10, 2);
print (wchar_t(fc::BoxDrawingsDownAndHorizontal));
print (wchar_t(finalcut::fc::BoxDrawingsDownAndHorizontal));
for (int y = 3; y < y_max; y++)
{
setPrintPos (10, y);
print (wchar_t(fc::BoxDrawingsVertical));
print (wchar_t(finalcut::fc::BoxDrawingsVertical));
}
setPrintPos (10, y_max);
print (wchar_t(fc::BoxDrawingsUpAndHorizontal));
print (wchar_t(finalcut::fc::BoxDrawingsUpAndHorizontal));
}
drawCanvas();
@ -468,7 +468,7 @@ void MouseDraw::drawBrush (int x, int y, bool swap_color)
void MouseDraw::drawCanvas()
{
if ( ! hasPrintArea() )
FVTerm::getPrintArea();
finalcut::FVTerm::getPrintArea();
if ( ! (hasPrintArea() && canvas) )
return;
@ -505,35 +505,39 @@ void MouseDraw::adjustSize()
, x = 1 + (getParentWidget()->getWidth() - w) / 2
, y = 1 + (getParentWidget()->getHeight() - h) / 2;
setGeometry (x, y, w, h, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
void MouseDraw::onMouseDown (FMouseEvent* ev)
void MouseDraw::onMouseDown (finalcut::FMouseEvent* ev)
{
FDialog::onMouseDown(ev);
finalcut::FDialog::onMouseDown(ev);
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
if ( ev->getButton() != finalcut::fc::LeftButton
&& ev->getButton() != finalcut::fc::RightButton )
return;
drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton);
drawBrush ( ev->getX()
, ev->getY()
, ev->getButton() == finalcut::fc::RightButton );
}
//----------------------------------------------------------------------
void MouseDraw::onMouseMove (FMouseEvent* ev)
void MouseDraw::onMouseMove (finalcut::FMouseEvent* ev)
{
FDialog::onMouseMove(ev);
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
if ( ev->getButton() != finalcut::fc::LeftButton
&& ev->getButton() != finalcut::fc::RightButton )
return;
drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton);
drawBrush ( ev->getX()
, ev->getY()
, ev->getButton() == finalcut::fc::RightButton);
}
//----------------------------------------------------------------------
void MouseDraw::cb_colorChanged (FWidget*, data_ptr)
void MouseDraw::cb_colorChanged (finalcut::FWidget*, data_ptr)
{
brush->setForeground (c_chooser->getForeground());
brush->setBackground (c_chooser->getBackground());
@ -547,7 +551,7 @@ void MouseDraw::cb_colorChanged (FWidget*, data_ptr)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
MouseDraw mouse_draw(&app);

View File

@ -27,10 +27,10 @@
// Global FVTerm object
static FVTerm* terminal;
static finalcut::FVTerm* terminal;
// Global FApplication object
static FApplication* app;
static finalcut::FApplication* app;
// function prototype
bool keyPressed();
@ -145,16 +145,16 @@ int main (int argc, char* argv[])
int xmax, ymax;
// Create the application object
FApplication TermApp(argc, argv);
finalcut::FApplication TermApp(argc, argv);
// Pointer to the global virtual terminal object
terminal = static_cast<FVTerm*>(&TermApp);
terminal = static_cast<finalcut::FVTerm*>(&TermApp);
app = &TermApp;
// Get screen dimension
xmax = TermApp.getDesktopWidth() - 1;
ymax = TermApp.getDesktopHeight() - 1;
FString line(xmax + 1, '-');
finalcut::FString line(xmax + 1, '-');
// Place the cursor in the upper left corner
TermApp.setTermXY(0,0);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2017 Markus Gans *
* Copyright 2017-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -30,11 +30,11 @@
#pragma pack(push)
#pragma pack(1)
class Scrollview : public FScrollView
class Scrollview : public finalcut::FScrollView
{
public:
// Constructor
explicit Scrollview (FWidget* = 0);
explicit Scrollview (finalcut::FWidget* = 0);
// Destructor
~Scrollview ();
@ -52,38 +52,42 @@ class Scrollview : public FScrollView
void draw();
// Callback methods
void cb_go_east (FWidget*, data_ptr);
void cb_go_south (FWidget*, data_ptr);
void cb_go_west (FWidget*, data_ptr);
void cb_go_north (FWidget*, data_ptr);
void cb_go_east (finalcut::FWidget*, data_ptr);
void cb_go_south (finalcut::FWidget*, data_ptr);
void cb_go_west (finalcut::FWidget*, data_ptr);
void cb_go_north (finalcut::FWidget*, data_ptr);
// Data Members
FButton* go_east;
FButton* go_south;
FButton* go_west;
FButton* go_north;
finalcut::FButton* go_east;
finalcut::FButton* go_south;
finalcut::FButton* go_west;
finalcut::FButton* go_north;
};
#pragma pack(pop)
//----------------------------------------------------------------------
Scrollview::Scrollview (FWidget* parent)
: FScrollView(parent)
Scrollview::Scrollview (finalcut::FWidget* parent)
: finalcut::FScrollView(parent)
, go_east()
, go_south()
, go_west()
, go_north()
{
// Create the four navigation buttons
go_east = new FButton(wchar_t(fc::BlackRightPointingPointer), this);
wchar_t pointer_right = wchar_t(finalcut::fc::BlackRightPointingPointer);
go_east = new finalcut::FButton(pointer_right, this);
go_east->setGeometry (1, 1, 5, 1);
go_south = new FButton(wchar_t(fc::BlackDownPointingTriangle), this);
wchar_t pointer_down = wchar_t(finalcut::fc::BlackDownPointingTriangle);
go_south = new finalcut::FButton(pointer_down, this);
go_south->setGeometry (getScrollWidth() - 5, 1, 5, 1);
go_west = new FButton(wchar_t(fc::BlackLeftPointingPointer), this);
wchar_t pointer_left = wchar_t(finalcut::fc::BlackLeftPointingPointer);
go_west = new finalcut::FButton(pointer_left, this);
go_west->setGeometry (getScrollWidth() - 5, getScrollHeight() - 2, 5, 1);
go_north = new FButton(wchar_t(fc::BlackUpPointingTriangle), this);
wchar_t pointer_up = wchar_t(finalcut::fc::BlackUpPointingTriangle);
go_north = new finalcut::FButton(pointer_up, this);
go_north->setGeometry (1, getScrollHeight() - 2, 5, 1);
// Add scroll function callbacks to the buttons
@ -149,7 +153,7 @@ void Scrollview::draw()
}
//----------------------------------------------------------------------
void Scrollview::cb_go_east (FWidget*, data_ptr)
void Scrollview::cb_go_east (finalcut::FWidget*, data_ptr)
{
scrollToX (getScrollWidth() - getViewportWidth() + 1);
go_south->setFocus();
@ -158,7 +162,7 @@ void Scrollview::cb_go_east (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Scrollview::cb_go_south (FWidget*, data_ptr)
void Scrollview::cb_go_south (finalcut::FWidget*, data_ptr)
{
scrollToY (getScrollHeight() - getViewportHeight() + 1);
go_west->setFocus();
@ -167,7 +171,7 @@ void Scrollview::cb_go_south (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Scrollview::cb_go_west (FWidget*, data_ptr)
void Scrollview::cb_go_west (finalcut::FWidget*, data_ptr)
{
scrollToX (1);
go_north->setFocus();
@ -176,7 +180,7 @@ void Scrollview::cb_go_west (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Scrollview::cb_go_north (FWidget*, data_ptr)
void Scrollview::cb_go_north (finalcut::FWidget*, data_ptr)
{
scrollToY (1);
go_east->setFocus();
@ -192,27 +196,27 @@ void Scrollview::cb_go_north (FWidget*, data_ptr)
#pragma pack(push)
#pragma pack(1)
class Scrollviewdemo : public FDialog
class Scrollviewdemo : public finalcut::FDialog
{
public:
// Constructor
explicit Scrollviewdemo (FWidget* = 0);
explicit Scrollviewdemo (finalcut::FWidget* = 0);
// Destructor
~Scrollviewdemo();
// Event handler
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback method
void cb_quit (FWidget* = 0, data_ptr = 0);
void cb_quit (finalcut::FWidget* = 0, data_ptr = 0);
};
#pragma pack(pop)
//----------------------------------------------------------------------
Scrollviewdemo::Scrollviewdemo (FWidget* parent)
: FDialog(parent)
Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
{
setGeometry (16, 3, 50, 19);
setText ("Scrolling viewport example");
@ -223,7 +227,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent)
sview->setScrollSize(188, 124);
// Quit button
FButton* button = new FButton("&Quit", this);
finalcut::FButton* button = new finalcut::FButton("&Quit", this);
button->setGeometry(37, 15, 10, 1);
// Add function callback
@ -234,7 +238,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent)
);
// Text label
FLabel* label = new FLabel (this);
finalcut::FLabel* label = new finalcut::FLabel (this);
label->setGeometry(2, 1, 46, 1);
label->setEmphasis();
*label << L"Use scrollbars to change the viewport position";
@ -245,15 +249,15 @@ Scrollviewdemo::~Scrollviewdemo()
{ }
//----------------------------------------------------------------------
void Scrollviewdemo::cb_quit (FWidget*, data_ptr)
void Scrollviewdemo::cb_quit (finalcut::FWidget*, data_ptr)
{
close();
}
//----------------------------------------------------------------------
void Scrollviewdemo::onClose (FCloseEvent* ev)
void Scrollviewdemo::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
@ -263,7 +267,7 @@ void Scrollviewdemo::onClose (FCloseEvent* ev)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
Scrollviewdemo svdemo(&app);

View File

@ -91,7 +91,7 @@ void init()
void inputStreamExample()
{
// Test: input stream (operator >>)
FString in;
finalcut::FString in;
std::cout << " Input: ";
std::cin >> in;
std::cout << " instream >> " << in << std::endl;
@ -101,7 +101,7 @@ void inputStreamExample()
void outputStreamExample()
{
// Test: output stream (operator <<)
const FString& out = L"A test string for 0 \x20ac";
const finalcut::FString& out = L"A test string for 0 \x20ac";
std::cout << " outstream << " << out << std::endl;
}
@ -111,62 +111,62 @@ void streamingIntoFStringExample()
// Test: Streaming into a FString (operator <<)...
// ...from FStrings
FString streamer1;
streamer1 << FString("FStr") << FString("ing");
finalcut::FString streamer1;
streamer1 << finalcut::FString("FStr") << finalcut::FString("ing");
std::cout << " stream in: " << streamer1 << std::endl;
// ...from c++ wide string
FString streamer2;
finalcut::FString streamer2;
streamer2 << std::wstring(L"std::wstring");
std::cout << " stream in: " << streamer2 << std::endl;
// ...from wide string
FString streamer3;
finalcut::FString streamer3;
streamer3 << const_cast<wchar_t*>(L"wchar_t*");
std::cout << " stream in: " << streamer3 << std::endl;
// ...from c++ string
FString streamer4;
finalcut::FString streamer4;
streamer4 << std::string("std::string");
std::cout << " stream in: " << streamer4 << std::endl;
// ...from c-string
FString streamer5;
finalcut::FString streamer5;
streamer5 << const_cast<char*>("char*");
std::cout << " stream in: " << streamer5 << std::endl;
// ...from wide character
FString streamer6;
finalcut::FString streamer6;
streamer6 << wchar_t(L'w');
std::cout << " stream in: " << streamer6 << std::endl;
// ...from character
FString streamer7;
finalcut::FString streamer7;
streamer7 << char('c');
std::cout << " stream in: " << streamer7 << std::endl;
// ...from interger
FString streamer8;
finalcut::FString streamer8;
streamer8 << int(-12345);
std::cout << " stream in: " << streamer8 << std::endl;
// ...from unsigned interger
FString streamer9;
finalcut::FString streamer9;
streamer9 << uInt(54321);
std::cout << " stream in: " << streamer9 << std::endl;
// ...from long double
FString streamer10;
finalcut::FString streamer10;
streamer10 << lDouble(0.333333333333333333L);
std::cout << " stream in: " << streamer10 << std::endl;
// ...from double
FString streamer11;
finalcut::FString streamer11;
streamer11 << double(0.11111111111);
std::cout << " stream in: " << streamer11 << std::endl;
// ...from float
FString streamer12;
finalcut::FString streamer12;
streamer12 << float(0.22222222);
std::cout << " stream in: " << streamer12 << std::endl;
}
@ -177,23 +177,23 @@ void streamingFromFStringExample()
// Test: Streaming from a FString (operator >>)...
// ...to FStrings
FString stream_fstring;
FString("FString") >> stream_fstring;
finalcut::FString stream_fstring;
finalcut::FString("FString") >> stream_fstring;
std::cout << "stream out: " << stream_fstring << std::endl;
// ...to c++ wide string
std::wstring stream_wstring;
FString("std::wstring") >> stream_wstring;
finalcut::FString("std::wstring") >> stream_wstring;
std::wcout << "stream out: " << stream_wstring << std::endl;
// ...to wide character
wchar_t stream_wchar_t = 0;
FString("w") >> stream_wchar_t;
finalcut::FString("w") >> stream_wchar_t;
std::wcout << "stream out: " << stream_wchar_t << std::endl;
// ...to character
char stream_char;
FString('c') >> stream_char;
finalcut::FString('c') >> stream_char;
std::cout << "stream out: " << stream_char << std::endl;
// ...to interger
@ -217,7 +217,7 @@ void streamToInterger()
try
{
int stream_int;
FString("-321") >> stream_int;
finalcut::FString("-321") >> stream_int;
std::cout << "stream out: " << stream_int << std::endl;
}
catch (const std::invalid_argument& ex)
@ -241,7 +241,7 @@ void streamToUnsignedInterger()
try
{
uInt stream_uint;
FString("123") >> stream_uint;
finalcut::FString("123") >> stream_uint;
std::cout << "stream out: " << stream_uint << std::endl;
}
catch (const std::invalid_argument& ex)
@ -265,7 +265,7 @@ void streamToDouble()
try
{
double stream_double;
FString("0.123456e+2") >> stream_double;
finalcut::FString("0.123456e+2") >> stream_double;
std::cout << "stream out: " << stream_double << std::endl;
}
catch (const std::invalid_argument& ex)
@ -285,7 +285,7 @@ void streamToFloat()
try
{
float stream_float;
FString("0.123e-3") >> stream_float;
finalcut::FString("0.123e-3") >> stream_float;
std::cout << "stream out: " << stream_float << std::endl;
}
catch (const std::invalid_argument& ex)
@ -302,7 +302,7 @@ void streamToFloat()
void CStringOutputExample()
{
// Test: c-string output
const FString& out = L"A test string for 0 \x20ac";
const finalcut::FString& out = L"A test string for 0 \x20ac";
printf (" c_str: \"%s\"\n", out.c_str());
}
@ -310,15 +310,15 @@ void CStringOutputExample()
void copyIntoFString()
{
// Test: copy a c++ string
const FString& cpp_str( std::string("c++ String") );
const finalcut::FString& cpp_str( std::string("c++ String") );
std::cout << " cpp_str: \"" << cpp_str << "\"" << std::endl;
// Test: copy a character
const FString ch('c');
const finalcut::FString ch('c');
std::cout << " char: '" << ch << "'" << std::endl;
// Test: copy a wide character
const FString wch(L'w');
const finalcut::FString wch(L'w');
std::cout << " wchar_t: '" << wch << "'" << std::endl;
}
@ -326,7 +326,7 @@ void copyIntoFString()
void utf8StringOutputExample()
{
// Test: utf-8 string
const FString& len = "длина́";
const finalcut::FString& len = "длина́";
std::cout << " length: \"" << len << "\" has "
<< len.getLength() << " characters" << std::endl;
}
@ -335,11 +335,11 @@ void utf8StringOutputExample()
void letterCaseExample()
{
// Test: convert uppercase letter to lowercase
const FString& lower = FString(L"InPut").toLower();
const finalcut::FString& lower = finalcut::FString(L"InPut").toLower();
std::wcout << L" toLower: " << lower << std::endl;
// Test: convert lowercase letter to uppercase
const FString& upper = FString("inPut").toUpper();
const finalcut::FString& upper = finalcut::FString("inPut").toUpper();
std::cout << " toUpper: " << upper << std::endl;
}
@ -347,63 +347,66 @@ void letterCaseExample()
void stringConcatenationExample()
{
// Test: concatenate two FStrings (operator +)
const FString& add1 = FString("FString + ") + FString("FString");
const finalcut::FString& add1 = finalcut::FString("FString + ")
+ finalcut::FString("FString");
std::cout << " add: " << add1 << std::endl;
// Test: concatenate a FString and a c++ wide string (operator +)
const FString& add2 = FString("FString + ")
const finalcut::FString& add2 = finalcut::FString("FString + ")
+ std::wstring(L"std::wstring");
std::cout << " add: " << add2 << std::endl;
// Test: concatenate a FString and a wide string (operator +)
const FString& add3 = FString("FString + ")
const finalcut::FString& add3 = finalcut::FString("FString + ")
+ const_cast<wchar_t*>(L"wchar_t*");
std::cout << " add: " << add3 << std::endl;
// Test: concatenate a FString and a c++ string (operator +)
const FString& add4 = FString("FString + ")
const finalcut::FString& add4 = finalcut::FString("FString + ")
+ std::string("std::string");
std::cout << " add: " << add4 << std::endl;
// Test: concatenate a FString and a c-string (operator +)
const FString& add5 = FString("FString + ")
const finalcut::FString& add5 = finalcut::FString("FString + ")
+ const_cast<char*>("char*");
std::cout << " add: " << add5 << std::endl;
// Test: concatenate a FString and a wide character (operator +)
const FString& add6 = FString("FString + ") + wchar_t(L'w');
const finalcut::FString& add6 = finalcut::FString("FString + ")
+ wchar_t(L'w');
std::cout << " add: " << add6 << std::endl;
// Test: concatenate a FString and a character (operator +)
const FString& add7 = FString("FString + ") + char('c');
const finalcut::FString& add7 = finalcut::FString("FString + ")
+ char('c');
std::cout << " add: " << add7 << std::endl;
// Test: concatenate a character and a FString (operator +)
const FString& add8 = 'c' + FString(" + FString");
const finalcut::FString& add8 = 'c' + finalcut::FString(" + FString");
std::cout << " add: " << add8 << std::endl;
// Test: concatenate a wide character and a FString (operator +)
const FString& add9 = L'w' + FString(" + FString");
const finalcut::FString& add9 = L'w' + finalcut::FString(" + FString");
std::cout << " add: " << add9 << std::endl;
// Test: concatenate a c-string and a FString (operator +)
const FString& add10 = const_cast<char*>("char*")
+ FString(" + FString");
const finalcut::FString& add10 = const_cast<char*>("char*")
+ finalcut::FString(" + FString");
std::cout << " add: " << add10 << std::endl;
// Test: concatenate a c++ string and a FString (operator +)
const FString& add11 = std::string("std::string")
+ FString(" + FString");
const finalcut::FString& add11 = std::string("std::string")
+ finalcut::FString(" + FString");
std::cout << " add: " << add11 << std::endl;
// Test: concatenate a wide string and a FString (operator +)
const FString& add12 = const_cast<wchar_t*>(L"wchar_t*")
+ FString(" + FString");
const finalcut::FString& add12 = const_cast<wchar_t*>(L"wchar_t*")
+ finalcut::FString(" + FString");
std::cout << " add: " << add12 << std::endl;
// Test: concatenate a c++ wide string and a FString (operator +)
const FString& add13 = std::wstring(L"std::wstring")
+ FString(" + FString");
const finalcut::FString& add13 = std::wstring(L"std::wstring")
+ finalcut::FString(" + FString");
std::cout << " add: " << add13 << std::endl;
}
@ -411,34 +414,34 @@ void stringConcatenationExample()
void stringCompareExample()
{
// Test: compare operators ==, <=, <, >=, >, !=
const FString& cmp = "compare";
const finalcut::FString& cmp = "compare";
if ( cmp == FString("compare") )
if ( cmp == finalcut::FString("compare") )
std::cout << " cmp: == Ok" << std::endl;
else
std::cout << " cmp: == Not Ok" << std::endl;
if ( cmp <= FString("d_compare") )
if ( cmp <= finalcut::FString("d_compare") )
std::cout << " cmp: <= Ok" << std::endl;
else
std::cout << " cmp: <= Not Ok" << std::endl;
if ( cmp < FString("e_compare") )
if ( cmp < finalcut::FString("e_compare") )
std::cout << " cmp: < Ok" << std::endl;
else
std::cout << " cmp: < Not Ok" << std::endl;
if ( cmp >= FString("b_compare") )
if ( cmp >= finalcut::FString("b_compare") )
std::cout << " cmp: >= Ok" << std::endl;
else
std::cout << " cmp: >= Not Ok" << std::endl;
if ( cmp > FString("a_compare") )
if ( cmp > finalcut::FString("a_compare") )
std::cout << " cmp: > Ok" << std::endl;
else
std::cout << " cmp: > Not Ok" << std::endl;
if ( cmp != FString("equal") )
if ( cmp != finalcut::FString("equal") )
std::cout << " cmp: != Ok" << std::endl;
else
std::cout << " cmp: != Not Ok" << std::endl;
@ -448,11 +451,11 @@ void stringCompareExample()
void stringSplittingExample()
{
// Test: split a string with a delimiter and returns a vector (array)
FString split_str = "a,b,c,d";
finalcut::FString split_str = "a,b,c,d";
std::cout << " split: \""
<< split_str << "\" into substrings ->";
FStringList parts = split_str.split(",");
FStringList::iterator it, end;
finalcut::FStringList parts = split_str.split(",");
finalcut::FStringList::iterator it, end;
end = parts.end();
for (it = parts.begin(); it != end; ++it)
@ -465,7 +468,7 @@ void stringSplittingExample()
void fromatStringExample()
{
// Test: format a string with sprintf
FString formatStr = "";
finalcut::FString formatStr = "";
std::cout << " formatted: "
<< formatStr.sprintf("sqrt(%d) = %d", 16, 4)
<< std::endl;
@ -477,7 +480,7 @@ void convertToNumberExample()
// Test: convert a string to a unsigned long interger
try
{
const uLong ulong_num = FString("123456789").toULong();
const uLong ulong_num = finalcut::FString("123456789").toULong();
std::cout << " toULong: " << ulong_num << std::endl;
}
catch (const std::invalid_argument& ex)
@ -492,7 +495,7 @@ void convertToNumberExample()
// Test: convert a string to a signed long interger
try
{
const long long_num = FString("-9876543210").toLong();
const long long_num = finalcut::FString("-9876543210").toLong();
std::cout << " toLong: " << long_num << std::endl;
}
catch (const std::invalid_argument& ex)
@ -509,7 +512,7 @@ void convertToNumberExample()
try
{
const double double_num = FString("2.7182818284590452353").toDouble();
const double double_num = finalcut::FString("2.7182818284590452353").toDouble();
std::ios_base::fmtflags save_flags = std::cout.flags();
std::cout << " toDouble: " << std::setprecision(11)
<< double_num << std::endl;
@ -529,7 +532,7 @@ void convertToNumberExample()
void convertNumberToStringExample()
{
// Test: convert integer and double value to a string
FString num1, num2, num3;
finalcut::FString num1, num2, num3;
num1.setNumber(137);
num2.setNumber(-512);
num3.setNumber(3.141592653589793238L, 12);
@ -546,7 +549,7 @@ void formatedNumberExample()
{
// Test: convert and format a integer number with thousand separator
std::setlocale (LC_NUMERIC, "");
FString fnum1, fnum2;
finalcut::FString fnum1, fnum2;
#if defined(__LP64__) || defined(_LP64)
// 64-bit architecture
fnum1.setFormatedNumber(0xffffffffffffffff, '\'');
@ -566,7 +569,7 @@ void formatedNumberExample()
void trimExample()
{
// Test: remove whitespace from the end of a string
const FString& trim_str = " A string \t";
const finalcut::FString& trim_str = " A string \t";
std::wcout << " rtrim: \""
<< trim_str.rtrim() << "\"" << std::endl;
@ -583,7 +586,7 @@ void trimExample()
void substringExample()
{
// Test: 11 characters from the left of the string
const FString& alphabet = "a b c d e f g h i j k l m "
const finalcut::FString& alphabet = "a b c d e f g h i j k l m "
"n o p q r s t u v w x y z";
std::cout << " left: \""
<< alphabet.left(11) << "\"" << std::endl;
@ -601,7 +604,7 @@ void substringExample()
void insertExample()
{
// Test: insert a string at index position 7
FString insert_str = "I am a string";
finalcut::FString insert_str = "I am a string";
try
{
@ -618,7 +621,7 @@ void insertExample()
void indexExample()
{
// Test: get character access at a specified index position
FString index(5); // string with five characters
finalcut::FString index(5); // string with five characters
index = "index";
try
@ -638,8 +641,8 @@ void indexExample()
void iteratorExample()
{
// Test: character access with std::iterator
const FString& stringIterator = "iterator";
FString::iterator iter;
const finalcut::FString& stringIterator = "iterator";
finalcut::FString::iterator iter;
iter = stringIterator.begin();
std::cout << " " << stringIterator << ": ";
@ -658,7 +661,7 @@ void iteratorExample()
void overwriteExample()
{
// Test: overwrite string at position 10 with "for t"
FString overwrite_std = "Overwrite the rest";
finalcut::FString overwrite_std = "Overwrite the rest";
std::cout << "overwrite: "
<< overwrite_std.overwrite("for t", 10) << std::endl;
}
@ -667,7 +670,7 @@ void overwriteExample()
void removeExample()
{
// Test: remove 2 characters at position 7
FString remove_std = "A fast remove";
finalcut::FString remove_std = "A fast remove";
std::cout << " remove: "
<< remove_std.remove(7, 2) << std::endl;
}
@ -676,7 +679,7 @@ void removeExample()
void substringIncludeExample()
{
// Test: includes a substring (positive test)
FString include_std = "string";
finalcut::FString include_std = "string";
if ( include_std.includes("ring") )
std::cout << " includes: \""
@ -702,8 +705,9 @@ void substringIncludeExample()
void replaceExample()
{
// Test: find and replace a substring
FString source_str = "computer and software";
const FString& replace_str = source_str.replace("computer", "hard-");
finalcut::FString source_str = "computer and software";
const finalcut::FString& replace_str = \
source_str.replace("computer", "hard-");
std::cout << " replace: "
<< replace_str << std::endl;
}
@ -712,7 +716,7 @@ void replaceExample()
void tabToSpaceExample()
{
// Test: convert tabs to spaces
const FString& tab_str = "1234\t5678";
const finalcut::FString& tab_str = "1234\t5678";
std::cout << " tab: "
<< tab_str.expandTabs() << std::endl;
}
@ -721,7 +725,7 @@ void tabToSpaceExample()
void backspaceControlCharacterExample()
{
// Test: backspaces remove characters in the string
const FString& bs_str = "t\b\bTesT\bt";
const finalcut::FString& bs_str = "t\b\bTesT\bt";
std::cout << "backspace: "
<< bs_str.removeBackspaces() << std::endl;
}
@ -730,7 +734,7 @@ void backspaceControlCharacterExample()
void deleteControlCharacterExample()
{
// Test: delete characters remove characters in the string
const FString& del_str = "apple \177\177\177pietree";
const finalcut::FString& del_str = "apple \177\177\177pietree";
std::cout << " delete: "
<< del_str.removeDel() << std::endl;
}

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -30,23 +30,23 @@
#pragma pack(push)
#pragma pack(1)
class AttribDlg : public FDialog
class AttribDlg : public finalcut::FDialog
{
public:
// Constructor
explicit AttribDlg (FWidget* = 0);
explicit AttribDlg (finalcut::FWidget* = 0);
// Destructor
~AttribDlg();
// Event handlers
void onAccel (FAccelEvent*);
void onWheel (FWheelEvent*);
void onClose (FCloseEvent*);
void onAccel (finalcut::FAccelEvent*);
void onWheel (finalcut::FWheelEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback methods
void cb_next (FWidget* = 0, data_ptr = 0);
void cb_back (FWidget* = 0, data_ptr = 0);
void cb_next (finalcut::FWidget* = 0, data_ptr = 0);
void cb_back (finalcut::FWidget* = 0, data_ptr = 0);
// Data Members
short bgcolor;
@ -61,28 +61,28 @@ class AttribDlg : public FDialog
void adjustSize();
// Data Members
FButton* next_button;
FButton* back_button;
finalcut::FButton* next_button;
finalcut::FButton* back_button;
};
#pragma pack(pop)
//----------------------------------------------------------------------
AttribDlg::AttribDlg (FWidget* parent)
: FDialog(parent)
AttribDlg::AttribDlg (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, bgcolor(wc.label_bg)
, next_button()
, back_button()
{
setText ( "A terminal attributes test ("
+ FString(getTermType())
+ finalcut::FString(getTermType())
+ ")");
next_button = new FButton("&Next >", this);
next_button = new finalcut::FButton("&Next >", this);
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1);
next_button->addAccelerator(fc::Fkey_right);
back_button = new FButton("< &Back", this);
next_button->addAccelerator(finalcut::fc::Fkey_right);
back_button = new finalcut::FButton("< &Back", this);
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1);
back_button->addAccelerator(fc::Fkey_left);
back_button->addAccelerator(finalcut::fc::Fkey_left);
// Add function callbacks
next_button->addCallback
@ -103,31 +103,31 @@ AttribDlg::~AttribDlg()
{ }
//----------------------------------------------------------------------
void AttribDlg::onAccel (FAccelEvent* ev)
void AttribDlg::onAccel (finalcut::FAccelEvent* ev)
{
close();
ev->accept();
}
//----------------------------------------------------------------------
void AttribDlg::onWheel (FWheelEvent* ev)
void AttribDlg::onWheel (finalcut::FWheelEvent* ev)
{
int wheel = ev->getWheel();
if ( wheel == fc::WheelUp )
if ( wheel == finalcut::fc::WheelUp )
cb_next();
else if ( wheel == fc::WheelDown )
else if ( wheel == finalcut::fc::WheelDown )
cb_back();
}
//----------------------------------------------------------------------
void AttribDlg::onClose (FCloseEvent* ev)
void AttribDlg::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void AttribDlg::cb_next (FWidget*, data_ptr)
void AttribDlg::cb_next (finalcut::FWidget*, data_ptr)
{
if ( isMonochron() )
return;
@ -135,20 +135,20 @@ void AttribDlg::cb_next (FWidget*, data_ptr)
bgcolor++;
if ( bgcolor >= getMaxColor() )
bgcolor = fc::Default;
bgcolor = finalcut::fc::Default;
redraw();
}
//----------------------------------------------------------------------
void AttribDlg::cb_back (FWidget*, data_ptr)
void AttribDlg::cb_back (finalcut::FWidget*, data_ptr)
{
if ( isMonochron() )
return;
bgcolor--;
if ( bgcolor < fc::Default )
if ( bgcolor < finalcut::fc::Default )
bgcolor = short(getMaxColor() - 1);
redraw();
@ -169,7 +169,7 @@ void AttribDlg::adjustSize()
setGeometry(x, y, 69, 21, false);
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1, false);
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
@ -180,7 +180,7 @@ void AttribDlg::adjustSize()
#pragma pack(push)
#pragma pack(1)
class AttribDemo : public FWidget
class AttribDemo : public finalcut::FWidget
{
public:
// Constructor
@ -191,7 +191,7 @@ class AttribDemo : public FWidget
{ }
// Event handler
void onWheel (FWheelEvent* ev)
void onWheel (finalcut::FWheelEvent* ev)
{
AttribDlg* p = static_cast<AttribDlg*>(getParentWidget());
@ -224,8 +224,8 @@ class AttribDemo : public FWidget
#pragma pack(pop)
//----------------------------------------------------------------------
AttribDemo::AttribDemo (FWidget* parent)
: FWidget(parent)
AttribDemo::AttribDemo (finalcut::FWidget* parent)
: finalcut::FWidget(parent)
, colors(getMaxColor())
{
if ( isMonochron() )
@ -259,16 +259,16 @@ void AttribDemo::printAltCharset()
setPrintPos (1,1);
print("alternate charset: ");
if ( parent->bgcolor == fc::Default )
if ( parent->bgcolor == finalcut::fc::Default )
{
setColor (fc::Default, fc::Default);
setColor (finalcut::fc::Default, finalcut::fc::Default);
}
else
{
if ( parent->bgcolor == 0 || parent->bgcolor == 16 )
setColor (fc::White, parent->bgcolor);
setColor (finalcut::fc::White, parent->bgcolor);
else
setColor (fc::Black, parent->bgcolor);
setColor (finalcut::fc::Black, parent->bgcolor);
}
setAltCharset();
@ -471,7 +471,7 @@ void AttribDemo::draw()
short bg = static_cast<AttribDlg*>(getParent())->bgcolor;
print (" Background color:");
if ( bg == fc::Default )
if ( bg == finalcut::fc::Default )
print (" default");
else
printf ( " %d", bg);
@ -487,7 +487,7 @@ void AttribDemo::draw()
int main (int argc, char* argv[])
{
// Create the application object
FApplication app (argc, argv);
finalcut::FApplication app (argc, argv);
// Create a dialog box object.
// This object will be automatically deleted by

View File

@ -28,16 +28,16 @@
// Global FVTerm object
static FVTerm* terminal;
static finalcut::FVTerm* terminal;
// Function prototype
void tcapBoolean (const std::string&, bool);
void tcapNumeric (const std::string&, int);
void tcapString (const std::string&, const char[]);
void debug (FApplication&);
void debug (finalcut::FApplication&);
void booleans();
void numeric();
void string(FTermcap::tcap_map*&);
void string(finalcut::FTermcap::tcap_map*&);
#pragma pack(push)
#pragma pack(1)
@ -45,95 +45,95 @@ void string(FTermcap::tcap_map*&);
struct termcap_string
{
const std::string name;
const fc::termcaps cap;
const finalcut::fc::termcaps cap;
};
#pragma pack(pop)
// String data array
static const termcap_string strings[] =
{
{ "t_bell", fc::t_bell },
{ "t_erase_chars", fc::t_erase_chars },
{ "t_clear_screen", fc::t_clear_screen },
{ "t_clr_eos", fc::t_clr_eos },
{ "t_clr_eol", fc::t_clr_eol },
{ "t_clr_bol", fc::t_clr_bol },
{ "t_cursor_home", fc::t_cursor_home },
{ "t_cursor_to_ll", fc::t_cursor_to_ll },
{ "t_carriage_return", fc::t_carriage_return },
{ "t_tab", fc::t_tab },
{ "t_back_tab", fc::t_back_tab },
{ "t_insert_padding", fc::t_insert_padding },
{ "t_insert_character", fc::t_insert_character },
{ "t_parm_ich", fc::t_parm_ich },
{ "t_repeat_char", fc::t_repeat_char },
{ "t_initialize_color", fc::t_initialize_color },
{ "t_initialize_pair", fc::t_initialize_pair },
{ "t_set_a_foreground", fc::t_set_a_foreground },
{ "t_set_a_background", fc::t_set_a_background },
{ "t_set_foreground", fc::t_set_foreground },
{ "t_set_background", fc::t_set_background },
{ "t_set_color_pair", fc::t_set_color_pair },
{ "t_orig_pair", fc::t_orig_pair },
{ "t_orig_colors", fc::t_orig_colors },
{ "t_no_color_video", fc::t_no_color_video },
{ "t_cursor_address", fc::t_cursor_address },
{ "t_column_address", fc::t_column_address },
{ "t_row_address", fc::t_row_address },
{ "t_cursor_visible", fc::t_cursor_visible },
{ "t_cursor_invisible", fc::t_cursor_invisible },
{ "t_cursor_normal", fc::t_cursor_normal },
{ "t_cursor_up", fc::t_cursor_up },
{ "t_cursor_down", fc::t_cursor_down },
{ "t_cursor_left", fc::t_cursor_left },
{ "t_cursor_right", fc::t_cursor_right },
{ "t_parm_up_cursor", fc::t_parm_up_cursor },
{ "t_parm_down_cursor", fc::t_parm_down_cursor },
{ "t_parm_left_cursor", fc::t_parm_left_cursor },
{ "t_parm_right_cursor", fc::t_parm_right_cursor },
{ "t_save_cursor", fc::t_save_cursor },
{ "t_restore_cursor", fc::t_restore_cursor },
{ "t_scroll_forward", fc::t_scroll_forward },
{ "t_scroll_reverse", fc::t_scroll_reverse },
{ "t_enter_ca_mode", fc::t_enter_ca_mode },
{ "t_exit_ca_mode", fc::t_exit_ca_mode },
{ "t_enable_acs", fc::t_enable_acs },
{ "t_enter_bold_mode", fc::t_enter_bold_mode },
{ "t_exit_bold_mode", fc::t_exit_bold_mode },
{ "t_enter_dim_mode", fc::t_enter_dim_mode },
{ "t_exit_dim_mode", fc::t_exit_dim_mode },
{ "t_enter_italics_mode", fc::t_enter_italics_mode },
{ "t_exit_italics_mode", fc::t_exit_italics_mode },
{ "t_enter_underline_mode", fc::t_enter_underline_mode },
{ "t_exit_underline_mode", fc::t_exit_underline_mode },
{ "t_enter_blink_mode", fc::t_enter_blink_mode },
{ "t_exit_blink_mode", fc::t_exit_blink_mode },
{ "t_enter_reverse_mode", fc::t_enter_reverse_mode },
{ "t_exit_reverse_mode", fc::t_exit_reverse_mode },
{ "t_enter_standout_mode", fc::t_enter_standout_mode },
{ "t_exit_standout_mode", fc::t_exit_standout_mode },
{ "t_enter_secure_mode", fc::t_enter_secure_mode },
{ "t_exit_secure_mode", fc::t_exit_secure_mode },
{ "t_enter_protected_mode", fc::t_enter_protected_mode },
{ "t_exit_protected_mode", fc::t_exit_protected_mode },
{ "t_enter_crossed_out_mode", fc::t_enter_crossed_out_mode },
{ "t_exit_crossed_out_mode", fc::t_exit_crossed_out_mode },
{ "t_enter_dbl_underline_mode", fc::t_enter_dbl_underline_mode },
{ "t_exit_dbl_underline_mode", fc::t_exit_dbl_underline_mode },
{ "t_set_attributes", fc::t_set_attributes },
{ "t_exit_attribute_mode", fc::t_exit_attribute_mode },
{ "t_enter_alt_charset_mode", fc::t_enter_alt_charset_mode },
{ "t_exit_alt_charset_mode", fc::t_exit_alt_charset_mode },
{ "t_enter_pc_charset_mode", fc::t_enter_pc_charset_mode },
{ "t_exit_pc_charset_mode", fc::t_exit_pc_charset_mode },
{ "t_enter_insert_mode", fc::t_enter_insert_mode },
{ "t_exit_insert_mode", fc::t_exit_insert_mode },
{ "t_enter_am_mode", fc::t_enter_am_mode },
{ "t_exit_am_mode", fc::t_exit_am_mode },
{ "t_acs_chars", fc::t_acs_chars },
{ "t_keypad_xmit", fc::t_keypad_xmit },
{ "t_keypad_local", fc::t_keypad_local },
{ "t_key_mouse", fc::t_key_mouse }
{ "t_bell", finalcut::fc::t_bell },
{ "t_erase_chars", finalcut::fc::t_erase_chars },
{ "t_clear_screen", finalcut::fc::t_clear_screen },
{ "t_clr_eos", finalcut::fc::t_clr_eos },
{ "t_clr_eol", finalcut::fc::t_clr_eol },
{ "t_clr_bol", finalcut::fc::t_clr_bol },
{ "t_cursor_home", finalcut::fc::t_cursor_home },
{ "t_cursor_to_ll", finalcut::fc::t_cursor_to_ll },
{ "t_carriage_return", finalcut::fc::t_carriage_return },
{ "t_tab", finalcut::fc::t_tab },
{ "t_back_tab", finalcut::fc::t_back_tab },
{ "t_insert_padding", finalcut::fc::t_insert_padding },
{ "t_insert_character", finalcut::fc::t_insert_character },
{ "t_parm_ich", finalcut::fc::t_parm_ich },
{ "t_repeat_char", finalcut::fc::t_repeat_char },
{ "t_initialize_color", finalcut::fc::t_initialize_color },
{ "t_initialize_pair", finalcut::fc::t_initialize_pair },
{ "t_set_a_foreground", finalcut::fc::t_set_a_foreground },
{ "t_set_a_background", finalcut::fc::t_set_a_background },
{ "t_set_foreground", finalcut::fc::t_set_foreground },
{ "t_set_background", finalcut::fc::t_set_background },
{ "t_set_color_pair", finalcut::fc::t_set_color_pair },
{ "t_orig_pair", finalcut::fc::t_orig_pair },
{ "t_orig_colors", finalcut::fc::t_orig_colors },
{ "t_no_color_video", finalcut::fc::t_no_color_video },
{ "t_cursor_address", finalcut::fc::t_cursor_address },
{ "t_column_address", finalcut::fc::t_column_address },
{ "t_row_address", finalcut::fc::t_row_address },
{ "t_cursor_visible", finalcut::fc::t_cursor_visible },
{ "t_cursor_invisible", finalcut::fc::t_cursor_invisible },
{ "t_cursor_normal", finalcut::fc::t_cursor_normal },
{ "t_cursor_up", finalcut::fc::t_cursor_up },
{ "t_cursor_down", finalcut::fc::t_cursor_down },
{ "t_cursor_left", finalcut::fc::t_cursor_left },
{ "t_cursor_right", finalcut::fc::t_cursor_right },
{ "t_parm_up_cursor", finalcut::fc::t_parm_up_cursor },
{ "t_parm_down_cursor", finalcut::fc::t_parm_down_cursor },
{ "t_parm_left_cursor", finalcut::fc::t_parm_left_cursor },
{ "t_parm_right_cursor", finalcut::fc::t_parm_right_cursor },
{ "t_save_cursor", finalcut::fc::t_save_cursor },
{ "t_restore_cursor", finalcut::fc::t_restore_cursor },
{ "t_scroll_forward", finalcut::fc::t_scroll_forward },
{ "t_scroll_reverse", finalcut::fc::t_scroll_reverse },
{ "t_enter_ca_mode", finalcut::fc::t_enter_ca_mode },
{ "t_exit_ca_mode", finalcut::fc::t_exit_ca_mode },
{ "t_enable_acs", finalcut::fc::t_enable_acs },
{ "t_enter_bold_mode", finalcut::fc::t_enter_bold_mode },
{ "t_exit_bold_mode", finalcut::fc::t_exit_bold_mode },
{ "t_enter_dim_mode", finalcut::fc::t_enter_dim_mode },
{ "t_exit_dim_mode", finalcut::fc::t_exit_dim_mode },
{ "t_enter_italics_mode", finalcut::fc::t_enter_italics_mode },
{ "t_exit_italics_mode", finalcut::fc::t_exit_italics_mode },
{ "t_enter_underline_mode", finalcut::fc::t_enter_underline_mode },
{ "t_exit_underline_mode", finalcut::fc::t_exit_underline_mode },
{ "t_enter_blink_mode", finalcut::fc::t_enter_blink_mode },
{ "t_exit_blink_mode", finalcut::fc::t_exit_blink_mode },
{ "t_enter_reverse_mode", finalcut::fc::t_enter_reverse_mode },
{ "t_exit_reverse_mode", finalcut::fc::t_exit_reverse_mode },
{ "t_enter_standout_mode", finalcut::fc::t_enter_standout_mode },
{ "t_exit_standout_mode", finalcut::fc::t_exit_standout_mode },
{ "t_enter_secure_mode", finalcut::fc::t_enter_secure_mode },
{ "t_exit_secure_mode", finalcut::fc::t_exit_secure_mode },
{ "t_enter_protected_mode", finalcut::fc::t_enter_protected_mode },
{ "t_exit_protected_mode", finalcut::fc::t_exit_protected_mode },
{ "t_enter_crossed_out_mode", finalcut::fc::t_enter_crossed_out_mode },
{ "t_exit_crossed_out_mode", finalcut::fc::t_exit_crossed_out_mode },
{ "t_enter_dbl_underline_mode", finalcut::fc::t_enter_dbl_underline_mode },
{ "t_exit_dbl_underline_mode", finalcut::fc::t_exit_dbl_underline_mode },
{ "t_set_attributes", finalcut::fc::t_set_attributes },
{ "t_exit_attribute_mode", finalcut::fc::t_exit_attribute_mode },
{ "t_enter_alt_charset_mode", finalcut::fc::t_enter_alt_charset_mode },
{ "t_exit_alt_charset_mode", finalcut::fc::t_exit_alt_charset_mode },
{ "t_enter_pc_charset_mode", finalcut::fc::t_enter_pc_charset_mode },
{ "t_exit_pc_charset_mode", finalcut::fc::t_exit_pc_charset_mode },
{ "t_enter_insert_mode", finalcut::fc::t_enter_insert_mode },
{ "t_exit_insert_mode", finalcut::fc::t_exit_insert_mode },
{ "t_enter_am_mode", finalcut::fc::t_enter_am_mode },
{ "t_exit_am_mode", finalcut::fc::t_exit_am_mode },
{ "t_acs_chars", finalcut::fc::t_acs_chars },
{ "t_keypad_xmit", finalcut::fc::t_keypad_xmit },
{ "t_keypad_local", finalcut::fc::t_keypad_local },
{ "t_key_mouse", finalcut::fc::t_key_mouse }
};
const int last_item = int ( sizeof(strings) / sizeof(strings[0]) ) - 1;
@ -204,10 +204,10 @@ void tcapString (const std::string& name, const char cap_str[])
//----------------------------------------------------------------------
#if DEBUG
void debug (FApplication& TermApp)
void debug (finalcut::FApplication& TermApp)
{
const FString& ab_s = TermApp.getAnswerbackString();
const FString& sec_da = TermApp.getSecDAString();
const finalcut::FString& ab_s = TermApp.getAnswerbackString();
const finalcut::FString& sec_da = TermApp.getSecDAString();
std::cout << "\n.------------------- debug -------------------\r\n";
#if defined(__linux__)
std::cout << "| Framebuffer bpp: "
@ -231,7 +231,7 @@ void debug (FApplication& TermApp)
}
#else
void debug (FApplication&)
void debug (finalcut::FApplication&)
{ }
#endif
@ -240,19 +240,19 @@ void booleans()
{
std::cout << "\r\n[Booleans]\r\n";
tcapBoolean ( "background_color_erase"
, FTermcap::background_color_erase );
, finalcut::FTermcap::background_color_erase );
tcapBoolean ( "automatic_left_margin"
, FTermcap::automatic_left_margin );
, finalcut::FTermcap::automatic_left_margin );
tcapBoolean ( "automatic_right_margin"
, FTermcap::automatic_right_margin );
, finalcut::FTermcap::automatic_right_margin );
tcapBoolean ( "eat_nl_glitch"
, FTermcap::eat_nl_glitch );
, finalcut::FTermcap::eat_nl_glitch );
tcapBoolean ( "ansi_default_color"
, FTermcap::ansi_default_color );
, finalcut::FTermcap::ansi_default_color );
tcapBoolean ( "osc_support"
, FTermcap::osc_support );
, finalcut::FTermcap::osc_support );
tcapBoolean ( "no_utf8_acs_chars"
, FTermcap::no_utf8_acs_chars );
, finalcut::FTermcap::no_utf8_acs_chars );
}
//----------------------------------------------------------------------
@ -260,22 +260,22 @@ void numeric()
{
std::cout << "\r\n[Numeric]\r\n";
tcapNumeric ("max_color"
, FTermcap::max_color);
, finalcut::FTermcap::max_color);
tcapNumeric ("tabstop"
, FTermcap::tabstop);
, finalcut::FTermcap::tabstop);
tcapNumeric ("attr_without_color"
, FTermcap::attr_without_color);
, finalcut::FTermcap::attr_without_color);
}
//----------------------------------------------------------------------
void string(FTermcap::tcap_map*& tcap)
void string(finalcut::FTermcap::tcap_map*& tcap)
{
std::cout << "\r\n[String]\r\n";
for (int n = 0; n <= last_item; n++ )
{
const std::string name = strings[n].name;
const fc::termcaps cap = strings[n].cap;
const finalcut::fc::termcaps cap = strings[n].cap;
tcapString (name, tcap[cap].string);
}
}
@ -286,13 +286,13 @@ void string(FTermcap::tcap_map*& tcap)
int main (int argc, char* argv[])
{
bool disable_alt_screen = true;
FApplication TermApp (argc, argv, disable_alt_screen);
finalcut::FApplication TermApp (argc, argv, disable_alt_screen);
// Pointer to the global virtual terminal object
terminal = static_cast<FVTerm*>(&TermApp);
terminal = static_cast<finalcut::FVTerm*>(&TermApp);
FTermcap::tcap_map* tcap = 0;
tcap = FTermcap::getTermcapMap();
finalcut::FTermcap::tcap_map* tcap = 0;
tcap = finalcut::FTermcap::getTermcapMap();
std::cout << "--------\r\nFTermcap\r\n--------\r\n\n";
std::cout << "Terminal: " << TermApp.getTermType() << "\r\n";

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2014-2017 Markus Gans *
* Copyright 2014-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -27,24 +27,24 @@
// class Timer
//----------------------------------------------------------------------
class Timer : public FWidget
class Timer : public finalcut::FWidget
{
public:
// Constructor
explicit Timer (FWidget* = 0);
explicit Timer (finalcut::FWidget* = 0);
protected:
// Method
void draw();
// Event handlers
void onTimer (FTimerEvent*);
void onAccel (FAccelEvent*);
void onTimer (finalcut::FTimerEvent*);
void onAccel (finalcut::FAccelEvent*);
};
//----------------------------------------------------------------------
Timer::Timer (FWidget* parent)
: FWidget(parent)
Timer::Timer (finalcut::FWidget* parent)
: finalcut::FWidget(parent)
{
addTimer (60000); // 1-minute timer
int id = addTimer (50); // 50-millisecond timer
@ -52,8 +52,8 @@ Timer::Timer (FWidget* parent)
delTimer (id);
addTimer (250); // 250-millisecond timer
wc.term_fg = fc::Default;
wc.term_bg = fc::Default;
wc.term_fg = finalcut::fc::Default;
wc.term_bg = finalcut::fc::Default;
}
//----------------------------------------------------------------------
@ -67,7 +67,7 @@ void Timer::draw()
}
//----------------------------------------------------------------------
void Timer::onTimer (FTimerEvent* ev)
void Timer::onTimer (finalcut::FTimerEvent* ev)
{
bool is_last_line = false;
int timer_id = ev->timerId();
@ -75,7 +75,7 @@ void Timer::onTimer (FTimerEvent* ev)
if ( getPrintPos().getY() == getDesktopHeight() )
is_last_line = true;
setColor (short(1 + timer_id), fc::Default);
setColor (short(1 + timer_id), finalcut::fc::Default);
print() << "Timer event, id " << timer_id << '\n';
if ( is_last_line )
@ -85,7 +85,7 @@ void Timer::onTimer (FTimerEvent* ev)
}
//----------------------------------------------------------------------
void Timer::onAccel (FAccelEvent* ev)
void Timer::onAccel (finalcut::FAccelEvent* ev)
{
quit();
ev->accept();
@ -98,9 +98,9 @@ void Timer::onAccel (FAccelEvent* ev)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
app.setForegroundColor(fc::Default);
app.setBackgroundColor(fc::Default);
finalcut::FApplication app(argc, argv);
app.setForegroundColor(finalcut::fc::Default);
app.setBackgroundColor(finalcut::fc::Default);
// Create a timer object t
Timer t(&app);

View File

@ -30,7 +30,7 @@
#pragma pack(push)
#pragma pack(1)
class Transparent : public FDialog
class Transparent : public finalcut::FDialog
{
public:
// Typedef and Enumeration
@ -43,7 +43,7 @@ class Transparent : public FDialog
public:
// Constructor
explicit Transparent (FWidget* = 0, trans_type = transparent);
explicit Transparent (finalcut::FWidget* = 0, trans_type = transparent);
// Destructor
~Transparent();
@ -59,7 +59,7 @@ class Transparent : public FDialog
void draw();
// Event handlers
void onKeyPress (FKeyEvent* ev);
void onKeyPress (finalcut::FKeyEvent* ev);
// Data Members
trans_type type;
@ -67,8 +67,9 @@ class Transparent : public FDialog
#pragma pack(pop)
//----------------------------------------------------------------------
Transparent::Transparent (FWidget* parent, Transparent::trans_type tt)
: FDialog(parent)
Transparent::Transparent ( finalcut::FWidget* parent
, Transparent::trans_type tt )
: finalcut::FDialog(parent)
, type(tt)
{
setStatusbarMessage("Press Q to quit");
@ -81,7 +82,7 @@ Transparent::~Transparent()
//----------------------------------------------------------------------
void Transparent::draw()
{
FDialog::draw();
finalcut::FDialog::draw();
if ( isMonochron() )
setReverse(true);
@ -94,16 +95,16 @@ void Transparent::draw()
else if ( type == inherit_background )
{
if ( getMaxColor() > 8 )
setColor(fc::Blue, fc::Black);
setColor(finalcut::fc::Blue, finalcut::fc::Black);
else
setColor(fc::Green, fc::Black);
setColor(finalcut::fc::Green, finalcut::fc::Black);
setInheritBackground();
}
else
setTransparent();
FString line(getClientWidth(), wchar_t('.'));
finalcut::FString line(getClientWidth(), wchar_t('.'));
for (int n = 1; n <= getClientHeight(); n++)
{
@ -123,7 +124,7 @@ void Transparent::draw()
}
//----------------------------------------------------------------------
void Transparent::onKeyPress (FKeyEvent* ev)
void Transparent::onKeyPress (finalcut::FKeyEvent* ev)
{
if ( ! ev )
return;
@ -136,7 +137,7 @@ void Transparent::onKeyPress (FKeyEvent* ev)
ev->ignore();
}
else
FDialog::onKeyPress(ev);
finalcut::FDialog::onKeyPress(ev);
}
@ -147,11 +148,11 @@ void Transparent::onKeyPress (FKeyEvent* ev)
#pragma pack(push)
#pragma pack(1)
class MainWindow : public FDialog
class MainWindow : public finalcut::FDialog
{
private:
FString line1;
FString line2;
finalcut::FString line1;
finalcut::FString line2;
private:
// Disable copy constructor
@ -162,10 +163,10 @@ class MainWindow : public FDialog
void draw();
// Event handlers
void onClose (FCloseEvent*);
void onShow (FShowEvent*);
void onTimer (FTimerEvent*);
void onKeyPress (FKeyEvent* ev)
void onClose (finalcut::FCloseEvent*);
void onShow (finalcut::FShowEvent*);
void onTimer (finalcut::FTimerEvent*);
void onKeyPress (finalcut::FKeyEvent* ev)
{
if ( ! ev )
return;
@ -176,19 +177,19 @@ class MainWindow : public FDialog
ev->accept();
}
else
FDialog::onKeyPress(ev);
finalcut::FDialog::onKeyPress(ev);
}
public:
// Constructor
explicit MainWindow (FWidget* = 0);
explicit MainWindow (finalcut::FWidget* = 0);
// Destructor
~MainWindow();
};
#pragma pack(pop)
//----------------------------------------------------------------------
MainWindow::MainWindow (FWidget* parent)
MainWindow::MainWindow (finalcut::FWidget* parent)
: FDialog(parent)
, line1()
, line2()
@ -212,7 +213,7 @@ MainWindow::MainWindow (FWidget* parent)
ibg->unsetTransparentShadow();
// Statusbar at the bottom
FStatusBar* status_bar = new FStatusBar (this);
finalcut::FStatusBar* status_bar = new finalcut::FStatusBar (this);
status_bar->setMessage("Press Q to quit");
addAccelerator('q');
@ -227,7 +228,7 @@ MainWindow::~MainWindow()
//----------------------------------------------------------------------
void MainWindow::draw()
{
FDialog::draw();
finalcut::FDialog::draw();
if ( isMonochron() )
setReverse(true);
@ -245,19 +246,19 @@ void MainWindow::draw()
}
//----------------------------------------------------------------------
void MainWindow::onClose (FCloseEvent* ev)
void MainWindow::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void MainWindow::onShow (FShowEvent*)
void MainWindow::onShow (finalcut::FShowEvent*)
{
addTimer(100);
}
//----------------------------------------------------------------------
void MainWindow::onTimer (FTimerEvent*)
void MainWindow::onTimer (finalcut::FTimerEvent*)
{
wchar_t first_Char[2];
uInt length = line1.getLength();
@ -276,7 +277,7 @@ void MainWindow::onTimer (FTimerEvent*)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app (argc, argv);
finalcut::FApplication app (argc, argv);
// Create main dialog object
MainWindow main_dlg (&app);

View File

@ -35,11 +35,11 @@
#pragma pack(push)
#pragma pack(1)
class Treeview : public FDialog
class Treeview : public finalcut::FDialog
{
public:
// Constructor
explicit Treeview (FWidget* = 0);
explicit Treeview (finalcut::FWidget* = 0);
// Destructor
~Treeview();
@ -62,11 +62,11 @@ class Treeview : public FDialog
TreeItem* getOceania();
// Event handlers
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Data Members
FListView* listView;
FButton* Quit;
finalcut::FListView* listView;
finalcut::FButton* Quit;
};
#pragma pack(pop)
@ -251,13 +251,13 @@ Treeview::TreeItem* Treeview::getOceania()
}
//----------------------------------------------------------------------
Treeview::Treeview (FWidget* parent)
: FDialog(parent)
Treeview::Treeview (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, listView()
, Quit()
{
// Create FListView object
listView = new FListView (this);
listView = new finalcut::FListView (this);
listView->setGeometry(2, 1, 53, 14);
// Add columns to the view
@ -266,8 +266,8 @@ Treeview::Treeview (FWidget* parent)
listView->addColumn ("Density/km²");
// Set right alignment for the second and third column
listView->setColumnAlignment (2, fc::alignRight);
listView->setColumnAlignment (3, fc::alignRight);
listView->setColumnAlignment (2, finalcut::fc::alignRight);
listView->setColumnAlignment (3, finalcut::fc::alignRight);
// Activate tree view
listView->setTreeView();
@ -297,12 +297,15 @@ Treeview::Treeview (FWidget* parent)
while ( continent_list->name )
{
TreeItem* country_list = continent_list->child_element;
FStringList continent_line (continent_list->begin(), continent_list->end());
FObjectIterator iter = listView->insert (continent_line);
finalcut::FStringList continent_line ( continent_list->begin()
, continent_list->end() );
finalcut::FListViewIterator::FObjectIterator iter = \
listView->insert (continent_line);
while ( country_list && country_list->name )
{
FStringList country_line (country_list->begin(), country_list->end());
finalcut::FStringList country_line ( country_list->begin()
, country_list->end() );
listView->insert (country_line, iter);
country_list++;
}
@ -311,7 +314,7 @@ Treeview::Treeview (FWidget* parent)
}
// Quit button
Quit = new FButton (this);
Quit = new finalcut::FButton (this);
Quit->setGeometry(24, 16, 10, 1);
Quit->setText (L"&Quit");
@ -319,7 +322,7 @@ Treeview::Treeview (FWidget* parent)
Quit->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
@ -345,13 +348,13 @@ void Treeview::adjustSize()
if ( Quit )
Quit->setY(getHeight() - 4);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
void Treeview::onClose (FCloseEvent* ev)
void Treeview::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
@ -362,7 +365,7 @@ void Treeview::onClose (FCloseEvent* ev)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create main dialog object
Treeview d(&app);

View File

@ -34,11 +34,11 @@
#pragma pack(push)
#pragma pack(1)
class ProgressDialog : public FDialog
class ProgressDialog : public finalcut::FDialog
{
public:
// Constructor
explicit ProgressDialog (FWidget* = 0);
explicit ProgressDialog (finalcut::FWidget* = 0);
// Destructor
~ProgressDialog();
@ -50,25 +50,25 @@ class ProgressDialog : public FDialog
ProgressDialog& operator = (const ProgressDialog&);
// Event handlers
void onShow (FShowEvent*);
void onTimer (FTimerEvent*);
void onShow (finalcut::FShowEvent*);
void onTimer (finalcut::FTimerEvent*);
// Callback methods
void cb_reset_bar (FWidget*, data_ptr);
void cb_more_bar (FWidget*, data_ptr);
void cb_exit_bar (FWidget*, data_ptr);
void cb_reset_bar (finalcut::FWidget*, data_ptr);
void cb_more_bar (finalcut::FWidget*, data_ptr);
void cb_exit_bar (finalcut::FWidget*, data_ptr);
// Data Members
FProgressbar* progressBar;
FButton* reset;
FButton* more;
FButton* quit;
finalcut::FProgressbar* progressBar;
finalcut::FButton* reset;
finalcut::FButton* more;
finalcut::FButton* quit;
};
#pragma pack(pop)
//----------------------------------------------------------------------
ProgressDialog::ProgressDialog (FWidget* parent)
: FDialog(parent)
ProgressDialog::ProgressDialog (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, progressBar()
, reset()
, more()
@ -78,24 +78,24 @@ ProgressDialog::ProgressDialog (FWidget* parent)
setText("Progress bar");
//setModal();
reset = new FButton(this);
reset = new finalcut::FButton(this);
reset->setText("&Reset");
reset->setStatusbarMessage ("Reset the progress bar");
reset->setGeometry(2, 6, 8, 1, false);
reset->setDisable();
more = new FButton(this);
more = new finalcut::FButton(this);
more->setText("&More");
more->setStatusbarMessage ("Increases the progress bar position");
more->setGeometry(15, 6, 8, 1, false);
more->setDisable();
quit = new FButton(this);
quit = new finalcut::FButton(this);
quit->setText("E&xit");
quit->setGeometry(28, 6, 8, 1, false);
quit->setDisable();
progressBar = new FProgressbar(this);
progressBar = new finalcut::FProgressbar(this);
progressBar->setGeometry(2, 3, 34, 1, false);
//progressBar->setPercentage(78);
@ -132,13 +132,13 @@ ProgressDialog::~ProgressDialog() // destructor
}
//----------------------------------------------------------------------
void ProgressDialog::onShow (FShowEvent*)
void ProgressDialog::onShow (finalcut::FShowEvent*)
{
addTimer(15);
}
//----------------------------------------------------------------------
void ProgressDialog::onTimer (FTimerEvent*)
void ProgressDialog::onTimer (finalcut::FTimerEvent*)
{
int p = progressBar->getPercentage();
progressBar->setPercentage(++p);
@ -164,20 +164,20 @@ void ProgressDialog::onTimer (FTimerEvent*)
}
//----------------------------------------------------------------------
void ProgressDialog::cb_reset_bar (FWidget*, data_ptr)
void ProgressDialog::cb_reset_bar (finalcut::FWidget*, data_ptr)
{
progressBar->reset();
}
//----------------------------------------------------------------------
void ProgressDialog::cb_more_bar (FWidget*, data_ptr)
void ProgressDialog::cb_more_bar (finalcut::FWidget*, data_ptr)
{
int p = progressBar->getPercentage();
progressBar->setPercentage(++p);
}
//----------------------------------------------------------------------
void ProgressDialog::cb_exit_bar (FWidget*, data_ptr)
void ProgressDialog::cb_exit_bar (finalcut::FWidget*, data_ptr)
{
close();
}
@ -190,16 +190,16 @@ void ProgressDialog::cb_exit_bar (FWidget*, data_ptr)
#pragma pack(push)
#pragma pack(1)
class TextWindow : public FDialog
class TextWindow : public finalcut::FDialog
{
public:
// Constructor
explicit TextWindow (FWidget* = 0);
explicit TextWindow (finalcut::FWidget* = 0);
// Destructor
~TextWindow();
void append (const FString&);
void append (const finalcut::FString&);
private:
// Disable copy constructor
@ -211,16 +211,16 @@ class TextWindow : public FDialog
void adjustSize();
// Data Members
FTextView* scrollText;
finalcut::FTextView* scrollText;
};
#pragma pack(pop)
//----------------------------------------------------------------------
TextWindow::TextWindow (FWidget* parent)
: FDialog(parent)
TextWindow::TextWindow (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, scrollText()
{
scrollText = new FTextView(this);
scrollText = new finalcut::FTextView(this);
scrollText->ignorePadding();
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
setMinimumSize (51, 6);
@ -240,7 +240,7 @@ TextWindow::~TextWindow() // destructor
{ }
//----------------------------------------------------------------------
void TextWindow::append (const FString& str)
void TextWindow::append (const finalcut::FString& str)
{
scrollText->append(str);
}
@ -248,7 +248,7 @@ void TextWindow::append (const FString& str)
//----------------------------------------------------------------------
void TextWindow::adjustSize()
{
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
}
@ -260,11 +260,11 @@ void TextWindow::adjustSize()
#pragma pack(push)
#pragma pack(1)
class MyDialog : public FDialog
class MyDialog : public finalcut::FDialog
{
public:
// Constructor
explicit MyDialog (FWidget* = 0);
explicit MyDialog (finalcut::FWidget* = 0);
// Destructor
~MyDialog();
@ -292,58 +292,58 @@ class MyDialog : public FDialog
void adjustSize();
// Event handlers
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback methods
void cb_noFunctionMsg (FWidget*, data_ptr);
void cb_about (FWidget*, data_ptr);
void cb_terminfo (FWidget*, data_ptr);
void cb_drives (FWidget*, data_ptr);
void cb_cutClipboard (FWidget*, data_ptr);
void cb_copyClipboard (FWidget*, data_ptr);
void cb_pasteClipboard (FWidget*, data_ptr);
void cb_clearInput (FWidget*, data_ptr);
void cb_input2buttonText (FWidget*, data_ptr);
void cb_setTitlebar (FWidget*, data_ptr);
void cb_ProgressBar (FWidget*, data_ptr);
void cb_updateNumber (FWidget*, data_ptr);
void cb_activateButton (FWidget*, data_ptr);
void cb_view (FWidget*, data_ptr);
void cb_setInput (FWidget*, data_ptr);
void cb_noFunctionMsg (finalcut::FWidget*, data_ptr);
void cb_about (finalcut::FWidget*, data_ptr);
void cb_terminfo (finalcut::FWidget*, data_ptr);
void cb_drives (finalcut::FWidget*, data_ptr);
void cb_cutClipboard (finalcut::FWidget*, data_ptr);
void cb_copyClipboard (finalcut::FWidget*, data_ptr);
void cb_pasteClipboard (finalcut::FWidget*, data_ptr);
void cb_clearInput (finalcut::FWidget*, data_ptr);
void cb_input2buttonText (finalcut::FWidget*, data_ptr);
void cb_setTitlebar (finalcut::FWidget*, data_ptr);
void cb_ProgressBar (finalcut::FWidget*, data_ptr);
void cb_updateNumber (finalcut::FWidget*, data_ptr);
void cb_activateButton (finalcut::FWidget*, data_ptr);
void cb_view (finalcut::FWidget*, data_ptr);
void cb_setInput (finalcut::FWidget*, data_ptr);
// Data Members
FMenuItem* Open;
FMenuItem* Quit;
FMenuItem* File1;
FMenuItem* File2;
FMenuItem* File3;
FMenuItem* Cut;
FMenuItem* Copy;
FMenuItem* Paste;
FMenuItem* Clear;
FMenuItem* Env;
FMenuItem* Drive;
FMenuItem* Help;
FStatusKey* key_F1;
FStatusKey* key_F2;
FStatusKey* key_F3;
FButton* MyButton1;
FButton* MyButton2;
FButton* MyButton3;
FButton* MyButton4;
FButton* MyButton5;
FButton* MyButton6;
FRadioButton* radio1;
FLabel* tagged_count;
FLineEdit* myLineEdit;
FListBox* myList;
FString clipboard;
finalcut::FMenuItem* Open;
finalcut::FMenuItem* Quit;
finalcut::FMenuItem* File1;
finalcut::FMenuItem* File2;
finalcut::FMenuItem* File3;
finalcut::FMenuItem* Cut;
finalcut::FMenuItem* Copy;
finalcut::FMenuItem* Paste;
finalcut::FMenuItem* Clear;
finalcut::FMenuItem* Env;
finalcut::FMenuItem* Drive;
finalcut::FMenuItem* Help;
finalcut::FStatusKey* key_F1;
finalcut::FStatusKey* key_F2;
finalcut::FStatusKey* key_F3;
finalcut::FButton* MyButton1;
finalcut::FButton* MyButton2;
finalcut::FButton* MyButton3;
finalcut::FButton* MyButton4;
finalcut::FButton* MyButton5;
finalcut::FButton* MyButton6;
finalcut::FRadioButton* radio1;
finalcut::FLabel* tagged_count;
finalcut::FLineEdit* myLineEdit;
finalcut::FListBox* myList;
finalcut::FString clipboard;
};
#pragma pack(pop)
//----------------------------------------------------------------------
MyDialog::MyDialog (FWidget* parent)
: FDialog(parent)
MyDialog::MyDialog (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, Open()
, Quit()
, File1()
@ -387,62 +387,67 @@ MyDialog::~MyDialog() // destructor
void MyDialog::initMenu()
{
// Menu bar
FMenuBar* Menubar = new FMenuBar (this);
finalcut::FMenuBar* Menubar = new finalcut::FMenuBar (this);
// Menu bar items
FMenu* File = new FMenu ("&File", Menubar);
finalcut::FMenu* File = new finalcut::FMenu ("&File", Menubar);
File->setStatusbarMessage ("File management commands");
FMenu* Edit = new FMenu ("&Edit", Menubar);
finalcut::FMenu* Edit = new finalcut::FMenu ("&Edit", Menubar);
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
FMenu* View = new FMenu ("&View", Menubar);
finalcut::FMenu* View = new finalcut::FMenu ("&View", Menubar);
View->setStatusbarMessage ("Show internal informations");
FMenuItem* Options = new FMenuItem ("&Options", Menubar);
finalcut::FMenuItem* Options = \
new finalcut::FMenuItem ("&Options", Menubar);
Options->setStatusbarMessage ("Set program defaults");
Options->setDisable();
FDialogListMenu* Window = new FDialogListMenu ("&Window", Menubar);
finalcut::FDialogListMenu* Window = \
new finalcut::FDialogListMenu ("&Window", Menubar);
Window->setStatusbarMessage ("List of all the active dialogs");
Help = new FMenuItem ("&Help", Menubar);
Help = new finalcut::FMenuItem ("&Help", Menubar);
Help->setStatusbarMessage ("Show version and copyright information");
// "File" menu items
Open = new FMenuItem ("&Open...", File);
Open->addAccelerator (fc::Fckey_o); // Ctrl + O
Open = new finalcut::FMenuItem ("&Open...", File);
Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
Open->setStatusbarMessage ("Locate and open a text file");
FMenu* Recent = new FMenu ("&System files", File);
finalcut::FMenu* Recent = new finalcut::FMenu ("&System files", File);
Recent->setStatusbarMessage ("View text file");
FMenuItem* Line1 = new FMenuItem (File);
finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File);
Line1->setSeparator();
Quit = new FMenuItem ("&Quit", File);
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
Quit = new finalcut::FMenuItem ("&Quit", File);
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit->setStatusbarMessage ("Exit the program");
// "Recent" menu items
File1 = new FMenuItem ("/etc/services", Recent);
File2 = new FMenuItem ("/etc/fstab", Recent);
File3 = new FMenuItem ("/etc/passwd", Recent);
File1 = new finalcut::FMenuItem ("/etc/services", Recent);
File2 = new finalcut::FMenuItem ("/etc/fstab", Recent);
File3 = new finalcut::FMenuItem ("/etc/passwd", Recent);
// "Edit" menu items
FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "Undo", Edit);
finalcut::FMenuItem* Undo = \
new finalcut::FMenuItem (finalcut::fc::Fckey_z, "Undo", Edit);
Undo->setDisable();
FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "Redo", Edit);
finalcut::FMenuItem* Redo = \
new finalcut::FMenuItem (finalcut::fc::Fckey_y, "Redo", Edit);
Redo->setDisable();
FMenuItem* Line2 = new FMenuItem (Edit);
finalcut::FMenuItem* Line2 = \
new finalcut::FMenuItem (Edit);
Line2->setSeparator();
Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit);
Cut = new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit);
Cut->setStatusbarMessage ( "Remove the input text"
" and put it in the clipboard" );
Copy= new FMenuItem (fc::Fckey_c, "&Copy", Edit);
Copy= new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit);
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit);
Paste = new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit);
Paste->setStatusbarMessage ("Insert text form clipboard");
Clear = new FMenuItem (fc::Fkey_dc, "C&lear", Edit);
Clear = new finalcut::FMenuItem (finalcut::fc::Fkey_dc, "C&lear", Edit);
Clear->setStatusbarMessage ("Delete input text");
// "View" menu items
Env = new FMenuItem ("&Terminal...", View);
Env = new finalcut::FMenuItem ("&Terminal...", View);
Env->setStatusbarMessage ("Informations about this terminal");
Drive = new FMenuItem ("&Drive symbols...", View);
Drive = new finalcut::FMenuItem ("&Drive symbols...", View);
Drive->setStatusbarMessage ("Show drive symbols");
}
@ -469,7 +474,7 @@ void MyDialog::initFileMenuCallbacks()
Quit->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
// System files submenu
@ -477,21 +482,21 @@ void MyDialog::initFileMenuCallbacks()
(
"clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<FWidget::data_ptr>(File1)
static_cast<finalcut::FWidget::data_ptr>(File1)
);
File2->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<FWidget::data_ptr>(File2)
static_cast<finalcut::FWidget::data_ptr>(File2)
);
File3->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
static_cast<FWidget::data_ptr>(File3)
static_cast<finalcut::FWidget::data_ptr>(File3)
);
}
@ -555,12 +560,12 @@ void MyDialog::initHelpMenuCallback()
void MyDialog::initStatusBar()
{
// Statusbar at the bottom
FStatusBar* Statusbar = new FStatusBar (this);
finalcut::FStatusBar* Statusbar = new finalcut::FStatusBar (this);
// Statusbar keys
key_F1 = new FStatusKey (fc::Fkey_f1, "About", Statusbar);
key_F2 = new FStatusKey (fc::Fkey_f2, "View", Statusbar);
key_F3 = new FStatusKey (fc::Fkey_f3, "Quit", Statusbar);
key_F1 = new finalcut::FStatusKey (finalcut::fc::Fkey_f1, "About", Statusbar);
key_F2 = new finalcut::FStatusKey (finalcut::fc::Fkey_f2, "View", Statusbar);
key_F3 = new finalcut::FStatusKey (finalcut::fc::Fkey_f3, "Quit", Statusbar);
}
//----------------------------------------------------------------------
@ -583,7 +588,7 @@ void MyDialog::initStatusBarCallbacks()
key_F3->addCallback
(
"activate",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
@ -597,24 +602,24 @@ void MyDialog::initWidgets()
initToggleButtons();
// A text input field
myLineEdit = new FLineEdit (this);
myLineEdit = new finalcut::FLineEdit (this);
myLineEdit->setGeometry(22, 1, 10, 1);
myLineEdit->setLabelText (L"&Input");
myLineEdit->setStatusbarMessage ("Press Enter to set the title");
*myLineEdit << FString("EnTry").toLower();
*myLineEdit << finalcut::FString("EnTry").toLower();
// Buttons
initButtons();
// A multiple selection listbox
myList = new FListBox (this);
myList = new finalcut::FListBox (this);
myList->setGeometry(38, 1, 14, 17);
myList->setText ("Items");
myList->setStatusbarMessage ("99 items in a list");
myList->setMultiSelection();
for (int z = 1; z < 100; z++)
myList->insert (FString() << z << L" placeholder");
myList->insert (finalcut::FString() << z << L" placeholder");
// Text labels
initLabels();
@ -624,23 +629,23 @@ void MyDialog::initWidgets()
void MyDialog::initFlatButtons()
{
// Flat buttons
MyButton1 = new FButton (this);
MyButton1 = new finalcut::FButton (this);
MyButton1->setGeometry(3, 3, 5, 1);
MyButton1->setText (L"&SIN");
MyButton1->setStatusbarMessage ("Sine function");
MyButton1->setNoUnderline();
MyButton1->setFlat();
MyButton1->setDoubleFlatLine (fc::bottom);
MyButton1->setDoubleFlatLine (finalcut::fc::bottom);
MyButton2 = new FButton (this);
MyButton2 = new finalcut::FButton (this);
MyButton2->setGeometry(3, 5, 5, 1);
MyButton2->setText (L"&COS");
MyButton2->setStatusbarMessage ("Cosine function");
MyButton2->setNoUnderline();
MyButton2->setFlat();
MyButton2->setDoubleFlatLine (fc::top);
MyButton2->setDoubleFlatLine (finalcut::fc::top);
MyButton3 = new FButton (this);
MyButton3 = new finalcut::FButton (this);
MyButton3->setGeometry(10, 3, 5, 3);
MyButton3->setText (L"&=");
MyButton3->setStatusbarMessage ("Equal");
@ -671,15 +676,17 @@ void MyDialog::initFlatButtons()
void MyDialog::initToggleButtons()
{
// Radio buttons in a group
FButtonGroup* radioButtonGroup = new FButtonGroup ("Button", this);
finalcut::FButtonGroup* radioButtonGroup = \
new finalcut::FButtonGroup ("Button", this);
radioButtonGroup->setGeometry(3, 8, 14, 4);
//radioButtonGroup->unsetBorder();
radio1 = new FRadioButton ("E&nable", radioButtonGroup);
radio1 = new finalcut::FRadioButton ("E&nable", radioButtonGroup);
radio1->setGeometry(1, 1, 10, 1);
radio1->setStatusbarMessage ("Enable button Test");
FRadioButton* radio2 = new FRadioButton (radioButtonGroup);
finalcut::FRadioButton* radio2 = \
new finalcut::FRadioButton (radioButtonGroup);
radio2->setGeometry(1, 2, 11, 1);
radio2->setText ("&Disable");
radio2->setStatusbarMessage ("Disable button Test");
@ -687,14 +694,17 @@ void MyDialog::initToggleButtons()
//radio2->setDisable();
// Checkboxes in a group
FButtonGroup* checkButtonGroup = new FButtonGroup ("Options", this);
finalcut::FButtonGroup* checkButtonGroup = \
new finalcut::FButtonGroup ("Options", this);
checkButtonGroup->setGeometry(3, 12, 14, 4);
FCheckBox* check1 = new FCheckBox ("&Bitmode", checkButtonGroup);
finalcut::FCheckBox* check1 = \
new finalcut::FCheckBox ("&Bitmode", checkButtonGroup);
check1->setGeometry(1, 1, 11, 1);
check1->setNoUnderline();
FCheckBox* check2 = new FCheckBox ("&8-Bit", checkButtonGroup);
finalcut::FCheckBox* check2 = \
new finalcut::FCheckBox ("&8-Bit", checkButtonGroup);
check2->setGeometry(1, 2, 9, 1);
check2->setChecked();
check2->setNoUnderline();
@ -704,19 +714,19 @@ void MyDialog::initToggleButtons()
void MyDialog::initButtons()
{
// Buttons
MyButton4 = new FButton (this);
MyButton4 = new finalcut::FButton (this);
MyButton4->setGeometry(20, 8, 12, 1);
MyButton4->setText (L"&Get input");
MyButton4->setStatusbarMessage ("Take text from input field");
MyButton4->setFocus();
MyButton5 = new FButton (this);
MyButton5 = new finalcut::FButton (this);
MyButton5->setGeometry(20, 11, 12, 1);
MyButton5->setText (L"&Test");
MyButton5->setStatusbarMessage ("Progressbar testing dialog");
MyButton5->setDisable();
MyButton6 = new FButton (this);
MyButton6 = new finalcut::FButton (this);
MyButton6->setGeometry(20, 14, 12, 1);
MyButton6->setText (L"&Quit");
MyButton6->setStatusbarMessage ("Exit the program");
@ -727,7 +737,7 @@ void MyDialog::initButtons()
(
"clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText),
static_cast<FWidget::data_ptr>(myLineEdit)
static_cast<finalcut::FWidget::data_ptr>(myLineEdit)
);
MyButton5->addCallback
@ -739,7 +749,7 @@ void MyDialog::initButtons()
MyButton6->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
@ -747,24 +757,24 @@ void MyDialog::initButtons()
void MyDialog::initLabels()
{
// Text labels
FLabel* headline = new FLabel (this);
finalcut::FLabel* headline = new finalcut::FLabel (this);
headline->setGeometry(21, 3, 10, 1);
headline->setEmphasis();
headline->setAlignment (fc::alignCenter);
headline->setAlignment (finalcut::fc::alignCenter);
*headline = L"List items";
FLabel* tagged = new FLabel (L"Tagged:", this);
finalcut::FLabel* tagged = new finalcut::FLabel (L"Tagged:", this);
tagged->setGeometry(21, 4, 7, 1);
tagged_count = new FLabel(this);
tagged_count = new finalcut::FLabel(this);
tagged_count->setGeometry(29, 4, 5, 1);
*tagged_count << 0;
FLabel* sum = new FLabel (L"Sum:", this);
finalcut::FLabel* sum = new finalcut::FLabel (L"Sum:", this);
sum->setGeometry(21, 5, 7, 3);
sum->setAlignment (fc::alignRight);
sum->setAlignment (finalcut::fc::alignRight);
FLabel* sum_count = new FLabel (this);
finalcut::FLabel* sum_count = new finalcut::FLabel (this);
sum_count->setGeometry(29, 5, 5, 3);
*sum_count << myList->getCount();
}
@ -784,21 +794,21 @@ void MyDialog::initWidgetsCallbacks()
(
"toggled",
F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton),
static_cast<FWidget::data_ptr>(MyButton5)
static_cast<finalcut::FWidget::data_ptr>(MyButton5)
);
myList->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
static_cast<FWidget::data_ptr>(myLineEdit)
static_cast<finalcut::FWidget::data_ptr>(myLineEdit)
);
myList->addCallback
(
"row-selected",
F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
static_cast<FWidget::data_ptr>(tagged_count)
static_cast<finalcut::FWidget::data_ptr>(tagged_count)
);
}
@ -817,83 +827,91 @@ void MyDialog::adjustSize()
if ( myList )
myList->setHeight (getHeight() - 3, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
void MyDialog::onClose (FCloseEvent* ev)
void MyDialog::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void MyDialog::cb_noFunctionMsg (FWidget* widget, data_ptr)
void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, data_ptr)
{
FButton* button = static_cast<FButton*>(widget);
FString text = button->getText();
finalcut::FButton* button = static_cast<finalcut::FButton*>(widget);
finalcut::FString text = button->getText();
text = text.replace('&', "");
FMessageBox::error (this, "The \"" + text + "\" button has\n"
finalcut::FMessageBox::error ( this
, "The \"" + text + "\" button has\n"
"no function");
}
//----------------------------------------------------------------------
void MyDialog::cb_about (FWidget*, data_ptr)
void MyDialog::cb_about (finalcut::FWidget*, data_ptr)
{
const char libver[] = F_VERSION;
FString line(2, wchar_t(fc::BoxDrawingsHorizontal));
finalcut::FString line(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal));
FMessageBox info ( "About"
finalcut::FMessageBox info ( "About"
, line + L" The Final Cut " + line + "\n\n"
L"Version " + libver + "\n\n"
L"(c) 2018 by Markus Gans"
, FMessageBox::Ok, 0, 0, this );
, finalcut::FMessageBox::Ok, 0, 0, this );
info.setCenterText();
info.show();
}
//----------------------------------------------------------------------
void MyDialog::cb_terminfo (FWidget*, data_ptr)
void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr)
{
int x = getDesktopWidth();
int y = getDesktopHeight();
FMessageBox info1 ( "Environment"
, FString()
finalcut::FMessageBox info1 \
(
"Environment"
, finalcut::FString()
<< " Type: " << getTermType() << "\n"
<< " Name: " << getTermFileName() << "\n"
<< " Mode: " << getEncodingString() << "\n"
<< " Size: " << x << wchar_t(fc::Times)
<< " Size: " << x << wchar_t(finalcut::fc::Times)
<< y << "\n"
<< "Colors: " << getMaxColor()
, FMessageBox::Ok, 0, 0, this );
, finalcut::FMessageBox::Ok, 0, 0, this
);
info1.setHeadline("Terminal:");
info1.exec();
}
//----------------------------------------------------------------------
void MyDialog::cb_drives (FWidget*, data_ptr)
void MyDialog::cb_drives (finalcut::FWidget*, data_ptr)
{
FMessageBox info2 ( "Drive symbols"
finalcut::FMessageBox info2 \
(
"Drive symbols"
, "Generic: \n\n"
"Network: \n\n"
" CD:"
, FMessageBox::Ok, 0, 0, this );
, finalcut::FMessageBox::Ok, 0, 0, this
);
if ( isNewFont() )
{
FLabel drive (NF_Drive, &info2);
finalcut::FLabel drive (finalcut::NF_Drive, &info2);
drive.setGeometry (11, 2, 4, 1);
FLabel net (NF_Net_Drive, &info2);
finalcut::FLabel net (finalcut::NF_Net_Drive, &info2);
net.setGeometry (11, 4, 4, 1);
FLabel cd (NF_CD_ROM, &info2);
finalcut::FLabel cd (finalcut::NF_CD_ROM, &info2);
cd.setGeometry (11, 6, 4, 1);
info2.exec();
}
else
{
FLabel drive (" - ", &info2);
finalcut::FLabel drive (" - ", &info2);
drive.setGeometry (11, 2, 4, 1);
FLabel net (" N ", &info2);
finalcut::FLabel net (" N ", &info2);
net.setGeometry (11, 4, 4, 1);
FLabel cd (" CD ", &info2);
finalcut::FLabel cd (" CD ", &info2);
cd.setGeometry (11, 6, 4, 1);
if ( isMonochron() )
@ -904,12 +922,12 @@ void MyDialog::cb_drives (FWidget*, data_ptr)
}
else
{
net.setForegroundColor (fc::White);
net.setBackgroundColor (fc::DarkGray);
drive.setForegroundColor (fc::White);
drive.setBackgroundColor (fc::DarkGray);
cd.setForegroundColor (fc::White);
cd.setBackgroundColor (fc::DarkGray);
net.setForegroundColor (finalcut::fc::White);
net.setBackgroundColor (finalcut::fc::DarkGray);
drive.setForegroundColor (finalcut::fc::White);
drive.setBackgroundColor (finalcut::fc::DarkGray);
cd.setForegroundColor (finalcut::fc::White);
cd.setBackgroundColor (finalcut::fc::DarkGray);
}
info2.exec();
@ -917,7 +935,7 @@ void MyDialog::cb_drives (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_cutClipboard (FWidget*, data_ptr)
void MyDialog::cb_cutClipboard (finalcut::FWidget*, data_ptr)
{
if ( ! myLineEdit )
return;
@ -928,7 +946,7 @@ void MyDialog::cb_cutClipboard (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_copyClipboard (FWidget*, data_ptr)
void MyDialog::cb_copyClipboard (finalcut::FWidget*, data_ptr)
{
if ( ! myLineEdit )
return;
@ -937,7 +955,7 @@ void MyDialog::cb_copyClipboard (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_pasteClipboard (FWidget*, data_ptr)
void MyDialog::cb_pasteClipboard (finalcut::FWidget*, data_ptr)
{
if ( ! myLineEdit )
return;
@ -947,7 +965,7 @@ void MyDialog::cb_pasteClipboard (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_clearInput (FWidget*, data_ptr)
void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr)
{
if ( ! myLineEdit )
return;
@ -958,19 +976,19 @@ void MyDialog::cb_clearInput (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_input2buttonText (FWidget* widget, data_ptr data)
void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, data_ptr data)
{
FButton* button = static_cast<FButton*>(widget);
FLineEdit* lineedit = static_cast<FLineEdit*>(data);
finalcut::FButton* button = static_cast<finalcut::FButton*>(widget);
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(data);
button->setText( lineedit->getText() );
button->redraw();
}
//----------------------------------------------------------------------
void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr)
void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr)
{
FLineEdit* lineedit = static_cast<FLineEdit*>(widget);
FString title;
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(widget);
finalcut::FString title;
*lineedit >> title;
setTermTitle (title);
setText (title);
@ -978,17 +996,17 @@ void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr)
}
//----------------------------------------------------------------------
void MyDialog::cb_ProgressBar (FWidget*, data_ptr)
void MyDialog::cb_ProgressBar (finalcut::FWidget*, data_ptr)
{
ProgressDialog* p_dgl = new ProgressDialog(this);
p_dgl->show();
}
//----------------------------------------------------------------------
void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data)
void MyDialog::cb_updateNumber (finalcut::FWidget* widget, data_ptr data)
{
FListBox* list = static_cast<FListBox*>(widget);
FLabel* num = static_cast<FLabel*>(data);
finalcut::FListBox* list = static_cast<finalcut::FListBox*>(widget);
finalcut::FLabel* num = static_cast<finalcut::FLabel*>(data);
int select_num = 0;
uInt count = list->getCount();
@ -1002,10 +1020,10 @@ void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data)
}
//----------------------------------------------------------------------
void MyDialog::cb_activateButton (FWidget* widget, data_ptr data)
void MyDialog::cb_activateButton (finalcut::FWidget* widget, data_ptr data)
{
FRadioButton* rb = static_cast<FRadioButton*>(widget);
FButton* button = static_cast<FButton*>(data);
finalcut::FRadioButton* rb = static_cast<finalcut::FRadioButton*>(widget);
finalcut::FButton* button = static_cast<finalcut::FButton*>(data);
if ( rb->isChecked() )
button->setEnable();
@ -1016,26 +1034,26 @@ void MyDialog::cb_activateButton (FWidget* widget, data_ptr data)
}
//----------------------------------------------------------------------
void MyDialog::cb_view (FWidget*, data_ptr data)
void MyDialog::cb_view (finalcut::FWidget*, data_ptr data)
{
FString file;
FMenuItem* item = static_cast<FMenuItem*>(data);
finalcut::FString file;
finalcut::FMenuItem* item = static_cast<finalcut::FMenuItem*>(data);
if ( item && ! item->getText().isEmpty() )
file = item->getText();
else
file = FFileDialog::fileOpenChooser (this);
file = finalcut::FFileDialog::fileOpenChooser (this);
if ( file.isNull() )
return;
TextWindow* view = new TextWindow(this);
FString filename(basename(const_cast<char*>(file.c_str())));
finalcut::FString filename(basename(const_cast<char*>(file.c_str())));
view->setText ("Viewer: " + filename);
view->setGeometry (1 + int((getRootWidget()->getWidth() - 60) / 2),
view->setGeometry ( 1 + int((getRootWidget()->getWidth() - 60) / 2),
int(getRootWidget()->getHeight() / 6),
60,
int(getRootWidget()->getHeight() * 3 / 4));
int(getRootWidget()->getHeight() * 3 / 4) );
view->setResizeable();
std::string line = "";
@ -1055,10 +1073,10 @@ void MyDialog::cb_view (FWidget*, data_ptr data)
}
//----------------------------------------------------------------------
void MyDialog::cb_setInput (FWidget* widget, data_ptr data)
void MyDialog::cb_setInput (finalcut::FWidget* widget, data_ptr data)
{
FListBox* ListBox = static_cast<FListBox*>(widget);
FLineEdit* lineedit = static_cast<FLineEdit*>(data);
finalcut::FListBox* ListBox = static_cast<finalcut::FListBox*>(widget);
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(data);
*lineedit = ListBox->getItem(ListBox->currentItem()).getText();
lineedit->redraw();
}
@ -1070,11 +1088,13 @@ void MyDialog::cb_setInput (FWidget* widget, data_ptr data)
int main (int argc, char* argv[])
{
FString ver = F_VERSION; // Library version
FString title = "The FINAL CUT " + ver + " (C) 2018 by Markus Gans";
finalcut::FString ver = F_VERSION; // Library version
finalcut::FString title = "The FINAL CUT "
+ ver
+ " (C) 2018 by Markus Gans";
// Create the application object app
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
app.redefineDefaultColors(true);
app.setTermTitle (title);

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -31,11 +31,11 @@
#pragma pack(push)
#pragma pack(1)
class Watch : public FDialog
class Watch : public finalcut::FDialog
{
public:
// Constructor
explicit Watch (FWidget* = 0);
explicit Watch (finalcut::FWidget* = 0);
// Destructor
~Watch();
@ -44,12 +44,12 @@ class Watch : public FDialog
void printTime();
// Event handlers
void onTimer (FTimerEvent*);
void onClose (FCloseEvent*);
void onTimer (finalcut::FTimerEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback methods
void cb_clock (FWidget*, data_ptr);
void cb_seconds (FWidget*, data_ptr);
void cb_clock (finalcut::FWidget*, data_ptr);
void cb_seconds (finalcut::FWidget*, data_ptr);
protected:
// Method
@ -64,16 +64,16 @@ class Watch : public FDialog
// Data Members
bool sec;
FLabel* time_label;
FLabel* time_str;
FSwitch* clock_sw;
FSwitch* seconds_sw;
finalcut::FLabel* time_label;
finalcut::FLabel* time_str;
finalcut::FSwitch* clock_sw;
finalcut::FSwitch* seconds_sw;
};
#pragma pack(pop)
//----------------------------------------------------------------------
Watch::Watch (FWidget* parent)
: FDialog(parent)
: finalcut::FDialog(parent)
, sec(true)
, time_label(0)
, time_str(0)
@ -85,21 +85,21 @@ Watch::Watch (FWidget* parent)
setGeometry (1 + (pw - 22) / 2, 3, 22, 13);
// Create labels
time_label = new FLabel(L"Time", this);
time_label = new finalcut::FLabel(L"Time", this);
time_label->setGeometry(5, 2, 5, 1);
time_label->setEmphasis();
time_str = new FLabel(L"--:--:--", this);
time_str = new finalcut::FLabel(L"--:--:--", this);
time_str->setGeometry(10, 2, 8, 1);
// Create checkbox buttons
clock_sw = new FSwitch(L"Clock", this);
seconds_sw = new FSwitch(L"Seconds", this);
clock_sw = new finalcut::FSwitch(L"Clock", this);
seconds_sw = new finalcut::FSwitch(L"Seconds", this);
clock_sw->setGeometry(4, 4, 9, 1);
seconds_sw->setGeometry(2, 6, 11, 1);
sec = seconds_sw->setChecked();
// Create button
FButton* quit_btn = new FButton(L"&Quit", this);
finalcut::FButton* quit_btn = new finalcut::FButton(L"&Quit", this);
quit_btn->setGeometry(6, 9, 9, 1);
// Connect switch signal "toggled" with a callback member function
@ -120,7 +120,7 @@ Watch::Watch (FWidget* parent)
quit_btn->addCallback
(
"clicked",
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
);
}
@ -133,7 +133,7 @@ Watch::~Watch()
//----------------------------------------------------------------------
void Watch::printTime()
{
FString str;
finalcut::FString str;
std::tm now;
std::time_t t;
@ -150,19 +150,19 @@ void Watch::printTime()
}
//----------------------------------------------------------------------
void Watch::onTimer (FTimerEvent*)
void Watch::onTimer (finalcut::FTimerEvent*)
{
printTime();
}
//----------------------------------------------------------------------
void Watch::onClose (FCloseEvent* ev)
void Watch::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void Watch::cb_clock (FWidget*, data_ptr)
void Watch::cb_clock (finalcut::FWidget*, data_ptr)
{
if ( clock_sw->isChecked() )
{
@ -178,7 +178,7 @@ void Watch::cb_clock (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Watch::cb_seconds (FWidget*, data_ptr)
void Watch::cb_seconds (finalcut::FWidget*, data_ptr)
{
if ( seconds_sw->isChecked() )
sec = true;
@ -203,7 +203,7 @@ void Watch::adjustSize()
{
int pw = getParentWidget()->getWidth();
setX (1 + (pw - 22) / 2, false);
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
@ -212,7 +212,7 @@ void Watch::adjustSize()
int main (int argc, char* argv[])
{
// Create the application object
FApplication app(argc, argv);
finalcut::FApplication app(argc, argv);
// Create a simple dialog box
Watch w(&app);

View File

@ -31,11 +31,11 @@
#pragma pack(push)
#pragma pack(1)
class SmallWindow : public FDialog
class SmallWindow : public finalcut::FDialog
{
public:
// Constructor
explicit SmallWindow (FWidget* = 0);
explicit SmallWindow (finalcut::FWidget* = 0);
// Destructor
~SmallWindow();
@ -51,21 +51,21 @@ class SmallWindow : public FDialog
void adjustSize();
// Event handlers
void onShow (FShowEvent*);
void onTimer (FTimerEvent*);
void onShow (finalcut::FShowEvent*);
void onTimer (finalcut::FTimerEvent*);
// Data Members
FLabel* left_arrow;
FLabel* right_arrow;
FLabel* top_left_label;
FLabel* top_right_label;
FLabel* bottom_label;
finalcut::FLabel* left_arrow;
finalcut::FLabel* right_arrow;
finalcut::FLabel* top_left_label;
finalcut::FLabel* top_right_label;
finalcut::FLabel* bottom_label;
};
#pragma pack(pop)
//----------------------------------------------------------------------
SmallWindow::SmallWindow (FWidget* parent)
: FDialog(parent)
SmallWindow::SmallWindow (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, left_arrow()
, right_arrow()
, top_left_label()
@ -74,39 +74,39 @@ SmallWindow::SmallWindow (FWidget* parent)
{
wchar_t arrow_up, arrow_down;
arrow_up = fc::BlackUpPointingTriangle;
arrow_down = fc::BlackDownPointingTriangle;
arrow_up = finalcut::fc::BlackUpPointingTriangle;
arrow_down = finalcut::fc::BlackDownPointingTriangle;
left_arrow = new FLabel (arrow_up, this);
left_arrow = new finalcut::FLabel (arrow_up, this);
left_arrow->setForegroundColor (wc.label_inactive_fg);
left_arrow->setEmphasis();
left_arrow->ignorePadding();
left_arrow->setGeometry (2, 2, 1, 1);
right_arrow = new FLabel (arrow_up, this);
right_arrow = new finalcut::FLabel (arrow_up, this);
right_arrow->setForegroundColor (wc.label_inactive_fg);
right_arrow->setEmphasis();
right_arrow->ignorePadding();
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
const FString& top_left_label_text = "menu";
top_left_label = new FLabel (top_left_label_text, this);
const finalcut::FString& top_left_label_text = "menu";
top_left_label = new finalcut::FLabel (top_left_label_text, this);
top_left_label->setForegroundColor (wc.label_inactive_fg);
top_left_label->setEmphasis();
top_left_label->setGeometry (1, 1, 6, 1);
const FString& top_right_label_text = "zoom";
top_right_label = new FLabel (top_right_label_text, this);
top_right_label->setAlignment (fc::alignRight);
const finalcut::FString& top_right_label_text = "zoom";
top_right_label = new finalcut::FLabel (top_right_label_text, this);
top_right_label->setAlignment (finalcut::fc::alignRight);
top_right_label->setForegroundColor (wc.label_inactive_fg);
top_right_label->setEmphasis();
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
FString bottom_label_text = "resize\n"
finalcut::FString bottom_label_text = "resize\n"
"corner\n";
bottom_label_text += arrow_down;
bottom_label = new FLabel (bottom_label_text, this);
bottom_label->setAlignment (fc::alignRight);
bottom_label = new finalcut::FLabel (bottom_label_text, this);
bottom_label->setAlignment (finalcut::fc::alignRight);
bottom_label->setForegroundColor (wc.label_inactive_fg);
bottom_label->setEmphasis();
bottom_label->setGeometry (13, 3, 6, 3);
@ -133,20 +133,20 @@ void SmallWindow::adjustSize()
bottom_label->setVisible();
}
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
bottom_label->setGeometry (1, getClientHeight() - 2, getClientWidth(), 3);
}
//----------------------------------------------------------------------
void SmallWindow::onShow (FShowEvent*)
void SmallWindow::onShow (finalcut::FShowEvent*)
{
addTimer(1000);
}
//----------------------------------------------------------------------
void SmallWindow::onTimer (FTimerEvent*)
void SmallWindow::onTimer (finalcut::FTimerEvent*)
{
left_arrow->unsetEmphasis();
left_arrow->redraw();
@ -170,23 +170,23 @@ void SmallWindow::onTimer (FTimerEvent*)
#pragma pack(push)
#pragma pack(1)
class Window : public FDialog
class Window : public finalcut::FDialog
{
public:
// Constructor
explicit Window (FWidget* = 0);
explicit Window (finalcut::FWidget* = 0);
// Destructor
~Window();
private:
// Typedefs
typedef void (Window::*WindowCallback)(FWidget*, data_ptr);
typedef void (FApplication::*FAppCallback)(FWidget*, data_ptr);
typedef void (Window::*WindowCallback)(finalcut::FWidget*, data_ptr);
typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, data_ptr);
typedef struct
{
bool is_open;
FString* title;
finalcut::FString* title;
SmallWindow* dgl;
}
win_data;
@ -198,22 +198,22 @@ class Window : public FDialog
Window& operator = (const Window&);
// Method
void createFileMenuItems (FMenu*);
void createFileMenuItems (finalcut::FMenu*);
void createDialogButtons();
void activateWindow (FDialog*);
void activateWindow (finalcut::FDialog*);
void adjustSize();
void addClickedCallback (FWidget*, WindowCallback);
void addClickedCallback (FWidget*, FAppCallback);
void addClickedCallback (finalcut::FWidget*, WindowCallback);
void addClickedCallback (finalcut::FWidget*, FAppCallback);
// Event handlers
void onClose (FCloseEvent*);
void onClose (finalcut::FCloseEvent*);
// Callback methods
void cb_createWindows (FWidget*, data_ptr);
void cb_closeWindows (FWidget*, data_ptr);
void cb_next (FWidget*, data_ptr);
void cb_previous (FWidget*, data_ptr);
void cb_destroyWindow (FWidget*, data_ptr);
void cb_createWindows (finalcut::FWidget*, data_ptr);
void cb_closeWindows (finalcut::FWidget*, data_ptr);
void cb_next (finalcut::FWidget*, data_ptr);
void cb_previous (finalcut::FWidget*, data_ptr);
void cb_destroyWindow (finalcut::FWidget*, data_ptr);
// Data Members
std::vector<win_data*> windows;
@ -221,26 +221,26 @@ class Window : public FDialog
#pragma pack(pop)
//----------------------------------------------------------------------
Window::Window (FWidget* parent)
: FDialog(parent)
Window::Window (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
, windows()
{
FMenu* File;
FDialogListMenu* DglList;
FString drop_down_symbol;
FMenuBar* Menubar;
FStatusBar* Statusbar;
finalcut::FMenu* File;
finalcut::FDialogListMenu* DglList;
finalcut::FString drop_down_symbol;
finalcut::FMenuBar* Menubar;
finalcut::FStatusBar* Statusbar;
// Menu bar
Menubar = new FMenuBar (this);
Menubar = new finalcut::FMenuBar (this);
// Menu bar item
File = new FMenu ("&File", Menubar);
File = new finalcut::FMenu ("&File", Menubar);
File->setStatusbarMessage ("File management commands");
// Dialog list menu item
drop_down_symbol = wchar_t(fc::BlackDownPointingTriangle);
DglList = new FDialogListMenu (drop_down_symbol, Menubar);
drop_down_symbol = wchar_t(finalcut::fc::BlackDownPointingTriangle);
DglList = new finalcut::FDialogListMenu (drop_down_symbol, Menubar);
DglList->setStatusbarMessage ("List of all the active dialogs");
// File menu items
@ -250,7 +250,7 @@ Window::Window (FWidget* parent)
createDialogButtons();
// Statusbar at the bottom
Statusbar = new FStatusBar (this);
Statusbar = new finalcut::FStatusBar (this);
Statusbar->setMessage("Status bar message");
// Generate data vector for the windows
@ -258,7 +258,7 @@ Window::Window (FWidget* parent)
{
win_data* win_dat = new win_data;
win_dat->is_open = false;
win_dat->title = new FString();
win_dat->title = new finalcut::FString();
win_dat->title->sprintf("Window %d", n);
windows.push_back(win_dat);
}
@ -285,31 +285,31 @@ Window::~Window()
}
//----------------------------------------------------------------------
void Window::createFileMenuItems (FMenu* File)
void Window::createFileMenuItems (finalcut::FMenu* File)
{
// "File" menu item
FMenuItem* New = new FMenuItem ("&New", File);
finalcut::FMenuItem* New = new finalcut::FMenuItem ("&New", File);
New->setStatusbarMessage ("Create the windows");
FMenuItem* Close = new FMenuItem ("&Close", File);
finalcut::FMenuItem* Close = new finalcut::FMenuItem ("&Close", File);
Close->setStatusbarMessage ("Close the windows");
FMenuItem* Line1 = new FMenuItem (File);
finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File);
Line1->setSeparator();
FMenuItem* Next = new FMenuItem ("Ne&xt window", File);
Next->addAccelerator (fc::Fmkey_npage); // Meta/Alt + PgDn
finalcut::FMenuItem* Next = new finalcut::FMenuItem ("Ne&xt window", File);
Next->addAccelerator (finalcut::fc::Fmkey_npage); // Meta/Alt + PgDn
Next->setStatusbarMessage ("Switch to the next window");
FMenuItem* Previous = new FMenuItem ("&Previous window", File);
Previous->addAccelerator (fc::Fmkey_ppage); // Meta/Alt + PgUp
finalcut::FMenuItem* Previous = new finalcut::FMenuItem ("&Previous window", File);
Previous->addAccelerator (finalcut::fc::Fmkey_ppage); // Meta/Alt + PgUp
Previous->setStatusbarMessage ("Switch to the previous window");
FMenuItem* Line2 = new FMenuItem (File);
finalcut::FMenuItem* Line2 = new finalcut::FMenuItem (File);
Line2->setSeparator();
FMenuItem* Quit = new FMenuItem ("&Quit", File);
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
finalcut::FMenuItem* Quit = new finalcut::FMenuItem ("&Quit", File);
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit->setStatusbarMessage ("Exit the program");
// Add menu item callback
@ -317,38 +317,38 @@ void Window::createFileMenuItems (FMenu* File)
addClickedCallback (Close, &Window::cb_closeWindows);
addClickedCallback (Next, &Window::cb_next);
addClickedCallback (Previous, &Window::cb_previous);
addClickedCallback (Quit, &FApplication::cb_exitApp);
addClickedCallback (Quit, &finalcut::FApplication::cb_exitApp);
}
//----------------------------------------------------------------------
void Window::createDialogButtons()
{
// Dialog buttons
FButton* CreateButton = new FButton (this);
finalcut::FButton* CreateButton = new finalcut::FButton (this);
CreateButton->setGeometry(2, 2, 9, 1);
CreateButton->setText (L"&Create");
FButton* CloseButton = new FButton (this);
finalcut::FButton* CloseButton = new finalcut::FButton (this);
CloseButton->setGeometry(15, 2, 9, 1);
CloseButton->setText (L"C&lose");
FButton* QuitButton = new FButton (this);
finalcut::FButton* QuitButton = new finalcut::FButton (this);
QuitButton->setGeometry(28, 2, 9, 1);
QuitButton->setText (L"&Quit");
// Add button callback
addClickedCallback (CreateButton, &Window::cb_createWindows);
addClickedCallback (CloseButton, &Window::cb_closeWindows);
addClickedCallback (QuitButton, &FApplication::cb_exitApp);
addClickedCallback (QuitButton, &finalcut::FApplication::cb_exitApp);
}
//----------------------------------------------------------------------
void Window::activateWindow (FDialog* win)
void Window::activateWindow (finalcut::FDialog* win)
{
if ( ! win || win->isWindowHidden() || win->isWindowActive() )
return;
bool has_raised = FWindow::raiseWindow(win);
bool has_raised = finalcut::FWindow::raiseWindow(win);
win->activateDialog();
if ( has_raised )
@ -387,14 +387,15 @@ void Window::adjustSize()
++iter;
}
FDialog::adjustSize();
finalcut::FDialog::adjustSize();
}
//----------------------------------------------------------------------
void Window::addClickedCallback (FWidget* widget, WindowCallback call)
void Window::addClickedCallback ( finalcut::FWidget* widget
, WindowCallback call )
{
FMemberCallback callback
= reinterpret_cast<FWidget::FMemberCallback>(call);
= reinterpret_cast<finalcut::FWidget::FMemberCallback>(call);
widget->addCallback
(
@ -404,10 +405,11 @@ void Window::addClickedCallback (FWidget* widget, WindowCallback call)
}
//----------------------------------------------------------------------
void Window::addClickedCallback (FWidget* widget, FAppCallback call)
void Window::addClickedCallback ( finalcut::FWidget* widget
, FAppCallback call )
{
FMemberCallback callback
= reinterpret_cast<FWidget::FMemberCallback>(call);
= reinterpret_cast<finalcut::FWidget::FMemberCallback>(call);
widget->addCallback
(
@ -417,13 +419,13 @@ void Window::addClickedCallback (FWidget* widget, FAppCallback call)
}
//----------------------------------------------------------------------
void Window::onClose (FCloseEvent* ev)
void Window::onClose (finalcut::FCloseEvent* ev)
{
FApplication::closeConfirmationDialog (this, ev);
finalcut::FApplication::closeConfirmationDialog (this, ev);
}
//----------------------------------------------------------------------
void Window::cb_createWindows (FWidget*, data_ptr)
void Window::cb_createWindows (finalcut::FWidget*, data_ptr)
{
std::vector<win_data*>::const_iterator iter, first;
iter = first = windows.begin();
@ -453,7 +455,7 @@ void Window::cb_createWindows (FWidget*, data_ptr)
(
"destroy",
F_METHOD_CALLBACK (this, &Window::cb_destroyWindow),
static_cast<FWidget::data_ptr>(win_dat)
static_cast<finalcut::FWidget::data_ptr>(win_dat)
);
}
@ -464,12 +466,12 @@ void Window::cb_createWindows (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Window::cb_closeWindows (FWidget*, data_ptr)
void Window::cb_closeWindows (finalcut::FWidget*, data_ptr)
{
if ( ! dialog_list || dialog_list->empty() )
return;
widgetList::const_iterator iter, first;
finalcut::FWidget::widgetList::const_iterator iter, first;
iter = dialog_list->end();
first = dialog_list->begin();
activateWindow(this);
@ -485,20 +487,20 @@ void Window::cb_closeWindows (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Window::cb_next (FWidget*, data_ptr)
void Window::cb_next (finalcut::FWidget*, data_ptr)
{
if ( ! dialog_list || dialog_list->empty() )
return;
widgetList::const_iterator iter;
finalcut::FWidget::widgetList::const_iterator iter;
iter = dialog_list->begin();
while ( iter != dialog_list->end() )
{
if ( static_cast<FWindow*>(*iter)->isWindowActive() )
if ( static_cast<finalcut::FWindow*>(*iter)->isWindowActive() )
{
FDialog* next;
widgetList::const_iterator next_element;
finalcut::FDialog* next;
finalcut::FWidget::widgetList::const_iterator next_element;
next_element = iter;
do
@ -508,7 +510,7 @@ void Window::cb_next (FWidget*, data_ptr)
if ( next_element == dialog_list->end() )
next_element = dialog_list->begin();
next = static_cast<FDialog*>(*next_element);
next = static_cast<finalcut::FDialog*>(*next_element);
} while ( ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
@ -523,12 +525,12 @@ void Window::cb_next (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Window::cb_previous (FWidget*, data_ptr)
void Window::cb_previous (finalcut::FWidget*, data_ptr)
{
if ( ! dialog_list || dialog_list->empty() )
return;
widgetList::const_iterator iter;
finalcut::FWidget::widgetList::const_iterator iter;
iter = dialog_list->end();
do
@ -536,10 +538,10 @@ void Window::cb_previous (FWidget*, data_ptr)
--iter;
if ( (*iter)->isDialogWidget()
&& static_cast<FWindow*>(*iter)->isWindowActive() )
&& static_cast<finalcut::FWindow*>(*iter)->isWindowActive() )
{
FDialog* prev;
widgetList::const_iterator prev_element;
finalcut::FDialog* prev;
finalcut::FWidget::widgetList::const_iterator prev_element;
prev_element = iter;
do
@ -548,7 +550,7 @@ void Window::cb_previous (FWidget*, data_ptr)
prev_element = dialog_list->end();
--prev_element;
prev = static_cast<FDialog*>(*prev_element);
prev = static_cast<finalcut::FDialog*>(*prev_element);
} while ( ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
@ -562,7 +564,7 @@ void Window::cb_previous (FWidget*, data_ptr)
}
//----------------------------------------------------------------------
void Window::cb_destroyWindow (FWidget*, data_ptr data)
void Window::cb_destroyWindow (finalcut::FWidget*, data_ptr data)
{
win_data* win_dat = static_cast<win_data*>(data);
@ -581,7 +583,7 @@ void Window::cb_destroyWindow (FWidget*, data_ptr data)
int main (int argc, char* argv[])
{
// Create the application object
FApplication app (argc, argv);
finalcut::FApplication app (argc, argv);
// Create main dialog object
Window main_dlg (&app);

View File

@ -8,8 +8,9 @@ FONTFILE="8x16graph.bdf"
echo -e "// newfont.h\\n"
echo -e "#ifndef FNEWFONT_H"
echo -e "#define FNEWFONT_H\\n"
echo -e "namespace fc\\n{"
echo -e "\\nstatic unsigned char __8x16graph[] =\\n{"
echo -e "namespace finalcut\\n{\\n"
echo -e "namespace fc\\n{\\n"
echo -e "static unsigned char __8x16graph[] =\\n{"
grep -A${HEIGHT} ^BITMAP "$FONTFILE" \
| tr '\n' ',' \
@ -28,6 +29,7 @@ FONTFILE="8x16graph.bdf"
echo -e "};"
echo -e "\\n} // namespace fc"
echo -e "\\n} // namespace finalcut"
echo -e "\\n#endif // FNEWFONT_H"
) > newfont.h

View File

@ -8,6 +8,7 @@ FONTFILE="8x16std"
echo -e "// vgafont.h\\n"
echo -e "#ifndef FVGAFONT_H"
echo -e "#define FVGAFONT_H\\n"
echo -e "namespace finalcut\\n{\\n"
echo -e "namespace fc\\n{\\n"
xxd -g 1 -i -c $HEIGHT $FONTFILE \
@ -26,5 +27,6 @@ FONTFILE="8x16std"
done
echo -e "\\n} // namespace fc"
echo -e "\\n} // namespace finalcut"
echo -e "\\n#endif // FVGAFONT_H"
) > vgafont.h

View File

@ -3,6 +3,9 @@
#ifndef FNEWFONT_H
#define FNEWFONT_H
namespace finalcut
{
namespace fc
{
@ -268,4 +271,6 @@ static unsigned char __8x16graph[] =
} // namespace fc
} // namespace finalcut
#endif // FNEWFONT_H

View File

@ -3,6 +3,9 @@
#ifndef FUNICODEMAP_H
#define FUNICODEMAP_H
namespace finalcut
{
namespace fc
{
@ -318,4 +321,6 @@ static struct unipair unicode_cp437_pairs[] =
} // namespace fc
} // namespace finalcut
#endif // FUNICODEMAP_H

View File

@ -3,6 +3,9 @@
#ifndef FVGAFONT_H
#define FVGAFONT_H
namespace finalcut
{
namespace fc
{
@ -268,4 +271,6 @@ static unsigned char __8x16std[] =
} // namespace fc
} // namespace finalcut
#endif // FVGAFONT_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -29,6 +29,9 @@
#include "final/fstring.h"
namespace finalcut
{
namespace fc
{
@ -90,4 +93,6 @@ inline void emptyFString::clear()
} // namespace fc
} // namespace finalcut
#endif // EMPTYFSTRING_H

View File

@ -69,6 +69,8 @@
#include "final/fwidget.h"
#include "final/fwindow.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FApplication
@ -241,5 +243,6 @@ inline FWidget* FApplication::getFocusWidget() const
inline void FApplication::cb_exitApp (FWidget*, data_ptr)
{ close(); }
} // namespace finalcut
#endif // FAPPLICATION_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2012-2017 Markus Gans *
* Copyright 2012-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -54,6 +54,8 @@
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FButton
@ -274,4 +276,6 @@ inline bool FButton::hasShadow() const
inline bool FButton::hasClickAnimation()
{ return click_animation; }
} // namespace finalcut
#endif // FBUTTON_H

View File

@ -55,6 +55,8 @@
#include "final/fscrollview.h"
namespace finalcut
{
// class forward declaration
class FToggleButton;
@ -170,4 +172,6 @@ inline uInt FButtonGroup::getCount() const
inline FString& FButtonGroup::getText()
{ return text; }
} // namespace finalcut
#endif // FBUTTONGROUP_H

View File

@ -41,6 +41,8 @@
#define OSC ESC "]" // Operating system command (7-bit)
#define SECDA ESC "[>c" // Secondary Device Attributes
namespace finalcut
{
//----------------------------------------------------------------------
// Global constants and enumerations
@ -1135,4 +1137,6 @@ enum termcaps
} // namespace fc
} // namespace finalcut
#endif // FC_H

View File

@ -30,6 +30,9 @@
#include "final/fc.h"
#include "final/ftypes.h"
namespace finalcut
{
namespace fc
{
@ -327,4 +330,6 @@ const uInt lastCP437Item = uInt ( sizeof(cp437_to_ucs)
/ sizeof(cp437_to_ucs[0]) ) - 1;
} // namespace fc
} // namespace finalcut
#endif // FCHARMAP_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2014-2017 Markus Gans *
* Copyright 2014-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -59,6 +59,8 @@
#include "final/ftogglebutton.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FCheckBox
@ -100,4 +102,6 @@ class FCheckBox : public FToggleButton
inline const char* FCheckBox::getClassName() const
{ return "FCheckBox"; }
} // namespace finalcut
#endif // FCHECKBOX_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -59,6 +59,8 @@
#include "final/fmenuitem.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FCheckMenuItem
@ -100,4 +102,6 @@ class FCheckMenuItem : public FMenuItem
inline const char* FCheckMenuItem::getClassName() const
{ return "FCheckMenuItem"; }
} // namespace finalcut
#endif // FCHECKMENUITEM_H

View File

@ -31,8 +31,14 @@
#ifndef FCOLORPALETTE_H
#define FCOLORPALETTE_H
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
#error "Only <final/final.h> can be included directly."
#endif
#include "final/fc.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FColorPalette
@ -69,4 +75,6 @@ class FColorPalette
inline const char* FColorPalette::getClassName() const
{ return "FColorPalette"; }
} // namespace finalcut
#endif // FCOLORPALETTE_H

View File

@ -61,6 +61,8 @@
#include "final/ftooltip.h"
#include "final/fwindow.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FDialog
@ -285,6 +287,6 @@ inline bool FDialog::isModal()
inline bool FDialog::isScrollable()
{ return ((flags & fc::scrollable) != 0); }
} // namespace finalcut
#endif // FDIALOG_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2016-2017 Markus Gans *
* Copyright 2016-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -65,6 +65,8 @@
#include "final/fmenu.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FDialogListMenu
@ -104,4 +106,6 @@ class FDialogListMenu : public FMenu
inline const char* FDialogListMenu::getClassName() const
{ return "FDialogListMenu"; }
} // namespace finalcut
#endif // FDIALOGLISTMENU_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2014-2017 Markus Gans *
* Copyright 2014-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -79,6 +79,8 @@
#include "final/fc.h"
#include "final/fpoint.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FEvent
@ -336,4 +338,6 @@ class FTimerEvent : public FEvent // timer event
#pragma pack(pop)
} // namespace finalcut
#endif // FEVENT_H

View File

@ -81,6 +81,8 @@
#include "final/fstatusbar.h"
#include "final/fterm.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FFileDialog
@ -231,4 +233,6 @@ inline bool FFileDialog::unsetShowHiddenFiles()
inline bool FFileDialog::getShowHiddenFiles()
{ return show_hidden; }
} // namespace finalcut
#endif // FFILEDIALOG_H

View File

@ -30,6 +30,9 @@
#include <string>
#include "final/ftypes.h"
namespace finalcut
{
namespace fc
{
@ -39,4 +42,6 @@ extern keyname FkeyName[];
} // namespace fc
} // namespace finalcut
#endif // FKEYMAP_H

View File

@ -42,6 +42,9 @@
#include "final/ftermlinux.h"
#endif
namespace finalcut
{
// class forward declaration
class FApplication;
@ -252,4 +255,6 @@ inline bool FKeyboard::setNonBlockingInput()
inline bool FKeyboard::unsetNonBlockingInput()
{ return setNonBlockingInput(false); }
} // namespace finalcut
#endif // FKEYBOARD_H

View File

@ -56,6 +56,8 @@
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FLabel
@ -225,4 +227,6 @@ inline bool FLabel::hasReverseMode()
inline void FLabel::clear()
{ text.clear(); }
} // namespace finalcut
#endif // FLABEL_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2012-2017 Markus Gans *
* Copyright 2012-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -55,6 +55,8 @@
#include "final/fwidget.h"
#include "final/flabel.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FLineEdit
@ -227,4 +229,6 @@ inline bool FLineEdit::unsetShadow()
inline bool FLineEdit::hasShadow()
{ return ((flags & fc::shadow) != 0); }
} // namespace finalcut
#endif // FLINEEDIT_H

View File

@ -59,6 +59,8 @@
#include "final/fstring.h"
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FListBoxItem
@ -532,4 +534,6 @@ inline FListBox::listBoxItems::iterator FListBox::index2iterator (int index)
return iter;
}
} // namespace finalcut
#endif // FLISTBOX_H

View File

@ -60,6 +60,9 @@
#include "final/ftermbuffer.h"
#include "final/fwidget.h"
namespace finalcut
{
// class forward declaration
class FListView;
@ -473,4 +476,6 @@ inline FObject::FObjectIterator FListView::endOfList()
inline void FListView::scrollTo (const FPoint& pos)
{ scrollTo(pos.getX(), pos.getY()); }
} // namespace finalcut
#endif // FLISTVIEW_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -64,6 +64,8 @@
#include "final/fmenulist.h"
#include "final/fmenuitem.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FMenu
@ -327,5 +329,6 @@ inline FMenu* FMenu::superMenuAt (const FPoint& p)
inline void FMenu::onAccel (FAccelEvent* ev)
{ item->onAccel(ev); }
} // namespace finalcut
#endif // FMENU_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -63,6 +63,8 @@
#include "final/fmenulist.h"
#include "final/fwindow.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FMenuBar
@ -166,4 +168,6 @@ inline const char* FMenuBar::getClassName() const
inline bool FMenuBar::isMenu (FMenuItem* mi) const
{ return mi->hasMenu(); }
} // namespace finalcut
#endif // FMENUBAR_H

View File

@ -58,6 +58,9 @@
#include "final/fwidget.h"
namespace finalcut
{
// class forward declaration
class FDialog;
class FMenu;
@ -270,4 +273,6 @@ inline FWidget* FMenuItem::getSuperMenu() const
inline void FMenuItem::setSuperMenu (FWidget* smenu)
{ super_menu = smenu; }
} // namespace finalcut
#endif // FMENUITEM_H

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2015-2017 Markus Gans *
* Copyright 2015-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
@ -48,6 +48,8 @@
#include "final/fmenuitem.h"
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FMenuList
@ -139,4 +141,6 @@ inline bool FMenuList::isSelected(int index) const
inline bool FMenuList::hasSelectedItem() const
{ return selected_item; }
} // namespace finalcut
#endif // FMENULIST_H

View File

@ -68,6 +68,8 @@
#include "final/fdialog.h"
#include "final/fterm.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FMessageBox
@ -205,4 +207,6 @@ inline bool FMessageBox::setCenterText()
inline bool FMessageBox::unsetCenterText()
{ return setCenterText(false); }
} // namespace finalcut
#endif // FMESSAGEBOX_H

View File

@ -76,6 +76,8 @@
#undef buttons // from term.h
#endif
namespace finalcut
{
//----------------------------------------------------------------------
// class FMouse
@ -249,7 +251,7 @@ inline bool FMouseGPM::disableGpmMouse()
//----------------------------------------------------------------------
inline bool FMouseGPM::isGpmMouseEnabled()
{ return gpm_mouse_enabled; }
#endif
#endif // F_HAVE_LIBGPM
//----------------------------------------------------------------------
@ -528,4 +530,6 @@ inline void FMouseControl::enableXTermMouse()
inline void FMouseControl::disableXTermMouse()
{ xtermMouse(false); }
} // namespace finalcut
#endif // FMOUSE_H

View File

@ -46,7 +46,8 @@
#include "final/fevent.h"
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FObject
@ -194,6 +195,8 @@ inline bool FObject::isInstanceOf (const char classname[]) const
inline bool FObject::isTimerInUpdating() const
{ return timer_modify_lock; }
} // namespace finalcut
//----------------------------------------------------------------------
// Operator functions for timeval

View File

@ -61,6 +61,8 @@
#include "final/fc.h"
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FOptiAttr
@ -413,4 +415,6 @@ inline void FOptiAttr::setDefaultColorSupport()
inline void FOptiAttr::unsetDefaultColorSupport()
{ ansi_default_color = false; }
} // namespace finalcut
#endif // FOPTIATTR_H

View File

@ -49,12 +49,12 @@
typedef unsigned int chtype;
#else
typedef unsigned long chtype;
#endif
#endif // _LP64
#include <term.h> // need for tparm
#else
#include <term.h> // need for tparm
#endif
#endif // defined(__sun) && defined(__SVR4)
#include <cctype>
#include <climits>
@ -65,6 +65,9 @@
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FOptiMove
//----------------------------------------------------------------------
@ -333,4 +336,6 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap)
inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
{ eat_nl_glitch = bcap; }
} // namespace finalcut
#endif // FOPTIMOVE_H

View File

@ -37,6 +37,8 @@
#include <iostream>
namespace finalcut
{
//----------------------------------------------------------------------
// class FPoint
@ -151,4 +153,6 @@ inline short& FPoint::x_ref()
inline short& FPoint::y_ref()
{ return ypos; }
} // namespace finalcut
#endif // FPOINT_H

View File

@ -54,6 +54,8 @@
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FProgressbar
@ -126,5 +128,6 @@ inline bool FProgressbar::unsetShadow()
inline bool FProgressbar::hasShadow()
{ return ((flags & fc::shadow) != 0); }
} // namespace finalcut
#endif // FPROGRESSBAR_H

View File

@ -59,6 +59,8 @@
#include "final/ftogglebutton.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FRadioButton
@ -100,4 +102,6 @@ class FRadioButton : public FToggleButton
inline const char* FRadioButton::getClassName() const
{ return "FRadioButton"; }
} // namespace finalcut
#endif // FRADIOBUTTON_H

View File

@ -59,6 +59,8 @@
#include "final/fmenuitem.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FRadioMenuItem
@ -100,4 +102,6 @@ class FRadioMenuItem : public FMenuItem
inline const char* FRadioMenuItem::getClassName() const
{ return "FRadioMenuItem"; }
} // namespace finalcut
#endif // FRADIOMENUITEM_H

View File

@ -38,6 +38,8 @@
#include <algorithm>
#include "final/fpoint.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FRect
@ -227,4 +229,6 @@ inline short& FRect::x2_ref()
inline short& FRect::y2_ref()
{ return Y2; }
} // namespace finalcut
#endif // FRECT_H

View File

@ -54,6 +54,8 @@
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FScrollbar
@ -174,4 +176,6 @@ inline int FScrollbar::getValue() const
inline FScrollbar::sType FScrollbar::getScrollType() const
{ return scroll_type; }
} // namespace finalcut
#endif // FSCROLLBAR_H

View File

@ -56,6 +56,8 @@
#include "final/fscrollbar.h"
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FScrollView
@ -248,5 +250,6 @@ inline bool FScrollView::isViewportPrint()
inline void FScrollView::scrollTo (const FPoint& pos)
{ scrollTo(pos.getX(), pos.getY()); }
} // namespace finalcut
#endif // FSCROLLVIEW_H

View File

@ -63,6 +63,8 @@
#include "final/fwindow.h"
namespace finalcut
{
// class forward declaration
class FStatusBar;
@ -295,4 +297,6 @@ inline FString FStatusBar::getMessage() const
inline void FStatusBar::clearMessage()
{ text.clear(); }
} // namespace finalcut
#endif // FSTATUSBAR_H

View File

@ -57,6 +57,9 @@
#include "final/ftypes.h"
namespace finalcut
{
// class forward declaration
class FString;
@ -496,5 +499,6 @@ inline FString& FString::setFormatedNumber (int num, char separator)
inline FString& FString::setFormatedNumber (uInt num, char separator)
{ return setFormatedNumber (uLong(num), separator); }
} // namespace finalcut
#endif // FSTRING_H

View File

@ -59,6 +59,8 @@
#include "final/ftogglebutton.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FSwitch
@ -113,4 +115,6 @@ class FSwitch : public FToggleButton
inline const char* FSwitch::getClassName() const
{ return "FSwitch"; }
} // namespace finalcut
#endif // FSWITCH_H

View File

@ -29,6 +29,9 @@
#include "final/ftermcap.h"
namespace finalcut
{
namespace fc
{
@ -139,4 +142,6 @@ static FTermcap::tcap_map term_caps[] =
} // namespace fc
} // namespace finalcut
#endif // FTCAPMAP_H

View File

@ -112,12 +112,12 @@
typedef unsigned int chtype;
#else
typedef unsigned long chtype;
#endif
#endif // _LP64
#include <term.h> // termcap
#else
#include <term.h> // termcap
#endif
#endif // defined(__sun) && defined(__SVR4)
#ifdef F_HAVE_LIBGPM
#undef buttons // from term.h
@ -164,6 +164,8 @@
#include "final/ftermios.h"
#include "final/ftermxterminal.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTerm
@ -205,7 +207,7 @@ class FTerm
static const char* getTermType_Answerback();
static const char* getTermType_SecDA();
static int getFramebufferBpp();
#endif
#endif // DEBUG
// Inquiries
static bool isCursorHidden();
@ -551,7 +553,7 @@ inline const char* FTerm::getTermType_SecDA()
//----------------------------------------------------------------------
inline int FTerm::getFramebufferBpp()
{ return framebuffer_bpp; }
#endif
#endif // DEBUG
//----------------------------------------------------------------------
inline bool FTerm::isCursorHidden()
@ -710,4 +712,6 @@ inline void FTerm::changeTermSizeFinished()
{ resize_term = false; }
} // namespace finalcut
#endif // FTERM_H

View File

@ -42,6 +42,8 @@
#include "final/fvterm.h"
#include "final/fstring.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermBuffer
@ -135,4 +137,6 @@ inline FTermBuffer& FTermBuffer::write()
inline std::vector<FTermBuffer::charData> FTermBuffer::getBuffer()
{ return data; }
} // namespace finalcut
#endif // FTERMBUFFER_H

View File

@ -40,6 +40,8 @@
#include <string>
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermcap
@ -103,4 +105,6 @@ class FTermcap
inline const char* FTermcap::getClassName() const
{ return "FTermcap"; }
} // namespace finalcut
#endif // FTERMCAP_H

View File

@ -40,6 +40,8 @@
#include "final/ftermcap.h"
#include "final/ftermdetection.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermcapsQuirks
@ -96,4 +98,6 @@ class FTermcapQuirks
inline const char* FTermcapQuirks::getClassName() const
{ return "FTermcapQuirks"; }
} // namespace finalcut
#endif // FTERMCAPQUIRKS_H

View File

@ -46,6 +46,8 @@
#include "final/ftermios.h"
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermDetection
@ -456,4 +458,6 @@ inline void FTermDetection::setTmuxTerm (bool on)
inline void FTermDetection::setTerminalDetection (bool on)
{ terminal_detection = on; }
} // namespace finalcut
#endif // FTERMDETECTION_H

View File

@ -46,6 +46,9 @@
#include <sys/kbio.h>
#endif
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermFreeBSD
//----------------------------------------------------------------------
@ -129,4 +132,6 @@ inline void FTermFreeBSD::disableMetaSendsEscape()
{ meta_sends_escape = false; }
#endif // defined(__FreeBSD__) || defined(__DragonFly__)
} // namespace finalcut
#endif // FTERMFREEBSD_H

View File

@ -40,6 +40,8 @@
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermios
@ -125,5 +127,6 @@ inline bool FTermios::unsetRawMode()
inline bool FTermios::setCookedMode()
{ return setRawMode(false); }
} // namespace finalcut
#endif // FTERMIOS_H

View File

@ -40,10 +40,10 @@
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
#include <sys/io.h> // <asm/io.h> is deprecated
#endif
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
#include <sys/kd.h>
#endif
#endif // defined(__linux__)
#include <sys/ioctl.h>
#include <unistd.h>
@ -56,6 +56,8 @@
#include "final/ftermdetection.h"
#include "final/ftypes.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermLinux
@ -156,7 +158,7 @@ class FTermLinux
static bool setVGAPalette (short, int, int, int);
static bool saveVGAPalette();
static bool resetVGAPalette();
#endif
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
static int shiftKeyCorrection (const int&);
static int ctrlKeyCorrection (const int&);
static int altKeyCorrection (const int&);
@ -215,4 +217,6 @@ inline bool FTermLinux::isNewFontUsed()
{ return NewFont; }
#endif // defined(__linux__)
} // namespace finalcut
#endif // FTERMLINUX_H

View File

@ -42,6 +42,9 @@
#include <dev/wscons/wsconsio.h>
#endif
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermOpenBSD
//----------------------------------------------------------------------
@ -89,7 +92,7 @@ class FTermOpenBSD
// Data Members
static kbd_t bsd_keyboard_encoding;
static bool meta_sends_escape;
#endif
#endif // defined(__NetBSD__) || defined(__OpenBSD__)
};
#pragma pack(pop)
@ -108,4 +111,6 @@ inline void FTermOpenBSD::disableMetaSendsEscape()
{ meta_sends_escape = false; }
#endif // defined(__NetBSD__) || defined(__OpenBSD__)
} // namespace finalcut
#endif // FTERMOPENBSD_H

View File

@ -40,6 +40,8 @@
#include "final/ftermcap.h"
#include "final/ftermdetection.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTermXTerminal
@ -219,5 +221,6 @@ inline void FTermXTerminal::setMouseSupport()
inline void FTermXTerminal::unsetMouseSupport()
{ setMouseSupport (false); }
} // namespace finalcut
#endif // FTERMXTERMINAL_H

View File

@ -60,6 +60,8 @@
#include "final/fstring.h"
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FTextView
@ -183,4 +185,6 @@ inline void FTextView::deleteRange (int from, int to)
inline void FTextView::deleteLine (int pos)
{ deleteRange (pos, pos); }
} // namespace finalcut
#endif // FTEXTVIEW_H

View File

@ -54,6 +54,8 @@
#include "final/fwidget.h"
namespace finalcut
{
// class forward declaration
class FButtonGroup;
@ -223,4 +225,6 @@ inline FButtonGroup* FToggleButton::getGroup() const
inline bool FToggleButton::hasGroup() const
{ return button_group; }
} // namespace finalcut
#endif // FTOGGLEBUTTON_H

View File

@ -61,6 +61,8 @@
#include "final/fwindow.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FToolTip
@ -121,5 +123,6 @@ class FToolTip : public FWindow
inline const char* FToolTip::getClassName() const
{ return "FToolTip"; }
} // namespace finalcut
#endif // FTOOLTIP_H

View File

@ -32,6 +32,9 @@
#define null NULL
namespace
{
typedef unsigned char uChar;
typedef unsigned int uInt;
typedef unsigned long uLong;
@ -49,6 +52,12 @@ typedef int64_t sInt64;
typedef long double lDouble;
} // namespace
namespace finalcut
{
namespace fc
{
#pragma pack(push)
@ -75,7 +84,10 @@ typedef struct
}
keyname;
#pragma pack(pop)
} // namespace fc
} // namespace finalcut
#endif // FTYPES_H

View File

@ -61,6 +61,9 @@
static_cast<FVTerm*>((i)) \
, reinterpret_cast<FVTerm::FPreprocessingHandler>((h))
namespace finalcut
{
// class forward declaration
class FWidget;
@ -858,4 +861,6 @@ inline bool FVTerm::isVirtualWindow() const
inline void FVTerm::setPrintArea (term_area* area)
{ print_area = area; }
} // namespace finalcut
#endif // FVTERM_H

View File

@ -103,11 +103,14 @@
// Callback macros
#define F_FUNCTION_CALLBACK(h) \
reinterpret_cast<FWidget::FCallback>((h))
reinterpret_cast<finalcut::FWidget::FCallback>((h))
#define F_METHOD_CALLBACK(i,h) \
reinterpret_cast<FWidget*>((i)) \
, reinterpret_cast<FWidget::FMemberCallback>((h))
reinterpret_cast<finalcut::FWidget*>((i)) \
, reinterpret_cast<finalcut::FWidget::FMemberCallback>((h))
namespace finalcut
{
// class forward declaration
class FStatusBar;
@ -929,4 +932,6 @@ const wchar_t CHECKED_RADIO_BUTTON[4] =
'\0'
};
} // namespace finalcut
#endif // FWIDGET_H

View File

@ -31,8 +31,14 @@
#ifndef FWIDGETCOLORS_H
#define FWIDGETCOLORS_H
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
#error "Only <final/final.h> can be included directly."
#endif
#include "final/fc.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FWidgetColors
@ -136,5 +142,6 @@ class FWidgetColors
};
#pragma pack(pop)
} // namespace finalcut
#endif // FWIDGETCOLORS_H

View File

@ -62,6 +62,8 @@
#include "final/fwidget.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FWindow
@ -273,4 +275,6 @@ inline bool FWindow::raiseWindow()
inline bool FWindow::lowerWindow()
{ return lowerWindow(this); }
} // namespace finalcut
#endif // FWINDOW_H

View File

@ -28,6 +28,9 @@
#include "final/fstatusbar.h"
#include "final/fwindow.h"
namespace finalcut
{
// global application object
static FApplication* rootObj = 0;
@ -1229,3 +1232,5 @@ bool FApplication::processNextEvent()
return ( num_events > 0 );
}
} // namespace finalcut

View File

@ -24,6 +24,8 @@
#include "final/fbutton.h"
#include "final/fstatusbar.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FButton
@ -855,3 +857,5 @@ void FButton::processClick()
{
emitCallback("clicked");
}
} // namespace finalcut

View File

@ -26,6 +26,8 @@
#include "final/fstatusbar.h"
#include "final/ftogglebutton.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FButtonGroup
@ -692,3 +694,5 @@ void FButtonGroup::directFocus()
flush_out();
}
}
} // namespace finalcut

View File

@ -22,6 +22,8 @@
#include "final/fcheckbox.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FCheckBox
@ -107,3 +109,5 @@ void FCheckBox::drawCheckButton()
if ( isMonochron() )
setReverse(false);
}
} // namespace finalcut

View File

@ -23,6 +23,8 @@
#include "final/fcheckmenuitem.h"
#include "final/fmenu.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FCheckMenuItem
@ -77,3 +79,5 @@ void FCheckMenuItem::processClicked()
processToggle();
emitCallback("clicked");
}
} // namespace finalcut

View File

@ -22,6 +22,8 @@
#include "final/fcolorpalette.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FColorPalette
@ -122,3 +124,5 @@ void FColorPalette::reset16ColorPalette (funcp setPalette)
setPalette (fc::Yellow, 0xff, 0xff, 0x55);
setPalette (fc::White, 0xff, 0xff, 0xff);
}
} // namespace finalcut

View File

@ -24,6 +24,8 @@
#include "final/fdialog.h"
#include "final/fstatusbar.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FDialog
@ -1066,7 +1068,7 @@ void FDialog::drawTitleBar()
setPrintPos (getWidth() - 2, 1);
printf ("(%d)", getWindowLayer(this));
}
#endif
#endif // DEBUG
}
//----------------------------------------------------------------------
@ -1765,3 +1767,5 @@ void FDialog::cb_close (FWidget*, data_ptr)
drawTitleBar();
close();
}
} // namespace finalcut

View File

@ -22,6 +22,8 @@
#include "final/fdialoglistmenu.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FDialogListMenu
@ -56,3 +58,5 @@ void FDialogListMenu::init()
if ( menuitem )
menuitem->dialog_index = true;
}
} // namespace finalcut

View File

@ -24,6 +24,8 @@
#include "final/fevent.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FEvent
@ -357,3 +359,5 @@ FTimerEvent::~FTimerEvent() // destructor
//----------------------------------------------------------------------
int FTimerEvent::timerId() const
{ return id; }
} // namespace finalcut

View File

@ -24,6 +24,8 @@
#include "final/ffiledialog.h"
namespace finalcut
{
// non-member functions
//----------------------------------------------------------------------
@ -939,3 +941,5 @@ void FFileDialog::cb_processShowHidden (FWidget*, data_ptr)
{
setShowHiddenFiles(not show_hidden);
}
} // namespace finalcut

View File

@ -23,6 +23,9 @@
#include <final/fc.h>
#include <final/fkey_map.h>
namespace finalcut
{
namespace fc
{
@ -826,3 +829,5 @@ keyname FkeyName[] =
};
} // namespace fc
} // namespace finalcut

View File

@ -26,6 +26,9 @@
#include "final/fkey_map.h"
#include "final/ftermios.h"
namespace finalcut
{
// static class attributes
long FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress)
struct timeval FKeyboard::time_keypressed;
@ -567,3 +570,5 @@ void FKeyboard::escapeKeyPressed()
{
escape_key_cmd.execute();
}
} // namespace finalcut

View File

@ -24,6 +24,8 @@
#include "final/flabel.h"
#include "final/fstatusbar.h"
namespace finalcut
{
//----------------------------------------------------------------------
// class FLabel
@ -666,3 +668,5 @@ void FLabel::printLine ( wchar_t line[]
if ( hasReverseMode() )
setReverse(false);
}
} // namespace finalcut

Some files were not shown because too many files have changed in this diff Show More