Commit Graph

78 Commits

Author SHA1 Message Date
Daniel Brooks
477797716f remove unsafe code from example “issue-1716”
Now that the NcDirectF type and its methods are defined, there is no
need to set a bad example.
2021-06-03 09:09:57 -07:00
joseLuís
f44175b9c3 [rust] update example for issue #1716 2021-06-03 16:12:30 +02:00
joseLuís
1c6a50e047 [rust] add example for issue #1716 2021-06-03 14:25:20 +02:00
joseLuís
47c794050a [rust] update example #1699 2021-06-01 10:18:37 +02:00
joseLuís
8fa70935fe [rust] update issue-1699 example 2021-05-30 17:42:18 +02:00
joseLuís
e839a95c2b [rust] fix build, remove raqote 2021-05-30 17:35:27 +02:00
joseLuís
7e51f04111 [rust] new example issue-1699; issue #1700
- add raqote 2D graphics library as a dev-dependency
2021-05-30 17:08:58 +02:00
nick black
8025beb6d8
[rust] fix issue-1559 example, i think #1559 2021-05-08 15:28:31 -04: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
dcfb368b21 [rust] remove example for issue #1575; fix warning
- delete file issue-1573.rs (wrongly named)
- fix warning in example issue-1559
2021-05-03 18:22:04 +02:00
Nick Black
ba6088578d
Sixel unit tests #1580 (#1586)
Two unit tests on Sixel round trips, one with wipes #1580.
2021-04-24 01:51:26 -04: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
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
a3017033a6 [rust] new example issue-1573 #1573 2021-04-22 01:44:59 +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
6ab072c953 [rust] update example pixel-cell & remove poc-planebase 2021-04-18 17:14:28 +02:00
joseLuís
1e69b48bbd [rust] add example issue-1559 #1559 2021-04-18 15:46:53 +02:00
joseLuís
c7f1c32f7f [rust] update pixel-cell example; #1546 2021-04-18 13:56:49 +02:00
joseLuís
08a3edb71f [rust] update pixel-cell example; #1546 2021-04-18 11:33:58 +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
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
76241f81d2 [rust] adapt pixel-cell.rs 2021-04-10 12:02:58 -04:00
joseLuís
932f4c1b7c [rust] simplify issue-1509 example 2021-04-10 15:54:38 +02:00
joseLuís
1afe6f162e rust: add new pixel geometry functionality
- add NcPlane method .pixelgeom.
- upgrade full-capabilities example.
- fix NcVisual method .blitter_geom docs.
- rustfmt
2021-04-10 15:09:02 +02:00
joseLuís
66d4f323e8 rust: fix .gitignore; remove issue example
- make .gitignore just ignore the *root* build dir
- remove unneeded rust/.gitignore
- remove no longer needed issue-rgba.rs
2021-04-10 13:03:54 +02:00
joseLuís
429ca673d3 rust: several fixes; add example for issue #1509
- fix method name: NcPlane.at_yx_cell().
- tell bidngen derive more traits when it can
- update .gitignore so it doesn't ignore rust/build
2021-04-08 14:48:16 +02:00
joseLuís
7d51756a12 rust: new poc-planebase example; doc improvements
- improve NcVisual.from_rgba documentation.
- fix Notcurses.term_dim_yx documentation.
- new example `poc-planebase` to help find the bug.
- improve full-capabilities example a little.
2021-04-08 13:11:06 +02:00
joseLuís
60c874f835 rust: impl ncplane_as_rgba; refactor macros
- rename and refactor NcPlane method rgba() to as_rgba().
- add example `issue-rgba` that shows a problem when the plane has text.
- refactor `error_ref` & `error_ref_mut` macros to allow custom return values
2021-04-08 11:07:04 +02:00
joseLuís
36a7355cd8 rust: minor examples updates 2021-04-07 21:27:10 +02:00
joseLuís
ae2af14281 rust: new methods, refactor methods and planes example
- add NcChannelPair constructors.
- change some NcChannel methods to return Self: set(), set_alpha()
- add NcPlane methods move_rel() & resize_simple_rel().
- add example full-planes (WIP).
- remove proto-example full-basics.
- small update of poc-menu example.
2021-04-07 20:32:46 +02:00
joseLuís
435b8cb6a7 rust: refactor examples & palette_size method
- refactor Notcurses.palette_size() to return an NcResult.
- refactor & rename example direct-text.rs to direct-capabilities.rs.
- new example full-capabilities.rs
2021-04-07 14:49:44 +02:00
joseLuís
aa9bf7a0e7 rust: add ncplane_abs_yx, ncplane_abs_y, ncplane_abs_x
- minor updates
2021-04-07 11:47:05 +02:00
joseLuís
63d8645f04 rust: improve pixel-cell example 2021-04-06 12:30:32 +02:00
joseLuís
89e38c11f3 rust: add ncvisual methods & pixel-cell example 2021-04-05 23:55:24 +02:00
joseLuís
1c5ee9eb8c rust: add more functions and methods
- add functions: ncdirect_core_init & notcurses_core_init (methods pending)
- add functions & methods: ncdirect_readline & notcurses_can_braille
- minor fixes
2021-04-05 19:34:39 +02:00
joseLuís
5492119263 rust: add *_check_pixel_support functions + example 2021-04-05 11:16:34 +02:00
joseLuís
797ef4b0ae rust: more changes and improvements
- raw field of new wrapping structs is now public just to the crate.
- NcNotcurses.stdplane method now doesn't return an NcResult since it can't fail.
- rename NcNotcurses to Notcurses and NcNotcursesOptions to NotcursesOptions.
- rename NcPlane::new_termsize constructor to with_termsize.
- bump MSV to 1.48 for the doc links.
- improve lib documentation.
- minor fixes.
2021-01-03 02:40:41 +01:00
joseLuís
bad3449205 rust: rename Notcurses to FullMode; update doc 2021-01-02 22:58:35 +01:00
joseLuís
f5f9397f7b rust: add new wrapper type over NcDirect called DirectMode. 2021-01-02 22:50:48 +01:00
joseLuís
6b2805937d rust: add new wrapper type over notcurses struct.
Create new wrapping types that can safely encapsulate the mutable references,
and implement Drop and automatic (de)referencing.

- Notcurses
  - rename Notcurses* to NcNotcurses*.
  - rename NotcursesOptions to NcNotcursesOptions.
  - new Notcurses struct.
    - implement Drop, AsRef, AsMut, Deref & DerefMut.
    - override stop method to be no-op.
    - reimplement constructors and associated methods.
  - remove without_altscreen_with_banners constructor.
- update examples and tests.
- rustfmt.
2021-01-02 19:45:15 +01:00
joseLuís
3bf9f11c80 rust: improve direct-cursor example.
- add `rand` as a dev-dependency.
2021-01-01 21:47:41 +01:00
joseLuís
9156cec58f rust: add handy constructors for NcChannel
- fix direct-cursor example.
2021-01-01 20:56:30 +01:00
joseLuís
500456e2e5 rust: continue working on the poc-menu example.
- change return type of NcMenu.selected to Option.
- change type to &str in ncplane_set_base.
- bonus: update some comments.
2021-01-01 14:17:01 +01:00
joseLuís
1d4653e7c8 rust: rename NcInput's new() to new_empty(); add new() 2021-01-01 13:59:30 +01:00
joseLuís
5e7bf86b9c rust: almost complete poc-menu example, still has bugs.
- add NcMenuSection::new_separator() constructor.
- rename constructor method for an empty NcInput to new();
- fix notcurses_getc_blocking() function name and error logic.
- improve comments.
- change type of NCMENU_OPTION_* to u64 (like in C API)
- fix error_str![] macro.
- improve error messages.
2020-12-31 00:11:49 +01:00
joseLuís
31e7305ce8 rust: start improving errors reporting.
- refactor error![] macro, switch place for $msg & $ok parameters.
- add more meaningful NcError return values in several functions related with poc-menu example, for starters.
- the poc-menu example now doesn't randomly fail, IDKW but OK I guess.
- minor unrelated corrections.
2020-12-30 19:11:55 +01:00
joseLuís
8e5e60f588 rust: Continue with poc-menu example.
- add NcPlane.pustr_aligned() method.
- disable notcurses_stddim_yx* functions & methods for now.
- make input argument optional for notcurses_getc_nblocking().
- update full-basics example.
- fix comments.
2020-12-30 18:40:54 +01:00
joseLuís
7b4c105fdf rust: finish updating rust for ncdirect changes
- update function and method names.
- update intra-doc links.
- update examples.
2020-12-29 02:56:01 +01:00
joseLuís
55d49a43f6 rust: continue NcMenu PoC example; fixes
- modify ncmenu constructor Accept &mut[] instead of Vec<> to avoid FFI related problems. Furthermore, from rust 1.48 it's easy to convert a Vec into an array using the std::convert::TryInto trait.
- fix ncmenu method names.
- fix & refactor Notcurses contructors; add `with_debug` constructor.
- make NcPlane.set_base receive a char instead of a reference, since it's copy.
- add `rre` cargo alias for running examples on release.
2020-12-27 19:00:32 +01:00