comparison dwt/internal/cocoa/NSCollectionView.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
comparison
equal deleted inserted replaced
0:380af2bdd8e5 1:8b48be5454ce
11 * Port to the D Programming language: 11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSCollectionView; 14 module dwt.internal.cocoa.NSCollectionView;
15 15
16 import dwt.internal.cocoa.id;
16 import dwt.internal.cocoa.NSArray; 17 import dwt.internal.cocoa.NSArray;
17 import dwt.internal.cocoa.NSCollectionViewItem; 18 import dwt.internal.cocoa.NSCollectionViewItem;
19 import dwt.internal.cocoa.NSInteger;
18 import dwt.internal.cocoa.NSIndexSet; 20 import dwt.internal.cocoa.NSIndexSet;
19 import dwt.internal.cocoa.NSSize; 21 import dwt.internal.cocoa.NSSize;
20 import dwt.internal.cocoa.NSView; 22 import dwt.internal.cocoa.NSView;
21 import dwt.internal.cocoa.OS; 23 import dwt.internal.cocoa.OS;
22 import objc = dwt.internal.objc.runtime; 24 import objc = dwt.internal.objc.runtime;
34 super(id); 36 super(id);
35 } 37 }
36 38
37 public bool allowsMultipleSelection () 39 public bool allowsMultipleSelection ()
38 { 40 {
39 return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) !is null; 41 return OS.objc_msgSend(this.id_, OS.sel_allowsMultipleSelection) !is null;
40 } 42 }
41 43
42 public NSArray backgroundColors () 44 public NSArray backgroundColors ()
43 { 45 {
44 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColors); 46 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColors);
45 return result !is null ? new NSArray(result) : null; 47 return result !is null ? new NSArray(result) : null;
46 } 48 }
47 49
48 public NSArray content () 50 public NSArray content ()
49 { 51 {
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_content); 52 objc.id result = OS.objc_msgSend(this.id_, OS.sel_content);
51 return result !is null ? new NSArray(result) : null; 53 return result !is null ? new NSArray(result) : null;
52 } 54 }
53 55
54 public bool isFirstResponder () 56 public bool isFirstResponder ()
55 { 57 {
56 return OS.objc_msgSend(this.id, OS.sel_isFirstResponder) !is null; 58 return OS.objc_msgSend(this.id_, OS.sel_isFirstResponder) !is null;
57 } 59 }
58 60
59 public bool isSelectable () 61 public bool isSelectable ()
60 { 62 {
61 return OS.objc_msgSend(this.id, OS.sel_isSelectable) !is null; 63 return OS.objc_msgSend(this.id_, OS.sel_isSelectable) !is null;
62 } 64 }
63 65
64 public NSCollectionViewItem itemPrototype () 66 public NSCollectionViewItem itemPrototype ()
65 { 67 {
66 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemPrototype); 68 objc.id result = OS.objc_msgSend(this.id_, OS.sel_itemPrototype);
67 return result !is null ? new NSCollectionViewItem(result) : null; 69 return result !is null ? new NSCollectionViewItem(result) : null;
68 } 70 }
69 71
70 public NSSize maxItemSize () 72 public NSSize maxItemSize ()
71 { 73 {
72 NSSize result; 74 NSSize result;
73 OS.objc_msgSend_stret(result, this.id, OS.sel_maxItemSize); 75 OS.objc_msgSend_stret(&result, this.id_, OS.sel_maxItemSize);
74 return result; 76 return result;
75 } 77 }
76 78
77 public NSUInteger maxNumberOfColumns () 79 public NSUInteger maxNumberOfColumns ()
78 { 80 {
79 return OS.objc_msgSend(this.id, OS.sel_maxNumberOfColumns); 81 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maxNumberOfColumns);
80 } 82 }
81 83
82 public NSUInteger maxNumberOfRows () 84 public NSUInteger maxNumberOfRows ()
83 { 85 {
84 return OS.objc_msgSend(this.id, OS.sel_maxNumberOfRows); 86 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maxNumberOfRows);
85 } 87 }
86 88
87 public NSSize minItemSize () 89 public NSSize minItemSize ()
88 { 90 {
89 NSSize result; 91 NSSize result;
90 OS.objc_msgSend_stret(result, this.id, OS.sel_minItemSize); 92 OS.objc_msgSend_stret(&result, this.id_, OS.sel_minItemSize);
91 return result; 93 return result;
92 } 94 }
93 95
94 public NSCollectionViewItem newItemForRepresentedObject (id object) 96 public NSCollectionViewItem newItemForRepresentedObject (id object)
95 { 97 {
96 objc.id result = OS.objc_msgSend(this.id, OS.sel_newItemForRepresentedObject_1, object !is null ? object.id : null); 98 objc.id result = OS.objc_msgSend(this.id_, OS.sel_newItemForRepresentedObject_1, object !is null ? object.id_ : null);
97 return result !is null ? new NSCollectionViewItem(result) : null; 99 return result !is null ? new NSCollectionViewItem(result) : null;
98 } 100 }
99 101
100 public NSIndexSet selectionIndexes () 102 public NSIndexSet selectionIndexes ()
101 { 103 {
102 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexes); 104 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectionIndexes);
103 return result !is null ? new NSIndexSet(result) : null; 105 return result !is null ? new NSIndexSet(result) : null;
104 } 106 }
105 107
106 public void setAllowsMultipleSelection (bool flag) 108 public void setAllowsMultipleSelection (bool flag)
107 { 109 {
108 OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag); 110 OS.objc_msgSend(this.id_, OS.sel_setAllowsMultipleSelection_1, flag);
109 } 111 }
110 112
111 public void setBackgroundColors (NSArray colors) 113 public void setBackgroundColors (NSArray colors)
112 { 114 {
113 OS.objc_msgSend(this.id, OS.sel_setBackgroundColors_1, colors !is null ? colors.id : null); 115 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColors_1, colors !is null ? colors.id_ : null);
114 } 116 }
115 117
116 public void setContent (NSArray content) 118 public void setContent (NSArray content)
117 { 119 {
118 OS.objc_msgSend(this.id, OS.sel_setContent_1, content !is null ? content.id : null); 120 OS.objc_msgSend(this.id_, OS.sel_setContent_1, content !is null ? content.id_ : null);
119 } 121 }
120 122
121 public void setItemPrototype (NSCollectionViewItem prototype) 123 public void setItemPrototype (NSCollectionViewItem prototype)
122 { 124 {
123 OS.objc_msgSend(this.id, OS.sel_setItemPrototype_1, prototype !is null ? prototype.id : null); 125 OS.objc_msgSend(this.id_, OS.sel_setItemPrototype_1, prototype !is null ? prototype.id_ : null);
124 } 126 }
125 127
126 public void setMaxItemSize (NSSize size) 128 public void setMaxItemSize (NSSize size)
127 { 129 {
128 OS.objc_msgSend(this.id, OS.sel_setMaxItemSize_1, size); 130 OS.objc_msgSend(this.id_, OS.sel_setMaxItemSize_1, size);
129 } 131 }
130 132
131 public void setMaxNumberOfColumns (NSUInteger number) 133 public void setMaxNumberOfColumns (NSUInteger number)
132 { 134 {
133 OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfColumns_1, number); 135 OS.objc_msgSend(this.id_, OS.sel_setMaxNumberOfColumns_1, number);
134 } 136 }
135 137
136 public void setMaxNumberOfRows (NSUInteger number) 138 public void setMaxNumberOfRows (NSUInteger number)
137 { 139 {
138 OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfRows_1, number); 140 OS.objc_msgSend(this.id_, OS.sel_setMaxNumberOfRows_1, number);
139 } 141 }
140 142
141 public void setMinItemSize (NSSize size) 143 public void setMinItemSize (NSSize size)
142 { 144 {
143 OS.objc_msgSend(this.id, OS.sel_setMinItemSize_1, size); 145 OS.objc_msgSend(this.id_, OS.sel_setMinItemSize_1, size);
144 } 146 }
145 147
146 public void setSelectable (bool flag) 148 public void setSelectable (bool flag)
147 { 149 {
148 OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag); 150 OS.objc_msgSend(this.id_, OS.sel_setSelectable_1, flag);
149 } 151 }
150 152
151 public void setSelectionIndexes (NSIndexSet indexes) 153 public void setSelectionIndexes (NSIndexSet indexes)
152 { 154 {
153 OS.objc_msgSend(this.id, OS.sel_setSelectionIndexes_1, indexes !is null ? indexes.id : null); 155 OS.objc_msgSend(this.id_, OS.sel_setSelectionIndexes_1, indexes !is null ? indexes.id_ : null);
154 } 156 }
155 157
156 } 158 }