~ubuntu-branches/ubuntu/quantal/openmotif/quantal

« back to all changes in this revision

Viewing changes to lib/Xm/DragIcon.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bauer
  • Date: 2010-06-23 12:12:31 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100623121231-u89gxdp51sg9wjj2
Tags: 2.3.0-1
* New Maintainer (Closes: #379258) 
* Acknowledge NMU changes
* New upstream release (Closes: #494375)
* Get rid of security patches as they are already part of new upstream
  release (00-xpmvuln.openmotif.patch, 342092-CVE-2005-3964.patch)
* Bump Standards to 3.8.4
* Added {misc:Depends} to make the package lintian cleaner
* Fix weak-library-dev-dependency by adding ${binary:Version}) for the
  -dev Package of openmotif
* Let package depend on autotools-dev to use newer autotools-helper-files
* Work around an autoconf-bug (Gentoo-Bug #1475)
* Added Client-side anti-aliased fonts support via XFT
* Added UTF-8 and UTF8_STRING atom support
* Ability to show text and pixmaps in Label, LabelGadget and all
  derived widgets
* Support of PNG/JPEG image formats in the same way as XPM is supported
* Increase FILE_OFFSET_BITS to 64 to show files >2GB in file-selector
  Idea taken from Magne Oestlyngen (Closes: #288537)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 *  @OPENGROUP_COPYRIGHT@
 
3
 *  COPYRIGHT NOTICE
 
4
 *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
 
5
 *  Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
 
6
 *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
 
7
 *  the full copyright text.
 
8
 *  
 
9
 *  This software is subject to an open license. It may only be
 
10
 *  used on, with or for operating systems which are themselves open
 
11
 *  source systems. You must contact The Open Group for a license
 
12
 *  allowing distribution and sublicensing of this software on, with,
 
13
 *  or for operating systems which are not Open Source programs.
 
14
 *  
 
15
 *  See http://www.opengroup.org/openmotif/license for full
 
16
 *  details of the license agreement. Any use, reproduction, or
 
17
 *  distribution of the program constitutes recipient's acceptance of
 
18
 *  this agreement.
 
19
 *  
 
20
 *  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
 
21
 *  PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
22
 *  KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
 
23
 *  WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
 
24
 *  OR FITNESS FOR A PARTICULAR PURPOSE
 
25
 *  
 
26
 *  EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
 
27
 *  NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
 
28
 *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
29
 *  DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
 
30
 *  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
31
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 
32
 *  ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
 
33
 *  EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
 
34
 *  POSSIBILITY OF SUCH DAMAGES.
 
35
*/ 
 
36
/* 
 
37
 * HISTORY
 
38
*/ 
 
39
 
 
40
/* 
 
41
 * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
 
42
 * ALL RIGHTS RESERVED 
 
43
*/ 
 
44
#ifdef REV_INFO
 
45
#ifndef lint
 
46
static char rcsid[] = "$XConsortium: DragIcon.c /main/17 1996/10/14 10:44:37 pascale $"
 
47
#endif
 
48
#endif
 
49
/* (c) Copyright 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
 
50
 
 
51
#ifdef HAVE_CONFIG_H
 
52
#include <config.h>
 
53
#endif
 
54
 
 
55
 
 
56
#include <Xm/Xm.h>              /* To make cpp on Sun happy. CR 5943 */
 
57
#include <Xm/DisplayP.h>
 
58
#include <Xm/DragIconP.h>
 
59
#include "TextDIconI.h"
 
60
#include "DragCI.h"
 
61
#include "DragICCI.h"
 
62
#include "DragIconI.h"
 
63
#include "ImageCachI.h"
 
64
#include "MessagesI.h"
 
65
#include "RegionI.h"
 
66
#include "ScreenI.h"
 
67
#include "XmI.h"
 
68
 
 
69
#define MESSAGE1        _XmMMsgDragIcon_0000
 
70
#define MESSAGE2        _XmMMsgDragIcon_0001
 
71
 
 
72
#define PIXMAP_MAX_WIDTH        128
 
73
#define PIXMAP_MAX_HEIGHT       128
 
74
 
 
75
#define TheDisplay(dd) (XtDisplayOfObject(XtParent(dd)))
 
76
 
 
77
typedef struct {
 
78
  unsigned int          width, height;
 
79
  int                   hot_x, hot_y;
 
80
  int                   offset_x, offset_y;
 
81
  char                  *dataName;
 
82
  XmConst unsigned char *data;
 
83
  char                  *maskDataName;
 
84
  XmConst unsigned char *maskData;
 
85
} XmCursorDataRec, *XmCursorData;
 
86
 
 
87
 
 
88
/********    Static Function Declarations    ********/
 
89
 
 
90
static void DragIconInitialize( 
 
91
                        Widget req,
 
92
                        Widget new_w,
 
93
                        ArgList args,
 
94
                        Cardinal *numArgs) ;
 
95
static Boolean SetValues( 
 
96
                        Widget current,
 
97
                        Widget req,
 
98
                        Widget new_w,
 
99
                        ArgList args,
 
100
                        Cardinal *num_args) ;
 
101
static void Destroy( 
 
102
                        Widget w) ;
 
103
 
 
104
static void ScreenObjectDestroy(
 
105
                        Widget w,
 
106
                        XtPointer client_data,
 
107
                        XtPointer call_data) ;
 
108
/********    End Static Function Declarations    ********/
 
109
 
 
110
#define valid_width 16
 
111
#define valid_height 16
 
112
#define valid_x_hot 1
 
113
#define valid_y_hot 1
 
114
#define valid_x_offset 7
 
115
#define valid_y_offset 7
 
116
 
 
117
static XmConst unsigned char valid_bits[] = {
 
118
   0x00, 0x00, 0xfe, 0x01, 0xfe, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
 
119
   0x0e, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
120
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
121
 
 
122
static XmConst unsigned char valid_m_bits[] = {
 
123
   0xff, 0x07, 0xff, 0x03, 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
 
124
   0x1f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
 
125
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
126
 
 
127
static XmConst XmCursorDataRec validCursorDataRec =
 
128
{
 
129
   valid_width, valid_height,
 
130
   valid_x_hot, valid_y_hot,
 
131
   valid_x_offset, valid_y_offset,
 
132
   "valid",
 
133
   valid_bits,
 
134
   "valid_m",
 
135
   valid_m_bits,
 
136
};
 
137
   
 
138
 
 
139
#define invalid_width 16
 
140
#define invalid_height 16
 
141
#define invalid_x_hot 1
 
142
#define invalid_y_hot 1
 
143
#define invalid_x_offset 7
 
144
#define invalid_y_offset 7
 
145
 
 
146
 
 
147
static XmConst unsigned char invalid_bits[] = {
 
148
   0x00, 0x00, 0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x0c, 0x1e, 0x06, 0x37,
 
149
   0x86, 0x33, 0xc6, 0x31, 0xe6, 0x30, 0x76, 0x30, 0x3c, 0x18, 0x1c, 0x1c,
 
150
   0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00};
 
151
 
 
152
static XmConst unsigned char invalid_m_bits[] = {
 
153
   0xe0, 0x03, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, 0x3f, 0x1e, 0x3f, 0x8f, 0x7f,
 
154
   0xcf, 0x7f, 0xef, 0x7b, 0xff, 0x79, 0xff, 0x78, 0x7e, 0x3c, 0xfe, 0x3f,
 
155
   0xfc, 0x1f, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00};
 
156
 
 
157
static XmConst XmCursorDataRec invalidCursorDataRec =
 
158
{
 
159
   invalid_width, invalid_height,
 
160
   invalid_x_hot, invalid_y_hot,
 
161
   invalid_x_offset, invalid_y_offset,
 
162
   "invalid",
 
163
   invalid_bits,
 
164
   "invalid_m",
 
165
   invalid_m_bits,
 
166
};
 
167
 
 
168
 
 
169
#define none_width 16
 
170
#define none_height 16
 
171
#define none_x_hot 1
 
172
#define none_y_hot 1 
 
173
#define none_x_offset 7
 
174
#define none_y_offset 7
 
175
 
 
176
static XmConst unsigned char none_bits[] = {
 
177
   0x00, 0x00, 0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x0c, 0x1e, 0x06, 0x37,
 
178
   0x86, 0x33, 0xc6, 0x31, 0xe6, 0x30, 0x76, 0x30, 0x3c, 0x18, 0x1c, 0x1c,
 
179
   0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00};
 
180
 
 
181
static XmConst unsigned char none_m_bits[] = {
 
182
   0xe0, 0x03, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, 0x3f, 0x1e, 0x3f, 0x8f, 0x7f,
 
183
   0xcf, 0x7f, 0xef, 0x7b, 0xff, 0x79, 0xff, 0x78, 0x7e, 0x3c, 0xfe, 0x3f,
 
184
   0xfc, 0x1f, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00};
 
185
 
 
186
static XmConst XmCursorDataRec noneCursorDataRec =
 
187
{
 
188
   none_width, none_height,
 
189
   none_x_hot, none_y_hot,
 
190
   none_x_offset, none_y_offset,
 
191
   "none",
 
192
   none_bits,
 
193
   "none_m",
 
194
   none_m_bits,
 
195
};
 
196
 
 
197
#define move_width 16
 
198
#define move_height 16
 
199
#define move_x_hot 1
 
200
#define move_y_hot 1
 
201
#define move_x_offset 14
 
202
#define move_y_offset 14
 
203
 
 
204
static XmConst unsigned char move_bits[] = {
 
205
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
206
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
207
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
208
 
 
209
 
 
210
static XmConst unsigned char move_m_bits[] = {
 
211
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
212
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
213
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
214
 
 
215
static XmConst XmCursorDataRec moveCursorDataRec =
 
216
{
 
217
   move_width, move_height,
 
218
   move_x_hot, move_y_hot,
 
219
   move_x_offset, move_y_offset,
 
220
   "move",
 
221
   move_bits,
 
222
   "move_m",
 
223
   move_m_bits,
 
224
};
 
225
 
 
226
#define copy_width 16
 
227
#define copy_height 16
 
228
#define copy_x_hot 1
 
229
#define copy_y_hot 1
 
230
#define copy_x_offset 14 
 
231
#define copy_y_offset 14
 
232
 
 
233
static XmConst unsigned char copy_bits[] = {
 
234
   0x00, 0x00, 0xfe, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x1f, 0x02, 0x11,
 
235
   0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0xfe, 0x11, 0x20, 0x10,
 
236
   0x20, 0x10, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00};
 
237
 
 
238
 
 
239
static XmConst unsigned char copy_m_bits[] = {
 
240
   0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
 
241
   0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
 
242
   0xf0, 0x3f, 0xf0, 0x3f, 0xf0, 0x3f, 0x00, 0x00};
 
243
 
 
244
static XmConst XmCursorDataRec copyCursorDataRec =
 
245
{
 
246
   copy_width, copy_height,
 
247
   copy_x_hot, copy_y_hot,
 
248
   copy_x_offset, copy_y_offset,
 
249
   "copy",
 
250
   copy_bits,
 
251
   "copy_m",
 
252
   copy_m_bits,
 
253
};
 
254
 
 
255
#define link_width 16
 
256
#define link_height 16
 
257
#define link_x_hot 1
 
258
#define link_y_hot 1
 
259
#define link_x_offset 14
 
260
#define link_y_offset 14
 
261
 
 
262
 
 
263
static XmConst unsigned char link_bits[] = {
 
264
   0x00, 0x00, 0xfe, 0x03, 0x02, 0x02, 0x02, 0x02, 0x32, 0x02, 0x32, 0x3e,
 
265
   0x42, 0x20, 0x82, 0x20, 0x02, 0x21, 0x3e, 0x26, 0x20, 0x26, 0x20, 0x20,
 
266
   0x20, 0x20, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00};
 
267
 
 
268
 
 
269
static XmConst unsigned char link_m_bits[] = {
 
270
   0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x7f, 0xff, 0x7f,
 
271
   0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xf0, 0x7f,
 
272
   0xf0, 0x7f, 0xf0, 0x7f, 0xf0, 0x7f, 0x00, 0x00};
 
273
 
 
274
static XmConst XmCursorDataRec linkCursorDataRec =
 
275
{
 
276
   link_width, link_height,
 
277
   link_x_hot, link_y_hot,
 
278
   link_x_offset, link_y_offset,
 
279
   "link",
 
280
   link_bits,
 
281
   "link_m",
 
282
   link_m_bits,
 
283
};
 
284
 
 
285
#define Altsource16_width 16
 
286
#define Altsource16_height 16
 
287
#define Altsource16_x_hot  2
 
288
#define Altsource16_y_hot  2
 
289
 
 
290
static XmConst unsigned char Altsource16_bits[] = {
 
291
   0xfc, 0x03, 0x04, 0x06, 0x04, 0x0a, 0x04, 0x12, 0x04, 0x3e, 0x04, 0x20,
 
292
   0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20,
 
293
   0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f};
 
294
 
 
295
static XmConst unsigned char Altsource16_m_bits[] = {
 
296
   0xfc, 0x03, 0xfc, 0x07, 0xfc, 0x0f, 0xfc, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f,
 
297
   0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f,
 
298
   0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f};
 
299
 
 
300
static XmConst XmCursorDataRec Altsource16CursorDataRec =
 
301
{
 
302
   Altsource16_width, Altsource16_height,
 
303
   Altsource16_x_hot, Altsource16_y_hot,
 
304
   0, 0,
 
305
   "Altsource16",
 
306
   Altsource16_bits,
 
307
   "Altsource16_m",
 
308
   Altsource16_m_bits,
 
309
};
 
310
 
 
311
 
 
312
#define Altsource_width 32
 
313
#define Altsource_height 32
 
314
#define Altsource_x_hot 3
 
315
#define Altsource_y_hot 3 
 
316
 
 
317
static XmConst unsigned char Altsource_bits[] = {
 
318
   0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x10, 0x00, 0xc0, 0x00,
 
319
   0x10, 0x00, 0x40, 0x01, 0x10, 0x00, 0x40, 0x02, 0x10, 0x00, 0x40, 0x04,
 
320
   0x10, 0x00, 0xc0, 0x0f, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
321
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
322
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
323
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
324
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
325
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
326
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
327
   0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
 
328
   0x10, 0x00, 0x00, 0x08, 0xf0, 0xff, 0xff, 0x0f};
 
329
 
 
330
static XmConst unsigned char Altsource_m_bits[] = {
 
331
   0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x00,
 
332
   0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07,
 
333
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
334
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
335
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
336
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
337
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
338
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
339
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
340
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f,
 
341
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f};
 
342
 
 
343
static XmConst XmCursorDataRec AltsourceCursorDataRec =
 
344
{
 
345
   Altsource_width, Altsource_height,
 
346
   Altsource_x_hot, Altsource_y_hot,
 
347
   0, 0,
 
348
   "Altsource",
 
349
   Altsource_bits,
 
350
   "Altsource_m",
 
351
   Altsource_m_bits,
 
352
};
 
353
 
 
354
/*
 
355
 *  The 16x16 default icon data.
 
356
 */
 
357
 
 
358
#define state16_width 16
 
359
#define state16_height 16
 
360
#define state16_x_hot 1
 
361
#define state16_y_hot 1
 
362
#define state16_x_offset -8
 
363
#define state16_y_offset -2
 
364
static XmConst unsigned char state16_bits[] =
 
365
{
 
366
   0x00, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x02, 0x00,
 
367
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
368
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
369
};
 
370
static XmConst unsigned char state16M_bits[] =
 
371
{
 
372
   0x7f, 0x00, 0x7f, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0x1f, 0x00, 0x0f, 0x00,
 
373
   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
374
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
375
};
 
376
static XmConst XmCursorDataRec state16CursorDataRec =
 
377
{
 
378
    state16_width, state16_height,
 
379
    state16_x_hot, state16_y_hot,
 
380
    state16_x_offset, state16_y_offset,
 
381
    "state16",
 
382
    state16_bits,
 
383
    "state16M",
 
384
    state16M_bits,
 
385
};
 
386
 
 
387
#define move16_width 16
 
388
#define move16_height 16
 
389
#define move16_x_hot 1
 
390
#define move16_y_hot 1
 
391
#define move16_x_offset -8
 
392
#define move16_y_offset -2
 
393
static XmConst unsigned char move16_bits[] =
 
394
{
 
395
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x40, 0x0c,
 
396
   0x40, 0x1c, 0x40, 0x3c, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20,
 
397
   0x40, 0x20, 0x40, 0x20, 0xc0, 0x3f, 0x00, 0x00
 
398
};
 
399
static XmConst unsigned char move16M_bits[] =
 
400
{
 
401
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0xe0, 0x1f, 0xe0, 0x3f,
 
402
   0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f,
 
403
   0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f
 
404
};
 
405
static XmConst XmCursorDataRec move16CursorDataRec =
 
406
{
 
407
    move16_width, move16_height,
 
408
    move16_x_hot, move16_y_hot,
 
409
    move16_x_offset, move16_y_offset,
 
410
    "move16",
 
411
    move16_bits,
 
412
    "move16M",
 
413
    move16M_bits,
 
414
};
 
415
 
 
416
#define copy16_width 16
 
417
#define copy16_height 16
 
418
#define copy16_x_hot 1
 
419
#define copy16_y_hot 1
 
420
#define copy16_x_offset -8
 
421
#define copy16_y_offset -2
 
422
static XmConst unsigned char copy16_bits[] =
 
423
{
 
424
   0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x80, 0x18, 0x80, 0x38, 0xb0, 0x78,
 
425
   0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x7f,
 
426
   0x10, 0x00, 0x10, 0x08, 0xf0, 0x0f, 0x00, 0x00
 
427
};
 
428
static XmConst unsigned char copy16M_bits[] =
 
429
{
 
430
   0x00, 0x00, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xf8, 0xff, 0xf8, 0xff,
 
431
   0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff,
 
432
   0xf8, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f
 
433
};
 
434
static XmConst XmCursorDataRec copy16CursorDataRec =
 
435
{
 
436
    copy16_width, copy16_height,
 
437
    copy16_x_hot, copy16_y_hot,
 
438
    copy16_x_offset, copy16_y_offset,
 
439
    "copy16",
 
440
    copy16_bits,
 
441
    "copy16M",
 
442
    copy16M_bits,
 
443
};
 
444
 
 
445
#define link16_width 16
 
446
#define link16_height 16
 
447
#define link16_x_hot 1
 
448
#define link16_y_hot 1
 
449
#define link16_x_offset -8
 
450
#define link16_y_offset -2
 
451
static XmConst unsigned char link16_bits[] =
 
452
{
 
453
   0x00, 0x00, 0x80, 0x0f, 0x80, 0x18, 0x80, 0x38, 0x80, 0x78, 0xb8, 0x40,
 
454
   0x88, 0x4e, 0x88, 0x4c, 0x08, 0x4a, 0x08, 0x41, 0xa8, 0x7c, 0x68, 0x00,
 
455
   0xe8, 0x04, 0x08, 0x04, 0xf8, 0x07, 0x00, 0x00
 
456
};
 
457
static XmConst unsigned char link16M_bits[] =
 
458
{
 
459
   0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xc0, 0xff, 0xfc, 0xff, 0xfc, 0xff,
 
460
   0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff,
 
461
   0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f
 
462
};
 
463
static XmConst XmCursorDataRec link16CursorDataRec =
 
464
{
 
465
    link16_width, link16_height,
 
466
    link16_x_hot, link16_y_hot,
 
467
    link16_x_offset, link16_y_offset,
 
468
    "link16",
 
469
    link16_bits,
 
470
    "link16M",
 
471
    link16M_bits,
 
472
};
 
473
 
 
474
#define source16_width 16
 
475
#define source16_height 16
 
476
#define source16_x_hot 0
 
477
#define source16_y_hot 0
 
478
static XmConst unsigned char source16_bits[] = 
 
479
{
 
480
   0x00, 0x00, 0xaa, 0xca, 0x54, 0x85, 0xaa, 0xca, 0x54, 0xe0, 0x2a, 0xe3,
 
481
   0x94, 0x81, 0xea, 0xf8, 0x54, 0xd4, 0xaa, 0xac, 0x94, 0xd9, 0xca, 0xac,
 
482
   0x64, 0xd6, 0x32, 0xab, 0xa4, 0xd6, 0xfe, 0xff
 
483
};
 
484
static XmConst XmCursorDataRec source16CursorDataRec =
 
485
{
 
486
    source16_width, source16_height,
 
487
    source16_x_hot, source16_y_hot,
 
488
    0, 0,
 
489
    "source16",
 
490
    /* a file icon */
 
491
    source16_bits,
 
492
    NULL,
 
493
    NULL,
 
494
};
 
495
 
 
496
/*
 
497
 *  The 32x32 default icon data.
 
498
 */
 
499
 
 
500
#define state32_width 32
 
501
#define state32_height 32
 
502
#define state32_x_hot 1
 
503
#define state32_y_hot 1
 
504
#define state32_x_offset -16
 
505
#define state32_y_offset -4
 
506
static XmConst unsigned char state32_bits[] = 
 
507
{
 
508
   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
 
509
   0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
 
510
   0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
 
511
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
512
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
513
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
514
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
515
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
516
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
517
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
518
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
519
};
 
520
static XmConst unsigned char state32M_bits[] =
 
521
{
 
522
   0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
 
523
   0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
 
524
   0xff, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
 
525
   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
526
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
527
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
528
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
529
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
530
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
531
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
532
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
533
};
 
534
static XmConst XmCursorDataRec state32CursorDataRec =
 
535
{
 
536
    state32_width, state32_height,
 
537
    state32_x_hot, state32_y_hot,
 
538
    state32_x_offset, state32_y_offset,
 
539
    "state32",
 
540
    state32_bits,
 
541
    "state32M",
 
542
    state32M_bits,
 
543
};
 
544
 
 
545
#define move32_width 32
 
546
#define move32_height 32
 
547
#define move32_x_hot 1
 
548
#define move32_y_hot 1
 
549
#define move32_x_offset -16
 
550
#define move32_y_offset -4
 
551
static XmConst unsigned char move32_bits[] =
 
552
{
 
553
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
554
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
555
   0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00,
 
556
   0x20, 0xe0, 0x00, 0x00, 0x20, 0xe0, 0x01, 0x00, 0x20, 0xe0, 0x03, 0x00,
 
557
   0x20, 0xe0, 0x07, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00,
 
558
   0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00,
 
559
   0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00,
 
560
   0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00,
 
561
   0xe0, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
 
562
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
563
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
564
};
 
565
static XmConst unsigned char move32M_bits[] =
 
566
{
 
567
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
568
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
569
   0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00,
 
570
   0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00,
 
571
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
 
572
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
 
573
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
 
574
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
 
575
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x1f, 0x00,
 
576
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
577
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
578
};
 
579
static XmConst XmCursorDataRec move32CursorDataRec =
 
580
{
 
581
    move32_width, move32_height,
 
582
    move32_x_hot, move32_y_hot,
 
583
    move32_x_offset, move32_y_offset,
 
584
    "move32",
 
585
    move32_bits,
 
586
    "move32M",
 
587
    move32M_bits,
 
588
};
 
589
 
 
590
#define copy32_width 32
 
591
#define copy32_height 32
 
592
#define copy32_x_hot 1
 
593
#define copy32_y_hot 1
 
594
#define copy32_x_offset -16
 
595
#define copy32_y_offset -4
 
596
static XmConst unsigned char copy32_bits[] = 
 
597
{
 
598
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
599
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
600
   0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00,
 
601
   0x20, 0xe0, 0x00, 0x00, 0x20, 0xe0, 0x01, 0x00, 0x20, 0xe0, 0x03, 0x00,
 
602
   0x20, 0xe0, 0x07, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00,
 
603
   0x20, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x20, 0x00, 0xec, 0x00,
 
604
   0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01,
 
605
   0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01,
 
606
   0xe0, 0xff, 0x8f, 0x01, 0xc0, 0xff, 0x8f, 0x01, 0x00, 0x00, 0x80, 0x01,
 
607
   0x00, 0x04, 0x80, 0x01, 0x00, 0x04, 0x80, 0x01, 0x00, 0xfc, 0xff, 0x01,
 
608
   0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00
 
609
};
 
610
static XmConst unsigned char copy32M_bits[] = 
 
611
{
 
612
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
613
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
614
   0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00,
 
615
   0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00,
 
616
   0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x7f, 0x00,
 
617
   0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03,
 
618
   0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03,
 
619
   0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03,
 
620
   0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x03,
 
621
   0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03,
 
622
   0x00, 0xfe, 0xff, 0x03, 0x00, 0xfc, 0xff, 0x03
 
623
};
 
624
static XmConst XmCursorDataRec copy32CursorDataRec =
 
625
{
 
626
    copy32_width, copy32_height,
 
627
    copy32_x_hot, copy32_y_hot,
 
628
    copy32_x_offset, copy32_y_offset,
 
629
    "copy32",
 
630
    copy32_bits,
 
631
    "copy32M",
 
632
    copy32M_bits,
 
633
};
 
634
 
 
635
#define link32_width 32
 
636
#define link32_height 32
 
637
#define link32_x_hot 1
 
638
#define link32_y_hot 1
 
639
#define link32_x_offset -16
 
640
#define link32_y_offset -4
 
641
static XmConst unsigned char link32_bits[] =
 
642
{
 
643
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
644
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
645
   0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x20, 0x30, 0x00, 0x00,
 
646
   0x20, 0x70, 0x00, 0x00, 0x20, 0xf0, 0x00, 0x00, 0x20, 0xf0, 0x01, 0x00,
 
647
   0x20, 0x00, 0x7b, 0x00, 0x20, 0x00, 0xc3, 0x00, 0x20, 0x04, 0xc3, 0x01,
 
648
   0x20, 0x06, 0xc3, 0x03, 0x20, 0x0f, 0xc2, 0x07, 0x20, 0x36, 0x00, 0x0c,
 
649
   0x20, 0xc4, 0x00, 0x0c, 0x20, 0x00, 0x23, 0x0c, 0x20, 0x00, 0x6c, 0x0c,
 
650
   0x20, 0x00, 0xf0, 0x0c, 0xe0, 0xff, 0x61, 0x0c, 0xc0, 0xff, 0x23, 0x0c,
 
651
   0x00, 0x00, 0x00, 0x0c, 0x00, 0x80, 0x00, 0x0c, 0x00, 0x80, 0x00, 0x0c,
 
652
   0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
 
653
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
654
};
 
655
static XmConst unsigned char link32M_bits[] =
 
656
{
 
657
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
658
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
659
   0xf0, 0x3f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00,
 
660
   0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0xff, 0x00,
 
661
   0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07,
 
662
   0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f,
 
663
   0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f,
 
664
   0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f,
 
665
   0xe0, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f,
 
666
   0x00, 0xc0, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x1f,
 
667
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
668
};
 
669
static XmConst XmCursorDataRec link32CursorDataRec =
 
670
{
 
671
    link32_width, link32_height,
 
672
    link32_x_hot, link32_y_hot,
 
673
    link32_x_offset, link32_y_offset,
 
674
    "link32",
 
675
    link32_bits,
 
676
    "link32M",
 
677
    link32M_bits,
 
678
};
 
679
 
 
680
#define source32_width 32
 
681
#define source32_height 32
 
682
#define source32_x_hot 0
 
683
#define source32_y_hot 0
 
684
static XmConst unsigned char source32_bits[] =
 
685
{
 
686
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x54, 0x55, 0x55, 0xd5,
 
687
   0xa8, 0xaa, 0xaa, 0xea, 0x54, 0x55, 0x55, 0xd1, 0xa8, 0xaa, 0xaa, 0xe0,
 
688
   0x54, 0x55, 0x55, 0xd0, 0xa8, 0xaa, 0xaa, 0xf0, 0x54, 0x55, 0x55, 0xd9,
 
689
   0xa8, 0xaa, 0x00, 0xee, 0x54, 0x55, 0x00, 0xd6, 0xa8, 0x2a, 0x3f, 0xea,
 
690
   0x54, 0x95, 0x05, 0xd7, 0xa8, 0xea, 0x82, 0xee, 0x54, 0x45, 0xc1, 0xd5,
 
691
   0xa8, 0xaa, 0xf4, 0x81, 0x54, 0xd5, 0x78, 0xff, 0xa8, 0xaa, 0xa0, 0xea,
 
692
   0x54, 0x95, 0x41, 0xd5, 0xa8, 0x4a, 0x87, 0xea, 0x54, 0x85, 0x0d, 0xd5,
 
693
   0xa8, 0xc2, 0x9a, 0xea, 0x54, 0x61, 0x05, 0xd5, 0xa8, 0xb0, 0xc2, 0xea,
 
694
   0x54, 0x58, 0x61, 0xd5, 0x28, 0xac, 0xb0, 0xea, 0x14, 0x56, 0x58, 0xd5,
 
695
   0x08, 0xab, 0xa8, 0xea, 0x14, 0x55, 0x51, 0xd5, 0x28, 0xaa, 0xaa, 0xea,
 
696
   0xfc, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
 
697
};
 
698
 
 
699
static XmConst XmCursorDataRec source32CursorDataRec =
 
700
{
 
701
    source32_width, source32_height,
 
702
    source32_x_hot, source32_y_hot,
 
703
    0, 0,
 
704
    "source32",
 
705
    /* a file icon */
 
706
    source32_bits,
 
707
    NULL,
 
708
    NULL,
 
709
};
 
710
 
 
711
typedef struct _XmQuarkToCursorEntryRec{
 
712
  XrmQuark                *xrmName;
 
713
  XmConst XmCursorDataRec *cursor;
 
714
} XmQuarkToCursorEntryRec, *XmQuarkToCursorEntry;
 
715
 
 
716
/* Used to be XmConst, but this was not linking on Solaris */
 
717
static XmQuarkToCursorEntryRec AltquarkToCursorTable[] = {
 
718
    { &_XmValidCursorIconQuark,  &state32CursorDataRec},
 
719
    { &_XmInvalidCursorIconQuark,&state32CursorDataRec},
 
720
    { &_XmNoneCursorIconQuark,   &state32CursorDataRec},
 
721
    { &_XmMoveCursorIconQuark,   &move32CursorDataRec},
 
722
    { &_XmCopyCursorIconQuark,   &copy32CursorDataRec},
 
723
    { &_XmLinkCursorIconQuark,   &link32CursorDataRec},
 
724
    { &_XmDefaultDragIconQuark,  &AltsourceCursorDataRec},
 
725
};
 
726
 
 
727
/* Used to be XmConst, but this was not linking on Solaris */
 
728
static XmQuarkToCursorEntryRec AltquarkTo16CursorTable[] = {
 
729
    { &_XmValidCursorIconQuark,  &validCursorDataRec},
 
730
    { &_XmInvalidCursorIconQuark,&invalidCursorDataRec},
 
731
    { &_XmNoneCursorIconQuark,   &noneCursorDataRec},
 
732
    { &_XmMoveCursorIconQuark,   &moveCursorDataRec},
 
733
    { &_XmCopyCursorIconQuark,   &copyCursorDataRec},
 
734
    { &_XmLinkCursorIconQuark,   &linkCursorDataRec},
 
735
    { &_XmDefaultDragIconQuark,  &Altsource16CursorDataRec},
 
736
};
 
737
 
 
738
/* Used to be XmConst, but this was not linking on Solaris */
 
739
static XmQuarkToCursorEntryRec  quarkToCursorTable[] = {
 
740
    {&_XmValidCursorIconQuark,  &state32CursorDataRec},
 
741
    {&_XmInvalidCursorIconQuark,&state32CursorDataRec},
 
742
    {&_XmNoneCursorIconQuark,   &state32CursorDataRec},
 
743
    {&_XmMoveCursorIconQuark,   &move32CursorDataRec},
 
744
    {&_XmCopyCursorIconQuark,   &copy32CursorDataRec},
 
745
    {&_XmLinkCursorIconQuark,   &link32CursorDataRec},
 
746
    {&_XmDefaultDragIconQuark,  &source32CursorDataRec},
 
747
};
 
748
 
 
749
/* Used to be XmConst, but this was not linking on Solaris */
 
750
static XmQuarkToCursorEntryRec  quarkTo16CursorTable[] = {
 
751
    {&_XmValidCursorIconQuark,  &state16CursorDataRec},
 
752
    {&_XmInvalidCursorIconQuark,&state16CursorDataRec},
 
753
    {&_XmNoneCursorIconQuark,   &state16CursorDataRec},
 
754
    {&_XmMoveCursorIconQuark,   &move16CursorDataRec},
 
755
    {&_XmCopyCursorIconQuark,   &copy16CursorDataRec},
 
756
    {&_XmLinkCursorIconQuark,   &link16CursorDataRec},
 
757
    {&_XmDefaultDragIconQuark,  &source16CursorDataRec},
 
758
};
 
759
 
 
760
#undef Offset
 
761
#define Offset(x) (XtOffsetOf( struct _XmDragIconRec, drag.x))
 
762
 
 
763
static XContext _XmTextualDragIconContext = (XContext) NULL;
 
764
 
 
765
static XtResource resources[]=
 
766
{
 
767
    {
 
768
        XmNdepth, XmCDepth, XmRInt,
 
769
        sizeof(int), Offset(depth), 
 
770
        XmRImmediate, (XtPointer)1,
 
771
    },
 
772
    {
 
773
        XmNwidth, XmCWidth, XmRHorizontalDimension,
 
774
        sizeof(Dimension), Offset(width),
 
775
        XmRImmediate, (XtPointer) 0,
 
776
    },
 
777
    {
 
778
        XmNheight, XmCHeight, XmRVerticalDimension,
 
779
        sizeof(Dimension), Offset(height),
 
780
        XmRImmediate, (XtPointer) 0,
 
781
    },
 
782
    {
 
783
        XmNhotX, XmCHot, XmRPosition,
 
784
        sizeof(Position), Offset(hot_x), 
 
785
        XmRImmediate, (XtPointer)0,
 
786
    },
 
787
    {
 
788
        XmNhotY, XmCHot, XmRPosition,
 
789
        sizeof(Position), Offset(hot_y),
 
790
        XmRImmediate, (XtPointer)0,
 
791
    },
 
792
    {
 
793
        XmNmask, XmCPixmap, XmRBitmap,
 
794
        sizeof(Pixmap), Offset(mask),
 
795
        XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
 
796
    },
 
797
    {
 
798
        XmNpixmap, XmCPixmap, XmRDynamicPixmap,
 
799
        sizeof(Pixmap), Offset(pixmap),
 
800
        XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP,
 
801
    },
 
802
    {
 
803
        XmNoffsetX, XmCOffset, XmRPosition,
 
804
        sizeof(Position), Offset(offset_x), 
 
805
        XmRImmediate, (XtPointer)0,
 
806
    },
 
807
    {
 
808
        XmNoffsetY, XmCOffset, XmRPosition,
 
809
        sizeof(Position), Offset(offset_y),
 
810
        XmRImmediate, (XtPointer)0,
 
811
    },
 
812
    {
 
813
        XmNattachment, XmCAttachment, XmRIconAttachment,
 
814
                sizeof(unsigned char), Offset(attachment),
 
815
                XmRImmediate, (XtPointer) XmATTACH_NORTH_WEST
 
816
    },
 
817
};
 
818
 
 
819
externaldef(xmdragiconclassrec)
 
820
XmDragIconClassRec xmDragIconClassRec = {
 
821
    {   
 
822
        (WidgetClass) &objectClassRec,  /* superclass           */   
 
823
        "XmDragIcon",                   /* class_name           */   
 
824
        sizeof(XmDragIconRec),          /* size                 */   
 
825
        NULL,                           /* Class Initializer    */   
 
826
        NULL,                           /* class_part_init      */ 
 
827
        FALSE,                          /* Class init'ed ?      */   
 
828
        DragIconInitialize,             /* initialize           */   
 
829
        NULL,                           /* initialize_notify    */ 
 
830
        NULL,                           /* realize              */   
 
831
        NULL,                           /* actions              */   
 
832
        0,                              /* num_actions          */   
 
833
        (XtResourceList)resources,      /* resources            */   
 
834
        XtNumber(resources),            /* resource_count       */   
 
835
        NULLQUARK,                      /* xrm_class            */   
 
836
        FALSE,                          /* compress_motion      */   
 
837
        XtExposeNoCompress,             /* compress_exposure    */   
 
838
        FALSE,                          /* compress_enterleave  */   
 
839
        FALSE,                          /* visible_interest     */   
 
840
        Destroy,                        /* destroy              */   
 
841
        NULL,                           /* resize               */   
 
842
        NULL,                           /* expose               */   
 
843
        SetValues,                      /* set_values           */
 
844
        NULL,                           /* set_values_hook      */ 
 
845
        XtInheritSetValuesAlmost,       /* set_values_almost    */ 
 
846
        NULL,                           /* get_values_hook      */ 
 
847
        NULL,                           /* accept_focus         */   
 
848
        XtVersion,                      /* intrinsics version   */   
 
849
        NULL,                           /* callback offsets     */   
 
850
        NULL,                           /* tm_table             */   
 
851
        NULL,                           /* query_geometry       */ 
 
852
        NULL,                           /* display_accelerator  */ 
 
853
        NULL,                           /* extension            */ 
 
854
    },  
 
855
    {                                   /* dragIcon             */
 
856
        NULL,                           /* extension            */
 
857
    },
 
858
};
 
859
 
 
860
externaldef(dragIconobjectclass) WidgetClass 
 
861
      xmDragIconObjectClass = (WidgetClass) &xmDragIconClassRec;
 
862
 
 
863
 
 
864
/************************************************************************
 
865
 *
 
866
 *  DragIconInitialize
 
867
 *
 
868
 ************************************************************************/
 
869
 
 
870
/*ARGSUSED*/
 
871
static void 
 
872
DragIconInitialize(
 
873
        Widget req,             /* unused */
 
874
        Widget new_w,
 
875
        ArgList args,           /* unused */
 
876
        Cardinal *numArgs )     /* unused */
 
877
{
 
878
    XmDragIconObject    dragIcon = (XmDragIconObject)new_w;
 
879
    Screen              *screen = XtScreenOfObject(XtParent(dragIcon));
 
880
    Display *           display = XtDisplay(new_w);
 
881
    XmDisplay           xmdpy = (XmDisplay) XmGetXmDisplay(display);
 
882
    Boolean             use_alt = xmdpy -> display.enable_drag_icon;
 
883
 
 
884
    dragIcon->drag.isDirty = False;
 
885
    if (dragIcon->drag.pixmap == XmUNSPECIFIED_PIXMAP) {
 
886
 
 
887
        XmCursorData    cursorData = NULL;
 
888
        Cardinal        i = 0;
 
889
        XImage          *image = NULL;
 
890
        Dimension       maxW, maxH;
 
891
 
 
892
        /*
 
893
         *  If this is one of the default cursors (recognized by name)
 
894
         *  then we use the built in images to generate the pixmap, its
 
895
         *  mask (as appropriate), and its dimensions and hot spot.
 
896
         */ 
 
897
 
 
898
        XmeQueryBestCursorSize (XtParent(dragIcon), &maxW, &maxH);
 
899
 
 
900
        if (maxW < 32 || maxH < 32) {
 
901
            /*
 
902
             *  Use small icons.
 
903
             */
 
904
          if (! use_alt) {
 
905
            for (i = 0; i < XtNumber(quarkTo16CursorTable); i++) {
 
906
              if ((*(quarkTo16CursorTable[i].xrmName)) ==
 
907
                  dragIcon->object.xrm_name) {
 
908
                cursorData = (XmCursorData) quarkTo16CursorTable[i].cursor;
 
909
                break;
 
910
              }
 
911
            }
 
912
          } else {
 
913
            for (i = 0; i < XtNumber(quarkTo16CursorTable); i++) {
 
914
              if ((*(AltquarkTo16CursorTable[i].xrmName)) ==
 
915
                  dragIcon->object.xrm_name) {
 
916
                cursorData = (XmCursorData) AltquarkTo16CursorTable[i].cursor;
 
917
                break;
 
918
              }
 
919
            }
 
920
          }
 
921
        }
 
922
        else {
 
923
            /*
 
924
             *  Use large icons.
 
925
             */
 
926
          if (! use_alt) {
 
927
            for (i = 0; i < XtNumber(quarkToCursorTable); i++) {
 
928
              if ((*(quarkToCursorTable[i].xrmName)) ==
 
929
                  dragIcon->object.xrm_name) {
 
930
                cursorData = (XmCursorData) quarkToCursorTable[i].cursor;
 
931
                break;
 
932
              }
 
933
            }
 
934
          } else {
 
935
            for (i = 0; i < XtNumber(quarkToCursorTable); i++) {
 
936
              if ((*(AltquarkToCursorTable[i].xrmName)) ==
 
937
                  dragIcon->object.xrm_name) {
 
938
                cursorData = (XmCursorData) AltquarkToCursorTable[i].cursor;
 
939
                break;
 
940
              }
 
941
            }
 
942
          }
 
943
        }
 
944
 
 
945
        if (cursorData) {
 
946
            dragIcon->drag.depth = 1;
 
947
            dragIcon->drag.width = cursorData->width;
 
948
            dragIcon->drag.height = cursorData->height;
 
949
            dragIcon->drag.hot_x = cursorData->hot_x;
 
950
            dragIcon->drag.hot_y = cursorData->hot_y;
 
951
            dragIcon->drag.offset_x = cursorData->offset_x;
 
952
            dragIcon->drag.offset_y = cursorData->offset_y;
 
953
 
 
954
            _XmCreateImage(image, display, (char *)cursorData->data,
 
955
                        dragIcon->drag.width, dragIcon->drag.height, 
 
956
                        LSBFirst);
 
957
    
 
958
            _XmInstallImage(image, cursorData->dataName,        
 
959
                            (int)dragIcon->drag.hot_x, 
 
960
                            (int)dragIcon->drag.hot_y);
 
961
            dragIcon->drag.pixmap =
 
962
                XmGetPixmapByDepth (screen, cursorData->dataName, 1, 0, 1);
 
963
    
 
964
            if (cursorData->maskData) {
 
965
                _XmCreateImage(image, display, (char *)cursorData->maskData,
 
966
                            dragIcon->drag.width, dragIcon->drag.height, 
 
967
                            LSBFirst);
 
968
        
 
969
                _XmInstallImage (image, cursorData->maskDataName, 0, 0);
 
970
        
 
971
                dragIcon->drag.mask =
 
972
                    XmGetPixmapByDepth(screen, cursorData->maskDataName, 
 
973
                                       1, 0, 1);
 
974
            }
 
975
        }
 
976
        dragIcon->drag.region = NULL;
 
977
    }
 
978
    else if (dragIcon->drag.pixmap != XmUNSPECIFIED_PIXMAP) {
 
979
      int               depth;
 
980
      unsigned int      width, height;
 
981
      int               hot_x, hot_y;
 
982
      String            name;
 
983
      Pixel             foreground, background;
 
984
      if ((dragIcon->drag.width == 0) || (dragIcon->drag.height == 0)) {
 
985
            if (XmeGetPixmapData(screen,
 
986
                                 dragIcon->drag.pixmap,
 
987
                                 &name,
 
988
                                 &depth, 
 
989
                                 &foreground, &background,
 
990
                                 &hot_x, &hot_y,
 
991
                                 &width, &height)) {
 
992
                dragIcon->drag.depth = depth;
 
993
                dragIcon->drag.hot_x = hot_x;
 
994
                dragIcon->drag.hot_y = hot_y;
 
995
                dragIcon->drag.width = (Dimension)width;
 
996
                dragIcon->drag.height = (Dimension)height;
 
997
            }
 
998
            else {
 
999
                dragIcon->drag.width = 
 
1000
                  dragIcon->drag.height = 0;
 
1001
                dragIcon->drag.pixmap = XmUNSPECIFIED_PIXMAP;
 
1002
                XmeWarning ((Widget) new_w, MESSAGE1);
 
1003
            }
 
1004
        }
 
1005
        if (dragIcon->drag.mask != XmUNSPECIFIED_PIXMAP) {
 
1006
           XImage * image;
 
1007
 
 
1008
           if (dragIcon->drag.width > 0 && dragIcon->drag.height > 0) {
 
1009
                image = XGetImage(display, (Drawable) dragIcon->drag.mask,
 
1010
                                  0, 0, dragIcon->drag.width,
 
1011
                                  dragIcon->drag.height, 1L, XYPixmap);
 
1012
 
 
1013
                dragIcon->drag.region = (Region) _XmRegionFromImage(image);
 
1014
                if (image)
 
1015
                    XDestroyImage(image);
 
1016
            } else
 
1017
                dragIcon->drag.region = NULL;
 
1018
           
 
1019
        } else
 
1020
           dragIcon->drag.region = NULL;
 
1021
    }
 
1022
 
 
1023
    dragIcon->drag.restore_region = NULL;
 
1024
    dragIcon->drag.x_offset = 0;
 
1025
    dragIcon->drag.y_offset = 0;
 
1026
 
 
1027
    if (dragIcon->drag.pixmap == XmUNSPECIFIED_PIXMAP) {
 
1028
        XmeWarning ((Widget) new_w, MESSAGE2);
 
1029
    }
 
1030
}
 
1031
 
 
1032
/************************************************************************
 
1033
 *
 
1034
 *  XmCreateDragIcon
 
1035
 *
 
1036
 ************************************************************************/
 
1037
 
 
1038
Widget 
 
1039
XmCreateDragIcon(
 
1040
        Widget parent,
 
1041
        String name,
 
1042
        ArgList argList,
 
1043
        Cardinal argCount )
 
1044
{
 
1045
    return (XtCreateWidget (name, xmDragIconObjectClass, parent,
 
1046
                            argList, argCount));
 
1047
}
 
1048
 
 
1049
/************************************************************************
 
1050
 *
 
1051
 *  _XmDestroyDefaultDragIcon ()
 
1052
 *
 
1053
 *  A default XmDragIcon's pixmap and mask (if present) were installed in
 
1054
 *  the Xm pixmap cache from built-in images when the XmDragIcon was
 
1055
 *  initialized.
 
1056
 ************************************************************************/
 
1057
 
 
1058
void 
 
1059
_XmDestroyDefaultDragIcon(
 
1060
        XmDragIconObject icon)
 
1061
{
 
1062
    Screen      *screen = XtScreenOfObject(XtParent(icon));
 
1063
 
 
1064
    if (icon->drag.pixmap != XmUNSPECIFIED_PIXMAP) {
 
1065
        XmDestroyPixmap (screen, icon->drag.pixmap);
 
1066
        icon->drag.pixmap = XmUNSPECIFIED_PIXMAP;
 
1067
    }
 
1068
    if (icon->drag.mask != XmUNSPECIFIED_PIXMAP) {
 
1069
        XmDestroyPixmap (screen, icon->drag.mask);
 
1070
        icon->drag.mask = XmUNSPECIFIED_PIXMAP;
 
1071
    }
 
1072
    XtDestroyWidget ((Widget) icon);
 
1073
}
 
1074
 
 
1075
/************************************************************************
 
1076
 *
 
1077
 *  _XmDragIconIsDirty ()
 
1078
 *
 
1079
 *  Test the isDirty member of XmDragIconObject.
 
1080
 ************************************************************************/
 
1081
 
 
1082
Boolean 
 
1083
_XmDragIconIsDirty(
 
1084
        XmDragIconObject icon)
 
1085
{
 
1086
    return (icon->drag.isDirty);
 
1087
}
 
1088
 
 
1089
/************************************************************************
 
1090
 *
 
1091
 *  _XmDragIconClean ()
 
1092
 *
 
1093
 *  Clear the isDirty member of XmDragIconObjects.
 
1094
 ************************************************************************/
 
1095
 
 
1096
void
 
1097
_XmDragIconClean(
 
1098
        XmDragIconObject icon1,
 
1099
        XmDragIconObject icon2,
 
1100
        XmDragIconObject icon3)
 
1101
{
 
1102
    if (icon1)
 
1103
        icon1->drag.isDirty = False;
 
1104
    if (icon2)
 
1105
        icon2->drag.isDirty = False;
 
1106
    if (icon3)
 
1107
        icon3->drag.isDirty = False;
 
1108
}
 
1109
 
 
1110
/************************************************************************
 
1111
 *
 
1112
 *  SetValues
 
1113
 *
 
1114
 ************************************************************************/
 
1115
 
 
1116
/*ARGSUSED*/
 
1117
static Boolean
 
1118
SetValues(
 
1119
    Widget      current,
 
1120
    Widget      req,            /* unused */
 
1121
    Widget      new_w,
 
1122
    ArgList     args,           /* unused */
 
1123
    Cardinal    *num_args)      /* unused */
 
1124
{
 
1125
    XmDragIconObject    newIcon = (XmDragIconObject) new_w;
 
1126
    XmDragIconObject    oldIcon = (XmDragIconObject) current;
 
1127
 
 
1128
    /*
 
1129
     *  Mark the icon as dirty if any of its resources have changed.
 
1130
     */
 
1131
 
 
1132
    if ((newIcon->drag.depth != oldIcon->drag.depth) ||
 
1133
        (newIcon->drag.pixmap != oldIcon->drag.pixmap) ||
 
1134
        (newIcon->drag.mask != oldIcon->drag.mask) ||
 
1135
        (newIcon->drag.width != oldIcon->drag.width) ||
 
1136
        (newIcon->drag.height != oldIcon->drag.height) ||
 
1137
        (newIcon->drag.attachment != oldIcon->drag.attachment) ||
 
1138
        (newIcon->drag.offset_x != oldIcon->drag.offset_x) ||
 
1139
        (newIcon->drag.offset_y != oldIcon->drag.offset_y) ||
 
1140
        (newIcon->drag.hot_x != oldIcon->drag.hot_x) ||
 
1141
        (newIcon->drag.hot_y != oldIcon->drag.hot_y)) {
 
1142
 
 
1143
        newIcon->drag.isDirty = True;
 
1144
    }
 
1145
 
 
1146
    if (newIcon->drag.mask != oldIcon->drag.mask) {
 
1147
       if (newIcon->drag.mask != XmUNSPECIFIED_PIXMAP) {
 
1148
           XImage * image;
 
1149
 
 
1150
           if (newIcon->drag.width > 0 && newIcon->drag.height > 0) {
 
1151
                image = XGetImage(XtDisplay(new_w),
 
1152
                                  (Drawable) newIcon->drag.mask,
 
1153
                                  0, 0, newIcon->drag.width,
 
1154
                                  newIcon->drag.height, 1L, XYPixmap);
 
1155
 
 
1156
                newIcon->drag.region = (Region) _XmRegionFromImage(image);
 
1157
                if (image)
 
1158
                    XDestroyImage(image);
 
1159
            }
 
1160
            else
 
1161
                newIcon->drag.region = NULL;
 
1162
       }
 
1163
       else
 
1164
            newIcon->drag.region = NULL;
 
1165
 
 
1166
       if (oldIcon->drag.region) {
 
1167
          XDestroyRegion(oldIcon->drag.region);
 
1168
          oldIcon->drag.region = NULL;
 
1169
       }
 
1170
    }
 
1171
 
 
1172
    return False;
 
1173
}
 
1174
 
 
1175
/************************************************************************
 
1176
 *
 
1177
 *  Destroy
 
1178
 *
 
1179
 *  Remove any cached cursors referencing this icon.
 
1180
 ************************************************************************/
 
1181
 
 
1182
static void 
 
1183
Destroy(
 
1184
        Widget w )
 
1185
{
 
1186
     XmDragIconObject   dragIcon = (XmDragIconObject) w;
 
1187
 
 
1188
     if (dragIcon->drag.region != NULL) {
 
1189
        XDestroyRegion(dragIcon->drag.region);
 
1190
        dragIcon->drag.region = NULL;
 
1191
     }
 
1192
 
 
1193
     if (dragIcon->drag.restore_region != NULL) {
 
1194
        XDestroyRegion(dragIcon->drag.restore_region);
 
1195
        dragIcon->drag.restore_region = NULL;
 
1196
     }
 
1197
 
 
1198
    _XmScreenRemoveFromCursorCache (dragIcon);
 
1199
}
 
1200
 
 
1201
 
 
1202
 
 
1203
/* ARGSUSED */
 
1204
static void
 
1205
ScreenObjectDestroy(
 
1206
        Widget w,
 
1207
        XtPointer client_data,
 
1208
        XtPointer call_data )
 
1209
{
 
1210
   Widget drag_icon = (Widget) client_data;
 
1211
 
 
1212
   XtDestroyWidget(drag_icon);  /* destroy drag_icon */
 
1213
   _XmProcessLock();
 
1214
   XDeleteContext(XtDisplay(w), RootWindowOfScreen(XtScreen(w)),  
 
1215
                  _XmTextualDragIconContext);
 
1216
   _XmProcessUnlock();
 
1217
}
 
1218
 
 
1219
 
 
1220
Widget
 
1221
XmeGetTextualDragIcon(
 
1222
        Widget w )
 
1223
{
 
1224
    Widget drag_icon;
 
1225
    Arg args[10];
 
1226
    int n = 0;
 
1227
    Pixmap icon, icon_mask;
 
1228
    Screen *screen = XtScreen(w);
 
1229
    XImage *image = NULL;
 
1230
    Window      root;
 
1231
    Widget screen_object;
 
1232
    XmDisplay dpy;
 
1233
    Boolean use_alt;
 
1234
    XContext loc_context;
 
1235
    _XmWidgetToAppContext(w);
 
1236
 
 
1237
   _XmAppLock(app);
 
1238
   root = RootWindowOfScreen(XtScreen(w));
 
1239
   dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w));
 
1240
   use_alt = dpy -> display.enable_drag_icon;
 
1241
 
 
1242
   _XmProcessLock();
 
1243
   if (_XmTextualDragIconContext == (XContext) NULL)
 
1244
      _XmTextualDragIconContext = XUniqueContext();
 
1245
   loc_context = _XmTextualDragIconContext;
 
1246
   _XmProcessUnlock();
 
1247
 
 
1248
   if (XFindContext(XtDisplay(w), root,
 
1249
                    loc_context, (char **) &drag_icon)) {
 
1250
       Dimension height, width;
 
1251
       int x_hot, y_hot;
 
1252
       XmConst unsigned char *icon_bits;
 
1253
       XmConst unsigned char *icon_mask_bits;
 
1254
 
 
1255
       XmeQueryBestCursorSize(w, &width, &height);
 
1256
 
 
1257
       if (width < 64 && height < 64) {
 
1258
         if (use_alt) {
 
1259
           icon_bits = XmTEXTUAL_DRAG_ICON_BITS_Alt_16;
 
1260
           icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_16;
 
1261
           height = XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_16;
 
1262
           width = XmTEXTUAL_DRAG_ICON_WIDTH_Alt_16;
 
1263
           x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_Alt_16;
 
1264
           y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_16;
 
1265
         } else {
 
1266
           icon_bits = XmTEXTUAL_DRAG_ICON_BITS_16;
 
1267
           icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_16;
 
1268
           height = XmTEXTUAL_DRAG_ICON_HEIGHT_16;
 
1269
           width = XmTEXTUAL_DRAG_ICON_WIDTH_16;
 
1270
           x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_16;
 
1271
           y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_16;
 
1272
         }
 
1273
       } else {
 
1274
         if (use_alt) {
 
1275
           icon_bits = XmTEXTUAL_DRAG_ICON_BITS_Alt_32;
 
1276
           icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_32;
 
1277
           height = XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_32;
 
1278
           width = XmTEXTUAL_DRAG_ICON_WIDTH_Alt_32;
 
1279
           x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_Alt_32;
 
1280
           y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_32;
 
1281
         } else {
 
1282
           icon_bits = XmTEXTUAL_DRAG_ICON_BITS_32;
 
1283
           icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_32;
 
1284
           height = XmTEXTUAL_DRAG_ICON_HEIGHT_32;
 
1285
           width = XmTEXTUAL_DRAG_ICON_WIDTH_32;
 
1286
           x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_32;
 
1287
           y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_32;
 
1288
         }
 
1289
       }
 
1290
 
 
1291
       _XmCreateImage(image, XtDisplay(w), (char *)icon_bits, 
 
1292
                width, height, LSBFirst);
 
1293
       _XmInstallImage(image, "XmTextualDragIcon", x_hot, y_hot);
 
1294
       icon = XmGetPixmapByDepth(screen, "XmTextualDragIcon", 1, 0, 1);
 
1295
 
 
1296
       _XmCreateImage(image, XtDisplay(w), (char *)icon_mask_bits, 
 
1297
                   width, height, LSBFirst);
 
1298
       _XmInstallImage(image, "XmTextualDragIconMask", x_hot, y_hot);
 
1299
       icon_mask = XmGetPixmapByDepth(screen, "XmTextualDragIconMask", 
 
1300
                                      1, 0, 1);
 
1301
       screen_object = XmGetXmScreen(XtScreen(w));
 
1302
 
 
1303
       XtSetArg(args[n], XmNhotX, x_hot);  n++;
 
1304
       XtSetArg(args[n], XmNhotY, y_hot);  n++;
 
1305
       XtSetArg(args[n], XmNheight, height);  n++;
 
1306
       XtSetArg(args[n], XmNwidth, width);  n++;
 
1307
       XtSetArg(args[n], XmNmaxHeight, height);  n++;
 
1308
       XtSetArg(args[n], XmNmaxWidth, width);  n++;
 
1309
       XtSetArg(args[n], XmNmask, icon_mask);  n++;
 
1310
       XtSetArg(args[n], XmNpixmap, icon);  n++;
 
1311
       drag_icon = XtCreateWidget("drag_icon", xmDragIconObjectClass,
 
1312
                                  screen_object, args, n);
 
1313
 
 
1314
       XSaveContext(XtDisplay(w), root,
 
1315
                    loc_context, (char *) drag_icon);
 
1316
 
 
1317
       XtAddCallback(screen_object, XmNdestroyCallback, ScreenObjectDestroy,
 
1318
                       (XtPointer) drag_icon);
 
1319
   }
 
1320
 
 
1321
   _XmAppUnlock(app);
 
1322
   return drag_icon;
 
1323
}
 
1324