Split XBM cursor #includes and set/free functions into "cursor.h" and

"cursor.c" source files.
This commit is contained in:
William Kendrick 2006-02-18 08:14:52 +00:00
parent aee93b1713
commit 410c156d16
5 changed files with 171 additions and 61 deletions

79
src/cursor.c Normal file
View file

@ -0,0 +1,79 @@
/*
cursor.c
For Tux Paint
Bitmapped mouse pointer (cursor)
Copyright (c) 2002-2006 by Bill Kendrick and others
bill@newbreedsoftware.com
http://www.newbreedsoftware.com/tuxpaint/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - February 17, 2006
$Id$
*/
#include "cursor.h"
#define UNUSED(arg) ((void)(arg))
SDL_Cursor * cursor_hand, * cursor_arrow, * cursor_watch,
* cursor_up, * cursor_down, * cursor_tiny, * cursor_crosshair,
* cursor_brush, * cursor_wand, * cursor_insertion, * cursor_rotate;
int no_fancy_cursors;
void do_setcursor(SDL_Cursor * c)
{
/* Shut GCC up over the fact that the XBMs are #included within cursor.h
but used in tuxpaint.c (and not cursor.c) */
UNUSED(watch_bits);
UNUSED(watch_mask_bits);
UNUSED(hand_bits);
UNUSED(hand_mask_bits);
UNUSED(wand_bits);
UNUSED(wand_mask_bits);
UNUSED(insertion_bits);
UNUSED(insertion_mask_bits);
UNUSED(brush_bits);
UNUSED(brush_mask_bits);
UNUSED(crosshair_bits);
UNUSED(crosshair_mask_bits);
UNUSED(rotate_bits);
UNUSED(rotate_mask_bits);
UNUSED(up_bits);
UNUSED(up_mask_bits);
UNUSED(down_bits);
UNUSED(down_mask_bits);
UNUSED(tiny_bits);
UNUSED(tiny_mask_bits);
UNUSED(arrow_bits);
UNUSED(arrow_mask_bits);
if (!no_fancy_cursors)
SDL_SetCursor(c);
}
void free_cursor(SDL_Cursor ** cursor)
{
if (*cursor)
{
SDL_FreeCursor(*cursor);
*cursor = NULL;
}
}