mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
* CMake: add USE_PANDOC, USE_DOXYGEN options #101 * README: mention rust * start integrating rust into build #101 * CMake: add USE_NETWORK option for cargo * Debian: build-dep on doxygen * rust: colloquy checks in Cargo.lock * extract NCKEY defines into their own include * colloquy: use clap to parse CLI args * CMake: unify option namespace * Python: update include path * Rust: fix up --frozen workings for -DUSE_NETWORK=off * CMake: abstract out colloquy a little * Sync direct.hh to the New Way
This commit is contained in:
parent
e429724287
commit
e6637e81cc
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,5 +6,6 @@ python/dist/
|
||||
python/src/notcurses.egg-info/
|
||||
python/src/_notcurses.so
|
||||
rust/*/target
|
||||
src/colloquy/target/
|
||||
*.pyc
|
||||
*.so
|
||||
|
158
CMakeLists.txt
158
CMakeLists.txt
@ -12,21 +12,27 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
include(GNUInstallDirs)
|
||||
set(NOTCURSES_SHARE ${CMAKE_INSTALL_PREFIX}/share/notcurses)
|
||||
|
||||
option(DISABLE_FFMPEG "Disable FFmpeg image/video support" OFF)
|
||||
option(BUILD_PYTHON "Build Python wrappers" ON)
|
||||
option(DFSG_BUILD "DFSG build (no non-free media)" OFF)
|
||||
###################### USER-SELECTABLE OPTIONS ###########################
|
||||
option(DFSG_BUILD "DFSG build (no non-free media/code)" OFF)
|
||||
option(USE_DOXYGEN "Build HTML cross reference with doxygen" ON)
|
||||
option(USE_FFMPEG "Disable FFmpeg image/video support (recommended)" ON)
|
||||
option(USE_NETWORK "Allow cargo to use the network" OFF)
|
||||
option(USE_PANDOC "Build man pages and HTML reference with pandoc" ON)
|
||||
option(USE_PYTHON "Build Python wrappers" ON)
|
||||
option(USE_RUST "Build Rust wrappers/colloquy (experimental)" OFF)
|
||||
############## END (additional) USER-SELECTABLE OPTIONS ##################
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
pkg_check_modules(TERMINFO REQUIRED tinfo>=6.1)
|
||||
if(NOT "${DISABLE_FFMPEG}")
|
||||
if(${USE_FFMPEG})
|
||||
pkg_check_modules(AVCODEC REQUIRED libavcodec>=57.0)
|
||||
pkg_check_modules(AVFORMAT REQUIRED libavformat>=57.0)
|
||||
pkg_check_modules(AVUTIL REQUIRED libavutil>=56.0)
|
||||
pkg_check_modules(SWSCALE REQUIRED libswscale>=5.0)
|
||||
endif()
|
||||
find_library(LIBRT rt)
|
||||
find_package(doctest REQUIRED)
|
||||
find_package(doctest 2.3.6 REQUIRED)
|
||||
|
||||
# libnotcurses
|
||||
file(GLOB NCSRCS CONFIGURE_DEPENDS src/lib/*.c)
|
||||
@ -78,7 +84,7 @@ target_link_directories(notcurses-static
|
||||
"${TERMINFO_STATIC_LIBRARY_DIRS}"
|
||||
)
|
||||
|
||||
if(NOT "${DISABLE_FFMPEG}")
|
||||
if(${USE_FFMPEG})
|
||||
target_include_directories(notcurses
|
||||
PUBLIC
|
||||
"${AVCODEC_INCLUDE_DIRS}"
|
||||
@ -312,7 +318,7 @@ target_compile_options(notcurses-demo
|
||||
)
|
||||
target_compile_definitions(notcurses-demo
|
||||
PRIVATE
|
||||
FORTIFY_SOURCE=2 _GNU_SOURCE
|
||||
FORTIFY_SOURCE=2 _GNU_SOURCE
|
||||
)
|
||||
|
||||
# tiny proofs of concept, one binary per source file
|
||||
@ -331,47 +337,71 @@ foreach(f ${POCSRCS})
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Documentation
|
||||
file(GLOB MANSOURCE1 CONFIGURE_DEPENDS doc/man/man1/*.md)
|
||||
file(GLOB MANSOURCE3 CONFIGURE_DEPENDS doc/man/man3/*.md)
|
||||
FIND_PROGRAM(PANDOC pandoc)
|
||||
iF(NOT PANDOC)
|
||||
message(WARNING "pandoc not found, won't generate documentation")
|
||||
else()
|
||||
foreach(m ${MANSOURCE3} ${MANSOURCE1})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
# Pandoc documentation (man pages, HTML reference)
|
||||
if(USE_PANDOC)
|
||||
file(GLOB MANSOURCE1 CONFIGURE_DEPENDS doc/man/man1/*.md)
|
||||
file(GLOB MANSOURCE3 CONFIGURE_DEPENDS doc/man/man3/*.md)
|
||||
find_program(PANDOC pandoc)
|
||||
if(NOT PANDOC)
|
||||
message(FATAL_ERROR "pandoc not found. USE_PANDOC=OFF to disable.")
|
||||
else()
|
||||
foreach(m ${MANSOURCE3} ${MANSOURCE1})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
DEPENDS ${m}
|
||||
COMMAND ${PANDOC}
|
||||
ARGS --to man --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
COMMENT "Building man page ${me}"
|
||||
)
|
||||
add_custom_target(${me}.man
|
||||
ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
)
|
||||
file(GLOB ANALHTML doc/analytics-header.html)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
DEPENDS ${m} ${ANALHTML}
|
||||
COMMAND ${PANDOC}
|
||||
ARGS -H ${ANALHTML} --to html --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
COMMENT "Building HTML5 ${me}.html"
|
||||
)
|
||||
add_custom_target(${me}.html5
|
||||
ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
)
|
||||
endforeach()
|
||||
foreach(m ${MANSOURCE3})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
set(MANPAGES3 ${MANPAGES3} ${CMAKE_CURRENT_BINARY_DIR}/${me})
|
||||
endforeach()
|
||||
foreach(m ${MANSOURCE1})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
set(MANPAGES1 ${MANPAGES1} ${CMAKE_CURRENT_BINARY_DIR}/${me})
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Doxygen
|
||||
if(USE_DOXYGEN)
|
||||
find_package(Doxygen REQUIRED dot dia)
|
||||
if(NOT ${DOXYGEN_FOUND})
|
||||
message(FATAL_ERROR "doxygen not found. USE_DOXYGEN=OFF to disable.")
|
||||
else()
|
||||
set(DOXYFILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile)
|
||||
# FIXME should dep on all source, i suppose, yuck
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
DEPENDS ${m}
|
||||
COMMAND ${PANDOC}
|
||||
ARGS --to man --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
COMMENT "Building man page ${me}"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
|
||||
DEPENDS ${DOXYFILE}
|
||||
COMMAND Doxygen::doxygen
|
||||
ARGS ${DOXYFILE}
|
||||
COMMENT "Running doxygen"
|
||||
)
|
||||
add_custom_target(${me}.man
|
||||
add_custom_target(doxygen
|
||||
ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
|
||||
)
|
||||
file(GLOB ANALHTML doc/analytics-header.html)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
DEPENDS ${m} ${ANALHTML}
|
||||
COMMAND ${PANDOC}
|
||||
ARGS -H ${ANALHTML} --to html --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
COMMENT "Building HTML5 ${me}.html"
|
||||
)
|
||||
add_custom_target(${me}.html5
|
||||
ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
|
||||
)
|
||||
endforeach()
|
||||
foreach(m ${MANSOURCE3})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
set(MANPAGES3 ${MANPAGES3} ${CMAKE_CURRENT_BINARY_DIR}/${me})
|
||||
endforeach()
|
||||
foreach(m ${MANSOURCE1})
|
||||
get_filename_component(me ${m} NAME_WLE)
|
||||
set(MANPAGES1 ${MANPAGES1} ${CMAKE_CURRENT_BINARY_DIR}/${me})
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# notcurses-input
|
||||
@ -418,7 +448,7 @@ target_compile_definitions(notcurses-ncreel
|
||||
|
||||
# notcurses-view
|
||||
file(GLOB VIEWSRCS CONFIGURE_DEPENDS src/view/*.cpp)
|
||||
if(NOT "${DISABLE_FFMPEG}")
|
||||
if(${USE_FFMPEG})
|
||||
add_executable(notcurses-view ${VIEWSRCS})
|
||||
target_include_directories(notcurses-view
|
||||
PRIVATE
|
||||
@ -513,7 +543,7 @@ write_basic_package_version_file(
|
||||
)
|
||||
|
||||
# Python bindings
|
||||
if(${BUILD_PYTHON})
|
||||
if(${USE_PYTHON})
|
||||
find_package(Python3 COMPONENTS Development Interpreter REQUIRED)
|
||||
file(GLOB PYSRC CONFIGURE_DEPENDS python/src/notcurses/*.py)
|
||||
file(COPY python/src/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python/src)
|
||||
@ -546,6 +576,36 @@ if(${BUILD_PYTHON})
|
||||
)
|
||||
endif()
|
||||
|
||||
# Rust bindings
|
||||
if(${USE_RUST})
|
||||
file(GLOB RUSTSRC CONFIGURE_DEPENDS src/colloquy/*.rs)
|
||||
file(GLOB COLLOQUYSRC CONFIGURE_DEPENDS rust/src/*.rs rust/src/*.yaml)
|
||||
set(COLLOQUY ${CMAKE_CURRENT_BINARY_DIR}/rust/debug/colloquy)
|
||||
find_program(CARGO cargo REQUIRED)
|
||||
set(CARGO_ARGS "--verbose")
|
||||
if(NOT ${USE_NETWORK})
|
||||
set(CARGO_ARGS "${CARGO_ARGS}" --frozen)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${COLLOQUY}
|
||||
COMMAND
|
||||
CARGO_HOME=${CMAKE_CURRENT_BINARY_DIR}/rust CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}/rust ${CARGO} build ${CARGO_ARGS}
|
||||
DEPENDS
|
||||
${COLLOQUYSRC}
|
||||
COMMENT "Building colloquy"
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/colloquy
|
||||
)
|
||||
add_custom_target(colloquy ALL
|
||||
DEPENDS
|
||||
${COLLOQUY}
|
||||
)
|
||||
set_target_properties(colloquy
|
||||
PROPERTIES LOCATION ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Installation
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/notcursesConfig.cmake
|
||||
@ -577,7 +637,7 @@ install(TARGETS notcurses-demo DESTINATION bin)
|
||||
install(TARGETS notcurses-input DESTINATION bin)
|
||||
install(TARGETS notcurses-ncreel DESTINATION bin)
|
||||
install(TARGETS notcurses-tester DESTINATION bin)
|
||||
if(NOT "${DISABLE_FFMPEG}")
|
||||
if(${USE_FFMPEG})
|
||||
install(TARGETS notcurses-view DESTINATION bin)
|
||||
endif()
|
||||
install(TARGETS notcurses notcurses-static
|
||||
@ -586,10 +646,10 @@ install(TARGETS notcurses notcurses-static
|
||||
COMPONENT Libraries
|
||||
NAMELINK_COMPONENT Development
|
||||
PUBLIC_HEADER
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/notcurses
|
||||
COMPONENT Development
|
||||
)
|
||||
if(${BUILD_PYTHON})
|
||||
if(${USE_PYTHON})
|
||||
# if DFSG_BUILD has been selected, assume we're building debs. debian/rules
|
||||
# has its own python install logic after many hours wasted, so we don't
|
||||
# install from here for a deb build.
|
||||
|
15
README.md
15
README.md
@ -109,13 +109,14 @@ that fine library.
|
||||
|
||||
## Requirements
|
||||
|
||||
* A C11 and a C++17 compiler
|
||||
* CMake 3.14.0+
|
||||
* From NCURSES: terminfo 6.1+
|
||||
* [Doctest](https://github.com/onqtam/doctest) (header file only)
|
||||
* (OPTIONAL) From FFMpeg: libswscale 5.0+, libavformat 57.0+, libavutil 56.0+
|
||||
* (documentation) [pandoc](https://pandoc.org/index.html) 1.19.2+
|
||||
* (Python bindings): Python + CFFI
|
||||
* (build) A C11 and a C++17 compiler
|
||||
* (build) CMake 3.14.0+
|
||||
* (build+runtime) From NCURSES: terminfo 6.1+
|
||||
* (OPTIONAL) (build+runtime) From FFMpeg: libswscale 5.0+, libavformat 57.0+, libavutil 56.0+
|
||||
* (OPTIONAL) (testing) [Doctest](https://github.com/onqtam/doctest) 2.3.6+
|
||||
* (OPTIONAL) (documentation) [pandoc](https://pandoc.org/index.html) 1.19.2+
|
||||
* (OPTIONAL) (python bindings): Python 3.7+, CFFI 1.13.2+
|
||||
* (OPTIONAL) (rust bindings, colloquy): rust 1.40.0+, cargo 0.40.0+, cmake-rs 0.1.42+
|
||||
|
||||
### Building
|
||||
|
||||
|
3
debian/control
vendored
3
debian/control
vendored
@ -5,7 +5,10 @@ Build-Depends: cmake,
|
||||
debhelper-compat (= 12),
|
||||
dh-python (>= 4.20191017),
|
||||
dh-sequence-python3,
|
||||
dia,
|
||||
doctest-dev,
|
||||
doxygen (>= 1.8.16),
|
||||
graphviz (>= 2.42.2),
|
||||
libavformat-dev (>= 7:4.2.1),
|
||||
libavutil-dev (>= 7:4.2.1),
|
||||
libncurses-dev,
|
||||
|
@ -2463,7 +2463,7 @@ DOT_IMAGE_FORMAT = png
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
INTERACTIVE_SVG = NO
|
||||
INTERACTIVE_SVG = YES
|
||||
|
||||
# The DOT_PATH tag can be used to specify the path where the dot tool can be
|
||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||
|
@ -79,6 +79,15 @@ are unavailable through the Debian package.
|
||||
If notcurses is built without FFmpeg, the **chunli**, **eagle**, **fallin'**,
|
||||
**outro**, **view**, and **xray** demos will be unavailable.
|
||||
|
||||
The following keypresses are recognized (and are also available from the menu):
|
||||
|
||||
* **Ctrl-U**: Toggle the help screen.
|
||||
* **H**: Toggle the HUD. The HUD shows the most recent and current demos'
|
||||
runtime and number of rendered frames. It can be grabbed and moved
|
||||
with the mouse.
|
||||
* **Ctrl-R**: Restart the demo.
|
||||
* **q**: Quit.
|
||||
|
||||
# BUGS
|
||||
|
||||
# AUTHORS
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
#include "CellStyle.hh"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "_flag_enum_operator_helpers.hh"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __NCPP_DIRECT_HH
|
||||
|
||||
#include <cstdio>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
#include "Cell.hh"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_MENU_HH
|
||||
#define __NCPP_MENU_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_NCALIGN_HH
|
||||
#define __NCPP_NCALIGN_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
namespace ncpp
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_NCBOX_HH
|
||||
#define __NCPP_NCBOX_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
namespace ncpp
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __NCPP_NCKEY_HH
|
||||
|
||||
#include <cstdint>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
namespace ncpp
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_NCLOGLEVEL_HH
|
||||
#define __NCPP_NCLOGLEVEL_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
namespace ncpp
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_NCSCALE_HH
|
||||
#define __NCPP_NCSCALE_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
namespace ncpp
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <csignal>
|
||||
#include <mutex>
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "CellStyle.hh"
|
||||
#include "NCKey.hh"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
#include "Cell.hh"
|
||||
@ -850,7 +850,7 @@ namespace ncpp
|
||||
|
||||
static Plane* map_plane (ncplane *ncp, Plane *associated_plane = nullptr) noexcept;
|
||||
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
bool blit_bgrx (int placey, int placex, int linesize, const unsigned char* data, int begy, int begx, int leny, int lenx) const noexcept
|
||||
{
|
||||
return ncblit_bgrx (plane, placey, placex, linesize, data, begy, begx, leny, lenx) >= 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __NCPP_REEL_HH
|
||||
|
||||
#include <memory>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Tablet.hh"
|
||||
#include "Root.hh"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_ROOT_HH
|
||||
#define __NCPP_ROOT_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "_helpers.hh"
|
||||
#include "_exceptions.hh"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_SELECTOR_HH
|
||||
#define __NCPP_SELECTOR_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
#include "NCAlign.hh"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __NCPP_VISUAL_HH
|
||||
#define __NCPP_VISUAL_HH
|
||||
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#include "Root.hh"
|
||||
#include "NCScale.hh"
|
||||
|
121
include/notcurses/nckeys.h
Normal file
121
include/notcurses/nckeys.h
Normal file
@ -0,0 +1,121 @@
|
||||
#ifndef NOTCURSES_NCKEYS
|
||||
#define NOTCURSES_NCKEYS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define suppuabize(w) ((w) + 0x100000)
|
||||
|
||||
// Special composed key defintions. These values are added to 0x100000.
|
||||
#define NCKEY_INVALID suppuabize(0)
|
||||
#define NCKEY_RESIZE suppuabize(1) // generated interally in response to SIGWINCH
|
||||
#define NCKEY_UP suppuabize(2)
|
||||
#define NCKEY_RIGHT suppuabize(3)
|
||||
#define NCKEY_DOWN suppuabize(4)
|
||||
#define NCKEY_LEFT suppuabize(5)
|
||||
#define NCKEY_INS suppuabize(6)
|
||||
#define NCKEY_DEL suppuabize(7)
|
||||
#define NCKEY_BACKSPACE suppuabize(8) // backspace (sometimes)
|
||||
#define NCKEY_PGDOWN suppuabize(9)
|
||||
#define NCKEY_PGUP suppuabize(10)
|
||||
#define NCKEY_HOME suppuabize(11)
|
||||
#define NCKEY_END suppuabize(12)
|
||||
#define NCKEY_F00 suppuabize(20)
|
||||
#define NCKEY_F01 suppuabize(21)
|
||||
#define NCKEY_F02 suppuabize(22)
|
||||
#define NCKEY_F03 suppuabize(23)
|
||||
#define NCKEY_F04 suppuabize(24)
|
||||
#define NCKEY_F05 suppuabize(25)
|
||||
#define NCKEY_F06 suppuabize(26)
|
||||
#define NCKEY_F07 suppuabize(27)
|
||||
#define NCKEY_F08 suppuabize(28)
|
||||
#define NCKEY_F09 suppuabize(29)
|
||||
#define NCKEY_F10 suppuabize(30)
|
||||
#define NCKEY_F11 suppuabize(31)
|
||||
#define NCKEY_F12 suppuabize(32)
|
||||
#define NCKEY_F13 suppuabize(33)
|
||||
#define NCKEY_F14 suppuabize(34)
|
||||
#define NCKEY_F15 suppuabize(35)
|
||||
#define NCKEY_F16 suppuabize(36)
|
||||
#define NCKEY_F17 suppuabize(37)
|
||||
#define NCKEY_F18 suppuabize(38)
|
||||
#define NCKEY_F19 suppuabize(39)
|
||||
#define NCKEY_F20 suppuabize(40)
|
||||
#define NCKEY_F21 suppuabize(41)
|
||||
#define NCKEY_F22 suppuabize(42)
|
||||
#define NCKEY_F23 suppuabize(43)
|
||||
#define NCKEY_F24 suppuabize(44)
|
||||
#define NCKEY_F25 suppuabize(45)
|
||||
#define NCKEY_F26 suppuabize(46)
|
||||
#define NCKEY_F27 suppuabize(47)
|
||||
#define NCKEY_F28 suppuabize(48)
|
||||
#define NCKEY_F29 suppuabize(49)
|
||||
#define NCKEY_F30 suppuabize(50)
|
||||
#define NCKEY_F31 suppuabize(51)
|
||||
#define NCKEY_F32 suppuabize(52)
|
||||
#define NCKEY_F33 suppuabize(53)
|
||||
#define NCKEY_F34 suppuabize(54)
|
||||
#define NCKEY_F35 suppuabize(55)
|
||||
#define NCKEY_F36 suppuabize(56)
|
||||
#define NCKEY_F37 suppuabize(57)
|
||||
#define NCKEY_F38 suppuabize(58)
|
||||
#define NCKEY_F39 suppuabize(59)
|
||||
#define NCKEY_F40 suppuabize(60)
|
||||
#define NCKEY_F41 suppuabize(61)
|
||||
#define NCKEY_F42 suppuabize(62)
|
||||
#define NCKEY_F43 suppuabize(63)
|
||||
#define NCKEY_F44 suppuabize(64)
|
||||
#define NCKEY_F45 suppuabize(65)
|
||||
#define NCKEY_F46 suppuabize(66)
|
||||
#define NCKEY_F47 suppuabize(67)
|
||||
#define NCKEY_F48 suppuabize(68)
|
||||
#define NCKEY_F49 suppuabize(69)
|
||||
#define NCKEY_F50 suppuabize(70)
|
||||
#define NCKEY_F51 suppuabize(71)
|
||||
#define NCKEY_F52 suppuabize(72)
|
||||
#define NCKEY_F53 suppuabize(73)
|
||||
#define NCKEY_F54 suppuabize(74)
|
||||
#define NCKEY_F55 suppuabize(75)
|
||||
#define NCKEY_F56 suppuabize(76)
|
||||
#define NCKEY_F57 suppuabize(77)
|
||||
#define NCKEY_F58 suppuabize(78)
|
||||
#define NCKEY_F59 suppuabize(79)
|
||||
#define NCKEY_F60 suppuabize(80)
|
||||
// ... leave room for up to 100 function keys, egads
|
||||
#define NCKEY_ENTER suppuabize(121)
|
||||
#define NCKEY_CLS suppuabize(122) // "clear-screen or erase"
|
||||
#define NCKEY_DLEFT suppuabize(123) // down + left on keypad
|
||||
#define NCKEY_DRIGHT suppuabize(124)
|
||||
#define NCKEY_ULEFT suppuabize(125) // up + left on keypad
|
||||
#define NCKEY_URIGHT suppuabize(126)
|
||||
#define NCKEY_CENTER suppuabize(127) // the most truly neutral of keypresses
|
||||
#define NCKEY_BEGIN suppuabize(128)
|
||||
#define NCKEY_CANCEL suppuabize(129)
|
||||
#define NCKEY_CLOSE suppuabize(130)
|
||||
#define NCKEY_COMMAND suppuabize(131)
|
||||
#define NCKEY_COPY suppuabize(132)
|
||||
#define NCKEY_EXIT suppuabize(133)
|
||||
#define NCKEY_PRINT suppuabize(134)
|
||||
#define NCKEY_REFRESH suppuabize(135)
|
||||
// Mouse events. We try to encode some details into the char32_t (i.e. which
|
||||
// button was pressed), but some is embedded in the ncinput event. The release
|
||||
// event is generic across buttons; callers must maintain state, if they care.
|
||||
#define NCKEY_BUTTON1 suppuabize(201)
|
||||
#define NCKEY_BUTTON2 suppuabize(202)
|
||||
#define NCKEY_BUTTON3 suppuabize(203)
|
||||
#define NCKEY_BUTTON4 suppuabize(204)
|
||||
#define NCKEY_BUTTON5 suppuabize(205)
|
||||
#define NCKEY_BUTTON6 suppuabize(206)
|
||||
#define NCKEY_BUTTON7 suppuabize(207)
|
||||
#define NCKEY_BUTTON8 suppuabize(208)
|
||||
#define NCKEY_BUTTON9 suppuabize(209)
|
||||
#define NCKEY_BUTTON10 suppuabize(210)
|
||||
#define NCKEY_BUTTON11 suppuabize(211)
|
||||
#define NCKEY_RELEASE suppuabize(212)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
@ -13,6 +13,7 @@
|
||||
#include <signal.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <notcurses/nckeys.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -264,115 +265,6 @@ API void notcurses_drop_planes(struct notcurses* nc);
|
||||
// returned to indicate that no input was available, but only by
|
||||
// notcurses_getc(). Otherwise (including on EOF) (char32_t)-1 is returned.
|
||||
|
||||
#define suppuabize(w) ((w) + 0x100000)
|
||||
|
||||
// Special composed key definitions. These values are added to 0x100000.
|
||||
#define NCKEY_INVALID suppuabize(0)
|
||||
#define NCKEY_RESIZE suppuabize(1) // generated internally in response to SIGWINCH
|
||||
#define NCKEY_UP suppuabize(2)
|
||||
#define NCKEY_RIGHT suppuabize(3)
|
||||
#define NCKEY_DOWN suppuabize(4)
|
||||
#define NCKEY_LEFT suppuabize(5)
|
||||
#define NCKEY_INS suppuabize(6)
|
||||
#define NCKEY_DEL suppuabize(7)
|
||||
#define NCKEY_BACKSPACE suppuabize(8) // backspace (sometimes)
|
||||
#define NCKEY_PGDOWN suppuabize(9)
|
||||
#define NCKEY_PGUP suppuabize(10)
|
||||
#define NCKEY_HOME suppuabize(11)
|
||||
#define NCKEY_END suppuabize(12)
|
||||
#define NCKEY_F00 suppuabize(20)
|
||||
#define NCKEY_F01 suppuabize(21)
|
||||
#define NCKEY_F02 suppuabize(22)
|
||||
#define NCKEY_F03 suppuabize(23)
|
||||
#define NCKEY_F04 suppuabize(24)
|
||||
#define NCKEY_F05 suppuabize(25)
|
||||
#define NCKEY_F06 suppuabize(26)
|
||||
#define NCKEY_F07 suppuabize(27)
|
||||
#define NCKEY_F08 suppuabize(28)
|
||||
#define NCKEY_F09 suppuabize(29)
|
||||
#define NCKEY_F10 suppuabize(30)
|
||||
#define NCKEY_F11 suppuabize(31)
|
||||
#define NCKEY_F12 suppuabize(32)
|
||||
#define NCKEY_F13 suppuabize(33)
|
||||
#define NCKEY_F14 suppuabize(34)
|
||||
#define NCKEY_F15 suppuabize(35)
|
||||
#define NCKEY_F16 suppuabize(36)
|
||||
#define NCKEY_F17 suppuabize(37)
|
||||
#define NCKEY_F18 suppuabize(38)
|
||||
#define NCKEY_F19 suppuabize(39)
|
||||
#define NCKEY_F20 suppuabize(40)
|
||||
#define NCKEY_F21 suppuabize(41)
|
||||
#define NCKEY_F22 suppuabize(42)
|
||||
#define NCKEY_F23 suppuabize(43)
|
||||
#define NCKEY_F24 suppuabize(44)
|
||||
#define NCKEY_F25 suppuabize(45)
|
||||
#define NCKEY_F26 suppuabize(46)
|
||||
#define NCKEY_F27 suppuabize(47)
|
||||
#define NCKEY_F28 suppuabize(48)
|
||||
#define NCKEY_F29 suppuabize(49)
|
||||
#define NCKEY_F30 suppuabize(50)
|
||||
#define NCKEY_F31 suppuabize(51)
|
||||
#define NCKEY_F32 suppuabize(52)
|
||||
#define NCKEY_F33 suppuabize(53)
|
||||
#define NCKEY_F34 suppuabize(54)
|
||||
#define NCKEY_F35 suppuabize(55)
|
||||
#define NCKEY_F36 suppuabize(56)
|
||||
#define NCKEY_F37 suppuabize(57)
|
||||
#define NCKEY_F38 suppuabize(58)
|
||||
#define NCKEY_F39 suppuabize(59)
|
||||
#define NCKEY_F40 suppuabize(60)
|
||||
#define NCKEY_F41 suppuabize(61)
|
||||
#define NCKEY_F42 suppuabize(62)
|
||||
#define NCKEY_F43 suppuabize(63)
|
||||
#define NCKEY_F44 suppuabize(64)
|
||||
#define NCKEY_F45 suppuabize(65)
|
||||
#define NCKEY_F46 suppuabize(66)
|
||||
#define NCKEY_F47 suppuabize(67)
|
||||
#define NCKEY_F48 suppuabize(68)
|
||||
#define NCKEY_F49 suppuabize(69)
|
||||
#define NCKEY_F50 suppuabize(70)
|
||||
#define NCKEY_F51 suppuabize(71)
|
||||
#define NCKEY_F52 suppuabize(72)
|
||||
#define NCKEY_F53 suppuabize(73)
|
||||
#define NCKEY_F54 suppuabize(74)
|
||||
#define NCKEY_F55 suppuabize(75)
|
||||
#define NCKEY_F56 suppuabize(76)
|
||||
#define NCKEY_F57 suppuabize(77)
|
||||
#define NCKEY_F58 suppuabize(78)
|
||||
#define NCKEY_F59 suppuabize(79)
|
||||
#define NCKEY_F60 suppuabize(80)
|
||||
// ... leave room for up to 100 function keys, egads
|
||||
#define NCKEY_ENTER suppuabize(121)
|
||||
#define NCKEY_CLS suppuabize(122) // "clear-screen or erase"
|
||||
#define NCKEY_DLEFT suppuabize(123) // down + left on keypad
|
||||
#define NCKEY_DRIGHT suppuabize(124)
|
||||
#define NCKEY_ULEFT suppuabize(125) // up + left on keypad
|
||||
#define NCKEY_URIGHT suppuabize(126)
|
||||
#define NCKEY_CENTER suppuabize(127) // the most truly neutral of keypresses
|
||||
#define NCKEY_BEGIN suppuabize(128)
|
||||
#define NCKEY_CANCEL suppuabize(129)
|
||||
#define NCKEY_CLOSE suppuabize(130)
|
||||
#define NCKEY_COMMAND suppuabize(131)
|
||||
#define NCKEY_COPY suppuabize(132)
|
||||
#define NCKEY_EXIT suppuabize(133)
|
||||
#define NCKEY_PRINT suppuabize(134)
|
||||
#define NCKEY_REFRESH suppuabize(135)
|
||||
// Mouse events. We try to encode some details into the char32_t (i.e. which
|
||||
// button was pressed), but some is embedded in the ncinput event. The release
|
||||
// event is generic across buttons; callers must maintain state, if they care.
|
||||
#define NCKEY_BUTTON1 suppuabize(201)
|
||||
#define NCKEY_BUTTON2 suppuabize(202)
|
||||
#define NCKEY_BUTTON3 suppuabize(203)
|
||||
#define NCKEY_BUTTON4 suppuabize(204)
|
||||
#define NCKEY_BUTTON5 suppuabize(205)
|
||||
#define NCKEY_BUTTON6 suppuabize(206)
|
||||
#define NCKEY_BUTTON7 suppuabize(207)
|
||||
#define NCKEY_BUTTON8 suppuabize(208)
|
||||
#define NCKEY_BUTTON9 suppuabize(209)
|
||||
#define NCKEY_BUTTON10 suppuabize(210)
|
||||
#define NCKEY_BUTTON11 suppuabize(211)
|
||||
#define NCKEY_RELEASE suppuabize(212)
|
||||
|
||||
// Is this char32_t a Supplementary Private Use Area-B codepoint?
|
||||
static inline bool
|
||||
nckey_supppuab_p(char32_t w){
|
||||
@ -446,7 +338,7 @@ API int notcurses_refresh(struct notcurses* n);
|
||||
|
||||
// Get a reference to the standard plane (one matching our current idea of the
|
||||
// terminal size) for this terminal. The standard plane always exists, and its
|
||||
// origin is always at the uppermost, leftmost cell of the screen.
|
||||
// origin is always at the uppermost, leftmost cell of the terminal.
|
||||
API struct ncplane* notcurses_stdplane(struct notcurses* nc);
|
||||
|
||||
// Retrieve the contents of the specified cell as last rendered. The EGC is
|
||||
@ -1978,7 +1870,7 @@ API int ncblit_bgrx(struct ncplane* nc, int placey, int placex, int linesize,
|
||||
// subregion of the input can be specified with 'begy'x'begx' and 'leny'x'lenx'.
|
||||
API int ncblit_rgba(struct ncplane* nc, int placey, int placex, int linesize,
|
||||
const unsigned char* data, int begy, int begx,
|
||||
int leny, int lenx);
|
||||
int leny, int lenx);
|
||||
|
||||
// An ncreel is a notcurses region devoted to displaying zero or more
|
||||
// line-oriented, contained panels between which the user may navigate. If at
|
||||
@ -2040,9 +1932,7 @@ struct ncreel;
|
||||
// and columns can be enforced via popts. efd, if non-negative, is an eventfd
|
||||
// that ought be written to whenever ncreel_touch() updates a tablet (this
|
||||
// is useful in the case of nonblocking input).
|
||||
API struct ncreel* ncreel_create(struct ncplane* nc,
|
||||
const ncreel_options* popts,
|
||||
int efd);
|
||||
API struct ncreel* ncreel_create(struct ncplane* nc, const ncreel_options* popts, int efd);
|
||||
|
||||
// Returns the ncplane on which this ncreel lives.
|
||||
API struct ncplane* ncreel_plane(struct ncreel* pr);
|
||||
@ -2073,8 +1963,8 @@ typedef int (*tabletcb)(struct nctablet* t, int begx, int begy, int maxx,
|
||||
// resulting location, assuming it is valid (after->next == before->prev); if
|
||||
// it is not valid, or there is any other error, NULL will be returned.
|
||||
API struct nctablet* ncreel_add(struct ncreel* pr, struct nctablet* after,
|
||||
struct nctablet* before, tabletcb cb,
|
||||
void* opaque);
|
||||
struct nctablet* before, tabletcb cb,
|
||||
void* opaque);
|
||||
|
||||
// Return the number of nctablets in the ncreel.
|
||||
API int ncreel_tabletcount(const struct ncreel* pr);
|
@ -4,7 +4,7 @@ ffibuild = FFI()
|
||||
ffibuild.set_source(
|
||||
"_notcurses",
|
||||
"""
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
""",
|
||||
libraries=["notcurses"],
|
||||
)
|
||||
|
129
src/colloquy/Cargo.lock
generated
Normal file
129
src/colloquy/Cargo.lock
generated
Normal file
@ -0,0 +1,129 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "ansi_term"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"hermit-abi 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "2.33.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colloquy"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"notcurses 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.66"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "notcurses"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "vec_map"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "yaml-rust"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[metadata]
|
||||
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
||||
"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
||||
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
|
||||
"checksum hermit-abi 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c55f143919fbc0bc77e427fe2d74cf23786d7c1875666f2fde3ac3c659bb67"
|
||||
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
|
||||
"checksum notcurses 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5922082c807aad44b9c62b337c18ba525aa836ac9d7e47b65879dfe3f734f262"
|
||||
"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
||||
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
||||
"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
|
||||
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
|
||||
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
|
10
src/colloquy/Cargo.toml
Normal file
10
src/colloquy/Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "colloquy"
|
||||
version = "0.1.0"
|
||||
authors = ["nick black <dankamongmen@gmail.com>"]
|
||||
edition = "2018"
|
||||
repository = "https://github.com/dankamongmen/notcurses"
|
||||
|
||||
[dependencies]
|
||||
notcurses = ">= 1.2.0"
|
||||
clap = {version = ">= 2.33.0", features = ["yaml", "color", "suggestions"]}
|
9
src/colloquy/src/cli.yml
Normal file
9
src/colloquy/src/cli.yml
Normal file
@ -0,0 +1,9 @@
|
||||
name: colloquy
|
||||
version: "0.1.0"
|
||||
about: Attractive UI widgets from the shell
|
||||
author: Nick Black <dankamongmen@gmail.com>
|
||||
args:
|
||||
- verbose:
|
||||
long: verbose
|
||||
short: v
|
||||
help: Verbose mode
|
5
src/colloquy/src/main.rs
Normal file
5
src/colloquy/src/main.rs
Normal file
@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
use clap::{load_yaml, App};
|
||||
let yaml = load_yaml!("cli.yml");
|
||||
let matches = App::from_yaml(yaml).get_matches();
|
||||
}
|
@ -8,8 +8,6 @@
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdatomic.h>
|
||||
#include <notcurses.h>
|
||||
#include "version.h"
|
||||
#include "demo.h"
|
||||
|
||||
// ansi terminal definition-4-life
|
||||
@ -20,11 +18,13 @@ static int democount;
|
||||
static demoresult* results;
|
||||
static char datadir[PATH_MAX];
|
||||
|
||||
#ifdef DISABLE_FFMPEG
|
||||
static const char DEFAULT_DEMO[] = "ithbgrwus";
|
||||
// yes, these are in different orders in different configurations on purpose
|
||||
// (since some transition into the next)
|
||||
#ifndef USE_FFMPEG
|
||||
static const char DEFAULT_DEMO[] = "itfhbrgswu";
|
||||
#else
|
||||
#ifdef DFSG_BUILD
|
||||
static const char DEFAULT_DEMO[] = "ixthbgrwuso";
|
||||
static const char DEFAULT_DEMO[] = "ixtfhbrgslwuo";
|
||||
#else
|
||||
static const char DEFAULT_DEMO[] = "ixethbcgrwuvlfsjo";
|
||||
#endif
|
||||
@ -84,9 +84,9 @@ struct timespec demodelay = {
|
||||
};
|
||||
|
||||
// anything that's dfsg non-free requires ncvisual (i.e. it's all multimedia),
|
||||
// so also check for FFMPEG_DISABLE here in DFSG_BUILD
|
||||
// so also check for USE_FFMPEG here in DFSG_BUILD
|
||||
#ifndef DFSG_BUILD
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
#define NONFREE(name, fxn) { name, fxn, }
|
||||
#endif
|
||||
#endif
|
||||
@ -94,7 +94,7 @@ struct timespec demodelay = {
|
||||
#define NONFREE(name, fxn) { NULL, NULL, }
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
#define FREEFFMPEG(name, fxn) { name, fxn, }
|
||||
#else
|
||||
#define FREEFFMPEG(name, fxn) { NULL, NULL, }
|
||||
@ -111,7 +111,7 @@ static struct {
|
||||
NONFREE("chunli", chunli_demo),
|
||||
{ NULL, NULL, },
|
||||
NONFREE("eagle", eagle_demo),
|
||||
NONFREE("fallin'", fallin_demo),
|
||||
{ "fallin'", fallin_demo, },
|
||||
{ "grid", grid_demo, },
|
||||
{ "highcon", highcontrast_demo, },
|
||||
{ "intro", intro, },
|
||||
|
@ -6,8 +6,9 @@
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <stdatomic.h>
|
||||
#include <notcurses.h>
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#include <version.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
#ifdef USE_FFMPEG
|
||||
#include <libavutil/pixdesc.h>
|
||||
#include <libavutil/avconfig.h>
|
||||
#include <libavcodec/avcodec.h> // ffmpeg doesn't reliably "C"-guard itself
|
||||
|
@ -1,31 +1,6 @@
|
||||
#include "demo.h"
|
||||
#include <pthread.h>
|
||||
|
||||
static bool done = false;
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static int
|
||||
patentpulser(struct notcurses* nc, struct ncplane* ncp, void* curry){
|
||||
(void)ncp;
|
||||
(void)curry;
|
||||
DEMO_RENDER(nc);
|
||||
bool donecheck;
|
||||
pthread_mutex_lock(&lock);
|
||||
donecheck = done;
|
||||
pthread_mutex_unlock(&lock);
|
||||
if(donecheck){
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void*
|
||||
patentpulsar(void* n){
|
||||
struct notcurses* nc = n;
|
||||
ncplane_pulse(notcurses_stdplane(nc), &demodelay, patentpulser, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
drop_bricks(struct notcurses* nc, struct ncplane** arr, int arrcount){
|
||||
if(arrcount == 0 || arr == NULL){
|
||||
@ -112,9 +87,6 @@ shuffle_in(struct ncplane** arr, int count, struct ncplane* n){
|
||||
|
||||
// ya playin' yourself
|
||||
int fallin_demo(struct notcurses* nc){
|
||||
if(!notcurses_canopen(nc)){
|
||||
return 0;
|
||||
}
|
||||
int dimx, dimy;
|
||||
ncplane_dim_yx(notcurses_stdplane(nc), &dimy, &dimx);
|
||||
size_t usesize = sizeof(bool) * dimy * dimx;
|
||||
@ -196,6 +168,7 @@ int fallin_demo(struct notcurses* nc){
|
||||
}
|
||||
}
|
||||
free(usemap);
|
||||
#ifdef USE_FFMPEG
|
||||
int averr = 0;
|
||||
char* path = find_data("lamepatents.jpg");
|
||||
struct ncvisual* ncv = ncplane_visual_open(notcurses_stdplane(nc), path, &averr);
|
||||
@ -211,19 +184,12 @@ int fallin_demo(struct notcurses* nc){
|
||||
ncvisual_destroy(ncv);
|
||||
return -1;
|
||||
}
|
||||
pthread_t tid;
|
||||
if(pthread_create(&tid, NULL, patentpulsar, nc)){
|
||||
return -1;
|
||||
}
|
||||
int ret = drop_bricks(nc, arr, arrcount);
|
||||
pthread_mutex_lock(&lock);
|
||||
done = true;
|
||||
pthread_mutex_unlock(&lock);
|
||||
if(pthread_join(tid, NULL)){
|
||||
return -1;
|
||||
}
|
||||
assert(ncvisual_decode(ncv, &averr) == NULL);
|
||||
assert(averr == AVERROR_EOF);
|
||||
ncvisual_destroy(ncv);
|
||||
#else
|
||||
ncplane_erase(notcurses_stdplane(nc));
|
||||
#endif
|
||||
int ret = drop_bricks(nc, arr, arrcount);
|
||||
return ret;
|
||||
}
|
||||
|
@ -161,7 +161,9 @@ int luigi_demo(struct notcurses* nc){
|
||||
return -1;
|
||||
}
|
||||
assert(ncvisual_decode(nv, &averr) == NULL);
|
||||
#ifdef USE_FFMPEG
|
||||
assert(averr == AVERROR_EOF);
|
||||
#endif
|
||||
int rows, cols;
|
||||
ncplane_dim_yx(n, &rows, &cols);
|
||||
// he should be walking on the platform ~4/5 of the way down
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/poll.h>
|
||||
#include <notcurses.h>
|
||||
#include "demo.h"
|
||||
|
||||
#define INITIAL_TABLET_COUNT 4
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <notcurses.h>
|
||||
#include "demo.h"
|
||||
|
||||
// FIXME do the bigger dimension on the screen's bigger dimension
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <notcurses.h>
|
||||
#include "demo.h"
|
||||
|
||||
static int
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "notcurses.h"
|
||||
#include "notcurses/notcurses.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef NOTCURSES_INTERNAL
|
||||
#define NOTCURSES_INTERNAL
|
||||
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#include "version.h"
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
#include <libavutil/error.h>
|
||||
#include <libavutil/frame.h>
|
||||
#include <libavutil/pixdesc.h>
|
||||
@ -25,8 +27,7 @@
|
||||
#include <wctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <pthread.h>
|
||||
#include "notcurses.h"
|
||||
#include "version.h"
|
||||
#include "notcurses/notcurses.h"
|
||||
#include "egcpool.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -94,7 +95,7 @@ typedef struct ncvisual {
|
||||
int placex, placey;
|
||||
ncscale_e style; // none, scale, or stretch
|
||||
struct notcurses* ncobj; // set iff this ncvisual "owns" its ncplane
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
AVSubtitle subtitle;
|
||||
#endif
|
||||
} ncvisual;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <string.h>
|
||||
#include "version.h"
|
||||
#include "notcurses.h"
|
||||
#include "internal.h"
|
||||
|
||||
ncplane* ncvisual_plane(ncvisual* ncv){
|
||||
@ -9,7 +8,7 @@ ncplane* ncvisual_plane(ncvisual* ncv){
|
||||
|
||||
void ncvisual_destroy(ncvisual* ncv){
|
||||
if(ncv){
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
avcodec_close(ncv->codecctx);
|
||||
avcodec_free_context(&ncv->codecctx);
|
||||
av_frame_free(&ncv->frame);
|
||||
@ -27,7 +26,7 @@ void ncvisual_destroy(ncvisual* ncv){
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
bool notcurses_canopen(const notcurses* nc __attribute__ ((unused))){
|
||||
return true;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <pthread.h>
|
||||
#include "notcurses.h"
|
||||
#include "notcurses/notcurses.h"
|
||||
|
||||
static const char* decisep;
|
||||
static pthread_once_t ponce = PTHREAD_ONCE_INIT;
|
||||
|
@ -757,7 +757,7 @@ void notcurses_reset_stats(notcurses* nc, ncstats* stats){
|
||||
// Convert a notcurses log level to its ffmpeg equivalent.
|
||||
static int
|
||||
ffmpeg_log_level(ncloglevel_e level){
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
switch(level){
|
||||
case NCLOGLEVEL_SILENT: return AV_LOG_QUIET;
|
||||
case NCLOGLEVEL_PANIC: return AV_LOG_PANIC;
|
||||
@ -943,14 +943,14 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){
|
||||
bprefix(ret->stats.fbbytes, 1, prefixbuf, 0),
|
||||
ret->colors, ret->RGBflag ? "direct" : "palette",
|
||||
__VERSION__, curses_version());
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
fprintf(ret->ttyfp, " avformat %u.%u.%u\n avutil %u.%u.%u\n swscale %u.%u.%u\n",
|
||||
LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO,
|
||||
LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO,
|
||||
LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO);
|
||||
#else
|
||||
putp(tiparm(ret->setaf, 3));
|
||||
fprintf(ret->ttyfp, " Warning! Built without ffmpeg support\n");
|
||||
term_fg_palindex(ret, ret->ttyfp, ret->colors <= 88 ? 1 % ret->colors : 0xcb);
|
||||
fprintf(ret->ttyfp, "\n Warning! Notcurses was built without ffmpeg support\n");
|
||||
#endif
|
||||
term_fg_palindex(ret, ret->ttyfp, ret->colors <= 88 ? 1 % ret->colors : 0xcb);
|
||||
if(!ret->RGBflag){ // FIXME
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "notcurses.h"
|
||||
#include "internal.h"
|
||||
|
||||
// Tablets are the toplevel entitites within an ncreel. Each corresponds to
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include "notcurses.h"
|
||||
#include "internal.h"
|
||||
|
||||
// ideal body width given the ncselector's items and secondary/footer
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
// can we leave what was already on the screen there? (narrator: it seems not)
|
||||
int main(void){
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
static int
|
||||
print_b(struct ncdirect* nc, int r, int g, int total){
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
// fun with the Geometric Shapes
|
||||
int main(void){
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
static int
|
||||
run_menu(struct notcurses* nc, struct ncmenu* ncm){
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
int main(void){
|
||||
if(!setlocale(LC_ALL, "")){
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
int main(void){
|
||||
if(!setlocale(LC_ALL, "")){
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
static struct selector_item items[] = {
|
||||
{ "first", "this is the first option", },
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#include <assert.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
#define DISABLE_ALTCHARSET 1
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <clocale>
|
||||
#include <cassert>
|
||||
#include <unistd.h>
|
||||
#include <notcurses.h>
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
int main(int argc, char** argv){
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <notcurses.h>
|
||||
#include "egcpool.h"
|
||||
#include "main.h"
|
||||
#include "egcpool.h"
|
||||
|
||||
TEST_CASE("MultibyteWidth") {
|
||||
if(!enforce_utf8()){
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <notcurses.h>
|
||||
#include "main.h"
|
||||
|
||||
TEST_CASE("ChannelGetRGB") {
|
||||
|
@ -1,5 +1,3 @@
|
||||
#include <notcurses.h>
|
||||
#include "egcpool.h"
|
||||
#include "main.h"
|
||||
|
||||
TEST_CASE("DirectMode") {
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <vector>
|
||||
#include <notcurses.h>
|
||||
#include "egcpool.h"
|
||||
#include "main.h"
|
||||
#include "egcpool.h"
|
||||
|
||||
TEST_CASE("EGCpool") {
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <notcurses.h>
|
||||
#include "internal.h"
|
||||
#include "main.h"
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
#define NOTCURSES_TEST_MAIN
|
||||
|
||||
#include <unistd.h>
|
||||
#include <notcurses.h>
|
||||
#include <doctest/doctest.h>
|
||||
#include "version.h"
|
||||
#include <notcurses/notcurses.h>
|
||||
|
||||
char* find_data(const char* datum);
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <notcurses.h>
|
||||
#include "internal.h"
|
||||
#include "main.h"
|
||||
#include "internal.h"
|
||||
|
||||
void BoxPermutationsRounded(struct notcurses* nc, struct ncplane* n, unsigned edges) {
|
||||
int dimx, dimy;
|
||||
|
@ -1,9 +1,8 @@
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <notcurses.h>
|
||||
#include "internal.h"
|
||||
#include "main.h"
|
||||
#include "internal.h"
|
||||
|
||||
TEST_CASE("NotcursesBase") {
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <notcurses.h>
|
||||
#include "main.h"
|
||||
|
||||
TEST_CASE("Palette256") {
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include <notcurses.h>
|
||||
#include "version.h"
|
||||
#include "main.h"
|
||||
#ifndef DISABLE_FFMPEG
|
||||
#ifdef USE_FFMPEG
|
||||
#include <libavutil/pixdesc.h>
|
||||
#include <libavutil/avconfig.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
@ -21,7 +19,7 @@ TEST_CASE("Multimedia") {
|
||||
ncplane* ncp_ = notcurses_stdplane(nc_);
|
||||
REQUIRE(ncp_);
|
||||
|
||||
#ifdef DISABLE_FFMPEG
|
||||
#ifndef USE_FFMPEG
|
||||
SUBCASE("LibavDisabled"){
|
||||
REQUIRE(!notcurses_canopen(nc_));
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define notcurses_VERSION_MAJOR "@notcurses_VERSION_MAJOR@"
|
||||
#define notcurses_VERSION_MINOR "@notcurses_VERSION_MINOR@"
|
||||
#define notcurses_VERSION_PATCH "@notcurses_VERSION_PATCH@"
|
||||
#cmakedefine DISABLE_FFMPEG
|
||||
#cmakedefine DFSG_BUILD
|
||||
#cmakedefine USE_FFMPEG
|
||||
#define NOTCURSES_SHARE "@NOTCURSES_SHARE@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user