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

Detail ways to create a C++ binding #13

Open
boulabiar opened this issue Apr 9, 2024 · 2 comments
Open

Detail ways to create a C++ binding #13

boulabiar opened this issue Apr 9, 2024 · 2 comments

Comments

@boulabiar
Copy link

I opened this issue to discuss ways to create C++ bindings for lvgl.

I don't think the bounty will do it, especially with the conditions that it should be perfect and with examples..
So let's discuss how to do the binding and start with simple examples so it can be done one step each time.

Can we generate code from the rust bindings ? so we have similar APIs ?

@kisvegabor
Copy link
Member

I think we should use the JSON generated from LVGL's API and generate the C++ binding based on that.

@kdschlosser
Copy link

If the JSON generation code gets added to LVGL the workload of putting together a C++ binding just got reduced by a HUGE amount. Couple that with the documentation for LVGL being available in that JSON output and now you can add that documentation to the binding code and make changes to the documentation programmatically so it would suit the C++ binding.

Examples and unit tests would probably need to be written by hand. unit tests are pretty easy to do actually. Instead of writing the data to a display in the flush callback you dump it into a buffer and you compare the data in that buffer to the data of what the expected output is supposed to be. You basically add a bunch of widgets you want to test and size them how you want and then call lv_refr_now and that will force the rendering to take place and the flush callback to get called. The only thing that you need to do special is setting the render mode to direct and making the frame buffer the same size as the "fake" displays resolution using 3 bytes per pixel.

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

No branches or pull requests

3 participants