Mercurial > projects > dwt-mac
comparison dwt/graphics/GlyphMetrics.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 7d135fe0caf2 |
children |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2006 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.graphics.GlyphMetrics; | 14 module dwt.graphics.GlyphMetrics; |
15 | 15 |
16 import dwt.DWT; | 16 import dwt.DWT; |
17 | 17 |
33 * required, and thus no <code>dispose()</code> method is provided. | 33 * required, and thus no <code>dispose()</code> method is provided. |
34 * </p> | 34 * </p> |
35 * | 35 * |
36 * @see TextStyle | 36 * @see TextStyle |
37 * @see TextLayout | 37 * @see TextLayout |
38 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
38 * | 39 * |
39 * @since 3.2 | 40 * @since 3.2 |
40 */ | 41 */ |
41 public final class GlyphMetrics { | 42 public final class GlyphMetrics { |
42 | 43 |
57 | 58 |
58 /** | 59 /** |
59 * Constructs an instance of this class with the given | 60 * Constructs an instance of this class with the given |
60 * ascent, descent and width values. | 61 * ascent, descent and width values. |
61 * | 62 * |
63 * @param ascent the GlyphMetrics ascent | |
64 * @param descent the GlyphMetrics descent | |
65 * @param width the GlyphMetrics width | |
66 * | |
62 * @exception IllegalArgumentException <ul> | 67 * @exception IllegalArgumentException <ul> |
63 * <li>ERROR_INVALID_ARGUMENT - if the ascent, descent or width argument is negative</li> | 68 * <li>ERROR_INVALID_ARGUMENT - if the ascent, descent or width argument is negative</li> |
64 * </ul> | 69 * </ul> |
65 */ | 70 */ |
66 public this(int ascent, int descent, int width) { | 71 public this(int ascent, int descent, int width) { |
67 if (ascent < 0 || descent < 0 || width < 0) { | 72 if (ascent < 0 || descent < 0 || width < 0) { |
68 DWT.error(DWT.ERROR_INVALID_ARGUMENT); | 73 DWT.error(DWT.ERROR_INVALID_ARGUMENT); |
69 } | 74 } |
70 this.ascent = ascent; | 75 this.ascent = ascent; |
71 this.descent = descent; | 76 this.descent = descent; |
72 this.width = width; | 77 this.width = width; |
73 } | 78 } |