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.SA
< prev
next >
Wrap
Text File
|
1994-11-11
|
2KB
|
65 lines
-- -*-Sather-*-
-- access to the X window system routines
-- (c) 1994/11/10 - 1994/11/11 by Erik Schnetter
class X_IMAGE is
-- handle an image
-- constants
const XYBitmap, XYPixmap, ZPixmap;
-- internal structure
readonly attr c_image: EXT_OB;
create: SAME is return new end;
Void: BOOL is
return void(self) or void(c_image) end;
-- create an image
Create (display: X_DISPLAY, visual: X_VISUAL, depth: INT, format: INT,
offset: INT, width, height: INT, bitmap_pad: INT) pre Void post ~Void is
c_image := C_X_IMAGE::X_CreateImage (display.c_display, visual.c_visual,
depth, format, offset, width, height, bitmap_pad);
end; -- Create
Create (display: X_DISPLAY, visual: X_VISUAL, depth: INT, format: INT,
offset: INT, size: X_OFFSET, bitmap_pad: INT) pre Void post ~Void is
Create (display, visual, depth, format, offset, size.width, size.height,
bitmap_pad);
end; -- Create
-- destroy an image
Destroy pre Void post ~Void is
C_X_IMAGE::X_DestroyImage (c_image);
c_image := void;
end; -- Destroy
-- put a pixel into an image
PutPixel (x, y: INT, pixel: INT) pre ~Void is
C_X_IMAGE::X_PutPixel (c_image, x, y, pixel);
end; -- Put
-- put an image into a drawable
Put (drawable: $X_DRAWABLE, gc: X_GC, src_x, src_y: INT,
dest_x, dest_y: INT, width, height: INT) pre ~Void is
C_X_IMAGE::X_PutImage (drawable.display.c_display, drawable.c_drawable,
gc.c_gc, c_image, src_x, src_y, dest_x, dest_y, width, height);
end; -- Put
end; -- class X_IMAGE
external class C_X_IMAGE is
X_CreateImage (display: EXT_OB, visual: EXT_OB, depth: INT, format: INT,
offset: INT, width, height: INT, bitmap_pad: INT): EXT_OB;
X_DestroyImage (image: EXT_OB);
X_PutPixel (image: EXT_OB, x, y: INT, pixel: INT);
X_PutImage (display: EXT_OB, drawable: INT, gc: EXT_OB, image: EXT_OB,
src_x, src_y: INT, dest_x, dest_y: INT, width, height: INT);
end; -- class C_X_IMAGE