-
Notifications
You must be signed in to change notification settings - Fork 0
/
cursorfactory.h
69 lines (60 loc) · 1.89 KB
/
cursorfactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* -*- c++ -*-
* cursorfactory.h
*
* Header for the CursorFactory class
* Copyright (C) 2002 lignum Computing, Inc. <lignumcad@lignumcomputing.com>
* $Id$
*
* 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
*
*/
#ifndef CURSORFACTORY_H
#define CURSORFACTORY_H
#include <QHash>
#include <qcursor.h>
/*!
* All of the items which might want a custom cursor can share the
* same QCursor. This is a singleton which doles out cursors as
* requested. It also gives us a chance to clean up the memory used at
* program exit. (QCursors don't have a parent which can easily
* delete them at program exit.) However, don't call this after
* the QApplication is destroyed since we no longer have an X connection.
*/
class CursorFactory {
QHash <int, QCursor> cursors_;
static CursorFactory cursor_factory_;
public:
enum Cursors {
ALIGNMENT,
ALIGNMENTPLUS,
CENTERLINE,
DIMENSION,
DIMENSIONPLUS,
RECTANGLE,
REFERENCELINE,
LINE_ROTATE,
ANNOTATION,
DELETE_CONSTRAINT,
ASSEMBLY_CONSTRAINT,
ASSEMBLY_CONSTRAINTPLUS,
RESIZE_SOLID
};
static CursorFactory& instance ( void );
QCursor& cursor ( enum Cursors c );
void clear ( void );
protected:
CursorFactory ( void );
};
#endif /* CURSORFACTORY_H */