diff --git a/ChangeLog b/ChangeLog index ef4a5a2b..e02c4410 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2017-10-30 Markus Gans * Fix scrollview functionality with new inheritance structure * Add a standardized close confirmation dialog + * Only can now be directly integrated in programs 2017-10-29 Markus Gans * Adaptation of the inheritance diagrams in the header files diff --git a/examples/calculator.cpp b/examples/calculator.cpp index c8a96bba..d11ce932 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -26,9 +26,7 @@ #include #include -#include -#include -#include +#include const lDouble PI = 3.141592653589793238L; diff --git a/examples/choice.cpp b/examples/choice.cpp index 3a30c6c5..895e3184 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -19,12 +19,8 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include -#include -#include +#include + // function prototypes void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/dialog.cpp b/examples/dialog.cpp index 38d7141c..65e68968 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -19,10 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include +#include // function prototype void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/hello.cpp b/examples/hello.cpp index 1a1d774f..6b226ad0 100644 --- a/examples/hello.cpp +++ b/examples/hello.cpp @@ -19,8 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include +#include int main (int argc, char* argv[]) diff --git a/examples/input-dialog.cpp b/examples/input-dialog.cpp index dacb4efa..1d0927df 100644 --- a/examples/input-dialog.cpp +++ b/examples/input-dialog.cpp @@ -19,13 +19,8 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include +#include + // function prototypes void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/listbox.cpp b/examples/listbox.cpp index b62746ed..3267b3c9 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -24,10 +24,7 @@ #include #include -#include -#include -#include -#include +#include // Global application object diff --git a/examples/listview.cpp b/examples/listview.cpp index 49edd1f3..fcded6ef 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -24,10 +24,7 @@ #include #include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index f0b14f20..c10c588c 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -19,9 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/menu.cpp b/examples/menu.cpp index 45392669..9fd81570 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -19,15 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/mouse.cpp b/examples/mouse.cpp index baeec577..6380a9a9 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -19,10 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index ad4b9ef5..bcdf28a9 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -22,8 +22,7 @@ #include #include -#include -#include +#include // global FVTerm object @@ -149,27 +148,28 @@ void move (int xold, int yold, int xnew, int ynew) //---------------------------------------------------------------------- int main (int argc, char* argv[]) { - bool init = true; int xmax, ymax; // Create the application object - FApplication app(argc, argv); + FApplication TermApp(argc, argv); - // Create a FVTerm object as virtual terminal - terminal = new FVTerm(init); - xmax = terminal->getColumnNumber() - 1; - ymax = terminal->getLineNumber() - 1; + // Pointer to the global virtual terminal object + terminal = static_cast(&TermApp); + + // Get screen dimension + xmax = TermApp.getColumnNumber() - 1; + ymax = TermApp.getLineNumber() - 1; FString line(xmax + 1, '-'); // Place the cursor in the upper left corner - terminal->setTermXY(0,0); + TermApp.setTermXY(0,0); // Reset all terminal attributes - terminal->setNormal(); + TermApp.setNormal(); // Clear the screen - terminal->clearArea(); + TermApp.clearArea(); // Show the determined terminal name and text resolution - std::cout << "Terminal: " << terminal->getTermType() << "\r\n"; + std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; std::cout << " Columns: 0.." << xmax << "\r\n"; std::cout << " Lines: 0.." << ymax << "\r\n"; @@ -202,7 +202,7 @@ int main (int argc, char* argv[]) // Show terminal speed and milliseconds for all cursor movement sequence std::cout << "\r" << line; - terminal->printMoveDurations(); + TermApp.printMoveDurations(); // Waiting for keypress keyPressed(); diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index 7da8bc4d..ddbf7fb3 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -19,12 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index c58773a0..3df60581 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -20,7 +20,6 @@ ************************************************************************/ #include -#include #include #include @@ -28,7 +27,7 @@ #include #include -#include +#include int main (int, char**) diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 0a7f43ae..65e2e746 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -19,10 +19,8 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include +#include + //---------------------------------------------------------------------- // class AttribDlg diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 855b8744..9e8b71f0 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -23,9 +23,7 @@ #include #include -#include -#include -#include +#include // global FVTerm object @@ -106,32 +104,31 @@ void tcapString (const std::string& name, const char* cap_str) //---------------------------------------------------------------------- int main (int argc, char* argv[]) { - bool init = true; bool disable_alt_screen = true; - FApplication app (argc, argv, disable_alt_screen); - terminal = new FVTerm(init); + FApplication TermApp (argc, argv, disable_alt_screen); + + // Pointer to the global virtual terminal object + terminal = static_cast(&TermApp); FTermcap::tcap_map* tcap = 0; tcap = FTermcap::getTermcapMap(); std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; - std::cout << "Terminal: " << terminal->getTermType() << "\r\n"; + std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; #if DEBUG std::cout << "\n.------------------- debug -------------------\r\n"; std::cout << "| after init_256colorTerminal(): " - << terminal->termtype_256color << "\r\n"; + << TermApp.termtype_256color << "\r\n"; std::cout << "| after parseAnswerbackMsg(): " - << terminal->termtype_Answerback << "\r\n"; + << TermApp.termtype_Answerback << "\r\n"; std::cout << "| after parseSecDA(): " - << terminal->termtype_SecDA << "\r\n"; + << TermApp.termtype_SecDA << "\r\n"; - if ( const FString& s = terminal->getAnswerbackString() ) + if ( const FString& s = TermApp.getAnswerbackString() ) tcapString ("| The answerback String", s); - - - if ( const FString& s = terminal->getSecDAString() ) + if ( const FString& s = TermApp.getSecDAString() ) tcapString ("| The SecDA String", s); std::cout << "`------------------- debug -------------------\r\n"; diff --git a/examples/transparent.cpp b/examples/transparent.cpp index 9112fca2..dd62e624 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -19,12 +19,7 @@ * along with this program. If not, see . * ************************************************************************/ -#include -#include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 219e14f4..39ef448f 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -24,10 +24,7 @@ #include #include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/watch.cpp b/examples/watch.cpp index 92badb96..277d254a 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -20,12 +20,7 @@ ************************************************************************/ #include - -#include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/examples/windows.cpp b/examples/windows.cpp index 4fe152a2..219fc9a2 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -20,16 +20,7 @@ ************************************************************************/ #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include //---------------------------------------------------------------------- diff --git a/include/final/fapplication.h b/include/final/fapplication.h index 21365775..63ada483 100644 --- a/include/final/fapplication.h +++ b/include/final/fapplication.h @@ -55,6 +55,10 @@ #ifndef FAPPLICATION_H #define FAPPLICATION_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include #include diff --git a/include/final/fbutton.h b/include/final/fbutton.h index 471521ba..7132a611 100644 --- a/include/final/fbutton.h +++ b/include/final/fbutton.h @@ -47,6 +47,10 @@ #ifndef FBUTTON_H #define FBUTTON_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" diff --git a/include/final/fbuttongroup.h b/include/final/fbuttongroup.h index fdb037e3..d8442280 100644 --- a/include/final/fbuttongroup.h +++ b/include/final/fbuttongroup.h @@ -48,6 +48,10 @@ #ifndef FBUTTONGROUP_H #define FBUTTONGROUP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fscrollview.h" diff --git a/include/final/fc.h b/include/final/fc.h index 8a7accde..91d32930 100644 --- a/include/final/fc.h +++ b/include/final/fc.h @@ -30,6 +30,10 @@ #ifndef FC_H #define FC_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fstring.h" // ascii sequences diff --git a/include/final/fcharmap.h b/include/final/fcharmap.h index 1b830168..0d6bb6ee 100644 --- a/include/final/fcharmap.h +++ b/include/final/fcharmap.h @@ -22,6 +22,10 @@ #ifndef FCHARMAP_H #define FCHARMAP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + static uInt character[][fc::NUM_OF_ENCODINGS] = { // .--------------------- Unicode (UTF-8) diff --git a/include/final/fcheckbox.h b/include/final/fcheckbox.h index 87afc0e9..7e5a07f1 100644 --- a/include/final/fcheckbox.h +++ b/include/final/fcheckbox.h @@ -52,6 +52,10 @@ #ifndef FCHECKBOX_H #define FCHECKBOX_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/ftogglebutton.h" diff --git a/include/final/fcheckmenuitem.h b/include/final/fcheckmenuitem.h index 8d9aa92a..f257aa84 100644 --- a/include/final/fcheckmenuitem.h +++ b/include/final/fcheckmenuitem.h @@ -52,6 +52,10 @@ #ifndef FCHECKMENUITEM_H #define FCHECKMENUITEM_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fmenuitem.h" diff --git a/include/final/fdialog.h b/include/final/fdialog.h index 2a9e7fc6..50c3d2db 100644 --- a/include/final/fdialog.h +++ b/include/final/fdialog.h @@ -52,6 +52,10 @@ #ifndef FDIALOG_H #define FDIALOG_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fmenu.h" #include "final/fmenuitem.h" #include "final/ftooltip.h" diff --git a/include/final/fdialoglistmenu.h b/include/final/fdialoglistmenu.h index 323ab312..a8f0c86d 100644 --- a/include/final/fdialoglistmenu.h +++ b/include/final/fdialoglistmenu.h @@ -59,6 +59,10 @@ #ifndef FDIALOGLISTMENU_H #define FDIALOGLISTMENU_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fmenu.h" diff --git a/include/final/fevent.h b/include/final/fevent.h index d4f3531d..19ae33e6 100644 --- a/include/final/fevent.h +++ b/include/final/fevent.h @@ -71,6 +71,10 @@ #ifndef FEVENT_H #define FEVENT_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fc.h" #include "final/fpoint.h" diff --git a/include/final/ffiledialog.h b/include/final/ffiledialog.h index 636b339b..c3c4c2bd 100644 --- a/include/final/ffiledialog.h +++ b/include/final/ffiledialog.h @@ -57,6 +57,10 @@ #ifndef FFILEDIALOG_H #define FFILEDIALOG_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include diff --git a/include/final/final.h b/include/final/final.h index db419e84..5afb9185 100644 --- a/include/final/final.h +++ b/include/final/final.h @@ -23,6 +23,8 @@ #ifndef FINAL_H #define FINAL_H +#define USE_FINAL_H + #include #include #include @@ -34,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -52,4 +55,6 @@ #include #include +#undef USE_FINAL_H + #endif // FINAL_H diff --git a/include/final/fkey_map.h b/include/final/fkey_map.h index ab29790a..81938de8 100644 --- a/include/final/fkey_map.h +++ b/include/final/fkey_map.h @@ -22,6 +22,10 @@ #ifndef FKEYMAP_H #define FKEYMAP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #pragma pack(push) diff --git a/include/final/flabel.h b/include/final/flabel.h index 3fe92640..17de1509 100644 --- a/include/final/flabel.h +++ b/include/final/flabel.h @@ -47,6 +47,10 @@ #ifndef FLABEL_H #define FLABEL_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fwidget.h" diff --git a/include/final/flineedit.h b/include/final/flineedit.h index 830032df..a41a21f4 100644 --- a/include/final/flineedit.h +++ b/include/final/flineedit.h @@ -47,6 +47,10 @@ #ifndef FLINEEDIT_H #define FLINEEDIT_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" #include "final/flabel.h" diff --git a/include/final/flistbox.h b/include/final/flistbox.h index 7febb190..a4073af0 100644 --- a/include/final/flistbox.h +++ b/include/final/flistbox.h @@ -48,6 +48,10 @@ #ifndef FLISTBOX_H #define FLISTBOX_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fscrollbar.h" diff --git a/include/final/flistview.h b/include/final/flistview.h index 95eb9ccf..386749ad 100644 --- a/include/final/flistview.h +++ b/include/final/flistview.h @@ -47,6 +47,10 @@ #ifndef FLISTVIEW_H #define FLISTVIEW_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include diff --git a/include/final/fmenu.h b/include/final/fmenu.h index d8d0ad0a..57d697c3 100644 --- a/include/final/fmenu.h +++ b/include/final/fmenu.h @@ -54,6 +54,10 @@ #ifndef FMENU_H #define FMENU_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwindow.h" #include "final/fmenubar.h" #include "final/fmenulist.h" diff --git a/include/final/fmenubar.h b/include/final/fmenubar.h index ab5c3956..60ae71ed 100644 --- a/include/final/fmenubar.h +++ b/include/final/fmenubar.h @@ -54,6 +54,10 @@ #ifndef FMENUBAR_H #define FMENUBAR_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fmenu.h" #include "final/fmenulist.h" #include "final/fwindow.h" diff --git a/include/final/fmenuitem.h b/include/final/fmenuitem.h index 76ec7ce9..70077e0c 100644 --- a/include/final/fmenuitem.h +++ b/include/final/fmenuitem.h @@ -51,6 +51,10 @@ #ifndef FMENUITEM_H #define FMENUITEM_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" // class forward declaration diff --git a/include/final/fmenulist.h b/include/final/fmenulist.h index 5cf9792a..29b87023 100644 --- a/include/final/fmenulist.h +++ b/include/final/fmenulist.h @@ -38,6 +38,10 @@ #ifndef FMENULIST_H #define FMENULIST_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fmenuitem.h" diff --git a/include/final/fmessagebox.h b/include/final/fmessagebox.h index 407a2786..06e1865a 100644 --- a/include/final/fmessagebox.h +++ b/include/final/fmessagebox.h @@ -57,6 +57,10 @@ #ifndef FMESSAGEBOX_H #define FMESSAGEBOX_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fbutton.h" diff --git a/include/final/fobject.h b/include/final/fobject.h index 14bad40c..cde5fc5a 100644 --- a/include/final/fobject.h +++ b/include/final/fobject.h @@ -30,6 +30,10 @@ #ifndef FOBJECT_H #define FOBJECT_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include // need for gettimeofday #include diff --git a/include/final/foptiattr.h b/include/final/foptiattr.h index cd58143f..e18aec56 100644 --- a/include/final/foptiattr.h +++ b/include/final/foptiattr.h @@ -30,6 +30,10 @@ #ifndef FOPTIATTR_H #define FOPTIATTR_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include // need for tparm diff --git a/include/final/foptimove.h b/include/final/foptimove.h index 19ae4914..2adc9f12 100644 --- a/include/final/foptimove.h +++ b/include/final/foptimove.h @@ -33,6 +33,10 @@ #ifndef FOPTIMOVE_H #define FOPTIMOVE_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include // need for tparm diff --git a/include/final/fpoint.h b/include/final/fpoint.h index 364e1e36..a988d67c 100644 --- a/include/final/fpoint.h +++ b/include/final/fpoint.h @@ -30,6 +30,11 @@ #ifndef FPOINT_H #define FPOINT_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + + //---------------------------------------------------------------------- // class FPoint //---------------------------------------------------------------------- diff --git a/include/final/fprogressbar.h b/include/final/fprogressbar.h index 99577f6e..9fa42fa4 100644 --- a/include/final/fprogressbar.h +++ b/include/final/fprogressbar.h @@ -47,6 +47,10 @@ #ifndef FPROGRESSBAR_H #define FPROGRESSBAR_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" diff --git a/include/final/fradiobutton.h b/include/final/fradiobutton.h index f3b92ae2..52fc04c2 100644 --- a/include/final/fradiobutton.h +++ b/include/final/fradiobutton.h @@ -52,6 +52,10 @@ #ifndef FRADIOBUTTON_H #define FRADIOBUTTON_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/ftogglebutton.h" diff --git a/include/final/fradiomenuitem.h b/include/final/fradiomenuitem.h index ebda705d..04facfdd 100644 --- a/include/final/fradiomenuitem.h +++ b/include/final/fradiomenuitem.h @@ -52,6 +52,10 @@ #ifndef FRADIOMENUITEM_H #define FRADIOMENUITEM_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fmenuitem.h" diff --git a/include/final/frect.h b/include/final/frect.h index a0356c60..0c1de692 100644 --- a/include/final/frect.h +++ b/include/final/frect.h @@ -30,6 +30,10 @@ #ifndef FRECT_H #define FRECT_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fpoint.h" diff --git a/include/final/fscrollbar.h b/include/final/fscrollbar.h index 6c017d56..7535b710 100644 --- a/include/final/fscrollbar.h +++ b/include/final/fscrollbar.h @@ -47,6 +47,10 @@ #ifndef FSCROLLBAR_H #define FSCROLLBAR_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" diff --git a/include/final/fscrollview.h b/include/final/fscrollview.h index edec320a..81c3be36 100644 --- a/include/final/fscrollview.h +++ b/include/final/fscrollview.h @@ -48,6 +48,10 @@ #ifndef FSCROLLVIEW_H #define FSCROLLVIEW_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fscrollbar.h" #include "final/fwidget.h" diff --git a/include/final/fstatusbar.h b/include/final/fstatusbar.h index b258ffeb..38f3ec8a 100644 --- a/include/final/fstatusbar.h +++ b/include/final/fstatusbar.h @@ -54,6 +54,10 @@ #ifndef FSTATUSBAR_H #define FSTATUSBAR_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fwindow.h" diff --git a/include/final/fstring.h b/include/final/fstring.h index 99a26291..0fa84571 100644 --- a/include/final/fstring.h +++ b/include/final/fstring.h @@ -30,6 +30,10 @@ #ifndef FSTRING_H #define FSTRING_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include diff --git a/include/final/fswitch.h b/include/final/fswitch.h index bd765e17..0648d793 100644 --- a/include/final/fswitch.h +++ b/include/final/fswitch.h @@ -52,6 +52,10 @@ #ifndef FSWITCH_H #define FSWITCH_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/ftogglebutton.h" diff --git a/include/final/ftcap_map.h b/include/final/ftcap_map.h index bd1d4707..f3b10da8 100644 --- a/include/final/ftcap_map.h +++ b/include/final/ftcap_map.h @@ -22,6 +22,10 @@ #ifndef FTCAPMAP_H #define FTCAPMAP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/ftermcap.h" static FTermcap::tcap_map term_caps[] = diff --git a/include/final/fterm.h b/include/final/fterm.h index abf21bc3..d6bfda72 100644 --- a/include/final/fterm.h +++ b/include/final/fterm.h @@ -46,6 +46,10 @@ #ifndef FTERM_H #define FTERM_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fconfig.h" #ifdef F_HAVE_LIBGPM diff --git a/include/final/ftermbuffer.h b/include/final/ftermbuffer.h index f2afef4b..cd97a64a 100644 --- a/include/final/ftermbuffer.h +++ b/include/final/ftermbuffer.h @@ -30,6 +30,10 @@ #ifndef FTERMBUFFER_H #define FTERMBUFFER_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include // std::stringstream #include #include diff --git a/include/final/ftermcap.h b/include/final/ftermcap.h index fa093c02..32a17fa5 100644 --- a/include/final/ftermcap.h +++ b/include/final/ftermcap.h @@ -30,6 +30,10 @@ #ifndef FTERMCAP_H #define FTERMCAP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + // FTermcap string macro #define TCAP(s) tcap[(s)].string diff --git a/include/final/ftextview.h b/include/final/ftextview.h index ad6c5b83..5e4791b1 100644 --- a/include/final/ftextview.h +++ b/include/final/ftextview.h @@ -47,6 +47,10 @@ #ifndef FTEXTVIEW_H #define FTEXTVIEW_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fapplication.h" diff --git a/include/final/ftogglebutton.h b/include/final/ftogglebutton.h index 7e4be022..5027ad57 100644 --- a/include/final/ftogglebutton.h +++ b/include/final/ftogglebutton.h @@ -47,6 +47,10 @@ #ifndef FTOGGLEBUTTON_H #define FTOGGLEBUTTON_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" diff --git a/include/final/ftooltip.h b/include/final/ftooltip.h index 7d7c5e75..4d2bf968 100644 --- a/include/final/ftooltip.h +++ b/include/final/ftooltip.h @@ -52,6 +52,10 @@ #ifndef FTOOLTIP_H #define FTOOLTIP_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fwindow.h" diff --git a/include/final/ftypes.h b/include/final/ftypes.h index 4263cd9d..25e43798 100644 --- a/include/final/ftypes.h +++ b/include/final/ftypes.h @@ -22,6 +22,10 @@ #ifndef FTYPES_H #define FTYPES_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #define null NULL diff --git a/include/final/fvterm.h b/include/final/fvterm.h index 50c6324a..ab8d0628 100644 --- a/include/final/fvterm.h +++ b/include/final/fvterm.h @@ -43,6 +43,10 @@ #ifndef FVTERM_H #define FVTERM_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include // std::stringstream #include "final/fterm.h" diff --git a/include/final/fwidget.h b/include/final/fwidget.h index c3954854..da7338bd 100644 --- a/include/final/fwidget.h +++ b/include/final/fwidget.h @@ -90,6 +90,10 @@ #ifndef FWIDGET_H #define FWIDGET_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include #include "final/fvterm.h" diff --git a/include/final/fwindow.h b/include/final/fwindow.h index 86e97f28..d9ee7355 100644 --- a/include/final/fwindow.h +++ b/include/final/fwindow.h @@ -55,6 +55,10 @@ #ifndef FWINDOW_H #define FWINDOW_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fwidget.h" diff --git a/src/Makefile.am b/src/Makefile.am index a6017337..7899f1a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = fonts -AM_CPPFLAGS = -I../include -Wall -Werror +AM_CPPFLAGS = -I../include -Wall -Werror -DCOMPILE_FINAL_CUT lib_LTLIBRARIES = libfinal.la diff --git a/src/Makefile.clang b/src/Makefile.clang index a5516081..d15bdc71 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -51,7 +51,7 @@ INCLUDE_HEADERS = \ # compiler parameter CXX = clang++ -CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions +CCXFLAGS = $(OPTIMIZE) $(PROFILE) -DCOMPILE_FINAL_CUT $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions MAKEFILE = -f Makefile.clang LDFLAGS = $(TERMCAP) -lgpm INCLUDES = -I../include @@ -153,7 +153,7 @@ clean: $(RM) $(LIB)* $(OBJS) .depend *.gch *.plist *~ dep: - $(CXX) $(INCLUDES) -MM *.cpp >.depend + $(CXX) $(INCLUDES) -DCOMPILE_FINAL_CUT -MM *.cpp >.depend # # include .depend if it exists diff --git a/src/Makefile.gcc b/src/Makefile.gcc index 52e7f22d..375ed15f 100644 --- a/src/Makefile.gcc +++ b/src/Makefile.gcc @@ -51,7 +51,7 @@ INCLUDE_HEADERS = \ # compiler parameter CXX = g++ -CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions +CCXFLAGS = $(OPTIMIZE) $(PROFILE) -DCOMPILE_FINAL_CUT $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions MAKEFILE = -f Makefile.gcc LDFLAGS = $(TERMCAP) -lgpm INCLUDES = -I../include @@ -153,7 +153,7 @@ clean: $(RM) $(LIB)* $(OBJS) .depend *.prof *~ dep: - $(CXX) $(INCLUDES) -MM *.cpp >.depend + $(CXX) $(INCLUDES) -MM -DCOMPILE_FINAL_CUT *.cpp >.depend # # include .depend if it exists diff --git a/src/Makefile.in b/src/Makefile.in index 8af85c7e..5f031fe1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -373,7 +373,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = fonts -AM_CPPFLAGS = -I../include -Wall -Werror +AM_CPPFLAGS = -I../include -Wall -Werror -DCOMPILE_FINAL_CUT lib_LTLIBRARIES = libfinal.la libfinal_la_SOURCES = \ fstring.cpp \