-
Notifications
You must be signed in to change notification settings - Fork 21
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
Still on ? #8
Comments
I am also interested in doing a C++ binding. After a quick review of this project, I believe it could be done in a more "Standard" compliant manner than this. |
Hi guys, Thank you for writing. Sorry @AlixANNERAUD somehow I haven't noticed your comment earlier. 🙁 This project is really stale now, but it would be really great to have a C++ binding! My 400 USD offering in the README is still also active. However there is one more thing: LVGL v9 will be released by end of this year so we should target the v9 API with the C++ binding too. There will be some refactoring later on on the API but no conceptual changes. |
Hello, |
How can it be used? E.g. how the set the size and position of a button and how to add an event to it? |
Alix, |
Hello, namespace LVGL
{
typedef class Object_Class
{
public:
virtual ~Object_Class();
void Clean();
void Del_Delayed(uint32_t delay_ms);
void Del_Anim_Ready_Cb(lv_anim_t * a);
void Del_Async();
void Set_Parent(Object_Class parent);
/* ... */
void Move_Background();
uint32_t Get_Child_Id();
inline Object_Class(lv_obj_t* LVGL_Pointer) : LVGL_Pointer(LVGL_Pointer) { };
inline Object_Class() : LVGL_Pointer(NULL) { };
inline lv_obj_t* Get_LVGL_Pointer() const { return LVGL_Pointer; };_lv_obj_t* Object_Class::Get_Child(int32_t id)
{
return lv_obj_get_child(LVGL_Pointer, id);
}
inline void Clear_Pointer() { LVGL_Pointer = NULL; };
static const lv_obj_class_t& Class;
protected:
lv_obj_t* LVGL_Pointer;
} Object_Type;
}
Some function here are not part of LVGL, it's only for shorter implementation. And here the definition of one function as an example : Object_Type Object_Class::Get_Child(int32_t id)
{
return Object_Type(lv_obj_get_child(LVGL_Pointer, id));
} Does this look right to you ? I'd like to use a more RAII-oriented model (object creation / deletion) within the constructor, move semantic ...), but I don't think it's the most suitable for this context. |
Hello, LVGL::Object_Type Screen(lv_scr_act());
LVGL::Button_Type B(Screen);
B.Set_Align(LV_ALIGN_CENTER);
LVGL::Label_Type Label(B);
LVGL::Switch_Type S(Screen);
S.Set_Align(LV_ALIGN_BOTTOM_LEFT);
LVGL::Colorwheel_Type C(Screen, true);
C.Set_Align(LV_ALIGN_BOTTOM_RIGHT);
C.Set_Size(200, 200);
Label.Set_Text("Hello World!"); Would it be possible to have your opinion on it? If you want to test it, I suggest you use my development environment available here: https://github.com/AlixANNERAUD/LVGL-Cpp-Binding-Environment (a fork of the native LVGL platform io). Just run Main.my inside the Tool folder, it's will generate the binding inside the LVGL_Cpp folder. Juste include from it the LVGL_Cpp.hpp file and you are done. |
Thank you for the update. Does this code just creates a an Shouldn't it be |
Hello, Here's what the two constructors code looks like, roughly speaking : Object_Class::Object_Class(lv_obj_t* LVGL_Pointer) : LVGL_Pointer(LVGL_Pointer)
{
}
Object_Class::Object_Class(Object_Class& Parent_Object) : LVGL_Pointer(NULL) // ! : This is not a copy constructor !!
{
this->LVGL_Pointer = lv_obj_create(Parent_Object.LVGL_Pointer)
} I don't think |
In LVGL v9 I'm thinking about having an |
Well, it's could help, and would make more sense, but it's not required. |
Hello,
Is this project still on?
I would be interested in doing the binding.
The text was updated successfully, but these errors were encountered: