This is /home/pdm/install/Python-2.1/Doc/lib/python-lib.info, produced
by makeinfo version 4.0 from lib.texi.

   April 15, 2001		2.1


File: python-lib.info,  Node: Python Byte Code Instructions,  Prev: dis,  Up: dis

Python Byte Code Instructions
-----------------------------

   The Python compiler currently generates the following byte code
instructions.

`STOP_CODE'
     Indicates end-of-code to the compiler, not used by the interpreter.

`POP_TOP'
     Removes the top-of-stack (TOS) item.

`ROT_TWO'
     Swaps the two top-most stack items.

`ROT_THREE'
     Lifts second and third stack item one position up, moves top down
     to position three.

`ROT_FOUR'
     Lifts second, third and forth stack item one position up, moves
     top down to position four.

`DUP_TOP'
     Duplicates the reference on top of the stack.

   Unary Operations take the top of the stack, apply the operation, and
push the result back on the stack.

`UNARY_POSITIVE'
     Implements `TOS = +TOS'.

`UNARY_NEGATIVE'
     Implements `TOS = -TOS'.

`UNARY_NOT'
     Implements `TOS = not TOS'.

`UNARY_CONVERT'
     Implements `TOS = `TOS`'.

`UNARY_INVERT'
     Implements `TOS = ~{}TOS'.

   Binary operations remove the top of the stack (TOS) and the second
top-most stack item (TOS1) from the stack.  They perform the operation,
and put the result back on the stack.

`BINARY_POWER'
     Implements `TOS = TOS1 ** TOS'.

`BINARY_MULTIPLY'
     Implements `TOS = TOS1 * TOS'.

`BINARY_DIVIDE'
     Implements `TOS = TOS1 / TOS'.

`BINARY_MODULO'
     Implements `TOS = TOS1 %{} TOS'.

`BINARY_ADD'
     Implements `TOS = TOS1 + TOS'.

`BINARY_SUBTRACT'
     Implements `TOS = TOS1 - TOS'.

`BINARY_SUBSCR'
     Implements `TOS = TOS1[TOS]'.

`BINARY_LSHIFT'
     Implements `TOS = TOS1 <`'< TOS'.

`BINARY_RSHIFT'
     Implements `TOS = TOS1 >`'> TOS'.

`BINARY_AND'
     Implements `TOS = TOS1 & TOS'.

`BINARY_XOR'
     Implements `TOS = TOS1 ^ TOS'.

`BINARY_OR'
     Implements `TOS = TOS1 | TOS'.

   In-place operations are like binary operations, in that they remove
TOS and TOS1, and push the result back on the stack, but the operation
is done in-place when TOS1 supports it, and the resulting TOS may be
(but does not have to be) the original TOS1.

`INPLACE_POWER'
     Implements in-place `TOS = TOS1 ** TOS'.

`INPLACE_MULTIPLY'
     Implements in-place `TOS = TOS1 * TOS'.

`INPLACE_DIVIDE'
     Implements in-place `TOS = TOS1 / TOS'.

`INPLACE_MODULO'
     Implements in-place `TOS = TOS1 %{} TOS'.

`INPLACE_ADD'
     Implements in-place `TOS = TOS1 + TOS'.

`INPLACE_SUBTRACT'
     Implements in-place `TOS = TOS1 - TOS'.

`INPLACE_LSHIFT'
     Implements in-place `TOS = TOS1 <`'< TOS'.

`INPLACE_RSHIFT'
     Implements in-place `TOS = TOS1 >`'> TOS'.

`INPLACE_AND'
     Implements in-place `TOS = TOS1 & TOS'.

`INPLACE_XOR'
     Implements in-place `TOS = TOS1 ^ TOS'.

`INPLACE_OR'
     Implements in-place `TOS = TOS1 | TOS'.

   The slice opcodes take up to three parameters.

`SLICE+0'
     Implements `TOS = TOS[:]'.

`SLICE+1'
     Implements `TOS = TOS1[TOS:]'.

`SLICE+2'
     Implements `TOS = TOS1[:TOS1]'.

`SLICE+3'
     Implements `TOS = TOS2[TOS1:TOS]'.

   Slice assignment needs even an additional parameter.  As any
statement, they put nothing on the stack.

`STORE_SLICE+0'
     Implements `TOS[:] = TOS1'.

`STORE_SLICE+1'
     Implements `TOS1[TOS:] = TOS2'.

`STORE_SLICE+2'
     Implements `TOS1[:TOS] = TOS2'.

`STORE_SLICE+3'
     Implements `TOS2[TOS1:TOS] = TOS3'.

`DELETE_SLICE+0'
     Implements `del TOS[:]'.

`DELETE_SLICE+1'
     Implements `del TOS1[TOS:]'.

`DELETE_SLICE+2'
     Implements `del TOS1[:TOS]'.

`DELETE_SLICE+3'
     Implements `del TOS2[TOS1:TOS]'.

`STORE_SUBSCR'
     Implements `TOS1[TOS] = TOS2'.

`DELETE_SUBSCR'
     Implements `del TOS1[TOS]'.

`PRINT_EXPR'
     Implements the expression statement for the interactive mode.  TOS
     is removed from the stack and printed.  In non-interactive mode, an
     expression statement is terminated with `POP_STACK'.

`PRINT_ITEM'
     Prints TOS to the file-like object bound to `sys.stdout'.  There
     is one such instruction for each item in the `print' statement.

`PRINT_ITEM_TO'
     Like `PRINT_ITEM', but prints the item second from TOS to the
     file-like object at TOS.  This is used by the extended print
     statement.

`PRINT_NEWLINE'
     Prints a new line on `sys.stdout'.  This is generated as the last
     operation of a `print' statement, unless the statement ends with a
     comma.

`PRINT_NEWLINE_TO'
     Like `PRINT_NEWLINE', but prints the new line on the file-like
     object on the TOS.  This is used by the extended print statement.

`BREAK_LOOP'
     Terminates a loop due to a `break' statement.

`LOAD_LOCALS'
     Pushes a reference to the locals of the current scope on the stack.
     This is used in the code for a class definition: After the class
     body is evaluated, the locals are passed to the class definition.

`RETURN_VALUE'
     Returns with TOS to the caller of the function.

`IMPORT_STAR'
     Loads all symbols not starting with `_' directly from the module
     TOS to the local namespace. The module is popped after loading all
     names.  This opcode implements `from module import *'.

`EXEC_STMT'
     Implements `exec TOS2,TOS1,TOS'.  The compiler fills missing
     optional parameters with `None'.

`POP_BLOCK'
     Removes one block from the block stack.  Per frame, there is a
     stack of blocks, denoting nested loops, try statements, and such.

`END_FINALLY'
     Terminates a `finally' clause.  The interpreter recalls whether
     the exception has to be re-raised, or whether the function
     returns, and continues with the outer-next block.

`BUILD_CLASS'
     Creates a new class object.  TOS is the methods dictionary, TOS1
     the tuple of the names of the base classes, and TOS2 the class
     name.

   All of the following opcodes expect arguments.  An argument is two
bytes, with the more significant byte last.

`STORE_NAME namei'
     Implements `name = TOS'. NAMEI is the index of NAME in the
     attribute `co_names' of the code object.  The compiler tries to
     use `STORE_LOCAL' or `STORE_GLOBAL' if possible.

`DELETE_NAME namei'
     Implements `del name', where NAMEI is the index into `co_names'
     attribute of the code object.

`UNPACK_SEQUENCE count'
     Unpacks TOS into COUNT individual values, which are put onto the
     stack right-to-left.

`DUP_TOPX count'
     Duplicate COUNT items, keeping them in the same order. Due to
     implementation limits, COUNT should be between 1 and 5 inclusive.

`STORE_ATTR namei'
     Implements `TOS.name = TOS1', where NAMEI is the index of name in
     `co_names'.

`DELETE_ATTR namei'
     Implements `del TOS.name', using NAMEI as index into `co_names'.

`STORE_GLOBAL namei'
     Works as `STORE_NAME', but stores the name as a global.

`DELETE_GLOBAL namei'
     Works as `DELETE_NAME', but deletes a global name.

`LOAD_CONST consti'
     Pushes `co_consts[CONSTI]' onto the stack.

`LOAD_NAME namei'
     Pushes the value associated with `co_names[NAMEI]' onto the stack.

`BUILD_TUPLE count'
     Creates a tuple consuming COUNT items from the stack, and pushes
     the resulting tuple onto the stack.

`BUILD_LIST count'
     Works as `BUILD_TUPLE', but creates a list.

`BUILD_MAP zero'
     Pushes a new empty dictionary object onto the stack.  The argument
     is ignored and set to zero by the compiler.

`LOAD_ATTR namei'
     Replaces TOS with `getattr(TOS, co_names[NAMEI]'.

`COMPARE_OP opname'
     Performs a boolean operation.  The operation name can be found in
     `cmp_op[OPNAME]'.

`IMPORT_NAME namei'
     Imports the module `co_names[NAMEI]'.  The module object is pushed
     onto the stack.  The current namespace is not affected: for a
     proper import statement, a subsequent `STORE_FAST' instruction
     modifies the namespace.

`IMPORT_FROM namei'
     Loads the attribute `co_names[NAMEI]' from the module found in
     TOS. The resulting object is pushed onto the stack, to be
     subsequently stored by a `STORE_FAST' instruction.

`JUMP_FORWARD delta'
     Increments byte code counter by DELTA.

`JUMP_IF_TRUE delta'
     If TOS is true, increment the byte code counter by DELTA.  TOS is
     left on the stack.

`JUMP_IF_FALSE delta'
     If TOS is false, increment the byte code counter by DELTA.  TOS is
     not changed.

`JUMP_ABSOLUTE target'
     Set byte code counter to TARGET.

`FOR_LOOP delta'
     Iterate over a sequence.  TOS is the current index, TOS1 the
     sequence.  First, the next element is computed.  If the sequence
     is exhausted, increment byte code counter by DELTA.  Otherwise,
     push the sequence, the incremented counter, and the current item
     onto the stack.

`LOAD_GLOBAL namei'
     Loads the global named `co_names[NAMEI]' onto the stack.

`SETUP_LOOP delta'
     Pushes a block for a loop onto the block stack.  The block spans
     from the current instruction with a size of DELTA bytes.

`SETUP_EXCEPT delta'
     Pushes a try block from a try-except clause onto the block stack.
     DELTA points to the first except block.

`SETUP_FINALLY delta'
     Pushes a try block from a try-except clause onto the block stack.
     DELTA points to the finally block.

`LOAD_FAST var_num'
     Pushes a reference to the local `co_varnames[VAR_NUM]' onto the
     stack.

`STORE_FAST var_num'
     Stores TOS into the local `co_varnames[VAR_NUM]'.

`DELETE_FAST var_num'
     Deletes local `co_varnames[VAR_NUM]'.

`LOAD_CLOSURE i'
     Pushes a reference to the cell contained in slot I of the cell and
     free variable storage.  The name of the variable is
     `co_cellvars[I]' if I is less than the length of CO_CELLVARS.
     Otherwise it is `co_freevars[I - len(co_cellvars)]'.

`LOAD_DEREF i'
     Loads the cell contained in slot I of the cell and free variable
     storage.  Pushes a reference to the object the cell contains on the
     stack.

`STORE_DEREF i'
     Stores TOS into the cell contained in slot I of the cell and free
     variable storage.

`SET_LINENO lineno'
     Sets the current line number to LINENO.

`RAISE_VARARGS argc'
     Raises an exception. ARGC indicates the number of parameters to
     the raise statement, ranging from 0 to 3.  The handler will find
     the traceback as TOS2, the parameter as TOS1, and the exception as
     TOS.

`CALL_FUNCTION argc'
     Calls a function.  The low byte of ARGC indicates the number of
     positional parameters, the high byte the number of keyword
     parameters.  On the stack, the opcode finds the keyword parameters
     first.  For each keyword argument, the value is on top of the key.
     Below the keyword parameters, the positional parameters are on
     the stack, with the right-most parameter on top.  Below the
     parameters, the function object to call is on the stack.

`MAKE_FUNCTION argc'
     Pushes a new function object on the stack.  TOS is the code
     associated with the function.  The function object is defined to
     have ARGC default parameters, which are found below TOS.

`MAKE_CLOSURE argc'
     Creates a new function object, sets its FUNC_CLOSURE slot, and
     pushes it on the stack.  TOS is the code associated with the
     function.  If the code object has N free variables, the next N
     items on the stack are the cells for these variables.  The
     function also has ARGC default parameters, where are found before
     the cells.

`BUILD_SLICE argc'
     Pushes a slice object on the stack.  ARGC must be 2 or 3.  If it
     is 2, `slice(TOS1, TOS)' is pushed; if it is 3, `slice(TOS2, TOS1,
     TOS)' is pushed.  See the `slice()' built-in function for more
     information.

`EXTENDED_ARG ext'
     Prefixes any opcode which has an argument too big to fit into the
     default two bytes.  EXT holds two additional bytes which, taken
     together with the subsequent opcode's argument, comprise a
     four-byte argument, EXT being the two most-significant bytes.

`CALL_FUNCTION_VAR argc'
     Calls a function. ARGC is interpreted as in `CALL_FUNCTION'.  The
     top element on the stack contains the variable argument list,
     followed by keyword and positional arguments.

`CALL_FUNCTION_KW argc'
     Calls a function. ARGC is interpreted as in `CALL_FUNCTION'.  The
     top element on the stack contains the keyword arguments dictionary,
     followed by explicit keyword and positional arguments.

`CALL_FUNCTION_VAR_KW argc'
     Calls a function. ARGC is interpreted as in `CALL_FUNCTION'.  The
     top element on the stack contains the keyword arguments
     dictionary, followed by the variable-arguments tuple, followed by
     explicit keyword and positional arguments.


File: python-lib.info,  Node: SGI IRIX Specific Services,  Next: SunOS Specific Services,  Prev: Python Language Services,  Up: Top

SGI IRIX Specific Services
**************************

   The modules described in this chapter provide interfaces to features
that are unique to SGI's IRIX operating system (versions 4 and 5).

* Menu:

* al::
* AL::
* cd::
* fl::
* FL::
* flp::
* fm::
* gl::
* DEVICE::
* GL::
* imgfile::
* jpeg::


File: python-lib.info,  Node: al,  Next: AL,  Prev: SGI IRIX Specific Services,  Up: SGI IRIX Specific Services

Audio functions on the SGI
==========================

   Audio functions on the SGI.

   This module provides access to the audio facilities of the SGI Indy
and Indigo workstations.  See section 3A of the IRIX man pages for
details.  You'll need to read those man pages to understand what these
functions do!  Some of the functions are not available in IRIX releases
before 4.0.5.  Again, see the manual to check whether a specific
function is available on your platform.

   All functions and methods defined in this module are equivalent to
the C functions with `AL' prefixed to their name.

   Symbolic constants from the C header file `<audio.h>' are defined in
the standard module `AL', see below.

   *Warning:* the current version of the audio library may dump core
when bad argument values are passed rather than returning an error
status.  Unfortunately, since the precise circumstances under which
this may happen are undocumented and hard to check, the Python
interface can provide no protection against this kind of problems.
(One example is specifying an excessive queue size -- there is no
documented upper limit.)

   The module defines the following functions:

`openport(name, direction[, config])'
     The name and direction arguments are strings.  The optional CONFIG
     argument is a configuration object as returned by `newconfig()'.
     The return value is an "audio port object"; methods of audio port
     objects are described below.

`newconfig()'
     The return value is a new "audio configuration object"; methods of
     audio configuration objects are described below.

`queryparams(device)'
     The device argument is an integer.  The return value is a list of
     integers containing the data returned by `ALqueryparams()'.

`getparams(device, list)'
     The DEVICE argument is an integer.  The list argument is a list
     such as returned by `queryparams()'; it is modified in place (!).

`setparams(device, list)'
     The DEVICE argument is an integer.  The LIST argument is a list
     such as returned by `queryparams()'.

* Menu:

* Configuration Objects::
* Port Objects::


File: python-lib.info,  Node: Configuration Objects,  Next: Port Objects,  Prev: al,  Up: al

Configuration Objects
---------------------

   Configuration objects (returned by `newconfig()' have the following
methods:

`getqueuesize()'
     Return the queue size.

`setqueuesize(size)'
     Set the queue size.

`getwidth()'
     Get the sample width.

`setwidth(width)'
     Set the sample width.

`getchannels()'
     Get the channel count.

`setchannels(nchannels)'
     Set the channel count.

`getsampfmt()'
     Get the sample format.

`setsampfmt(sampfmt)'
     Set the sample format.

`getfloatmax()'
     Get the maximum value for floating sample formats.

`setfloatmax(floatmax)'
     Set the maximum value for floating sample formats.


File: python-lib.info,  Node: Port Objects,  Prev: Configuration Objects,  Up: al

Port Objects
------------

   Port objects, as returned by `openport()', have the following
methods:

`closeport()'
     Close the port.

`getfd()'
     Return the file descriptor as an int.

`getfilled()'
     Return the number of filled samples.

`getfillable()'
     Return the number of fillable samples.

`readsamps(nsamples)'
     Read a number of samples from the queue, blocking if necessary.
     Return the data as a string containing the raw data, (e.g., 2
     bytes per sample in big-endian byte order (high byte, low byte) if
     you have set the sample width to 2 bytes).

`writesamps(samples)'
     Write samples into the queue, blocking if necessary.  The samples
     are encoded as described for the `readsamps()' return value.

`getfillpoint()'
     Return the `fill point'.

`setfillpoint(fillpoint)'
     Set the `fill point'.

`getconfig()'
     Return a configuration object containing the current configuration
     of the port.

`setconfig(config)'
     Set the configuration from the argument, a configuration object.

`getstatus(list)'
     Get status information on last error.


File: python-lib.info,  Node: AL,  Next: cd,  Prev: al,  Up: SGI IRIX Specific Services

Constants used with the `al' module
===================================

   Constants used with the `al' module.

   This module defines symbolic constants needed to use the built-in
module `al' (see above); they are equivalent to those defined in the C
header file `<audio.h>' except that the name prefix `AL_' is omitted.
Read the module source for a complete list of the defined names.
Suggested use:

     import al
     from AL import *


File: python-lib.info,  Node: cd,  Next: fl,  Prev: AL,  Up: SGI IRIX Specific Services

CD-ROM access on SGI systems
============================

   Interface to the CD-ROM on Silicon Graphics systems.

   This module provides an interface to the Silicon Graphics CD library.
It is available only on Silicon Graphics systems.

   The way the library works is as follows.  A program opens the CD-ROM
device with `open()' and creates a parser to parse the data from the CD
with `createparser()'.  The object returned by `open()' can be used to
read data from the CD, but also to get status information for the
CD-ROM device, and to get information about the CD, such as the table
of contents.  Data from the CD is passed to the parser, which parses
the frames, and calls any callback functions that have previously been
added.

   An audio CD is divided into "tracks" or "programs" (the terms are
used interchangeably).  Tracks can be subdivided into "indices".  An
audio CD contains a "table of contents" which gives the starts of the
tracks on the CD.  Index 0 is usually the pause before the start of a
track.  The start of the track as given by the table of contents is
normally the start of index 1.

   Positions on a CD can be represented in two ways.  Either a frame
number or a tuple of three values, minutes, seconds and frames.  Most
functions use the latter representation.  Positions can be both
relative to the beginning of the CD, and to the beginning of the track.

   Module `cd' defines the following functions and constants:

`createparser()'
     Create and return an opaque parser object.  The methods of the
     parser object are described below.

`msftoframe(minutes, seconds, frames)'
     Converts a `(MINUTES, SECONDS, FRAMES)' triple representing time
     in absolute time code into the corresponding CD frame number.

`open([device[, mode]])'
     Open the CD-ROM device.  The return value is an opaque player
     object; methods of the player object are described below.  The
     device is the name of the SCSI device file, e.g.
     `'/dev/scsi/sc0d4l0'', or `None'.  If omitted or `None', the
     hardware inventory is consulted to locate a CD-ROM drive.  The
     MODE, if not omited, should be the string `'r''.

   The module defines the following variables:

`error'
     Exception raised on various errors.

`DATASIZE'
     The size of one frame's worth of audio data.  This is the size of
     the audio data as passed to the callback of type `audio'.

`BLOCKSIZE'
     The size of one uninterpreted frame of audio data.

   The following variables are states as returned by `getstatus()':

`READY'
     The drive is ready for operation loaded with an audio CD.

`NODISC'
     The drive does not have a CD loaded.

`CDROM'
     The drive is loaded with a CD-ROM.  Subsequent play or read
     operations will return I/O errors.

`ERROR'
     An error occurred while trying to read the disc or its table of
     contents.

`PLAYING'
     The drive is in CD player mode playing an audio CD through its
     audio jacks.

`PAUSED'
     The drive is in CD layer mode with play paused.

`STILL'
     The equivalent of `PAUSED' on older (non 3301) model Toshiba
     CD-ROM drives.  Such drives have never been shipped by SGI.

`audio'

`pnum'

`index'

`ptime'

`atime'

`catalog'

`ident'

`control'
     Integer constants describing the various types of parser callbacks
     that can be set by the `addcallback()' method of CD parser objects
     (see below).

* Menu:

* Player Objects::
* Parser Objects::


File: python-lib.info,  Node: Player Objects,  Next: Parser Objects,  Prev: cd,  Up: cd

Player Objects
--------------

   Player objects (returned by `open()') have the following methods:

`allowremoval()'
     Unlocks the eject button on the CD-ROM drive permitting the user to
     eject the caddy if desired.

`bestreadsize()'
     Returns the best value to use for the NUM_FRAMES parameter of the
     `readda()' method.  Best is defined as the value that permits a
     continuous flow of data from the CD-ROM drive.

`close()'
     Frees the resources associated with the player object.  After
     calling `close()', the methods of the object should no longer be
     used.

`eject()'
     Ejects the caddy from the CD-ROM drive.

`getstatus()'
     Returns information pertaining to the current state of the CD-ROM
     drive.  The returned information is a tuple with the following
     values: STATE, TRACK, RTIME, ATIME, TTIME, FIRST, LAST,
     SCSI_AUDIO, CUR_BLOCK.  RTIME is the time relative to the start of
     the current track; ATIME is the time relative to the beginning of
     the disc; TTIME is the total time on the disc.  For more
     information on the meaning of the values, see the man page
     `CDgetstatus(3dm)'.  The value of STATE is one of the following:
     `ERROR', `NODISC', `READY', `PLAYING', `PAUSED', `STILL', or
     `CDROM'.

`gettrackinfo(track)'
     Returns information about the specified track.  The returned
     information is a tuple consisting of two elements, the start time
     of the track and the duration of the track.

`msftoblock(min, sec, frame)'
     Converts a minutes, seconds, frames triple representing a time in
     absolute time code into the corresponding logical block number for
     the given CD-ROM drive.  You should use `msftoframe()' rather than
     `msftoblock()' for comparing times.  The logical block number
     differs from the frame number by an offset required by certain
     CD-ROM drives.

`play(start, play)'
     Starts playback of an audio CD in the CD-ROM drive at the specified
     track.  The audio output appears on the CD-ROM drive's headphone
     and audio jacks (if fitted).  Play stops at the end of the disc.
     START is the number of the track at which to start playing the CD;
     if PLAY is 0, the CD will be set to an initial paused state.  The
     method `togglepause()' can then be used to commence play.

`playabs(minutes, seconds, frames, play)'
     Like `play()', except that the start is given in minutes, seconds,
     and frames instead of a track number.

`playtrack(start, play)'
     Like `play()', except that playing stops at the end of the track.

`playtrackabs(track, minutes, seconds, frames, play)'
     Like `play()', except that playing begins at the specified
     absolute time and ends at the end of the specified track.

`preventremoval()'
     Locks the eject button on the CD-ROM drive thus preventing the user
     from arbitrarily ejecting the caddy.

`readda(num_frames)'
     Reads the specified number of frames from an audio CD mounted in
     the CD-ROM drive.  The return value is a string representing the
     audio frames.  This string can be passed unaltered to the
     `parseframe()' method of the parser object.

`seek(minutes, seconds, frames)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     an absolute time code location specified in MINUTES, SECONDS, and
     FRAMES.  The return value is the logical block number to which the
     pointer has been set.

`seekblock(block)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     the specified logical block number.  The return value is the
     logical block number to which the pointer has been set.

`seektrack(track)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     the specified track.  The return value is the logical block number
     to which the pointer has been set.

`stop()'
     Stops the current playing operation.

`togglepause()'
     Pauses the CD if it is playing, and makes it play if it is paused.


File: python-lib.info,  Node: Parser Objects,  Prev: Player Objects,  Up: cd

Parser Objects
--------------

   Parser objects (returned by `createparser()') have the following
methods:

`addcallback(type, func, arg)'
     Adds a callback for the parser.  The parser has callbacks for eight
     different types of data in the digital audio data stream.
     Constants for these types are defined at the `cd' module level
     (see above).  The callback is called as follows: `FUNC(ARG, type,
     data)', where ARG is the user supplied argument, TYPE is the
     particular type of callback, and DATA is the data returned for
     this TYPE of callback.  The type of the data depends on the TYPE
     of callback as follows:

     Type                               Value
     ------                             -----
     audio                              String which can be passed
                                        unmodified to `al.writesamps()'.
     pnum                               Integer giving the program
                                        (track) number.
     index                              Integer giving the index number.
     ptime                              Tuple consisting of the program
                                        time in minutes, seconds, and
                                        frames.
     atime                              Tuple consisting of the absolute
                                        time in minutes, seconds, and
                                        frames.
     catalog                            String of 13 characters, giving
                                        the catalog number of the CD.
     ident                              String of 12 characters, giving
                                        the ISRC identification number of
                                        the recording.  The string
                                        consists of two characters
                                        country code, three characters
                                        owner code, two characters giving
                                        the year, and five characters
                                        giving a serial number.
     control                            Integer giving the control bits
                                        from the CD subcode data

`deleteparser()'
     Deletes the parser and frees the memory it was using.  The object
     should not be used after this call.  This call is done
     automatically when the last reference to the object is removed.

`parseframe(frame)'
     Parses one or more frames of digital audio data from a CD such as
     returned by `readda()'.  It determines which subcodes are present
     in the data.  If these subcodes have changed since the last frame,
     then `parseframe()' executes a callback of the appropriate type
     passing to it the subcode data found in the frame.  Unlike the C
     function, more than one frame of digital audio data can be passed
     to this method.

`removecallback(type)'
     Removes the callback for the given TYPE.

`resetparser()'
     Resets the fields of the parser used for tracking subcodes to an
     initial state.  `resetparser()' should be called after the disc
     has been changed.


File: python-lib.info,  Node: fl,  Next: FL,  Prev: cd,  Up: SGI IRIX Specific Services

FORMS library interface for GUI applications
============================================

   FORMS library interface for GUI applications.

   This module provides an interface to the FORMS Library by Mark
Overmars.  The source for the library can be retrieved by anonymous ftp
from host `ftp.cs.ruu.nl', directory `SGI/FORMS'.  It was last tested
with version 2.0b.

   Most functions are literal translations of their C equivalents,
dropping the initial `fl_' from their name.  Constants used by the
library are defined in module `FL' described below.

   The creation of objects is a little different in Python than in C:
instead of the `current form' maintained by the library to which new
FORMS objects are added, all functions that add a FORMS object to a
form are methods of the Python object representing the form.
Consequently, there are no Python equivalents for the C functions
`fl_addto_form()' and `fl_end_form()', and the equivalent of
`fl_bgn_form()' is called `fl.make_form()'.

   Watch out for the somewhat confusing terminology: FORMS uses the word
"object" for the buttons, sliders etc. that you can place in a form.
In Python, `object' means any value.  The Python interface to FORMS
introduces two new Python object types: form objects (representing an
entire form) and FORMS objects (representing one button, slider etc.).
Hopefully this isn't too confusing.

   There are no `free objects' in the Python interface to FORMS, nor is
there an easy way to add object classes written in Python.  The FORMS
interface to GL event handling is available, though, so you can mix
FORMS with pure GL windows.

   *Please note:* importing `fl' implies a call to the GL function
`foreground()' and to the FORMS routine `fl_init()'.

* Menu:

* FL Functions::
* Form Objects::
* FORMS Objects::


File: python-lib.info,  Node: FL Functions,  Next: Form Objects,  Prev: fl,  Up: fl

Functions Defined in Module `fl'
--------------------------------

   Module `fl' defines the following functions.  For more information
about what they do, see the description of the equivalent C function in
the FORMS documentation:

`make_form(type, width, height)'
     Create a form with given type, width and height.  This returns a
     "form" object, whose methods are described below.

`do_forms()'
     The standard FORMS main loop.  Returns a Python object representing
     the FORMS object needing interaction, or the special value
     `FL.EVENT'.

`check_forms()'
     Check for FORMS events.  Returns what `do_forms()' above returns,
     or `None' if there is no event that immediately needs interaction.

`set_event_call_back(function)'
     Set the event callback function.

`set_graphics_mode(rgbmode, doublebuffering)'
     Set the graphics modes.

`get_rgbmode()'
     Return the current rgb mode.  This is the value of the C global
     variable `fl_rgbmode'.

`show_message(str1, str2, str3)'
     Show a dialog box with a three-line message and an OK button.

`show_question(str1, str2, str3)'
     Show a dialog box with a three-line message and YES and NO buttons.
     It returns `1' if the user pressed YES, `0' if NO.

`show_choice(str1, str2, str3, but1[, but2[, but3]])'
     Show a dialog box with a three-line message and up to three
     buttons.  It returns the number of the button clicked by the user
     (`1', `2' or `3').

`show_input(prompt, default)'
     Show a dialog box with a one-line prompt message and text field in
     which the user can enter a string.  The second argument is the
     default input string.  It returns the string value as edited by
     the user.

`show_file_selector(message, directory, pattern, default)'
     Show a dialog box in which the user can select a file.  It returns
     the absolute filename selected by the user, or `None' if the user
     presses Cancel.

`get_directory()'

`get_pattern'

`get_filename'
     These functions return the directory, pattern and filename (the
     tail part only) selected by the user in the last
     `show_file_selector()' call.

`qdevice(dev)'

`unqdevice dev'

`isqueued dev'

`qtest'

`qread'

`qreset'

`qenter dev, val'

`get_mouse'

`tie button, valuator1, valuator2'
     These functions are the FORMS interfaces to the corresponding GL
     functions.  Use these if you want to handle some GL events yourself
     when using `fl.do_events()'.  When a GL event is detected that
     FORMS cannot handle, `fl.do_forms()' returns the special value
     `FL.EVENT' and you should call `fl.qread()' to read the event from
     the queue.  Don't use the equivalent GL functions!

`color()'

`mapcolor'

`getmcolor'
     See the description in the FORMS documentation of `fl_color()',
     `fl_mapcolor()' and `fl_getmcolor()'.


File: python-lib.info,  Node: Form Objects,  Next: FORMS Objects,  Prev: FL Functions,  Up: fl

Form Objects
------------

   Form objects (returned by `make_form()' above) have the following
methods.  Each method corresponds to a C function whose name is
prefixed with `fl_'; and whose first argument is a form pointer; please
refer to the official FORMS documentation for descriptions.

   All the `add_*()' methods return a Python object representing the
FORMS object.  Methods of FORMS objects are described below.  Most
kinds of FORMS object also have some methods specific to that kind;
these methods are listed here.

`show_form(placement, bordertype, name)'
     Show the form.

`hide_form()'
     Hide the form.

`redraw_form()'
     Redraw the form.

`set_form_position(x, y)'
     Set the form's position.

`freeze_form()'
     Freeze the form.

`unfreeze_form()'
     Unfreeze the form.

`activate_form()'
     Activate the form.

`deactivate_form()'
     Deactivate the form.

`bgn_group()'
     Begin a new group of objects; return a group object.

`end_group()'
     End the current group of objects.

`find_first()'
     Find the first object in the form.

`find_last()'
     Find the last object in the form.

`add_box(type, x, y, w, h, name)'
     Add a box object to the form.  No extra methods.

`add_text(type, x, y, w, h, name)'
     Add a text object to the form.  No extra methods.

`add_clock(type, x, y, w, h, name)'
     Add a clock object to the form. \ Method: `get_clock()'.

`add_button(type, x, y, w, h,  name)'
     Add a button object to the form. \ Methods: `get_button()',
     `set_button()'.

`add_lightbutton(type, x, y, w, h, name)'
     Add a lightbutton object to the form. \ Methods: `get_button()',
     `set_button()'.

`add_roundbutton(type, x, y, w, h, name)'
     Add a roundbutton object to the form. \ Methods: `get_button()',
     `set_button()'.

`add_slider(type, x, y, w, h, name)'
     Add a slider object to the form. \ Methods: `set_slider_value()',
     `get_slider_value()', `set_slider_bounds()', `get_slider_bounds()',
     `set_slider_return()', `set_slider_size()',
     `set_slider_precision()', `set_slider_step()'.

`add_valslider(type, x, y, w, h, name)'
     Add a valslider object to the form. \ Methods:
     `set_slider_value()', `get_slider_value()', `set_slider_bounds()',
     `get_slider_bounds()', `set_slider_return()', `set_slider_size()',
     `set_slider_precision()', `set_slider_step()'.

`add_dial(type, x, y, w, h, name)'
     Add a dial object to the form. \ Methods: `set_dial_value()',
     `get_dial_value()', `set_dial_bounds()', `get_dial_bounds()'.

`add_positioner(type, x, y, w, h, name)'
     Add a positioner object to the form. \ Methods:
     `set_positioner_xvalue()', `set_positioner_yvalue()',
     `set_positioner_xbounds()', `set_positioner_ybounds()',
     `get_positioner_xvalue()', `get_positioner_yvalue()',
     `get_positioner_xbounds()', `get_positioner_ybounds()'.

`add_counter(type, x, y, w, h, name)'
     Add a counter object to the form. \ Methods: `set_counter_value()',
     `get_counter_value()', `set_counter_bounds()',
     `set_counter_step()', `set_counter_precision()',
     `set_counter_return()'.

`add_input(type, x, y, w, h, name)'
     Add a input object to the form. \ Methods: `set_input()',
     `get_input()', `set_input_color()', `set_input_return()'.

`add_menu(type, x, y, w, h, name)'
     Add a menu object to the form. \ Methods: `set_menu()',
     `get_menu()', `addto_menu()'.

`add_choice(type, x, y, w, h, name)'
     Add a choice object to the form. \ Methods: `set_choice()',
     `get_choice()', `clear_choice()', `addto_choice()',
     `replace_choice()', `delete_choice()', `get_choice_text()',
     `set_choice_fontsize()', `set_choice_fontstyle()'.

`add_browser(type, x, y, w, h, name)'
     Add a browser object to the form. \ Methods:
     `set_browser_topline()', `clear_browser()', `add_browser_line()',
     `addto_browser()', `insert_browser_line()',
     `delete_browser_line()', `replace_browser_line()',
     `get_browser_line()', `load_browser()', `get_browser_maxline()',
     `select_browser_line()', `deselect_browser_line()',
     `deselect_browser()', `isselected_browser_line()', `get_browser()',
     `set_browser_fontsize()', `set_browser_fontstyle()',
     `set_browser_specialkey()'.

`add_timer(type, x, y, w, h, name)'
     Add a timer object to the form. \ Methods: `set_timer()',
     `get_timer()'.

   Form objects have the following data attributes; see the FORMS
documentation:

Name                     C Type                   Meaning
------                   -----                    -----
window                   int (read-only)          GL window id
w                        float                    form width
h                        float                    form height
x                        float                    form x origin
y                        float                    form y origin
deactivated              int                      nonzero if form is
                                                  deactivated
visible                  int                      nonzero if form is
                                                  visible
frozen                   int                      nonzero if form is
                                                  frozen
doublebuf                int                      nonzero if double
                                                  buffering on


File: python-lib.info,  Node: FORMS Objects,  Prev: Form Objects,  Up: fl

FORMS Objects
-------------

   Besides methods specific to particular kinds of FORMS objects, all
FORMS objects also have the following methods:

`set_call_back(function, argument)'
     Set the object's callback function and argument.  When the object
     needs interaction, the callback function will be called with two
     arguments: the object, and the callback argument.  (FORMS objects
     without a callback function are returned by `fl.do_forms()' or
     `fl.check_forms()' when they need interaction.)  Call this method
     without arguments to remove the callback function.

`delete_object()'
     Delete the object.

`show_object()'
     Show the object.

`hide_object()'
     Hide the object.

`redraw_object()'
     Redraw the object.

`freeze_object()'
     Freeze the object.

`unfreeze_object()'
     Unfreeze the object.

   FORMS objects have these data attributes; see the FORMS
documentation:

Name                     C Type                   Meaning
------                   -----                    -----
objclass                 int (read-only)          object class
type                     int (read-only)          object type
boxtype                  int                      box type
x                        float                    x origin
y                        float                    y origin
w                        float                    width
h                        float                    height
col1                     int                      primary color
col2                     int                      secondary color
align                    int                      alignment
lcol                     int                      label color
lsize                    float                    label font size
label                    string                   label string
lstyle                   int                      label style
pushed                   int (read-only)          (see FORMS docs)
focus                    int (read-only)          (see FORMS docs)
belowmouse               int (read-only)          (see FORMS docs)
frozen                   int (read-only)          (see FORMS docs)
active                   int (read-only)          (see FORMS docs)
input                    int (read-only)          (see FORMS docs)
visible                  int (read-only)          (see FORMS docs)
radio                    int (read-only)          (see FORMS docs)
automatic                int (read-only)          (see FORMS docs)


File: python-lib.info,  Node: FL,  Next: flp,  Prev: fl,  Up: SGI IRIX Specific Services

Constants used with the `fl' module
===================================

   Constants used with the `fl' module.

   This module defines symbolic constants needed to use the built-in
module `fl' (see above); they are equivalent to those defined in the C
header file `<forms.h>' except that the name prefix `FL_' is omitted.
Read the module source for a complete list of the defined names.
Suggested use:

     import fl
     from FL import *


File: python-lib.info,  Node: flp,  Next: fm,  Prev: FL,  Up: SGI IRIX Specific Services

Functions for loading stored FORMS designs
==========================================

   Functions for loading stored FORMS designs.

   This module defines functions that can read form definitions created
by the `form designer' (`fdesign') program that comes with the FORMS
library (see module `fl' above).

   For now, see the file `flp.doc' in the Python library source
directory for a description.

   XXX A complete description should be inserted here!


File: python-lib.info,  Node: fm,  Next: gl,  Prev: flp,  Up: SGI IRIX Specific Services

_Font Manager_ interface
========================

   _Font Manager_ interface for SGI workstations.

   This module provides access to the IRIS _Font Manager_ library.  It
is available only on Silicon Graphics machines.  See also: _4Sight
User's Guide_, section 1, chapter 5: "Using the IRIS Font Manager."

   This is not yet a full interface to the IRIS Font Manager.  Among
the unsupported features are: matrix operations; cache operations;
character operations (use string operations instead); some details of
font info; individual glyph metrics; and printer matching.

   It supports the following operations:

`init()'
     Initialization function.  Calls `fminit()'.  It is normally not
     necessary to call this function, since it is called automatically
     the first time the `fm' module is imported.

`findfont(fontname)'
     Return a font handle object.  Calls `fmfindfont(FONTNAME)'.

`enumerate()'
     Returns a list of available font names.  This is an interface to
     `fmenumerate()'.

`prstr(string)'
     Render a string using the current font (see the `setfont()' font
     handle method below).  Calls `fmprstr(STRING)'.

`setpath(string)'
     Sets the font search path.  Calls `fmsetpath(STRING)'.  (XXX Does
     not work!?!)

`fontpath()'
     Returns the current font search path.

   Font handle objects support the following operations:

`scalefont(factor)'
     Returns a handle for a scaled version of this font.  Calls
     `fmscalefont(FH, FACTOR)'.

`setfont()'
     Makes this font the current font.  Note: the effect is undone
     silently when the font handle object is deleted.  Calls
     `fmsetfont(FH)'.

`getfontname()'
     Returns this font's name.  Calls `fmgetfontname(FH)'.

`getcomment()'
     Returns the comment string associated with this font.  Raises an
     exception if there is none.  Calls `fmgetcomment(FH)'.

`getfontinfo()'
     Returns a tuple giving some pertinent data about this font.  This
     is an interface to `fmgetfontinfo()'.  The returned tuple contains
     the following numbers: `('PRINTERMATCHED, FIXED_WIDTH, XORIG,
     YORIG, XSIZE, YSIZE, HEIGHT, NGLYPHS`)'.

`getstrwidth(string)'
     Returns the width, in pixels, of STRING when drawn in this font.
     Calls `fmgetstrwidth(FH, STRING)'.

