View Javadoc

1   /*
2    * @(#)$Id: Wintab32.java 689 2009-07-22 00:10:27Z bsigner $
3    *
4    * Author       :   Michele Croci, mcroci@gmail.com
5    *
6    * Purpose      :   Access to wintab32.dll.
7    *
8    * -----------------------------------------------------------------------
9    *
10   * Revision Information:
11   *
12   * Date             Who         Reason
13   *
14   * Oct 22, 2007     crocimi         Initial Release
15   * 
16   *
17   * -----------------------------------------------------------------------
18   *
19   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20   *
21   * This software is the proprietary information of ETH Zurich.
22   * Use is subject to license terms.
23   * 
24   */
25  
26  
27  
28  package org.ximtec.igesture.io.wacom;
29  
30  
31  
32  
33  
34  import org.ximtec.igesture.io.win32.W32API;
35  
36  import com.sun.jna.Structure;
37  
38  
39  /** Provides access to the w32 wintab32 library.
40   *  
41   * @author Michele Croci
42   */
43  
44  public interface Wintab32 extends W32API {
45  
46  	  
47  	    
48  	    static int HWND_BROADCAST = 0xffff;
49      	static int WTI_DEFCONTEXT = 3; //first parameter for WTInfo (not move cursor)
50      	static int WTI_DEFSYSCTX = 4; //first parameter for WTInfo (move cursor)
51      	static int WTI_DEVICES = 100; //status info about device
52  
53  	    HDC WTOpenW(HWND hwnd, LOGCONTEXTW s, boolean b);
54  	    
55  	    boolean WTClose(HDC hDC);
56  	    
57  	    int WTInfoW(int category, int index, LOGCONTEXTW s);
58  	    
59  	    int WTQueueSizeGet(HDC hdc);
60  	    
61  	    //The return value is the number of packets copied in the buffer
62  	    int WTPacketsGet(HDC hdc, int max, PACKET p);
63  	    int WTPacketsGet(HDC hdc, int max, PACKET[] p);
64  	    boolean WTPacket(HDC hdc, int wSerial, PACKET p);
65  	    void WacomDoSpecialContextHandling(boolean b); 
66  	    
67  
68  	    HANDLE WTMgrPacketHookEx(HINSTANCE hmgr, int nType, String module, String hookproc); //not sure
69  	    
70  	    
71  	    public static class LOGCONTEXTW extends Structure {
72  	    	// see wintab32.dll specification
73  	    	
74  			//public String lcName;
75  			public char[] lcName=new char[40];
76  			public int	lcOptions;
77  			public int	lcStatus;
78  			public int	lcLocks;
79  			public int	lcMsgBase;
80  			public int	lcDevice;
81  			public int	lcPktRate;
82  			public int	lcPktData; 
83  			public int	lcPktMode;
84  			public int	lcMoveMask; 
85  			public int	lcBtnDnMask;
86  			public int	lcBtnUpMask;
87  			public int	lcInOrgX;
88  			public int	lcInOrgY;
89  			public int	lcInOrgZ;
90  			public int	lcInExtX;
91  			public int	lcInExtY;
92  			public int	lcInExtZ;
93  			public int	lcOutOrgX;
94  			public int	lcOutOrgY;
95  			public int	lcOutOrgZ;
96  			public int	lcOutExtX;
97  			public int	lcOutExtY;
98  			public int	lcOutExtZ;
99  			public int	lcSensX;
100 			public int	lcSensY;
101 			public int	lcSensZ;
102 			public boolean	lcSysMode;
103 			public int		lcSysOrgX;
104 			public int		lcSysOrgY;
105 			public int		lcSysExtX;
106 			public int		lcSysExtY;
107 			public int	lcSysSensX;
108 			public int	lcSysSensY;
109 			
110 	    }
111 
112 	    // for specification see wintab.h
113 	    public static class PACKET extends Structure {
114 	    	// see wintab32.dll specification
115 	    	public HDC pkContext;
116 	    	public int pkStatus;
117 	    	public int pkTime;
118 	    	public int pkChanged; 
119 	    	public int pkSerialNumber;
120 	    	public int pkCursor;
121 	    	public int pkButtons;
122 	    	public int pkX; 
123 	    	public int pkY; 
124 	    	public int pkZ; 
125 	    	public int pkNormalPressure;
126 	    	public int pkTangentPressure;
127 	    	public ORIENTATION	pkOrientation;
128 	    	public ROTATION pkRotation; 
129 
130 	    }
131 	    
132 	    public static class ORIENTATION extends Structure{
133 	    	public int orAzimuth;
134 	    	public int orAltitude;
135 	    	public int orTwist;
136 	    }
137 		
138 		public static class ROTATION extends Structure{
139 	    	public int	roPitch;
140 	    	public int roRoll;
141 	    	public int roYaw;
142 	    } 
143 
144 	}
145 
146 
147