Commit Graph

55 Commits (master)

Author SHA1 Message Date
Christian Burger 8784bb2ce3 distributed files to `src/` directory 2022-05-28 13:19:16 +02:00
Christian Burger 01b90fe0ef closes #17: own headers are not system headers
This was stupid as it prevented the compiler from doing code analysis
and discovering the bug leading to a segmentation fault when using
compiler optimization (see christian/shellipt#44).

Long overdue update of ``.
2022-05-28 12:39:03 +02:00
Christian Burger 6fe1a7c5fb forgot `returns` in macros
I think that might be the culprit for the segmentation fault in Nix
(see christian/shellipt#44). Chances are good, because the when I fixed
the problem, I bypassed those faulty macros.
2022-05-27 15:59:53 +02:00
Christian Burger c6218e9acc enabled compiler flags "-pedantic", "-Wall", …
… "-Werror" and "-Wextra". Corrected some issues resulting from the
2022-05-22 13:54:05 +02:00
Christian Burger 4b709c92fb fixing problem with packaging
Multiline strings are problematic in cmake.
2022-05-21 00:05:07 +02:00
Christian Burger ba378b2a43 window manager: inverting all windows' visibility
Introducing a method that makes all visible windows invisible and vice-
2022-05-20 20:41:45 +02:00
Christian Burger 870fa80fc7 getter for ncurses mutex
not sure if the best solution, but works for the moment
2022-05-19 14:45:50 +02:00
Christian Burger f48641bb58 cmake: changed project homepage URL 2022-05-18 23:30:04 +02:00
Christian Burger 3be5336ca0 refactoring tiling window manager
Laying out the windows in the window manager frame, is a very similar
process regardless of doing it horizontally or vertically. So the
template design pattern was applied and the general functionality was
pulled up; only specific functionalities were put into the corresponding

kNCursesDemoApp: Separated the screen into three windows vertically. The
top and bottom window contain another two windows each, lay out
horizontally. The top left window is fixed to width 1 and the top right
takes the rest of the space. Bottom two windows take 50 % of the space

Remarks: There are still some rendering bugs, when hiding and showing
windows. E. g. when hiding the top or middle window with `<F1>` or
`<F2>` respectively, the bottom window has some errors. Maybe some
timing issue.
2022-05-18 21:15:13 +02:00
Christian Burger 0a086ff604 horizontal window manager now resizes correctly
Window managers are now descendants of windows instead of owning the
window in which they exist. This makes a clean window hierarchy.
2022-05-08 22:52:23 +02:00
Christian Burger 9ddb769cb4 added `HorizontalWindowManager` to `DemoApp` 2022-05-08 21:37:06 +02:00
Christian Burger 4fb2e6a976 renamed `App.*` to `DemoApp.*` 2022-05-08 21:26:12 +02:00
Christian Burger 7e7372ee52 refactored `DemoApp`
Separated `run()` into `setUpWindows()` and
2022-05-08 21:24:40 +02:00
Christian Burger a801752620 added class `HorizontalTilingWindowManager`
Just some minor changes to
`VerticalTilingWindowManager`. Not part of the
demo, yet.
2022-05-08 21:12:06 +02:00
Christian Burger 792f12c96c created abstract class `TilingWindowManager`
`TilingWindowManager` was created from `VerticalTilingWindowManager` and
separated its functionality so that there can be a
`HorizontalTilingWindowManager` next.
2022-05-08 20:57:48 +02:00
Christian Burger 1357a7f6bf renamed to project to `kNCurses` 2022-05-06 22:42:09 +02:00
Christian Burger b723aa5f33 fixed crash when all windows were hidden 2022-05-06 22:15:34 +02:00
Christian Burger 320f5ba63a improved demo a bit, refactoring a bit 2022-05-06 22:05:57 +02:00
Christian Burger e42711f123 switched to `scoped_lock` 2022-05-06 18:37:48 +02:00
Christian Burger b9e32941fb hide and show windows in window manager
* switching to recursive mutexes for now; easier to implement
* need to read user input from the window manager; hidden windows are
drawn when reading input from there
* note: occasional dead lock between PTY and ncurses mutex
* fixed type in class `SingleUserInput`
2022-05-06 14:02:18 +02:00
Christian Burger 0462a68c54 added simple vertical tiling window manager 2022-05-03 11:23:32 +02:00
Christian Burger f8db9dc660 renamed project to `NCurses` 2022-05-01 22:51:17 +02:00
Christian Burger 2601d78453 cmake: missed to add `PtyWindow.hpp` to package 2022-05-01 22:37:49 +02:00
Christian Burger 02266dfb0c fixed bug: deadlock when resizing PTY window 2022-04-29 16:36:07 +02:00
Christian Burger 78672521c4 corrected return values for `UNDEF` macros 2022-04-28 12:48:38 +02:00
Christian Burger a300dd492b added ncurses `addnwstr()` to window 2022-04-26 20:53:14 +02:00
Christian Burger ed534363a2 method to insert wide character in ncurses window 2022-04-26 15:13:25 +02:00
Christian Burger 3af1284cf8 refactoring: wide character methods to `Window` 2022-04-25 15:55:39 +02:00
Christian Burger 746e458cd2 renamed `Window` to `PtyWindow`
Making space for a more general base window class with support for wide
2022-04-25 11:10:07 +02:00
Christian Burger ae6130f095 cmake: some improvements
* not depending on "-dev" packages for the built Debian package
* some refactoring in if-clauses and with "quotes"
* libvterm dependency: if something is missing, made clear what
2022-04-23 22:24:08 +02:00
Christian Burger f994cb2261 moved library system headers to separate folder
Gave the library a version in case it is build statically.
2022-04-23 20:27:55 +02:00
Christian Burger 2d7dda88c5 cmake: determines version from latest Git tag
Some other changes to the CMake-files done as well:
* documentation looks more like Doxygen-style
* prevent mix-up with C++ GSL library ("Guidelines support library" not
"GNU scientific library")
2022-04-23 10:00:33 +02:00
Christian Burger bc76ae227c fixed homepage for Debian package 2022-04-21 12:36:18 +02:00
Christian Burger d3bdb305d0 fixes issue with wrong description in DEB package
* added homepage URL as well
2022-04-21 10:28:45 +02:00
Christian Burger 6ce6bcdace removed redundant include 2022-04-20 12:34:42 +01:00
Christian Burger 45beee33a8 minor cmake fix: ncurses header as system includes 2022-04-20 12:22:51 +01:00
Christian Burger 0a916fe01a made package (.deb and .tar.gz) 2022-04-18 22:59:36 +02:00
Christian Burger 8273da4ada improvements to debug output for syscalls 2022-04-18 22:53:25 +02:00
Christian Burger 33e05f058c well … forgot header guard 2022-04-17 10:28:19 +02:00
Christian Burger ab0525cc6f added mutex to lock concurrent writes to ncurses 2022-04-16 20:27:24 +02:00
Christian Burger aa36b3d22d minor fix 2022-04-14 09:37:37 +02:00
Christian Burger f1d0c012b7 fixing debug facility in when NDEBUG is set
- changed libvterm.cmake so it is easier to integrate in other projects
2022-04-14 09:31:19 +02:00
Christian Burger 4ca933a158 refactoring: closes #10 2022-04-13 19:41:41 +02:00
Christian Burger 8e71512f12 cmake: locate or build `libvterm` dependency
There is no version detection. If there is any vterm library, it is
used. If it is the wrong version, there will be an build error.
`` is preferred, which hopefully is compatible to
revision 740 or Ubuntu `libvterm0` version 0.1.2-2.

If no library is found, the correct one is downloaded and build.
2022-04-13 13:10:55 +02:00
Christian Burger ef07c3ac06 fixes #5, touches on #8
* using `get_wch()` now and mapping most of the function keys documented
in `vterm_keycodes.h` (not num keypad)
* there are still a lot of mappings from ncurses missing (in conjunction
with modifier keys, related issue #11)
* using mutex to make sure writing to terminal client is serialized
2022-04-13 10:46:44 +02:00
Christian Burger 34cebb1019 refactored some debug output 2022-04-09 08:49:44 +02:00
Christian Burger c7138f3df9 added static output handler (fixes #6)
added some extensive debug output — all the communication between pseudo
terminal's host and client
2022-04-08 21:35:49 +02:00
Christian Burger fd800dbca8 extended debug facilities for output
* Output strings with unprintable characters either as a table or as
continuing string of characters; the byte value of unprintable
characters (`isprint(<character>, <locale>) == false`) is shown.
* Output readable string of `key` -> `value` pairs with an enumerated
type for the key and union type for the value.
2022-04-08 21:34:54 +02:00
Christian Burger d01917c82d increased PTY client output buffer size
Corrected error checking for reading output from the client while at it.
2022-04-07 14:28:35 +02:00
Christian Burger 69d750b6ed fixing return key
When pressing return in `nano` the terminal received an `<CTRL>+J` instead of
the return key. `<CTRL>+J` justifies the text. But is (confusingly) actually
the key for a line feed as well? Terminal programming is not easy …
2022-04-07 09:01:05 +02:00