prepare modules for pending work
parent
8759572632
commit
799407f98c
@ -0,0 +1,31 @@
|
||||
// Already exported by bindgen: 0
|
||||
//
|
||||
// FUNCTIONS TO REIMPLEMENT:
|
||||
// - from notcurses.h: 2
|
||||
// - done: 0
|
||||
// - remaining: 2
|
||||
//
|
||||
// ---------------
|
||||
// + reimplemented
|
||||
// # and unit test
|
||||
// --------------
|
||||
// nckey_mouse_p
|
||||
// nckey_supppuab_p
|
||||
//
|
||||
|
||||
// use std::ffi::CString;
|
||||
//
|
||||
// use crate as ffi;
|
||||
// use crate::types::{ChannelPair, IntResult};
|
||||
|
||||
// // Is this char32_t a Supplementary Private Use Area-B codepoint?
|
||||
// static inline bool
|
||||
// nckey_supppuab_p(char32_t w){
|
||||
// return w >= 0x100000 && w <= 0x10fffd;
|
||||
// }
|
||||
//
|
||||
// // Is the event a synthesized mouse event?
|
||||
// static inline bool
|
||||
// nckey_mouse_p(char32_t r){
|
||||
// return r >= NCKEY_BUTTON1 && r <= NCKEY_RELEASE;
|
||||
// }
|
@ -0,0 +1,92 @@
|
||||
// Already exported by bindgen: 35
|
||||
//
|
||||
// notcurses_at_yx
|
||||
// notcurses_canchangecolor
|
||||
// notcurses_canfade
|
||||
// notcurses_canopen_images
|
||||
// notcurses_canopen_videos
|
||||
// notcurses_cansixel
|
||||
// notcurses_cantruecolor
|
||||
// notcurses_canutf8
|
||||
// notcurses_cursor_disable
|
||||
// notcurses_cursor_enable
|
||||
// notcurses_debug
|
||||
// notcurses_drop_planes
|
||||
// notcurses_getc
|
||||
// notcurses_init
|
||||
// notcurses_inputready_fd
|
||||
// notcurses_lex_blitter
|
||||
// notcurses_lex_margins
|
||||
// notcurses_lex_scalemode
|
||||
// notcurses_mouse_disable
|
||||
// notcurses_mouse_enable
|
||||
// notcurses_palette_size
|
||||
// notcurses_refresh
|
||||
// notcurses_render
|
||||
// notcurses_render_to_file
|
||||
// notcurses_reset_stats
|
||||
// notcurses_stats
|
||||
// notcurses_stdplane
|
||||
// notcurses_stdplane_const
|
||||
// notcurses_stop
|
||||
// notcurses_str_blitter
|
||||
// notcurses_str_scalemode
|
||||
// notcurses_supported_styles
|
||||
// notcurses_top
|
||||
// notcurses_version
|
||||
// notcurses_version_components
|
||||
//
|
||||
// FUNCTIONS TO REIMPLEMENT:
|
||||
// - from notcurses.h: 4
|
||||
// - done: 0
|
||||
// - remaining: 4
|
||||
//
|
||||
// ---------------
|
||||
// + reimplemented
|
||||
// # and unit test
|
||||
// --------------
|
||||
// notcurses_getc_blocking
|
||||
// notcurses_getc_nblock
|
||||
// notcurses_stddim_yx
|
||||
// notcurses_term_dim_yx
|
||||
|
||||
|
||||
// use std::ffi::CString;
|
||||
//
|
||||
// use crate as ffi;
|
||||
// use crate::types::{ChannelPair, IntResult};
|
||||
|
||||
|
||||
// // 'ni' may be NULL if the caller is uninterested in event details. If no event
|
||||
// // is ready, returns 0.
|
||||
// static inline char32_t
|
||||
// notcurses_getc_nblock(struct notcurses* n, ncinput* ni){
|
||||
// sigset_t sigmask;
|
||||
// sigfillset(&sigmask);
|
||||
// struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 };
|
||||
// return notcurses_getc(n, &ts, &sigmask, ni);
|
||||
// }
|
||||
//
|
||||
// // 'ni' may be NULL if the caller is uninterested in event details. Blocks
|
||||
// // until an event is processed or a signal is received.
|
||||
// static inline char32_t
|
||||
// notcurses_getc_blocking(struct notcurses* n, ncinput* ni){
|
||||
// sigset_t sigmask;
|
||||
// sigemptyset(&sigmask);
|
||||
// return notcurses_getc(n, NULL, &sigmask, ni);
|
||||
// }
|
||||
//
|
||||
// // notcurses_stdplane(), plus free bonus dimensions written to non-NULL y/x!
|
||||
// static inline struct ncplane*
|
||||
// notcurses_stddim_yx(struct notcurses* nc, int* RESTRICT y, int* RESTRICT x){
|
||||
// struct ncplane* s = notcurses_stdplane(nc); // can't fail
|
||||
// ncplane_dim_yx(s, y, x); // accepts NULL
|
||||
// return s;
|
||||
// }
|
||||
//
|
||||
// // Return our current idea of the terminal dimensions in rows and cols.
|
||||
// static inline void
|
||||
// notcurses_term_dim_yx(const struct notcurses* n, int* RESTRICT rows, int* RESTRICT cols){
|
||||
// ncplane_dim_yx(notcurses_stdplane_const(n), rows, cols);
|
||||
// }
|
||||
|
@ -0,0 +1,44 @@
|
||||
// Already exported by bindgen: 3
|
||||
//
|
||||
// palette256_free
|
||||
// palette256_new
|
||||
// palette256_use
|
||||
//
|
||||
// FUNCTIONS TO REIMPLEMENT:
|
||||
// - from notcurses.h: 3
|
||||
// - done: 0
|
||||
// - remaining: 3
|
||||
//
|
||||
// ---------------
|
||||
// + reimplemented
|
||||
// # and unit test
|
||||
// --------------
|
||||
// palette256_get_rgb
|
||||
// palette256_set
|
||||
// palette256_set_rgb
|
||||
|
||||
|
||||
// // Manipulate entries in the palette store 'p'. These are *not* locked.
|
||||
// static inline int
|
||||
// palette256_set_rgb(palette256* p, int idx, int r, int g, int b){
|
||||
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){
|
||||
// return -1;
|
||||
// }
|
||||
// return channel_set_rgb(&p->chans[idx], r, g, b);
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// palette256_set(palette256* p, int idx, unsigned rgb){
|
||||
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){
|
||||
// return -1;
|
||||
// }
|
||||
// return channel_set(&p->chans[idx], rgb);
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// palette256_get_rgb(const palette256* p, int idx, unsigned* RESTRICT r, unsigned* RESTRICT g, unsigned* RESTRICT b){
|
||||
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){
|
||||
// return -1;
|
||||
// }
|
||||
// return channel_rgb(p->chans[idx], r, g, b);
|
||||
// }
|
@ -0,0 +1,108 @@
|
||||
// Already exported by bindgen: 0
|
||||
//
|
||||
// FUNCTIONS TO REIMPLEMENT:
|
||||
// - from notcurses.h: 10
|
||||
// - done: 0
|
||||
// - remaining: 10
|
||||
//
|
||||
// ---------------
|
||||
// + reimplemented
|
||||
// # and unit test
|
||||
// --------------
|
||||
//
|
||||
// ncpixel
|
||||
// ncpixel_a
|
||||
// ncpixel_b
|
||||
// ncpixel_g
|
||||
// ncpixel_r
|
||||
// ncpixel_set_a
|
||||
// ncpixel_set_b
|
||||
// ncpixel_set_g
|
||||
// ncpixel_set_r
|
||||
// ncpixel_set_rgb
|
||||
|
||||
|
||||
// use std::ffi::CString;
|
||||
//
|
||||
// use crate as ffi;
|
||||
// use crate::types::{ChannelPair, IntResult};
|
||||
|
||||
|
||||
// // The ncpixel API facilitates direct management of the pixels within an
|
||||
// // ncvisual (ncvisuals keep a backing store of 32-bit RGBA pixels, and render
|
||||
// // them down to terminal graphics in ncvisual_render()).
|
||||
// static inline uint32_t
|
||||
// ncpixel(int r, int g, int b){
|
||||
// if(r < 0) r = 0;
|
||||
// if(r > 255) r = 255;
|
||||
// if(g < 0) g = 0;
|
||||
// if(g > 255) g = 255;
|
||||
// if(b < 0) b = 0;
|
||||
// if(b > 255) b = 255;
|
||||
// return 0xff000000ul | r | (b << 8u) | (g << 16u);
|
||||
// }
|
||||
//
|
||||
// static inline unsigned
|
||||
// ncpixel_a(uint32_t pixel){
|
||||
// return (pixel & 0xff0000fful) >> 24u;
|
||||
// }
|
||||
//
|
||||
// static inline unsigned
|
||||
// ncpixel_r(uint32_t pixel){
|
||||
// return (pixel & 0x000000fful);
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_g(uint32_t pixel){
|
||||
// return (pixel & 0x00ff0000ul) >> 16u;
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_b(uint32_t pixel){
|
||||
// return (pixel & 0x0000ff00ul) >> 8u;
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_set_a(uint32_t* pixel, int a){
|
||||
// if(a > 255 || a < 0){
|
||||
// return -1;
|
||||
// }
|
||||
// *pixel = (*pixel & 0x00fffffful) | (a << 24u);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_set_r(uint32_t* pixel, int r){
|
||||
// if(r > 255 || r < 0){
|
||||
// return -1;
|
||||
// }
|
||||
// *pixel = (*pixel & 0xffffff00ul) | r;
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_set_g(uint32_t* pixel, int g){
|
||||
// if(g > 255 || g < 0){
|
||||
// return -1;
|
||||
// }
|
||||
// *pixel = (*pixel & 0xff00fffful) | (g << 16u);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// static inline int
|
||||
// ncpixel_set_b(uint32_t* pixel, int b){
|
||||
// if(b > 255 || b < 0){
|
||||
// return -1;
|
||||
// }
|
||||
// *pixel = (*pixel & 0xffff00fful) | (b << 8u);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // set the RGB values of an RGB pixel
|
||||
// static inline int
|
||||
// ncpixel_set_rgb(uint32_t* pixel, int r, int g, int b){
|
||||
// if(ncpixel_set_r(pixel, r) || ncpixel_set_g(pixel, g) || ncpixel_set_b(pixel, b)){
|
||||
// return -1;
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
Loading…
Reference in New Issue