| Category | Native procedure | ||||||||||||||||||
| Format | (battery-info) | ||||||||||||||||||
| Parameters | none | ||||||||||||||||||
| Description | battery-info returns detailed information about the
Palm's battery status as a list of seven items:
|
||||||||||||||||||
| R4RS Compliance | LispMe extension | ||||||||||||||||||
| Examples |
|
| Category | Special form | |||
| Format | (begin expr1 expr2 ...) | |||
| Parameters |
|
|||
| Description | begin evaluates each expri in sequence
from left to right. The value of the last
expri is returned. A second use of begin is to group mutually recursive define expressions entered into the command line. | |||
| R4RS Compliance | Full | |||
| Examples |
|
| Category | Primitive procedure | |||||||||||||||
| Format | (bit-and ni ...) | |||||||||||||||
| Parameters |
|
|||||||||||||||
| Description | bit-and ands the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
| R4RS Compliance | LispMe extension | |||||||||||||||
| Examples |
|
| Category | Primitive procedure | ||||||
| Format | (bit-not n) | ||||||
| Parameters |
|
||||||
| Description | bit-not inverts every bit in its argument. The
result is returned as a
signed 15 bit integers. The truth table for this operation is
|
||||||
| R4RS Compliance | LispMe extension | ||||||
| Examples |
|
| Category | Primitive procedure | |||||||||||||||
| Format | (bit-or ni ...) | |||||||||||||||
| Parameters |
|
|||||||||||||||
| Description | bit-or inclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
| R4RS Compliance | LispMe extension | |||||||||||||||
| Examples |
|
| Category | Primitive procedure | ||||||||||||||||||
| Format | (bit-shift n k) | ||||||||||||||||||
| Parameters |
|
||||||||||||||||||
| Description | bit-shift shifts n by
k bits to the left (if k is
positive) or to the right (if k is negative).
All shifts are signed, i.e. they preserve the most significant
bit in the standard two's-complement representation of integers. Shift amounts are interpreted modulo 64, since 68000 family processors treat them this way. |
||||||||||||||||||
| R4RS Compliance | LispMe extension | ||||||||||||||||||
| Examples |
|
| Category | Primitive procedure | |||||||||||||||
| Format | (bit-xor ni ...) | |||||||||||||||
| Parameters |
|
|||||||||||||||
| Description | bit-xor exclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
| R4RS Compliance | LispMe extension | |||||||||||||||
| Examples |
|
| Category | Native procedure | |||
| Format | (bitmap bmap) | |||
| Parameters |
|
|||
| Description | bitmap draws a bitmap at the current point stored in
*gstate* extending
to the right and the bottom. The current point is not changed.
The return value is #n to
avoid trashing the graphics. See here for details on the graphic state. The string describing the bitmap uses the standard Pilot bitmap format adn supports colored and multiple bitmaps (OS 3.5), It's exactly the format stored in a bitmap resource (ResType Tbmp). This format corresponds to this C structure definition (from the 3.5 header Core/System/Bitmap.h)
typedef struct BitmapFlagsType {
UInt16 compressed:1; // Data format: 0=raw; 1=compressed
UInt16 hasColorTable:1; // if true, color table stored before bits[]
UInt16 hasTransparency:1; // true if transparency is used
UInt16 indirect:1; // true if bits are stored indirectly
UInt16 forScreen:1; // system use only
UInt16 reserved:11;
} BitmapFlagsType;
typedef struct BitmapType {
Int16 width;
Int16 height;
UInt16 rowBytes;
BitmapFlagsType flags;
UInt8 pixelSize; // bits/pixel
UInt8 version; // version of bitmap. This is vers 2
UInt16 nextDepthOffset; // # of DWords to next BitmapType
// from beginnning of this one
UInt8 transparentIndex; // v2 only, if flags.hasTransparency is true,
// index number of transparent color
UInt8 compressionType; // v2 only, if flags.compressed is true, this is
// the type, see BitmapCompressionType
UInt16 reserved; // for future use, must be zero!
// [colorTableType] pixels | pixels*
// If hasColorTable != 0, we have:
// ColorTableType followed by pixels.
// If hasColorTable == 0:
// this is the start of the pixels
// if indirect != 0 bits are stored indirectly.
// the address of bits is stored here
// In some cases the ColorTableType will
// have 0 entries and be 2 bytes long.
} BitmapType;
Caution: The Pilot API is very sensitive to the right
initialization of these fields, especially that
rowBytes must be even. Though
LispMe checks some of these conditions, an invalid bitmap can
cause a Fatal exception, so you should stick to bitmaps read
from resources and be careful when assembling bitmaps on the fly.You can retrieve the width and height of a bitmap with
(define (width bitmap)
(+ (* 256 (char->integer (string-ref bitmap 0)))
(char->integer (string-ref bitmap 1))))
(define (height bitmap)
(+ (* 256 (char->integer (string-ref bitmap 2)))
(char->integer (string-ref bitmap 3))))
As most bitmaps are smaller than 256 pixels, you can ignore the
high-order byte:
(define (width bitmap) (char->integer (string-ref bitmap 1))) (define (height bitmap) (char->integer (string-ref bitmap 3))) |
|||
| R4RS Compliance | LispMe extension | |||
| Examples |
|
| Category | Primitive procedure | ||||||||||||
| Format | (boolean? obj) | ||||||||||||
| Parameters |
|
||||||||||||
| Description | boolean? returns #t for the boolean values #t and #f and returns #f for any other object. Remember that in LispMe () and #f are distinct objects. | ||||||||||||
| R4RS Compliance | Full | ||||||||||||
| Examples |
|
Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other