comparison dwt/internal/cocoa/NSBrowserCell.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSBrowserCell; 14 module dwt.internal.cocoa.NSBrowserCell;
15 15
16 import cocoa = dwt.internal.cocoa.id;
16 import dwt.internal.cocoa.NSCell; 17 import dwt.internal.cocoa.NSCell;
17 import dwt.internal.cocoa.NSColor; 18 import dwt.internal.cocoa.NSColor;
18 import dwt.internal.cocoa.NSImage;
19 import dwt.internal.cocoa.NSView; 19 import dwt.internal.cocoa.NSView;
20 import dwt.internal.cocoa.OS; 20 import dwt.internal.cocoa.OS;
21 import objc = dwt.internal.objc.runtime; 21 import objc = dwt.internal.objc.runtime;
22 22
23 public class NSBrowserCell : NSCell 23 public class NSBrowserCell : NSCell {
24 { 24
25 public this () 25 public this () {
26 { 26 super();
27 super(); 27 }
28 }
29 28
30 public this (objc.id id) 29 public this (objc.id id) {
31 { 30 super(id);
32 super(id); 31 }
33 }
34 32
35 public NSImage alternateImage () 33 public this (cocoa.id id) {
36 { 34 super(id);
37 objc.id result = OS.objc_msgSend(this.id_, OS.sel_alternateImage);
38 return result !is null ? new NSImage(result) : null;
39 }
40 35
41 public static NSImage branchImage () 36 }
42 {
43 objc.id result = OS.objc_msgSend(OS.class_NSBrowserCell, OS.sel_branchImage);
44 return result !is null ? new NSImage(result) : null;
45 }
46 37
47 public NSColor highlightColorInView (NSView controlView) 38 public NSColor highlightColorInView (NSView controlView) {
48 { 39 objc.id result = OS.objc_msgSend(this.id, OS.sel_highlightColorInView_, controlView !is null ? controlView.id : null);
49 objc.id result = OS.objc_msgSend(this.id_, OS.sel_highlightColorInView_1, controlView !is null ? controlView.id_ : null); 40 return result !is null ? new NSColor(result) : null;
50 return result !is null ? new NSColor(result) : null; 41 }
51 }
52 42
53 public static NSImage highlightedBranchImage () 43 public void setLeaf (bool flag) {
54 { 44 OS.objc_msgSend(this.id, OS.sel_setLeaf_, flag);
55 objc.id result = OS.objc_msgSend(OS.class_NSBrowserCell, OS.sel_highlightedBranchImage); 45 }
56 return result !is null ? new NSImage(result) : null;
57 }
58 46
59 public NSImage image ()
60 {
61 objc.id result = OS.objc_msgSend(this.id_, OS.sel_image);
62 return result !is null ? new NSImage(result) : null;
63 }
64
65 public bool isLeaf ()
66 {
67 return OS.objc_msgSend(this.id_, OS.sel_isLeaf) !is null;
68 }
69
70 public bool isLoaded ()
71 {
72 return OS.objc_msgSend(this.id_, OS.sel_isLoaded) !is null;
73 }
74
75 public void reset ()
76 {
77 OS.objc_msgSend(this.id_, OS.sel_reset);
78 }
79
80 public void set ()
81 {
82 OS.objc_msgSend(this.id_, OS.sel_set);
83 }
84
85 public void setAlternateImage (NSImage newAltImage)
86 {
87 OS.objc_msgSend(this.id_, OS.sel_setAlternateImage_1, newAltImage !is null ? newAltImage.id_ : null);
88 }
89
90 public void setImage (NSImage image)
91 {
92 OS.objc_msgSend(this.id_, OS.sel_setImage_1, image !is null ? image.id_ : null);
93 }
94
95 public void setLeaf (bool flag)
96 {
97 OS.objc_msgSend(this.id_, OS.sel_setLeaf_1, flag);
98 }
99
100 public void setLoaded (bool flag)
101 {
102 OS.objc_msgSend(this.id_, OS.sel_setLoaded_1, flag);
103 }
104 } 47 }