class Bindgen::Processor::QtMetaObject

Overview

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.

Defined in:

bindgen/processor/qt_meta_object.cr

Constant Summary

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 = "/srv/crystaldoc.info/github-Papierkorb-bindgen-v0.16.2/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 Method Summary

Instance methods inherited from class Bindgen::Processor::Base

inherited_rules(class_name : String, & : TypeDatabase::TypeConfig -> TypeDatabase::KeepAlive) : TypeDatabase::KeepAlive inherited_rules, process(graph : Graph::Container, doc : Parser::Document) process, unmatched_patterns(klass : Graph::Class, rules : TypeDatabase::KeepAlive) : Array(Regex) unmatched_patterns

Constructor methods inherited from class Bindgen::Processor::Base

new(config : Configuration, db : TypeDatabase) new

Instance methods inherited from module Bindgen::Graph::Visitor

visit_alias(alias_name) visit_alias, visit_children(container : Container) visit_children, visit_class(klass) visit_class, visit_constant(constant) visit_constant, visit_enum(enumeration) visit_enum, visit_library(library) visit_library, visit_method(method) visit_method, visit_namespace(ns) visit_namespace, visit_node(node : Node) visit_node, visit_node?(node : Node) visit_node?, visit_platform_specific(specific) visit_platform_specific, visit_struct(structure) visit_struct, visit_union(structure) visit_union

Instance Method Detail

def process(graph : Graph::Container, doc : Parser::Document) #
Description copied from class Bindgen::Processor::Base

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


[View source]
def visit_class(klass) #
Description copied from module Bindgen::Graph::Visitor

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


[View source]