renamed project to `NCurses`

master
Christian Burger 2022-04-29 20:25:47 +02:00
parent 2601d78453
commit f8db9dc660
11 changed files with 34 additions and 34 deletions

8
.vscode/launch.json vendored
View File

@ -5,10 +5,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "(gdb) start NCursesPtyApp", "name": "(gdb) start NCursesDemoApp",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/build/NCursesPtyApp", "program": "${workspaceFolder}/build/NCursesDemoApp",
"args": [], "args": [],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
@ -29,10 +29,10 @@
] ]
}, },
{ {
"name": "(gdb) attach to running NCursesPtyApp", "name": "(gdb) attach to running NCursesDemoApp",
"type": "cppdbg", "type": "cppdbg",
"request": "attach", "request": "attach",
"program": "${workspaceFolder}/build/NCursesPtyApp", "program": "${workspaceFolder}/build/NCursesDemoApp",
"processId": "${command:pickProcess}", "processId": "${command:pickProcess}",
"MIMode": "gdb", "MIMode": "gdb",
"setupCommands": [ "setupCommands": [

View File

@ -4,21 +4,21 @@
#include "App.hpp" #include "App.hpp"
#include "Debug.hpp" #include "Debug.hpp"
#include <NCursesPtyWindow/PtyWindow.hpp> #include <NCurses/PtyWindow.hpp>
#include <unistd.h> #include <unistd.h>
#include <utmp.h> #include <utmp.h>
#include <cstdlib> #include <cstdlib>
#include <mutex> #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; std::mutex writeMutex;

View File

@ -8,12 +8,12 @@
#include <cursesapp.h> #include <cursesapp.h>
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
class App : public NCursesApplication class DemoApp : public NCursesApplication
{ {
public: public:
App(); DemoApp();
private: private:
int run() override; int run() override;

View File

@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.16.3) cmake_minimum_required(VERSION 3.16.3)
include("cmake/version.cmake") include("cmake/version.cmake")
project(NCursesPtyWindow project(NCurses
HOMEPAGE_URL "https://gitea.xndr.de/christian/NCursesPtyWindow" HOMEPAGE_URL "https://gitea.xndr.de/christian/NCursesPtyWindow"
VERSION ${SEMANTIC_VERSION}) VERSION ${SEMANTIC_VERSION})
@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 17)
include(CTest) include(CTest)
enable_testing() 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 ### path to own system includes
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include") include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
@ -21,34 +21,34 @@ include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
### libraries ### libraries
include("cmake/ncurses.cmake") include("cmake/ncurses.cmake")
target_link_libraries(NCursesPtyWindow ${CURSES_LIBRARIES}) target_link_libraries(NCurses ${CURSES_LIBRARIES})
include("cmake/gsl.cmake") include("cmake/gsl.cmake")
include("cmake/libvterm.cmake") include("cmake/libvterm.cmake")
if(EXISTS libvtermProject) if(EXISTS libvtermProject)
add_dependencies(NCursesPtyWindow libvtermProject) add_dependencies(NCurses libvtermProject)
endif() endif()
target_link_libraries(NCursesPtyWindow ${LIBVTERM_LIBRARY}) target_link_libraries(NCurses ${LIBVTERM_LIBRARY})
find_library(UTIL_LIBRARY util) find_library(UTIL_LIBRARY util)
target_link_libraries(NCursesPtyWindow ${UTIL_LIBRARY}) target_link_libraries(NCurses ${UTIL_LIBRARY})
set(THREADS_PREFER_PTHREAD_FLAG true) set(THREADS_PREFER_PTHREAD_FLAG true)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(NCursesPtyWindow Threads::Threads) target_link_libraries(NCurses Threads::Threads)
### demo application ### demo application
add_executable(NCursesPtyApp main.cpp App.cpp) add_executable(NCursesDemoApp main.cpp App.cpp)
target_link_libraries(NCursesPtyApp NCursesPtyWindow) target_link_libraries(NCursesDemoApp NCurses)
### installation and packaging ### installation and packaging
set(NCURSES_PTY_WINDOW_SYSTEM_INCLUDE "include/NCursesPtyWindow") set(NCURSES_SYSTEM_INCLUDE "include/NCurses")
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_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}") VERSION "${CMAKE_PROJECT_VERSION}")
include(GNUInstallDirs) include(GNUInstallDirs)
install(TARGETS NCursesPtyWindow ARCHIVE install(TARGETS NCurses ARCHIVE
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCursesPtyWindow/") PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCurses/")
set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

View File

@ -2,7 +2,7 @@
* @author Christian Burger (christian@krikkel.de) * @author Christian Burger (christian@krikkel.de)
*/ */
#include <NCursesPtyWindow/PtyWindow.hpp> #include <NCurses/PtyWindow.hpp>
#include "Debug.hpp" #include "Debug.hpp"
#include <cstdio> #include <cstdio>
@ -13,7 +13,7 @@
#include <termios.h> #include <termios.h>
#include <fcntl.h> #include <fcntl.h>
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
using gsl::narrow; using gsl::narrow;
using std::lock_guard; using std::lock_guard;

View File

@ -2,7 +2,7 @@
* @author Christian Burger (christian@krikkel.de) * @author Christian Burger (christian@krikkel.de)
*/ */
#include <NCursesPtyWindow/SingleUserInput.hpp> #include <NCurses/SingleUserInput.hpp>
#include "Debug.hpp" #include "Debug.hpp"
#include <vterm.h> #include <vterm.h>
@ -13,7 +13,7 @@
#define KEY_ALT_BACKSPACE 127 #define KEY_ALT_BACKSPACE 127
#define KEY_ALT_ALT_BACKSPACE '\b' #define KEY_ALT_ALT_BACKSPACE '\b'
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
SingleUserInput::SingleUserInput(int _resultGetWchCall, wint_t _input) SingleUserInput::SingleUserInput(int _resultGetWchCall, wint_t _input)
: input(_input), resultGetWchCall(_resultGetWchCall) : input(_input), resultGetWchCall(_resultGetWchCall)

View File

@ -2,9 +2,9 @@
* @author Christian Burger (christian@krikkel.de) * @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) Window::Window(int lines, int columns, int y, int x)
: NCursesWindow(lines, columns, y, x) : NCursesWindow(lines, columns, y, x)

View File

@ -16,7 +16,7 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
class PtyWindow : public Window class PtyWindow : public Window
{ {

View File

@ -9,7 +9,7 @@
#include <cursesw.h> #include <cursesw.h>
#include <vterm_keycodes.h> #include <vterm_keycodes.h>
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
class SingleUserInput class SingleUserInput
{ {

View File

@ -34,7 +34,7 @@ inline int UNDEF(get_wch)(wint_t *character) { get_wch(character); }
#define get_wch UNDEF(get_wch) #define get_wch UNDEF(get_wch)
#endif #endif
namespace krikkel::NCursesPtyWindow namespace krikkel::NCurses
{ {
class Window : public NCursesWindow class Window : public NCursesWindow
{ {

View File

@ -6,4 +6,4 @@
#include "App.hpp" #include "App.hpp"
krikkel::NCursesPtyWindow::App cursesPtyApp; krikkel::NCurses::DemoApp demoApp;