class

Bindgen::Processor::QtMetaObject

Inherits Bindgen::Processor::Base < Bindgen::Graph::Visitor < Reference < Object

Meta-objects for Crystal subclasses of QObject classes (SPEC.md §Q.4): the signals, slots and properties a Crystal class declares with the signal, @[Qt::Slot] and qt_property macros of the QObject wrapper class, which this processor adds from assets/qt_meta_object.cr.

Runs after virtual_override, whose C++ subclass of every class deriving from QObject gets a bgMeta pointer to a BindgenQtMetaObject (see assets/bindgen_qt_meta.hpp, which the glue must include), and overrides of metaObject, qt_metacast and qt_metacall using it. The Qt processor made those methods non-virtual for the wrappers. A SET_META function, called by a post-hook of the constructors, sets the pointer to the meta-object of the Crystal class, which its finished macro built.

Constants

BUILTIN_CRYSTAL_TYPES = ["Int8", "Int16", "Int32", "Int64", "UInt8", "UInt16", "UInt32", "UInt64", "Float32", "Float64", "Bool", "Nil", "String", "Bytes", "Void"] of ::String

The Crystal types BindgenMeta.cpp_type_name maps itself.

CLASS_MARKER = "########## CLASS ##########"

Separates the code of the module from the code of the QObject class in GLUE_PATH.

CONVERTED_PREFIX = "bg_qt_meta"

Prefix of the conversion functions of a converted value type.

GLUE_PATH = "/tmp/tmp.jlhHHN/src/src/bindgen/processor/../../../assets/qt_meta_object.cr"

The Crystal code added, see #add_glue.

Log = ::Log.for(self)

Meta-objects for Crystal subclasses of QObject classes (SPEC.md §Q.4): the signals, slots and properties a Crystal class declares with the signal, @[Qt::Slot] and qt_property macros of the QObject wrapper class, which this processor adds from assets/qt_meta_object.cr.

Runs after virtual_override, whose C++ subclass of every class deriving from QObject gets a bgMeta pointer to a BindgenQtMetaObject (see assets/bindgen_qt_meta.hpp, which the glue must include), and overrides of metaObject, qt_metacast and qt_metacall using it. The Qt processor made those methods non-virtual for the wrappers. A SET_META function, called by a post-hook of the constructors, sets the pointer to the meta-object of the Crystal class, which its finished macro built.

META_FIELD = "bgMeta"

Name of the field holding it in the C++ subclass.

META_TYPE = "BindgenQtMetaObject"

The C++ type of a meta-object, of bindgen_qt_meta.hpp.

QOBJECT = "QObject"

The class whose subclasses get meta-objects.

SET_META = "SET_META"

Name of the function setting the meta-object of an object.

Instance methods

process(graph : Graph::Container, doc : Parser::Document)

Runs the processor. You may change graph as you see fit.

Source
visit_class(klass)

Visits a Graph::Class. The default implementation calls #visit_children to visit all child nodes.

Source

Nested types