Mercurial > projects > dstep
comparison dstep/appkit/NSPanel.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSPanel; | |
8 | |
9 import dstep.appkit.NSWindow; | |
10 import dstep.foundation.NSObjCRuntime; | |
11 import dstep.foundation.NSString; | |
12 import dstep.objc.bridge.Bridge; | |
13 import dstep.objc.objc; | |
14 | |
15 import bindings = dstep.appkit.NSPanel_bindings; | |
16 | |
17 enum | |
18 { | |
19 NSAlertDefaultReturn = 1, | |
20 NSAlertAlternateReturn = 0, | |
21 NSAlertOtherReturn = -1, | |
22 NSAlertErrorReturn = -2 | |
23 } | |
24 | |
25 enum | |
26 { | |
27 NSOKButton = 1, | |
28 NSCancelButton = 0 | |
29 } | |
30 | |
31 enum | |
32 { | |
33 NSUtilityWindowMask = 1 << 4, | |
34 NSDocModalWindowMask = 1 << 6 | |
35 } | |
36 | |
37 enum | |
38 { | |
39 NSNonactivatingPanelMask = 1 << 7 | |
40 } | |
41 | |
42 enum | |
43 { | |
44 NSHUDWindowMask = 1 << 13 | |
45 } | |
46 | |
47 class NSPanel : NSWindow | |
48 { | |
49 mixin (ObjcWrap); | |
50 | |
51 bool isFloatingPanel () | |
52 { | |
53 return invokeObjcSelf!(bool, "isFloatingPanel"); | |
54 } | |
55 | |
56 void setFloatingPanel (bool flag) | |
57 { | |
58 return invokeObjcSelf!(void, "setFloatingPanel:", bool)(flag); | |
59 } | |
60 | |
61 bool becomesKeyOnlyIfNeeded () | |
62 { | |
63 return invokeObjcSelf!(bool, "becomesKeyOnlyIfNeeded"); | |
64 } | |
65 | |
66 void setBecomesKeyOnlyIfNeeded (bool flag) | |
67 { | |
68 return invokeObjcSelf!(void, "setBecomesKeyOnlyIfNeeded:", bool)(flag); | |
69 } | |
70 | |
71 bool worksWhenModal () | |
72 { | |
73 return invokeObjcSelf!(bool, "worksWhenModal"); | |
74 } | |
75 | |
76 void setWorksWhenModal (bool flag) | |
77 { | |
78 return invokeObjcSelf!(void, "setWorksWhenModal:", bool)(flag); | |
79 } | |
80 } | |
81 | |
82 NSInteger NSRunAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
83 { | |
84 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args); | |
85 } | |
86 | |
87 NSInteger NSRunInformationalAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
88 { | |
89 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunInformationalAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args); | |
90 } | |
91 | |
92 NSInteger NSRunCriticalAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
93 { | |
94 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunCriticalAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args); | |
95 } | |
96 | |
97 NSInteger NSRunAlertPanelRelativeToWindow (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, ARGS args) | |
98 { | |
99 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunAlertPanelRelativeToWindow, NSString, NSString, NSString, NSString, NSString, NSWindow)(title, msgFormat, defaultButton, alternateButton, otherButton, docWindow, args); | |
100 } | |
101 | |
102 NSInteger NSRunInformationalAlertPanelRelativeToWindow (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, ARGS args) | |
103 { | |
104 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunInformationalAlertPanelRelativeToWindow, NSString, NSString, NSString, NSString, NSString, NSWindow)(title, msgFormat, defaultButton, alternateButton, otherButton, docWindow, args); | |
105 } | |
106 | |
107 NSInteger NSRunCriticalAlertPanelRelativeToWindow (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, ARGS args) | |
108 { | |
109 return Bridge.invokeObjcFunction!(NSInteger, bindings.NSRunCriticalAlertPanelRelativeToWindow, NSString, NSString, NSString, NSString, NSString, NSWindow)(title, msgFormat, defaultButton, alternateButton, otherButton, docWindow), args; | |
110 } | |
111 | |
112 void NSBeginAlertSheet (ARGS...) (NSString title, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, Object modalDelegate, SEL didEndSelector, SEL didDismissSelector, void* contextInfo, NSString msgFormat, ARGS args) | |
113 { | |
114 return Bridge.invokeObjcFunction!(void, bindings.NSBeginAlertSheet, NSString, NSString, NSString, NSString, NSWindow, Object, SEL, SEL, void*, NSString)(title, defaultButton, alternateButton, otherButton, docWindow, modalDelegate, didEndSelector, didDismissSelector, contextInfo, msgFormat, args); | |
115 } | |
116 | |
117 void NSBeginInformationalAlertSheet (ARGS...) (NSString title, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, Object modalDelegate, SEL didEndSelector, SEL didDismissSelector, void* contextInfo, NSString msgFormat, ARGS args) | |
118 { | |
119 return Bridge.invokeObjcFunction!(void, bindings.NSBeginInformationalAlertSheet, NSString, NSString, NSString, NSString, NSWindow, Object, SEL, SEL, void*, NSString)(title, defaultButton, alternateButton, otherButton, docWindow, modalDelegate, didEndSelector, didDismissSelector, contextInfo, msgFormat, args); | |
120 } | |
121 | |
122 void NSBeginCriticalAlertSheet (ARGS...) (NSString title, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, Object modalDelegate, SEL didEndSelector, SEL didDismissSelector, void* contextInfo, NSString msgFormat, ARGS args) | |
123 { | |
124 return Bridge.invokeObjcFunction!(void, bindings.NSBeginCriticalAlertSheet, NSString, NSString, NSString, NSString, NSWindow, Object, SEL, SEL, void*, NSString)(title, defaultButton, alternateButton, otherButton, docWindow, modalDelegate, didEndSelector, didDismissSelector, contextInfo, msgFormat, args); | |
125 } | |
126 | |
127 Object NSGetAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
128 { | |
129 return Bridge.invokeObjcFunction!(Object, bindings.NSGetAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args, args); | |
130 } | |
131 | |
132 Object NSGetInformationalAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
133 { | |
134 return Bridge.invokeObjcFunction!(Object, bindings.NSGetInformationalAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args, args); | |
135 } | |
136 | |
137 Object NSGetCriticalAlertPanel (ARGS...) (NSString title, NSString msgFormat, NSString defaultButton, NSString alternateButton, NSString otherButton, ARGS args) | |
138 { | |
139 return Bridge.invokeObjcFunction!(Object, bindings.NSGetCriticalAlertPanel, NSString, NSString, NSString, NSString, NSString)(title, msgFormat, defaultButton, alternateButton, otherButton, args, args); | |
140 } | |
141 | |
142 void NSReleaseAlertPanel (Object panel) | |
143 { | |
144 return Bridge.invokeObjcFunction!(void, bindings.NSReleaseAlertPanel, Object)(panel); | |
145 } | |
146 |