some fixes

This commit is contained in:
Markus Gans 2018-12-22 15:33:23 +01:00
parent 602526686c
commit ac9ed260f5
13 changed files with 37 additions and 30 deletions

View File

@ -1,4 +1,4 @@
PROJECT_NAME = "The Final Cut" PROJECT_NAME = "FINAL CUT"
EXCLUDE = debian, doc, icon, logo, m4, scripts, examples EXCLUDE = debian, doc, icon, logo, m4, scripts, examples
EXCLUDE_PATTERNS = */test/* EXCLUDE_PATTERNS = */test/*

View File

@ -1,5 +1,5 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Makefile.am - The Final Cut terminal programming library # Makefile.am - FINAL CUT terminal programming library
#---------------------------------------------------------------------- #----------------------------------------------------------------------
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign

View File

@ -1,5 +1,5 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# configure.ac - the Final Cut library # configure.ac - FINAL CUT library
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.

View File

@ -1,5 +1,5 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Makefile.am - the Final Cut library # Makefile.am - FINAL CUT library
#---------------------------------------------------------------------- #----------------------------------------------------------------------
docdir = ${datadir}/doc/${PACKAGE} docdir = ${datadir}/doc/${PACKAGE}

View File

@ -1,5 +1,5 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Makefile for Final Cut # Makefile for FINAL CUT
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# This is where make install will install the executable # This is where make install will install the executable

View File

@ -1,5 +1,5 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Makefile for Final Cut # Makefile for FINAL CUT
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# This is where make install will install the executable # This is where make install will install the executable

View File

@ -6,7 +6,7 @@ libdir=@libdir@
includedir=${prefix}/include includedir=${prefix}/include
Name: finalcut Name: finalcut
Description: The Final Cut text-based widget library Description: FINAL CUT text-based widget library
Version: @VERSION@ Version: @VERSION@
URL: https://github.com/gansm/finalcut URL: https://github.com/gansm/finalcut
Libs: -L${libdir} -lfinal Libs: -L${libdir} -lfinal

View File

@ -21,7 +21,7 @@ BuildRequires: libtool
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
%description %description
The Final Cut is a class library and widget toolkit with full mouse FINAL CUT is a class library and widget toolkit with full mouse
support for creating a text-based user interface. The library supports support for creating a text-based user interface. The library supports
the programmer to develop an application for the text console. It allows the programmer to develop an application for the text console. It allows
the simultaneous handling of multiple windows on the screen. the simultaneous handling of multiple windows on the screen.
@ -30,7 +30,7 @@ common controls like dialog windows, push buttons, check boxes,
radio buttons, input lines, list boxes, status bars and so on. radio buttons, input lines, list boxes, status bars and so on.
%package -n libfinal-devel %package -n libfinal-devel
Summary: Development files for The Final Cut text widget library Summary: Development files for the FINAL CUT text widget library
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: libfinal%{sover} = %{version} Requires: libfinal%{sover} = %{version}
Requires: bdftopcf Requires: bdftopcf
@ -44,7 +44,7 @@ Provides: libfinal-devel = %{version}
Recommends: libfinal-examples = %{version} Recommends: libfinal-examples = %{version}
%description -n libfinal-devel %description -n libfinal-devel
The Final Cut is a class library and widget toolkit with full mouse FINAL CUT is a class library and widget toolkit with full mouse
support for creating a text-based user interface. The library supports support for creating a text-based user interface. The library supports
the programmer to develop an application for the text console. It allows the programmer to develop an application for the text console. It allows
the simultaneous handling of multiple windows on the screen. the simultaneous handling of multiple windows on the screen.
@ -53,12 +53,12 @@ common controls like dialog windows, push buttons, check boxes,
radio buttons, input lines, list boxes, status bars and so on. radio buttons, input lines, list boxes, status bars and so on.
%package -n libfinal-examples %package -n libfinal-examples
Summary: Example files for The Final Cut library Summary: Example files for the FINAL CUT library
Group: Development/Languages/C and C++ Group: Development/Languages/C and C++
BuildArch: noarch BuildArch: noarch
%description -n libfinal-examples %description -n libfinal-examples
The Final Cut is a class library and widget toolkit with full mouse FINAL CUT is a class library and widget toolkit with full mouse
support for creating a text-based user interface. The library supports support for creating a text-based user interface. The library supports
the programmer to develop an application for the text console. It allows the programmer to develop an application for the text console. It allows
the simultaneous handling of multiple windows on the screen. the simultaneous handling of multiple windows on the screen.
@ -71,7 +71,7 @@ Summary: Console widget toolkit
Group: System/Libraries Group: System/Libraries
%description -n libfinal%{sover} %description -n libfinal%{sover}
The Final Cut is a class library and widget toolkit with full mouse FINAL CUT is a class library and widget toolkit with full mouse
support for creating a text-based user interface. The library supports support for creating a text-based user interface. The library supports
the programmer to develop an application for the text console. It allows the programmer to develop an application for the text console. It allows
the simultaneous handling of multiple windows on the screen. the simultaneous handling of multiple windows on the screen.
@ -84,7 +84,7 @@ Summary: Console widget toolkit
Group: System/Libraries Group: System/Libraries
%description -n libfinal-static %description -n libfinal-static
The Final Cut is a class library and widget toolkit with full mouse FINAL CUT is a class library and widget toolkit with full mouse
support for creating a text-based user interface. The library supports support for creating a text-based user interface. The library supports
the programmer to develop an application for the text console. It allows the programmer to develop an application for the text console. It allows
the simultaneous handling of multiple windows on the screen. the simultaneous handling of multiple windows on the screen.

View File

@ -1,5 +1,5 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Makefile.am - the Final Cut library # Makefile.am - FINAL CUT library
#---------------------------------------------------------------------- #----------------------------------------------------------------------
EXTRA_DIST = \ EXTRA_DIST = \

View File

@ -79,11 +79,7 @@ FTermDetection::FTermDetection()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FTermDetection::~FTermDetection() // destructor FTermDetection::~FTermDetection() // destructor
{ {
if ( sec_da ) deallocation();
delete sec_da;
if ( answer_back )
delete answer_back;
} }
@ -107,6 +103,8 @@ void FTermDetection::setTtyTypeFileName (char ttytype_filename[])
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermDetection::detect() void FTermDetection::detect()
{ {
deallocation();
// Set the variable 'termtype' to the predefined type of the terminal // Set the variable 'termtype' to the predefined type of the terminal
getSystemTermType(); getSystemTermType();
@ -119,6 +117,16 @@ void FTermDetection::detect()
// private methods of FTermDetection // private methods of FTermDetection
//----------------------------------------------------------------------
void FTermDetection::deallocation()
{
if ( sec_da )
delete sec_da;
if ( answer_back )
delete answer_back;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermDetection::getSystemTermType() void FTermDetection::getSystemTermType()
{ {

View File

@ -873,11 +873,10 @@ FVTerm::covered_state FVTerm::isCovered ( int x, int y
bool found = bool(area == vdesktop); bool found = bool(area == vdesktop);
auto is_covered = non_covered; auto is_covered = non_covered;
auto w = static_cast<FWidget*>(area->widget);
if ( w->window_list && ! w->window_list->empty() ) if ( FWidget::window_list && ! FWidget::window_list->empty() )
{ {
for (auto&& win_obj : *w->window_list) for (auto& win_obj : *FWidget::window_list)
{ {
auto win = win_obj->getVWin(); auto win = win_obj->getVWin();
@ -1696,13 +1695,12 @@ FVTerm::charData FVTerm::generateCharacter (int x, int y)
{ {
// Generates characters for a given position considering all areas // Generates characters for a given position considering all areas
auto widget = static_cast<FWidget*>(vterm->widget);
auto sc = &vdesktop->text[y * vdesktop->width + x]; // shown character auto sc = &vdesktop->text[y * vdesktop->width + x]; // shown character
if ( ! widget->window_list || widget->window_list->empty() ) if ( ! FWidget::window_list || FWidget::window_list->empty() )
return *sc; return *sc;
for (auto&& win_obj : *widget->window_list) for (auto& win_obj : *FWidget::window_list)
{ {
auto win = win_obj->getVWin(); auto win = win_obj->getVWin();
@ -1794,15 +1792,15 @@ FVTerm::charData FVTerm::getCharacter ( character_type char_type
yy = vterm->height - 1; yy = vterm->height - 1;
auto cc = &vdesktop->text[yy * vdesktop->width + xx]; // covered character auto cc = &vdesktop->text[yy * vdesktop->width + xx]; // covered character
auto w = static_cast<FWidget*>(obj);
if ( ! w->window_list || w->window_list->empty() ) if ( ! FWidget::window_list || FWidget::window_list->empty() )
return *cc; return *cc;
// Get the window layer of this object // Get the window layer of this object
auto w = static_cast<FWidget*>(obj);
int layer = FWindow::getWindowLayer(w); int layer = FWindow::getWindowLayer(w);
for (auto&& win_obj : *w->window_list) for (auto&& win_obj : *FWidget::window_list)
{ {
bool significant_char; bool significant_char;

View File

@ -168,6 +168,7 @@ class FTermDetection
private: private:
// Methods // Methods
static void deallocation();
static void getSystemTermType(); static void getSystemTermType();
static bool getTTYtype(); static bool getTTYtype();
#if F_HAVE_GETTTYNAM #if F_HAVE_GETTTYNAM

View File

@ -1,5 +1,5 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Makefile.am - The Final Cut unit tests programs # Makefile.am - FINAL CUT unit tests programs
#---------------------------------------------------------------------- #----------------------------------------------------------------------
if CPPUNIT_TEST if CPPUNIT_TEST