home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
GETGEOM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-20
|
1KB
|
47 lines
/* $Id: getgeom.c 1.1 1994/02/20 17:24:11 ulrich Exp $ */
/*
* X library function XGetGeometry.
*/
#include "Xlibemu.h"
Status
XGetGeometry (Display* dpy,
Drawable d,
Window* root_return,
int* x_return,
int* y_return,
unsigned int* width_return,
unsigned int* height_return,
unsigned int* border_width_return,
unsigned int* depth_return)
{
Window w;
switch (d->type) {
case 2:
w = (Window) d;
if (0 == _WCheckWindow (dpy, w, X_GetGeometry))
return 0;
*root_return = DefaultRootWindow (dpy);
*x_return = w->x;
*y_return = w->y;
*width_return = w->width;
*height_return = w->height;
*border_width_return = w->border_width;
*depth_return = w->depth;
return 1;
case 0:
case 1:
case 3:
*root_return = DefaultRootWindow (dpy);
*x_return = 0;
*y_return = 0;
*width_return = ((Pixmap) d)->width;
*height_return = ((Pixmap) d)->height;
*border_width_return = 0;
*depth_return = (d->type == 0) ? 1 : DefaultDepth (dpy, DefaultScreen (dpy));
return 1;
}
return 0;
}