Esempio n. 1
0
/***************************************************************************
...
***************************************************************************/
void load_cursors(void)
{
  enum cursor_type cursor;
  GdkDisplay *display = gdk_display_get_default();
  int frame;

  for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
    for (frame = 0; frame < NUM_CURSOR_FRAMES; frame++) {
      int hot_x, hot_y;
      struct sprite *sprite
	= get_cursor_sprite(tileset, cursor, &hot_x, &hot_y, frame);
      GdkPixbuf *pixbuf = sprite_get_pixbuf(sprite);

      fc_cursors[cursor][frame] = gdk_cursor_new_from_pixbuf(display, pixbuf,
							     hot_x, hot_y);
    }
  }
}
Esempio n. 2
0
/***************************************************************************
...
***************************************************************************/
void load_cursors(void)
{
  enum cursor_type cursor;
  XColor white, black;
  struct sprite *sprite;
  int hot_x, hot_y;

  white.pixel = get_color(tileset, COLOR_OVERVIEW_VIEWRECT)->color.pixel;
  black.pixel = get_color(tileset, COLOR_OVERVIEW_UNKNOWN)->color.pixel;
  XQueryColor(display, cmap, &white);
  XQueryColor(display, cmap, &black);

  for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
    sprite = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y, 0);

    /* FIXME: this is entirely wrong.  It should be rewritten using
     * XcursorImageLoadCursor.  See gdkcursor-x11.c in the GTK sources for
     * examples. */
    cursors[cursor] = XCreatePixmapCursor(display,
					  sprite->mask, sprite->mask,
					  &white, &black, hot_x, hot_y);
  }
}