## cs-pixmap.api "cs" == "client-side"
#
# A client-side rectangular array of pixels.
# X jargon calls it an "Ximage" but I prefer
# a name more obviously related to pixmaps.
#
# Support for copying back and forth between
# client-side and server-side pixmaps makes
# them useful for specifying icons, tiling
# patterns and other client-originated image
# data intended for X display.
#
# See also:
#
src/lib/x-kit/xclient/src/window/ro-pixmap-old.api#
src/lib/x-kit/xclient/src/window/window-old.api#
src/lib/x-kit/xclient/src/window/rw-pixmap-old.pkg# Compiled by:
#
src/lib/x-kit/xclient/xclient-internals.sublibstipulate
# package dt = draw_types; # draw_types is from
src/lib/x-kit/xclient/src/window/draw-types.pkg package g2d = geometry2d; # geometry2d is from
src/lib/std/2d/geometry2d.pkg package sn = xsession_junk; # xsession_junk is from
src/lib/x-kit/xclient/src/window/xsession-junk.pkg package v1u = vector_of_one_byte_unts; # vector_of_one_byte_unts is from
src/lib/std/src/vector-of-one-byte-unts.pkgherein
# This api is implemented in:
#
#
src/lib/x-kit/xclient/src/window/cs-pixmap.pkg api Cs_Pixmap {
exception BAD_CS_PIXMAP_DATA;
# XY format for clientside window image data,
# Each vector in the inner list corresponds to a scan line in a plane.
# The outer list corresponds to the list of planes, with plane 0 being
# the last item in the list.
#
# Multiple planes are not very useful right now, as the pixel type is
# opaque. It seemed reasonable, however, to allow make_clientside_pixmap_from_readwrite_pixmap
# to work on all pixmaps, and the necessary changes were minimal.
Cs_Pixmap = CS_PIXMAP { size: g2d::Size,
data: List( List( v1u::Vector ) )
};
same_cs_pixmap: (Cs_Pixmap, Cs_Pixmap) -> Bool;
copy_from_clientside_pixmap_to_pixmap
:
sn::Rw_Pixmap
->
{ from: Cs_Pixmap,
#
from_box: g2d::Box,
to_point: g2d::Point
}
->
Void;
make_clientside_pixmap_from_ascii
:
(Int, List( List(String))) -> Cs_Pixmap;
#
# Create window with contents given by
# supplied ascii strings specifying binary or
# hex pixel values, with the integer parameter
# giving the width of the pixel array, and height
# of which is determined by the length of the
# stringlist.
#
# Example: the "tic-tac-toe" pattern result
#
# RW_PIXMAP
# { size => { wide => 8, high => 8 },
# data => [ [ "\x02\x04", "\x02\x04", "\xff\xff", "\x02\x04",
# "\x02\x04", "\xff\xff", "\x02\x04", "\x02\x04"
# ] ]
# };
#
# may be generated by either of
#
# make_clientside_pixmap_from_ascii
# (8, [ [ "0x24", "0x24", "0xff", "0x24", "0x24", "0xff","0x24", "0x24" ] ] );
#
# make_clientside_pixmap_from_ascii
# ( 8,
# [ [ "0x00100100",
# "0x00100100",
# "0x11111111",
# "0x00100100",
# "0x00100100",
# "0x11111111",
# "0x00100100",
# "0x00100100"
# ] ]
# ); # Example adapted from p9 http://mythryl.org/pub/exene/1993-lib.ps
#
# We raise exception BAD_CS_PIXMAP_DATA if the
# given ascii data cannot be successfully converted.
make_readwrite_pixmap_from_clientside_pixmap
:
sn::Screen -> Cs_Pixmap -> sn::Rw_Pixmap;
make_readwrite_pixmap_from_ascii_data
:
sn::Screen
->
(Int, List(List(String)))
->
sn::Rw_Pixmap;
make_clientside_pixmap_from_readwrite_pixmap: sn::Rw_Pixmap -> Cs_Pixmap;
make_clientside_pixmap_from_readonly_pixmap: sn::Ro_Pixmap -> Cs_Pixmap;
make_clientside_pixmap_from_window: (g2d::Box, sn::Window) -> Cs_Pixmap;
};
end;
## COPYRIGHT (c) 1990, 1991 by John H. Reppy. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.