source: tuxpaint/trunk/fuentes/src/cursor.c @ 219

Last change on this file since 219 was 219, checked in by mabarracus, 4 years ago

added sources from trusty

File size: 2.3 KB
Line 
1/*
2  cursor.c
3
4  For Tux Paint
5  Bitmapped mouse pointer (cursor)
6
7  Copyright (c) 2002-2007 by Bill Kendrick and others
8  bill@newbreedsoftware.com
9  http://www.tuxpaint.org/
10
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  GNU General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24  (See COPYING.txt)
25
26  June 14, 2002 - May 15, 2007
27  $Id: cursor.c,v 1.6 2011/08/29 22:48:18 scottmc Exp $
28*/
29
30#include "cursor.h"
31#include "debug.h"
32
33#define UNUSED(arg) ((void)(arg))
34
35SDL_Cursor *cursor_hand, *cursor_arrow, *cursor_watch,
36  *cursor_up, *cursor_down, *cursor_tiny, *cursor_crosshair,
37  *cursor_brush, *cursor_wand, *cursor_insertion, *cursor_rotate;
38
39#ifdef NOKIA_770
40int hide_cursor = 1;
41#else
42int hide_cursor;
43#endif
44
45#if defined(NOKIA_770) || defined(__BEOS__) || defined(__HAIKU__)
46// Fancy cursors on BeOS are buggy in SDL
47int no_fancy_cursors = 1;
48#else
49int no_fancy_cursors;
50#endif
51
52void do_setcursor(SDL_Cursor * c)
53{
54  /* Shut GCC up over the fact that the XBMs are #included within cursor.h
55     but used in tuxpaint.c (and not cursor.c) */
56
57  UNUSED(watch_bits);
58  UNUSED(watch_mask_bits);
59  UNUSED(hand_bits);
60  UNUSED(hand_mask_bits);
61  UNUSED(wand_bits);
62  UNUSED(wand_mask_bits);
63  UNUSED(insertion_bits);
64  UNUSED(insertion_mask_bits);
65  UNUSED(brush_bits);
66  UNUSED(brush_mask_bits);
67  UNUSED(crosshair_bits);
68  UNUSED(crosshair_mask_bits);
69  UNUSED(rotate_bits);
70  UNUSED(rotate_mask_bits);
71  UNUSED(up_bits);
72  UNUSED(up_mask_bits);
73  UNUSED(down_bits);
74  UNUSED(down_mask_bits);
75  UNUSED(tiny_bits);
76  UNUSED(tiny_mask_bits);
77  UNUSED(arrow_bits);
78  UNUSED(arrow_mask_bits);
79
80  if (!hide_cursor && !no_fancy_cursors)
81    SDL_SetCursor(c);
82}
83
84void free_cursor(SDL_Cursor ** cursor)
85{
86  if (*cursor)
87  {
88    SDL_FreeCursor(*cursor);
89    *cursor = NULL;
90  }
91}
Note: See TracBrowser for help on using the repository browser.