43 DsScreen(int32_t phys_width, int32_t phys_height,
DsRotation rotation,
DsColorMode cmode, uint8_t* linebuffer, uint8_t* aa_linebuffer, uint32_t framebuffer_alignment,
bool triple_buffered);
104 bool pushView(
const char*
id,
bool on_top =
false);
285 void lcdSurfaceUpdateFinishedFromISR(int32_t* woken);
290 volatile bool mDirty;
291 volatile bool mLocked;
292 bool mCoalescePaintEvents;
293 uint8_t mCoalescePaintEventsCounter;
295 const uint32_t mFrameBufferAlignment;
301 DsRect mSurfaceUserRect[3];
371 bool operator==(
const ViewEntry &rhs)
const
373 return strcmp(
id, rhs.id) == 0;
377 ds_thread_t mUiThreadHandler;
390 bool mIsTouchTimeoutExpired;
396 void touchRotate(int32_t &x, int32_t &y);
397 bool processEvent(
const DsEvent &event);
399 void onPaint(
DsRenderer &renderer)
override final;
402 void invalidateRegion(
DsRect region)
override final;
404 void update(
DsRect dirty_region);
DsSemaphore is a class that implements a binary semaphore.
Definition ds_os.h:22
Definition ds_keyboard.h:21
DsPoint is a class that represents the X and Y 2D coordinates of a point as integer numbers.
Definition ds_geometry.h:24
DsRect is a class that represents a 2D rectangle (X, Y, W, H)
Definition ds_geometry.h:1507
DsRenderer is a class that implements all the drawing operations.
Definition ds_renderer.h:42
DsScreen is class of type DsView (inherits from DsView) that implements a physical screen.
Definition ds_screen.h:29
size_t getViewStackSize(void) const
Returns the number of views in the view stack.
DsView * getFocusedView(void) const
Returns the focused view.
void kickTouchTimeout(uint32_t timeout_ms)
Kick the touch timeout while setting a new timeout value.
void registerView(DsView *view, const char *id)
Registers a view with the view stack manager.
bool isUiThread(void) const
Returns true if the caller is running in the UI thread.
void queueTouchEventFromISR(const DsTouchEvent::Mode &mode, const DsPoint &pos, uint32_t timestamp, int32_t *woken)
Queues a touch event into the event loop. It can be used from an interrupt handler.
virtual void onEventProcessFinish(void)
Called by the UI thread after processing an event. Can be implemented in a derived class.
bool isTouchTimeoutExpired(void) const
Is the touch timer expired?
bool popView(const char *id)
Pops the top named view from the stack.
void enableCoalescePaintEvents(bool enabled)
Enables or disables the coalescing of the paint events.
void createKeyboard(const ds_bitmap_font_t *font)
Creates the on screen keyboard object.
DsRenderer createRenderer(DsSurface &surface)
Creates a temporary DsRendered using the specified surface.
void lcdSurfaceUpdateFinished(void)
Called from the LCD driver when the surface update is finished.
void queueVSyncEvent(void)
Queues an VSYNC event into the event loop.
bool unrollViewStack(const char *id)
Unrolls the view stack to a specific view ID.
virtual void onFinish(void)
Called by the UI thread after the main event loop exits. Can be implemented in a derived class.
DsKeyboard & getKeyboard(void)
Returns a reference to the on screen keyboard.
DsRotation getRotation(void) const
Returns the logical rotation of the screen.
virtual void lcdSurfaceUpdate(DsSurface *surface)=0
Updates the front framebuffer of the screen. Must be implemented in a derived class.
void queueLambdaFromISR(const lambda< void(void), 64 > &lambda, int32_t *woken)
Queues a lambda to get executed in the UI thread event loop. It can be used from an interrupt handler...
virtual void onEventProcessStart(void)
Called by the UI thread before processing an event. Can be implemented in a derived class.
virtual void onTouchTimeout(bool expired)
Called whenever the touch timeout expiration flag changes. Can be implemented in a derived class.
bool pushView(const char *id, bool on_top=false)
Pushes a new view to the stack.
void queueTouchEvent(const DsTouchEvent::Mode &mode, const DsPoint &pos, uint32_t timestamp)
Queues a touch event into the event loop.
void queueKeyboardEvent(int32_t key)
Queues a keyboard event into the event loop.
virtual void onStart(void)
Called by the UI thread before the main event loop is entered. Can be implemented in a derived class.
void run(void)
Executes the event loop.
void queueLambda(const lambda< void(void), 64 > &lambda)
Queues a lambda to get executed in the UI thread event loop.
void queueExitLoopEvent(void)
Queues an screen vertical sync event into the event loop.
bool popView(void)
Pops the top view from the stack.
DsScreen(int32_t phys_width, int32_t phys_height, DsRotation rotation, DsColorMode cmode, uint8_t *linebuffer, uint8_t *aa_linebuffer, uint32_t framebuffer_alignment, bool triple_buffered)
Creates a DsScreen object.
void setFocusedView(DsView *view)
Sets the focused view.
bool unrollViewStack(size_t level)
Unrolls the view stack to a specific level.
DsSurface * allocSurface(int32_t width, int32_t height, DsColorMode cmode, size_t palette_size=0, bool palette_has_alpha=false)
Allocates a DsSurface object using the screen's allocator and rotation.
DsView * getView(const char *id)
Returns the view based on its identifier.
void queueVSyncEventFromISR(int32_t *woken)
Queues an screen vertical sync event into the event loop. It can be used from an interrupt handler.
bool topViewIs(const char *id)
Returns true if the view on the top of the stack has the specified id.
DsSurface is a class that represents a drawing surface.
Definition ds_surface.h:30
DsView is a base class that represents any view on the screen.
Definition ds_view.h:40
Definition ds_types_lambda.h:24
Definition ds_types_queue.h:19
static_stack implements a stack with statically allocated storage space
Definition ds_types_stack.h:187
static_vector implements a vector with statically allocated storage space
Definition ds_types_vector.h:329
DsColorMode
DsColorMode is an enumeration of all possible color modes. These modes determine the color format use...
Definition ds_color.h:25
DsRotation
DsRotation is an enumeration of all possible values of the rotation used in drawing operations.
Definition ds_types.h:34
This structure implements a touch event.
Definition ds_event.h:25
Mode
Enumeration defining all touch modes.
Definition ds_event.h:30