1 //******************************************************************************
2 //  Copyright (c) 2005-2013 by Jan Van hijfte
3 //
4 //  See the included file COPYING.TXT for details about the copyright.
5 //
6 //  This program is distributed in the hope that it will be useful,
7 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 //******************************************************************************
10 
11 
12 #include "qobject_c.h"
13 
QObject_Create(QObjectH parent)14 QObjectH QObject_Create(QObjectH parent)
15 {
16 	return (QObjectH) new QObject((QObject*)parent);
17 }
18 
QObject_Destroy(QObjectH handle)19 void QObject_Destroy(QObjectH handle)
20 {
21 	delete (QObject *)handle;
22 }
23 
QObject_event(QObjectH handle,QEventH AnonParam1)24 bool QObject_event(QObjectH handle, QEventH AnonParam1)
25 {
26 	return (bool) ((QObject *)handle)->event((QEvent*)AnonParam1);
27 }
28 
QObject_eventFilter(QObjectH handle,QObjectH AnonParam1,QEventH AnonParam2)29 bool QObject_eventFilter(QObjectH handle, QObjectH AnonParam1, QEventH AnonParam2)
30 {
31 	return (bool) ((QObject *)handle)->eventFilter((QObject*)AnonParam1, (QEvent*)AnonParam2);
32 }
33 
QObject_objectName(QObjectH handle,PWideString retval)34 void QObject_objectName(QObjectH handle, PWideString retval)
35 {
36 	QString t_retval;
37 	t_retval = ((QObject *)handle)->objectName();
38 	copyQStringToPWideString(t_retval, retval);
39 }
40 
QObject_setObjectName(QObjectH handle,PWideString name)41 void QObject_setObjectName(QObjectH handle, PWideString name)
42 {
43 	QString t_name;
44 	copyPWideStringToQString(name, t_name);
45 	((QObject *)handle)->setObjectName(t_name);
46 }
47 
QObject_isWidgetType(QObjectH handle)48 bool QObject_isWidgetType(QObjectH handle)
49 {
50 	return (bool) ((QObject *)handle)->isWidgetType();
51 }
52 
QObject_isWindowType(QObjectH handle)53 bool QObject_isWindowType(QObjectH handle)
54 {
55 	return (bool) ((QObject *)handle)->isWindowType();
56 }
57 
QObject_signalsBlocked(QObjectH handle)58 bool QObject_signalsBlocked(QObjectH handle)
59 {
60 	return (bool) ((QObject *)handle)->signalsBlocked();
61 }
62 
QObject_blockSignals(QObjectH handle,bool b)63 bool QObject_blockSignals(QObjectH handle, bool b)
64 {
65 	return (bool) ((QObject *)handle)->blockSignals(b);
66 }
67 
QObject_thread(QObjectH handle)68 QThreadH QObject_thread(QObjectH handle)
69 {
70 	return (QThreadH) ((QObject *)handle)->thread();
71 }
72 
QObject_moveToThread(QObjectH handle,QThreadH thread)73 void QObject_moveToThread(QObjectH handle, QThreadH thread)
74 {
75 	((QObject *)handle)->moveToThread((QThread*)thread);
76 }
77 
QObject_startTimer(QObjectH handle,int interval,Qt::TimerType timerType)78 int QObject_startTimer(QObjectH handle, int interval, Qt::TimerType timerType)
79 {
80 	return (int) ((QObject *)handle)->startTimer(interval, timerType);
81 }
82 
QObject_killTimer(QObjectH handle,int id)83 void QObject_killTimer(QObjectH handle, int id)
84 {
85 	((QObject *)handle)->killTimer(id);
86 }
87 
QObject_children(QObjectH handle,PPtrIntArray retval)88 void QObject_children(QObjectH handle, PPtrIntArray retval)
89 {
90 	QObjectList t_retval;
91 	t_retval = ((QObject *)handle)->children();
92 	copyQListTemplateToPtrIntArray(t_retval, retval);
93 }
94 
QObject_setParent(QObjectH handle,QObjectH AnonParam1)95 void QObject_setParent(QObjectH handle, QObjectH AnonParam1)
96 {
97 	((QObject *)handle)->setParent((QObject*)AnonParam1);
98 }
99 
QObject_installEventFilter(QObjectH handle,QObjectH AnonParam1)100 void QObject_installEventFilter(QObjectH handle, QObjectH AnonParam1)
101 {
102 	((QObject *)handle)->installEventFilter((QObject*)AnonParam1);
103 }
104 
QObject_removeEventFilter(QObjectH handle,QObjectH AnonParam1)105 void QObject_removeEventFilter(QObjectH handle, QObjectH AnonParam1)
106 {
107 	((QObject *)handle)->removeEventFilter((QObject*)AnonParam1);
108 }
109 
QObject_connect(const QObjectH sender,const char * signal,const QObjectH receiver,const char * member,Qt::ConnectionType AnonParam5)110 void QObject_connect(const QObjectH sender, const char* signal, const QObjectH receiver, const char* member, Qt::ConnectionType AnonParam5)
111 {
112 	QObject::connect((const QObject*)sender, signal, (const QObject*)receiver, member, AnonParam5);
113 }
114 
QObject_connect2(const QObjectH sender,const QMetaMethodH signal,const QObjectH receiver,const QMetaMethodH method,Qt::ConnectionType type)115 void QObject_connect2(const QObjectH sender, const QMetaMethodH signal, const QObjectH receiver, const QMetaMethodH method, Qt::ConnectionType type)
116 {
117 	QObject::connect((const QObject*)sender, *(const QMetaMethod*)signal, (const QObject*)receiver, *(const QMetaMethod*)method, type);
118 }
119 
QObject_connect3(QObjectH handle,const QObjectH sender,const char * signal,const char * member,Qt::ConnectionType type)120 void QObject_connect3(QObjectH handle, const QObjectH sender, const char* signal, const char* member, Qt::ConnectionType type)
121 {
122 	((QObject *)handle)->connect((const QObject*)sender, signal, member, type);
123 }
124 
QObject_disconnect(const QObjectH sender,const char * signal,const QObjectH receiver,const char * member)125 bool QObject_disconnect(const QObjectH sender, const char* signal, const QObjectH receiver, const char* member)
126 {
127 	return (bool) QObject::disconnect((const QObject*)sender, signal, (const QObject*)receiver, member);
128 }
129 
QObject_disconnect2(const QObjectH sender,const QMetaMethodH signal,const QObjectH receiver,const QMetaMethodH member)130 bool QObject_disconnect2(const QObjectH sender, const QMetaMethodH signal, const QObjectH receiver, const QMetaMethodH member)
131 {
132 	return (bool) QObject::disconnect((const QObject*)sender, *(const QMetaMethod*)signal, (const QObject*)receiver, *(const QMetaMethod*)member);
133 }
134 
QObject_disconnect4(QObjectH handle,const QObjectH receiver,const char * member)135 bool QObject_disconnect4(QObjectH handle, const QObjectH receiver, const char* member)
136 {
137 	return (bool) ((QObject *)handle)->disconnect((const QObject*)receiver, member);
138 }
139 
QObject_dumpObjectTree(QObjectH handle)140 void QObject_dumpObjectTree(QObjectH handle)
141 {
142 	((QObject *)handle)->dumpObjectTree();
143 }
144 
QObject_dumpObjectInfo(QObjectH handle)145 void QObject_dumpObjectInfo(QObjectH handle)
146 {
147 	((QObject *)handle)->dumpObjectInfo();
148 }
149 
QObject_setProperty(QObjectH handle,const char * name,const QVariantH value)150 bool QObject_setProperty(QObjectH handle, const char* name, const QVariantH value)
151 {
152 	return (bool) ((QObject *)handle)->setProperty(name, *(const QVariant*)value);
153 }
154 
QObject_property(QObjectH handle,QVariantH retval,const char * name)155 void QObject_property(QObjectH handle, QVariantH retval, const char* name)
156 {
157 	*(QVariant *)retval = ((QObject *)handle)->property(name);
158 }
159 
QObject_registerUserData()160 uint QObject_registerUserData()
161 {
162 	return (uint) QObject::registerUserData();
163 }
164 
QObject_parent(QObjectH handle)165 QObjectH QObject_parent(QObjectH handle)
166 {
167 	return (QObjectH) ((QObject *)handle)->parent();
168 }
169 
QObject_inherits(QObjectH handle,const char * classname)170 bool QObject_inherits(QObjectH handle, const char* classname)
171 {
172 	return (bool) ((QObject *)handle)->inherits(classname);
173 }
174 
QObject_deleteLater(QObjectH handle)175 void QObject_deleteLater(QObjectH handle)
176 {
177 	((QObject *)handle)->deleteLater();
178 }
179 
QObject_metaObject(QObjectH handle)180 const QMetaObjectH QObject_metaObject(QObjectH handle)
181 {
182   const QMetaObject *meta = ((QObject *)handle)->metaObject();
183   if (!meta)
184     return NULL;
185   return (const QMetaObjectH) meta;
186 }
187