summaryrefslogtreecommitdiffhomepage
path: root/Tobii-EyeX/include/eyex/EyeXEvent.h
blob: 446fc4ff91ecfcf06f4117ce7cf38901ee6e6fab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*********************************************************************************************************************
 * Copyright 2013-2014 Tobii Technology AB. All rights reserved.
 * EyeXEvent.h
 *********************************************************************************************************************/

#if !defined(__TOBII_TX_EVENT_API__H__)
#define __TOBII_TX_EVENT_API__H__

/*********************************************************************************************************************/

/**
  txGetEventInteractorId

  Gets the id of the interactor for which the event should apply.
 
  @param hEvent [in]: 
    A TX_CONSTHANDLE to the event from which the interactor id should be retrieved.
    Must not be TX_EMPTY_HANDLE.
 
  @param pInteractorId [out]: 
    A TX_STRING to which the interactor id will be copied.
    Must be at least the size of the interactor id.
    Can be NULL to only get the size of the interactor.
 
  @param pInteractorIdSize [in,out]: 
    A pointer to a TX_SIZE which will be set to the size of the interactor id.
    Must not be NULL.
    The value must be 0 if pInteractorId is NULL.
 
  @return 
    TX_RESULT_OK: The interactor id or the required size of the string was successfully retrieved.
    TX_RESULT_EYEXNOTINITIALIZED: The EyeX client environment is not initialized.
    TX_RESULT_INVALIDARGUMENT: An invalid argument was passed to the function.
    TX_RESULT_INVALIDBUFFERSIZE: The size of pInteractorId is invalid (*pInteractorIdSize will be set to the required size).
 */
TX_C_BEGIN
TX_API TX_RESULT TX_CALLCONVENTION txGetEventInteractorId(
    TX_CONSTHANDLE hEvent, 
    TX_STRING pInteractorId,
    TX_SIZE* pInteractorIdSize
    );
TX_C_END

typedef TX_RESULT (TX_CALLCONVENTION *GetEventInteractorIdHook)(
    TX_CONSTHANDLE hEvent, 
    TX_STRING pInteractorId,
    TX_SIZE* pInteractorIdSize
    );


/*********************************************************************************************************************/

/**
  txGetEventBehavior

  Gets a behavior with a specified TX_BEHAVIORTYPE from an event.
  If the event does not have a behavior of the specified type this call will fail.
 
  @param hEvent [in]: 
    A TX_CONSTHANDLE to the event from which the behavior should be retrieved.
    Must not be TX_EMPTY_HANDLE.
 
  @param phBehavior [out]: 
    A pointer to a TX_HANDLE which will be set to the behavior.
    This handle must be released using txReleaseObject to avoid leaks.
    Must not be NULL.
    The value of the pointer must be set to TX_EMPTY_HANDLE.
 
  @param behaviorType [in]: 
    The TX_BEHAVIORTYPE which specifies what type of behavior to get.
 
  @return 
    TX_RESULT_OK: The behavior was successfully retrieved.
    TX_RESULT_EYEXNOTINITIALIZED: The EyeX client environment is not initialized.
    TX_RESULT_INVALIDARGUMENT: An invalid argument was passed to the function.
    TX_RESULT_NOTFOUND: This event does not have a behavior of the specified type.
 */
TX_C_BEGIN
TX_API TX_RESULT TX_CALLCONVENTION txGetEventBehavior(
    TX_CONSTHANDLE hEvent,
    TX_HANDLE* phBehavior,
    TX_BEHAVIORTYPE behaviorType
    );
TX_C_END

typedef TX_RESULT (TX_CALLCONVENTION *GetEventBehaviorHook)(
    TX_CONSTHANDLE hEvent,
    TX_HANDLE* phBehavior,
    TX_BEHAVIORTYPE behaviorType
    );

  
/*********************************************************************************************************************/

/**
  txGetEventBehaviors

  Gets the TX_HANDLEs to all the behaviors on an event.
 
  @param hEvent [in]: 
    A TX_CONSTHANDLE to the event from which to get the behaviors.
    Must not be TX_EMPTY_HANDLE.
 
  @param phBehaviors [out]: 
    A pointer to an array of TX_HANDLEs to which the behavior handles will be copied.
    These handles must be released using txReleaseObject to avoid leaks.
    Can be NULL to only get the required size.
 
  @param pBehaviorsSize [in,out]: 
    A pointer to a TX_SIZE which will be set to the number of behaviors.
    Must not be NULL.
    The value must be 0 if phBehaviors is NULL.
 
  @return 
    TX_RESULT_OK: The handles or the required size of the buffer was retrieved successfully.
    TX_RESULT_EYEXNOTINITIALIZED: The EyeX client environment is not initialized.
    TX_RESULT_INVALIDARGUMENT: An invalid argument was passed to the function.
    TX_RESULT_INVALIDBUFFERSIZE: The size of the array is invalid. (*pBehaviorsSize will be set to the number of behaviors).
 */
TX_C_BEGIN
TX_API TX_RESULT TX_CALLCONVENTION txGetEventBehaviors(
    TX_CONSTHANDLE hEvent,
    TX_HANDLE* phBehaviors,
    TX_SIZE* pBehaviorsSize
    );
TX_C_END

typedef TX_RESULT (TX_CALLCONVENTION *GetEventBehaviorsHook)(
    TX_CONSTHANDLE hEvent,
    TX_HANDLE* phBehaviors,
    TX_SIZE* pBehaviorsSize
    );


/*********************************************************************************************************************/

#endif /* !defined(__TOBII_TX_EVENT_API__H__) */

/*********************************************************************************************************************/