1 | /* |
2 | * $Id: LOGFONT.java,v 1.1.1.5 2004/05/25 20:23:24 hastings Exp $ |
3 | * |
4 | * (c) Copyright, Moebius Solutions, Inc., 2004 |
5 | * |
6 | * All Rights Reserved |
7 | * |
8 | * This material may be reproduced by or for the U. S. Government |
9 | * pursuant to the copyright license under the clause at |
10 | * DFARS 252.227-7014 (OCT 2001). |
11 | */ |
12 | |
13 | package com.moesol.bindings.platform_sdk.windows_api; |
14 | |
15 | import java.nio.ByteBuffer; |
16 | import com.moesol.bindings.NativeStructure; |
17 | |
18 | /** |
19 | * @author hastings |
20 | * |
21 | * Emulate Win32 LOGFONT structure in Java. |
22 | */ |
23 | public class LOGFONT extends NativeStructure { |
24 | public LOGFONT() { |
25 | super( new byte[sizeof()] ); |
26 | } |
27 | public LOGFONT(ByteBuffer bb) { |
28 | super( bb ); |
29 | } |
30 | public static int sizeof() { |
31 | return 60; |
32 | } |
33 | public void set_lfHeight(int v) { |
34 | putInt(0, v); |
35 | } |
36 | public int get_lfHeight() { |
37 | return getInt(0); |
38 | } |
39 | public void set_lfWidth(int v) { |
40 | putInt(4, v); |
41 | } |
42 | public int get_lfWidth() { |
43 | return getInt(4); |
44 | } |
45 | public void set_lfEscapement(int v) { |
46 | putInt(8, v); |
47 | } |
48 | public int get_lfEscapement() { |
49 | return getInt(8); |
50 | } |
51 | public void set_lfOrientation(int v) { |
52 | putInt(12, v); |
53 | } |
54 | public int get_lfOrientation() { |
55 | return getInt(12); |
56 | } |
57 | public void set_lfWeight(int v) { |
58 | putInt(16, v); |
59 | } |
60 | public int get_lfWeight() { |
61 | return getInt(16); |
62 | } |
63 | public void set_lfItalic(byte v) { |
64 | putByte(20, v); |
65 | } |
66 | public byte get_lfItalic() { |
67 | return getByte(20); |
68 | } |
69 | public void set_lfUnderline(byte v) { |
70 | putByte(21, v); |
71 | } |
72 | public byte get_lfUnderline() { |
73 | return getByte(21); |
74 | } |
75 | public void set_lfStrikeOut(byte v) { |
76 | putByte(22, v); |
77 | } |
78 | public byte get_lfStrikeOut() { |
79 | return getByte(22); |
80 | } |
81 | public void set_lfCharSet(byte v) { |
82 | putByte(23, v); |
83 | } |
84 | public byte get_lfCharSet() { |
85 | return getByte(23); |
86 | } |
87 | public void set_lfOutPrecision(byte v) { |
88 | putByte(24, v); |
89 | } |
90 | public byte get_lfOutPrecision() { |
91 | return getByte(24); |
92 | } |
93 | public void set_lfClipPrecision(byte v) { |
94 | putByte(25, v); |
95 | } |
96 | public byte get_lfClipPrecision() { |
97 | return getByte(25); |
98 | } |
99 | public void set_lfQuality(byte v) { |
100 | putByte(26, v); |
101 | } |
102 | public byte get_lfQuality() { |
103 | return getByte(26); |
104 | } |
105 | public void set_lfPitchAndFamily(byte v) { |
106 | putByte(27, v); |
107 | } |
108 | public byte get_lfPitchAndFamily() { |
109 | return getByte(27); |
110 | } |
111 | public void set_lfFaceName(String v) { |
112 | putString(28, 32, v); |
113 | } |
114 | public String get_lfFaceName() { |
115 | return getString(28, 32); |
116 | } |
117 | } |