summaryrefslogtreecommitdiffhomepage
path: root/dev/sci
diff options
context:
space:
mode:
Diffstat (limited to 'dev/sci')
-rw-r--r--dev/sci/sci_base.h46
-rw-r--r--dev/sci/xpcom_core.h99
2 files changed, 4 insertions, 141 deletions
diff --git a/dev/sci/sci_base.h b/dev/sci/sci_base.h
index eca69595..0860e72f 100644
--- a/dev/sci/sci_base.h
+++ b/dev/sci/sci_base.h
@@ -10,8 +10,6 @@ Purpose: SCI core header file (C++ only).
#ifndef __SCI_BASE_H__
#define __SCI_BASE_H__
-#include <sci/sci_hint.h>
-
#define ATTRIBUTE(X) __attribute__((X))
#define IMPORT_XPCOM extern "XPCOM"
#define IMPORT_CXX extern "C++"
@@ -35,46 +33,12 @@ typedef __INT8_TYPE__ SInt8;
typedef void* VoidPtr;
typedef __UINTPTR_TYPE__ UIntPtr;
typedef char Char;
-#include <sci/sci_lpc.h>
-#ifdef __XPCOM_IMPL__
-#include <sci/xpcom_core.h>
-#else
-class IUnknown; // Refrenced from an IDB entry.
-class ICLSID; // From the IDB, the constructor of the object, e.g: IAppCLSID.
-class UUID;
-class ATTRIBUTE(uuid("d7c144b6-0792-44b8-b06b-02b227b547df")) IUnknown
-{
-public:
- explicit IUnknown() = default;
- virtual ~IUnknown() = default;
-
- IUnknown& operator=(const IUnknown&) = default;
- IUnknown(const IUnknown&) = default;
-
- virtual SInt32 Release() = 0;
- virtual void RemoveRef() = 0;
- virtual IUnknown* AddRef() = 0;
- virtual VoidPtr QueryClass(UUID* p_uuid) = 0;
-};
-template <typename FnSign, typename ClsID>
-class IEventListener : public ClsID
-{
- friend ClsID;
-
- explicit IEventListener() = default;
- virtual ~IEventListener() = default;
-
- IEventListener& operator=(const IEventListener&) = default;
- IEventListener(const IEventListener&) = default;
-
- virtual IEventListener& operator-=(const Char* event_name);
- virtual IEventListener& operator+=(FnSign arg) = 0;
-};
-#endif
+#include <sci/sci_hint.h>
+#include <sci/sci_lpc.h>
// ------------------------------------------------------------------------------------------ //
-/// @note Handle typedefs.
+/// @brief Handle Type Definitions.
// ------------------------------------------------------------------------------------------ //
typedef VoidPtr SCIObject;
@@ -88,9 +52,7 @@ typedef SCIObject ShellObject;
typedef SCIObject UIObject;
// ------------------------------------------------------------------------------------------ //
-
-// ------------------------------------------------------------------------------------------ //
-/// @note Dynamic Loader API.
+/// @brief Dynamic Loader API.
// ------------------------------------------------------------------------------------------ //
/// @brief Get function which is part of the DLL.
diff --git a/dev/sci/xpcom_core.h b/dev/sci/xpcom_core.h
deleted file mode 100644
index 45c13d1f..00000000
--- a/dev/sci/xpcom_core.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -------------------------------------------
-
-Copyright ZKA Web Services Co.
-
-File: rt.internal.inl
-Purpose: Base code of XPCOM.
-
-------------------------------------------- */
-
-/// @internal Reserved for internal definitions only.
-
-#ifndef __TOOLCHAINKIT__
-#define object class
-#define protocol class
-#define clsid(X)
-
-#warning ! You may be using the clang compiler, please be cautious that some features mayn't be present. !
-#endif // !__TOOLCHAINKIT__
-
-protocol IUnknown; // Refrenced from an IDB entry.
-protocol ICLSID; // From the IDB, the constructor of the object, e.g: TextUCLSID.
-object UUID;
-object IStr;
-
-/// @brief Unknown XPCOM interface
-protocol clsid("d7c144b6-0792-44b8-b06b-02b227b547df") IUnknown
-{
-public:
- explicit IUnknown() = default;
- virtual ~IUnknown() = default;
-
- IUnknown& operator=(const IUnknown&) = default;
- IUnknown(const IUnknown&) = default;
-
- virtual SInt32 Release() = 0;
- virtual Void RemoveRef() = 0;
- virtual IUnknown* AddRef() = 0;
- virtual VoidPtr QueryClass(UUID * p_uuid) = 0;
-};
-
-/// @brief Allocate new XPCOM object.
-/// @tparam TCLS the class type.
-/// @tparam UCLSID UCLS factory class type.
-/// @param uclsidOfCls UCLS factory class
-/// @return TCLS interface
-template <typename TCLS, typename UCLSID, typename... Args>
-inline TCLS* XPCOMQueryInterface(UCLSID* uclsidOfCls, Args&&... args)
-{
- if (uclsidOfCls == nullptr)
- return nullptr;
-
- uclsidOfCls->AddRef();
- return uclsidOfCls->QueryInterfaceWithArgs(args...);
-}
-
-/// @brief Release XPCOM object.
-/// @tparam TCLS the class type.
-/// @param cls the class to release.
-/// @return status code.
-template <typename TCLS>
-inline SInt32 XPCOMReleaseClass(TCLS** cls)
-{
- if (!*cls)
- return -kErrorInvalidData;
-
- (*cls)->RemoveRef();
- (*cls)->Release();
-
- *cls = nullptr;
-
- return kErrorSuccess;
-}
-
-/// @brief Event listener interface.
-/// @tparam FnSign the event listener function type.
-/// @tparam ClsID the event listener class ID.
-template <typename FnSign, typename ClsID>
-protocol IEventListener : public ClsID
-{
- friend ClsID;
-
- explicit IEventListener() = default;
- virtual ~IEventListener() = default;
-
- IEventListener& operator=(const IEventListener&) = default;
- IEventListener(const IEventListener&) = default;
-
- virtual IEventListener& operator-=(const IStr* event_name)
- {
- this->RemoveEventListener(event_name);
- return *this;
- }
-
- virtual IEventListener& operator+=(FnSign arg)
- {
- this->AddEventListener(arg);
- return *this;
- }
-};