Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSWindow.d @ 37:642f460a0908
Fixed a lot of compile errors, a "hello world" app compiles now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 10 Oct 2008 12:29:48 +0200 |
parents | f565d3a95c0a |
children | d8635bb48c7c |
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSWindow.d Tue Oct 07 12:56:18 2008 +0200 +++ b/dwt/internal/cocoa/NSWindow.d Fri Oct 10 12:29:48 2008 +0200 @@ -45,100 +45,104 @@ import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; -alias int NSWindowDepth; +extern (C) +{ + alias int NSWindowDepth; -enum NSWindowOrderingMode : NSInteger -{ + enum NSWindowOrderingMode : NSInteger + { NSWindowAbove = 1, NSWindowBelow = -1, NSWindowOut = 0 -} + } -alias NSWindowOrderingMode.NSWindowAbove NSWindowAbove; -alias NSWindowOrderingMode.NSWindowBelow NSWindowBelow; -alias NSWindowOrderingMode.NSWindowOut NSWindowOut; + alias NSWindowOrderingMode.NSWindowAbove NSWindowAbove; + alias NSWindowOrderingMode.NSWindowBelow NSWindowBelow; + alias NSWindowOrderingMode.NSWindowOut NSWindowOut; -enum NSWindowBackingLocation : NSUInteger -{ + enum NSWindowBackingLocation : NSUInteger + { NSWindowBackingLocationDefault = 0, NSWindowBackingLocationVideoMemory = 1, NSWindowBackingLocationMainMemory = 2 -} + } -alias NSWindowBackingLocation.NSWindowBackingLocationDefault NSWindowBackingLocationDefault; -alias NSWindowBackingLocation.NSWindowBackingLocationVideoMemory NSWindowBackingLocationVideoMemory; -alias NSWindowBackingLocation.NSWindowBackingLocationMainMemory NSWindowBackingLocationMainMemory; + alias NSWindowBackingLocation.NSWindowBackingLocationDefault NSWindowBackingLocationDefault; + alias NSWindowBackingLocation.NSWindowBackingLocationVideoMemory NSWindowBackingLocationVideoMemory; + alias NSWindowBackingLocation.NSWindowBackingLocationMainMemory NSWindowBackingLocationMainMemory; -enum NSBackingStoreType -{ + enum NSBackingStoreType + { NSBackingStoreRetained = 0, NSBackingStoreNonretained = 1, NSBackingStoreBuffered = 2 -} + } -alias NSBackingStoreType.NSBackingStoreRetained NSBackingStoreRetained; -alias NSBackingStoreType.NSBackingStoreNonretained NSBackingStoreNonretained; -alias NSBackingStoreType.NSBackingStoreBuffered NSBackingStoreBuffered; + alias NSBackingStoreType.NSBackingStoreRetained NSBackingStoreRetained; + alias NSBackingStoreType.NSBackingStoreNonretained NSBackingStoreNonretained; + alias NSBackingStoreType.NSBackingStoreBuffered NSBackingStoreBuffered; -enum NSWindowCollectionBehavior : NSUInteger -{ + enum NSWindowCollectionBehavior : NSUInteger + { NSWindowCollectionBehaviorDefault = 0, NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0, NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1 -} + } -alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorDefault NSWindowCollectionBehaviorDefault; -alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorCanJoinAllSpaces NSWindowCollectionBehaviorCanJoinAllSpaces; -alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorMoveToActiveSpace NSWindowCollectionBehaviorMoveToActiveSpace; + alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorDefault NSWindowCollectionBehaviorDefault; + alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorCanJoinAllSpaces NSWindowCollectionBehaviorCanJoinAllSpaces; + alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorMoveToActiveSpace NSWindowCollectionBehaviorMoveToActiveSpace; -enum NSSelectionDirection -{ + enum NSSelectionDirection + { NSDirectSelection = 0, NSSelectingNext, NSSelectingPrevious -} + } -alias NSSelectionDirection.NSDirectSelection NSDirectSelection; -alias NSSelectionDirection.NSSelectingNext NSSelectingNext; -alias NSSelectionDirection.NSSelectingPrevious NSSelectingPrevious; + alias NSSelectionDirection.NSDirectSelection NSDirectSelection; + alias NSSelectionDirection.NSSelectingNext NSSelectingNext; + alias NSSelectionDirection.NSSelectingPrevious NSSelectingPrevious; -enum NSWindowSharingType : NSUInteger -{ + enum NSWindowSharingType : NSUInteger + { NSWindowSharingNone = 0, NSWindowSharingReadOnly = 1, NSWindowSharingReadWrite = 2 -} + } -alias NSWindowSharingType.NSWindowSharingNone NSWindowSharingNone; -alias NSWindowSharingType.NSWindowSharingReadOnly NSWindowSharingReadOnly; -alias NSWindowSharingType.NSWindowSharingReadWrite NSWindowSharingReadWrite; + alias NSWindowSharingType.NSWindowSharingNone NSWindowSharingNone; + alias NSWindowSharingType.NSWindowSharingReadOnly NSWindowSharingReadOnly; + alias NSWindowSharingType.NSWindowSharingReadWrite NSWindowSharingReadWrite; -enum NSWindowButton -{ + enum NSWindowButton + { NSWindowCloseButton, NSWindowMiniaturizeButton, NSWindowZoomButton, NSWindowToolbarButton, NSWindowDocumentIconButton -} + } -alias NSWindowButton.NSWindowCloseButton NSWindowCloseButton; -alias NSWindowButton.NSWindowMiniaturizeButton NSWindowMiniaturizeButton; -alias NSWindowButton.NSWindowZoomButton NSWindowZoomButton; -alias NSWindowButton.NSWindowToolbarButton NSWindowToolbarButton; -alias NSWindowButton.NSWindowDocumentIconButton NSWindowDocumentIconButton; + alias NSWindowButton.NSWindowCloseButton NSWindowCloseButton; + alias NSWindowButton.NSWindowMiniaturizeButton NSWindowMiniaturizeButton; + alias NSWindowButton.NSWindowZoomButton NSWindowZoomButton; + alias NSWindowButton.NSWindowToolbarButton NSWindowToolbarButton; + alias NSWindowButton.NSWindowDocumentIconButton NSWindowDocumentIconButton; -enum -{ + enum + { NSBorderlessWindowMask = 0, NSTitledWindowMask = 1 << 0, NSClosableWindowMask = 1 << 1, NSMiniaturizableWindowMask = 1 << 2, NSResizableWindowMask = 1 << 3, NSTexturedBackgroundWindowMask = 1 << 8 + } } + public class NSWindow : NSResponder { @@ -269,7 +273,7 @@ public NSPoint cascadeTopLeftFromPoint (NSPoint topLeftPoint) { NSPoint result; - OS.objc_msgSend_struct(&result, this.id_, OS.sel_cascadeTopLeftFromPoint_1, &topLeftPoint); + OS.objc_msgSend_struct(&result, this.id_, OS.sel_cascadeTopLeftFromPoint_1, topLeftPoint); return result; } @@ -364,7 +368,7 @@ public NSPoint convertScreenToBase (NSPoint aPoint) { NSPoint result; - OS.objc_msgSend_struct(&result, this.id_, OS.sel_convertScreenToBase_1, &aPoint); + OS.objc_msgSend_struct(&result, this.id_, OS.sel_convertScreenToBase_1, aPoint); return result; }