1 /*
2 * ============================================================================
3 * Title: Null Event Handling Subsystem
4 * Author: J. Zbiciak
5 * ============================================================================
6 * This backend generates no events, and has the event core short-circuit.
7 * ============================================================================
8 */
9
10 #include "config.h"
11 #include "event/event_tbl.h"
12 #include "event/event_plat.h"
13
14 /* ======================================================================== */
15 /* EVENT_PLAT_INIT -- Initializes the platform-specific code. */
16 /* ======================================================================== */
event_plat_init(const bool enable_mouse,evt_pvt_t * const evt_pvt,void ** const ptr_plat_pvt)17 int event_plat_init
18 (
19 const bool enable_mouse, /* Enable mouse events? */
20 evt_pvt_t *const evt_pvt, /* Pass back to event core. */
21 void **const ptr_plat_pvt /* For plat-specifc private struct. */
22 )
23 {
24 UNUSED(enable_mouse);
25 UNUSED(evt_pvt);
26 *ptr_plat_pvt = NULL;
27 return 0;
28 }
29
30 /* ======================================================================== */
31 /* EVENT_PLAT_DTOR -- Shuts down the platform-specific code. */
32 /* ======================================================================== */
event_plat_dtor(void * const plat_pvt)33 void event_plat_dtor(void *const plat_pvt) { UNUSED(plat_pvt); return; }
34
35 /* ======================================================================== */
36 /* EVENT_PLAT_PUMP -- Pump events, even if we're not going to consume. */
37 /* Called at the start of a tick, but before we decide to "cork." */
38 /* ======================================================================== */
event_plat_pump(evt_pvt_t * const pvt,void * const plat_pvt)39 void event_plat_pump(evt_pvt_t *const pvt, void *const plat_pvt)
40 {
41 UNUSED(pvt);
42 UNUSED(plat_pvt);
43 }
44
45 /* ======================================================================== */
46 /* EVENT_PLAT_TICK -- Performs the bulk of the tick cycle. */
47 /* */
48 /* Returns true if we should make an early exit before dequeuing. This */
49 /* typically happens when we need to "cork" for a combo. */
50 /* ======================================================================== */
event_plat_tick(evt_pvt_t * const pvt,void * const plat_pvt)51 bool event_plat_tick(evt_pvt_t *const pvt, void *const plat_pvt)
52 {
53 UNUSED(pvt);
54 UNUSED(plat_pvt);
55 return true; /* always short-circuit the main event core. */
56 }
57
58 /* ======================================================================== */
59 /* EVENT_PLAT_TICK_LATE -- Performs deferred tick cycle tasks, after we */
60 /* have drained our internal event queue. */
61 /* */
62 /* Currently this is only used by SDL's experimental mouse processing. */
63 /* Not sure if this is really necessary. */
64 /* ======================================================================== */
event_plat_tick_late(evt_pvt_t * const pvt,void * const plat_pvt)65 void event_plat_tick_late(evt_pvt_t *const pvt, void *const plat_pvt)
66 {
67 UNUSED(pvt);
68 UNUSED(plat_pvt);
69 }
70
71 /* ======================================================================== */
72 /* This program is free software; you can redistribute it and/or modify */
73 /* it under the terms of the GNU General Public License as published by */
74 /* the Free Software Foundation; either version 2 of the License, or */
75 /* (at your option) any later version. */
76 /* */
77 /* This program is distributed in the hope that it will be useful, */
78 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
79 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
80 /* General Public License for more details. */
81 /* */
82 /* You should have received a copy of the GNU General Public License along */
83 /* with this program; if not, write to the Free Software Foundation, Inc., */
84 /* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
85 /* ======================================================================== */
86 /* Copyright (c) 1998-2020, Joseph Zbiciak */
87 /* ======================================================================== */
88