renamed project to NCurses
This commit is contained in:
parent
2601d78453
commit
f8db9dc660
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
|
@ -5,10 +5,10 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "(gdb) start NCursesPtyApp",
|
||||
"name": "(gdb) start NCursesDemoApp",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/NCursesPtyApp",
|
||||
"program": "${workspaceFolder}/build/NCursesDemoApp",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
|
@ -29,10 +29,10 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"name": "(gdb) attach to running NCursesPtyApp",
|
||||
"name": "(gdb) attach to running NCursesDemoApp",
|
||||
"type": "cppdbg",
|
||||
"request": "attach",
|
||||
"program": "${workspaceFolder}/build/NCursesPtyApp",
|
||||
"program": "${workspaceFolder}/build/NCursesDemoApp",
|
||||
"processId": "${command:pickProcess}",
|
||||
"MIMode": "gdb",
|
||||
"setupCommands": [
|
||||
|
|
8
App.cpp
8
App.cpp
|
@ -4,21 +4,21 @@
|
|||
|
||||
#include "App.hpp"
|
||||
#include "Debug.hpp"
|
||||
#include <NCursesPtyWindow/PtyWindow.hpp>
|
||||
#include <NCurses/PtyWindow.hpp>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <utmp.h>
|
||||
#include <cstdlib>
|
||||
#include <mutex>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
App::App() : NCursesApplication(false)
|
||||
DemoApp::DemoApp() : NCursesApplication(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int App::run()
|
||||
int DemoApp::run()
|
||||
{
|
||||
std::mutex writeMutex;
|
||||
|
||||
|
|
6
App.hpp
6
App.hpp
|
@ -8,12 +8,12 @@
|
|||
|
||||
#include <cursesapp.h>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
class App : public NCursesApplication
|
||||
class DemoApp : public NCursesApplication
|
||||
{
|
||||
public:
|
||||
App();
|
||||
DemoApp();
|
||||
|
||||
private:
|
||||
int run() override;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
cmake_minimum_required(VERSION 3.16.3)
|
||||
|
||||
include("cmake/version.cmake")
|
||||
project(NCursesPtyWindow
|
||||
project(NCurses
|
||||
HOMEPAGE_URL "https://gitea.xndr.de/christian/NCursesPtyWindow"
|
||||
VERSION ${SEMANTIC_VERSION})
|
||||
|
||||
|
@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 17)
|
|||
include(CTest)
|
||||
enable_testing()
|
||||
|
||||
add_library(NCursesPtyWindow Window.cpp PtyWindow.cpp SingleUserInput.cpp Debug.cpp)
|
||||
add_library(NCurses Window.cpp PtyWindow.cpp SingleUserInput.cpp Debug.cpp)
|
||||
|
||||
### path to own system includes
|
||||
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
|
||||
|
@ -21,34 +21,34 @@ include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
|
|||
### libraries
|
||||
|
||||
include("cmake/ncurses.cmake")
|
||||
target_link_libraries(NCursesPtyWindow ${CURSES_LIBRARIES})
|
||||
target_link_libraries(NCurses ${CURSES_LIBRARIES})
|
||||
|
||||
include("cmake/gsl.cmake")
|
||||
|
||||
include("cmake/libvterm.cmake")
|
||||
if(EXISTS libvtermProject)
|
||||
add_dependencies(NCursesPtyWindow libvtermProject)
|
||||
add_dependencies(NCurses libvtermProject)
|
||||
endif()
|
||||
target_link_libraries(NCursesPtyWindow ${LIBVTERM_LIBRARY})
|
||||
target_link_libraries(NCurses ${LIBVTERM_LIBRARY})
|
||||
|
||||
find_library(UTIL_LIBRARY util)
|
||||
target_link_libraries(NCursesPtyWindow ${UTIL_LIBRARY})
|
||||
target_link_libraries(NCurses ${UTIL_LIBRARY})
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG true)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(NCursesPtyWindow Threads::Threads)
|
||||
target_link_libraries(NCurses Threads::Threads)
|
||||
|
||||
### demo application
|
||||
add_executable(NCursesPtyApp main.cpp App.cpp)
|
||||
target_link_libraries(NCursesPtyApp NCursesPtyWindow)
|
||||
add_executable(NCursesDemoApp main.cpp App.cpp)
|
||||
target_link_libraries(NCursesDemoApp NCurses)
|
||||
|
||||
### installation and packaging
|
||||
set(NCURSES_PTY_WINDOW_SYSTEM_INCLUDE "include/NCursesPtyWindow")
|
||||
set_target_properties(NCursesPtyWindow PROPERTIES PUBLIC_HEADER "${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/Window.hpp;${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/SingleUserInput.hpp;${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/PtyWindow.hpp"
|
||||
set(NCURSES_SYSTEM_INCLUDE "include/NCurses")
|
||||
set_target_properties(NCurses PROPERTIES PUBLIC_HEADER "${NCURSES_SYSTEM_INCLUDE}/Window.hpp;${NCURSES_SYSTEM_INCLUDE}/SingleUserInput.hpp;${NCURSES_SYSTEM_INCLUDE}/PtyWindow.hpp"
|
||||
VERSION "${CMAKE_PROJECT_VERSION}")
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS NCursesPtyWindow ARCHIVE
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCursesPtyWindow/")
|
||||
install(TARGETS NCurses ARCHIVE
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCurses/")
|
||||
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @author Christian Burger (christian@krikkel.de)
|
||||
*/
|
||||
|
||||
#include <NCursesPtyWindow/PtyWindow.hpp>
|
||||
#include <NCurses/PtyWindow.hpp>
|
||||
#include "Debug.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
@ -13,7 +13,7 @@
|
|||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
using gsl::narrow;
|
||||
using std::lock_guard;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @author Christian Burger (christian@krikkel.de)
|
||||
*/
|
||||
|
||||
#include <NCursesPtyWindow/SingleUserInput.hpp>
|
||||
#include <NCurses/SingleUserInput.hpp>
|
||||
#include "Debug.hpp"
|
||||
|
||||
#include <vterm.h>
|
||||
|
@ -13,7 +13,7 @@
|
|||
#define KEY_ALT_BACKSPACE 127
|
||||
#define KEY_ALT_ALT_BACKSPACE '\b'
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
SingleUserInput::SingleUserInput(int _resultGetWchCall, wint_t _input)
|
||||
: input(_input), resultGetWchCall(_resultGetWchCall)
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* @author Christian Burger (christian@krikkel.de)
|
||||
*/
|
||||
|
||||
#include <NCursesPtyWindow/Window.hpp>
|
||||
#include <NCurses/Window.hpp>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
Window::Window(int lines, int columns, int y, int x)
|
||||
: NCursesWindow(lines, columns, y, x)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
class PtyWindow : public Window
|
||||
{
|
|
@ -9,7 +9,7 @@
|
|||
#include <cursesw.h>
|
||||
#include <vterm_keycodes.h>
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
class SingleUserInput
|
||||
{
|
|
@ -34,7 +34,7 @@ inline int UNDEF(get_wch)(wint_t *character) { get_wch(character); }
|
|||
#define get_wch UNDEF(get_wch)
|
||||
#endif
|
||||
|
||||
namespace krikkel::NCursesPtyWindow
|
||||
namespace krikkel::NCurses
|
||||
{
|
||||
class Window : public NCursesWindow
|
||||
{
|
Loading…
Reference in a new issue