View Javadoc

1   /* Copyright (c) 2007 Timothy Wall, All Rights Reserved
2    * 
3    * This library is free software; you can redistribute it and/or
4    * modify it under the terms of the GNU Lesser General Public
5    * License as published by the Free Software Foundation; either
6    * version 2.1 of the License, or (at your option) any later version.
7    * 
8    * This library is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   * Lesser General Public License for more details.  
12   */
13  
14  package org.ximtec.igesture.io.win32;
15  
16  import com.sun.jna.IntegerType;
17  import com.sun.jna.Pointer;
18  import com.sun.jna.PointerType;
19  import com.sun.jna.win32.StdCallLibrary;
20  
21  /** Base type for most W32 API libraries.  Provides standard options
22   * for unicode/ASCII mappings.  Set the system property <code>w32.ascii</code>
23   * to <code>true</code> to default to the ASCII mappings.
24   */
25  public interface W32API extends StdCallLibrary, W32Errors {
26      
27      
28      public static class HANDLE extends PointerType { 
29          public HANDLE() { }
30          public HANDLE(Pointer p) { super(p); }
31      }
32      
33      public static class HDC extends HANDLE { }
34      public static class HICON extends HANDLE { }
35      public static class HBITMAP extends HANDLE { }
36      public static class HRGN extends HANDLE { }
37      public static class HWND extends HANDLE { }
38      public static class HINSTANCE extends HANDLE { }
39      public static class HMODULE extends HINSTANCE { }
40      
41  
42      HANDLE INVALID_HANDLE_VALUE = new HANDLE() {//Pointer.PM1
43          public void setPointer(Pointer p) { 
44              throw new UnsupportedOperationException("Immutable reference");
45          }
46      };
47      
48      public static class LONG_PTR extends IntegerType { 
49      	public LONG_PTR() { this(0); }
50      	public LONG_PTR(long value) { super(Pointer.SIZE, value); }
51      }
52      public static class LPARAM extends IntegerType { //LONG_PTR
53      	public LPARAM() { this(0); }
54      	public LPARAM(long value) { super(Pointer.SIZE, value);}//super(value); 
55      } 
56      public static class WPARAM extends IntegerType { //IntegerType 
57      	public WPARAM() { this(0); }
58      	public WPARAM(long value) { super(Pointer.SIZE, value); } //super(Pointer.SIZE, value);
59      } 
60      
61      public static class LRESULT extends LONG_PTR { 
62      	public LRESULT() { this(0); }
63      	public LRESULT(long value) { super(value); }
64      } 
65      
66      public static class ULONG_PTR extends IntegerType {
67      	public ULONG_PTR() { super(Pointer.SIZE); }
68      	public ULONG_PTR(long value) { super(Pointer.SIZE, value); }
69      }
70  }