mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 17:30:09 +02:00
Merge remote-tracking branch 'origin/master' into dvb
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AlignCellOptionsDialog</class>
|
||||
<widget class="QDialog" name="AlignCellOptionsDialog" >
|
||||
<property name="geometry" >
|
||||
<widget class="QDialog" name="AlignCellOptionsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
@@ -9,52 +10,68 @@
|
||||
<height>342</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Align Cell</string>
|
||||
<property name="windowTitle">
|
||||
<string>Adjust Cell Origin</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Put origin relative to cell's bounding box at ...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>20</height>
|
||||
@@ -63,187 +80,205 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QToolButton" name="ct" >
|
||||
<property name="text" >
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="ct">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/ct.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/ct.png</normaloff>:/ct.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QToolButton" name="lt" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QToolButton" name="lt">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/lt.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/lt.png</normaloff>:/lt.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" >
|
||||
<widget class="QToolButton" name="rt" >
|
||||
<property name="text" >
|
||||
<item row="0" column="3">
|
||||
<widget class="QToolButton" name="rt">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/rt.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/rt.png</normaloff>:/rt.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QToolButton" name="lc" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QToolButton" name="lc">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/lc.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/lc.png</normaloff>:/lc.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QToolButton" name="cc" >
|
||||
<property name="text" >
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="cc">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/cc.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/cc.png</normaloff>:/cc.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QToolButton" name="rc" >
|
||||
<property name="text" >
|
||||
<item row="1" column="3">
|
||||
<widget class="QToolButton" name="rc">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/rc.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/rc.png</normaloff>:/rc.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QToolButton" name="lb" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QToolButton" name="lb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/lb.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/lb.png</normaloff>:/lb.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" >
|
||||
<widget class="QToolButton" name="cb" >
|
||||
<property name="text" >
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="cb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/cb.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/cb.png</normaloff>:/cb.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" >
|
||||
<widget class="QToolButton" name="rb" >
|
||||
<property name="text" >
|
||||
<item row="2" column="3">
|
||||
<widget class="QToolButton" name="rb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="layResources.qrc" >:/rb.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../../lay/lay/layResources.qrc">
|
||||
<normaloff>:/rb.png</normaloff>:/rb.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -253,10 +288,10 @@
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>20</height>
|
||||
@@ -268,28 +303,28 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="vis_only_cbx" >
|
||||
<property name="text" >
|
||||
<widget class="QCheckBox" name="vis_only_cbx">
|
||||
<property name="text">
|
||||
<string>Use visible layers only for bounding box</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="adjust_calls_cbx" >
|
||||
<property name="text" >
|
||||
<widget class="QCheckBox" name="adjust_calls_cbx">
|
||||
<property name="text">
|
||||
<string>Adjust instances in parents</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>8</height>
|
||||
@@ -298,26 +333,35 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>209</width>
|
||||
<height>20</height>
|
||||
@@ -326,18 +370,18 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton" >
|
||||
<property name="text" >
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Ok</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2" >
|
||||
<property name="text" >
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -362,7 +406,7 @@
|
||||
<tabstop>vis_only_cbx</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="layResources.qrc" />
|
||||
<include location="../../lay/lay/layResources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
@@ -371,11 +415,11 @@
|
||||
<receiver>AlignCellOptionsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<hint type="sourcelabel">
|
||||
<x>237</x>
|
||||
<y>203</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<hint type="destinationlabel">
|
||||
<x>147</x>
|
||||
<y>81</y>
|
||||
</hint>
|
||||
@@ -387,11 +431,11 @@
|
||||
<receiver>AlignCellOptionsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<hint type="sourcelabel">
|
||||
<x>325</x>
|
||||
<y>202</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<hint type="destinationlabel">
|
||||
<x>325</x>
|
||||
<y>57</y>
|
||||
</hint>
|
||||
|
||||
@@ -1388,9 +1388,9 @@ Class<lay::LayerPropertiesNodeRef> decl_LayerPropertiesNodeRef (
|
||||
"This class has been introduced in version 0.25.\n"
|
||||
);
|
||||
|
||||
static lay::LayerPropertiesNodeRef current (lay::LayerPropertiesConstIterator *iter)
|
||||
static lay::LayerPropertiesNodeRef current (const lay::LayerPropertiesConstIterator *iter)
|
||||
{
|
||||
return lay::LayerPropertiesNodeRef (iter);
|
||||
return lay::LayerPropertiesNodeRef (*iter);
|
||||
}
|
||||
|
||||
Class<lay::LayerPropertiesConstIterator> decl_LayerPropertiesIterator (
|
||||
|
||||
@@ -366,7 +366,7 @@ namespace {
|
||||
|
||||
reference operator* () const
|
||||
{
|
||||
return lay::LayerPropertiesNodeRef (&const_cast<LayerPropertiesConstIteratorWrapper *> (this)->m_iter);
|
||||
return lay::LayerPropertiesNodeRef (m_iter);
|
||||
}
|
||||
|
||||
bool at_end () const
|
||||
|
||||
@@ -197,12 +197,15 @@ LayerProperties::operator= (const LayerProperties &d)
|
||||
flags += nr_source;
|
||||
}
|
||||
|
||||
if (m_name != d.m_name) {
|
||||
m_name = d.m_name;
|
||||
flags += nr_meta;
|
||||
}
|
||||
|
||||
if (flags) {
|
||||
need_realize (flags, true /*force on children*/);
|
||||
}
|
||||
|
||||
m_name = d.m_name;
|
||||
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -806,13 +809,13 @@ LayerPropertiesNode::add_child (const LayerPropertiesNode &child)
|
||||
// LayerPropertiesConstIterator implementation
|
||||
|
||||
LayerPropertiesConstIterator::LayerPropertiesConstIterator ()
|
||||
: m_uint (0), m_list (), mp_obj (0)
|
||||
: m_uint (0), m_list ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
LayerPropertiesConstIterator::LayerPropertiesConstIterator (const lay::LayerPropertiesNode *node)
|
||||
: m_uint (0), m_list (), mp_obj (0)
|
||||
: m_uint (0), m_list ()
|
||||
{
|
||||
if (!node) {
|
||||
return;
|
||||
@@ -874,7 +877,7 @@ LayerPropertiesConstIterator::LayerPropertiesConstIterator (const lay::LayerProp
|
||||
|
||||
LayerPropertiesConstIterator::LayerPropertiesConstIterator (const LayerPropertiesList &list, bool last)
|
||||
// NOTE: there should be some "const_weak_ptr"
|
||||
: m_uint (0), m_list (const_cast<LayerPropertiesList *> (&list)), mp_obj (0)
|
||||
: m_uint (0), m_list (const_cast<LayerPropertiesList *> (&list))
|
||||
{
|
||||
if (last) {
|
||||
m_uint = (list.end_const () - list.begin_const ()) + 1;
|
||||
@@ -885,7 +888,7 @@ LayerPropertiesConstIterator::LayerPropertiesConstIterator (const LayerPropertie
|
||||
|
||||
LayerPropertiesConstIterator::LayerPropertiesConstIterator (const LayerPropertiesList &list, size_t uint)
|
||||
// NOTE: there should be some "const_weak_ptr"
|
||||
: m_uint (uint), m_list (const_cast<LayerPropertiesList *> (&list)), mp_obj (0)
|
||||
: m_uint (uint), m_list (const_cast<LayerPropertiesList *> (&list))
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
@@ -991,7 +994,7 @@ LayerPropertiesConstIterator &
|
||||
LayerPropertiesConstIterator::up ()
|
||||
{
|
||||
m_uint %= factor ().first;
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -999,7 +1002,7 @@ LayerPropertiesConstIterator &
|
||||
LayerPropertiesConstIterator::next_sibling (ptrdiff_t n)
|
||||
{
|
||||
m_uint += factor ().first * n;
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1008,7 +1011,7 @@ LayerPropertiesConstIterator::to_sibling (size_t n)
|
||||
{
|
||||
std::pair <size_t, size_t> f = factor ();
|
||||
m_uint = (m_uint % f.first) + (1 + n) * f.first;
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1024,7 +1027,7 @@ LayerPropertiesConstIterator::down_first_child ()
|
||||
{
|
||||
std::pair <size_t, size_t> f = factor ();
|
||||
m_uint += f.first * f.second;
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1034,7 +1037,7 @@ LayerPropertiesConstIterator::down_last_child ()
|
||||
std::pair <size_t, size_t> f = factor ();
|
||||
const LayerPropertiesNode *o = obj ();
|
||||
m_uint += f.first * f.second * ((o->end_children () - o->begin_children ()) + 1);
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1067,8 +1070,8 @@ LayerPropertiesConstIterator::parent_obj () const
|
||||
void
|
||||
LayerPropertiesConstIterator::invalidate ()
|
||||
{
|
||||
mp_obj = 0;
|
||||
|
||||
mp_obj.reset (0);
|
||||
|
||||
// the iterator may be parked at a position behind the last element.
|
||||
// Move one step further in this case.
|
||||
std::pair <size_t, size_t> f = factor ();
|
||||
@@ -1083,7 +1086,7 @@ LayerPropertiesConstIterator::set_obj () const
|
||||
{
|
||||
if (is_null () || !m_list) {
|
||||
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -1104,7 +1107,7 @@ LayerPropertiesConstIterator::set_obj () const
|
||||
iter = iter[rem - 1].begin_children ();
|
||||
}
|
||||
|
||||
mp_obj = &iter[uint - 1];
|
||||
mp_obj.reset (const_cast<lay::LayerPropertiesNode *> (&iter[uint - 1]));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1122,7 +1125,7 @@ LayerPropertiesConstIterator::inc (unsigned int d)
|
||||
while (true) {
|
||||
std::pair <size_t, size_t> f = factor ();
|
||||
m_uint += f.first;
|
||||
mp_obj = 0;
|
||||
mp_obj.reset (0);
|
||||
if (m_uint / f.first < f.second - 1) {
|
||||
break;
|
||||
} else if (at_top ()) {
|
||||
@@ -1908,32 +1911,11 @@ LayerPropertiesNodeRef::LayerPropertiesNodeRef (LayerPropertiesNode *node)
|
||||
attach_view (node->view (), node->list_index ());
|
||||
set_parent (node->parent ());
|
||||
|
||||
mp_iter.reset (&m_iter);
|
||||
mp_node.reset (node);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
LayerPropertiesNodeRef::LayerPropertiesNodeRef (LayerPropertiesConstIterator *iter)
|
||||
{
|
||||
if (iter && !iter->at_end () && !iter->is_null ()) {
|
||||
|
||||
const lay::LayerPropertiesNode *node = (*iter).operator-> ();
|
||||
|
||||
// NOTE: we do assignment before we set the iterator reference - hence there won't be
|
||||
// updates triggered.
|
||||
LayerPropertiesNode::operator= (*node);
|
||||
|
||||
// Makes ourself a perfect copy of the original (including reference into the view)
|
||||
attach_view (node->view (), node->list_index ());
|
||||
set_parent (node->parent ());
|
||||
|
||||
mp_iter.reset (iter);
|
||||
mp_node.reset (const_cast<lay::LayerPropertiesNode *> (node));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
LayerPropertiesNodeRef::LayerPropertiesNodeRef (const LayerPropertiesConstIterator &iter)
|
||||
: m_iter (iter)
|
||||
{
|
||||
@@ -1949,7 +1931,6 @@ LayerPropertiesNodeRef::LayerPropertiesNodeRef (const LayerPropertiesConstIterat
|
||||
attach_view (node->view (), node->list_index ());
|
||||
set_parent (node->parent ());
|
||||
|
||||
mp_iter.reset (&m_iter);
|
||||
mp_node.reset (const_cast<lay::LayerPropertiesNode *> (node));
|
||||
|
||||
}
|
||||
@@ -1961,7 +1942,7 @@ LayerPropertiesNodeRef::LayerPropertiesNodeRef ()
|
||||
}
|
||||
|
||||
LayerPropertiesNodeRef::LayerPropertiesNodeRef (const LayerPropertiesNodeRef &other)
|
||||
: LayerPropertiesNode (other), m_iter (other.m_iter), mp_iter (other.mp_iter), mp_node (other.mp_node)
|
||||
: LayerPropertiesNode (other), m_iter (other.m_iter), mp_node (other.mp_node)
|
||||
{
|
||||
attach_view (other.view (), other.list_index ());
|
||||
set_parent (other.parent ());
|
||||
@@ -1971,7 +1952,6 @@ LayerPropertiesNodeRef &LayerPropertiesNodeRef::operator= (const LayerProperties
|
||||
{
|
||||
if (this != &other) {
|
||||
|
||||
mp_iter = other.mp_iter;
|
||||
mp_node = other.mp_node;
|
||||
m_iter = other.m_iter;
|
||||
attach_view (other.view (), other.list_index ());
|
||||
@@ -1988,25 +1968,20 @@ void
|
||||
LayerPropertiesNodeRef::erase ()
|
||||
{
|
||||
if (is_valid ()) {
|
||||
view ()->delete_layer ((unsigned int) list_index (), *mp_iter);
|
||||
view ()->delete_layer ((unsigned int) list_index (), m_iter);
|
||||
}
|
||||
}
|
||||
|
||||
const lay::LayerPropertiesConstIterator &
|
||||
LayerPropertiesNodeRef::iter () const
|
||||
{
|
||||
if (mp_iter) {
|
||||
return *mp_iter;
|
||||
} else {
|
||||
static lay::LayerPropertiesConstIterator null_iter;
|
||||
return null_iter;
|
||||
}
|
||||
return m_iter;
|
||||
}
|
||||
|
||||
bool
|
||||
LayerPropertiesNodeRef::is_valid () const
|
||||
{
|
||||
return mp_iter && !mp_iter->at_end () && !mp_iter->is_null () && view ();
|
||||
return !m_iter.is_null () && !m_iter.at_end () && view ();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2015,11 +1990,11 @@ LayerPropertiesNodeRef::need_realize (unsigned int flags, bool force)
|
||||
LayerPropertiesNode::need_realize (flags, force);
|
||||
if (is_valid ()) {
|
||||
|
||||
if ((flags & (nr_visual + nr_source)) != 0) {
|
||||
view ()->set_properties ((unsigned int) list_index (), *mp_iter, *this);
|
||||
if ((flags & (nr_visual + nr_source + nr_meta)) != 0) {
|
||||
view ()->set_properties ((unsigned int) list_index (), m_iter, *this);
|
||||
}
|
||||
if ((flags & nr_hierarchy) != 0) {
|
||||
view ()->replace_layer_node ((unsigned int) list_index (), *mp_iter, *this);
|
||||
view ()->replace_layer_node ((unsigned int) list_index (), m_iter, *this);
|
||||
}
|
||||
|
||||
} else if (mp_node) {
|
||||
|
||||
@@ -637,7 +637,10 @@ public:
|
||||
*/
|
||||
void set_name (const std::string &n)
|
||||
{
|
||||
m_name = n;
|
||||
if (m_name != n) {
|
||||
m_name = n;
|
||||
need_realize (nr_meta);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -916,7 +919,8 @@ protected:
|
||||
enum {
|
||||
nr_visual = 1,
|
||||
nr_source = 2,
|
||||
nr_hierarchy = 4
|
||||
nr_meta = 4,
|
||||
nr_hierarchy = 8
|
||||
};
|
||||
|
||||
mutable bool m_realize_needed_source : 1;
|
||||
@@ -1407,7 +1411,7 @@ public:
|
||||
if (! mp_obj) {
|
||||
set_obj ();
|
||||
}
|
||||
return mp_obj;
|
||||
return mp_obj.get ();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1423,7 +1427,7 @@ private:
|
||||
|
||||
size_t m_uint;
|
||||
tl::weak_ptr<LayerPropertiesList> m_list;
|
||||
mutable const LayerPropertiesNode *mp_obj;
|
||||
mutable tl::weak_ptr<LayerPropertiesNode> mp_obj;
|
||||
|
||||
void inc (unsigned int d);
|
||||
std::pair <size_t, size_t> factor () const;
|
||||
@@ -1888,14 +1892,6 @@ public:
|
||||
*/
|
||||
LayerPropertiesNodeRef (LayerPropertiesNode *node);
|
||||
|
||||
/**
|
||||
* @brief Constructor from an iterator
|
||||
* The iterator is a pointer since the erase implementation requires us to
|
||||
* modify the iterator. Hence with this version, the original iterator will
|
||||
* follow up after the erase.
|
||||
*/
|
||||
LayerPropertiesNodeRef (LayerPropertiesConstIterator *iter);
|
||||
|
||||
/**
|
||||
* @brief Constructor from an iterator with an iterator copy
|
||||
*/
|
||||
@@ -1919,7 +1915,7 @@ public:
|
||||
|
||||
/**
|
||||
* @brief Deletes the current node
|
||||
* After this operation, the reference will point to the
|
||||
* After this operation, the reference will point to the next element.
|
||||
*/
|
||||
void erase ();
|
||||
|
||||
@@ -1947,7 +1943,6 @@ public:
|
||||
|
||||
private:
|
||||
LayerPropertiesConstIterator m_iter;
|
||||
tl::weak_ptr<LayerPropertiesConstIterator> mp_iter;
|
||||
tl::weak_ptr<LayerPropertiesNode> mp_node;
|
||||
|
||||
void need_realize (unsigned int flags, bool force);
|
||||
|
||||
Reference in New Issue
Block a user