Rename preprocessor macro names with leading underscore

This commit is contained in:
Markus Gans 2017-04-09 20:08:53 +02:00
parent 68c4b8385a
commit c6dba0b4ac
80 changed files with 415 additions and 394 deletions

View File

@ -1,3 +1,7 @@
2017-04-09 Markus Gans <guru.mail@muenster.de>
* The Final Cut compiles now also under NetBSD
* Rename preprocessor macro names with leading underscore
2017-04-08 Markus Gans <guru.mail@muenster.de>
* Looking in /etc/ttys for the type of terminal

View File

@ -33,8 +33,8 @@
// └- - - -▕ FWidget ▏
// ▕▁▁▁▁▁▁▁▁▁▏
#ifndef _FAPPLICATION_H
#define _FAPPLICATION_H
#ifndef FAPPLICATION_H
#define FAPPLICATION_H
#include <getopt.h>
#include <deque>
@ -236,4 +236,4 @@ inline FWidget* FApplication::getFocusWidget() const
{ return focus_widget; }
#endif // _FAPPLICATION_H
#endif // FAPPLICATION_H

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -35,8 +35,8 @@
// ▕ FFileDialog ▏
// ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏
#ifndef _FFILEDIALOG_H
#define _FFILEDIALOG_H
#ifndef FFILEDIALOG_H
#define FFILEDIALOG_H
#include <sys/param.h>
@ -191,5 +191,4 @@ inline bool FFileDialog::unsetShowHiddenFiles()
inline bool FFileDialog::getShowHiddenFiles()
{ return show_hidden; }
#endif // _FFILEDIALOG_H
#endif // FFILEDIALOG_H

View File

@ -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

View File

@ -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

View File

@ -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)
);
}

View File

@ -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

View File

@ -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

View File

@ -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 )
{

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<FWidget::data_ptr>(win)
);
win->addCallback
(
"destroy",
_METHOD_CALLBACK (win_item, &FMenuItem::cb_destroyDialog)
F_METHOD_CALLBACK (win_item, &FMenuItem::cb_destroyDialog)
);
win_item->associated_window = win;

View File

@ -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

View File

@ -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

View File

@ -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<FWidget::data_ptr>(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<FWidget::data_ptr>(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<FWidget::data_ptr>(button_digit[2])
);
}

View File

@ -35,8 +35,8 @@
// ▕ FMessageBox ▏
// ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏
#ifndef _FMESSAGEBOX_H
#define _FMESSAGEBOX_H
#ifndef FMESSAGEBOX_H
#define FMESSAGEBOX_H
#include <cstring>
@ -181,4 +181,4 @@ inline bool FMessageBox::setCenterText()
inline bool FMessageBox::unsetCenterText()
{ return setCenterText(false); }
#endif // _FMESSAGEBOX_H
#endif // FMESSAGEBOX_H

View File

@ -8,8 +8,8 @@
// ▕ FObject ▏
// ▕▁▁▁▁▁▁▁▁▁▏
#ifndef _FOBJECT_H
#define _FOBJECT_H
#ifndef FOBJECT_H
#define FOBJECT_H
#include <stdint.h>
#include <sys/time.h> // 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -8,8 +8,8 @@
// ▕ FOptiAttr ▏
// ▕▁▁▁▁▁▁▁▁▁▁▁▏
#ifndef _FOPTIATTR_H
#define _FOPTIATTR_H
#ifndef FOPTIATTR_H
#define FOPTIATTR_H
#include <algorithm> // 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

View File

@ -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;
}

View File

@ -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 <assert.h>
#include <term.h> // 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

View File

@ -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

View File

@ -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 );

View File

@ -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

View File

@ -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

View File

@ -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)
);
}
}

View File

@ -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

View File

@ -8,8 +8,8 @@
// ▕ FRect ▏- - - -▕ FPoint ▏
// ▕▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▏
#ifndef _FRECT_H
#define _FRECT_H
#ifndef FRECT_H
#define FRECT_H
#include <algorithm>
#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

View File

@ -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;

View File

@ -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

View File

@ -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 )

View File

@ -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

View File

@ -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)
);
}

View File

@ -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

View File

@ -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';

View File

@ -8,8 +8,8 @@
// ▕ FString ▏
// ▕▁▁▁▁▁▁▁▁▁▏
#ifndef _FSTRING_H
#define _FSTRING_H
#ifndef FSTRING_H
#define FSTRING_H
#include <sys/types.h>
@ -445,4 +445,4 @@ inline FString& FString::setFormatedNumber (uInt num, char separator)
{ return setFormatedNumber (uLong(num), separator); }
#endif // _FSTRING_H
#endif // FSTRING_H

View File

@ -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

View File

@ -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

View File

@ -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<speed_t,uInt> 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<speed_t,uInt> 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<char*>(CSI "29m");
}
#if defined(BSD)
if ( isBSDConsole() )
#if defined(__FreeBSD__) || defined(__DragonFly__)
if ( isFreeBSDConsole() )
{
tcap[fc::t_acs_chars].string = \
const_cast<char*>("-\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<char*>("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<char*>("xterm-256color");
}
else if ( getXTermColorName(87) != "" )
else if ( ! getXTermColorName(87).isEmpty() )
{
new_termtype = const_cast<char*>("xterm-88color");
}
else if ( getXTermColorName(15) != "" )
else if ( ! getXTermColorName(15).isEmpty() )
{
new_termtype = const_cast<char*>("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 )

View File

@ -24,8 +24,8 @@
// └- - - -▕ FRect ▏
// ▕▁▁▁▁▁▁▁▏
#ifndef _FTERM_H
#define _FTERM_H
#ifndef FTERM_H
#define FTERM_H
#include <fconfig.h>
@ -40,13 +40,10 @@
#include <sys/kd.h>
#endif
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <sys/param.h>
#if defined(BSD)
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/consio.h>
#include <sys/kbio.h>
#endif
#endif
#include <sys/ioctl.h>
#include <sys/stat.h>
@ -59,6 +56,7 @@
#include <ttyent.h>
#include <unistd.h>
#include <clocale>
#include <cmath>
#include <csignal>
#include <map>
@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -23,14 +23,14 @@
// └- - - -▕ FRect ▏
// ▕▁▁▁▁▁▁▁▏
#ifndef _FVTERM_H
#define _FVTERM_H
#ifndef FVTERM_H
#define FVTERM_H
#include "fterm.h"
#include <sstream> // std::stringstream
// Preprocessing handler macro
#define _PREPROC_HANDLER(i,h) \
#define F_PREPROC_HANDLER(i,h) \
reinterpret_cast<FVTerm*>((i)) \
, reinterpret_cast<FVTerm::FPreprocessingHandler>((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

View File

@ -1163,8 +1163,8 @@ void FWidget::show()
initLinuxConsoleCharMap();
#endif
#if defined(BSD)
initBSDConsoleCharMap();
#if defined(__FreeBSD__) || defined(__DragonFly__)
initFreeBSDConsoleCharMap();
#endif
// set xterm underline cursor

View File

@ -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<FWidget::FCallback>((h))
#define _METHOD_CALLBACK(i,h) \
#define F_METHOD_CALLBACK(i,h) \
reinterpret_cast<FWidget*>((i)) \
, reinterpret_cast<FWidget::FMemberCallback>((h))
@ -967,4 +967,4 @@ const wchar_t CHECKED_RADIO_BUTTON[4] =
'\0'
};
#endif // _FWIDGET_H
#endif // FWIDGET_H

View File

@ -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

View File

@ -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<lDouble>::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

View File

@ -111,7 +111,7 @@ int main (int argc, char* argv[])
ok->addCallback
(
"clicked",
_FUNCTION_CALLBACK (&cb_quit),
F_FUNCTION_CALLBACK (&cb_quit),
dgl
);

View File

@ -54,7 +54,7 @@ int main (int argc, char* argv[])
btn.addCallback
(
"clicked",
_FUNCTION_CALLBACK (&cb_quit),
F_FUNCTION_CALLBACK (&cb_quit),
&app
);

View File

@ -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
);

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -1,5 +1,6 @@
// File: string-operations.cpp
#include <clocale>
#include <iomanip>
#include <langinfo.h>

View File

@ -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)
);
}

View File

@ -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<FWidget::data_ptr>(File1)
);
File2->addCallback
(
"clicked",
_METHOD_CALLBACK (this, &MyDialog::cb_view),
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
dynamic_cast<FWidget::data_ptr>(File2)
);
File3->addCallback
(
"clicked",
_METHOD_CALLBACK (this, &MyDialog::cb_view),
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
dynamic_cast<FWidget::data_ptr>(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<FWidget::data_ptr>(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 <Enter>
_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<FWidget::data_ptr>(MyButton5)
);
myList->addCallback
(
"clicked",
_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
F_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
dynamic_cast<FWidget::data_ptr>(myLineEdit)
);
myList->addCallback
(
"row-selected",
_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
dynamic_cast<FWidget::data_ptr>(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)
);
}

View File

@ -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)
);
}

View File

@ -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<FWidget::data_ptr>(win_dat)
);
}