Commit Graph

261 Commits

Author SHA1 Message Date
joseLuís
2c8a364f3a [rust] fix pixel-cell example
- fix column and row order in visual resize methods
2021-06-13 22:39:11 +02:00
joseLuís
3d830f5e73 [rust] updates against 2.3.4
- remove ncvisual_inflate and add ncvisual_resize_noninterpolative & fix example.
- add notcurses_detected_terminal & ncdirect_detected_terminal.
- take into account new static functions pending to implement:
  ncdirect_light_box, ncdirect_heavy_box, nccells_light_box, nccells_heavy_box, nccells_ascii_box.
- update module info headers notation.
2021-06-13 13:07:00 +02:00
joseLuís
125ab361e6 [rust] add pending functions
- include new functions: ncdirect_stream, ncdirect_supported_styles, ncdirect_styles, nccell_width, ncinput_nomod_p.
- account for functions: ncplane_halign, ncplane_valign.
- rename ncpalette_get_rgb and ncpalette_set_rgb to ncpalette_get_rgb8 and ncpalette_set_rgb8 respectively.
- minor formatting fixes.
2021-06-12 21:29:03 +02:00
joseLuís
ad7b67ec5b [rust] fix docs 2021-06-11 12:14:43 +02:00
joseLuís
fce6ee22db [rust] update ncdirectf_geom & NcVGeom #1746 #1749 2021-06-10 14:43:17 -04:00
joseLuís
8432486b26 explain the return value of ncplane_set_base 2021-06-10 19:34:13 +02:00
joseLuís
0ea7c5236d [rust] add example issue #1751 2021-06-10 10:03:27 +02:00
joseLuís
8d902f5c2b [rust] update ncdirectf_render #1738 2021-06-09 13:42:52 +02:00
joseLuís
9d1ca028c5 [rust] fix ncdirectf_render method #1738 2021-06-09 06:57:15 -04:00
joseLuís
852cde9a75 [rust] add NCVISUAL_OPTION_NOINTERPOLATE
- update the `pixel-cell` example.
- change the type of ncvisual flags parameter to u32.
- minor doc fixes.
2021-06-08 21:18:58 +02:00
joseLuís
6f1f544b77 [rust] add prsleep macro + fixes
- add prsleep macro for rendering & rasterizing a plane pline + sleep
- fix some comments and refactor a little
2021-06-08 20:27:36 +02:00
Daniel Brooks
313f1caaa0 cargo doc complains about some urls that are not turned into links
so turn them into links.
2021-06-08 04:29:59 -07:00
joseLuís
c3f1d6c4a3 [rust] wrap ncdirectf functions
- add type aliases: NcDirectF (NcVisual alias), NcDirectV (NcPlane alias).
- implement wrapper methods for the `ncdirect_*` functions on NcDirectF.
- the methods over NcDirectF are prefixed with `ncdirectf_` to distinguish them
  from the other NcVisual methods (since they are both type aliases, they
  share their methods).
- fix typos in `direct.h`:
  - ncdirect_geom_frame > ncdirectf_geom()
  - ncdirect_render_loaded_frame > ncdirectf_render()
- add NcVGeom struct.
- minor fixes & rustfmt.
2021-06-03 16:08:54 +02:00
joseLuís
812a29e219 [rust] add ncdirectf functions; fix build
- ncdirectf_from_file, ncdirectf_geom, ncdirectf_render, ncdirectf_free
2021-06-03 14:34:45 +02:00
joseLuís
18446034e4 [rust] add ncblit functions
- ncblit_rgba, ncblit_bgrx, ncblit_rgb_packed, ncblit_rgb_loose
2021-06-03 14:24:42 +02:00
Nick Black
cd2b5de5fa
Panblitter ncplane_as_rgba() (#1697)
ncplane_as_rgba: genericize across blitters

ncplane_as_rgba() previously was implemented explicitly
in terms of NCBLIT_2x1. it now uses the `egcs` field of the
`blitset`. this supports NCBLIT_2x2 and NCBLIT_3x2 in
ncplane_rgba(). Closes #1490.
2021-06-01 02:25:11 -04:00
joseLuís
95fa72c3e7 [rust] update mergedown doc comment
- fix more warnings
2021-05-06 21:22:22 +02:00
joseLuís
5ec11e5897 [rust] remove ncplane_vprintf
- remove `__va_list_tag`

The `printf` functions wont be implemented, since they require
`__va_list` which causes compatibility problems.
2021-05-06 14:44:51 +02:00
joseLuís
5f3b2f79cf [rust] fix bindgen imports
- update blacklist rules
- use ffi `__va_list_tags`
2021-05-06 14:40:12 +02:00
joseLuís
c52e9c5a47 [rust] add NCVISUAL_OPTION_CHILDPLANE
- update docs
2021-05-06 14:31:31 +02:00
joseLuís
7e7082e836 [rust] adjust bindgen imports.
- only import functions from the notcurses public API
- exclude more unneeded types from being imported.
- use custom `__va_list_tag`
2021-05-06 14:10:46 +02:00
joseLuís
66e20bdac8 [rust] safely wrap ncmetric function & fix warnings
- fix warnings on doc generation from imported C API doc-comments
- fix remaining clippy warning
2021-05-06 13:39:30 +02:00
joseLuís
81f63f0e3b [rust] fix docs 2021-05-06 13:08:21 +02:00
joseLuís
87f92546db [rust] remove raw_wrap macro 2021-05-06 13:01:56 +02:00
joseLuís
aa0e242a7a [rust] bugfix & a couple of minor updates 2021-05-05 20:34:04 +02:00
joseLuís
b7bfbb0f90 [rust] fix hundreds of clippy warnings 2021-05-05 20:28:51 +02:00
joseLuís
129e208438 [rust] refactor Notcurses & NcDirect wrapping approach
- remove `Nc` & `NcD` wrappers, to move them to notcurses-rs library.
- update the summary header format for Notcurses and NcDirect
- update docs and examples
2021-05-05 19:33:00 +02:00
joseLuís
6966cd78b5 [rust] more channels refactor
- make ncplane_set_channels and NcPlane::set_channels don't return the NcChannelPair
- add safe function wrapper for ncplane_channels
- fix docs
2021-05-04 00:42:12 +02:00
joseLuís
d886e01fea [rust] refactor channels
- rename channel* functions to ncchannel*
- rename NcPlane methods:
  - fg_default_p to fg_default
  - bg_default_p to bg_default
- new functions:
  - ncplane_set_default
  - ncplane_set_not_default
  - ncplane_set_fg_not_default
  - ncplane_set_bg_not_default
- new NcPlane methods:
  - set_channels
  - set_default
  - set_not_default
  - set_fg_not_default
  - set_bg_not_default
- new safe wrapper functions:
  - ncplane_set_fchannel
  - ncplane_set_bchannel
  - ncplane_set_channels
2021-05-04 00:26:18 +02:00
joseLuís
e9a841954d [rust] more functions to manage the "default color"
- new functions:
  - channel_set_not_default
  - channels_set_fg_not_default
  - channels_set_bg_not_default
  - channels_set_default
  - channels_set_not_default
- new NcChannel methods:
  - set_not_default
- new NcChannelPair methods:
  - set_fg_not_default
  - set_bg_not_default
  - set_default
  - set_not_default
- improve the test of: channel_set_default
- add tests for:
  - channel_set
  - channel_set_not_default
- add doc comments to existing NcChannel reimplemented functions tests.
2021-05-03 19:25:05 +02:00
Nick Black
2c5d938cbd
Paint sprixels bottom-to-top (#1589)
* Paint sprixels in order, bottom-to-top

We don't want to have to track sprixel order whenever someone
moves an ncplane, so just keep a list growing backwards as we
pass top-to-bottom in notcurses_render_internal(). Each time
we hit a sprixel plane, splice it out of the sprixel list, and
add it to the front of our temporary list. When we hit the
bottom, stick this temporary list on the end of our existing
list (any such planes are to be deleted, which comes before
drawing). Closes #1575.

* reorder collected sprixellist; solves kitty but breaks sixel =/ #1575

* remove debugging cruft

* [rust] fix up mergedown mutability
2021-04-24 13:08:09 -04:00
joseLuís
bb669965c2 [rust] #1339 1st fix attempt multiple architecture bugs
# List of architectures per type of bug

>  `__va_list_tag` not found
> (differentiate between x86_64|s390x and the rest)
i686:
aarch64:
armv7l: (a similar name exists in the module: `__va_list`)
ppc64le:

- [x] bindings.rs:24

> (expected u32, found u64)
> (differentiate between i686|armv7l and the rest)
i686:
armv7l:

- [x] src/notcurses/methods.rs:531:75 `notcurses_render_to_buffer`
- [x] src/plane/reimplemented.rs:167:55 `ncplane_putnstr_yx`

> expected [0;32]
> (differentiate between i686|armv7l and the rest)
i686:
armv7l:

- [x] src/signal.rs:15:23 `__val: [0; 16]`

> (expected `u8`, found `i8`)
> (differentiate between x86_64|i686 and the rest)
aarch64:
armv7l:
ppc64le:
s390x:

- [x] src/direct/methods.rs:663:60 `ncdirect_hline_interp`
- [x] src/direct/methods.rs:685:60 `ncdirect_vline_interp`
- [x] src/notcurses/methods.rs:531:65 `notcurses_render_to_buffer`
- [x] src/plane/methods.rs:1901:17
- [x] src/plane/reimplemented.rs:697:13
2021-04-22 14:49:14 +02:00
joseLuís
9e2add4e46 [rust] update capabilities, support new functions.
- add new Notcurses methods: `canhalfblock()` and `canquadrant()`.
- add doc links to NCBLIT_* flags from the capabilities methods.
- update the full-capabilites example to include `canhalfblock`, `canquadrant`,
  `canchangecolor` and `canfade` functions.
- rustfmt
2021-04-22 12:25:24 +02:00
joseLuís
97d8c91a1a [rust] palette256 -> ncpalette #1573 2021-04-22 11:57:07 +02:00
joseLuís
5c216c2f9b [rust] blitter related updates
- move blitter type, NCBLIT_* constants and NcPixelGeometry from the plane module to the visual module.
- add information about blitter graceful degradation the NcBlitter type.
- add cross linking from/to the NCVISUAL_OPTION_NODEGRADE flag.
- update the full-capabilites example to include braille.
2021-04-22 02:12:08 +02:00
joseLuís
c57a7b33cf [rust] derive Debug for Nc & NcD 2021-04-22 00:49:36 +02:00
joseLuís
bc123fbba8 undo prev. ncvisual_resize related changes #1559 2021-04-18 22:03:17 +02:00
joseLuís
0ec15fa920 update doc for ncvisual_resize; fix #1559 2021-04-18 21:38:25 +02:00
joseLuís
88c89f2d30 [rust] add ncvisual_inflate; update function-summary; fixes
- add ncvisual_inflate function
- update function-summary script & related data
- update cell inner comments.
- fix several doc inner links.
2021-04-18 11:15:33 +02:00
joseLuís
eaee89c99f [rust] renamed FullMode & DirectMode to Nc & NcD
- improve pixel-cell example.
- rustfmt
2021-04-17 22:13:43 +02:00
nick black
e1d97bfb62
[rust] cell_ -> nccell_ drudgery #1532 2021-04-15 22:41:48 -04:00
nick black
b070b69eb2
get last remaining cell_ functions -> nccell_ #1532 2021-04-15 22:29:53 -04:00
joseLuís
452b7cd535 [rust] renamed cell_* functions to nccell_* 2021-04-15 20:45:08 +02:00
Nick Black
e591ec2e98
cell -> nccell throughout much of remaining API (#1535)
cell -> nccell throughout much of the API #1532
2021-04-14 06:42:14 -04:00
joseLuís
5f96acc9e3 [rust] refacture NcVisual module
- separate the methods into its own module.
- add constants NCVISUAL_OPTION_ADDALPHA, NCVISUAL_OPTION_HORALIGNED, NCVISUAL_OPTION_VERALIGNED
- add NcRgba type.
- update the docs.
2021-04-10 20:19:13 +02:00
joseLuís
48ab7e0945 [rust] fix #1509
- fix bugs in macros: error, error_ref & error_ref_mut
- remove issue-1509 example
- minor improvements
- rustfmt
2021-04-10 19:26:55 +02:00
nick black
bb0d6c2e80 [rust] update fullsize_pixel_without_plane() 2021-04-10 12:02:58 -04:00
nick black
bac7d634d9 [visual] pipe transcolor through, use it everywhere #1518 2021-04-10 12:02:58 -04:00
nick black
33929cf91e
[rust] update to nccell 2021-04-10 09:33:01 -04:00
joseLuís
bc80350384 [rust] several fixes
- fix after renaming cell functions.
- fix some NcVisual method names and docs
- fix some rustdoc warnings
2021-04-10 15:29:55 +02:00