annotate qt/gui/UrlHandler.d @ 221:ca4040017dba

no static ctors allowed :F
author eldar
date Tue, 14 Jul 2009 22:00:46 +0000
parents 11f1760d1700
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
149
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
1 module qt.gui.UrlHandler;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
2
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
3 import qt.core.QUrl;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
4
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
5 alias void delegate(QUrl) UrlHandlerDg;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
6
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
7 package class UrlHandler : QObject {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
8 public this(UrlHandlerDg dg) {
221
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
9 if (!init_flag_UrlHandler)
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
10 static_init_UrlHandler();
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
11
149
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
12 _dg = dg;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
13 void* __qt_return_value = qtd_UrlHandler_UrlHandler_QObject(cast(void*) this, null);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
14 this(__qt_return_value, true);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
15 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
16
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
17 void handleUrl(QUrl url) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
18 _dg(url);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
19 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
20
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
21 private UrlHandlerDg _dg;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
22
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
23 public this(void* native_id, bool gc_managed) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
24 super(native_id, gc_managed);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
25 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
26
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
27
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
28 protected void __free_native_resources() {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
29 qtd_UrlHandler_destructor(nativeId());
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
30 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
31
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
32 void __set_native_ownership(bool ownership_) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
33 __no_real_delete = ownership_;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
34 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
35 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
36 extern (C) void qtd_UrlHandler_destructor(void *ptr);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
37
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
38 private extern(C) void* qtd_UrlHandler_UrlHandler_QObject(void *d_ptr,
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
39 void* parent0);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
40
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
41 private extern(C) void qtd_UrlHandler_handleUrl_QUrl_dispatch(void *d_entity, void* name1)
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
42 {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
43 auto d_object = cast(UrlHandler) d_entity;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
44 scope name1_d_ref = new QUrl(name1, true);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
45 d_object.handleUrl(name1_d_ref);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
46 }
214
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
47
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
48 private extern (C) void qtd_UrlHandler_initCallBacks(void* virtuals, void* qobj_del);
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
49
221
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
50 private bool init_flag_UrlHandler = false;
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
51 void static_init_UrlHandler() {
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
52 init_flag_UrlHandler = true;
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
53
214
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
54 void*[1] virt_arr;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
55 virt_arr[0] = &qtd_UrlHandler_handleUrl_QUrl_dispatch;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
56
221
ca4040017dba no static ctors allowed :F
eldar
parents: 214
diff changeset
57 // void *qobj_del;
214
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
58 // qobj_del = &qtd_D_QWidget_delete;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
59 qtd_UrlHandler_initCallBacks(virt_arr.ptr, null);
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
60 }