/qtqml/qqmlcontext.go

https://github.com/kitech/qt.go · Go · 457 lines · 228 code · 53 blank · 176 comment · 59 complexity · 2f854efbf1bb91301d0f578e6b0863c5 MD5 · raw file

  1. package qtqml
  2. // /usr/include/qt/QtQml/qqmlcontext.h
  3. // #include <qqmlcontext.h>
  4. // #include <QtQml>
  5. // header block end
  6. // main block begin
  7. // main block end
  8. // use block begin
  9. // use block end
  10. // ext block begin
  11. /*
  12. #include <stdlib.h>
  13. // extern C begin: 28
  14. */
  15. // import "C"
  16. import "unsafe"
  17. import "reflect"
  18. import "fmt"
  19. import "log"
  20. import "github.com/kitech/qt.go/qtrt"
  21. import "github.com/kitech/qt.go/qtcore"
  22. import "github.com/kitech/qt.go/qtnetwork"
  23. // ext block end
  24. // body block begin
  25. /*
  26. */
  27. type QQmlContext struct {
  28. *qtcore.QObject
  29. }
  30. type QQmlContext_ITF interface {
  31. qtcore.QObject_ITF
  32. QQmlContext_PTR() *QQmlContext
  33. }
  34. func (ptr *QQmlContext) QQmlContext_PTR() *QQmlContext { return ptr }
  35. func (this *QQmlContext) GetCthis() unsafe.Pointer {
  36. if this == nil {
  37. return nil
  38. } else {
  39. return this.QObject.GetCthis()
  40. }
  41. }
  42. func (this *QQmlContext) SetCthis(cthis unsafe.Pointer) {
  43. this.QObject = qtcore.NewQObjectFromPointer(cthis)
  44. }
  45. func NewQQmlContextFromPointer(cthis unsafe.Pointer) *QQmlContext {
  46. bcthis0 := qtcore.NewQObjectFromPointer(cthis)
  47. return &QQmlContext{bcthis0}
  48. }
  49. func (*QQmlContext) NewFromPointer(cthis unsafe.Pointer) *QQmlContext {
  50. return NewQQmlContextFromPointer(cthis)
  51. }
  52. // /usr/include/qt/QtQml/qqmlcontext.h:63
  53. // index:0
  54. // Public virtual Visibility=Default Availability=Available
  55. // [8] const QMetaObject * metaObject() const
  56. /*
  57. */
  58. func (this *QQmlContext) MetaObject() *qtcore.QMetaObject /*777 const QMetaObject **/ {
  59. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext10metaObjectEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  60. qtrt.ErrPrint(err, rv)
  61. return qtcore.NewQMetaObjectFromPointer(unsafe.Pointer(uintptr(rv))) // 444
  62. }
  63. // /usr/include/qt/QtQml/qqmlcontext.h:69
  64. // index:0
  65. // Public Visibility=Default Availability=Available
  66. // [-2] void QQmlContext(QQmlEngine *, QObject *)
  67. /*
  68. Create a new QQmlContext as a child of engine's root context, and the QObject parent.
  69. */
  70. func (*QQmlContext) NewForInherit(parent QQmlEngine_ITF /*777 QQmlEngine **/, objParent qtcore.QObject_ITF /*777 QObject **/) *QQmlContext {
  71. return NewQQmlContext(parent, objParent)
  72. }
  73. func NewQQmlContext(parent QQmlEngine_ITF /*777 QQmlEngine **/, objParent qtcore.QObject_ITF /*777 QObject **/) *QQmlContext {
  74. var convArg0 unsafe.Pointer
  75. if parent != nil && parent.QQmlEngine_PTR() != nil {
  76. convArg0 = parent.QQmlEngine_PTR().GetCthis()
  77. }
  78. var convArg1 unsafe.Pointer
  79. if objParent != nil && objParent.QObject_PTR() != nil {
  80. convArg1 = objParent.QObject_PTR().GetCthis()
  81. }
  82. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContextC2EP10QQmlEngineP7QObject", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
  83. qtrt.ErrPrint(err, rv)
  84. gothis := NewQQmlContextFromPointer(unsafe.Pointer(uintptr(rv)))
  85. qtrt.ConnectDestroyed(gothis, "QQmlContext")
  86. return gothis
  87. }
  88. // /usr/include/qt/QtQml/qqmlcontext.h:69
  89. // index:0
  90. // Public Visibility=Default Availability=Available
  91. // [-2] void QQmlContext(QQmlEngine *, QObject *)
  92. /*
  93. Create a new QQmlContext as a child of engine's root context, and the QObject parent.
  94. */
  95. func (*QQmlContext) NewForInheritp(parent QQmlEngine_ITF /*777 QQmlEngine **/) *QQmlContext {
  96. return NewQQmlContextp(parent)
  97. }
  98. func NewQQmlContextp(parent QQmlEngine_ITF /*777 QQmlEngine **/) *QQmlContext {
  99. var convArg0 unsafe.Pointer
  100. if parent != nil && parent.QQmlEngine_PTR() != nil {
  101. convArg0 = parent.QQmlEngine_PTR().GetCthis()
  102. }
  103. // arg: 1, QObject *=Pointer, QObject=Record, , Invalid
  104. var convArg1 unsafe.Pointer
  105. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContextC2EP10QQmlEngineP7QObject", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
  106. qtrt.ErrPrint(err, rv)
  107. gothis := NewQQmlContextFromPointer(unsafe.Pointer(uintptr(rv)))
  108. qtrt.ConnectDestroyed(gothis, "QQmlContext")
  109. return gothis
  110. }
  111. // /usr/include/qt/QtQml/qqmlcontext.h:70
  112. // index:1
  113. // Public Visibility=Default Availability=Available
  114. // [-2] void QQmlContext(QQmlContext *, QObject *)
  115. /*
  116. Create a new QQmlContext as a child of engine's root context, and the QObject parent.
  117. */
  118. func (*QQmlContext) NewForInherit1(parent QQmlContext_ITF /*777 QQmlContext **/, objParent qtcore.QObject_ITF /*777 QObject **/) *QQmlContext {
  119. return NewQQmlContext1(parent, objParent)
  120. }
  121. func NewQQmlContext1(parent QQmlContext_ITF /*777 QQmlContext **/, objParent qtcore.QObject_ITF /*777 QObject **/) *QQmlContext {
  122. var convArg0 unsafe.Pointer
  123. if parent != nil && parent.QQmlContext_PTR() != nil {
  124. convArg0 = parent.QQmlContext_PTR().GetCthis()
  125. }
  126. var convArg1 unsafe.Pointer
  127. if objParent != nil && objParent.QObject_PTR() != nil {
  128. convArg1 = objParent.QObject_PTR().GetCthis()
  129. }
  130. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContextC2EPS_P7QObject", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
  131. qtrt.ErrPrint(err, rv)
  132. gothis := NewQQmlContextFromPointer(unsafe.Pointer(uintptr(rv)))
  133. qtrt.ConnectDestroyed(gothis, "QQmlContext")
  134. return gothis
  135. }
  136. // /usr/include/qt/QtQml/qqmlcontext.h:70
  137. // index:1
  138. // Public Visibility=Default Availability=Available
  139. // [-2] void QQmlContext(QQmlContext *, QObject *)
  140. /*
  141. Create a new QQmlContext as a child of engine's root context, and the QObject parent.
  142. */
  143. func (*QQmlContext) NewForInherit1p(parent QQmlContext_ITF /*777 QQmlContext **/) *QQmlContext {
  144. return NewQQmlContext1p(parent)
  145. }
  146. func NewQQmlContext1p(parent QQmlContext_ITF /*777 QQmlContext **/) *QQmlContext {
  147. var convArg0 unsafe.Pointer
  148. if parent != nil && parent.QQmlContext_PTR() != nil {
  149. convArg0 = parent.QQmlContext_PTR().GetCthis()
  150. }
  151. // arg: 1, QObject *=Pointer, QObject=Record, , Invalid
  152. var convArg1 unsafe.Pointer
  153. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContextC2EPS_P7QObject", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
  154. qtrt.ErrPrint(err, rv)
  155. gothis := NewQQmlContextFromPointer(unsafe.Pointer(uintptr(rv)))
  156. qtrt.ConnectDestroyed(gothis, "QQmlContext")
  157. return gothis
  158. }
  159. // /usr/include/qt/QtQml/qqmlcontext.h:71
  160. // index:0
  161. // Public virtual Visibility=Default Availability=Available
  162. // [-2] void ~QQmlContext()
  163. /*
  164. */
  165. func DeleteQQmlContext(this *QQmlContext) {
  166. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContextD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
  167. qtrt.Cmemset(this.GetCthis(), 9, 16)
  168. qtrt.ErrPrint(err, rv)
  169. this.SetCthis(nil)
  170. }
  171. // /usr/include/qt/QtQml/qqmlcontext.h:73
  172. // index:0
  173. // Public Visibility=Default Availability=Available
  174. // [1] bool isValid() const
  175. /*
  176. Returns whether the context is valid.
  177. To be valid, a context must have a engine, and it's contextObject(), if any, must not have been deleted.
  178. */
  179. func (this *QQmlContext) IsValid() bool {
  180. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext7isValidEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  181. qtrt.ErrPrint(err, rv)
  182. return rv != 0
  183. }
  184. // /usr/include/qt/QtQml/qqmlcontext.h:75
  185. // index:0
  186. // Public Visibility=Default Availability=Available
  187. // [8] QQmlEngine * engine() const
  188. /*
  189. Return the context's QQmlEngine, or 0 if the context has no QQmlEngine or the QQmlEngine was destroyed.
  190. */
  191. func (this *QQmlContext) Engine() *QQmlEngine /*777 QQmlEngine **/ {
  192. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext6engineEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  193. qtrt.ErrPrint(err, rv)
  194. return /*==*/ NewQQmlEngineFromPointer(unsafe.Pointer(uintptr(rv))) // 444
  195. }
  196. // /usr/include/qt/QtQml/qqmlcontext.h:76
  197. // index:0
  198. // Public Visibility=Default Availability=Available
  199. // [8] QQmlContext * parentContext() const
  200. /*
  201. Return the context's parent QQmlContext, or 0 if this context has no parent or if the parent has been destroyed.
  202. */
  203. func (this *QQmlContext) ParentContext() *QQmlContext /*777 QQmlContext **/ {
  204. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext13parentContextEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  205. qtrt.ErrPrint(err, rv)
  206. return /*==*/ NewQQmlContextFromPointer(unsafe.Pointer(uintptr(rv))) // 444
  207. }
  208. // /usr/include/qt/QtQml/qqmlcontext.h:78
  209. // index:0
  210. // Public Visibility=Default Availability=Available
  211. // [8] QObject * contextObject() const
  212. /*
  213. Return the context object, or 0 if there is no context object.
  214. See also setContextObject().
  215. */
  216. func (this *QQmlContext) ContextObject() *qtcore.QObject /*777 QObject **/ {
  217. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext13contextObjectEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  218. qtrt.ErrPrint(err, rv)
  219. return qtcore.NewQObjectFromPointer(unsafe.Pointer(uintptr(rv))) // 444
  220. }
  221. // /usr/include/qt/QtQml/qqmlcontext.h:79
  222. // index:0
  223. // Public Visibility=Default Availability=Available
  224. // [-2] void setContextObject(QObject *)
  225. /*
  226. Set the context object.
  227. See also contextObject().
  228. */
  229. func (this *QQmlContext) SetContextObject(arg0 qtcore.QObject_ITF /*777 QObject **/) {
  230. var convArg0 unsafe.Pointer
  231. if arg0 != nil && arg0.QObject_PTR() != nil {
  232. convArg0 = arg0.QObject_PTR().GetCthis()
  233. }
  234. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContext16setContextObjectEP7QObject", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
  235. qtrt.ErrPrint(err, rv)
  236. }
  237. // /usr/include/qt/QtQml/qqmlcontext.h:81
  238. // index:0
  239. // Public Visibility=Default Availability=Available
  240. // [16] QVariant contextProperty(const QString &) const
  241. /*
  242. Returns the value of the name property for this context as a QVariant.
  243. See also setContextProperty().
  244. */
  245. func (this *QQmlContext) ContextProperty(arg0 string) *qtcore.QVariant /*123*/ {
  246. var tmpArg0 = qtcore.NewQString5(arg0)
  247. var convArg0 = tmpArg0.GetCthis()
  248. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext15contextPropertyERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
  249. qtrt.ErrPrint(err, rv)
  250. rv2 := qtcore.NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
  251. qtrt.SetFinalizer(rv2, qtcore.DeleteQVariant)
  252. return rv2
  253. }
  254. // /usr/include/qt/QtQml/qqmlcontext.h:82
  255. // index:0
  256. // Public Visibility=Default Availability=Available
  257. // [-2] void setContextProperty(const QString &, QObject *)
  258. /*
  259. Set the value of the name property on this context.
  260. QQmlContext does not take ownership of value.
  261. See also contextProperty().
  262. */
  263. func (this *QQmlContext) SetContextProperty(arg0 string, arg1 qtcore.QObject_ITF /*777 QObject **/) {
  264. var tmpArg0 = qtcore.NewQString5(arg0)
  265. var convArg0 = tmpArg0.GetCthis()
  266. var convArg1 unsafe.Pointer
  267. if arg1 != nil && arg1.QObject_PTR() != nil {
  268. convArg1 = arg1.QObject_PTR().GetCthis()
  269. }
  270. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContext18setContextPropertyERK7QStringP7QObject", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, convArg1)
  271. qtrt.ErrPrint(err, rv)
  272. }
  273. // /usr/include/qt/QtQml/qqmlcontext.h:83
  274. // index:1
  275. // Public Visibility=Default Availability=Available
  276. // [-2] void setContextProperty(const QString &, const QVariant &)
  277. /*
  278. Set the value of the name property on this context.
  279. QQmlContext does not take ownership of value.
  280. See also contextProperty().
  281. */
  282. func (this *QQmlContext) SetContextProperty1(arg0 string, arg1 qtcore.QVariant_ITF) {
  283. var tmpArg0 = qtcore.NewQString5(arg0)
  284. var convArg0 = tmpArg0.GetCthis()
  285. var convArg1 unsafe.Pointer
  286. if arg1 != nil && arg1.QVariant_PTR() != nil {
  287. convArg1 = arg1.QVariant_PTR().GetCthis()
  288. }
  289. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContext18setContextPropertyERK7QStringRK8QVariant", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, convArg1)
  290. qtrt.ErrPrint(err, rv)
  291. }
  292. // /usr/include/qt/QtQml/qqmlcontext.h:87
  293. // index:0
  294. // Public Visibility=Default Availability=Available
  295. // [8] QString nameForObject(QObject *) const
  296. /*
  297. Returns the name of object in this context, or an empty string if object is not named in the context. Objects are named by setContextProperty(), or by ids in the case of QML created contexts.
  298. If the object has multiple names, the first is returned.
  299. */
  300. func (this *QQmlContext) NameForObject(arg0 qtcore.QObject_ITF /*777 QObject **/) string {
  301. var convArg0 unsafe.Pointer
  302. if arg0 != nil && arg0.QObject_PTR() != nil {
  303. convArg0 = arg0.QObject_PTR().GetCthis()
  304. }
  305. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext13nameForObjectEP7QObject", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
  306. qtrt.ErrPrint(err, rv)
  307. rv2 := qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
  308. rv3 := rv2.ToUtf8().Data()
  309. qtcore.DeleteQString(rv2)
  310. return rv3
  311. }
  312. // /usr/include/qt/QtQml/qqmlcontext.h:89
  313. // index:0
  314. // Public Visibility=Default Availability=Available
  315. // [8] QUrl resolvedUrl(const QUrl &)
  316. /*
  317. Resolves the URL src relative to the URL of the containing component.
  318. See also QQmlEngine::baseUrl() and setBaseUrl().
  319. */
  320. func (this *QQmlContext) ResolvedUrl(arg0 qtcore.QUrl_ITF) *qtcore.QUrl /*123*/ {
  321. var convArg0 unsafe.Pointer
  322. if arg0 != nil && arg0.QUrl_PTR() != nil {
  323. convArg0 = arg0.QUrl_PTR().GetCthis()
  324. }
  325. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContext11resolvedUrlERK4QUrl", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
  326. qtrt.ErrPrint(err, rv)
  327. rv2 := qtcore.NewQUrlFromPointer(unsafe.Pointer(uintptr(rv))) // 333
  328. qtrt.SetFinalizer(rv2, qtcore.DeleteQUrl)
  329. return rv2
  330. }
  331. // /usr/include/qt/QtQml/qqmlcontext.h:91
  332. // index:0
  333. // Public Visibility=Default Availability=Available
  334. // [-2] void setBaseUrl(const QUrl &)
  335. /*
  336. Explicitly sets the url resolvedUrl() will use for relative references to baseUrl.
  337. Calling this function will override the url of the containing component used by default.
  338. See also baseUrl() and resolvedUrl().
  339. */
  340. func (this *QQmlContext) SetBaseUrl(arg0 qtcore.QUrl_ITF) {
  341. var convArg0 unsafe.Pointer
  342. if arg0 != nil && arg0.QUrl_PTR() != nil {
  343. convArg0 = arg0.QUrl_PTR().GetCthis()
  344. }
  345. rv, err := qtrt.InvokeQtFunc6("_ZN11QQmlContext10setBaseUrlERK4QUrl", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
  346. qtrt.ErrPrint(err, rv)
  347. }
  348. // /usr/include/qt/QtQml/qqmlcontext.h:92
  349. // index:0
  350. // Public Visibility=Default Availability=Available
  351. // [8] QUrl baseUrl() const
  352. /*
  353. Returns the base url of the component, or the containing component if none is set.
  354. See also setBaseUrl().
  355. */
  356. func (this *QQmlContext) BaseUrl() *qtcore.QUrl /*123*/ {
  357. rv, err := qtrt.InvokeQtFunc6("_ZNK11QQmlContext7baseUrlEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
  358. qtrt.ErrPrint(err, rv)
  359. rv2 := qtcore.NewQUrlFromPointer(unsafe.Pointer(uintptr(rv))) // 333
  360. qtrt.SetFinalizer(rv2, qtcore.DeleteQUrl)
  361. return rv2
  362. }
  363. // body block end
  364. // keep block begin
  365. func init_unused_11517() {
  366. if false {
  367. reflect.TypeOf(123)
  368. }
  369. if false {
  370. reflect.TypeOf(unsafe.Sizeof(0))
  371. }
  372. if false {
  373. fmt.Println(123)
  374. }
  375. if false {
  376. log.Println(123)
  377. }
  378. if false {
  379. qtrt.KeepMe()
  380. }
  381. if false {
  382. qtcore.KeepMe()
  383. }
  384. if false {
  385. qtnetwork.KeepMe()
  386. }
  387. }
  388. // keep block end