mirror of https://github.com/KLayout/klayout.git
WIP: Provide a way to force-include enums and use it for QTextDocument::PropertyType
This commit is contained in:
parent
a17f89201f
commit
ef13bb7528
|
|
@ -851,6 +851,8 @@ drop_method "QMenuBar", /QMenuBar::platformMenuBar/ # QPlatformMenu not availab
|
|||
drop_method "QTreeWidgetItem", /::QTreeWidgetItem\(const\s+QTreeWidgetItem\s*&/ # will hide the parent-constructor otherwise. Use dup/copy protocol instead.
|
||||
drop_method "QInputMethodEvent", /::clone\(/ # returns QInputMethodEvent *, not Event * (@@@ TODO: bug?)
|
||||
|
||||
include_enum "QTextDocument", /^ResourceType$/
|
||||
|
||||
rename "QRawFont", /QRawFont::supportsCharacter\(.*ucs4/, "supportsCharacter_ucs4"
|
||||
drop_method "QTextLine", /QTextLine::cursorToX\(.*int\s*\*/ # clashes with int-only version
|
||||
drop_method "QPainter", /QPainter::drawRects.*QRect\s+\*/ # requires pointers, alternative available
|
||||
|
|
|
|||
|
|
@ -954,6 +954,7 @@ class Configurator
|
|||
@dropped_methods = {}
|
||||
@dropped_classes = {}
|
||||
@dropped_enums = {}
|
||||
@included_enums = {}
|
||||
@renamed_methods = {}
|
||||
@kept_args = {}
|
||||
@owner_args = {}
|
||||
|
|
@ -1274,6 +1275,16 @@ class Configurator
|
|||
gsub(/\s+/, "")
|
||||
end
|
||||
|
||||
def include_enum(cls, sig)
|
||||
@included_enums[cls] ||= []
|
||||
@included_enums[cls] << sig
|
||||
end
|
||||
|
||||
def is_enum_included?(cls, sig)
|
||||
dm = (@included_enums[:all_classes] || []) + (@included_enums[cls] || [])
|
||||
dm.find { |d| sig =~ d } != nil
|
||||
end
|
||||
|
||||
def drop_enum(cls, sig)
|
||||
@dropped_enums[cls] ||= []
|
||||
@dropped_enums[cls] << sig
|
||||
|
|
@ -1847,7 +1858,7 @@ END
|
|||
mmap = {}
|
||||
struct.collect_methods(methods_by_name)
|
||||
struct.collect_all_methods(all_methods_by_name, conf)
|
||||
struct.collect_enum_decls(enum_decls_by_name) { |bd| self.is_enum_used?(bd) }
|
||||
struct.collect_enum_decls(enum_decls_by_name) { |bd| self.is_enum_used?(bd) || conf.is_enum_included?(cls, bd.myself) }
|
||||
|
||||
# if one method is abstract, omit ctors for example
|
||||
is_abstract = all_methods_by_name.values.find do |m|
|
||||
|
|
|
|||
Loading…
Reference in New Issue