1 /*  NAME:
2         QD3DDrawContext.c
3 
4     DESCRIPTION:
5         Entry point for Quesa API calls. Performs parameter checking and
6         then forwards each API call to the equivalent E3xxxxx routine.
7 
8     COPYRIGHT:
9         Copyright (c) 1999-2004, Quesa Developers. All rights reserved.
10 
11         For the current release of Quesa, please see:
12 
13             <http://www.quesa.org/>
14 
15         Redistribution and use in source and binary forms, with or without
16         modification, are permitted provided that the following conditions
17         are met:
18 
19             o Redistributions of source code must retain the above copyright
20               notice, this list of conditions and the following disclaimer.
21 
22             o Redistributions in binary form must reproduce the above
23               copyright notice, this list of conditions and the following
24               disclaimer in the documentation and/or other materials provided
25               with the distribution.
26 
27             o Neither the name of Quesa nor the names of its contributors
28               may be used to endorse or promote products derived from this
29               software without specific prior written permission.
30 
31         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32         "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33         LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34         A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35         OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36         SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
37         TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
38         PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39         LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40         NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41         SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42     ___________________________________________________________________________
43 */
44 //=============================================================================
45 //      Include files
46 //-----------------------------------------------------------------------------
47 #include "E3Prefix.h"
48 #include "E3DrawContext.h"
49 
50 
51 
52 
53 
54 //=============================================================================
55 //      Internal constants
56 //-----------------------------------------------------------------------------
57 // Internal constants go here
58 
59 
60 
61 
62 
63 //=============================================================================
64 //      Internal types
65 //-----------------------------------------------------------------------------
66 // Internal types go here
67 
68 
69 
70 
71 
72 //=============================================================================
73 //      Internal macros
74 //-----------------------------------------------------------------------------
75 // Internal macros go here
76 
77 
78 
79 
80 
81 //=============================================================================
82 //      Public functions
83 //-----------------------------------------------------------------------------
84 //      Q3DrawContext_GetType : Quesa API entry point.
85 //-----------------------------------------------------------------------------
86 #pragma mark -
87 TQ3ObjectType
Q3DrawContext_GetType(TQ3DrawContextObject drawContext)88 Q3DrawContext_GetType(TQ3DrawContextObject drawContext)
89 {
90 
91 
92 	// Release build checks
93 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3ObjectTypeInvalid ) ;
94 
95 
96 
97 	// Debug build checks
98 #if Q3_DEBUG
99 	if (0) // Further checks on drawContext
100 		return(kQ3ObjectTypeInvalid);
101 #endif
102 
103 
104 
105 	// Call the bottleneck
106 	E3System_Bottleneck();
107 
108 
109 
110 	// Call our implementation
111 	return(E3DrawContext_GetType(drawContext));
112 }
113 
114 
115 
116 
117 
118 //=============================================================================
119 //      Q3DrawContext_SetData : Quesa API entry point.
120 //-----------------------------------------------------------------------------
121 TQ3Status
Q3DrawContext_SetData(TQ3DrawContextObject context,const TQ3DrawContextData * contextData)122 Q3DrawContext_SetData(TQ3DrawContextObject context, const TQ3DrawContextData *contextData)
123 {
124 
125 
126 	// Release build checks
127 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
128 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(contextData), kQ3Failure);
129 
130 
131 
132 	// Debug build checks
133 #if Q3_DEBUG
134 	if (0) // Further checks on context
135 		return(kQ3Failure);
136 
137 	if (0) // Further checks on contextData
138 		return(kQ3Failure);
139 #endif
140 
141 
142 
143 	// Call the bottleneck
144 	E3System_Bottleneck();
145 
146 
147 
148 	// Call our implementation
149 	return(E3DrawContext_SetData(context, contextData));
150 }
151 
152 
153 
154 
155 
156 //=============================================================================
157 //      Q3DrawContext_GetData : Quesa API entry point.
158 //-----------------------------------------------------------------------------
159 TQ3Status
Q3DrawContext_GetData(TQ3DrawContextObject context,TQ3DrawContextData * contextData)160 Q3DrawContext_GetData(TQ3DrawContextObject context, TQ3DrawContextData *contextData)
161 {
162 
163 
164 	// Release build checks
165 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
166 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(contextData), kQ3Failure);
167 
168 
169 
170 	// Debug build checks
171 #if Q3_DEBUG
172 	if (0) // Further checks on context
173 		return(kQ3Failure);
174 
175 	if (0) // Further checks on contextData
176 		return(kQ3Failure);
177 #endif
178 
179 
180 
181 	// Call the bottleneck
182 	E3System_Bottleneck();
183 
184 
185 
186 	// Call our implementation
187 	return(E3DrawContext_GetData(context, contextData));
188 }
189 
190 
191 
192 
193 
194 //=============================================================================
195 //      Q3DrawContext_SetClearImageColor : Quesa API entry point.
196 //-----------------------------------------------------------------------------
197 TQ3Status
Q3DrawContext_SetClearImageColor(TQ3DrawContextObject context,const TQ3ColorARGB * color)198 Q3DrawContext_SetClearImageColor(TQ3DrawContextObject context, const TQ3ColorARGB *color)
199 {
200 
201 
202 	// Release build checks
203 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
204 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(color), kQ3Failure);
205 
206 
207 
208 	// Debug build checks
209 #if Q3_DEBUG
210 	if (0) // Further checks on context
211 		return(kQ3Failure);
212 
213 	if (0) // Further checks on color
214 		return(kQ3Failure);
215 #endif
216 
217 
218 
219 	// Call the bottleneck
220 	E3System_Bottleneck();
221 
222 
223 
224 	// Call our implementation
225 	return(E3DrawContext_SetClearImageColor(context, color));
226 }
227 
228 
229 
230 
231 
232 //=============================================================================
233 //      Q3DrawContext_GetClearImageColor : Quesa API entry point.
234 //-----------------------------------------------------------------------------
235 TQ3Status
Q3DrawContext_GetClearImageColor(TQ3DrawContextObject context,TQ3ColorARGB * color)236 Q3DrawContext_GetClearImageColor(TQ3DrawContextObject context, TQ3ColorARGB *color)
237 {
238 
239 
240 	// Release build checks
241 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
242 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(color), kQ3Failure);
243 
244 
245 
246 	// Debug build checks
247 #if Q3_DEBUG
248 	if (0) // Further checks on context
249 		return(kQ3Failure);
250 
251 	if (0) // Further checks on color
252 		return(kQ3Failure);
253 #endif
254 
255 
256 
257 	// Call the bottleneck
258 	E3System_Bottleneck();
259 
260 
261 
262 	// Call our implementation
263 	return(E3DrawContext_GetClearImageColor(context, color));
264 }
265 
266 
267 
268 
269 
270 //=============================================================================
271 //      Q3DrawContext_SetPane : Quesa API entry point.
272 //-----------------------------------------------------------------------------
273 TQ3Status
Q3DrawContext_SetPane(TQ3DrawContextObject context,const TQ3Area * pane)274 Q3DrawContext_SetPane(TQ3DrawContextObject context, const TQ3Area *pane)
275 {
276 
277 
278 	// Release build checks
279 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
280 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(pane), kQ3Failure);
281 
282 
283 
284 	// Debug build checks
285 #if Q3_DEBUG
286 	if (0) // Further checks on context
287 		return(kQ3Failure);
288 
289 	if (0) // Further checks on pane
290 		return(kQ3Failure);
291 #endif
292 
293 
294 
295 	// Call the bottleneck
296 	E3System_Bottleneck();
297 
298 
299 
300 	// Call our implementation
301 	return(E3DrawContext_SetPane(context, pane));
302 }
303 
304 
305 
306 
307 
308 //=============================================================================
309 //      Q3DrawContext_GetPane : Quesa API entry point.
310 //-----------------------------------------------------------------------------
311 TQ3Status
Q3DrawContext_GetPane(TQ3DrawContextObject context,TQ3Area * pane)312 Q3DrawContext_GetPane(TQ3DrawContextObject context, TQ3Area *pane)
313 {
314 
315 
316 	// Release build checks
317 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
318 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(pane), kQ3Failure);
319 
320 
321 
322 	// Debug build checks
323 #if Q3_DEBUG
324 	if (0) // Further checks on context
325 		return(kQ3Failure);
326 
327 	if (0) // Further checks on pane
328 		return(kQ3Failure);
329 #endif
330 
331 
332 
333 	// Call the bottleneck
334 	E3System_Bottleneck();
335 
336 
337 
338 	// Call our implementation
339 	return ( (E3DrawContext*) context )->GetPane ( pane ) ;
340 }
341 
342 
343 
344 
345 
346 //=============================================================================
347 //      Q3DrawContext_SetPaneState : Quesa API entry point.
348 //-----------------------------------------------------------------------------
349 TQ3Status
Q3DrawContext_SetPaneState(TQ3DrawContextObject context,TQ3Boolean state)350 Q3DrawContext_SetPaneState(TQ3DrawContextObject context, TQ3Boolean state)
351 {
352 
353 
354 	// Release build checks
355 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
356 
357 
358 
359 	// Debug build checks
360 #if Q3_DEBUG
361 	if (0) // Further checks on context
362 		return(kQ3Failure);
363 
364 	if (0) // Further checks on state
365 		return(kQ3Failure);
366 #endif
367 
368 
369 
370 	// Call the bottleneck
371 	E3System_Bottleneck();
372 
373 
374 
375 	// Call our implementation
376 	return(E3DrawContext_SetPaneState(context, state));
377 }
378 
379 
380 
381 
382 
383 //=============================================================================
384 //      Q3DrawContext_GetPaneState : Quesa API entry point.
385 //-----------------------------------------------------------------------------
386 TQ3Status
Q3DrawContext_GetPaneState(TQ3DrawContextObject context,TQ3Boolean * state)387 Q3DrawContext_GetPaneState(TQ3DrawContextObject context, TQ3Boolean *state)
388 {
389 
390 
391 	// Release build checks
392 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
393 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(state), kQ3Failure);
394 
395 
396 
397 	// Debug build checks
398 #if Q3_DEBUG
399 	if (0) // Further checks on context
400 		return(kQ3Failure);
401 
402 	if (0) // Further checks on state
403 		return(kQ3Failure);
404 #endif
405 
406 
407 
408 	// Call the bottleneck
409 	E3System_Bottleneck();
410 
411 
412 
413 	// Call our implementation
414 	return(E3DrawContext_GetPaneState(context, state));
415 }
416 
417 
418 
419 
420 
421 //=============================================================================
422 //      Q3DrawContext_SetClearImageMethod : Quesa API entry point.
423 //-----------------------------------------------------------------------------
424 TQ3Status
Q3DrawContext_SetClearImageMethod(TQ3DrawContextObject context,TQ3DrawContextClearImageMethod method)425 Q3DrawContext_SetClearImageMethod(TQ3DrawContextObject context, TQ3DrawContextClearImageMethod method)
426 {
427 
428 
429 	// Release build checks
430 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
431 
432 
433 
434 	// Debug build checks
435 #if Q3_DEBUG
436 	if (0) // Further checks on context
437 		return(kQ3Failure);
438 
439 	if (0) // Further checks on method
440 		return(kQ3Failure);
441 #endif
442 
443 
444 
445 	// Call the bottleneck
446 	E3System_Bottleneck();
447 
448 
449 
450 	// Call our implementation
451 	return(E3DrawContext_SetClearImageMethod(context, method));
452 }
453 
454 
455 
456 
457 
458 //=============================================================================
459 //      Q3DrawContext_GetClearImageMethod : Quesa API entry point.
460 //-----------------------------------------------------------------------------
461 TQ3Status
Q3DrawContext_GetClearImageMethod(TQ3DrawContextObject context,TQ3DrawContextClearImageMethod * method)462 Q3DrawContext_GetClearImageMethod(TQ3DrawContextObject context, TQ3DrawContextClearImageMethod *method)
463 {
464 
465 
466 	// Release build checks
467 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
468 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(method), kQ3Failure);
469 
470 
471 
472 	// Debug build checks
473 #if Q3_DEBUG
474 	if (0) // Further checks on context
475 		return(kQ3Failure);
476 
477 	if (0) // Further checks on method
478 		return(kQ3Failure);
479 #endif
480 
481 
482 
483 	// Call the bottleneck
484 	E3System_Bottleneck();
485 
486 
487 
488 	// Call our implementation
489 	return(E3DrawContext_GetClearImageMethod(context, method));
490 }
491 
492 
493 
494 
495 
496 //=============================================================================
497 //      Q3DrawContext_SetMask : Quesa API entry point.
498 //-----------------------------------------------------------------------------
499 TQ3Status
Q3DrawContext_SetMask(TQ3DrawContextObject context,const TQ3Bitmap * mask)500 Q3DrawContext_SetMask(TQ3DrawContextObject context, const TQ3Bitmap *mask)
501 {
502 
503 
504 	// Release build checks
505 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
506 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(mask), kQ3Failure);
507 
508 
509 
510 	// Debug build checks
511 #if Q3_DEBUG
512 	if (0) // Further checks on context
513 		return(kQ3Failure);
514 
515 	if (0) // Further checks on mask
516 		return(kQ3Failure);
517 #endif
518 
519 
520 
521 	// Call the bottleneck
522 	E3System_Bottleneck();
523 
524 
525 
526 	// Call our implementation
527 	return(E3DrawContext_SetMask(context, mask));
528 }
529 
530 
531 
532 
533 
534 //=============================================================================
535 //      Q3DrawContext_GetMask : Quesa API entry point.
536 //-----------------------------------------------------------------------------
537 TQ3Status
Q3DrawContext_GetMask(TQ3DrawContextObject context,TQ3Bitmap * mask)538 Q3DrawContext_GetMask(TQ3DrawContextObject context, TQ3Bitmap *mask)
539 {
540 
541 
542 	// Release build checks
543 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
544 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(mask), kQ3Failure);
545 
546 
547 
548 	// Debug build checks
549 #if Q3_DEBUG
550 	if (0) // Further checks on context
551 		return(kQ3Failure);
552 
553 	if (0) // Further checks on mask
554 		return(kQ3Failure);
555 #endif
556 
557 
558 
559 	// Call the bottleneck
560 	E3System_Bottleneck();
561 
562 
563 
564 	// Call our implementation
565 	return(E3DrawContext_GetMask(context, mask));
566 }
567 
568 
569 
570 
571 
572 //=============================================================================
573 //      Q3DrawContext_SetMaskState : Quesa API entry point.
574 //-----------------------------------------------------------------------------
575 TQ3Status
Q3DrawContext_SetMaskState(TQ3DrawContextObject context,TQ3Boolean state)576 Q3DrawContext_SetMaskState(TQ3DrawContextObject context, TQ3Boolean state)
577 {
578 
579 
580 	// Release build checks
581 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
582 
583 
584 
585 	// Debug build checks
586 #if Q3_DEBUG
587 	if (0) // Further checks on context
588 		return(kQ3Failure);
589 
590 	if (0) // Further checks on state
591 		return(kQ3Failure);
592 #endif
593 
594 
595 
596 	// Call the bottleneck
597 	E3System_Bottleneck();
598 
599 
600 
601 	// Call our implementation
602 	return(E3DrawContext_SetMaskState(context, state));
603 }
604 
605 
606 
607 
608 
609 //=============================================================================
610 //      Q3DrawContext_GetMaskState : Quesa API entry point.
611 //-----------------------------------------------------------------------------
612 TQ3Status
Q3DrawContext_GetMaskState(TQ3DrawContextObject context,TQ3Boolean * state)613 Q3DrawContext_GetMaskState(TQ3DrawContextObject context, TQ3Boolean *state)
614 {
615 
616 
617 	// Release build checks
618 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
619 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(state), kQ3Failure);
620 
621 
622 
623 	// Debug build checks
624 #if Q3_DEBUG
625 	if (0) // Further checks on context
626 		return(kQ3Failure);
627 
628 	if (0) // Further checks on state
629 		return(kQ3Failure);
630 #endif
631 
632 
633 
634 	// Call the bottleneck
635 	E3System_Bottleneck();
636 
637 
638 
639 	// Call our implementation
640 	return(E3DrawContext_GetMaskState(context, state));
641 }
642 
643 
644 
645 
646 
647 //=============================================================================
648 //      Q3DrawContext_SetDoubleBufferState : Quesa API entry point.
649 //-----------------------------------------------------------------------------
650 TQ3Status
Q3DrawContext_SetDoubleBufferState(TQ3DrawContextObject context,TQ3Boolean state)651 Q3DrawContext_SetDoubleBufferState(TQ3DrawContextObject context, TQ3Boolean state)
652 {
653 
654 
655 	// Release build checks
656 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
657 
658 
659 
660 	// Debug build checks
661 #if Q3_DEBUG
662 	if (0) // Further checks on context
663 		return(kQ3Failure);
664 
665 	if (0) // Further checks on state
666 		return(kQ3Failure);
667 #endif
668 
669 
670 
671 	// Call the bottleneck
672 	E3System_Bottleneck();
673 
674 
675 
676 	// Call our implementation
677 	return(E3DrawContext_SetDoubleBufferState(context, state));
678 }
679 
680 
681 
682 
683 
684 //=============================================================================
685 //      Q3DrawContext_GetDoubleBufferState : Quesa API entry point.
686 //-----------------------------------------------------------------------------
687 TQ3Status
Q3DrawContext_GetDoubleBufferState(TQ3DrawContextObject context,TQ3Boolean * state)688 Q3DrawContext_GetDoubleBufferState(TQ3DrawContextObject context, TQ3Boolean *state)
689 {
690 
691 
692 	// Release build checks
693 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( context ), kQ3Failure ) ;
694 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(state), kQ3Failure);
695 
696 
697 
698 	// Debug build checks
699 #if Q3_DEBUG
700 	if (0) // Further checks on context
701 		return(kQ3Failure);
702 
703 	if (0) // Further checks on state
704 		return(kQ3Failure);
705 #endif
706 
707 
708 
709 	// Call the bottleneck
710 	E3System_Bottleneck();
711 
712 
713 
714 	// Call our implementation
715 	return(E3DrawContext_GetDoubleBufferState(context, state));
716 }
717 
718 
719 
720 
721 
722 //=============================================================================
723 //      Q3PixmapDrawContext_New : Quesa API entry point.
724 //-----------------------------------------------------------------------------
725 TQ3DrawContextObject
Q3PixmapDrawContext_New(const TQ3PixmapDrawContextData * contextData)726 Q3PixmapDrawContext_New(const TQ3PixmapDrawContextData *contextData)
727 {
728 
729 
730 	// Release build checks
731 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(contextData), NULL);
732 
733 
734 
735 	// Debug build checks
736 #if Q3_DEBUG
737 	if (0) // Further checks on contextData
738 		return(NULL);
739 #endif
740 
741 
742 
743 	// Call the bottleneck
744 	E3System_Bottleneck();
745 
746 
747 
748 	// Call our implementation
749 	return(E3PixmapDrawContext_New(contextData));
750 }
751 
752 
753 
754 
755 
756 //=============================================================================
757 //      Q3PixmapDrawContext_SetPixmap : Quesa API entry point.
758 //-----------------------------------------------------------------------------
759 TQ3Status
Q3PixmapDrawContext_SetPixmap(TQ3DrawContextObject drawContext,const TQ3Pixmap * pixmap)760 Q3PixmapDrawContext_SetPixmap(TQ3DrawContextObject drawContext, const TQ3Pixmap *pixmap)
761 {
762 
763 
764 	// Release build checks
765 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
766 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(pixmap), kQ3Failure);
767 
768 
769 
770 	// Debug build checks
771 #if Q3_DEBUG
772 	if (0) // Further checks on drawContext
773 		return(kQ3Failure);
774 
775 	if (0) // Further checks on pixmap
776 		return(kQ3Failure);
777 #endif
778 
779 
780 
781 	// Call the bottleneck
782 	E3System_Bottleneck();
783 
784 
785 
786 	// Call our implementation
787 	return(E3PixmapDrawContext_SetPixmap(drawContext, pixmap));
788 }
789 
790 
791 
792 
793 
794 //=============================================================================
795 //      Q3PixmapDrawContext_GetPixmap : Quesa API entry point.
796 //-----------------------------------------------------------------------------
797 TQ3Status
Q3PixmapDrawContext_GetPixmap(TQ3DrawContextObject drawContext,TQ3Pixmap * pixmap)798 Q3PixmapDrawContext_GetPixmap(TQ3DrawContextObject drawContext, TQ3Pixmap *pixmap)
799 {
800 
801 
802 	// Release build checks
803 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
804 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(pixmap), kQ3Failure);
805 
806 
807 
808 	// Debug build checks
809 #if Q3_DEBUG
810 	if (0) // Further checks on drawContext
811 		return(kQ3Failure);
812 
813 	if (0) // Further checks on pixmap
814 		return(kQ3Failure);
815 #endif
816 
817 
818 
819 	// Call the bottleneck
820 	E3System_Bottleneck();
821 
822 
823 
824 	// Call our implementation
825 	return(E3PixmapDrawContext_GetPixmap(drawContext, pixmap));
826 }
827 
828 
829 
830 
831 
832 //=============================================================================
833 //      Q3MacDrawContext_New : Quesa API entry point.
834 //-----------------------------------------------------------------------------
835 #pragma mark -
836 #if QUESA_OS_MACINTOSH
837 TQ3DrawContextObject
Q3MacDrawContext_New(const TQ3MacDrawContextData * drawContextData)838 Q3MacDrawContext_New(const TQ3MacDrawContextData *drawContextData)
839 {
840 
841 
842 	// Release build checks
843 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
844 
845 
846 
847 	// Debug build checks
848 #if Q3_DEBUG
849 	if (0) // Further checks on drawContextData
850 		return(NULL);
851 #endif
852 
853 
854 
855 	// Call the bottleneck
856 	E3System_Bottleneck();
857 
858 
859 
860 	// Call our implementation
861 	return(E3MacDrawContext_New(drawContextData));
862 }
863 
864 
865 
866 
867 
868 //=============================================================================
869 //      Q3MacDrawContext_SetWindow : Quesa API entry point.
870 //-----------------------------------------------------------------------------
871 TQ3Status
Q3MacDrawContext_SetWindow(TQ3DrawContextObject drawContext,CWindowPtr window)872 Q3MacDrawContext_SetWindow(TQ3DrawContextObject drawContext, CWindowPtr window)
873 {
874 
875 
876 	// Release build checks
877 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
878 
879 
880 
881 	// Debug build checks
882 #if Q3_DEBUG
883 	if (0) // Further checks on drawContext
884 		return(kQ3Failure);
885 
886 	if (0) // Further checks on window
887 		return(kQ3Failure);
888 #endif
889 
890 
891 
892 	// Call the bottleneck
893 	E3System_Bottleneck();
894 
895 
896 
897 	// Call our implementation
898 	return(E3MacDrawContext_SetWindow(drawContext, window));
899 }
900 
901 
902 
903 
904 
905 //=============================================================================
906 //      Q3MacDrawContext_GetWindow : Quesa API entry point.
907 //-----------------------------------------------------------------------------
908 TQ3Status
Q3MacDrawContext_GetWindow(TQ3DrawContextObject drawContext,CWindowPtr * window)909 Q3MacDrawContext_GetWindow(TQ3DrawContextObject drawContext, CWindowPtr *window)
910 {
911 
912 
913 	// Release build checks
914 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
915 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(window), kQ3Failure);
916 
917 
918 
919 	// Debug build checks
920 #if Q3_DEBUG
921 	if (0) // Further checks on drawContext
922 		return(kQ3Failure);
923 
924 	if (0) // Further checks on window
925 		return(kQ3Failure);
926 #endif
927 
928 
929 
930 	// Call the bottleneck
931 	E3System_Bottleneck();
932 
933 
934 
935 	// Call our implementation
936 	return(E3MacDrawContext_GetWindow(drawContext, window));
937 }
938 
939 
940 
941 
942 
943 //=============================================================================
944 //      Q3MacDrawContext_SetGXViewPort : Quesa API entry point.
945 //-----------------------------------------------------------------------------
946 TQ3Status
Q3MacDrawContext_SetGXViewPort(TQ3DrawContextObject drawContext,gxViewPort viewPort)947 Q3MacDrawContext_SetGXViewPort(TQ3DrawContextObject drawContext, gxViewPort viewPort)
948 {
949 
950 
951 	// Release build checks
952 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
953 
954 
955 
956 	// Debug build checks
957 #if Q3_DEBUG
958 	if (0) // Further checks on drawContext
959 		return(kQ3Failure);
960 
961 	if (0) // Further checks on viewPort
962 		return(kQ3Failure);
963 #endif
964 
965 
966 
967 	// Call the bottleneck
968 	E3System_Bottleneck();
969 
970 
971 
972 	// Call our implementation
973 	return(E3MacDrawContext_SetGXViewPort(drawContext, viewPort));
974 }
975 
976 
977 
978 
979 
980 //=============================================================================
981 //      Q3MacDrawContext_GetGXViewPort : Quesa API entry point.
982 //-----------------------------------------------------------------------------
983 TQ3Status
Q3MacDrawContext_GetGXViewPort(TQ3DrawContextObject drawContext,gxViewPort * viewPort)984 Q3MacDrawContext_GetGXViewPort(TQ3DrawContextObject drawContext, gxViewPort *viewPort)
985 {
986 
987 
988 	// Release build checks
989 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
990 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(viewPort), kQ3Failure);
991 
992 
993 
994 	// Debug build checks
995 #if Q3_DEBUG
996 	if (0) // Further checks on drawContext
997 		return(kQ3Failure);
998 
999 	if (0) // Further checks on viewPort
1000 		return(kQ3Failure);
1001 #endif
1002 
1003 
1004 
1005 	// Call the bottleneck
1006 	E3System_Bottleneck();
1007 
1008 
1009 
1010 	// Call our implementation
1011 	return(E3MacDrawContext_GetGXViewPort(drawContext, viewPort));
1012 }
1013 
1014 
1015 
1016 
1017 
1018 //=============================================================================
1019 //      Q3MacDrawContext_SetGrafPort : Quesa API entry point.
1020 //-----------------------------------------------------------------------------
1021 TQ3Status
Q3MacDrawContext_SetGrafPort(TQ3DrawContextObject drawContext,CGrafPtr grafPort)1022 Q3MacDrawContext_SetGrafPort(TQ3DrawContextObject drawContext, CGrafPtr grafPort)
1023 {
1024 
1025 
1026 	// Release build checks
1027 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1028 
1029 
1030 
1031 	// Debug build checks
1032 #if Q3_DEBUG
1033 	if (0) // Further checks on drawContext
1034 		return(kQ3Failure);
1035 
1036 	if (0) // Further checks on grafPort
1037 		return(kQ3Failure);
1038 #endif
1039 
1040 
1041 
1042 	// Call the bottleneck
1043 	E3System_Bottleneck();
1044 
1045 
1046 
1047 	// Call our implementation
1048 	return(E3MacDrawContext_SetGrafPort(drawContext, grafPort));
1049 }
1050 
1051 
1052 
1053 
1054 
1055 //=============================================================================
1056 //      Q3MacDrawContext_GetGrafPort : Quesa API entry point.
1057 //-----------------------------------------------------------------------------
1058 TQ3Status
Q3MacDrawContext_GetGrafPort(TQ3DrawContextObject drawContext,CGrafPtr * grafPort)1059 Q3MacDrawContext_GetGrafPort(TQ3DrawContextObject drawContext, CGrafPtr *grafPort)
1060 {
1061 
1062 
1063 	// Release build checks
1064 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1065 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(grafPort), kQ3Failure);
1066 
1067 
1068 
1069 	// Debug build checks
1070 #if Q3_DEBUG
1071 	if (0) // Further checks on drawContext
1072 		return(kQ3Failure);
1073 
1074 	if (0) // Further checks on grafPort
1075 		return(kQ3Failure);
1076 #endif
1077 
1078 
1079 
1080 	// Call the bottleneck
1081 	E3System_Bottleneck();
1082 
1083 
1084 
1085 	// Call our implementation
1086 	return(E3MacDrawContext_GetGrafPort(drawContext, grafPort));
1087 }
1088 
1089 
1090 
1091 
1092 
1093 //=============================================================================
1094 //      Q3MacDrawContext_Set2DLibrary : Quesa API entry point.
1095 //-----------------------------------------------------------------------------
1096 TQ3Status
Q3MacDrawContext_Set2DLibrary(TQ3DrawContextObject drawContext,TQ3MacDrawContext2DLibrary library)1097 Q3MacDrawContext_Set2DLibrary(TQ3DrawContextObject drawContext, TQ3MacDrawContext2DLibrary library)
1098 {
1099 
1100 
1101 	// Release build checks
1102 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1103 
1104 
1105 
1106 	// Debug build checks
1107 #if Q3_DEBUG
1108 	if (0) // Further checks on drawContext
1109 		return(kQ3Failure);
1110 
1111 	if (0) // Further checks on library
1112 		return(kQ3Failure);
1113 #endif
1114 
1115 
1116 
1117 	// Call the bottleneck
1118 	E3System_Bottleneck();
1119 
1120 
1121 
1122 	// Call our implementation
1123 	return(E3MacDrawContext_Set2DLibrary(drawContext, library));
1124 }
1125 
1126 
1127 
1128 
1129 
1130 //=============================================================================
1131 //      Q3MacDrawContext_Get2DLibrary : Quesa API entry point.
1132 //-----------------------------------------------------------------------------
1133 TQ3Status
Q3MacDrawContext_Get2DLibrary(TQ3DrawContextObject drawContext,TQ3MacDrawContext2DLibrary * library)1134 Q3MacDrawContext_Get2DLibrary(TQ3DrawContextObject drawContext, TQ3MacDrawContext2DLibrary *library)
1135 {
1136 
1137 
1138 	// Release build checks
1139 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1140 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(library), kQ3Failure);
1141 
1142 
1143 
1144 	// Debug build checks
1145 #if Q3_DEBUG
1146 	if (0) // Further checks on drawContext
1147 		return(kQ3Failure);
1148 
1149 	if (0) // Further checks on library
1150 		return(kQ3Failure);
1151 #endif
1152 
1153 
1154 
1155 	// Call the bottleneck
1156 	E3System_Bottleneck();
1157 
1158 
1159 
1160 	// Call our implementation
1161 	return(E3MacDrawContext_Get2DLibrary(drawContext, library));
1162 }
1163 #endif // QUESA_OS_MACINTOSH
1164 
1165 
1166 
1167 
1168 
1169 //=============================================================================
1170 //      Q3XBuffers_New : Quesa API entry point.
1171 //-----------------------------------------------------------------------------
1172 #pragma mark -
1173 #if QUESA_OS_UNIX
1174 TQ3XBufferObject
Q3XBuffers_New(Display * dpy,TQ3Uns32 numBuffers,Window window)1175 Q3XBuffers_New(Display *dpy, TQ3Uns32 numBuffers, Window window)
1176 {
1177 
1178 
1179 	// Release build checks
1180 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(dpy), NULL);
1181 
1182 
1183 
1184 	// Debug build checks
1185 #if Q3_DEBUG
1186 	if (0) // Further checks on dpy
1187 		return(NULL);
1188 
1189 	if (0) // Further checks on numBuffers
1190 		return(NULL);
1191 
1192 	if (0) // Further checks on window
1193 		return(NULL);
1194 #endif
1195 
1196 
1197 
1198 	// Call the bottleneck
1199 	E3System_Bottleneck();
1200 
1201 
1202 
1203 	// Call our implementation
1204 	return(E3XBuffers_New(dpy, numBuffers, window));
1205 }
1206 
1207 
1208 
1209 
1210 
1211 //=============================================================================
1212 //      Q3XBuffers_Swap : Quesa API entry point.
1213 //-----------------------------------------------------------------------------
1214 void
Q3XBuffers_Swap(Display * dpy,TQ3XBufferObject buffers)1215 Q3XBuffers_Swap(Display *dpy, TQ3XBufferObject buffers)
1216 {
1217 
1218 
1219 	// Release build checks
1220 	Q3_REQUIRE(Q3_VALID_PTR(dpy));
1221 
1222 
1223 
1224 	// Debug build checks
1225 #if Q3_DEBUG
1226 	if (0) // Further checks on dpy
1227 		return;
1228 
1229 	if (0) // Further checks on buffers
1230 		return;
1231 #endif
1232 
1233 
1234 
1235 	// Call the bottleneck
1236 	E3System_Bottleneck();
1237 
1238 
1239 
1240 	// Call our implementation
1241 	E3XBuffers_Swap(dpy, buffers);
1242 }
1243 
1244 
1245 
1246 
1247 
1248 //=============================================================================
1249 //      Q3X_GetVisualInfo : Quesa API entry point.
1250 //-----------------------------------------------------------------------------
1251 XVisualInfo *
Q3X_GetVisualInfo(Display * dpy,Screen * screen)1252 Q3X_GetVisualInfo(Display *dpy, Screen *screen)
1253 {
1254 
1255 
1256 	// Release build checks
1257 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(dpy), NULL);
1258 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(screen), NULL);
1259 
1260 
1261 
1262 	// Debug build checks
1263 #if Q3_DEBUG
1264 	if (0) // Further checks on dpy
1265 		return(NULL);
1266 
1267 	if (0) // Further checks on screen
1268 		return(NULL);
1269 #endif
1270 
1271 
1272 
1273 	// Call the bottleneck
1274 	E3System_Bottleneck();
1275 
1276 
1277 
1278 	// Call our implementation
1279 	return(E3X_GetVisualInfo(dpy, screen));
1280 }
1281 
1282 
1283 
1284 
1285 
1286 //=============================================================================
1287 //      Q3XDrawContext_New : Quesa API entry point.
1288 //-----------------------------------------------------------------------------
1289 TQ3DrawContextObject
Q3XDrawContext_New(const TQ3XDrawContextData * drawContextData)1290 Q3XDrawContext_New(const TQ3XDrawContextData *drawContextData)
1291 {
1292 
1293 
1294 	// Release build checks
1295 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
1296 
1297 
1298 
1299 	// Debug build checks
1300 #if Q3_DEBUG
1301 	if (0) // Further checks on drawContextData
1302 		return(NULL);
1303 
1304 	if (0) // Further checks on display
1305 		return(NULL);
1306 #endif
1307 
1308 
1309 
1310 	// Call the bottleneck
1311 	E3System_Bottleneck();
1312 
1313 
1314 
1315 	// Call our implementation
1316 	return(E3XDrawContext_New(drawContextData));
1317 }
1318 
1319 
1320 
1321 
1322 
1323 //=============================================================================
1324 //      Q3XDrawContext_SetDisplay : Quesa API entry point.
1325 //-----------------------------------------------------------------------------
1326 TQ3Status
Q3XDrawContext_SetDisplay(TQ3DrawContextObject drawContext,const Display * display)1327 Q3XDrawContext_SetDisplay(TQ3DrawContextObject drawContext, const Display *display)
1328 {
1329 
1330 
1331 	// Release build checks
1332 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1333 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(display), kQ3Failure);
1334 
1335 
1336 
1337 	// Debug build checks
1338 #if Q3_DEBUG
1339 	if (0) // Further checks on drawContext
1340 		return(kQ3Failure);
1341 
1342 	if (0) // Further checks on display
1343 		return(kQ3Failure);
1344 #endif
1345 
1346 
1347 
1348 	// Call the bottleneck
1349 	E3System_Bottleneck();
1350 
1351 
1352 
1353 	// Call our implementation
1354 	return(E3XDrawContext_SetDisplay(drawContext, display));
1355 }
1356 
1357 
1358 
1359 
1360 
1361 //=============================================================================
1362 //      Q3XDrawContext_GetDisplay : Quesa API entry point.
1363 //-----------------------------------------------------------------------------
1364 TQ3Status
Q3XDrawContext_GetDisplay(TQ3DrawContextObject drawContext,Display ** display)1365 Q3XDrawContext_GetDisplay(TQ3DrawContextObject drawContext, Display **display)
1366 {
1367 
1368 
1369 	// Release build checks
1370 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1371 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(display), kQ3Failure);
1372 
1373 
1374 
1375 	// Debug build checks
1376 #if Q3_DEBUG
1377 	if (0) // Further checks on drawContext
1378 		return(kQ3Failure);
1379 
1380 	if (0) // Further checks on display
1381 		return(kQ3Failure);
1382 #endif
1383 
1384 
1385 
1386 	// Call the bottleneck
1387 	E3System_Bottleneck();
1388 
1389 
1390 
1391 	// Call our implementation
1392 	return(E3XDrawContext_GetDisplay(drawContext, display));
1393 }
1394 
1395 
1396 
1397 
1398 
1399 //=============================================================================
1400 //      Q3XDrawContext_SetDrawable : Quesa API entry point.
1401 //-----------------------------------------------------------------------------
1402 TQ3Status
Q3XDrawContext_SetDrawable(TQ3DrawContextObject drawContext,Drawable drawable)1403 Q3XDrawContext_SetDrawable(TQ3DrawContextObject drawContext, Drawable drawable)
1404 {
1405 
1406 
1407 	// Release build checks
1408 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1409 
1410 
1411 
1412 	// Debug build checks
1413 #if Q3_DEBUG
1414 	if (0) // Further checks on drawContext
1415 		return(kQ3Failure);
1416 
1417 	if (0) // Further checks on drawable
1418 		return(kQ3Failure);
1419 #endif
1420 
1421 
1422 
1423 	// Call the bottleneck
1424 	E3System_Bottleneck();
1425 
1426 
1427 
1428 	// Call our implementation
1429 	return(E3XDrawContext_SetDrawable(drawContext, drawable));
1430 }
1431 
1432 
1433 
1434 
1435 
1436 //=============================================================================
1437 //      Q3XDrawContext_GetDrawable : Quesa API entry point.
1438 //-----------------------------------------------------------------------------
1439 TQ3Status
Q3XDrawContext_GetDrawable(TQ3DrawContextObject drawContext,Drawable * drawable)1440 Q3XDrawContext_GetDrawable(TQ3DrawContextObject drawContext, Drawable *drawable)
1441 {
1442 
1443 
1444 	// Release build checks
1445 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1446 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawable), kQ3Failure);
1447 
1448 
1449 
1450 	// Debug build checks
1451 #if Q3_DEBUG
1452 	if (0) // Further checks on drawContext
1453 		return(kQ3Failure);
1454 
1455 	if (0) // Further checks on drawable
1456 		return(kQ3Failure);
1457 #endif
1458 
1459 
1460 
1461 	// Call the bottleneck
1462 	E3System_Bottleneck();
1463 
1464 
1465 
1466 	// Call our implementation
1467 	return(E3XDrawContext_GetDrawable(drawContext, drawable));
1468 }
1469 
1470 
1471 
1472 
1473 
1474 //=============================================================================
1475 //      Q3XDrawContext_SetVisual : Quesa API entry point.
1476 //-----------------------------------------------------------------------------
1477 TQ3Status
Q3XDrawContext_SetVisual(TQ3DrawContextObject drawContext,const Visual * visual)1478 Q3XDrawContext_SetVisual(TQ3DrawContextObject drawContext, const Visual *visual)
1479 {
1480 
1481 
1482 	// Release build checks
1483 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1484 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(visual), kQ3Failure);
1485 
1486 
1487 
1488 	// Debug build checks
1489 #if Q3_DEBUG
1490 	if (0) // Further checks on drawContext
1491 		return(kQ3Failure);
1492 
1493 	if (0) // Further checks on visual
1494 		return(kQ3Failure);
1495 #endif
1496 
1497 
1498 
1499 	// Call the bottleneck
1500 	E3System_Bottleneck();
1501 
1502 
1503 
1504 	// Call our implementation
1505 	return(E3XDrawContext_SetVisual(drawContext, visual));
1506 }
1507 
1508 
1509 
1510 
1511 
1512 //=============================================================================
1513 //      Q3XDrawContext_GetVisual : Quesa API entry point.
1514 //-----------------------------------------------------------------------------
1515 TQ3Status
Q3XDrawContext_GetVisual(TQ3DrawContextObject drawContext,Visual ** visual)1516 Q3XDrawContext_GetVisual(TQ3DrawContextObject drawContext, Visual **visual)
1517 {
1518 
1519 
1520 	// Release build checks
1521 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1522 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(visual), kQ3Failure);
1523 
1524 
1525 
1526 	// Debug build checks
1527 #if Q3_DEBUG
1528 	if (0) // Further checks on drawContext
1529 		return(kQ3Failure);
1530 
1531 	if (0) // Further checks on visual
1532 		return(kQ3Failure);
1533 #endif
1534 
1535 
1536 
1537 	// Call the bottleneck
1538 	E3System_Bottleneck();
1539 
1540 
1541 
1542 	// Call our implementation
1543 	return(E3XDrawContext_GetVisual(drawContext, visual));
1544 }
1545 
1546 
1547 
1548 
1549 
1550 //=============================================================================
1551 //      Q3XDrawContext_SetColormap : Quesa API entry point.
1552 //-----------------------------------------------------------------------------
1553 TQ3Status
Q3XDrawContext_SetColormap(TQ3DrawContextObject drawContext,Colormap colormap)1554 Q3XDrawContext_SetColormap(TQ3DrawContextObject drawContext, Colormap colormap)
1555 {
1556 
1557 
1558 	// Release build checks
1559 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1560 
1561 
1562 
1563 	// Debug build checks
1564 #if Q3_DEBUG
1565 	if (0) // Further checks on drawContext
1566 		return(kQ3Failure);
1567 
1568 	if (0) // Further checks on colormap
1569 		return(kQ3Failure);
1570 #endif
1571 
1572 
1573 
1574 	// Call the bottleneck
1575 	E3System_Bottleneck();
1576 
1577 
1578 
1579 	// Call our implementation
1580 	return(E3XDrawContext_SetColormap(drawContext, colormap));
1581 }
1582 
1583 
1584 
1585 
1586 
1587 //=============================================================================
1588 //      Q3XDrawContext_GetColormap : Quesa API entry point.
1589 //-----------------------------------------------------------------------------
1590 TQ3Status
Q3XDrawContext_GetColormap(TQ3DrawContextObject drawContext,Colormap * colormap)1591 Q3XDrawContext_GetColormap(TQ3DrawContextObject drawContext, Colormap *colormap)
1592 {
1593 
1594 
1595 	// Release build checks
1596 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1597 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(colormap), kQ3Failure);
1598 
1599 
1600 
1601 	// Debug build checks
1602 #if Q3_DEBUG
1603 	if (0) // Further checks on drawContext
1604 		return(kQ3Failure);
1605 
1606 	if (0) // Further checks on colormap
1607 		return(kQ3Failure);
1608 #endif
1609 
1610 
1611 
1612 	// Call the bottleneck
1613 	E3System_Bottleneck();
1614 
1615 
1616 
1617 	// Call our implementation
1618 	return(E3XDrawContext_GetColormap(drawContext, colormap));
1619 }
1620 
1621 
1622 
1623 
1624 
1625 //=============================================================================
1626 //      Q3XDrawContext_SetColormapData : Quesa API entry point.
1627 //-----------------------------------------------------------------------------
1628 TQ3Status
Q3XDrawContext_SetColormapData(TQ3DrawContextObject drawContext,const TQ3XColormapData * colormapData)1629 Q3XDrawContext_SetColormapData(TQ3DrawContextObject drawContext, const TQ3XColormapData *colormapData)
1630 {
1631 
1632 
1633 	// Release build checks
1634 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1635 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(colormapData), kQ3Failure);
1636 
1637 
1638 
1639 	// Debug build checks
1640 #if Q3_DEBUG
1641 	if (0) // Further checks on drawContext
1642 		return(kQ3Failure);
1643 
1644 	if (0) // Further checks on colormapData
1645 		return(kQ3Failure);
1646 #endif
1647 
1648 
1649 
1650 	// Call the bottleneck
1651 	E3System_Bottleneck();
1652 
1653 
1654 
1655 	// Call our implementation
1656 	return(E3XDrawContext_SetColormapData(drawContext, colormapData));
1657 }
1658 
1659 
1660 
1661 
1662 
1663 //=============================================================================
1664 //      Q3XDrawContext_GetColormapData : Quesa API entry point.
1665 //-----------------------------------------------------------------------------
1666 TQ3Status
Q3XDrawContext_GetColormapData(TQ3DrawContextObject drawContext,TQ3XColormapData * colormapData)1667 Q3XDrawContext_GetColormapData(TQ3DrawContextObject drawContext, TQ3XColormapData *colormapData)
1668 {
1669 
1670 
1671 	// Release build checks
1672 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1673 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(colormapData), kQ3Failure);
1674 
1675 
1676 
1677 	// Debug build checks
1678 #if Q3_DEBUG
1679 	if (0) // Further checks on drawContext
1680 		return(kQ3Failure);
1681 
1682 	if (0) // Further checks on colormapData
1683 		return(kQ3Failure);
1684 #endif
1685 
1686 
1687 
1688 	// Call the bottleneck
1689 	E3System_Bottleneck();
1690 
1691 
1692 
1693 	// Call our implementation
1694 	return(E3XDrawContext_GetColormapData(drawContext, colormapData));
1695 }
1696 #endif // QUESA_OS_UNIX
1697 
1698 
1699 
1700 
1701 
1702 //=============================================================================
1703 //      Q3Win32DCDrawContext_New : Quesa API entry point.
1704 //-----------------------------------------------------------------------------
1705 #pragma mark -
1706 #if QUESA_OS_WIN32
1707 TQ3DrawContextObject
Q3Win32DCDrawContext_New(const TQ3Win32DCDrawContextData * drawContextData)1708 Q3Win32DCDrawContext_New(const TQ3Win32DCDrawContextData *drawContextData)
1709 {
1710 
1711 
1712 	// Release build checks
1713 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
1714 
1715 
1716 
1717 	// Debug build checks
1718 #if Q3_DEBUG
1719 	if (0) // Further checks on drawContextData
1720 		return(NULL);
1721 #endif
1722 
1723 
1724 
1725 	// Call the bottleneck
1726 	E3System_Bottleneck();
1727 
1728 
1729 
1730 	// Call our implementation
1731 	return(E3Win32DCDrawContext_New(drawContextData));
1732 }
1733 
1734 
1735 
1736 
1737 
1738 //=============================================================================
1739 //      Q3Win32DCDrawContext_SetDC : Quesa API entry point.
1740 //-----------------------------------------------------------------------------
1741 TQ3Status
Q3Win32DCDrawContext_SetDC(TQ3DrawContextObject drawContext,HDC newHDC)1742 Q3Win32DCDrawContext_SetDC(TQ3DrawContextObject drawContext, HDC newHDC)
1743 {
1744 
1745 
1746 	// Release build checks
1747 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1748 
1749 
1750 
1751 	// Debug build checks
1752 #if Q3_DEBUG
1753 	if (0) // Further checks on drawContext
1754 		return(kQ3Failure);
1755 
1756 	if (0) // Further checks on newHDC
1757 		return(kQ3Failure);
1758 #endif
1759 
1760 
1761 
1762 	// Call the bottleneck
1763 	E3System_Bottleneck();
1764 
1765 
1766 
1767 	// Call our implementation
1768 	return(E3Win32DCDrawContext_SetDC(drawContext, newHDC));
1769 }
1770 
1771 
1772 
1773 
1774 
1775 //=============================================================================
1776 //      Q3Win32DCDrawContext_GetDC : Quesa API entry point.
1777 //-----------------------------------------------------------------------------
1778 TQ3Status
Q3Win32DCDrawContext_GetDC(TQ3DrawContextObject drawContext,HDC * curHDC)1779 Q3Win32DCDrawContext_GetDC(TQ3DrawContextObject drawContext, HDC *curHDC)
1780 {
1781 
1782 
1783 	// Release build checks
1784 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1785 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(curHDC), kQ3Failure);
1786 
1787 
1788 
1789 	// Debug build checks
1790 #if Q3_DEBUG
1791 	if (0) // Further checks on drawContext
1792 		return(kQ3Failure);
1793 
1794 	if (0) // Further checks on curHDC
1795 		return(kQ3Failure);
1796 #endif
1797 
1798 
1799 
1800 	// Call the bottleneck
1801 	E3System_Bottleneck();
1802 
1803 
1804 
1805 	// Call our implementation
1806 	return(E3Win32DCDrawContext_GetDC(drawContext, curHDC));
1807 }
1808 
1809 
1810 
1811 
1812 #if !defined(QD3D_NO_DIRECTDRAW)
1813 
1814 //=============================================================================
1815 //      Q3DDSurfaceDrawContext_New : Quesa API entry point.
1816 //-----------------------------------------------------------------------------
1817 TQ3DrawContextObject
Q3DDSurfaceDrawContext_New(const TQ3DDSurfaceDrawContextData * drawContextData)1818 Q3DDSurfaceDrawContext_New(const TQ3DDSurfaceDrawContextData *drawContextData)
1819 {
1820 
1821 
1822 	// Release build checks
1823 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
1824 
1825 
1826 
1827 	// Debug build checks
1828 #if Q3_DEBUG
1829 	if (0) // Further checks on drawContextData
1830 		return(NULL);
1831 #endif
1832 
1833 
1834 
1835 	// Call the bottleneck
1836 	E3System_Bottleneck();
1837 
1838 
1839 
1840 	// Call our implementation
1841 	return(E3DDSurfaceDrawContext_New(drawContextData));
1842 }
1843 
1844 
1845 
1846 
1847 
1848 //=============================================================================
1849 //      Q3DDSurfaceDrawContext_SetDirectDrawSurface : Quesa API entry point.
1850 //-----------------------------------------------------------------------------
1851 TQ3Status
Q3DDSurfaceDrawContext_SetDirectDrawSurface(TQ3DrawContextObject drawContext,const TQ3DDSurfaceDescriptor * ddSurfaceDescriptor)1852 Q3DDSurfaceDrawContext_SetDirectDrawSurface(TQ3DrawContextObject drawContext, const TQ3DDSurfaceDescriptor *ddSurfaceDescriptor)
1853 {
1854 
1855 
1856 	// Release build checks
1857 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1858 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(ddSurfaceDescriptor), kQ3Failure);
1859 
1860 
1861 
1862 	// Debug build checks
1863 #if Q3_DEBUG
1864 	if (0) // Further checks on drawContext
1865 		return(kQ3Failure);
1866 
1867 	if (0) // Further checks on ddSurfaceDescriptor
1868 		return(kQ3Failure);
1869 #endif
1870 
1871 
1872 
1873 	// Call the bottleneck
1874 	E3System_Bottleneck();
1875 
1876 
1877 
1878 	// Call our implementation
1879 	return(E3DDSurfaceDrawContext_SetDirectDrawSurface(drawContext, ddSurfaceDescriptor));
1880 }
1881 
1882 
1883 
1884 
1885 
1886 //=============================================================================
1887 //      Q3DDSurfaceDrawContext_GetDirectDrawSurface : Quesa API entry point.
1888 //-----------------------------------------------------------------------------
1889 TQ3Status
Q3DDSurfaceDrawContext_GetDirectDrawSurface(TQ3DrawContextObject drawContext,TQ3DDSurfaceDescriptor * ddSurfaceDescriptor)1890 Q3DDSurfaceDrawContext_GetDirectDrawSurface(TQ3DrawContextObject drawContext, TQ3DDSurfaceDescriptor *ddSurfaceDescriptor)
1891 {
1892 
1893 
1894 	// Release build checks
1895 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1896 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(ddSurfaceDescriptor), kQ3Failure);
1897 
1898 
1899 
1900 	// Debug build checks
1901 #if Q3_DEBUG
1902 	if (0) // Further checks on drawContext
1903 		return(kQ3Failure);
1904 
1905 	if (0) // Further checks on ddSurfaceDescriptor
1906 		return(kQ3Failure);
1907 #endif
1908 
1909 
1910 
1911 	// Call the bottleneck
1912 	E3System_Bottleneck();
1913 
1914 
1915 
1916 	// Call our implementation
1917 	return(E3DDSurfaceDrawContext_GetDirectDrawSurface(drawContext, ddSurfaceDescriptor));
1918 }
1919 #endif // QD3D_NO_DIRECTDRAW
1920 #endif // QUESA_OS_WIN32
1921 
1922 
1923 
1924 
1925 
1926 //=============================================================================
1927 //      Q3BeDrawContext_New : Quesa API entry point.
1928 //-----------------------------------------------------------------------------
1929 #pragma mark -
1930 #if QUESA_OS_BE
1931 TQ3DrawContextObject
Q3BeDrawContext_New(const TQ3BeDrawContextData * drawContextData)1932 Q3BeDrawContext_New(const TQ3BeDrawContextData *drawContextData)
1933 {
1934 
1935 
1936 	// Release build checks
1937 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
1938 
1939 
1940 
1941 	// Debug build checks
1942 #if Q3_DEBUG
1943 	if (0) // Further checks on drawContextData
1944 		return(NULL);
1945 #endif
1946 
1947 
1948 
1949 	// Call the bottleneck
1950 	E3System_Bottleneck();
1951 
1952 
1953 
1954 	// Call our implementation
1955 	return(E3BeDrawContext_New(drawContextData));
1956 }
1957 
1958 
1959 
1960 
1961 
1962 //=============================================================================
1963 //      Q3BeDrawContext_SetView : Quesa API entry point.
1964 //-----------------------------------------------------------------------------
1965 TQ3Status
Q3BeDrawContext_SetView(TQ3DrawContextObject drawContext,BView * theView)1966 Q3BeDrawContext_SetView(TQ3DrawContextObject drawContext, BView *theView)
1967 {
1968 
1969 
1970 	// Release build checks
1971 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
1972 
1973 
1974 
1975 	// Debug build checks
1976 #if Q3_DEBUG
1977 	if (0) // Further checks on drawContext
1978 		return(kQ3Failure);
1979 
1980 	if (0) // Further checks on theView
1981 		return(kQ3Failure);
1982 #endif
1983 
1984 
1985 
1986 	// Call the bottleneck
1987 	E3System_Bottleneck();
1988 
1989 
1990 
1991 	// Call our implementation
1992 	return(E3BeDrawContext_SetView(drawContext, theView));
1993 }
1994 
1995 
1996 
1997 
1998 
1999 //=============================================================================
2000 //      Q3BeDrawContext_GetView : Quesa API entry point.
2001 //-----------------------------------------------------------------------------
2002 TQ3Status
Q3BeDrawContext_GetView(TQ3DrawContextObject drawContext,BView ** theView)2003 Q3BeDrawContext_GetView(TQ3DrawContextObject drawContext, BView **theView)
2004 {
2005 
2006 
2007 	// Release build checks
2008 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
2009 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(theView), kQ3Failure);
2010 
2011 
2012 
2013 	// Debug build checks
2014 #if Q3_DEBUG
2015 	if (0) // Further checks on drawContext
2016 		return(kQ3Failure);
2017 
2018 	if (0) // Further checks on theView
2019 		return(kQ3Failure);
2020 #endif
2021 
2022 
2023 
2024 	// Call the bottleneck
2025 	E3System_Bottleneck();
2026 
2027 
2028 
2029 	// Call our implementation
2030 	return(E3BeDrawContext_GetView(drawContext, theView));
2031 }
2032 #endif // QUESA_OS_BE
2033 
2034 
2035 
2036 
2037 
2038 //=============================================================================
2039 //      Q3CocoaDrawContext_New : Quesa API entry point.
2040 //-----------------------------------------------------------------------------
2041 #pragma mark -
2042 #if QUESA_OS_COCOA
2043 TQ3DrawContextObject
Q3CocoaDrawContext_New(const TQ3CocoaDrawContextData * drawContextData)2044 Q3CocoaDrawContext_New(const TQ3CocoaDrawContextData *drawContextData)
2045 {
2046 
2047 
2048 	// Release build checks
2049 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(drawContextData), NULL);
2050 
2051 
2052 
2053 	// Debug build checks
2054 #if Q3_DEBUG
2055 	if (0) // Further checks on drawContextData
2056 		return(NULL);
2057 #endif
2058 
2059 
2060 
2061 	// Call the bottleneck
2062 	E3System_Bottleneck();
2063 
2064 
2065 
2066 	// Call our implementation
2067 	return(E3CocoaDrawContext_New(drawContextData));
2068 }
2069 
2070 
2071 
2072 
2073 
2074 //=============================================================================
2075 //      Q3CocoaDrawContext_SetNSView : Quesa API entry point.
2076 //-----------------------------------------------------------------------------
2077 TQ3Status
Q3CocoaDrawContext_SetNSView(TQ3DrawContextObject drawContext,void * nsView)2078 Q3CocoaDrawContext_SetNSView(TQ3DrawContextObject drawContext, void *nsView)
2079 {
2080 
2081 
2082 	// Release build checks
2083 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
2084 
2085 
2086 
2087 	// Debug build checks
2088 #if Q3_DEBUG
2089 	if (0) // Further checks on drawContext
2090 		return(kQ3Failure);
2091 
2092 	if (0) // Further checks on nsView
2093 		return(kQ3Failure);
2094 #endif
2095 
2096 
2097 
2098 	// Call the bottleneck
2099 	E3System_Bottleneck();
2100 
2101 
2102 
2103 	// Call our implementation
2104 	return(E3CocoaDrawContext_SetNSView(drawContext, nsView));
2105 }
2106 
2107 
2108 
2109 
2110 
2111 //=============================================================================
2112 //      Q3CocoaDrawContext_GetNSView : Quesa API entry point.
2113 //-----------------------------------------------------------------------------
2114 TQ3Status
Q3CocoaDrawContext_GetNSView(TQ3DrawContextObject drawContext,void ** nsView)2115 Q3CocoaDrawContext_GetNSView(TQ3DrawContextObject drawContext, void **nsView)
2116 {
2117 
2118 
2119 	// Release build checks
2120 	Q3_REQUIRE_OR_RESULT( E3DrawContext_IsOfMyClass ( drawContext ), kQ3Failure ) ;
2121 	Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(nsView), kQ3Failure);
2122 
2123 
2124 
2125 	// Debug build checks
2126 #if Q3_DEBUG
2127 	if (0) // Further checks on drawContext
2128 		return(kQ3Failure);
2129 
2130 	if (0) // Further checks on nsView
2131 		return(kQ3Failure);
2132 #endif
2133 
2134 
2135 
2136 	// Call the bottleneck
2137 	E3System_Bottleneck();
2138 
2139 
2140 
2141 	// Call our implementation
2142 	return(E3CocoaDrawContext_GetNSView(drawContext, nsView));
2143 }
2144 
2145 #endif // QUESA_OS_COCOA
2146 
2147 
2148