comparison dwt/internal/cocoa/NSGlyphInfo.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSGlyphInfo;
15
16 import dwt.internal.cocoa.NSFont;
17 import dwt.internal.cocoa.NSInteger;
18 import dwt.internal.cocoa.NSObject;
19 import dwt.internal.cocoa.NSString;
20 import dwt.internal.cocoa.OS;
21 import objc = dwt.internal.objc.runtime;
22
23 enum NSCharacterCollection
24 {
25 NSIdentityMappingCharacterCollection = 0,
26 NSAdobeCNS1CharacterCollection = 1,
27 NSAdobeGB1CharacterCollection = 2,
28 NSAdobeJapan1CharacterCollection = 3,
29 NSAdobeJapan2CharacterCollection = 4,
30 NSAdobeKorea1CharacterCollection = 5,
31 }
32
33 public class NSGlyphInfo : NSObject
34 {
35
36 public this ()
37 {
38 super();
39 }
40
41 public this (objc.id id)
42 {
43 super(id);
44 }
45
46 public NSCharacterCollection characterCollection ()
47 {
48 return OS.objc_msgSend(this.id, OS.sel_characterCollection);
49 }
50
51 public NSUInteger characterIdentifier ()
52 {
53 return OS.objc_msgSend(this.id, OS.sel_characterIdentifier);
54 }
55
56 public static NSGlyphInfo glyphInfoWithCharacterIdentifier (NSUInteger cid, NSCharacterCollection characterCollection, NSString theString)
57 {
58 objc.id result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithCharacterIdentifier_1collection_1baseString_1, cid,
59 characterCollection, theString !is null ? theString.id : null);
60 return result !is null ? new NSGlyphInfo(result) : null;
61 }
62
63 public static NSGlyphInfo glyphInfoWithGlyph (NSGlyph glyph, NSFont font, NSString theString)
64 {
65 objc.id result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithGlyph_1forFont_1baseString_1, glyph,
66 font !is null ? font.id : null, theString !is null ? theString.id : null);
67 return result !is null ? new NSGlyphInfo(result) : null;
68 }
69
70 public static NSGlyphInfo glyphInfoWithGlyphName (NSString glyphName, NSFont font, NSString theString)
71 {
72 objc.id result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithGlyphName_1forFont_1baseString_1,
73 glyphName !is null ? glyphName.id : null, font !is null ? font.id : null, theString !is null ? theString.id : null);
74 return result !is null ? new NSGlyphInfo(result) : null;
75 }
76
77 public NSString glyphName ()
78 {
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_glyphName);
80 return result !is null ? new NSString(result) : null;
81 }
82
83 }