From 1392dc2144a4b1810ba5c421f54e05dc1a3a74c7 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Sat, 23 Aug 2008 09:46:38 +0000 Subject: Commit FS#9308: differentiate between TOUCHPAD & TOUCHSCREEN git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18338 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 4 +- apps/action.c | 20 +- apps/action.h | 10 +- apps/gui/bitmap/list.c | 6 +- apps/gui/color_picker.c | 12 +- apps/gui/list.c | 10 +- apps/keymaps/keymap-touchpad.c | 247 --------------------- apps/keymaps/keymap-touchscreen.c | 247 +++++++++++++++++++++ apps/main.c | 4 +- apps/plugin.c | 4 +- apps/plugin.h | 4 +- apps/plugins/CATEGORIES | 2 +- apps/plugins/battery_bench.c | 2 +- apps/plugins/blackjack.c | 4 +- apps/plugins/bounce.c | 2 +- apps/plugins/brickmania.c | 18 +- apps/plugins/calculator.c | 8 +- apps/plugins/chessbox/chessbox_pgn.h | 2 +- apps/plugins/chessclock.c | 2 +- apps/plugins/chip8.c | 2 +- apps/plugins/chopper.c | 2 +- apps/plugins/cube.c | 2 +- apps/plugins/doom/i_video.c | 2 +- apps/plugins/fireworks.c | 2 +- apps/plugins/flipit.c | 4 +- apps/plugins/invadrox.c | 2 +- apps/plugins/jewels.c | 4 +- apps/plugins/jpeg.c | 2 +- apps/plugins/lamp.c | 2 +- apps/plugins/lib/SOURCES | 2 +- apps/plugins/lib/pluginlib_actions.c | 8 +- apps/plugins/lib/touchscreen.c | 4 +- apps/plugins/lib/touchscreen.h | 6 +- apps/plugins/logo.c | 2 +- apps/plugins/mandelbrot.c | 2 +- apps/plugins/matrix.c | 2 +- apps/plugins/midi/midiplay.c | 2 +- apps/plugins/minesweeper.c | 18 +- apps/plugins/mosaique.c | 2 +- apps/plugins/mp3_encoder.c | 2 +- apps/plugins/mpegplayer/mpeg_settings.c | 2 +- apps/plugins/mpegplayer/mpegplayer.c | 4 +- apps/plugins/oscilloscope.c | 2 +- apps/plugins/pacbox/pacbox.h | 2 +- apps/plugins/pegbox.c | 22 +- apps/plugins/plasma.c | 8 +- apps/plugins/pong.c | 8 +- apps/plugins/reversi/reversi-gui.h | 2 +- apps/plugins/rockblox.c | 2 +- apps/plugins/rockboy/rockboy.c | 4 +- apps/plugins/rockpaint.c | 2 +- apps/plugins/sliding_puzzle.c | 4 +- apps/plugins/snake.c | 2 +- apps/plugins/snake2.c | 2 +- apps/plugins/sokoban.c | 4 +- apps/plugins/solitaire.c | 2 +- apps/plugins/spacerocks.c | 2 +- apps/plugins/star.c | 4 +- apps/plugins/starfield.c | 2 +- apps/plugins/stopwatch.c | 2 +- apps/plugins/sudoku/sudoku.h | 2 +- apps/plugins/superdom.c | 2 +- apps/plugins/test_touchpad.c | 141 ------------ apps/plugins/test_touchscreen.c | 141 ++++++++++++ apps/plugins/viewer.c | 2 +- apps/plugins/vu_meter.c | 2 +- apps/plugins/wormlet.c | 2 +- apps/plugins/xobox.c | 2 +- apps/plugins/zxbox/keymaps.h | 2 +- apps/plugins/zxbox/zxbox_keyb.c | 2 +- bootloader/mrobe500.c | 18 +- firmware/drivers/button.c | 2 +- firmware/export/button.h | 26 +-- firmware/export/config-cowond2.h | 2 +- firmware/export/config-mrobe500.h | 2 +- firmware/export/config-ondavx747.h | 2 +- .../target/arm/tcc780x/cowond2/button-cowond2.c | 22 +- .../target/arm/tcc780x/cowond2/button-target.h | 2 +- .../arm/tms320dm320/mrobe-500/button-mr500.c | 18 +- .../arm/tms320dm320/mrobe-500/button-target.h | 8 +- .../mips/ingenic_jz47xx/onda_vx747/button-target.h | 2 +- uisimulator/sdl/button.c | 40 ++-- uisimulator/sdl/uisdl.c | 4 +- 83 files changed, 606 insertions(+), 604 deletions(-) delete mode 100644 apps/keymaps/keymap-touchpad.c create mode 100644 apps/keymaps/keymap-touchscreen.c delete mode 100644 apps/plugins/test_touchpad.c create mode 100644 apps/plugins/test_touchscreen.c diff --git a/apps/SOURCES b/apps/SOURCES index 74535bfb0c..c8371a71aa 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -146,8 +146,8 @@ metadata/asap.c #ifdef HAVE_TAGCACHE tagcache.c #endif -#ifdef HAVE_TOUCHPAD -keymaps/keymap-touchpad.c +#ifdef HAVE_TOUCHSCREEN +keymaps/keymap-touchscreen.c #endif #if (CONFIG_KEYPAD == IRIVER_H100_PAD) \ || (CONFIG_KEYPAD == IRIVER_H300_PAD) diff --git a/apps/action.c b/apps/action.c index b1dd98df08..5ceeeb896f 100644 --- a/apps/action.c +++ b/apps/action.c @@ -39,7 +39,7 @@ static intptr_t last_data = 0; static int last_action = ACTION_NONE; static bool repeated = false; -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN static bool short_press = false; #endif @@ -145,12 +145,12 @@ static int get_action_worker(int context, int timeout, return ACTION_NONE; /* "safest" return value */ } last_context = context; -#ifdef HAVE_TOUCHPAD - if (button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if (button & BUTTON_TOUCHSCREEN) { repeated = false; short_press = false; - if (last_button & BUTTON_TOUCHPAD) + if (last_button & BUTTON_TOUCHSCREEN) { if ((button & BUTTON_REL) && ((last_button & BUTTON_REPEAT)==0)) @@ -161,7 +161,7 @@ static int get_action_worker(int context, int timeout, repeated = true; } last_button = button; - return ACTION_TOUCHPAD; + return ACTION_TOUCHSCREEN; } #endif #ifndef HAS_BUTTON_HOLD @@ -282,18 +282,18 @@ int get_action_statuscode(int *button) return ret; } -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN /* return BUTTON_NONE on error * BUTTON_REPEAT if repeated press * BUTTON_REPEAT|BUTTON_REL if release after repeated press * BUTTON_REL if its a short press = release after press - * BUTTON_TOUCHPAD if press + * BUTTON_TOUCHSCREEN if press */ -int action_get_touchpad_press(short *x, short *y) +int action_get_touchscreen_press(short *x, short *y) { static int last_data = 0; int data; - if ((last_button & BUTTON_TOUCHPAD) == 0) + if ((last_button & BUTTON_TOUCHSCREEN) == 0) return BUTTON_NONE; data = button_get_data(); if (last_button & BUTTON_REL) @@ -314,6 +314,6 @@ int action_get_touchpad_press(short *x, short *y) /* This is to return a BUTTON_REL after a BUTTON_REPEAT. */ if (last_button & BUTTON_REL) return BUTTON_REPEAT|BUTTON_REL; - return BUTTON_TOUCHPAD; + return BUTTON_TOUCHSCREEN; } #endif diff --git a/apps/action.h b/apps/action.h index 94bf732ab6..743e1470dc 100644 --- a/apps/action.h +++ b/apps/action.h @@ -82,8 +82,8 @@ enum { ACTION_NONE = BUTTON_NONE, ACTION_UNKNOWN, ACTION_REDRAW, /* returned if keys are locked and we splash()'ed */ - ACTION_TOUCHPAD, - ACTION_TOUCHPAD_MODE, /* toggle the touchpad mode */ + ACTION_TOUCHSCREEN, + ACTION_TOUCHSCREEN_MODE, /* toggle the touchscreen mode */ /* standard actions, use these first */ ACTION_STD_PREV, @@ -265,13 +265,13 @@ int get_action_statuscode(int *button); BUTTON_NONE or flagged with SYS_EVENT */ intptr_t get_action_data(void); -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN /* return BUTTON_NONE on error BUTTON_REPEAT if repeated press BUTTON_REL if its a short press - BUTTON_TOUCHPAD otherwise + BUTTON_TOUCHSCREEN otherwise */ -int action_get_touchpad_press(short *x, short *y); +int action_get_touchscreen_press(short *x, short *y); #endif #endif /* __ACTION_H__ */ diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index 5a8bc69450..a3f5da92ea 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -285,17 +285,17 @@ void list_draw(struct screen *display, struct viewport *parent, } -#if defined(HAVE_TOUCHPAD) +#if defined(HAVE_TOUCHSCREEN) /* This needs to be fixed if we ever get more than 1 touchscreen on a target. * This also assumes the whole screen is used, which is a bad assumption but * fine until customizable lists comes in... */ static bool scrolling=false; -unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewport *parent) +unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list, struct viewport *parent) { short x, y; - unsigned button = action_get_touchpad_press(&x, &y); + unsigned button = action_get_touchscreen_press(&x, &y); int line; struct screen *display = &screens[SCREEN_MAIN]; if (button == BUTTON_NONE) diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index 87af8ae3ed..d1ac2a9103 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c @@ -330,13 +330,13 @@ static void draw_screen(struct screen *display, char *title, set_drawinfo(display, DRMODE_SOLID, text_color, background_color); } -#ifdef HAVE_TOUCHPAD -static int touchpad_slider(struct rgb_pick *rgb, int *selected_slider) +#ifdef HAVE_TOUCHSCREEN +static int touchscreen_slider(struct rgb_pick *rgb, int *selected_slider) { short x,y; int text_top,i,x1; int slider_left, slider_width; - unsigned button = action_get_touchpad_press(&x, &y); + unsigned button = action_get_touchscreen_press(&x, &y); bool display_three_rows; int max_label_width; struct screen *display = &screens[SCREEN_MAIN]; @@ -426,9 +426,9 @@ bool set_color(struct screen *display, char *title, unsigned *color, } button = get_action(CONTEXT_SETTINGS_COLOURCHOOSER, TIMEOUT_BLOCK); -#ifdef HAVE_TOUCHPAD - if (button == ACTION_TOUCHPAD) - button = touchpad_slider(&rgb, &slider); +#ifdef HAVE_TOUCHSCREEN + if (button == ACTION_TOUCHSCREEN) + button = touchscreen_slider(&rgb, &slider); #endif switch (button) diff --git a/apps/gui/list.c b/apps/gui/list.c index 12ff929e8a..77ec090b04 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -576,9 +576,9 @@ void gui_synclist_speak_item(struct gui_synclist * lists) } extern intptr_t get_action_data(void); -#if defined(HAVE_TOUCHPAD) +#if defined(HAVE_TOUCHSCREEN) /* this needs to be fixed if we ever get more than 1 touchscreen on a target */ -unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewport *parent); +unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list, struct viewport *parent); #endif bool gui_synclist_do_button(struct gui_synclist * lists, @@ -619,9 +619,9 @@ bool gui_synclist_do_button(struct gui_synclist * lists, } #endif -#if defined(HAVE_TOUCHPAD) - if (action == ACTION_TOUCHPAD) - action = *actionptr = gui_synclist_do_touchpad(lists, &parent[SCREEN_MAIN]); +#if defined(HAVE_TOUCHSCREEN) + if (action == ACTION_TOUCHSCREEN) + action = *actionptr = gui_synclist_do_touchscreen(lists, &parent[SCREEN_MAIN]); #endif switch (wrap) diff --git a/apps/keymaps/keymap-touchpad.c b/apps/keymaps/keymap-touchpad.c deleted file mode 100644 index b658fe48fe..0000000000 --- a/apps/keymaps/keymap-touchpad.c +++ /dev/null @@ -1,247 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2006 Jonathan Gordon - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -/* Button Code Definitions for touchpad targets */ -#include -#include -#include - -#include "config.h" -#include "action.h" -#include "button.h" -#include "settings.h" - -const struct button_mapping* target_get_context_mapping(int context); -/* How this file is used: - get_context_mapping() at the bottom of the file is called by action.c as usual. - if the context is for the remote control its then passed straight to - target_get_context_mapping(). - These tables are only used for the touchpad buttons, so at the end of each - CONTEXT_CUSTOM2 is OR'ed with the context and then sent to target_get_context_mapping() - (NOTE: CONTEXT_CUSTOM2 will be stripped before being sent to make it easier.) - In the target keymap, remember to |CONTEXT_CUSTOM2 in the LAST_ITEM_IN_LIST__NEXTLIST() macro - to speed it up a tiny bit... if you dont it will go through these tables first before going - back to the target file. - */ - - -/* touchpad "buttons" - screen is split into a 3x3 grid for buttons... - BUTTON_TOPLEFT BUTTON_TOPMIDDLE BUTTON_TOPRIGHT - BUTTON_MIDLEFT BUTTON_CENTER BUTTON_MIDRIGHT - BUTTON_BOTTOMLEFT BUTTON_BOTTOMMIDDLE BUTTON_BOTTOMRIGHT -*/ - -static const struct button_mapping button_context_standard[] = { - { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - - { ACTION_STD_OK, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER }, - { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT }, - { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT }, - - { ACTION_STD_MENU, BUTTON_TOPLEFT, BUTTON_NONE }, - { ACTION_STD_QUICKSCREEN, BUTTON_TOPLEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_CONTEXT, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER }, - { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_STD) -}; /* button_context_standard */ - -static const struct button_mapping button_context_wps[] = { - - { ACTION_WPS_SKIPNEXT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT }, - { ACTION_WPS_SKIPPREV, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT }, - - { ACTION_WPS_SEEKBACK, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_SEEKFWD, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_WPS_STOPSEEK, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT|BUTTON_REPEAT }, - { ACTION_WPS_STOPSEEK, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT|BUTTON_REPEAT }, - - { ACTION_WPS_CONTEXT, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER }, - { ACTION_WPS_QUICKSCREEN, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_WPS) -}; /* button_context_wps */ - -static const struct button_mapping button_context_list[] = { -#if 0 - /* this is all to show how the poor-mans-gestures can be used... */ - { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT, BUTTON_NONE}, - { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT}, - { ACTION_STD_NEXTREPEAT, BUTTON_CENTER, BUTTON_TOPMIDDLE}, - { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE, BUTTON_CENTER}, - { ACTION_NONE, BUTTON_TOPMIDDLE, BUTTON_NONE }, - { ACTION_NONE, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, - { ACTION_STD_PREV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_NONE }, - { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE}, - { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT}, - { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE, BUTTON_CENTER}, - { ACTION_STD_PREVREPEAT, BUTTON_CENTER, BUTTON_BOTTOMMIDDLE}, -#endif - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_LIST) -}; /* button_context_list */ - -static const struct button_mapping button_context_tree[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM2|CONTEXT_TREE) -}; /* button_context_tree */ - -static const struct button_mapping button_context_listtree_scroll_with_combo[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_listtree_scroll_without_combo[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), -}; - -static const struct button_mapping button_context_settings[] = { - { ACTION_SETTINGS_INC, BUTTON_TOPMIDDLE, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS) -}; /* button_context_settings */ - -static const struct button_mapping button_context_settings_right_is_inc[] = { - { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, - { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, - { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_INC, BUTTON_MIDRIGHT, BUTTON_NONE }, - { ACTION_SETTINGS_INCREPEAT, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_SETTINGS_DEC, BUTTON_MIDLEFT, BUTTON_NONE }, - { ACTION_SETTINGS_DECREPEAT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, - { ACTION_STD_CANCEL, BUTTON_TOPLEFT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_SETTINGS) -}; /* button_context_settingsgraphical */ - -static const struct button_mapping button_context_yesno[] = { - { ACTION_YESNO_ACCEPT, BUTTON_MIDLEFT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_YESNOSCREEN) -}; /* button_context_settings_yesno */ - -static const struct button_mapping button_context_colorchooser[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_COLOURCHOOSER), -}; /* button_context_colorchooser */ - -static const struct button_mapping button_context_eq[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_EQ), -}; /* button_context_eq */ - -/* Bookmark Screen */ -static const struct button_mapping button_context_bmark[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_BOOKMARKSCREEN), -}; /* button_context_bmark */ - -static const struct button_mapping button_context_time[] = { - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_TIME), -}; /* button_context_time */ - -static const struct button_mapping button_context_quickscreen[] = { - - { ACTION_STD_CANCEL, BUTTON_CENTER|BUTTON_REL, BUTTON_NONE }, - { ACTION_QS_DOWNINV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_NONE }, - { ACTION_QS_DOWNINV, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_NONE }, - { ACTION_QS_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_NONE }, - { ACTION_QS_LEFT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_NONE }, - { ACTION_QS_RIGHT, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_QUICKSCREEN) -}; /* button_context_quickscreen */ - -static const struct button_mapping button_context_pitchscreen[] = { - - { ACTION_PS_INC_SMALL, BUTTON_TOPMIDDLE, BUTTON_NONE }, - { ACTION_PS_INC_BIG, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_DEC_SMALL, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, - { ACTION_PS_DEC_BIG, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFT, BUTTON_MIDLEFT, BUTTON_NONE }, - { ACTION_PS_NUDGE_LEFTOFF, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHT, BUTTON_MIDRIGHT, BUTTON_NONE }, - { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_NONE }, - { ACTION_PS_TOGGLE_MODE, BUTTON_BOTTOMRIGHT, BUTTON_NONE }, - { ACTION_PS_RESET, BUTTON_CENTER, BUTTON_NONE }, - { ACTION_PS_EXIT, BUTTON_TOPLEFT, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_PITCHSCREEN) -}; /* button_context_pitchcreen */ - -static const struct button_mapping button_context_keyboard[] = { - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_KEYBOARD) -}; /* button_context_keyboard */ - -const struct button_mapping* get_context_mapping(int context) -{ - if ((context&CONTEXT_REMOTE) || (context&CONTEXT_CUSTOM2)) - return target_get_context_mapping(context&(~CONTEXT_CUSTOM2)); - - switch (context) - { - case CONTEXT_STD: - return button_context_standard; - case CONTEXT_WPS: - return button_context_wps; - - case CONTEXT_LIST: - return button_context_list; - case CONTEXT_MAINMENU: - case CONTEXT_TREE: - if (global_settings.hold_lr_for_scroll_in_list) - return button_context_listtree_scroll_without_combo; - else - return button_context_listtree_scroll_with_combo; - case CONTEXT_CUSTOM|CONTEXT_TREE: - return button_context_tree; - - case CONTEXT_SETTINGS: - return button_context_settings; - case CONTEXT_CUSTOM|CONTEXT_SETTINGS: - return button_context_settings_right_is_inc; - - case CONTEXT_SETTINGS_COLOURCHOOSER: - return button_context_colorchooser; - case CONTEXT_SETTINGS_EQ: - return button_context_eq; - - case CONTEXT_SETTINGS_TIME: - return button_context_time; - - case CONTEXT_YESNOSCREEN: - return button_context_yesno; - case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; - case CONTEXT_QUICKSCREEN: - return button_context_quickscreen; - case CONTEXT_PITCHSCREEN: - return button_context_pitchscreen; - case CONTEXT_KEYBOARD: - return button_context_keyboard; - } - return button_context_standard; -} diff --git a/apps/keymaps/keymap-touchscreen.c b/apps/keymaps/keymap-touchscreen.c new file mode 100644 index 0000000000..a56eefd427 --- /dev/null +++ b/apps/keymaps/keymap-touchscreen.c @@ -0,0 +1,247 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 Jonathan Gordon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +/* Button Code Definitions for touchscreen targets */ +#include +#include +#include + +#include "config.h" +#include "action.h" +#include "button.h" +#include "settings.h" + +const struct button_mapping* target_get_context_mapping(int context); +/* How this file is used: + get_context_mapping() at the bottom of the file is called by action.c as usual. + if the context is for the remote control its then passed straight to + target_get_context_mapping(). + These tables are only used for the touchscreen buttons, so at the end of each + CONTEXT_CUSTOM2 is OR'ed with the context and then sent to target_get_context_mapping() + (NOTE: CONTEXT_CUSTOM2 will be stripped before being sent to make it easier.) + In the target keymap, remember to |CONTEXT_CUSTOM2 in the LAST_ITEM_IN_LIST__NEXTLIST() macro + to speed it up a tiny bit... if you dont it will go through these tables first before going + back to the target file. + */ + + +/* touchscreen "buttons" + screen is split into a 3x3 grid for buttons... + BUTTON_TOPLEFT BUTTON_TOPMIDDLE BUTTON_TOPRIGHT + BUTTON_MIDLEFT BUTTON_CENTER BUTTON_MIDRIGHT + BUTTON_BOTTOMLEFT BUTTON_BOTTOMMIDDLE BUTTON_BOTTOMRIGHT +*/ + +static const struct button_mapping button_context_standard[] = { + { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + + { ACTION_STD_OK, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER }, + { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT }, + { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT }, + + { ACTION_STD_MENU, BUTTON_TOPLEFT, BUTTON_NONE }, + { ACTION_STD_QUICKSCREEN, BUTTON_TOPLEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_CONTEXT, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER }, + { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_STD) +}; /* button_context_standard */ + +static const struct button_mapping button_context_wps[] = { + + { ACTION_WPS_SKIPNEXT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT }, + { ACTION_WPS_SKIPPREV, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT }, + + { ACTION_WPS_SEEKBACK, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_SEEKFWD, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_STOPSEEK, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_MIDLEFT|BUTTON_REPEAT }, + { ACTION_WPS_STOPSEEK, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT|BUTTON_REPEAT }, + + { ACTION_WPS_CONTEXT, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER }, + { ACTION_WPS_QUICKSCREEN, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_WPS) +}; /* button_context_wps */ + +static const struct button_mapping button_context_list[] = { +#if 0 + /* this is all to show how the poor-mans-gestures can be used... */ + { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT, BUTTON_NONE}, + { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT}, + { ACTION_STD_NEXTREPEAT, BUTTON_CENTER, BUTTON_TOPMIDDLE}, + { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE, BUTTON_CENTER}, + { ACTION_NONE, BUTTON_TOPMIDDLE, BUTTON_NONE }, + { ACTION_NONE, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_NONE }, + { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE}, + { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT}, + { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE, BUTTON_CENTER}, + { ACTION_STD_PREVREPEAT, BUTTON_CENTER, BUTTON_BOTTOMMIDDLE}, +#endif + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_LIST) +}; /* button_context_list */ + +static const struct button_mapping button_context_tree[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM2|CONTEXT_TREE) +}; /* button_context_tree */ + +static const struct button_mapping button_context_listtree_scroll_with_combo[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), +}; + +static const struct button_mapping button_context_listtree_scroll_without_combo[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), +}; + +static const struct button_mapping button_context_settings[] = { + { ACTION_SETTINGS_INC, BUTTON_TOPMIDDLE, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS) +}; /* button_context_settings */ + +static const struct button_mapping button_context_settings_right_is_inc[] = { + { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_INC, BUTTON_MIDRIGHT, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_MIDLEFT, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_TOPLEFT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_SETTINGS) +}; /* button_context_settingsgraphical */ + +static const struct button_mapping button_context_yesno[] = { + { ACTION_YESNO_ACCEPT, BUTTON_MIDLEFT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_YESNOSCREEN) +}; /* button_context_settings_yesno */ + +static const struct button_mapping button_context_colorchooser[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_COLOURCHOOSER), +}; /* button_context_colorchooser */ + +static const struct button_mapping button_context_eq[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_EQ), +}; /* button_context_eq */ + +/* Bookmark Screen */ +static const struct button_mapping button_context_bmark[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_BOOKMARKSCREEN), +}; /* button_context_bmark */ + +static const struct button_mapping button_context_time[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_TIME), +}; /* button_context_time */ + +static const struct button_mapping button_context_quickscreen[] = { + + { ACTION_STD_CANCEL, BUTTON_CENTER|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_DOWNINV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_DOWNINV, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_DOWN, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_LEFT, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_LEFT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_QUICKSCREEN) +}; /* button_context_quickscreen */ + +static const struct button_mapping button_context_pitchscreen[] = { + + { ACTION_PS_INC_SMALL, BUTTON_TOPMIDDLE, BUTTON_NONE }, + { ACTION_PS_INC_BIG, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_PS_DEC_SMALL, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, + { ACTION_PS_DEC_BIG, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_PS_NUDGE_LEFT, BUTTON_MIDLEFT, BUTTON_NONE }, + { ACTION_PS_NUDGE_LEFTOFF, BUTTON_MIDLEFT|BUTTON_REL, BUTTON_NONE }, + { ACTION_PS_NUDGE_RIGHT, BUTTON_MIDRIGHT, BUTTON_NONE }, + { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_NONE }, + { ACTION_PS_TOGGLE_MODE, BUTTON_BOTTOMRIGHT, BUTTON_NONE }, + { ACTION_PS_RESET, BUTTON_CENTER, BUTTON_NONE }, + { ACTION_PS_EXIT, BUTTON_TOPLEFT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_PITCHSCREEN) +}; /* button_context_pitchcreen */ + +static const struct button_mapping button_context_keyboard[] = { + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_KEYBOARD) +}; /* button_context_keyboard */ + +const struct button_mapping* get_context_mapping(int context) +{ + if ((context&CONTEXT_REMOTE) || (context&CONTEXT_CUSTOM2)) + return target_get_context_mapping(context&(~CONTEXT_CUSTOM2)); + + switch (context) + { + case CONTEXT_STD: + return button_context_standard; + case CONTEXT_WPS: + return button_context_wps; + + case CONTEXT_LIST: + return button_context_list; + case CONTEXT_MAINMENU: + case CONTEXT_TREE: + if (global_settings.hold_lr_for_scroll_in_list) + return button_context_listtree_scroll_without_combo; + else + return button_context_listtree_scroll_with_combo; + case CONTEXT_CUSTOM|CONTEXT_TREE: + return button_context_tree; + + case CONTEXT_SETTINGS: + return button_context_settings; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + return button_context_settings_right_is_inc; + + case CONTEXT_SETTINGS_COLOURCHOOSER: + return button_context_colorchooser; + case CONTEXT_SETTINGS_EQ: + return button_context_eq; + + case CONTEXT_SETTINGS_TIME: + return button_context_time; + + case CONTEXT_YESNOSCREEN: + return button_context_yesno; + case CONTEXT_BOOKMARKSCREEN: + return button_context_bmark; + case CONTEXT_QUICKSCREEN: + return button_context_quickscreen; + case CONTEXT_PITCHSCREEN: + return button_context_pitchscreen; + case CONTEXT_KEYBOARD: + return button_context_keyboard; + } + return button_context_standard; +} diff --git a/apps/main.c b/apps/main.c index 1f2625df6c..d59d17a5f1 100644 --- a/apps/main.c +++ b/apps/main.c @@ -131,8 +131,8 @@ static void app_main(void) screens[i].update(); } tree_gui_init(); -#ifdef HAVE_TOUCHPAD - touchpad_set_mode(TOUCHPAD_BUTTON); +#ifdef HAVE_TOUCHSCREEN + touchscreen_set_mode(TOUCHSCREEN_BUTTON); #endif root_menu(); } diff --git a/apps/plugin.c b/apps/plugin.c index 7f546011a9..6889248402 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -237,8 +237,8 @@ static const struct plugin_api rockbox_api = { #ifdef HAS_BUTTON_HOLD button_hold, #endif -#ifdef HAVE_TOUCHPAD - touchpad_set_mode, +#ifdef HAVE_TOUCHSCREEN + touchscreen_set_mode, #endif #ifdef HAVE_BUTTON_LIGHT diff --git a/apps/plugin.h b/apps/plugin.h index fa5993d97f..7ce91bbf99 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -345,8 +345,8 @@ struct plugin_api { #ifdef HAS_BUTTON_HOLD bool (*button_hold)(void); #endif -#ifdef HAVE_TOUCHPAD - void (*touchpad_set_mode)(enum touchpad_mode); +#ifdef HAVE_TOUCHSCREEN + void (*touchscreen_set_mode)(enum touchscreen_mode); #endif #ifdef HAVE_BUTTON_LIGHT void (*buttonlight_set_timeout)(int value); diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index a8110593f0..1cf530b5af 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES @@ -89,7 +89,7 @@ test_fps,apps test_grey,apps test_sampr,apps test_scanrate,apps -test_touchpad,apps +test_touchscreen,apps test_viewports,apps text_editor,apps vbrfix,viewers diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 90e9b405c8..4361bbc491 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -154,7 +154,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BATTERY_ON #define BATTERY_ON BUTTON_CENTER #endif diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index 7d69e8f602..e6a9fbd8cd 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -261,7 +261,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BJACK_START #define BJACK_START BUTTON_CENTER #endif @@ -1238,7 +1238,7 @@ static unsigned int blackjack_menu(struct game_context* bj) { rb->lcd_puts(0, 10, str); #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN rb->lcd_puts(0, 2, "LCD CENTRE to start & to hit"); rb->lcd_puts(0, 3, "LCD BOTTOMLEFT to stay"); rb->lcd_puts(0, 4, "LCD BOTTOMRIGHT to save/resume"); diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index bae5b8285b..65aaa3ef09 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -148,7 +148,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BOUNCE_LEFT #define BOUNCE_LEFT BUTTON_MIDLEFT #endif diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index c3cdcad967..d6b1827b94 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -173,7 +173,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef LEFT #define LEFT BUTTON_MIDLEFT #endif @@ -448,7 +448,7 @@ enum menu_items { #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #include "lib/touchscreen.h" static struct ts_mapping main_menu_items[4] = @@ -1024,8 +1024,8 @@ int game_menu(int when) rb->lcd_update(); button = rb->button_get(true); -#ifdef HAVE_TOUCHPAD - if(button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(button & BUTTON_TOUCHSCREEN) { unsigned int result = touchscreen_map(&main_menu, rb->button_get_data() >> 16, rb->button_get_data() & 0xffff); if(result != (unsigned)-1 && button & BUTTON_REL) @@ -1176,8 +1176,8 @@ int help(int when) #ifdef RC_QUIT case RC_QUIT: #endif -#ifdef HAVE_TOUCHPAD - case BUTTON_TOUCHPAD: +#ifdef HAVE_TOUCHSCREEN + case BUTTON_TOUCHSCREEN: #endif case QUIT: switch (game_menu(when)) { @@ -1871,8 +1871,8 @@ int game_loop(void) button = QUIT; #endif -#ifdef HAVE_TOUCHPAD - if(button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(button & BUTTON_TOUCHSCREEN) { short touch_x, touch_y; touch_x = rb->button_get_data() >> 16; @@ -1936,7 +1936,7 @@ int game_loop(void) pad_pos_x-=8; } } -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN } #endif diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index cbbbeaa293..3a3947d81a 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -265,7 +265,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef CALCULATOR_LEFT #define CALCULATOR_LEFT BUTTON_MIDLEFT #endif @@ -1549,8 +1549,8 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame while (calStatus != cal_exit ) { btn = rb->button_get_w_tmo(HZ/2); -#ifdef HAVE_TOUCHPAD - if(btn & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(btn & BUTTON_TOUCHSCREEN) { struct ts_raster_result res; if(touchscreen_map_raster(&calc_raster, rb->button_get_data() >> 16, rb->button_get_data() & 0xffff, &res) == 1) @@ -1575,7 +1575,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame sciButtonsProcess(); break; } - btn = BUTTON_TOUCHPAD; + btn = BUTTON_TOUCHSCREEN; } } } diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h index 48357ee5fa..2054316770 100644 --- a/apps/plugins/chessbox/chessbox_pgn.h +++ b/apps/plugins/chessbox/chessbox_pgn.h @@ -274,7 +274,7 @@ #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef CB_LEVEL #define CB_LEVEL BUTTON_TOPLEFT #endif diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index d808956f9d..b4d2ed0547 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -194,7 +194,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef CHC_SETTINGS_OK #define CHC_SETTINGS_OK BUTTON_CENTER #endif diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index 6bddfa23c6..be624ed711 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c @@ -1086,7 +1086,7 @@ STATIC void chip8 (void) #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef CHIP8_OFF #define CHIP8_OFF BUTTON_TOPLEFT #endif diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 9b854ae0e1..c61d012898 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -112,7 +112,7 @@ Still To do: #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef QUIT #define QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 55721fb6c2..35737a65b3 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -250,7 +250,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN // not enough touchfields, so CUBE_QUIT have to be // mapped to a real button //ifndef CUBE_QUIT diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index cb6d967b0c..58be699a5f 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -272,7 +272,7 @@ void I_ShutdownGraphics(void) #error Keymap not defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef DOOMBUTTON_UP #define DOOMBUTTON_UP BUTTON_TOPMIDDLE #endif diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index f3beb6532a..43cd04a985 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c @@ -77,7 +77,7 @@ static const struct plugin_api* rb; #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BTN_MENU #define BTN_MENU (BUTTON_TOPLEFT|BUTTON_REL) #endif diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 9d3a9a25f4..6eff1472df 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -216,7 +216,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef FLIPIT_LEFT #define FLIPIT_LEFT BUTTON_MIDLEFT #endif @@ -675,7 +675,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->lcd_putsxy(2, 48, "[MENU] step by step"); #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN rb->lcd_putsxy(2, 8, "[BOTTOMLEFT] to stop"); rb->lcd_putsxy(2, 18, "[CENTRE] toggle"); rb->lcd_putsxy(2, 28, "[TOPRIGHT] shuffle"); diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 44094c254b..a46580ad95 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -124,7 +124,7 @@ PLUGIN_HEADER #error INVADROX: Unsupported keypad #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef QUIT #define QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 7f4cd4bd41..6f547fdf39 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -157,7 +157,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef JEWELS_UP #define JEWELS_UP BUTTON_TOPMIDDLE #endif @@ -1610,7 +1610,7 @@ static int jewels_main(struct game_context* bj) { #warning: missing help text. #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN rb->lcd_puts(0, 2, "Swap pairs of jewels to"); rb->lcd_puts(0, 3, "form connected segments"); rb->lcd_puts(0, 4, "of three or more of the"); diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index ffc9d49a98..142e982d0b 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -218,7 +218,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef JPEG_UP #define JPEG_UP BUTTON_TOPMIDDLE #endif diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c index 8a673944bc..a938d7a7f2 100644 --- a/apps/plugins/lamp.c +++ b/apps/plugins/lamp.c @@ -79,7 +79,7 @@ PLUGIN_HEADER #endif #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN # ifndef LAMP_LEFT # define LAMP_LEFT BUTTON_MIDLEFT # endif diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index 775db0587e..d21f21af15 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -39,7 +39,7 @@ bmp_smooth_scale.c #endif pluginlib_actions.c helper.c -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN touchscreen.c #endif md5.c diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c index 996e2178b4..a6bf28302f 100644 --- a/apps/plugins/lib/pluginlib_actions.c +++ b/apps/plugins/lib/pluginlib_actions.c @@ -67,7 +67,7 @@ const struct button_mapping remote_directions[] = const struct button_mapping generic_directions[] = { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN { PLA_UP, BUTTON_TOPMIDDLE, BUTTON_NONE}, { PLA_DOWN, BUTTON_BOTTOMMIDDLE, BUTTON_NONE}, { PLA_LEFT, BUTTON_MIDLEFT, BUTTON_NONE}, @@ -162,7 +162,7 @@ const struct button_mapping generic_directions[] = const struct button_mapping generic_left_right_fire[] = { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN { PLA_LEFT, BUTTON_MIDLEFT, BUTTON_NONE}, { PLA_LEFT_REPEAT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE}, { PLA_RIGHT, BUTTON_MIDRIGHT, BUTTON_NONE}, @@ -266,7 +266,7 @@ const struct button_mapping generic_left_right_fire[] = /* these were taken from the bubbles plugin, so may need tweaking */ const struct button_mapping generic_actions[] = { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN {PLA_QUIT, BUTTON_BOTTOMRIGHT, BUTTON_NONE}, {PLA_START, BUTTON_CENTER, BUTTON_NONE}, {PLA_MENU, BUTTON_TOPLEFT, BUTTON_NONE}, @@ -399,7 +399,7 @@ const struct button_mapping generic_actions[] = const struct button_mapping generic_increase_decrease[] = { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN {PLA_INC, BUTTON_TOPMIDDLE, BUTTON_NONE}, {PLA_DEC, BUTTON_BOTTOMMIDDLE, BUTTON_NONE}, {PLA_INC_REPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE}, diff --git a/apps/plugins/lib/touchscreen.c b/apps/plugins/lib/touchscreen.c index cda2f46f1e..5b7517349a 100644 --- a/apps/plugins/lib/touchscreen.c +++ b/apps/plugins/lib/touchscreen.c @@ -21,7 +21,7 @@ #include "plugin.h" -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #include "touchscreen.h" @@ -132,4 +132,4 @@ struct ts_raster_button_result touchscreen_raster_map_button(struct ts_raster_bu return ret; } -#endif /* HAVE_TOUCHPAD */ +#endif /* HAVE_TOUCHSCREEN */ diff --git a/apps/plugins/lib/touchscreen.h b/apps/plugins/lib/touchscreen.h index 7050db669b..cd5251e46f 100644 --- a/apps/plugins/lib/touchscreen.h +++ b/apps/plugins/lib/touchscreen.h @@ -22,7 +22,9 @@ #ifndef _PLUGIN_LIB_TOUCHSCREEN_H_ #define _PLUGIN_LIB_TOUCHSCREEN_H_ -#ifdef HAVE_TOUCHPAD +#include "plugin.h" + +#ifdef HAVE_TOUCHSCREEN struct ts_mapping { @@ -88,5 +90,5 @@ struct ts_raster_button_result struct ts_raster_button_result touchscreen_raster_map_button(struct ts_raster_button_mapping *map, int x, int y, int button); -#endif /* HAVE_TOUCHPAD */ +#endif /* HAVE_TOUCHSCREEN */ #endif /* _PLUGIN_LIB_TOUCHSCREEN_H_ */ diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c index dd03dd800c..779ce8845d 100644 --- a/apps/plugins/logo.c +++ b/apps/plugins/logo.c @@ -160,7 +160,7 @@ const unsigned char rockbox16x7[] = { #endif #endif /* CONFIG_REMOTE_KEYPAD */ -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef LP_QUIT #define LP_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c index e4e83111e3..ca7f708fc8 100644 --- a/apps/plugins/mandelbrot.c +++ b/apps/plugins/mandelbrot.c @@ -227,7 +227,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MANDELBROT_UP #define MANDELBROT_UP BUTTON_TOPMIDDLE #endif diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c index 2b63be90e7..fe54b2938a 100644 --- a/apps/plugins/matrix.c +++ b/apps/plugins/matrix.c @@ -103,7 +103,7 @@ extern const fb_data matrix_normal[]; #error Unsupported keypad #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MATRIX_EXIT #define MATRIX_EXIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index a394aaccb1..d76e0382ad 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -154,7 +154,7 @@ PLUGIN_IRAM_DECLARE #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BTN_QUIT #define BTN_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 266d12fc8d..c37c9e8795 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -192,7 +192,7 @@ enum minesweeper_status { #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MINESWP_QUIT # define MINESWP_QUIT BUTTON_TOPLEFT #endif @@ -305,7 +305,7 @@ int stack_pos = 0; /* a usefull string for snprintf */ char str[30]; -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #include "lib/touchscreen.h" static struct ts_raster mine_raster = { 0, 0, MAX_WIDTH, MAX_HEIGHT, TileSize, TileSize }; @@ -485,7 +485,7 @@ void mine_show( void ) button = rb->button_get(true); while( ( button == BUTTON_NONE ) || ( button & (BUTTON_REL|BUTTON_REPEAT) ) ); -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN button = BUTTON_NONE; #endif } @@ -582,7 +582,7 @@ enum minesweeper_status minesweeper( void ) top = (LCD_HEIGHT-height*TileSize)/2; left = (LCD_WIDTH-width*TileSize)/2; -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN mine_raster.tl_x = left; mine_raster.tl_y = top; mine_raster.width = width*TileSize; @@ -633,21 +633,21 @@ enum minesweeper_status minesweeper( void ) rb->lcd_update(); button = rb->button_get(true); -#ifdef HAVE_TOUCHPAD - if(button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(button & BUTTON_TOUCHSCREEN) { struct ts_raster_result res; if(touchscreen_map_raster(&mine_raster, rb->button_get_data() >> 16, rb->button_get_data() & 0xffff, &res) == 1) { - button &= ~BUTTON_TOUCHPAD; - lastbutton &= ~BUTTON_TOUCHPAD; + button &= ~BUTTON_TOUCHSCREEN; + lastbutton &= ~BUTTON_TOUCHSCREEN; if(button & BUTTON_REPEAT && lastbutton != MINESWP_TOGGLE && lastbutton ^ BUTTON_REPEAT) button = MINESWP_TOGGLE; else if(button == BUTTON_REL && lastbutton ^ BUTTON_REPEAT) button = MINESWP_DISCOVER; else - button |= BUTTON_TOUCHPAD; + button |= BUTTON_TOUCHSCREEN; x = res.x; y = res.y; diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c index dbd647330f..b750efb6b3 100644 --- a/apps/plugins/mosaique.c +++ b/apps/plugins/mosaique.c @@ -131,7 +131,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MOSAIQUE_QUIT #define MOSAIQUE_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 0dce32e9df..1e159da2c8 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -2460,7 +2460,7 @@ void get_mp3_filename(const char *wav_name) #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MP3ENC_PREV #define MP3ENC_PREV BUTTON_MIDLEFT #endif diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 17a1cbbb69..e53b37f810 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c @@ -128,7 +128,7 @@ struct mpeg_settings settings; #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MPEG_START_TIME_SELECT #define MPEG_START_TIME_SELECT BUTTON_CENTER #endif diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index c58a2f6d0f..fd6d3dbd1a 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -201,7 +201,7 @@ PLUGIN_IRAM_DECLARE #elif CONFIG_KEYPAD == MROBE500_PAD #define MPEG_MENU BUTTON_RC_HEART #define MPEG_STOP BUTTON_POWER -#define MPEG_PAUSE BUTTON_TOUCHPAD +#define MPEG_PAUSE BUTTON_TOUCHSCREEN #define MPEG_VOLDOWN BUTTON_RC_VOL_DOWN #define MPEG_VOLUP BUTTON_RC_VOL_UP #define MPEG_RW BUTTON_RC_REW @@ -235,7 +235,7 @@ PLUGIN_IRAM_DECLARE #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef MPEG_MENU #define MPEG_MENU (BUTTON_TOPRIGHT|BUTTON_REL) #endif diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 76ff5f5744..9cb59a8fad 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -192,7 +192,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef OSCILLOSCOPE_QUIT #define OSCILLOSCOPE_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index 56e7600d58..4e51e3c868 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h @@ -153,7 +153,7 @@ #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PACMAN_UP #define PACMAN_UP BUTTON_MIDRIGHT #endif diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index 4ba8156e8b..04f5ba9273 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c @@ -282,7 +282,7 @@ PLUGIN_HEADER #error Unsupported keymap! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PEGBOX_QUIT #define PEGBOX_QUIT BUTTON_TOPLEFT #endif @@ -370,7 +370,7 @@ PLUGIN_HEADER #define BOARD_Y 0 #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #include "lib/touchscreen.h" static struct ts_mapping main_menu_items[5] = @@ -385,7 +385,7 @@ static struct ts_mapping main_menu_items[5] = #elif LCD_WIDTH > 112 0, LCD_HEIGHT - 8, SYSFONT_WIDTH*28, SYSFONT_HEIGHT #else -#error "Touchpad isn't supported on non-bitmap screens!" +#error "Touchscreen isn't supported on non-bitmap screens!" #endif } @@ -640,8 +640,8 @@ static void display_text(char *str, bool waitkey) key = rb->button_get(true); switch (key) { -#ifdef HAVE_TOUCHPAD - case BUTTON_TOUCHPAD: +#ifdef HAVE_TOUCHSCREEN + case BUTTON_TOUCHSCREEN: #endif case PEGBOX_QUIT: case PEGBOX_LEFT: @@ -769,8 +769,8 @@ static void new_piece(struct game_context* pb, unsigned int x_loc, while (!exit) { draw_board(pb); button = rb->button_get(true); -#ifdef HAVE_TOUCHPAD - if(button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(button & BUTTON_TOUCHSCREEN) { pegbox_raster_btn.two_d_from.y = x_loc; pegbox_raster_btn.two_d_from.x = y_loc; @@ -1107,8 +1107,8 @@ static unsigned int pegbox_menu(struct game_context* pb) { /* handle menu button presses */ button = rb->button_get(true); -#ifdef HAVE_TOUCHPAD - if(button & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(button & BUTTON_TOUCHSCREEN) { unsigned int result = touchscreen_map(&main_menu, rb->button_get_data() >> 16, rb->button_get_data() & 0xffff); if(result != (unsigned)-1 && button & BUTTON_REL) @@ -1240,8 +1240,8 @@ static int pegbox(struct game_context* pb) { while (true) { temp_var = rb->button_get(true); -#ifdef HAVE_TOUCHPAD - if(temp_var & BUTTON_TOUCHPAD) +#ifdef HAVE_TOUCHSCREEN + if(temp_var & BUTTON_TOUCHSCREEN) { pegbox_raster_btn.two_d_from.y = pb->player_row; pegbox_raster_btn.two_d_from.x = pb->player_col; diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index 35ce9daa83..e1527e1907 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c @@ -104,7 +104,7 @@ static int plasma_frequency; #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PLASMA_QUIT #define PLASMA_QUIT BUTTON_TOPLEFT #endif @@ -114,7 +114,7 @@ static int plasma_frequency; #ifndef PLASMA_DECREASE_FREQUENCY #define PLASMA_DECREASE_FREQUENCY BUTTON_MIDLEFT #endif -#endif /* HAVE_TOUCHPAD */ +#endif /* HAVE_TOUCHSCREEN */ #ifndef PLASMA_QUIT #define PLASMA_QUIT BUTTON_OFF @@ -147,11 +147,11 @@ static int plasma_frequency; #elif CONFIG_KEYPAD == GIGABEAT_S_PAD #define PLASMA_REGEN_COLORS BUTTON_SELECT #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PLASMA_REGEN_COLORS #define PLASMA_REGEN_COLORS BUTTON_CENTER #endif -#endif /* HAVE_TOUCHPAD */ +#endif /* HAVE_TOUCHSCREEN */ #endif /* HAVE_LCD_COLOR */ #define WAV_AMP 90 diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 60d704337f..27721fcfab 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -155,7 +155,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PONG_QUIT #define PONG_QUIT BUTTON_TOPMIDDLE #endif @@ -398,7 +398,7 @@ int keys(struct pong *p) #endif /* number of ticks this function will loop reading keys */ -#ifndef HAVE_TOUCHPAD +#ifndef HAVE_TOUCHSCREEN int time = 4; #else int time = 1; @@ -409,9 +409,9 @@ int keys(struct pong *p) while(end > *rb->current_tick) { key = rb->button_get_w_tmo(end - *rb->current_tick); -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN short touch_x, touch_y; - if(key & BUTTON_TOUCHPAD) + if(key & BUTTON_TOUCHSCREEN) { touch_x = rb->button_get_data() >> 16; touch_y = rb->button_get_data() & 0xFFFF; diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h index 3a3cdda3ce..a03be8ee70 100644 --- a/apps/plugins/reversi/reversi-gui.h +++ b/apps/plugins/reversi/reversi-gui.h @@ -151,7 +151,7 @@ #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef REVERSI_QUIT #define REVERSI_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 27ae8e2f99..c4580665ab 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -221,7 +221,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef ROCKBLOX_OFF #define ROCKBLOX_OFF BUTTON_TOPLEFT #endif diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index d214807c2d..1de2c2f4d1 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -86,7 +86,7 @@ static void setoptions (void) fd = open(optionsave, O_RDONLY); if(fd < 0) /* no options to read, set defaults */ { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN options.LEFT=BUTTON_MIDLEFT; options.RIGHT=BUTTON_MIDRIGHT; #else @@ -219,7 +219,7 @@ static void setoptions (void) #error No Keymap Defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN options.UP=BUTTON_TOPMIDDLE; options.DOWN=BUTTON_BOTTOMMIDDLE; diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 6436d9baa5..32c746cc3e 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -126,7 +126,7 @@ PLUGIN_HEADER #error "Please define keys for this keypad" #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef ROCKPAINT_QUIT #define ROCKPAINT_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index 9ed15f4b8a..9303985d03 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -148,7 +148,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef PUZZLE_QUIT #define PUZZLE_QUIT BUTTON_TOPLEFT #endif @@ -676,7 +676,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->lcd_putsxy(0, 28, "[MODE] shuffle"); rb->lcd_putsxy(0, 38, "[MENU] change pic"); #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN rb->lcd_putsxy(0, 18, PUZZLE_QUIT_TEXT " to stop"); rb->lcd_putsxy(0, 28, PUZZLE_SHUFFLE_TEXT " shuffle"); rb->lcd_putsxy(0, 38, PUZZLE_PICTURE_TEXT " change pic"); diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 21dcebbdb0..0f5923454b 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -149,7 +149,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef SNAKE_QUIT #define SNAKE_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index ff868538f3..1bddeb6b3b 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -297,7 +297,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef SNAKE2_LEFT #define SNAKE2_LEFT BUTTON_MIDLEFT #endif diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 4e8263aadf..f8e73682dc 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -280,7 +280,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef SOKOBAN_LEFT #define SOKOBAN_LEFT BUTTON_MIDLEFT #endif @@ -1240,7 +1240,7 @@ static int sokoban_menu(void) rb->lcd_putsxy(3, 56, "[SELECT+UP] Next Level"); #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN rb->lcd_putsxy(3, 6, SOKOBAN_MENU_NAME " Menu"); rb->lcd_putsxy(3, 16, SOKOBAN_UNDO_NAME " Undo"); rb->lcd_putsxy(3, 26, SOKOBAN_REDO_NAME " Redo"); diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 385aa11a41..2baea48c8d 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -307,7 +307,7 @@ static const struct plugin_api* rb; #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN //#ifndef SOL_QUIT //# define SOL_QUIT BUTTON_TOPLEFT //endif diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index ac6ff4ee55..21cfb1e794 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -209,7 +209,7 @@ static const struct plugin_api* rb; /* global api struct pointer */ #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef AST_PAUSE #define AST_PAUSE BUTTON_CENTER #endif diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 23bfd3ceef..401519bdee 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -237,7 +237,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN //#ifndef STAR_QUIT //#define STAR_QUIT BUTTON_TOPLEFT //#define STAR_QUIT_NAME "[TOPLEFT]" @@ -1075,7 +1075,7 @@ static int star_menu(void) "[PLAY+RIGHT] Reset level\n" "[PLAY+UP] Next level", true); #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN star_display_text("KEYS\n\n" STAR_TOGGLE_CONTROL_NAME " Toggle Control\n" STAR_QUIT_NAME " Exit\n" diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index 0544569dc5..53198d0a5f 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -92,7 +92,7 @@ static const struct plugin_api* rb; /* global api struct pointer */ #define STARFIELD_QUIT BUTTON_POWER #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef STARFIELD_QUIT #define STARFIELD_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c index 6bd6d2be2a..ae71a12f80 100644 --- a/apps/plugins/stopwatch.c +++ b/apps/plugins/stopwatch.c @@ -154,7 +154,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef STOPWATCH_QUIT #define STOPWATCH_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h index 22abdfed57..fb64ef9a66 100644 --- a/apps/plugins/sudoku/sudoku.h +++ b/apps/plugins/sudoku/sudoku.h @@ -190,7 +190,7 @@ #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef SUDOKU_BUTTON_QUIT #define SUDOKU_BUTTON_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index 64d91b7c48..088cdaea33 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c @@ -134,7 +134,7 @@ char buf[255]; #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef SUPERDOM_OK #define SUPERDOM_OK BUTTON_CENTER #endif diff --git a/apps/plugins/test_touchpad.c b/apps/plugins/test_touchpad.c deleted file mode 100644 index 1d4480a46c..0000000000 --- a/apps/plugins/test_touchpad.c +++ /dev/null @@ -1,141 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 Rob Purchase - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "plugin.h" - -PLUGIN_HEADER - -#if (CONFIG_KEYPAD == COWOND2_PAD) -#define TOUCHPAD_QUIT BUTTON_POWER -#define TOUCHPAD_TOGGLE BUTTON_MENU -#elif (CONFIG_KEYPAD == MROBE500_PAD) -#define TOUCHPAD_QUIT BUTTON_POWER -#define TOUCHPAD_TOGGLE BUTTON_RC_MODE -#endif - -static const struct plugin_api* rb; - -/* plugin entry point */ -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) -{ - int button = 0; - enum touchpad_mode mode = TOUCHPAD_BUTTON; - - /* standard stuff */ - (void)parameter; - rb = api; - - rb->touchpad_set_mode(mode); - - /* wait until user closes plugin */ - do - { - short x = 0; - short y = 0; - bool draw_rect = false; - - button = rb->button_get(true); - - if (button & BUTTON_TOPLEFT) - { - draw_rect = true; - x = 0; y = 0; - } - else if (button & BUTTON_TOPMIDDLE) - { - draw_rect = true; - x = LCD_WIDTH/3; y = 0; - } - else if (button & BUTTON_TOPRIGHT) - { - draw_rect = true; - x = 2*(LCD_WIDTH/3); y = 0; - } - else if (button & BUTTON_MIDLEFT) - { - draw_rect = true; - x = 0; y = LCD_HEIGHT/3; - } - else if (button & BUTTON_CENTER) - { - draw_rect = true; - x = LCD_WIDTH/3; y = LCD_HEIGHT/3; - } - else if (button & BUTTON_MIDRIGHT) - { - draw_rect = true; - x = 2*(LCD_WIDTH/3); y = LCD_HEIGHT/3; - } - else if (button & BUTTON_BOTTOMLEFT) - { - draw_rect = true; - x = 0; y = 2*(LCD_HEIGHT/3); - } - else if (button & BUTTON_BOTTOMMIDDLE) - { - draw_rect = true; - x = LCD_WIDTH/3; y = 2*(LCD_HEIGHT/3); - } - else if (button & BUTTON_BOTTOMRIGHT) - { - draw_rect = true; - x = 2*(LCD_WIDTH/3); y = 2*(LCD_HEIGHT/3); - } - - if (button & TOUCHPAD_TOGGLE && (button & BUTTON_REL)) - { - mode = (mode == TOUCHPAD_POINT) ? TOUCHPAD_BUTTON : TOUCHPAD_POINT; - rb->touchpad_set_mode(mode); - } - - if (button & BUTTON_REL) draw_rect = false; - - rb->lcd_clear_display(); - - if (draw_rect) - { - rb->lcd_set_foreground(LCD_RGBPACK(0xc0, 0, 0)); - rb->lcd_fillrect(x, y, LCD_WIDTH/3, LCD_HEIGHT/3); - } - - if (draw_rect || button & BUTTON_TOUCHPAD) - { - intptr_t button_data = rb->button_get_data(); - x = button_data >> 16; - y = button_data & 0xffff; - - rb->lcd_set_foreground(LCD_RGBPACK(0, 0, 0xc0)); - rb->lcd_fillrect(x-7, y-7, 14, 14); - - /* in stylus mode, show REL position in black */ - if (mode == TOUCHPAD_POINT && (button & BUTTON_REL)) - rb->lcd_set_foreground(LCD_BLACK); - else - rb->lcd_set_foreground(LCD_WHITE); - - rb->lcd_hline(x-5, x+5, y); - rb->lcd_vline(x, y-5, y+5); - } - rb->lcd_update(); - - } while (button != TOUCHPAD_QUIT); - - return PLUGIN_OK; -} diff --git a/apps/plugins/test_touchscreen.c b/apps/plugins/test_touchscreen.c new file mode 100644 index 0000000000..84c8e96cb5 --- /dev/null +++ b/apps/plugins/test_touchscreen.c @@ -0,0 +1,141 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 Rob Purchase + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "plugin.h" + +PLUGIN_HEADER + +#if (CONFIG_KEYPAD == COWOND2_PAD) +#define TOUCHSCREEN_QUIT BUTTON_POWER +#define TOUCHSCREEN_TOGGLE BUTTON_MENU +#elif (CONFIG_KEYPAD == MROBE500_PAD) +#define TOUCHSCREEN_QUIT BUTTON_POWER +#define TOUCHSCREEN_TOGGLE BUTTON_RC_MODE +#endif + +static const struct plugin_api* rb; + +/* plugin entry point */ +enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +{ + int button = 0; + enum touchscreen_mode mode = TOUCHSCREEN_BUTTON; + + /* standard stuff */ + (void)parameter; + rb = api; + + rb->touchscreen_set_mode(mode); + + /* wait until user closes plugin */ + do + { + short x = 0; + short y = 0; + bool draw_rect = false; + + button = rb->button_get(true); + + if (button & BUTTON_TOPLEFT) + { + draw_rect = true; + x = 0; y = 0; + } + else if (button & BUTTON_TOPMIDDLE) + { + draw_rect = true; + x = LCD_WIDTH/3; y = 0; + } + else if (button & BUTTON_TOPRIGHT) + { + draw_rect = true; + x = 2*(LCD_WIDTH/3); y = 0; + } + else if (button & BUTTON_MIDLEFT) + { + draw_rect = true; + x = 0; y = LCD_HEIGHT/3; + } + else if (button & BUTTON_CENTER) + { + draw_rect = true; + x = LCD_WIDTH/3; y = LCD_HEIGHT/3; + } + else if (button & BUTTON_MIDRIGHT) + { + draw_rect = true; + x = 2*(LCD_WIDTH/3); y = LCD_HEIGHT/3; + } + else if (button & BUTTON_BOTTOMLEFT) + { + draw_rect = true; + x = 0; y = 2*(LCD_HEIGHT/3); + } + else if (button & BUTTON_BOTTOMMIDDLE) + { + draw_rect = true; + x = LCD_WIDTH/3; y = 2*(LCD_HEIGHT/3); + } + else if (button & BUTTON_BOTTOMRIGHT) + { + draw_rect = true; + x = 2*(LCD_WIDTH/3); y = 2*(LCD_HEIGHT/3); + } + + if (button & TOUCHSCREEN_TOGGLE && (button & BUTTON_REL)) + { + mode = (mode == TOUCHSCREEN_POINT) ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT; + rb->touchscreen_set_mode(mode); + } + + if (button & BUTTON_REL) draw_rect = false; + + rb->lcd_clear_display(); + + if (draw_rect) + { + rb->lcd_set_foreground(LCD_RGBPACK(0xc0, 0, 0)); + rb->lcd_fillrect(x, y, LCD_WIDTH/3, LCD_HEIGHT/3); + } + + if (draw_rect || button & BUTTON_TOUCHSCREEN) + { + intptr_t button_data = rb->button_get_data(); + x = button_data >> 16; + y = button_data & 0xffff; + + rb->lcd_set_foreground(LCD_RGBPACK(0, 0, 0xc0)); + rb->lcd_fillrect(x-7, y-7, 14, 14); + + /* in stylus mode, show REL position in black */ + if (mode == TOUCHSCREEN_POINT && (button & BUTTON_REL)) + rb->lcd_set_foreground(LCD_BLACK); + else + rb->lcd_set_foreground(LCD_WHITE); + + rb->lcd_hline(x-5, x+5, y); + rb->lcd_vline(x, y-5, y+5); + } + rb->lcd_update(); + + } while (button != TOUCHSCREEN_QUIT); + + return PLUGIN_OK; +} diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 7005745e01..806688514e 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -262,7 +262,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef VIEWER_QUIT #define VIEWER_QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index b18c4f0db0..4c98e6df8f 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -213,7 +213,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef VUMETER_QUIT #define VUMETER_QUIT BUTTON_TOPLEFT #define LABEL_QUIT "TOPLEFT" diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 5469073588..6586e78b2c 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -225,7 +225,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef BTN_DIR_UP #define BTN_DIR_UP BUTTON_TOPMIDDLE #endif diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 0faf8a27be..8490d6bae6 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -149,7 +149,7 @@ PLUGIN_HEADER #error No keymap defined! #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef QUIT #define QUIT BUTTON_TOPLEFT #endif diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h index 932c360991..777ddccac3 100644 --- a/apps/plugins/zxbox/keymaps.h +++ b/apps/plugins/zxbox/keymaps.h @@ -127,7 +127,7 @@ #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef ZX_UP #define ZX_UP BUTTON_TOPMIDDLE #endif diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c index 146d7432b4..f57b8e4f16 100644 --- a/apps/plugins/zxbox/zxbox_keyb.c +++ b/apps/plugins/zxbox/zxbox_keyb.c @@ -138,7 +138,7 @@ #endif -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #ifndef KBD_SELECT #define KBD_SELECT BUTTON_CENTER #endif diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c index ee46eb8eb4..c71d43d40e 100755 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c @@ -54,13 +54,13 @@ extern int line; #if 0 struct touch_calibration_point tl, br; -void touchpad_get_one_point(struct touch_calibration_point *p) +void touchscreen_get_one_point(struct touch_calibration_point *p) { int data = 0; int start = current_tick; while (TIME_AFTER(start+(HZ/3), current_tick)) { - if (button_read_device()&BUTTON_TOUCHPAD) + if (button_read_device()&BUTTON_TOUCHSCREEN) { data = button_get_last_touch(); p->val_x = data>>16; @@ -74,7 +74,7 @@ void touchpad_get_one_point(struct touch_calibration_point *p) #define MARGIN 25 #define LEN 7 -void touchpad_calibrate_screen(void) +void touchscreen_calibrate_screen(void) { reset_screen(); printf("touch the center of the crosshairs to calibrate"); @@ -83,7 +83,7 @@ void touchpad_calibrate_screen(void) lcd_vline(MARGIN, MARGIN-LEN, MARGIN+LEN); lcd_update(); tl.px_x = MARGIN; tl.px_y = MARGIN; - touchpad_get_one_point(&tl); + touchscreen_get_one_point(&tl); reset_screen(); printf("touch the center of the crosshairs to calibrate"); /* get the topright value */ @@ -91,7 +91,7 @@ void touchpad_calibrate_screen(void) lcd_vline(LCD_WIDTH-MARGIN, LCD_HEIGHT-MARGIN-LEN, LCD_HEIGHT-MARGIN+LEN); lcd_update(); br.px_x = LCD_WIDTH-MARGIN; br.px_y = LCD_HEIGHT-MARGIN; - touchpad_get_one_point(&br); + touchscreen_get_one_point(&br); reset_screen(); line++; printf("tl %d %d", tl.val_x, tl.val_y); @@ -108,7 +108,7 @@ void mrdebug(void) int button=0; #if 0 use_calibration(false); - touchpad_calibrate_screen(); + touchscreen_calibrate_screen(); use_calibration(true); #endif @@ -148,15 +148,15 @@ void mrdebug(void) else if (button == BUTTON_RC_HEART) { printf("POINT"); - touchpad_set_mode(TOUCHPAD_POINT); + touchscreen_set_mode(TOUCHSCREEN_POINT); } else if (button == BUTTON_RC_MODE) { printf("BUTTON"); - touchpad_set_mode(TOUCHPAD_BUTTON); + touchscreen_set_mode(TOUCHSCREEN_BUTTON); } #if 1 - else if (button&BUTTON_TOUCHPAD) + else if (button&BUTTON_TOUCHSCREEN) { if (button&BUTTON_REL) continue; diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 7be7fbc1b3..8ad93ae022 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -517,7 +517,7 @@ static int button_read(void) /* Filter the button status. It is only accepted if we get the same status twice in a row. */ -#ifndef HAVE_TOUCHPAD +#ifndef HAVE_TOUCHSCREEN if (btn != last_read) retval = lastbtn; else diff --git a/firmware/export/button.h b/firmware/export/button.h index f47639b3c7..0b4c8fd2b0 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -60,30 +60,30 @@ void wheel_send_events(bool send); int button_apply_acceleration(const unsigned int data); #endif -#define BUTTON_NONE 0x00000000 +#define BUTTON_NONE 0x00000000 /* Button modifiers */ -#define BUTTON_REL 0x02000000 -#define BUTTON_REPEAT 0x04000000 -#define BUTTON_TOUCHPAD 0x08000000 +#define BUTTON_REL 0x02000000 +#define BUTTON_REPEAT 0x04000000 +#define BUTTON_TOUCHSCREEN 0x08000000 -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN #if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ || !defined(BUTTON_BOTTOMRIGHT) -#error Touchpad button mode BUTTON_* defines not set up correctly +#error Touchscreen button mode BUTTON_* defines not set up correctly #endif -enum touchpad_mode { - TOUCHPAD_POINT = 0, /* touchpad returns pixel co-ords */ - TOUCHPAD_BUTTON, /* touchpad returns BUTTON_* area codes - actual pixel value will still be accessable - from button_get_data */ +enum touchscreen_mode { + TOUCHSCREEN_POINT = 0, /* touchscreen returns pixel co-ords */ + TOUCHSCREEN_BUTTON, /* touchscreen returns BUTTON_* area codes + actual pixel value will still be accessable + from button_get_data */ }; /* maybe define the number of buttons in button-target.h ? */ -void touchpad_set_mode(enum touchpad_mode mode); -enum touchpad_mode touchpad_get_mode(void); +void touchscreen_set_mode(enum touchscreen_mode mode); +enum touchscreen_mode touchscreen_get_mode(void); #endif #endif /* _BUTTON_H_ */ diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h index 828dc076b7..841390b479 100644 --- a/firmware/export/config-cowond2.h +++ b/firmware/export/config-cowond2.h @@ -60,7 +60,7 @@ /* define this to indicate your device's keypad */ #define CONFIG_KEYPAD COWOND2_PAD -#define HAVE_TOUCHPAD +#define HAVE_TOUCHSCREEN #define HAVE_BUTTON_DATA /* define this if you have a real-time clock */ diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h index d7e172b50f..285a53a014 100644 --- a/firmware/export/config-mrobe500.h +++ b/firmware/export/config-mrobe500.h @@ -86,7 +86,7 @@ #define DEFAULT_REMOTE_CONTRAST_SETTING 7 #define CONFIG_KEYPAD MROBE500_PAD -#define HAVE_TOUCHPAD +#define HAVE_TOUCHSCREEN #define HAVE_BUTTON_DATA /* Define this if you do software codec */ diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h index 1c2be01d93..ffb5e90a75 100644 --- a/firmware/export/config-ondavx747.h +++ b/firmware/export/config-ondavx747.h @@ -66,7 +66,7 @@ #define CONFIG_KEYPAD ONDAVX747_PAD #define HAS_BUTTON_HOLD -#define HAVE_TOUCHPAD +#define HAVE_TOUCHSCREEN #define HAVE_BUTTON_DATA /* Define this if you do software codec */ diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c index 0da55e3f0a..9449bcdf30 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c @@ -28,24 +28,24 @@ #define TOUCH_MARGIN 8 -static enum touchpad_mode current_mode = TOUCHPAD_POINT; +static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT; static short last_x, last_y; static bool touch_available = false; -static int touchpad_buttons[3][3] = +static int touchscreen_buttons[3][3] = { {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, }; -void touchpad_set_mode(enum touchpad_mode mode) +void touchscreen_set_mode(enum touchscreen_mode mode) { current_mode = mode; } -enum touchpad_mode touchpad_get_mode(void) +enum touchscreen_mode touchscreen_get_mode(void) { return current_mode; } @@ -58,7 +58,7 @@ void button_set_touch_available(void) struct touch_calibration_point { short px_x; /* known pixel value */ short px_y; - short val_x; /* touchpad value at the known pixel */ + short val_x; /* touchscreen value at the known pixel */ short val_y; }; @@ -188,15 +188,15 @@ int button_read_device(int *data) *data = touch_to_pixels(x, y); switch (current_mode) { - case TOUCHPAD_POINT: - btn |= BUTTON_TOUCHPAD; + case TOUCHSCREEN_POINT: + btn |= BUTTON_TOUCHSCREEN; break; - case TOUCHPAD_BUTTON: + case TOUCHSCREEN_BUTTON: { int px_x = (*data&0xffff0000)>>16; int px_y = (*data&0x0000ffff); - btn |= touchpad_buttons[px_y/(LCD_HEIGHT/3)] - [px_x/(LCD_WIDTH/3)]; + btn |= touchscreen_buttons[px_y/(LCD_HEIGHT/3)] + [px_x/(LCD_WIDTH/3)]; break; } } @@ -208,7 +208,7 @@ int button_read_device(int *data) if (!(GPIOA & 0x4)) btn |= BUTTON_POWER; - if(btn & BUTTON_TOUCHPAD && !is_backlight_on(true)) + if(btn & BUTTON_TOUCHSCREEN && !is_backlight_on(true)) *data = 0; return btn; diff --git a/firmware/target/arm/tcc780x/cowond2/button-target.h b/firmware/target/arm/tcc780x/cowond2/button-target.h index d315d0172f..faf660fc71 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-target.h +++ b/firmware/target/arm/tcc780x/cowond2/button-target.h @@ -44,7 +44,7 @@ void button_set_touch_available(void); #define BUTTON_UP BUTTON_TOPMIDDLE #define BUTTON_DOWN BUTTON_BOTTOMMIDDLE -/* Touchpad Screen Area Buttons */ +/* Touch Screen Area Buttons */ #define BUTTON_TOPLEFT 0x00000010 #define BUTTON_TOPMIDDLE 0x00000020 #define BUTTON_TOPRIGHT 0x00000040 diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c index 26136ce59b..ba2cedb76c 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c @@ -42,18 +42,18 @@ static short last_x, last_y, last_z1, last_z2; /* for the touch screen */ static bool touch_available = false; -static enum touchpad_mode current_mode = TOUCHPAD_POINT; -static int touchpad_buttons[3][3] = { +static enum touchscreen_mode current_mode = TOUCHSCREEN_POINT; +static int touchscreen_buttons[3][3] = { {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, }; -void touchpad_set_mode(enum touchpad_mode mode) +void touchscreen_set_mode(enum touchscreen_mode mode) { current_mode = mode; } -enum touchpad_mode touchpad_get_mode(void) +enum touchscreen_mode touchscreen_get_mode(void) { return current_mode; } @@ -185,13 +185,13 @@ int button_read_device(int *data) *data = touch_to_pixels(x, y); switch (current_mode) { - case TOUCHPAD_POINT: - r_button |= BUTTON_TOUCHPAD; + case TOUCHSCREEN_POINT: + r_button |= BUTTON_TOUCHSCREEN; break; - case TOUCHPAD_BUTTON: + case TOUCHSCREEN_BUTTON: { int px_x = ((*data&0xffff0000)>>16), px_y = ((*data&0x0000ffff)); - r_button |= touchpad_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; + r_button |= touchscreen_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; oldbutton = r_button; break; } @@ -233,7 +233,7 @@ int button_read_device(int *data) return r_button; } -/* Touchpad data available interupt */ +/* Touchscreen data available interupt */ void read_battery_inputs(void); void GIO14(void) { diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-target.h b/firmware/target/arm/tms320dm320/mrobe-500/button-target.h index 30cc55dada..5b888b3e0a 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/button-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/button-target.h @@ -33,7 +33,7 @@ int button_read_device(int *data); struct touch_calibration_point { short px_x; /* known pixel value */ short px_y; - short val_x; /* touchpad value at the known pixel */ + short val_x; /* touchscreen value at the known pixel */ short val_y; }; void use_calibration(bool enable); @@ -55,7 +55,7 @@ void use_calibration(bool enable); #define BUTTON_TOUCH 0x00000200 -/* Touchpad Screen Area Buttons */ +/* Touch Screen Area Buttons */ #define BUTTON_TOPLEFT 0x00004000 #define BUTTON_TOPMIDDLE 0x00008000 #define BUTTON_TOPRIGHT 0x00010000 @@ -67,8 +67,8 @@ void use_calibration(bool enable); #define BUTTON_BOTTOMRIGHT 0x00400000 /* compatibility hacks - not mapped to the touchpad button areas because - the touchpad is not always in that mode */ + not mapped to the touchscreen button areas because + the touchscreen is not always in that mode */ #define BUTTON_LEFT BUTTON_RC_REW #define BUTTON_RIGHT BUTTON_RC_FF diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h index 23ce386cb1..677e4d1c67 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/button-target.h @@ -44,7 +44,7 @@ void button_set_touch_available(void); #define BUTTON_UP BUTTON_TOPMIDDLE #define BUTTON_DOWN BUTTON_BOTTOMMIDDLE -/* Touchpad Screen Area Buttons */ +/* Touch Screen Area Buttons */ #define BUTTON_TOPLEFT 0x00000010 #define BUTTON_TOPMIDDLE 0x00000020 #define BUTTON_TOPRIGHT 0x00000040 diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 843f685226..47ecb2b368 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -32,16 +32,16 @@ static intptr_t button_data; /* data value from last message dequeued */ -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN static int mouse_coords = 0; -static enum touchpad_mode touchpad_mode = TOUCHPAD_POINT; -void touchpad_set_mode(enum touchpad_mode mode) +static enum touchscreen_mode touchscreen_mode = TOUCHSCREEN_POINT; +void touchscreen_set_mode(enum touchscreen_mode mode) { - touchpad_mode = mode; + touchscreen_mode = mode; } -enum touchpad_mode touchpad_get_mode(void) +enum touchscreen_mode touchscreen_get_mode(void) { - return touchpad_mode; + return touchscreen_mode; } #endif /* how long until repeat kicks in */ @@ -120,23 +120,23 @@ void button_event(int key, bool pressed) switch (key) { -#ifdef HAVE_TOUCHPAD - case BUTTON_TOUCHPAD: +#ifdef HAVE_TOUCHSCREEN + case BUTTON_TOUCHSCREEN: data = mouse_coords; - switch (touchpad_mode) + switch (touchscreen_mode) { - case TOUCHPAD_POINT: - new_btn = BUTTON_TOUCHPAD; + case TOUCHSCREEN_POINT: + new_btn = BUTTON_TOUCHSCREEN; break; - case TOUCHPAD_BUTTON: + case TOUCHSCREEN_BUTTON: { - static int touchpad_buttons[3][3] = { + static int touchscreen_buttons[3][3] = { {BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT}, {BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT}, {BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT}, }; int px_x = ((data&0xffff0000)>>16), px_y = ((data&0x0000ffff)); - new_btn = touchpad_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; + new_btn = touchscreen_buttons[px_y/(LCD_HEIGHT/3)][px_x/(LCD_WIDTH/3)]; break; } } @@ -171,8 +171,8 @@ void button_event(int key, bool pressed) case SDLK_F4: if(pressed) { - touchpad_mode = (touchpad_mode == TOUCHPAD_POINT ? TOUCHPAD_BUTTON : TOUCHPAD_POINT); - printf("Touchpad mode: %s\n", touchpad_mode == TOUCHPAD_POINT ? "TOUCHPAD_POINT" : "TOUCHPAD_BUTTON"); + touchscreen_mode = (touchscreen_mode == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); + printf("Touchscreen mode: %s\n", touchscreen_mode == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); } break; @@ -1105,7 +1105,7 @@ long button_get_w_tmo(int ticks) intptr_t button_get_data(void) { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN return button_data; #else /* Needed by the accelerating wheel driver for Sansa e200 */ @@ -1113,7 +1113,7 @@ intptr_t button_get_data(void) #endif } -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN extern bool debug_wps; void mouse_tick_task(void) { @@ -1134,7 +1134,7 @@ void mouse_tick_task(void) } mouse_coords = (x<<16)|y; - button_event(BUTTON_TOUCHPAD, true); + button_event(BUTTON_TOUCHSCREEN, true); if (debug_wps) printf("Mouse at: (%d, %d)\n", x, y); } @@ -1142,7 +1142,7 @@ void mouse_tick_task(void) #endif void button_init(void) { -#ifdef HAVE_TOUCHPAD +#ifdef HAVE_TOUCHSCREEN tick_add_task(mouse_tick_task); #endif } diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c index f0e99070e5..156e4203f6 100644 --- a/uisimulator/sdl/uisdl.c +++ b/uisimulator/sdl/uisdl.c @@ -78,7 +78,7 @@ void gui_message_loop(void) button_event(event.key.keysym.sym, false); sim_exit_irq_handler(); break; -#ifndef HAVE_TOUCHPAD +#ifndef HAVE_TOUCHSCREEN case SDL_MOUSEBUTTONDOWN: if (debug_wps && event.button.button == 1) { @@ -88,7 +88,7 @@ void gui_message_loop(void) #else case SDL_MOUSEBUTTONUP: sim_enter_irq_handler(); - button_event(BUTTON_TOUCHPAD, false); + button_event(BUTTON_TOUCHSCREEN, false); sim_exit_irq_handler(); break; #endif -- cgit v1.2.3