# Home AESAES Shell libraryShell library Font selectionFont selection

8.20 Extended graphics library

This library contains functions to animate moving (expanding or contracting) rectangles. The following routines are available for this purpse:

xgrf_2box Animation of moving rectangles
xgrf_stepcalc Parameter calculation for rectangle animation

Note: These functions should be seen primarily as replacements for the functions graf_growbox and graf_shrinkbox, that in PC-GEM were a casualty of the legal dispute between Apple and Digital Research.

See also: graf_growbox   graf_shrinkbox   Style guidelines

8.20.1 xgrf_2box

Name: »Animate rectangles« - Draw a set of moving rectangles.
 
Opcode: 131
 
Syntax: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
 
Description: The call xgrf_2box draws a set of rectangles that move on the screen. The following apply:
 
Parameter Meaning
   
cx Start position in X-direction
cy Start position in Y-direction
w Width of start position
h Height of start position
corners Draw:
0 = Draw complete rectangles
1 = Draw only the corners
cnt Number of single steps
xstep Step size in X-direction
ystep Step size in Y-direction
doubled Step size
0 = Normal step size
1 = Doubled step size

Note: The function is a replacement for the deleted functions of the FORM and GRAF libraries in PC-GEM (due to the legal dispute between Apple and Digital Research).
 
Return value: This is unknown at present.
 
Availability: The function is available only as of PC-GEM 2.0, as of KAOS 1.4.2 and MagiC.
 
Group: Extended graphics library
 
See also: Binding   xgrf_stepcalc   MagiC
 

8.20.2 Bindings for xgrf_2box

C: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
 
Binding:
 
int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w,
                    int16_t h, int16_t corners, int16_t cnt,
                    int16_t xstep, int16_t ystep,
                    int16_t doubled )
{
   int_in[0] = cnt;
   int_in[1] = xstep;
   int_in[2] = ystep;
   int_in[3] = doubled;
   int_in[4] = corners;
   int_in[5] = cx;
   int_in[6] = cy;
   int_in[7] = w;
   int_in[8] = h;

   return ( crys_if(131) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 131 # Function opcode
control+2 control[1] 9 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] cnt
int_in+2 int_in[1] xstep
int_in+4 int_in[2] ystep
int_in+6 int_in[3] doubled
int_in+8 int_in[4] corners
int_in+10 int_in[5] cx
int_in+12 int_in[6] cy
int_in+14 int_in[7] w
int_in+16 int_in[8] h
int_out int_out[0] Return value

8.20.3 xgrf_stepcalc

Name: »Stepcalc for XGraf« - Parameter calculation for the animation of rectangles.
 
Opcode: 130
 
Syntax: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
 
Description: The call xgrf_stepcalc calculates all parameters for a call of xgrf_2box. The following apply:
 
Parameter Meaning
   
orgw Starting width
orgh Starting height
xc End position in X-direction
yc End position in Y-direction
w Width of final size
h Height of final size
pcx Centred position at completion of process in X-direction
pcy Ditto for Y-directiong
pcnt Number of single steps
pxstep Step size in X-direction
pystep Step size in Y-direction

Note: The centred position, number of steps as well as step size are calculated from the starting size, final size and the end positions of the rectangle.
 
Return value: This is unknown at present.
 
Availability: The function is available only as of PC-GEM 2.0, as of KAOS 1.4.2 and MagiC.
 
Group: Extended graphics library
 
See also: Binding   xgrf_2box   MagiC
 

8.20.4 Bindings for xgrf_stepcalc

C: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
 
Binding:
 
int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh,
                        int16_t xc, int16_t yc,
                        int16_t w, int16_t h,
                        int16_t *pcx, int16_t *pcy,
                        int16_t *pcnt,
                        int16_t *pxstep, int16_t *pystep )
{
   int_in[0] = orgw;
   int_in[1] = orgh;
   int_in[2] = xc;
   int_in[3] = yc;
   int_in[4] = w;
   int_in[5] = h;

   crys_if (130);

   *pcx    = int_out[1];
   *pcy    = int_out[2];
   *pcnt   = int_out[3];
   *pxstep = int_out[4];
   *pystep = int_out[5];

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 130 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 6 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] orgw
int_in+2 int_in[1] orgh
int_in+4 int_in[2] xc
int_in+6 int_in[3] yc
int_in+8 int_in[4] w
int_in+10 int_in[5] h
int_out int_out[0] Return value
int_out+2 int_out[1] pcx
int_out+4 int_out[2] pcy
int_out+6 int_out[3] pcnt
int_out+8 int_out[4] pxstep
int_out+10 int_out[5] pystep

8.20.5 xgrf_color

Name: »« - Set color category for various window elements.
 
Opcode: 132
 
Syntax: int16_t xgrf_color ( int16_t color, int16_t fgclr, int16_t bkclr, int16_t style, int16_t pattern );
 
Description:
 
CC_NAME (8) Window title bar selected.
 
CC_SLIDER (9)
 
CC_DESKTOP (10)
 
CC_BUTTON (11)
 
CC_INFO (12) Info bar.
 
CC_ALERT (13)
 
CC_SLCTDNAME (14) Window title bar normal.
 
CC_3DSHADE (16)
 
CC_RADIO (17)
 
CC_CHECK (18)
 
CC_NAMETEXT (19) Text of active titlebar.
 
CC_NNAMETEXT (20) Text of inactive titlebar.
 
CC_INFOTEXT (21) Text of info bar.
 
Availability: The function is available only as of ViewMAX/2.
 
Group: Extended graphics library
 

8.20.6 xgrf_dtimage

Name: »« - Set desktop image
 
Opcode: 133
 
Syntax: int16_t xgrf_dtimage ( MFDB *image );
 
Description:
 
Availability: The function is available only as of ViewMAX/3.
 
Group: Extended graphics library
 

Home AESAES Shell libraryShell library Font selectionFont selection