codewitch-honey-crisis / gfx

GFX is a device independent graphics library primarily intended for IoT MCUs but not limited to that.
https://honeythecodewitch.com/gfx
MIT License
110 stars 10 forks source link

Return value of suspender #9

Closed fschuetz closed 1 year ago

fschuetz commented 1 year ago

In gfx_draw_helpers.hpp:175ff, the suspender returns gfx_result::success for the functions suspend, resume, suspend_async and resume_async. Shouldn't it return gfx_result::not_supported if the destination does not have the suspend capability (as it is the case in this template due to the other templates covering all the Suspend == true patterns)?

inline static gfx_result suspend(Destination& dst) {
    return gfx_result::success;
}

inline static gfx_result resume(Destination& dst,bool force=false) {
    return gfx_result::success;
}

inline static gfx_result suspend_async(Destination& dst) {
    return gfx_result::success;
}

inline static gfx_result resume_async(Destination& dst,bool force=false) {
    return gfx_result::success;
}

As the case where suspend is supported is covered by the templates after line 188, implementation for lines 175ff could be:

inline static gfx_result suspend(Destination& dst) {
    return gfx_result::not_supported;
}

inline static gfx_result resume(Destination& dst,bool force=false) {
    return gfx_result::not_supported;
}

inline static gfx_result suspend_async(Destination& dst) {
    return gfx_result::not_supported;
}

inline static gfx_result resume_async(Destination& dst,bool force=false) {
    return gfx_result::not_supported;
}
codewitch-honey-crisis commented 1 year ago

I'm pretty sure you're right, thanks. I'll take a look at it when I dive into another bug I've got open. I'm just buried with work just this second.

fschuetz commented 1 year ago

No worries. I have a mirror on gitlab where I changed it (also the other issue). If its easier to pull from there I can make it public. Just let me know.

codewitch-honey-crisis commented 1 year ago

You know, I've been kind of looking for contributors for this project if you're interested. It's just a lot to take on by myself, and I get concerned that I might get hit by a bus or something and then the project is in limbo. You seem like you've already done some spelunking through my codebase. I don't want to rope you into something here, so no obligation, but the offer is out there.

codewitch-honey-crisis commented 1 year ago

Fixed in 1.3.5

fschuetz commented 1 year ago

You know, I've been kind of looking for contributors for this project if you're interested. It's just a lot to take on by myself, and I get concerned that I might get hit by a bus or something and then the project is in limbo. You seem like you've already done some spelunking through my codebase. I don't want to rope you into something here, so no obligation, but the offer is out there.

Thanks for the offer and the trust. I am currently quite busy myself and I promised some contributions to other projects. However, I am also very actively using your gfx at the moment as it perfectly fits my needs. When I discover things along the way (developing currently a menu module that allow easily creating text based old school menus). I don't think I can reliably spend the time to help maintaining it, but I am happy to contribute if I see things I along using gfx. Just let me know which way this is most convenient for you.

codewitch-honey-crisis commented 1 year ago

By all means keep posting issues and suggestions here then. I appreciate all the help. If there's something it can do better let me know.