Lines Matching full:obj
53 #define QOBJECT_INTERNAL(obj, _obj) ({ \ argument
54 typeof(obj) _obj = (obj); \
57 #define QOBJECT(obj) QOBJECT_INTERNAL((obj), MAKE_IDENTIFIER(_obj)) argument
70 #define qobject_to(type, obj) \ argument
71 ((type *)qobject_check_type(obj, glue(QTYPE_CAST_TO_, type)))
73 static inline void qobject_ref_impl(QObject *obj) in qobject_ref_impl() argument
75 if (obj) { in qobject_ref_impl()
76 obj->base.refcnt++; in qobject_ref_impl()
93 void qobject_destroy(QObject *obj);
95 static inline void qobject_unref_impl(QObject *obj) in qobject_unref_impl() argument
97 assert(!obj || obj->base.refcnt); in qobject_unref_impl()
98 if (obj && --obj->base.refcnt == 0) { in qobject_unref_impl()
99 qobject_destroy(obj); in qobject_unref_impl()
106 * Returns: the same @obj. The type of @obj will be propagated to the
109 #define qobject_ref(obj) ({ \ argument
110 typeof(obj) _o = (obj); \
119 #define qobject_unref(obj) qobject_unref_impl(QOBJECT(obj)) argument
124 static inline QType qobject_type(const QObject *obj) in qobject_type() argument
126 assert(QTYPE_NONE < obj->base.type && obj->base.type < QTYPE__MAX); in qobject_type()
127 return obj->base.type; in qobject_type()
132 * Return @obj, but only if @obj is not NULL and @type is equal to
133 * @obj's type. Return NULL otherwise.
135 static inline QObject *qobject_check_type(const QObject *obj, QType type) in qobject_check_type() argument
137 if (obj && qobject_type(obj) == type) { in qobject_check_type()
138 return (QObject *)obj; in qobject_check_type()