Skip to content

Commit

Permalink
#326 Updated MAM and MachO to use the new commands format
Browse files Browse the repository at this point in the history
  • Loading branch information
rzaharia committed Jul 30, 2024
1 parent 395a548 commit 903d6e3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Types/MACHO/include/MachO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ namespace Panels

namespace Commands
{
static constexpr uint32 MACHO_COMMAND_DIGITAL_SIGNATURE = 0;

static KeyboardControl MACHO_COMMANDS[] = {
{ Input::Key::Alt | Input::Key::F8, "DigitalSignature", "Show digital signature", MACHO_COMMAND_DIGITAL_SIGNATURE },
};

class CodeSignMagic : public AppCUI::Controls::Window
{
private:
Expand Down
7 changes: 6 additions & 1 deletion Types/MACHO/src/MachO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ extern "C"
sect["Priority"] = 1;
sect["Description"] = "Mach file executable object (Mach-O) for OSX based systems (including MachO Fat)";
sect["OpCodes.Mask"] = (uint32) GView::Dissasembly::Opcodes::All;
sect["Command.DigitalSignature"] = AppCUI::Input::Key::Alt | AppCUI::Input::Key::F8;

LocalString<128> buffer;
for (const auto& command : MachO::Commands::MACHO_COMMANDS) {
buffer.SetFormat("Command.%s", command.Caption);
sect[buffer.GetText()] = command.Key;
}
}
}
6 changes: 6 additions & 0 deletions Types/MAM/include/MAM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

namespace GView::Type::MAM
{
static constexpr uint32 MAM_COMMAND_DECOMPRESS = 0;

static KeyboardControl MAM_COMMANDS[] = {
{ Input::Key::Shift | Input::Key::F10, "Decompress", "Decompress file", MAM_COMMAND_DECOMPRESS },
};

class MAMFile : public TypeInterface
{
public:
Expand Down
7 changes: 6 additions & 1 deletion Types/MAM/src/MAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ extern "C"
sect["Extension"] = "pf";
sect["Priority"] = 1;
sect["Description"] = "PF file format (*.pf)";
sect["Command.Decompress"] = AppCUI::Input::Key::Shift | AppCUI::Input::Key::F10;

LocalString<128> buffer;
for (const auto& command : MAM::MAM_COMMANDS) {
buffer.SetFormat("Command.%s", command.Caption);
sect[buffer.GetText()] = command.Key;
}
}
}

0 comments on commit 903d6e3

Please sign in to comment.