From 92e213aaabaaa607907f6940266955909ef7bae5 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 10 Jun 2023 10:17:52 +0200 Subject: [PATCH] Preparations for 0.28.9, updated python stubs --- Changelog | 11 + Changelog.Debian | 7 + src/pymod/distutils_src/klayout/dbcore.pyi | 531 ++++++++++++++------ src/pymod/distutils_src/klayout/laycore.pyi | 510 ++++++++++++++----- version.sh | 4 +- 5 files changed, 766 insertions(+), 297 deletions(-) diff --git a/Changelog b/Changelog index 565365404..289dee9df 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,14 @@ +0.28.9 (2023-06-10): +* Enhancement: %GITHUB%/issues/1281 Layout diff can ignore shape or instance duplicates +* Bugfix: %GITHUB%/issues/1393 GDS2Text format not supported in Python module +* Bugfix: "add meta info" did not take "persisted" flag +* Enhancement: "profile" feature for DRC and LVS +* Enhancement: DRC can write to multiple targets now + - new functions "new_report", "new_target": create output channel objects + that can be used to redirect "output" to specific other channels +* Bugfix: GDS2 reader should not segfault on certain broken files +* Enhancement: performance improvement of hierarchical XOR in certain cases + 0.28.8 (2023-05-23): * Enhancement: %GITHUB%/issues/1314 Storing (arbitrary) data in metadata - Meta information can be attached to layout and cells diff --git a/Changelog.Debian b/Changelog.Debian index 22a597e8f..4e4c1e632 100644 --- a/Changelog.Debian +++ b/Changelog.Debian @@ -1,3 +1,10 @@ +klayout (0.28.9-1) unstable; urgency=low + + * New features and bugfixes + - See changelog + + -- Matthias Köfferlein Sat, 10 Jun 2023 09:27:25 +0200 + klayout (0.28.8-1) unstable; urgency=low * New features and bugfixes diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 36e46e0f4..56ee68640 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -812,6 +812,13 @@ class Cell: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def add_meta_info(self, info: LayoutMetaInfo) -> None: + r""" + @brief Adds meta information to the cell + See \LayoutMetaInfo for details about cells and meta information. + + This method has been introduced in version 0.28.8. + """ def basic_name(self) -> str: r""" @brief Returns the name of the library or PCell or the real name of the cell @@ -1061,6 +1068,13 @@ class Cell: r""" @brief Clears the instance list """ + def clear_meta_info(self) -> None: + r""" + @brief Clears the meta information of the cell + See \LayoutMetaInfo for details about cells and meta information. + + This method has been introduced in version 0.28.8. + """ def clear_shapes(self) -> None: r""" @brief Clears all shapes in the cell @@ -1281,6 +1295,13 @@ class Cell: Starting with version 0.15, this iterator delivers \Instance objects rather than \CellInstArray objects. """ + def each_meta_info(self) -> Iterator[LayoutMetaInfo]: + r""" + @brief Iterates over the meta information of the cell + See \LayoutMetaInfo for details about cells and meta information. + + This method has been introduced in version 0.28.8. + """ @overload def each_overlapping_inst(self, b: Box) -> Iterator[Instance]: r""" @@ -1741,6 +1762,25 @@ class Cell: This method has been introduced in version 0.22. """ + def meta_info(self, name: str) -> LayoutMetaInfo: + r""" + @brief Gets the meta information for a given name + See \LayoutMetaInfo for details about cells and meta information. + + If no meta information with the given name exists, a default object with empty fields will be returned. + + This method has been introduced in version 0.28.8. + """ + def meta_info_value(self, name: str) -> Any: + r""" + @brief Gets the meta information value for a given name + See \LayoutMetaInfo for details about cells and meta information. + + If no meta information with the given name exists, a nil value will be returned. + A more generic version that delivers all fields of the meta information is \meta_info. + + This method has been introduced in version 0.28.8. + """ @overload def move(self, src: int, dest: int) -> None: r""" @@ -2073,6 +2113,13 @@ class Cell: This method has been introduced in version 0.22. """ + def remove_meta_info(self, name: str) -> None: + r""" + @brief Removes meta information from the cell + See \LayoutMetaInfo for details about cells and meta information. + + This method has been introduced in version 0.28.8. + """ @overload def replace(self, instance: Instance, cell_inst_array: CellInstArray) -> Instance: r""" @@ -3950,12 +3997,12 @@ class CompoundRegionOperationNode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -4078,12 +4125,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -4168,12 +4215,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -4258,12 +4305,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -10397,6 +10444,13 @@ class DPolygon: This method has been introduced in version 0.23. """ + def sort_holes(self) -> None: + r""" + @brief Brings the holes in a specific order + This function is normalize the hole order so the comparison of two polygons does not depend on the order the holes were inserted. Polygons generated by KLayout's alorithms have their holes sorted. + + This method has been introduced in version 0.28.8. + """ def split(self) -> List[DPolygon]: r""" @brief Splits the polygon into two or more parts @@ -12649,12 +12703,8 @@ class DeepShapeStore: def subcircuit_hierarchy_for_nets(self) -> None: r""" WARNING: This variable can only be set, not retrieved. - @brief Sets a value indicating whether to build a subcircuit hierarchy per net - - - This flag is used to determine the way, net subcircuit hierarchies are built: - when true, subcells are created for subcircuits on a net. Otherwise the net - shapes are produced flat inside the cell they appear on. + @brief Gets a value indicating whether to build a subcircuit hierarchy per net + See \subcircuit_hierarchy_for_nets= for details. This attribute has been introduced in version 0.28.4 """ @@ -12995,14 +13045,14 @@ class Device(NetlistObject): @overload def circuit(self) -> Circuit: r""" - @brief Gets the circuit the device lives in. + @brief Gets the circuit the device lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 """ @overload def circuit(self) -> Circuit: r""" - @brief Gets the circuit the device lives in (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the circuit the device lives in. """ def clear_combined_abstracts(self) -> None: r""" @@ -13087,7 +13137,7 @@ class Device(NetlistObject): @overload def net_for_terminal(self, terminal_name: str) -> Net: r""" - @brief Gets the net connected to the specified terminal. + @brief Gets the net connected to the specified terminal (non-const version). If the terminal is not connected, nil is returned for the net. This convenience method has been introduced in version 0.27.3. @@ -13095,7 +13145,7 @@ class Device(NetlistObject): @overload def net_for_terminal(self, terminal_name: str) -> Net: r""" - @brief Gets the net connected to the specified terminal (non-const version). + @brief Gets the net connected to the specified terminal. If the terminal is not connected, nil is returned for the net. This convenience method has been introduced in version 0.27.3. @@ -13241,14 +13291,14 @@ class DeviceAbstract: @overload def netlist(self) -> Netlist: r""" - @brief Gets the netlist the device abstract lives in (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the netlist the device abstract lives in. """ @overload def netlist(self) -> Netlist: r""" - @brief Gets the netlist the device abstract lives in. + @brief Gets the netlist the device abstract lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 """ class DeviceAbstractRef: @@ -15380,6 +15430,19 @@ class DeviceParameterDefinition: Setter: @brief Sets the description of the parameter. """ + geo_scaling_exponent: float + r""" + Getter: + @brief Gets the geometry scaling exponent. + This value is used when applying '.options scale' in the SPICE reader for example. It is zero for 'no scaling', 1.0 for linear scaling and 2.0 for quadratic scaling. + + This attribute has been added in version 0.28.6. + Setter: + @brief Sets the geometry scaling exponent. + See \geo_scaling_exponent for details. + + This attribute has been added in version 0.28.6. + """ is_primary: bool r""" Getter: @@ -15397,8 +15460,18 @@ class DeviceParameterDefinition: Setter: @brief Sets the name of the parameter. """ + si_scaling: float + r""" + Getter: + @brief Gets the scaling factor to SI units. + For parameters in micrometers - for example W and L of MOS devices - this factor can be set to 1e-6 to reflect the unit. + Setter: + @brief Sets the scaling factor to SI units. + + This setter has been added in version 0.28.6. + """ @classmethod - def new(cls, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> DeviceParameterDefinition: + def new(cls, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ..., geo_scaling_exponent: Optional[float] = ...) -> DeviceParameterDefinition: r""" @brief Creates a new parameter definition. @param name The name of the parameter @@ -15406,6 +15479,7 @@ class DeviceParameterDefinition: @param default_value The initial value @param is_primary True, if the parameter is a primary parameter (see \is_primary=) @param si_scaling The scaling factor to SI units + @param geo_scaling_exponent Indicates how the parameter scales with geometrical scaling (0: no scaling, 1.0: linear, 2.0: quadratic) """ def __copy__(self) -> DeviceParameterDefinition: r""" @@ -15415,7 +15489,7 @@ class DeviceParameterDefinition: r""" @brief Creates a copy of self """ - def __init__(self, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> None: + def __init__(self, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ..., geo_scaling_exponent: Optional[float] = ...) -> None: r""" @brief Creates a new parameter definition. @param name The name of the parameter @@ -15423,6 +15497,7 @@ class DeviceParameterDefinition: @param default_value The initial value @param is_primary True, if the parameter is a primary parameter (see \is_primary=) @param si_scaling The scaling factor to SI units + @param geo_scaling_exponent Indicates how the parameter scales with geometrical scaling (0: no scaling, 1.0: linear, 2.0: quadratic) """ def _create(self) -> None: r""" @@ -15497,11 +15572,6 @@ class DeviceParameterDefinition: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def si_scaling(self) -> float: - r""" - @brief Gets the scaling factor to SI units. - For parameters in micrometers for example, this factor will be 1e-6. - """ class DeviceReconnectedTerminal: r""" @@ -23323,11 +23393,11 @@ class Instance: Starting with version 0.25 the displacement is of vector type. Setter: - @brief Sets the displacement vector for the 'a' axis + @brief Sets the displacement vector for the 'a' axis in micrometer units - If the instance was not an array instance before it is made one. + Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. - This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. + This method has been introduced in version 0.25. """ b: Vector r""" @@ -23336,11 +23406,11 @@ class Instance: Starting with version 0.25 the displacement is of vector type. Setter: - @brief Sets the displacement vector for the 'b' axis + @brief Sets the displacement vector for the 'b' axis in micrometer units - If the instance was not an array instance before it is made one. + Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. - This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. + This method has been introduced in version 0.25. """ cell: Cell r""" @@ -23372,10 +23442,10 @@ class Instance: Getter: @brief Gets the basic \CellInstArray object associated with this instance reference. Setter: - @brief Returns the basic cell instance array object by giving a micrometer unit object. - This method replaces the instance by the given CellInstArray object and it internally transformed into database units. + @brief Changes the \CellInstArray object to the given one. + This method replaces the instance by the given CellInstArray object. - This method has been introduced in version 0.25 + This method has been introduced in version 0.22 """ cplx_trans: ICplxTrans r""" @@ -23383,10 +23453,9 @@ class Instance: @brief Gets the complex transformation of the instance or the first instance in the array This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. Setter: - @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + @brief Sets the complex transformation of the instance or the first instance in the array - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. """ da: DVector r""" @@ -24073,6 +24142,20 @@ class LEFDEFReaderConfiguration: This method has been introduced in version 0.26.4. """ + joined_paths: bool + r""" + Getter: + @brief Gets a value indicating whether to create joined paths for wires. + If this property is set to true, wires are represented by multi-segment paths as far as possible (this will fail for 45 degree path segments for example). By defauls, wires are represented by multiple straight segments. + + This property has been added in version 0.28.8. + + Setter: + @brief Sets a value indicating whether to create joined paths for wires. + See \joined_paths for details about this property. + + This property has been added in version 0.28.8. + """ labels_datatype: int r""" Getter: @@ -26246,6 +26329,7 @@ class Layout: Clears the layout completely. """ + @overload def clear_layer(self, layer_index: int) -> None: r""" @brief Clears a layer @@ -26257,6 +26341,24 @@ class Layout: @param layer_index The index of the layer to delete. """ @overload + def clear_layer(self, layer_index: int, flags: int) -> None: + r""" + @brief Clears a layer (given shape types only) + + Clears the layer: removes all shapes for the given shape types. + + This method was introduced in version 0.28.9. + + @param layer_index The index of the layer to delete. + @param flags The type selector for the shapes to delete (see \Shapes class, S... constants). + """ + def clear_meta_info(self) -> None: + r""" + @brief Clears the meta information of the layout + See \LayoutMetaInfo for details about layouts and meta information. + This method has been introduced in version 0.28.8. + """ + @overload def clip(self, cell: Cell, box: Box) -> Cell: r""" @brief Clips the given cell by the given rectangle and produce a new cell with the clip @@ -26352,17 +26454,32 @@ class Layout: This method has been added in version 0.23. """ + @overload def copy_layer(self, src: int, dest: int) -> None: r""" @brief Copies a layer - This method was introduced in version 0.19. - - Copy a layer from the source to the target. The target is not cleared before, so that this method - merges shapes from the source with the target layer. + Copies a layer from the source to the destination layer. The destination layer is not cleared before, so that this method + merges shapes from the source with the destination layer. @param src The layer index of the source layer. @param dest The layer index of the destination layer. + + This method was introduced in version 0.19. + """ + @overload + def copy_layer(self, src: int, dest: int, flags: int) -> None: + r""" + @brief Copies a layer (selected shape types only) + + Copies a layer from the source to the destination layer. The destination layer is not cleared before, so that this method + merges shapes from the source with the destination layer. + + @param src The layer index of the source layer. + @param dest The layer index of the destination layer. + @param flags A combination of the shape type flags from \Shapes, S... constants + + This method variant has been introduced in version 0.28.9. """ @overload def copy_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: @@ -26837,26 +26954,51 @@ class Layout: @brief Gets the library this layout lives in or nil if the layout is not part of a library This attribute has been introduced in version 0.27.5. """ - def meta_info_value(self, name: str) -> str: + def meta_info(self, name: str) -> LayoutMetaInfo: + r""" + @brief Gets the meta information for a given name + See \LayoutMetaInfo for details about layouts and meta information. + + If no meta information with the given name exists, nil is returned. + + This method has been introduced in version 0.28.8. + """ + def meta_info_value(self, name: str) -> Any: r""" @brief Gets the meta information value for a given name See \LayoutMetaInfo for details about layouts and meta information. - If no meta information with the given name exists, an empty string will be returned. + If no meta information with the given name exists, a nil value will be returned. + A more generic version that delivers all fields of the meta information is \meta_info. - This method has been introduced in version 0.25. + This method has been introduced in version 0.25. Starting with version 0.28.8, the value is of variant type instead of string only. """ + @overload def move_layer(self, src: int, dest: int) -> None: r""" @brief Moves a layer - This method was introduced in version 0.19. - - Move a layer from the source to the target. The target is not cleared before, so that this method - merges shapes from the source with the target layer. The source layer is empty after that operation. + Moves a layer from the source to the destination layer. The target is not cleared before, so that this method + merges shapes from the source with the destination layer. The source layer is empty after that operation. @param src The layer index of the source layer. @param dest The layer index of the destination layer. + + This method was introduced in version 0.19. + """ + @overload + def move_layer(self, src: int, dest: int, flags: int) -> None: + r""" + @brief Moves a layer (selected shape types only) + + Moves a layer from the source to the destination layer. The target is not cleared before, so that this method + merges shapes from the source with the destination layer. The copied shapes are removed from the source layer. + + @param src The layer index of the source layer. + @param dest The layer index of the destination layer. + @param flags A combination of the shape type flags from \Shapes, S... constants + + This method variant has been introduced in version 0.28.9. """ @overload def move_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: @@ -27338,6 +27480,13 @@ class LayoutDiff: @brief Compare array instances instance by instance This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. """ + IgnoreDuplicates: ClassVar[int] + r""" + @brief Ignore duplicate instances or shapes + With this option present, duplicate instances or shapes are ignored and duplication does not count as a difference. + + This option has been introduced in version 0.28.9. + """ NoLayerNames: ClassVar[int] r""" @brief Do not compare layer names @@ -27889,8 +28038,37 @@ class LayoutMetaInfo: Multiple layout meta information objects can be attached to one layout using \Layout#add_meta_info. Meta information is identified by a unique name and carries a string value plus an optional description string. The description string is for information only and is not evaluated by code. - See also \Layout#each_meta_info and \Layout#meta_info_value and \Layout#remove_meta_info - This class has been introduced in version 0.25. + Meta information can be attached to the layout object and to cells. It is similar to user properties. The differences are: + + @ul + @li Meta information is stored differently in GDS and OASIS files using the context information added by KLayout to annotated PCell or library cells too. Hence meta information does not pollute the standard user properties space. @/li + @li The value of meta information can be complex serializable types such as lists, hashes and elementary objects such as \Box or \DBox. Scalar types include floats and booleans. @/li + @li Meta information keys are strings and are supported also for GDS which only accepts integer number keys for user properties. @/li + @/ul + + Elementary (serializable) objects are: \Box, \DBox, \Edge, \DEdge, \EdgePair, \DEdgePair, \EdgePairs, \Edges, \LayerProperties, \Matrix2d, \Matrix3d, \Path, \DPath, \Point, \DPoint, \Polygon, \DPolygon, \SimplePolygon, \DSimplePolygon, \Region, \Text, \DText, \Texts, \Trans, \DTrans, \CplxTrans, \ICplxTrans, \DCplxTrans, \VCplxTrans, \Vector, \DVector (list may not be complete). + + KLayout itself also generates meta information with specific keys. For disambiguation, namespaces can be established by prefixing the key strings with some unique identifier in XML fashion, like a domain name - e.g. 'example.com:key'. + + @b Note: @/b only meta information marked with \is_persisted? == true is stored in GDS or OASIS files. This is not the default setting, so you need to explicitly set that flag. + + See also \Layout#each_meta_info, \Layout#meta_info_value, \Layout#meta_info and \Layout#remove_meta_info as well as the corresponding \Cell methods. + + An example of how to attach persisted meta information to a cell is here: + + @code + ly = RBA::Layout::new + c1 = ly.create_cell("C1") + + mi = RBA::LayoutMetaInfo::new("the-answer", 42.0) + mi.persisted = true + c1.add_meta_info(mi) + + # will now hold this piece of meta information attached to cell 'C1': + ly.write("to.gds") + @/code + + This class has been introduced in version 0.25 and was extended in version 0.28.8. """ description: str r""" @@ -27908,7 +28086,17 @@ class LayoutMetaInfo: Setter: @brief Sets the name of the layout meta info object """ - value: str + persisted: bool + r""" + Getter: + @brief Gets a value indicating whether the meta information will be persisted + This predicate was introduced in version 0.28.8. + + Setter: + @brief Sets a value indicating whether the meta information will be persisted + This predicate was introduced in version 0.28.8. + """ + value: Any r""" Getter: @brief Gets the value of the layout meta info object @@ -27917,12 +28105,15 @@ class LayoutMetaInfo: @brief Sets the value of the layout meta info object """ @classmethod - def new(cls, name: str, value: str, description: Optional[str] = ...) -> LayoutMetaInfo: + def new(cls, name: str, value: Any, description: Optional[str] = ..., persisted: Optional[bool] = ...) -> LayoutMetaInfo: r""" @brief Creates a layout meta info object @param name The name @param value The value @param description An optional description text + @param persisted If true, the meta information will be persisted in some file formats, like GDS2 + + The 'persisted' attribute has been introduced in version 0.28.8. """ def __copy__(self) -> LayoutMetaInfo: r""" @@ -27932,12 +28123,15 @@ class LayoutMetaInfo: r""" @brief Creates a copy of self """ - def __init__(self, name: str, value: str, description: Optional[str] = ...) -> None: + def __init__(self, name: str, value: Any, description: Optional[str] = ..., persisted: Optional[bool] = ...) -> None: r""" @brief Creates a layout meta info object @param name The name @param value The value @param description An optional description text + @param persisted If true, the meta information will be persisted in some file formats, like GDS2 + + The 'persisted' attribute has been introduced in version 0.28.8. """ def _create(self) -> None: r""" @@ -28007,6 +28201,11 @@ class LayoutMetaInfo: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ + def is_persisted(self) -> bool: + r""" + @brief Gets a value indicating whether the meta information will be persisted + This predicate was introduced in version 0.28.8. + """ class LayoutQuery: r""" @@ -29635,12 +29834,12 @@ class LoadLayoutOptions: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -30428,15 +30627,6 @@ class LoadLayoutOptions: This attribute has been added in version 0.28. """ @classmethod - def from_technology(cls, technology: str) -> LoadLayoutOptions: - r""" - @brief Gets the reader options of a given technology - @param technology The name of the technology to apply - Returns the reader options of a specific technology. If the technology name is not valid or an empty string, the reader options of the default technology are returned. - - This method has been introduced in version 0.25 - """ - @classmethod def new(cls) -> LoadLayoutOptions: r""" @brief Creates a new object of this class @@ -33081,10 +33271,20 @@ class NetTracerTechnologyComponent(TechnologyComponent): Usually it's not required to call this method. It has been introduced in version 0.24. """ + def add(self, connection: NetTracerConnectivity) -> None: + r""" + @brief Adds a connectivity definition. + This method has been introduced in version 0.28.7 + """ def assign(self, other: TechnologyComponent) -> None: r""" @brief Assigns another object to self """ + def clear(self) -> None: + r""" + @brief Removes all connectivity definitions. + This method has been introduced in version 0.28.7 + """ def dup(self) -> NetTracerTechnologyComponent: r""" @brief Creates a copy of self @@ -33226,14 +33426,6 @@ class Netlist: This constness variant has been introduced in version 0.26.8. """ @overload - def circuits_by_name(self, name_pattern: str) -> List[Circuit]: - r""" - @brief Gets the circuit objects for a given name filter. - The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - - This method has been introduced in version 0.26.4. - """ - @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" @brief Gets the circuit objects for a given name filter (const version). @@ -33242,6 +33434,14 @@ class Netlist: This constness variant has been introduced in version 0.26.8. """ + @overload + def circuits_by_name(self, name_pattern: str) -> List[Circuit]: + r""" + @brief Gets the circuit objects for a given name filter. + The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. + + This method has been introduced in version 0.26.4. + """ def combine_devices(self) -> None: r""" @brief Combines devices where possible @@ -33326,14 +33526,14 @@ class Netlist: @overload def each_device_class(self) -> Iterator[DeviceClass]: r""" - @brief Iterates over the device classes of the netlist + @brief Iterates over the device classes of the netlist (const version) + + This constness variant has been introduced in version 0.26.8. """ @overload def each_device_class(self) -> Iterator[DeviceClass]: r""" - @brief Iterates over the device classes of the netlist (const version) - - This constness variant has been introduced in version 0.26.8. + @brief Iterates over the device classes of the netlist """ def flatten(self) -> None: r""" @@ -34760,14 +34960,6 @@ class NetlistSpiceReader(NetlistReader): r""" @brief Creates a new reader with a delegate. """ - def __copy__(self) -> NetlistSpiceReader: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistSpiceReader: - r""" - @brief Creates a copy of self - """ @overload def __init__(self) -> None: r""" @@ -34815,14 +35007,6 @@ class NetlistSpiceReader(NetlistReader): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: NetlistReader) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> NetlistSpiceReader: - r""" - @brief Creates a copy of self - """ class NetlistSpiceReaderDelegate: r""" @@ -34887,6 +35071,15 @@ class NetlistSpiceReaderDelegate: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def apply_parameter_scaling(self, device: Device) -> None: + r""" + @brief Applies parameter scaling to the given device + Applies SI scaling (according to the parameter's si_scaling attribute) and geometry scaling (according to the parameter's geo_scale_exponent attribute) to the device parameters. Use this method of finish the device when you have created a custom device yourself. + + The geometry scale is taken from the '.options scale=...' control statement. + + This method has been introduced in version 0.28.6. + """ def assign(self, other: NetlistSpiceReaderDelegate) -> None: r""" @brief Assigns another object to self @@ -34929,6 +35122,11 @@ class NetlistSpiceReaderDelegate: r""" @hide """ + def get_scale(self) -> float: + r""" + @brief Gets the scale factor set with '.options scale=...' + This method has been introduced in version 0.28.6. + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -35885,12 +36083,12 @@ class PCellParameterState: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -35915,12 +36113,12 @@ class PCellParameterState: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -38294,6 +38492,13 @@ class Polygon: This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27. """ + def sort_holes(self) -> None: + r""" + @brief Brings the holes in a specific order + This function is normalize the hole order so the comparison of two polygons does not depend on the order the holes were inserted. Polygons generated by KLayout's alorithms have their holes sorted. + + This method has been introduced in version 0.28.8. + """ def split(self) -> List[Polygon]: r""" @brief Splits the polygon into two or more parts @@ -38670,12 +38875,12 @@ class PropertyConstraint: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -38700,12 +38905,12 @@ class PropertyConstraint: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -40244,12 +40449,12 @@ class Region(ShapeCollection): @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -40274,12 +40479,12 @@ class Region(ShapeCollection): @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -43978,11 +44183,12 @@ class Shape: This method has been introduced in version 0.23. Setter: - @brief Sets the lower left point of the box + @brief Sets the lower left corner of the box with the point being given in micrometer units Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. - This method has been introduced in version 0.23. + This method has been introduced in version 0.25. """ box_p2: Point r""" @@ -43994,11 +44200,12 @@ class Shape: This method has been introduced in version 0.23. Setter: - @brief Sets the upper right point of the box + @brief Sets the upper right corner of the box with the point being given in micrometer units Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. - This method has been introduced in version 0.23. + This method has been introduced in version 0.25. """ box_width: int r""" @@ -44204,11 +44411,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a path. Setter: - @brief Replaces the shape by the given path object - This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + @brief Replaces the shape by the given path (in micrometer units) + This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ path_bgnext: int r""" @@ -44316,10 +44522,11 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon. Setter: - @brief Replaces the shape by the given polygon (in micrometer units) - This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally. + @brief Replaces the shape by the given polygon object + This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - This method has been introduced in version 0.25. + This method has been introduced in version 0.22. """ prop_id: int r""" @@ -44358,11 +44565,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. Setter: - @brief Replaces the shape by the given simple polygon object - This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + @brief Replaces the shape by the given simple polygon (in micrometer units) + This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ text: Any r""" @@ -45543,10 +45749,16 @@ class Shapes: SAll: ClassVar[int] r""" @brief Indicates that all shapes shall be retrieved + You can use this constant to construct 'except' classes - e.g. to specify 'all shape types except boxes' use + + @code SAll - SBoxes @/code """ SAllWithProperties: ClassVar[int] r""" @brief Indicates that all shapes with properties shall be retrieved + Using this selector means to retrieve only shapes with properties.You can use this constant to construct 'except' classes - e.g. to specify 'all shape types with properties except boxes' use + + @code SAllWithProperties - SBoxes @/code """ SBoxes: ClassVar[int] r""" @@ -45576,6 +45788,7 @@ class Shapes: SProperties: ClassVar[int] r""" @brief Indicates that only shapes with properties shall be retrieved + You can or-combine this flag with the plain shape types to select a certain shape type, but only those shapes with properties. For example to select boxes with properties, use 'SProperties | SBoxes'. """ SRegions: ClassVar[int] r""" @@ -45600,11 +45813,17 @@ class Shapes: def s_all(cls) -> int: r""" @brief Indicates that all shapes shall be retrieved + You can use this constant to construct 'except' classes - e.g. to specify 'all shape types except boxes' use + + @code SAll - SBoxes @/code """ @classmethod def s_all_with_properties(cls) -> int: r""" @brief Indicates that all shapes with properties shall be retrieved + Using this selector means to retrieve only shapes with properties.You can use this constant to construct 'except' classes - e.g. to specify 'all shape types with properties except boxes' use + + @code SAllWithProperties - SBoxes @/code """ @classmethod def s_boxes(cls) -> int: @@ -45641,6 +45860,7 @@ class Shapes: def s_properties(cls) -> int: r""" @brief Indicates that only shapes with properties shall be retrieved + You can or-combine this flag with the plain shape types to select a certain shape type, but only those shapes with properties. For example to select boxes with properties, use 'SProperties | SBoxes'. """ @classmethod def s_regions(cls) -> int: @@ -45731,10 +45951,19 @@ class Shapes: This method has been added in version 0.28. """ + @overload def clear(self) -> None: r""" @brief Clears the shape container - This method has been introduced in version 0.16. It can only be used in editable mode. + This method has been introduced in version 0.16. + """ + @overload + def clear(self, flags: int) -> None: + r""" + @brief Clears certain shape types from the shape container + Only shapes matching the shape types from 'flags' are removed. 'flags' is a combination of the S... constants. + + This method has been introduced in version 0.28.9. """ def create(self) -> None: r""" @@ -47549,15 +47778,15 @@ class SubCircuit(NetlistObject): @overload def circuit_ref(self) -> Circuit: r""" - @brief Gets the circuit referenced by the subcircuit (non-const version). - - - This constness variant has been introduced in version 0.26.8 + @brief Gets the circuit referenced by the subcircuit. """ @overload def circuit_ref(self) -> Circuit: r""" - @brief Gets the circuit referenced by the subcircuit. + @brief Gets the circuit referenced by the subcircuit (non-const version). + + + This constness variant has been introduced in version 0.26.8 """ @overload def connect_pin(self, pin: Pin, net: Net) -> None: @@ -47594,12 +47823,6 @@ class SubCircuit(NetlistObject): When assigned, the subcircuit ID is not 0. """ @overload - def net_for_pin(self, pin_id: int) -> Net: - r""" - @brief Gets the net connected to the specified pin of the subcircuit. - If the pin is not connected, nil is returned for the net. - """ - @overload def net_for_pin(self, pin_id: int) -> Net: r""" @brief Gets the net connected to the specified pin of the subcircuit (non-const version). @@ -47607,6 +47830,12 @@ class SubCircuit(NetlistObject): This constness variant has been introduced in version 0.26.8 """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net connected to the specified pin of the subcircuit. + If the pin is not connected, nil is returned for the net. + """ class Technology: r""" @@ -49922,14 +50151,6 @@ class TilingProcessor: @param edges The \Edges object to which the data is sent """ @overload - def output(self, name: str, image: lay.BasicImage) -> None: - r""" - @brief Specifies output to an image - This method will establish an output channel which delivers float data to image data. The image is a monochrome image where each pixel corresponds to a single tile. This method for example is useful to collect density information into an image. The image is configured such that each pixel covers one tile. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - """ - @overload def output(self, name: str, layout: Layout, cell: int, layer_index: int) -> None: r""" @brief Specifies output to a layout layer @@ -49956,14 +50177,6 @@ class TilingProcessor: @param lp The layer specification where the output will be sent to """ @overload - def output(self, name: str, rdb: rdb.ReportDatabase, cell_id: int, category_id: int) -> None: - r""" - @brief Specifies output to a report database - This method will establish an output channel for the processor. The output sent to that channel will be put into the report database given by the "rdb" parameter. "cell_id" specifies the cell and "category_id" the category to use. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - """ - @overload def output(self, name: str, rec: TileOutputReceiverBase) -> None: r""" @brief Specifies output for the tiling processor @@ -50866,12 +51079,12 @@ class TrapezoidDecompositionMode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -51175,12 +51388,12 @@ class VAlign: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -51205,12 +51418,12 @@ class VAlign: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi index 83fd6ba69..0a41cc3f2 100644 --- a/src/pymod/distutils_src/klayout/laycore.pyi +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -337,11 +337,11 @@ class ActionBase: def icon(self) -> None: r""" WARNING: This variable can only be set, not retrieved. - @brief Sets the icon to the given image file + @brief Sets the icon to the given \QIcon object - @param file The image file to load for the icon + @param qicon The QIcon object - Passing an empty string will reset the icon. + This variant has been added in version 0.28. """ default_shortcut: str r""" @@ -1539,6 +1539,11 @@ class BitmapBuffer: This method may not be available if PNG support is not compiled into KLayout. """ @classmethod + def from_qimage(cls, qimage: QtGui.QImage_Native) -> BitmapBuffer: + r""" + @brief Creates a pixel buffer object from a QImage object + """ + @classmethod def new(cls, width: int, height: int) -> BitmapBuffer: r""" @brief Creates a pixel buffer object @@ -1672,6 +1677,10 @@ class BitmapBuffer: @brief Converts the pixel buffer to a PNG byte stream This method may not be available if PNG support is not compiled into KLayout. """ + def to_qimage(self) -> QtGui.QImage_Native: + r""" + @brief Converts the pixel buffer to a \QImage object + """ def width(self) -> int: r""" @brief Gets the width of the pixel buffer in pixels @@ -1682,7 +1691,7 @@ class BitmapBuffer: This method may not be available if PNG support is not compiled into KLayout. """ -class BrowserDialog: +class BrowserDialog(QDialog_Native): r""" @brief A HTML display and browser dialog @@ -1755,6 +1764,20 @@ class BrowserDialog: """ @overload @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, html: str) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a static HTML content + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + @classmethod def new(cls, source: BrowserSource) -> BrowserDialog: r""" @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code @@ -1767,6 +1790,18 @@ class BrowserDialog: This method has been introduced in version 0.23. """ @overload + def __init__(self, parent: QtWidgets.QWidget_Native, html: str) -> None: + r""" + @brief Creates a HTML browser window with a static HTML content + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> None: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload def __init__(self, source: BrowserSource) -> None: r""" @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code @@ -1809,23 +1844,6 @@ class BrowserDialog: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ def exec_(self) -> int: r""" @brief Executes the HTML browser dialog as a modal window @@ -1834,16 +1852,6 @@ class BrowserDialog: r""" @brief Executes the HTML browser dialog as a modal window """ - def hide(self) -> None: - r""" - @brief Hides the HTML browser window - """ - def is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ def load(self, url: str) -> None: r""" @brief Loads the given URL into the browser dialog @@ -1890,9 +1898,122 @@ class BrowserDialog: Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. """ - def show(self) -> None: + +class BrowserPanel(QWidget_Native): + r""" + @brief A HTML display and browser widget + + This widget provides the functionality of \BrowserDialog within a widget. It can be embedded into other dialogs. For details about the use model of this class see \BrowserDialog. + + This class has been introduced in version 0.25. + """ + @property + def home(self) -> None: r""" - @brief Shows the HTML browser window in a non-modal way + WARNING: This variable can only be set, not retrieved. + @brief Sets the browser widget's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + @property + def label(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the label text + + The label is shown left of the navigation buttons. + By default, no label is specified. + """ + @property + def source(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native) -> BrowserPanel: + r""" + @brief Creates a HTML browser widget + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> BrowserPanel: + r""" + @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native) -> None: + r""" + @brief Creates a HTML browser widget + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> None: + r""" + @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def load(self, url: str) -> None: + r""" + @brief Loads the given URL into the browser widget + Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. + """ + def reload(self) -> None: + r""" + @brief Reloads the current page + """ + def search(self, search_item: str) -> None: + r""" + @brief Issues a search request using the given search item and the search URL specified with \set_search_url + + See \search_url= for a description of the search mechanism. + """ + def set_search_url(self, url: str, query_item: str) -> None: + r""" + @brief Enables the search field and specifies the search URL generated for a search + + If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". + """ + def url(self) -> str: + r""" + @brief Gets the URL currently shown """ class BrowserSource: @@ -1997,6 +2118,12 @@ class BrowserSource: r""" @brief Creates a copy of self """ + def get_image(self, url: str) -> QtGui.QImage_Native: + r""" + @brief Gets the image object for a specific URL + + This method has been introduced in version 0.28. + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -2105,6 +2232,9 @@ class BrowserSource_Native: def get(self, arg0: str) -> str: r""" """ + def get_image(self, url: str) -> QtGui.QImage_Native: + r""" + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -3236,7 +3366,7 @@ class FileDialog: In that case, only const methods may be called on self. """ -class HelpDialog: +class HelpDialog(QDialog_Native): r""" @brief The help dialog @@ -3244,12 +3374,20 @@ class HelpDialog: This class has been added in version 0.25. """ + @overload @classmethod def new(cls, modal: bool) -> HelpDialog: r""" @brief Creates a new help dialog If the modal flag is true, the dialog will be shown as a modal window. """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, modal: bool) -> HelpDialog: + r""" + @brief Creates a new help dialog + If the modal flag is true, the dialog will be shown as a modal window. + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -3287,33 +3425,6 @@ class HelpDialog: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def exec_(self) -> int: - r""" - @brief Executes the dialog (shows it modally) - """ - def is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ def load(self, url: str) -> None: r""" @brief Loads the specified URL @@ -3324,10 +3435,6 @@ class HelpDialog: @brief Issues a search on the specified topic This method will call the search page with the given topic. """ - def show(self) -> None: - r""" - @brief Shows the dialog - """ class HelpSource(BrowserSource_Native): r""" @@ -3393,6 +3500,10 @@ class HelpSource(BrowserSource_Native): Usually it's not required to call this method. It has been introduced in version 0.24. """ + def get_dom(self, path: str) -> QtXml.QDomDocument: + r""" + @brief Reserved for internal use + """ def get_option(self, key: str) -> Any: r""" @brief Reserved for internal use @@ -6293,12 +6404,12 @@ class LayoutViewBase: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -7491,6 +7602,33 @@ class LayoutViewBase: @param cv_index The cellview index for which to get the current path from (usually this will be the active cellview index) This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell. """ + def get_image(self, width: int, height: int) -> QtGui.QImage_Native: + r""" + @brief Gets the layout image as a \QImage + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. + """ + def get_image_with_options(self, width: int, height: int, linewidth: Optional[int] = ..., oversampling: Optional[int] = ..., resolution: Optional[float] = ..., target: Optional[db.DBox] = ..., monochrome: Optional[bool] = ...) -> QtGui.QImage_Native: + r""" + @brief Gets the layout image as a \QImage (with options) + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + @param linewidth The width of a line in pixels (usually 1) or 0 for default. + @param oversampling The oversampling factor (1..3) or 0 for default. + @param resolution The resolution (pixel size compared to a screen pixel size, i.e 1/oversampling) or 0 for default. + @param target_box The box to draw or an empty box for default. + @param monochrome If true, monochrome images will be produced. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently. + + This method has been introduced in version 0.23.10. + """ def get_line_style(self, index: int) -> str: r""" @brief Gets the line style string for the style with the given index @@ -7541,6 +7679,12 @@ class LayoutViewBase: This method has been introduced in 0.28. """ + def get_screenshot(self) -> QtGui.QImage_Native: + r""" + @brief Gets a screenshot as a \QImage + + Getting the image requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout. + """ def get_screenshot_pixels(self) -> PixelBuffer: r""" @brief Gets a screenshot as a \PixelBuffer @@ -8444,6 +8588,12 @@ class LayoutViewBase: @brief Returns the viewport width in pixels This method was introduced in version 0.18. """ + def widget(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the QWidget object of the view + + This method has been introduced in version 0.28.7. + """ def zoom_box(self, box: db.DBox) -> None: r""" @brief Sets the viewport to the given box @@ -8469,6 +8619,119 @@ class LayoutViewBase: @brief Zooms out somewhat """ +class LayoutViewWidget(QFrame_Native): + r""" + This object produces a widget which embeds a LayoutView. This widget can be used inside Qt widget hierarchies. + To access the \LayoutView object within, use \view. + + This class has been introduced in version 0.28. + """ + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutViewWidget: + r""" + @brief Creates a standalone view widget + + @param parent The parent widget in which to embed the view + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def __init__(self, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: + r""" + @brief Creates a standalone view widget + + @param parent The parent widget in which to embed the view + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def bookmarks_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the bookmarks side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def hierarchy_control_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the cell view (hierarchy view) side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def layer_control_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the layer control side widget + A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. + + The side widget can be configured through the views configuration interface. + + This method has been introduced in version 0.27 + """ + def layer_toolbox_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the layer toolbox side widget + A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. + + The side widget can be configured through the views configuration interface. + + This method has been introduced in version 0.28 + """ + def libraries_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the library view side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def view(self) -> LayoutView: + r""" + @brief Gets the embedded view object. + """ + class Macro: r""" @brief A macro class @@ -8547,12 +8810,12 @@ class Macro: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -9426,7 +9689,7 @@ class MacroInterpreter: Registration of the interpreter makes the object known to the system. After registration, macros whose interpreter is set to 'dsl' can use this object to run the script. For executing a script, the system will call the interpreter's \execute method. """ -class MainWindow: +class MainWindow(QMainWindow_Native): r""" @brief The main application window and central controller object @@ -9490,6 +9753,30 @@ class MainWindow: Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_current_view_observer/remove_current_view_observer) have been removed in 0.25. """ + on_session_about_to_be_restored: None + r""" + Getter: + @brief An event indicating that a session is about to be restored + + This event has been added in version 0.28.8. + + Setter: + @brief An event indicating that a session is about to be restored + + This event has been added in version 0.28.8. + """ + on_session_restored: None + r""" + Getter: + @brief An event indicating that a session was restored + + This event has been added in version 0.28.8. + + Setter: + @brief An event indicating that a session was restored + + This event has been added in version 0.28.8. + """ on_view_closed: None r""" Getter: @@ -9541,15 +9828,6 @@ class MainWindow: This method has been introduced in version 0.27. """ - @classmethod - def new(cls) -> MainWindow: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -10346,11 +10624,6 @@ class MainWindow: This method has been introduced in version 0.27. """ - def create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ @overload def create_layout(self, mode: int) -> CellView: r""" @@ -10398,18 +10671,6 @@ class MainWindow: @return A reference to a \LayoutView object representing the current view. """ - def destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ def dispatcher(self) -> Dispatcher: r""" @brief Gets the dispatcher interface (the plugin root configuration space) @@ -10492,12 +10753,6 @@ class MainWindow: This method has been added in version 0.25. """ - def is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ @overload def load_layout(self, filename: str, mode: Optional[int] = ...) -> CellView: r""" @@ -10975,7 +11230,7 @@ class Marker: The set method has been added in version 0.20. """ -class MessageBox: +class MessageBox(QMainWindow_Native): r""" @brief Various methods to display message boxes This class provides some basic message boxes. This functionality is provided through the static (class) methods \warning, \question and so on. @@ -11074,11 +11329,6 @@ class MessageBox: @return The button constant describing the button that was pressed """ @classmethod - def new(cls) -> MessageBox: - r""" - @brief Creates a new object of this class - """ - @classmethod def question(cls, title: str, text: str, buttons: int) -> int: r""" @brief Open a question message box @@ -11104,10 +11354,6 @@ class MessageBox: r""" @brief Creates a copy of self """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -11145,37 +11391,14 @@ class MessageBox: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: MessageBox) -> None: + def assign(self, other: QObject_Native) -> None: r""" @brief Assigns another object to self """ - def create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ def dup(self) -> MessageBox: r""" @brief Creates a copy of self """ - def is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ class NetlistBrowserDialog: r""" @@ -11950,6 +12173,11 @@ class PixelBuffer: This method may not be available if PNG support is not compiled into KLayout. """ @classmethod + def from_qimage(cls, qimage: QtGui.QImage_Native) -> PixelBuffer: + r""" + @brief Creates a pixel buffer object from a QImage object + """ + @classmethod def new(cls, width: int, height: int) -> PixelBuffer: r""" @brief Creates a pixel buffer object @@ -12058,6 +12286,12 @@ class PixelBuffer: r""" @brief Creates a copy of self """ + @overload + def fill(self, color: QtGui.QColor) -> None: + r""" + @brief Fills the pixel buffer with the given QColor + """ + @overload def fill(self, color: int) -> None: r""" @brief Fills the pixel buffer with the given pixel value @@ -12095,6 +12329,10 @@ class PixelBuffer: @brief Converts the pixel buffer to a PNG byte stream This method may not be available if PNG support is not compiled into KLayout. """ + def to_qimage(self) -> QtGui.QImage_Native: + r""" + @brief Converts the pixel buffer to a \QImage object + """ def width(self) -> int: r""" @brief Gets the width of the pixel buffer in pixels diff --git a/version.sh b/version.sh index b99f42265..87e36a3ce 100644 --- a/version.sh +++ b/version.sh @@ -2,10 +2,10 @@ # This script is sourced to define the main version parameters # The main version -KLAYOUT_VERSION="0.28.8" +KLAYOUT_VERSION="0.28.9" # The version used for PyPI (don't use variables here!) -KLAYOUT_PYPI_VERSION="0.28.8" +KLAYOUT_PYPI_VERSION="0.28.9" # The build date KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d")