CHARCELL doesn't have sbs support, so disable it properly.
[maemo-rb.git] / firmware / export / button.h
blob6276a033cc10ff4091553f2611820be6b1457b48
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 #ifndef BUTTON_REMOTE
32 # define BUTTON_REMOTE 0
33 #endif
35 extern struct event_queue button_queue;
37 void button_init_device(void);
38 #ifdef HAVE_BUTTON_DATA
39 int button_read_device(int *);
40 #else
41 int button_read_device(void);
42 #endif
44 #ifdef HAS_BUTTON_HOLD
45 bool button_hold(void);
46 #endif
47 #ifdef HAS_REMOTE_BUTTON_HOLD
48 bool remote_button_hold(void);
49 #endif
51 void button_init (void) INIT_ATTR;
52 void button_close(void);
53 int button_queue_count(void);
54 long button_get (bool block);
55 long button_get_w_tmo(int ticks);
56 intptr_t button_get_data(void);
57 int button_status(void);
58 #ifdef HAVE_BUTTON_DATA
59 int button_status_wdata(int *pdata);
60 #endif
61 void button_clear_queue(void);
62 #ifdef HAVE_LCD_BITMAP
63 void button_set_flip(bool flip); /* turn 180 degrees */
64 #endif
65 #ifdef HAVE_BACKLIGHT
66 void set_backlight_filter_keypress(bool value);
67 #ifdef HAVE_REMOTE_LCD
68 void set_remote_backlight_filter_keypress(bool value);
69 #endif
70 #endif
72 #ifdef HAVE_HEADPHONE_DETECTION
73 bool headphones_inserted(void);
74 #endif
75 #ifdef HAVE_WHEEL_POSITION
76 int wheel_status(void);
77 void wheel_send_events(bool send);
78 #endif
80 #ifdef HAVE_WHEEL_ACCELERATION
81 int button_apply_acceleration(const unsigned int data);
82 #endif
84 #define BUTTON_NONE 0x00000000
86 /* Button modifiers */
87 #define BUTTON_REL 0x02000000
88 #define BUTTON_REPEAT 0x04000000
89 /* Special buttons */
90 #define BUTTON_TOUCHSCREEN 0x08000000
91 #define BUTTON_MULTIMEDIA 0x10000000
92 #define BUTTON_REDRAW 0x20000000
94 #define BUTTON_MULTIMEDIA_PLAYPAUSE (BUTTON_MULTIMEDIA|0x01)
95 #define BUTTON_MULTIMEDIA_STOP (BUTTON_MULTIMEDIA|0x02)
96 #define BUTTON_MULTIMEDIA_PREV (BUTTON_MULTIMEDIA|0x04)
97 #define BUTTON_MULTIMEDIA_NEXT (BUTTON_MULTIMEDIA|0x08)
98 #define BUTTON_MULTIMEDIA_REW (BUTTON_MULTIMEDIA|0x10)
99 #define BUTTON_MULTIMEDIA_FFWD (BUTTON_MULTIMEDIA|0x20)
101 #define BUTTON_MULTIMEDIA_ALL (BUTTON_MULTIMEDIA_PLAYPAUSE| \
102 BUTTON_MULTIMEDIA_STOP| \
103 BUTTON_MULTIMEDIA_PREV| \
104 BUTTON_MULTIMEDIA_NEXT| \
105 BUTTON_MULTIMEDIA_REW | \
106 BUTTON_MULTIMEDIA_FFWD)
108 #ifdef HAVE_TOUCHSCREEN
109 int touchscreen_last_touch(void);
111 #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
112 || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
113 || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \
114 || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \
115 || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__)
116 #error Touchscreen button mode BUTTON_* defines not set up correctly
117 #endif
119 #include "touchscreen.h"
120 #endif
122 #endif /* _BUTTON_H_ */