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 //==============================================
32 QCursor** 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 //===========================================================
52 const QCursor& getCursor( CUSTOM_CURSOR_TYPE type )
53 {
54  if( type < 0 || type >= CUSTOM_CURSOR_COUNT )
56  else
57  return *customCursors[type];
58 }
59 //===========================================================
CUSTOM_CURSOR_TYPE
custom cursor types
Definition: cursors.h:15
void loadCursors()
Definition: cursors.cpp:34
const QCursor & getCursor(CUSTOM_CURSOR_TYPE type)
Definition: cursors.cpp:52
QCursor ** customCursors
Definition: cursors.cpp:32