From c6dba0b4acce51c3072e1f58e7c470d28de4b575 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 9 Apr 2017 20:08:53 +0200 Subject: [PATCH] Rename preprocessor macro names with leading underscore --- ChangeLog | 4 ++ src/fapp.h | 6 +- src/fbutton.h | 6 +- src/fbuttongroup.cpp | 2 +- src/fbuttongroup.h | 6 +- src/fc.h | 10 +-- src/fcharmap.h | 6 +- src/fcheckbox.h | 6 +- src/fcheckmenuitem.h | 6 +- src/fdialog.cpp | 6 +- src/fdialog.h | 6 +- src/fdialoglistmenu.h | 6 +- src/fevent.h | 6 +- src/ffiledialog.cpp | 12 ++-- src/ffiledialog.h | 7 +- src/final.h | 6 +- src/fkey_map.h | 6 +- src/flabel.cpp | 2 +- src/flabel.h | 6 +- src/flineedit.h | 6 +- src/flistbox.cpp | 8 +-- src/flistbox.h | 6 +- src/fmenu.h | 6 +- src/fmenubar.h | 6 +- src/fmenuitem.cpp | 6 +- src/fmenuitem.h | 6 +- src/fmenulist.h | 6 +- src/fmessagebox.cpp | 6 +- src/fmessagebox.h | 6 +- src/fobject.h | 6 +- src/fonts/bdf2c.sh | 6 +- src/fonts/font2c.sh | 6 +- src/fonts/newfont.h | 6 +- src/fonts/unicodemap.h | 6 +- src/fonts/vgafont.h | 6 +- src/foptiattr.cpp | 14 ++-- src/foptiattr.h | 6 +- src/foptimove.cpp | 28 ++++---- src/foptimove.h | 6 +- src/fpoint.h | 6 +- src/fprogressbar.cpp | 2 +- src/fprogressbar.h | 6 +- src/fradiobutton.h | 6 +- src/fradiomenuitem.cpp | 2 +- src/fradiomenuitem.h | 6 +- src/frect.h | 6 +- src/fscrollbar.cpp | 28 ++++---- src/fscrollbar.h | 44 ++++++------ src/fscrollview.cpp | 12 ++-- src/fscrollview.h | 6 +- src/fstatusbar.cpp | 2 +- src/fstatusbar.h | 6 +- src/fstring.cpp | 12 ++-- src/fstring.h | 6 +- src/fswitch.h | 6 +- src/ftcap_map.h | 6 +- src/fterm.cpp | 139 ++++++++++++++++++++----------------- src/fterm.h | 47 ++++++------- src/ftermcap.h | 6 +- src/ftextview.cpp | 4 +- src/ftextview.h | 6 +- src/ftogglebutton.h | 6 +- src/ftooltip.h | 6 +- src/fvterm.cpp | 18 ++--- src/fvterm.h | 8 +-- src/fwidget.cpp | 4 +- src/fwidget.h | 10 +-- src/fwindow.h | 6 +- test/calculator.cpp | 11 +-- test/choice.cpp | 2 +- test/dialog.cpp | 2 +- test/input-dialog.cpp | 4 +- test/menu.cpp | 4 +- test/mouse.cpp | 2 +- test/scrollview.cpp | 10 +-- test/string-operations.cpp | 1 + test/term-attributes.cpp | 4 +- test/ui.cpp | 56 +++++++-------- test/watch.cpp | 6 +- test/windows.cpp | 18 ++--- 80 files changed, 415 insertions(+), 394 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a0fb33a..6832afd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-04-09 Markus Gans + * The Final Cut compiles now also under NetBSD + * Rename preprocessor macro names with leading underscore + 2017-04-08 Markus Gans * Looking in /etc/ttys for the type of terminal diff --git a/src/fapp.h b/src/fapp.h index 50ef748f..603e3f47 100644 --- a/src/fapp.h +++ b/src/fapp.h @@ -33,8 +33,8 @@ // └- - - -▕ FWidget ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FAPPLICATION_H -#define _FAPPLICATION_H +#ifndef FAPPLICATION_H +#define FAPPLICATION_H #include #include @@ -236,4 +236,4 @@ inline FWidget* FApplication::getFocusWidget() const { return focus_widget; } -#endif // _FAPPLICATION_H +#endif // FAPPLICATION_H diff --git a/src/fbutton.h b/src/fbutton.h index c11f85be..125e15b0 100644 --- a/src/fbutton.h +++ b/src/fbutton.h @@ -25,8 +25,8 @@ // ▕ FButton ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FBUTTON_H -#define _FBUTTON_H +#ifndef FBUTTON_H +#define FBUTTON_H #include "fwidget.h" @@ -224,4 +224,4 @@ inline bool FButton::hasShadow() const inline bool FButton::hasClickAnimation() { return click_animation; } -#endif // _FBUTTON_H +#endif // FBUTTON_H diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index a293d1f7..6f3b818c 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -249,7 +249,7 @@ void FButtonGroup::insert (FToggleButton* button) button->addCallback ( "toggled", - _METHOD_CALLBACK (this, &FButtonGroup::cb_buttonToggled) + F_METHOD_CALLBACK (this, &FButtonGroup::cb_buttonToggled) ); //checkScrollSize (button); diff --git a/src/fbuttongroup.h b/src/fbuttongroup.h index fb28f831..a193079a 100644 --- a/src/fbuttongroup.h +++ b/src/fbuttongroup.h @@ -25,8 +25,8 @@ // ▕ FButtonGroup ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FBUTTONGROUP_H -#define _FBUTTONGROUP_H +#ifndef FBUTTONGROUP_H +#define FBUTTONGROUP_H #include "fscrollview.h" @@ -143,4 +143,4 @@ inline uInt FButtonGroup::getCount() const inline FString& FButtonGroup::getText() { return text; } -#endif // _FBUTTONGROUP_H +#endif // FBUTTONGROUP_H diff --git a/src/fc.h b/src/fc.h index c63600e3..3637337b 100644 --- a/src/fc.h +++ b/src/fc.h @@ -8,8 +8,8 @@ // ▕ fc ▏ // ▕▁▁▁▁▁▁▁▁▏ -#ifndef _FC_H -#define _FC_H +#ifndef FC_H +#define FC_H //---------------------------------------------------------------------- @@ -941,11 +941,11 @@ class fc }; // BSD console cursor style - enum bsdConsoleCursorStyle + enum freebsdConsoleCursorStyle { normal_cursor = 0, blink_cursor = 1, - destructive_cursor = 3 + destructive_cursor = 3 }; // KDE konsole cursor style @@ -1075,4 +1075,4 @@ class fc #pragma pack(pop) -#endif // _FC_H +#endif // FC_H diff --git a/src/fcharmap.h b/src/fcharmap.h index 431fdf97..48e127fb 100644 --- a/src/fcharmap.h +++ b/src/fcharmap.h @@ -1,7 +1,7 @@ // File: fcharmap.h -#ifndef _FCHARMAP_H -#define _FCHARMAP_H +#ifndef FCHARMAP_H +#define FCHARMAP_H static uInt character[][fc::NUM_OF_ENCODINGS] = { @@ -290,4 +290,4 @@ const uInt lastCP437Item = uInt ( sizeof(cp437_to_ucs) / sizeof(cp437_to_ucs[0]) ) - 1; -#endif // _FCHARMAP_H +#endif // FCHARMAP_H diff --git a/src/fcheckbox.h b/src/fcheckbox.h index 7d492011..5be0af9e 100644 --- a/src/fcheckbox.h +++ b/src/fcheckbox.h @@ -30,8 +30,8 @@ // ▕ FCheckBox ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FCHECKBOX_H -#define _FCHECKBOX_H +#ifndef FCHECKBOX_H +#define FCHECKBOX_H #include "ftogglebutton.h" @@ -76,4 +76,4 @@ class FCheckBox : public FToggleButton inline const char* FCheckBox::getClassName() const { return "FCheckBox"; } -#endif // _FCHECKBOX_H +#endif // FCHECKBOX_H diff --git a/src/fcheckmenuitem.h b/src/fcheckmenuitem.h index d3754672..95045e4c 100644 --- a/src/fcheckmenuitem.h +++ b/src/fcheckmenuitem.h @@ -30,8 +30,8 @@ // ▕ FCheckMenuItem ▏- - - - -▕ FMenu ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▏ -#ifndef _FCHECKMENUITEM_H -#define _FCHECKMENUITEM_H +#ifndef FCHECKMENUITEM_H +#define FCHECKMENUITEM_H #include "fmenuitem.h" @@ -76,4 +76,4 @@ class FCheckMenuItem : public FMenuItem inline const char* FCheckMenuItem::getClassName() const { return "FCheckMenuItem"; } -#endif // _FCHECKMENUITEM_H +#endif // FCHECKMENUITEM_H diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 73250a06..ba58984f 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -1099,7 +1099,7 @@ void FDialog::init() move_size_item->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FDialog::cb_move) + F_METHOD_CALLBACK (this, &FDialog::cb_move) ); zoom_item = new FMenuItem (dialog_menu); @@ -1109,7 +1109,7 @@ void FDialog::init() zoom_item->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FDialog::cb_zoom) + F_METHOD_CALLBACK (this, &FDialog::cb_zoom) ); close_item = new FMenuItem ("&Close", dialog_menu); @@ -1118,7 +1118,7 @@ void FDialog::init() close_item->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FDialog::cb_close) + F_METHOD_CALLBACK (this, &FDialog::cb_close) ); } diff --git a/src/fdialog.h b/src/fdialog.h index 77b26437..afb4cf39 100644 --- a/src/fdialog.h +++ b/src/fdialog.h @@ -30,8 +30,8 @@ // ▕ FDialog ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FDIALOG_H -#define _FDIALOG_H +#ifndef FDIALOG_H +#define FDIALOG_H #include "fmenu.h" #include "fmenuitem.h" @@ -225,4 +225,4 @@ inline bool FDialog::isScrollable() -#endif // _FDIALOG_H +#endif // FDIALOG_H diff --git a/src/fdialoglistmenu.h b/src/fdialoglistmenu.h index 9eac1fa3..d774f00c 100644 --- a/src/fdialoglistmenu.h +++ b/src/fdialoglistmenu.h @@ -37,8 +37,8 @@ // ▕ FDialogListMenu ▏- - - - - -▕ FMenuItem ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏1 1▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FDIALOGLISTMENU_H -#define _FDIALOGLISTMENU_H +#ifndef FDIALOGLISTMENU_H +#define FDIALOGLISTMENU_H #include "fmenu.h" @@ -81,4 +81,4 @@ class FDialogListMenu : public FMenu inline const char* FDialogListMenu::getClassName() const { return "FDialogListMenu"; } -#endif // _FDIALOGLISTMENU_H +#endif // FDIALOGLISTMENU_H diff --git a/src/fevent.h b/src/fevent.h index a83b8aac..30bcf25f 100644 --- a/src/fevent.h +++ b/src/fevent.h @@ -50,8 +50,8 @@ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FEVENT_H -#define _FEVENT_H +#ifndef FEVENT_H +#define FEVENT_H #include "fc.h" #include "fpoint.h" @@ -313,4 +313,4 @@ class FTimerEvent : public FEvent // timer event #pragma pack(pop) -#endif // _FEVENT_H +#endif // FEVENT_H diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index e9c3e6d5..6f678501 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -515,37 +515,37 @@ void FFileDialog::init() filename->addCallback ( "activate", - _METHOD_CALLBACK (this, &FFileDialog::cb_processActivate) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processActivate) ); filebrowser->addCallback ( "row-changed", - _METHOD_CALLBACK (this, &FFileDialog::cb_processRowChanged) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processRowChanged) ); filebrowser->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FFileDialog::cb_processClicked) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processClicked) ); hidden->addCallback ( "toggled", - _METHOD_CALLBACK (this, &FFileDialog::cb_processShowHidden) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processShowHidden) ); cancel->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FFileDialog::cb_processCancel) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processCancel) ); open->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FFileDialog::cb_processOpen) + F_METHOD_CALLBACK (this, &FFileDialog::cb_processOpen) ); setModal(); diff --git a/src/ffiledialog.h b/src/ffiledialog.h index 24e5d7d7..416b566a 100644 --- a/src/ffiledialog.h +++ b/src/ffiledialog.h @@ -35,8 +35,8 @@ // ▕ FFileDialog ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FFILEDIALOG_H -#define _FFILEDIALOG_H +#ifndef FFILEDIALOG_H +#define FFILEDIALOG_H #include @@ -191,5 +191,4 @@ inline bool FFileDialog::unsetShowHiddenFiles() inline bool FFileDialog::getShowHiddenFiles() { return show_hidden; } -#endif // _FFILEDIALOG_H - +#endif // FFILEDIALOG_H diff --git a/src/final.h b/src/final.h index 243141bd..3f4f58f0 100644 --- a/src/final.h +++ b/src/final.h @@ -1,7 +1,7 @@ // final.h -#ifndef _FINAL_H -#define _FINAL_H +#ifndef FINAL_H +#define FINAL_H #include "fapp.h" #include "fbuttongroup.h" @@ -32,4 +32,4 @@ #include "ftooltip.h" #include "fwidget.h" -#endif // _FINAL_H +#endif // FINAL_H diff --git a/src/fkey_map.h b/src/fkey_map.h index ff50eadb..f57f222f 100644 --- a/src/fkey_map.h +++ b/src/fkey_map.h @@ -1,7 +1,7 @@ // File: fkey_map.h -#ifndef _FKEYMAP_H -#define _FKEYMAP_H +#ifndef FKEYMAP_H +#define FKEYMAP_H #pragma pack(push) @@ -827,4 +827,4 @@ static keyname FkeyName[] = { 0 , "\0" } }; -#endif // _FKEYMAP_H +#endif // FKEYMAP_H diff --git a/src/flabel.cpp b/src/flabel.cpp index 747235ac..26bda948 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -61,7 +61,7 @@ void FLabel::setAccelWidget (FWidget* widget) accel_widget->addCallback ( "destroy", - _METHOD_CALLBACK (this, &FLabel::cb_accel_widget_destroyed) + F_METHOD_CALLBACK (this, &FLabel::cb_accel_widget_destroyed) ); } diff --git a/src/flabel.h b/src/flabel.h index 49214c1a..8c015284 100644 --- a/src/flabel.h +++ b/src/flabel.h @@ -25,8 +25,8 @@ // ▕ FLabel ▏ // ▕▁▁▁▁▁▁▁▁▏ -#ifndef _FLABEL_H -#define _FLABEL_H +#ifndef FLABEL_H +#define FLABEL_H #include "fwidget.h" @@ -158,4 +158,4 @@ inline bool FLabel::hasEmphasis() inline bool FLabel::hasReverseMode() { return reverse_mode; } -#endif // _FLABEL_H +#endif // FLABEL_H diff --git a/src/flineedit.h b/src/flineedit.h index 800ad835..2b6b4aff 100644 --- a/src/flineedit.h +++ b/src/flineedit.h @@ -25,8 +25,8 @@ // ▕ FLineEdit ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FLINEEDIT_H -#define _FLINEEDIT_H +#ifndef FLINEEDIT_H +#define FLINEEDIT_H #include "fwidget.h" #include "flabel.h" @@ -181,4 +181,4 @@ inline bool FLineEdit::unsetShadow() inline bool FLineEdit::hasShadow() { return ((flags & fc::shadow) != 0); } -#endif // _FLINEEDIT_H +#endif // FLINEEDIT_H diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 42aed8ff..32de047a 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -1458,13 +1458,13 @@ void FListBox::init() vbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FListBox::cb_VBarChange) + F_METHOD_CALLBACK (this, &FListBox::cb_VBarChange) ); hbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FListBox::cb_HBarChange) + F_METHOD_CALLBACK (this, &FListBox::cb_HBarChange) ); nf_offset = isNewFont() ? 1 : 0; @@ -1519,8 +1519,8 @@ void FListBox::draw() if ( isFocus && getStatusBar() ) { - FString msg = getStatusbarMessage(); - FString curMsg = getStatusBar()->getMessage(); + const FString& msg = getStatusbarMessage(); + const FString& curMsg = getStatusBar()->getMessage(); if ( curMsg != msg ) { diff --git a/src/flistbox.h b/src/flistbox.h index d0e4de7b..11dd0bd0 100644 --- a/src/flistbox.h +++ b/src/flistbox.h @@ -27,8 +27,8 @@ // ▕▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ // -#ifndef _FLISTBOX_H -#define _FLISTBOX_H +#ifndef FLISTBOX_H +#define FLISTBOX_H #include "fscrollbar.h" #include "fstring.h" @@ -309,4 +309,4 @@ inline bool FListBox::isMultiSelection() const inline bool FListBox::hasBrackets(int index) const { return bool(data[uInt(index-1)].brackets > 0); } -#endif // _FLISTBOX_H +#endif // FLISTBOX_H diff --git a/src/fmenu.h b/src/fmenu.h index 9d293835..65a8985d 100644 --- a/src/fmenu.h +++ b/src/fmenu.h @@ -32,8 +32,8 @@ // ▕ FMenu ▏- - - - - - - -▕ FMenuItem ▏ // ▕▁▁▁▁▁▁▁▏1 1▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FMENU_H -#define _FMENU_H +#ifndef FMENU_H +#define FMENU_H #include "fwindow.h" #include "fmenubar.h" @@ -248,4 +248,4 @@ inline void FMenu::onAccel (FAccelEvent* ev) { item->onAccel(ev); } -#endif // _FMENU_H +#endif // FMENU_H diff --git a/src/fmenubar.h b/src/fmenubar.h index 7e8cf777..27d1950b 100644 --- a/src/fmenubar.h +++ b/src/fmenubar.h @@ -32,8 +32,8 @@ // ▕ FMenuBar ▏ // ▕▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FMENUBAR_H -#define _FMENUBAR_H +#ifndef FMENUBAR_H +#define FMENUBAR_H #include "fmenu.h" #include "fmenulist.h" @@ -116,4 +116,4 @@ inline const char* FMenuBar::getClassName() const inline bool FMenuBar::isMenu (FMenuItem* mi) const { return mi->hasMenu(); } -#endif // _FMENUBAR_H +#endif // FMENUBAR_H diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index e807d0de..b297f6e6 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -679,7 +679,7 @@ void FMenuItem::init (FWidget* parent) this->addCallback ( "deactivate", - _METHOD_CALLBACK (parent, &FMenuBar::cb_item_deactivated) + F_METHOD_CALLBACK (parent, &FMenuBar::cb_item_deactivated) ); } else if ( isMenu(parent) ) // Parent is menu @@ -764,14 +764,14 @@ void FMenuItem::createDialogList (FMenu* winmenu) win_item->addCallback ( "clicked", - _METHOD_CALLBACK (win_item, &FMenuItem::cb_switchToDialog), + F_METHOD_CALLBACK (win_item, &FMenuItem::cb_switchToDialog), dynamic_cast(win) ); win->addCallback ( "destroy", - _METHOD_CALLBACK (win_item, &FMenuItem::cb_destroyDialog) + F_METHOD_CALLBACK (win_item, &FMenuItem::cb_destroyDialog) ); win_item->associated_window = win; diff --git a/src/fmenuitem.h b/src/fmenuitem.h index 0f7d1321..8bda3146 100644 --- a/src/fmenuitem.h +++ b/src/fmenuitem.h @@ -29,8 +29,8 @@ // └- - - -▕ FMenuList ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FMENUITEM_H -#define _FMENUITEM_H +#ifndef FMENUITEM_H +#define FMENUITEM_H #include "fwidget.h" @@ -244,4 +244,4 @@ inline FWidget* FMenuItem::getSuperMenu() const inline void FMenuItem::setSuperMenu (FWidget* smenu) { super_menu = smenu; } -#endif // _FMENUITEM_H +#endif // FMENUITEM_H diff --git a/src/fmenulist.h b/src/fmenulist.h index 8284f25d..46519501 100644 --- a/src/fmenulist.h +++ b/src/fmenulist.h @@ -16,8 +16,8 @@ // └- - - - - - -▕ FCheckMenuItem ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FMENULIST_H -#define _FMENULIST_H +#ifndef FMENULIST_H +#define FMENULIST_H #include "fmenuitem.h" #include "fwidget.h" @@ -113,4 +113,4 @@ inline bool FMenuList::isSelected(int index) const inline bool FMenuList::hasSelectedItem() const { return selected_item; } -#endif // _FMENULIST_H +#endif // FMENULIST_H diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index efc33fac..ebc6ffd2 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -318,7 +318,7 @@ void FMessageBox::init (int button0, int button1, int button2) button[0]->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FMessageBox::cb_processClick), + F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), static_cast(button_digit[0]) ); } @@ -328,7 +328,7 @@ void FMessageBox::init (int button0, int button1, int button2) button[1]->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FMessageBox::cb_processClick), + F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), static_cast(button_digit[1]) ); } @@ -338,7 +338,7 @@ void FMessageBox::init (int button0, int button1, int button2) button[2]->addCallback ( "clicked", - _METHOD_CALLBACK (this, &FMessageBox::cb_processClick), + F_METHOD_CALLBACK (this, &FMessageBox::cb_processClick), static_cast(button_digit[2]) ); } diff --git a/src/fmessagebox.h b/src/fmessagebox.h index 4a053b0b..aaf71245 100644 --- a/src/fmessagebox.h +++ b/src/fmessagebox.h @@ -35,8 +35,8 @@ // ▕ FMessageBox ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FMESSAGEBOX_H -#define _FMESSAGEBOX_H +#ifndef FMESSAGEBOX_H +#define FMESSAGEBOX_H #include @@ -181,4 +181,4 @@ inline bool FMessageBox::setCenterText() inline bool FMessageBox::unsetCenterText() { return setCenterText(false); } -#endif // _FMESSAGEBOX_H +#endif // FMESSAGEBOX_H diff --git a/src/fobject.h b/src/fobject.h index 73d29ebe..07c9c7c3 100644 --- a/src/fobject.h +++ b/src/fobject.h @@ -8,8 +8,8 @@ // ▕ FObject ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FOBJECT_H -#define _FOBJECT_H +#ifndef FOBJECT_H +#define FOBJECT_H #include #include // need for gettimeofday @@ -210,4 +210,4 @@ static inline bool operator < (const timeval& t1, const timeval& t2) || (t1.tv_sec == t2.tv_sec && t1.tv_usec < t2.tv_usec); } -#endif // _FOBJECT_H +#endif // FOBJECT_H diff --git a/src/fonts/bdf2c.sh b/src/fonts/bdf2c.sh index 0286e1e2..f983cc3b 100755 --- a/src/fonts/bdf2c.sh +++ b/src/fonts/bdf2c.sh @@ -6,8 +6,8 @@ FONTFILE="8x16graph.bdf" ( echo -e "// newfont.h\n" - echo -e "#ifndef _FNEWFONT_H" - echo -e "#define _FNEWFONT_H\n" + echo -e "#ifndef FNEWFONT_H" + echo -e "#define FNEWFONT_H\n" echo -e "\nstatic unsigned char __8x16graph[] =\n{" grep -A${HEIGHT} ^BITMAP "$FONTFILE" \ @@ -26,6 +26,6 @@ FONTFILE="8x16graph.bdf" done echo -e "};" - echo -e "\n#endif // _FNEWFONT_H" + echo -e "\n#endif // FNEWFONT_H" ) > newfont.h diff --git a/src/fonts/font2c.sh b/src/fonts/font2c.sh index 584f45d0..49e37d01 100755 --- a/src/fonts/font2c.sh +++ b/src/fonts/font2c.sh @@ -6,8 +6,8 @@ FONTFILE="8x16std" ( echo -e "// vgafont.h\n" - echo -e "#ifndef _FVGAFONT_H" - echo -e "#define _FVGAFONT_H\n" + echo -e "#ifndef FVGAFONT_H" + echo -e "#define FVGAFONT_H\n" xxd -g 1 -i -c $HEIGHT $FONTFILE \ | sed -e 's/ {$/\n{/' \ @@ -24,5 +24,5 @@ FONTFILE="8x16std" fi done - echo -e "\n#endif // _FVGAFONT_H" + echo -e "\n#endif // FVGAFONT_H" ) > vgafont.h diff --git a/src/fonts/newfont.h b/src/fonts/newfont.h index e832845a..e918953e 100644 --- a/src/fonts/newfont.h +++ b/src/fonts/newfont.h @@ -1,7 +1,7 @@ // newfont.h -#ifndef _FNEWFONT_H -#define _FNEWFONT_H +#ifndef FNEWFONT_H +#define FNEWFONT_H static unsigned char __8x16graph[] = @@ -264,4 +264,4 @@ static unsigned char __8x16graph[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 255 */ }; -#endif // _FNEWFONT_H +#endif // FNEWFONT_H diff --git a/src/fonts/unicodemap.h b/src/fonts/unicodemap.h index d63fed5a..4fd9f905 100644 --- a/src/fonts/unicodemap.h +++ b/src/fonts/unicodemap.h @@ -1,7 +1,7 @@ // unicodemap.h -#ifndef _FUNICODEMAP_H -#define _FUNICODEMAP_H +#ifndef FUNICODEMAP_H +#define FUNICODEMAP_H static struct unipair unicode_cp437_pairs[] = { @@ -313,4 +313,4 @@ static struct unipair unicode_cp437_pairs[] = {0xfffd, 0xfe} }; -#endif // _FUNICODEMAP_H +#endif // FUNICODEMAP_H diff --git a/src/fonts/vgafont.h b/src/fonts/vgafont.h index d34a101c..a2f9885a 100644 --- a/src/fonts/vgafont.h +++ b/src/fonts/vgafont.h @@ -1,7 +1,7 @@ // vgafont.h -#ifndef _FVGAFONT_H -#define _FVGAFONT_H +#ifndef FVGAFONT_H +#define FVGAFONT_H static unsigned char __8x16std[] = { @@ -263,4 +263,4 @@ static unsigned char __8x16std[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 255 */ }; -#endif // _FVGAFONT_H +#endif // FVGAFONT_H diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 92bbc640..f6eb0d2f 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1372,18 +1372,22 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next) short ansi_fg = vga2ansi(fg); short ansi_bg = vga2ansi(bg); - if ( term->fg_color != fg && (color_str = tparm(AF, ansi_fg)) ) + if ( term->fg_color != fg + && (color_str = tparm(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0)) ) append_sequence (color_str); - if ( term->bg_color != bg && (color_str = tparm(AB, ansi_bg)) ) + if ( term->bg_color != bg + && (color_str = tparm(AB, ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0)) ) append_sequence (color_str); } else if ( Sf && Sb ) { - if ( term->fg_color != fg && (color_str = tparm(Sf, fg)) ) + if ( term->fg_color != fg + && (color_str = tparm(Sf, fg, 0, 0, 0, 0, 0, 0, 0, 0)) ) append_sequence (color_str); - if ( term->bg_color != bg && (color_str = tparm(Sb, bg)) ) + if ( term->bg_color != bg + && (color_str = tparm(Sb, bg, 0, 0, 0, 0, 0, 0, 0, 0)) ) append_sequence (color_str); } else if ( sp ) @@ -1391,7 +1395,7 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next) fg = vga2ansi(fg); bg = vga2ansi(bg); - if ( (color_str = tparm(sp, fg, bg)) ) + if ( (color_str = tparm(sp, fg, bg, 0, 0, 0, 0, 0, 0, 0)) ) append_sequence (color_str); } diff --git a/src/foptiattr.h b/src/foptiattr.h index 74772e79..75d05864 100644 --- a/src/foptiattr.h +++ b/src/foptiattr.h @@ -8,8 +8,8 @@ // ▕ FOptiAttr ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FOPTIATTR_H -#define _FOPTIATTR_H +#ifndef FOPTIATTR_H +#define FOPTIATTR_H #include // need for std::swap @@ -306,4 +306,4 @@ inline void FOptiAttr::setDefaultColorSupport() inline void FOptiAttr::setCygwinTerminal() { cygwin_terminal = true; } -#endif // _FOPTIATTR_H +#endif // FOPTIATTR_H diff --git a/src/foptimove.cpp b/src/foptimove.cpp index e41fde60..4f8dae88 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -271,7 +271,7 @@ int FOptiMove::set_column_address (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_column_address.cap = cap; F_column_address.duration = capDuration (temp, 1); F_column_address.length = capDurationToLength (F_column_address.duration); @@ -291,7 +291,7 @@ int FOptiMove::set_row_address (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_row_address.cap = cap; F_row_address.duration = capDuration (temp, 1); F_row_address.length = capDurationToLength (F_row_address.duration); @@ -311,7 +311,7 @@ int FOptiMove::set_parm_up_cursor (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_up_cursor.cap = cap; F_parm_up_cursor.duration = capDuration (temp, 1); F_parm_up_cursor.length = capDurationToLength (F_parm_up_cursor.duration); @@ -331,7 +331,7 @@ int FOptiMove::set_parm_down_cursor (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_down_cursor.cap = cap; F_parm_down_cursor.duration = capDuration (temp, 1); F_parm_down_cursor.length = capDurationToLength (F_parm_down_cursor.duration); @@ -351,7 +351,7 @@ int FOptiMove::set_parm_left_cursor (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_left_cursor.cap = cap; F_parm_left_cursor.duration = capDuration (temp, 1); F_parm_left_cursor.length = capDurationToLength (F_parm_left_cursor.duration); @@ -371,7 +371,7 @@ int FOptiMove::set_parm_right_cursor (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_right_cursor.cap = cap; F_parm_right_cursor.duration = capDuration (temp, 1); F_parm_right_cursor.length = capDurationToLength (F_parm_right_cursor.duration); @@ -391,7 +391,7 @@ int FOptiMove::set_erase_chars (char*& cap) { if ( cap ) { - char* temp = tparm(cap, 23); + char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_erase_chars.cap = cap; F_erase_chars.duration = capDuration (temp, 1); F_erase_chars.length = capDurationToLength (F_erase_chars.duration); @@ -411,7 +411,7 @@ int FOptiMove::set_repeat_char (char*& cap) { if ( cap ) { - char* temp = tparm(cap, ' ', 23); + char* temp = tparm(cap, ' ', 23, 0, 0, 0, 0, 0, 0, 0); F_repeat_char.cap = cap; F_repeat_char.duration = capDuration (temp, 1); F_repeat_char.length = capDurationToLength (F_repeat_char.duration); @@ -757,7 +757,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_row_address.cap ) { if ( move ) - std::strcpy (move, tparm(F_row_address.cap, to_y)); + std::strcpy (move, tparm(F_row_address.cap, to_y, 0, 0, 0, 0, 0, 0, 0, 0)); vtime = F_row_address.duration; } @@ -769,7 +769,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_parm_down_cursor.cap && F_parm_down_cursor.duration < vtime ) { if ( move ) - std::strcpy (move, tparm(F_parm_down_cursor.cap, num)); + std::strcpy (move, tparm(F_parm_down_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0)); vtime = F_parm_down_cursor.duration; } @@ -789,7 +789,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_parm_up_cursor.cap && F_parm_up_cursor.duration < vtime ) { if ( move ) - std::strcpy (move, tparm(F_parm_up_cursor.cap, num)); + std::strcpy (move, tparm(F_parm_up_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0)); vtime = F_parm_up_cursor.duration; } @@ -816,7 +816,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_column_address.cap ) { std::strncat ( hmove - , tparm(F_column_address.cap, to_x) + , tparm(F_column_address.cap, to_x, 0, 0, 0, 0, 0, 0, 0, 0) , sizeof(hmove) - std::strlen(hmove) - 1 ); htime = F_column_address.duration; } @@ -828,7 +828,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_parm_right_cursor.cap && F_parm_right_cursor.duration < htime ) { std::strncat ( hmove - , tparm(F_parm_right_cursor.cap, num) + , tparm(F_parm_right_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , sizeof(hmove) - std::strlen(hmove) - 1 ); htime = F_parm_right_cursor.duration; } @@ -878,7 +878,7 @@ int FOptiMove::relativeMove ( char*& move if ( F_parm_left_cursor.cap && F_parm_left_cursor.duration < htime ) { std::strncat ( hmove - , tparm(F_parm_left_cursor.cap, num) + , tparm(F_parm_left_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , sizeof(hmove) - std::strlen(hmove) - 1 ); htime = F_parm_left_cursor.duration; } diff --git a/src/foptimove.h b/src/foptimove.h index a8c402ea..f77012f5 100644 --- a/src/foptimove.h +++ b/src/foptimove.h @@ -11,8 +11,8 @@ // The cursor optimization based on ncurses lib_mvcur.c // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#ifndef _FOPTIMOVE_H -#define _FOPTIMOVE_H +#ifndef FOPTIMOVE_H +#define FOPTIMOVE_H #include #include // need for tparm @@ -141,4 +141,4 @@ inline void FOptiMove::set_auto_left_margin (bool& bcap) inline void FOptiMove::set_eat_newline_glitch (bool& bcap) { eat_nl_glitch = bcap; } -#endif // _FOPTIMOVE_H +#endif // FOPTIMOVE_H diff --git a/src/fpoint.h b/src/fpoint.h index 7ce4994b..54fabc55 100644 --- a/src/fpoint.h +++ b/src/fpoint.h @@ -8,8 +8,8 @@ // ▕ FPoint ▏ // ▕▁▁▁▁▁▁▁▁▏ -#ifndef _FPOINT_H -#define _FPOINT_H +#ifndef FPOINT_H +#define FPOINT_H //---------------------------------------------------------------------- // class FPoint @@ -115,4 +115,4 @@ inline short& FPoint::x_ref() inline short& FPoint::y_ref() { return ypos; } -#endif // _FPOINT_H +#endif // FPOINT_H diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index 187580ca..dbb35bfd 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -185,7 +185,7 @@ void FProgressbar::drawPercentage() void FProgressbar::drawBar() { int i = 0; - float length = float(bar_length * percentage) / 100; + double length = double(bar_length * percentage) / 100; setPrintPos (1,1); setColor ( wc.progressbar_bg , wc.progressbar_fg ); diff --git a/src/fprogressbar.h b/src/fprogressbar.h index 1fda7012..bdee46dc 100644 --- a/src/fprogressbar.h +++ b/src/fprogressbar.h @@ -25,8 +25,8 @@ // ▕ FProgressbar ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FPROGRESSBAR_H -#define _FPROGRESSBAR_H +#ifndef FPROGRESSBAR_H +#define FPROGRESSBAR_H #include "fwidget.h" @@ -119,4 +119,4 @@ inline bool FProgressbar::hasShadow() { return ((flags & fc::shadow) != 0); } -#endif // _FPROGRESSBAR_H +#endif // FPROGRESSBAR_H diff --git a/src/fradiobutton.h b/src/fradiobutton.h index 0a070cd5..96c04c3d 100644 --- a/src/fradiobutton.h +++ b/src/fradiobutton.h @@ -30,8 +30,8 @@ // ▕ FRadioButton ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FRADIOBUTTON_H -#define _FRADIOBUTTON_H +#ifndef FRADIOBUTTON_H +#define FRADIOBUTTON_H #include "ftogglebutton.h" @@ -76,4 +76,4 @@ class FRadioButton : public FToggleButton inline const char* FRadioButton::getClassName() const { return "FRadioButton"; } -#endif // _FRADIOBUTTON_H +#endif // FRADIOBUTTON_H diff --git a/src/fradiomenuitem.cpp b/src/fradiomenuitem.cpp index 5a73e919..aed99a1a 100644 --- a/src/fradiomenuitem.cpp +++ b/src/fradiomenuitem.cpp @@ -48,7 +48,7 @@ void FRadioMenuItem::init (FWidget* parent) this->addCallback ( "toggled", - _METHOD_CALLBACK (parent, &FMenu::cb_menuitem_toggled) + F_METHOD_CALLBACK (parent, &FMenu::cb_menuitem_toggled) ); } } diff --git a/src/fradiomenuitem.h b/src/fradiomenuitem.h index 79b9079e..5617e8b1 100644 --- a/src/fradiomenuitem.h +++ b/src/fradiomenuitem.h @@ -30,8 +30,8 @@ // ▕ FRadioMenuItem ▏- - - - -▕ FMenu ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▏ -#ifndef _FRADIOMENUITEM_H -#define _FRADIOMENUITEM_H +#ifndef FRADIOMENUITEM_H +#define FRADIOMENUITEM_H #include "fmenuitem.h" @@ -76,4 +76,4 @@ class FRadioMenuItem : public FMenuItem inline const char* FRadioMenuItem::getClassName() const { return "FRadioMenuItem"; } -#endif // _FRADIOMENUITEM_H +#endif // FRADIOMENUITEM_H diff --git a/src/frect.h b/src/frect.h index 49c071b3..1f6ecc75 100644 --- a/src/frect.h +++ b/src/frect.h @@ -8,8 +8,8 @@ // ▕ FRect ▏- - - -▕ FPoint ▏ // ▕▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▏ -#ifndef _FRECT_H -#define _FRECT_H +#ifndef FRECT_H +#define FRECT_H #include #include "fpoint.h" @@ -192,4 +192,4 @@ inline short& FRect::x2_ref() inline short& FRect::y2_ref() { return Y2; } -#endif // _FRECT_H +#endif // FRECT_H diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index ecbeeea0..de3c918d 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -99,7 +99,7 @@ void FScrollbar::setValue (int value) } //---------------------------------------------------------------------- -void FScrollbar::setSteps (float st) +void FScrollbar::setSteps (double st) { if ( st <= 0 ) steps = 1; @@ -107,7 +107,7 @@ void FScrollbar::setSteps (float st) steps = st; if ( pageSize == 0 ) - pageSize = int(float(max)/steps); + pageSize = int(double(max)/steps); } //---------------------------------------------------------------------- @@ -121,7 +121,7 @@ void FScrollbar::setPageSize (int document_size, int page_size) else { pageSize = page_size; - steps = float(float(document_size) / float(page_size)); + steps = double(double(document_size) / double(page_size)); } } @@ -196,7 +196,7 @@ void FScrollbar::calculateSliderValues() else bar_length = length - 2; - slider_length = int(float(bar_length) / steps); + slider_length = int(double(bar_length) / steps); if ( slider_length < 1 ) slider_length = 1; @@ -215,8 +215,8 @@ void FScrollbar::calculateSliderValues() return; } - slider_pos = int( round ( float((bar_length - slider_length) * val) - / float(max - min) ) ); + slider_pos = int( round ( double((bar_length - slider_length) * val) + / double(max - min) ) ); if ( slider_pos < 0 ) slider_pos = 0; @@ -503,15 +503,15 @@ void FScrollbar::onMouseMove (FMouseEvent* ev) { int dy = mouse_y - slider_click_pos; slider_click_pos = mouse_y; - new_val = int( round ( float((max - min) * (slider_pos + dy)) - / float(bar_length - slider_length) ) ); + new_val = int( round ( double((max - min) * (slider_pos + dy)) + / double(bar_length - slider_length) ) ); } else // horizontal { int dx = mouse_x - slider_click_pos; slider_click_pos = mouse_x; - new_val = int( round ( float((max - min) * (slider_pos + dx)) - / float(bar_length - slider_length) ) ); + new_val = int( round ( double((max - min) * (slider_pos + dx)) + / double(bar_length - slider_length) ) ); } if ( new_val != val ) @@ -696,8 +696,8 @@ void FScrollbar::processMiddleButton (int x, int y) { if ( y >1 && y < getHeight() ) { - new_val = int( round ( float(max - min) * (y - 2.0 - (slider_length/2)) - / float(bar_length - slider_length) ) ); + new_val = int( round ( double(max - min) * (y - 2.0 - (slider_length/2)) + / double(bar_length - slider_length) ) ); } else return; @@ -708,8 +708,8 @@ void FScrollbar::processMiddleButton (int x, int y) if ( x > 1+nf && x < getWidth()-nf ) { - new_val = int( round ( float(max - min) * (x - 2.0 - nf - (slider_length/2)) - / float(bar_length - slider_length) ) ); + new_val = int( round ( double(max - min) * (x - 2.0 - nf - (slider_length/2)) + / double(bar_length - slider_length) ) ); } else return; diff --git a/src/fscrollbar.h b/src/fscrollbar.h index 79e54ee5..16c1374b 100644 --- a/src/fscrollbar.h +++ b/src/fscrollbar.h @@ -25,8 +25,8 @@ // ▕ FScrollbar ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FSCROLLBAR_H -#define _FSCROLLBAR_H +#ifndef FSCROLLBAR_H +#define FSCROLLBAR_H #include "fwidget.h" @@ -74,7 +74,7 @@ class FScrollbar : public FWidget void setMaximum (int); void setRange (int, int); void setValue (int); - void setSteps (float); + void setSteps (double); void setPageSize (int, int); void setOrientation (int); void setGeometry (int, int, int, int, bool = true); @@ -108,24 +108,24 @@ class FScrollbar : public FWidget void processScroll(); // Data Members - sType scroll_type; - bool threshold_reached; - int threshold_time; - int repeat_time; - int slider_click_pos; - int slider_click_stop_pos; - int current_slider_pos; - int slider_pos; - int slider_length; - int bar_length; - int val; - int min; - int max; - float steps; - int pageSize; - int length; - int bar_orientation; - int max_color; + sType scroll_type; + bool threshold_reached; + int threshold_time; + int repeat_time; + int slider_click_pos; + int slider_click_stop_pos; + int current_slider_pos; + int slider_pos; + int slider_length; + int bar_length; + int val; + int min; + int max; + double steps; + int pageSize; + int length; + int bar_orientation; + int max_color; }; #pragma pack(pop) @@ -143,4 +143,4 @@ inline int FScrollbar::getValue() const inline FScrollbar::sType FScrollbar::getScrollType() const { return scroll_type; } -#endif // _FSCROLLBAR_H +#endif // FSCROLLBAR_H diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index 5093bc51..928efad9 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -55,7 +55,7 @@ void FScrollView::setScrollWidth (int width) addPreprocessingHandler ( - _PREPROC_HANDLER (this, &FScrollView::copy2area) + F_PREPROC_HANDLER (this, &FScrollView::copy2area) ); child_print_area = viewport; } @@ -82,7 +82,7 @@ void FScrollView::setScrollHeight (int height) resizeArea (scroll_geometry, no_shadow, viewport); addPreprocessingHandler ( - _PREPROC_HANDLER (this, &FScrollView::copy2area) + F_PREPROC_HANDLER (this, &FScrollView::copy2area) ); child_print_area = viewport; } @@ -112,7 +112,7 @@ void FScrollView::setScrollSize (int width, int height) resizeArea (scroll_geometry, no_shadow, viewport); addPreprocessingHandler ( - _PREPROC_HANDLER (this, &FScrollView::copy2area) + F_PREPROC_HANDLER (this, &FScrollView::copy2area) ); child_print_area = viewport; } @@ -774,13 +774,13 @@ void FScrollView::init (FWidget* parent) vbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FScrollView::cb_VBarChange) + F_METHOD_CALLBACK (this, &FScrollView::cb_VBarChange) ); hbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FScrollView::cb_HBarChange) + F_METHOD_CALLBACK (this, &FScrollView::cb_HBarChange) ); nf_offset = isNewFont() ? 1 : 0; @@ -803,7 +803,7 @@ void FScrollView::init (FWidget* parent) createArea (scroll_geometry, no_shadow, viewport); addPreprocessingHandler ( - _PREPROC_HANDLER (this, &FScrollView::copy2area) + F_PREPROC_HANDLER (this, &FScrollView::copy2area) ); if ( viewport ) diff --git a/src/fscrollview.h b/src/fscrollview.h index 95ce65e4..baa38a9a 100644 --- a/src/fscrollview.h +++ b/src/fscrollview.h @@ -26,8 +26,8 @@ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FSCROLLVIEW_H -#define _FSCROLLVIEW_H +#ifndef FSCROLLVIEW_H +#define FSCROLLVIEW_H #include "fscrollbar.h" #include "fwidget.h" @@ -223,4 +223,4 @@ inline void FScrollView::scrollTo (FPoint pos) { scrollTo(pos.getX(), pos.getY()); } -#endif // _FSCROLLVIEW_H +#endif // FSCROLLVIEW_H diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 76e472bf..bd946f66 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -274,7 +274,7 @@ void FStatusBar::insert (FStatusKey* skey) skey->addCallback ( "activate", - _METHOD_CALLBACK (this, &FStatusBar::cb_statuskey_activated) + F_METHOD_CALLBACK (this, &FStatusBar::cb_statuskey_activated) ); } diff --git a/src/fstatusbar.h b/src/fstatusbar.h index e006e240..ea321785 100644 --- a/src/fstatusbar.h +++ b/src/fstatusbar.h @@ -33,8 +33,8 @@ // ▕ FStatusBar ▏- - - -▕ FStatusKey ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FSTATUSBAR_H -#define _FSTATUSBAR_H +#ifndef FSTATUSBAR_H +#define FSTATUSBAR_H #include "fwindow.h" @@ -266,4 +266,4 @@ inline FString FStatusBar::getMessage() const inline void FStatusBar::clearMessage() { text.clear(); } -#endif // _FSTATUSBAR_H +#endif // FSTATUSBAR_H diff --git a/src/fstring.cpp b/src/fstring.cpp index 538ec12e..78593575 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -586,7 +586,7 @@ FString FString::toLower() const { while ( *p ) { - *p = wchar_t(std::towlower(uInt(*p))); + *p = wchar_t(std::towlower(wint_t(*p))); p++; } } @@ -605,7 +605,7 @@ FString FString::toUpper() const { while ( *p ) { - *p = wchar_t(std::towupper(uInt(*p))); + *p = wchar_t(std::towupper(wint_t(*p))); p++; } } @@ -765,7 +765,7 @@ float FString::toFloat() const register double num; num = toDouble(); - if ( num > FLT_MAX || num < FLT_MIN ) + if ( num > double(FLT_MAX) || num < double(FLT_MIN) ) throw std::overflow_error ("overflow"); return float(num); @@ -812,7 +812,7 @@ FString FString::ltrim() const p = s.string; - while ( std::iswspace(uInt(*p)) ) + while ( std::iswspace(wint_t(*p)) ) p++; return FString(p); @@ -832,9 +832,9 @@ FString FString::rtrim() const p = s.string; last = p + length; - while ( std::iswspace(uInt(*--last)) && last > p ); + while ( std::iswspace(wint_t(*--last)) && last > p ); - if ( last == p && std::iswspace(uInt(*last)) ) + if ( last == p && std::iswspace(wint_t(*last)) ) s.clear(); else *(last+1) = '\0'; diff --git a/src/fstring.h b/src/fstring.h index 28535859..23f6515c 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -8,8 +8,8 @@ // ▕ FString ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FSTRING_H -#define _FSTRING_H +#ifndef FSTRING_H +#define FSTRING_H #include @@ -445,4 +445,4 @@ inline FString& FString::setFormatedNumber (uInt num, char separator) { return setFormatedNumber (uLong(num), separator); } -#endif // _FSTRING_H +#endif // FSTRING_H diff --git a/src/fswitch.h b/src/fswitch.h index 3f940eda..1c5cc80e 100644 --- a/src/fswitch.h +++ b/src/fswitch.h @@ -30,8 +30,8 @@ // ▕ FSwitch ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FSWITCH_H -#define _FSWITCH_H +#ifndef FSWITCH_H +#define FSWITCH_H #include "ftogglebutton.h" @@ -87,4 +87,4 @@ class FSwitch : public FToggleButton inline const char* FSwitch::getClassName() const { return "FSwitch"; } -#endif // _FSWITCH_H +#endif // FSWITCH_H diff --git a/src/ftcap_map.h b/src/ftcap_map.h index 617d462b..178c88bc 100644 --- a/src/ftcap_map.h +++ b/src/ftcap_map.h @@ -1,7 +1,7 @@ // File: ftcap_map.h -#ifndef _FTCAPMAP_H -#define _FTCAPMAP_H +#ifndef FTCAPMAP_H +#define FTCAPMAP_H #include "ftermcap.h" @@ -109,4 +109,4 @@ static FTermcap::tcap_map term_caps[] = * "XX", "Us" and "Ue" are unofficial and they are only used here. */ -#endif // _FTCAPMAP_H +#endif // FTCAPMAP_H diff --git a/src/fterm.cpp b/src/fterm.cpp index b33f026d..bc41c7c5 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -54,6 +54,7 @@ bool FTerm::tera_terminal; bool FTerm::cygwin_terminal; bool FTerm::mintty_terminal; bool FTerm::linux_terminal; +bool FTerm::netbsd_terminal; bool FTerm::screen_terminal; bool FTerm::tmux_terminal; bool FTerm::pc_charset_console; @@ -110,15 +111,15 @@ bool FTermcap::no_utf8_acs_chars = false; int FTermcap::max_color = 1; int FTermcap::tabstop = 8; int FTermcap::attr_without_color = 0; -fc::linuxConsoleCursorStyle FTerm::linux_console_cursor_style; -fc::bsdConsoleCursorStyle FTerm::bsd_console_cursor_style; +fc::linuxConsoleCursorStyle FTerm::linux_console_cursor_style; +fc::freebsdConsoleCursorStyle FTerm::freebsd_console_cursor_style; #if defined(__linux__) console_font_op FTerm::screen_font; unimapdesc FTerm::screen_unicode_map; #endif -uChar FTerm::bsd_alt_keymap = 0; +uInt FTerm::bsd_alt_keymap = 0; //---------------------------------------------------------------------- // class FTerm @@ -227,11 +228,11 @@ fc::linuxConsoleCursorStyle FTerm::getLinuxConsoleCursorStyle() } #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- -fc::bsdConsoleCursorStyle FTerm::getBSDConsoleCursorStyle() +fc::freebsdConsoleCursorStyle FTerm::getFreeBSDConsoleCursorStyle() { - return bsd_console_cursor_style; + return freebsd_console_cursor_style; } #endif @@ -282,17 +283,17 @@ void FTerm::setLinuxConsoleCursorStyle ( fc::linuxConsoleCursorStyle style } #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- -void FTerm::setBSDConsoleCursorStyle ( fc::bsdConsoleCursorStyle style - , bool hidden ) +void FTerm::setFreeBSDConsoleCursorStyle ( fc::freebsdConsoleCursorStyle style + , bool hidden ) { // Set cursor style in a BSD console - if ( ! isBSDConsole() ) + if ( ! isFreeBSDConsole() ) return; - bsd_console_cursor_style = style; + freebsd_console_cursor_style = style; if ( hidden ) return; @@ -994,8 +995,8 @@ void FTerm::setXTermCursorStyle (fc::xtermCursorStyle style) { // Set the xterm cursor style -#if defined(BSD) - if ( isBSDConsole() ) +#if defined(__FreeBSD__) || defined(__DragonFly__) + if ( isFreeBSDConsole() ) return; #endif @@ -1666,13 +1667,13 @@ void FTerm::initLinuxConsoleCharMap() } #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- -void FTerm::initBSDConsoleCharMap() +void FTerm::initFreeBSDConsoleCharMap() { // A FreeBSD console can't show ASCII codes from 0x00 to 0x1b - if ( ! isBSDConsole() ) + if ( ! isFreeBSDConsole() ) return; for (int i=0; i <= lastCharItem; i++ ) @@ -1831,9 +1832,9 @@ int FTerm::isLinuxConsole() } #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- -bool FTerm::isBSDConsole() +bool FTerm::isFreeBSDConsole() { keymap_t keymap; @@ -1844,7 +1845,7 @@ bool FTerm::isBSDConsole() } //---------------------------------------------------------------------- -bool FTerm::saveBSDAltKey() +bool FTerm::saveFreeBSDAltKey() { keymap_t keymap; int ret; @@ -1861,7 +1862,7 @@ bool FTerm::saveBSDAltKey() } //---------------------------------------------------------------------- -bool FTerm::setBSDAltKey (uChar key) +bool FTerm::setFreeBSDAltKey (uInt key) { keymap_t keymap; int ret; @@ -1882,15 +1883,15 @@ bool FTerm::setBSDAltKey (uChar key) } //---------------------------------------------------------------------- -bool FTerm::setBSDAlt2Meta() +bool FTerm::setFreeBSDAlt2Meta() { - return setBSDAltKey (META); + return setFreeBSDAltKey (META); } //---------------------------------------------------------------------- -bool FTerm::resetBSDAlt2Meta() +bool FTerm::resetFreeBSDAlt2Meta() { - return setBSDAltKey(bsd_alt_keymap); + return setFreeBSDAltKey (bsd_alt_keymap); } #endif @@ -2374,19 +2375,19 @@ void FTerm::initLinuxConsole() } #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- -void FTerm::initBSDConsole() +void FTerm::initFreeBSDConsole() { // initialize BSD console - if ( isBSDConsole() ) + if ( isFreeBSDConsole() ) { // save current left alt key mapping - saveBSDAltKey(); + saveFreeBSDAltKey(); // map meta key to left alt key - setBSDAlt2Meta(); + setFreeBSDAlt2Meta(); } } #endif @@ -2394,28 +2395,28 @@ void FTerm::initBSDConsole() //---------------------------------------------------------------------- uInt FTerm::getBaudRate (const struct termios* termios_p) { - std::map ospeed; - ospeed[B0] = 0; // hang up - ospeed[B50] = 50; // 50 baud - ospeed[B75] = 75; // 75 baud - ospeed[B110] = 110; // 110 baud - ospeed[B134] = 134; // 134.5 baud - ospeed[B150] = 150; // 150 baud - ospeed[B200] = 200; // 200 baud - ospeed[B300] = 300; // 300 baud - ospeed[B600] = 600; // 600 baud - ospeed[B1200] = 1200; // 1,200 baud - ospeed[B1800] = 1800; // 1,800 baud - ospeed[B2400] = 2400; // 2,400 baud - ospeed[B4800] = 4800; // 4,800 baud - ospeed[B9600] = 9600; // 9,600 baud - ospeed[B19200] = 19200; // 19,200 baud - ospeed[B38400] = 38400; // 38,400 baud - ospeed[B57600] = 57600; // 57,600 baud - ospeed[B115200] = 115200; // 115,200 baud - ospeed[B230400] = 230400; // 230,400 baud + std::map outspeed; + outspeed[B0] = 0; // hang up + outspeed[B50] = 50; // 50 baud + outspeed[B75] = 75; // 75 baud + outspeed[B110] = 110; // 110 baud + outspeed[B134] = 134; // 134.5 baud + outspeed[B150] = 150; // 150 baud + outspeed[B200] = 200; // 200 baud + outspeed[B300] = 300; // 300 baud + outspeed[B600] = 600; // 600 baud + outspeed[B1200] = 1200; // 1,200 baud + outspeed[B1800] = 1800; // 1,800 baud + outspeed[B2400] = 2400; // 2,400 baud + outspeed[B4800] = 4800; // 4,800 baud + outspeed[B9600] = 9600; // 9,600 baud + outspeed[B19200] = 19200; // 19,200 baud + outspeed[B38400] = 38400; // 38,400 baud + outspeed[B57600] = 57600; // 57,600 baud + outspeed[B115200] = 115200; // 115,200 baud + outspeed[B230400] = 230400; // 230,400 baud - return ospeed[cfgetospeed(termios_p)]; + return outspeed[cfgetospeed(termios_p)]; } //---------------------------------------------------------------------- @@ -2633,7 +2634,12 @@ char* FTerm::parseSecDA (char*& current_termtype) case 2: // DEC VT240 case 18: // DEC VT330 case 19: // DEC VT340 + case 24: // DEC VT320 + if ( terminal_id_version == 20 ) + netbsd_terminal = true; // NetBSD workstation console + break; + case 41: // DEC VT420 case 61: // DEC VT510 case 64: // DEC VT520 @@ -3219,8 +3225,8 @@ void FTerm::init_termcaps() const_cast(CSI "29m"); } -#if defined(BSD) - if ( isBSDConsole() ) +#if defined(__FreeBSD__) || defined(__DragonFly__) + if ( isFreeBSDConsole() ) { tcap[fc::t_acs_chars].string = \ const_cast("-\036.\0370\333" @@ -3525,9 +3531,9 @@ void FTerm::init() initLinuxConsole(); #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) // Initialize BSD console - initBSDConsole(); + initFreeBSDConsole(); #endif // Save termios settings @@ -3563,6 +3569,12 @@ void FTerm::init() else linux_terminal = false; + // Test for NetBSD workstation console + if ( std::strncmp(termtype, const_cast("wsvt25"), 6) == 0 ) + netbsd_terminal = true; + else + netbsd_terminal = false; + // Terminal detection if ( terminal_detection ) { @@ -3587,17 +3599,18 @@ void FTerm::init() && ! cygwin_terminal && ! tera_terminal && ! linux_terminal - && getXTermColorName(0) != "" ) + && ! netbsd_terminal + && ! getXTermColorName(0).isEmpty() ) { - if ( getXTermColorName(256) != "" ) + if ( ! getXTermColorName(256).isEmpty() ) { new_termtype = const_cast("xterm-256color"); } - else if ( getXTermColorName(87) != "" ) + else if ( ! getXTermColorName(87).isEmpty() ) { new_termtype = const_cast("xterm-88color"); } - else if ( getXTermColorName(15) != "" ) + else if ( ! getXTermColorName(15).isEmpty() ) { new_termtype = const_cast("xterm-16color"); } @@ -3630,8 +3643,8 @@ void FTerm::init() FTermcap::max_color = 16; #endif -#if defined(BSD) - setBSDConsoleCursorStyle (fc::destructive_cursor, true); +#if defined(__FreeBSD__) || defined(__DragonFly__) + setFreeBSDConsoleCursorStyle (fc::destructive_cursor, true); #endif t.c_lflag |= uInt(ICANON | ECHO); @@ -3877,9 +3890,9 @@ void FTerm::finish() } #endif -#if defined(BSD) - resetBSDAlt2Meta(); - setBSDConsoleCursorStyle (fc::normal_cursor, false); +#if defined(__FreeBSD__) || defined(__DragonFly__) + resetFreeBSDAlt2Meta(); + setFreeBSDConsoleCursorStyle (fc::normal_cursor, false); #endif if ( kde_konsole ) diff --git a/src/fterm.h b/src/fterm.h index f08d0800..ec49b807 100644 --- a/src/fterm.h +++ b/src/fterm.h @@ -24,8 +24,8 @@ // └- - - -▕ FRect ▏ // ▕▁▁▁▁▁▁▁▏ -#ifndef _FTERM_H -#define _FTERM_H +#ifndef FTERM_H +#define FTERM_H #include @@ -40,13 +40,10 @@ #include #endif -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) - #include -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) #include #include #endif -#endif #include #include @@ -59,6 +56,7 @@ #include #include +#include #include #include #include @@ -136,8 +134,8 @@ class FTerm static fc::linuxConsoleCursorStyle getLinuxConsoleCursorStyle(); #endif -#if defined(BSD) - static fc::bsdConsoleCursorStyle getBSDConsoleCursorStyle(); +#if defined(__FreeBSD__) || defined(__DragonFly__) + static fc::freebsdConsoleCursorStyle getFreeBSDConsoleCursorStyle(); #endif #if DEBUG @@ -183,9 +181,9 @@ class FTerm , bool ); #endif -#if defined(BSD) - static void setBSDConsoleCursorStyle ( fc::bsdConsoleCursorStyle - , bool ); +#if defined(__FreeBSD__) || defined(__DragonFly__) + static void setFreeBSDConsoleCursorStyle ( fc::freebsdConsoleCursorStyle + , bool ); #endif static void setTTY (termios&); @@ -278,8 +276,8 @@ class FTerm static void initLinuxConsoleCharMap(); #endif -#if defined(BSD) - static void initBSDConsoleCharMap(); +#if defined(__FreeBSD__) || defined(__DragonFly__) + static void initFreeBSDConsoleCharMap(); #endif static void initCygwinCharMap(); static void initTeraTermCharMap(); @@ -347,12 +345,12 @@ class FTerm static int isLinuxConsole(); #endif -#if defined(BSD) - static bool isBSDConsole(); - static bool saveBSDAltKey(); - static bool setBSDAltKey (uChar); - static bool setBSDAlt2Meta(); - static bool resetBSDAlt2Meta(); +#if defined(__FreeBSD__) || defined(__DragonFly__) + static bool isFreeBSDConsole(); + static bool saveFreeBSDAltKey(); + static bool setFreeBSDAltKey (uInt); + static bool setFreeBSDAlt2Meta(); + static bool resetFreeBSDAlt2Meta(); #endif // Methods @@ -380,8 +378,8 @@ class FTerm static void initLinuxConsole(); #endif -#if defined(BSD) - static void initBSDConsole(); +#if defined(__FreeBSD__) || defined(__DragonFly__) + static void initFreeBSDConsole(); #endif static uInt getBaudRate (const struct termios*); @@ -433,6 +431,7 @@ class FTerm static bool cygwin_terminal; static bool mintty_terminal; static bool linux_terminal; + static bool netbsd_terminal; static bool screen_terminal; static bool tmux_terminal; static char termtype[30]; @@ -449,10 +448,10 @@ class FTerm static struct termios term_init; static fc::linuxConsoleCursorStyle linux_console_cursor_style; - static fc::bsdConsoleCursorStyle bsd_console_cursor_style; + static fc::freebsdConsoleCursorStyle freebsd_console_cursor_style; static struct console_font_op screen_font; static struct unimapdesc screen_unicode_map; - static uChar bsd_alt_keymap; + static uInt bsd_alt_keymap; static FOptiMove* opti_move; static FOptiAttr* opti_attr; @@ -684,4 +683,4 @@ inline void FTerm::setMousePos (short x, short y) { mouse->setPoint (x, y); } -#endif // _FTERM_H +#endif // FTERM_H diff --git a/src/ftermcap.h b/src/ftermcap.h index cd8a6375..6d106843 100644 --- a/src/ftermcap.h +++ b/src/ftermcap.h @@ -8,8 +8,8 @@ // ▕ FTermcap ▏ // ▕▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FTERMCAP_H -#define _FTERMCAP_H +#ifndef FTERMCAP_H +#define FTERMCAP_H //---------------------------------------------------------------------- @@ -67,4 +67,4 @@ class FTermcap }; #pragma pack(pop) -#endif // _FTERMCAP_H +#endif // FTERMCAP_H diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 50117a61..ddcf8226 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -615,13 +615,13 @@ void FTextView::init() vbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FTextView::cb_VBarChange) + F_METHOD_CALLBACK (this, &FTextView::cb_VBarChange) ); hbar->addCallback ( "change-value", - _METHOD_CALLBACK (this, &FTextView::cb_HBarChange) + F_METHOD_CALLBACK (this, &FTextView::cb_HBarChange) ); nf_offset = isNewFont() ? 1 : 0; diff --git a/src/ftextview.h b/src/ftextview.h index 6230ac54..5302eb39 100644 --- a/src/ftextview.h +++ b/src/ftextview.h @@ -25,8 +25,8 @@ // ▕ FTextView ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FTEXTVIEW_H -#define _FTEXTVIEW_H +#ifndef FTEXTVIEW_H +#define FTEXTVIEW_H #include "fapp.h" #include "fscrollbar.h" @@ -145,4 +145,4 @@ inline void FTextView::deleteRange (int start, int end) inline void FTextView::deleteLine (int pos) { deleteRange (pos, pos); } -#endif // _FTEXTVIEW_H +#endif // FTEXTVIEW_H diff --git a/src/ftogglebutton.h b/src/ftogglebutton.h index 3914d5f7..9c586f34 100644 --- a/src/ftogglebutton.h +++ b/src/ftogglebutton.h @@ -25,8 +25,8 @@ // ▕ FToggleButton ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FTOGGLEBUTTON_H -#define _FTOGGLEBUTTON_H +#ifndef FTOGGLEBUTTON_H +#define FTOGGLEBUTTON_H #include "fwidget.h" @@ -197,4 +197,4 @@ inline FButtonGroup* FToggleButton::getGroup() const inline bool FToggleButton::hasGroup() const { return button_group; } -#endif // _FTOGGLEBUTTON_H +#endif // FTOGGLEBUTTON_H diff --git a/src/ftooltip.h b/src/ftooltip.h index f55ab75f..6eb2dffe 100644 --- a/src/ftooltip.h +++ b/src/ftooltip.h @@ -30,8 +30,8 @@ // ▕ FToolTip ▏ // ▕▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FTOOLTIP_H -#define _FTOOLTIP_H +#ifndef FTOOLTIP_H +#define FTOOLTIP_H #include "fwindow.h" @@ -99,4 +99,4 @@ inline const char* FToolTip::getClassName() const { return "FToolTip"; } -#endif // _FTOOLTIP_H +#endif // FTOOLTIP_H diff --git a/src/fvterm.cpp b/src/fvterm.cpp index e495fdf9..d46c151a 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -143,9 +143,9 @@ bool FVTerm::hideCursor (bool on) setLinuxConsoleCursorStyle (getLinuxConsoleCursorStyle(), false); #endif -#if defined(BSD) +#if defined(__FreeBSD__) || defined(__DragonFly__) if ( ! hidden_cursor ) - setBSDConsoleCursorStyle (getBSDConsoleCursorStyle(), false); + setFreeBSDConsoleCursorStyle (getFreeBSDConsoleCursorStyle(), false); #endif return hidden_cursor; @@ -722,8 +722,8 @@ void FVTerm::setInsertCursorStyle (bool on) setLinuxConsoleCursorStyle (fc::underscore_cursor, isCursorHidden()); #endif -#if defined(BSD) - setBSDConsoleCursorStyle (fc::destructive_cursor, isCursorHidden()); +#if defined(__FreeBSD__) || defined(__DragonFly__) + setFreeBSDConsoleCursorStyle (fc::destructive_cursor, isCursorHidden()); #endif if ( isUrxvtTerminal() ) @@ -738,8 +738,8 @@ void FVTerm::setInsertCursorStyle (bool on) setLinuxConsoleCursorStyle (fc::full_block_cursor, isCursorHidden()); #endif -#if defined(BSD) - setBSDConsoleCursorStyle (fc::normal_cursor, isCursorHidden()); +#if defined(__FreeBSD__) || defined(__DragonFly__) + setFreeBSDConsoleCursorStyle (fc::normal_cursor, isCursorHidden()); #endif if ( isUrxvtTerminal() ) @@ -2384,7 +2384,7 @@ void FVTerm::updateTerminalLine (uInt y) && (ut || normal) ) { appendAttributes (print_char); - appendOutputBuffer (tparm(ec, whitespace)); + appendOutputBuffer (tparm(ec, whitespace, 0, 0, 0, 0, 0, 0, 0, 0)); if ( x + whitespace - 1 < xmax || draw_tailing_ws ) setTermXY (int(x + whitespace), int(y)); @@ -2433,7 +2433,7 @@ void FVTerm::updateTerminalLine (uInt y) newFontChanges (print_char); charsetChanges (print_char); appendAttributes (print_char); - appendOutputBuffer (tparm(rp, print_char->code, repetitions)); + appendOutputBuffer (tparm(rp, print_char->code, repetitions, 0, 0, 0, 0, 0, 0, 0)); term_pos->x_ref() += short(repetitions); x = x + repetitions - 1; } @@ -2687,7 +2687,7 @@ int FVTerm::appendLowerRight (char_data*& screen_char) if ( IC ) { - appendOutputBuffer (tparm(IC, 1)); + appendOutputBuffer (tparm(IC, 1, 0, 0, 0, 0, 0, 0, 0, 0)); appendChar (screen_char); } else if ( im && ei ) diff --git a/src/fvterm.h b/src/fvterm.h index 5bf9b66a..15541081 100644 --- a/src/fvterm.h +++ b/src/fvterm.h @@ -23,14 +23,14 @@ // └- - - -▕ FRect ▏ // ▕▁▁▁▁▁▁▁▏ -#ifndef _FVTERM_H -#define _FVTERM_H +#ifndef FVTERM_H +#define FVTERM_H #include "fterm.h" #include // std::stringstream // Preprocessing handler macro -#define _PREPROC_HANDLER(i,h) \ +#define F_PREPROC_HANDLER(i,h) \ reinterpret_cast((i)) \ , reinterpret_cast((h)) @@ -777,4 +777,4 @@ inline void FVTerm::unsetInsertCursorStyle() inline void FVTerm::setPrintArea (term_area* area) { print_area = area; } -#endif // _FVTERM_H +#endif // FVTERM_H diff --git a/src/fwidget.cpp b/src/fwidget.cpp index f1cdcefb..b1dc9c74 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1163,8 +1163,8 @@ void FWidget::show() initLinuxConsoleCharMap(); #endif -#if defined(BSD) - initBSDConsoleCharMap(); +#if defined(__FreeBSD__) || defined(__DragonFly__) + initFreeBSDConsoleCharMap(); #endif // set xterm underline cursor diff --git a/src/fwidget.h b/src/fwidget.h index d6a8fdf4..cf986671 100644 --- a/src/fwidget.h +++ b/src/fwidget.h @@ -68,17 +68,17 @@ // └- - - -▕ FCloseEvent ▏ // ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ -#ifndef _FWIDGET_H -#define _FWIDGET_H +#ifndef FWIDGET_H +#define FWIDGET_H #include "fvterm.h" // Callback macros -#define _FUNCTION_CALLBACK(h) \ +#define F_FUNCTION_CALLBACK(h) \ reinterpret_cast((h)) -#define _METHOD_CALLBACK(i,h) \ +#define F_METHOD_CALLBACK(i,h) \ reinterpret_cast((i)) \ , reinterpret_cast((h)) @@ -967,4 +967,4 @@ const wchar_t CHECKED_RADIO_BUTTON[4] = '\0' }; -#endif // _FWIDGET_H +#endif // FWIDGET_H diff --git a/src/fwindow.h b/src/fwindow.h index 4d3d71c1..c08e9037 100644 --- a/src/fwindow.h +++ b/src/fwindow.h @@ -33,8 +33,8 @@ // └- - - -▕ FWidget ▏ // ▕▁▁▁▁▁▁▁▁▁▏ -#ifndef _FWINDOW_H -#define _FWINDOW_H +#ifndef FWINDOW_H +#define FWINDOW_H #include "fwidget.h" @@ -249,4 +249,4 @@ inline bool FWindow::raiseWindow() inline bool FWindow::lowerWindow() { return lowerWindow(this); } -#endif // _FWINDOW_H +#endif // FWINDOW_H diff --git a/test/calculator.cpp b/test/calculator.cpp index 101aff09..cf9ccdd5 100644 --- a/test/calculator.cpp +++ b/test/calculator.cpp @@ -272,7 +272,7 @@ Calc::Calc (FWidget* parent) btn->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Calc::cb_buttonClicked), + F_METHOD_CALLBACK (this, &Calc::cb_buttonClicked), &button_no[key] ); @@ -527,7 +527,7 @@ void Calc::onKeyPress (FKeyEvent* ev) else input = input.left(input.getLength() - 1); - a = std::atof(input.c_str()); + a = lDouble(std::atof(input.c_str())); drawDispay(); updateTerminal(); } @@ -574,6 +574,7 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data) { int key; lDouble* x; + lDouble infinity = std::numeric_limits::infinity(); using namespace std; @@ -596,7 +597,7 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data) if ( errno == EDOM || errno == ERANGE ) error = true; - if ( *x == INFINITY ) + if ( fabs(*x - infinity) < LDBL_EPSILON ) // x = ∞ error = true; } else @@ -632,7 +633,7 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data) if ( errno == EDOM || errno == ERANGE ) error = true; - if ( *x == INFINITY ) + if ( fabs(*x - infinity) < LDBL_EPSILON ) // x = ∞ error = true; } else @@ -976,7 +977,7 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data) if ( ! input.isEmpty() ) { if ( isDataEntryKey(key) ) - *x = input.toDouble(); + *x = lDouble(input.toDouble()); else { // remove trailing zeros diff --git a/test/choice.cpp b/test/choice.cpp index d5be252f..0152766f 100644 --- a/test/choice.cpp +++ b/test/choice.cpp @@ -111,7 +111,7 @@ int main (int argc, char* argv[]) ok->addCallback ( "clicked", - _FUNCTION_CALLBACK (&cb_quit), + F_FUNCTION_CALLBACK (&cb_quit), dgl ); diff --git a/test/dialog.cpp b/test/dialog.cpp index 58edb22b..99237f47 100644 --- a/test/dialog.cpp +++ b/test/dialog.cpp @@ -54,7 +54,7 @@ int main (int argc, char* argv[]) btn.addCallback ( "clicked", - _FUNCTION_CALLBACK (&cb_quit), + F_FUNCTION_CALLBACK (&cb_quit), &app ); diff --git a/test/input-dialog.cpp b/test/input-dialog.cpp index 63470023..ed74c76f 100644 --- a/test/input-dialog.cpp +++ b/test/input-dialog.cpp @@ -101,7 +101,7 @@ int main (int argc, char* argv[]) check1->addCallback ( "clicked", - _FUNCTION_CALLBACK (&cb_publish), + F_FUNCTION_CALLBACK (&cb_publish), check2 ); @@ -109,7 +109,7 @@ int main (int argc, char* argv[]) btn.addCallback ( "clicked", - _FUNCTION_CALLBACK (&cb_quit), + F_FUNCTION_CALLBACK (&cb_quit), &app ); diff --git a/test/menu.cpp b/test/menu.cpp index 4a1f33f5..a30538ba 100644 --- a/test/menu.cpp +++ b/test/menu.cpp @@ -174,7 +174,7 @@ Menu::Menu (FWidget* parent) Quit->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Menu::cb_exitApp) + F_METHOD_CALLBACK (this, &Menu::cb_exitApp) ); // Statusbar at the bottom @@ -221,7 +221,7 @@ void Menu::defaultCallback (FMenuList* mb) item->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Menu::cb_message) + F_METHOD_CALLBACK (this, &Menu::cb_message) ); // Call sub-menu diff --git a/test/mouse.cpp b/test/mouse.cpp index 8638d4d4..fe69127b 100644 --- a/test/mouse.cpp +++ b/test/mouse.cpp @@ -341,7 +341,7 @@ MouseDraw::MouseDraw (FWidget* parent) c_chooser->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MouseDraw::cb_colorChanged) + F_METHOD_CALLBACK (this, &MouseDraw::cb_colorChanged) ); brush = new Brushes(this); diff --git a/test/scrollview.cpp b/test/scrollview.cpp index 1a5fd193..474b83be 100644 --- a/test/scrollview.cpp +++ b/test/scrollview.cpp @@ -72,25 +72,25 @@ scrollview::scrollview (FWidget* parent) go_east->addCallback ( "clicked", - _METHOD_CALLBACK (this, &scrollview::cb_go_east) + F_METHOD_CALLBACK (this, &scrollview::cb_go_east) ); go_south->addCallback ( "clicked", - _METHOD_CALLBACK (this, &scrollview::cb_go_south) + F_METHOD_CALLBACK (this, &scrollview::cb_go_south) ); go_west->addCallback ( "clicked", - _METHOD_CALLBACK (this, &scrollview::cb_go_west) + F_METHOD_CALLBACK (this, &scrollview::cb_go_west) ); go_north->addCallback ( "clicked", - _METHOD_CALLBACK (this, &scrollview::cb_go_north) + F_METHOD_CALLBACK (this, &scrollview::cb_go_north) ); } @@ -212,7 +212,7 @@ scrollviewdemo::scrollviewdemo (FWidget* parent) button->addCallback ( "clicked", - _METHOD_CALLBACK (this, &scrollviewdemo::cb_quit) + F_METHOD_CALLBACK (this, &scrollviewdemo::cb_quit) ); // Text label diff --git a/test/string-operations.cpp b/test/string-operations.cpp index 43bab425..8c3869f8 100644 --- a/test/string-operations.cpp +++ b/test/string-operations.cpp @@ -1,5 +1,6 @@ // File: string-operations.cpp +#include #include #include diff --git a/test/term-attributes.cpp b/test/term-attributes.cpp index 31ef7e97..fc4fcdf2 100644 --- a/test/term-attributes.cpp +++ b/test/term-attributes.cpp @@ -73,13 +73,13 @@ AttribDlg::AttribDlg (FWidget* parent) next_button->addCallback ( "clicked", - _METHOD_CALLBACK (this, &AttribDlg::cb_next) + F_METHOD_CALLBACK (this, &AttribDlg::cb_next) ); back_button->addCallback ( "clicked", - _METHOD_CALLBACK (this, &AttribDlg::cb_back) + F_METHOD_CALLBACK (this, &AttribDlg::cb_back) ); } diff --git a/test/ui.cpp b/test/ui.cpp index 07e22d3a..18029013 100644 --- a/test/ui.cpp +++ b/test/ui.cpp @@ -80,19 +80,19 @@ ProgressDialog::ProgressDialog (FWidget* parent) reset->addCallback ( "clicked", - _METHOD_CALLBACK (this, &ProgressDialog::cb_reset_bar) + F_METHOD_CALLBACK (this, &ProgressDialog::cb_reset_bar) ); more->addCallback ( "clicked", - _METHOD_CALLBACK (this, &ProgressDialog::cb_more_bar) + F_METHOD_CALLBACK (this, &ProgressDialog::cb_more_bar) ); quit->addCallback ( "clicked", - _METHOD_CALLBACK (this, &ProgressDialog::cb_exit_bar) + F_METHOD_CALLBACK (this, &ProgressDialog::cb_exit_bar) ); } @@ -350,75 +350,75 @@ MyDialog::MyDialog (FWidget* parent) Open->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_view) + F_METHOD_CALLBACK (this, &MyDialog::cb_view) ); Quit->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_exitApp) + F_METHOD_CALLBACK (this, &MyDialog::cb_exitApp) ); Cut->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_cutClipboard) + F_METHOD_CALLBACK (this, &MyDialog::cb_cutClipboard) ); Copy->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_copyClipboard) + F_METHOD_CALLBACK (this, &MyDialog::cb_copyClipboard) ); Paste->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_pasteClipboard) + F_METHOD_CALLBACK (this, &MyDialog::cb_pasteClipboard) ); Clear->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_clearInput) + F_METHOD_CALLBACK (this, &MyDialog::cb_clearInput) ); Env->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_terminfo) + F_METHOD_CALLBACK (this, &MyDialog::cb_terminfo) ); Drive->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_drives) + F_METHOD_CALLBACK (this, &MyDialog::cb_drives) ); Help->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_about) + F_METHOD_CALLBACK (this, &MyDialog::cb_about) ); File1->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_view), + F_METHOD_CALLBACK (this, &MyDialog::cb_view), dynamic_cast(File1) ); File2->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_view), + F_METHOD_CALLBACK (this, &MyDialog::cb_view), dynamic_cast(File2) ); File3->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_view), + F_METHOD_CALLBACK (this, &MyDialog::cb_view), dynamic_cast(File3) ); @@ -543,83 +543,83 @@ MyDialog::MyDialog (FWidget* parent) MyButton1->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) + F_METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) ); MyButton2->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) + F_METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) ); MyButton3->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) + F_METHOD_CALLBACK (this, &MyDialog::cb_noFunctionMsg) ); MyButton4->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText), + F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText), dynamic_cast(myLineEdit) ); MyButton5->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_ProgressBar) + F_METHOD_CALLBACK (this, &MyDialog::cb_ProgressBar) ); MyButton6->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_exitApp) + F_METHOD_CALLBACK (this, &MyDialog::cb_exitApp) ); myLineEdit->addCallback ( "activate", // e.g. on - _METHOD_CALLBACK (this, &MyDialog::cb_setTitlebar) + F_METHOD_CALLBACK (this, &MyDialog::cb_setTitlebar) ); radio1->addCallback ( "toggled", - _METHOD_CALLBACK (this, &MyDialog::cb_activateButton), + F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton), dynamic_cast(MyButton5) ); myList->addCallback ( "clicked", - _METHOD_CALLBACK (this, &MyDialog::cb_setInput), + F_METHOD_CALLBACK (this, &MyDialog::cb_setInput), dynamic_cast(myLineEdit) ); myList->addCallback ( "row-selected", - _METHOD_CALLBACK (this, &MyDialog::cb_updateNumber), + F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber), dynamic_cast(tagged_count) ); key_F1->addCallback ( "activate", - _METHOD_CALLBACK (this, &MyDialog::cb_about) + F_METHOD_CALLBACK (this, &MyDialog::cb_about) ); key_F2->addCallback ( "activate", - _METHOD_CALLBACK (this, &MyDialog::cb_view) + F_METHOD_CALLBACK (this, &MyDialog::cb_view) ); key_F3->addCallback ( "activate", - _METHOD_CALLBACK (this, &MyDialog::cb_exitApp) + F_METHOD_CALLBACK (this, &MyDialog::cb_exitApp) ); } diff --git a/test/watch.cpp b/test/watch.cpp index 5b52d193..5deb2c61 100644 --- a/test/watch.cpp +++ b/test/watch.cpp @@ -91,21 +91,21 @@ watch::watch (FWidget* parent) clock_sw->addCallback ( "toggled", - _METHOD_CALLBACK (this, &watch::cb_clock) + F_METHOD_CALLBACK (this, &watch::cb_clock) ); // Connect switch signal "toggled" with a callback member function seconds_sw->addCallback ( "toggled", - _METHOD_CALLBACK (this, &watch::cb_seconds) + F_METHOD_CALLBACK (this, &watch::cb_seconds) ); // Connect button signal "clicked" with a callback member function quit_btn->addCallback ( "clicked", - _METHOD_CALLBACK (this, &watch::cb_exitApp) + F_METHOD_CALLBACK (this, &watch::cb_exitApp) ); } diff --git a/test/windows.cpp b/test/windows.cpp index 95738fcd..9cadab92 100644 --- a/test/windows.cpp +++ b/test/windows.cpp @@ -265,50 +265,50 @@ Window::Window (FWidget* parent) New->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_createWindows) + F_METHOD_CALLBACK (this, &Window::cb_createWindows) ); Close->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_closeWindows) + F_METHOD_CALLBACK (this, &Window::cb_closeWindows) ); Next->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_next) + F_METHOD_CALLBACK (this, &Window::cb_next) ); Previous->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_previous) + F_METHOD_CALLBACK (this, &Window::cb_previous) ); Quit->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_exitApp) + F_METHOD_CALLBACK (this, &Window::cb_exitApp) ); // Add button callback CreateButton->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_createWindows) + F_METHOD_CALLBACK (this, &Window::cb_createWindows) ); CloseButton->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_closeWindows) + F_METHOD_CALLBACK (this, &Window::cb_closeWindows) ); QuitButton->addCallback ( "clicked", - _METHOD_CALLBACK (this, &Window::cb_exitApp) + F_METHOD_CALLBACK (this, &Window::cb_exitApp) ); for (int n=1; n <= 6; n++) @@ -434,7 +434,7 @@ void Window::cb_createWindows (FWidget*, data_ptr) win->addCallback ( "destroy", - _METHOD_CALLBACK (this, &Window::cb_destroyWindow), + F_METHOD_CALLBACK (this, &Window::cb_destroyWindow), static_cast(win_dat) ); }