EMMA Coverage Report (generated Mon Mar 20 21:34:30 PST 2006)
[all classes][com.moesol.bindings.platform_sdk.windows_api]

COVERAGE SUMMARY FOR SOURCE FILE [MENUITEMINFO.java]

nameclass, %method, %block, %line, %
MENUITEMINFO.java100% (1/1)92%  (36/39)91%  (246/270)93%  (54/58)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MENUITEMINFO100% (1/1)92%  (36/39)91%  (246/270)93%  (54/58)
get_hbmpItem (): HBITMAP 0%   (0/1)0%   (0/9)0%   (0/1)
set_hbmpItem (HBITMAP): void 0%   (0/1)0%   (0/9)0%   (0/2)
verify_hbmpItem (int): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
MENUITEMINFO (): void 100% (1/1)100% (17/17)100% (6/6)
get_cbSize (): int 100% (1/1)100% (5/5)100% (1/1)
get_cch (): int 100% (1/1)100% (5/5)100% (1/1)
get_dwItemData (): int 100% (1/1)100% (5/5)100% (1/1)
get_dwTypeData (): String 100% (1/1)100% (3/3)100% (1/1)
get_fMask (): int 100% (1/1)100% (5/5)100% (1/1)
get_fState (): int 100% (1/1)100% (5/5)100% (1/1)
get_fType (): int 100% (1/1)100% (5/5)100% (1/1)
get_hSubMenu (): HMENU 100% (1/1)100% (10/10)100% (1/1)
get_hbmpChecked (): HBITMAP 100% (1/1)100% (10/10)100% (1/1)
get_hbmpUnchecked (): HBITMAP 100% (1/1)100% (10/10)100% (1/1)
get_wID (): int 100% (1/1)100% (5/5)100% (1/1)
set_cbSize (int): void 100% (1/1)100% (7/7)100% (2/2)
set_cch (int): void 100% (1/1)100% (7/7)100% (2/2)
set_dwItemData (int): void 100% (1/1)100% (7/7)100% (2/2)
set_dwTypeData (String): void 100% (1/1)100% (4/4)100% (2/2)
set_fMask (int): void 100% (1/1)100% (7/7)100% (2/2)
set_fState (int): void 100% (1/1)100% (7/7)100% (2/2)
set_fType (int): void 100% (1/1)100% (7/7)100% (2/2)
set_hSubMenu (HMENU): void 100% (1/1)100% (9/9)100% (2/2)
set_hbmpChecked (HBITMAP): void 100% (1/1)100% (9/9)100% (2/2)
set_hbmpUnchecked (HBITMAP): void 100% (1/1)100% (9/9)100% (2/2)
set_wID (int): void 100% (1/1)100% (7/7)100% (2/2)
sizeof (): int 100% (1/1)100% (2/2)100% (1/1)
verify_cbSize (): boolean 100% (1/1)100% (5/5)100% (1/1)
verify_cch (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_dwItemData (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_dwTypeData (String): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_fMask (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_fState (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_fType (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_hSubMenu (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_hbmpChecked (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_hbmpUnchecked (int): boolean 100% (1/1)100% (6/6)100% (1/1)
verify_wID (int): boolean 100% (1/1)100% (6/6)100% (1/1)
zero (): void 100% (1/1)100% (14/14)100% (3/3)

1/*
2 * $Id: MENUITEMINFO.java,v 1.2 2004/11/03 22:18: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 
13package com.moesol.bindings.platform_sdk.windows_api;
14 
15import java.nio.*;
16 
17/**
18 * Wraps a java class around a Win32 MENUITEMINFO structure, see the
19 * Win32 documentation for more information about the properties.
20 * TODO: Refactor to use com.moesol.nio.NativeStructure (uses a non-direct ByteBuffer).
21 */
22public class MENUITEMINFO {
23    public MENUITEMINFO() {
24        m_native_mii = ByteBuffer.allocateDirect(sizeof());
25        m_native_mii.order(ByteOrder.nativeOrder());
26        zero();
27        set_cbSize(sizeof());
28    }
29    
30    private void set_cbSize(int size) {
31        m_native_mii.putInt(0, size);
32    }
33    /** package access for testing */
34    int get_cbSize() {
35        return m_native_mii.getInt(0);
36    }
37    boolean verify_cbSize() {
38        return jni_verify_cbSize(m_native_mii);
39    }
40 
41    public void set_fMask(int mask) {
42        m_native_mii.putInt(4, mask);
43    }
44    public int get_fMask() {
45        return m_native_mii.getInt(4);
46    }
47    boolean verify_fMask(int value) {
48        return jni_verify_fMask(m_native_mii, value);
49    }
50 
51    public void set_fType(int type) {
52        m_native_mii.putInt(8, type);
53    }
54    public int get_fType() {
55        return m_native_mii.getInt(8);
56    }
57    boolean verify_fType(int value) {
58        return jni_verify_fType(m_native_mii, value);
59    }
60 
61    public void set_fState(int state) {
62        m_native_mii.putInt(12, state);
63    }
64    public int get_fState() {
65        return m_native_mii.getInt(12);
66    }
67    boolean verify_fState(int value) {
68        return jni_verify_fState(m_native_mii, value);
69    }
70 
71    public void set_wID(int id) {
72        m_native_mii.putInt(16, id);
73    }
74    public int get_wID() {
75        return m_native_mii.getInt(16);
76    }
77    boolean verify_wID(int value) {
78        return jni_verify_wID(m_native_mii, value);
79    }
80 
81    public void set_hSubMenu(HMENU submenu) {
82        m_native_mii.putInt(20, (int)HMENU._safeGetHandle(submenu));
83    }
84    public HMENU get_hSubMenu() {
85        return new HMENU(m_native_mii.getInt(20), true);
86    }
87    boolean verify_hSubMenu(int value) {
88        return jni_verify_hSubMenu(m_native_mii, value);
89    }
90 
91    public void set_hbmpChecked(HBITMAP bitmap) {
92        m_native_mii.putInt(24, (int)HBITMAP._safeGetHandle(bitmap));
93    }
94    public HBITMAP get_hbmpChecked() {
95        return new HBITMAP(m_native_mii.getInt(24), true);
96    }
97    boolean verify_hbmpChecked(int value) {
98        return jni_verify_hbmpChecked(m_native_mii, value);
99    }
100 
101    public void set_hbmpUnchecked(HBITMAP bitmap) {
102        m_native_mii.putInt(28, (int)HBITMAP._safeGetHandle(bitmap));
103    }
104    public HBITMAP get_hbmpUnchecked() {
105        return new HBITMAP(m_native_mii.getInt(28), true);
106    }
107    boolean verify_hbmpUnchecked(int value) {
108        return jni_verify_hbmpUnchecked(m_native_mii, value);
109    }
110 
111    public void set_dwItemData(int item_data) {
112        m_native_mii.putInt(32, item_data);
113    }
114    public int get_dwItemData() {
115        return m_native_mii.getInt(32);
116    }
117    boolean verify_dwItemData(int value) {
118        return jni_verify_dwItemData(m_native_mii, value);
119    }
120 
121    public void set_dwTypeData(String type_data) {
122        // Only support strings for now, and you
123        // have to convert from String to UTF
124        // in InsertMenuItem
125        m_type_data = type_data;
126        // offset of 36
127    }
128    public String get_dwTypeData() {
129        return m_type_data;
130    }
131    boolean verify_dwTypeData(String value) {
132        return jni_verify_dwTypeData(m_native_mii, value);
133    }
134    
135    public void set_cch(int cch) {
136        m_native_mii.putInt(40, cch);
137    }
138    public int get_cch() {
139        return m_native_mii.getInt(40);
140    }
141    boolean verify_cch(int value) {
142        return jni_verify_cch(m_native_mii, value);
143    }
144 
145    /**
146     * Note that the hbmpItem member of MENUITEMINFO only appears if
147     * the JNI side is compiled with _WIN32_WINNT >= 0x0500. Therefore
148     * this method may throw a IndexOutOfBoundsException.
149     *
150     * @throws IndexOutOfBoundsException If JNI side is missing this
151     * member.
152     */
153    public void set_hbmpItem(HBITMAP bitmap) {
154        m_native_mii.putInt(44, (int)HBITMAP._safeGetHandle(bitmap));
155    }
156    /**
157     * @throws IndexOutOfBoundsException If JNI side is missing this
158     * member.
159     */
160    public HBITMAP get_hbmpItem() {
161        return new HBITMAP(m_native_mii.getInt(44));
162    }
163    boolean verify_hbmpItem(int value) {
164        return jni_verify_hbmpItem(m_native_mii, value);
165    }
166    
167    private void zero() {
168        for (int i = 0; i < sizeof(); i++) {
169            m_native_mii.put(i, (byte)0);
170        }
171    }
172    static int sizeof() {
173        return jni_sizeof();
174    }
175 
176    public static final int MIIM_STATE =        0x00000001;
177    public static final int MIIM_ID =           0x00000002;
178    public static final int MIIM_SUBMENU =      0x00000004;
179    public static final int MIIM_CHECKMARKS =   0x00000008;
180    public static final int MIIM_TYPE =         0x00000010;
181    public static final int MIIM_DATA =         0x00000020;
182 
183    public static final int MFT_STRING =        0x00000000;
184    public static final int MFT_BITMAP =        0x00000004;
185    public static final int MFT_MENUBARBREAK =  0x00000020;
186    public static final int MFT_MENUBREAK =     0x00000040;
187    public static final int MFT_OWNERDRAW =     0x00000100;
188    public static final int MFT_RADIOCHECK =    0x00000200;
189    public static final int MFT_SEPARATOR =     0x00000800;
190    public static final int MFT_RIGHTORDER =    0x00002000;
191    public static final int MFT_RIGHTJUSTIFY =  0x00004000;
192 
193    public static final int MFS_GRAYED =        0x00000003;
194    public static final int MFS_DISABLED = MFS_GRAYED;
195    public static final int MFS_CHECKED =       0x00000008;
196    public static final int MFS_HILITE =        0x00000080;
197    public static final int MFS_ENABLED =       0x00000000;
198    public static final int MFS_UNCHECKED =     0x00000000;
199    public static final int MFS_UNHILITE =      0x00000000;
200    public static final int MFS_DEFAULT =       0x00001000;
201 
202    private static native int jni_sizeof();
203    private native boolean jni_verify_cbSize(ByteBuffer native_mmi);
204    private native boolean jni_verify_fMask(ByteBuffer native_mmi, int value);
205    private native boolean jni_verify_fType(ByteBuffer native_mmi, int value);
206    private native boolean jni_verify_fState(ByteBuffer native_mmi, int value);
207    private native boolean jni_verify_wID(ByteBuffer native_mmi, int value);
208    private native boolean jni_verify_hSubMenu(ByteBuffer native_mmi, int value);
209    private native boolean jni_verify_hbmpChecked(ByteBuffer native_mmi, int value);
210    private native boolean jni_verify_hbmpUnchecked(ByteBuffer native_mmi, int value);
211    private native boolean jni_verify_dwItemData(ByteBuffer native_mmi, int value);
212    private native boolean jni_verify_dwTypeData(ByteBuffer native_mmi, String value);
213    private native boolean jni_verify_cch(ByteBuffer native_mmi, int value);
214    private native boolean jni_verify_hbmpItem(ByteBuffer native_mmi, int value);
215    
216    ByteBuffer m_native_mii;
217    String m_type_data;
218}

[all classes][com.moesol.bindings.platform_sdk.windows_api]
EMMA 2.0.5312 (C) Vladimir Roubtsov