add notcurses-keyplot #430

This commit is contained in:
nick black 2020-04-02 19:42:17 -04:00 committed by Nick Black
parent d541cda306
commit 5e27499194
4 changed files with 41 additions and 13 deletions

View File

@ -332,7 +332,7 @@ foreach(f ${POCSRCS})
PRIVATE include "${TERMINFO_INCLUDE_DIRS}" PRIVATE include "${TERMINFO_INCLUDE_DIRS}"
) )
target_link_libraries(${fe} target_link_libraries(${fe}
PRIVATE notcurses notcurses++ "${TERMINFO_LIBRARIES}" PRIVATE notcurses++ "${TERMINFO_LIBRARIES}"
) )
target_link_directories(${fe} target_link_directories(${fe}
PRIVATE "${TERMINFO_LIBRARY_DIRS}" PRIVATE "${TERMINFO_LIBRARY_DIRS}"
@ -406,8 +406,8 @@ if(USE_DOXYGEN)
endif() endif()
endif() endif()
# notcurses-input # notcurses-input and notcurses-keyplot
file(GLOB INPUTSRCS CONFIGURE_DEPENDS src/input/*.cpp) file(GLOB INPUTSRCS CONFIGURE_DEPENDS src/input/input.cpp)
add_executable(notcurses-input ${INPUTSRCS}) add_executable(notcurses-input ${INPUTSRCS})
target_include_directories(notcurses-input target_include_directories(notcurses-input
PRIVATE PRIVATE
@ -416,7 +416,7 @@ target_include_directories(notcurses-input
) )
target_link_libraries(notcurses-input target_link_libraries(notcurses-input
PRIVATE PRIVATE
notcurses notcurses++ notcurses++
) )
target_compile_options(notcurses-input target_compile_options(notcurses-input
PRIVATE PRIVATE
@ -427,9 +427,29 @@ target_compile_definitions(notcurses-input
FORTIFY_SOURCE=2 FORTIFY_SOURCE=2
) )
file(GLOB KEYPLOTSRCS CONFIGURE_DEPENDS src/input/keyplot.cpp)
add_executable(notcurses-keyplot ${KEYPLOTSRCS})
target_include_directories(notcurses-keyplot
PRIVATE
include
"${PROJECT_BINARY_DIR}/include"
)
target_link_libraries(notcurses-keyplot
PRIVATE
notcurses++
)
target_compile_options(notcurses-keyplot
PRIVATE
-Wall -Wextra -W -Wshadow ${DEBUG_OPTIONS}
)
target_compile_definitions(notcurses-keyplot
PRIVATE
FORTIFY_SOURCE=2
)
# notcurses-ncreel # notcurses-ncreel
file(GLOB ncreelSRCS CONFIGURE_DEPENDS src/ncreel/*.cpp) file(GLOB NCREELSRCS CONFIGURE_DEPENDS src/ncreel/*.cpp)
add_executable(notcurses-ncreel ${ncreelSRCS}) add_executable(notcurses-ncreel ${NCREELSRCS})
target_include_directories(notcurses-ncreel target_include_directories(notcurses-ncreel
PRIVATE PRIVATE
include include
@ -437,7 +457,7 @@ target_include_directories(notcurses-ncreel
) )
target_link_libraries(notcurses-ncreel target_link_libraries(notcurses-ncreel
PRIVATE PRIVATE
notcurses notcurses++ notcurses++
) )
target_compile_options(notcurses-ncreel target_compile_options(notcurses-ncreel
PRIVATE PRIVATE
@ -489,7 +509,7 @@ target_link_directories(notcurses-view
) )
target_link_libraries(notcurses-view target_link_libraries(notcurses-view
PRIVATE PRIVATE
notcurses notcurses++ notcurses++
PRIVATE PRIVATE
"${AVCODEC_LIBRARIES}" "${AVCODEC_LIBRARIES}"
"${AVFORMAT_LIBRARIES}" "${AVFORMAT_LIBRARIES}"
@ -701,6 +721,7 @@ install(FILES
install(PROGRAMS src/pydemo/notcurses-pydemo DESTINATION bin) install(PROGRAMS src/pydemo/notcurses-pydemo DESTINATION bin)
install(TARGETS notcurses-demo DESTINATION bin) install(TARGETS notcurses-demo DESTINATION bin)
install(TARGETS notcurses-input DESTINATION bin) install(TARGETS notcurses-input DESTINATION bin)
install(TARGETS notcurses-keyplot DESTINATION bin)
install(TARGETS notcurses-ncreel DESTINATION bin) install(TARGETS notcurses-ncreel DESTINATION bin)
install(TARGETS notcurses-tester DESTINATION bin) install(TARGETS notcurses-tester DESTINATION bin)
install(TARGETS notcurses-tetris DESTINATION bin) install(TARGETS notcurses-tetris DESTINATION bin)

View File

@ -2486,8 +2486,8 @@ typedef enum {
} ncgridgeom_e; } ncgridgeom_e;
// Plots. Given a rectilinear area, an ncplot can graph samples along some axis. // Plots. Given a rectilinear area, an ncplot can graph samples along some axis.
// There is some underlying independent variable--this could be measurement // There is some underlying independent variable--this could be e.g. measurement
// number, or measurement time. Samples are tagged with this variable, which // sequence number, or measurement time. Samples are tagged with this variable, which
// should never fall, but may grow non-monotonically. The desired range in terms // should never fall, but may grow non-monotonically. The desired range in terms
// of the underlying independent variable is provided at creation time. The // of the underlying independent variable is provided at creation time. The
// desired domain can be specified, or can be autosolved. Granularity of the // desired domain can be specified, or can be autosolved. Granularity of the
@ -2528,8 +2528,9 @@ typedef struct ncplot_options {
// number of "pixels" per row x column // number of "pixels" per row x column
ncgridgeom_e gridtype; ncgridgeom_e gridtype;
// independent variable can either be a contiguous range, or a finite set // independent variable can either be a contiguous range, or a finite set
// of keys. // of keys. for a time range, say the previous hour sampled with second
// FIXME give parameters for variables // resolution, the independent variable would be the range [0..3960).
int64_t minx, maxx;
} ncplot_options; } ncplot_options;
API struct ncplot* ncplot_create(struct ncplane* n, const ncplot_options* opts); API struct ncplot* ncplot_create(struct ncplane* n, const ncplot_options* opts);

6
src/input/keyplot.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <cstdlib>
#include <ncpp/NotCurses.hh>
int main(void){
return EXIT_FAILURE; // FIXME
}

View File

@ -67,7 +67,7 @@ int main(void){
sopts.itemcount = sizeof(items) / sizeof(*items); sopts.itemcount = sizeof(items) / sizeof(*items);
sopts.title = "this is truly an awfully long example of a MULTISELECTOR title"; sopts.title = "this is truly an awfully long example of a MULTISELECTOR title";
sopts.secondary = "pick one (you will die regardless)"; sopts.secondary = "pick one (you will die regardless)";
sopts.footer = "press q to exit (there is sartrev(\"no exit\")"; sopts.footer = "press q to exit (there is sartrev(\"no exit\"))";
channels_set_fg(&sopts.boxchannels, 0x20e0e0); channels_set_fg(&sopts.boxchannels, 0x20e0e0);
channels_set_fg(&sopts.opchannels, 0xe08040); channels_set_fg(&sopts.opchannels, 0xe08040);
channels_set_fg(&sopts.descchannels, 0xe0e040); channels_set_fg(&sopts.descchannels, 0xe0e040);