AlbumShaper
1.0a3
src
gui
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
//==============================================
34
void
loadCursors
()
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
)
55
return
*
customCursors
[
DEFAULT_CURSOR
];
56
else
57
return
*
customCursors
[type];
58
}
59
//===========================================================
customCursors
QCursor ** customCursors
Definition
cursors.cpp:32
loadCursors
void loadCursors()
Definition
cursors.cpp:34
getCursor
const QCursor & getCursor(CUSTOM_CURSOR_TYPE type)
Definition
cursors.cpp:52
cursors.h
CUSTOM_CURSOR_TYPE
CUSTOM_CURSOR_TYPE
custom cursor types
Definition
cursors.h:16
SCALE_SELECTION_CURSOR
@ SCALE_SELECTION_CURSOR
Definition
cursors.h:25
MOVE_TR_CURSOR
@ MOVE_TR_CURSOR
Definition
cursors.h:23
DEFAULT_CURSOR
@ DEFAULT_CURSOR
Definition
cursors.h:30
ROTATE_CURSOR
@ ROTATE_CURSOR
Definition
cursors.h:26
MOVE_VERT_CURSOR
@ MOVE_VERT_CURSOR
Definition
cursors.h:21
TARGET_CURSOR
@ TARGET_CURSOR
Definition
cursors.h:28
MOVE_HOR_CURSOR
@ MOVE_HOR_CURSOR
Definition
cursors.h:20
CUSTOM_CURSOR_COUNT
@ CUSTOM_CURSOR_COUNT
Definition
cursors.h:32
MOVE_TL_CURSOR
@ MOVE_TL_CURSOR
Definition
cursors.h:22
CROSS_CURSOR
@ CROSS_CURSOR
Definition
cursors.h:17
MOVE_SELECTION_CURSOR
@ MOVE_SELECTION_CURSOR
Definition
cursors.h:19
Generated by
1.12.0