-
Notifications
You must be signed in to change notification settings - Fork 27
Open
hdhbdh/Kobo-Reader
#1Labels
brainstormingGeneral discussion (about implementation details or actual usage)General discussion (about implementation details or actual usage)
Description
Carrying on from our discussions in shermp/go-fbink-v2/pull/9, I just wanted to jot down a few ideas rolling around in my skull while they are fresh.
Feel free to ignore, or wait on this.
- Splitting the library into eink refresh/blitting component, and a text/image rendering components. The idea is if one wants to use different libraries for text or images, they can. The hard part in many cases is dealing with all the quirks of eink, and device framebuffer formats etc, and it would be nice to have a standalone library to deal with that.
- Not using a massive FBConfig struct to configure everything under the sun. IMO, it's gotten rather unwieldly as more features have been added. One potential idea:
- An opaque context struct that contains per session config variables
- Change options via "methods" on that context struct.
- Use an init 'method' to create said struct for the user.
- While we're at it, create a fbfd in the init function and store it in the context. Drop the AUTO fbfd completely
- There could be an internal function to test the context for any re-init requirements, so the user doesn't have to think about it.
- Then when finished, close the context to unmap the fbfd etc.
That's one initial thought from me. I'm generally not a fan of getter/setters, coming from a Python/C background, but in this case it might help prevent API breakage by hiding internal structs etc.
Metadata
Metadata
Assignees
Labels
brainstormingGeneral discussion (about implementation details or actual usage)General discussion (about implementation details or actual usage)