1 /***********************************************************************
5 File OpenGl_textheight :
12 HISTORIQUE DES MODIFICATIONS :
13 --------------------------------
14 xx-xx-xx : xxx ; Creation.
15 20-02-96 : FMN ; Suppression code inutile:
16 01-04-96 : CAL ; Integration MINSK portage WNT
17 26-04-96 : FMN ; Correction warning de compilation.
18 20-11-97 : CAL ; RererereMerge avec le source de portage.
19 17-12-96 : FMN ; Warning de compilation.
21 ************************************************************************/
23 #define BUC60821 //GG 12/02/01 allow tu use the nearest font size.
25 /*----------------------------------------------------------------------*/
30 #include <OpenGl_tgl_all.hxx>
35 #include <OpenGl_cmn_varargs.hxx>
36 #include <OpenGl_telem_attri.hxx>
37 #include <OpenGl_tsm.hxx>
38 #include <OpenGl_telem.hxx>
39 #include <OpenGl_telem_inquire.hxx>
40 #include <OpenGl_tgl_tox.hxx>
41 #include <OpenGl_Memory.hxx>
44 /*----------------------------------------------------------------------*/
49 static TStatus TextHeightDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
50 static TStatus TextHeightAdd( TSM_ELEM_DATA, Tint, cmn_key* );
51 static TStatus TextHeightDelete( TSM_ELEM_DATA, Tint, cmn_key* );
52 static TStatus TextHeightPrint( TSM_ELEM_DATA, Tint, cmn_key* );
53 static TStatus TextHeightInquire( TSM_ELEM_DATA, Tint, cmn_key* );
55 /*----------------------------------------------------------------------*/
56 static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
58 TextHeightDisplay, /* PickTraverse */
67 /*----------------------------------------------------------------------*/
69 TelTextHeightInitClass( TelType *el )
75 /*----------------------------------------------------------------------*/
77 TextHeightAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
79 Tfloat *data = new Tfloat();
84 *data = k[0]->data.fdata;
89 call_tox_getscreen( &d_wdth, &d_hght );
90 *data = k[0]->data.fdata * d_hght;
93 *data = k[0]->data.fdata;
97 ((tsm_elem_data)(d.pdata))->pdata = data;
103 /*----------------------------------------------------------------------*/
105 TextHeightDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k )
109 key.id = TelTextHeight;
110 key.data.fdata = *(Tfloat*)(data.pdata);
111 TsmSetAttri( 1, &key );
117 /*----------------------------------------------------------------------*/
119 TextHeightDelete( TSM_ELEM_DATA data, Tint n, cmn_key *k )
127 /*----------------------------------------------------------------------*/
129 TextHeightPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
131 fprintf( stdout, "TelTextHeight. Value = %g\n", *(Tfloat *)(data.pdata));
132 fprintf( stdout, "\n" );
138 /*----------------------------------------------------------------------*/
140 TextHeightInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
143 Tfloat *f = (Tfloat*)data.pdata;
145 for( i = 0; i < n; i++ )
149 case INQ_GET_SIZE_ID:
151 k[i]->data.ldata = sizeof( Tint );
154 case INQ_GET_CONTENT_ID:
159 c = (TEL_INQ_CONTENT *)k[i]->data.pdata;
170 /*----------------------------------------------------------------------*/