aalib/doc/reference.texinfo

2042 lines
42 KiB
Plaintext

@c Automatically generated file. DO NOT EDIT! it is generated according to the
@c aalib.h header file.
@node Reference, Index, Designing new driver, Top
@appendix Reference
@menu
* aa_attrs:: returns pointer to the text output buffer used by AA-lib.
* aa_autoinitkbd:: easy to use AA-lib keyboard initialization function.
* aa_autoinitmouse:: easy to use AA-lib mouse initialization function.
* aa_autoinit:: easy to use AA-lib initialization function.
* aa_close:: close the AA-lib context.
* aa_createedit:: Simple interactive line editor provided as helper function.
* aa_currentfont:: returns specification of the fonts used by AA-lib rendering routines.
* aa_defparams:: default hardware paramters requested by AA-lib programs.
* aa_defrenderparams:: default rendering parameters.
* aa_displayrecommended::List of recommended drivers.
* aa_dithernames:: Names of dithering methods supported by AA-lib.
* aa_drivers:: NULL-terminated array of output drivers available in AA-lib.
* aa_editkey:: Notify the line editor about keypress.
* aa_edit:: Simple interactive line editor.
* aa_fastrender:: simple and fast AA-lib rendering function.
* aa_fonts:: Null-terminated array of available fonts.
* aa_formats:: NULL terminated array of save formats supported by AA-lib.
* aa_getevent:: keyboard functions
* aa_getkey:: return next keypress event from queue.
* aa_getmouse:: Get mouse position as specified by last mouse event read by aa_getevent.
* aa_gotoxy:: move the hardware cursor (if any) to specified position.
* aa_help:: AA-lib help string for the default command line parser.
* aa_hidecursor:: hide the hardware cursor.
* aa_hidemouse:: hide the mouse cursor.
* aa_image:: returns pointer to the framebuffer emulated by AA-lib.
* aa_imgheight:: returns height of the emulated image in pixels.
* aa_imgwidth:: returns width of the emulated image in pixels.
* aa_initkbd:: initialize the AA-lib keyboard driver.
* aa_initmouse:: initialize the AA-lib mouse driver.
* aa_init:: open the output display for AA-lib.
* aa_kbddrivers:: NULL-terminated array of keyboard drivers available in AA_lib.
* aa_kbdrecommended:: List of recommended drivers.
* aa_mmheight:: returns height of the output screen in millimeters.
* aa_mmwidth:: returns width of the output screen in millimeters.
* aa_mousedrivers:: NULL terminated array of mouse drivers supported by AA-lib.
* aa_mouserecommended:: List of recommended drivers.
* aa_parseoptions:: parse the standard command line options used by AA-lib.
* aa_printf:: print text to AA-lib output buffers.
* aa_putpixel:: put pixel to emulated framebuffer
* aa_puts:: output string to AA-lib output buffers.
* aa_recommendhidisplay::insert the given driver on beggining of the list of recommended display drivers.
* aa_recommendhikbd:: insert the given driver on beggining of the list of recommended keyboard drivers.
* aa_recommendhimouse:: insert the given driver on beggining of the list of recommended mouse drivers.
* aa_recommendhi:: insert the given driver on beggining of the list of recommended drivers.
* aa_recommendlowdisplay::Add the given driver to the end of list of display recommended drivers.
* aa_recommendlowkbd:: Add the given driver to the end of list of keyboard recommended drivers.
* aa_recommendlowmouse:: Add the given driver to the end of list of mouse recommended drivers.
* aa_recommendlow:: Add the given driver to the end of list of recommended drivers.
* aa_registerfont:: add new font specification to aa_fonts array.
* aa_render:: convert image buffer to ASCII-art.
* aa_resizehandler:: Set user handler to be called on resize event.
* aa_resize:: resize functions
* aa_scrheight:: returns height of the output screen in characters.
* aa_scrwidth:: returns width of the output screen in characters.
* aa_setfont:: set font specification to be used by rendering functions.
* aa_setsupported:: alter the "supported" field of hardware_params structure used by AA-lib
* aa_showcursor:: show the hardware cursor.
* aa_showmouse:: show the mouse cursor.
* aa_text:: returns pointer to the text output buffer used by AA-lib.
* aa_uninitkbd:: uninitialize the keyboard driver.
* aa_uninitmouse:: uninitialize the mouse driver.
* mem_d:: AA-lib memory driver.
* save_d:: AA-lib driver used to save ascii-art image into file in used specified format.
@end menu
@node aa_attrs, aa_autoinitkbd, , Reference
@findex aa_attrs
@appendixsec aa_attrs
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
char *aa_attrs(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
The attribute output buffer is simple array of characters specifying
the attributes.
The array is organizated in the aa_scrheight (a) rows of
aa_scrwidth(a) characters.
@heading Return value
@noindent
Pointer the text output buffer used by AA-lib.
@node aa_autoinitkbd, aa_autoinitmouse, aa_attrs, Reference
@findex aa_autoinitkbd
@appendixsec aa_autoinitkbd
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_autoinitkbd
(
struct aa_context *context,
int mode
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_context *context
Specifies the AA-lib context to operate on.
@item int mode
Mask of extra features you request. Can contain
AA_SENDRELEASE if you are interested in release events
too.
@end table
@end quotation
@heading Description
@noindent
Attempts to find available keyboard driver supporting the specified
mode. First attempts to initialize the recommended drivers
and then in order drivers available in the aa_kbddrivers array
(all regular output drivers compiled into AA-lib).
Every AA-lib program ought to have call to aa_parseoptions before
first call to aa_init.
@heading Return value
@noindent
1 when succesfull or 0 on failure.
@node aa_autoinitmouse, aa_autoinit, aa_autoinitkbd, Reference
@findex aa_autoinitmouse
@appendixsec aa_autoinitmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_autoinitmouse
(
struct aa_context *c,
int mode
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_context *c
Specifies the AA-lib context to operate on.
@item int mode
Mask of extra features you request. No such features
are available in the current AA-lib version.
@end table
@end quotation
@heading Description
@noindent
Attempts to find available mouse driver supporting the specified
mode. First attempts to initialize the recommended drivers
and then in order drivers available in the aa_kbddrivers array
(all regular output drivers compiled into AA-lib).
@heading Return value
@noindent
1 when succesfull or 0 on failure.
@node aa_autoinit, aa_close, aa_autoinitmouse, Reference
@findex aa_autoinit
@appendixsec aa_autoinit
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
aa_context *aa_autoinit(const struct aa_hardware_params *params);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const struct aa_hardware_params *params
Hardware parameters you want. Use aa_defparams
for default values.
@end table
@end quotation
@heading Description
@noindent
Attempts to find available output driver supporting the specified
parameters. First attempts to initialize the recommended drivers
and then in order drivers available in the aa_drivers array
(all regular output drivers compiled into AA-lib).
@heading Return value
@noindent
Pointer to initialized context structure when succesfull or
NULL on failure.
@node aa_close, aa_createedit, aa_autoinit, Reference
@findex aa_close
@appendixsec aa_close
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_close(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Uninitialize all activated drivers and frees the memory used by context
structures.
@node aa_createedit, aa_currentfont, aa_close, Reference
@findex aa_createedit
@appendixsec aa_createedit
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
struct aa_edit *aa_createedit
(
aa_context *c,
int x,
int y,
int size,
char *s,
int maxsize
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate of the edited text.
@item int y
Y coordinate of the edited text.
@item int size
Length of the editor window.
@item char *s
Buffer to edit (containing default value).
@item int maxsize
Size of the buffer.
@end table
@end quotation
@heading Description
@noindent
You might use this function to input strings in AA-lib programs.
This function initializes the aa_edit structure used by event-based
editor. You might then call the aa_editkey function when key is pressed.
@heading Return value
@noindent
Pointer to edit context when succesfull and NULL on failure.
@node aa_currentfont, aa_defparams, aa_createedit, Reference
@findex aa_currentfont
@appendixsec aa_currentfont
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
const struct aa_font *aa_currentfont(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns specification of the fonts used by AA-lib rendering routines.
@node aa_defparams, aa_defrenderparams, aa_currentfont, Reference
@findex aa_defparams
@appendixsec aa_defparams
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern struct aa_hardware_params aa_defparams;
@end example
@heading Description
@noindent
Pa
Default hardware paramters requested by AA-lib programs. Passed to aa_init
function familly.
@node aa_defrenderparams, aa_displayrecommended, aa_defparams, Reference
@findex aa_defrenderparams
@appendixsec aa_defrenderparams
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern struct aa_renderparams aa_defrenderparams;
@end example
@heading Description
@noindent
Default rendering parameters. Passed to aa_render function familly.
@node aa_displayrecommended, aa_dithernames, aa_defrenderparams, Reference
@findex aa_displayrecommended
@appendixsec aa_displayrecommended
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern aa_linkedlist *aa_displayrecommended;
@end example
@heading Description
@noindent
List of recommended drivers is used by aa_autoinit familly of functions
and altered by aa_recommend familly of functions.
@node aa_dithernames, aa_drivers, aa_displayrecommended, Reference
@findex aa_dithernames
@appendixsec aa_dithernames
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const char *const aa_dithernames[];
@end example
@heading Description
@noindent
NULL terminated array containing the names of supported dithering methods
as ascii strings.
@node aa_drivers, aa_editkey, aa_dithernames, Reference
@findex aa_drivers
@appendixsec aa_drivers
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_driver *const aa_drivers[];
@end example
@heading Description
@noindent
NULL-terminated array of output drivers available in AA-lib.
@node aa_editkey, aa_edit, aa_drivers, Reference
@findex aa_editkey
@appendixsec aa_editkey
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_editkey
(
struct aa_edit *e,
int c
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_edit *e
Editor context to use (see aa_createedit).
@item int c
Key pressed.
@end table
@end quotation
@heading Description
@noindent
Notify the line editor about keypress.
@node aa_edit, aa_fastrender, aa_editkey, Reference
@findex aa_edit
@appendixsec aa_edit
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_edit
(
aa_context *c,
int x,
int y,
int size,
char *s,
int maxsize
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate of the edited text.
@item int y
Y coordinate of the edited text.
@item int size
Length of the editor window.
@item char *s
Buffer to edit (containing default value).
@item int maxsize
Size of the buffer.
@end table
@end quotation
@heading Description
@noindent
This function produces the simple interactive line editor that can
be used by AA-lib programs to input strings.
@node aa_fastrender, aa_fonts, aa_edit, Reference
@findex aa_fastrender
@appendixsec aa_fastrender
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_fastrender
(
aa_context *c,
int x1,
int y1,
int x2,
int y2
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x1
Column of top left coner of rendered area
(in characters!).
@item int y1
Row of top left coner of rendered area.
@item int x2
Column of bottom right coner of rendered area.
@item int y2
Row of bottom right coner of rendered area.
@end table
@end quotation
@heading Description
@noindent
This function does the trick of converting the emulated framebuffer
into high quality ASCII-art. It is slightly faster and less flexible
the aa_render function.
Note that to see the effect you need to call aa_flush too.
First call to this function may take a while, because the rendering
tables are produced.
@node aa_fonts, aa_formats, aa_fastrender, Reference
@findex aa_fonts
@appendixsec aa_fonts
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_font *aa_fonts[];
@end example
@heading Description
@noindent
Null-terminated array of available fonts.
@node aa_formats, aa_getevent, aa_fonts, Reference
@findex aa_formats
@appendixsec aa_formats
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_format *const aa_formats[];
@end example
@heading Description
@noindent
NULL terminated array of save formats supported by AA-lib.
@node aa_getevent, aa_getkey, aa_formats, Reference
@findex aa_getevent
@appendixsec aa_getevent
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_getevent
(
aa_context *c,
int wait
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int wait
1 if you wish to wait for the even when queue is empty.
@end table
@end quotation
@heading Description
@noindent
Return next event from queue.
Return next even from queue. Optionally wait for even when queue is
empty.
@heading Return value
@noindent
Next event from queue (values lower than 256 are used to report
ascii values of pressed keys and higher values have special meanings)
See the AA-lib texinfo documentation for more details.
0 is returned when queue is empty and wait is set to 0.
@node aa_getkey, aa_getmouse, aa_getevent, Reference
@findex aa_getkey
@appendixsec aa_getkey
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_getkey
(
aa_context *c,
int wait
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int wait
1 if you wish to wait for the even when queue is empty.
@end table
@end quotation
@heading Description
@noindent
Return next keypress event from queue.
@heading Return value
@noindent
Next keypress event from queue (values lower than 256 are used
to report ascii values of pressed keys and higher values are used to
represent some special keys like arrows)
See the AA-lib texinfo documentation for more details.
@node aa_getmouse, aa_gotoxy, aa_getkey, Reference
@findex aa_getmouse
@appendixsec aa_getmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_getmouse
(
aa_context *c,
int *x,
int *y,
int *b
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int *x
Used to return X coordinate of mouse in characters.
@item int *y
Used to return Y coordinate of mouse in characters.
@item int *b
Used to return button mask of mouse.
(Values used are AA_BUTTON1, AA_BUTTON2 and AA_BUTTON3).
@end table
@end quotation
@heading Description
@noindent
Get mouse position as specified by last mouse event read by aa_getevent.
@node aa_gotoxy, aa_help, aa_getmouse, Reference
@findex aa_gotoxy
@appendixsec aa_gotoxy
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_gotoxy
(
aa_context *c,
int x,
int y
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate of new position.
@item int y
Y coordinate of the position.
@end table
@end quotation
@heading Description
@noindent
Move the hardware cursor (if any) to specified position.
To see the effect you need to call aa_flush too.
@node aa_help, aa_hidecursor, aa_gotoxy, Reference
@findex aa_help
@appendixsec aa_help
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const char *const aa_help;
@end example
@heading Description
@noindent
AA-lib help string for the default command line parser.
@node aa_hidecursor, aa_hidemouse, aa_help, Reference
@findex aa_hidecursor
@appendixsec aa_hidecursor
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_hidecursor(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Hide the hardware cursor.
This function may be ignored by some drivers.
@node aa_hidemouse, aa_image, aa_hidecursor, Reference
@findex aa_hidemouse
@appendixsec aa_hidemouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_hidemouse(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Not Documented.
@end table
@end quotation
@heading Description
@noindent
Hide the mouse cursor.
This function may be ignored by some drivers.
@node aa_image, aa_imgheight, aa_hidemouse, Reference
@findex aa_image
@appendixsec aa_image
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
char *aa_image(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
The framebuffer is simple array of characters specifying
the brightness value (or palette index depending on the aa_render
call). The array is organizated in the aa_imgheight (a) rows of
aa_imgwidth(a) characters.
@heading Return value
@noindent
Pointer to framebuffer emulated by AA-lib.
@node aa_imgheight, aa_imgwidth, aa_image, Reference
@findex aa_imgheight
@appendixsec aa_imgheight
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_imgheight(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns height of the emulated image in pixels.
@node aa_imgwidth, aa_initkbd, aa_imgheight, Reference
@findex aa_imgwidth
@appendixsec aa_imgwidth
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_imgwidth(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns width of the emulated image in pixels.
@node aa_initkbd, aa_initmouse, aa_imgwidth, Reference
@findex aa_initkbd
@appendixsec aa_initkbd
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_initkbd
(
struct aa_context *context,
const struct aa_kbddriver *drv,
int mode
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_context *context
Specifies the AA-lib context to operate on.
@item const struct aa_kbddriver *drv
Driver you wish to use.
@item int mode
Mask of extra features you request. Can contain
AA_SENDRELEASE if you are interested in release events
too.
@end table
@end quotation
@heading Description
@noindent
This is the most primitive AA-lib keyboard initialization function.
Allows better control over the process than the easier to use
aa_autoinitkbd function.
@heading Return value
@noindent
1 on success and 0 on fail.
@node aa_initmouse, aa_init, aa_initkbd, Reference
@findex aa_initmouse
@appendixsec aa_initmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_initmouse
(
struct aa_context *c,
const struct aa_mousedriver *d,
int mode
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_context *c
Specifies the AA-lib context to operate on.
@item const struct aa_mousedriver *d
Driver you wish to use.
@item int mode
Mask of extra features you request. No such features
are available in the current AA-lib version.
@end table
@end quotation
@heading Description
@noindent
This is the most primitive AA-lib keyboard initialization function.
Allows better control over the process than the easier to use
aa_autoinitmouse function.
@heading Return value
@noindent
1 on success and 0 on fail.
@node aa_init, aa_kbddrivers, aa_initmouse, Reference
@findex aa_init
@appendixsec aa_init
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
aa_context *aa_init
(
const struct aa_driver *driver,
const struct aa_hardware_params *defparams,
const void *driverdata
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const struct aa_driver *driver
Driver you want to use. Available drivers are listed
in the NULL terminated aa_drivers array.
@item const struct aa_hardware_params *defparams
Hardware parameters you want. Use aa_defparams
for default values.
@item const void *driverdata
This pointer is passed dirrectly to driver used
to specify additional driver dependent parameters.
@end table
@end quotation
@heading Description
@noindent
This is the most primitive AA-lib initialization function.
Allows better control over the process than the easier to use
aa_autoinit function.
Every AA-lib program ought to have call to aa_parseoptions before
first call to aa_init.
@heading Return value
@noindent
Pointer to new AA-lib context or NULL if failed.
@node aa_kbddrivers, aa_kbdrecommended, aa_init, Reference
@findex aa_kbddrivers
@appendixsec aa_kbddrivers
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_kbddriver *const aa_kbddrivers[];
@end example
@heading Description
@noindent
NULL-terminated array of keyboard drivers available in AA_lib.
@node aa_kbdrecommended, aa_mmheight, aa_kbddrivers, Reference
@findex aa_kbdrecommended
@appendixsec aa_kbdrecommended
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern aa_linkedlist *aa_kbdrecommended;
@end example
@heading Description
@noindent
List of recommended drivers is used by aa_autoinit familly of functions
and altered by aa_recommend familly of functions.
@node aa_mmheight, aa_mmwidth, aa_kbdrecommended, Reference
@findex aa_mmheight
@appendixsec aa_mmheight
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_mmheight(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns height of the output screen in millimeters.
@node aa_mmwidth, aa_mousedrivers, aa_mmheight, Reference
@findex aa_mmwidth
@appendixsec aa_mmwidth
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_mmwidth(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns width of the output screen in millimeters.
@node aa_mousedrivers, aa_mouserecommended, aa_mmwidth, Reference
@findex aa_mousedrivers
@appendixsec aa_mousedrivers
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_mousedriver *const aa_mousedrivers[];
@end example
@heading Description
@noindent
NULL terminated array of mouse drivers supported by AA-lib.
@node aa_mouserecommended, aa_parseoptions, aa_mousedrivers, Reference
@findex aa_mouserecommended
@appendixsec aa_mouserecommended
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern aa_linkedlist *aa_mouserecommended;
@end example
@heading Description
@noindent
List of recommended drivers is used by aa_autoinit familly of functions
and altered by aa_recommend familly of functions.
@node aa_parseoptions, aa_printf, aa_mouserecommended, Reference
@findex aa_parseoptions
@appendixsec aa_parseoptions
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_parseoptions
(
struct aa_hardware_params *p,
aa_renderparams *r,
int *argc,
char **argv
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item struct aa_hardware_params *p
Hardware parameters structure to alter. It is expected
that this structure only with necessary modifications
will be later used to initialize the AA-lib context.
@item aa_renderparams *r
Rendering prameters structure to alter. It is expected
that this structure only with necessary modifications
will be later used to render images.
@item int *argc
Pointer to argc parameter passed to function "main".
@item char **argv
Pointer to argv parameter passed to function "main".
@end table
@end quotation
@heading Description
@noindent
Use this function to parse the standard command line options used by
AA-lib. Every AA-lib program ought to call this function to let user
specify some extra parameters. The function alters the aa_hardware_params
and aa_renderparams structures and removes known options from the
argc/argv lists. It also parse the AAOPTS environment variable.
When called with NULL for the argc/argv parameters, it parses AAOPTS
only. At least this call ought to be in every AA-lib program.
@heading Return value
@noindent
1 when sucesfull and 0 on failure. The program then can
print the help text available in aa_help variable.
@node aa_printf, aa_putpixel, aa_parseoptions, Reference
@findex aa_printf
@appendixsec aa_printf
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_printf
(
aa_context *c,
int x,
int y,
enum aa_attribute attr,
const char *fmt,
...
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate of the first character.
@item int y
Y coordinate of the first character.
@item enum aa_attribute attr
Attribute to use.
@sp 1
Possible values for an @code{enum aa_attribute} are as follows:
@quotation
@table @code
@item AA_NORMAL
Normal characters.
@item AA_DIM
Dark characters.
@item AA_BOLD
Bright characters.
@item AA_BOLDFONT
Characters rendered in bold font.
@item AA_REVERSE
Reversed (black on whilte) characters.
@item AA_SPECIAL
Render characters in a way easilly visible on the
screen. The exact rendering is driver dependent,
but this mode ought to be used to output texts you
want to make easilly visible in the image.
@end table
@end quotation
@item const char *fmt
Text to output in standard printf format.
@item ...
Not Documented.
@end table
@end quotation
@heading Description
@noindent
Print given text to AA-lib output buffers. To see the effect you need to
call aa_flush too.
@node aa_putpixel, aa_puts, aa_printf, Reference
@findex aa_putpixel
@appendixsec aa_putpixel
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_putpixel
(
aa_context *c,
int x,
int y,
int color
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate.
@item int y
Y coordinate.
@item int color
Palette index or brightness value (0..255).
@end table
@end quotation
@heading Description
@noindent
Put pixel to emulated framebuffer.
@node aa_puts, aa_recommendhidisplay, aa_putpixel, Reference
@findex aa_puts
@appendixsec aa_puts
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_puts
(
aa_context *c,
int x,
int y,
enum aa_attribute attr,
const char *s
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int x
X coordinate of the first character.
@item int y
Y coordinate of the first character.
@item enum aa_attribute attr
Attribute to use.
@sp 1
Possible values for an @code{enum aa_attribute} are as follows:
@quotation
@table @code
@item AA_NORMAL
Normal characters.
@item AA_DIM
Dark characters.
@item AA_BOLD
Bright characters.
@item AA_BOLDFONT
Characters rendered in bold font.
@item AA_REVERSE
Reversed (black on whilte) characters.
@item AA_SPECIAL
Render characters in a way easilly visible on the
screen. The exact rendering is driver dependent,
but this mode ought to be used to output texts you
want to make easilly visible in the image.
@end table
@end quotation
@item const char *s
String to output.
@end table
@end quotation
@heading Description
@noindent
Output given string to AA-lib output buffers. To see the effect you need to
call aa_flush too.
@node aa_recommendhidisplay, aa_recommendhikbd, aa_puts, Reference
@findex aa_recommendhidisplay
@appendixsec aa_recommendhidisplay
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendhidisplay(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Insert the given driver on beggining of the list of recommended display drivers.
@node aa_recommendhikbd, aa_recommendhimouse, aa_recommendhidisplay, Reference
@findex aa_recommendhikbd
@appendixsec aa_recommendhikbd
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendhikbd(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Insert the given driver on beggining of the list of recommended keyboard drivers.
@node aa_recommendhimouse, aa_recommendhi, aa_recommendhikbd, Reference
@findex aa_recommendhimouse
@appendixsec aa_recommendhimouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendhimouse(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Insert the given driver on beggining of the list of recommended mouse drivers.
@node aa_recommendhi, aa_recommendlowdisplay, aa_recommendhimouse, Reference
@findex aa_recommendhi
@appendixsec aa_recommendhi
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendhi
(
aa_linkedlist **l,
const char *name
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_linkedlist **l
List to operate on (aa_displayrecommended,
aa_kbdrecommended or aa_mouserecommended).
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Insert the given driver on beggining of the list of recommended drivers.
@node aa_recommendlowdisplay, aa_recommendlowkbd, aa_recommendhi, Reference
@findex aa_recommendlowdisplay
@appendixsec aa_recommendlowdisplay
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendlowdisplay(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Add the given driver to the end of list of display recommended drivers.
@node aa_recommendlowkbd, aa_recommendlowmouse, aa_recommendlowdisplay, Reference
@findex aa_recommendlowkbd
@appendixsec aa_recommendlowkbd
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendlowkbd(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Add the given driver to the end of list of keyboard recommended drivers.
@node aa_recommendlowmouse, aa_recommendlow, aa_recommendlowkbd, Reference
@findex aa_recommendlowmouse
@appendixsec aa_recommendlowmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendlowmouse(const char *name);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Add the given driver to the end of list of mouse recommended drivers.
@node aa_recommendlow, aa_registerfont, aa_recommendlowmouse, Reference
@findex aa_recommendlow
@appendixsec aa_recommendlow
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_recommendlow
(
aa_linkedlist **l,
const char *name
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_linkedlist **l
List to operate on (aa_displayrecommended,
aa_kbdrecommended or aa_mouserecommended).
@item const char *name
Name of the driver (ought to match the "shortname"
field of the driver definition structure).
@end table
@end quotation
@heading Description
@noindent
Add the given driver to the end of list of recommended drivers.
@node aa_registerfont, aa_render, aa_recommendlow, Reference
@findex aa_registerfont
@appendixsec aa_registerfont
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_registerfont(const struct aa_font *f);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item const struct aa_font *f
Font specification structure.
@end table
@end quotation
@heading Description
@noindent
Add new font specification to aa_fonts array.
@heading Return value
@noindent
1 when succesfull or 0 on failure.
@node aa_render, aa_resizehandler, aa_registerfont, Reference
@findex aa_render
@appendixsec aa_render
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_render
(
aa_context *c,
const aa_renderparams *p,
int x1,
int y1,
int x2,
int y2
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item const aa_renderparams *p
Rendering parametters used to specify brightness, gamma
correction and other usefull stuff. Use aa_defrenderparams
for default values.
@item int x1
Column of top left coner of rendered area
(in characters!).
@item int y1
Row of top left coner of rendered area.
@item int x2
Column of bottom right coner of rendered area.
@item int y2
Row of bottom right coner of rendered area.
@end table
@end quotation
@heading Description
@noindent
This function does the trick of converting the emulated framebuffer
into high quality ASCII-art. If you want to be really fast, you might
use aa_fastrender. If you want to emulate palette, use aa_renderpalette.
Note that to see the effect you need to call aa_flush too.
First call to this function may take a while, because the rendering
tables are produced.
@node aa_resizehandler, aa_resize, aa_render, Reference
@findex aa_resizehandler
@appendixsec aa_resizehandler
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_resizehandler
(
aa_context *c,
void (*handler)(aa_context *)
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item void (*handler)(aa_context *)
Function to be called when resize happends.
@end table
@end quotation
@heading Description
@noindent
Set user handler to be called on resize event.
@node aa_resize, aa_scrheight, aa_resizehandler, Reference
@findex aa_resize
@appendixsec aa_resize
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_resize(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Do resize action. This function ought to be called when application
takes into account the AA_RESIZE event. The context is reinitialized
and set to new sizes.
@heading Return value
@noindent
0 when no resizing is done and 1 when resizing was succesfull.
@node aa_scrheight, aa_scrwidth, aa_resize, Reference
@findex aa_scrheight
@appendixsec aa_scrheight
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_scrheight(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns height of the output screen in characters.
@node aa_scrwidth, aa_setfont, aa_scrheight, Reference
@findex aa_scrwidth
@appendixsec aa_scrwidth
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
int aa_scrwidth(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Returns width of the output screen in characters.
@node aa_setfont, aa_setsupported, aa_scrwidth, Reference
@findex aa_setfont
@appendixsec aa_setfont
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_setfont
(
aa_context *c,
const struct aa_font *font
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item const struct aa_font *font
Font specification structure.
@end table
@end quotation
@heading Description
@noindent
Set font specification to be used by rendering functions.
@node aa_setsupported, aa_showcursor, aa_setfont, Reference
@findex aa_setsupported
@appendixsec aa_setsupported
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_setsupported
(
aa_context *c,
int supported
);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@item int supported
New mask of requested features. Can contain
AA_EXTENDED to enable use of all 256 characters
and AA_EIGHT to enable use of the character numbered
higher than 127.
@end table
@end quotation
@heading Description
@noindent
This function can be used to alter "supported" field of hardware-params
structure used by AA-lib.
@node aa_showcursor, aa_showmouse, aa_setsupported, Reference
@findex aa_showcursor
@appendixsec aa_showcursor
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_showcursor(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Show the hardware cursor.
This function may not be ignored by some drivers.
@node aa_showmouse, aa_text, aa_showcursor, Reference
@findex aa_showmouse
@appendixsec aa_showmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_showmouse(aa_context *c);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *c
Not Documented.
@end table
@end quotation
@heading Description
@noindent
Show the mouse cursor.
This function may be ignored by some drivers.
@node aa_text, aa_uninitkbd, aa_showmouse, Reference
@findex aa_text
@appendixsec aa_text
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
char *aa_text(aa_context *a);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *a
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
The text output buffer is simple array of characters specifying
the ascii-value of the characters.
The array is organizated in the aa_scrheight (a) rows of
aa_scrwidth(a) characters.
@heading Return value
@noindent
Pointer the text output buffer used by AA-lib.
@node aa_uninitkbd, aa_uninitmouse, aa_text, Reference
@findex aa_uninitkbd
@appendixsec aa_uninitkbd
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_uninitkbd(aa_context *context);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *context
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Calls "uninitialize" function of the keyboard driver. It ought to undo
all actions done by "initialize" function.
@node aa_uninitmouse, mem_d, aa_uninitkbd, Reference
@findex aa_uninitmouse
@appendixsec aa_uninitmouse
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
void aa_uninitmouse(aa_context *context);
@end example
@heading Parameters
@noindent
@quotation
@table @code
@item aa_context *context
Specifies the AA-lib context to operate on.
@end table
@end quotation
@heading Description
@noindent
Calls "uninitialize" function of the mouse driver. It ought to undo
all actions done by "initialize" function.
@node mem_d, save_d, aa_uninitmouse, Reference
@findex mem_d
@appendixsec mem_d
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_driver mem_d;
@end example
@heading Description
@noindent
Used to render ascii-art images into memory.
You might use this driver to render images into memory and then use your
own routines to handle them in case you want to avoid AA-lib's output
mechanizms.
@node save_d, , mem_d, Reference
@findex save_d
@appendixsec save_d
@noindent
@noindent
@example
#include <aalib.h>
@sp 1
extern const struct aa_driver save_d;
@end example
@heading Description
@noindent
Initialize this driver using aa_init function and specify the driver
dependent parameters in aa_savedata structure to save image into file.
See the texinfo documentation for details.