AlbumShaper 1.0a3
cursors.cpp
Go to the documentation of this file.
1//==============================================
2// copyright : (C) 2003-2005 by Will Stokes
3//==============================================
4// This program is free software; you can redistribute it
5// and/or modify it under the terms of the GNU General
6// Public License as published by the Free Software
7// Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//==============================================
10
11//Systemwide includes
12#include <qcursor.h>
13#include <qpixmap.h>
14
15//Projectwide includes
16#include "cursors.h"
17
18//Include cursor xpm's
19#include "../../resources/cursors/crossCursor.xpm"
20
21#include "../../resources/cursors/moveSelectionCursor.xpm"
22#include "../../resources/cursors/moveHorCursor.xpm"
23#include "../../resources/cursors/moveVertCursor.xpm"
24#include "../../resources/cursors/moveTLCursor.xpm"
25#include "../../resources/cursors/moveTRCursor.xpm"
26
27#include "../../resources/cursors/scaleSelectionCursor.xpm"
28#include "../../resources/cursors/rotateCursor.xpm"
29
30#include "../../resources/cursors/targetCursor.xpm"
31//==============================================
32QCursor** customCursors = new QCursor*[CUSTOM_CURSOR_COUNT];
33//==============================================
35{
36 customCursors[CROSS_CURSOR] = new QCursor( QPixmap( (const char**)crossCursor_xpm));
37
38 customCursors[MOVE_SELECTION_CURSOR] = new QCursor( QPixmap( (const char**)moveSelectionCursor_xpm));
39 customCursors[MOVE_HOR_CURSOR] = new QCursor( QPixmap( (const char**)moveHorCursor_xpm));
40 customCursors[MOVE_VERT_CURSOR] = new QCursor( QPixmap( (const char**)moveVertCursor_xpm));
41 customCursors[MOVE_TL_CURSOR] = new QCursor( QPixmap( (const char**)moveTLCursor_xpm));
42 customCursors[MOVE_TR_CURSOR] = new QCursor( QPixmap( (const char**)moveTRCursor_xpm));
43
44 customCursors[SCALE_SELECTION_CURSOR] = new QCursor( QPixmap( (const char**)scaleSelectionCursor_xpm));
45 customCursors[ROTATE_CURSOR] = new QCursor( QPixmap( (const char**)rotateCursor_xpm));
46
47 customCursors[TARGET_CURSOR] = new QCursor( QPixmap( (const char**)targetCursor_xpm));
48
49 customCursors[DEFAULT_CURSOR] = new QCursor( Qt::ArrowCursor );
50}
51//===========================================================
52const QCursor& getCursor( CUSTOM_CURSOR_TYPE type )
53{
54 if( type < 0 || type >= CUSTOM_CURSOR_COUNT )
56 else
57 return *customCursors[type];
58}
59//===========================================================
QCursor ** customCursors
Definition cursors.cpp:32
void loadCursors()
Definition cursors.cpp:34
const QCursor & getCursor(CUSTOM_CURSOR_TYPE type)
Definition cursors.cpp:52
CUSTOM_CURSOR_TYPE
custom cursor types
Definition cursors.h:16
@ SCALE_SELECTION_CURSOR
Definition cursors.h:25
@ MOVE_TR_CURSOR
Definition cursors.h:23
@ DEFAULT_CURSOR
Definition cursors.h:30
@ ROTATE_CURSOR
Definition cursors.h:26
@ MOVE_VERT_CURSOR
Definition cursors.h:21
@ TARGET_CURSOR
Definition cursors.h:28
@ MOVE_HOR_CURSOR
Definition cursors.h:20
@ CUSTOM_CURSOR_COUNT
Definition cursors.h:32
@ MOVE_TL_CURSOR
Definition cursors.h:22
@ CROSS_CURSOR
Definition cursors.h:17
@ MOVE_SELECTION_CURSOR
Definition cursors.h:19