home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1999 March
/
PCShareware-3-99.iso
/
IMPLE
/
DJGPP.RAR
/
DJGPP2
/
XLIB-SR0.ZIP
/
SRC
/
XLIBEMU
/
CHWATTR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-20
|
3KB
|
99 lines
/* $Id: chwattr.c 1.2 1994/02/20 19:59:19 ulrich Exp $ */
/*
* X library function XChangeWindowAttributes.
*/
#include "Xlibemu.h"
extern _WContextFilledBox ();
int
XChangeWindowAttributes (Display* dpy,
Window window,
unsigned long valuemask,
XSetWindowAttributes* attributes)
{
int redraw_border;
if (0 == _WCheckWindow (dpy, window, X_ChangeWindowAttributes))
return 0;
redraw_border = False;
if (valuemask & CWBackPixmap) {
window->background.fillArg = (long) None;
window->background.fillBox = _WDummyFilledBox;
if (attributes->background_pixmap != None) {
if (attributes->background_pixmap->pattern != NULL) {
window->background.fillArg = (long) attributes->background_pixmap->pattern;
if (attributes->background_pixmap->type == 0) {
GrPattern *bmp = attributes->background_pixmap->pattern;
window->background.fillArg = (long)
GrBuildPixmapFromBits (bmp->gp_bmp_data + bmp->gp_bmp_height,
attributes->background_pixmap->width,
attributes->background_pixmap->height,
bmp->gp_bmp_fgcolor,
bmp->gp_bmp_bgcolor);
}
window->background.fillBox = GrPatternFilledBox;
}
else if (attributes->background_pixmap->context != NULL) {
window->background.fillArg = (long) attributes->background_pixmap->context;
window->background.fillBox = _WContextFilledBox;
}
}
}
if (valuemask & CWBackPixel) {
window->background.fillArg = attributes->background_pixel;
window->background.fillBox = GrFilledBox;
}
if (valuemask & CWBorderPixmap) {
window->border.fillArg = (long) attributes->border_pixmap->pattern;
window->border.fillBox = (window->border.fillArg != None)
? GrPatternFilledBox : _WDummyFilledBox;
redraw_border = True;
}
if (valuemask & CWBorderPixel) {
window->border.fillArg = attributes->border_pixel;
window->border.fillBox = GrFilledBox;
redraw_border = True;
}
if (valuemask & CWBitGravity)
window->bit_gravity = attributes->bit_gravity;
if (valuemask & CWWinGravity)
window->win_gravity = attributes->win_gravity;
if (valuemask & CWBackingStore)
window->backing_store = attributes->backing_store;
if (valuemask & CWBackingPlanes)
window->backing_planes = attributes->backing_planes;
if (valuemask & CWBackingPixel)
window->backing_pixel = attributes->backing_pixel;
if (valuemask & CWSaveUnder)
window->save_under = attributes->save_under;
if (valuemask & CWEventMask) {
int i;
long mask;
window->event_masks[ConnectionNumber(dpy)] = attributes->event_mask;
mask = 0;
for (i = 0; i < MAX_CONN; i++) {
mask |= window->event_masks[i];
}
window->event_mask = mask;
}
if (valuemask & CWDontPropagate)
window->do_not_propagate_mask = attributes->do_not_propagate_mask;
if (valuemask & CWOverrideRedirect)
window->override_redirect = attributes->override_redirect;
if (valuemask & CWColormap)
window->colormap = attributes->colormap;
if (valuemask & CWCursor)
window->cursor = attributes->cursor;
if (window->viewable) {
if (redraw_border)
_WDrawWindowBorder (dpy, window, &window->border_port, True);
}
return 1;
}