Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 121 lines (100 sloc) 3.84 kb
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23 // Stock cursors
24 enum FXStockCursor {
25 CURSOR_ARROW=1, // Default left pointing arrow
26 CURSOR_RARROW, // Right arrow
27 CURSOR_IBEAM, // Text I-Beam
28 CURSOR_WATCH, // Stopwatch or hourglass
29 CURSOR_CROSS, // Crosshair
30 CURSOR_UPDOWN, // Move up, down
31 CURSOR_LEFTRIGHT, // Move left, right
32 CURSOR_MOVE // Move up,down,left,right
33 };
34
35
36 /// Cursor options
37 enum {
38 CURSOR_KEEP = 0x00000100, /// Keep pixel data in client
39 CURSOR_OWNED = 0x00000200 /// Pixel data is owned by image
40 };
41
42
43 /// Cursor class
44 class FXCursor : public FXId {
45 protected:
46 FXColor *data; // Source data
47 FXint width; // Width
48 FXint height; // Height
49 FXint hotx; // Hot spot x
50 FXint hoty; // Hot spot y
51 FXuint options; // Options
52 protected:
53 FXCursor();
54 public:
55 %extend {
56 /// Make stock cursor
57 FXCursor(FXApp* a,FXStockCursor curid=CURSOR_ARROW){
58 return new FXRbCursor(a,curid);
59 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
60
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
61 /// Make cursor from source and mask; cursor size should at most 32x32 for portability!
62 FXCursor(FXApp* a,const FXuchar* src,const FXuchar* msk,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0){
63 return new FXRbCursor(a,src,msk,w,h,hx,hy);
64 }
65
66 /// Make cursor from FXColor pixels; cursor size should at most 32x32 for portability!
67 FXCursor(FXApp* a,const FXColor* pix,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0){
68 return new FXRbCursor(a,pix,w,h,hx,hy);
69 }
70 }
71
72 /// Width of cursor
73 FXint getWidth() const;
74
75 /// Height of cursor
76 FXint getHeight() const;
77
78 /// Set hotspot x
79 void setHotX(FXint x);
bea4cad @larskanis Strip all whitespaces on line endings
authored
80
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
81 /// Get hotspot x
82 FXint getHotX() const;
83
84 /// Set hotspot y
85 void setHotY(FXint y);
bea4cad @larskanis Strip all whitespaces on line endings
authored
86
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
87 /// Get hotspot y
88 FXint getHotY() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
89
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
90 /// Check if there is color in the cursor
91 bool isColor() const;
92
93 /// Destructor
94 virtual ~FXCursor();
95 };
96
97
98 DECLARE_FXOBJECT_VIRTUALS(FXCursor)
99 DECLARE_FXID_VIRTUALS(FXCursor)
100 DECLARE_FXCURSOR_VIRTUALS(FXCursor)
101
102 %{
103 static swig_type_info *FXCursor_dynamic_cast(void **ptr) {
104 FXCursor **ppCursor = reinterpret_cast<FXCursor **>(ptr);
105 FXCURCursor *pCURCursor=dynamic_cast<FXCURCursor*>(*ppCursor);
106 if(pCURCursor){
107 *ptr=reinterpret_cast<void*>(pCURCursor);
108 return SWIG_TypeQuery("FXCURCursor *");
109 }
110 FXGIFCursor *pGIFCursor=dynamic_cast<FXGIFCursor*>(*ppCursor);
111 if(pGIFCursor){
112 *ptr=reinterpret_cast<void*>(pGIFCursor);
113 return SWIG_TypeQuery("FXGIFCursor *");
114 }
115 return 0;
116 }
117 %}
118
119 DYNAMIC_CAST(SWIGTYPE_p_FXCursor, FXCursor_dynamic_cast);
120
Something went wrong with that request. Please try again.