Support building beastpatcher with MinGW.
[kugel-rb.git] / firmware / export / button.h
blob3947f072073e0c307a01601617aa222bf81abd81
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Daniel Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef _BUTTON_H_
22 #define _BUTTON_H_
24 #include <stdbool.h>
25 #include <inttypes.h>
26 #include "config.h"
27 #ifndef __PCTOOL__
28 #include "button-target.h"
29 #endif
31 extern struct event_queue button_queue;
33 void button_init (void);
34 void button_close(void);
35 int button_queue_count(void);
36 long button_get (bool block);
37 long button_get_w_tmo(int ticks);
38 intptr_t button_get_data(void);
39 int button_status(void);
40 void button_clear_queue(void);
41 #ifdef HAVE_LCD_BITMAP
42 void button_set_flip(bool flip); /* turn 180 degrees */
43 #endif
44 #ifdef HAVE_BACKLIGHT
45 void set_backlight_filter_keypress(bool value);
46 #ifdef HAVE_REMOTE_LCD
47 void set_remote_backlight_filter_keypress(bool value);
48 #endif
49 #endif
51 #ifdef HAVE_HEADPHONE_DETECTION
52 bool headphones_inserted(void);
53 #endif
54 #ifdef HAVE_WHEEL_POSITION
55 int wheel_status(void);
56 void wheel_send_events(bool send);
57 #endif
59 #ifdef HAVE_WHEEL_ACCELERATION
60 int button_apply_acceleration(const unsigned int data);
61 #endif
63 #define BUTTON_NONE 0x00000000
65 /* Button modifiers */
66 #define BUTTON_REL 0x02000000
67 #define BUTTON_REPEAT 0x04000000
68 #define BUTTON_TOUCHSCREEN 0x08000000
70 #ifdef HAVE_TOUCHSCREEN
71 int touchscreen_last_touch(void);
73 #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
74 || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
75 || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \
76 || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \
77 || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__)
78 #error Touchscreen button mode BUTTON_* defines not set up correctly
79 #endif
81 #include "touchscreen.h"
82 #endif
84 #endif /* _BUTTON_H_ */