Skip to content

Commit 3539f5a

Browse files
ceyusaaperezdc
authored andcommitted
gamepad: Add wpe_gamepad_provider_get_implementator_backend()
So implementators can get access of their internal gamepad provider.
1 parent 2f59e56 commit 3539f5a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

include/wpe/gamepad.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ void wpe_gamepad_provider_start(struct wpe_gamepad_provider*);
256256
WPE_EXPORT
257257
void wpe_gamepad_provider_stop(struct wpe_gamepad_provider*);
258258

259+
/**
260+
* wpe_gamepad_provider_get_backend:
261+
* @provider: opaque libwpe's representation of gamepad provider.
262+
*
263+
* Called by application (gamepad implementator) to access it's internal object.
264+
265+
* Returns: the pointer to the implementator's object.
266+
*
267+
* Since: 1.14
268+
*/
269+
WPE_EXPORT
270+
void* wpe_gamepad_provider_get_backend(struct wpe_gamepad_provider*);
271+
259272
/**
260273
* wpe_gampepad_provider_get_view_backend:
261274
* @provider: opaque libwpe's representation of gamepad provider.

src/gamepad.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ wpe_gamepad_provider_stop(struct wpe_gamepad_provider* provider)
8888
provider_interface->stop(provider->backend);
8989
}
9090

91+
void*
92+
wpe_gamepad_provider_get_backend(struct wpe_gamepad_provider* provider)
93+
{
94+
if (provider)
95+
return provider->backend;
96+
return NULL;
97+
}
98+
9199
struct wpe_view_backend*
92100
wpe_gamepad_provider_get_view_backend(struct wpe_gamepad_provider* provider, struct wpe_gamepad* gamepad)
93101
{

0 commit comments

Comments
 (0)