Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to lvgl's property API #50

Merged
merged 14 commits into from
Aug 4, 2024
Merged

Adapt to lvgl's property API #50

merged 14 commits into from
Aug 4, 2024

Conversation

XuNeo
Copy link
Owner

@XuNeo XuNeo commented Jul 21, 2024

Fix #11

Make full use of lvgl's property API for binding language.
For simple properties, luavgl will call lv_obj_property_ API directly.

luavgl_toproperty and luavgl_pushproperty is used to convert value between lua and lv_property_t.

New feature

Now the property can be accessed directly in nature way. E.g

obj.x = 123;
print("obj  x:", obj.x)

obj.align = lvgl.ALIGN.CENTER
obj.align = {
    type = lvgl.ALIGN.CENTER
    x_ofs = 10,
    y_ofs = 10,
}

@XuNeo XuNeo force-pushed the luavgl-property branch 5 times, most recently from 1cebfaa to 0b27ad9 Compare July 25, 2024 17:48
@XuNeo XuNeo force-pushed the luavgl-property branch 2 times, most recently from 674e286 to e33f873 Compare July 29, 2024 14:29
@XuNeo XuNeo force-pushed the luavgl-property branch 2 times, most recently from 6dcebf6 to 11a193b Compare August 3, 2024 18:03
XuNeo and others added 9 commits August 4, 2024 14:31
Now the property value can be set and get directly using methog like:
print(obj.bg_color)
obj.align = lvgl.ALIGN.CENTER

Signed-off-by: Neo Xu <[email protected]>

property value should be initialized to zero

Signed-off-by: Neo Xu <[email protected]>
@XuNeo XuNeo force-pushed the luavgl-property branch 2 times, most recently from 5493ea0 to 9a927ba Compare August 4, 2024 06:48
@XuNeo XuNeo marked this pull request as ready for review August 4, 2024 06:48
@XuNeo XuNeo force-pushed the luavgl-property branch from 9a927ba to 8a63b9d Compare August 4, 2024 06:54
@XuNeo
Copy link
Owner Author

XuNeo commented Aug 4, 2024

Not all changes have been upstreamed, thus switched to https://github.com/XuNeo/lvgl/tree/luavgl-property

@XuNeo XuNeo merged commit a3d8c7f into master Aug 4, 2024
1 check passed
@XuNeo XuNeo deleted the luavgl-property branch August 4, 2024 07:00
@XuNeo XuNeo mentioned this pull request Aug 4, 2024
Closed
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make full use LVGL's property API
1 participant