crappy band-aid fix for statusbar being screwed after leaving plugins...
[kugel-rb.git] / firmware / export / button.h
blob3aac1af9d6f507159524a01358004927713f316d
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 #ifdef HAVE_BUTTON_DATA
41 int button_status_wdata(int *pdata);
42 #endif
43 void button_clear_queue(void);
44 #ifdef HAVE_LCD_BITMAP
45 void button_set_flip(bool flip); /* turn 180 degrees */
46 #endif
47 #ifdef HAVE_BACKLIGHT
48 void set_backlight_filter_keypress(bool value);
49 #ifdef HAVE_REMOTE_LCD
50 void set_remote_backlight_filter_keypress(bool value);
51 #endif
52 #endif
54 #ifdef HAVE_HEADPHONE_DETECTION
55 bool headphones_inserted(void);
56 #endif
57 #ifdef HAVE_WHEEL_POSITION
58 int wheel_status(void);
59 void wheel_send_events(bool send);
60 #endif
62 #ifdef HAVE_WHEEL_ACCELERATION
63 int button_apply_acceleration(const unsigned int data);
64 #endif
66 #define BUTTON_NONE 0x00000000
68 /* Button modifiers */
69 #define BUTTON_REL 0x02000000
70 #define BUTTON_REPEAT 0x04000000
71 #define BUTTON_TOUCHSCREEN 0x08000000
73 #ifdef HAVE_TOUCHSCREEN
74 int touchscreen_last_touch(void);
76 #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
77 || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
78 || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \
79 || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \
80 || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__)
81 #error Touchscreen button mode BUTTON_* defines not set up correctly
82 #endif
84 #include "touchscreen.h"
85 #endif
87 #endif /* _BUTTON_H_ */