Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2012fe0 in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2020-01-21T15:04:53Z (9 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
28db46b
Parents:
c79545e
git-author:
Jiri Svoboda <jiri@…> (2020-01-20 19:04:50)
git-committer:
Jiri Svoboda <jiri@…> (2020-01-21 15:04:53)
Message:

Repaint display when finished moving a window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/display.c

    rc79545e r2012fe0  
    236236}
    237237
     238/** Get last window in display.
     239 *
     240 * @param display Display
     241 * @return Last window or @c NULL if there is none
     242 */
     243ds_window_t *ds_display_last_window(ds_display_t *display)
     244{
     245        link_t *link = list_last(&display->windows);
     246
     247        if (link == NULL)
     248                return NULL;
     249
     250        return list_get_instance(link, ds_window_t, ldwindows);
     251}
     252
    238253/** Get next window in client.
    239254 *
     
    244259{
    245260        link_t *link = list_next(&wnd->ldwindows, &wnd->display->windows);
     261
     262        if (link == NULL)
     263                return NULL;
     264
     265        return list_get_instance(link, ds_window_t, ldwindows);
     266}
     267
     268/** Get previous window in client.
     269 *
     270 * @param wnd Current window
     271 * @return Previous window or @c NULL if there is none
     272 */
     273ds_window_t *ds_display_prev_window(ds_window_t *wnd)
     274{
     275        link_t *link = list_prev(&wnd->ldwindows, &wnd->display->windows);
    246276
    247277        if (link == NULL)
     
    441471}
    442472
     473/** Paint display.
     474 *
     475 * @param display Display
     476 * @param rect Bounding rectangle or @c NULL to repaint entire display
     477 */
     478errno_t ds_display_paint(ds_display_t *disp, gfx_rect_t *rect)
     479{
     480        errno_t rc;
     481        ds_window_t *wnd;
     482
     483        /* Paint background */
     484        rc = ds_display_paint_bg(disp, rect);
     485        if (rc != EOK)
     486                return rc;
     487
     488        /* Paint windows bottom to top */
     489        wnd = ds_display_last_window(disp);
     490        while (wnd != NULL) {
     491                rc = ds_window_paint(wnd, rect);
     492                if (rc != EOK)
     493                        return rc;
     494
     495                wnd = ds_display_prev_window(wnd);
     496        }
     497
     498        return EOK;
     499}
     500
    443501/** @}
    444502 */
Note: See TracChangeset for help on using the changeset viewer.