Example #1
0
bool_t reset_cursor(cursor_t *cursor) {
  if( cursor ) {
    cursor->top = 0;
    push_cursor(cursor, 0, 0, 0);
    return TRUE;
  }
  return FALSE;
}
Example #2
0
static void
qxl_hide_cursor(ScrnInfoPtr pScrn)
{
    qxl_screen_t *qxl = pScrn->driverPrivate;
    struct QXLCursorCmd *cursor = qxl_alloc_cursor_cmd(qxl);

    cursor->type = QXL_CURSOR_HIDE;

    push_cursor(qxl, cursor);
}
Example #3
0
static void
qxl_load_cursor_argb (ScrnInfoPtr pScrn, CursorPtr pCurs)
{
    qxl_screen_t *qxl = pScrn->driverPrivate;
    int w = pCurs->bits->width;
    int h = pCurs->bits->height;
    int size = w * h * sizeof (CARD32);

    struct QXLCursorCmd *cmd = qxl_alloc_cursor_cmd (qxl);
    struct QXLCursor *cursor =
	qxl_allocnf(qxl, sizeof(struct QXLCursor) + size);

    cursor->header.unique = 0;
    cursor->header.type = SPICE_CURSOR_TYPE_ALPHA;
    cursor->header.width = w;
    cursor->header.height = h;
    /* I wonder if we can just tell the client that the hotspot is 0, 0
     * always? The coordinates we are getting from X are for 0, 0 anyway,
     * so the question is if the client uses the hotspot for anything else?
     */
    cursor->header.hot_spot_x = pCurs->bits->xhot;
    cursor->header.hot_spot_y = pCurs->bits->yhot;

    cursor->data_size = size;
    
    cursor->chunk.next_chunk = 0;
    cursor->chunk.prev_chunk = 0;
    cursor->chunk.data_size = size;

    memcpy (cursor->chunk.data, pCurs->bits->argb, size);

#if 0
    int i, j;
    for (j = 0; j < h; ++j)
    {
	for (i = 0; i < w; ++i)
	{
	    ErrorF ("%c", (pCurs->bits->argb[j * w + i] & 0xff000000) == 0xff000000? '#' : '.');
	}

	ErrorF ("\n");
    }
#endif

    qxl->hot_x = pCurs->bits->xhot;
    qxl->hot_y = pCurs->bits->yhot;
    
    cmd->type = QXL_CURSOR_SET;
    cmd->u.set.position.x = qxl->cur_x + qxl->hot_x;
    cmd->u.set.position.y = qxl->cur_y + qxl->hot_y;
    cmd->u.set.shape = physical_address (qxl, cursor, qxl->main_mem_slot);
    cmd->u.set.visible = TRUE;

    push_cursor(qxl, cmd);
}    
Example #4
0
bool_t bump_cursor(cursor_t *cursor, size_t depth, off_t offset, int nord) {
/*   debug("bump_cursor %d %d (top=%d)\n", depth, offset, cursor->top); */
  if( cursor && (depth >= 0) ) {
    if( cursor->top == depth ) {
      push_cursor(cursor, offset, 0, nord);
    } else {
      cursor->stack[depth].off = offset;
      cursor->stack[depth].ord++;
      cursor->stack[depth].nord = nord;
      cursor->top = depth + 1;
    }
    return TRUE;
  }
  return FALSE;
}
Example #5
0
static void
qxl_set_cursor_position(ScrnInfoPtr pScrn, int x, int y)
{
    qxl_screen_t *qxl = pScrn->driverPrivate;
    struct QXLCursorCmd *cmd = qxl_alloc_cursor_cmd(qxl);

    qxl->cur_x = x;
    qxl->cur_y = y;
    
    cmd->type = QXL_CURSOR_MOVE;
    cmd->u.position.x = qxl->cur_x + qxl->hot_x;
    cmd->u.position.y = qxl->cur_y + qxl->hot_y;
    
    push_cursor(qxl, cmd);
}
int
reset_line ()
{
#if defined(uniosu)
  putchar (Ctrl ('O'));         /* おまじない。括弧の中はゼロでなくオー */
#endif /* defined(uniosu) */
  if (empty_modep () == 0)
    {
      push_cursor ();
      set_scroll_region (0, crow - 1);
      kk_restore_cursor ();
      call_redraw_line (c_b->t_c_p, 1);
      pop_cursor ();
    }
  return (0);
}
void trace_set_cursor(GdkCursorType type)
{
	GdkWindow *window;
	GdkCursor *cursor;

	if (!parent_window)
		return;

	window = GTK_WIDGET(parent_window)->window;

	/* save the previous cursor */
	cursor = gdk_window_get_cursor(window);
	push_cursor(cursor);

	cursor = gdk_cursor_new(type);
	if (!cursor)
		die("Can't create cursor");
	gdk_window_set_cursor(window, cursor);
}