7fd59977 |
1 | |
2 | #include <Xw_Extension.h> |
3 | |
4 | /* ifdef then trace on */ |
5 | #ifdef TRACE |
6 | #define TRACE_GET_DISPLAY_INFO |
7 | #endif |
8 | |
9 | /* |
10 | XW_STATUS Xw_get_display_info (adisplay,display,root,colormap,tclass,depth): |
11 | XW_EXT_DISPLAY *adisplay Extended Display structure |
12 | Aspect_Handle **display Display XID |
13 | Aspect_Handle *root Root XID |
14 | Aspect_Handle *colormap Default Colormap XID |
15 | Xw_TypeOfVisual *tclass Default Visual Class |
16 | int *depth Default Depth |
17 | |
18 | Returns the X display attributes of a connexion |
19 | |
20 | returns XW_ERROR if something is wrong |
21 | returns XW_SUCCESS else |
22 | |
23 | */ |
24 | |
25 | #ifdef XW_PROTOTYPE |
26 | XW_STATUS Xw_get_display_info (void *adisplay,Aspect_Handle **display,Aspect_Handle *root,Aspect_Handle *colormap,Xw_TypeOfVisual *tclass,int *depth) |
27 | #else |
28 | XW_STATUS Xw_get_display_info (adisplay,display,root,colormap,tclass,depth) |
29 | void *adisplay ; |
30 | Aspect_Handle **display; |
31 | Aspect_Handle *root; |
32 | Aspect_Handle *colormap; |
33 | Xw_TypeOfVisual *tclass; |
34 | int *depth ; |
35 | #endif /*XW_PROTOTYPE*/ |
36 | { |
37 | XW_EXT_DISPLAY *pdisplay = (XW_EXT_DISPLAY*)adisplay ; |
38 | |
39 | if( !Xw_isdefine_display(pdisplay) ) { |
40 | /*ERROR*Bad EXT_DISPLAY Address*/ |
41 | Xw_set_error(96,"Xw_get_display_info",pdisplay) ; |
42 | return (XW_ERROR) ; |
43 | } |
44 | |
45 | *display = (Aspect_Handle*) _DDISPLAY ; |
46 | *root = _DROOT ; |
47 | *tclass = (Xw_TypeOfVisual) _DCLASS ; |
48 | *colormap = _DCOLORMAP ; |
49 | *depth = DefaultDepthOfScreen(_DSCREEN) ; |
50 | |
51 | #ifdef TRACE_GET_DISPLAY_INFO |
52 | if( Xw_get_trace() > 1 ) { |
53 | printf (" Xw_get_display_info(%lx,%lx,%lx,%lx,%d,%d)\n", |
54 | (long ) adisplay,(long ) *display,*root,*colormap,*tclass,*depth) ; |
55 | } |
56 | #endif |
57 | |
58 | return (XW_SUCCESS) ; |
59 | } |