Commit Graph

320 Commits (47fa86f90d85296e8dd51d8ba10618a8f8efa36d)

Author SHA1 Message Date
joseLuís 4c048ef625 rust: finish adding Notcurses methods. 4 years ago
joseLuís fa693a89c1 rust: add most Notcurses methods.
- fix some comments.
4 years ago
joseLuís fd1b81c0f8 rust: add NcPixel methods.
- finish updating the functions.
4 years ago
joseLuís 0db4e48a6b rust: endianess updates for NcPixel & NcCell
- Update NcPixel functions, and their descriptions.
- Update NcPixel constructor.
4 years ago
joseLuís 6752741982 rust: add dynamic linesig control
- add new functions notcurses_linesigs_disable & notcurses_linesigs_enable.
- fix comments.
4 years ago
joseLuís de56912cc4 rust: keep adding NcPlane methods & more
- new type NcResizeCb.
- new functions ncresizecb_safe & ncresizecb_unsafe.
- update NcPlaneOptions constructors.
- Improve & fix comments.
4 years ago
joseLuís 183d6473cd rust: continue adding NcPlane methods.
- add new module fade.
  - new type NcFadeCb.
  - move NcFadeCtx here.
- add TOC for NcPlane methods sections.
- fix & improve comments.
- remove deprecated ncplane functions.
4 years ago
joseLuís 84987b61a9 rust: refactor ncbox, ncalign; add NcPlane methods.
- wrap NCBOX* constants.
- new NcBoxMask type.
- new NCRESULT_MAX const.
- add NcPlane box & perimeter methods.
- move NcAlign to notcurses mod.
- update notcurses_align & test.
- improve comments.
- rustfmt.
4 years ago
joseLuís 493298f0f1 rust: new dimension types & NcPlane methods.
- add new NcDimension and NcOffset types.
- add more NcPlane methods.
- remove NcPlane methods:
  - ncplane_put_egc.
- add missing NCKEY_ESC and NCKEY_SPACE keycodes.
- add notcurses methods: getc_nblock.
- fix comments.
- rustfmt.
4 years ago
joseLuís 2957893da9 rust: update cell tests; minor doc fix 4 years ago
joseLuís 7f175cf37c rust: NcCell width-aware constructors #1203 #1205 4 years ago
joseLuís 4cca3ddd48 rust: working on input
- make char: all NCKEY_* constants.
- make const fn: nckey_mouse_p, ncinput_equal_p & NcInput::new.
- make rsleep!() return the notcurses_render() result.
- new Notcurses constructor with_flags().
- new example: full-input.rs.
- fix comments.
4 years ago
Nick Black 6106dea18a
track+use width for polycolumn EGCs #1203 (#1205)
Some EGCs are more than 2 columns (wcwidth() never returns more than 2, so far as i can tell, but when multiple characters combine, we use the sum). An example would be ကြေ (Myanmar) which occupies three columns over the course of three characters. Track the width (biased by 1) in cell->width, taking over 8 bits from cell->reserved. Use this width in rasterization. Closes #1203.
4 years ago
joseLuís b229f0247c rust: update some comments 4 years ago
nick black 10c8dec7c0
fix up notcurses_debug rust test #1189 4 years ago
joseLuís ac29cab8e4 rust: fix documentation building; #1125
- Preparing to host the documentation in the github pages, at least until
- libnotcurses-sys can get into Ubuntu 20.
- fix Cargo.toml, add documentation link.
- update documentation link in README.
- improve lib doc comment, among others.
4 years ago
joseLuís a0e1577b56 rust: fix comments 4 years ago
joseLuís 96eaa29484 rust: add lib doc comments with examples 4 years ago
joseLuís c46c06a2e9 rust: move NcScale & NcVisual to visual module 4 years ago
joseLuís 01f7434a9a rust: rename bindgen module to ffi 4 years ago
joseLuís d19c753227 rust: use cstring macro instead of CString function 4 years ago
joseLuís 57d2eddbf5 rust: more refactoring, channel methods, new macro.
- add NcChannel methods
- add the `NcChannelMethods` Trait to be able to use them,
  since you can't implement methods over a primitive otherwise, unlike over a struct like NcPlane. And NcChannel is a type alias of `u32`.
- create more channel functions, to set the r,g,b separately.
- made some functions const
- add new rsleep![] macro, for rendering before sleeping.
- improve doc comments.
- fix previous commits.
4 years ago
joseLuís 5def609c73 rust: add stats methods 4 years ago
joseLuís e822e85a14 rust: Drop trait doesn't work with &muts; del impls 4 years ago
joseLuís 2483771af1 rust: Don't derive the Copy trait
- implement the Drop trait for the all the obvious types.
- resolve lifetime issues revealed from not being Copy.
  - return
4 years ago
joseLuís 6ad18bfa7b rust: refactoring and corrections.
- reorder cell, ncchannel & ncplane reimplemented functions.
- minor fixes and corrections.
- improve doc comments.
4 years ago
joseLuís 01e4f7de5a rust: big refactor
- move tests to their own submodules
- move functions reimplementations to reimplemented submodule.
- remove types submodules and move them to their parent.
- add more NcPlane & Notcurses methods
- rename NcChar back to NcEgc, and NcCharBackstop tp NcEgcBackstop
- add ncpile_top & ncpile_bottom functions.
- fix Notcurses stdplane(_mut) methods
- make cell_load_char not return anything since it was always 1.
4 years ago
joseLuís 38bdc627a4 rust: more refactoring
- new macros module, with sleep![] and cstring![] macros.
- rename NCell constructors.
- more plane methods.
- improve doc comments.
4 years ago
joseLuís 4ea2ccc51d rust: more refactor and fixes
- create some more notcurses tests.
- rename `constructors` submodules to `wrapped`.
- fix ncplane_str so to accept &str.
- implement some rusty methods for NcPlane, as a POC.
- improve multiple doc comments.
4 years ago
joseLuís 24640eb80e rust: big modules refactor
- remove the types module, and move the types definitions
  into submodules
- improve multiple comments
4 years ago
joseLuís 1206a281ec rust: keep refactoring and improving docs
- remove the use of inline code markings inside rustdoc [`links`],
  because they are too visually distracting.
- Use descriptive language in the doc comments, instead of imperative.
- Rename NcChannels to NcChannelPair, for improved clarity.
- Improve more comments, add inner links.
- Improve some tests.
- separate tests and constructors into submodules for cells and channels
4 years ago
joseLuís 279f36ec93 rust: more tests, refactors & improvements
- separate tests and constructors into submodules for cells and channels
- add missing functions channels_set_bg_palindex & channels_set_fg_palindex
- fix bug in channel_palindex_p function
- wrap NCSTYLE_* constants
- add more missing cell tests
- improve many doc comments
- fix some types
4 years ago
joseLuís e2ec27d413 rust: more tests, refactors & improvements
- add ncplane_putchar_yx & ncplane_putchar static functions
- complete test for channel_default_p
- add more tests for ncplane
- separate tests and constructors into submodules for ncplane and notcurses
- make public FILE_NC & FILE_LIBC
- improve integration tests.
- clean & rustfmt
- add constant NCRESULT_OK, NCRESULT_ERR and use them to refer to
  the NcResult values when appropriate
4 years ago
joseLuís 059007bd50 rust: more improvements
- fix bindings module, by not making public the wrapped bindgen types
- add notcurses_stddim_yx_const()
- fix return types of TODO
- add plane constructor new() wrapping ncpile_create()
- add plane constructor new_bound() wrapping ncplane_create()
- add plane constructor new_termsize() wrapping ncpile_create() with the terminal size
- add plane doc comment
4 years ago
joseLuís b64a257ecf rust: replace cell macros with constructors
- add NcCell constructors: new(), new_blank(), with_char()
- remove cell initializer macros
- update full-basics example
- add more doc comments
4 years ago
joseLuís 58c3d66c15 rust: add ncpile funcs & upd function-summary
- add functions ncpile_create, ncpile_render, ncpile_rasterize
- add new script tools/blame-nick.sh
- upd script tools/function-summary.sh and the generated data
- upd bindgen version
4 years ago
joseLuís 657da94887 rust: add MSRV
- make a little change to ensure MSRV 1.40.0
- show MSRV (Minimum Supported Rust Version) in README
- show up-to-date state of crate dependencies in README
- update comments
4 years ago
nick black ebc80915a3 c++/rust struck #1138 4 years ago
joseLuís 433068a5ae rust: further types cleanup
- made sigset_t private.
- made FILE_LIBC & FILE_NC private.
- add NCMETRIC_ prefix to the related constants.
- Improve more comments.
4 years ago
joseLuís 8b6495a894 rust: rename type aliases for consistency
Rename all bound types so that they start by Nc (and constants by NC),
except Notcurses:

- rename Cell to NcCell.
- rename CELL_* constants to NCCELL_*.
- rename Channel to NcChannel & Channels to NcChannels.
- rename CHANNEL_* constants to NCCHANNEL_*.
- rename Egc to NcChar & EgcBackstop to NcCharBackstop.
- rename Palette to NcPalette & PaletteIndex to NcPaletteIndex.
- rename IntResult to NcResult.
- rename Color to NcColor.
- rename Rgb to NcRgb.
- rename AlphaBits to NcAlphaBits.
- rename StyleMask to NcStyleMask.
- rename LIBC_FILE to FILE_LIBC & NC_FILE to FILE_NC.

Also:
- new type NcTime for timespec.
- rustfmt.
4 years ago
joseLuís 1dda2d7d58 rust: add new functions
- ncpile_create
- ncplane_reparent_family
- ncplane_resizecb
4 years ago
joseLuís e23cd63aac rust: improve comments
- use new syntax for doclinks
- improve some comments
- add README
4 years ago
nick black 7fa89b45da rust: unfuck ncaligns #1115 4 years ago
nick black 9ce821a045 [headscratch] 4 years ago
nick black ee019b2d5a rust: clear all mention of ncplane->horiz #1115 4 years ago
nick black bc245e09fc rust: drop ncplane_options__bindgen_ty_1 4 years ago
joseLuís 4de2652f8d rust: more fixes and improvements
- fix notcurses_init unit test
- fix fn call name: `nplane_at_cursor_cell` → `ncplane_at_cursor_cell`.
- make LIBC_FILE & NC_FILE type aliases with doc comment.
- add lib module comment.
- improve direct-cursor example.
- fix full-text example and rename it to full-basics.
4 years ago
joseLuís 9fe0363937 rust: improve testing
- add new alias `t_all` for running every test even if some fail.
- call it from `.drone.yml` to have more complete testing picture.
- add a new test for `notcurses_init` as the first test.
4 years ago
joseLuís 1f77571174 rust: cleanup
- remove deprecated functions ncplane_new & nctablet_ncplane
- fix some comments
- run rustfmt
4 years ago
joseLuís 9563c9e02e rust: new NcFile type to wrap libc::FILE
The notcurses FILE type (`NC_FILE`) is imported via bindgen as a struct,
while the equivalent Rust libc::FILE (`LIBC_FILE`) is an opaque enum.
Several methods are provided to convert back and forth between both types,
so it works both with rust libc operations and notcurses file I/O operations.

- new notcurses_debug() test as the first usage of `NcFile`
4 years ago
joseLuís 2e47618a6a rust: 2+ notcurses convenience constructors 4 years ago
joseLuís 08b000de28 rust: remove no_std; fix #1119 4 years ago
joseLuís d9a74dab26 rust: start adding notcurses tests 4 years ago
joseLuís 00f5001342 rust: ncplane constructors
- new NcPlane & NcPlaneOptions constructors.
- new NcHoriz enum for NcPlaneOptions horiz parameter.
- Make NCPLANE_OPTION_HORALIGNED u64 for consistency with expected value type.
4 years ago
nick black 259b2b6012
make it clear that sixel is not yet supported 4 years ago
joseLuís 04882971a2 rust: more refactoring
- make Notcurses `new()` constructor not output banners.
- add an additional constructor `with_banners()`.
- add new aliases for running examples silently.
- improve comments & run rustfmt.
4 years ago
joseLuís 7a164c3009 rust: continue reworking the API & improve documentation
- remove macros module and move macros to types submodules.
- document the macros.
- add ncmetric macros.
- add missing constants for NcVisual and ncmetric.
- add missing function ncstrwidth
- remove types/colors module and move the content to types/channel
- add more doc comments.
4 years ago
joseLuís f22dfd78b5 rust: continue reworking the API & improve documentation
- separate the `types` module into submodules to improve clarity & maintenance.
- more constructors for NcMenu, NcMenuItem, NcMenuSection, NcMenuOptions.
- add more missing docs, specially for constants
4 years ago
joseLuís 08a0da358e rust: continue reworking the API & improve documentation
- remove _IO_FILE import and usage.
- create handy constructors for NcDirect & Notcurses.
  (but can't implement destructors for copy types…).
- when possible substitute mutable pointers `*mut` for mutable references `&mut`
  with associated lifetimes.
- new widgets module, starting with NcReader & NcReaderOptions constructors
4 years ago
joseLuís 965a0771d8 rust: continue reworking the API & improve documentation
- rename `Pixel` to `NcPixel`
- rename `cell_simple_initializer` to `cell_char_initializer`
  and `cell_load_simple` to `cell_load_char`
- create constructor for `NcReader`
- fix and improve documentation for several types.
- Add `NcDirectOptions` struct and `NcDirectOptionHoriz` union
4 years ago
joseLuís 4673a86ea2 rust: API refactor & improve documentation
- rename EGC to Egc, EGCBackstop to EgcBackstop and ChannelPair to Channels.
- make the original type aliased structs non-public (e.g. ncdirect, ncalign…)
- fix and improve documentation for several types.
- revert renaming crate to nc on use.
- directly import the used types at the beginning of the module.

Now the rustdoc generated documentation is much cleaner.
4 years ago
joseLuís d82f0934b3 rust: show inline documentation for curated bindings 4 years ago
joseLuís 27628e961a rust: improve bindings 4 years ago
joseLuís a40cabb9d0 rust: move integration tests out of lib.rs 4 years ago
joseLuís c8316d75ae rust: continue improving bindings and API
- use libc types and functions directly when possible
	- char32_t -> u32 -> char
	- size_t -> u64
	- free()
	- strcmp()
	NOTE: it seems libc::timespec doesn't work with notcurses_getc()
- rename types
  	- Input -> NcInput
	- Scale -> NcScale
- `suppuabize` function is now private.
- `bindings` module is now public.
- improve comments.
4 years ago
joseLuís 98a2fcf336 rust: explicit bindgen imports for a better world 4 years ago
joseLuís 4beec0845f rust: type changes
- rename types in order to make them more similar to the original ones,
  and so that they play better alongside the higher types defined by
  notcurses-rs.
  	- Plane -> NcPlane
	- DirectMode -> NcDirect
	- DirectModeFlags -> NcDirectFlags
	- FullMode -> Notcurses
	- Align -> NcAlign
	- Blitter -> NcBlitter
	- Scale -> NcScale
- make `types` module re-exportable.
- rename nc module to notcurses.
- improve comments.
4 years ago
joseLuís d59d05990b rust: direct mode changes
- rename ncdirect_start to ncdirect_new
- add direct mode option flags
- fix examples
- refactor comments
4 years ago
joseLuís fed2d7cb9b rust: fix comments 4 years ago
joseLuís e8ff092f50 rust: fix input; add constructor 4 years ago
joseLuís 2f3d99e4e7 rust: fix visual 4 years ago
joseLuís cfb2bf0824 rust: add input module with 1 static function 4 years ago
joseLuís 09bdf6ebd4 rust: add visual module 4 years ago
joseLuís cb16c52eef rust: review functions; update headers 4 years ago
joseLuís 40621b7b95 rust: finish converting missing rgb calls 4 years ago
joseLuís 42250179f3 rust: add `Blitter` and `Scale` types 4 years ago
nick black c6c157a5ad
notcurses_stats_alloc() everywhere 4 years ago
joseLuís 5be9edd6f4 rust: convert all rgb calls & new plane functions #1024
- add (TBD) ncplane_putchar, ncplane_putchar_yx
- delete ncplane_bound, ncplane_new, ncplane_pusimple & ncplane_putsimple_yx
- rename `.*_[bf]g.*_rgb` → .`*_[bf]g.*_rgb8`
- rename `.*_[bf]g` → .`*_[bf]g.*_rgb`
4 years ago
nick black 21b8a50da0
rust: s/NCCHANNEL_ALPHA_MASK/CHANNEL_ALPHA_MASK/g 4 years ago
nick black 97dc50db1a kill stray entry in NEWS 4 years ago
nick black e42dbdfd60 _stainable() -> _stained() #985 4 years ago
nick black 4c7a1d0427 ncdirect_init: add flags parameter #976 4 years ago
joseLuís 1e6558fed9 new type aliases FullMode & Input 4 years ago
joseLuís 246cde91f9 +notcurses_align & modify ncplane_align #937 4 years ago
joseLuís 2c1c150969 rust: add more type aliases, format
add new type aliases for: cell, ncplane, palette256, ncalign_e &
ncdirect + alignment constants.
4 years ago
joseLuís 8c2d7bc5ac rust: EGC type safe wrapping for real this time 4 years ago
joseLuís 73961c04ce rust: rename ffi:: namespace to nc::
+rustfmt
4 years ago
joseLuís 9dc847c8b5 rust: add simple wrapper over ncdirect_init 4 years ago
joseLuís e975211a29 rust: even safer casting to char 4 years ago
joseLuís 356b44b015 rust: finish up EGC type safe wrapping. 4 years ago
joseLuís 3e4a074f8f rust: del ncplane_highgradient_sized due to #922 4 years ago
joseLuís cac8202e03 rust: egc char related fixes 4 years ago
joseLuís f25ba1b83c rust: +11 plane functions, ±finishing ncplane.
- Functions ncplane_putw* considered unnecessary from Rust.
- Functions & macros ncplane_printf* pending evaluation.
4 years ago
joseLuís 9b827f22b6 rust: +6 plane functions 4 years ago
joseLuís 915d59fb3e rust: +2 cell functions, finishing cells
- cell_prime and cells_load_box are unsafe fn, until a safer abstraction
  is built around gcluster, to avoid raw pointers dereferencing.
4 years ago
joseLuís 11287b6081 rust: rename types, add cell init macros
- +3 macros: cell_initializer, cell_simple_initializer and
  cell_trivial_initializer
- rename GraphemeCluster to EGC and GraphemeClusterBackStop to
EGCBackstop
- improve EGC doc comments
4 years ago
joseLuís 9c08411e27 rust: rustfmt 4 years ago
joseLuís e324cd404c rust: finish notcurses functions
+4 notcurses functions
4 years ago
joseLuís 154d3ef312 rust: +14 cell functions
WIP: cell_prime & cells_load_box
4 years ago
joseLuís 5eb9dc37d4 rust: finish channel functions
remove channels_blend()
4 years ago
nick black 05da44b06b
hide blending functions #917 4 years ago
joseLuís 18f90e394c rust: +22 cell functions 4 years ago
joseLuís 6cfd3d6ad7 rust: fix clippy compat with bindgen
and fix a couple of lints in plane.rs
4 years ago
joseLuís b1b8400165 rust: +8 plane functions; refactor 4 years ago
joseLuís a5fecf021e rust: update cells code 4 years ago
joseLuís ccac3d033e rust: update types 4 years ago
nick black 202b88615f
kill ncplane_styles(), duplicates ncplane_attrs() 4 years ago
nick black 8b072c0b5f rust: attrword -> stylemask, u32 -> u16 4 years ago
joseLuís 62e9c28a0a rust: update types info 4 years ago
joseLuís 8c2ed36c3a rust: update types info 4 years ago
joseLuís 9ff74c393a rust: improve types info 4 years ago
joseLuís 5ba618d6a8 rust: several fixes
- rename Alpha to AlphaBits
- fix pixel alpha mask
- fix syntax errors
4 years ago
joseLuís 55ad6153d2 rust: add a lot of info about types 4 years ago
joseLuís d3d8051f36 rust: fix channel tests 4 years ago
joseLuís d0f691af5f rust: +8 plane functions; fix headers; minor fixes 4 years ago
joseLuís 4720f23b12 rust: improve some channel functions & comments
Functions `channel_set_alpha()`, `channels_set_fg_alpha()` &
`channels_set_bg_alpha()` don't return an error anymore. Instead
of failing when the alpha value has others bits set, it gets
cleaned of other possible bits with bitmasking.

And in case of trying to use high contrast for the background
alpha gets reset to a default opaque.
4 years ago
joseLuís e1cfe9394f +2 plane functions; fix comments 4 years ago
nick black adcabfae52
rust: assimilate #883 4 years ago
nick black 17df279b66 libnotcurses-sys rust lowlevel bindings 5 years ago
Nick Black 4571b57ece
Rust/FreeBSD (#221)
* rust bindings
* update release documentation with Rust info
* panelreel tester: accept command-line options#180
* input: char32_t not wchar_t in output
* freebsd compilation issues #196
5 years ago