Skip to content

Commit 9210ad5

Browse files
author
dave
committed
#106 improve doxygen comments
1 parent aea20f3 commit 9210ad5

12 files changed

+204
-13
lines changed

examples/esp32Lcd/Esp32Lcd.emf

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,88 @@
8181
"localOnly": false,
8282
"visible": true
8383
}
84+
},
85+
{
86+
"parentId": 0,
87+
"type": "subMenu",
88+
"item": {
89+
"secured": false,
90+
"name": "Grid",
91+
"variableName": "Grid",
92+
"id": 6,
93+
"eepromAddress": -1,
94+
"readOnly": false,
95+
"localOnly": false,
96+
"visible": true
97+
}
98+
},
99+
{
100+
"parentId": 6,
101+
"type": "floatItem",
102+
"item": {
103+
"numDecimalPlaces": 3,
104+
"name": "Float value",
105+
"variableName": "GridFloatValue",
106+
"id": 9,
107+
"eepromAddress": -1,
108+
"readOnly": false,
109+
"localOnly": false,
110+
"visible": true
111+
}
112+
},
113+
{
114+
"parentId": 6,
115+
"type": "boolItem",
116+
"item": {
117+
"naming": "TRUE_FALSE",
118+
"name": "LED1",
119+
"variableName": "GridLED1",
120+
"id": 7,
121+
"eepromAddress": -1,
122+
"readOnly": false,
123+
"localOnly": false,
124+
"visible": true
125+
}
126+
},
127+
{
128+
"parentId": 6,
129+
"type": "boolItem",
130+
"item": {
131+
"naming": "TRUE_FALSE",
132+
"name": "LED2",
133+
"variableName": "GridLED2",
134+
"id": 8,
135+
"eepromAddress": -1,
136+
"readOnly": false,
137+
"localOnly": false,
138+
"visible": true
139+
}
140+
},
141+
{
142+
"parentId": 6,
143+
"type": "actionMenu",
144+
"item": {
145+
"name": "Up",
146+
"variableName": "GridUp",
147+
"id": 10,
148+
"eepromAddress": -1,
149+
"readOnly": false,
150+
"localOnly": false,
151+
"visible": true
152+
}
153+
},
154+
{
155+
"parentId": 6,
156+
"type": "actionMenu",
157+
"item": {
158+
"name": "Down",
159+
"variableName": "GridDown",
160+
"id": 11,
161+
"eepromAddress": -1,
162+
"readOnly": false,
163+
"localOnly": false,
164+
"visible": true
165+
}
84166
}
85167
],
86168
"codeOptions": {

examples/esp32Lcd/esp32Lcd.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ void setup() {
44
Serial.begin(115200);
55
Wire.begin(4, 15);
66
setupMenu();
7-
87
}
98

109
void loop() {
1110
taskManager.runLoop();
12-
1311
}
1412

1513

examples/esp32Lcd/esp32Lcd_menu.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,22 @@ LiquidCrystalRenderer renderer(lcd, 20, 4);
1919

2020
// Global Menu Item declarations
2121

22+
const PROGMEM AnyMenuInfo minfoGridDown = { "Down", 11, 0xffff, 0, NO_CALLBACK };
23+
ActionMenuItem menuGridDown(&minfoGridDown, NULL);
24+
const PROGMEM AnyMenuInfo minfoGridUp = { "Up", 10, 0xffff, 0, NO_CALLBACK };
25+
ActionMenuItem menuGridUp(&minfoGridUp, &menuGridDown);
26+
const PROGMEM BooleanMenuInfo minfoGridLED2 = { "LED2", 8, 0xffff, 1, NO_CALLBACK, NAMING_TRUE_FALSE };
27+
BooleanMenuItem menuGridLED2(&minfoGridLED2, false, &menuGridUp);
28+
const PROGMEM BooleanMenuInfo minfoGridLED1 = { "LED1", 7, 0xffff, 1, NO_CALLBACK, NAMING_TRUE_FALSE };
29+
BooleanMenuItem menuGridLED1(&minfoGridLED1, false, &menuGridLED2);
30+
const PROGMEM FloatMenuInfo minfoGridFloatValue = { "Float value", 9, 0xffff, 3, NO_CALLBACK };
31+
FloatMenuItem menuGridFloatValue(&minfoGridFloatValue, &menuGridLED1);
32+
RENDERING_CALLBACK_NAME_INVOKE(fnGridRtCall, backSubItemRenderFn, "Grid", -1, NO_CALLBACK)
33+
const PROGMEM SubMenuInfo minfoGrid = { "Grid", 6, 0xffff, 0, NO_CALLBACK };
34+
BackMenuItem menuBackGrid(fnGridRtCall, &menuGridFloatValue);
35+
SubMenuItem menuGrid(&minfoGrid, &menuBackGrid, NULL);
2236
RENDERING_CALLBACK_NAME_INVOKE(fnRGBRtCall, rgbAlphaItemRenderFn, "RGB", -1, NO_CALLBACK)
23-
Rgb32MenuItem menuRGB(5, fnRGBRtCall, false, NULL);
37+
Rgb32MenuItem menuRGB(5, fnRGBRtCall, false, &menuGrid);
2438
ListRuntimeMenuItem menuMyList(4, 0, fnMyListRtCall, &menuRGB);
2539
const PROGMEM BooleanMenuInfo minfoPeeled = { "Power", 3, 0xffff, 1, NO_CALLBACK, NAMING_ON_OFF };
2640
BooleanMenuItem menuPeeled(&minfoPeeled, false, &menuMyList);

examples/esp32Lcd/esp32Lcd_menu.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ extern LiquidCrystalRenderer renderer;
3030

3131
// Global Menu Item exports
3232

33+
extern ActionMenuItem menuGridDown;
34+
extern ActionMenuItem menuGridUp;
35+
extern BooleanMenuItem menuGridLED2;
36+
extern BooleanMenuItem menuGridLED1;
37+
extern FloatMenuItem menuGridFloatValue;
38+
extern BackMenuItem menuBackGrid;
39+
extern SubMenuItem menuGrid;
3340
extern Rgb32MenuItem menuRGB;
3441
extern ListRuntimeMenuItem menuMyList;
3542
extern BooleanMenuItem menuPeeled;

src/MenuHistoryNavigator.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
44
*/
55

6+
/**
7+
* @file MenuHistoryNavigator.h contains the functionality to do with menu item navigation, including a stack of
8+
* previous navigations
9+
*/
10+
611
#ifndef TCMENU_MENUHISTORYNAVIGATOR_H
712
#define TCMENU_MENUHISTORYNAVIGATOR_H
813

src/ScrollChoiceMenuItem.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
44
*/
55

6+
/**
7+
* @file ScrollChoiceMenuItem.h contains the menu item definition for scrolling choice types, and also for RGB items
8+
*/
9+
610
#ifndef SCROLL_CHOICE_ENUM_MENU_ITEM_H
711
#define SCROLL_CHOICE_ENUM_MENU_ITEM_H
812

src/SecuredMenuPopup.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#ifndef _SECURED_MENU_POPUP_H_
22
#define _SECURED_MENU_POPUP_H_
33

4+
/**
5+
* @file SecuredMenuPopup.h contains the code to show a security screen for secured menus.
6+
*/
7+
48
#include <RuntimeMenuItem.h>
59
#include <RemoteAuthentication.h>
610

src/graphics/GfxMenuConfig.h

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
44
*/
55

6+
/**
7+
* @file GfxMenuConfig.h
8+
*
9+
* This file contains the base drawing configuration structures and helper methods for
10+
* drawing onto graphical screens, be it mono or colour. Also there's some additional
11+
* structures for describing colours, coordinates and padding.
12+
*/
13+
614
#ifndef _GFX_MENU_CONFIG_H_
715
#define _GFX_MENU_CONFIG_H_
816

@@ -11,13 +19,6 @@
1119
#include "MenuItems.h"
1220
#include "DrawingPrimitives.h"
1321

14-
/**
15-
* @file GfxMenuConfig.h
16-
*
17-
* This file contains the base drawing configuration structures and helper methods for
18-
* drawing onto graphical screens, be it mono or colour. Also there's some additional
19-
* structures for describing colours, coordinates and padding.
20-
*/
2122

2223
namespace tcgfx {
2324

@@ -158,14 +159,29 @@ namespace tcgfx {
158159
int getRow() const { return rowPosition; }
159160
};
160161

162+
/**
163+
* A helper function that checks if a particular justification includes the value
164+
* @param justification the justification to check
165+
* @return true if the value is needed
166+
*/
161167
inline bool itemNeedsValue(GridPosition::GridJustification justification) {
162168
return (justification & GridPosition::CORE_JUSTIFY_VALUE_REQUIRED) != 0;
163169
}
164170

171+
/**
172+
* A helper function that checks if a particular justification includes the name
173+
* @param justification the justification to check
174+
* @return true if the name is needed
175+
*/
165176
inline bool itemNeedsName(GridPosition::GridJustification justification) {
166177
return (justification & GridPosition::CORE_JUSTIFY_NAME_REQUIRED) != 0;
167178
}
168179

180+
/**
181+
* Get the core justification part, eg left, right centre
182+
* @param j the justification to check
183+
* @return the core part, just left, right centre etc.
184+
*/
169185
inline GridPosition::GridJustification coreJustification(GridPosition::GridJustification j) {
170186
return static_cast<GridPosition::GridJustification>(j & 0b11);
171187
}
@@ -331,10 +347,40 @@ namespace tcgfx {
331347
*/
332348
class ItemDisplayPropertiesFactory {
333349
public:
350+
/**
351+
* Returns the configuration for the parameters below, it should never return nullptr.
352+
* @param pItem the item or null for default
353+
* @param compType the component type to get the rendering for
354+
* @return the properties for a given component.
355+
*/
334356
virtual ItemDisplayProperties* configFor(MenuItem* pItem, ItemDisplayProperties::ComponentType compType) = 0;
357+
358+
/**
359+
* Returns the icon associated with the menu item ID, there are two special IDs for the edit and active icons
360+
* @param id the menu item ID or the special ID for edit or active icon
361+
* @return the icon or nullptr if not available
362+
*/
335363
virtual DrawableIcon* iconForMenuItem(uint16_t id) = 0;
364+
365+
/**
366+
* Get the grid item for a given position if it is available
367+
* @param pItem the item to get the grid position for
368+
* @return the grid position if available
369+
*/
336370
virtual GridPositionWithId* gridPositionForItem(MenuItem* pItem) = 0;
371+
372+
/**
373+
* Get the selected color for a given palette entry
374+
* @param colorType
375+
* @return
376+
*/
337377
virtual color_t getSelectedColor(ItemDisplayProperties::ColorType colorType) = 0;
378+
379+
/**
380+
* add a new grid position for a given menu item
381+
* @param item the menu item the position is for
382+
* @param position the position to record
383+
*/
338384
virtual void addGridPosition(MenuItem* item, const GridPosition& position) = 0;
339385
};
340386

src/graphics/GraphicsDeviceRenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
/**
7-
* @file GraphicsDevice.h the interface that all graphics devices should implement to do the actual graphics rendering.
7+
* @file GraphicsDeviceRenderer.h the interface that all graphics devices should implement to do the actual graphics rendering.
88
*/
99

1010
#ifndef TCLIBRARYDEV_GRAPHICSDEVICERENDERER_H

src/graphics/MenuTouchScreenEncoder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
44
*/
55

6+
/**
7+
* @file MenuTouchScreenEncoder.h contains the interface between the touch screen and tcMenu.
8+
*/
9+
610
#ifndef TCMENU_MENUTOUCHSCREENENCODER_H
711
#define TCMENU_MENUTOUCHSCREENENCODER_H
812

0 commit comments

Comments
 (0)