This commit is contained in:
Matthias Koefferlein
2022-05-15 10:31:09 +02:00
parent b17b2714a5
commit f5b4bbb62c
57 changed files with 388 additions and 349 deletions
@@ -462,9 +462,9 @@ static LayerPropertiesConstIteratorWrapper each_layer2 (lay::LayoutViewBase *vie
}
#if defined(HAVE_QT)
Class<lay::LayoutViewBase> decl_LayoutViewBase (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutViewBase",
LAYBASIC_PUBLIC Class<lay::LayoutViewBase> decl_LayoutViewBase (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutViewBase",
#else
Class<lay::LayoutViewBase> decl_LayoutViewBase (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutViewBase",
LAYBASIC_PUBLIC Class<lay::LayoutViewBase> decl_LayoutViewBase (QT_EXTERNAL_BASE (QWidget) "lay", "LayoutViewBase",
#endif
gsi::constant ("LV_NoLayers", (unsigned int) lay::LayoutViewBase::LV_NoLayers,
"@brief With this option, no layers view will be provided (see \\layer_control_frame)\n"
+3 -1
View File
@@ -3,6 +3,8 @@
#ifndef HDR_layFixedFont
#define HDR_layFixedFont
#include "laybasicCommon.h"
#include <stdint.h>
namespace lay
@@ -12,7 +14,7 @@ namespace lay
* @brief A descriptor class for a fixed font
*/
class FixedFont
class LAYBASIC_PUBLIC FixedFont
{
public:
/**
+7 -6
View File
@@ -24,11 +24,7 @@
#ifndef HDR_layLayoutCanvas
#define HDR_layLayoutCanvas
#include <vector>
#include <map>
#include <set>
#include <utility>
#include "laybasicCommon.h"
#include "dbTrans.h"
#include "dbBox.h"
#include "layViewport.h"
@@ -44,6 +40,11 @@
#include "tlDeferredExecution.h"
#include "tlThreads.h"
#include <vector>
#include <map>
#include <set>
#include <utility>
namespace lay
{
@@ -132,7 +133,7 @@ private:
* and to manage the auxiliary objects like rulers etc.
*/
class LayoutCanvas
class LAYBASIC_PUBLIC LayoutCanvas
: public lay::ViewObjectWidget,
public lay::BitmapViewObjectCanvas,
public lay::BitmapRedrawThreadCanvas,
+2 -1
View File
@@ -23,6 +23,7 @@
#ifndef HDR_layMove
#define HDR_layMove
#include "laybasicCommon.h"
#include "dbManager.h"
#include "layViewObject.h"
@@ -33,7 +34,7 @@ namespace lay {
class Editables;
class LayoutViewBase;
class MoveService :
class LAYBASIC_PUBLIC MoveService :
public lay::ViewService
{
public:
+55
View File
@@ -0,0 +1,55 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "layNativePlugin.h"
#include "gsiDecl.h"
const klp_class_t *klp_class_by_name (const char *name)
{
return reinterpret_cast<const klp_class_t *> (gsi::class_by_name (name));
}
void *klp_create (const klp_class_t *cls)
{
return reinterpret_cast<const gsi::ClassBase *> (cls)->create ();
}
void klp_destroy (const klp_class_t *cls, void *obj)
{
reinterpret_cast<const gsi::ClassBase *> (cls)->destroy (obj);
}
void *klp_clone (const klp_class_t *cls, const void *source)
{
return reinterpret_cast<const gsi::ClassBase *> (cls)->clone (source);
}
void klp_assign (const klp_class_t *cls, void *target, const void *source)
{
reinterpret_cast<const gsi::ClassBase *> (cls)->assign (target, source);
}
void klp_require_api_version (const char * /*version*/)
{
// TODO: implement
}
+97
View File
@@ -0,0 +1,97 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2022 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HDR_layNativePlugin
#define HDR_layNativePlugin
#include "laybasicCommon.h"
/**
* @brief A struct to hold the data of the plugin
*
* Use it like this:
*
* @code
* static NativePlugin plugin_desc = {
* 0, // (void (*)()) pointer to autorun function or 0 if not present
* 0, // (void (*)()) pointer to early autorun function or 0 if not present
* "1.0", // (const char *) version information - should be given at least
* 0 // (const char *) description or 0/empty if no description is given
* };
* DECLARE_NATIVE_PLUGIN (plugin_desc);
* @endcode
*/
struct NativePlugin {
void (*autorun) ();
void (*autorun_early) ();
const char *version;
const char *description;
};
/**
* @brief A typedef for the initialization function a plugin is supposed to expose.
*/
typedef void (*klp_init_func_t) (void (**autorun) (), void (**autorun_early) (), const char **version, const char **description);
# if defined _WIN32 || defined __CYGWIN__
# define KLP_PUBLIC __declspec(dllexport)
# else
# if __GNUC__ >= 4 || defined(__clang__)
# define KLP_PUBLIC __attribute__ ((visibility ("default")))
# else
# define KLP_PUBLIC
# endif
# endif
#define DECLARE_NATIVE_PLUGIN(desc) \
extern "C" { \
KLP_PUBLIC void klp_init (void (**autorun) (), void (**autorun_early) (), const char **version, const char **description) { \
*autorun = desc.autorun; \
*autorun_early = desc.autorun_early; \
*version = desc.version; \
*description = desc.description; \
} \
}
/**
* @brief Some (opaque) types for representing some gsi classes in the native API
*/
struct klp_class_t { };
struct klp_method_t { };
/**
* @brief The gsi API functions wrapped for the native API
*/
extern "C" {
LAYBASIC_PUBLIC const klp_class_t *klp_class_by_name (const char *name);
LAYBASIC_PUBLIC void *klp_create (const klp_class_t *cls);
LAYBASIC_PUBLIC void klp_destroy (const klp_class_t *cls, void *obj);
LAYBASIC_PUBLIC void *klp_clone (const klp_class_t *cls, const void *source);
LAYBASIC_PUBLIC void klp_assign (const klp_class_t *cls, void *target, const void *source);
LAYBASIC_PUBLIC void klp_require_api_version (const char *version);
}
#endif
+2
View File
@@ -61,6 +61,7 @@ SOURCES += \
layMarker.cc \
layMouseTracker.cc \
layMove.cc \
layNativePlugin.cc \
layNetColorizer.cc \
layObjectInstPath.cc \
layParsedLayerSource.cc \
@@ -112,6 +113,7 @@ HEADERS += \
layMarker.h \
layMouseTracker.h \
layMove.h \
layNativePlugin.h \
layNetColorizer.h \
layObjectInstPath.h \
layParsedLayerSource.h \