PocketFrame is a small native UI library and design system for PocketBook
InkView applications. It provides a consistent monochrome interface for slow
e-ink displays, imprecise touch input, and physical page keys without depending
on firmware OpenList chrome.
PocketFrame is intentionally not an application framework. Networking, storage, navigation state, background work, and domain logic stay in the host application. PocketFrame owns visual tokens, font metrics, common components, hit-testing helpers, refresh boundaries, and the keyboard repaint contract.
Version 1.0.0. The library and example application have been cross-compiled
with the B300 SDK 6.8 and visually validated on a PocketBook Verse Pro.
- C99 API with an optional C++11 RAII wrapper.
- Resolution-aware InkView font setup.
- Header, icon actions, rows, badges, buttons, bottom dock, empty states, status screens, and recoverable error screens.
- Vector-like monochrome icons drawn with InkView primitives.
- Shared geometry and hit-testing helpers.
- Full and bounded partial refresh helpers.
- Explicit keyboard repaint guard.
- No heap allocation inside the library.
- No app-specific names, storage, or network dependencies.
#include <inkview.h>
#include <pocketframe.h>
static pf_context ui;
static void draw_home(void)
{
pf_header_action actions[] = {
{ PF_ICON_ADD, PF_CONTROL_OUTLINED, 0 }
};
pf_begin_frame(&ui);
pf_draw_header(&ui, "Library", "Local collections", 0, actions, 1);
pf_draw_text_row(&ui, ui.header_height, PF_STANDARD_ROW_HEIGHT,
"Example item", "Secondary information", PF_ROW_RAIL);
pf_end_frame_full(&ui);
}
static int handler(int type, int p1, int p2)
{
if (type == EVT_INIT)
return pf_init(&ui, ScreenWidth(), ScreenHeight());
if (type == EVT_SHOW || type == EVT_REPAINT) {
if (pf_may_repaint(&ui)) draw_home();
return 1;
}
if (type == EVT_EXIT) {
pf_destroy(&ui);
return 1;
}
return 0;
}Vendored source is the recommended integration until a stable repository is published:
add_subdirectory(vendor/PocketFrame)
target_link_libraries(MyApp PRIVATE PocketFrame::pocketframe)For applications distributed as source archives, prefer a Git subtree or a versioned vendored copy over a submodule.
On Windows with Docker Desktop running, launch Build-PocketFrame.cmd. The
script reuses the local PocketBook SDK builder image and places the generated
library and example application in D:\PocketFrameBuild when drive D exists,
or in the project build directory otherwise.
Generated artifacts:
libpocketframe.a, for linking into an InkView application;PocketFrameExample.app, a small on-device visual and interaction test.
Pass -Rebuild to recreate the small PocketFrame wrapper image. The underlying
PocketBook SDK image remains cached.
An installed copy also exports a CMake package:
find_package(PocketFrame 1 REQUIRED)
target_link_libraries(MyApp PRIVATE PocketFrame::pocketframe)- Design system
- Typography and layout
- Iconography
- Components
- Interaction and navigation
- E-ink rendering
- Accessibility and content
- Integration and event loop
- Migration guide
- Testing checklist
- API reference
- Versioning and compatibility
The validated baseline is a 1072×1448 portrait framebuffer using the PocketBook B300 SDK 6.8. Geometry is deliberately stable across comparable devices; typography scales from screen height and is clamped.
MIT. See LICENSE.