0022819: Redesign of OpenGl driver
[occt.git] / src / OpenGl / OpenGl_inquire.cxx
1
2 #include <OpenGl_tgl_all.hxx>
3 #include <OpenGl_tsm.hxx>
4 #include <OpenGl_cmn_varargs.hxx>
5 #include <OpenGl_telem.hxx>
6 #include <OpenGl_telem_inquire.hxx>
7
8 TStatus
9 TelInqCurElemTypeSize( TelType *element, Tint *size )
10 {
11   CMN_KEY  key;
12   TSM_ELEM elem;
13   TStatus  status;
14
15   if( TsmGetCurElem( &elem ) == TFailure )
16     return TFailure;
17
18   *element = elem.el;
19   key.id = INQ_GET_SIZE_ID;
20   status = TsmSendMessage( elem.el, Inquire, elem.data, 1, &key );
21   *size = key.data.ldata;
22
23   return status;
24 }
25
26 TStatus
27 TelInqCurElemContent( Tint size, Tchar *buf, Tint *act_size, Teldata *data )
28 {
29   CMN_KEY         key;
30   TSM_ELEM        elem;
31   TStatus         status;
32   TEL_INQ_CONTENT content;
33
34   if( TsmGetCurElem( &elem ) == TFailure )
35     return TFailure;
36
37   content.size     = size;
38   content.buf      = buf;
39   content.data     = data;
40
41   key.data.pdata   = &content;
42
43   key.id = INQ_GET_CONTENT_ID;
44   status =  TsmSendMessage( elem.el, Inquire, elem.data, 1, &key );
45   *act_size = content.act_size;
46
47   return status;
48 }