home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
CONTRIB
/
SCHNETTR
/
XLIB
/
IMAGE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-28
|
1KB
|
40 lines
/* -*-C-*-
* access to the X Window System for Sather
* (c) 1994/11/03 - 1994/11/28 by Erik Schnetter
*/
#include <X11/X.h>
#include <X11/Xlib.h>
#include "../../System/header.h"
XImage* X_CreateImage (Display* display, Visual* visual, INT depth, INT format,
INT offset, INT width, INT height, INT bitmap_pad)
{
int scanline = ((width+offset-1) /bitmap_pad +1) *bitmap_pad /8;
int bytes_per_line = scanline * height;
char* data = (char*) malloc (height * scanline * depth);
return XCreateImage (display, visual, depth, format, offset, data,
width, height, bitmap_pad, bytes_per_line);
}
X_DestroyImage (XImage* image)
{
XDestroyImage (image);
}
X_PutPixel (XImage* image, INT x, INT y, INT pixel)
{
XPutPixel (image, x, y, pixel);
}
X_PutImage (Display* display, INT drawable, GC gc, XImage* image,
INT src_x, INT src_y, INT dest_x, INT dest_y,
INT width, INT height)
/* GC is struct* */
{
XPutImage (display, drawable, gc, image,
src_x, src_y, dest_x, dest_y, width, height);
}