SoGtk  0.1.0
Coin3D GUI toolkit binding
All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
SoGtkCursor.h
1#ifndef SOGTK_CURSOR_H
2#define SOGTK_CURSOR_H
3
4//
5
6/**************************************************************************\
7 * Copyright (c) Kongsberg Oil & Gas Technologies AS
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
13 *
14 * Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * Neither the name of the copyright holder nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36\**************************************************************************/
37
38#include <Inventor/SbLinear.h>
39#include <Inventor/Gtk/SoGtkBasic.h>
40
41class SOGTK_DLL_API SoGtkCursor {
42public:
43 static void initClass(void);
44
45 struct CustomCursor {
46 SbVec2s dim;
47 SbVec2s hotspot;
48 unsigned char * bitmap;
49 unsigned char * mask;
50 };
51
52
53 // FIXME: add more default shapes. 20011119 pederb.
54 enum Shape {
55 CUSTOM_BITMAP = -1,
56 DEFAULT = 0,
59 UPARROW
60 };
61
62 SoGtkCursor(void);
63 SoGtkCursor(const Shape shape);
64 SoGtkCursor(const CustomCursor * cc);
65 SoGtkCursor(const SoGtkCursor & cursor);
67
68 SoGtkCursor & operator=(const SoGtkCursor & c);
69
70 Shape getShape(void) const;
71 void setShape(const Shape shape);
72
73 const CustomCursor & getCustomCursor(void) const;
74
75 static const SoGtkCursor & getZoomCursor(void);
76 static const SoGtkCursor & getPanCursor(void);
77 static const SoGtkCursor & getRotateCursor(void);
78 static const SoGtkCursor & getBlankCursor(void);
79
80private:
81 void commonConstructor(const Shape shape, const CustomCursor * cc);
82
83 Shape shape;
84 CustomCursor * cc;
85};
86
87#endif // ! SOGTK_CURSOR_H
The SoGtkCursor class is used to set cursors for GUI components.
Definition SoGtkCursor.h:41
Shape
Definition SoGtkCursor.h:54
@ CROSSHAIR
Definition SoGtkCursor.h:58
@ BUSY
Definition SoGtkCursor.h:57
The SoGtkCursor::CustomCursor class is used to specify bitmap data for SoGtkCursor custom cursors.
Definition SoGtkCursor.h:45
unsigned char * bitmap
Definition SoGtkCursor.h:48
unsigned char * mask
Definition SoGtkCursor.h:49
SbVec2s hotspot
Definition SoGtkCursor.h:47
SbVec2s dim
Definition SoGtkCursor.h:46