mirror of https://github.com/KLayout/klayout.git
Small fixes
- Qt5 binding was not properly including bindings for special types - Macro editor: forward button wasn't autoRaise like the others - DRC engine: gave deprecation warnings for Ruby 2.4 because Fixnum became deprecated. Now the implementation is more generic. - Fixed some #includes for Qt5
This commit is contained in:
parent
5c414ef0be
commit
af640086e6
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
|
||||
#include "gsiQt.h"
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
#include "gsiQt.h"
|
||||
|
||||
#include <QtCore/QPair>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QPoint>
|
||||
#include <QtGui/QColor>
|
||||
#include <QtGui/QAccessibleInterface>
|
||||
#include <QtNetwork/QHostAddress>
|
||||
#include <QPair>
|
||||
#include <QString>
|
||||
#include <QPoint>
|
||||
#include <QColor>
|
||||
#include <QAccessibleInterface>
|
||||
#include <QHostAddress>
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Generic declarations for a pair
|
||||
|
|
|
|||
|
|
@ -350,6 +350,9 @@ p, li { white-space: pre-wrap; }
|
|||
<iconset resource="layResources.qrc">
|
||||
<normaloff>:/forward_16.png</normaloff>:/forward_16.png</iconset>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
|||
|
|
@ -60,16 +60,18 @@ class Float
|
|||
end
|
||||
end
|
||||
|
||||
# Extend the Fixnum class, so it is possible to
|
||||
# convert a value to Float with a unit spec, i.e.
|
||||
# 5.nm -> 0.005. A spec with ".dbu" gives the
|
||||
# Fixnum value itself. This indicates a value in
|
||||
# database units for most methods of the DRC
|
||||
# framework.
|
||||
class Fixnum
|
||||
def Fixnum._dbu=(dbu)
|
||||
@@dbu = dbu
|
||||
module IntegerClassExtensions
|
||||
@dbu = nil
|
||||
def _dbu=(dbu)
|
||||
@dbu = dbu
|
||||
end
|
||||
def _dbu
|
||||
@dbu
|
||||
end
|
||||
end
|
||||
|
||||
module IntegerExtensions
|
||||
|
||||
def um
|
||||
self.to_f
|
||||
end
|
||||
|
|
@ -104,11 +106,22 @@ class Fixnum
|
|||
self*1.0e12
|
||||
end
|
||||
def dbu
|
||||
@@dbu || raise("No layout loaded - cannot determine database unit")
|
||||
self*@@dbu
|
||||
self.class._dbu || raise("No layout loaded - cannot determine database unit")
|
||||
self*self.class._dbu
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
# Extend the Fixnum class, so it is possible to
|
||||
# convert a value to Float with a unit spec, i.e.
|
||||
# 5.nm -> 0.005. A spec with ".dbu" gives the
|
||||
# Fixnum value itself. This indicates a value in
|
||||
# database units for most methods of the DRC
|
||||
# framework.
|
||||
1.class.include(IntegerExtensions)
|
||||
1.class.extend(IntegerClassExtensions)
|
||||
|
||||
module DRC
|
||||
|
||||
include RBA
|
||||
|
|
@ -134,7 +147,7 @@ module DRC
|
|||
self.value = v
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# A wrapper for the join flag for extended
|
||||
class DRCJoinFlag
|
||||
attr_accessor :value
|
||||
|
|
@ -183,16 +196,16 @@ module DRC
|
|||
if a.size > 2 || a.size == 0
|
||||
raise("A projection limits specification requires a maximum of two values and at least one argument")
|
||||
elsif a.size == 1
|
||||
if !a[0].is_a?(Range) || (!a[0].min.is_a?(Float) && !a[0].min.is_a?(Fixnum))
|
||||
if !a[0].is_a?(Range) || (!a[0].min.is_a?(Float) && !a[0].min.is_a?(1.class))
|
||||
raise("A projection limit requires an interval of two length values or two individual length values")
|
||||
end
|
||||
self.min = a[0].min
|
||||
self.max = a[0].max
|
||||
elsif a.size == 2
|
||||
if a[0] && !a[0].is_a?(Float) && !a[0].is_a?(Fixnum)
|
||||
if a[0] && !a[0].is_a?(Float) && !a[0].is_a?(1.class)
|
||||
raise("First argument to a projection limit must be either nil or a length value")
|
||||
end
|
||||
if a[1] && !a[1].is_a?(Float) && !a[1].is_a?(Fixnum)
|
||||
if a[1] && !a[1].is_a?(Float) && !a[1].is_a?(1.class)
|
||||
raise("Second argument to a projection limit must be either nil or a length value")
|
||||
end
|
||||
self.min = a[0]
|
||||
|
|
@ -1632,7 +1645,7 @@ CODE
|
|||
a[:in] && av[3] = prep_value(a[:in])
|
||||
a[:joined] && av[4] = true
|
||||
elsif i < 4
|
||||
if !a.is_a?(Fixnum) && !a.is_a?(Float)
|
||||
if !a.is_a?(1.class) && !a.is_a?(Float)
|
||||
raise("Invalid type for argument " + (i+1).to_s + " (method '#{f}')")
|
||||
end
|
||||
av[i] = prep_value(a)
|
||||
|
|
@ -2154,7 +2167,7 @@ CODE
|
|||
elsif a.is_a?(DRCProjectionLimits)
|
||||
minp = prep_value(a.min)
|
||||
maxp = prep_value(a.max)
|
||||
elsif a.is_a?(Float) || a.is_a?(Fixnum)
|
||||
elsif a.is_a?(Float) || a.is_a?(1.class)
|
||||
value && raise("Value already specified")
|
||||
value = prep_value(a)
|
||||
else
|
||||
|
|
@ -2213,7 +2226,7 @@ CODE
|
|||
elsif a.is_a?(DRCProjectionLimits)
|
||||
minp = prep_value(a.min)
|
||||
maxp = prep_value(a.max)
|
||||
elsif a.is_a?(Float) || a.is_a?(Fixnum)
|
||||
elsif a.is_a?(Float) || a.is_a?(1.class)
|
||||
value && raise("Value already specified")
|
||||
value = prep_value(a)
|
||||
else
|
||||
|
|
@ -2384,7 +2397,7 @@ CODE
|
|||
mode = 2
|
||||
values = []
|
||||
args.each do |a|
|
||||
if a.is_a?(Fixnum) || a.is_a?(Float)
|
||||
if a.is_a?(1.class) || a.is_a?(Float)
|
||||
v = prep_value(a)
|
||||
v.abs > dist && dist = v.abs
|
||||
values.push(v)
|
||||
|
|
@ -2946,7 +2959,7 @@ CODE
|
|||
li && layers.push(li)
|
||||
li && @tmp_layers.push(li)
|
||||
|
||||
elsif (args.size == 1 || args.size == 2) && args[0].is_a?(Fixnum)
|
||||
elsif (args.size == 1 || args.size == 2) && args[0].is_a?(1.class)
|
||||
|
||||
li = @layout.find_layer(args[0], args[1] || 0)
|
||||
li && layers.push(li)
|
||||
|
|
@ -3155,7 +3168,7 @@ CODE
|
|||
end
|
||||
# Should have a "context", but no such thing for Float or Fixnum
|
||||
Float._dbu = d
|
||||
Fixnum._dbu = d
|
||||
1.class._dbu = d
|
||||
@dbu = d
|
||||
end
|
||||
|
||||
|
|
@ -4101,7 +4114,7 @@ CODE
|
|||
|
||||
info = nil
|
||||
if args.size == 1
|
||||
if args[0].is_a?(Fixnum)
|
||||
if args[0].is_a?(1.class)
|
||||
info = RBA::LayerInfo::new(args[0], 0)
|
||||
elsif args[0].is_a?(String)
|
||||
info = RBA::LayerInfo::from_string(args[0])
|
||||
|
|
|
|||
Loading…
Reference in New Issue