diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-08-15 12:27:07 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-08-15 12:27:07 +0000 |
commit | 224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9 (patch) | |
tree | bae2154b272f786983cf8e6de28d33f98f327560 /apps/gui/list.c | |
parent | c0f8b187706364f5e4bda2ac26750d14454c901d (diff) | |
download | rockbox-224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9.tar.gz rockbox-224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9.zip |
Finally, the new button action system is here, thanks to Jonathan Gordon. Some button mappings have changed and other things may break. Comments should go to the forum, http://forums.rockbox.org/index.php?topic=5829.0 or the mailing list.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10582 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 90 |
1 files changed, 25 insertions, 65 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index b17e01ed90..f48d4d9ee1 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "settings.h" | 26 | #include "settings.h" |
27 | #include "kernel.h" | 27 | #include "kernel.h" |
28 | 28 | ||
29 | #include "action.h" | ||
29 | #include "screen_access.h" | 30 | #include "screen_access.h" |
30 | #include "list.h" | 31 | #include "list.h" |
31 | #include "scrollbar.h" | 32 | #include "scrollbar.h" |
@@ -683,106 +684,65 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
683 | gui_synclist_limit_scroll(lists, true); | 684 | gui_synclist_limit_scroll(lists, true); |
684 | switch(button) | 685 | switch(button) |
685 | { | 686 | { |
686 | case LIST_PREV: | 687 | case ACTION_STD_PREV: |
687 | #ifdef LIST_RC_PREV | ||
688 | case LIST_RC_PREV: | ||
689 | #endif | ||
690 | gui_synclist_limit_scroll(lists, false); | 688 | gui_synclist_limit_scroll(lists, false); |
691 | 689 | ||
692 | case LIST_PREV | BUTTON_REPEAT: | 690 | case ACTION_STD_PREVREPEAT: |
693 | #ifdef LIST_RC_PREV | ||
694 | case LIST_RC_PREV | BUTTON_REPEAT: | ||
695 | #endif | ||
696 | gui_synclist_select_previous(lists); | 691 | gui_synclist_select_previous(lists); |
697 | gui_synclist_draw(lists); | 692 | gui_synclist_draw(lists); |
698 | yield(); | 693 | yield(); |
699 | return LIST_PREV; | 694 | return ACTION_STD_PREV; |
700 | 695 | ||
701 | case LIST_NEXT: | 696 | case ACTION_STD_NEXT: |
702 | #ifdef LIST_RC_NEXT | ||
703 | case LIST_RC_NEXT: | ||
704 | #endif | ||
705 | gui_synclist_limit_scroll(lists, false); | 697 | gui_synclist_limit_scroll(lists, false); |
706 | 698 | ||
707 | case LIST_NEXT | BUTTON_REPEAT: | 699 | case ACTION_STD_NEXTREPEAT: |
708 | #ifdef LIST_RC_NEXT | ||
709 | |||
710 | case LIST_RC_NEXT | BUTTON_REPEAT: | ||
711 | #endif | ||
712 | gui_synclist_select_next(lists); | 700 | gui_synclist_select_next(lists); |
713 | gui_synclist_draw(lists); | 701 | gui_synclist_draw(lists); |
714 | yield(); | 702 | yield(); |
715 | return LIST_NEXT; | 703 | return ACTION_STD_NEXT; |
716 | 704 | ||
717 | #ifdef LIST_PGRIGHT | 705 | #ifdef HAVE_LCD_BITMAP |
718 | case LIST_PGRIGHT: | 706 | case ACTION_TREE_PGRIGHT: |
719 | #if !(LIST_PGRIGHT & BUTTON_REPEAT) | ||
720 | case LIST_PGRIGHT | BUTTON_REPEAT: | ||
721 | #endif | ||
722 | #ifdef LIST_RC_PGRIGHT | ||
723 | case LIST_RC_PGRIGHT: | ||
724 | case LIST_RC_PGRIGHT | BUTTON_REPEAT: | ||
725 | #endif | ||
726 | gui_synclist_scroll_right(lists); | 707 | gui_synclist_scroll_right(lists); |
727 | gui_synclist_draw(lists); | 708 | gui_synclist_draw(lists); |
728 | return LIST_PGRIGHT; | 709 | return ACTION_TREE_PGRIGHT; |
729 | #endif | 710 | case ACTION_TREE_PGLEFT: |
730 | |||
731 | #ifdef LIST_PGLEFT | ||
732 | case LIST_PGLEFT: | ||
733 | #if !(LIST_PGLEFT & BUTTON_REPEAT) | ||
734 | case LIST_PGLEFT | BUTTON_REPEAT: | ||
735 | #endif | ||
736 | #ifdef LIST_RC_PGLEFT | ||
737 | case LIST_RC_PGLEFT: | ||
738 | case LIST_RC_PGLEFT | BUTTON_REPEAT: | ||
739 | #endif | ||
740 | gui_synclist_scroll_left(lists); | 711 | gui_synclist_scroll_left(lists); |
741 | gui_synclist_draw(lists); | 712 | gui_synclist_draw(lists); |
742 | return LIST_PGLEFT; | 713 | return ACTION_TREE_PGLEFT; |
743 | #endif | 714 | #endif |
744 | 715 | ||
745 | /* for pgup / pgdown, we are obliged to have a different behaviour depending on the screen | 716 | /* for pgup / pgdown, we are obliged to have a different behaviour depending on the screen |
746 | * for which the user pressed the key since for example, remote and main screen doesn't | 717 | * for which the user pressed the key since for example, remote and main screen doesn't |
747 | * have the same number of lines*/ | 718 | * have the same number of lines*/ |
748 | #ifdef LIST_PGUP | 719 | case ACTION_LISTTREE_PGUP: |
749 | case LIST_PGUP: | ||
750 | gui_synclist_limit_scroll(lists, false); | 720 | gui_synclist_limit_scroll(lists, false); |
751 | case LIST_PGUP | BUTTON_REPEAT: | ||
752 | gui_synclist_select_previous_page(lists, SCREEN_MAIN); | 721 | gui_synclist_select_previous_page(lists, SCREEN_MAIN); |
753 | gui_synclist_draw(lists); | 722 | gui_synclist_draw(lists); |
754 | yield(); | 723 | yield(); |
755 | return LIST_NEXT; | 724 | return ACTION_STD_NEXT; |
756 | #endif | 725 | |
757 | 726 | case ACTION_LISTTREE_PGDOWN: | |
758 | #ifdef LIST_RC_PGUP | ||
759 | case LIST_RC_PGUP: | ||
760 | gui_synclist_limit_scroll(lists, false); | 727 | gui_synclist_limit_scroll(lists, false); |
761 | case LIST_RC_PGUP | BUTTON_REPEAT: | 728 | gui_synclist_select_next_page(lists, SCREEN_MAIN); |
762 | gui_synclist_select_previous_page(lists, SCREEN_REMOTE); | ||
763 | gui_synclist_draw(lists); | 729 | gui_synclist_draw(lists); |
764 | yield(); | 730 | yield(); |
765 | return LIST_NEXT; | 731 | return ACTION_STD_PREV; |
766 | #endif | 732 | #if (REMOTE_BUTTON != 0 ) |
767 | 733 | case ACTION_LISTTREE_RC_PGUP: | |
768 | #ifdef LIST_PGDN | ||
769 | case LIST_PGDN: | ||
770 | gui_synclist_limit_scroll(lists, false); | 734 | gui_synclist_limit_scroll(lists, false); |
771 | case LIST_PGDN | BUTTON_REPEAT: | 735 | gui_synclist_select_previous_page(lists, SCREEN_REMOTE); |
772 | gui_synclist_select_next_page(lists, SCREEN_MAIN); | ||
773 | gui_synclist_draw(lists); | 736 | gui_synclist_draw(lists); |
774 | yield(); | 737 | yield(); |
775 | return LIST_PREV; | 738 | return ACTION_STD_NEXT; |
776 | #endif | 739 | |
777 | 740 | case ACTION_LISTTREE_RC_PGDOWN: | |
778 | #ifdef LIST_RC_PGDN | ||
779 | case LIST_RC_PGDN: | ||
780 | gui_synclist_limit_scroll(lists, false); | 741 | gui_synclist_limit_scroll(lists, false); |
781 | case LIST_RC_PGDN | BUTTON_REPEAT: | ||
782 | gui_synclist_select_next_page(lists, SCREEN_REMOTE); | 742 | gui_synclist_select_next_page(lists, SCREEN_REMOTE); |
783 | gui_synclist_draw(lists); | 743 | gui_synclist_draw(lists); |
784 | yield(); | 744 | yield(); |
785 | return LIST_PREV; | 745 | return ACTION_STD_PREV; |
786 | #endif | 746 | #endif |
787 | } | 747 | } |
788 | return 0; | 748 | return 0; |