7fd59977 |
1 | |
2 | #include <OpenGl_tgl_all.hxx> |
3 | |
4 | #include <stddef.h> |
5 | #include <stdio.h> |
6 | |
7 | #include <OpenGl_cmn_varargs.hxx> |
8 | #include <OpenGl_telem_attri.hxx> |
9 | #include <OpenGl_tsm.hxx> |
10 | #include <OpenGl_telem.hxx> |
11 | #include <OpenGl_telem_inquire.hxx> |
12 | |
13 | static TStatus DepthCueIndexAdd( TSM_ELEM_DATA, Tint, cmn_key* ); |
14 | static TStatus DepthCueIndexDisplay( TSM_ELEM_DATA, Tint, cmn_key* ); |
15 | static TStatus DepthCueIndexPrint( TSM_ELEM_DATA, Tint, cmn_key* ); |
16 | static TStatus DepthCueIndexInquire( TSM_ELEM_DATA, Tint, cmn_key* ); |
17 | |
18 | static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) = |
19 | { |
20 | DepthCueIndexDisplay, /* PickTraverse */ |
21 | DepthCueIndexDisplay, |
22 | DepthCueIndexAdd, |
23 | 0, /* Delete */ |
24 | DepthCueIndexPrint, |
25 | DepthCueIndexInquire |
26 | }; |
27 | |
28 | |
29 | MtblPtr |
30 | TelDepthCueIndexInitClass( TelType *el ) |
31 | { |
32 | *el = TelDepthCueIndex; |
33 | return MtdTbl; |
34 | } |
35 | |
36 | static TStatus |
37 | DepthCueIndexAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
38 | { |
39 | ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata; |
40 | |
41 | return TSuccess; |
42 | } |
43 | |
44 | |
45 | static TStatus |
46 | DepthCueIndexDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
47 | { |
48 | CMN_KEY key; |
49 | |
50 | key.id = TelDepthCueIndex; |
51 | key.data.ldata = d.ldata; |
52 | TsmSetAttri( 1, &key ); |
53 | return TSuccess; |
54 | } |
55 | |
56 | |
57 | static TStatus |
58 | DepthCueIndexPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
59 | { |
60 | fprintf( stdout, "TelDepthCueIndex. Value = %d\n", data.ldata); |
61 | fprintf( stdout, "\n" ); |
62 | |
63 | return TSuccess; |
64 | } |
65 | |
66 | |
67 | static TStatus |
68 | DepthCueIndexInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
69 | { |
70 | Tint i; |
71 | |
72 | for( i = 0; i < n; i++ ) |
73 | { |
74 | switch( k[i]->id ) |
75 | { |
76 | case INQ_GET_SIZE_ID: |
77 | { |
78 | k[i]->data.ldata = sizeof( Tint ); |
79 | break; |
80 | } |
81 | case INQ_GET_CONTENT_ID: |
82 | { |
83 | TEL_INQ_CONTENT *c; |
84 | Teldata *w; |
85 | |
86 | c = (tel_inq_content)k[i]->data.pdata; |
87 | w = c->data; |
88 | c->act_size = 0; |
89 | w->idata = data.ldata; |
90 | break; |
91 | } |
92 | } |
93 | } |
94 | |
95 | return TSuccess; |
96 | } |