Update of /cvsroot/q-lang/q/modules/ggi
In directory sc8-pr-cvs1:/tmp/cvs-serv27867
Modified Files:
ggi.c ggi.q
Log Message:
added functions to retrieve the current antialias mode and transform
Index: ggi.c
===================================================================
RCS file: /cvsroot/q-lang/q/modules/ggi/ggi.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ggi.c 20 Dec 2003 21:41:27 -0000 1.11
--- ggi.c 20 Dec 2003 22:06:16 -0000 1.12
***************
*** 1115,1118 ****
--- 1115,1133 ----
}
+ FUNCTION(ggi,ggi_get_antialias,argc,argv)
+ {
+ #ifdef HAVE_FT2
+ visual_t *v;
+ if (init && argc == 1 && isobj(argv[0], type(GGIVisual), (void**)&v) &&
+ v->vis && v->face) {
+ if (v->aa)
+ return mktrue;
+ else
+ return mkfalse;
+ } else
+ #endif
+ return __FAIL;
+ }
+
FUNCTION(ggi,ggi_set_transform,argc,argv)
{
***************
*** 1159,1162 ****
--- 1174,1212 ----
}
return mkvoid;
+ } else
+ #endif
+ return __FAIL;
+ }
+
+ FUNCTION(ggi,ggi_get_transform_vector,argc,argv)
+ {
+ #ifdef HAVE_FT2
+ visual_t *v;
+ if (init && argc == 1 && isobj(argv[0], type(GGIVisual), (void**)&v) &&
+ v->vis && v->face) {
+ if (v->vect)
+ return mktuplel(2, mkfloat(((double)v->vect->x)/0x40),
+ mkfloat(((double)v->vect->y)/0x40));
+ else
+ return mktuplel(2, mkfloat(0.0), mkfloat(0.0));
+ } else
+ #endif
+ return __FAIL;
+ }
+
+ FUNCTION(ggi,ggi_get_transform_matrix,argc,argv)
+ {
+ #ifdef HAVE_FT2
+ visual_t *v;
+ if (init && argc == 1 && isobj(argv[0], type(GGIVisual), (void**)&v) &&
+ v->vis && v->face) {
+ if (v->matrix)
+ return mktuplel(4, mkfloat(((double)v->matrix->xx)/0x10000L),
+ mkfloat(((double)v->matrix->xy)/0x10000L),
+ mkfloat(((double)v->matrix->yx)/0x10000L),
+ mkfloat(((double)v->matrix->yy)/0x10000L));
+ else
+ return mktuplel(4, mkfloat(1.0), mkfloat(0.0), mkfloat(0.0),
+ mkfloat(1.0));
} else
#endif
Index: ggi.q
===================================================================
RCS file: /cvsroot/q-lang/q/modules/ggi/ggi.q,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ggi.q 20 Dec 2003 21:29:36 -0000 1.6
--- ggi.q 20 Dec 2003 22:06:16 -0000 1.7
***************
*** 377,392 ****
/* Specify whether the font should be antialiased. If true (which is the
default), text will be rendered in up to 256 different shades of the
! foreground color, to give it a smoother appearance. */
! public extern ggi_set_antialias VIS FLAG;
/* Specify an affine transformation to be applied before a string is rendered
on the visual. The font must be scalable for this to work. This can be used
to print translated, rotated and stretched text. The transformation is
! given by a translation vector VECT = (X,Y) and a 2x2 matrix MATRIX =
(XX,XY,YX,YY). E.g., to rotate text by an angle A counter-clockwise, you
would use a transform matrix of the form (cos A, -sin A, sin A, cos A). */
! public extern ggi_set_transform VIS VECT MATRIX;
/* Retrieve general information about the loaded font. The ggi_get_font_info
--- 377,399 ----
/* Specify whether the font should be antialiased. If true (which is the
default), text will be rendered in up to 256 different shades of the
! foreground color, to give it a smoother appearance. The ggi_get_antialias
! function is used to retrieve the current setting. */
! public extern ggi_set_antialias VIS FLAG, ggi_get_antialias VIS;
/* Specify an affine transformation to be applied before a string is rendered
on the visual. The font must be scalable for this to work. This can be used
to print translated, rotated and stretched text. The transformation is
! given by a translation vector VECTOR = (X,Y) and a 2x2 matrix MATRIX =
(XX,XY,YX,YY). E.g., to rotate text by an angle A counter-clockwise, you
would use a transform matrix of the form (cos A, -sin A, sin A, cos A). */
! public extern ggi_set_transform VIS VECTOR MATRIX;
!
! /* The following functions can be used to retrieve the current transform
! vector and matrix. */
!
! public extern ggi_get_transform_vector VIS;
! public extern ggi_get_transform_matrix VIS;
/* Retrieve general information about the loaded font. The ggi_get_font_info
|