Beispiel #1
0
void
twin_pixmap_hide (twin_pixmap_t *pixmap)
{
    twin_screen_t   *screen = pixmap->screen;
    twin_pixmap_t   **up, **down;

    if (!screen)
	return;

    twin_pixmap_damage (pixmap, 0, 0, pixmap->width, pixmap->height);

    if (pixmap->up)
	down = &pixmap->up->down;
    else
	down = &screen->top;

    if (pixmap->down)
	up = &pixmap->down->up;
    else
	up = &screen->bottom;

    *down = pixmap->down;
    *up = pixmap->up;

    pixmap->screen = 0;
    pixmap->up = 0;
    pixmap->down = 0;
    if (pixmap->disable)
	twin_screen_enable_update (screen);
}
Beispiel #2
0
void
twin_pixmap_enable_update (twin_pixmap_t *pixmap)
{
    if (--pixmap->disable == 0)
    {
	if (pixmap->screen)
	    twin_screen_enable_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);
}