Add info about what is implemented to the README

This commit is contained in:
Rafael Caricio 2020-06-02 09:39:02 +02:00
parent 532cf3cf1b
commit 9ec78a70cb
2 changed files with 72 additions and 4 deletions

View file

@ -67,3 +67,63 @@ Then run the `demo` example:
```shell
$ DEP_LV_CONFIG_PATH=`pwd`/examples/include cargo run --example demo
```
## Feature Support
The bindings are still in development. There are many features of LVGL that needs to be exposed by `lvgl-rs`. In
this section you can check what is implemented at the moment.
### Features
List of LVGL features that impacts the library usage in general.
- [x] Displays: We use [`embedded_graphics`](https://docs.rs/embedded-graphics/0.6.2/embedded_graphics/) library to
draw to the display. You can use `lvgl-rs` with any of the
[`embedded_graphics` supported displays](https://docs.rs/embedded-graphics/0.6.2/embedded_graphics/#supported-displays).
- [x] Events: You can listen and trigger events in widget objects.
- [x] Styles: Partially supported. You can set styles in any exposed object. We are still missing the
possibility of defining base styles.
- [ ] Input Devices
- [ ] Fonts
- [ ] Images
- [ ] File system
- [ ] Animations
- [ ] Tasks
### Widgets
- [x] Base object (lv_obj)
- [ ] Arc (lv_arc)
- [x] Bar (lv_bar)
- [x] Button (lv_btn)
- [ ] Button matrix (lv_btnm)
- [ ] Calendar (lv_calendar)
- [ ] Canvas (lv_canvas)
- [ ] Checkbox (lv_cb)
- [ ] Chart (lv_chart)
- [ ] Container (lv_cont)
- [ ] Color picker (lv_cpicker)
- [ ] Drop-down list (lv_ddlist)
- [ ] Gauge (lv_gauge)
- [ ] Image (lv_img)
- [ ] Image button (lv_imgbtn)
- [ ] Keyboard (lv_kb)
- [x] Label (lv_label)
- [ ] LED (lv_led)
- [ ] Line (lv_line)
- [ ] List (lv_list)
- [ ] Line meter (lv_lmeter)
- [ ] Message box (lv_mbox)
- [ ] Page (lv_page)
- [ ] Preloader (lv_preload)
- [ ] Roller (lv_roller)
- [ ] Slider (lv_slider)
- [ ] Spinbox (lv_spinbox)
- [ ] Switch (lv_sw)
- [ ] Table (lv_table)
- [ ] Tabview (lv_tabview)
- [ ] Text area (lv_ta)
- [ ] Tile view (lv_tileview)
- [ ] Window (lv_win)
Widgets currently implemented might have some missing features. If the widget you want to use is not exposed or
is missing a feature you want to make use, please send a Pull Request or open an issue.

View file

@ -14,16 +14,16 @@ pub trait NativeObject {
fn raw(&self) -> ptr::NonNull<lvgl_sys::lv_obj_t>;
}
/// Stores the native LittlevGL raw pointer.
/// Generic LVGL object.
///
/// This is the parent object of all widget objects in `lvgl-rs`.
/// This is the parent object of all widget types. It stores the native LVGL raw pointer.
///
/// # Panics
///
/// Panics if LittlevGL internally deallocated the original object.
/// Panics if LVGL internally freed the original object.
pub struct ObjectX {
// We use a raw pointer here because we do not control this memory address, it is controlled
// by LittlevGL's C code.
// by LVGL's global state.
raw: *mut lvgl_sys::lv_obj_t,
}
@ -125,6 +125,14 @@ impl Object for ObjectX {
}
}
impl Default for ObjectX {
fn default() -> Self {
Self {
raw: unsafe { lvgl_sys::lv_obj_create(ptr::null_mut(), ptr::null_mut()) },
}
}
}
macro_rules! define_object {
($item:ident) => {
pub struct $item {