• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /***************************************************************************
2 *
3 * Copyright 2015, Codethink Ltd.
4 *
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *        http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 ****************************************************************************/
19 #ifndef _ILM_INPUT_H_
20 #define _ILM_INPUT_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
26 #include "ilm_common.h"
27 
28 /**
29  * \brief      Set the surface's accepted seats to the list specified
30  * \ingroup    ilmControl
31  * \param[in]  surfaceID   The surface whose list of accepted seats is to be
32  *                         changed
33  * \param[in]  num_seats   The number of seats stored in seats
34  * \param[in]  seats       A pointer to an array of strings listing each seat
35  *                         to accept by its seat name
36  * \return     ILM_SUCCESS if the method call was successful
37  * \return     ILM_FAILED  if the client cannot call the method on the surface
38  */
39 ilmErrorTypes
40 ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats,
41                          t_ilm_string *seats);
42 
43 /**
44  * \brief      Get the surface's list of accepted seats
45  * \ingroup    ilmControl
46  * \param[in]  surfaceID   The surface that the list of seats comes from
47  * \param[out] num_seats   The number of seats returned
48  * \param[out] seats       A pointer to the memory where an array of seats is
49  *                         stored. It is the caller's responsibility to free
50  *                         this memory after use.
51  * \return     ILM_SUCCESS if the method call was successful
52  * \return     ILM_FAILED  if the client cannot call the method on the surface
53  */
54 ilmErrorTypes
55 ilm_getInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint *num_seats,
56                          t_ilm_string **seats);
57 
58 /**
59  * \brief      Get the list of seats that support the device types specified in
60  *             bitmask
61  * \ingroup    ilmControl
62  * \param[in]  bitmask      The bitmask that indicates what type of devices
63  *                          are requested (e.g. ILM_INPUT_DEVICE_POINTER)
64  * \param[out] num_seats    The number of seats returned
65  * \param[out] seats        A pointer to the memory where an array of seats is
66  *                          stored. It is the caller's responsibility to free
67  *                          this memory after use.
68  * \return     ILM_SUCCESS  if the method call was successful
69  * \return     ILM_FAILED   if the method call was unsuccessful
70  */
71 ilmErrorTypes
72 ilm_getInputDevices(ilmInputDevice bitmask, t_ilm_uint *num_seats,
73                     t_ilm_string **seats);
74 /**
75  * \brief      Get the device capabilities of a seat
76  * \ingroup    ilmControl
77  * \param[in]  seat_name    The name of the seat
78  * \param[out] bitmask      A pointer to the bitmask that should be set
79  * \return     ILM_SUCCESS  if the method call was successful
80  * \return     ILM_FAILED   if the method call was unsuccessful
81  */
82 ilmErrorTypes
83 ilm_getInputDeviceCapabilities(t_ilm_string seat_name, ilmInputDevice* bitmask);
84 
85 /**
86  * \brief      Set whether the specified surfaces have input focus set for the
87  *             given device types
88  * \ingroup    ilmControl
89  * \param[in]  surfaceIDs   An array of surface IDs whose input focus may be
90  *                          changed
91  * \param[in]  num_surfaces The number of surfaces in surfaceIDs
92  * \param[in]  bitmask      A bitmask of the types of device for which focus
93  *                          will be set
94  * \param[in]  is_set       ILM_TRUE if focus is to be set, ILM_FALSE if focus
95  *                          is to be unset
96  * \return     ILM_SUCCESS if the method call was successful
97  * \return     ILM_FAILED  if the method call was unsuccessful
98  */
99 ilmErrorTypes
100 ilm_setInputFocus(t_ilm_surface *surfaceIDs, t_ilm_uint num_surfaces,
101                   ilmInputDevice bitmask, t_ilm_bool is_set);
102 
103 /**
104  * \brief      Get all surface IDs and their corresponding focus bitmasks
105  * \ingroup    ilmControl
106  * \param[out] surfaceIDs  A pointer to the memory where an array of surface
107  *                         IDs will be created. The caller is responsible for
108  *                         freeing this memory after use.
109  * \param[out] bitmasks    A pointer to the memory where an array of bitmasks
110  *                         will be created. The caller is responsible for
111  *                         freeing this memory after use.
112  * \param[out] num_ids     The number of surface IDs that were returned
113  * \return     ILM_SUCCESS if the method call was successful
114  * \return     ILM_FAILED  if the method call was unsuccessful
115  */
116 ilmErrorTypes
117 ilm_getInputFocus(t_ilm_surface **surfaceIDs, ilmInputDevice** bitmasks,
118                   t_ilm_uint *num_ids);
119 
120 #ifdef __cplusplus
121 } /**/
122 #endif /* __cplusplus */
123 
124 #endif /* _ILM_INPUT_H_ */
125