~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/lib/PEX5/pl_oc_attr.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Xorg: pl_oc_attr.c,v 1.5 2001/02/09 02:03:28 xorgcvs Exp $ */
 
2
 
 
3
/******************************************************************************
 
4
 
 
5
Copyright 1992, 1998  The Open Group
 
6
 
 
7
Permission to use, copy, modify, distribute, and sell this software and its
 
8
documentation for any purpose is hereby granted without fee, provided that
 
9
the above copyright notice appear in all copies and that both that
 
10
copyright notice and this permission notice appear in supporting
 
11
documentation.
 
12
 
 
13
The above copyright notice and this permission notice shall be included in
 
14
all copies or substantial portions of the Software.
 
15
 
 
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
19
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
22
 
 
23
Except as contained in this notice, the name of The Open Group shall not be
 
24
used in advertising or otherwise to promote the sale, use or other dealings
 
25
in this Software without prior written authorization from The Open Group.
 
26
 
 
27
 
 
28
Copyright 1987,1991 by Digital Equipment Corporation, Maynard, Massachusetts
 
29
 
 
30
                        All Rights Reserved
 
31
 
 
32
Permission to use, copy, modify, distribute, and sell this software and its
 
33
documentation for any purpose is hereby granted without fee, provided that
 
34
the above copyright notice appear in all copies and that both that copyright
 
35
notice and this permission notice appear in supporting documentation, and that
 
36
the name of Digital not be used in advertising or publicity
 
37
pertaining to distribution of the software without specific, written prior
 
38
permission.  Digital make no representations about the suitability
 
39
of this software for any purpose.  It is provided "as is" without express or
 
40
implied warranty.
 
41
 
 
42
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 
43
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 
44
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
45
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
46
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
47
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 
48
SOFTWARE.
 
49
******************************************************************************/
 
50
 
 
51
#include "PEXlib.h"
 
52
#include "PEXlibint.h"
 
53
#include "pl_oc_util.h"
 
54
 
 
55
 
 
56
void
 
57
PEXSetMarkerType (display, resource_id, req_type, type)
 
58
 
 
59
INPUT Display           *display;
 
60
INPUT XID               resource_id;
 
61
INPUT PEXOCRequestType  req_type;
 
62
INPUT int               type;
 
63
 
 
64
{
 
65
    register pexMarkerType      *req;
 
66
 
 
67
    BEGIN_SIMPLE_OC (MarkerType, resource_id, req_type, req);
 
68
    req->markerType = type;
 
69
    END_SIMPLE_OC (MarkerType, resource_id, req_type, req);
 
70
}
 
71
 
 
72
 
 
73
void
 
74
PEXSetMarkerScale (display, resource_id, req_type, scale)
 
75
 
 
76
INPUT Display           *display;
 
77
INPUT XID               resource_id;
 
78
INPUT PEXOCRequestType  req_type;
 
79
INPUT double            scale;
 
80
 
 
81
{
 
82
    register pexMarkerScale     *req;
 
83
    int                         fpConvert;
 
84
    int                         fpFormat;
 
85
 
 
86
    BEGIN_SIMPLE_OC (MarkerScale, resource_id, req_type, req);
 
87
    CHECK_FP (fpConvert, fpFormat);
 
88
 
 
89
    if (fpConvert)
 
90
    {
 
91
        FP_CONVERT_DHTON (scale, req->scale, fpFormat);
 
92
    }
 
93
    else
 
94
        req->scale = scale;
 
95
 
 
96
    END_SIMPLE_OC (MarkerScale, resource_id, req_type, req);
 
97
}
 
98
 
 
99
 
 
100
void
 
101
PEXSetMarkerColorIndex (display, resource_id, req_type, index)
 
102
 
 
103
INPUT Display           *display;
 
104
INPUT XID               resource_id;
 
105
INPUT PEXOCRequestType  req_type;
 
106
INPUT unsigned int      index;
 
107
 
 
108
{
 
109
    register pexMarkerColorIndex        *req;
 
110
 
 
111
    BEGIN_SIMPLE_OC (MarkerColorIndex, resource_id, req_type, req);
 
112
    req->index = index;
 
113
    END_SIMPLE_OC (MarkerColorIndex, resource_id, req_type, req);
 
114
}
 
115
 
 
116
 
 
117
void
 
118
PEXSetMarkerColor (display, resource_id, req_type, colorType, color)
 
119
 
 
120
INPUT Display           *display;
 
121
INPUT XID               resource_id;
 
122
INPUT PEXOCRequestType  req_type;
 
123
INPUT int               colorType;
 
124
INPUT PEXColor          *color;
 
125
 
 
126
{
 
127
    register pexMarkerColor     *req;
 
128
    char                        *pBuf;
 
129
    int                         lenofColor;
 
130
    int                         fpConvert;
 
131
    int                         fpFormat;
 
132
 
 
133
    lenofColor = GetColorLength (colorType);
 
134
 
 
135
    PEXInitOC (display, resource_id, req_type,
 
136
        LENOF (pexMarkerColor), lenofColor, pBuf);
 
137
 
 
138
    if (pBuf == NULL) return;
 
139
 
 
140
    CHECK_FP (fpConvert, fpFormat);
 
141
 
 
142
    BEGIN_OC_HEADER (MarkerColor, lenofColor, pBuf, req);
 
143
 
 
144
    req->colorType = colorType;
 
145
 
 
146
    END_OC_HEADER (MarkerColor, pBuf, req);
 
147
 
 
148
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
149
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
150
 
 
151
    PEXFinishOC (display);
 
152
    PEXSyncHandle (display);
 
153
}
 
154
 
 
155
 
 
156
void
 
157
PEXSetMarkerBundleIndex (display, resource_id, req_type, index)
 
158
 
 
159
INPUT Display           *display;
 
160
INPUT XID               resource_id;
 
161
INPUT PEXOCRequestType  req_type;
 
162
INPUT unsigned int      index;
 
163
 
 
164
{
 
165
    register pexMarkerBundleIndex       *req;
 
166
 
 
167
    BEGIN_SIMPLE_OC (MarkerBundleIndex, resource_id, req_type, req);
 
168
    req->index = index;
 
169
    END_SIMPLE_OC (MarkerBundleIndex, resource_id, req_type, req);
 
170
}
 
171
 
 
172
 
 
173
void
 
174
PEXSetTextFontIndex (display, resource_id, req_type, index)
 
175
 
 
176
INPUT Display           *display;
 
177
INPUT XID               resource_id;
 
178
INPUT PEXOCRequestType  req_type;
 
179
INPUT unsigned int      index;
 
180
 
 
181
{
 
182
    register pexTextFontIndex   *req;
 
183
 
 
184
    BEGIN_SIMPLE_OC (TextFontIndex, resource_id, req_type, req);
 
185
    req->index = index;
 
186
    END_SIMPLE_OC (TextFontIndex, resource_id, req_type, req);
 
187
}
 
188
 
 
189
 
 
190
void
 
191
PEXSetTextPrecision (display, resource_id, req_type, precision)
 
192
 
 
193
INPUT Display           *display;
 
194
INPUT XID               resource_id;
 
195
INPUT PEXOCRequestType  req_type;
 
196
INPUT int               precision;
 
197
 
 
198
{
 
199
    register pexTextPrecision   *req;
 
200
 
 
201
    BEGIN_SIMPLE_OC (TextPrecision, resource_id, req_type, req);
 
202
    req->precision = precision;
 
203
    END_SIMPLE_OC (TextPrecision, resource_id, req_type, req);
 
204
}
 
205
 
 
206
 
 
207
void
 
208
PEXSetCharExpansion (display, resource_id, req_type, expansion)
 
209
 
 
210
INPUT Display           *display;
 
211
INPUT XID               resource_id;
 
212
INPUT PEXOCRequestType  req_type;
 
213
INPUT double            expansion;
 
214
 
 
215
{
 
216
    register pexCharExpansion   *req;
 
217
    int                         fpConvert;
 
218
    int                         fpFormat;
 
219
 
 
220
    BEGIN_SIMPLE_OC (CharExpansion, resource_id, req_type, req);
 
221
    CHECK_FP (fpConvert, fpFormat);
 
222
 
 
223
    if (fpConvert)
 
224
    {
 
225
        FP_CONVERT_DHTON (expansion, req->expansion, fpFormat);
 
226
    }
 
227
    else
 
228
        req->expansion = expansion;
 
229
 
 
230
    END_SIMPLE_OC (CharExpansion, resource_id, req_type, req);
 
231
}
 
232
 
 
233
 
 
234
void
 
235
PEXSetCharSpacing (display, resource_id, req_type, spacing)
 
236
 
 
237
INPUT Display           *display;
 
238
INPUT XID               resource_id;
 
239
INPUT PEXOCRequestType  req_type;
 
240
INPUT double            spacing;
 
241
 
 
242
{
 
243
    register pexCharSpacing     *req;
 
244
    int                         fpConvert;
 
245
    int                         fpFormat;
 
246
 
 
247
    BEGIN_SIMPLE_OC (CharSpacing, resource_id, req_type, req);
 
248
    CHECK_FP (fpConvert, fpFormat);
 
249
 
 
250
    if (fpConvert)
 
251
    {
 
252
        FP_CONVERT_DHTON (spacing, req->spacing, fpFormat);
 
253
    }
 
254
    else
 
255
        req->spacing = spacing;
 
256
 
 
257
    END_SIMPLE_OC (CharSpacing, resource_id, req_type, req);
 
258
}
 
259
 
 
260
 
 
261
void
 
262
PEXSetTextColorIndex (display, resource_id, req_type, index)
 
263
 
 
264
INPUT Display           *display;
 
265
INPUT XID               resource_id;
 
266
INPUT PEXOCRequestType  req_type;
 
267
INPUT unsigned int      index;
 
268
 
 
269
{
 
270
    register pexTextColorIndex  *req;
 
271
 
 
272
    BEGIN_SIMPLE_OC (TextColorIndex, resource_id, req_type, req);
 
273
    req->index = index;
 
274
    END_SIMPLE_OC (TextColorIndex, resource_id, req_type, req);
 
275
}
 
276
 
 
277
 
 
278
void
 
279
PEXSetTextColor (display, resource_id, req_type, colorType, color)
 
280
 
 
281
INPUT Display           *display;
 
282
INPUT XID               resource_id;
 
283
INPUT PEXOCRequestType  req_type;
 
284
INPUT int               colorType;
 
285
INPUT PEXColor          *color;
 
286
 
 
287
{
 
288
    register pexTextColor       *req;
 
289
    char                        *pBuf;
 
290
    int                         lenofColor;
 
291
    int                         fpConvert;
 
292
    int                         fpFormat;
 
293
 
 
294
    lenofColor = GetColorLength (colorType);
 
295
 
 
296
    PEXInitOC (display, resource_id, req_type,
 
297
        LENOF (pexTextColor), lenofColor, pBuf);
 
298
 
 
299
    if (pBuf == NULL) return;
 
300
 
 
301
    CHECK_FP (fpConvert, fpFormat);
 
302
 
 
303
    BEGIN_OC_HEADER (TextColor, lenofColor, pBuf, req);
 
304
 
 
305
    req->colorType = colorType;
 
306
 
 
307
    END_OC_HEADER (TextColor, pBuf, req);
 
308
 
 
309
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
310
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
311
 
 
312
    PEXFinishOC (display);
 
313
    PEXSyncHandle (display);
 
314
}
 
315
 
 
316
 
 
317
void
 
318
PEXSetCharHeight (display, resource_id, req_type, height)
 
319
 
 
320
INPUT Display           *display;
 
321
INPUT XID               resource_id;
 
322
INPUT PEXOCRequestType  req_type;
 
323
INPUT double            height;
 
324
 
 
325
{
 
326
    register pexCharHeight      *req;
 
327
    int                         fpConvert;
 
328
    int                         fpFormat;
 
329
 
 
330
    BEGIN_SIMPLE_OC (CharHeight, resource_id, req_type, req);
 
331
    CHECK_FP (fpConvert, fpFormat);
 
332
 
 
333
    if (fpConvert)
 
334
    {
 
335
        FP_CONVERT_DHTON (height, req->height, fpFormat);
 
336
    }
 
337
    else
 
338
        req->height = height;
 
339
 
 
340
    END_SIMPLE_OC (CharHeight, resource_id, req_type, req);
 
341
}
 
342
 
 
343
 
 
344
void
 
345
PEXSetCharUpVector (display, resource_id, req_type, vector)
 
346
 
 
347
INPUT Display           *display;
 
348
INPUT XID               resource_id;
 
349
INPUT PEXOCRequestType  req_type;
 
350
INPUT PEXVector2D       *vector;
 
351
 
 
352
{
 
353
    register pexCharUpVector    *req;
 
354
    int                         fpConvert;
 
355
    int                         fpFormat;
 
356
 
 
357
    BEGIN_SIMPLE_OC (CharUpVector, resource_id, req_type, req);
 
358
    CHECK_FP (fpConvert, fpFormat);
 
359
 
 
360
    if (fpConvert)
 
361
    {
 
362
        FP_CONVERT_HTON (vector->x, req->up_x, fpFormat);
 
363
        FP_CONVERT_HTON (vector->y, req->up_y, fpFormat);
 
364
    }
 
365
    else
 
366
    {
 
367
        req->up_x = vector->x;
 
368
        req->up_y = vector->y;
 
369
    }
 
370
 
 
371
    END_SIMPLE_OC (CharUpVector, resource_id, req_type, req);
 
372
}
 
373
 
 
374
 
 
375
void
 
376
PEXSetTextPath (display, resource_id, req_type, path)
 
377
 
 
378
INPUT Display           *display;
 
379
INPUT XID               resource_id;
 
380
INPUT PEXOCRequestType  req_type;
 
381
INPUT int               path;
 
382
 
 
383
{
 
384
    register pexTextPath        *req;
 
385
 
 
386
    BEGIN_SIMPLE_OC (TextPath, resource_id, req_type, req);
 
387
    req->path = path;
 
388
    END_SIMPLE_OC (TextPath, resource_id, req_type, req);
 
389
}
 
390
 
 
391
 
 
392
void
 
393
PEXSetTextAlignment (display, resource_id, req_type, halignment, valignment)
 
394
 
 
395
INPUT Display           *display;
 
396
INPUT XID               resource_id;
 
397
INPUT PEXOCRequestType  req_type;
 
398
INPUT int               halignment;
 
399
INPUT int               valignment;
 
400
 
 
401
{
 
402
    register pexTextAlignment   *req;
 
403
 
 
404
    BEGIN_SIMPLE_OC (TextAlignment, resource_id, req_type, req);
 
405
    req->alignment_vertical = valignment;
 
406
    req->alignment_horizontal = halignment;
 
407
    END_SIMPLE_OC (TextAlignment, resource_id, req_type, req);
 
408
}
 
409
 
 
410
 
 
411
void
 
412
PEXSetATextHeight (display, resource_id, req_type, height)
 
413
 
 
414
INPUT Display           *display;
 
415
INPUT XID               resource_id;
 
416
INPUT PEXOCRequestType  req_type;
 
417
INPUT double            height;
 
418
 
 
419
{
 
420
    register pexATextHeight     *req;
 
421
    int                         fpConvert;
 
422
    int                         fpFormat;
 
423
 
 
424
    BEGIN_SIMPLE_OC (ATextHeight, resource_id, req_type, req);
 
425
    CHECK_FP (fpConvert, fpFormat);
 
426
 
 
427
    if (fpConvert)
 
428
    {
 
429
        FP_CONVERT_DHTON (height, req->height, fpFormat);
 
430
    }
 
431
    else
 
432
        req->height = height;
 
433
 
 
434
    END_SIMPLE_OC (ATextHeight, resource_id, req_type, req);
 
435
}
 
436
 
 
437
 
 
438
void
 
439
PEXSetATextUpVector (display, resource_id, req_type, vector)
 
440
 
 
441
INPUT Display           *display;
 
442
INPUT XID               resource_id;
 
443
INPUT PEXOCRequestType  req_type;
 
444
INPUT PEXVector2D       *vector;
 
445
 
 
446
{
 
447
    register pexATextUpVector   *req;
 
448
    int                         fpConvert;
 
449
    int                         fpFormat;
 
450
 
 
451
    BEGIN_SIMPLE_OC (ATextUpVector, resource_id, req_type, req);
 
452
    CHECK_FP (fpConvert, fpFormat);
 
453
 
 
454
    if (fpConvert)
 
455
    {
 
456
        FP_CONVERT_HTON (vector->x, req->up_x, fpFormat);
 
457
        FP_CONVERT_HTON (vector->y, req->up_y, fpFormat);
 
458
    }
 
459
    else
 
460
    {
 
461
        req->up_x = vector->x;
 
462
        req->up_y = vector->y;
 
463
    }
 
464
 
 
465
    END_SIMPLE_OC (ATextUpVector, resource_id, req_type, req);
 
466
}
 
467
 
 
468
 
 
469
void
 
470
PEXSetATextPath (display, resource_id, req_type, path)
 
471
 
 
472
INPUT Display           *display;
 
473
INPUT XID               resource_id;
 
474
INPUT PEXOCRequestType  req_type;
 
475
INPUT int               path;
 
476
 
 
477
{
 
478
    register pexATextPath       *req;
 
479
 
 
480
    BEGIN_SIMPLE_OC (ATextPath, resource_id, req_type, req);
 
481
    req->path = path;
 
482
    END_SIMPLE_OC (ATextPath, resource_id, req_type, req);
 
483
}
 
484
 
 
485
 
 
486
void
 
487
PEXSetATextAlignment (display, resource_id, req_type, halignment, valignment)
 
488
 
 
489
INPUT Display           *display;
 
490
INPUT XID               resource_id;
 
491
INPUT PEXOCRequestType  req_type;
 
492
INPUT int               halignment;
 
493
INPUT int               valignment;
 
494
 
 
495
{
 
496
    register pexATextAlignment  *req;
 
497
 
 
498
    BEGIN_SIMPLE_OC (ATextAlignment, resource_id, req_type, req);
 
499
    req->alignment_vertical = valignment;
 
500
    req->alignment_horizontal = halignment;
 
501
    END_SIMPLE_OC (ATextAlignment, resource_id, req_type, req);
 
502
}
 
503
 
 
504
 
 
505
void
 
506
PEXSetATextStyle (display, resource_id, req_type, style)
 
507
 
 
508
INPUT Display           *display;
 
509
INPUT XID               resource_id;
 
510
INPUT PEXOCRequestType  req_type;
 
511
INPUT int               style;
 
512
 
 
513
{
 
514
    register pexATextStyle      *req;
 
515
 
 
516
    BEGIN_SIMPLE_OC (ATextStyle, resource_id, req_type, req);
 
517
    req->style = style;
 
518
    END_SIMPLE_OC (ATextStyle, resource_id, req_type, req);
 
519
}
 
520
 
 
521
 
 
522
void
 
523
PEXSetTextBundleIndex (display, resource_id, req_type, index)
 
524
 
 
525
INPUT Display           *display;
 
526
INPUT XID               resource_id;
 
527
INPUT PEXOCRequestType  req_type;
 
528
INPUT unsigned int      index;
 
529
 
 
530
{
 
531
    register pexTextBundleIndex *req;
 
532
 
 
533
    BEGIN_SIMPLE_OC (TextBundleIndex, resource_id, req_type, req);
 
534
    req->index = index;
 
535
    END_SIMPLE_OC (TextBundleIndex, resource_id, req_type, req);
 
536
}
 
537
 
 
538
 
 
539
void
 
540
PEXSetLineType (display, resource_id, req_type, type)
 
541
 
 
542
INPUT Display           *display;
 
543
INPUT XID               resource_id;
 
544
INPUT PEXOCRequestType  req_type;
 
545
INPUT int               type;
 
546
 
 
547
{
 
548
    register pexLineType        *req;
 
549
 
 
550
    BEGIN_SIMPLE_OC (LineType, resource_id, req_type, req);
 
551
    req->lineType = type;
 
552
    END_SIMPLE_OC (LineType, resource_id, req_type, req);
 
553
}
 
554
 
 
555
 
 
556
void
 
557
PEXSetLineWidth (display, resource_id, req_type, width)
 
558
 
 
559
INPUT Display           *display;
 
560
INPUT XID               resource_id;
 
561
INPUT PEXOCRequestType  req_type;
 
562
INPUT double            width;
 
563
 
 
564
{
 
565
    register pexLineWidth       *req;
 
566
    int                         fpConvert;
 
567
    int                         fpFormat;
 
568
 
 
569
    BEGIN_SIMPLE_OC (LineWidth, resource_id, req_type, req);
 
570
    CHECK_FP (fpConvert, fpFormat);
 
571
 
 
572
    if (fpConvert)
 
573
    {
 
574
        FP_CONVERT_DHTON (width, req->width, fpFormat);
 
575
    }
 
576
    else
 
577
        req->width = width;
 
578
 
 
579
    END_SIMPLE_OC (LineWidth, resource_id, req_type, req);
 
580
}
 
581
 
 
582
 
 
583
void
 
584
PEXSetLineColorIndex (display, resource_id, req_type, index)
 
585
 
 
586
INPUT Display           *display;
 
587
INPUT XID               resource_id;
 
588
INPUT PEXOCRequestType  req_type;
 
589
INPUT unsigned int      index;
 
590
 
 
591
{
 
592
    register pexLineColorIndex  *req;
 
593
 
 
594
    BEGIN_SIMPLE_OC (LineColorIndex, resource_id, req_type, req);
 
595
    req->index = index;
 
596
    END_SIMPLE_OC (LineColorIndex, resource_id, req_type, req);
 
597
}
 
598
 
 
599
 
 
600
void
 
601
PEXSetLineColor (display, resource_id, req_type, colorType, color)
 
602
 
 
603
INPUT Display           *display;
 
604
INPUT XID               resource_id;
 
605
INPUT PEXOCRequestType  req_type;
 
606
INPUT int               colorType;
 
607
INPUT PEXColor          *color;
 
608
 
 
609
{
 
610
    register pexLineColor       *req;
 
611
    char                        *pBuf;
 
612
    int                         lenofColor;
 
613
    int                         fpConvert;
 
614
    int                         fpFormat;
 
615
 
 
616
    lenofColor = GetColorLength (colorType);
 
617
 
 
618
    PEXInitOC (display, resource_id, req_type,
 
619
        LENOF (pexLineColor), lenofColor, pBuf);
 
620
 
 
621
    if (pBuf == NULL) return;
 
622
 
 
623
    CHECK_FP (fpConvert, fpFormat);
 
624
 
 
625
    BEGIN_OC_HEADER (LineColor, lenofColor, pBuf, req);
 
626
 
 
627
    req->colorType = colorType;
 
628
 
 
629
    END_OC_HEADER (LineColor, pBuf, req);
 
630
 
 
631
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
632
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
633
 
 
634
    PEXFinishOC (display);
 
635
    PEXSyncHandle (display);
 
636
}
 
637
 
 
638
 
 
639
void
 
640
PEXSetCurveApprox (display, resource_id, req_type, approxMethod, tolerance)
 
641
 
 
642
INPUT Display           *display;
 
643
INPUT XID               resource_id;
 
644
INPUT PEXOCRequestType  req_type;
 
645
INPUT int               approxMethod;
 
646
INPUT double            tolerance;
 
647
 
 
648
{
 
649
    register pexCurveApprox     *req;
 
650
    int                         fpConvert;
 
651
    int                         fpFormat;
 
652
 
 
653
    BEGIN_SIMPLE_OC (CurveApprox, resource_id, req_type, req);
 
654
    CHECK_FP (fpConvert, fpFormat);
 
655
 
 
656
    req->approxMethod = approxMethod;
 
657
 
 
658
    if (fpConvert)
 
659
    {
 
660
        FP_CONVERT_DHTON (tolerance, req->tolerance, fpFormat);
 
661
    }
 
662
    else
 
663
        req->tolerance = tolerance;
 
664
 
 
665
    END_SIMPLE_OC (CurveApprox, resource_id, req_type, req);
 
666
}
 
667
 
 
668
 
 
669
void
 
670
PEXSetPolylineInterpMethod (display, resource_id, req_type, method)
 
671
 
 
672
INPUT Display           *display;
 
673
INPUT XID               resource_id;
 
674
INPUT PEXOCRequestType  req_type;
 
675
INPUT int               method;
 
676
 
 
677
{
 
678
    register pexPolylineInterpMethod    *req;
 
679
 
 
680
    BEGIN_SIMPLE_OC (PolylineInterpMethod, resource_id, req_type, req);
 
681
    req->polylineInterp = method;
 
682
    END_SIMPLE_OC (PolylineInterpMethod, resource_id, req_type, req);
 
683
}
 
684
 
 
685
 
 
686
void
 
687
PEXSetLineBundleIndex (display, resource_id, req_type, index)
 
688
 
 
689
INPUT Display           *display;
 
690
INPUT XID               resource_id;
 
691
INPUT PEXOCRequestType  req_type;
 
692
INPUT unsigned int      index;
 
693
 
 
694
{
 
695
    register pexLineBundleIndex *req;
 
696
 
 
697
    BEGIN_SIMPLE_OC (LineBundleIndex, resource_id, req_type, req);
 
698
    req->index = index;
 
699
    END_SIMPLE_OC (LineBundleIndex, resource_id, req_type, req);
 
700
}
 
701
 
 
702
 
 
703
void
 
704
PEXSetInteriorStyle (display, resource_id, req_type, style)
 
705
 
 
706
INPUT Display           *display;
 
707
INPUT XID               resource_id;
 
708
INPUT PEXOCRequestType  req_type;
 
709
INPUT int               style;
 
710
 
 
711
{
 
712
    register pexInteriorStyle   *req;
 
713
 
 
714
    BEGIN_SIMPLE_OC (InteriorStyle, resource_id, req_type, req);
 
715
    req->interiorStyle = style;
 
716
    END_SIMPLE_OC (InteriorStyle, resource_id, req_type, req);
 
717
}
 
718
 
 
719
 
 
720
void
 
721
PEXSetInteriorStyleIndex (display, resource_id, req_type, index)
 
722
 
 
723
INPUT Display           *display;
 
724
INPUT XID               resource_id;
 
725
INPUT PEXOCRequestType  req_type;
 
726
INPUT int               index;
 
727
 
 
728
{
 
729
    register pexInteriorStyleIndex      *req;
 
730
 
 
731
    BEGIN_SIMPLE_OC (InteriorStyleIndex, resource_id, req_type, req);
 
732
    req->index = index;
 
733
    END_SIMPLE_OC (InteriorStyleIndex, resource_id, req_type, req);
 
734
}
 
735
 
 
736
 
 
737
void
 
738
PEXSetSurfaceColorIndex (display, resource_id, req_type, index)
 
739
 
 
740
INPUT Display           *display;
 
741
INPUT XID               resource_id;
 
742
INPUT PEXOCRequestType  req_type;
 
743
INPUT unsigned int      index;
 
744
 
 
745
{
 
746
    register pexSurfaceColorIndex       *req;
 
747
 
 
748
    BEGIN_SIMPLE_OC (SurfaceColorIndex, resource_id, req_type, req);
 
749
    req->index = index;
 
750
    END_SIMPLE_OC (SurfaceColorIndex, resource_id, req_type, req);
 
751
}
 
752
 
 
753
 
 
754
void
 
755
PEXSetSurfaceColor (display, resource_id, req_type, colorType, color)
 
756
 
 
757
INPUT Display           *display;
 
758
INPUT XID               resource_id;
 
759
INPUT PEXOCRequestType  req_type;
 
760
INPUT int               colorType;
 
761
INPUT PEXColor          *color;
 
762
 
 
763
{
 
764
    register pexSurfaceColor    *req;
 
765
    char                        *pBuf;
 
766
    int                         lenofColor;
 
767
    int                         fpConvert;
 
768
    int                         fpFormat;
 
769
 
 
770
    lenofColor = GetColorLength (colorType);
 
771
 
 
772
    PEXInitOC (display, resource_id, req_type,
 
773
        LENOF (pexSurfaceColor), lenofColor, pBuf);
 
774
 
 
775
    if (pBuf == NULL) return;
 
776
 
 
777
    CHECK_FP (fpConvert, fpFormat);
 
778
 
 
779
    BEGIN_OC_HEADER (SurfaceColor, lenofColor, pBuf, req);
 
780
 
 
781
    req->colorType = colorType;
 
782
 
 
783
    END_OC_HEADER (SurfaceColor, pBuf, req);
 
784
 
 
785
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
786
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
787
 
 
788
    PEXFinishOC (display);
 
789
    PEXSyncHandle (display);
 
790
}
 
791
 
 
792
 
 
793
void
 
794
PEXSetReflectionAttributes (display, resource_id, req_type, reflectionAttr)
 
795
 
 
796
INPUT Display                   *display;
 
797
INPUT XID                       resource_id;
 
798
INPUT PEXOCRequestType          req_type;
 
799
INPUT PEXReflectionAttributes   *reflectionAttr;
 
800
 
 
801
{
 
802
    register pexReflectionAttributes    *req;
 
803
    char                                *pBuf;
 
804
    int                                 lenofColor;
 
805
    int                                 fpConvert;
 
806
    int                                 fpFormat;
 
807
 
 
808
    lenofColor = GetColorLength (reflectionAttr->specular_color.type);
 
809
 
 
810
    PEXInitOC (display, resource_id, req_type,
 
811
        LENOF (pexReflectionAttributes), lenofColor, pBuf);
 
812
 
 
813
    if (pBuf == NULL) return;
 
814
 
 
815
    CHECK_FP (fpConvert, fpFormat);
 
816
 
 
817
    BEGIN_OC_HEADER (ReflectionAttributes, lenofColor, pBuf, req);
 
818
 
 
819
    if (fpConvert)
 
820
    {
 
821
        FP_CONVERT_HTON (reflectionAttr->ambient, req->ambient, fpFormat);
 
822
        FP_CONVERT_HTON (reflectionAttr->diffuse, req->diffuse, fpFormat);
 
823
        FP_CONVERT_HTON (reflectionAttr->specular, req->specular, fpFormat);
 
824
        FP_CONVERT_HTON (reflectionAttr->specular_conc,
 
825
            req->specularConc, fpFormat);
 
826
        FP_CONVERT_HTON (reflectionAttr->transmission,
 
827
            req->transmission, fpFormat);
 
828
    }
 
829
    else
 
830
    {
 
831
        req->ambient = reflectionAttr->ambient;
 
832
        req->diffuse = reflectionAttr->diffuse;
 
833
        req->specular = reflectionAttr->specular;
 
834
        req->specularConc = reflectionAttr->specular_conc;
 
835
        req->transmission = reflectionAttr->transmission;
 
836
    }
 
837
 
 
838
    req->specular_colorType = reflectionAttr->specular_color.type;
 
839
 
 
840
    END_OC_HEADER (ReflectionAttributes, pBuf, req);
 
841
 
 
842
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
843
    STORE_COLOR_VAL (reflectionAttr->specular_color.type,
 
844
        reflectionAttr->specular_color.value, pBuf, fpConvert, fpFormat);
 
845
 
 
846
    PEXFinishOC (display);
 
847
    PEXSyncHandle (display);
 
848
}
 
849
 
 
850
 
 
851
void
 
852
PEXSetReflectionModel (display, resource_id, req_type, model)
 
853
 
 
854
INPUT Display           *display;
 
855
INPUT XID               resource_id;
 
856
INPUT PEXOCRequestType  req_type;
 
857
INPUT int               model;
 
858
 
 
859
{
 
860
    register pexReflectionModel *req;
 
861
 
 
862
    BEGIN_SIMPLE_OC (ReflectionModel, resource_id, req_type, req);
 
863
    req->reflectionModel = model;
 
864
    END_SIMPLE_OC (ReflectionModel, resource_id, req_type, req);
 
865
}
 
866
 
 
867
 
 
868
void
 
869
PEXSetSurfaceInterpMethod (display, resource_id, req_type, method)
 
870
 
 
871
INPUT Display           *display;
 
872
INPUT XID               resource_id;
 
873
INPUT PEXOCRequestType  req_type;
 
874
INPUT int               method;
 
875
 
 
876
{
 
877
    register pexSurfaceInterpMethod     *req;
 
878
 
 
879
    BEGIN_SIMPLE_OC (SurfaceInterpMethod, resource_id, req_type, req);
 
880
    req->surfaceInterp = method;
 
881
    END_SIMPLE_OC (SurfaceInterpMethod, resource_id, req_type, req);
 
882
}
 
883
 
 
884
 
 
885
void
 
886
PEXSetBFInteriorStyle (display, resource_id, req_type, style)
 
887
 
 
888
INPUT Display           *display;
 
889
INPUT XID               resource_id;
 
890
INPUT PEXOCRequestType  req_type;
 
891
INPUT int               style;
 
892
 
 
893
{
 
894
    register pexBFInteriorStyle *req;
 
895
 
 
896
    BEGIN_SIMPLE_OC (BFInteriorStyle, resource_id, req_type, req);
 
897
    req->interiorStyle = style;
 
898
    END_SIMPLE_OC (BFInteriorStyle, resource_id, req_type, req);
 
899
}
 
900
 
 
901
 
 
902
void
 
903
PEXSetBFInteriorStyleIndex (display, resource_id, req_type, index)
 
904
 
 
905
INPUT Display           *display;
 
906
INPUT XID               resource_id;
 
907
INPUT PEXOCRequestType  req_type;
 
908
INPUT int               index;
 
909
 
 
910
{
 
911
    register pexBFInteriorStyleIndex    *req;
 
912
 
 
913
    BEGIN_SIMPLE_OC (BFInteriorStyleIndex, resource_id, req_type, req);
 
914
    req->index = index;
 
915
    END_SIMPLE_OC (BFInteriorStyleIndex, resource_id, req_type, req);
 
916
}
 
917
 
 
918
 
 
919
void
 
920
PEXSetBFSurfaceColorIndex (display, resource_id, req_type, index)
 
921
 
 
922
INPUT Display           *display;
 
923
INPUT XID               resource_id;
 
924
INPUT PEXOCRequestType  req_type;
 
925
INPUT unsigned int      index;
 
926
 
 
927
{
 
928
    register pexBFSurfaceColorIndex     *req;
 
929
 
 
930
    BEGIN_SIMPLE_OC (BFSurfaceColorIndex, resource_id, req_type, req);
 
931
    req->index = index;
 
932
    END_SIMPLE_OC (BFSurfaceColorIndex, resource_id, req_type, req);
 
933
}
 
934
 
 
935
 
 
936
void
 
937
PEXSetBFSurfaceColor (display, resource_id, req_type, colorType, color)
 
938
 
 
939
INPUT Display           *display;
 
940
INPUT XID               resource_id;
 
941
INPUT PEXOCRequestType  req_type;
 
942
INPUT int               colorType;
 
943
INPUT PEXColor          *color;
 
944
 
 
945
{
 
946
    register pexBFSurfaceColor  *req;
 
947
    char                        *pBuf;
 
948
    int                         lenofColor;
 
949
    int                         fpConvert;
 
950
    int                         fpFormat;
 
951
 
 
952
    lenofColor = GetColorLength (colorType);
 
953
 
 
954
    PEXInitOC (display, resource_id, req_type,
 
955
        LENOF (pexBFSurfaceColor), lenofColor, pBuf);
 
956
 
 
957
    if (pBuf == NULL) return;
 
958
 
 
959
    CHECK_FP (fpConvert, fpFormat);
 
960
 
 
961
    BEGIN_OC_HEADER (BFSurfaceColor, lenofColor, pBuf, req);
 
962
 
 
963
    req->colorType = colorType;
 
964
 
 
965
    END_OC_HEADER (BFSurfaceColor, pBuf, req);
 
966
 
 
967
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
968
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
969
 
 
970
    PEXFinishOC (display);
 
971
    PEXSyncHandle (display);
 
972
}
 
973
 
 
974
 
 
975
void
 
976
PEXSetBFReflectionAttributes (display, resource_id, req_type, reflectionAttr)
 
977
 
 
978
INPUT Display                   *display;
 
979
INPUT XID                       resource_id;
 
980
INPUT PEXOCRequestType          req_type;
 
981
INPUT PEXReflectionAttributes   *reflectionAttr;
 
982
 
 
983
{
 
984
    register pexBFReflectionAttributes  *req;
 
985
    char                                *pBuf;
 
986
    int                                 lenofColor;
 
987
    int                                 fpConvert;
 
988
    int                                 fpFormat;
 
989
 
 
990
    lenofColor = GetColorLength (reflectionAttr->specular_color.type);
 
991
 
 
992
    PEXInitOC (display, resource_id, req_type,
 
993
        LENOF (pexBFReflectionAttributes), lenofColor, pBuf);
 
994
 
 
995
    if (pBuf == NULL) return;
 
996
 
 
997
    CHECK_FP (fpConvert, fpFormat);
 
998
 
 
999
    BEGIN_OC_HEADER (BFReflectionAttributes, lenofColor, pBuf, req);
 
1000
 
 
1001
    if (fpConvert)
 
1002
    {
 
1003
        FP_CONVERT_HTON (reflectionAttr->ambient, req->ambient, fpFormat);
 
1004
        FP_CONVERT_HTON (reflectionAttr->diffuse, req->diffuse, fpFormat);
 
1005
        FP_CONVERT_HTON (reflectionAttr->specular, req->specular, fpFormat);
 
1006
        FP_CONVERT_HTON (reflectionAttr->specular_conc,
 
1007
            req->specularConc, fpFormat);
 
1008
        FP_CONVERT_HTON (reflectionAttr->transmission,
 
1009
            req->transmission, fpFormat);
 
1010
    }
 
1011
    else
 
1012
    {
 
1013
        req->ambient = reflectionAttr->ambient;
 
1014
        req->diffuse = reflectionAttr->diffuse;
 
1015
        req->specular = reflectionAttr->specular;
 
1016
        req->specularConc = reflectionAttr->specular_conc;
 
1017
        req->transmission = reflectionAttr->transmission;
 
1018
    }
 
1019
 
 
1020
    req->specular_colorType = reflectionAttr->specular_color.type;
 
1021
 
 
1022
    END_OC_HEADER (BFReflectionAttributes, pBuf, req);
 
1023
 
 
1024
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
1025
    STORE_COLOR_VAL (reflectionAttr->specular_color.type,
 
1026
        reflectionAttr->specular_color.value, pBuf, fpConvert, fpFormat);
 
1027
 
 
1028
    PEXFinishOC (display);
 
1029
    PEXSyncHandle (display);
 
1030
}
 
1031
 
 
1032
 
 
1033
void
 
1034
PEXSetBFReflectionModel (display, resource_id, req_type, model)
 
1035
 
 
1036
INPUT Display           *display;
 
1037
INPUT XID               resource_id;
 
1038
INPUT PEXOCRequestType  req_type;
 
1039
INPUT int               model;
 
1040
 
 
1041
{
 
1042
    register pexBFReflectionModel       *req;
 
1043
 
 
1044
    BEGIN_SIMPLE_OC (BFReflectionModel, resource_id, req_type, req);
 
1045
    req->reflectionModel = model;
 
1046
    END_SIMPLE_OC (BFReflectionModel, resource_id, req_type, req);
 
1047
}
 
1048
 
 
1049
 
 
1050
void
 
1051
PEXSetBFSurfaceInterpMethod (display, resource_id, req_type, method)
 
1052
 
 
1053
INPUT Display           *display;
 
1054
INPUT XID               resource_id;
 
1055
INPUT PEXOCRequestType  req_type;
 
1056
INPUT int               method;
 
1057
 
 
1058
{
 
1059
    register pexBFSurfaceInterpMethod   *req;
 
1060
 
 
1061
    BEGIN_SIMPLE_OC (BFSurfaceInterpMethod, resource_id, req_type, req);
 
1062
    req->surfaceInterp = method;
 
1063
    END_SIMPLE_OC (BFSurfaceInterpMethod, resource_id, req_type, req);
 
1064
}
 
1065
 
 
1066
 
 
1067
void
 
1068
PEXSetSurfaceApprox (display, resource_id, req_type,
 
1069
    approxMethod, uTolerance, vTolerance)
 
1070
 
 
1071
INPUT Display           *display;
 
1072
INPUT XID               resource_id;
 
1073
INPUT PEXOCRequestType  req_type;
 
1074
INPUT int               approxMethod;
 
1075
INPUT double            uTolerance;
 
1076
INPUT double            vTolerance;
 
1077
 
 
1078
{
 
1079
    register pexSurfaceApprox   *req;
 
1080
    int                         fpConvert;
 
1081
    int                         fpFormat;
 
1082
 
 
1083
    BEGIN_SIMPLE_OC (SurfaceApprox, resource_id, req_type, req);
 
1084
    CHECK_FP (fpConvert, fpFormat);
 
1085
 
 
1086
    req->approxMethod = approxMethod;
 
1087
 
 
1088
    if (fpConvert)
 
1089
    {
 
1090
        FP_CONVERT_DHTON (uTolerance, req->uTolerance, fpFormat);
 
1091
        FP_CONVERT_DHTON (vTolerance, req->vTolerance, fpFormat);
 
1092
    }
 
1093
    else
 
1094
    {
 
1095
        req->uTolerance = uTolerance;
 
1096
        req->vTolerance = vTolerance;
 
1097
    }
 
1098
 
 
1099
    END_SIMPLE_OC (SurfaceApprox, resource_id, req_type, req);
 
1100
}
 
1101
 
 
1102
 
 
1103
void
 
1104
PEXSetFacetCullingMode (display, resource_id, req_type, mode)
 
1105
 
 
1106
INPUT Display           *display;
 
1107
INPUT XID               resource_id;
 
1108
INPUT PEXOCRequestType  req_type;
 
1109
INPUT int               mode;
 
1110
 
 
1111
{
 
1112
    register pexFacetCullingMode        *req;
 
1113
 
 
1114
    BEGIN_SIMPLE_OC (FacetCullingMode, resource_id, req_type, req);
 
1115
    req->cullMode = mode;
 
1116
    END_SIMPLE_OC (FacetCullingMode, resource_id, req_type, req);
 
1117
}
 
1118
 
 
1119
 
 
1120
void
 
1121
PEXSetFacetDistinguishFlag (display, resource_id, req_type, flag)
 
1122
 
 
1123
INPUT Display           *display;
 
1124
INPUT XID               resource_id;
 
1125
INPUT PEXOCRequestType  req_type;
 
1126
INPUT int               flag;
 
1127
 
 
1128
{
 
1129
    register pexFacetDistinguishFlag    *req;
 
1130
 
 
1131
    BEGIN_SIMPLE_OC (FacetDistinguishFlag, resource_id, req_type, req);
 
1132
    req->distinguish = flag;
 
1133
    END_SIMPLE_OC (FacetDistinguishFlag, resource_id, req_type, req);
 
1134
}
 
1135
 
 
1136
 
 
1137
void
 
1138
PEXSetPatternSize (display, resource_id, req_type, width, height)
 
1139
 
 
1140
INPUT Display           *display;
 
1141
INPUT XID               resource_id;
 
1142
INPUT PEXOCRequestType  req_type;
 
1143
INPUT double            width;
 
1144
INPUT double            height;
 
1145
 
 
1146
{
 
1147
    register pexPatternSize     *req;
 
1148
    int                         fpConvert;
 
1149
    int                         fpFormat;
 
1150
 
 
1151
    BEGIN_SIMPLE_OC (PatternSize, resource_id, req_type, req);
 
1152
    CHECK_FP (fpConvert, fpFormat);
 
1153
 
 
1154
    if (fpConvert)
 
1155
    {
 
1156
        FP_CONVERT_DHTON (width, req->size_x, fpFormat);
 
1157
        FP_CONVERT_DHTON (height, req->size_y, fpFormat);
 
1158
    }
 
1159
    else
 
1160
    {
 
1161
        req->size_x = width;
 
1162
        req->size_y = height;
 
1163
    }
 
1164
 
 
1165
    END_SIMPLE_OC (PatternSize, resource_id, req_type, req);
 
1166
}
 
1167
 
 
1168
 
 
1169
void
 
1170
PEXSetPatternAttributes2D (display, resource_id, req_type, ref_point)
 
1171
 
 
1172
INPUT Display           *display;
 
1173
INPUT XID               resource_id;
 
1174
INPUT PEXOCRequestType  req_type;
 
1175
INPUT PEXCoord2D        *ref_point;
 
1176
 
 
1177
{
 
1178
    register pexPatternAttributes2D     *req;
 
1179
    int                                 fpConvert;
 
1180
    int                                 fpFormat;
 
1181
 
 
1182
    BEGIN_SIMPLE_OC (PatternAttributes2D, resource_id, req_type, req);
 
1183
    CHECK_FP (fpConvert, fpFormat);
 
1184
 
 
1185
    if (fpConvert)
 
1186
    {
 
1187
        FP_CONVERT_HTON (ref_point->x, req->point_x, fpFormat);
 
1188
        FP_CONVERT_HTON (ref_point->y, req->point_y, fpFormat);
 
1189
    }
 
1190
    else
 
1191
    {
 
1192
        req->point_x = ref_point->x;
 
1193
        req->point_y = ref_point->y;
 
1194
    }
 
1195
 
 
1196
    END_SIMPLE_OC (PatternAttributes2D, resource_id, req_type, req);
 
1197
}
 
1198
 
 
1199
 
 
1200
void
 
1201
PEXSetPatternAttributes (display, resource_id, req_type, refPt, vec1, vec2)
 
1202
 
 
1203
INPUT Display           *display;
 
1204
INPUT XID               resource_id;
 
1205
INPUT PEXOCRequestType  req_type;
 
1206
INPUT PEXCoord          *refPt;
 
1207
INPUT PEXVector         *vec1;
 
1208
INPUT PEXVector         *vec2;
 
1209
 
 
1210
{
 
1211
    register pexPatternAttributes       *req;
 
1212
    int                                 fpConvert;
 
1213
    int                                 fpFormat;
 
1214
 
 
1215
    BEGIN_SIMPLE_OC (PatternAttributes, resource_id, req_type, req);
 
1216
    CHECK_FP (fpConvert, fpFormat);
 
1217
 
 
1218
    if (fpConvert)
 
1219
    {
 
1220
        FP_CONVERT_HTON (refPt->x, req->refPt_x, fpFormat);
 
1221
        FP_CONVERT_HTON (refPt->y, req->refPt_y, fpFormat);
 
1222
        FP_CONVERT_HTON (refPt->z, req->refPt_z, fpFormat);
 
1223
        FP_CONVERT_HTON (vec1->x, req->vector1_x, fpFormat);
 
1224
        FP_CONVERT_HTON (vec1->y, req->vector1_y, fpFormat);
 
1225
        FP_CONVERT_HTON (vec1->z, req->vector1_z, fpFormat);
 
1226
        FP_CONVERT_HTON (vec2->x, req->vector2_x, fpFormat);
 
1227
        FP_CONVERT_HTON (vec2->y, req->vector2_y, fpFormat);
 
1228
        FP_CONVERT_HTON (vec2->z, req->vector2_z, fpFormat);
 
1229
    }
 
1230
    else
 
1231
    {
 
1232
        req->refPt_x = refPt->x;
 
1233
        req->refPt_y = refPt->y;
 
1234
        req->refPt_z = refPt->z;
 
1235
        req->vector1_x = vec1->x;
 
1236
        req->vector1_y = vec1->y;
 
1237
        req->vector1_z = vec1->z;
 
1238
        req->vector2_x = vec2->x;
 
1239
        req->vector2_y = vec2->y;
 
1240
        req->vector2_z = vec2->z;
 
1241
    }
 
1242
 
 
1243
    END_SIMPLE_OC (PatternAttributes, resource_id, req_type, req);
 
1244
}
 
1245
 
 
1246
 
 
1247
void
 
1248
PEXSetInteriorBundleIndex (display, resource_id, req_type, index)
 
1249
 
 
1250
INPUT Display           *display;
 
1251
INPUT XID               resource_id;
 
1252
INPUT PEXOCRequestType  req_type;
 
1253
INPUT unsigned int      index;
 
1254
 
 
1255
{
 
1256
    register pexInteriorBundleIndex     *req;
 
1257
 
 
1258
    BEGIN_SIMPLE_OC (InteriorBundleIndex, resource_id, req_type, req);
 
1259
    req->index = index;
 
1260
    END_SIMPLE_OC (InteriorBundleIndex, resource_id, req_type, req);
 
1261
}
 
1262
 
 
1263
 
 
1264
void
 
1265
PEXSetSurfaceEdgeFlag (display, resource_id, req_type, flag)
 
1266
 
 
1267
INPUT Display           *display;
 
1268
INPUT XID               resource_id;
 
1269
INPUT PEXOCRequestType  req_type;
 
1270
INPUT int               flag;
 
1271
 
 
1272
{
 
1273
    register pexSurfaceEdgeFlag *req;
 
1274
 
 
1275
    BEGIN_SIMPLE_OC (SurfaceEdgeFlag, resource_id, req_type, req);
 
1276
    req->onoff = flag;
 
1277
    END_SIMPLE_OC (SurfaceEdgeFlag, resource_id, req_type, req);
 
1278
}
 
1279
 
 
1280
 
 
1281
void
 
1282
PEXSetSurfaceEdgeType (display, resource_id, req_type, type)
 
1283
 
 
1284
INPUT Display           *display;
 
1285
INPUT XID               resource_id;
 
1286
INPUT PEXOCRequestType  req_type;
 
1287
INPUT int               type;
 
1288
 
 
1289
{
 
1290
    register pexSurfaceEdgeType *req;
 
1291
 
 
1292
    BEGIN_SIMPLE_OC (SurfaceEdgeType, resource_id, req_type, req);
 
1293
    req->edgeType = type;
 
1294
    END_SIMPLE_OC (SurfaceEdgeType, resource_id, req_type, req);
 
1295
}
 
1296
 
 
1297
 
 
1298
void
 
1299
PEXSetSurfaceEdgeWidth (display, resource_id, req_type, width)
 
1300
 
 
1301
INPUT Display           *display;
 
1302
INPUT XID               resource_id;
 
1303
INPUT PEXOCRequestType  req_type;
 
1304
INPUT double            width;
 
1305
 
 
1306
{
 
1307
    register pexSurfaceEdgeWidth        *req;
 
1308
    int                                 fpConvert;
 
1309
    int                                 fpFormat;
 
1310
 
 
1311
    BEGIN_SIMPLE_OC (SurfaceEdgeWidth, resource_id, req_type, req);
 
1312
    CHECK_FP (fpConvert, fpFormat);
 
1313
 
 
1314
    if (fpConvert)
 
1315
    {
 
1316
        FP_CONVERT_DHTON (width, req->width, fpFormat);
 
1317
    }
 
1318
    else
 
1319
        req->width = width;
 
1320
 
 
1321
    END_SIMPLE_OC (SurfaceEdgeWidth, resource_id, req_type, req);
 
1322
}
 
1323
 
 
1324
 
 
1325
void
 
1326
PEXSetSurfaceEdgeColorIndex (display, resource_id, req_type, index)
 
1327
 
 
1328
INPUT Display           *display;
 
1329
INPUT XID               resource_id;
 
1330
INPUT PEXOCRequestType  req_type;
 
1331
INPUT unsigned int      index;
 
1332
 
 
1333
{
 
1334
    register pexSurfaceEdgeColorIndex   *req;
 
1335
 
 
1336
    BEGIN_SIMPLE_OC (SurfaceEdgeColorIndex, resource_id, req_type, req);
 
1337
    req->index = index;
 
1338
    END_SIMPLE_OC (SurfaceEdgeColorIndex, resource_id, req_type, req);
 
1339
}
 
1340
 
 
1341
 
 
1342
void
 
1343
PEXSetSurfaceEdgeColor (display, resource_id, req_type, colorType, color)
 
1344
 
 
1345
INPUT Display           *display;
 
1346
INPUT XID               resource_id;
 
1347
INPUT PEXOCRequestType  req_type;
 
1348
INPUT int               colorType;
 
1349
INPUT PEXColor          *color;
 
1350
 
 
1351
{
 
1352
    register pexSurfaceEdgeColor        *req;
 
1353
    char                                *pBuf;
 
1354
    int                                 lenofColor;
 
1355
    int                                 fpConvert;
 
1356
    int                                 fpFormat;
 
1357
 
 
1358
    lenofColor = GetColorLength (colorType);
 
1359
 
 
1360
    PEXInitOC (display, resource_id, req_type,
 
1361
        LENOF (pexSurfaceEdgeColor), lenofColor, pBuf);
 
1362
 
 
1363
    if (pBuf == NULL) return;
 
1364
 
 
1365
    CHECK_FP (fpConvert, fpFormat);
 
1366
 
 
1367
    BEGIN_OC_HEADER (SurfaceEdgeColor, lenofColor, pBuf, req);
 
1368
 
 
1369
    req->colorType = colorType;
 
1370
 
 
1371
    END_OC_HEADER (SurfaceEdgeColor, pBuf, req);
 
1372
 
 
1373
    pBuf = PEXGetOCAddr (display, NUMBYTES (lenofColor));
 
1374
    STORE_COLOR_VAL (colorType, (*color), pBuf, fpConvert, fpFormat);
 
1375
 
 
1376
    PEXFinishOC (display);
 
1377
    PEXSyncHandle (display);
 
1378
}
 
1379
 
 
1380
 
 
1381
void
 
1382
PEXSetEdgeBundleIndex (display, resource_id, req_type, index)
 
1383
 
 
1384
INPUT Display           *display;
 
1385
INPUT XID               resource_id;
 
1386
INPUT PEXOCRequestType  req_type;
 
1387
INPUT unsigned int      index;
 
1388
 
 
1389
{
 
1390
    register pexEdgeBundleIndex *req;
 
1391
 
 
1392
    BEGIN_SIMPLE_OC (EdgeBundleIndex, resource_id, req_type, req);
 
1393
    req->index = index;
 
1394
    END_SIMPLE_OC (EdgeBundleIndex, resource_id, req_type, req);
 
1395
}
 
1396
 
 
1397
 
 
1398
void
 
1399
PEXSetIndividualASF (display, resource_id, req_type, attribute, value)
 
1400
 
 
1401
INPUT Display           *display;
 
1402
INPUT XID               resource_id;
 
1403
INPUT PEXOCRequestType  req_type;
 
1404
INPUT unsigned long     attribute;
 
1405
INPUT int               value;
 
1406
 
 
1407
{
 
1408
    register pexIndividualASF   *req;
 
1409
 
 
1410
    BEGIN_SIMPLE_OC (IndividualASF, resource_id, req_type, req);
 
1411
    req->attribute = attribute;
 
1412
    req->source = value;
 
1413
    END_SIMPLE_OC (IndividualASF, resource_id, req_type, req);
 
1414
}
 
1415
 
 
1416
 
 
1417
void
 
1418
PEXSetLocalTransform (display, resource_id, req_type, compType, transform)
 
1419
 
 
1420
INPUT Display           *display;
 
1421
INPUT XID               resource_id;
 
1422
INPUT PEXOCRequestType  req_type;
 
1423
INPUT int               compType;
 
1424
INPUT PEXMatrix         transform;
 
1425
 
 
1426
{
 
1427
    register pexLocalTransform  *req;
 
1428
    char                        *ptr;
 
1429
    int                         fpConvert;
 
1430
    int                         fpFormat;
 
1431
 
 
1432
    BEGIN_SIMPLE_OC (LocalTransform, resource_id, req_type, req);
 
1433
    CHECK_FP (fpConvert, fpFormat);
 
1434
 
 
1435
    req->compType = compType;
 
1436
 
 
1437
    ptr = (char *) req->matrix;
 
1438
    STORE_LISTOF_FLOAT32 (16, transform, ptr, fpConvert, fpFormat);
 
1439
 
 
1440
    END_SIMPLE_OC (LocalTransform, resource_id, req_type, req);
 
1441
}
 
1442
 
 
1443
 
 
1444
void
 
1445
PEXSetLocalTransform2D (display, resource_id, req_type, compType, transform)
 
1446
 
 
1447
INPUT Display           *display;
 
1448
INPUT XID               resource_id;
 
1449
INPUT PEXOCRequestType  req_type;
 
1450
INPUT int               compType;
 
1451
INPUT PEXMatrix3x3      transform;
 
1452
 
 
1453
{
 
1454
    register pexLocalTransform2D        *req;
 
1455
    char                                *ptr;
 
1456
    int                                 fpConvert;
 
1457
    int                                 fpFormat;
 
1458
 
 
1459
    BEGIN_SIMPLE_OC (LocalTransform2D, resource_id, req_type, req);
 
1460
    CHECK_FP (fpConvert, fpFormat);
 
1461
 
 
1462
    req->compType = compType;
 
1463
 
 
1464
    ptr = (char *) req->matrix3X3;
 
1465
    STORE_LISTOF_FLOAT32 (9, transform, ptr, fpConvert, fpFormat);
 
1466
 
 
1467
    END_SIMPLE_OC (LocalTransform2D, resource_id, req_type, req);
 
1468
}
 
1469
 
 
1470
 
 
1471
void
 
1472
PEXSetGlobalTransform (display, resource_id, req_type, transform)
 
1473
 
 
1474
INPUT Display           *display;
 
1475
INPUT XID               resource_id;
 
1476
INPUT PEXOCRequestType  req_type;
 
1477
INPUT PEXMatrix         transform;
 
1478
 
 
1479
{
 
1480
    register pexGlobalTransform *req;
 
1481
    char                        *ptr;
 
1482
    int                         fpConvert;
 
1483
    int                         fpFormat;
 
1484
 
 
1485
    BEGIN_SIMPLE_OC (GlobalTransform, resource_id, req_type, req);
 
1486
    CHECK_FP (fpConvert, fpFormat);
 
1487
 
 
1488
    ptr = (char *) req->matrix;
 
1489
    STORE_LISTOF_FLOAT32 (16, transform, ptr, fpConvert, fpFormat);
 
1490
 
 
1491
    END_SIMPLE_OC (GlobalTransform, resource_id, req_type, req);
 
1492
}
 
1493
 
 
1494
 
 
1495
void
 
1496
PEXSetGlobalTransform2D (display, resource_id, req_type, transform)
 
1497
 
 
1498
INPUT Display           *display;
 
1499
INPUT XID               resource_id;
 
1500
INPUT PEXOCRequestType  req_type;
 
1501
INPUT PEXMatrix3x3      transform;
 
1502
 
 
1503
{
 
1504
    register pexGlobalTransform2D       *req;
 
1505
    char                                *ptr;
 
1506
    int                                 fpConvert;
 
1507
    int                                 fpFormat;
 
1508
 
 
1509
    BEGIN_SIMPLE_OC (GlobalTransform2D, resource_id, req_type, req);
 
1510
    CHECK_FP (fpConvert, fpFormat);
 
1511
 
 
1512
    ptr = (char *) req->matrix3X3;
 
1513
    STORE_LISTOF_FLOAT32 (9, transform, ptr, fpConvert, fpFormat);
 
1514
 
 
1515
    END_SIMPLE_OC (GlobalTransform2D, resource_id, req_type, req);
 
1516
}
 
1517
 
 
1518
 
 
1519
void
 
1520
PEXSetModelClipFlag (display, resource_id, req_type, flag)
 
1521
 
 
1522
INPUT Display           *display;
 
1523
INPUT XID               resource_id;
 
1524
INPUT PEXOCRequestType  req_type;
 
1525
INPUT int               flag;
 
1526
 
 
1527
{
 
1528
    register pexModelClipFlag   *req;
 
1529
 
 
1530
    BEGIN_SIMPLE_OC (ModelClipFlag, resource_id, req_type, req);
 
1531
    req->onoff = flag;
 
1532
    END_SIMPLE_OC (ModelClipFlag, resource_id, req_type, req);
 
1533
}
 
1534
 
 
1535
 
 
1536
void
 
1537
PEXSetModelClipVolume (display, resource_id, req_type, op,
 
1538
    numHalfSpaces, halfSpaces)
 
1539
 
 
1540
INPUT Display           *display;
 
1541
INPUT XID               resource_id;
 
1542
INPUT PEXOCRequestType  req_type;
 
1543
INPUT int               op;
 
1544
INPUT unsigned int      numHalfSpaces;
 
1545
INPUT PEXHalfSpace      *halfSpaces;
 
1546
 
 
1547
{
 
1548
    register pexModelClipVolume *req;
 
1549
    char                        *pBuf;
 
1550
    int                         dataLength;
 
1551
    int                         fpConvert;
 
1552
    int                         fpFormat;
 
1553
 
 
1554
    /*
 
1555
     * Initialize the OC request.
 
1556
     */
 
1557
 
 
1558
    dataLength = NUMWORDS (numHalfSpaces * SIZEOF (pexHalfSpace));
 
1559
 
 
1560
    PEXInitOC (display, resource_id, req_type,
 
1561
        LENOF (pexModelClipVolume), dataLength, pBuf);
 
1562
 
 
1563
    if (pBuf == NULL) return;
 
1564
 
 
1565
 
 
1566
    /* 
 
1567
     * Store the request header data. 
 
1568
     */
 
1569
 
 
1570
    CHECK_FP (fpConvert, fpFormat);
 
1571
 
 
1572
    BEGIN_OC_HEADER (ModelClipVolume, dataLength, pBuf, req);
 
1573
 
 
1574
    req->modelClipOperator = op; 
 
1575
    req->numHalfSpaces = numHalfSpaces;
 
1576
 
 
1577
    END_OC_HEADER (ModelClipVolume, pBuf, req);
 
1578
 
 
1579
 
 
1580
    /*
 
1581
     * Copy the oc data.
 
1582
     */
 
1583
 
 
1584
    OC_LISTOF_HALFSPACE3D (numHalfSpaces, halfSpaces, fpConvert, fpFormat);
 
1585
 
 
1586
    PEXFinishOC (display);
 
1587
    PEXSyncHandle (display);
 
1588
}
 
1589
 
 
1590
 
 
1591
void
 
1592
PEXSetModelClipVolume2D (display, resource_id, req_type, op,
 
1593
    numHalfSpaces, halfSpaces)
 
1594
 
 
1595
INPUT Display           *display;
 
1596
INPUT XID               resource_id;
 
1597
INPUT PEXOCRequestType  req_type;
 
1598
INPUT int               op;
 
1599
INPUT unsigned int      numHalfSpaces;
 
1600
INPUT PEXHalfSpace2D    *halfSpaces;
 
1601
 
 
1602
{
 
1603
    register pexModelClipVolume2D       *req;
 
1604
    char                                *pBuf;
 
1605
    int                                 dataLength;
 
1606
    int                                 fpConvert;
 
1607
    int                                 fpFormat;
 
1608
 
 
1609
    /*
 
1610
     * Initialize the OC request.
 
1611
     */
 
1612
 
 
1613
    dataLength = NUMWORDS (numHalfSpaces * SIZEOF (pexHalfSpace2D));
 
1614
 
 
1615
    PEXInitOC (display, resource_id, req_type,
 
1616
        LENOF (pexModelClipVolume2D), dataLength, pBuf);
 
1617
 
 
1618
    if (pBuf == NULL) return;
 
1619
 
 
1620
 
 
1621
    /* 
 
1622
     * Store the request header data. 
 
1623
     */
 
1624
 
 
1625
    CHECK_FP (fpConvert, fpFormat);
 
1626
 
 
1627
    BEGIN_OC_HEADER (ModelClipVolume2D, dataLength, pBuf, req);
 
1628
 
 
1629
    req->modelClipOperator = op; 
 
1630
    req->numHalfSpaces = numHalfSpaces;
 
1631
 
 
1632
    END_OC_HEADER (ModelClipVolume2D, pBuf, req);
 
1633
 
 
1634
 
 
1635
    /*
 
1636
     * Copy the oc data.
 
1637
     */
 
1638
 
 
1639
    OC_LISTOF_HALFSPACE2D (numHalfSpaces, halfSpaces, fpConvert, fpFormat);
 
1640
 
 
1641
    PEXFinishOC (display);
 
1642
    PEXSyncHandle (display);
 
1643
}
 
1644
 
 
1645
 
 
1646
void
 
1647
PEXRestoreModelClipVolume (display, resource_id, req_type)
 
1648
 
 
1649
INPUT Display           *display;
 
1650
INPUT XID               resource_id;
 
1651
INPUT PEXOCRequestType  req_type;
 
1652
 
 
1653
{
 
1654
    register pexRestoreModelClipVolume  *req;
 
1655
 
 
1656
    BEGIN_SIMPLE_OC (RestoreModelClipVolume, resource_id, req_type, req);
 
1657
    /* no data */
 
1658
    END_SIMPLE_OC (RestoreModelClipVolume, resource_id, req_type, req);
 
1659
}
 
1660
 
 
1661
 
 
1662
void
 
1663
PEXSetViewIndex (display, resource_id, req_type, index)
 
1664
 
 
1665
INPUT Display           *display;
 
1666
INPUT XID               resource_id;
 
1667
INPUT PEXOCRequestType  req_type;
 
1668
INPUT unsigned int      index;
 
1669
 
 
1670
{
 
1671
    register pexViewIndex       *req;
 
1672
 
 
1673
    BEGIN_SIMPLE_OC (ViewIndex, resource_id, req_type, req);
 
1674
    req->index = index;
 
1675
    END_SIMPLE_OC (ViewIndex, resource_id, req_type, req);
 
1676
}
 
1677
 
 
1678
 
 
1679
void
 
1680
PEXSetLightSourceState (display, resource_id, req_type,
 
1681
    numEnable, enable, numDisable, disable)
 
1682
 
 
1683
INPUT Display           *display;
 
1684
INPUT XID               resource_id;
 
1685
INPUT PEXOCRequestType  req_type;
 
1686
INPUT unsigned int      numEnable;
 
1687
INPUT PEXTableIndex     *enable;
 
1688
INPUT unsigned int      numDisable;
 
1689
INPUT PEXTableIndex     *disable;
 
1690
 
 
1691
{
 
1692
    register pexLightSourceState        *req;
 
1693
    char                                *pBuf;
 
1694
    int                                 dataLength;
 
1695
 
 
1696
    /*
 
1697
     * Initialize the OC request.
 
1698
     */
 
1699
 
 
1700
    dataLength = NUMWORDS (numEnable * SIZEOF (CARD16)) +
 
1701
        NUMWORDS (numDisable * SIZEOF (CARD16));
 
1702
 
 
1703
    PEXInitOC (display, resource_id, req_type,
 
1704
        LENOF (pexLightSourceState), dataLength, pBuf);
 
1705
 
 
1706
    if (pBuf == NULL) return;
 
1707
 
 
1708
 
 
1709
    /* 
 
1710
     * Store the request header data. 
 
1711
     */
 
1712
 
 
1713
    BEGIN_OC_HEADER (LightSourceState, dataLength, pBuf, req);
 
1714
 
 
1715
    req->numEnable = numEnable;
 
1716
    req->numDisable = numDisable;
 
1717
 
 
1718
    END_OC_HEADER (LightSourceState, pBuf, req);
 
1719
 
 
1720
 
 
1721
    /*
 
1722
     * Copy the oc data.
 
1723
     */
 
1724
 
 
1725
    OC_LISTOF_CARD16_PAD (numEnable, enable);
 
1726
    OC_LISTOF_CARD16_PAD (numDisable, disable);
 
1727
 
 
1728
 
 
1729
    PEXFinishOC (display);
 
1730
    PEXSyncHandle (display);
 
1731
}
 
1732
 
 
1733
 
 
1734
void
 
1735
PEXSetDepthCueIndex (display, resource_id, req_type, index)
 
1736
 
 
1737
INPUT Display           *display;
 
1738
INPUT XID               resource_id;
 
1739
INPUT PEXOCRequestType  req_type;
 
1740
INPUT unsigned int      index;
 
1741
 
 
1742
{
 
1743
    register pexDepthCueIndex   *req;
 
1744
 
 
1745
    BEGIN_SIMPLE_OC (DepthCueIndex, resource_id, req_type, req);
 
1746
    req->index = index;
 
1747
    END_SIMPLE_OC (DepthCueIndex, resource_id, req_type, req);
 
1748
}
 
1749
 
 
1750
 
 
1751
void
 
1752
PEXSetPickID (display, resource_id, req_type, id)
 
1753
 
 
1754
INPUT Display           *display;
 
1755
INPUT XID               resource_id;
 
1756
INPUT PEXOCRequestType  req_type;
 
1757
INPUT unsigned long     id;
 
1758
 
 
1759
{
 
1760
    register pexPickID  *req;
 
1761
 
 
1762
    BEGIN_SIMPLE_OC (PickID, resource_id, req_type, req);
 
1763
    req->pickId = id;
 
1764
    END_SIMPLE_OC (PickID, resource_id, req_type, req);
 
1765
}
 
1766
 
 
1767
 
 
1768
void
 
1769
PEXSetHLHSRID (display, resource_id, req_type, id)
 
1770
 
 
1771
INPUT Display           *display;
 
1772
INPUT XID               resource_id;
 
1773
INPUT PEXOCRequestType  req_type;
 
1774
INPUT unsigned long     id;
 
1775
 
 
1776
{
 
1777
    register pexHLHSRID *req;
 
1778
 
 
1779
    BEGIN_SIMPLE_OC (HLHSRID, resource_id, req_type, req);
 
1780
    req->hlhsrID = id;
 
1781
    END_SIMPLE_OC (HLHSRID, resource_id, req_type, req);
 
1782
}
 
1783
 
 
1784
 
 
1785
void
 
1786
PEXSetColorApproxIndex (display, resource_id, req_type, index)
 
1787
 
 
1788
INPUT Display           *display;
 
1789
INPUT XID               resource_id;
 
1790
INPUT PEXOCRequestType  req_type;
 
1791
INPUT unsigned int      index;
 
1792
 
 
1793
{
 
1794
    register pexColorApproxIndex        *req;
 
1795
 
 
1796
    BEGIN_SIMPLE_OC (ColorApproxIndex, resource_id, req_type, req);
 
1797
    req->index = index;
 
1798
    END_SIMPLE_OC (ColorApproxIndex, resource_id, req_type, req);
 
1799
}
 
1800
 
 
1801
 
 
1802
void
 
1803
PEXSetParaSurfCharacteristics (display, resource_id, req_type,
 
1804
    pscType, pscData)
 
1805
 
 
1806
INPUT Display           *display;
 
1807
INPUT XID               resource_id;
 
1808
INPUT PEXOCRequestType  req_type;
 
1809
INPUT int               pscType;
 
1810
INPUT PEXPSCData        *pscData;
 
1811
 
 
1812
{
 
1813
    register pexParaSurfCharacteristics *req;
 
1814
    char                                *pBuf;
 
1815
    int                                 dataLength = 0;
 
1816
    int                                 fpConvert;
 
1817
    int                                 fpFormat;
 
1818
 
 
1819
    /*
 
1820
     * Initialize the OC request.
 
1821
     */
 
1822
 
 
1823
    if (pscType == PEXPSCIsoCurves)
 
1824
    {
 
1825
        dataLength = LENOF (pexPSC_IsoparametricCurves);
 
1826
    }
 
1827
    else if (pscType == PEXPSCMCLevelCurves || pscType == PEXPSCWCLevelCurves)
 
1828
    {
 
1829
        dataLength = NUMWORDS (SIZEOF (pexPSC_LevelCurves) +
 
1830
                (pscData->level_curves.count * SIZEOF (float)));
 
1831
    }
 
1832
 
 
1833
    PEXInitOC (display, resource_id, req_type,
 
1834
        LENOF (pexParaSurfCharacteristics), dataLength, pBuf);
 
1835
 
 
1836
    if (pBuf == NULL) return;
 
1837
 
 
1838
 
 
1839
    /* 
 
1840
     * Store the request header data. 
 
1841
     */
 
1842
 
 
1843
    CHECK_FP (fpConvert, fpFormat);
 
1844
 
 
1845
    BEGIN_OC_HEADER (ParaSurfCharacteristics, dataLength, pBuf, req);
 
1846
 
 
1847
    req->characteristics = pscType;
 
1848
    req->length = NUMBYTES (dataLength);
 
1849
 
 
1850
    END_OC_HEADER (ParaSurfCharacteristics, pBuf, req);
 
1851
 
 
1852
 
 
1853
    /*
 
1854
     * Copy the oc data.
 
1855
     */
 
1856
 
 
1857
    if ((pBuf = PEXGetOCAddr (display, req->length)))
 
1858
    {
 
1859
        if (pscType == PEXPSCIsoCurves)
 
1860
        {
 
1861
            STORE_PSC_ISOCURVES (pscData->iso_curves, pBuf);
 
1862
        }
 
1863
        else if (pscType == PEXPSCMCLevelCurves ||
 
1864
            pscType == PEXPSCWCLevelCurves)
 
1865
        {
 
1866
            STORE_PSC_LEVELCURVES (pscData->level_curves, pBuf,
 
1867
                fpConvert, fpFormat);
 
1868
 
 
1869
            STORE_LISTOF_FLOAT32 (pscData->level_curves.count,
 
1870
                pscData->level_curves.parameters, pBuf, fpConvert, fpFormat);
 
1871
        }
 
1872
    }
 
1873
 
 
1874
    PEXFinishOC (display);
 
1875
    PEXSyncHandle (display);
 
1876
}
 
1877
 
 
1878
 
 
1879
void
 
1880
PEXSetRenderingColorModel (display, resource_id, req_type, model)
 
1881
 
 
1882
INPUT Display           *display;
 
1883
INPUT XID               resource_id;
 
1884
INPUT PEXOCRequestType  req_type;
 
1885
INPUT int               model;
 
1886
 
 
1887
{
 
1888
    register pexRenderingColorModel     *req;
 
1889
 
 
1890
    BEGIN_SIMPLE_OC (RenderingColorModel, resource_id, req_type, req);
 
1891
    req->model = model;
 
1892
    END_SIMPLE_OC (RenderingColorModel, resource_id, req_type, req);
 
1893
}
 
1894
 
 
1895
 
 
1896
void
 
1897
PEXAddToNameSet (display, resource_id, req_type, numNames, names)
 
1898
 
 
1899
INPUT Display           *display;
 
1900
INPUT XID               resource_id;
 
1901
INPUT PEXOCRequestType  req_type;
 
1902
INPUT unsigned long     numNames;
 
1903
INPUT PEXName           *names;
 
1904
 
 
1905
{
 
1906
    register pexAddToNameSet    *req;
 
1907
    char                        *pBuf;
 
1908
    int                         dataLength;
 
1909
 
 
1910
    /*
 
1911
     * Initialize the OC request.
 
1912
     */
 
1913
 
 
1914
    dataLength = NUMWORDS (numNames * SIZEOF (pexName));
 
1915
 
 
1916
    PEXInitOC (display, resource_id, req_type,
 
1917
        LENOF (pexAddToNameSet), dataLength, pBuf);
 
1918
 
 
1919
    if (pBuf == NULL) return;
 
1920
 
 
1921
 
 
1922
    /* 
 
1923
     * Store the request header data. 
 
1924
     */
 
1925
 
 
1926
    BEGIN_OC_HEADER (AddToNameSet, dataLength, pBuf, req);
 
1927
    END_OC_HEADER (AddToNameSet, pBuf, req);
 
1928
 
 
1929
 
 
1930
    /*
 
1931
     * Copy the oc data.
 
1932
     */
 
1933
 
 
1934
    OC_LISTOF_CARD32 (numNames, names);
 
1935
 
 
1936
    PEXFinishOC (display);
 
1937
    PEXSyncHandle (display);
 
1938
}
 
1939
 
 
1940
 
 
1941
void
 
1942
PEXRemoveFromNameSet (display, resource_id, req_type, numNames, names)
 
1943
 
 
1944
INPUT Display           *display;
 
1945
INPUT XID               resource_id;
 
1946
INPUT PEXOCRequestType  req_type;
 
1947
INPUT unsigned long     numNames;
 
1948
INPUT PEXName           *names;
 
1949
 
 
1950
{
 
1951
    register pexRemoveFromNameSet       *req;
 
1952
    char                                *pBuf;
 
1953
    int                                 dataLength;
 
1954
 
 
1955
    /*
 
1956
     * Initialize the OC request.
 
1957
     */
 
1958
 
 
1959
    dataLength = NUMWORDS (numNames * SIZEOF (pexName));
 
1960
 
 
1961
    PEXInitOC (display, resource_id, req_type,
 
1962
        LENOF (pexRemoveFromNameSet), dataLength, pBuf);
 
1963
 
 
1964
    if (pBuf == NULL) return;
 
1965
 
 
1966
 
 
1967
    /* 
 
1968
     * Store the request header data. 
 
1969
     */
 
1970
 
 
1971
    BEGIN_OC_HEADER (RemoveFromNameSet, dataLength, pBuf, req);
 
1972
    END_OC_HEADER (RemoveFromNameSet, pBuf, req);
 
1973
 
 
1974
 
 
1975
    /*
 
1976
     * Copy the oc data.
 
1977
     */
 
1978
 
 
1979
    OC_LISTOF_CARD32 (numNames, names);
 
1980
 
 
1981
    PEXFinishOC (display);
 
1982
    PEXSyncHandle (display);
 
1983
}