GithubHelp home page GithubHelp logo

gansm / finalcut Goto Github PK

View Code? Open in Web Editor NEW
964.0 30.0 50.0 26.14 MB

A text-based widget toolkit

Home Page: https://github.com/gansm/finalcut/wiki/First-steps#first-steps-with-the-final-cut-widget-toolkit

License: GNU Lesser General Public License v3.0

Shell 0.30% C++ 99.03% C 0.33% Makefile 0.26% M4 0.09%
dialog widget-toolkit termcap terminal tui console tty library framework text-mode-gui

finalcut's People

Contributors

axenow avatar gansm avatar grendello avatar imgbotapp avatar linuxdoesitbetter avatar michael-lehn avatar michielcuijpers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

finalcut's Issues

Custom selection panels

Hi,

I'm attempting to write a small setup application, in the style of Windows 95 Setup, and I'm wondering if aligning panels similarly to the way it does during setup would be a thing I could do here.

e.g.
image

This is neat as all crap, by the way!

Iconizable windows?

Hi, I just noticed this, apologies for the flurry of tickets.

Anyway, I was wondering if it was possible to change(?) the default UI style to be more in-line with VBDOS?

Thanks!

e.g.
image

compilation problem

Hi

I cannot to compile master

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I../include -Wall -Werror -DCOMPILE_FINAL_CUT   -g -O2 -MT fscrollbar.lo -MD -MP -MF .deps/fscrollbar.Tpo -c -o fscrollbar.lo fscrollbar.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../include -Wall -Werror -DCOMPILE_FINAL_CUT -g -O2 -MT fscrollbar.lo -MD -MP -MF .deps/fscrollbar.Tpo -c fscrollbar.cpp  -fPIC -DPIC -o .libs/fscrollbar.o
In file included from ../include/final/fkeyboard.h:42,
                 from ../include/final/fterm.h:140,
                 from ../include/final/fvterm.h:57,
                 from ../include/final/fwidget.h:100,
                 from ../include/final/fscrollbar.h:55,
                 from fscrollbar.cpp:25:
../include/final/ftermlinux.h: In static member function 'static int FTermLinux::getFramebufferBpp()':
../include/final/ftermlinux.h:197:10: error: 'framebuffer_bpp' was not declared in this scope
 { return framebuffer_bpp; }
          ^~~~~~~~~~~~~~~
../include/final/ftermlinux.h:197:10: note: suggested alternative: 'getFramebuffer_bpp'
 { return framebuffer_bpp; }
          ^~~~~~~~~~~~~~~
          getFramebuffer_bpp

Compilation problems (minor)

I have two minor compilation problems with finalcut

  1. "fobject.h" includes "final/emptyfstring.h", but "emptyfstring.h" is not copied by default with "make install" command.
  2. In the source code "register" word is used, but:
    warning: ISO C++1z does not allow ‘register’ storage class specifier

cannot to compile finlacut

I have a problem with compilation on Fedora 28

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT   -g -O2 -MT foptimove.lo -MD -MP -MF .deps/foptimove.Tpo -c -o foptimove.lo foptimove.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT -g -O2 -MT foptimove.lo -MD -MP -MF .deps/foptimove.Tpo -c foptimove.cpp  -fPIC -DPIC -o .libs/foptimove.o
In member function ‘void finalcut::FOptiMove::rightMove(char*, int&, int, int)’,
    inlined from ‘int finalcut::FOptiMove::horizontalMove(char*, int, int)’ at foptimove.cpp:804:15,
    inlined from ‘int finalcut::FOptiMove::relativeMove(char*, int, int, int, int)’ at foptimove.cpp:687:28:
foptimove.cpp:819:18: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 512 equals destination size [-Werror=stringop-truncation]
     std::strncpy ( hmove
     ~~~~~~~~~~~~~^~~~~~~
                  , tparm(F_parm_right_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0)
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  , BUF_SIZE );
                  ~~~~~~~~~~~~
In member function ‘bool finalcut::FOptiMove::isMethod0Faster(int&, int, int)’,
    inlined from ‘char* finalcut::FOptiMove::moveCursor(int, int, int, int)’ at foptimove.cpp:524:23:
foptimove.cpp:941:18: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 512 equals destination size [-Werror=stringop-truncation]
     std::strncpy (move_ptr, move_xy, BUF_SIZE);
     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:694: foptimove.lo] Chyba 1
make[3]: Opouští se adresář „/home/pavel/src/finalcut/src“
make[2]: *** [Makefile:734: all-recursive] Chyba 1
make[2]: Opouští se adresář „/home/pavel/src/finalcut/src“
make[1]: *** [Makefile:493: all-recursive] Chyba 1
make[1]: Opouští se adresář „/home/pavel/src/finalcut“
make: *** [Makefile:379: all] Chyba 2

FListView Column Selection Feature

I have been playing with the FListView widget this morning and it looks extremely helpful for our particular use case where we have use case to print nested tabular data (similar to treeview example). Currently, I don't see a easy way to click on a column and possibly sort based on it's values; I see that FListView directly interacts with strings so it may not be able to sort numerical data but even if the library was able to provide a generic callback for clicked-column I should probably be able to handle it in client code; possible swap FListViewItem inplace without creating new objects; maybe something like
std::sort(itemlist.begin(), itemlist.end(), sort_fn); would probably need to additionally do a static_cast<FListViewItem*>() and then possible lookup client data based on 1st column to get new position.

bool sort_fn(FObject* a, FObject* b) {
  auto* x = static_cast<FListViewItem*>(a);
  auto* y = static_cast<FListViewItem*>(b);
  auto& name_x = x->getText(0);
  auto& name_y = x->getText(1);
  // Get saved data from client code which has correct data-types
  auto& x_struct = data_map[name_x];
  auto& y_struct = data_map[name_y];
  return x_struct.temperature < y_struct.temparature;
}

FListBoxItem: add a pointer to user data

I suggest to enhance a bit FListBoxItem class by passing a user provided data pointer to the constructor.

Change (I just picked up one of the three available constructors):
explicit FListBoxItem (const std::string&);
To
explicit FListBoxItem (const std::string&,const void *data=0);
Store 'data' attribute in FListBoxItem and provide access method to it.

The introduction of data will simplify the use of FListBox class. Consider the following example. There is a custom list std::vector<MyData> mydata;. A programmer wants a UI to select an item in the list and pass it to a function void myfunction(const MyData &data);. To achive this, the programmer has to:

  1. Create FListBox object
  2. Loop over mydata vector and create string presentations if every MyData item
  3. When user selects an item, the code will access FListBoxItem, which has (a) item "string" value and (b) item number
  4. One should look back to the original mydata vector (which means the programmer has to keep the container it in the UI code) to access the selected MyData object.

With the proposed modification, the step (4) will not be needed. Think about situations when the original container is not vector, but list or map. In this case "item number" is more-or-less useless, and extra code should be written to keep the items connection.

make returns with error

Trying to do make (as told by README).
@@ubuntu 20.04
Fails with this:

make[2]: Entering directory '/home/user/Desktop/finalcut/examples'
g++ -DHAVE_CONFIG_H -I. -I..  -I../src/include -Wall -Werror -std=c++11   -g -O2 -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o hello.cpp
mv -f .deps/hello.Tpo .deps/hello.Po
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -g -O2 -L../src/.libs -lfinal  -o hello hello.o  
libtool: link: g++ -g -O2 -o .libs/hello hello.o  -L../src/.libs /home/user/Desktop/finalcut/src/.libs/libfinal.so
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tgetnum'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tparm'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tgetent'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tgetstr'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tgoto'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tputs'
/usr/bin/ld: /home/user/Desktop/finalcut/src/.libs/libfinal.so: undefined reference to `tgetflag'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:584: hello] Error 1
make[2]: Leaving directory '/home/user/Desktop/finalcut/examples'
make[1]: *** [Makefile:494: all-recursive] Error 1
make[1]: Leaving directory '/home/user/Desktop/finalcut'
make: *** [Makefile:380: all] Error 2

Virtual Screen capture for use in web browser.

I am using the C++ based WebToolKit to build a web server. I would like to provide a virtual console within the solution.

Is there a mechanism for capturing FTermBuffer or FPutChar or similar to capture the results for remove viewing and interaction?

rpmlint warning

I'd like to submit finalcut to openSUSE for inclusion, but when building it on OBS I see this warning:

libfinal0.x86_64: W: shared-lib-calls-exit /usr/lib64/libfinal.so.0.5.0 exit@GLIBC_2.2.5
This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.

0.5.0 tumbleweed build failure

I get the following build failure for finalcut on openSUSE Tumbleweed:

[   61s] libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -f
unwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -Wall -Wextra -Wpedantic -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-prot
ector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -c fwidgetcolors.cpp  -fPIC -DPIC -o .libs/fwidgetco
lors.o
[   61s] In file included from /usr/include/string.h:494,
[   61s]                  from /usr/include/c++/9/cstring:42,
[   61s]                  from foptimove.cpp:23:
[   61s] In function 'char* strncpy(char*, const char*, size_t)',
[   61s]     inlined from 'void finalcut::FOptiMove::rightMove(char*, int&, int, int)' at foptimove.cpp:819:18,
[   61s]     inlined from 'int finalcut::FOptiMove::horizontalMove(char*, int, int)' at foptimove.cpp:804:15,
[   61s]     inlined from 'int finalcut::FOptiMove::relativeMove(char*, int, int, int, int)' at foptimove.cpp:687:28:
[   61s] /usr/include/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 512 equals destination size [-Werror=stringop-truncation]
[   61s]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[   61s]       |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   61s] /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -Wall -Wextra -Wpedantic  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -c -o fwidget.lo fwidget.cpp
[   61s] In function 'char* strncpy(char*, const char*, size_t)',
[   61s]     inlined from 'bool finalcut::FOptiMove::isMethod0Faster(int&, int, int)' at foptimove.cpp:941:18,
[   61s]     inlined from 'char* finalcut::FOptiMove::moveCursor(int, int, int, int)' at foptimove.cpp:524:23:
[   61s] /usr/include/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 512 equals destination size [-Werror=stringop-truncation]
[   61s]   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
[   61s]       |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   61s] cc1plus: all warnings being treated as errors

I assume some library/compiler/toolchain was updated on oS TW.

any way to remove window borders?

i'd like to remove the red lines
KG58jFm

didn't find this in the docs

if there isn't, i wonder why, because we can remove shadows no problem

Few Questions

  1. I am having a little difficulty trying to understand the memory-model; particularly with local / member variables. Say, I create 2 FDialog's diag1 & diag2 and 1 FLabel. Now, based on a click event I change the parent window of FLabel from diag1 to diag2 and vice-versa. My code looks something like this:
FLabel label;
FDialog diag1(fapp), diag2(fapp);
diag1.addChild(label);

// And in some callback I do
diag2.addChild(label);

All is expected to work fine till now. However, if I destruct diag1 or diag2 then it'll also try to destruct FLabel; at this point am I expected to see a memory corruption / seg-fault given that FLabel is on the stack and not heap. Overall, I am having a little difficult with the memory-model; should I always construct stuff on the heap or there a different way to think about the memory-model ?

  1. Small point but when I have multiple dialog windows; closing any of them creates a confirmation dialog that says do you want to quit the program but in the end it'll only close the window. If I always operate on multiple dialogs what's the correct way to either override this message so it says close window OR correct way to always make it close the complete app ?
    void onClose(FCloseEvent* ev) {
      FApplication::closeConfirmationDialog(this, ev);
    }
  1. Dynamic Widgets: I am trying to work with the scrollview.cpp example to make it resizable. I am able to get quite far but I want to understand the different functions a little better. The process I'm following based on the dynamic layout (size-adjustment.cpp) is as follows; is this correct ? I'm going to have a few different types of dialog boxes that will have a dynamic layout so I plan to follow the same convention for all of them ?
    # Override these 3 functions
    void setSize(const FSize& size, bool adjust) override;
    void adjustSize() override;
    void draw() override;

# This code is always fixed; just copy/paste it
void Scrollviewdemo::setSize(const FSize& size, bool adjust) {
  // Calling super class methods setSize() + adjustSize()
  FDialog::setSize (size, false);
  FDialog::adjustSize();
}

# Here, call the base class version and change the widget size if required
void Scrollviewdemo::adjustSize() {
  FDialog::adjustSize();
  // Change widget size (centerDialog())
}

# Here, adjustWidgets() and then call base class function
void Scrollviewdemo::draw() {
  adjustWidgets();
  // Calling super class method draw()
  FDialog::draw();
}
  1. I played around the scrollview.cpp (making it dynamic) and menu.cpp and merged the 2 examples. It is working fine in terms of functionality but when I exit the app it screws up the terminal; the cursor disappears and new line is skipped too. Please advise if you can spot the issue. Also, any general advise based on this code. Please see attached code.

my_test.txt

syntax error near unexpected token `CPPUNIT,'

When trying to install finalcut on Ubuntu Server 20.04, at the step ./configure --prefix=/usr I get this error:

configure: creating ./config.lt
config.lt: creating libtool
checking whether C++ compiler accepts -std=c++11... yes
checking for Gpm_Open in -lgpm... no
./configure: line 14053: syntax error near unexpected token `CPPUNIT,'
./configure: line 14053: `  PKG_CHECK_MODULES(CPPUNIT,'

I've installed libtool, autconf, autoconf-archive, gpm, libcppunit-dev, pkg-config, libglib2.0-dev, libtinfo-dev, libncurses5-dev, libgpm-dev.

libstdc++-6-dev isn't available for some reason.

Any idea what I'm missing?

std::cin problem

Hi , I wanted to make it possibly to redirect the output of a file to a "QuickForm" to simply edit some fields. but it is like cin does not close really well.

so for e.g. : cat test.data | ./quickform -> this shows the fields but when i type on the keyboard I see my input on the form which shouldn't unless a field is selected.

When I try it with a file the read it works fine
So ./quickform test.data
does work

here is my code :

#include <final/final.h>
#include <regex>
#include <string>
#include <fstream>
#include <iostream>

using namespace finalcut;

class QuickForm : public FDialog
{

	public:
		explicit QuickForm (FWidget* parent ,std::vector<std::string> data ) : FDialog(parent)
//		explicit QuickForm (FWidget* parent = nullptr) : FDialog(parent)
    		{
			//create quickform
			this->setText("QuickForm");
			this->setGeometry (FPoint(1, 1), FSize(50, 40));
			this->quit_btn.setGeometry (FPoint((this->getWidth()/2-5),(this->getHeight()-3)), FSize(10, 1));
			this->next_btn.setGeometry (FPoint((9),3), FSize(3, 1));
			this->prev_btn.setGeometry (FPoint((5),3), FSize(3, 1));
//			std::vector<std::string> data { "The Quick", "Brown Fox" };
			this->records_vctr = data;
			for (int i=0;i<data.size();i++)
				std::cerr<<data[i]<<i<<"object\n";		
			

			this->create_FLineEdits(this->tokenize_record(records_vctr[0]));
		}
	private:
		//Create Buttons
		FButton quit_btn{"&Quit", this};
		FButton prev_btn{fc::BlackLeftPointingTriangle, this};
		FButton next_btn{fc::BlackRightPointingTriangle, this};

		//Declare Vector to hold the fields
		std::vector<FLineEdit*> Fields_vctr;
		std::vector<std::string> records_vctr;
		
		std::vector<std::string>tokenize_record(std::string record)
		{
		  const std::regex delim_re("\\s+");
		  return std::vector<std::string> {std::sregex_token_iterator{record.begin(),record.end(),delim_re,-1},std::sregex_token_iterator{}};
		}

		void create_FLineEdits(std::vector<std::string> record)
			{
			    
 	for(int i=0;i< record.size();i++){
		FLineEdit* field  = new FLineEdit{record[i],this}; 
		field->setGeometry(FPoint(9,(i*3+20)),FSize(20,1));
		field->setLabelText(record[i]);
		field->redraw();
		this->Fields_vctr.push_back(field);
			}
	
	this->redraw();
	this->show();
	
	}
};

std::vector<std::string>readData(std::istream& in)
	{
		std::string line;
		std::vector<std::string>v {};
		while(std::getline(in,line))
			{
			 v.push_back(line);
			}
		return v;
	}
std::vector<std::string> processparameters(const int& argc, char** argv)
	{
	if( argc > 1)
		{
				std::ifstream ifile(argv[1]);
			if (ifile)
				{
				 return readData(ifile);
				}
			else 
				{
				//deal with file errors
				}
		}
	return readData(std::cin);
	
	}

int main (int argc, char* argv[])
{
	std::vector<std::string> v {};
	v = processparameters(argc,argv); for (int i=0;i<v.size();i++) std::cerr<<v[i]<<i<<"vector\n";
	argc = 0;
	argv = nullptr;
	std::cin.clear();
	fflush(stdin);
	FApplication app(argc, argv);
	QuickForm dialog(&app,v);
	app.setMainWidget(&dialog);
	dialog.show();
	return app.exec();
}


If you could point me in a direction would be nice.
Kind regards,
Wim

-fsanitize=undefined produces a bonanza of errors

Better yet, try -fsanitize=address,undefined I'd paste them here, but my terminal window freezes when executing my app.

EDIT: I now remember the reason why I didn't want to use tvision anymore was, that the sanitizer went ballistic with it too. It had memory leaks and undefined behavior.

Build fails on non-x86 architectures

It's a minor warning, but I thought you should know.

ftermlinux.cpp:121:6: error: unused parameter 'index' [-Werror=unused-parameter]
 bool FTermLinux::setPalette (FColor index, int r, int g, int b)
      ^
ftermlinux.cpp:121:6: error: unused parameter 'r' [-Werror=unused-parameter]
ftermlinux.cpp:121:6: error: unused parameter 'g' [-Werror=unused-parameter]
ftermlinux.cpp:121:6: error: unused parameter 'b' [-Werror=unused-parameter]
cc1plus: all warnings being treated as errors

Multiple Tab Support

Currently, I am running a very basic FApplication which has a number of FDialog's. However, I would like to build something that has multiple Tabs on the top and within each Tab a number of FDialog's. Please suggest a way to accomplish this.

Also, really appreciate the effort you have put in this library. I have found it useful for some of my use cases.

Cygwin conflicts with ACLOCAL_AMFLAGS

Hi! trying to generate Makefiles with Cywing, after use "autoreconf --install --force" I get the error:

error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-. m4

Change dialog border to empty space?

Similar to issue #48, I'm looking to change the box surrounding to an empty space (" ") character. Is there any "good" way to do this (e.g. remove the visual border, but keep its padding)?

mouse doesn't work

After today update from git the mouse is not initialized and is not active. Tested on Fedora Core 31.

opening bash and returning to app loses focus

I've been using this library for a while now and I'm really impressed with it.
I have and option in my ListView to open the bash from the app, when the user clicks the bash option the following function is called

void MainDialog::startBash() { system("cd; clear; reset; sudo bash"); }
now when when I type "exit" I lose focus and can't do any navigation.
is there a way to restore focus to the app after executing these commands ?.

building

Configuration was fine, but 'make' returns:
....../finalcut/missing: line 81: aclocal-1.14: command not found
And my system does have aclocal-1.15

std::cout

Hi, it's me again.
Thanks again for resolving the std::cin problem.
But now I have the following problem
if I do : finalcutdemo > file.txt
I don't see my finalcut window appear.
if I close the stdout like with the stdinput I see my finalcut program. but I cannot get the output the be written to the file.txt. I should be able to reattach the stdoutput.
Or to make only the finalcut windows appear to tty.
Do you have an idea ?

kind regard,
Wim Stockman

"Bus error" on armhf Debian installed through Linux Deploy

Thank you very much for this cool collection of widgets. They do look much more awesome than the ancient libnewt. I successfully compiled libfinalcut and the examples in test directory. Everything runs perfectly in x86_64 linux environment.

However, on the armhf Debian on my tablet, the whole library as well as all examples compiled nicely but all the executable gave "cqBus error". I am wondering if there is anything in the source code restricted to x86_64/i386 archs.

Maybe it is too greedy to ask for ARM support at the moment. :)

CMake integration

Hello dear team,
I am trying to integrate this project into an existing CMake based project.
Before I spend more time on this, is there an existing migration that someone did?

Many thanks.

fatal error: final/ftermdata.h: No such file or directory

I have compiled and installed finalcut as told in the documentation.
But after I wrote this line #include <final/final.h>

My compiler gave me this error

In file included from /usr/include/final/ftermlinux.h:56:0,
                 from /usr/include/final/fkeyboard.h:42,
                 from /usr/include/final/fterm.h:120,
                 from /usr/include/final/fvterm.h:60,
                 from /usr/include/final/fwidget.h:100,
                 from /usr/include/final/fapplication.h:69,
                 from /usr/include/final/final.h:30,
                 from /media/ssd/programs/opensource/Simple-Arch-Linux-Installer/app/App.h:8,
                 from /media/ssd/programs/opensource/Simple-Arch-Linux-Installer/app/App.cpp:5:
/usr/include/final/ftermdetection.h:46:29: fatal error: final/ftermdata.h: No such file or directory
 #include "final/ftermdata.h"

This simple command fixes it, but anyway it seems to be an issue.
sudo cp ./src/include/final/ftermdata.h /usr/include/final/

Bus error in "windows" example.

Here are my actions:

  • git clone
  • compile code (make)
  • go to 'examples' directory
  • run ./windows (or .libs/windows)
  • in the 'windows' application I click "Create", "Quit", "Yes" (to confirm the quit)

On the program exit I receive "Bus error".

finalcut version: from the repository, last commit 64a8041, Fri Nov 3 05:04:27

Users feedback, discussion

Markus Gans, I am really impressed of the work you have done! In comparision with dialog/newt-snack/ncurses/npyscreen it is like a breath of fresh air. Congratulations and please continue.

I think your library will get more attention if there is a place where users (like me) can ask questions, ask for advices, etc. What shall it be? A mail list? A web forum? Probably the easiest solution (it does not require anything to setup) is to use Stackoverflow with [final-cut] tag?!

Compile error on Mac OS X

Thank @gansm for this cool console widget library!

I am trying to compile on Mac OS X, and get the following errors possibly due to the missing of gpm library on Mac. Is there any way to fix quickly? Otherwise, is there any plan for support macOS?

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
Making all in fonts
make[3]: Nothing to be done for `all'.
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -Wall -Werror   -g -O2 -MT fscrollbar.lo -MD -MP -MF .deps/fscrollbar.Tpo -c -o fscrollbar.lo fscrollbar.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Wall -Werror -g -O2 -MT fscrollbar.lo -MD -MP -MF .deps/fscrollbar.Tpo -c fscrollbar.cpp  -fno-common -DPIC -o .libs/fscrollbar.o
In file included from fscrollbar.cpp:4:
In file included from ./fscrollbar.h:31:
In file included from ./fwidget.h:74:
In file included from ./fvterm.h:29:
./fterm.h:33:12: fatal error: 'gpm.h' file not found
  #include <gpm.h>
           ^
1 error generated.
make[3]: *** [fscrollbar.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Can't compile under Ubuntu

I tried to compile under Ubuntu 18.04 following the installation instructions, but it failed when running autoreconf

libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:81: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

It failed while checking for c++11 capability

ui demo - cpu 100% in withou any user action

Hi

when I run ui demo, then one CPU is used on 100%

15,90% [kernel] [k] prepare_exit_to_usermode
10,46% [kernel] [k] entry_SYSCALL_64
10,08% [kernel] [k] syscall_return_via_sysret
5,84% [kernel] [k] mwait_idle_with_hints.constprop.0
2,45% [kernel] [k] do_syscall_64
1,92% [kernel] [k] __fget_light
1,83% [kernel] [k] do_select
1,67% [kernel] [k] core_sys_select
1,62% [kernel] [k] n_tty_poll
1,62% libfinal.so.0.6.1 [.] finalcut::FVTerm::updateVTerm
1,50% libfinal.so.0.6.1 [.] finalcut::FKeyboard::isKeyPressed
1,30% [kernel] [k] tty_poll
1,29% [kernel] [k] selinux_file_ioctl
1,17% [kernel] [k] tty_ioctl
1,14% [kernel] [k] entry_SYSCALL_64_after_hwframe
1,13% libfinal.so.0.6.1 [.] finalcut::FTerm::detectTermSize

Qt supports -fno-rtti, but finalcut does not

gcc.compile.c++ .build/finalcut/gcc-8.2.1/debug/inlining-on/link-static/threading-multi/finalcut/src/fmenuitem.o
finalcut/finalcut/src/fmenuitem.cpp: In destructor 'virtual finalcut::FMenuItem::~FMenuItem()':
finalcut/finalcut/src/fmenuitem.cpp:104:63: error: 'dynamic_cast' not permitted with -fno-rtti
     FMenuList* menu_list = dynamic_cast<FMenuList*>(super_menu);
                                                               ^
finalcut/finalcut/src/fmenuitem.cpp: In member function 'virtual bool finalcut::FMenuItem::setFocus(bool)':
finalcut/finalcut/src/fmenuitem.cpp:153:71: error: 'dynamic_cast' not permitted with -fno-rtti
         FMenuList* menu_list = dynamic_cast<FMenuList*>(getSuperMenu());
                                                                       ^
finalcut/finalcut/src/fmenuitem.cpp: In member function 'void finalcut::FMenuItem::init(finalcut::FWidget*)':
finalcut/finalcut/src/fmenuitem.cpp:582:46: error: 'dynamic_cast' not permitted with -fno-rtti
   menu_list = dynamic_cast<FMenuList*>(parent);
                                              ^

Display corruption?

Button shadows display weird in Konsole, Alacritty and several other terminal emulators. Alacritty simply displays squares for all of the UI characters.
image

FMessageBox crashes with strings length longer than terminal window.

Consider the following code. It works fine with short (less than terminal window width) strings, and crashes with long.

#include "final.h"

int main (int argc, char* argv[])
{
    if( argc!=2 )
        return 1;
    FApplication app(argc,argv);
    FMessageBox info ( "Greeting",argv[1], FMessageBox::Ok, 0, 0, &app );
    info.show();
    return 0;
}

term attributes on Windows with Cygwin

It's Windows' terminal capable tu use some of the xterm-256color features?
I ran term-attributes.exe but the next features don't seems to works:

  • Double underline
  • Crossed-out
  • Blink
  • Invisible
  • Protected

2020-05-05 00_48_02-D__Development_finalcut_examples_term-attributes exe

g++ not finding -lfinal?

I've successfully compiled and installed finalcut:

$ ls /usr/lib/libfinal*
/usr/lib/libfinal.a  /usr/lib/libfinal.la  /usr/lib/libfinal.so  /usr/lib/libfinal.so.0  /usr/lib/libfinal.so.0.6.1
$ sudo /sbin/ldconfig -p | grep final
	libfinal.so.0 (libc6,x86-64) => /lib/libfinal.so.0
	libfinal.so (libc6,x86-64) => /lib/libfinal.so

but when I compile the dialog.cpp example I get this:

$ g++ -O2 -lfinal ./dialog.cpp -o dialog
/usr/bin/ld: /tmp/cc8O8bbS.o: in function `main':
dialog.cpp:(.text.startup+0x84): undefined reference to `finalcut::FApplication::FApplication(int const&, char**)'
/usr/bin/ld: dialog.cpp:(.text.startup+0x8f): undefined reference to `finalcut::FDialog::FDialog(finalcut::FWidget*)'
/usr/bin/ld: dialog.cpp:(.text.startup+0xa3): undefined reference to `finalcut::FString::FString(char const*)'
/usr/bin/ld: dialog.cpp:(.text.startup+0xb3): undefined reference to `finalcut::FString::setString(finalcut::FString const&)'
/usr/bin/ld: dialog.cpp:(.text.startup+0xc0): undefined reference to `finalcut::FString::~FString()'
/usr/bin/ld: dialog.cpp:(.text.startup+0xd2): undefined reference to `vtable for finalcut::FPoint'
/usr/bin/ld: dialog.cpp:(.text.startup+0xf9): undefined reference to `vtable for finalcut::FSize'
/usr/bin/ld: dialog.cpp:(.text.startup+0x10c): undefined reference to `finalcut::FWindow::setGeometry(finalcut::FPoint const&, finalcut::FSize const&, bool)'
/usr/bin/ld: dialog.cpp:(.text.startup+0x114): undefined reference to `finalcut::FWidget::setMainWidget(finalcut::FWidget*)'
/usr/bin/ld: dialog.cpp:(.text.startup+0x11c): undefined reference to `finalcut::FDialog::show()'
/usr/bin/ld: dialog.cpp:(.text.startup+0x124): undefined reference to `finalcut::FApplication::exec()'
/usr/bin/ld: dialog.cpp:(.text.startup+0x12f): undefined reference to `finalcut::FSize::~FSize()'
/usr/bin/ld: dialog.cpp:(.text.startup+0x137): undefined reference to `finalcut::FPoint::~FPoint()'
/usr/bin/ld: dialog.cpp:(.text.startup+0x13f): undefined reference to `finalcut::FDialog::~FDialog()'
/usr/bin/ld: dialog.cpp:(.text.startup+0x147): undefined reference to `finalcut::FApplication::~FApplication()'
/usr/bin/ld: /tmp/cc8O8bbS.o: in function `main.cold':
dialog.cpp:(.text.unlikely+0x4): undefined reference to `finalcut::FSize::~FSize()'
/usr/bin/ld: dialog.cpp:(.text.unlikely+0xc): undefined reference to `finalcut::FPoint::~FPoint()'
/usr/bin/ld: dialog.cpp:(.text.unlikely+0x17): undefined reference to `finalcut::FDialog::~FDialog()'
/usr/bin/ld: dialog.cpp:(.text.unlikely+0x1f): undefined reference to `finalcut::FApplication::~FApplication()'
/usr/bin/ld: dialog.cpp:(.text.unlikely+0x2f): undefined reference to `finalcut::FString::~FString()'

FLabel Text Wrapping, Not Obeying Max Size Hint

Hello, was experimenting with finalcut (already a huge fan, absolutely brilliant work) and found setMaximumWidth , setMaximumSize, etc. don't see to be obeyed when updating a label's text dynamically. Here's a minimal reproduction case for my scenario below.

The output looks something like the screenshot attached, with dots wrapping line after line.
If you uncomment the commented two lines, I noticed it would enforce the minimum size as the maximum, and only 5 dots were displayed. Also to note, if I use FLabel::setGeometry or setSize, the maximum size is enforced, and no wrapping occurs.

Perhaps I am not using FLabel the way it was intended, but as a newcomer it seems like this is probably not intended and maximum hints should be enforced. Or maybe I made a simple mistake?

Thanks!

labelbugreport

#include <iostream>

#include <final/final.h>

namespace fc = finalcut;

class HelloDialog : public fc::FDialog
{
	fc::FLabel labelDim{this};

public:
	HelloDialog(fc::FWidget& widget)
		: FDialog(&widget)
	{
		setText("Hello Finalcut - Size Issue");
		setPos(fc::FPoint(10, 1));
		setSize(fc::FSize(50,25));

		//labelDim.setMinimumSize({5,1});
		labelDim.setMaximumSize(30, 1);
		labelDim.setMaximumHeight({30,1});

		addTimer(100);
	}

	void onTimer (fc::FTimerEvent *ev) override
	{
		labelDim.getText() << ".";

		//adjustSize();

		redraw();
	}
};

int main(int argc, char **argv)
{
	fc::FApplication app{argc, argv};
	HelloDialog dialog{app};
	dialog.show();

	app.setMainWidget(&dialog);

	return app.exec();
}

#include cpp file

I want to compile this with my application... how do I do that? I can't include the CPP files, nor can I act like final.h (define USE_FINAL_H, symlink src/include/final to src/final and include the C++ files in the same order)...

segfault in "ui" example

After I opened file "fstab", then any action in related windows is finished by segfault.

Program received signal SIGSEGV, Segmentation fault.
0x00007f0ad67fba34 in __wcslen_sse2 () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f0ad67fba34 in __wcslen_sse2 () from /lib64/libc.so.6
#1  0x00007f0ad6d05e1d in finalcut::FString::_assign (s=0x7200000065 , 
    this=0x7ffd47b5a810) at fstring.cpp:1425
#2  finalcut::FString::FString (this=0x7ffd47b5a810, s=0x7200000065 )
    at fstring.cpp:83
#3  0x00007f0ad6d081c7 in finalcut::FString::mid (this=0x528cc0, pos=1, len=58) at fstring.cpp:846
#4  0x00007f0ad6d40849 in finalcut::FTextView::drawText (this=0x5420a5) at /usr/include/c++/8/bits/stl_vector.h:930
#5  0x00007f0ad6d40a77 in finalcut::FTextView::scrollTo (this=this@entry=0x5420a5, x=0, y=) at ftextview.cpp:182
#6  0x00007f0ad6d40b41 in finalcut::FTextView::scrollBy (this=this@entry=0x5420a5, dx=dx@entry=0, dy=dy@entry=4) at ftextview.cpp:134
#7  0x00007f0ad6d40e95 in finalcut::FTextView::onWheel (this=0x5420a5, ev=) at ftextview.cpp:514
#8  0x00007f0ad6d629e4 in finalcut::FWidget::event (this=0x5420a5, ev=0x7ffd47b5a9a0) at fwidget.cpp:1744
#9  0x00007f0ad6d5e06c in finalcut::FApplication::sendWheelEvent (this=, widgetMousePos=..., mouse_position=...)
    at fapplication.cpp:1120
#10 0x00007f0ad6d5e1ac in finalcut::FApplication::sendMouseEvent (this=0x7ffd47b5abb0) at fapplication.cpp:934
#11 0x00007f0ad6d5e218 in finalcut::FApplication::processMouseEvent (this=0x7ffd47b5abb0) at fapplication.cpp:1134
#12 finalcut::FApplication::processMouseEvent (this=0x7ffd47b5abb0) at fapplication.cpp:1125
#13 0x00007f0ad6d5e42b in finalcut::FApplication::performKeyboardAction (this=0x7ffd47b5abb0) at fapplication.cpp:569
#14 finalcut::FApplication::keyPressed (this=0x7ffd47b5abb0) at fapplication.cpp:529
#15 0x00007f0ad6d2e96d in finalcut::FKeyboard::parseKeyBuffer (this=0x4c0f00) at fkeyboard.cpp:441
#16 0x00007f0ad6d2ea55 in finalcut::FKeyboard::fetchKeyCode (this=) at fkeyboard.cpp:88
#17 0x00007f0ad6d5d465 in finalcut::FApplication::processKeyboardEvent (this=) at fapplication.cpp:668
#18 finalcut::FApplication::processKeyboardEvent (this=) at fapplication.cpp:658
#19 0x00007f0ad6d5e979 in finalcut::FApplication::processNextEvent (this=this@entry=0x7ffd47b5abb0) at fapplication.cpp:1179
#20 0x00007f0ad6d5e9f9 in finalcut::FApplication::enter_loop (this=0x7ffd47b5abb0) at fapplication.cpp:134
#21 0x00007f0ad6d5ea4b in finalcut::FApplication::exec (this=this@entry=0x7ffd47b5abb0) at fapplication.cpp:119
#22 0x0000000000407dc2 in main (argc=, argv=0x7ffd47b639b8) at ui.cpp:1036
(gdb) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.