From 28f3de0971e5a006c326b146cb4932c288619ce1 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 17 Sep 2017 21:32:46 +0200 Subject: [PATCH] All include files were moved to a separate director --- .gitignore | 48 +++++------ ChangeLog | 1 + Makefile.am | 2 +- Makefile.in | 2 +- configure | 10 +-- configure.ac | 4 +- debian/libfinal-examples.install | 8 +- examples/Makefile.am | 2 +- examples/Makefile.clang | 2 +- examples/Makefile.gcc | 2 +- examples/Makefile.in | 8 +- examples/calculator.cpp | 10 +-- examples/choice.cpp | 12 +-- examples/dialog.cpp | 8 +- examples/hello.cpp | 4 +- examples/input-dialog.cpp | 14 ++-- examples/keyboard.cpp | 2 +- examples/listbox.cpp | 8 +- examples/listview.cpp | 8 +- examples/mandelbrot.cpp | 6 +- examples/menu.cpp | 18 ++-- examples/mouse.cpp | 8 +- examples/opti-move.cpp | 4 +- examples/scrollview.cpp | 12 +-- examples/string-operations.cpp | 2 +- examples/term-attributes.cpp | 8 +- examples/termcap.cpp | 6 +- examples/timer.cpp | 2 +- examples/transparent.cpp | 12 +-- examples/treeview.cpp | 12 ++- examples/ui.cpp | 2 +- examples/watch.cpp | 10 +-- examples/windows.cpp | 26 +++--- include/final/fapplication.h | 6 +- include/final/fbutton.h | 2 +- include/final/fbuttongroup.h | 2 +- include/final/fc.h | 2 +- include/final/fcheckbox.h | 2 +- include/final/fcheckmenuitem.h | 2 +- include/final/fconfig.h | 12 +-- include/final/fdialog.h | 8 +- include/final/fdialoglistmenu.h | 2 +- include/final/fevent.h | 4 +- include/final/ffiledialog.h | 16 ++-- include/final/flabel.h | 3 +- include/final/flineedit.h | 4 +- include/final/flistbox.h | 6 +- include/final/flistview.h | 10 +-- include/final/fmenu.h | 8 +- include/final/fmenubar.h | 6 +- include/final/fmenuitem.h | 2 +- include/final/fmenulist.h | 8 +- include/final/fmessagebox.h | 6 +- include/final/fobject.h | 6 +- include/final/foptiattr.h | 2 +- include/final/fprogressbar.h | 2 +- include/final/fradiobutton.h | 2 +- include/final/fradiomenuitem.h | 2 +- include/final/frect.h | 2 +- include/final/fscrollbar.h | 2 +- include/final/fscrollview.h | 4 +- include/final/fstatusbar.h | 2 +- include/final/fstring.h | 6 +- include/final/fswitch.h | 2 +- include/final/ftcap_map.h | 2 +- include/final/fterm.h | 24 +++--- include/final/ftermbuffer.h | 4 +- include/final/ftextview.h | 10 +-- include/final/ftogglebutton.h | 2 +- include/final/ftooltip.h | 2 +- include/final/fvterm.h | 3 +- include/final/fwidget.h | 4 +- include/final/fwindow.h | 2 +- scripts/cppcheck.sh | 2 +- scripts/cpuprofile.sh | 6 +- scripts/disassemble.sh | 2 +- scripts/kcachegrind.sh | 2 +- scripts/library_calls.sh | 2 +- scripts/profile.sh | 2 +- scripts/remove_eol_spaces.sh | 3 +- scripts/syscall_statistic.sh | 2 +- scripts/valgrind.sh | 2 +- scripts/xterm-latin1.sh | 2 +- src/Makefile.am | 95 ++++++++++----------- src/Makefile.clang | 17 ++-- src/Makefile.gcc | 17 ++-- src/Makefile.in | 95 ++++++++++----------- src/fapplication.cpp | 16 ++-- src/fbutton.cpp | 6 +- src/fbuttongroup.cpp | 8 +- src/fcheckbox.cpp | 2 +- src/fcheckmenuitem.cpp | 4 +- src/fdialog.cpp | 6 +- src/fdialoglistmenu.cpp | 2 +- src/fevent.cpp | 6 +- src/ffiledialog.cpp | 2 +- src/flabel.cpp | 6 +- src/flineedit.cpp | 6 +- src/flistbox.cpp | 8 +- src/flistview.cpp | 12 +-- src/fmenu.cpp | 8 +- src/fmenubar.cpp | 16 ++-- src/fmenuitem.cpp | 15 ++-- src/fmenulist.cpp | 2 +- src/fmessagebox.cpp | 4 +- src/fobject.cpp | 2 +- src/foptiattr.cpp | 5 +- src/foptimove.cpp | 4 +- src/fpoint.cpp | 2 +- src/fprogressbar.cpp | 2 +- src/fradiobutton.cpp | 4 +- src/fradiomenuitem.cpp | 4 +- src/frect.cpp | 2 +- src/fscrollbar.cpp | 6 +- src/fscrollview.cpp | 4 +- src/fstatusbar.cpp | 4 +- src/fstring.cpp | 136 +++++++++++++++---------------- src/fswitch.cpp | 2 +- src/fterm.cpp | 26 +++--- src/ftermbuffer.cpp | 2 +- src/ftextview.cpp | 8 +- src/ftogglebutton.cpp | 8 +- src/ftooltip.cpp | 4 +- src/fvterm.cpp | 24 +++--- src/fwidget.cpp | 22 ++--- src/fwindow.cpp | 10 +-- stamp-h1 | 1 - 127 files changed, 578 insertions(+), 561 deletions(-) delete mode 100644 stamp-h1 diff --git a/.gitignore b/.gitignore index fad926d0..73594396 100644 --- a/.gitignore +++ b/.gitignore @@ -21,27 +21,27 @@ libtool /autom4te.cache src/.deps/ src/.libs/ -test/.deps/ -test/.libs/ -test/calculator -test/dialog -test/string-operations -test/opti-move -test/termcap -test/hello -test/watch -test/menu -test/scrollview -test/windows -test/term-attributes -test/transparent -test/input-dialog -test/choice -test/listbox -test/listview -test/treeview -test/mandelbrot -test/keyboard -test/mouse -test/timer -test/ui +examples/.deps/ +examples/.libs/ +examples/calculator +examples/dialog +examples/string-operations +examples/opti-move +examples/termcap +examples/hello +examples/watch +examples/menu +examples/scrollview +examples/windows +examples/term-attributes +examples/transparent +examples/input-dialog +examples/choice +examples/listbox +examples/listview +examples/treeview +examples/mandelbrot +examples/keyboard +examples/mouse +examples/timer +examples/ui diff --git a/ChangeLog b/ChangeLog index e3b699e9..435b8ba6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2017-09-17 Markus Gans * FObject has received the iterator child access methods begin() and end() + * All include files were moved to a separate directory 2017-09-15 Markus Gans * Fix byte access in data type char_data diff --git a/Makefile.am b/Makefile.am index fe0b2fb6..784f750b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src doc test +SUBDIRS = src doc examples docdir = ${datadir}/doc/${PACKAGE} doc_DATA = AUTHORS COPYING ChangeLog diff --git a/Makefile.in b/Makefile.in index ef17166c..361b0b03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -352,7 +352,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src doc test +SUBDIRS = src doc examples doc_DATA = AUTHORS COPYING ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/configure b/configure index 4febf2c3..b899e6f9 100755 --- a/configure +++ b/configure @@ -2351,7 +2351,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" -ac_config_commands="$ac_config_commands src/fconfig.h" +ac_config_commands="$ac_config_commands include/final/fconfig.h" am__api_version='1.14' @@ -16978,7 +16978,7 @@ SO_VERSION="3:0:3" -ac_config_files="$ac_config_files Makefile src/Makefile src/fonts/Makefile doc/Makefile test/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile src/fonts/Makefile doc/Makefile examples/Makefile" # use GPM (General Purpose Mouse) @@ -18191,14 +18191,14 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "src/fconfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/fconfig.h" ;; + "include/final/fconfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/final/fconfig.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/fonts/Makefile") CONFIG_FILES="$CONFIG_FILES src/fonts/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -18794,7 +18794,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in - "src/fconfig.h":C) ac_prefix_conf_OUT=`echo src/fconfig.h` + "include/final/fconfig.h":C) ac_prefix_conf_OUT=`echo include/final/fconfig.h` ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"` ac_prefix_conf_PKG=`echo F` ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"` diff --git a/configure.ac b/configure.ac index f385528b..9380571f 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_INIT([finalcut], [0.3.0]) AC_CONFIG_HEADER([config.h]) -AX_PREFIX_CONFIG_H([src/fconfig.h], [F]) +AX_PREFIX_CONFIG_H([include/final/fconfig.h], [F]) AC_CONFIG_SRCDIR([src/fobject.cpp]) AM_INIT_AUTOMAKE AC_PROG_CC @@ -54,7 +54,7 @@ AC_SUBST([LIBTOOL_DEPS]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_FILES([Makefile src/Makefile src/fonts/Makefile doc/Makefile test/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile src/fonts/Makefile doc/Makefile examples/Makefile]) # use GPM (General Purpose Mouse) AC_ARG_WITH([gpm], diff --git a/debian/libfinal-examples.install b/debian/libfinal-examples.install index d627894b..dd0efdab 100644 --- a/debian/libfinal-examples.install +++ b/debian/libfinal-examples.install @@ -1,4 +1,4 @@ -test/.libs/* usr/lib/finalcut/examples -test/*.cpp usr/lib/finalcut/examples -test/Makefile.clang usr/lib/finalcut/examples -test/Makefile.gcc usr/lib/finalcut/examples +examples/.libs/* usr/lib/finalcut/examples +examples/*.cpp usr/lib/finalcut/examples +examples/Makefile.clang usr/lib/finalcut/examples +examples/Makefile.gcc usr/lib/finalcut/examples diff --git a/examples/Makefile.am b/examples/Makefile.am index c9f9d428..24f852ac 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -3,7 +3,7 @@ #---------------------------------------------------------------------- AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal -AM_CPPFLAGS = -Wall -Werror -I$(top_srcdir)/src +AM_CPPFLAGS = -I$(top_srcdir)/include -Wall -Werror noinst_PROGRAMS = \ hello \ diff --git a/examples/Makefile.clang b/examples/Makefile.clang index 7ef3f7cf..e64b4a51 100644 --- a/examples/Makefile.clang +++ b/examples/Makefile.clang @@ -12,7 +12,7 @@ OBJS = $(SRCS:%.cpp=%) CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) MAKEFILE = -f Makefile.clang LDFLAGS = -L../src -lfinal -INCLUDES = -I../src -I/usr/include/final/ +INCLUDES = -I../include -I/usr/include/final RM = rm -f ifdef DEBUG diff --git a/examples/Makefile.gcc b/examples/Makefile.gcc index e3a546ce..a6d4e45b 100644 --- a/examples/Makefile.gcc +++ b/examples/Makefile.gcc @@ -12,7 +12,7 @@ OBJS = $(SRCS:%.cpp=%) CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) MAKEFILE = -f Makefile.gcc LDFLAGS = -L../src -lfinal -INCLUDES = -I../src -I/usr/include/final/ +INCLUDES = -I../include -I/usr/include/final RM = rm -f ifdef DEBUG diff --git a/examples/Makefile.in b/examples/Makefile.in index e4e82082..7e7dc49f 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -90,7 +90,7 @@ noinst_PROGRAMS = hello$(EXEEXT) dialog$(EXEEXT) input-dialog$(EXEEXT) \ transparent$(EXEEXT) keyboard$(EXEEXT) mouse$(EXEEXT) \ timer$(EXEEXT) scrollview$(EXEEXT) windows$(EXEEXT) \ menu$(EXEEXT) ui$(EXEEXT) -subdir = test +subdir = examples DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -374,7 +374,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal -AM_CPPFLAGS = -Wall -Werror -I$(top_srcdir)/src +AM_CPPFLAGS = -I../include -I$(top_srcdir)/src -Wall -Werror hello_SOURCES = hello.cpp dialog_SOURCES = dialog.cpp input_dialog_SOURCES = input-dialog.cpp @@ -410,9 +410,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile + $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 16a06c6e..d03d5278 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -11,9 +11,9 @@ #include #include -#include "fapplication.h" -#include "fdialog.h" -#include "fmessagebox.h" +#include +#include +#include const lDouble PI = 3.141592653589793238L; @@ -255,7 +255,7 @@ Calc::Calc (FWidget* parent) else { int x, y, n; - (key <= Three) ? n = 0 : n = 1; + ( key <= Three ) ? n = 0 : n = 1; x = (key + n) % 5 * 7 + 2; y = (key + n) / 5 * 2 + 3; btn->setGeometry(x, y, 5, 1); @@ -564,7 +564,7 @@ void Calc::onClose (FCloseEvent* ev) FMessageBox::Yes, FMessageBox::No ); - (ret == FMessageBox::Yes) ? ev->accept() : ev->ignore(); + ( ret == FMessageBox::Yes ) ? ev->accept() : ev->ignore(); } //---------------------------------------------------------------------- diff --git a/examples/choice.cpp b/examples/choice.cpp index dcfdd9ca..37493438 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -1,11 +1,11 @@ // File: os-choice.cpp -#include "fapplication.h" -#include "fbutton.h" -#include "fbuttongroup.h" -#include "fdialog.h" -#include "fradiobutton.h" -#include "ftooltip.h" +#include +#include +#include +#include +#include +#include // function prototypes void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/dialog.cpp b/examples/dialog.cpp index 268b17b7..677d855e 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -1,9 +1,9 @@ // File: dialog.cpp -#include "fapplication.h" -#include "fbutton.h" -#include "fdialog.h" -#include "flabel.h" +#include +#include +#include +#include // function prototype void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/hello.cpp b/examples/hello.cpp index dd15e583..6f3006c4 100644 --- a/examples/hello.cpp +++ b/examples/hello.cpp @@ -1,7 +1,7 @@ // File: hello.cpp -#include "fapplication.h" -#include "fmessagebox.h" +#include +#include int main (int argc, char* argv[]) diff --git a/examples/input-dialog.cpp b/examples/input-dialog.cpp index 466908b9..603ebb02 100644 --- a/examples/input-dialog.cpp +++ b/examples/input-dialog.cpp @@ -1,12 +1,12 @@ // File: input-dialog.cpp -#include "fapplication.h" -#include "fbutton.h" -#include "fbuttongroup.h" -#include "fcheckbox.h" -#include "fdialog.h" -#include "flineedit.h" -#include "fradiobutton.h" +#include +#include +#include +#include +#include +#include +#include // function prototypes void cb_quit (FWidget*, FWidget::data_ptr); diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp index a7df453d..7c03578e 100644 --- a/examples/keyboard.cpp +++ b/examples/keyboard.cpp @@ -1,6 +1,6 @@ // File: keyboard.cpp -#include "final.h" +#include //---------------------------------------------------------------------- // class keyboard diff --git a/examples/listbox.cpp b/examples/listbox.cpp index 15785900..f50107d5 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -5,10 +5,10 @@ #include #include -#include "fapplication.h" -#include "fdialog.h" -#include "flistbox.h" -#include "fmessagebox.h" +#include +#include +#include +#include // Global application object diff --git a/examples/listview.cpp b/examples/listview.cpp index fb6da530..c8d975bf 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -5,10 +5,10 @@ #include #include -#include "fapplication.h" -#include "fdialog.h" -#include "flistview.h" -#include "fmessagebox.h" +#include +#include +#include +#include //---------------------------------------------------------------------- diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index c3fd1ca1..e2eb19d0 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -1,8 +1,8 @@ // File: mandelbrot.cpp -#include "fapplication.h" -#include "fdialog.h" -#include "fmessagebox.h" +#include +#include +#include //---------------------------------------------------------------------- // class Mandelbrot diff --git a/examples/menu.cpp b/examples/menu.cpp index 3e76e921..b76b74c5 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -1,14 +1,14 @@ // File: menu.cpp -#include "fapplication.h" -#include "fcheckmenuitem.h" -#include "fdialog.h" -#include "flabel.h" -#include "fmenubar.h" -#include "fmenu.h" -#include "fmessagebox.h" -#include "fradiomenuitem.h" -#include "fstatusbar.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include //---------------------------------------------------------------------- diff --git a/examples/mouse.cpp b/examples/mouse.cpp index 0d06ff14..9f8bf4e6 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -1,9 +1,9 @@ // File: mouse.cpp -#include "fapplication.h" -#include "fdialog.h" -#include "flabel.h" -#include "fmessagebox.h" +#include +#include +#include +#include //---------------------------------------------------------------------- diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index f2776962..6c99eabb 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -3,8 +3,8 @@ #include #include -#include "fapplication.h" -#include "fvterm.h" +#include +#include // global FVTerm object diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index 42442304..f2ffb41d 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -1,11 +1,11 @@ // File: scrollview.cpp -#include "fapplication.h" -#include "fbutton.h" -#include "fdialog.h" -#include "flabel.h" -#include "fmessagebox.h" -#include "fscrollview.h" +#include +#include +#include +#include +#include +#include //---------------------------------------------------------------------- // class scrollview diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index ae69678b..81a149ba 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -9,7 +9,7 @@ #include #include -#include "fstring.h" +#include int main (int, char**) diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index cdebe09b..9fd4e4ae 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -1,9 +1,9 @@ // File: term-attributes.cpp -#include "fapplication.h" -#include "fbutton.h" -#include "fdialog.h" -#include "fmessagebox.h" +#include +#include +#include +#include //---------------------------------------------------------------------- // class AttribDlg diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 703b5ac9..80df8b8a 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -4,9 +4,9 @@ #include #include -#include "fapplication.h" -#include "ftermcap.h" -#include "fvterm.h" +#include +#include +#include // global FVTerm object diff --git a/examples/timer.cpp b/examples/timer.cpp index d595711b..ad440735 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -1,6 +1,6 @@ // File: timer.cpp -#include "final.h" +#include //---------------------------------------------------------------------- // class timer diff --git a/examples/transparent.cpp b/examples/transparent.cpp index 8a97d84c..c8274f86 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -1,11 +1,11 @@ // File: transparent.cpp -#include "fapplication.h" -#include "fdialog.h" -#include "flabel.h" -#include "fmessagebox.h" -#include "fstatusbar.h" -#include "fstring.h" +#include +#include +#include +#include +#include +#include //---------------------------------------------------------------------- diff --git a/examples/treeview.cpp b/examples/treeview.cpp index a023f22f..5e4e4ca7 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -5,10 +5,10 @@ #include #include -#include "fapplication.h" -#include "fdialog.h" -#include "flistview.h" -#include "fmessagebox.h" +#include +#include +#include +#include //---------------------------------------------------------------------- @@ -87,6 +87,10 @@ Treeview::Treeview (FWidget* parent) //FObjectIterator iter_africa = listView->insert (egypt_line); listView->insert (egypt_line, iter_africa); + FListViewItem* item_africa = static_cast(*iter_africa); + FObjectIterator iter_egypt = item_africa->begin(); + FListViewItem* item_egypt = static_cast(*iter_egypt); +item_egypt = item_egypt; // Quit button FButton* Quit = new FButton (this); diff --git a/examples/ui.cpp b/examples/ui.cpp index d3333212..691d720f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -4,7 +4,7 @@ #include #include -#include "final.h" +#include //---------------------------------------------------------------------- diff --git a/examples/watch.cpp b/examples/watch.cpp index db4623ac..a99e15e1 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -2,11 +2,11 @@ #include -#include "fapplication.h" -#include "flabel.h" -#include "fdialog.h" -#include "fmessagebox.h" -#include "fswitch.h" +#include +#include +#include +#include +#include //---------------------------------------------------------------------- // class watch diff --git a/examples/windows.cpp b/examples/windows.cpp index d31755f1..373d4930 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -2,15 +2,15 @@ #include -#include "fapplication.h" -#include "fdialog.h" -#include "fdialoglistmenu.h" -#include "flabel.h" -#include "fmenubar.h" -#include "fmenu.h" -#include "fmessagebox.h" -#include "fstatusbar.h" -#include "fstring.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include //---------------------------------------------------------------------- // class smallWindow @@ -361,8 +361,8 @@ void Window::adjustSize() h = getRootWidget()->getHeight(); X = int(1 + (w - 40) / 2); Y = int(1 + (h - 22) / 2); - dx = (w > 80) ? (w - 80) / 2 : 0; - dy = (h > 24) ? (h - 24) / 2 : 0; + dx = ( w > 80 ) ? (w - 80) / 2 : 0; + dy = ( h > 24 ) ? (h - 24) / 2 : 0; if ( Y < 2) Y = 2; @@ -412,8 +412,8 @@ void Window::cb_createWindows (FWidget*, data_ptr) iter = first = windows.begin(); w = getRootWidget()->getWidth(); h = getRootWidget()->getHeight(); - dx = (w > 80) ? (w - 80) / 2 : 0; - dy = (h > 24) ? (h - 24) / 2 : 0; + dx = ( w > 80 ) ? (w - 80) / 2 : 0; + dy = ( h > 24 ) ? (h - 24) / 2 : 0; while ( iter != windows.end() ) { diff --git a/include/final/fapplication.h b/include/final/fapplication.h index f701f989..f8febe8f 100644 --- a/include/final/fapplication.h +++ b/include/final/fapplication.h @@ -41,9 +41,9 @@ #include #include -#include "fevent.h" -#include "fwidget.h" -#include "fwindow.h" +#include "final/fevent.h" +#include "final/fwidget.h" +#include "final/fwindow.h" //---------------------------------------------------------------------- diff --git a/include/final/fbutton.h b/include/final/fbutton.h index fa495be8..3c4b09dc 100644 --- a/include/final/fbutton.h +++ b/include/final/fbutton.h @@ -28,7 +28,7 @@ #ifndef FBUTTON_H #define FBUTTON_H -#include "fwidget.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/fbuttongroup.h b/include/final/fbuttongroup.h index b6aa4a45..262fb5a6 100644 --- a/include/final/fbuttongroup.h +++ b/include/final/fbuttongroup.h @@ -28,7 +28,7 @@ #ifndef FBUTTONGROUP_H #define FBUTTONGROUP_H -#include "fscrollview.h" +#include "final/fscrollview.h" // class forward declaration diff --git a/include/final/fc.h b/include/final/fc.h index fc62d598..f5822aae 100644 --- a/include/final/fc.h +++ b/include/final/fc.h @@ -11,7 +11,7 @@ #ifndef FC_H #define FC_H -#include "fstring.h" +#include "final/fstring.h" // ascii sequences #define ESC "\033" // Escape diff --git a/include/final/fcheckbox.h b/include/final/fcheckbox.h index 0fb129ba..9f25222b 100644 --- a/include/final/fcheckbox.h +++ b/include/final/fcheckbox.h @@ -33,7 +33,7 @@ #ifndef FCHECKBOX_H #define FCHECKBOX_H -#include "ftogglebutton.h" +#include "final/ftogglebutton.h" //---------------------------------------------------------------------- diff --git a/include/final/fcheckmenuitem.h b/include/final/fcheckmenuitem.h index 6a3e9e4f..a78c1a4f 100644 --- a/include/final/fcheckmenuitem.h +++ b/include/final/fcheckmenuitem.h @@ -33,7 +33,7 @@ #ifndef FCHECKMENUITEM_H #define FCHECKMENUITEM_H -#include "fmenuitem.h" +#include "final/fmenuitem.h" //---------------------------------------------------------------------- diff --git a/include/final/fconfig.h b/include/final/fconfig.h index a37b0fa6..ff16c3e4 100644 --- a/include/final/fconfig.h +++ b/include/final/fconfig.h @@ -1,7 +1,7 @@ -#ifndef _SRC_FCONFIG_H -#define _SRC_FCONFIG_H 1 - -/* src/fconfig.h. Generated automatically at end of configure. */ +#ifndef _INCLUDE_FINAL_FCONFIG_H +#define _INCLUDE_FINAL_FCONFIG_H 1 + +/* include/final/fconfig.h. Generated automatically at end of configure. */ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ @@ -171,6 +171,6 @@ #ifndef F_VERSION #define F_VERSION "0.3.0" #endif - -/* once: _SRC_FCONFIG_H */ + +/* once: _INCLUDE_FINAL_FCONFIG_H */ #endif diff --git a/include/final/fdialog.h b/include/final/fdialog.h index f8010cfa..4d93b6d8 100644 --- a/include/final/fdialog.h +++ b/include/final/fdialog.h @@ -33,10 +33,10 @@ #ifndef FDIALOG_H #define FDIALOG_H -#include "fmenu.h" -#include "fmenuitem.h" -#include "ftooltip.h" -#include "fwindow.h" +#include "final/fmenu.h" +#include "final/fmenuitem.h" +#include "final/ftooltip.h" +#include "final/fwindow.h" //---------------------------------------------------------------------- diff --git a/include/final/fdialoglistmenu.h b/include/final/fdialoglistmenu.h index da6ebf13..02560b83 100644 --- a/include/final/fdialoglistmenu.h +++ b/include/final/fdialoglistmenu.h @@ -40,7 +40,7 @@ #ifndef FDIALOGLISTMENU_H #define FDIALOGLISTMENU_H -#include "fmenu.h" +#include "final/fmenu.h" //---------------------------------------------------------------------- diff --git a/include/final/fevent.h b/include/final/fevent.h index d9318559..c50f688e 100644 --- a/include/final/fevent.h +++ b/include/final/fevent.h @@ -53,8 +53,8 @@ #ifndef FEVENT_H #define FEVENT_H -#include "fc.h" -#include "fpoint.h" +#include "final/fc.h" +#include "final/fpoint.h" //---------------------------------------------------------------------- diff --git a/include/final/ffiledialog.h b/include/final/ffiledialog.h index 7abbecda..19a19e57 100644 --- a/include/final/ffiledialog.h +++ b/include/final/ffiledialog.h @@ -48,14 +48,14 @@ #include #include -#include "fbutton.h" -#include "fcheckbox.h" -#include "fdialog.h" -#include "flineedit.h" -#include "flistbox.h" -#include "fmessagebox.h" -#include "fstatusbar.h" -#include "fterm.h" +#include "final/fbutton.h" +#include "final/fcheckbox.h" +#include "final/fdialog.h" +#include "final/flineedit.h" +#include "final/flistbox.h" +#include "final/fmessagebox.h" +#include "final/fstatusbar.h" +#include "final/fterm.h" //---------------------------------------------------------------------- diff --git a/include/final/flabel.h b/include/final/flabel.h index a78d7495..593e1bc6 100644 --- a/include/final/flabel.h +++ b/include/final/flabel.h @@ -29,7 +29,8 @@ #define FLABEL_H #include -#include "fwidget.h" + +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/flineedit.h b/include/final/flineedit.h index 12b81ac5..41f6a939 100644 --- a/include/final/flineedit.h +++ b/include/final/flineedit.h @@ -28,8 +28,8 @@ #ifndef FLINEEDIT_H #define FLINEEDIT_H -#include "fwidget.h" -#include "flabel.h" +#include "final/fwidget.h" +#include "final/flabel.h" //---------------------------------------------------------------------- diff --git a/include/final/flistbox.h b/include/final/flistbox.h index 4d1b39b0..b685f541 100644 --- a/include/final/flistbox.h +++ b/include/final/flistbox.h @@ -32,9 +32,9 @@ #include -#include "fscrollbar.h" -#include "fstring.h" -#include "fwidget.h" +#include "final/fscrollbar.h" +#include "final/fstring.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/flistview.h b/include/final/flistview.h index ee813f24..a3bddf15 100644 --- a/include/final/flistview.h +++ b/include/final/flistview.h @@ -32,10 +32,10 @@ #include -#include "fscrollbar.h" -#include "fstring.h" -#include "ftermbuffer.h" -#include "fwidget.h" +#include "final/fscrollbar.h" +#include "final/fstring.h" +#include "final/ftermbuffer.h" +#include "final/fwidget.h" // class forward declaration class FListView; @@ -288,7 +288,7 @@ inline FListViewItem* FListView::getCurrentItem() //---------------------------------------------------------------------- inline bool FListView::setTreeView (bool on) -{ return tree_view = (on) ? true : false; } +{ return tree_view = ( on ) ? true : false; } //---------------------------------------------------------------------- inline bool FListView::setTreeView() diff --git a/include/final/fmenu.h b/include/final/fmenu.h index 5b357296..660d4be8 100644 --- a/include/final/fmenu.h +++ b/include/final/fmenu.h @@ -35,10 +35,10 @@ #ifndef FMENU_H #define FMENU_H -#include "fwindow.h" -#include "fmenubar.h" -#include "fmenulist.h" -#include "fmenuitem.h" +#include "final/fwindow.h" +#include "final/fmenubar.h" +#include "final/fmenulist.h" +#include "final/fmenuitem.h" //---------------------------------------------------------------------- diff --git a/include/final/fmenubar.h b/include/final/fmenubar.h index 32363e5e..3ead180d 100644 --- a/include/final/fmenubar.h +++ b/include/final/fmenubar.h @@ -35,9 +35,9 @@ #ifndef FMENUBAR_H #define FMENUBAR_H -#include "fmenu.h" -#include "fmenulist.h" -#include "fwindow.h" +#include "final/fmenu.h" +#include "final/fmenulist.h" +#include "final/fwindow.h" //---------------------------------------------------------------------- diff --git a/include/final/fmenuitem.h b/include/final/fmenuitem.h index 4a2bd224..d42c13d9 100644 --- a/include/final/fmenuitem.h +++ b/include/final/fmenuitem.h @@ -32,7 +32,7 @@ #ifndef FMENUITEM_H #define FMENUITEM_H -#include "fwidget.h" +#include "final/fwidget.h" // class forward declaration class FDialog; diff --git a/include/final/fmenulist.h b/include/final/fmenulist.h index 70e4568b..8e108f57 100644 --- a/include/final/fmenulist.h +++ b/include/final/fmenulist.h @@ -21,8 +21,8 @@ #include -#include "fmenuitem.h" -#include "fwidget.h" +#include "final/fmenuitem.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- @@ -89,7 +89,7 @@ inline uInt FMenuList::getCount() const //---------------------------------------------------------------------- inline FMenuItem* FMenuList::getItem (int index) const -{ return (index > 0) ? item_list[uInt(index - 1)] : 0; } +{ return ( index > 0 ) ? item_list[uInt(index - 1)] : 0; } //---------------------------------------------------------------------- inline FMenuItem* FMenuList::getSelectedItem() const @@ -109,7 +109,7 @@ inline void FMenuList::setSelectedItem (FMenuItem* menuitem) //---------------------------------------------------------------------- inline bool FMenuList::isSelected(int index) const -{ return (index > 0) ? item_list[uInt(index - 1)]->isSelected() : false; } +{ return ( index > 0 ) ? item_list[uInt(index - 1)]->isSelected() : false; } //---------------------------------------------------------------------- inline bool FMenuList::hasSelectedItem() const diff --git a/include/final/fmessagebox.h b/include/final/fmessagebox.h index b12100dd..bd6176bf 100644 --- a/include/final/fmessagebox.h +++ b/include/final/fmessagebox.h @@ -40,9 +40,9 @@ #include -#include "fbutton.h" -#include "fdialog.h" -#include "fterm.h" +#include "final/fbutton.h" +#include "final/fdialog.h" +#include "final/fterm.h" //---------------------------------------------------------------------- diff --git a/include/final/fobject.h b/include/final/fobject.h index d632e44c..989d5c70 100644 --- a/include/final/fobject.h +++ b/include/final/fobject.h @@ -18,9 +18,9 @@ #include #include -#include "fc.h" -#include "fevent.h" -#include "ftypes.h" +#include "final/fc.h" +#include "final/fevent.h" +#include "final/ftypes.h" //---------------------------------------------------------------------- diff --git a/include/final/foptiattr.h b/include/final/foptiattr.h index 5aa5a7d5..1bfbc409 100644 --- a/include/final/foptiattr.h +++ b/include/final/foptiattr.h @@ -16,7 +16,7 @@ #include // need for std::swap -#include "fc.h" +#include "final/fc.h" //---------------------------------------------------------------------- diff --git a/include/final/fprogressbar.h b/include/final/fprogressbar.h index d31fc4fe..7be0bdd5 100644 --- a/include/final/fprogressbar.h +++ b/include/final/fprogressbar.h @@ -28,7 +28,7 @@ #ifndef FPROGRESSBAR_H #define FPROGRESSBAR_H -#include "fwidget.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/fradiobutton.h b/include/final/fradiobutton.h index e7fbef6b..91a22eb7 100644 --- a/include/final/fradiobutton.h +++ b/include/final/fradiobutton.h @@ -33,7 +33,7 @@ #ifndef FRADIOBUTTON_H #define FRADIOBUTTON_H -#include "ftogglebutton.h" +#include "final/ftogglebutton.h" //---------------------------------------------------------------------- diff --git a/include/final/fradiomenuitem.h b/include/final/fradiomenuitem.h index 93278e39..ab3094b2 100644 --- a/include/final/fradiomenuitem.h +++ b/include/final/fradiomenuitem.h @@ -33,7 +33,7 @@ #ifndef FRADIOMENUITEM_H #define FRADIOMENUITEM_H -#include "fmenuitem.h" +#include "final/fmenuitem.h" //---------------------------------------------------------------------- diff --git a/include/final/frect.h b/include/final/frect.h index 97db71b3..6b9c0d06 100644 --- a/include/final/frect.h +++ b/include/final/frect.h @@ -12,7 +12,7 @@ #define FRECT_H #include -#include "fpoint.h" +#include "final/fpoint.h" //---------------------------------------------------------------------- diff --git a/include/final/fscrollbar.h b/include/final/fscrollbar.h index ce77332d..0c2b24ac 100644 --- a/include/final/fscrollbar.h +++ b/include/final/fscrollbar.h @@ -28,7 +28,7 @@ #ifndef FSCROLLBAR_H #define FSCROLLBAR_H -#include "fwidget.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/fscrollview.h b/include/final/fscrollview.h index d2499d23..7263a20f 100644 --- a/include/final/fscrollview.h +++ b/include/final/fscrollview.h @@ -29,8 +29,8 @@ #ifndef FSCROLLVIEW_H #define FSCROLLVIEW_H -#include "fscrollbar.h" -#include "fwidget.h" +#include "final/fscrollbar.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/fstatusbar.h b/include/final/fstatusbar.h index b108658a..fea0fca7 100644 --- a/include/final/fstatusbar.h +++ b/include/final/fstatusbar.h @@ -38,7 +38,7 @@ #include -#include "fwindow.h" +#include "final/fwindow.h" // class forward declaration diff --git a/include/final/fstring.h b/include/final/fstring.h index 2605f579..cc029f69 100644 --- a/include/final/fstring.h +++ b/include/final/fstring.h @@ -31,7 +31,7 @@ #include #include -#include "ftypes.h" +#include "final/ftypes.h" //---------------------------------------------------------------------- @@ -331,11 +331,11 @@ class FString // FString inline functions //---------------------------------------------------------------------- inline bool FString::isNull() const -{ return ( ! string ); } +{ return ! string; } //---------------------------------------------------------------------- inline bool FString::isEmpty() const -{ return (! string ) || (! *string); } +{ return ( ! string ) || ( ! *string ); } //---------------------------------------------------------------------- inline uInt FString::getLength() const diff --git a/include/final/fswitch.h b/include/final/fswitch.h index 8343fae2..8668bfce 100644 --- a/include/final/fswitch.h +++ b/include/final/fswitch.h @@ -33,7 +33,7 @@ #ifndef FSWITCH_H #define FSWITCH_H -#include "ftogglebutton.h" +#include "final/ftogglebutton.h" //---------------------------------------------------------------------- diff --git a/include/final/ftcap_map.h b/include/final/ftcap_map.h index 178c88bc..99b2b229 100644 --- a/include/final/ftcap_map.h +++ b/include/final/ftcap_map.h @@ -3,7 +3,7 @@ #ifndef FTCAPMAP_H #define FTCAPMAP_H -#include "ftermcap.h" +#include "final/ftermcap.h" static FTermcap::tcap_map term_caps[] = { diff --git a/include/final/fterm.h b/include/final/fterm.h index 6a6559c5..03d69d01 100644 --- a/include/final/fterm.h +++ b/include/final/fterm.h @@ -27,7 +27,7 @@ #ifndef FTERM_H #define FTERM_H -#include +#include "final/fconfig.h" #ifdef F_HAVE_LIBGPM #include @@ -67,14 +67,14 @@ #include #include -#include "fc.h" -#include "fobject.h" -#include "foptiattr.h" -#include "foptimove.h" -#include "fpoint.h" -#include "frect.h" -#include "fstring.h" -#include "ftermcap.h" +#include "final/fc.h" +#include "final/fobject.h" +#include "final/foptiattr.h" +#include "final/foptimove.h" +#include "final/fpoint.h" +#include "final/frect.h" +#include "final/fstring.h" +#include "final/ftermcap.h" #ifdef F_HAVE_LIBGPM @@ -511,11 +511,11 @@ inline int FTerm::getMaxColor() #if DEBUG //---------------------------------------------------------------------- inline const FString& FTerm::getAnswerbackString() -{ return (answer_back) ? *answer_back : *fc::empty_string; } +{ return ( answer_back ) ? *answer_back : *fc::empty_string; } //---------------------------------------------------------------------- inline const FString& FTerm::getSecDAString() -{ return (sec_da) ? *sec_da : *fc::empty_string; } +{ return ( sec_da ) ? *sec_da : *fc::empty_string; } #endif //---------------------------------------------------------------------- @@ -620,7 +620,7 @@ inline bool FTerm::isUTF8_linux_terminal() //---------------------------------------------------------------------- inline bool FTerm::setCursorOptimisation (bool on) -{ return cursor_optimisation = (on) ? true : false; } +{ return cursor_optimisation = ( on ) ? true : false; } //---------------------------------------------------------------------- inline void FTerm::setXTermDefaultColors (bool on) diff --git a/include/final/ftermbuffer.h b/include/final/ftermbuffer.h index 7c118983..61b1b112 100644 --- a/include/final/ftermbuffer.h +++ b/include/final/ftermbuffer.h @@ -16,8 +16,8 @@ #include #include -#include "fvterm.h" -#include "fstring.h" +#include "final/fvterm.h" +#include "final/fstring.h" //---------------------------------------------------------------------- diff --git a/include/final/ftextview.h b/include/final/ftextview.h index 2511869d..48ddc6d9 100644 --- a/include/final/ftextview.h +++ b/include/final/ftextview.h @@ -30,11 +30,11 @@ #include -#include "fapplication.h" -#include "fscrollbar.h" -#include "fstatusbar.h" -#include "fstring.h" -#include "fwidget.h" +#include "final/fapplication.h" +#include "final/fscrollbar.h" +#include "final/fstatusbar.h" +#include "final/fstring.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/include/final/ftogglebutton.h b/include/final/ftogglebutton.h index f9ac34a8..83cd83da 100644 --- a/include/final/ftogglebutton.h +++ b/include/final/ftogglebutton.h @@ -28,7 +28,7 @@ #ifndef FTOGGLEBUTTON_H #define FTOGGLEBUTTON_H -#include "fwidget.h" +#include "final/fwidget.h" // class forward declaration diff --git a/include/final/ftooltip.h b/include/final/ftooltip.h index c3cea5ba..7d33336f 100644 --- a/include/final/ftooltip.h +++ b/include/final/ftooltip.h @@ -35,7 +35,7 @@ #include -#include "fwindow.h" +#include "final/fwindow.h" //---------------------------------------------------------------------- diff --git a/include/final/fvterm.h b/include/final/fvterm.h index 13dde6e8..d8644d10 100644 --- a/include/final/fvterm.h +++ b/include/final/fvterm.h @@ -26,9 +26,10 @@ #ifndef FVTERM_H #define FVTERM_H -#include "fterm.h" #include // std::stringstream +#include "final/fterm.h" + // Preprocessing handler macro #define F_PREPROC_HANDLER(i,h) \ reinterpret_cast((i)) \ diff --git a/include/final/fwidget.h b/include/final/fwidget.h index eec1d35f..fbca0d79 100644 --- a/include/final/fwidget.h +++ b/include/final/fwidget.h @@ -73,7 +73,7 @@ #include -#include "fvterm.h" +#include "final/fvterm.h" // Callback macros @@ -697,7 +697,7 @@ inline bool FWidget::setDisable() //---------------------------------------------------------------------- inline bool FWidget::setVisibleCursor (bool on) -{ return visible_cursor = (on) ? true : ((hideable) ? false : true); } +{ return visible_cursor = ( on ) ? true : (( hideable ) ? false : true); } //---------------------------------------------------------------------- inline bool FWidget::setVisibleCursor() diff --git a/include/final/fwindow.h b/include/final/fwindow.h index 1956ef85..00bcc392 100644 --- a/include/final/fwindow.h +++ b/include/final/fwindow.h @@ -36,7 +36,7 @@ #ifndef FWINDOW_H #define FWINDOW_H -#include "fwidget.h" +#include "final/fwidget.h" //---------------------------------------------------------------------- diff --git a/scripts/cppcheck.sh b/scripts/cppcheck.sh index 0cbcee74..83b1c234 100755 --- a/scripts/cppcheck.sh +++ b/scripts/cppcheck.sh @@ -4,6 +4,6 @@ if [ $# -gt 0 ] then eval cppcheck --enable=all "$@" else - eval cppcheck --enable=all ../src/ ../test/ + eval cppcheck --enable=all ../include/final/ ../src/ ../examples/ fi diff --git a/scripts/cpuprofile.sh b/scripts/cpuprofile.sh index 18941373..1d57b7e1 100755 --- a/scripts/cpuprofile.sh +++ b/scripts/cpuprofile.sh @@ -1,6 +1,6 @@ #!/bin/bash -LD_LIBRARY_PATH=../src/.libs/ LD_PRELOAD="/usr/lib64/libprofiler.so.0" CPUPROFILE=../test/.libs/ui.prof ../test/.libs/ui -pprof --gv ../test/.libs/ui ../test/.libs/ui.prof -rm -f ../test/.libs/ui.prof +LD_LIBRARY_PATH=../src/.libs/ LD_PRELOAD="/usr/lib64/libprofiler.so.0" CPUPROFILE=../examples/.libs/ui.prof ../examples/.libs/ui +pprof --gv ../examples/.libs/ui ../examples/.libs/ui.prof +rm -f ../examples/.libs/ui.prof diff --git a/scripts/disassemble.sh b/scripts/disassemble.sh index 93abc6ed..386e44fa 100755 --- a/scripts/disassemble.sh +++ b/scripts/disassemble.sh @@ -1,3 +1,3 @@ #!/bin/sh -hte ../test/.libs/ui +hte ../examples/.libs/ui diff --git a/scripts/kcachegrind.sh b/scripts/kcachegrind.sh index 8074b053..5cdae679 100755 --- a/scripts/kcachegrind.sh +++ b/scripts/kcachegrind.sh @@ -1,6 +1,6 @@ #!/bin/bash -LD_LIBRARY_PATH=../src/.libs/ valgrind --tool=callgrind -v ../test/.libs/ui 2>/dev/null +LD_LIBRARY_PATH=../src/.libs/ valgrind --tool=callgrind -v ../examples/.libs/ui 2>/dev/null kcachegrind rm -f callgrind.out.* diff --git a/scripts/library_calls.sh b/scripts/library_calls.sh index 5cc384d9..55e85619 100755 --- a/scripts/library_calls.sh +++ b/scripts/library_calls.sh @@ -4,7 +4,7 @@ PROG="ui" -LD_LIBRARY_PATH=../src/.libs/ ltrace -o ./$PROG.ltrace ../test/.libs/$PROG +LD_LIBRARY_PATH=../src/.libs/ ltrace -o ./$PROG.ltrace ../examples/.libs/$PROG less ./$PROG.ltrace rm -f ./$PROG.ltrace ./gmon.out diff --git a/scripts/profile.sh b/scripts/profile.sh index 49e083c5..f5771dae 100755 --- a/scripts/profile.sh +++ b/scripts/profile.sh @@ -1,7 +1,7 @@ #!/bin/bash DIR="$PWD" -cd ../test/.libs/ || exit +cd ../examples/.libs/ || exit LD_LIBRARY_PATH=../../src/.libs/ ./ui gprof ./ui >./profile.txt rm ./gmon.out diff --git a/scripts/remove_eol_spaces.sh b/scripts/remove_eol_spaces.sh index 88c4dadd..791c7c42 100755 --- a/scripts/remove_eol_spaces.sh +++ b/scripts/remove_eol_spaces.sh @@ -1,7 +1,8 @@ #!/bin/bash find ../src/ \ - ../test/ \ + ../include/final/ \ + ../examples/ \ -regextype posix-egrep \ -regex ".*\.(cpp|h)$" \ -exec sed -i 's/ *$//' "{}" \; diff --git a/scripts/syscall_statistic.sh b/scripts/syscall_statistic.sh index 87392e7f..b3bbafd7 100755 --- a/scripts/syscall_statistic.sh +++ b/scripts/syscall_statistic.sh @@ -1,3 +1,3 @@ #!/bin/sh -strace -c ../test/.libs/ui +strace -c ../examples/.libs/ui diff --git a/scripts/valgrind.sh b/scripts/valgrind.sh index 991cf455..616f824e 100755 --- a/scripts/valgrind.sh +++ b/scripts/valgrind.sh @@ -4,7 +4,7 @@ if [ -z "$1" ] then - PROG="../test/.libs/ui" + PROG="../examples/.libs/ui" else PROG="$1" fi diff --git a/scripts/xterm-latin1.sh b/scripts/xterm-latin1.sh index 7e238337..267cdfea 100755 --- a/scripts/xterm-latin1.sh +++ b/scripts/xterm-latin1.sh @@ -1,3 +1,3 @@ #!/bin/sh -luit -encoding POSIX ../test/ui +luit -encoding POSIX ../examples/ui diff --git a/src/Makefile.am b/src/Makefile.am index 4804a6f8..a6017337 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = fonts -AM_CPPFLAGS = -Wall -Werror +AM_CPPFLAGS = -I../include -Wall -Werror lib_LTLIBRARIES = libfinal.la @@ -54,52 +54,53 @@ libfinal_la_LDFLAGS = -version-info @SO_VERSION@ finalcutincludedir = $(includedir)/final finalcutinclude_HEADERS = \ - fapplication.h \ - fbutton.h \ - fbuttongroup.h \ - fcharmap.h \ - fcheckbox.h \ - fconfig.h \ - fswitch.h \ - fdialog.h \ - fc.h \ - fevent.h \ - ffiledialog.h \ - final.h \ - fkey_map.h \ - flabel.h \ - flineedit.h \ - flistbox.h \ - flistview.h \ - fmenu.h \ - fdialoglistmenu.h \ - fmenubar.h \ - fmenuitem.h \ - fradiomenuitem.h \ - fcheckmenuitem.h \ - fmenulist.h \ - fmessagebox.h \ - ftooltip.h \ - fobject.h \ - fpoint.h \ - foptiattr.h \ - foptimove.h \ - ftermbuffer.h \ - fprogressbar.h \ - fradiobutton.h \ - frect.h \ - fscrollbar.h \ - fscrollview.h \ - fstatusbar.h \ - fstring.h \ - ftcap_map.h \ - ftermcap.h \ - fterm.h \ - fvterm.h \ - ftextview.h \ - ftogglebutton.h \ - fwidget.h \ - fwindow.h + ../include/final/fapplication.h \ + ../include/final/fbutton.h \ + ../include/final/fbuttongroup.h \ + ../include/final/fcharmap.h \ + ../include/final/fcheckbox.h \ + ../include/final/fconfig.h \ + ../include/final/fswitch.h \ + ../include/final/fdialog.h \ + ../include/final/fc.h \ + ../include/final/ftypes.h \ + ../include/final/fevent.h \ + ../include/final/ffiledialog.h \ + ../include/final/final.h \ + ../include/final/fkey_map.h \ + ../include/final/flabel.h \ + ../include/final/flineedit.h \ + ../include/final/flistbox.h \ + ../include/final/flistview.h \ + ../include/final/fmenu.h \ + ../include/final/fdialoglistmenu.h \ + ../include/final/fmenubar.h \ + ../include/final/fmenuitem.h \ + ../include/final/fradiomenuitem.h \ + ../include/final/fcheckmenuitem.h \ + ../include/final/fmenulist.h \ + ../include/final/fmessagebox.h \ + ../include/final/ftooltip.h \ + ../include/final/fobject.h \ + ../include/final/fpoint.h \ + ../include/final/foptiattr.h \ + ../include/final/foptimove.h \ + ../include/final/ftermbuffer.h \ + ../include/final/fprogressbar.h \ + ../include/final/fradiobutton.h \ + ../include/final/frect.h \ + ../include/final/fscrollbar.h \ + ../include/final/fscrollview.h \ + ../include/final/fstatusbar.h \ + ../include/final/fstring.h \ + ../include/final/ftcap_map.h \ + ../include/final/ftermcap.h \ + ../include/final/fterm.h \ + ../include/final/fvterm.h \ + ../include/final/ftextview.h \ + ../include/final/ftogglebutton.h \ + ../include/final/fwidget.h \ + ../include/final/fwindow.h #uninstall: # rm -R -f $(includedir)/final diff --git a/src/Makefile.clang b/src/Makefile.clang index ef1d1671..a5516081 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -5,8 +5,9 @@ # This is where make install will install the library VERSION = "0.3.0" MAJOR := $(shell echo ${VERSION} | cut -d. -f1) -LIBDIR = /usr/local/lib64 -INCLUDEDIR = /usr/local/include/final +LIBDIR = /usr/local/lib +INCLUDEDIR1 = ../include/final +INCLUDEDIR2 = /usr/local/include/final INCLUDE_HEADERS = \ fapplication.h \ fbuttongroup.h \ @@ -53,7 +54,7 @@ CXX = clang++ CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions MAKEFILE = -f Makefile.clang LDFLAGS = $(TERMCAP) -lgpm -INCLUDES = -I./ +INCLUDES = -I../include GPM = -D F_HAVE_LIBGPM VER = -D F_VERSION=$(VERSION) RM = rm -f @@ -133,19 +134,19 @@ install: $(LIB) ln -s -f $(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) ln -s -f $(LIB).$(MAJOR) $(LIBDIR)/libfinal.so ldconfig - mkdir -p $(INCLUDEDIR) + mkdir -p $(INCLUDEDIR2) @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ - install -m 644 $$h $(INCLUDEDIR)/$$h; \ + install -m 644 $(INCLUDEDIR1)/$$h $(INCLUDEDIR2)/$$h; \ done -uninstall: $(INCLUDE_HEADERS) +uninstall: $(OBJS) $(RM) $(LIBDIR)/$(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) $(LIBDIR)/libfinal.so @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ - $(RM) $(INCLUDEDIR)/$$h; \ + $(RM) $(INCLUDEDIR2)/$$h; \ done - rmdir $(INCLUDEDIR) + rmdir $(INCLUDEDIR2) .PHONY: clean dep clean: diff --git a/src/Makefile.gcc b/src/Makefile.gcc index e512655c..52e7f22d 100644 --- a/src/Makefile.gcc +++ b/src/Makefile.gcc @@ -5,8 +5,9 @@ # This is where make install will install the library VERSION = "0.3.0" MAJOR := $(shell echo ${VERSION} | cut -d. -f1) -LIBDIR = /usr/local/lib64 -INCLUDEDIR = /usr/local/include/final +LIBDIR = /usr/local/lib +INCLUDEDIR1 = ../include/final +INCLUDEDIR2 = /usr/local/include/final INCLUDE_HEADERS = \ fapplication.h \ fbuttongroup.h \ @@ -53,7 +54,7 @@ CXX = g++ CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) $(VER) $(GPM) -march=x86-64 -frtti -fexceptions MAKEFILE = -f Makefile.gcc LDFLAGS = $(TERMCAP) -lgpm -INCLUDES = -I./ +INCLUDES = -I../include GPM = -D F_HAVE_LIBGPM VER = -D F_VERSION=$(VERSION) RM = rm -f @@ -133,19 +134,19 @@ install: $(LIB) ln -s -f $(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) ln -s -f $(LIB).$(MAJOR) $(LIBDIR)/libfinal.so ldconfig - mkdir -p $(INCLUDEDIR) + mkdir -p $(INCLUDEDIR2) @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ - install -m 644 $$h $(INCLUDEDIR)/$$h; \ + install -m 644 $(INCLUDEDIR1)/$$h $(INCLUDEDIR2)/$$h; \ done -uninstall: $(INCLUDE_HEADERS) +uninstall: $(OBJS) $(RM) $(LIBDIR)/$(LIB).$(VERSION) $(LIBDIR)/libfinal.so.$(MAJOR) $(LIBDIR)/libfinal.so @list='$(INCLUDE_HEADERS)'; for h in $$list; \ do \ - $(RM) $(INCLUDEDIR)/$$h; \ + $(RM) $(INCLUDEDIR2)/$$h; \ done - rmdir $(INCLUDEDIR) + rmdir $(INCLUDEDIR2) .PHONY: clean dep clean: diff --git a/src/Makefile.in b/src/Makefile.in index 2a6cd8b1..8af85c7e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -373,7 +373,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = fonts -AM_CPPFLAGS = -Wall -Werror +AM_CPPFLAGS = -I../include -Wall -Werror lib_LTLIBRARIES = libfinal.la libfinal_la_SOURCES = \ fstring.cpp \ @@ -419,52 +419,53 @@ libfinal_la_SOURCES = \ libfinal_la_LDFLAGS = -version-info @SO_VERSION@ finalcutincludedir = $(includedir)/final finalcutinclude_HEADERS = \ - fapplication.h \ - fbutton.h \ - fbuttongroup.h \ - fcharmap.h \ - fcheckbox.h \ - fconfig.h \ - fswitch.h \ - fdialog.h \ - fc.h \ - fevent.h \ - ffiledialog.h \ - final.h \ - fkey_map.h \ - flabel.h \ - flineedit.h \ - flistbox.h \ - flistview.h \ - fmenu.h \ - fdialoglistmenu.h \ - fmenubar.h \ - fmenuitem.h \ - fradiomenuitem.h \ - fcheckmenuitem.h \ - fmenulist.h \ - fmessagebox.h \ - ftooltip.h \ - fobject.h \ - fpoint.h \ - foptiattr.h \ - foptimove.h \ - ftermbuffer.h \ - fprogressbar.h \ - fradiobutton.h \ - frect.h \ - fscrollbar.h \ - fscrollview.h \ - fstatusbar.h \ - fstring.h \ - ftcap_map.h \ - ftermcap.h \ - fterm.h \ - fvterm.h \ - ftextview.h \ - ftogglebutton.h \ - fwidget.h \ - fwindow.h + ../include/final/fapplication.h \ + ../include/final/fbutton.h \ + ../include/final/fbuttongroup.h \ + ../include/final/fcharmap.h \ + ../include/final/fcheckbox.h \ + ../include/final/fconfig.h \ + ../include/final/fswitch.h \ + ../include/final/fdialog.h \ + ../include/final/fc.h \ + ../include/final/ftypes.h \ + ../include/final/fevent.h \ + ../include/final/ffiledialog.h \ + ../include/final/final.h \ + ../include/final/fkey_map.h \ + ../include/final/flabel.h \ + ../include/final/flineedit.h \ + ../include/final/flistbox.h \ + ../include/final/flistview.h \ + ../include/final/fmenu.h \ + ../include/final/fdialoglistmenu.h \ + ../include/final/fmenubar.h \ + ../include/final/fmenuitem.h \ + ../include/final/fradiomenuitem.h \ + ../include/final/fcheckmenuitem.h \ + ../include/final/fmenulist.h \ + ../include/final/fmessagebox.h \ + ../include/final/ftooltip.h \ + ../include/final/fobject.h \ + ../include/final/fpoint.h \ + ../include/final/foptiattr.h \ + ../include/final/foptimove.h \ + ../include/final/ftermbuffer.h \ + ../include/final/fprogressbar.h \ + ../include/final/fradiobutton.h \ + ../include/final/frect.h \ + ../include/final/fscrollbar.h \ + ../include/final/fscrollview.h \ + ../include/final/fstatusbar.h \ + ../include/final/fstring.h \ + ../include/final/ftcap_map.h \ + ../include/final/ftermcap.h \ + ../include/final/fterm.h \ + ../include/final/fvterm.h \ + ../include/final/ftextview.h \ + ../include/final/ftogglebutton.h \ + ../include/final/fwidget.h \ + ../include/final/fwindow.h all: all-recursive diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 2828b318..3989f139 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -3,10 +3,10 @@ #include -#include "fapplication.h" -#include "fmenu.h" -#include "fstatusbar.h" -#include "fwindow.h" +#include "final/fapplication.h" +#include "final/fmenu.h" +#include "final/fstatusbar.h" +#include "final/fwindow.h" // global application object static FApplication* rootObj = 0; @@ -418,7 +418,7 @@ void FApplication::cmd_options () int FApplication::gpmEvent (bool clear) { register int result; - register int max = (gpm_fd > stdin_no) ? gpm_fd : stdin_no; + register int max = ( gpm_fd > stdin_no ) ? gpm_fd : stdin_no; fd_set ifds; struct timeval tv; @@ -463,7 +463,7 @@ inline bool FApplication::KeyPressed() if ( FD_ISSET(stdin_no, &ifds) ) FD_CLR (stdin_no, &ifds); - return (result > 0); + return ( result > 0 ); } //---------------------------------------------------------------------- @@ -1673,7 +1673,7 @@ void FApplication::processMouseEvent() { // determine the widget at the current click position FWidget* child = childWidgetAt (window, mouse_position); - clicked_widget = (child != 0) ? child : window; + clicked_widget = ( child != 0 ) ? child : window; } // unset the move/size mode @@ -1996,5 +1996,5 @@ bool FApplication::processNextEvent() sendQueuedEvents(); num_events += processTimerEvent(); - return (num_events > 0); + return ( num_events > 0 ); } diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 289c4971..7f0f3935 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -1,9 +1,9 @@ // File: fbutton.cpp // Provides: class FButton -#include "fapplication.h" -#include "fbutton.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/fbutton.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index a9296e69..16caff5a 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -1,10 +1,10 @@ // File: fbuttongroup.cpp // Provides: class FButtonGroup -#include "fapplication.h" -#include "fbuttongroup.h" -#include "fstatusbar.h" -#include "ftogglebutton.h" +#include "final/fapplication.h" +#include "final/fbuttongroup.h" +#include "final/fstatusbar.h" +#include "final/ftogglebutton.h" //---------------------------------------------------------------------- diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp index 2ce6aabf..ebdec5ac 100644 --- a/src/fcheckbox.cpp +++ b/src/fcheckbox.cpp @@ -1,7 +1,7 @@ // File: fcheckbox.cpp // Provides: class FCheckBox -#include "fcheckbox.h" +#include "final/fcheckbox.h" //---------------------------------------------------------------------- diff --git a/src/fcheckmenuitem.cpp b/src/fcheckmenuitem.cpp index 259a0e8c..a6f0b618 100644 --- a/src/fcheckmenuitem.cpp +++ b/src/fcheckmenuitem.cpp @@ -1,8 +1,8 @@ // File: fcheckmenuitem.cpp // Provides: class FCheckMenuItem -#include "fcheckmenuitem.h" -#include "fmenu.h" +#include "final/fcheckmenuitem.h" +#include "final/fmenu.h" //---------------------------------------------------------------------- // class FCheckMenuItem diff --git a/src/fdialog.cpp b/src/fdialog.cpp index ea6b028e..6c69bb3b 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -1,9 +1,9 @@ // File: fdialog.cpp // Provides: class FDialog -#include "fapplication.h" -#include "fdialog.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/fdialog.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- diff --git a/src/fdialoglistmenu.cpp b/src/fdialoglistmenu.cpp index 736c0a51..2b186da9 100644 --- a/src/fdialoglistmenu.cpp +++ b/src/fdialoglistmenu.cpp @@ -2,7 +2,7 @@ // Provides: class FDialogListMenu -#include "fdialoglistmenu.h" +#include "final/fdialoglistmenu.h" //---------------------------------------------------------------------- // class FDialogListMenu diff --git a/src/fevent.cpp b/src/fevent.cpp index 8d93b17e..90ea14e1 100644 --- a/src/fevent.cpp +++ b/src/fevent.cpp @@ -3,7 +3,7 @@ #include -#include "fevent.h" +#include "final/fevent.h" //---------------------------------------------------------------------- @@ -185,13 +185,13 @@ FFocusEvent::~FFocusEvent() // destructor //---------------------------------------------------------------------- bool FFocusEvent::gotFocus() const { - return (type() == fc::FocusIn_Event); + return ( type() == fc::FocusIn_Event ); } //---------------------------------------------------------------------- bool FFocusEvent::lostFocus() const { - return (type() == fc::FocusOut_Event); + return ( type() == fc::FocusOut_Event ); } //---------------------------------------------------------------------- diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 4aea0770..3a93e99b 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -3,7 +3,7 @@ #include -#include "ffiledialog.h" +#include "final/ffiledialog.h" // non-member functions diff --git a/src/flabel.cpp b/src/flabel.cpp index 1b8b2107..beac82ef 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -1,9 +1,9 @@ // File: flabel.cpp // Provides: class FLabel -#include "fapplication.h" -#include "flabel.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/flabel.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 6172ddd3..c8cfc730 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -1,9 +1,9 @@ // File: flineedit.cpp // Provides: class FLineEdit -#include "fapplication.h" -#include "flineedit.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/flineedit.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 76c2abdf..3a60e666 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -4,10 +4,10 @@ #include -#include "fapplication.h" -#include "flistbox.h" -#include "fscrollbar.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/flistbox.h" +#include "final/fscrollbar.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- diff --git a/src/flistview.cpp b/src/flistview.cpp index 23dee12a..ee0a49a1 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -4,11 +4,11 @@ #include -#include "fapplication.h" -#include "flistview.h" -#include "fscrollbar.h" -#include "fstatusbar.h" -#include "ftermbuffer.h" +#include "final/fapplication.h" +#include "final/flistview.h" +#include "final/fscrollbar.h" +#include "final/fstatusbar.h" +#include "final/ftermbuffer.h" //---------------------------------------------------------------------- // class FListViewItem @@ -1396,7 +1396,7 @@ void FListView::drawListLine ( const FListViewItem* item uInt i; for (i = 0; i < len; i++) - print (element_str[i]); + *this << element_str[i]; for (; i < uInt(getWidth() - nf_offset - 2); i++) print (' '); diff --git a/src/fmenu.cpp b/src/fmenu.cpp index c05ece59..908ac773 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -3,10 +3,10 @@ #include -#include "fapplication.h" -#include "fdialog.h" -#include "fmenu.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/fdialog.h" +#include "final/fmenu.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- // class FMenu diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 4a180129..ef128ea0 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -3,9 +3,10 @@ #include -#include "fapplication.h" -#include "fmenubar.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/fmenubar.h" +#include "final/fstatusbar.h" + //---------------------------------------------------------------------- // class FMenuBar @@ -423,16 +424,17 @@ void FMenuBar::onMouseMove (FMouseEvent* ev) try { _ev = new FMouseEvent (fc::MouseMove_Event, p, t, b); - menu->mouse_down = true; - setClickedWidget(menu); - menu->onMouseMove(_ev); - delete _ev; } catch (const std::bad_alloc& ex) { std::cerr << "not enough memory to alloc " << ex.what() << std::endl; } + + menu->mouse_down = true; + setClickedWidget(menu); + menu->onMouseMove(_ev); + delete _ev; } } } diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 65409e72..e642df1a 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -1,13 +1,14 @@ // File: fmenuitem.cpp // Provides: class FMenuItem -#include "fapplication.h" -#include "fdialog.h" -#include "fmenu.h" -#include "fmenubar.h" -#include "fmenulist.h" -#include "fmenuitem.h" -#include "fstatusbar.h" +#include "final/fapplication.h" +#include "final/fdialog.h" +#include "final/fmenu.h" +#include "final/fmenubar.h" +#include "final/fmenulist.h" +#include "final/fmenuitem.h" +#include "final/fstatusbar.h" + //---------------------------------------------------------------------- // class FMenuItem diff --git a/src/fmenulist.cpp b/src/fmenulist.cpp index 66fb60f9..1657c13a 100644 --- a/src/fmenulist.cpp +++ b/src/fmenulist.cpp @@ -3,7 +3,7 @@ #include -#include "fmenulist.h" +#include "final/fmenulist.h" //---------------------------------------------------------------------- // class FMenuList diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index f80db00b..952cb6ca 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -3,8 +3,8 @@ #include -#include "fapplication.h" -#include "fmessagebox.h" +#include "final/fapplication.h" +#include "final/fmessagebox.h" static const char* const button_text[] = diff --git a/src/fobject.cpp b/src/fobject.cpp index 90d72740..99223f0e 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -1,7 +1,7 @@ // File: fobject.cpp // Provides: class FObject -#include "fobject.h" +#include "final/fobject.h" // static class attributes bool FObject::timer_modify_lock; diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 7bca1d58..ee05191e 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1,9 +1,10 @@ // File: foptiattr.cpp // Provides: class FOptiAttr -#include "foptiattr.h" #include +#include "final/foptiattr.h" + //---------------------------------------------------------------------- // class FOptiAttr //---------------------------------------------------------------------- @@ -736,7 +737,7 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next) inline bool FOptiAttr::setTermBold (char_data*& term) { if ( term && append_sequence(F_enter_bold_mode.cap) ) - return (term->attr.bit.bold = true); + return (term->attr.bit.bold = true ); else return false; } diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 591b327a..f576dffa 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -3,7 +3,7 @@ #include -#include "foptimove.h" +#include "final/foptimove.h" //---------------------------------------------------------------------- @@ -958,7 +958,7 @@ int FOptiMove::relativeMove ( char*& move } } - return (vtime + htime); + return vtime + htime; } //---------------------------------------------------------------------- diff --git a/src/fpoint.cpp b/src/fpoint.cpp index 647b759b..d884df5d 100644 --- a/src/fpoint.cpp +++ b/src/fpoint.cpp @@ -1,7 +1,7 @@ // File: fpoint.cpp // Provides: class FPoint -#include "fpoint.h" +#include "final/fpoint.h" //---------------------------------------------------------------------- diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index de0800e0..3fa97445 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -1,7 +1,7 @@ // File: fprogressbar.cpp // Provides: class FProgressbar -#include "fprogressbar.h" +#include "final/fprogressbar.h" //---------------------------------------------------------------------- // class FProgressbar diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp index ca151e19..b9b932f9 100644 --- a/src/fradiobutton.cpp +++ b/src/fradiobutton.cpp @@ -1,8 +1,8 @@ // File: fradiobutton.cpp // Provides: class FRadioButton -#include "fapplication.h" -#include "fradiobutton.h" +#include "final/fapplication.h" +#include "final/fradiobutton.h" //---------------------------------------------------------------------- diff --git a/src/fradiomenuitem.cpp b/src/fradiomenuitem.cpp index 94843f9d..5c06ad23 100644 --- a/src/fradiomenuitem.cpp +++ b/src/fradiomenuitem.cpp @@ -1,8 +1,8 @@ // File: fradiomenuitem.cpp // Provides: class FRadioMenuItem -#include "fradiomenuitem.h" -#include "fmenu.h" +#include "final/fradiomenuitem.h" +#include "final/fmenu.h" //---------------------------------------------------------------------- // class FRadioMenuItem diff --git a/src/frect.cpp b/src/frect.cpp index 8bb8ba02..f996ebba 100644 --- a/src/frect.cpp +++ b/src/frect.cpp @@ -3,7 +3,7 @@ #include -#include "frect.h" +#include "final/frect.h" //---------------------------------------------------------------------- // class FRect diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 01b7686b..ce58e425 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -3,7 +3,7 @@ #include -#include "fscrollbar.h" +#include "final/fscrollbar.h" //---------------------------------------------------------------------- // class FScrollbar @@ -131,7 +131,7 @@ void FScrollbar::setPageSize (int document_size, int page_size) void FScrollbar::setOrientation (int o) { int nf = 0; - length = (getHeight() > getWidth()) ? getHeight() : getWidth(); + length = ( getHeight() > getWidth() ) ? getHeight() : getWidth(); if ( o == fc::vertical && bar_orientation == fc::horizontal ) { @@ -158,7 +158,7 @@ void FScrollbar::setGeometry (int x, int y, int w, int h, bool adjust) FWidget::setGeometry (x, y, w, h, adjust); int nf = 0; - length = (h > w) ? h : w; + length = ( h > w ) ? h : w; if ( bar_orientation == fc::vertical ) { diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index 2e110ce0..d2e273ca 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -1,8 +1,8 @@ // File: fscrollview.cpp // Provides: class FScrollView -#include "fscrollview.h" -#include "fwindow.h" +#include "final/fscrollview.h" +#include "final/fwindow.h" //---------------------------------------------------------------------- diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 2119defd..46ea4ec8 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -4,7 +4,7 @@ #include -#include "fstatusbar.h" +#include "final/fstatusbar.h" //---------------------------------------------------------------------- // class FStatusKey @@ -78,7 +78,7 @@ bool FStatusKey::setMouseFocus(bool on) if ( on == mouse_focus ) return true; - return mouse_focus = (on) ? true : false; + return mouse_focus = ( on ) ? true : false; } diff --git a/src/fstring.cpp b/src/fstring.cpp index 8cd2deda..cbd053f6 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -4,7 +4,7 @@ #include #include -#include "fstring.h" +#include "final/fstring.h" // static class constant const char* const FString::bad_alloc_str = "not enough memory " \ @@ -238,7 +238,7 @@ FString& FString::operator = (const FString& s) else clear(); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -249,7 +249,7 @@ FString& FString::operator = (const std::wstring& s) else clear(); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -260,7 +260,7 @@ const FString& FString::operator = (const wchar_t* s) else clear(); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -276,7 +276,7 @@ FString& FString::operator = (const std::string& s) else clear(); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -292,7 +292,7 @@ const FString& FString::operator = (const char* s) else clear(); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -302,7 +302,7 @@ const FString& FString::operator = (const wchar_t c) s[0] = c; s[1] = L'\0'; _assign (s); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -312,28 +312,28 @@ const FString& FString::operator = (const char c) s[0] = wchar_t(c & 0xff); s[1] = L'\0'; _assign (s); - return (*this); + return *this; } //---------------------------------------------------------------------- const FString& FString::operator += (const FString& s) { _insert (length, s.length, s.string); - return (*this); + return *this; } //---------------------------------------------------------------------- const FString& FString::operator += (const std::wstring& s) { _insert (length, uInt(s.length()), s.c_str()); - return (*this); + return *this; } //---------------------------------------------------------------------- const FString& FString::operator += (const wchar_t* s) { _insert (length, uInt(std::wcslen(s)), s); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -347,7 +347,7 @@ const FString& FString::operator += (const std::string& s) delete[] wc_string; } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -361,7 +361,7 @@ const FString& FString::operator += (const char* s) delete[] wc_string; } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -371,7 +371,7 @@ const FString& FString::operator += (const wchar_t c) s[0] = c; s[1] = L'\0'; _insert (length, 1, s); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -381,7 +381,7 @@ const FString& FString::operator += (const char c) s[0] = wchar_t(c & 0xff); s[1] = L'\0'; _insert (length, 1, s); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -389,7 +389,7 @@ const FString FString::operator + (const FString& s) { FString tmp(string); tmp._insert (length, s.length, s.string); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -397,7 +397,7 @@ const FString FString::operator + (const std::wstring& s) { FString tmp(string); tmp._insert (length, uInt(s.length()), s.c_str()); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -405,7 +405,7 @@ const FString FString::operator + (const wchar_t* s) { FString tmp(string); tmp._insert (length, uInt(std::wcslen(s)), s); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -415,11 +415,11 @@ const FString FString::operator + (const std::string& s) wchar_t* wc_string = c_to_wc_str(s.c_str()); if ( ! wc_string ) - return (tmp); + return tmp; tmp._insert (length, uInt(std::wcslen(wc_string)), wc_string); delete[] wc_string; - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -429,11 +429,11 @@ const FString FString::operator + (const char* s) wchar_t* wc_string = c_to_wc_str(s); if ( ! wc_string ) - return (tmp); + return tmp; tmp._insert (length, uInt(std::wcslen(wc_string)), wc_string); delete[] wc_string; - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -444,7 +444,7 @@ const FString FString::operator + (const wchar_t c) s[1] = L'\0'; FString tmp(string); tmp._insert (length, 1, s); - return(tmp); + return tmp; } //---------------------------------------------------------------------- @@ -455,7 +455,7 @@ const FString FString::operator + (const char c) s[1] = L'\0'; FString tmp(string); tmp._insert (length, 1, s); - return(tmp); + return tmp; } //---------------------------------------------------------------------- @@ -480,7 +480,7 @@ wchar_t& FString::operator [] (uInt pos) //---------------------------------------------------------------------- const FString& FString::operator () () { - return (*this); + return *this; } @@ -512,7 +512,7 @@ FString& FString::sprintf (const wchar_t* format, ...) va_end (args); _assign (buffer); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -538,7 +538,7 @@ FString& FString::sprintf (const char* format, ...) catch (const std::bad_alloc& ex) { std::cerr << bad_alloc_str << ex.what() << std::endl; - return (*this); + return *this; } va_start (args, format); @@ -557,7 +557,7 @@ FString& FString::sprintf (const char* format, ...) if ( buffer != buf ) delete[] buffer; - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -569,13 +569,13 @@ FString FString::clear() length = 0; bufsize = 0; string = 0; - return (*this); + return *this; } //---------------------------------------------------------------------- const wchar_t* FString::wc_str() const { - return (string); + return string; } //---------------------------------------------------------------------- @@ -872,7 +872,7 @@ FString FString::trim() const { // handle NULL and empty string if ( ! (string && *string) ) - return (*this); + return *this; FString s(ltrim()); return s.rtrim(); @@ -1001,7 +1001,7 @@ std::vector FString::split (const FString& delimiter) FString& FString::setString (const wchar_t* s) { _assign (s); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -1015,7 +1015,7 @@ FString& FString::setString (const char* s) delete[] wc_string; } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -1187,7 +1187,7 @@ bool FString::operator < (const FString& s) const if ( ! (string || s.string) ) return false; - return (std::wcscmp(string, s.string) < 0); + return ( std::wcscmp(string, s.string) < 0 ); } //---------------------------------------------------------------------- @@ -1247,7 +1247,7 @@ bool FString::operator <= (const FString& s) const if ( ! (string || s.string) ) return true; - return (std::wcscmp(string, s.string) <= 0); + return ( std::wcscmp(string, s.string) <= 0 ); } //---------------------------------------------------------------------- @@ -1304,7 +1304,7 @@ bool FString::operator == (const FString& s) const if ( ! (string || s.string) ) return true; - return (std::wcscmp(string, s.string) == 0); + return ( std::wcscmp(string, s.string) == 0 ); } //---------------------------------------------------------------------- @@ -1361,7 +1361,7 @@ bool FString::operator != (const FString& s) const if ( ! (string || s.string) ) return false; - return (std::wcscmp(string, s.string) != 0); + return ( std::wcscmp(string, s.string) != 0 ); } //---------------------------------------------------------------------- @@ -1421,7 +1421,7 @@ bool FString::operator >= (const FString& s) const if ( ! (string || s.string) ) return true; - return (std::wcscmp(string, s.string) >= 0); + return ( std::wcscmp(string, s.string) >= 0 ); } //---------------------------------------------------------------------- @@ -1481,7 +1481,7 @@ bool FString::operator > (const FString& s) const if ( ! (string || s.string) ) return false; - return (std::wcscmp(string, s.string) > 0); + return ( std::wcscmp(string, s.string) > 0 ); } //---------------------------------------------------------------------- @@ -1534,7 +1534,7 @@ const FString& FString::insert (const FString& s, uInt pos) throw std::out_of_range(""); _insert (pos, s.length, s.string); - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -1545,25 +1545,25 @@ const FString& FString::insert (const wchar_t* s, uInt pos) throw std::out_of_range(""); _insert (pos, uInt(std::wcslen(s)), s); - return (*this); + return *this; } //---------------------------------------------------------------------- const FString& FString::insert (const char* s, uInt pos) { - return (insert(FString(s), pos)); + return insert(FString(s), pos); } //---------------------------------------------------------------------- const FString& FString::insert (const wchar_t c, uInt pos) { - return (insert(FString(c), pos)); + return insert(FString(c), pos); } //---------------------------------------------------------------------- const FString& FString::insert (const char c, uInt pos) { - return (insert(FString(c), pos)); + return insert(FString(c), pos); } //---------------------------------------------------------------------- @@ -2138,7 +2138,7 @@ const FString& FString::overwrite (const FString& s, uInt pos) _insert (length, pos + s.length - length, s.string + length - pos); } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -2156,7 +2156,7 @@ const FString& FString::overwrite (const wchar_t* s, uInt pos) _insert (length, pos + len - length, s + length - pos); } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -2167,7 +2167,7 @@ const FString& FString::overwrite (const wchar_t c, uInt pos) string[pos] = c; } - return (*this); + return *this; } //---------------------------------------------------------------------- @@ -2176,19 +2176,19 @@ const FString& FString::remove (uInt pos, uInt len) assert ((pos < length) && ((pos + len) <= length)); _remove (pos, len); - return (*this); + return *this; } //---------------------------------------------------------------------- bool FString::includes (const FString& s) { - return (std::wcsstr(string, s.string) != 0); + return ( std::wcsstr(string, s.string) != 0 ); } //---------------------------------------------------------------------- bool FString::includes (const wchar_t* s) { - return (std::wcsstr(string, s) != 0); + return ( std::wcsstr(string, s) != 0 ); } //---------------------------------------------------------------------- @@ -2202,7 +2202,7 @@ bool FString::includes (const char* s) ret = bool(std::wcsstr(string, wc_string) != 0); delete[] wc_string; - return (ret); + return ret; } //---------------------------------------------------------------------- @@ -2211,7 +2211,7 @@ bool FString::includes (const wchar_t c) wchar_t s[2]; s[0] = c; s[1] = L'\0'; - return (std::wcsstr(string, s) != 0); + return ( std::wcsstr(string, s) != 0 ); } //---------------------------------------------------------------------- @@ -2220,7 +2220,7 @@ bool FString::includes (const char c) wchar_t s[2]; s[0] = wchar_t(c & 0xff); s[1] = L'\0'; - return (std::wcsstr(string, s) != 0); + return ( std::wcsstr(string, s) != 0 ); } @@ -2460,7 +2460,7 @@ inline wchar_t* FString::c_to_wc_str (const char* s) const try { // Generate a empty wide string (L"") - return (new wchar_t[1]()); + return new wchar_t[1](); } catch (const std::bad_alloc& ex) { @@ -2540,7 +2540,7 @@ std::ostream& operator << (std::ostream& outstr, const FString& s) if ( s.length ) outstr << s.wc_to_c_str( s.string ); - return (outstr); + return outstr; } //---------------------------------------------------------------------- @@ -2558,7 +2558,7 @@ std::istream& operator >> (std::istream& instr, FString& s) delete[] wc_str; } - return (instr); + return instr; } //---------------------------------------------------------------------- @@ -2567,7 +2567,7 @@ std::wostream& operator << (std::wostream& outstr, const FString& s) if ( s.length ) outstr << s.string; - return (outstr); + return outstr; } //---------------------------------------------------------------------- @@ -2576,7 +2576,7 @@ std::wistream& operator >> (std::wistream& instr, FString& s) wchar_t buf[FString::INPBUFFER + 1]; instr.getline (buf, FString::INPBUFFER); s._assign (buf); - return (instr); + return instr; } //---------------------------------------------------------------------- @@ -2586,7 +2586,7 @@ const FString operator + (const FString& s1, const FString& s2) tmp._insert ( uInt(std::wcslen(s1.wc_str())) , uInt(std::wcslen(s2.wc_str())) , s2.wc_str() ); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2594,7 +2594,7 @@ const FString operator + (const FString& s, const wchar_t c) { FString tmp(s); tmp._insert ( uInt(std::wcslen(s.wc_str())), 1, &c); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2604,7 +2604,7 @@ const FString operator + (const std::wstring& s1, const FString& s2) tmp._insert ( uInt(std::wcslen(s1.c_str())) , uInt(std::wcslen(s2.wc_str())) , s2.wc_str() ); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2614,7 +2614,7 @@ const FString operator + (const wchar_t* s1, const FString& s2) tmp._insert ( uInt(std::wcslen(s1)) , uInt(std::wcslen(s2.wc_str())) , s2.wc_str() ); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2624,7 +2624,7 @@ const FString operator + (const std::string& s1, const FString& s2) tmp._insert ( tmp.getLength() , uInt(std::wcslen(s2.wc_str())) , s2.wc_str() ); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2634,7 +2634,7 @@ const FString operator + (const char* s1, const FString& s2) tmp._insert ( tmp.getLength() , uInt(std::wcslen(s2.wc_str())) , s2.wc_str() ); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2642,7 +2642,7 @@ const FString operator + (const wchar_t c, const FString& s) { FString tmp(c); tmp._insert (1, uInt(std::wcslen(s.wc_str())), s.wc_str()); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2650,7 +2650,7 @@ const FString operator + (const char c, const FString& s) { FString tmp(c); tmp._insert (1, uInt(std::wcslen(s.wc_str())), s.wc_str()); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2658,7 +2658,7 @@ const FString operator + (const wchar_t c, const std::wstring& s) { FString tmp(c); tmp._insert (1, uInt(s.length()), s.c_str()); - return (tmp); + return tmp; } //---------------------------------------------------------------------- @@ -2669,5 +2669,5 @@ const FString operator + (const FString& s, const char c) tmp2[0] = wchar_t(c & 0xff); tmp2[1] = L'\0'; tmp1._insert (s.length, 1, tmp2); - return (tmp1); + return tmp1; } diff --git a/src/fswitch.cpp b/src/fswitch.cpp index 0c460128..5a50bd06 100644 --- a/src/fswitch.cpp +++ b/src/fswitch.cpp @@ -1,7 +1,7 @@ // File: fswitch.cpp // Provides: class FSwitch -#include "fswitch.h" +#include "final/fswitch.h" //---------------------------------------------------------------------- diff --git a/src/fterm.cpp b/src/fterm.cpp index b580c171..2527b66b 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -6,10 +6,10 @@ #include #include -#include "fterm.h" -#include "fcharmap.h" -#include "fkey_map.h" -#include "ftcap_map.h" +#include "final/fterm.h" +#include "final/fcharmap.h" +#include "final/fkey_map.h" +#include "final/ftcap_map.h" #if defined(__linux__) #include "fonts/newfont.h" @@ -265,7 +265,7 @@ bool FTerm::isKeyTimeout (timeval* time, register long timeout) } diff_usec = (diff.tv_sec * 1000000) + diff.tv_usec; - return (diff_usec > timeout); + return ( diff_usec > timeout ); } //---------------------------------------------------------------------- @@ -468,7 +468,7 @@ int FTerm::parseKeyString ( char buffer[] for (int i = 0; Fkey[i].tname[0] != 0; i++) { char* k = Fkey[i].string; - len = (k) ? int(std::strlen(k)) : 0; + len = ( k ) ? int(std::strlen(k)) : 0; if ( k && std::strncmp(k, buffer, uInt(len)) == 0 ) // found { @@ -887,7 +887,6 @@ const FString* FTerm::getXTermFont() { fd_set ifds; struct timeval tv; - char temp[150] = {}; oscPrefix(); putstring (OSC "50;?" BEL); // get font @@ -902,6 +901,8 @@ const FString* FTerm::getXTermFont() // read the terminal answer if ( select (stdin_no + 1, &ifds, 0, 0, &tv) > 0) { + char temp[150] = {}; + if ( std::scanf("\033]50;%[^\n]s", temp) == 1 ) { FString* xtermfont; @@ -937,7 +938,6 @@ const FString* FTerm::getXTermTitle() fd_set ifds; struct timeval tv; - char temp[512] = {}; putstring (CSI "21t"); // get title std::fflush(stdout); @@ -950,6 +950,8 @@ const FString* FTerm::getXTermTitle() // read the terminal answer if ( select (stdin_no + 1, &ifds, 0, 0, &tv) > 0) { + char temp[512] = {}; + if ( std::scanf("\033]l%[^\n]s", temp) == 1 ) { std::size_t n = std::strlen(temp); @@ -1918,7 +1920,7 @@ inline uInt16 FTerm::getInputStatusRegisterOne() // Miscellaneous output (read port) static const uInt16 misc_read = 0x3cc; - const uInt16 io_base = (inb(misc_read) & 0x01) ? 0x3d0 : 0x3b0; + const uInt16 io_base = ( inb(misc_read) & 0x01 ) ? 0x3d0 : 0x3b0; // 0x3ba : Input status 1 MDA (read port) // 0x3da : Input status 1 CGA (read port) return io_base + 0x0a; @@ -2115,13 +2117,13 @@ void FTerm::getSystemTermType() if ( (fp = std::fopen("/etc/ttytype", "r")) != 0 ) { char* p; - char* type; - char* name; char str[BUFSIZ]; // read and parse the file while ( fgets(str, sizeof(str) - 1, fp) != 0 ) { + char* name; + char* type; type = name = 0; // 0 == not found p = str; @@ -2694,7 +2696,6 @@ char* FTerm::parseAnswerbackMsg (char*& current_termtype) char* FTerm::parseSecDA (char*& current_termtype) { char* new_termtype = current_termtype; - bool sec_da_supported = false; // The Linux console knows no Sec_DA if ( linux_terminal ) @@ -2714,6 +2715,7 @@ char* FTerm::parseSecDA (char*& current_termtype) if ( sec_da->getLength() > 5 ) { uLong num_components; + bool sec_da_supported = false; // remove the first 3 bytes ("\033[>") FString temp = sec_da->right(sec_da->getLength() - 3); diff --git a/src/ftermbuffer.cpp b/src/ftermbuffer.cpp index bc2db509..010ef7c8 100644 --- a/src/ftermbuffer.cpp +++ b/src/ftermbuffer.cpp @@ -4,7 +4,7 @@ #include #include -#include "ftermbuffer.h" +#include "final/ftermbuffer.h" //---------------------------------------------------------------------- diff --git a/src/ftextview.cpp b/src/ftextview.cpp index f1cdd9db..f22393a9 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -1,9 +1,9 @@ // File: ftextview.cpp // Provides: class FTextView -#include "fdialog.h" -#include "fstatusbar.h" -#include "ftextview.h" +#include "final/fdialog.h" +#include "final/fstatusbar.h" +#include "final/ftextview.h" //---------------------------------------------------------------------- @@ -769,7 +769,7 @@ void FTextView::drawText() for (i = 0; i < len; i++) { wchar_t ch = line_str[i]; - bool utf8 = (Encoding == fc::UTF8) ? true : false; + bool utf8 = ( Encoding == fc::UTF8 ) ? true : false; // only printable and 1 column per character if ( ( (utf8 && std::iswprint(wint_t(ch))) diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 923f1e58..f4863e6c 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -1,10 +1,10 @@ // File: ftogglebutton.cpp // Provides: class FToggleButton -#include "fapplication.h" -#include "fbuttongroup.h" -#include "fstatusbar.h" -#include "ftogglebutton.h" +#include "final/fapplication.h" +#include "final/fbuttongroup.h" +#include "final/fstatusbar.h" +#include "final/ftogglebutton.h" //---------------------------------------------------------------------- diff --git a/src/ftooltip.cpp b/src/ftooltip.cpp index ccbd7ba8..a1d57d1f 100644 --- a/src/ftooltip.cpp +++ b/src/ftooltip.cpp @@ -1,8 +1,8 @@ // File: ftooltip.cpp // Provides: class FToolTip -#include "fapplication.h" -#include "ftooltip.h" +#include "final/fapplication.h" +#include "final/ftooltip.h" //---------------------------------------------------------------------- diff --git a/src/fvterm.cpp b/src/fvterm.cpp index f53b0373..8cf29b29 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -5,10 +5,10 @@ #include #include -#include "fapplication.h" -#include "fvterm.h" -#include "fwidget.h" -#include "fwindow.h" +#include "final/fapplication.h" +#include "final/fvterm.h" +#include "final/fwidget.h" +#include "final/fwindow.h" // global FVTerm object static FVTerm* init_object = 0; @@ -1571,8 +1571,6 @@ void FVTerm::getArea (int ax, int ay, term_area* area) // Copies a block from the virtual terminal position to the given area int y_end; int length; - char_data* tc; // terminal character - char_data* ac; // area character if ( ! area ) return; @@ -1592,6 +1590,8 @@ void FVTerm::getArea (int ax, int ay, term_area* area) for (int y = 0; y < y_end; y++) // line loop { + char_data* tc; // terminal character + char_data* ac; // area character tc = &vterm->text[(ay + y) * vterm->width + ax]; ac = &area->text[y * area->width]; std::memcpy (ac, tc, sizeof(char_data) * unsigned(length)); @@ -1619,8 +1619,6 @@ void FVTerm::getArea (int x, int y, int w, int h, term_area* area) { // Copies a block from the virtual terminal rectangle to the given area int y_end, length, dx, dy; - char_data* tc; // terminal character - char_data* ac; // area character if ( ! area ) return; @@ -1646,6 +1644,8 @@ void FVTerm::getArea (int x, int y, int w, int h, term_area* area) for (int _y = 0; _y < y_end; _y++) // line loop { + char_data* tc; // terminal character + char_data* ac; // area character int line_len = area->width + area->right_shadow; tc = &vterm->text[(y + _y - 1) * vterm->width + x - 1]; ac = &area->text[(dy + _y) * line_len + dx]; @@ -1793,7 +1793,6 @@ void FVTerm::scrollAreaForward (term_area* area) int y_max; char_data nc; // next character char_data* lc; // last character - char_data* sc; // source character char_data* dc; // destination character if ( ! area ) @@ -1808,6 +1807,7 @@ void FVTerm::scrollAreaForward (term_area* area) for (int y = 0; y < y_max; y++) { + char_data* sc; // source character int pos1 = y * total_width; int pos2 = (y + 1) * total_width; sc = &area->text[pos2]; @@ -1854,7 +1854,6 @@ void FVTerm::scrollAreaReverse (term_area* area) int y_max; char_data nc; // next character char_data* lc; // last character - char_data* sc; // source character char_data* dc; // destination character if ( ! area ) @@ -1869,6 +1868,7 @@ void FVTerm::scrollAreaReverse (term_area* area) for (int y = y_max; y > 0; y--) { + char_data* sc; // source character int pos1 = (y - 1) * total_width; int pos2 = y * total_width; sc = &area->text[pos1]; @@ -2361,8 +2361,6 @@ void FVTerm::updateTerminalLine (uInt y) bool draw_tailing_ws = false; char*& ce = TCAP(fc::t_clr_eol); char*& cb = TCAP(fc::t_clr_bol); - char*& ec = TCAP(fc::t_erase_chars); - char*& rp = TCAP(fc::t_repeat_char); bool ut = FTermcap::background_color_erase; char_data* first_char = &vt->text[y * uInt(vt->width)]; char_data* last_char = &vt->text[(y + 1) * uInt(vt->width) - 1]; @@ -2463,6 +2461,8 @@ void FVTerm::updateTerminalLine (uInt y) for (uInt x = xmin; x <= xmax; x++) { char_data* print_char; + char*& ec = TCAP(fc::t_erase_chars); + char*& rp = TCAP(fc::t_repeat_char); print_char = &vt->text[y * uInt(vt->width) + x]; print_char->attr.bit.printed = true; diff --git a/src/fwidget.cpp b/src/fwidget.cpp index f31e3823..df58ea4c 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -3,10 +3,10 @@ #include -#include "fapplication.h" -#include "fmenubar.h" -#include "fstatusbar.h" -#include "fwidget.h" +#include "final/fapplication.h" +#include "final/fmenubar.h" +#include "final/fstatusbar.h" +#include "final/fwidget.h" // global FWidget object @@ -338,7 +338,7 @@ bool FWidget::setEnable (bool on) else flags &= ~fc::active; - return enable = (on) ? true : false; + return enable = ( on ) ? true : false; } //---------------------------------------------------------------------- @@ -391,7 +391,7 @@ bool FWidget::setFocus (bool on) window->setWindowFocusWidget(this); } - return focus = (on) ? true : false; + return focus = ( on ) ? true : false; } //---------------------------------------------------------------------- @@ -676,8 +676,8 @@ void FWidget::setGeometry (int x, int y, int w, int h, bool adjust) if ( ! isWindowWidget() ) { - (x < 1) ? wsize.setX(1) : wsize.setX(x); - (y < 1) ? wsize.setY(1) : wsize.setY(y); + ( x < 1 ) ? wsize.setX(1) : wsize.setX(x); + ( y < 1 ) ? wsize.setY(1) : wsize.setY(y); } else { @@ -685,8 +685,8 @@ void FWidget::setGeometry (int x, int y, int w, int h, bool adjust) wsize.setY(y); } - (w < 1) ? wsize.setWidth(1) : wsize.setWidth(w); - (h < 1) ? wsize.setHeight(1) : wsize.setHeight(h); + ( w < 1 ) ? wsize.setWidth(1) : wsize.setWidth(w); + ( h < 1 ) ? wsize.setHeight(1) : wsize.setHeight(h); adjust_wsize = wsize; term_x = getTermX(); @@ -858,7 +858,7 @@ FWidget* FWidget::childWidgetAt (FWidget* p, int x, int y) && widget->getTermGeometry().contains(x, y) ) { FWidget* child = childWidgetAt(widget, x, y); - return (child != 0) ? child : widget; + return ( child != 0 ) ? child : widget; } ++iter; diff --git a/src/fwindow.cpp b/src/fwindow.cpp index 395f2440..62e6f3d9 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -1,10 +1,10 @@ // File: fwindow.cpp // Provides: class FWindow -#include "fapplication.h" -#include "fmenubar.h" -#include "fstatusbar.h" -#include "fwindow.h" +#include "final/fapplication.h" +#include "final/fmenubar.h" +#include "final/fstatusbar.h" +#include "final/fwindow.h" // static attributes FWindow* FWindow::previous_window = 0; @@ -152,7 +152,7 @@ bool FWindow::activateWindow (bool on) active_area = getVWin(); } - return window_active = (on) ? true : false; + return window_active = ( on ) ? true : false; } //---------------------------------------------------------------------- diff --git a/stamp-h1 b/stamp-h1 deleted file mode 100644 index 4547fe1b..00000000 --- a/stamp-h1 +++ /dev/null @@ -1 +0,0 @@ -timestamp for config.h