WIP: avoids a segfault because of missing manager

This commit is contained in:
Matthias Koefferlein 2020-02-04 20:50:46 +01:00
parent f6a6acd20e
commit 0f69c24e79
39 changed files with 286 additions and 273 deletions

View File

@ -33,10 +33,11 @@
namespace db
{
Manager::Manager ()
Manager::Manager (bool enabled)
: m_transactions (),
m_current (m_transactions.begin ()),
m_opened (false), m_replay (false)
m_opened (false), m_replay (false),
m_enabled (enabled)
{
// .. nothing yet ..
}
@ -110,7 +111,7 @@ Manager::erase_transactions (transactions_t::iterator from, transactions_t::iter
Manager::transaction_id_t
Manager::transaction (const std::string &description, transaction_id_t join_with)
{
if (db::transactions_enabled ()) {
if (m_enabled) {
// close transactions that are still open (was an assertion before)
if (m_opened) {
@ -146,7 +147,7 @@ Manager::last_transaction_id () const
void
Manager::cancel ()
{
if (db::transactions_enabled ()) {
if (m_enabled) {
// commit and undo - revert changes done so far
commit ();
@ -162,7 +163,7 @@ Manager::cancel ()
void
Manager::commit ()
{
if (db::transactions_enabled ()) {
if (m_enabled) {
tl_assert (m_opened);
tl_assert (! m_replay);

View File

@ -85,13 +85,21 @@ public:
/**
* @brief Default constructor
*/
Manager ();
Manager (bool enabled = true);
/**
* @brief Destructor
*/
~Manager ();
/**
* @brief Gets a value indicating whether the manager is enabled
*/
bool is_enabled () const
{
return m_enabled;
}
/**
* @brief Release an object with the given id.
*
@ -255,6 +263,7 @@ private:
transactions_t::iterator m_current;
bool m_opened;
bool m_replay;
bool m_enabled;
void erase_transactions (transactions_t::iterator from, transactions_t::iterator to);
};

View File

@ -130,6 +130,26 @@ public:
return manager () && manager ()->replaying ();
}
/**
* @brief Begins a transaction (same as calling manager ()->transaction (), but safe against null manager ())
*/
void transaction (const std::string &description, db::Manager::transaction_id_t join_with = 0)
{
if (manager ()) {
manager ()->transaction (description, join_with);
}
}
/**
* @brief Ends a transaction (same as calling manager ()->commit (), but safe against null manager ())
*/
void commit ()
{
if (manager ()) {
manager ()->commit ();
}
}
private:
db::Manager::ident_t m_id;
db::Manager *mp_manager;

View File

@ -70,25 +70,6 @@ inline unsigned int num_circle_points ()
*/
void DB_PUBLIC set_num_circle_points (unsigned int n);
// -----------------------------------------------------------
// transaction enable
/**
* @brief Return true, if undo buffering is enabled
*/
inline bool transactions_enabled ()
{
extern DB_PUBLIC bool ms_transactions_enabled;
return ms_transactions_enabled;
}
/**
* @brief Enable or disable transaction buffering
*
* @param enabled True to enable undo buffering
*/
void DB_PUBLIC enable_transactions (bool enable);
}
#endif

View File

@ -28,7 +28,7 @@
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c1 (g.cell (g.add_cell ()));
db::Cell &c2 (g.cell (g.add_cell ()));
@ -265,7 +265,7 @@ TEST(2)
{
::pi = 0;
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -615,7 +615,7 @@ TEST(3)
{
::pi = 0;
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -672,7 +672,7 @@ TEST(3a)
{
::pi = 0;
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -728,7 +728,7 @@ TEST(3b)
{
::pi = 0;
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -805,7 +805,7 @@ TEST(4)
{
::pi = 0;
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -842,7 +842,7 @@ TEST(4)
TEST(5)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));
@ -888,7 +888,7 @@ TEST(5)
TEST(6)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));

View File

@ -29,7 +29,7 @@
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
db::Cell &c0 (g.cell (g.add_cell ()));
db::Cell &c1 (g.cell (g.add_cell ()));

View File

@ -61,7 +61,7 @@ static bool check_hull (const std::vector<db::Polygon> &hull, const db::Shapes &
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
unsigned int l1 = g.insert_layer (db::LayerProperties (1, 0));
unsigned int l2 = g.insert_layer (db::LayerProperties (2, 0));
@ -238,7 +238,7 @@ TEST(1)
TEST(2)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
unsigned int l1 = g.insert_layer (db::LayerProperties (1, 0));
db::Cell &c1 (g.cell (g.add_cell ()));

View File

@ -417,7 +417,7 @@ TEST(3special)
void run_test_size (tl::TestBase *_this, const char *file, const char *au_file, int mode, db::Coord dx, db::Coord dy, bool min_coherence = true, bool flat = true)
{
db::Manager m;
db::Manager m (true);
db::Layout layout_org (&m);
db::Layout layout_au (&m);

View File

@ -308,7 +308,7 @@ TEST(1)
EXPECT_EQ (lib->layout ().get_properties(1).to_string (), "16/0");
EXPECT_EQ (lib->layout ().get_properties(2).to_string (), "24/0");
db::Manager m;
db::Manager m (true);
db::Layout layout(&m);
layout.dbu (0.001);
@ -460,7 +460,7 @@ TEST(2)
bool equal;
db::Writer writer = db::Writer (db::SaveLayoutOptions ());
db::Manager m;
db::Manager m (true);
db::Layout layout(&m);
layout.dbu (0.001);
@ -571,7 +571,7 @@ TEST(3)
// This test tests the ability to reference libraries out of other libraries ("B" references "A"),
// the ability to persist that and whether this survives a write/read cycle.
db::Manager m;
db::Manager m (true);
db::Layout layout(&m);
layout.dbu (0.001);

View File

@ -69,7 +69,7 @@ struct A : public db::Object
TEST(1)
{
db::Manager *man = new db::Manager ();
db::Manager *man = new db::Manager (true);
{
EXPECT_EQ (man->available_undo ().first, false);
EXPECT_EQ (man->available_redo ().first, false);
@ -176,7 +176,7 @@ struct B : public db::Object
TEST(2)
{
db::Manager *man = new db::Manager ();
db::Manager *man = new db::Manager (true);
{
EXPECT_EQ (man->available_undo ().first, false);
EXPECT_EQ (man->available_redo ().first, false);
@ -234,7 +234,7 @@ TEST(2)
TEST(3)
{
db::Manager *man = new db::Manager ();
db::Manager *man = new db::Manager (true);
{
EXPECT_EQ (man->available_undo ().first, false);
EXPECT_EQ (man->available_redo ().first, false);
@ -268,7 +268,7 @@ TEST(3)
TEST(4)
{
db::Manager *man = new db::Manager ();
db::Manager *man = new db::Manager (true);
{
EXPECT_EQ (man->available_undo ().first, false);
EXPECT_EQ (man->available_redo ().first, false);

View File

@ -92,7 +92,7 @@ class PD
TEST(0)
{
db::Manager m;
db::Manager m (true);
db::Layout layout(&m);
layout.dbu (0.001);
db::Layout layout_au(&m);
@ -114,7 +114,7 @@ TEST(0)
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Layout layout(&m);
layout.dbu (0.001);

View File

@ -65,7 +65,7 @@ std::string collect_with_copy(db::RecursiveShapeIterator s, const db::Layout &la
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer (0);
g.insert_layer (1);
@ -326,7 +326,7 @@ TEST(1)
TEST(1a)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer (0);
g.insert_layer (1);
@ -472,7 +472,7 @@ TEST(1a)
TEST(1b)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer (0);
db::Cell &c0 (g.cell (g.add_cell ()));
@ -508,7 +508,7 @@ TEST(1b)
TEST(2)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer(0);
@ -562,7 +562,7 @@ TEST(2)
TEST(3)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer(0);
@ -742,7 +742,7 @@ TEST(4)
{
// Big fun
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer(0);
@ -827,7 +827,7 @@ TEST(5)
{
// Big fun with cells
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer(0);
@ -1013,7 +1013,7 @@ private:
// Push mode with cells
TEST(10)
{
db::Manager m;
db::Manager m (true);
db::Layout g (&m);
g.insert_layer(0);

View File

@ -32,7 +32,7 @@
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -129,7 +129,7 @@ TEST(1)
TEST(2)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -209,7 +209,7 @@ TEST(2)
TEST(3)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -272,7 +272,7 @@ TEST(3)
TEST(1BOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -342,7 +342,7 @@ TEST(1BOX)
TEST(2BOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -400,7 +400,7 @@ TEST(2BOX)
TEST(3BOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -463,7 +463,7 @@ TEST(3BOX)
TEST(1SBOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -533,7 +533,7 @@ TEST(1SBOX)
TEST(2SBOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -591,7 +591,7 @@ TEST(2SBOX)
TEST(3SBOX)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Polygon p1;
@ -654,7 +654,7 @@ TEST(3SBOX)
TEST(4)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box bx1 (db::Point (0, 0), db::Point (1000, 100));
@ -684,7 +684,7 @@ TEST(4)
TEST(5)
{
if (db::default_editable_mode ()) { return; } // currently Boxes are treated as ones with properties
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box bx1 (db::Point (0, 0), db::Point (1000, 100));
@ -720,7 +720,7 @@ TEST(5)
TEST(6)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box bx1 (db::Point (0, 0), db::Point (1000, 100));
@ -745,7 +745,7 @@ TEST(6)
TEST(7)
{
if (db::default_editable_mode ()) { return; } // currently Boxes are treated as ones with properties
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box bx2 (db::Point (0, 1000), db::Point (100, 2000));
@ -766,7 +766,7 @@ TEST(7)
TEST(8)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::PropertiesRepository proprep;

View File

@ -256,7 +256,7 @@ TEST(2SIMPLE)
TEST(3)
{
db::GenericRepository *rep = new db::GenericRepository ();
db::Manager m;
db::Manager m (true);
std::vector <db::Point> c1;
c1.push_back (db::Point (100, 0));

View File

@ -30,7 +30,7 @@
TEST(1)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box b_empty;
@ -60,7 +60,7 @@ TEST(1)
TEST(1a)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, true);
db::Box b_empty;
@ -88,7 +88,7 @@ TEST(1a)
TEST(1b)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, false);
db::Box b_empty;
@ -393,7 +393,7 @@ struct plus1
TEST(2)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -644,7 +644,7 @@ TEST(2)
TEST(2A)
{
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -737,7 +737,7 @@ TEST(2A)
TEST(3)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -988,7 +988,7 @@ TEST(3)
TEST(4)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -1238,7 +1238,7 @@ TEST(4)
TEST(5)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -1489,7 +1489,7 @@ TEST(5)
TEST(6)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -1711,7 +1711,7 @@ TEST(6)
TEST(7)
{
db::Manager m;
db::Manager m (true);
db::Layout other_layout (&m);
db::Cell &other_topcell = other_layout.cell (other_layout.add_cell ());
@ -2017,7 +2017,7 @@ TEST(10A)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -2076,7 +2076,7 @@ TEST(10C)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -2101,7 +2101,7 @@ TEST(10D)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -2126,7 +2126,7 @@ TEST(11A)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x20);
@ -2182,7 +2182,7 @@ TEST(11C)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x20);
@ -2207,7 +2207,7 @@ TEST(11D)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x20);
@ -2232,7 +2232,7 @@ TEST(11E)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
m.transaction ("y");
unsigned int lindex = read_testdata (layout, 0x20);
@ -2268,7 +2268,7 @@ TEST(11F)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
m.transaction ("y");
unsigned int lindex = read_testdata (layout, 0x20);
@ -2369,7 +2369,7 @@ TEST(12A)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x20 | 0x80); // short box, no arrays
@ -2414,7 +2414,7 @@ TEST(12B)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x20 | 0x80); // short box, no arrays
@ -2442,7 +2442,7 @@ TEST(12C)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x10 | 0x80); // box, no arrays
@ -2487,7 +2487,7 @@ TEST(12D)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x10 | 0x80); // box, no arrays
@ -2515,7 +2515,7 @@ TEST(12E)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x01 | 0x80); // simple polygon, no arrays
@ -2577,7 +2577,7 @@ TEST(12F)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x01 | 0x80); // simple polygon, no arrays
@ -2614,7 +2614,7 @@ TEST(12G)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x02 | 0x80); // polygon, no arrays
@ -2676,7 +2676,7 @@ TEST(12H)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x02 | 0x80); // polygon, no arrays
@ -2713,7 +2713,7 @@ TEST(12I)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x04 | 0x80); // path, no arrays
@ -2773,7 +2773,7 @@ TEST(12J)
{
if (db::default_editable_mode ()) {
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x08 | 0x80); // text, no arrays
@ -2831,7 +2831,7 @@ TEST(12J)
TEST(13)
{
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x3f); // all with arrays
@ -2859,7 +2859,7 @@ TEST(13)
TEST(14)
{
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x10); // boxes
@ -2947,7 +2947,7 @@ TEST(14)
TEST(15)
{
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -3058,7 +3058,7 @@ TEST(15)
TEST(16)
{
db::Manager m;
db::Manager m (true);
db::Layout layout (&m);
unsigned int lindex = read_testdata (layout, 0x1);
@ -3276,7 +3276,7 @@ TEST(22)
// Edge pairs
TEST(23)
{
db::Manager m;
db::Manager m (true);
db::Shapes s (&m, 0, db::default_editable_mode ());
db::Box b_empty;
@ -3312,7 +3312,7 @@ TEST(23)
// Bug #107
TEST(100)
{
db::Manager m;
db::Manager m (true);
db::Shapes shapes1 (&m, 0, true);
m.transaction ("y");

View File

@ -731,7 +731,6 @@ ApplicationBase::init_app ()
}
db::set_default_editable_mode (m_editable);
db::enable_transactions (m_enable_undo);
if (! m_gtf_record.empty ()) {
// since the recorder tracks QAction connections etc., it must be instantiated before every other
@ -1485,7 +1484,7 @@ GuiApplication::setup ()
tl_assert (mp_mw == 0 && mp_plugin_root == 0);
mp_plugin_root = new lay::PluginRootToMainWindow ();
mp_mw = new lay::MainWindow (this, mp_plugin_root, "main_window");
mp_mw = new lay::MainWindow (this, mp_plugin_root, "main_window", is_undo_enabled ());
mp_plugin_root->attach_to (mp_mw);
QObject::connect (mp_mw, SIGNAL (closed ()), this, SLOT (quit ()));

View File

@ -419,7 +419,7 @@ MainWindow::instance ()
// -----------------------------------
MainWindow::MainWindow (QApplication *app, lay::Plugin *plugin_parent, const char *name)
MainWindow::MainWindow (QApplication *app, lay::Plugin *plugin_parent, const char *name, bool undo_enabled)
: QMainWindow (0),
lay::Plugin (plugin_parent),
m_text_progress (this, 10 /*verbosity threshold*/),
@ -438,7 +438,8 @@ MainWindow::MainWindow (QApplication *app, lay::Plugin *plugin_parent, const cha
m_synchronized_views (false),
m_synchronous (false),
m_busy (false),
mp_app (app)
mp_app (app),
m_manager (true)
{
// ensures the deferred method scheduler is present
tl::DeferredMethodScheduler::instance ();

View File

@ -132,7 +132,7 @@ public:
/**
* @brief Constructor
*/
MainWindow (QApplication *app = 0, lay::Plugin *parent_plugin = 0, const char *name = "main_window");
MainWindow (QApplication *app = 0, lay::Plugin *parent_plugin = 0, const char *name = "main_window", bool undo_enabled = true);
/**
* @brief Destructor

View File

@ -427,75 +427,75 @@ Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "Layou
"This constructor has been introduced in version 0.25.\n"
"It has been enhanced with the arguments in version 0.26.4.\n"
) +
gsi::constant ("LV_NoLayers", (unsigned int) laybasic::LayoutView::LV_NoLayers,
gsi::constant ("LV_NoLayers", (unsigned int) lay::LayoutView::LV_NoLayers,
"@brief With this option, no layers view will be provided (see \\layer_control_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoHierarchyPanel", (unsigned int) laybasic::LayoutView::LV_NoHierarchyPanel,
gsi::constant ("LV_NoHierarchyPanel", (unsigned int) lay::LayoutView::LV_NoHierarchyPanel,
"@brief With this option, no cell hierarchy view will be provided (see \\hierarchy_control_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoLibrariesView", (unsigned int) laybasic::LayoutView::LV_NoLibrariesView,
gsi::constant ("LV_NoLibrariesView", (unsigned int) lay::LayoutView::LV_NoLibrariesView,
"@brief With this option, no library view will be provided (see \\libraries_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoBookmarksView", (unsigned int) laybasic::LayoutView::LV_NoBookmarksView,
gsi::constant ("LV_NoBookmarksView", (unsigned int) lay::LayoutView::LV_NoBookmarksView,
"@brief With this option, no bookmarks view will be provided (see \\bookmarks_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_Naked", (unsigned int) laybasic::LayoutView::LV_Naked,
gsi::constant ("LV_Naked", (unsigned int) lay::LayoutView::LV_Naked,
"@brief With this option, no separate views will be provided\n"
"Use this value with the constructor's 'options' argument.\n"
"This option is basically equivalent to using \\LV_NoLayers+\\LV_NoHierarchyPanel+\\LV_NoLibrariesView+\\LV_NoBookmarksView\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoZoom", (unsigned int) laybasic::LayoutView::LV_NoZoom,
gsi::constant ("LV_NoZoom", (unsigned int) lay::LayoutView::LV_NoZoom,
"@brief With this option, zooming is disabled\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoGrid", (unsigned int) laybasic::LayoutView::LV_NoGrid,
gsi::constant ("LV_NoGrid", (unsigned int) lay::LayoutView::LV_NoGrid,
"@brief With this option, the grid background is not shown\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoMove", (unsigned int) laybasic::LayoutView::LV_NoMove,
gsi::constant ("LV_NoMove", (unsigned int) lay::LayoutView::LV_NoMove,
"@brief With this option, move operations are not supported\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoTracker", (unsigned int) laybasic::LayoutView::LV_NoTracker,
gsi::constant ("LV_NoTracker", (unsigned int) lay::LayoutView::LV_NoTracker,
"@brief With this option, mouse position tracking is not supported\n"
"Use this value with the constructor's 'options' argument.\n"
"This option is not useful currently as no mouse tracking support is provided.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoSelection", (unsigned int) laybasic::LayoutView::LV_NoSelection,
gsi::constant ("LV_NoSelection", (unsigned int) lay::LayoutView::LV_NoSelection,
"@brief With this option, objects cannot be selected\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoPlugins", (unsigned int) laybasic::LayoutView::LV_NoPlugins,
gsi::constant ("LV_NoPlugins", (unsigned int) lay::LayoutView::LV_NoPlugins,
"@brief With this option, all plugins are disabled\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.26.4.\n"
) +
gsi::constant ("LV_NoServices", (unsigned int) laybasic::LayoutView::LV_NoServices,
gsi::constant ("LV_NoServices", (unsigned int) lay::LayoutView::LV_NoServices,
"@brief This option disables all services except the ones for pure viewing\n"
"Use this value with the constructor's 'options' argument.\n"
"With this option, all manipulation features are disabled, except zooming.\n"

View File

@ -52,7 +52,7 @@ struct CurrentStyleOp
EditLineStylesForm::EditLineStylesForm (lay::LayoutView *view, const lay::LineStyles &styles)
: QDialog (view), db::Object (0),
m_selected (-1), m_styles (styles), mp_view (view)
m_selected (-1), m_styles (styles), m_manager (true), mp_view (view)
{
m_selection_changed_enabled = false;

View File

@ -52,7 +52,7 @@ struct CurrentPatternOp
EditStipplesForm::EditStipplesForm (lay::LayoutView *view, const lay::DitherPattern &pattern)
: QDialog (view), db::Object (0),
m_selected (-1), m_pattern (pattern), mp_view (view)
m_selected (-1), m_pattern (pattern), m_manager (true), mp_view (view)
{
m_selection_changed_enabled = false;

View File

@ -632,14 +632,14 @@ HierarchyControlPanel::double_clicked (const QModelIndex &index)
BEGIN_PROTECTED
if (index.isValid ()) {
set_active_celltree_from_sender ();
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Show or hide cell")));
mp_view->transaction (tl::to_string (QObject::tr ("Show or hide cell")));
CellTreeItem *item = (CellTreeItem *) index.internalPointer ();
if (mp_view->is_cell_hidden (item->cell_or_pcell_index (), m_active_index)) {
mp_view->show_cell (item->cell_or_pcell_index (), m_active_index);
} else {
mp_view->hide_cell (item->cell_or_pcell_index (), m_active_index);
}
mp_view->manager ()->commit ();
mp_view->commit ();
}
END_PROTECTED
}
@ -1085,14 +1085,14 @@ HierarchyControlPanel::cut ()
}
}
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Cut Cells")));
mp_view->transaction (tl::to_string (QObject::tr ("Cut Cells")));
if (cut_mode == 1) {
layout.prune_cells (cells_to_delete);
} else {
layout.delete_cells (cells_to_delete);
}
layout.cleanup ();
mp_view->manager ()->commit ();
mp_view->commit ();
// If one of the cells in the path was deleted, establish a valid path

View File

@ -496,7 +496,9 @@ void
LayerControlPanel::recover ()
{
cancel_updates ();
manager ()->clear ();
if (manager ()) {
manager ()->clear ();
}
}
void
@ -504,13 +506,13 @@ LayerControlPanel::cm_delete ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Delete layer views")));
transaction (tl::to_string (QObject::tr ("Delete layer views")));
do_delete ();
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP {
recover ();
manager ()->commit ();
commit ();
}
}
@ -535,7 +537,7 @@ LayerControlPanel::do_delete ()
mp_view->delete_layer (*s);
}
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
@ -553,7 +555,7 @@ LayerControlPanel::cm_remove_unused ()
begin_updates ();
manager ()->transaction (tl::to_string (QObject::tr ("Clean up views")));
transaction (tl::to_string (QObject::tr ("Clean up views")));
bool any_deleted;
do {
@ -577,7 +579,7 @@ LayerControlPanel::cm_remove_unused ()
} while (any_deleted);
manager ()->commit ();
commit ();
end_updates ();
@ -592,9 +594,9 @@ LayerControlPanel::cm_add_missing ()
BEGIN_PROTECTED_CLEANUP
begin_updates ();
manager ()->transaction (tl::to_string (QObject::tr ("Add other views")));
transaction (tl::to_string (QObject::tr ("Add other views")));
mp_view->add_missing_layers ();
manager ()->commit ();
commit ();
end_updates ();
END_PROTECTED_CLEANUP { recover (); }
@ -618,18 +620,18 @@ LayerControlPanel::cm_insert ()
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Insert views")));
transaction (tl::to_string (QObject::tr ("Insert views")));
props.set_source (tl::to_string (n));
mp_view->init_layer_properties (props);
const LayerPropertiesNode &lp = mp_view->insert_layer (sel, props);
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
mp_layer_list->set_current (sel);
manager ()->commit ();
commit ();
emit order_changed ();
@ -656,7 +658,7 @@ LayerControlPanel::cm_group ()
begin_updates ();
manager ()->transaction (tl::to_string (QObject::tr ("Group layer views")));
transaction (tl::to_string (QObject::tr ("Group layer views")));
lay::LayerPropertiesNode node;
for (std::vector<lay::LayerPropertiesConstIterator>::const_iterator s = sel.begin (); s != sel.end (); ++s) {
@ -678,11 +680,11 @@ LayerControlPanel::cm_group ()
mp_view->insert_layer (ins_pos, node);
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
manager ()->commit ();
commit ();
end_updates ();
@ -705,7 +707,7 @@ LayerControlPanel::cm_ungroup ()
begin_updates ();
manager ()->transaction (tl::to_string (QObject::tr ("Ungroup layer views")));
transaction (tl::to_string (QObject::tr ("Ungroup layer views")));
lay::LayerPropertiesNode node = *sel;
@ -720,12 +722,12 @@ LayerControlPanel::cm_ungroup ()
mp_view->insert_layer (ins_pos, c->flat ());
}
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
set_selection (std::vector<lay::LayerPropertiesConstIterator> ()); // clear selection
manager ()->commit ();
commit ();
end_updates ();
@ -870,7 +872,7 @@ LayerControlPanel::paste ()
}
}
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
@ -904,9 +906,9 @@ LayerControlPanel::cm_source ()
props.set_source (tl::to_string (n));
manager ()->transaction (tl::to_string (QObject::tr ("Select source")));
transaction (tl::to_string (QObject::tr ("Select source")));
mp_view->set_properties (sel, props);
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
@ -937,9 +939,9 @@ LayerControlPanel::cm_rename ()
props.set_name (tl::to_string (n));
manager ()->transaction (tl::to_string (QObject::tr ("Rename layer")));
transaction (tl::to_string (QObject::tr ("Rename layer")));
mp_view->set_properties (sel, props);
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
@ -953,7 +955,7 @@ LayerControlPanel::cm_show_only ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Show selected layers")));
transaction (tl::to_string (QObject::tr ("Show selected layers")));
std::vector<lay::LayerPropertiesConstIterator> sel = mp_view->selected_layers ();
std::set<lay::LayerPropertiesConstIterator> sel_set (sel.begin (), sel.end ());
@ -996,7 +998,7 @@ LayerControlPanel::cm_show_only ()
}
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1006,7 +1008,7 @@ LayerControlPanel::cm_show ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Show layer")));
transaction (tl::to_string (QObject::tr ("Show layer")));
std::vector<lay::LayerPropertiesConstIterator> sel = mp_view->selected_layers ();
@ -1016,7 +1018,7 @@ LayerControlPanel::cm_show ()
mp_view->set_properties (*l, props);
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1026,7 +1028,7 @@ LayerControlPanel::cm_show_all ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Show all layers")));
transaction (tl::to_string (QObject::tr ("Show all layers")));
for (lay::LayerPropertiesConstIterator l = mp_view->begin_layers (); ! l.at_end (); ++l) {
lay::LayerProperties props (*l);
@ -1034,7 +1036,7 @@ LayerControlPanel::cm_show_all ()
mp_view->set_properties (l, props);
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1044,7 +1046,7 @@ LayerControlPanel::cm_rename_tab ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Rename layer tab")));
transaction (tl::to_string (QObject::tr ("Rename layer tab")));
bool ok = false;
QString n = QInputDialog::getText (this,
@ -1060,7 +1062,7 @@ LayerControlPanel::cm_rename_tab ()
end_updates ();
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1070,7 +1072,7 @@ LayerControlPanel::cm_remove_tab ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Remove layer tab")));
transaction (tl::to_string (QObject::tr ("Remove layer tab")));
if (mp_view->layer_lists () == 1) {
throw tl::Exception (tl::to_string (QObject::tr ("Cannot remove last layer tab")));
@ -1080,7 +1082,7 @@ LayerControlPanel::cm_remove_tab ()
mp_view->delete_layer_list (mp_view->current_layer_list ());
end_updates ();
manager ()->commit ();
commit ();
emit order_changed ();
@ -1092,13 +1094,13 @@ LayerControlPanel::cm_new_tab ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("New layer tab")));
transaction (tl::to_string (QObject::tr ("New layer tab")));
begin_updates ();
mp_view->insert_layer_list (mp_view->current_layer_list () + 1, mp_view->get_properties ());
end_updates ();
manager ()->commit ();
commit ();
emit order_changed ();
@ -1110,7 +1112,7 @@ LayerControlPanel::cm_make_valid ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Make layer valid")));
transaction (tl::to_string (QObject::tr ("Make layer valid")));
std::vector<lay::LayerPropertiesConstIterator> sel = mp_view->selected_layers ();
@ -1120,7 +1122,7 @@ LayerControlPanel::cm_make_valid ()
mp_view->set_properties (*l, props);
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1130,7 +1132,7 @@ LayerControlPanel::cm_make_invalid ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Make layer invalid")));
transaction (tl::to_string (QObject::tr ("Make layer invalid")));
std::vector<lay::LayerPropertiesConstIterator> sel = mp_view->selected_layers ();
@ -1140,7 +1142,7 @@ LayerControlPanel::cm_make_invalid ()
mp_view->set_properties (*l, props);
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1150,7 +1152,7 @@ LayerControlPanel::cm_hide ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Hide layer")));
transaction (tl::to_string (QObject::tr ("Hide layer")));
std::vector<lay::LayerPropertiesConstIterator> sel = mp_view->selected_layers ();
@ -1160,7 +1162,7 @@ LayerControlPanel::cm_hide ()
mp_view->set_properties (*l, props);
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1170,7 +1172,7 @@ LayerControlPanel::cm_hide_all ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Hide all layers")));
transaction (tl::to_string (QObject::tr ("Hide all layers")));
for (lay::LayerPropertiesConstIterator l = mp_view->begin_layers (); ! l.at_end (); ++l) {
if (l.parent ().is_null ()) {
@ -1182,7 +1184,7 @@ LayerControlPanel::cm_hide_all ()
}
}
manager ()->commit ();
commit ();
END_PROTECTED_CLEANUP { recover (); }
}
@ -1214,7 +1216,7 @@ LayerControlPanel::set_selection (const std::vector<lay::LayerPropertiesConstIte
mp_layer_list->set_selection (new_sel);
// :TODO: save selection for undo? Currently we just clear it.
if (manager ()->transacting ()) {
if (transacting ()) {
manager ()->queue (this, new LayerSelectionClearOp ());
}
@ -1304,9 +1306,9 @@ LayerControlPanel::cm_regroup_flatten ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Flatten layers")));
transaction (tl::to_string (QObject::tr ("Flatten layers")));
regroup_layers (RegroupFlatten);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1318,9 +1320,9 @@ LayerControlPanel::cm_regroup_by_index ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Regroup layers")));
transaction (tl::to_string (QObject::tr ("Regroup layers")));
regroup_layers (RegroupByIndex);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1332,9 +1334,9 @@ LayerControlPanel::cm_regroup_by_datatype ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Regroup layers")));
transaction (tl::to_string (QObject::tr ("Regroup layers")));
regroup_layers (RegroupByDatatype);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1346,9 +1348,9 @@ LayerControlPanel::cm_regroup_by_layer ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Regroup layers")));
transaction (tl::to_string (QObject::tr ("Regroup layers")));
regroup_layers (RegroupByLayer);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1360,9 +1362,9 @@ LayerControlPanel::cm_sort_by_name ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Sort layers")));
transaction (tl::to_string (QObject::tr ("Sort layers")));
sort_layers (ByName);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1374,9 +1376,9 @@ LayerControlPanel::cm_sort_by_ild ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Sort layers")));
transaction (tl::to_string (QObject::tr ("Sort layers")));
sort_layers (ByIndexLayerDatatype);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1388,9 +1390,9 @@ LayerControlPanel::cm_sort_by_idl ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Sort layers")));
transaction (tl::to_string (QObject::tr ("Sort layers")));
sort_layers (ByIndexDatatypeLayer);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1402,9 +1404,9 @@ LayerControlPanel::cm_sort_by_ldi ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Sort layers")));
transaction (tl::to_string (QObject::tr ("Sort layers")));
sort_layers (ByLayerDatatypeIndex);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1416,9 +1418,9 @@ LayerControlPanel::cm_sort_by_dli ()
{
BEGIN_PROTECTED_CLEANUP
manager ()->transaction (tl::to_string (QObject::tr ("Sort layers")));
transaction (tl::to_string (QObject::tr ("Sort layers")));
sort_layers (ByDatatypeLayerIndex);
manager ()->commit ();
commit ();
emit order_changed ();
@ -1725,14 +1727,14 @@ LayerControlPanel::double_clicked (const QModelIndex &index, Qt::KeyboardModifie
props.set_visible (! props.visible (false));
if (props.visible (false)) {
manager ()->transaction (tl::to_string (QObject::tr ("Show layer")));
transaction (tl::to_string (QObject::tr ("Show layer")));
} else {
manager ()->transaction (tl::to_string (QObject::tr ("Hide layer")));
transaction (tl::to_string (QObject::tr ("Hide layer")));
}
mp_view->set_properties (item, props);
manager ()->commit ();
commit ();
}
@ -2213,9 +2215,9 @@ LayerControlPanel::up_clicked ()
BEGIN_PROTECTED_CLEANUP
if (mp_view) {
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Move up")));
mp_view->transaction (tl::to_string (QObject::tr ("Move up")));
do_move (1 /*up*/);
mp_view->manager ()->commit ();
mp_view->commit ();
}
END_PROTECTED_CLEANUP { recover (); }
@ -2227,9 +2229,9 @@ LayerControlPanel::down_clicked ()
BEGIN_PROTECTED_CLEANUP
if (mp_view) {
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Move down")));
mp_view->transaction (tl::to_string (QObject::tr ("Move down")));
do_move (0 /*down*/);
mp_view->manager ()->commit ();
mp_view->commit ();
}
END_PROTECTED_CLEANUP { recover (); }
@ -2241,9 +2243,9 @@ LayerControlPanel::downdown_clicked ()
BEGIN_PROTECTED_CLEANUP
if (mp_view) {
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Move fully down")));
mp_view->transaction (tl::to_string (QObject::tr ("Move fully down")));
do_move (2 /*downdown*/);
mp_view->manager ()->commit ();
mp_view->commit ();
}
END_PROTECTED_CLEANUP { recover (); }
@ -2255,9 +2257,9 @@ LayerControlPanel::upup_clicked ()
BEGIN_PROTECTED_CLEANUP
if (mp_view) {
mp_view->manager ()->transaction (tl::to_string (QObject::tr ("Move fully up")));
mp_view->transaction (tl::to_string (QObject::tr ("Move fully up")));
do_move (3 /*upup*/);
mp_view->manager ()->commit ();
mp_view->commit ();
}
END_PROTECTED_CLEANUP { recover (); }

View File

@ -5778,7 +5778,7 @@ LayoutView::cm_cell_flatten ()
bool supports_undo = true;
if (db::transactions_enabled ()) {
if (manager () && manager ()->is_enabled ()) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (QObject::tr ("Undo buffering for the following operation can be memory and time consuming.\nChoose \"Yes\" to use undo buffering or \"No\" for no undo buffering. Warning: in the latter case, the undo history will be lost.\n\nChoose undo buffering?")),
@ -6969,7 +6969,7 @@ LayoutView::cm_copy_layer ()
bool supports_undo = true;
if (db::transactions_enabled ()) {
if (manager () && manager ()->is_enabled ()) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (QObject::tr ("Undo buffering for the following operation can be memory and time consuming.\nChoose \"Yes\" to use undo buffering or \"No\" for no undo buffering. Warning: in the latter case, the undo history will be lost.\n\nChoose undo buffering?")),

View File

@ -618,7 +618,7 @@ static QToolButton * (Ui::LayoutViewConfigPage4::*cfg4_buttons []) = {
LayoutViewConfigPage4::LayoutViewConfigPage4 (QWidget *parent)
: lay::ConfigPage (parent),
m_edit_order_changed_disabled (false)
m_manager (true), m_edit_order_changed_disabled (false)
{
// install the manager at db::Object
manager (&m_manager);
@ -952,7 +952,7 @@ static QToolButton * (Ui::LayoutViewConfigPage6::*cfg6_buttons []) = {
LayoutViewConfigPage6::LayoutViewConfigPage6 (QWidget *parent)
: lay::ConfigPage (parent),
m_edit_order_changed_disabled (false)
m_manager (true), m_edit_order_changed_disabled (false)
{
// install the manager at db::Object
manager (&m_manager);
@ -1239,7 +1239,7 @@ static QToolButton * (Ui::LayoutViewConfigPage6a::*cfg6a_buttons []) = {
};
LayoutViewConfigPage6a::LayoutViewConfigPage6a (QWidget *parent)
: lay::ConfigPage (parent)
: lay::ConfigPage (parent), m_manager (true)
{
// install the manager at db::Object
manager (&m_manager);

View File

@ -104,7 +104,7 @@ db::DUserObject us (const Sh &sh)
TEST(1)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes s (&m);
db::DBox b_empty;
@ -205,7 +205,7 @@ void read_testdata (lay::AnnotationShapes &shapes, unsigned int what = 0xff)
TEST(2)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x1);
@ -244,7 +244,7 @@ TEST(2)
TEST(3)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x4);
@ -283,7 +283,7 @@ TEST(3)
TEST(4)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x4);
@ -333,7 +333,7 @@ TEST(4)
TEST(5)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x4);
@ -369,7 +369,7 @@ TEST(5)
TEST(6)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x10);
@ -396,7 +396,7 @@ TEST(6)
TEST(7)
{
db::Manager m;
db::Manager m (true);
lay::AnnotationShapes shapes (&m);
read_testdata (shapes, 0x10);

View File

@ -1303,7 +1303,7 @@ TEST (16)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);
@ -1355,7 +1355,7 @@ TEST (17)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);
@ -1422,7 +1422,7 @@ TEST (18)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);
@ -1490,7 +1490,7 @@ TEST (19)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);
@ -1559,7 +1559,7 @@ TEST (20)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);
@ -1631,7 +1631,7 @@ TEST (21)
{
lay::LayerPropertiesList list;
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
list.attach_view (&view, 0);

View File

@ -27,7 +27,7 @@
TEST(1)
{
db::Manager mgr;
db::Manager mgr (true);
lay::LayoutView view (&mgr, is_editable (), 0);
int cv1 = view.create_layout ("", true, false);

View File

@ -54,7 +54,7 @@ static void run_test (tl::TestBase *_this, const std::string &base, const char *
db::LoadLayoutOptions options;
options.set_options (opt);
db::Manager m;
db::Manager m (false);
db::Layout layout (&m), layout2 (&m), layout2_cif (&m), layout_au (&m);
{

View File

@ -222,7 +222,7 @@ TEST(1)
{
tl::InputMemoryStream im ((const char *) data, sizeof (data));
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
tl::InputStream file (im);
db::Reader reader (file);
@ -264,7 +264,7 @@ TEST(2)
{
tl::InputMemoryStream im ((const char *) data, sizeof (data));
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
db::LayerMap map_full;
@ -351,7 +351,7 @@ TEST(2)
TEST(Bug_121_1)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{
@ -372,7 +372,7 @@ TEST(Bug_121_1)
TEST(Bug_121_2)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{

View File

@ -33,7 +33,7 @@
void run_test (tl::TestBase *_this, const char *file, const char *file_ref, bool priv = false, const db::GDS2WriterOptions &opt = db::GDS2WriterOptions ())
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{
std::string fn (priv ? tl::testsrc_private () : tl::testsrc ());
@ -85,7 +85,7 @@ TEST(1)
TEST(2)
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
db::cell_index_type cid = layout_org.add_cell ("TOP");
@ -131,7 +131,7 @@ TEST(2)
// Test the writer's capabilities to cut a polygon into small pieces correctly
TEST(3)
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{
std::string fn (tl::testsrc ());
@ -190,7 +190,7 @@ TEST(4)
{
db::ShapeProcessor sp;
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{
std::string fn (tl::testsrc ());
@ -247,7 +247,7 @@ TEST(4)
TEST(100)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -329,7 +329,7 @@ TEST(100)
TEST(101)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -401,7 +401,7 @@ TEST(101)
TEST(102)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -481,7 +481,7 @@ TEST(102)
TEST(103)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -554,7 +554,7 @@ TEST(103)
TEST(110)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -630,7 +630,7 @@ TEST(110)
TEST(111)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -703,7 +703,7 @@ TEST(111)
TEST(112)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -780,7 +780,7 @@ TEST(112)
TEST(113)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -856,7 +856,7 @@ TEST(114)
{
// text alignment flags, font and text size
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -946,7 +946,7 @@ TEST(115)
{
// polygons and boxes without area
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;
@ -1012,7 +1012,7 @@ TEST(116)
{
// big paths with multi-xy
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;
@ -1073,7 +1073,7 @@ TEST(117)
{
// big polygons with multi-xy
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;

View File

@ -47,7 +47,7 @@ static void run_test (tl::TestBase *_this, const char *lef_dir, const char *file
tc.set_blockages_suffix (".BLK");
db::LEFDEFLayerDelegate ld (&tc);
db::Manager m;
db::Manager m (false);
db::Layout layout (&m), layout2 (&m), layout_au (&m);
tl::Extractor ex (filename);

View File

@ -57,7 +57,7 @@ static void run_test (tl::TestBase *_this, const std::string &base, const char *
db::LoadLayoutOptions options;
options.set_options (opt);
db::Manager m;
db::Manager m (false);
db::Layout layout (&m), layout2 (&m), layout2_mag (&m), layout_au (&m);
{

View File

@ -81,7 +81,7 @@ compare_ref (tl::TestBase *_this, const char *test, const db::Layout &layout)
void
run_test (tl::TestBase *_this, const char *test)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/t";
@ -106,7 +106,7 @@ run_test (tl::TestBase *_this, const char *test)
void
run_test_error (tl::TestBase *_this, const char *test, const char *msg_au)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/t";
@ -435,7 +435,7 @@ TEST(99)
"end_lib\n"
;
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{
@ -518,7 +518,7 @@ TEST(100)
"end_lib\n"
;
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{
@ -540,7 +540,7 @@ TEST(100)
TEST(Bug_121_1)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{
@ -561,7 +561,7 @@ TEST(Bug_121_1)
TEST(Bug_121_2)
{
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
{

View File

@ -36,7 +36,7 @@
void run_test (tl::TestBase *_this, const char *file, bool scaling_test, int compr, bool recompress)
{
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/";
@ -81,7 +81,7 @@ void run_test (tl::TestBase *_this, const char *file, bool scaling_test, int com
}
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/";
@ -137,7 +137,7 @@ void run_test (tl::TestBase *_this, const char *file, bool scaling_test, int com
}
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/";
@ -186,7 +186,7 @@ void run_test (tl::TestBase *_this, const char *file, bool scaling_test, int com
}
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/";
@ -237,7 +237,7 @@ void run_test (tl::TestBase *_this, const char *file, bool scaling_test, int com
if (scaling_test) {
db::Manager m;
db::Manager m (false);
db::Layout layout (&m);
std::string fn (tl::testsrc ());
fn += "/testdata/oasis/";
@ -513,7 +513,7 @@ TEST(40)
TEST(100)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -596,7 +596,7 @@ TEST(100)
TEST(101)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -669,7 +669,7 @@ TEST(101)
TEST(102)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -750,7 +750,7 @@ TEST(102)
TEST(103)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -824,7 +824,7 @@ TEST(103)
TEST(110)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -901,7 +901,7 @@ TEST(110)
TEST(111)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -975,7 +975,7 @@ TEST(111)
TEST(112)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -1053,7 +1053,7 @@ TEST(112)
TEST(113)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp0;
@ -1127,7 +1127,7 @@ TEST(113)
TEST(114)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;
@ -1182,7 +1182,7 @@ TEST(114)
TEST(115)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::property_names_id_type n1, n2, n3;
@ -1262,7 +1262,7 @@ TEST(115)
TEST(116)
{
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::property_names_id_type n1, n2, n3;
@ -1612,7 +1612,7 @@ TEST(117)
{
// polygons and boxes without area
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;
@ -1679,7 +1679,7 @@ TEST(118)
{
// 1x1 arrays (#902)
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
db::LayerProperties lp1;
@ -1734,7 +1734,7 @@ TEST(119_WithAndWithoutContext)
{
// PCells with context and without
db::Manager m;
db::Manager m (false);
db::Layout g (&m);
// Note: this sample requires the BASIC lib

View File

@ -34,7 +34,7 @@ TEST(1)
{
db::ShapeProcessor sp;
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{
std::string fn (tl::testsrc ());

View File

@ -107,7 +107,7 @@ public:
bool supports_undo = true;
if (db::transactions_enabled ()) {
if (mp_view->manager () && mp_view->manager ()->is_enabled ()) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (QObject::tr ("Undo buffering for the following operation can be memory and time consuming.\nChoose \"Yes\" to use undo buffering or \"No\" for no undo buffering. Warning: in the latter case, the undo history will be lost.\n\nChoose undo buffering?")),
@ -244,7 +244,7 @@ public:
bool supports_undo = true;
if (db::transactions_enabled ()) {
if (mp_view->manager () && mp_view->manager ()->is_enabled ()) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (QObject::tr ("Undo buffering for the following operation can be memory and time consuming.\nChoose \"Yes\" to use undo buffering or \"No\" for no undo buffering. Warning: in the latter case, the undo history will be lost.\n\nChoose undo buffering?")),
@ -359,7 +359,7 @@ public:
bool supports_undo = true;
if (db::transactions_enabled ()) {
if (mp_view->manager () && mp_view->manager ()->is_enabled ()) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (QObject::tr ("Undo buffering for the following operation can be memory and time consuming.\nChoose \"Yes\" to use undo buffering or \"No\" for no undo buffering. Warning: in the latter case, the undo history will be lost.\n\nChoose undo buffering?")),

View File

@ -92,7 +92,7 @@ static db::NetTracerNet trace (db::NetTracer &tracer, const db::Layout &layout,
void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracerTechnologyComponent &tc, const db::LayerProperties &lp_start, const db::Point &p_start, const std::string &file_au, const char *net_name = 0)
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{
@ -126,7 +126,7 @@ void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracer
void run_test2 (tl::TestBase *_this, const std::string &file, const db::NetTracerTechnologyComponent &tc, const db::LayerProperties &lp_start, const db::Point &p_start, const db::LayerProperties &lp_stop, const db::Point &p_stop, const std::string &file_au, const char *net_name = 0)
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{

View File

@ -52,7 +52,7 @@ static db::NetTracerSymbolInfo symbol (const std::string &s, const std::string &
void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracerTechnologyComponent &tc, const std::string &file_au)
{
db::Manager m;
db::Manager m (false);
db::Layout layout_org (&m);
{