When setting a cache path also enable the cache implicitly.
[Rockbox.git] / firmware / export / button.h
blob82ea81ffab7285d9b6c3a30e4f612b92f5f552f4
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Daniel Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef _BUTTON_H_
20 #define _BUTTON_H_
22 #include <stdbool.h>
23 #include <inttypes.h>
24 #include "config.h"
25 #ifndef __PCTOOL__
26 #include "button-target.h"
27 #endif
29 extern struct event_queue button_queue;
31 void button_init (void);
32 void button_close(void);
33 int button_queue_count(void);
34 long button_get (bool block);
35 long button_get_w_tmo(int ticks);
36 intptr_t button_get_data(void);
37 int button_status(void);
38 void button_clear_queue(void);
39 #ifdef HAVE_LCD_BITMAP
40 void button_set_flip(bool flip); /* turn 180 degrees */
41 #endif
42 #ifdef HAVE_BACKLIGHT
43 void set_backlight_filter_keypress(bool value);
44 #ifdef HAVE_REMOTE_LCD
45 void set_remote_backlight_filter_keypress(bool value);
46 #endif
47 #endif
49 #ifdef HAVE_HEADPHONE_DETECTION
50 bool headphones_inserted(void);
51 #endif
52 #ifdef HAVE_WHEEL_POSITION
53 int wheel_status(void);
54 void wheel_send_events(bool send);
55 #endif
57 #ifdef HAVE_SCROLLWHEEL
58 int button_apply_acceleration(const unsigned int data);
59 #endif
61 #define BUTTON_NONE 0x00000000
63 /* Button modifiers */
64 #define BUTTON_REL 0x02000000
65 #define BUTTON_REPEAT 0x04000000
66 #define BUTTON_TOUCHPAD 0x08000000
68 #ifdef HAVE_TOUCHPAD
69 #if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
70 || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
71 || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \
72 || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \
73 || !defined(BUTTON_BOTTOMRIGHT)
74 #error Touchpad button mode BUTTON_* defines not set up correctly
75 #endif
76 enum touchpad_mode {
77 TOUCHPAD_POINT = 0, /* touchpad returns pixel co-ords */
78 TOUCHPAD_BUTTON, /* touchpad returns BUTTON_* area codes
79 actual pixel value will still be accessable
80 from button_get_data */
82 /* maybe define the number of buttons in button-target.h ? */
83 void touchpad_set_mode(enum touchpad_mode mode);
84 enum touchpad_mode touchpad_get_mode(void);
85 #endif
87 #endif /* _BUTTON_H_ */