Continuing my study of Papyrix's pivotal "Reader" UI state... How does it render its different substates? And perhaps I'll discuss substate event handling too?
To render the current page it retrieves the file's filetype & the current theme, clears the screen to the theme's background colour, checks if we're on the 1st page of the 1st "spine" in which case it should render cover image if any, considers a configurable double-refresh, ...
1/?
... branches over the filetype to render the actual page in one of 2 ways, possibly starts background caching, & marks the display as dirty. To render the cover page where relevant a helper logs what its doing, asks the ebook's class to render the cover, if successful retrieves the frame's viewport, & renders that image there. If there was no cover the current page renderer updates its properties to something valid.
XTC renders pages specially, but otherwise...
2/?