2 * Copyright (C) 2005-2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "Resolution.h"
12 #include "input/XBMC_keyboard.h"
14 /* Event enumerations */
17 XBMC_NOEVENT
= 0, /* Unused (do not remove) */
18 XBMC_KEYDOWN
, /* Keys pressed */
19 XBMC_KEYUP
, /* Keys released */
20 XBMC_MOUSEMOTION
, /* Mouse moved */
21 XBMC_MOUSEBUTTONDOWN
, /* Mouse button pressed */
22 XBMC_MOUSEBUTTONUP
, /* Mouse button released */
23 XBMC_QUIT
, /* User-requested quit */
24 XBMC_VIDEORESIZE
, /* User resized video mode */
25 XBMC_FULLSCREEN_UPDATE
, /* Triggered by an OS event when Kodi is running in fullscreen, rescale and repositioning is required */
26 XBMC_VIDEOMOVE
, /* User moved the window */
27 XBMC_MODECHANGE
, /* Video mode must be changed */
29 XBMC_BUTTON
, /* Button (remote) pressed */
33 XBMC_MAXEVENT
= 256 /* XBMC_EventType is represented as uchar */
36 /* Keyboard event structure */
37 typedef struct XBMC_KeyboardEvent
{
41 /* Mouse motion event structure */
42 typedef struct XBMC_MouseMotionEvent
{
43 uint16_t x
, y
; /* The X/Y coordinates of the mouse */
44 } XBMC_MouseMotionEvent
;
46 /* Mouse button event structure */
47 typedef struct XBMC_MouseButtonEvent
{
48 unsigned char button
; /* The mouse button index */
49 uint16_t x
, y
; /* The X/Y coordinates of the mouse at press time */
50 } XBMC_MouseButtonEvent
;
52 /* The "window resized" event
53 When you get this event, you are responsible for setting a new video
54 mode with the new width and height.
56 typedef struct XBMC_ResizeEvent
{
57 int w
; /* New width */
58 int h
; /* New height */
61 typedef struct XBMC_MoveEvent
{
62 int x
; /* New x position */
63 int y
; /* New y position */
66 struct XBMC_ModeChangeEvent
71 /* The "quit requested" event */
72 typedef struct XBMC_QuitEvent
{
75 /* A user-defined event type */
76 typedef struct XBMC_UserEvent
{
77 int code
; /* User defined event code */
78 void *data1
; /* User defined data pointer */
79 void *data2
; /* User defined data pointer */
82 /* Multimedia keys on keyboards / remotes are mapped to APPCOMMAND events */
83 typedef struct XBMC_AppCommandEvent
{
84 unsigned int action
; /* One of ACTION_... */
85 } XBMC_AppCommandEvent
;
87 /* Mouse motion event structure */
88 typedef struct XBMC_TouchEvent
{
89 int action
; /* action ID */
90 float x
, y
; /* The X/Y coordinates of the mouse */
91 float x2
, y2
; /* Additional X/Y coordinates */
92 float x3
, y3
; /* Additional X/Y coordinates */
93 int pointers
; /* number of touch pointers */
96 typedef struct XBMC_SetFocusEvent
{
97 int x
; /* x position */
98 int y
; /* y position */
101 /* Button event structure */
102 typedef struct XBMC_ButtonEvent
108 /* General event structure */
109 typedef struct XBMC_Event
{
113 XBMC_KeyboardEvent key
;
114 XBMC_MouseMotionEvent motion
;
115 XBMC_MouseButtonEvent button
;
116 XBMC_ResizeEvent resize
;
118 XBMC_ModeChangeEvent mode
;
121 XBMC_AppCommandEvent appcommand
;
122 XBMC_TouchEvent touch
;
123 XBMC_ButtonEvent keybutton
;
124 XBMC_SetFocusEvent focus
;