void twin_pixmap_show (twin_pixmap_t *pixmap, twin_screen_t *screen, twin_pixmap_t *lower) { if (pixmap->disable) twin_screen_disable_update (screen); if (lower == pixmap) lower = pixmap->down; if (pixmap->screen) twin_pixmap_hide (pixmap); pixmap->screen = screen; if (lower) { pixmap->down = lower; pixmap->up = lower->up; lower->up = pixmap; if (!pixmap->up) screen->top = pixmap; } else { pixmap->down = NULL; pixmap->up = screen->bottom; screen->bottom = pixmap; if (!pixmap->up) screen->top = pixmap; } twin_pixmap_damage (pixmap, 0, 0, pixmap->width, pixmap->height); }
void twin_pixmap_disable_update (twin_pixmap_t *pixmap) { if (pixmap->disable++ == 0) { if (pixmap->screen) twin_screen_disable_update (pixmap->screen); } }
static void twin_screen_update_cursor(twin_screen_t *screen, twin_coord_t x, twin_coord_t y) { twin_screen_disable_update(screen); if (screen->cursor) twin_screen_damage_cursor(screen); screen->curs_x = x; screen->curs_y = y; if (screen->cursor) { screen->cursor->x = screen->curs_x - screen->curs_hx; screen->cursor->y = screen->curs_y - screen->curs_hy; twin_screen_damage_cursor(screen); } twin_screen_enable_update(screen); }
void twin_screen_set_cursor (twin_screen_t *screen, twin_pixmap_t *pixmap, twin_fixed_t hotspot_x, twin_fixed_t hotspot_y) { twin_screen_disable_update(screen); if (screen->cursor) twin_screen_damage_cursor(screen); screen->cursor = pixmap; screen->curs_hx = hotspot_x; screen->curs_hy = hotspot_y; if (pixmap) { pixmap->x = screen->curs_x - hotspot_x; pixmap->y = screen->curs_y - hotspot_y; twin_screen_damage_cursor(screen); } twin_screen_enable_update(screen); }