egg (or chicken)
Signed-off-by: Arthur Khachaturov <me@wzray.ru>
This commit is contained in:
commit
8ed52d1c79
20 changed files with 11719 additions and 0 deletions
14
puppy/include/COMWrapper.hpp
Normal file
14
puppy/include/COMWrapper.hpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
class COMWrapper {
|
||||
protected:
|
||||
void Raise(const HRESULT hr, const char *ctx) const;
|
||||
void Release(const void *cls) const;
|
||||
|
||||
public:
|
||||
virtual const char *classname() const = 0;
|
||||
};
|
18
puppy/include/PromtCtlDirection.hpp
Normal file
18
puppy/include/PromtCtlDirection.hpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
#include "COMWrapper.hpp"
|
||||
|
||||
class PromtCtlDirection : COMWrapper {
|
||||
public:
|
||||
const void *m_instance = nullptr;
|
||||
static constexpr char m_classname[] = "PromtCtlDirection";
|
||||
|
||||
public:
|
||||
PromtCtlDirection() = delete;
|
||||
explicit PromtCtlDirection(const void *instance) : m_instance(instance){};
|
||||
~PromtCtlDirection();
|
||||
std::wstring Translate(const std::wstring_view src) const;
|
||||
const char *classname() const override;
|
||||
};
|
34
puppy/include/PromtCtlDocument.hpp
Normal file
34
puppy/include/PromtCtlDocument.hpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include "COMWrapper.hpp"
|
||||
#include "PromtCtlDirection.hpp"
|
||||
#include "PromtFTManager.hpp"
|
||||
|
||||
// GUIDs
|
||||
const GUID CLSID_PromtCtlDocument = {0xbdf7dc81, 0xdaae, 0x11d5, {0xb3, 0x92, 0x0, 0xe0, 0x29, 0x42, 0x4b, 0x73}};
|
||||
const GUID CLSID_PromtSvrDirectionsIP = {0x212aae21, 0xdaa2, 0x11d5, {0xb3, 0x92, 0x0, 0xe0, 0x29, 0x42, 0x4b, 0x73}};
|
||||
const GUID IID_IPromtCtlDocument = {0xfd163702, 0x2c47, 0x11d6, {0xb3, 0x92, 0x0, 0xe0, 0x29, 0x42, 0x4b, 0x73}};
|
||||
const GUID IID_IPromtSvrDirections = {0x67c8f1c1, 0x2c4b, 0x11d6, {0xb3, 0x92, 0x0, 0xe0, 0x29, 0x42, 0x4b, 0x73}};
|
||||
const GUID IID_IPromtSvrDirectionsIP = {0x67c8f1cf, 0x2c4b, 0x11d6, {0xb3, 0x92, 0x0, 0x0e0, 0x29, 0x42, 0x4b, 0x73}};
|
||||
//const GUID IID_IUnknown = {0x0, 0x0, 0x0, {0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x46}};
|
||||
|
||||
class PromtCtlDocument : COMWrapper {
|
||||
public:
|
||||
enum class Direction { kEngRus = 0x20001, kRusEng = 0x10002 };
|
||||
|
||||
private:
|
||||
const BSTR k_client = SysAllocString(L"MG3");
|
||||
const BSTR k_common = SysAllocString(L"Common");
|
||||
static constexpr char k_registry_key[] = "Software\\PROject MT\\Kernel6MG\\Directions";
|
||||
static constexpr char k_classname[] = "PromtCtlDocument";
|
||||
void *m_instance = nullptr;
|
||||
Direction m_direction;
|
||||
|
||||
public:
|
||||
PromtCtlDocument();
|
||||
~PromtCtlDocument();
|
||||
void direction(const Direction direction);
|
||||
PromtCtlDirection direction() const;
|
||||
const char* classname() const override;
|
||||
};
|
24
puppy/include/PromtFTManager.hpp
Normal file
24
puppy/include/PromtFTManager.hpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include "COMWrapper.hpp"
|
||||
#include "PromtCtlDirection.hpp"
|
||||
#include "PromtFileTranslator.hpp"
|
||||
|
||||
const GUID CLSID_PromtFTManager = {0xdcc0c930, 0x25cc, 0x4043, {0xb0, 0xf6, 0xb1, 0xed, 0x7a, 0xca, 0xd7, 0x1b}};
|
||||
const GUID IID_IPromtFTManager = {0xe64125d8, 0x14dc, 0x4993, {0x8f, 0x84, 0x8b, 0xf4, 0x94, 0xc0, 0x94, 0xb}};
|
||||
const GUID IID_Inknown2 = {0x0, 0x0, 0x0, {0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x46}};
|
||||
|
||||
class PromtFTManager : COMWrapper {
|
||||
private:
|
||||
void *mInstance = nullptr;
|
||||
static constexpr char mClassname[] = "PromtFTManager";
|
||||
|
||||
public:
|
||||
enum class FileType { kHTML = 130, kRTF = 32 };
|
||||
|
||||
public:
|
||||
PromtFTManager();
|
||||
~PromtFTManager();
|
||||
PromtFileTranslator Translator(PromtFTManager::FileType ft, PromtCtlDirection &dir) const;
|
||||
const char* classname() const override { return mClassname; };
|
||||
};
|
20
puppy/include/PromtFileTranslator.hpp
Normal file
20
puppy/include/PromtFileTranslator.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
#include "COMWrapper.hpp"
|
||||
|
||||
class PromtFileTranslator : COMWrapper {
|
||||
private:
|
||||
const void *mInstance = nullptr;
|
||||
const void *mDirection = nullptr;
|
||||
static constexpr char mClassName[] = "PromtFileTranslator";
|
||||
|
||||
public:
|
||||
PromtFileTranslator() = delete;
|
||||
explicit PromtFileTranslator(const void *instance, const void *direction) : mInstance(instance), mDirection(direction){};
|
||||
~PromtFileTranslator();
|
||||
void Translate(const std::string_view src, const std::string_view dest) const;
|
||||
const char* classname() const override {
|
||||
return mClassName;
|
||||
};
|
||||
};
|
10243
puppy/include/httplib.hpp
Normal file
10243
puppy/include/httplib.hpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue