summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h99
1 files changed, 87 insertions, 12 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
index 4ce5bbc..79ca778 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h
@@ -131,17 +131,6 @@ GAME_ERROR HwContextDestroy(void);
131// --- Input operations -------------------------------------------------------- 131// --- Input operations --------------------------------------------------------
132 132
133/*! 133/*!
134 * \brief Notify the add-on of a status change on an open port
135 *
136 * Ports can be opened using the OpenPort() callback
137 *
138 * \param port Non-negative for a joystick port, or GAME_INPUT_PORT value otherwise
139 * \param collected True if a controller was connected, false if disconnected
140 * \param controller The connected controller
141 */
142void UpdatePort(int port, bool connected, const game_controller* controller);
143
144/*!
145 * \brief Check if input is accepted for a feature on the controller 134 * \brief Check if input is accepted for a feature on the controller
146 * 135 *
147 * If only a subset of the controller profile is used, this can return false 136 * If only a subset of the controller profile is used, this can return false
@@ -156,6 +145,88 @@ void UpdatePort(int port, bool connected, const game_controller* controller);
156bool HasFeature(const char* controller_id, const char* feature_name); 145bool HasFeature(const char* controller_id, const char* feature_name);
157 146
158/*! 147/*!
148 * \brief Get the input topolgy that specifies which controllers can be connected
149 *
150 * \return The input topology, or null to use the default
151 *
152 * If this returns non-null, topology must be freed using FreeTopology().
153 *
154 * If this returns null, the topology will default to a single port that can
155 * accept all controllers imported by addon.xml. The port ID is set to
156 * the DEFAULT_PORT_ID constant.
157 */
158game_input_topology* GetTopology();
159
160/*!
161 * \brief Free the topology's resources
162 *
163 * \param topology The topology returned by GetTopology()
164 */
165void FreeTopology(game_input_topology* topology);
166
167/*!
168 * \brief Enable/disable keyboard input using the specified controller
169 *
170 * \param enable True to enable input, false otherwise
171 * \param controller The controller info if enabling, or unused if disabling
172 *
173 * \return True if keyboard input was enabled, false otherwise
174 */
175bool EnableKeyboard(bool enable, const game_controller* controller);
176
177/*!
178 * \brief Enable/disable mouse input using the specified controller
179 *
180 * \param enable True to enable input, false otherwise
181 * \param controller The controller info if enabling, or unused if disabling
182 *
183 * \return True if mouse input was enabled, false otherwise
184 */
185bool EnableMouse(bool enable, const game_controller* controller);
186
187/*!
188 * \brief Connect/disconnect a controller to a port on the virtual game console
189 *
190 * \param connect True to connect a controller, false to disconnect
191 * \param address The address of the port
192 * \param controller The controller info if connecting, or unused if disconnecting
193 *
194 * The address is a string that allows traversal of the controller topology.
195 * It is formed by alternating port IDs and controller IDs separated by "/".
196 *
197 * For example, assume that the topology represented in XML for Snes9x is:
198 *
199 * <logicaltopology>
200 * <port type="controller" id="1">
201 * <accepts controller="game.controller.snes"/>
202 * <accepts controller="game.controller.snes.multitap">
203 * <port type="controller" id="1">
204 * <accepts controller="game.controller.snes"/>
205 * </port>
206 * <port type="controller" id="2">
207 * <accepts controller="game.controller.snes"/>
208 * </port>
209 * ...
210 * </accepts>
211 * </port>
212 * </logicaltopology>
213 *
214 * To connect a multitap to the console's first port, the multitap's controller
215 * info is set using the port address:
216 *
217 * 1
218 *
219 * To connect a SNES controller to the second port of the multitap, the
220 * controller info is next set using the address:
221 *
222 * 1/game.controller.multitap/2
223 *
224 * Any attempts to connect a controller to a port on a disconnected multitap
225 * will return false.
226 */
227bool ConnectController(bool connect, const char* port_address, const game_controller* controller);
228
229/*!
159 * \brief Notify the add-on of an input event 230 * \brief Notify the add-on of an input event
160 * 231 *
161 * \param event The input event 232 * \param event The input event
@@ -247,8 +318,12 @@ void __declspec(dllexport) get_addon(void* ptr)
247 pClient->toAddon.Reset = Reset; 318 pClient->toAddon.Reset = Reset;
248 pClient->toAddon.HwContextReset = HwContextReset; 319 pClient->toAddon.HwContextReset = HwContextReset;
249 pClient->toAddon.HwContextDestroy = HwContextDestroy; 320 pClient->toAddon.HwContextDestroy = HwContextDestroy;
250 pClient->toAddon.UpdatePort = UpdatePort;
251 pClient->toAddon.HasFeature = HasFeature; 321 pClient->toAddon.HasFeature = HasFeature;
322 pClient->toAddon.GetTopology = GetTopology;
323 pClient->toAddon.FreeTopology = FreeTopology;
324 pClient->toAddon.EnableKeyboard = EnableKeyboard;
325 pClient->toAddon.EnableMouse = EnableMouse;
326 pClient->toAddon.ConnectController = ConnectController;
252 pClient->toAddon.InputEvent = InputEvent; 327 pClient->toAddon.InputEvent = InputEvent;
253 pClient->toAddon.SerializeSize = SerializeSize; 328 pClient->toAddon.SerializeSize = SerializeSize;
254 pClient->toAddon.Serialize = Serialize; 329 pClient->toAddon.Serialize = Serialize;