Gamepad

Functions

wpe_gamepad_create

struct wpe_gamepad *
wpe_gamepad_create (struct wpe_gamepad_provider * ,
                    int  uintptr_t)

Method called by WPEWebKit to create an internal representation of a gamepad device.

Parameters:

No description available
uintptr_t
No description available
Returns (struct wpe_gamepad *)

opaque libwpe's representation of a gamepad device.

Since : 1.14


wpe_gamepad_destroy

void 
wpe_gamepad_destroy (struct wpe_gamepad * )

Called by WPEWebkit to free the internal resources used by gamepad object.

Parameters:

No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_dispatch_axis_changed

void 
wpe_gamepad_dispatch_axis_changed (struct wpe_gamepad * ,
                                   enum wpe_gamepad_axis ,
                                   double  )

Method called by application (gamepad implementator). It reports to WPEWebkit a change in the position of axis.

Parameters:

No description available
No description available
No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_dispatch_button_changed

void 
wpe_gamepad_dispatch_button_changed (struct wpe_gamepad * ,
                                     enum wpe_gamepad_button ,
                                     _Bool  )

Method called by application (gamepad implementator). It reports to WPEWebkit a change in the status of button.

Parameters:

No description available
No description available
No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_get_id

const char *
wpe_gamepad_get_id (struct wpe_gamepad * )

Gets the identification string for the gamepad.

Parameters:

No description available
Returns (const char *)
No description available

Since : 1.14


wpe_gamepad_provider_create

struct wpe_gamepad_provider *
wpe_gamepad_provider_create ()

This method is called by WPEWebKit.

Returns (struct wpe_gamepad_provider *)

an opaque object representing the gamepad provider in libwpe.

Since : 1.14


wpe_gamepad_provider_destroy

void 
wpe_gamepad_provider_destroy (struct wpe_gamepad_provider * )

Frees the internal resources used by provider.

This method is called by WPEWebKit.

Parameters:

No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_provider_dispatch_gamepad_connected

void 
wpe_gamepad_provider_dispatch_gamepad_connected (struct wpe_gamepad_provider * ,
                                                 int  uintptr_t)

Method called by application (gamepad implementator) to inform WPEWebKit that a new gamepad device is plugged.

Parameters:

No description available
uintptr_t
No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_provider_dispatch_gamepad_disconnected

void 
wpe_gamepad_provider_dispatch_gamepad_disconnected (struct wpe_gamepad_provider * ,
                                                    int  uintptr_t)

Method called by application (gamepad implementator) to inform WPEWebKit that a plugged gamepad device has been unplugged.

Parameters:

No description available
uintptr_t
No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_provider_get_backend

void *
wpe_gamepad_provider_get_backend (struct wpe_gamepad_provider * )

Called by application (gamepad implementator) to access it's internal object.

Parameters:

No description available
Returns (void *)

the pointer to the implementator's object.

Since : 1.14


wpe_gamepad_provider_get_view_backend

struct wpe_view_backend *
wpe_gamepad_provider_get_view_backend (struct wpe_gamepad_provider * ,
                                       struct wpe_gamepad * )

Parameters:

No description available
No description available
Returns (struct wpe_view_backend *)
No description available

wpe_gamepad_provider_set_client

void 
wpe_gamepad_provider_set_client (struct wpe_gamepad_provider * ,
                                 struct wpe_gamepad_provider_client_interface * ,
                                 void * )

Sets WPEWebKit's callbacks for events in gamepad.

Parameters:

No description available
No description available
No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_provider_start

void 
wpe_gamepad_provider_start (struct wpe_gamepad_provider * )

Called by WPEWebkit to start provider monitoring for gamepad devices.

Parameters:

No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_provider_stop

void 
wpe_gamepad_provider_stop (struct wpe_gamepad_provider * )

Called by WPEWebkit to stop provider monitoring for gamepad devices.

Parameters:

No description available
Returns (void )
No description available

Since : 1.14


wpe_gamepad_set_client

void 
wpe_gamepad_set_client (struct wpe_gamepad * ,
                        struct wpe_gamepad_client_interface * ,
                        void * )

Parameters:

No description available
No description available
No description available
Returns (void )
No description available

wpe_gamepad_set_handler

void 
wpe_gamepad_set_handler (struct wpe_gamepad_provider_interface * ,
                         struct wpe_gamepad_interface * )

Method called by the application (gamepad implementator) to register, in libwpe, the callbacks for gamepad devices and gamepad provider.

Note that the last registered handlers will be used.

Parameters:

No description available
No description available
Returns (void )
No description available

Since : 1.14


Structures

wpe_gamepad


wpe_gamepad_client_interface

struct wpe_gamepad_client_interface {
    void (*button_changed)(void*, enum wpe_gamepad_button, bool);
    void (*axis_changed)(void*, enum wpe_gamepad_axis, double);

};

This interface is defines gamepad callbacks to notify WPEWebKit of events.

Fields

button_changed () –

Callback to inform WPEWebkit a change in the status of a button.

axis_changed () –

Callback to inform WPEWebkit a change in the status of an axis.

Since : 1.14


wpe_gamepad_interface

struct wpe_gamepad_interface {
    void* (*create)(struct wpe_gamepad*, struct wpe_gamepad_provider*, uintptr_t);
    void (*destroy)(void*);
    const char* (*get_id)(void*);

};

Fields

create () –
No description available
destroy () –
No description available
get_id () –
No description available

wpe_gamepad_provider


wpe_gamepad_provider_client_interface

struct wpe_gamepad_provider_client_interface {
    void (*connected)(void*, uintptr_t);
    void (*disconnected)(void*, uintptr_t);

};

This interface is defines gamepad provider callbacks to notify WPEWebKit of devices.

Fields

connected () –

Callback to inform WPEWebKit that a new gamepad device is plugged.

disconnected () –

Callback to inform WPEWebKit that a new gamepad device is gone.

Since : 1.14


wpe_gamepad_provider_interface

struct wpe_gamepad_provider_interface {
    void* (*create)(struct wpe_gamepad_provider*);
    void (*destroy)(void*);
    void (*start)(void*);
    void (*stop)(void*);
    struct wpe_view_backend* (*get_view_backend)(void*, void*);

};

Methods called by WebKit requesting gamepad device operations to implementator.

Fields

create () –

creates a gamepad device.

destroy () –

destroy a gamepad device.

start () –
No description available
stop () –
No description available

Since : 1.14


wpe_view_backend


Enumerations

wpe_gamepad_axis

enum wpe_gamepad_axis {
    WPE_GAMEPAD_AXIS_LEFT_STICK_X,
    WPE_GAMEPAD_AXIS_LEFT_STICK_Y,
    WPE_GAMEPAD_AXIS_RIGHT_STICK_X,
    WPE_GAMEPAD_AXIS_RIGHT_STICK_Y,
    WPE_GAMEPAD_AXIS_COUNT,
};

Standard mapping. Refer https://www.w3.org/TR/gamepad/#gamepadbutton-interface

Members

WPE_GAMEPAD_AXIS_LEFT_STICK_X (0) –

Horizontal axis for left stick (negative left/positive right).

WPE_GAMEPAD_AXIS_LEFT_STICK_Y (1) –

Vertical axis for left stick (negative up/positive down).

WPE_GAMEPAD_AXIS_RIGHT_STICK_X (2) –

Horizontal axis for right stick (negative left/positive right).

WPE_GAMEPAD_AXIS_RIGHT_STICK_Y (3) –

Vertical axis for right stick (negative up/positive down).

WPE_GAMEPAD_AXIS_COUNT (4) –

max number of axis.


wpe_gamepad_button

enum wpe_gamepad_button {
    WPE_GAMEPAD_BUTTON_BOTTOM,
    WPE_GAMEPAD_BUTTON_RIGHT,
    WPE_GAMEPAD_BUTTON_LEFT,
    WPE_GAMEPAD_BUTTON_TOP,
    WPE_GAMEPAD_BUTTON_LEFT_SHOULDER,
    WPE_GAMEPAD_BUTTON_RIGHT_SHOULDER,
    WPE_GAMEPAD_BUTTON_LEFT_TRIGGER,
    WPE_GAMEPAD_BUTTON_RIGHT_TRIGGER,
    WPE_GAMEPAD_BUTTON_SELECT,
    WPE_GAMEPAD_BUTTON_START,
    WPE_GAMEPAD_BUTTON_LEFT_STICK,
    WPE_GAMEPAD_BUTTON_RIGHT_STICK,
    WPE_GAMEPAD_BUTTON_D_PAD_TOP,
    WPE_GAMEPAD_BUTTON_D_PAD_BOTTOM,
    WPE_GAMEPAD_BUTTON_D_PAD_LEFT,
    WPE_GAMEPAD_BUTTON_D_PAD_RIGHT,
    WPE_GAMEPAD_BUTTON_CENTER,
    WPE_GAMEPAD_BUTTON_COUNT,
};

Standard mapping. Refer https://www.w3.org/TR/gamepad/#gamepadbutton-interface

Members

WPE_GAMEPAD_BUTTON_BOTTOM (0) –

Bottom button in right cluster.

WPE_GAMEPAD_BUTTON_RIGHT (1) –

Right button in right cluster.

WPE_GAMEPAD_BUTTON_LEFT (2) –

Left button in right cluster.

WPE_GAMEPAD_BUTTON_TOP (3) –

Top button in right cluster.

WPE_GAMEPAD_BUTTON_LEFT_SHOULDER (4) –

Top left front button.

WPE_GAMEPAD_BUTTON_RIGHT_SHOULDER (5) –

Top right front button.

WPE_GAMEPAD_BUTTON_LEFT_TRIGGER (6) –

Bottom left front button.

WPE_GAMEPAD_BUTTON_RIGHT_TRIGGER (7) –

Bottom right front button.

WPE_GAMEPAD_BUTTON_SELECT (8) –

Left button in center cluster.

WPE_GAMEPAD_BUTTON_START (9) –

Right button in center cluster.

WPE_GAMEPAD_BUTTON_LEFT_STICK (10) –

Left stick pressed button.

WPE_GAMEPAD_BUTTON_RIGHT_STICK (11) –

Right stick pressed button.

WPE_GAMEPAD_BUTTON_D_PAD_TOP (12) –

Top button in left cluster.

WPE_GAMEPAD_BUTTON_D_PAD_BOTTOM (13) –
No description available
WPE_GAMEPAD_BUTTON_D_PAD_LEFT (14) –

Left button in left cluster.

WPE_GAMEPAD_BUTTON_D_PAD_RIGHT (15) –

Right button in left cluster.

WPE_GAMEPAD_BUTTON_CENTER (16) –

Center button in center cluster.

WPE_GAMEPAD_BUTTON_COUNT (17) –

Max number of buttons.


The results of the search are