mirror of https://github.com/KLayout/klayout.git
WIP
This commit is contained in:
parent
876215f6c7
commit
80d1aad90a
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "edtEditorHooks.h"
|
||||
#include "tlObjectCollection.h"
|
||||
#include "tlStaticObjects.h"
|
||||
|
||||
namespace edt
|
||||
{
|
||||
|
|
@ -30,16 +31,28 @@ namespace edt
|
|||
// ---------------------------------------------------------------
|
||||
// EditorHooksManager definition and implementation
|
||||
|
||||
static EditorHooksManager *sp_instance = 0;
|
||||
static bool sp_instance_initialized = false;
|
||||
|
||||
class EditorHooksManager
|
||||
{
|
||||
public:
|
||||
EditorHooksManager () { }
|
||||
EditorHooksManager ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
~EditorHooksManager ()
|
||||
{
|
||||
sp_instance = 0;
|
||||
}
|
||||
|
||||
static EditorHooksManager *instance ()
|
||||
{
|
||||
static EditorHooksManager *sp_instance = 0;
|
||||
if (! sp_instance) {
|
||||
if (! sp_instance && ! sp_instance_initialized) {
|
||||
sp_instance = new EditorHooksManager ();
|
||||
sp_instance_initialized = true;
|
||||
tl::StaticObjects::reg (&sp_instance);
|
||||
}
|
||||
return sp_instance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,6 +140,11 @@ gsi::Class<edt::EditorHooks> decl_EditorHooksBase ("lay", "EditorHooksBase",
|
|||
) +
|
||||
gsi::method ("technologies", &edt::EditorHooks::get_technologies,
|
||||
"@brief Gets the list of technologies these hooks are associated with.\n"
|
||||
) +
|
||||
gsi::method ("register", &edt::EditorHooks::register_editor_hook, gsi::arg ("hooks"),
|
||||
"@brief Registers the hooks in the system.\n"
|
||||
"The hooks will not be active before they are registered in the system. Registration will "
|
||||
"also transfer object ownership to the system."
|
||||
),
|
||||
"@brief The base class for editor hooks\n"
|
||||
"Editor hooks allow implementing technology-specific callbacks into the editor "
|
||||
|
|
|
|||
Loading…
Reference in New Issue