From 645c5a1e07b8ca32f3ab7d25865bfff0e4332d41 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 5 Oct 2019 20:31:05 -0500 Subject: Un-plugin the architecture of the API --- CMakeLists.txt | 3 +-- hscript/key.hh | 18 ------------------ hscript/keymanager.hh | 48 ------------------------------------------------ 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 hscript/keymanager.hh diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e11d96..f14aeb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,7 @@ set(HSCRIPT_SOURCE ) set(HSCRIPT_INCLUDE - hscript/script.hh - hscript/keymanager.hh + hscript/script.hh hscript/key.hh ) diff --git a/hscript/key.hh b/hscript/key.hh index 7c398ca..5a9613b 100644 --- a/hscript/key.hh +++ b/hscript/key.hh @@ -36,23 +36,5 @@ public: bool execute(); }; -/*! Describes a Key class. */ -typedef struct KeyDesc { - /*! The name of the Key. */ - std::string name; - /*! Determines if the Key is required to be present for the HorizonScript - * to be considered valid. */ - bool required; - /*! Determines how many times this Key can be repeated. - * If this value is 0, it can be repeated an unlimited number of times. - * If this value is 1, it can only be present once per HorizonScript. - */ - int repeat; - /*! Order of the Key. Determines when the Key will be executed. */ - int order; - /*! The function used to create a new Key of this type. */ - Key*(*key_create_fn)(void); -} key_desc_t; - } } diff --git a/hscript/keymanager.hh b/hscript/keymanager.hh deleted file mode 100644 index 347f5c2..0000000 --- a/hscript/keymanager.hh +++ /dev/null @@ -1,48 +0,0 @@ -/* - * keymanager.hh - Definition of the key manager - * libhscript, the HorizonScript library for - * Project Horizon - * - * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. - * This code is licensed under the AGPL 3.0 license, as noted in the - * LICENSE-code file in the root directory of this repository. - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -#include -#include -#include -#include "key.hh" - -namespace Horizon { -namespace Keys { - -/*! Manages the Key classes. */ -class KeyManager { -private: - /*! Internal data class used by the KeyManager. */ - struct ManagerPrivate; - /*! Internal data. */ - const std::unique_ptr internal; - - /*! Create the key manager */ - KeyManager(); -public: - /*! Retrieve the global KeyManager instance. */ - static const KeyManager *getKeyManager(); - - /*! Add a new Key to the key manager. */ - void addKey(key_desc_t description); - - /*! Determines if a Key is recognised. */ - void hasKey(std::string name); - - /*! Create a new Key with the specified name. - * Returns nullptr if no Key exists. - */ - Key *createKey(std::string name); -}; - -} -} -- cgit v1.2.3-60-g2f50