forked from swissmicros/SDKdemo
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcustom.h
76 lines (66 loc) · 2.64 KB
/
custom.h
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
#ifndef CUSTOM_H
#define CUSTOM_H
// ****************************************************************************
// custom.h DB48X project
// ****************************************************************************
//
// File Description:
//
// Custom menu, as defined by the Cst / CustomMenu variable
//
//
//
//
//
//
//
//
// ****************************************************************************
// (C) 2022 Christophe de Dinechin <[email protected]>
// This software is licensed under the terms outlined in LICENSE.txt
// ****************************************************************************
// This file is part of DB48X.
//
// DB48X is free software: you can redistribute it and/or modify
// it under the terms outlined in the LICENSE.txt file
//
// DB48X is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// ****************************************************************************
#include "list.h"
#include "runtime.h"
#include "command.h"
#include "menu.h"
struct CustomMenu : menu
// ----------------------------------------------------------------------------
// The custom menu is a bit special
// ----------------------------------------------------------------------------
// The CustomMenu shows custom in the current menu
// For each variable, the function key evaluates it, shift recalls it,
// and xshift stores it. In program mode, the function key shows the name
// for evaluation purpose, and shifted, shows it between quotes
{
CustomMenu(id type = ID_CustomMenu) : menu(type) {}
static list_p custom();
static uint count_custom();
static void list_custom(info &mi, list_p cst = nullptr);
static void add_custom_item(info &mi, object_p obj);
static result run_menu_command(bool tmp);
public:
OBJECT_DECL(CustomMenu);
MENU_DECL(CustomMenu);
};
COMMAND_DECLARE(ToggleCustomMenu, 0);
COMMAND_DECLARE(Menu, 1);
COMMAND_DECLARE(TemporaryMenu, 1);
COMMAND_DECLARE(RecallMenu, 0);
COMMAND_DECLARE(KeyMap, 1); // Set Keyboard mappings
COMMAND_DECLARE(StandardKey, 0); // Restore standard key
COMMAND_DECLARE(AssignKey, 2); // Assign one key
COMMAND_DECLARE(DeleteKeys, 1); // Delete user keys
COMMAND_DECLARE(StoreKeys, 1); // Store multiple user keys
COMMAND_DECLARE(RecallKeys, 0); // Recall user-defined keys
COMMAND_DECLARE(ToggleUserMode, 0); // Toggle user mode flags
object_p compatible_key_id(uint key);
#endif // CUSTOM_H