1: #include <X/mit-copyright.h> 2: 3: /* $Header: DisplaySize.c,v 10.3 86/02/01 15:29:08 tony Rel $ */ 4: /* Copyright Massachusetts Institute of Technology 1985 */ 5: 6: #include "XlibInternal.h" 7: 8: int DisplayWidth() 9: { 10: register Display *dpy = _XlibCurrentDisplay; 11: WindowInfo rootinfo; 12: if (dpy->width == 0 || dpy->height == 0) { 13: XQueryWindow(RootWindow, &rootinfo); 14: dpy->width = rootinfo.width; 15: dpy->height = rootinfo.height; 16: } 17: return (dpy->width); 18: } 19: 20: int DisplayHeight() 21: { 22: register Display *dpy = _XlibCurrentDisplay; 23: WindowInfo rootinfo; 24: if (dpy->width == 0 || dpy->height == 0) { 25: XQueryWindow(RootWindow, &rootinfo); 26: dpy->width = rootinfo.width; 27: dpy->height = rootinfo.height; 28: } 29: return (dpy->height); 30: }