1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
diff --git a/apps/action.c b/apps/action.c
index 2119888..5810003 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -197,7 +197,7 @@ static int get_action_worker(int context, int timeout,
         if (button & BUTTON_REMOTE)
             context |= CONTEXT_REMOTE;
 #endif
-        if ((context & CONTEXT_CUSTOM) && get_context_map)
+        if ((context & CONTEXT_PLUGIN) && get_context_map)
             items = get_context_map(context);
         else
             items = get_context_mapping(context);
diff --git a/apps/action.h b/apps/action.h
index 9869fb3..616fad5 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -30,6 +30,7 @@
 #define CONTEXT_REMOTE  0x80000000 /* | this against another context to get remote buttons for that context */
 #define CONTEXT_CUSTOM  0x40000000 /* | this against anything to get your context number */
 #define CONTEXT_CUSTOM2 0x20000000 /* as above */
+#define CONTEXT_PLUGIN  0x10000000 /* for plugins using get_custom_action */

 #define LAST_ITEM_IN_LIST { CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE }
 #define LAST_ITEM_IN_LIST__NEXTLIST(a) { a, BUTTON_NONE, BUTTON_NONE }
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index 550cd56..e870c79 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -71,7 +71,7 @@ const struct button_mapping remote_directions[] =
 #else
     #error pluginlib_actions: Unsupported remote keypad
 #endif
-    {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+    {CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
 };
 #endif /* HAVE_REMOTE_LCD */

@@ -174,7 +174,7 @@ const struct button_mapping generic_directions[] =
 #else
     #error pluginlib_actions: Unsupported keypad
 #endif
-    {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+    {CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
 };

 const struct button_mapping generic_left_right_fire[] =
@@ -296,7 +296,7 @@ const struct button_mapping generic_left_right_fire[] =
 #else
     #error pluginlib_actions: Unsupported keypad
 #endif
-    {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+    {CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
 };

 /* these were taken from the bubbles plugin, so may need tweaking */
@@ -457,7 +457,7 @@ const struct button_mapping generic_actions[] =
 #else
     #error pluginlib_actions: Unsupported keypad
 #endif
-    {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+    {CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
 };

 const struct button_mapping generic_increase_decrease[] =
@@ -537,7 +537,7 @@ const struct button_mapping generic_increase_decrease[] =
 #else
 #error pluginlib_actions: Unsupported keypad
 #endif
-    {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+    {CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
 };

 static struct button_mapping **plugin_context_order;
@@ -560,5 +560,5 @@ int pluginlib_getaction(int timeout,
     plugin_context_order = (struct button_mapping **)plugin_contexts;
     plugin_context_count = count;
     last_context = 0;
-    return rb->get_custom_action(CONTEXT_CUSTOM,timeout,get_context_map);
+    return rb->get_custom_action(CONTEXT_PLUGIN,timeout,get_context_map);
 }
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 96f7979..ec3bdc8 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -87,7 +87,7 @@ const struct button_mapping pf_context_album_scroll[] =
     {PF_NEXT,         BUTTON_RC_FF,               BUTTON_NONE},
     {PF_NEXT_REPEAT,  BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
 #endif
-    LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1)
+    LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_PLUGIN|1)
 };

 const struct button_mapping pf_context_buttons[] =
@@ -139,7 +139,7 @@ const struct button_mapping pf_context_buttons[] =
 #if CONFIG_KEYPAD == IAUDIO_M3_PAD
     LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD|CONTEXT_REMOTE)
 #else
-    LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+    LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE)
 #endif
 };
 const struct button_mapping *pf_contexts[] =
@@ -686,7 +686,7 @@ const struct custom_format format_transposed = {

 static const struct button_mapping* get_context_map(int context)
 {
-    return pf_contexts[context & ~CONTEXT_CUSTOM];
+    return pf_contexts[context & ~CONTEXT_PLUGIN];
 }

 /* Create the lookup table with the scaling values for the reflections */
@@ -2601,7 +2601,7 @@ int main(void)
         rb->yield();

         /*/ Handle buttons */
-        button = rb->get_custom_action(CONTEXT_CUSTOM|
+        button = rb->get_custom_action(CONTEXT_PLUGIN|
             (pf_state == pf_show_tracks ? 1 : 0),
             instant_update ? 0 : HZ/16,
             get_context_map);