The good news is - itās achievable if you persevere! I have successfully converted an extensive project (13 screens, hundreds of objects, 1000+ āerrorsā on first compile with v8) and it is stable, fully functional, and hard to tell apart from the V7 version after some theme modifications.
Iām not as good with regular expressions for replaces, but I significantly reduced the initial pass of fixing breaking changes to at least get something to compile with a lot of defines, some temporary replacement functions, etc. and, once I had a working version, start attacking the bulk of changes at my own pace. The biggest āmanualā task I had (again, maybe because of my lack of RegEx experience) was changing the event callback signatures.
Here are just a few examples of the types of defines I did to at first get it to compile, and still function. Later, I could refine the code piece by piece.
//I don't use the copy parameter, so this was fine to implement
#define lv_img_create(X, Y) lv_img_create(X)
#define lv_btn_create(X, Y) lv_btn_create(X)
#define lv_label_create(X, Y) lv_label_create(X)
#define lv_line_create(X, Y) lv_line_create(X)
...
...
#define lv_obj_set_event_cb(X, Y) lv_obj_add_event_cb(X, Y, LV_EVENT_ALL, NULL)
...
//Renamed 100s of lv_obj_align to lv_legacy_obj_align and implemented this. Later, can go back and change them individually:
void lv_legacy_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs)
{
if ((align == LV_ALIGN_CENTER) && (x_ofs == 0) && (y_ofs == 0) && (lv_obj_get_parent(obj) == base)) {
lv_obj_center(obj);
} else if (lv_obj_get_parent(obj) == base) {
lv_obj_align(obj, align, x_ofs, y_ofs);
} else {
lv_obj_align_to(obj, base, align, x_ofs, y_ofs);
}
}
...
//Lots of these to handle arbitrarily named items that were arbitrarily renamed in v8
#define LV_ALIGN_IN_TOP_LEFT LV_ALIGN_TOP_LEFT
#define LV_ALIGN_IN_TOP_MID LV_ALIGN_TOP_MID
#define LV_ALIGN_IN_TOP_RIGHT LV_ALIGN_TOP_RIGHT
#define LV_ALIGN_IN_BOTTOM_LEFT LV_ALIGN_BOTTOM_LEFT
#define LV_ALIGN_IN_BOTTOM_MID LV_ALIGN_BOTTOM_MID
#define LV_ALIGN_IN_BOTTOM_RIGHT LV_ALIGN_BOTTOM_RIGHT
#define LV_ALIGN_IN_LEFT_MID LV_ALIGN_LEFT_MID
#define LV_ALIGN_IN_RIGHT_MID LV_ALIGN_RIGHT_MID
You get the idea. As you go through the errors and look up the equivalent in v8, you can give yourself some shortcuts to getting it to compile.
I should add that I wrapped the above with #if LV_VERSION_CHECK(8, 0, 0)
, and wrapped areas where I made code changes specifically for V8 with the same check and #else
for the V7 code. By doing defines above for v8 instead of renaming globally, I could actually switch out the v7 and v8 library at will whilst doing this.
Good luck!