7fd59977 |
1 | |
2 | #include <Xw_Extension.h> |
3 | |
4 | /* ifdef then trace on */ |
5 | #ifdef TRACE |
6 | #define TRACE_GET_SCREEN_SIZE |
7 | #define TRACE_GET_MMSCREEN_SIZE |
8 | #endif |
9 | |
10 | /* |
11 | XW_STATUS Xw_get_screen_size (adisplay,width,height): |
12 | XW_EXT_DISPLAY *adisplay |
13 | int *width |
14 | int *depth |
15 | |
16 | Get Screen Width and Height in Pixels |
17 | |
18 | Returns XW_ERROR if Ext_Display address is wrong |
19 | Returns XW_SUCCESS always |
20 | |
21 | XW_STATUS Xw_get_mmscreen_size (adisplay,width,height): |
22 | XW_EXT_DISPLAY *adisplay |
23 | int *width |
24 | int *depth |
25 | |
26 | Get Screen Width and Height in Millimeters |
27 | |
28 | Returns XW_ERROR if Ext_Display address is wrong |
29 | Returns XW_SUCCESS always |
30 | |
31 | */ |
32 | |
33 | #ifdef XW_PROTOTYPE |
34 | XW_STATUS Xw_get_screen_size (void *adisplay,int *width,int *height) |
35 | #else |
36 | XW_STATUS Xw_get_screen_size (adisplay,width,height) |
37 | void *adisplay; |
38 | int *width ; |
39 | int *height ; |
40 | #endif /*XW_PROTOTYPE*/ |
41 | { |
42 | XW_EXT_DISPLAY *pdisplay = (XW_EXT_DISPLAY*)adisplay; |
43 | |
44 | if( !Xw_isdefine_display(pdisplay) ) { |
45 | /*ERROR*Bad EXT_DISPLAY Address*/ |
46 | Xw_set_error(96,"Xw_get_screen_size",pdisplay) ; |
47 | return (XW_ERROR) ; |
48 | } |
49 | |
50 | *width = _DWIDTH ; |
51 | *height = _DHEIGHT ; |
52 | |
53 | |
54 | #ifdef TRACE_GET_SCREEN_SIZE |
55 | if( Xw_get_trace() ) { |
56 | printf (" Xw_get_screen_size(%lx,%d,%d)\n",(long ) pdisplay,*width,*height) ; |
57 | } |
58 | #endif |
59 | |
60 | return (XW_SUCCESS); |
61 | } |
62 | |
63 | #ifdef XW_PROTOTYPE |
64 | XW_STATUS Xw_get_mmscreen_size (void *adisplay,float *width,float *height) |
65 | #else |
66 | XW_STATUS Xw_get_mmscreen_size (adisplay,width,height) |
67 | void *adisplay; |
68 | float *width ; |
69 | float *height ; |
70 | #endif /*XW_PROTOTYPE*/ |
71 | { |
72 | XW_EXT_DISPLAY *pdisplay = (XW_EXT_DISPLAY*)adisplay; |
73 | |
74 | if( !Xw_isdefine_display(pdisplay) ) { |
75 | /*ERROR*Bad EXT_DISPLAY Address*/ |
76 | Xw_set_error(96,"Xw_get_mmscreen_size",pdisplay) ; |
77 | return (XW_ERROR) ; |
78 | } |
79 | |
80 | *width = WidthMMOfScreen(_DSCREEN) ; |
81 | *height = HeightMMOfScreen(_DSCREEN) ; |
82 | |
83 | #ifdef TRACE_GET_SCREEN_SIZE |
84 | if( Xw_get_trace() ) { |
85 | printf (" Xw_get_mmscreen_size(%lx,%f,%f)\n",(long ) pdisplay,*width,*height) ; |
86 | } |
87 | #endif |
88 | |
89 | return (XW_SUCCESS); |
90 | } |