rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / x11 / libdga / src / draw_inquiry.c
blobbbabe5f3601178485b9b18b028b2bbd0bb51d084
1 /* Copyright (c) 1993, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
12 * Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
24 /*
25 ** draw_inquiry.c - state inquiry routines for drawable veneer.
28 #ifdef SERVER_DGA
29 #include <X11/Xlib.h>
30 #endif /* SERVER_DGA */
31 #include "dga_incls.h"
33 extern int dgai_mbsmemb_devinfochg (_Dga_window dgawin);
34 extern int dgai_pix_devinfochg(_Dga_pixmap dgapix);
36 Display *
37 dga_draw_display (Dga_drawable dgadraw)
39 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
40 case DGA_DRAW_WINDOW:
41 return (dgai_mbsmemb_display((_Dga_window)dgadraw));
42 case DGA_DRAW_PIXMAP:
43 return (dgai_pix_display((_Dga_pixmap)dgadraw));
45 return (NULL);
48 Drawable
49 dga_draw_id (Dga_drawable dgadraw)
51 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
52 case DGA_DRAW_WINDOW:
53 return ((Drawable)((_Dga_window)dgadraw)->w_id);
54 case DGA_DRAW_PIXMAP:
55 return ((Drawable)((_Dga_pixmap)dgadraw)->p_id);
57 return (None);
60 int
61 dga_draw_type (Dga_drawable dgadraw)
63 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
64 case DGA_DRAW_WINDOW:
65 return ((((_Dga_window)dgadraw)->isOverlay)
66 ? (DGA_DRAW_OVERLAY)
67 : (DGA_DRAW_WINDOW));
68 case DGA_DRAW_PIXMAP:
69 return (DGA_DRAW_PIXMAP);
71 return (-1);
74 char *
75 dga_draw_devname (Dga_drawable dgadraw)
77 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
78 case DGA_DRAW_WINDOW:
79 return (dgai_mbsmemb_devname((_Dga_window)dgadraw));
80 case DGA_DRAW_PIXMAP:
81 return (dgai_pix_devname((_Dga_pixmap)dgadraw));
83 return (NULL);
86 int
87 dga_draw_devfd (Dga_drawable dgadraw)
89 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
90 case DGA_DRAW_WINDOW:
91 return (dgai_mbsmemb_devfd((_Dga_window)dgadraw));
92 case DGA_DRAW_PIXMAP:
93 return (dgai_pix_devfd((_Dga_pixmap)dgadraw));
95 return (-1);
98 int
99 dga_draw_depth (Dga_drawable dgadraw)
101 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
102 case DGA_DRAW_WINDOW:
103 return (dgai_mbsmemb_depth((_Dga_window)dgadraw));
104 case DGA_DRAW_PIXMAP:
105 return (dgai_pix_depth((_Dga_pixmap)dgadraw));
107 return (-1);
110 void
111 dga_draw_set_client_infop (Dga_drawable dgadraw, void *client_info_ptr)
113 #ifdef MT
114 mutex_lock(&dgaGlobalMutex);
115 #endif
116 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
117 case DGA_DRAW_WINDOW:
118 dgai_mbsmemb_set_client_infop((_Dga_window)dgadraw, client_info_ptr);
119 break;
120 case DGA_DRAW_PIXMAP:
121 dgai_pix_set_client_infop((_Dga_pixmap)dgadraw, client_info_ptr);
122 break;
124 #ifdef MT
125 mutex_unlock(&dgaGlobalMutex);
126 #endif
129 void *
130 dga_draw_get_client_infop (Dga_drawable dgadraw)
132 void *rval = NULL;
133 #ifdef MT
134 mutex_lock(&dgaGlobalMutex);
135 #endif
136 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
137 case DGA_DRAW_WINDOW:
138 rval = dgai_mbsmemb_get_client_infop((_Dga_window)dgadraw);
139 break;
140 case DGA_DRAW_PIXMAP:
141 rval = dgai_pix_get_client_infop((_Dga_pixmap)dgadraw);
142 break;
144 #ifdef MT
145 mutex_unlock(&dgaGlobalMutex);
146 #endif
147 return (rval);
151 dga_draw_devinfochg (Dga_drawable dgadraw)
153 int rval = -1;
155 #ifdef MT
156 mutex_lock(&dgaGlobalMutex);
157 #endif
158 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
159 case DGA_DRAW_WINDOW:
160 rval = dgai_mbsmemb_devinfochg((_Dga_window)dgadraw);
161 break;
162 case DGA_DRAW_PIXMAP:
163 rval = dgai_pix_devinfochg((_Dga_pixmap)dgadraw);
164 break;
166 #ifdef MT
167 mutex_unlock(&dgaGlobalMutex);
168 #endif
169 return (rval);
172 void *
173 dga_draw_devinfo (Dga_drawable dgadraw)
175 void *rval = NULL;
177 #ifdef MT
178 mutex_lock(&dgaGlobalMutex);
179 #endif
180 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
181 case DGA_DRAW_WINDOW:
182 rval = dgai_mbsmemb_devinfo((_Dga_window)dgadraw);
183 break;
184 case DGA_DRAW_PIXMAP:
185 rval = dgai_pix_devinfo((_Dga_pixmap)dgadraw);
186 break;
188 #ifdef MT
189 mutex_unlock(&dgaGlobalMutex);
190 #endif
191 return (rval);
195 dga_draw_sitechg (Dga_drawable dgadraw, int *reason)
197 int rval = -1;
199 #ifdef MT
200 mutex_lock(&dgaGlobalMutex);
201 #endif
202 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
203 case DGA_DRAW_WINDOW:
204 rval = dgai_mbsmemb_sitechg((_Dga_window)dgadraw, reason);
205 break;
206 case DGA_DRAW_PIXMAP:
207 rval = dgai_pix_sitechg((_Dga_pixmap)dgadraw, reason);
208 break;
210 #ifdef MT
211 mutex_unlock(&dgaGlobalMutex);
212 #endif
213 return (rval);
216 void
217 dga_draw_sitesetnotify (Dga_drawable dgadraw, DgaSiteNotifyFunc site_notify_func,
218 void *client_data)
220 #ifdef MT
221 mutex_lock(&dgaGlobalMutex);
222 #endif
223 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
224 case DGA_DRAW_WINDOW:
225 dgai_mbsmemb_sitesetnotify((_Dga_window)dgadraw, site_notify_func, client_data);
226 break;
227 case DGA_DRAW_PIXMAP:
228 dgai_pix_sitesetnotify((_Dga_pixmap)dgadraw, site_notify_func, client_data);
229 break;
231 #ifdef MT
232 mutex_unlock(&dgaGlobalMutex);
233 #endif
236 void
237 dga_draw_sitegetnotify (Dga_drawable dgadraw, DgaSiteNotifyFunc *site_notify_func,
238 void **client_data)
240 #ifdef MT
241 mutex_lock(&dgaGlobalMutex);
242 #endif
243 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
244 case DGA_DRAW_WINDOW:
245 dgai_mbsmemb_sitegetnotify((_Dga_window)dgadraw, site_notify_func, client_data);
246 break;
247 case DGA_DRAW_PIXMAP:
248 dgai_pix_sitegetnotify((_Dga_pixmap)dgadraw, site_notify_func, client_data);
249 break;
251 #ifdef MT
252 mutex_unlock(&dgaGlobalMutex);
253 #endif
257 dga_draw_site (Dga_drawable dgadraw)
259 int rval = -1;
261 #ifdef MT
262 mutex_lock(&dgaGlobalMutex);
263 #endif
264 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
265 case DGA_DRAW_WINDOW:
266 rval = dgai_mbsmemb_site((_Dga_window)dgadraw);
267 break;
268 case DGA_DRAW_PIXMAP:
269 rval = dgai_pix_site((_Dga_pixmap)dgadraw);
270 break;
272 #ifdef MT
273 mutex_unlock(&dgaGlobalMutex);
274 #endif
275 return (rval);
278 void *
279 dga_draw_address (Dga_drawable dgadraw)
281 void *rval = NULL;
283 #ifdef MT
284 mutex_lock(&dgaGlobalMutex);
285 #endif
286 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
287 case DGA_DRAW_WINDOW:
288 rval = dgai_mbsmemb_address((_Dga_window)dgadraw);
289 break;
290 case DGA_DRAW_PIXMAP:
291 rval = dgai_pix_address((_Dga_pixmap)dgadraw);
292 break;
294 #ifdef MT
295 mutex_unlock(&dgaGlobalMutex);
296 #endif
297 return (rval);
301 dga_draw_linebytes (Dga_drawable dgadraw)
303 int rval = -1;
305 #ifdef MT
306 mutex_lock(&dgaGlobalMutex);
307 #endif
308 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
309 case DGA_DRAW_WINDOW:
310 rval = dgai_mbsmemb_linebytes((_Dga_window)dgadraw);
311 break;
312 case DGA_DRAW_PIXMAP:
313 rval = dgai_pix_linebytes((_Dga_pixmap)dgadraw);
314 break;
316 #ifdef MT
317 mutex_unlock(&dgaGlobalMutex);
318 #endif
319 return (rval);
323 dga_draw_bitsperpixel (Dga_drawable dgadraw)
325 int rval = -1;
327 #ifdef MT
328 mutex_lock(&dgaGlobalMutex);
329 #endif
330 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
331 case DGA_DRAW_WINDOW:
332 rval = dgai_mbsmemb_bitsperpixel((_Dga_window)dgadraw);
333 break;
334 case DGA_DRAW_PIXMAP:
335 rval = dgai_pix_bitsperpixel((_Dga_pixmap)dgadraw);
336 break;
338 #ifdef MT
339 mutex_unlock(&dgaGlobalMutex);
340 #endif
341 return (rval);
345 dga_draw_clipchg (Dga_drawable dgadraw)
347 int rval = -1;
349 #ifdef MT
350 mutex_lock(&dgaGlobalMutex);
351 #endif
352 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
353 case DGA_DRAW_WINDOW:
354 rval = dgai_mbsmemb_clipchg((_Dga_window)dgadraw);
355 break;
356 case DGA_DRAW_PIXMAP:
357 rval = dgai_pix_clipchg((_Dga_pixmap)dgadraw);
358 break;
360 #ifdef MT
361 mutex_unlock(&dgaGlobalMutex);
362 #endif
363 return (rval);
366 void
367 dga_draw_bbox(Dga_drawable dgadraw, int *xp, int *yp, int *widthp, int *heightp)
369 #ifdef MT
370 mutex_lock(&dgaGlobalMutex);
371 #endif
372 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
373 case DGA_DRAW_WINDOW:
374 dgai_mbsmemb_bbox((_Dga_window)dgadraw, xp, yp, widthp, heightp);
375 break;
376 case DGA_DRAW_PIXMAP:
377 dgai_pix_bbox((_Dga_pixmap)dgadraw, xp, yp, widthp, heightp);
378 break;
380 #ifdef MT
381 mutex_unlock(&dgaGlobalMutex);
382 #endif
386 dga_draw_visibility (Dga_drawable dgadraw)
388 int rval = -1;
390 #ifdef MT
391 mutex_lock(&dgaGlobalMutex);
392 #endif
393 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
394 case DGA_DRAW_WINDOW:
395 rval = dgai_mbsmemb_visibility((_Dga_window)dgadraw);
396 break;
397 case DGA_DRAW_PIXMAP:
398 /* always unobscured */
399 rval = DGA_VIS_UNOBSCURED;
400 break;
402 #ifdef MT
403 mutex_unlock(&dgaGlobalMutex);
404 #endif
405 return (rval);
409 dga_draw_empty (Dga_drawable dgadraw)
411 int rval = -1;
413 #ifdef MT
414 mutex_lock(&dgaGlobalMutex);
415 #endif
416 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
417 case DGA_DRAW_WINDOW:
418 rval = dgai_mbsmemb_empty((_Dga_window)dgadraw);
419 break;
420 case DGA_DRAW_PIXMAP:
421 rval = dgai_pix_empty((_Dga_pixmap)dgadraw);
422 break;
424 #ifdef MT
425 mutex_unlock(&dgaGlobalMutex);
426 #endif
427 return (rval);
430 short *
431 dga_draw_clipinfo (Dga_drawable dgadraw)
433 short *rval = NULL;
435 #ifdef MT
436 mutex_lock(&dgaGlobalMutex);
437 #endif
438 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
439 case DGA_DRAW_WINDOW:
440 rval = dgai_mbsmemb_clipinfo((_Dga_window)dgadraw);
441 break;
442 case DGA_DRAW_PIXMAP:
443 rval = dgai_pix_clipinfo((_Dga_pixmap)dgadraw);
444 break;
446 #ifdef MT
447 mutex_unlock(&dgaGlobalMutex);
448 #endif
449 return (rval);
454 dga_draw_singlerect (Dga_drawable dgadraw)
456 int rval;
458 #ifdef MT
459 mutex_lock(&dgaGlobalMutex);
460 #endif
461 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
462 case DGA_DRAW_WINDOW:
463 rval = dgai_mbsmemb_singlerect((_Dga_window)dgadraw);
464 break;
465 case DGA_DRAW_PIXMAP:
466 default:
467 /* always a single rect */
468 rval = 1;
469 break;
471 #ifdef MT
472 mutex_unlock(&dgaGlobalMutex);
473 #endif
474 return (rval);
478 dga_draw_obscured (Dga_drawable dgadraw)
480 int rval;
482 #ifdef MT
483 mutex_lock(&dgaGlobalMutex);
484 #endif
485 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
486 case DGA_DRAW_WINDOW:
487 rval = dgai_mbsmemb_obscured((_Dga_window)dgadraw);
488 break;
489 case DGA_DRAW_PIXMAP:
490 default:
491 /* never obscured */
492 rval = 0;
493 break;
495 #ifdef MT
496 mutex_unlock(&dgaGlobalMutex);
497 #endif
498 return (rval);
502 /* CONSOLIDATION PRIVATE */
503 u_short
504 dga_draw_borderwidth (Dga_drawable dgadraw)
506 u_short rval;
508 #ifdef MT
509 mutex_lock(&dgaGlobalMutex);
510 #endif
511 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
512 case DGA_DRAW_WINDOW:
513 rval = dgai_mbsmemb_borderwidth((_Dga_window)dgadraw);
514 break;
515 case DGA_DRAW_PIXMAP:
516 default:
517 /* always 0 */
518 rval = 0;
519 break;
521 #ifdef MT
522 mutex_unlock(&dgaGlobalMutex);
523 #endif
524 return (rval);
528 void
529 dga_draw_curshandle (Dga_drawable dgadraw, DgaCursTakeDownFunc take_down_func,
530 void *client_data)
532 #ifdef MT
533 mutex_lock(&dgaGlobalMutex);
534 #endif
535 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
536 case DGA_DRAW_WINDOW:
537 dgai_mbsmemb_curshandle((_Dga_window)dgadraw, take_down_func, client_data);
538 break;
539 case DGA_DRAW_PIXMAP:
540 /* pixmaps never have cursors */
541 break;
543 #ifdef MT
544 mutex_unlock(&dgaGlobalMutex);
545 #endif
549 int
550 dga_draw_rtngrab (Dga_drawable dgadraw)
552 int rval;
554 #ifdef MT
555 mutex_lock(&dgaGlobalMutex);
556 #endif
557 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
558 case DGA_DRAW_WINDOW:
559 rval = dgai_mbsmemb_rtngrab((_Dga_window)dgadraw);
560 break;
561 case DGA_DRAW_PIXMAP:
562 default:
563 /* not applicable to pixmaps */
564 rval = 0;
565 break;
567 #ifdef MT
568 mutex_unlock(&dgaGlobalMutex);
569 #endif
570 return (rval);
573 int
574 dga_draw_rtnungrab (Dga_drawable dgadraw)
576 int rval;
578 #ifdef MT
579 mutex_lock(&dgaGlobalMutex);
580 #endif
581 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
582 case DGA_DRAW_WINDOW:
583 rval = dgai_mbsmemb_rtnungrab((_Dga_window)dgadraw);
584 break;
585 case DGA_DRAW_PIXMAP:
586 default:
587 /* not applicable to pixmaps */
588 rval = 0;
589 break;
591 #ifdef MT
592 mutex_unlock(&dgaGlobalMutex);
593 #endif
594 return (rval);
597 int
598 dga_draw_rtnchg (Dga_drawable dgadraw)
600 int rval;
602 #ifdef MT
603 mutex_lock(&dgaGlobalMutex);
604 #endif
605 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
606 case DGA_DRAW_WINDOW:
607 rval = dgai_mbsmemb_rtnchg((_Dga_window)dgadraw);
608 break;
609 case DGA_DRAW_PIXMAP:
610 default:
611 /* not applicable to pixmaps -- force a query for active */
612 rval = 1;
613 break;
615 #ifdef MT
616 mutex_unlock(&dgaGlobalMutex);
617 #endif
618 return (rval);
621 int
622 dga_draw_rtnactive (Dga_drawable dgadraw)
624 int rval;
626 #ifdef MT
627 mutex_lock(&dgaGlobalMutex);
628 #endif
629 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
630 case DGA_DRAW_WINDOW:
631 rval = dgai_mbsmemb_rtnactive((_Dga_window)dgadraw);
632 break;
633 case DGA_DRAW_PIXMAP:
634 default:
635 /* not applicable to pixmaps -- never active */
636 rval = 0;
637 break;
639 #ifdef MT
640 mutex_unlock(&dgaGlobalMutex);
641 #endif
642 return (rval);
645 int
646 dga_draw_rtncached (Dga_drawable dgadraw)
648 int rval;
650 #ifdef MT
651 mutex_lock(&dgaGlobalMutex);
652 #endif
653 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
654 case DGA_DRAW_WINDOW:
655 rval = dgai_mbsmemb_rtncached((_Dga_window)dgadraw);
656 break;
657 case DGA_DRAW_PIXMAP:
658 default:
659 /* not applicable to pixmaps -- consider never cached */
660 rval = 0;
661 break;
663 #ifdef MT
664 mutex_unlock(&dgaGlobalMutex);
665 #endif
666 return (rval);
669 void *
670 dga_draw_rtndevinfop (Dga_drawable dgadraw)
672 void *rval;
674 #ifdef MT
675 mutex_lock(&dgaGlobalMutex);
676 #endif
677 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
678 case DGA_DRAW_WINDOW:
679 rval = dgai_mbsmemb_rtndevinfop((_Dga_window)dgadraw);
680 break;
681 case DGA_DRAW_PIXMAP:
682 default:
683 /* not applicable to pixmaps -- doesn't have devinfo */
684 rval = NULL;
685 break;
687 #ifdef MT
688 mutex_unlock(&dgaGlobalMutex);
689 #endif
690 return (rval);
693 /* This routine is for compatibility only. In the old interface both
694 * the "p" and the "non-p" version were in but the "p" version was the
695 * one that was documented. */
696 void *
697 dga_draw_rtndevinfo (Dga_drawable dgadraw)
699 return(dga_draw_rtndevinfop (dgadraw));
702 void
703 dga_draw_rtndevtype (Dga_drawable dgadraw, u_char *type,
704 char **name)
706 #ifdef MT
707 mutex_lock(&dgaGlobalMutex);
708 #endif
709 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
710 case DGA_DRAW_WINDOW:
711 dgai_mbsmemb_rtndevtype((_Dga_window)dgadraw, type, name);
712 break;
713 case DGA_DRAW_PIXMAP:
714 default:
715 /* not applicable to pixmaps -- no dev type and name */
716 *type = (u_char) 0;
717 *name = NULL;
718 break;
720 #ifdef MT
721 mutex_unlock(&dgaGlobalMutex);
722 #endif
725 void
726 dga_draw_rtndimensions (Dga_drawable dgadraw, short *width,
727 short *height, u_int *linebytes)
729 #ifdef MT
730 mutex_lock(&dgaGlobalMutex);
731 #endif
732 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
733 case DGA_DRAW_WINDOW:
734 dgai_mbsmemb_rtndimensions((_Dga_window)dgadraw, width, height, linebytes);
735 break;
736 case DGA_DRAW_PIXMAP:
737 default:
738 /* not applicable to pixmaps -- no dimensions */
739 *width = 0;
740 *height = 0;
741 *linebytes = 0;
742 break;
744 #ifdef MT
745 mutex_unlock(&dgaGlobalMutex);
746 #endif
750 dga_draw_rtnbitsperpixel (Dga_drawable dgadraw)
752 int rval;
754 #ifdef MT
755 mutex_lock(&dgaGlobalMutex);
756 #endif
757 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
758 case DGA_DRAW_WINDOW:
759 rval = dgai_mbsmemb_rtnbitsperpixel((_Dga_window)dgadraw);
760 break;
761 case DGA_DRAW_PIXMAP:
762 default:
763 /* not applicable to pixmaps */
764 rval = 0;
765 break;
767 #ifdef MT
768 mutex_unlock(&dgaGlobalMutex);
769 #endif
770 return (rval);
773 void *
774 dga_draw_rtnpixels (Dga_drawable dgadraw)
776 void *rval;
778 #ifdef MT
779 mutex_lock(&dgaGlobalMutex);
780 #endif
781 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
782 case DGA_DRAW_WINDOW:
783 rval = dgai_mbsmemb_rtnpixels((_Dga_window)dgadraw);
784 break;
785 case DGA_DRAW_PIXMAP:
786 default:
787 /* not applicable to pixmaps -- doesn't have retained pixels */
788 rval = NULL;
789 break;
791 #ifdef MT
792 mutex_unlock(&dgaGlobalMutex);
793 #endif
794 return (rval);
797 Dga_widinfo *
798 dga_draw_widinfop (Dga_drawable dgadraw)
800 Dga_widinfo *rval;
802 #ifdef MT
803 mutex_lock(&dgaGlobalMutex);
804 #endif
805 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
806 case DGA_DRAW_WINDOW:
807 rval = dga_win_widinfop((Dga_window)dgadraw);
808 break;
809 case DGA_DRAW_PIXMAP:
810 default:
811 /* not applicable to pixmaps -- doesn't have retained pixels */
812 rval = NULL;
813 break;
815 #ifdef MT
816 mutex_unlock(&dgaGlobalMutex);
817 #endif
818 return (rval);
822 /* Note: the following routines are consolidation private. They are not
823 a part of the public interface. */
826 dga_draw_mbchg (Dga_drawable dgadraw, int *reason)
828 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
829 case DGA_DRAW_WINDOW:
830 return (dgai_mbsmemb_mbchg((_Dga_window)dgadraw, reason));
831 case DGA_DRAW_PIXMAP:
832 default:
833 /* pixmaps never are multibuffered */
834 return (0);
838 void
839 dga_draw_mbsetnotify (Dga_drawable dgadraw, DgaMbNotifyFunc mb_notify_func,
840 void *client_data)
842 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
843 case DGA_DRAW_WINDOW:
844 dgai_mbsmemb_mbsetnotify((_Dga_window)dgadraw, mb_notify_func, client_data);
845 break;
846 case DGA_DRAW_PIXMAP:
847 /* pixmaps never are multibuffered */
848 break;
852 void
853 dga_draw_mbgetnotify (Dga_drawable dgadraw, DgaMbNotifyFunc *mb_notify_func,
854 void **client_data)
856 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
857 case DGA_DRAW_WINDOW:
858 dgai_mbsmemb_mbgetnotify((_Dga_window)dgadraw, mb_notify_func, client_data);
859 break;
860 case DGA_DRAW_PIXMAP:
861 /* pixmaps never are multibuffered */
862 break;
868 dga_draw_mbaccessmode (Dga_drawable dgadraw)
870 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
871 case DGA_DRAW_WINDOW:
872 return (dgai_mbsmemb_mbaccessmode((_Dga_window)dgadraw));
873 case DGA_DRAW_PIXMAP:
874 default:
875 return (DGA_MBACCESS_NONE);
880 dga_draw_mbsitetypeconst (Dga_drawable dgadraw)
882 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
883 case DGA_DRAW_WINDOW:
884 return (dgai_mbsmemb_mbsitetypeconst((_Dga_window)dgadraw));
885 case DGA_DRAW_PIXMAP:
886 default:
887 /* can't tell for pixmaps - be conservative */
888 return (0);
892 void
893 dga_draw_mbsetrendbufnotify (Dga_drawable dgadraw, DgaRendBufNotifyFunc rb_notify_func,
894 void *client_data)
896 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
897 case DGA_DRAW_WINDOW:
898 dgai_mbsmemb_mbsetrendbufnotify((_Dga_window)dgadraw, rb_notify_func, client_data);
899 break;
900 case DGA_DRAW_PIXMAP:
901 /* pixmaps never are multibuffered */
902 break;
906 void
907 dga_draw_mbgetrendbufnotify (Dga_drawable dgadraw, DgaRendBufNotifyFunc *rb_notify_func,
908 void **client_data)
910 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
911 case DGA_DRAW_WINDOW:
912 dgai_mbsmemb_mbgetrendbufnotify((_Dga_window)dgadraw, rb_notify_func, client_data);
913 break;
914 case DGA_DRAW_PIXMAP:
915 /* pixmaps never are multibuffered */
916 break;
922 dga_draw_ovlstatechg (Dga_drawable dgadraw)
924 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
925 case DGA_DRAW_WINDOW:
926 return (dgai_mbsmemb_ovlstatechg((_Dga_window)dgadraw));
927 case DGA_DRAW_PIXMAP:
928 default:
929 /* Pixmaps never have an ovlstate */
930 return (0);
935 dga_draw_ovlstate (Dga_drawable dgadraw)
937 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
938 case DGA_DRAW_WINDOW:
939 return (dgai_mbsmemb_ovlstate((_Dga_window)dgadraw));
940 case DGA_DRAW_PIXMAP:
941 default:
942 /* Pixmaps never have an ovlstate */
943 return (DGA_OVLSTATE_CONFLICT);
947 void
948 dga_draw_ovlstatesetnotify (Dga_drawable dgadraw,
949 DgaOvlStateNotifyFunc ovlstate_notify_func,
950 void *client_data)
952 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
953 case DGA_DRAW_WINDOW:
954 dgai_mbsmemb_setovlstatenotify((_Dga_window)dgadraw,
955 ovlstate_notify_func,
956 client_data);
957 case DGA_DRAW_PIXMAP:
958 /* Pixmaps never have an ovlstate */
959 break;
963 void
964 dga_draw_ovlstategetnotify (Dga_drawable dgadraw,
965 DgaOvlStateNotifyFunc *ovlstate_notify_func,
966 void **client_data)
968 switch ( ((_Dga_drawable)dgadraw)->drawable_type) {
969 case DGA_DRAW_WINDOW:
970 dgai_mbsmemb_getovlstatenotify((_Dga_window)dgadraw,
971 ovlstate_notify_func,
972 client_data);
973 case DGA_DRAW_PIXMAP:
974 /* Pixmaps never have an ovlstate */
975 break;