mirror of https://github.com/KLayout/klayout.git
WIP
This commit is contained in:
parent
8cbb49d5f9
commit
0a804f2e32
|
|
@ -386,7 +386,7 @@ render_scanline_cross (const uint32_t *dp, unsigned int ds, const lay::Bitmap *p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_precursor_bitmaps (const std::vector<lay::ViewOp> &view_ops_in, const std::vector <unsigned int> &vo_map, const std::vector<lay::Bitmap *> &pbitmaps_in, const std::vector<unsigned int> &bm_map, const lay::LineStyles &ls, unsigned int width, unsigned int height, std::map<unsigned int, lay::Bitmap> &precursors, QMutex *mutex)
|
static void create_precursor_bitmaps (const std::vector<lay::ViewOp> &view_ops_in, const std::vector <unsigned int> &vo_map, const std::vector<lay::Bitmap *> &pbitmaps_in, const std::vector<unsigned int> &bm_map, const lay::LineStyles &ls, unsigned int width, unsigned int height, std::map<unsigned int, lay::Bitmap> &precursors, tl::Mutex *mutex)
|
||||||
{
|
{
|
||||||
tl_assert (bm_map.size () == vo_map.size ());
|
tl_assert (bm_map.size () == vo_map.size ());
|
||||||
|
|
||||||
|
|
@ -430,7 +430,7 @@ bitmaps_to_image_rgb (const std::vector<lay::ViewOp> &view_ops_in,
|
||||||
QImage *pimage, unsigned int width, unsigned int height,
|
QImage *pimage, unsigned int width, unsigned int height,
|
||||||
bool use_bitmap_index,
|
bool use_bitmap_index,
|
||||||
bool transparent,
|
bool transparent,
|
||||||
QMutex *mutex)
|
tl::Mutex *mutex)
|
||||||
{
|
{
|
||||||
std::vector<unsigned int> bm_map;
|
std::vector<unsigned int> bm_map;
|
||||||
std::vector<unsigned int> vo_map;
|
std::vector<unsigned int> vo_map;
|
||||||
|
|
@ -668,7 +668,7 @@ bitmaps_to_image_mono (const std::vector<lay::ViewOp> &view_ops_in,
|
||||||
const lay::LineStyles &ls,
|
const lay::LineStyles &ls,
|
||||||
QImage *pimage, unsigned int width, unsigned int height,
|
QImage *pimage, unsigned int width, unsigned int height,
|
||||||
bool use_bitmap_index,
|
bool use_bitmap_index,
|
||||||
QMutex *mutex)
|
tl::Mutex *mutex)
|
||||||
{
|
{
|
||||||
std::vector<unsigned int> bm_map;
|
std::vector<unsigned int> bm_map;
|
||||||
std::vector<unsigned int> vo_map;
|
std::vector<unsigned int> vo_map;
|
||||||
|
|
@ -873,7 +873,7 @@ bitmaps_to_image (const std::vector<lay::ViewOp> &view_ops_in,
|
||||||
const lay::LineStyles &ls,
|
const lay::LineStyles &ls,
|
||||||
QImage *pimage, unsigned int width, unsigned int height,
|
QImage *pimage, unsigned int width, unsigned int height,
|
||||||
bool use_bitmap_index,
|
bool use_bitmap_index,
|
||||||
QMutex *mutex)
|
tl::Mutex *mutex)
|
||||||
{
|
{
|
||||||
if (pimage->depth () <= 1) {
|
if (pimage->depth () <= 1) {
|
||||||
bitmaps_to_image_mono (view_ops_in, pbitmaps_in, dp, ls, pimage, width, height, use_bitmap_index, mutex);
|
bitmaps_to_image_mono (view_ops_in, pbitmaps_in, dp, ls, pimage, width, height, use_bitmap_index, mutex);
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@
|
||||||
#define HDR_layBitmapsToImage
|
#define HDR_layBitmapsToImage
|
||||||
|
|
||||||
#include "layViewOp.h"
|
#include "layViewOp.h"
|
||||||
|
#include "tlThreads.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class QMutex;
|
|
||||||
class QImage;
|
class QImage;
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
|
|
@ -46,7 +46,7 @@ class Bitmap;
|
||||||
* with the given width and height.
|
* with the given width and height.
|
||||||
* The "view_ops" and "pbitmaps" vectors must have the same size.
|
* The "view_ops" and "pbitmaps" vectors must have the same size.
|
||||||
* The QImage must be initialized to the given width and height.
|
* The QImage must be initialized to the given width and height.
|
||||||
* If the QMutex pointer is not 0, the mutex is locked between operations
|
* If the tl::Mutex pointer is not 0, the mutex is locked between operations
|
||||||
* if the bitmap is accessed. The set of dither pattern specifies any custom
|
* if the bitmap is accessed. The set of dither pattern specifies any custom
|
||||||
* pattern that are used bz the view operands.
|
* pattern that are used bz the view operands.
|
||||||
* The "use_bitmap_index" parameter specifies whether the bitmap_index
|
* The "use_bitmap_index" parameter specifies whether the bitmap_index
|
||||||
|
|
@ -60,7 +60,7 @@ bitmaps_to_image (const std::vector <lay::ViewOp> &view_ops,
|
||||||
const lay::LineStyles &ls,
|
const lay::LineStyles &ls,
|
||||||
QImage *pimage, unsigned int width, unsigned int height,
|
QImage *pimage, unsigned int width, unsigned int height,
|
||||||
bool use_bitmap_index,
|
bool use_bitmap_index,
|
||||||
QMutex *mutex);
|
tl::Mutex *mutex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Convert a lay::Bitmap to a unsigned char * data field to be passed to QBitmap
|
* @brief Convert a lay::Bitmap to a unsigned char * data field to be passed to QBitmap
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@
|
||||||
#include "laybasicCommon.h"
|
#include "laybasicCommon.h"
|
||||||
#include "layColor.h"
|
#include "layColor.h"
|
||||||
|
|
||||||
#include <QColor>
|
#if defined(HAVE_QT)
|
||||||
|
# include <QColor>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -37,9 +39,11 @@ namespace lay
|
||||||
*/
|
*/
|
||||||
struct LAYBASIC_PUBLIC ColorConverter
|
struct LAYBASIC_PUBLIC ColorConverter
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT)
|
||||||
std::string to_string (const QColor &c) const;
|
std::string to_string (const QColor &c) const;
|
||||||
std::string to_string (const lay::Color &c) const;
|
|
||||||
void from_string (const std::string &s, QColor &c) const;
|
void from_string (const std::string &s, QColor &c) const;
|
||||||
|
#endif
|
||||||
|
std::string to_string (const lay::Color &c) const;
|
||||||
void from_string (const std::string &s, lay::Color &c) const;
|
void from_string (const std::string &s, lay::Color &c) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ struct LPContextCompareOp
|
||||||
bool
|
bool
|
||||||
ShapeFinder::find (LayoutViewBase *view, const db::DBox ®ion_mu)
|
ShapeFinder::find (LayoutViewBase *view, const db::DBox ®ion_mu)
|
||||||
{
|
{
|
||||||
tl::AbsoluteProgress progress (tl::to_string (QObject::tr ("Selecting ...")));
|
tl::AbsoluteProgress progress (tl::to_string (tr ("Selecting ...")));
|
||||||
progress.set_unit (1000);
|
progress.set_unit (1000);
|
||||||
progress.set_format ("");
|
progress.set_format ("");
|
||||||
mp_progress = &progress;
|
mp_progress = &progress;
|
||||||
|
|
@ -332,7 +332,7 @@ ShapeFinder::find (LayoutViewBase *view, const db::DBox ®ion_mu)
|
||||||
bool
|
bool
|
||||||
ShapeFinder::find (lay::LayoutViewBase *view, const lay::LayerProperties &lprops, const db::DBox ®ion_mu)
|
ShapeFinder::find (lay::LayoutViewBase *view, const lay::LayerProperties &lprops, const db::DBox ®ion_mu)
|
||||||
{
|
{
|
||||||
tl::AbsoluteProgress progress (tl::to_string (QObject::tr ("Selecting ...")));
|
tl::AbsoluteProgress progress (tl::to_string (tr ("Selecting ...")));
|
||||||
progress.set_unit (1000);
|
progress.set_unit (1000);
|
||||||
progress.set_format ("");
|
progress.set_format ("");
|
||||||
mp_progress = &progress;
|
mp_progress = &progress;
|
||||||
|
|
@ -626,7 +626,7 @@ InstFinder::InstFinder (bool point_mode, bool top_level_sel, bool full_arrays, b
|
||||||
bool
|
bool
|
||||||
InstFinder::find (lay::LayoutViewBase *view, const db::DBox ®ion_mu)
|
InstFinder::find (lay::LayoutViewBase *view, const db::DBox ®ion_mu)
|
||||||
{
|
{
|
||||||
tl::AbsoluteProgress progress (tl::to_string (QObject::tr ("Selecting ...")));
|
tl::AbsoluteProgress progress (tl::to_string (tr ("Selecting ...")));
|
||||||
progress.set_unit (1000);
|
progress.set_unit (1000);
|
||||||
progress.set_format ("");
|
progress.set_format ("");
|
||||||
mp_progress = &progress;
|
mp_progress = &progress;
|
||||||
|
|
@ -643,7 +643,7 @@ InstFinder::find (lay::LayoutViewBase *view, const db::DBox ®ion_mu)
|
||||||
bool
|
bool
|
||||||
InstFinder::find (LayoutViewBase *view, unsigned int cv_index, const db::DCplxTrans &trans_mu, const db::DBox ®ion_mu)
|
InstFinder::find (LayoutViewBase *view, unsigned int cv_index, const db::DCplxTrans &trans_mu, const db::DBox ®ion_mu)
|
||||||
{
|
{
|
||||||
tl::AbsoluteProgress progress (tl::to_string (QObject::tr ("Selecting ...")));
|
tl::AbsoluteProgress progress (tl::to_string (tr ("Selecting ...")));
|
||||||
progress.set_unit (1000);
|
progress.set_unit (1000);
|
||||||
progress.set_format ("");
|
progress.set_format ("");
|
||||||
mp_progress = &progress;
|
mp_progress = &progress;
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,17 @@
|
||||||
|
|
||||||
#include "laybasicConfig.h"
|
#include "laybasicConfig.h"
|
||||||
#include "layGridNet.h"
|
#include "layGridNet.h"
|
||||||
#include "layWidgets.h"
|
#if defined(HAVE_QT) // @@@
|
||||||
|
# include "layWidgets.h"
|
||||||
|
#endif
|
||||||
#include "layLayoutView.h"
|
#include "layLayoutView.h"
|
||||||
#include "layConverters.h"
|
#include "layConverters.h"
|
||||||
#include "layFixedFont.h"
|
#include "layFixedFont.h"
|
||||||
#include "laySnap.h"
|
#include "laySnap.h"
|
||||||
#include "dbTrans.h"
|
#include "dbTrans.h"
|
||||||
#include "ui_GridNetConfigPage.h"
|
#if defined(HAVE_QT) // @@@
|
||||||
|
# include "ui_GridNetConfigPage.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -64,7 +68,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw tl::Exception (tl::to_string (QObject::tr ("Invalid grid net style: ")) + value);
|
throw tl::Exception (tl::to_string (tr ("Invalid grid net style: ")) + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
|
@ -97,12 +101,14 @@ GridNetPluginDeclaration::get_options (std::vector < std::pair<std::string, std:
|
||||||
// grid-micron is not configured here since some other entity is supposed to do this.
|
// grid-micron is not configured here since some other entity is supposed to do this.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
lay::ConfigPage *
|
lay::ConfigPage *
|
||||||
GridNetPluginDeclaration::config_page (QWidget *parent, std::string &title) const
|
GridNetPluginDeclaration::config_page (QWidget *parent, std::string &title) const
|
||||||
{
|
{
|
||||||
title = tl::to_string (QObject::tr ("Display|Background"));
|
title = tl::to_string (QObject::tr ("Display|Background"));
|
||||||
return new GridNetConfigPage (parent);
|
return new GridNetConfigPage (parent);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
lay::Plugin *
|
lay::Plugin *
|
||||||
GridNetPluginDeclaration::create_plugin (db::Manager *, Dispatcher *, lay::LayoutViewBase *view) const
|
GridNetPluginDeclaration::create_plugin (db::Manager *, Dispatcher *, lay::LayoutViewBase *view) const
|
||||||
|
|
@ -115,6 +121,7 @@ static tl::RegisteredClass<lay::PluginDeclaration> config_decl (new GridNetPlugi
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Implementation of the configuration page
|
// Implementation of the configuration page
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
GridNetConfigPage::GridNetConfigPage (QWidget *parent)
|
GridNetConfigPage::GridNetConfigPage (QWidget *parent)
|
||||||
: lay::ConfigPage (parent)
|
: lay::ConfigPage (parent)
|
||||||
{
|
{
|
||||||
|
|
@ -188,6 +195,7 @@ GridNetConfigPage::commit (lay::Dispatcher *root)
|
||||||
root->config_set (cfg_grid_style1, lay::GridNet::GridStyle (mp_ui->style1_cbx->currentIndex ()), GridNetStyleConverter ());
|
root->config_set (cfg_grid_style1, lay::GridNet::GridStyle (mp_ui->style1_cbx->currentIndex ()), GridNetStyleConverter ());
|
||||||
root->config_set (cfg_grid_style2, lay::GridNet::GridStyle (mp_ui->style2_cbx->currentIndex ()), GridNetStyleConverter ());
|
root->config_set (cfg_grid_style2, lay::GridNet::GridStyle (mp_ui->style2_cbx->currentIndex ()), GridNetStyleConverter ());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Implementation of the GridNet object
|
// Implementation of the GridNet object
|
||||||
|
|
@ -210,25 +218,25 @@ GridNet::configure (const std::string &name, const std::string &value)
|
||||||
|
|
||||||
if (name == cfg_grid_color) {
|
if (name == cfg_grid_color) {
|
||||||
|
|
||||||
QColor color;
|
lay::Color color;
|
||||||
ColorConverter ().from_string (value, color);
|
ColorConverter ().from_string (value, color);
|
||||||
need_update = test_and_set (m_color, color);
|
need_update = test_and_set (m_color, color);
|
||||||
|
|
||||||
} else if (name == cfg_grid_grid_color) {
|
} else if (name == cfg_grid_grid_color) {
|
||||||
|
|
||||||
QColor color;
|
lay::Color color;
|
||||||
ColorConverter ().from_string (value, color);
|
ColorConverter ().from_string (value, color);
|
||||||
need_update = test_and_set (m_grid_color, color);
|
need_update = test_and_set (m_grid_color, color);
|
||||||
|
|
||||||
} else if (name == cfg_grid_axis_color) {
|
} else if (name == cfg_grid_axis_color) {
|
||||||
|
|
||||||
QColor color;
|
lay::Color color;
|
||||||
ColorConverter ().from_string (value, color);
|
ColorConverter ().from_string (value, color);
|
||||||
need_update = test_and_set (m_axis_color, color);
|
need_update = test_and_set (m_axis_color, color);
|
||||||
|
|
||||||
} else if (name == cfg_grid_ruler_color) {
|
} else if (name == cfg_grid_ruler_color) {
|
||||||
|
|
||||||
QColor color;
|
lay::Color color;
|
||||||
ColorConverter ().from_string (value, color);
|
ColorConverter ().from_string (value, color);
|
||||||
need_update = test_and_set (m_ruler_color, color);
|
need_update = test_and_set (m_ruler_color, color);
|
||||||
|
|
||||||
|
|
@ -283,7 +291,7 @@ GridNet::configure (const std::string &name, const std::string &value)
|
||||||
return taken;
|
return taken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
class ImagePainter
|
class ImagePainter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -427,27 +435,28 @@ private:
|
||||||
double m_resolution;
|
double m_resolution;
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas)
|
GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas)
|
||||||
{
|
{
|
||||||
if (m_visible) {
|
if (m_visible) {
|
||||||
|
|
||||||
QColor color;
|
lay::Color color;
|
||||||
if (m_color.isValid ()) {
|
if (m_color.is_valid ()) {
|
||||||
color = m_color;
|
color = m_color;
|
||||||
} else {
|
} else {
|
||||||
color = QColor (128, 128, 128); // TODO: this is not a "real" automatic color ..
|
color = lay::Color (128, 128, 128); // TODO: this is not a "real" automatic color ..
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor grid_color = color, axis_color = color, ruler_color = color;
|
lay::Color grid_color = color, axis_color = color, ruler_color = color;
|
||||||
if (m_grid_color.isValid ()) {
|
if (m_grid_color.is_valid ()) {
|
||||||
grid_color = m_grid_color;
|
grid_color = m_grid_color;
|
||||||
}
|
}
|
||||||
if (m_axis_color.isValid ()) {
|
if (m_axis_color.is_valid ()) {
|
||||||
axis_color = m_axis_color;
|
axis_color = m_axis_color;
|
||||||
}
|
}
|
||||||
if (m_ruler_color.isValid ()) {
|
if (m_ruler_color.is_valid ()) {
|
||||||
ruler_color = m_ruler_color;
|
ruler_color = m_ruler_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -457,6 +466,7 @@ GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
ImagePainter painter (*bmp_canvas);
|
ImagePainter painter (*bmp_canvas);
|
||||||
|
|
||||||
db::DCplxTrans trans = vp.trans ();
|
db::DCplxTrans trans = vp.trans ();
|
||||||
|
|
@ -769,11 +779,10 @@ GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace lay
|
} // namespace lay
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@
|
||||||
|
|
||||||
#include "layViewObject.h"
|
#include "layViewObject.h"
|
||||||
#include "layPlugin.h"
|
#include "layPlugin.h"
|
||||||
#include "layPluginConfigPage.h"
|
#if defined(HAVE_QT)
|
||||||
|
# include "layPluginConfigPage.h"
|
||||||
|
#endif
|
||||||
|
#include "layColor.h"
|
||||||
#include "dbTypes.h"
|
#include "dbTypes.h"
|
||||||
#include "dbBox.h"
|
#include "dbBox.h"
|
||||||
|
|
||||||
|
|
@ -44,11 +47,14 @@ class GridNetPluginDeclaration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void get_options (std::vector < std::pair<std::string, std::string> > &options) const;
|
virtual void get_options (std::vector < std::pair<std::string, std::string> > &options) const;
|
||||||
|
#if defined(HAVE_QT)
|
||||||
virtual lay::ConfigPage *config_page (QWidget *parent, std::string &title) const;
|
virtual lay::ConfigPage *config_page (QWidget *parent, std::string &title) const;
|
||||||
|
#endif
|
||||||
virtual lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *, lay::LayoutViewBase *view) const;
|
virtual lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *, lay::LayoutViewBase *view) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GridNetConfigPage
|
#if defined(HAVE_QT) // @@@
|
||||||
|
class GridNetConfigPage
|
||||||
: public lay::ConfigPage
|
: public lay::ConfigPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -67,6 +73,7 @@ private:
|
||||||
lay::ColorButton *mp_grid_axis_color_cbtn;
|
lay::ColorButton *mp_grid_axis_color_cbtn;
|
||||||
lay::ColorButton *mp_grid_ruler_color_cbtn;
|
lay::ColorButton *mp_grid_ruler_color_cbtn;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class GridNet
|
class GridNet
|
||||||
: public lay::BackgroundViewObject,
|
: public lay::BackgroundViewObject,
|
||||||
|
|
@ -95,10 +102,10 @@ private:
|
||||||
bool m_visible;
|
bool m_visible;
|
||||||
bool m_show_ruler;
|
bool m_show_ruler;
|
||||||
double m_grid;
|
double m_grid;
|
||||||
QColor m_color;
|
lay::Color m_color;
|
||||||
QColor m_grid_color;
|
lay::Color m_grid_color;
|
||||||
QColor m_axis_color;
|
lay::Color m_axis_color;
|
||||||
QColor m_ruler_color;
|
lay::Color m_ruler_color;
|
||||||
GridStyle m_style0;
|
GridStyle m_style0;
|
||||||
GridStyle m_style1;
|
GridStyle m_style1;
|
||||||
GridStyle m_style2;
|
GridStyle m_style2;
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ public:
|
||||||
void execute (const tl::ExpressionParserContext &context, tl::Variant &out, const std::vector <tl::Variant> &vv) const
|
void execute (const tl::ExpressionParserContext &context, tl::Variant &out, const std::vector <tl::Variant> &vv) const
|
||||||
{
|
{
|
||||||
if (vv.size () != 0) {
|
if (vv.size () != 0) {
|
||||||
throw tl::EvalError (tl::to_string (QObject::tr ("Layer source function must not have arguments")), context);
|
throw tl::EvalError (tl::to_string (tr ("Layer source function must not have arguments")), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
out = tl::Variant ();
|
out = tl::Variant ();
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,15 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
#include <QEvent>
|
# include <QEvent>
|
||||||
#include <QPixmap>
|
# include <QPixmap>
|
||||||
#include <QBitmap>
|
# include <QBitmap>
|
||||||
#include <QPainter>
|
# include <QPainter>
|
||||||
#include <QApplication>
|
# include <QApplication>
|
||||||
#include <QBuffer>
|
# include <QBuffer>
|
||||||
#include <QWheelEvent>
|
# include <QWheelEvent>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "tlTimer.h"
|
#include "tlTimer.h"
|
||||||
#include "tlLog.h"
|
#include "tlLog.h"
|
||||||
|
|
@ -36,9 +37,13 @@
|
||||||
#include "layRedrawThread.h"
|
#include "layRedrawThread.h"
|
||||||
#include "layLayoutView.h"
|
#include "layLayoutView.h"
|
||||||
#include "layMarker.h"
|
#include "layMarker.h"
|
||||||
#include "gtf.h"
|
#if defined(HAVE_QT) // @@@
|
||||||
|
# include "gtf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
#include "layBitmapsToImage.h"
|
#include "layBitmapsToImage.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -131,6 +136,7 @@ std::string ImageCacheEntry::to_string () const
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
static void
|
static void
|
||||||
blowup (const QImage &src, QImage &dest, unsigned int os)
|
blowup (const QImage &src, QImage &dest, unsigned int os)
|
||||||
{
|
{
|
||||||
|
|
@ -273,7 +279,9 @@ invert (unsigned char *data, unsigned int width, unsigned int height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
LayoutCanvas::LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const char *name)
|
LayoutCanvas::LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const char *name)
|
||||||
: lay::ViewObjectWidget (parent, name),
|
: lay::ViewObjectWidget (parent, name),
|
||||||
mp_view (view),
|
mp_view (view),
|
||||||
|
|
@ -288,6 +296,22 @@ LayoutCanvas::LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const ch
|
||||||
m_do_update_image_dm (this, &LayoutCanvas::do_update_image),
|
m_do_update_image_dm (this, &LayoutCanvas::do_update_image),
|
||||||
m_do_end_of_drawing_dm (this, &LayoutCanvas::do_end_of_drawing),
|
m_do_end_of_drawing_dm (this, &LayoutCanvas::do_end_of_drawing),
|
||||||
m_image_cache_size (1)
|
m_image_cache_size (1)
|
||||||
|
#else
|
||||||
|
LayoutCanvas::LayoutCanvas (lay::LayoutViewBase *view)
|
||||||
|
: lay::ViewObjectWidget (),
|
||||||
|
mp_view (view),
|
||||||
|
// @@@ mp_image (0), mp_image_bg (0), mp_pixmap (0),
|
||||||
|
m_background (0), m_foreground (0), m_active (0),
|
||||||
|
m_oversampling (1),
|
||||||
|
m_dpr (1),
|
||||||
|
m_need_redraw (false),
|
||||||
|
m_redraw_clearing (false),
|
||||||
|
m_redraw_force_update (true),
|
||||||
|
m_update_image (true),
|
||||||
|
m_do_update_image_dm (this, &LayoutCanvas::do_update_image),
|
||||||
|
m_do_end_of_drawing_dm (this, &LayoutCanvas::do_end_of_drawing),
|
||||||
|
m_image_cache_size (1)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#if QT_VERSION > 0x050000
|
#if QT_VERSION > 0x050000
|
||||||
m_dpr = devicePixelRatio ();
|
m_dpr = devicePixelRatio ();
|
||||||
|
|
@ -302,11 +326,13 @@ LayoutCanvas::LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const ch
|
||||||
|
|
||||||
mp_redraw_thread = new lay::RedrawThread (this, view);
|
mp_redraw_thread = new lay::RedrawThread (this, view);
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
setBackgroundRole (QPalette::NoRole);
|
setBackgroundRole (QPalette::NoRole);
|
||||||
set_colors (lay::Color (palette ().color (QPalette::Normal, QPalette::Window).rgb ()),
|
set_colors (lay::Color (palette ().color (QPalette::Normal, QPalette::Window).rgb ()),
|
||||||
lay::Color (palette ().color (QPalette::Normal, QPalette::Text).rgb ()),
|
lay::Color (palette ().color (QPalette::Normal, QPalette::Text).rgb ()),
|
||||||
lay::Color (palette ().color (QPalette::Normal, QPalette::Mid).rgb ()));
|
lay::Color (palette ().color (QPalette::Normal, QPalette::Mid).rgb ()));
|
||||||
setAttribute (Qt::WA_NoSystemBackground);
|
setAttribute (Qt::WA_NoSystemBackground);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LayoutCanvas::~LayoutCanvas ()
|
LayoutCanvas::~LayoutCanvas ()
|
||||||
|
|
@ -314,6 +340,7 @@ LayoutCanvas::~LayoutCanvas ()
|
||||||
// Detach all listeners so we don't trigger events in the destructor
|
// Detach all listeners so we don't trigger events in the destructor
|
||||||
viewport_changed_event.clear ();
|
viewport_changed_event.clear ();
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (mp_image) {
|
if (mp_image) {
|
||||||
delete mp_image;
|
delete mp_image;
|
||||||
mp_image = 0;
|
mp_image = 0;
|
||||||
|
|
@ -326,6 +353,7 @@ LayoutCanvas::~LayoutCanvas ()
|
||||||
delete mp_pixmap;
|
delete mp_pixmap;
|
||||||
mp_pixmap = 0;
|
mp_pixmap = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (mp_redraw_thread) {
|
if (mp_redraw_thread) {
|
||||||
delete mp_redraw_thread;
|
delete mp_redraw_thread;
|
||||||
mp_redraw_thread = 0;
|
mp_redraw_thread = 0;
|
||||||
|
|
@ -337,6 +365,7 @@ LayoutCanvas::~LayoutCanvas ()
|
||||||
void
|
void
|
||||||
LayoutCanvas::key_event (unsigned int key, unsigned int buttons)
|
LayoutCanvas::key_event (unsigned int key, unsigned int buttons)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (! (buttons & lay::ShiftButton)) {
|
if (! (buttons & lay::ShiftButton)) {
|
||||||
if (int (key) == Qt::Key_Down) {
|
if (int (key) == Qt::Key_Down) {
|
||||||
emit down_arrow_key_pressed ();
|
emit down_arrow_key_pressed ();
|
||||||
|
|
@ -358,6 +387,7 @@ LayoutCanvas::key_event (unsigned int key, unsigned int buttons)
|
||||||
emit right_arrow_key_pressed_with_shift ();
|
emit right_arrow_key_pressed_with_shift ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -385,10 +415,12 @@ LayoutCanvas::set_colors (lay::Color background, lay::Color foreground, lay::Col
|
||||||
m_active = active.rgb ();
|
m_active = active.rgb ();
|
||||||
|
|
||||||
// force regeneration of background image ..
|
// force regeneration of background image ..
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (mp_image_bg) {
|
if (mp_image_bg) {
|
||||||
delete mp_image_bg;
|
delete mp_image_bg;
|
||||||
}
|
}
|
||||||
mp_image_bg = 0;
|
mp_image_bg = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
update_image ();
|
update_image ();
|
||||||
}
|
}
|
||||||
|
|
@ -427,6 +459,7 @@ LayoutCanvas::prepare_drawing ()
|
||||||
|
|
||||||
BitmapViewObjectCanvas::set_size (m_viewport_l.width (), m_viewport_l.height (), 1.0 / double (m_oversampling * m_dpr));
|
BitmapViewObjectCanvas::set_size (m_viewport_l.width (), m_viewport_l.height (), 1.0 / double (m_oversampling * m_dpr));
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (! mp_image ||
|
if (! mp_image ||
|
||||||
(unsigned int) mp_image->width () != m_viewport_l.width () ||
|
(unsigned int) mp_image->width () != m_viewport_l.width () ||
|
||||||
(unsigned int) mp_image->height () != m_viewport_l.height ()) {
|
(unsigned int) mp_image->height () != m_viewport_l.height ()) {
|
||||||
|
|
@ -444,6 +477,7 @@ LayoutCanvas::prepare_drawing ()
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_image->fill (m_background);
|
mp_image->fill (m_background);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Cancel any pending "finish" event so there is no race between finish and restart (important for caching)
|
// Cancel any pending "finish" event so there is no race between finish and restart (important for caching)
|
||||||
m_do_end_of_drawing_dm.cancel ();
|
m_do_end_of_drawing_dm.cancel ();
|
||||||
|
|
@ -546,12 +580,15 @@ LayoutCanvas::update_image ()
|
||||||
void
|
void
|
||||||
LayoutCanvas::free_resources ()
|
LayoutCanvas::free_resources ()
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (mp_pixmap) {
|
if (mp_pixmap) {
|
||||||
delete mp_pixmap;
|
delete mp_pixmap;
|
||||||
mp_pixmap = 0;
|
mp_pixmap = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
void
|
void
|
||||||
LayoutCanvas::paintEvent (QPaintEvent *)
|
LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
{
|
{
|
||||||
|
|
@ -692,7 +729,9 @@ LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
class DetachedViewObjectCanvas
|
class DetachedViewObjectCanvas
|
||||||
: public BitmapViewObjectCanvas
|
: public BitmapViewObjectCanvas
|
||||||
{
|
{
|
||||||
|
|
@ -769,14 +808,18 @@ private:
|
||||||
QImage *mp_image_l;
|
QImage *mp_image_l;
|
||||||
double m_gamma;
|
double m_gamma;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QImage
|
QImage
|
||||||
LayoutCanvas::image (unsigned int width, unsigned int height)
|
LayoutCanvas::image (unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
return image_with_options (width, height, -1, -1, -1.0, lay::Color (), lay::Color (), lay::Color (), db::DBox (), false);
|
return image_with_options (width, height, -1, -1, -1.0, lay::Color (), lay::Color (), lay::Color (), db::DBox (), false);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QImage
|
#if defined(HAVE_QT) // @@@
|
||||||
|
QImage
|
||||||
LayoutCanvas::image_with_options (unsigned int width, unsigned int height, int linewidth, int oversampling, double resolution, lay::Color background, lay::Color foreground, lay::Color active, const db::DBox &target_box, bool is_mono)
|
LayoutCanvas::image_with_options (unsigned int width, unsigned int height, int linewidth, int oversampling, double resolution, lay::Color background, lay::Color foreground, lay::Color active, const db::DBox &target_box, bool is_mono)
|
||||||
{
|
{
|
||||||
if (oversampling <= 0) {
|
if (oversampling <= 0) {
|
||||||
|
|
@ -866,8 +909,10 @@ LayoutCanvas::image_with_options (unsigned int width, unsigned int height, int l
|
||||||
|
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QImage
|
#if defined(HAVE_QT) // @@@
|
||||||
|
QImage
|
||||||
LayoutCanvas::screenshot ()
|
LayoutCanvas::screenshot ()
|
||||||
{
|
{
|
||||||
// if required, start the redraw thread ..
|
// if required, start the redraw thread ..
|
||||||
|
|
@ -896,7 +941,9 @@ LayoutCanvas::screenshot ()
|
||||||
|
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
void
|
void
|
||||||
LayoutCanvas::resizeEvent (QResizeEvent *)
|
LayoutCanvas::resizeEvent (QResizeEvent *)
|
||||||
{
|
{
|
||||||
|
|
@ -910,6 +957,7 @@ LayoutCanvas::resizeEvent (QResizeEvent *)
|
||||||
do_redraw_all (true);
|
do_redraw_all (true);
|
||||||
viewport_changed_event ();
|
viewport_changed_event ();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutCanvas::update_viewport ()
|
LayoutCanvas::update_viewport ()
|
||||||
|
|
@ -979,6 +1027,7 @@ LayoutCanvas::do_update_image ()
|
||||||
update_image ();
|
update_image ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
bool
|
bool
|
||||||
LayoutCanvas::event (QEvent *e)
|
LayoutCanvas::event (QEvent *e)
|
||||||
{
|
{
|
||||||
|
|
@ -997,6 +1046,7 @@ LayoutCanvas::event (QEvent *e)
|
||||||
return QWidget::event (e);
|
return QWidget::event (e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutCanvas::redraw_all ()
|
LayoutCanvas::redraw_all ()
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
#include "dbTrans.h"
|
#include "dbTrans.h"
|
||||||
#include "dbBox.h"
|
#include "dbBox.h"
|
||||||
#include "layViewport.h"
|
#include "layViewport.h"
|
||||||
|
|
@ -43,6 +41,7 @@
|
||||||
#include "layRedrawThreadCanvas.h"
|
#include "layRedrawThreadCanvas.h"
|
||||||
#include "layRedrawLayerInfo.h"
|
#include "layRedrawLayerInfo.h"
|
||||||
#include "tlDeferredExecution.h"
|
#include "tlDeferredExecution.h"
|
||||||
|
#include "tlThreads.h"
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -146,7 +145,7 @@ public:
|
||||||
#if defined(HAVE_QT)
|
#if defined(HAVE_QT)
|
||||||
LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const char *name = "canvas");
|
LayoutCanvas (QWidget *parent, lay::LayoutViewBase *view, const char *name = "canvas");
|
||||||
#else
|
#else
|
||||||
LayoutCanvas (lay::LayoutViewBase *view, const char *name = "canvas");
|
LayoutCanvas (lay::LayoutViewBase *view);
|
||||||
#endif
|
#endif
|
||||||
~LayoutCanvas ();
|
~LayoutCanvas ();
|
||||||
|
|
||||||
|
|
@ -171,9 +170,11 @@ public:
|
||||||
return m_view_ops;
|
return m_view_ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QImage screenshot ();
|
QImage screenshot ();
|
||||||
QImage image (unsigned int width, unsigned int height);
|
QImage image (unsigned int width, unsigned int height);
|
||||||
QImage image_with_options (unsigned int width, unsigned int height, int linewidth, int oversampling, double resolution, lay::Color background, lay::Color foreground, lay::Color active_color, const db::DBox &target_box, bool monochrome);
|
QImage image_with_options (unsigned int width, unsigned int height, int linewidth, int oversampling, double resolution, lay::Color background, lay::Color foreground, lay::Color active_color, const db::DBox &target_box, bool monochrome);
|
||||||
|
#endif
|
||||||
|
|
||||||
void update_image ();
|
void update_image ();
|
||||||
|
|
||||||
|
|
@ -315,6 +316,7 @@ public:
|
||||||
return lay::Color (m_active);
|
return lay::Color (m_active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
/**
|
/**
|
||||||
* @brief Reimplementation of ViewObjectCanvas: background image
|
* @brief Reimplementation of ViewObjectCanvas: background image
|
||||||
*/
|
*/
|
||||||
|
|
@ -322,6 +324,7 @@ public:
|
||||||
{
|
{
|
||||||
return *mp_image;
|
return *mp_image;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reimplementation of RedrawThreadCanvas: signal end of drawing
|
* @brief Reimplementation of RedrawThreadCanvas: signal end of drawing
|
||||||
|
|
@ -359,9 +362,11 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
lay::LayoutViewBase *mp_view;
|
lay::LayoutViewBase *mp_view;
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QImage *mp_image;
|
QImage *mp_image;
|
||||||
QImage *mp_image_bg;
|
QImage *mp_image_bg;
|
||||||
QPixmap *mp_pixmap;
|
QPixmap *mp_pixmap;
|
||||||
|
#endif
|
||||||
db::DBox m_precious_box;
|
db::DBox m_precious_box;
|
||||||
lay::Viewport m_viewport, m_viewport_l;
|
lay::Viewport m_viewport, m_viewport_l;
|
||||||
lay::color_t m_background;
|
lay::color_t m_background;
|
||||||
|
|
@ -388,11 +393,13 @@ private:
|
||||||
std::vector<ImageCacheEntry> m_image_cache;
|
std::vector<ImageCacheEntry> m_image_cache;
|
||||||
size_t m_image_cache_size;
|
size_t m_image_cache_size;
|
||||||
|
|
||||||
QMutex m_mutex;
|
tl::Mutex m_mutex;
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
virtual void paintEvent (QPaintEvent *);
|
virtual void paintEvent (QPaintEvent *);
|
||||||
virtual void resizeEvent (QResizeEvent *);
|
virtual void resizeEvent (QResizeEvent *);
|
||||||
virtual bool event (QEvent *e);
|
virtual bool event (QEvent *e);
|
||||||
|
#endif
|
||||||
virtual void key_event (unsigned int key, unsigned int buttons);
|
virtual void key_event (unsigned int key, unsigned int buttons);
|
||||||
|
|
||||||
// implementation of the lay::Drawings interface
|
// implementation of the lay::Drawings interface
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -1107,3 +1108,26 @@ LayoutView::sizeHint () const
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace lay
|
} // namespace lay
|
||||||
|
|
||||||
|
#else // defined(HAVE_QT)
|
||||||
|
|
||||||
|
#include "layLayoutView.h"
|
||||||
|
|
||||||
|
namespace lay
|
||||||
|
{
|
||||||
|
|
||||||
|
LayoutView::LayoutView (db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options)
|
||||||
|
: LayoutViewBase (mgr, editable, plugin_parent, options)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
LayoutView::LayoutView (lay::LayoutView *source, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options)
|
||||||
|
: LayoutViewBase (source, mgr, editable, plugin_parent, options)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace lay
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
#include "laybasicCommon.h"
|
#include "laybasicCommon.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
@ -764,4 +766,36 @@ protected:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // defined(HAVE_QT)
|
||||||
|
|
||||||
|
#include "layLayoutViewBase.h"
|
||||||
|
|
||||||
|
namespace lay
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The layout view object
|
||||||
|
*
|
||||||
|
* The layout view is responsible for displaying one or a set of layouts.
|
||||||
|
* It manages the layer display list and many other components.
|
||||||
|
*/
|
||||||
|
class LAYBASIC_PUBLIC LayoutView
|
||||||
|
: public LayoutViewBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructor
|
||||||
|
*/
|
||||||
|
LayoutView (db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options = (unsigned int) LV_Normal);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Constructor (clone from another view)
|
||||||
|
*/
|
||||||
|
LayoutView (lay::LayoutView *source, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options = (unsigned int) LV_Normal);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "laybasicConfig.h"
|
||||||
|
|
||||||
#include "tlInternational.h"
|
#include "tlInternational.h"
|
||||||
#include "tlExpression.h"
|
#include "tlExpression.h"
|
||||||
#include "tlTimer.h"
|
#include "tlTimer.h"
|
||||||
|
|
@ -35,7 +37,6 @@
|
||||||
#include "layLayoutViewBase.h"
|
#include "layLayoutViewBase.h"
|
||||||
#include "layViewOp.h"
|
#include "layViewOp.h"
|
||||||
#include "layViewObject.h"
|
#include "layViewObject.h"
|
||||||
#include "laybasicConfig.h"
|
|
||||||
#include "layConverters.h"
|
#include "layConverters.h"
|
||||||
#include "layGridNet.h"
|
#include "layGridNet.h"
|
||||||
#include "layMove.h"
|
#include "layMove.h"
|
||||||
|
|
@ -45,30 +46,19 @@
|
||||||
#include "layFixedFont.h"
|
#include "layFixedFont.h"
|
||||||
#include "laySelector.h"
|
#include "laySelector.h"
|
||||||
#include "layLayoutCanvas.h"
|
#include "layLayoutCanvas.h"
|
||||||
#include "layLayerControlPanel.h"
|
|
||||||
#include "layHierarchyControlPanel.h"
|
|
||||||
#include "layLibrariesView.h"
|
|
||||||
#include "layBrowser.h"
|
|
||||||
#include "layRedrawThread.h"
|
#include "layRedrawThread.h"
|
||||||
#include "layRedrawThreadWorker.h"
|
#include "layRedrawThreadWorker.h"
|
||||||
#include "layParsedLayerSource.h"
|
#include "layParsedLayerSource.h"
|
||||||
#include "layBookmarkManagementForm.h"
|
|
||||||
#include "layNetlistBrowserDialog.h"
|
|
||||||
#include "layBookmarksView.h"
|
|
||||||
#include "layEditorOptionsFrame.h"
|
|
||||||
#include "layEditorOptionsPages.h"
|
|
||||||
#include "dbClipboard.h"
|
#include "dbClipboard.h"
|
||||||
#include "dbLayout.h"
|
#include "dbLayout.h"
|
||||||
#include "dbLayoutUtils.h"
|
#include "dbLayoutUtils.h"
|
||||||
#include "dbManager.h"
|
#include "dbManager.h"
|
||||||
#include "dbLibrary.h"
|
#include "dbLibrary.h"
|
||||||
#include "rdb.h"
|
#include "rdb.h"
|
||||||
#include "rdbMarkerBrowserDialog.h"
|
|
||||||
#include "dbLayoutToNetlist.h"
|
#include "dbLayoutToNetlist.h"
|
||||||
#include "dbTechnology.h"
|
#include "dbTechnology.h"
|
||||||
#include "tlXMLParser.h"
|
#include "tlXMLParser.h"
|
||||||
#include "gsi.h"
|
#include "gsi.h"
|
||||||
#include "gtf.h"
|
|
||||||
|
|
||||||
#if defined(HAVE_QT)
|
#if defined(HAVE_QT)
|
||||||
# include <QImageWriter>
|
# include <QImageWriter>
|
||||||
|
|
@ -634,7 +624,7 @@ LayoutViewBase::title () const
|
||||||
if (! m_title.empty ()) {
|
if (! m_title.empty ()) {
|
||||||
return m_title;
|
return m_title;
|
||||||
} else if (cellviews () == 0) {
|
} else if (cellviews () == 0) {
|
||||||
return tl::to_string (QObject::tr ("<empty>"));
|
return tl::to_string (tr ("<empty>"));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
int cv_index = active_cellview_index ();
|
int cv_index = active_cellview_index ();
|
||||||
|
|
@ -4836,7 +4826,7 @@ LayoutViewBase::paste_interactive ()
|
||||||
{
|
{
|
||||||
clear_selection ();
|
clear_selection ();
|
||||||
|
|
||||||
std::unique_ptr<db::Transaction> trans (new db::Transaction (manager (), tl::to_string (QObject::tr ("Paste and move"))));
|
std::unique_ptr<db::Transaction> trans (new db::Transaction (manager (), tl::to_string (tr ("Paste and move"))));
|
||||||
|
|
||||||
{
|
{
|
||||||
// let the receivers sort out who is pasting what ..
|
// let the receivers sort out who is pasting what ..
|
||||||
|
|
@ -4872,7 +4862,7 @@ LayoutViewBase::cut ()
|
||||||
lay::Editables::transient_to_selection ();
|
lay::Editables::transient_to_selection ();
|
||||||
}
|
}
|
||||||
|
|
||||||
db::Transaction trans (manager (), tl::to_string (QObject::tr ("Cut")));
|
db::Transaction trans (manager (), tl::to_string (tr ("Cut")));
|
||||||
lay::Editables::cut ();
|
lay::Editables::cut ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "layLayerProperties.h"
|
#include "layLayerProperties.h"
|
||||||
#include "layAbstractMenu.h"
|
|
||||||
#include "layAnnotationShapes.h"
|
#include "layAnnotationShapes.h"
|
||||||
#include "layDispatcher.h"
|
#include "layDispatcher.h"
|
||||||
#include "layLayoutCanvas.h"
|
#include "layLayoutCanvas.h"
|
||||||
|
|
|
||||||
|
|
@ -149,16 +149,16 @@ LineStylePalette::from_string (const std::string &s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! x.at_end ()) {
|
if (! x.at_end ()) {
|
||||||
throw tl::Exception (tl::sprintf (tl::to_string (QObject::tr ("unexpected characters: %s")), x.skip ()));
|
throw tl::Exception (tl::sprintf (tl::to_string (tr ("unexpected characters: %s")), x.skip ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (styles () == 0) {
|
if (styles () == 0) {
|
||||||
throw tl::Exception (tl::to_string (QObject::tr ("invalid line style palette - no styles")));
|
throw tl::Exception (tl::to_string (tr ("invalid line style palette - no styles")));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (std::exception &ex) {
|
} catch (std::exception &ex) {
|
||||||
// reformat error message
|
// reformat error message
|
||||||
throw tl::Exception (tl::sprintf (tl::to_string (QObject::tr ("Line style palette string format error: %s")), ex.what ()));
|
throw tl::Exception (tl::sprintf (tl::to_string (tr ("Line style palette string format error: %s")), ex.what ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -162,6 +163,7 @@ LineStyleInfo::is_bit_set (unsigned int n) const
|
||||||
return (pattern () [(n / 32) % pattern_stride ()] & (1 << (n % 32))) != 0;
|
return (pattern () [(n / 32) % pattern_stride ()] & (1 << (n % 32))) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QBitmap
|
QBitmap
|
||||||
LineStyleInfo::get_bitmap (int width, int height) const
|
LineStyleInfo::get_bitmap (int width, int height) const
|
||||||
{
|
{
|
||||||
|
|
@ -196,6 +198,7 @@ LineStyleInfo::get_bitmap (int width, int height) const
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
LineStyleInfo::set_pattern (uint32_t pt, unsigned int w)
|
LineStyleInfo::set_pattern (uint32_t pt, unsigned int w)
|
||||||
|
|
@ -351,8 +354,11 @@ struct ReplaceLineStyleOp
|
||||||
LineStyleInfo m_old, m_new;
|
LineStyleInfo m_old, m_new;
|
||||||
};
|
};
|
||||||
|
|
||||||
LineStyles::LineStyles ()
|
LineStyles::LineStyles () :
|
||||||
: QObject (), db::Object (0)
|
#if defined(HAVE_QT)
|
||||||
|
QObject (),
|
||||||
|
#endif
|
||||||
|
db::Object (0)
|
||||||
{
|
{
|
||||||
for (unsigned int d = 0; d < sizeof (style_strings) / sizeof (style_strings [0]); d += 2) {
|
for (unsigned int d = 0; d < sizeof (style_strings) / sizeof (style_strings [0]); d += 2) {
|
||||||
m_styles.push_back (LineStyleInfo ());
|
m_styles.push_back (LineStyleInfo ());
|
||||||
|
|
@ -361,17 +367,20 @@ LineStyles::LineStyles ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LineStyles::LineStyles (const LineStyles &p) :
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
QObject (),
|
||||||
|
#endif
|
||||||
|
db::Object (0)
|
||||||
|
{
|
||||||
|
m_styles = p.m_styles;
|
||||||
|
}
|
||||||
|
|
||||||
LineStyles::~LineStyles ()
|
LineStyles::~LineStyles ()
|
||||||
{
|
{
|
||||||
// .. nothing yet ..
|
// .. nothing yet ..
|
||||||
}
|
}
|
||||||
|
|
||||||
LineStyles::LineStyles (const LineStyles &p)
|
|
||||||
: QObject (), db::Object (0)
|
|
||||||
{
|
|
||||||
m_styles = p.m_styles;
|
|
||||||
}
|
|
||||||
|
|
||||||
LineStyles &
|
LineStyles &
|
||||||
LineStyles::operator= (const LineStyles &p)
|
LineStyles::operator= (const LineStyles &p)
|
||||||
{
|
{
|
||||||
|
|
@ -418,7 +427,9 @@ LineStyles::replace_style (unsigned int i, const LineStyleInfo &p)
|
||||||
|
|
||||||
// if something has changed emit the signal
|
// if something has changed emit the signal
|
||||||
if (chg) {
|
if (chg) {
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
emit changed ();
|
emit changed ();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace lay
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst, const db::CplxTrans &tr, lay::Renderer &r,
|
void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst, const db::CplxTrans &trans, lay::Renderer &r,
|
||||||
unsigned int font, lay::CanvasPlane *fill, lay::CanvasPlane *contour, lay::CanvasPlane *vertex, lay::CanvasPlane *text,
|
unsigned int font, lay::CanvasPlane *fill, lay::CanvasPlane *contour, lay::CanvasPlane *vertex, lay::CanvasPlane *text,
|
||||||
bool cell_name_text_transform, int min_size_for_label, bool draw_outline, size_t max_shapes)
|
bool cell_name_text_transform, int min_size_for_label, bool draw_outline, size_t max_shapes)
|
||||||
{
|
{
|
||||||
|
|
@ -83,29 +83,29 @@ void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst,
|
||||||
db::Vector av(a), bv(b);
|
db::Vector av(a), bv(b);
|
||||||
|
|
||||||
// fallback to simpler representation using a description text
|
// fallback to simpler representation using a description text
|
||||||
db::CplxTrans tbox (tr * inst.complex_trans ());
|
db::CplxTrans tbox (trans * inst.complex_trans ());
|
||||||
|
|
||||||
// one representative instance
|
// one representative instance
|
||||||
r.draw (cell_box, tbox, fill, contour, 0, text);
|
r.draw (cell_box, tbox, fill, contour, 0, text);
|
||||||
r.draw (cell_box, db::CplxTrans (tr * (av * long (amax - 1))) * tbox, fill, contour, 0, text);
|
r.draw (cell_box, db::CplxTrans (trans * (av * long (amax - 1))) * tbox, fill, contour, 0, text);
|
||||||
r.draw (cell_box, db::CplxTrans (tr * (bv * long (bmax - 1))) * tbox, fill, contour, 0, text);
|
r.draw (cell_box, db::CplxTrans (trans * (bv * long (bmax - 1))) * tbox, fill, contour, 0, text);
|
||||||
r.draw (cell_box, db::CplxTrans (tr * (av * long (amax - 1) + bv * long (bmax - 1))) * tbox, fill, contour, 0, text);
|
r.draw (cell_box, db::CplxTrans (trans * (av * long (amax - 1) + bv * long (bmax - 1))) * tbox, fill, contour, 0, text);
|
||||||
|
|
||||||
db::DBox cb (tbox * cell_box);
|
db::DBox cb (tbox * cell_box);
|
||||||
db::DPolygon p;
|
db::DPolygon p;
|
||||||
db::DPoint points[] = {
|
db::DPoint points[] = {
|
||||||
db::DPoint (cb.lower_left ()),
|
db::DPoint (cb.lower_left ()),
|
||||||
db::DPoint (cb.lower_left () + tr * (av * long (amax - 1))),
|
db::DPoint (cb.lower_left () + trans * (av * long (amax - 1))),
|
||||||
db::DPoint (cb.lower_left () + tr * (av * long (amax - 1) + bv * long (bmax - 1))),
|
db::DPoint (cb.lower_left () + trans * (av * long (amax - 1) + bv * long (bmax - 1))),
|
||||||
db::DPoint (cb.lower_left () + tr * (bv * long (bmax - 1))),
|
db::DPoint (cb.lower_left () + trans * (bv * long (bmax - 1))),
|
||||||
};
|
};
|
||||||
p.assign_hull (points, points + sizeof (points) / sizeof (points[0]));
|
p.assign_hull (points, points + sizeof (points) / sizeof (points[0]));
|
||||||
r.draw (p, fill, contour, 0, text);
|
r.draw (p, fill, contour, 0, text);
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
db::DBox arr_box (db::DPoint (), db::DPoint () + tr * (av * long (amax - 1) + bv * long (bmax - 1)));
|
db::DBox arr_box (db::DPoint (), db::DPoint () + trans * (av * long (amax - 1) + bv * long (bmax - 1)));
|
||||||
arr_box *= cb;
|
arr_box *= cb;
|
||||||
r.draw (arr_box, tl::sprintf (tl::to_string (QObject::tr ("Array %ldx%ld")), amax, bmax), db::Font (font), db::HAlignCenter, db::VAlignCenter, db::DFTrans (db::DFTrans::r0), 0, 0, 0, text);
|
r.draw (arr_box, tl::sprintf (tl::to_string (tr ("Array %ldx%ld")), amax, bmax), db::Font (font), db::HAlignCenter, db::VAlignCenter, db::DFTrans (db::DFTrans::r0), 0, 0, 0, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -113,7 +113,7 @@ void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst,
|
||||||
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
||||||
|
|
||||||
// fallback to simpler representation using a description text
|
// fallback to simpler representation using a description text
|
||||||
db::CplxTrans tbox (tr * inst.complex_trans ());
|
db::CplxTrans tbox (trans * inst.complex_trans ());
|
||||||
|
|
||||||
r.draw (cell_box, tbox, fill, contour, 0, 0);
|
r.draw (cell_box, tbox, fill, contour, 0, 0);
|
||||||
|
|
||||||
|
|
@ -149,7 +149,7 @@ void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst,
|
||||||
while (! shapes.at_end ()) {
|
while (! shapes.at_end ()) {
|
||||||
|
|
||||||
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
||||||
r.draw (*shapes, tr * inst.complex_trans (*arr) * shapes.trans (), fill, contour, 0 /*use vertex for origin*/, text);
|
r.draw (*shapes, trans * inst.complex_trans (*arr) * shapes.trans (), fill, contour, 0 /*use vertex for origin*/, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
++shapes;
|
++shapes;
|
||||||
|
|
@ -167,7 +167,7 @@ void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst,
|
||||||
while (! shapes.at_end ()) {
|
while (! shapes.at_end ()) {
|
||||||
|
|
||||||
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
||||||
r.draw (*shapes, tr * inst.complex_trans (*arr) * shapes.trans (), fill, contour, 0 /*use vertex for origin*/, text);
|
r.draw (*shapes, trans * inst.complex_trans (*arr) * shapes.trans (), fill, contour, 0 /*use vertex for origin*/, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
++shapes;
|
++shapes;
|
||||||
|
|
@ -179,7 +179,7 @@ void render_cell_inst (const db::Layout &layout, const db::CellInstArray &inst,
|
||||||
if (render_origins && vertex) {
|
if (render_origins && vertex) {
|
||||||
|
|
||||||
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
for (db::CellInstArray::iterator arr = inst.begin (); ! arr.at_end (); ++arr) {
|
||||||
db::DPoint dp = db::DPoint () + (tr * inst.complex_trans (*arr)).disp ();
|
db::DPoint dp = db::DPoint () + (trans * inst.complex_trans (*arr)).disp ();
|
||||||
r.draw (db::DEdge (dp, dp), 0, 0, vertex, 0);
|
r.draw (db::DEdge (dp, dp), 0, 0, vertex, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ bool
|
||||||
MoveService::key_event (unsigned int key, unsigned int /*buttons*/)
|
MoveService::key_event (unsigned int key, unsigned int /*buttons*/)
|
||||||
{
|
{
|
||||||
double dx = 0.0, dy = 0.0;
|
double dx = 0.0, dy = 0.0;
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (int (key) == Qt::Key_Down) {
|
if (int (key) == Qt::Key_Down) {
|
||||||
dy = -1.0;
|
dy = -1.0;
|
||||||
} else if (int (key) == Qt::Key_Up) {
|
} else if (int (key) == Qt::Key_Up) {
|
||||||
|
|
@ -98,6 +99,7 @@ MoveService::key_event (unsigned int key, unsigned int /*buttons*/)
|
||||||
} else if (int (key) == Qt::Key_Right) {
|
} else if (int (key) == Qt::Key_Right) {
|
||||||
dx = 1.0;
|
dx = 1.0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (! m_dragging && fabs (dx + dy) > 0.0 && mp_editables->has_selection ()) {
|
if (! m_dragging && fabs (dx + dy) > 0.0 && mp_editables->has_selection ()) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,153 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
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 "layNetColorizer.h"
|
||||||
|
#include "dbNet.h"
|
||||||
|
#include "dbCircuit.h"
|
||||||
|
|
||||||
|
namespace lay
|
||||||
|
{
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// NetColorizer implementation
|
||||||
|
|
||||||
|
NetColorizer::NetColorizer ()
|
||||||
|
{
|
||||||
|
m_auto_colors_enabled = false;
|
||||||
|
m_update_needed = false;
|
||||||
|
m_signals_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::configure (const lay::Color &marker_color, const lay::ColorPalette *auto_colors)
|
||||||
|
{
|
||||||
|
m_marker_color = marker_color;
|
||||||
|
if (auto_colors) {
|
||||||
|
m_auto_colors = *auto_colors;
|
||||||
|
m_auto_colors_enabled = true;
|
||||||
|
} else {
|
||||||
|
m_auto_colors_enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit_colors_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
NetColorizer::has_color_for_net (const db::Net *net)
|
||||||
|
{
|
||||||
|
return net != 0 && (m_auto_colors_enabled || m_custom_color.find (net) != m_custom_color.end ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::set_color_of_net (const db::Net *net, const lay::Color &color)
|
||||||
|
{
|
||||||
|
m_custom_color[net] = color;
|
||||||
|
emit_colors_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::reset_color_of_net (const db::Net *net)
|
||||||
|
{
|
||||||
|
m_custom_color.erase (net);
|
||||||
|
emit_colors_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::clear ()
|
||||||
|
{
|
||||||
|
m_net_index_by_object.clear ();
|
||||||
|
m_custom_color.clear ();
|
||||||
|
emit_colors_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::begin_changes ()
|
||||||
|
{
|
||||||
|
if (m_signals_enabled) {
|
||||||
|
m_update_needed = false;
|
||||||
|
m_signals_enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::end_changes ()
|
||||||
|
{
|
||||||
|
if (! m_signals_enabled) {
|
||||||
|
m_signals_enabled = true;
|
||||||
|
if (m_update_needed) {
|
||||||
|
colors_changed ();
|
||||||
|
}
|
||||||
|
m_update_needed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetColorizer::emit_colors_changed ()
|
||||||
|
{
|
||||||
|
if (! m_signals_enabled) {
|
||||||
|
m_update_needed = true;
|
||||||
|
} else {
|
||||||
|
colors_changed ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lay::Color
|
||||||
|
NetColorizer::color_of_net (const db::Net *net) const
|
||||||
|
{
|
||||||
|
if (! net) {
|
||||||
|
return lay::Color ();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<const db::Net *, lay::Color>::const_iterator c = m_custom_color.find (net);
|
||||||
|
if (c != m_custom_color.end ()) {
|
||||||
|
return c->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_auto_colors_enabled) {
|
||||||
|
|
||||||
|
const db::Circuit *circuit = net->circuit ();
|
||||||
|
|
||||||
|
size_t index = 0;
|
||||||
|
|
||||||
|
std::map<const db::Net *, size_t>::iterator cc = m_net_index_by_object.find (net);
|
||||||
|
if (cc == m_net_index_by_object.end ()) {
|
||||||
|
|
||||||
|
size_t i = 0;
|
||||||
|
for (db::Circuit::const_net_iterator n = circuit->begin_nets (); n != circuit->end_nets (); ++n, ++i) {
|
||||||
|
m_net_index_by_object.insert (std::make_pair (n.operator-> (), i));
|
||||||
|
if (n.operator-> () == net) {
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
index = cc->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_auto_colors.color_by_index ((unsigned int) index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return lay::Color ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
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_layNetColorizer
|
||||||
|
#define HDR_layNetColorizer
|
||||||
|
|
||||||
|
#include "laybasicCommon.h"
|
||||||
|
#include "layColorPalette.h"
|
||||||
|
#include "layColor.h"
|
||||||
|
#include "tlEvents.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace db
|
||||||
|
{
|
||||||
|
class Net;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace lay
|
||||||
|
{
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------
|
||||||
|
// NetColorizer definition
|
||||||
|
|
||||||
|
class LAYBASIC_PUBLIC NetColorizer
|
||||||
|
: public tl::Object
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NetColorizer ();
|
||||||
|
|
||||||
|
void configure (const lay::Color &marker_color, const lay::ColorPalette *auto_colors);
|
||||||
|
bool has_color_for_net (const db::Net *net);
|
||||||
|
void set_color_of_net (const db::Net *net, const lay::Color &color);
|
||||||
|
void reset_color_of_net (const db::Net *net);
|
||||||
|
void clear ();
|
||||||
|
|
||||||
|
lay::Color color_of_net (const db::Net *net) const;
|
||||||
|
|
||||||
|
const lay::Color &marker_color () const
|
||||||
|
{
|
||||||
|
return m_marker_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
void begin_changes ();
|
||||||
|
void end_changes ();
|
||||||
|
|
||||||
|
tl::Event colors_changed;
|
||||||
|
|
||||||
|
private:
|
||||||
|
lay::Color m_marker_color;
|
||||||
|
lay::ColorPalette m_auto_colors;
|
||||||
|
bool m_auto_colors_enabled;
|
||||||
|
std::map<const db::Net *, lay::Color> m_custom_color;
|
||||||
|
bool m_update_needed;
|
||||||
|
bool m_signals_enabled;
|
||||||
|
mutable std::map<const db::Net *, size_t> m_net_index_by_object;
|
||||||
|
|
||||||
|
void emit_colors_changed ();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lay
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
@ -100,129 +100,6 @@ NetlistObjectsPath::second () const
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// NetColorizer implementation
|
|
||||||
|
|
||||||
NetColorizer::NetColorizer ()
|
|
||||||
{
|
|
||||||
m_auto_colors_enabled = false;
|
|
||||||
m_update_needed = false;
|
|
||||||
m_signals_enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::configure (const lay::Color &marker_color, const lay::ColorPalette *auto_colors)
|
|
||||||
{
|
|
||||||
m_marker_color = marker_color;
|
|
||||||
if (auto_colors) {
|
|
||||||
m_auto_colors = *auto_colors;
|
|
||||||
m_auto_colors_enabled = true;
|
|
||||||
} else {
|
|
||||||
m_auto_colors_enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
emit_colors_changed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
NetColorizer::has_color_for_net (const db::Net *net)
|
|
||||||
{
|
|
||||||
return net != 0 && (m_auto_colors_enabled || m_custom_color.find (net) != m_custom_color.end ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::set_color_of_net (const db::Net *net, const lay::Color &color)
|
|
||||||
{
|
|
||||||
m_custom_color[net] = color;
|
|
||||||
emit_colors_changed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::reset_color_of_net (const db::Net *net)
|
|
||||||
{
|
|
||||||
m_custom_color.erase (net);
|
|
||||||
emit_colors_changed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::clear ()
|
|
||||||
{
|
|
||||||
m_net_index_by_object.clear ();
|
|
||||||
m_custom_color.clear ();
|
|
||||||
emit_colors_changed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::begin_changes ()
|
|
||||||
{
|
|
||||||
if (m_signals_enabled) {
|
|
||||||
m_update_needed = false;
|
|
||||||
m_signals_enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::end_changes ()
|
|
||||||
{
|
|
||||||
if (! m_signals_enabled) {
|
|
||||||
m_signals_enabled = true;
|
|
||||||
if (m_update_needed) {
|
|
||||||
emit colors_changed ();
|
|
||||||
}
|
|
||||||
m_update_needed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
NetColorizer::emit_colors_changed ()
|
|
||||||
{
|
|
||||||
if (! m_signals_enabled) {
|
|
||||||
m_update_needed = true;
|
|
||||||
} else {
|
|
||||||
emit colors_changed ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lay::Color
|
|
||||||
NetColorizer::color_of_net (const db::Net *net) const
|
|
||||||
{
|
|
||||||
if (! net) {
|
|
||||||
return lay::Color ();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<const db::Net *, lay::Color>::const_iterator c = m_custom_color.find (net);
|
|
||||||
if (c != m_custom_color.end ()) {
|
|
||||||
return c->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_auto_colors_enabled) {
|
|
||||||
|
|
||||||
const db::Circuit *circuit = net->circuit ();
|
|
||||||
|
|
||||||
size_t index = 0;
|
|
||||||
|
|
||||||
std::map<const db::Net *, size_t>::iterator cc = m_net_index_by_object.find (net);
|
|
||||||
if (cc == m_net_index_by_object.end ()) {
|
|
||||||
|
|
||||||
size_t i = 0;
|
|
||||||
for (db::Circuit::const_net_iterator n = circuit->begin_nets (); n != circuit->end_nets (); ++n, ++i) {
|
|
||||||
m_net_index_by_object.insert (std::make_pair (n.operator-> (), i));
|
|
||||||
if (n.operator-> () == net) {
|
|
||||||
index = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
index = cc->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_auto_colors.color_by_index ((unsigned int) index);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return lay::Color ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Implementation of the item classes
|
// Implementation of the item classes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "dbLayoutToNetlist.h"
|
#include "dbLayoutToNetlist.h"
|
||||||
#include "dbLayoutVsSchematic.h"
|
#include "dbLayoutVsSchematic.h"
|
||||||
|
#include "layNetColorizer.h"
|
||||||
|
|
||||||
#include "tlList.h"
|
#include "tlList.h"
|
||||||
#include "tlTypeTraits.h"
|
#include "tlTypeTraits.h"
|
||||||
|
|
@ -46,48 +47,6 @@ namespace lay
|
||||||
|
|
||||||
class IndexedNetlistModel;
|
class IndexedNetlistModel;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// NetColorizer definition
|
|
||||||
|
|
||||||
class LAYBASIC_PUBLIC NetColorizer
|
|
||||||
: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
NetColorizer ();
|
|
||||||
|
|
||||||
void configure (const lay::Color &marker_color, const lay::ColorPalette *auto_colors);
|
|
||||||
bool has_color_for_net (const db::Net *net);
|
|
||||||
void set_color_of_net (const db::Net *net, const Color &color);
|
|
||||||
void reset_color_of_net (const db::Net *net);
|
|
||||||
void clear ();
|
|
||||||
|
|
||||||
lay::Color color_of_net (const db::Net *net) const;
|
|
||||||
|
|
||||||
const lay::Color &marker_color () const
|
|
||||||
{
|
|
||||||
return m_marker_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void begin_changes ();
|
|
||||||
void end_changes ();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void colors_changed ();
|
|
||||||
|
|
||||||
private:
|
|
||||||
lay::Color m_marker_color;
|
|
||||||
lay::ColorPalette m_auto_colors;
|
|
||||||
bool m_auto_colors_enabled;
|
|
||||||
std::map<const db::Net *, lay::Color> m_custom_color;
|
|
||||||
bool m_update_needed;
|
|
||||||
bool m_signals_enabled;
|
|
||||||
mutable std::map<const db::Net *, size_t> m_net_index_by_object;
|
|
||||||
|
|
||||||
void emit_colors_changed ();
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// NetlistBrowserModel definition
|
// NetlistBrowserModel definition
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
|
|
||||||
#include "dbInstElement.h"
|
#include "dbInstElement.h"
|
||||||
#include "dbClipboardData.h"
|
#include "dbClipboardData.h"
|
||||||
#include "dbClipboard.h"
|
#include "dbClipboard.h"
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ extract_base (tl::Extractor &ex)
|
||||||
} else if (ex.test ("!=")) {
|
} else if (ex.test ("!=")) {
|
||||||
eq = false;
|
eq = false;
|
||||||
} else {
|
} else {
|
||||||
ex.error (tl::to_string (QObject::tr ("'==' or '!=' operator expected")));
|
ex.error (tl::to_string (tr ("'==' or '!=' operator expected")));
|
||||||
}
|
}
|
||||||
ex.read (v);
|
ex.read (v);
|
||||||
return new PropertySelectorEqual (n, v, eq);
|
return new PropertySelectorEqual (n, v, eq);
|
||||||
|
|
@ -1376,7 +1376,7 @@ ParsedLayerSource::parse_from_string (const char *cp)
|
||||||
if (sp == "CellFrame" || sp == "cellframe" || sp == "CF" || sp == "cell-frame") {
|
if (sp == "CellFrame" || sp == "cellframe" || sp == "CF" || sp == "cell-frame") {
|
||||||
m_special_purpose = SP_CellFrame;
|
m_special_purpose = SP_CellFrame;
|
||||||
} else {
|
} else {
|
||||||
throw tl::Exception (tl::to_string (QObject::tr ("Invalid special purpose '%s'")), sp);
|
throw tl::Exception (tl::to_string (tr ("Invalid special purpose '%s'")), sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (x.test ("(")) {
|
} else if (x.test ("(")) {
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,13 @@
|
||||||
#include "tlExceptions.h"
|
#include "tlExceptions.h"
|
||||||
#include "tlClassRegistry.h"
|
#include "tlClassRegistry.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
#include "gtf.h"
|
#include "gtf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -93,6 +94,7 @@ PluginDeclaration::menu_symbols ()
|
||||||
return symbols;
|
return symbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class GenericMenuAction
|
class GenericMenuAction
|
||||||
|
|
@ -142,10 +144,12 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginDeclaration::init_menu (lay::Dispatcher *dispatcher)
|
PluginDeclaration::init_menu (lay::Dispatcher *dispatcher)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
lay::AbstractMenu &menu = *dispatcher->menu ();
|
lay::AbstractMenu &menu = *dispatcher->menu ();
|
||||||
|
|
||||||
mp_editable_mode_action.reset ((Action *) 0);
|
mp_editable_mode_action.reset ((Action *) 0);
|
||||||
|
|
@ -255,11 +259,13 @@ PluginDeclaration::init_menu (lay::Dispatcher *dispatcher)
|
||||||
menu.insert_item (m->second.first, name + ":mode_group", mp_mouse_mode_action.get ());
|
menu.insert_item (m->second.first, name + ":mode_group", mp_mouse_mode_action.get ());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginDeclaration::remove_menu_items (Dispatcher *dispatcher)
|
PluginDeclaration::remove_menu_items (Dispatcher *dispatcher)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
lay::AbstractMenu *menu = dispatcher->menu ();
|
lay::AbstractMenu *menu = dispatcher->menu ();
|
||||||
menu->delete_items (mp_editable_mode_action.get ());
|
menu->delete_items (mp_editable_mode_action.get ());
|
||||||
menu->delete_items (mp_mouse_mode_action.get ());
|
menu->delete_items (mp_mouse_mode_action.get ());
|
||||||
|
|
@ -274,6 +280,7 @@ PluginDeclaration::remove_menu_items (Dispatcher *dispatcher)
|
||||||
menu->delete_items (*a);
|
menu->delete_items (*a);
|
||||||
}
|
}
|
||||||
m_menu_actions.clear ();
|
m_menu_actions.clear ();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -281,9 +288,11 @@ PluginDeclaration::set_editable_enabled (bool f)
|
||||||
{
|
{
|
||||||
if (f != m_editable_enabled) {
|
if (f != m_editable_enabled) {
|
||||||
m_editable_enabled = f;
|
m_editable_enabled = f;
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (mp_editable_mode_action.get ()) {
|
if (mp_editable_mode_action.get ()) {
|
||||||
mp_editable_mode_action->set_checked (f);
|
mp_editable_mode_action->set_checked (f);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
editable_enabled_changed_event ();
|
editable_enabled_changed_event ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -358,7 +367,7 @@ Plugin::config_set (const std::string &name, const std::string &value)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (tl::Exception &ex) {
|
} catch (tl::Exception &ex) {
|
||||||
tl::error << tl::to_string (QObject::tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
tl::error << tl::to_string (tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -481,7 +490,7 @@ Plugin::do_config_set (const std::string &name, const std::string &value, bool f
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (tl::Exception &ex) {
|
} catch (tl::Exception &ex) {
|
||||||
tl::error << tl::to_string (QObject::tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
tl::error << tl::to_string (tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// propagate to all children (not only the first that takes it!)
|
// propagate to all children (not only the first that takes it!)
|
||||||
|
|
|
||||||
|
|
@ -455,8 +455,10 @@ public:
|
||||||
|
|
||||||
#if defined(HAVE_QT)
|
#if defined(HAVE_QT)
|
||||||
private slots:
|
private slots:
|
||||||
void toggle_editable_enabled ();
|
#else
|
||||||
|
private:
|
||||||
#endif
|
#endif
|
||||||
|
void toggle_editable_enabled ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_id;
|
int m_id;
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <QEvent>
|
|
||||||
#include <QApplication>
|
|
||||||
|
|
||||||
#include "layRedrawThread.h"
|
#include "layRedrawThread.h"
|
||||||
#include "layRedrawThreadWorker.h"
|
#include "layRedrawThreadWorker.h"
|
||||||
#include "tlLog.h"
|
#include "tlLog.h"
|
||||||
|
|
@ -63,7 +60,7 @@ RedrawThread::~RedrawThread ()
|
||||||
void RedrawThread::layout_changed ()
|
void RedrawThread::layout_changed ()
|
||||||
{
|
{
|
||||||
if (is_running () && tl::verbosity () >= 30) {
|
if (is_running () && tl::verbosity () >= 30) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Layout changed: redraw thread stopped"));
|
tl::info << tl::to_string (tr ("Layout changed: redraw thread stopped"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if something changed on the layouts we observe, stop the redraw thread
|
// if something changed on the layouts we observe, stop the redraw thread
|
||||||
|
|
@ -228,9 +225,9 @@ RedrawThread::do_start (bool clear, const db::Vector *shift_vector, const std::v
|
||||||
|
|
||||||
{
|
{
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Preparing to draw"));
|
tl::info << tl::to_string (tr ("Preparing to draw"));
|
||||||
}
|
}
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (QObject::tr ("Preparing to draw")));
|
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Preparing to draw")));
|
||||||
|
|
||||||
// detach from all layout objects
|
// detach from all layout objects
|
||||||
tl::Object::detach_from_all_events ();
|
tl::Object::detach_from_all_events ();
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,6 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <QThread>
|
|
||||||
#include <QMutex>
|
|
||||||
#include <QWaitCondition>
|
|
||||||
|
|
||||||
#include "dbBox.h"
|
#include "dbBox.h"
|
||||||
#include "dbTrans.h"
|
#include "dbTrans.h"
|
||||||
#include "dbLayout.h"
|
#include "dbLayout.h"
|
||||||
|
|
@ -41,6 +37,7 @@
|
||||||
#include "layRedrawLayerInfo.h"
|
#include "layRedrawLayerInfo.h"
|
||||||
#include "layCanvasPlane.h"
|
#include "layCanvasPlane.h"
|
||||||
#include "tlTimer.h"
|
#include "tlTimer.h"
|
||||||
|
#include "tlThreads.h"
|
||||||
#include "tlThreadedWorkers.h"
|
#include "tlThreadedWorkers.h"
|
||||||
|
|
||||||
namespace lay {
|
namespace lay {
|
||||||
|
|
@ -120,8 +117,8 @@ private:
|
||||||
bool m_start_recursion_sentinel;
|
bool m_start_recursion_sentinel;
|
||||||
|
|
||||||
tl::Clock m_clock;
|
tl::Clock m_clock;
|
||||||
QMutex m_initial_wait_lock;
|
tl::Mutex m_initial_wait_lock;
|
||||||
QWaitCondition m_initial_wait_cond;
|
tl::WaitCondition m_initial_wait_cond;
|
||||||
|
|
||||||
std::unique_ptr<tl::SelfTimer> m_main_timer;
|
std::unique_ptr<tl::SelfTimer> m_main_timer;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,15 @@
|
||||||
|
|
||||||
#include "layRedrawThreadCanvas.h"
|
#include "layRedrawThreadCanvas.h"
|
||||||
#include "layCanvasPlane.h"
|
#include "layCanvasPlane.h"
|
||||||
|
#if defined(HAVE_QT)
|
||||||
#include "layBitmapsToImage.h"
|
#include "layBitmapsToImage.h"
|
||||||
|
#endif
|
||||||
#include "layDrawing.h"
|
#include "layDrawing.h"
|
||||||
#include "layBitmap.h"
|
#include "layBitmap.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
{
|
{
|
||||||
|
|
@ -393,6 +397,7 @@ BitmapRedrawThreadCanvas::initialize_plane (lay::CanvasPlane *plane, unsigned in
|
||||||
unlock ();
|
unlock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
void
|
void
|
||||||
BitmapRedrawThreadCanvas::to_image (const std::vector <lay::ViewOp> &view_ops, const lay::DitherPattern &dp, const lay::LineStyles &ls, lay::Color background, lay::Color foreground, lay::Color active, const lay::Drawings *drawings, QImage &img, unsigned int width, unsigned int height)
|
BitmapRedrawThreadCanvas::to_image (const std::vector <lay::ViewOp> &view_ops, const lay::DitherPattern &dp, const lay::LineStyles &ls, lay::Color background, lay::Color foreground, lay::Color active, const lay::Drawings *drawings, QImage &img, unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
|
|
@ -412,6 +417,7 @@ BitmapRedrawThreadCanvas::to_image (const std::vector <lay::ViewOp> &view_ops, c
|
||||||
bitmaps_to_image (d->get_view_ops (*this, background, foreground, active), *bt, dp, ls, &img, width, height, true, &mutex ());
|
bitmaps_to_image (d->get_view_ops (*this, background, foreground, active), *bt, dp, ls, &img, width, height, true, &mutex ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,10 @@
|
||||||
#include "dbTrans.h"
|
#include "dbTrans.h"
|
||||||
#include "layViewOp.h"
|
#include "layViewOp.h"
|
||||||
#include "layBitmapRenderer.h"
|
#include "layBitmapRenderer.h"
|
||||||
|
#include "tlThreads.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
class QImage;
|
|
||||||
|
|
||||||
namespace lay {
|
namespace lay {
|
||||||
|
|
||||||
class CanvasPlane;
|
class CanvasPlane;
|
||||||
|
|
@ -151,7 +148,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Access to the mutex object
|
* @brief Access to the mutex object
|
||||||
*/
|
*/
|
||||||
QMutex &mutex ()
|
tl::Mutex &mutex ()
|
||||||
{
|
{
|
||||||
return m_mutex;
|
return m_mutex;
|
||||||
}
|
}
|
||||||
|
|
@ -186,7 +183,7 @@ public:
|
||||||
virtual lay::Renderer *create_renderer () = 0;
|
virtual lay::Renderer *create_renderer () = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex m_mutex;
|
tl::Mutex m_mutex;
|
||||||
double m_resolution;
|
double m_resolution;
|
||||||
unsigned int m_width, m_height;
|
unsigned int m_width, m_height;
|
||||||
};
|
};
|
||||||
|
|
@ -318,10 +315,12 @@ public:
|
||||||
return new lay::BitmapRenderer (m_width, m_height, resolution ());
|
return new lay::BitmapRenderer (m_width, m_height, resolution ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
/**
|
/**
|
||||||
* @brief Transfer the content to an QImage
|
* @brief Transfer the content to an QImage
|
||||||
*/
|
*/
|
||||||
void to_image (const std::vector <lay::ViewOp> &view_ops, const lay::DitherPattern &dp, const lay::LineStyles &ls, lay::Color background, lay::Color foreground, lay::Color active, const lay::Drawings *drawings, QImage &img, unsigned int width, unsigned int height);
|
void to_image (const std::vector <lay::ViewOp> &view_ops, const lay::DitherPattern &dp, const lay::LineStyles &ls, lay::Color background, lay::Color foreground, lay::Color active, const lay::Drawings *drawings, QImage &img, unsigned int width, unsigned int height);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the current bitmap data as a BitmapCanvasData object
|
* @brief Gets the current bitmap data as a BitmapCanvasData object
|
||||||
|
|
|
||||||
|
|
@ -194,9 +194,9 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
||||||
m_layer = li.layer_index;
|
m_layer = li.layer_index;
|
||||||
|
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Drawing layer: ")) << mp_layout->get_properties (m_layer).name;
|
tl::info << tl::to_string (tr ("Drawing layer: ")) << mp_layout->get_properties (m_layer).name;
|
||||||
}
|
}
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (QObject::tr ("Drawing layer")));
|
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Drawing layer")));
|
||||||
|
|
||||||
// configure renderer ..
|
// configure renderer ..
|
||||||
mp_renderer->set_xfill (m_xfill);
|
mp_renderer->set_xfill (m_xfill);
|
||||||
|
|
@ -220,9 +220,9 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
||||||
|
|
||||||
// if no specific layer is assigned, draw cell boxes with the style given
|
// if no specific layer is assigned, draw cell boxes with the style given
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Drawing custom frames"));
|
tl::info << tl::to_string (tr ("Drawing custom frames"));
|
||||||
}
|
}
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (QObject::tr ("Drawing frames")));
|
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Drawing frames")));
|
||||||
|
|
||||||
for (std::set< std::pair<db::DCplxTrans, int> >::const_iterator b = m_box_variants.begin (); b != m_box_variants.end (); ++b) {
|
for (std::set< std::pair<db::DCplxTrans, int> >::const_iterator b = m_box_variants.begin (); b != m_box_variants.end (); ++b) {
|
||||||
if (b->second == li.cellview_index) {
|
if (b->second == li.cellview_index) {
|
||||||
|
|
@ -245,9 +245,9 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
||||||
|
|
||||||
// draw the bounding boxes
|
// draw the bounding boxes
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Drawing frames and guiding shapes"));
|
tl::info << tl::to_string (tr ("Drawing frames and guiding shapes"));
|
||||||
}
|
}
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (QObject::tr ("Drawing frames and guiding shapes")));
|
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Drawing frames and guiding shapes")));
|
||||||
|
|
||||||
// No xfill for cell boxes
|
// No xfill for cell boxes
|
||||||
mp_renderer->set_xfill (false);
|
mp_renderer->set_xfill (false);
|
||||||
|
|
@ -416,9 +416,9 @@ RedrawThreadWorker::perform_task (tl::Task *task)
|
||||||
|
|
||||||
// draw the decorations
|
// draw the decorations
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Drawing decorations"));
|
tl::info << tl::to_string (tr ("Drawing decorations"));
|
||||||
}
|
}
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (QObject::tr ("Drawing decorations")));
|
tl::SelfTimer timer (tl::verbosity () >= 41, tl::to_string (tr ("Drawing decorations")));
|
||||||
|
|
||||||
m_buffers.clear ();
|
m_buffers.clear ();
|
||||||
mp_canvas->initialize_plane (m_planes[0], m_nlayers * planes_per_layer + special_planes_before);
|
mp_canvas->initialize_plane (m_planes[0], m_nlayers * planes_per_layer + special_planes_before);
|
||||||
|
|
@ -2172,7 +2172,7 @@ RedrawThreadWorker::iterate_variants (const std::vector <db::Box> &redraw_region
|
||||||
m_from_level = fl;
|
m_from_level = fl;
|
||||||
|
|
||||||
if (tl::verbosity () >= 40) {
|
if (tl::verbosity () >= 40) {
|
||||||
tl::info << tl::to_string (QObject::tr ("Cell variant cache hits/misses: ")) << m_cache_hits << "/" << m_cache_misses;
|
tl::info << tl::to_string (tr ("Cell variant cache hits/misses: ")) << m_cache_hits << "/" << m_cache_misses;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ int draw_round (double x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
QPoint draw_round (db::DPoint p, int h)
|
QPoint draw_round (db::DPoint p, int h)
|
||||||
{
|
{
|
||||||
return QPoint (draw_round (p.x ()), h - 1 - draw_round (p.y ()));
|
return QPoint (draw_round (p.x ()), h - 1 - draw_round (p.y ()));
|
||||||
|
|
@ -140,6 +141,7 @@ draw_round (const db::DPoint &p1, const db::DPoint &p2, int h)
|
||||||
std::pair<db::DPoint , db::DPoint> dp = draw_round_dbl (p1, p2, h);
|
std::pair<db::DPoint , db::DPoint> dp = draw_round_dbl (p1, p2, h);
|
||||||
return std::make_pair (draw_round (dp.first, h), draw_round (dp.second, h));
|
return std::make_pair (draw_round (dp.first, h), draw_round (dp.second, h));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::pair<db::DPoint, db::DPoint>
|
std::pair<db::DPoint, db::DPoint>
|
||||||
draw_round_dbl (const db::DPoint &p1, const db::DPoint &p2, int /*h*/)
|
draw_round_dbl (const db::DPoint &p1, const db::DPoint &p2, int /*h*/)
|
||||||
|
|
|
||||||
|
|
@ -205,16 +205,16 @@ StipplePalette::from_string (const std::string &s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! x.at_end ()) {
|
if (! x.at_end ()) {
|
||||||
throw tl::Exception (tl::sprintf (tl::to_string (QObject::tr ("unexpected characters: %s")), x.skip ()));
|
throw tl::Exception (tl::sprintf (tl::to_string (tr ("unexpected characters: %s")), x.skip ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stipples () == 0 || standard_stipples () == 0) {
|
if (stipples () == 0 || standard_stipples () == 0) {
|
||||||
throw tl::Exception (tl::to_string (QObject::tr ("invalid palette - no stipples and/or standard stipples")));
|
throw tl::Exception (tl::to_string (tr ("invalid palette - no stipples and/or standard stipples")));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (std::exception &ex) {
|
} catch (std::exception &ex) {
|
||||||
// reformat error message
|
// reformat error message
|
||||||
throw tl::Exception (tl::sprintf (tl::to_string (QObject::tr ("Stipple palette string format error: %s")), ex.what ()));
|
throw tl::Exception (tl::sprintf (tl::to_string (tr ("Stipple palette string format error: %s")), ex.what ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,13 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
#include <QMouseEvent>
|
# include <QMouseEvent>
|
||||||
#include <QWheelEvent>
|
# include <QWheelEvent>
|
||||||
#include <QKeyEvent>
|
# include <QKeyEvent>
|
||||||
#include <QMimeData>
|
# include <QMimeData>
|
||||||
#include <QCoreApplication>
|
# include <QCoreApplication>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "layViewObject.h"
|
#include "layViewObject.h"
|
||||||
#include "layCanvasPlane.h"
|
#include "layCanvasPlane.h"
|
||||||
|
|
@ -51,6 +52,7 @@ const char *drag_drop_mime_type ()
|
||||||
return "application/klayout-ddd";
|
return "application/klayout-ddd";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QMimeData *
|
QMimeData *
|
||||||
DragDropDataBase::to_mime_data () const
|
DragDropDataBase::to_mime_data () const
|
||||||
{
|
{
|
||||||
|
|
@ -58,10 +60,12 @@ DragDropDataBase::to_mime_data () const
|
||||||
mimeData->setData (QString::fromUtf8 (drag_drop_mime_type ()), serialized ());
|
mimeData->setData (QString::fromUtf8 (drag_drop_mime_type ()), serialized ());
|
||||||
return mimeData;
|
return mimeData;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// Implementation of CellDragDropData
|
// Implementation of CellDragDropData
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
QByteArray
|
QByteArray
|
||||||
CellDragDropData::serialized () const
|
CellDragDropData::serialized () const
|
||||||
{
|
{
|
||||||
|
|
@ -119,10 +123,12 @@ CellDragDropData::deserialize (const QByteArray &ba)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// A helper function to convert a Qt modifier/buttons to klayout buttons
|
// A helper function to convert a Qt modifier/buttons to klayout buttons
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
static unsigned int
|
static unsigned int
|
||||||
qt_to_buttons (Qt::MouseButtons b, Qt::KeyboardModifiers m)
|
qt_to_buttons (Qt::MouseButtons b, Qt::KeyboardModifiers m)
|
||||||
{
|
{
|
||||||
|
|
@ -139,6 +145,7 @@ qt_to_buttons (Qt::MouseButtons b, Qt::KeyboardModifiers m)
|
||||||
((m & Qt::ControlModifier) != 0 ? ControlButton : 0) |
|
((m & Qt::ControlModifier) != 0 ? ControlButton : 0) |
|
||||||
((m & Qt::AltModifier) != 0 ? AltButton : 0);
|
((m & Qt::AltModifier) != 0 ? AltButton : 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// BackgroundViewObject implementation
|
// BackgroundViewObject implementation
|
||||||
|
|
@ -225,7 +232,9 @@ ViewObject::redraw ()
|
||||||
if (m_static) {
|
if (m_static) {
|
||||||
widget ()->touch ();
|
widget ()->touch ();
|
||||||
} else {
|
} else {
|
||||||
widget ()->update ();
|
#if defined(HAVE_QT)
|
||||||
|
widget ()->update (); // @@@
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -280,6 +289,7 @@ ViewService::set_cursor (lay::Cursor::cursor_shape cursor)
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// ViewObject implementation
|
// ViewObject implementation
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
ViewObjectWidget::ViewObjectWidget (QWidget *parent, const char *name)
|
ViewObjectWidget::ViewObjectWidget (QWidget *parent, const char *name)
|
||||||
: QWidget (parent),
|
: QWidget (parent),
|
||||||
m_view_objects_dismissed (false),
|
m_view_objects_dismissed (false),
|
||||||
|
|
@ -299,6 +309,22 @@ ViewObjectWidget::ViewObjectWidget (QWidget *parent, const char *name)
|
||||||
|
|
||||||
m_objects.changed ().add (this, &ViewObjectWidget::objects_changed);
|
m_objects.changed ().add (this, &ViewObjectWidget::objects_changed);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ViewObjectWidget::ViewObjectWidget ()
|
||||||
|
: m_view_objects_dismissed (false),
|
||||||
|
m_needs_update_static (false),
|
||||||
|
m_needs_update_bg (false),
|
||||||
|
mp_active_service (0),
|
||||||
|
m_mouse_pressed_state (false),
|
||||||
|
m_mouse_buttons (0),
|
||||||
|
m_in_mouse_move (false),
|
||||||
|
m_mouse_inside (false),
|
||||||
|
m_cursor (lay::Cursor::none),
|
||||||
|
m_default_cursor (lay::Cursor::none)
|
||||||
|
{
|
||||||
|
m_objects.changed ().add (this, &ViewObjectWidget::objects_changed);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ViewObjectWidget::~ViewObjectWidget ()
|
ViewObjectWidget::~ViewObjectWidget ()
|
||||||
{
|
{
|
||||||
|
|
@ -369,6 +395,7 @@ ViewObjectWidget::set_cursor (lay::Cursor::cursor_shape cursor)
|
||||||
void
|
void
|
||||||
ViewObjectWidget::set_default_cursor (lay::Cursor::cursor_shape cursor)
|
ViewObjectWidget::set_default_cursor (lay::Cursor::cursor_shape cursor)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (cursor != m_default_cursor) {
|
if (cursor != m_default_cursor) {
|
||||||
m_default_cursor = cursor;
|
m_default_cursor = cursor;
|
||||||
if (m_cursor == lay::Cursor::none) {
|
if (m_cursor == lay::Cursor::none) {
|
||||||
|
|
@ -379,14 +406,17 @@ ViewObjectWidget::set_default_cursor (lay::Cursor::cursor_shape cursor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewObjectWidget::ensure_entered ()
|
ViewObjectWidget::ensure_entered ()
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (! m_mouse_inside) {
|
if (! m_mouse_inside) {
|
||||||
enterEvent (0);
|
enterEvent (0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -398,6 +428,7 @@ ViewObjectWidget::begin_mouse_event (lay::Cursor::cursor_shape cursor)
|
||||||
void
|
void
|
||||||
ViewObjectWidget::end_mouse_event ()
|
ViewObjectWidget::end_mouse_event ()
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
if (m_cursor == lay::Cursor::none) {
|
if (m_cursor == lay::Cursor::none) {
|
||||||
if (m_default_cursor == lay::Cursor::none) {
|
if (m_default_cursor == lay::Cursor::none) {
|
||||||
unsetCursor ();
|
unsetCursor ();
|
||||||
|
|
@ -407,8 +438,10 @@ ViewObjectWidget::end_mouse_event ()
|
||||||
} else if (m_cursor != lay::Cursor::keep) {
|
} else if (m_cursor != lay::Cursor::keep) {
|
||||||
setCursor (lay::Cursor::qcursor (m_cursor));
|
setCursor (lay::Cursor::qcursor (m_cursor));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
bool
|
bool
|
||||||
ViewObjectWidget::focusNextPrevChild (bool /*next*/)
|
ViewObjectWidget::focusNextPrevChild (bool /*next*/)
|
||||||
{
|
{
|
||||||
|
|
@ -555,6 +588,7 @@ BEGIN_PROTECTED
|
||||||
do_mouse_move ();
|
do_mouse_move ();
|
||||||
END_PROTECTED
|
END_PROTECTED
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewObjectWidget::do_mouse_move ()
|
ViewObjectWidget::do_mouse_move ()
|
||||||
|
|
@ -637,7 +671,8 @@ ViewObjectWidget::do_mouse_move ()
|
||||||
m_in_mouse_move = false;
|
m_in_mouse_move = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
#if defined(HAVE_QT) // @@@
|
||||||
|
void
|
||||||
ViewObjectWidget::mouseDoubleClickEvent (QMouseEvent *e)
|
ViewObjectWidget::mouseDoubleClickEvent (QMouseEvent *e)
|
||||||
{
|
{
|
||||||
BEGIN_PROTECTED
|
BEGIN_PROTECTED
|
||||||
|
|
@ -883,17 +918,38 @@ END_PROTECTED
|
||||||
|
|
||||||
m_mouse_pressed_state = false;
|
m_mouse_pressed_state = false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
db::DPoint
|
int
|
||||||
ViewObjectWidget::pixel_to_um (const QPoint &pt) const
|
ViewObjectWidget::widget_height () const
|
||||||
{
|
{
|
||||||
return m_trans.inverted () * db::DPoint (pt.x (), height () - 1 - pt.y ());
|
#if defined(HAVE_QT)
|
||||||
|
return height ();
|
||||||
|
#else
|
||||||
|
return 500; // @@@
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ViewObjectWidget::widget_width () const
|
||||||
|
{
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
return width ();
|
||||||
|
#else
|
||||||
|
return 800; // @@@
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
db::DPoint
|
db::DPoint
|
||||||
ViewObjectWidget::pixel_to_um (const QPointF &pt) const
|
ViewObjectWidget::pixel_to_um (const db::Point &pt) const
|
||||||
{
|
{
|
||||||
return m_trans.inverted () * db::DPoint (pt.x (), height () - 1 - pt.y ());
|
return m_trans.inverted () * db::DPoint (pt.x (), widget_height () - 1 - pt.y ());
|
||||||
|
}
|
||||||
|
|
||||||
|
db::DPoint
|
||||||
|
ViewObjectWidget::pixel_to_um (const db::DPoint &pt) const
|
||||||
|
{
|
||||||
|
return m_trans.inverted () * db::DPoint (pt.x (), widget_height () - 1 - pt.y ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1018,6 +1074,14 @@ ViewObjectWidget::thaw (ViewObject *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(HAVE_QT)
|
||||||
|
void
|
||||||
|
ViewObjectWidget::update ()
|
||||||
|
{
|
||||||
|
// @@@
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewObjectWidget::touch ()
|
ViewObjectWidget::touch ()
|
||||||
{
|
{
|
||||||
|
|
@ -1057,7 +1121,7 @@ db::DBox
|
||||||
ViewObjectWidget::mouse_event_viewport () const
|
ViewObjectWidget::mouse_event_viewport () const
|
||||||
{
|
{
|
||||||
db::DPoint p1 = m_trans.inverted () * db::DPoint (0, 0);
|
db::DPoint p1 = m_trans.inverted () * db::DPoint (0, 0);
|
||||||
db::DPoint p2 = m_trans.inverted () * db::DPoint (width (), height ());
|
db::DPoint p2 = m_trans.inverted () * db::DPoint (widget_width (), widget_height ());
|
||||||
return db::DBox (p1, p2);
|
return db::DBox (p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,12 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <QPoint>
|
#if defined(HAVE_QT)
|
||||||
#include <QByteArray>
|
# include <QPoint>
|
||||||
#include <QColor>
|
# include <QByteArray>
|
||||||
#include <QWidget>
|
# include <QColor>
|
||||||
|
# include <QWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "tlObjectCollection.h"
|
#include "tlObjectCollection.h"
|
||||||
#include "tlVariant.h"
|
#include "tlVariant.h"
|
||||||
|
|
@ -45,6 +47,7 @@
|
||||||
#include "layCursor.h"
|
#include "layCursor.h"
|
||||||
#include "layBitmapRenderer.h"
|
#include "layBitmapRenderer.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
class QMouseEvent;
|
class QMouseEvent;
|
||||||
class QImage;
|
class QImage;
|
||||||
class QDragEnterEvent;
|
class QDragEnterEvent;
|
||||||
|
|
@ -52,6 +55,7 @@ class QDragMoveEvent;
|
||||||
class QDragLeaveEvent;
|
class QDragLeaveEvent;
|
||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
class QMimeData;
|
class QMimeData;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace db
|
namespace db
|
||||||
{
|
{
|
||||||
|
|
@ -89,6 +93,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual ~DragDropDataBase () { }
|
virtual ~DragDropDataBase () { }
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
/**
|
/**
|
||||||
* @brief Serializes itself to an QByteArray
|
* @brief Serializes itself to an QByteArray
|
||||||
*/
|
*/
|
||||||
|
|
@ -105,6 +110,7 @@ public:
|
||||||
* @brief Create a QMimeData object from the object
|
* @brief Create a QMimeData object from the object
|
||||||
*/
|
*/
|
||||||
QMimeData *to_mime_data () const;
|
QMimeData *to_mime_data () const;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -176,6 +182,7 @@ public:
|
||||||
return m_is_pcell;
|
return m_is_pcell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
/**
|
/**
|
||||||
* @brief Serializes itself to an QByteArray
|
* @brief Serializes itself to an QByteArray
|
||||||
*/
|
*/
|
||||||
|
|
@ -187,6 +194,7 @@ public:
|
||||||
* Returns false, if deserialization failed.
|
* Returns false, if deserialization failed.
|
||||||
*/
|
*/
|
||||||
bool deserialize (const QByteArray &ba);
|
bool deserialize (const QByteArray &ba);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const db::Layout *mp_layout;
|
const db::Layout *mp_layout;
|
||||||
|
|
@ -644,8 +652,10 @@ enum ButtonState {
|
||||||
* painting.
|
* painting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LAYBASIC_PUBLIC ViewObjectWidget
|
class LAYBASIC_PUBLIC ViewObjectWidget :
|
||||||
: public QWidget,
|
#if defined(HAVE_QT)
|
||||||
|
public QWidget,
|
||||||
|
#endif
|
||||||
public tl::Object
|
public tl::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -657,7 +667,11 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief ctor
|
* @brief ctor
|
||||||
*/
|
*/
|
||||||
|
#if defined(HAVE_QT)
|
||||||
ViewObjectWidget (QWidget *view, const char *name);
|
ViewObjectWidget (QWidget *view, const char *name);
|
||||||
|
#else
|
||||||
|
ViewObjectWidget ();
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief dtor
|
* @brief dtor
|
||||||
|
|
@ -984,7 +998,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Gets the current mouse position
|
* @brief Gets the current mouse position
|
||||||
*/
|
*/
|
||||||
QPoint mouse_position () const
|
db::Point mouse_position () const
|
||||||
{
|
{
|
||||||
return m_mouse_pos;
|
return m_mouse_pos;
|
||||||
}
|
}
|
||||||
|
|
@ -1000,12 +1014,12 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Translates a screen coordinate in micrometer coordinates
|
* @brief Translates a screen coordinate in micrometer coordinates
|
||||||
*/
|
*/
|
||||||
db::DPoint pixel_to_um (const QPoint &pt) const;
|
db::DPoint pixel_to_um (const db::Point &pt) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Translates a screen coordinate in micrometer coordinates
|
* @brief Translates a screen coordinate in micrometer coordinates
|
||||||
*/
|
*/
|
||||||
db::DPoint pixel_to_um (const QPointF &pt) const;
|
db::DPoint pixel_to_um (const db::DPoint &pt) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets a flag indicating whether the mouse is inside the window
|
* @brief Gets a flag indicating whether the mouse is inside the window
|
||||||
|
|
@ -1016,6 +1030,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#if defined(HAVE_QT)
|
||||||
/**
|
/**
|
||||||
* @brief Qt focus event handler
|
* @brief Qt focus event handler
|
||||||
*/
|
*/
|
||||||
|
|
@ -1084,6 +1099,11 @@ protected:
|
||||||
* @brief Qt mouse wheel event handler
|
* @brief Qt mouse wheel event handler
|
||||||
*/
|
*/
|
||||||
void wheelEvent (QWheelEvent *e);
|
void wheelEvent (QWheelEvent *e);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_QT)
|
||||||
|
void update ();
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the transformation for mouse events
|
* @brief Set the transformation for mouse events
|
||||||
|
|
@ -1104,8 +1124,8 @@ private:
|
||||||
bool m_needs_update_bg;
|
bool m_needs_update_bg;
|
||||||
lay::ViewService *mp_active_service;
|
lay::ViewService *mp_active_service;
|
||||||
db::DCplxTrans m_trans;
|
db::DCplxTrans m_trans;
|
||||||
QPoint m_mouse_pos;
|
db::Point m_mouse_pos;
|
||||||
QPoint m_mouse_pressed;
|
db::Point m_mouse_pressed;
|
||||||
bool m_mouse_pressed_state;
|
bool m_mouse_pressed_state;
|
||||||
unsigned int m_mouse_buttons;
|
unsigned int m_mouse_buttons;
|
||||||
bool m_in_mouse_move;
|
bool m_in_mouse_move;
|
||||||
|
|
@ -1117,6 +1137,8 @@ private:
|
||||||
void begin_mouse_event (lay::Cursor::cursor_shape cursor = lay::Cursor::keep);
|
void begin_mouse_event (lay::Cursor::cursor_shape cursor = lay::Cursor::keep);
|
||||||
void end_mouse_event ();
|
void end_mouse_event ();
|
||||||
void objects_changed ();
|
void objects_changed ();
|
||||||
|
int widget_height () const;
|
||||||
|
int widget_width () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register a service
|
* @brief Register a service
|
||||||
|
|
@ -1328,10 +1350,12 @@ public:
|
||||||
*/
|
*/
|
||||||
void clear_fg_bitmaps ();
|
void clear_fg_bitmaps ();
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
/**
|
/**
|
||||||
* @brief Return the background image
|
* @brief Return the background image
|
||||||
*/
|
*/
|
||||||
virtual QImage &bg_image () = 0;
|
virtual QImage &bg_image () = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the width and height and resolution
|
* @brief Set the width and height and resolution
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
gtf.cc \
|
gtf.cc \
|
||||||
layAbstractMenu.cc \
|
layAbstractMenu.cc \
|
||||||
layBackgroundAwareTreeStyle.cc \
|
layBackgroundAwareTreeStyle.cc \
|
||||||
layBitmapRenderer.cc \
|
|
||||||
layBitmapsToImage.cc \
|
layBitmapsToImage.cc \
|
||||||
layBookmarkList.cc \
|
layBookmarkList.cc \
|
||||||
layBookmarkManagementForm.cc \
|
layBookmarkManagementForm.cc \
|
||||||
|
|
@ -121,7 +120,6 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
layEditorServiceBase.cc \
|
layEditorServiceBase.cc \
|
||||||
layFileDialog.cc \
|
layFileDialog.cc \
|
||||||
layGenericSyntaxHighlighter.cc \
|
layGenericSyntaxHighlighter.cc \
|
||||||
layGridNet.cc \
|
|
||||||
layHierarchyControlPanel.cc \
|
layHierarchyControlPanel.cc \
|
||||||
layIndexedNetlistModel.cc \
|
layIndexedNetlistModel.cc \
|
||||||
layItemDelegates.cc \
|
layItemDelegates.cc \
|
||||||
|
|
@ -129,10 +127,8 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
layLayerMappingWidget.cc \
|
layLayerMappingWidget.cc \
|
||||||
layLayerToolbox.cc \
|
layLayerToolbox.cc \
|
||||||
layLayerTreeModel.cc \
|
layLayerTreeModel.cc \
|
||||||
layLayoutCanvas.cc \
|
|
||||||
layLayoutPropertiesForm.cc \
|
layLayoutPropertiesForm.cc \
|
||||||
layLayoutStatisticsForm.cc \
|
layLayoutStatisticsForm.cc \
|
||||||
layLayoutView.cc \
|
|
||||||
layLayoutViewConfigPages.cc \
|
layLayoutViewConfigPages.cc \
|
||||||
layLayoutViewFunctions.cc \
|
layLayoutViewFunctions.cc \
|
||||||
layLibrariesView.cc \
|
layLibrariesView.cc \
|
||||||
|
|
@ -154,6 +150,7 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
laySelectLineStyleForm.cc \
|
laySelectLineStyleForm.cc \
|
||||||
laySelectStippleForm.cc \
|
laySelectStippleForm.cc \
|
||||||
laySelector.cc \
|
laySelector.cc \
|
||||||
|
layStream.cc \
|
||||||
layTechnology.cc \
|
layTechnology.cc \
|
||||||
layTipDialog.cc \
|
layTipDialog.cc \
|
||||||
layWidgets.cc \
|
layWidgets.cc \
|
||||||
|
|
@ -168,7 +165,6 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
layAbstractMenu.h \
|
layAbstractMenu.h \
|
||||||
layBackgroundAwareTreeStyle.h \
|
layBackgroundAwareTreeStyle.h \
|
||||||
layBitmap.h \
|
layBitmap.h \
|
||||||
layBitmapRenderer.h \
|
|
||||||
layBitmapsToImage.h \
|
layBitmapsToImage.h \
|
||||||
layBookmarkList.h \
|
layBookmarkList.h \
|
||||||
layBookmarkManagementForm.h \
|
layBookmarkManagementForm.h \
|
||||||
|
|
@ -197,7 +193,6 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
layEditorServiceBase.h \
|
layEditorServiceBase.h \
|
||||||
layFileDialog.h \
|
layFileDialog.h \
|
||||||
layGenericSyntaxHighlighter.h \
|
layGenericSyntaxHighlighter.h \
|
||||||
layGridNet.h \
|
|
||||||
layHierarchyControlPanel.h \
|
layHierarchyControlPanel.h \
|
||||||
layIndexedNetlistModel.h \
|
layIndexedNetlistModel.h \
|
||||||
layItemDelegates.h \
|
layItemDelegates.h \
|
||||||
|
|
@ -205,10 +200,8 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
layLayerMappingWidget.h \
|
layLayerMappingWidget.h \
|
||||||
layLayerToolbox.h \
|
layLayerToolbox.h \
|
||||||
layLayerTreeModel.h \
|
layLayerTreeModel.h \
|
||||||
layLayoutCanvas.h \
|
|
||||||
layLayoutPropertiesForm.h \
|
layLayoutPropertiesForm.h \
|
||||||
layLayoutStatisticsForm.h \
|
layLayoutStatisticsForm.h \
|
||||||
layLayoutView.h \
|
|
||||||
layLayoutViewConfigPages.h \
|
layLayoutViewConfigPages.h \
|
||||||
layLayoutViewFunctions.h \
|
layLayoutViewFunctions.h \
|
||||||
layLibrariesView.h \
|
layLibrariesView.h \
|
||||||
|
|
@ -230,6 +223,7 @@ DEFINES += MAKE_LAYBASIC_LIBRARY
|
||||||
laySelectLineStyleForm.h \
|
laySelectLineStyleForm.h \
|
||||||
laySelectStippleForm.h \
|
laySelectStippleForm.h \
|
||||||
laySelector.h \
|
laySelector.h \
|
||||||
|
layStream.h \
|
||||||
layTechnology.h \
|
layTechnology.h \
|
||||||
layTipDialog.h \
|
layTipDialog.h \
|
||||||
layWidgets.h \
|
layWidgets.h \
|
||||||
|
|
@ -246,6 +240,7 @@ SOURCES += \
|
||||||
gsiDeclLayLayers.cc \
|
gsiDeclLayLayers.cc \
|
||||||
layAnnotationShapes.cc \
|
layAnnotationShapes.cc \
|
||||||
layBitmap.cc \
|
layBitmap.cc \
|
||||||
|
layBitmapRenderer.cc \
|
||||||
layColor.cc \
|
layColor.cc \
|
||||||
layColorPalette.cc \
|
layColorPalette.cc \
|
||||||
layDispatcher.cc \
|
layDispatcher.cc \
|
||||||
|
|
@ -254,12 +249,16 @@ SOURCES += \
|
||||||
layDrawing.cc \
|
layDrawing.cc \
|
||||||
layEditable.cc \
|
layEditable.cc \
|
||||||
layFinder.cc \
|
layFinder.cc \
|
||||||
|
layGridNet.cc \
|
||||||
layFixedFont.cc \
|
layFixedFont.cc \
|
||||||
|
layLayoutCanvas.cc \
|
||||||
|
layLayoutView.cc \
|
||||||
layLineStylePalette.cc \
|
layLineStylePalette.cc \
|
||||||
layLineStyles.cc \
|
layLineStyles.cc \
|
||||||
layMarker.cc \
|
layMarker.cc \
|
||||||
layMouseTracker.cc \
|
layMouseTracker.cc \
|
||||||
layMove.cc \
|
layMove.cc \
|
||||||
|
layNetColorizer.cc \
|
||||||
layObjectInstPath.cc \
|
layObjectInstPath.cc \
|
||||||
layParsedLayerSource.cc \
|
layParsedLayerSource.cc \
|
||||||
layPlugin.cc \
|
layPlugin.cc \
|
||||||
|
|
@ -271,7 +270,6 @@ SOURCES += \
|
||||||
layRubberBox.cc \
|
layRubberBox.cc \
|
||||||
laySnap.cc \
|
laySnap.cc \
|
||||||
layStipplePalette.cc \
|
layStipplePalette.cc \
|
||||||
layStream.cc \
|
|
||||||
layCanvasPlane.cc \
|
layCanvasPlane.cc \
|
||||||
layLayoutViewBase.cc \
|
layLayoutViewBase.cc \
|
||||||
layLayerProperties.cc \
|
layLayerProperties.cc \
|
||||||
|
|
@ -282,20 +280,25 @@ SOURCES += \
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
layAnnotationShapes.h \
|
layAnnotationShapes.h \
|
||||||
layBitmap.h \
|
layBitmap.h \
|
||||||
|
layBitmapRenderer.h \
|
||||||
layColorPalette.h \
|
layColorPalette.h \
|
||||||
layDispatcher.h \
|
layDispatcher.h \
|
||||||
layDisplayState.h \
|
layDisplayState.h \
|
||||||
layDitherPattern.h \
|
layDitherPattern.h \
|
||||||
layDrawing.h \
|
layDrawing.h \
|
||||||
layEditable.h \
|
layEditable.h \
|
||||||
|
layLayoutCanvas.h \
|
||||||
|
layLayoutView.h \
|
||||||
layFinder.h \
|
layFinder.h \
|
||||||
layFixedFont.h \
|
layFixedFont.h \
|
||||||
|
layGridNet.h \
|
||||||
layLayoutViewBase.h \
|
layLayoutViewBase.h \
|
||||||
layLineStylePalette.h \
|
layLineStylePalette.h \
|
||||||
layLineStyles.h \
|
layLineStyles.h \
|
||||||
layMarker.h \
|
layMarker.h \
|
||||||
layMouseTracker.h \
|
layMouseTracker.h \
|
||||||
layMove.h \
|
layMove.h \
|
||||||
|
layNetColorizer.h \
|
||||||
layObjectInstPath.h \
|
layObjectInstPath.h \
|
||||||
layParsedLayerSource.h \
|
layParsedLayerSource.h \
|
||||||
layPlugin.h \
|
layPlugin.h \
|
||||||
|
|
@ -307,7 +310,6 @@ HEADERS += \
|
||||||
layRubberBox.h \
|
layRubberBox.h \
|
||||||
laySnap.h \
|
laySnap.h \
|
||||||
layStipplePalette.h \
|
layStipplePalette.h \
|
||||||
layStream.h \
|
|
||||||
layLayerProperties.h \
|
layLayerProperties.h \
|
||||||
layCanvasPlane.h \
|
layCanvasPlane.h \
|
||||||
layViewObject.h \
|
layViewObject.h \
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
|
||||||
#include "layAbstractMenu.h"
|
#include "layAbstractMenu.h"
|
||||||
|
|
||||||
#include "tlUnitTest.h"
|
#include "tlUnitTest.h"
|
||||||
|
|
@ -184,3 +186,4 @@ TEST(3_ActionReferences)
|
||||||
EXPECT_EQ (action.get () == 0, true);
|
EXPECT_EQ (action.get () == 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
#include "layBitmapsToImage.h"
|
#include "layBitmapsToImage.h"
|
||||||
#include "layBitmap.h"
|
#include "layBitmap.h"
|
||||||
#include "layDitherPattern.h"
|
#include "layDitherPattern.h"
|
||||||
|
|
@ -940,3 +940,4 @@ TEST(1)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(HAVE_QT) // @@@
|
||||||
|
|
||||||
#include "layNetlistBrowserTreeModel.h"
|
#include "layNetlistBrowserTreeModel.h"
|
||||||
#include "tlUnitTest.h"
|
#include "tlUnitTest.h"
|
||||||
|
|
||||||
|
|
@ -103,3 +105,5 @@ TEST (2)
|
||||||
EXPECT_EQ (model->parent (model->index (1, 0, inv2PairIndex)).isValid (), true);
|
EXPECT_EQ (model->parent (model->index (1, 0, inv2PairIndex)).isValid (), true);
|
||||||
EXPECT_EQ (model->parent (model->index (1, 0, inv2PairIndex)).internalId () == inv2PairIndex.internalId (), true);
|
EXPECT_EQ (model->parent (model->index (1, 0, inv2PairIndex)).internalId () == inv2PairIndex.internalId (), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue