7fd59977 |
1 | |
2 | /*OCC7456 abd 14.12.2004 Text alingnment attributes */ |
3 | |
4 | #include <stddef.h> |
5 | #include <stdio.h> |
6 | |
7 | #include <OpenGl_tgl_all.hxx> |
8 | |
9 | #include <OpenGl_cmn_varargs.hxx> |
10 | #include <OpenGl_telem_attri.hxx> |
11 | #include <OpenGl_tsm.hxx> |
12 | #include <OpenGl_telem.hxx> |
13 | #include <OpenGl_telem_inquire.hxx> |
14 | #include <OpenGl_Memory.hxx> |
15 | |
16 | static TStatus TextAlignDisplay( TSM_ELEM_DATA, Tint, cmn_key* ); |
17 | static TStatus TextAlignAdd( TSM_ELEM_DATA, Tint, cmn_key* ); |
18 | static TStatus TextAlignPrint( TSM_ELEM_DATA, Tint, cmn_key* ); |
19 | |
20 | static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) = |
21 | { |
22 | 0, /* PickTraverse */ |
23 | TextAlignDisplay, |
24 | TextAlignAdd, |
25 | 0, /* Delete */ |
26 | TextAlignPrint, |
27 | 0 /* Inquire */ |
28 | }; |
29 | |
30 | MtblPtr |
31 | TelTextAlignInitClass( TelType *el ) |
32 | { |
33 | *el = TelTextAlign; |
34 | return MtdTbl; |
35 | } |
36 | |
37 | static TStatus |
38 | TextAlignDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
39 | { |
40 | CMN_KEY key; |
41 | |
42 | key.id = TelTextAlign; |
43 | key.data.pdata = data.pdata; |
44 | TsmSetAttri( 1, &key ); |
45 | return TSuccess; |
46 | } |
47 | |
48 | static TStatus |
49 | TextAlignAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
50 | { |
51 | tel_align_data data = new TEL_ALIGN_DATA(); |
52 | if( !data ) |
53 | return TFailure; |
54 | |
55 | *data = *(tel_align_data)(k[0]->data.pdata); |
56 | |
57 | ((tsm_elem_data)(d.pdata))->pdata = data; |
58 | |
59 | return TSuccess; |
60 | } |
61 | |
62 | |
63 | static TStatus |
64 | TextAlignPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
65 | { |
66 | fprintf( stdout, "TelTextHAlign. Value = %d\n", data.ldata); |
67 | fprintf( stdout, "\n" ); |
68 | |
69 | return TSuccess; |
70 | } |