annotate qt/gui/UrlHandler.d @ 214:11f1760d1700

UrlHandler windows fix
author eldar
date Tue, 14 Jul 2009 14:37:23 +0000
parents 7bc921c7100a
children ca4040017dba
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) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
9 _dg = dg;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
10 void* __qt_return_value = qtd_UrlHandler_UrlHandler_QObject(cast(void*) this, null);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
11 this(__qt_return_value, true);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
12 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
13
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
14 void handleUrl(QUrl url) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
15 _dg(url);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
16 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
17
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
18 private UrlHandlerDg _dg;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
19
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
20 public this(void* native_id, bool gc_managed) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
21 super(native_id, gc_managed);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
22 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
23
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
24
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
25 protected void __free_native_resources() {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
26 qtd_UrlHandler_destructor(nativeId());
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
27 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
28
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
29 void __set_native_ownership(bool ownership_) {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
30 __no_real_delete = ownership_;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
31 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
32 }
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
33 extern (C) void qtd_UrlHandler_destructor(void *ptr);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
34
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
35 private extern(C) void* qtd_UrlHandler_UrlHandler_QObject(void *d_ptr,
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
36 void* parent0);
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_handleUrl_QUrl_dispatch(void *d_entity, void* name1)
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
39 {
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
40 auto d_object = cast(UrlHandler) d_entity;
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
41 scope name1_d_ref = new QUrl(name1, true);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
42 d_object.handleUrl(name1_d_ref);
7bc921c7100a QDesktopServices.setUrlHandler - temporary solution
eldar
parents:
diff changeset
43 }
214
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
44
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
45 private extern (C) void qtd_UrlHandler_initCallBacks(void* virtuals, void* qobj_del);
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
46
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
47 static this() {
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
48 void*[1] virt_arr;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
49 virt_arr[0] = &qtd_UrlHandler_handleUrl_QUrl_dispatch;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
50
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
51 void *qobj_del;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
52 // qobj_del = &qtd_D_QWidget_delete;
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
53 qtd_UrlHandler_initCallBacks(virt_arr.ptr, null);
11f1760d1700 UrlHandler windows fix
eldar
parents: 149
diff changeset
54 }