home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
WINDOW.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-20
|
2KB
|
74 lines
/* $Id: window.c 1.3 1994/02/20 18:01:05 ulrich Exp $ */
/*
* X library function XCreateWindow.
*/
#include "Xlibemu.h"
Window
XCreateWindow (Display* dpy,
Window parent,
int x,
int y,
unsigned int width,
unsigned int height,
unsigned int border_width,
int depth,
unsigned int class,
Visual* visual,
unsigned long valuemask,
XSetWindowAttributes* attributes)
{
Window window;
XEvent xe;
if (dpy == None) return None;
if (parent == None) {
parent = DefaultRootWindow (dpy);
}
window = (Window) Xcalloc (1, sizeof (*window));
if (window == None) {
return None;
}
window->type = 2; /* 0 = bitmap, 1 = pixmap */
window->parent = parent;
window->x = x;
window->y = y;
window->width = width;
window->height = height;
window->border_width = border_width;
window->depth = (depth == CopyFromParent) ? parent->depth : depth;
window->class = (class == CopyFromParent) ? parent->class : class;
window->visual = (visual == CopyFromParent) ? parent->visual : visual;
window->visible_region = XCreateRegion();
_WTreeInsertTop (parent, window);
/* Needs parent, x, y, width, height and border_width initialized */
_WNewWindowContext (window);
/* Set default functions for border and background */
window->border.fillBox = _WDummyFilledBox;
window->background.fillBox = _WDummyFilledBox;
XChangeWindowAttributes (dpy, window, valuemask, attributes);
if (window->parent &&
window->parent->event_mask & SubstructureNotifyMask) {
xe.xcreatewindow.type = CreateNotify;
xe.xcreatewindow.send_event = 0;
xe.xcreatewindow.display = dpy;
xe.xcreatewindow.parent = parent;
xe.xcreatewindow.window = window;
xe.xcreatewindow.x = x;
xe.xcreatewindow.y = y;
xe.xcreatewindow.width = width;
xe.xcreatewindow.height = height;
xe.xcreatewindow.border_width = border_width;
xe.xcreatewindow.override_redirect = window->override_redirect;
_WDispatchEvent (&xe);
}
return window;
}