Source Code Cross Referenced for W32API.java in  » IDE-Netbeans » core » org » netbeans » core » nativeaccess » transparency » win32 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » core » org.netbeans.core.nativeaccess.transparency.win32 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2007 Timothy Wall, All Rights Reserved
002:         * 
003:         * This library is free software; you can redistribute it and/or
004:         * modify it under the terms of the GNU Lesser General Public
005:         * License as published by the Free Software Foundation; either
006:         * version 2.1 of the License, or (at your option) any later version.
007:         * 
008:         * This library is distributed in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011:         * Lesser General Public License for more details.  
012:         */
013:        package org.netbeans.core.nativeaccess.transparency.win32;
014:
015:        import java.util.HashMap;
016:        import java.util.Map;
017:
018:        import com.sun.jna.FromNativeContext;
019:        import com.sun.jna.IntegerType;
020:        import com.sun.jna.Pointer;
021:        import com.sun.jna.PointerType;
022:        import com.sun.jna.ptr.ByReference;
023:        import com.sun.jna.win32.StdCallLibrary;
024:        import com.sun.jna.win32.W32APIFunctionMapper;
025:        import com.sun.jna.win32.W32APITypeMapper;
026:
027:        /** Base type for most W32 API libraries.  Provides standard options
028:         * for unicode/ASCII mappings.  Set the system property <code>w32.ascii</code>
029:         * to <code>true</code> to default to the ASCII mappings.
030:         */
031:        public interface W32API extends StdCallLibrary, W32Errors {
032:
033:            /** Standard options to use the unicode version of a w32 API. */
034:            Map UNICODE_OPTIONS = new HashMap() {
035:                {
036:                    put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
037:                    put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
038:                }
039:            };
040:            /** Standard options to use the ASCII/MBCS version of a w32 API. */
041:            Map ASCII_OPTIONS = new HashMap() {
042:                {
043:                    put(OPTION_TYPE_MAPPER, W32APITypeMapper.ASCII);
044:                    put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.ASCII);
045:                }
046:            };
047:            Map DEFAULT_OPTIONS = Boolean.getBoolean("w32.ascii") ? ASCII_OPTIONS
048:                    : UNICODE_OPTIONS;
049:
050:            public static class HANDLE extends PointerType {
051:                /** Override to the appropriate object for INVALID_HANDLE_VALUE. */
052:                public Object fromNative(Object nativeValue,
053:                        FromNativeContext context) {
054:                    Object o = super .fromNative(nativeValue, context);
055:                    if (INVALID_HANDLE_VALUE.equals(o))
056:                        return INVALID_HANDLE_VALUE;
057:                    return o;
058:                }
059:            }
060:
061:            public static class HDC extends HANDLE {
062:            }
063:
064:            public static class HICON extends HANDLE {
065:            }
066:
067:            public static class HBITMAP extends HANDLE {
068:            }
069:
070:            public static class HRGN extends HANDLE {
071:            }
072:
073:            public static class HWND extends HANDLE {
074:            }
075:
076:            public static class HINSTANCE extends HANDLE {
077:            }
078:
079:            public static class HMODULE extends HINSTANCE {
080:            }
081:
082:            /** Constant value representing an invalid HANDLE. */
083:            HANDLE INVALID_HANDLE_VALUE = new HANDLE() {
084:                {
085:                    super .setPointer(Pointer.createConstant(-1));
086:                }
087:
088:                public void setPointer(Pointer p) {
089:                    throw new UnsupportedOperationException(
090:                            "Immutable reference");
091:                }
092:            };
093:            /** Special HWND value. */
094:            HWND HWND_BROADCAST = new HWND() {
095:                {
096:                    super .setPointer(Pointer.createConstant(0xFFFF));
097:                }
098:
099:                public void setPointer(Pointer p) {
100:                    throw new UnsupportedOperationException(
101:                            "Immutable reference");
102:                }
103:            };
104:
105:            /** LPHANDLE */
106:            public static class HANDLEByReference extends ByReference {
107:                public HANDLEByReference() {
108:                    this (null);
109:                }
110:
111:                public HANDLEByReference(HANDLE h) {
112:                    super (Pointer.SIZE);
113:                    setValue(h);
114:                }
115:
116:                public void setValue(HANDLE h) {
117:                    getPointer().setPointer(0,
118:                            h != null ? h.getPointer() : null);
119:                }
120:
121:                public HANDLE getValue() {
122:                    Pointer p = getPointer().getPointer(0);
123:                    if (p == null)
124:                        return null;
125:                    if (INVALID_HANDLE_VALUE.getPointer().equals(p))
126:                        return INVALID_HANDLE_VALUE;
127:                    HANDLE h = new HANDLE();
128:                    h.setPointer(p);
129:                    return h;
130:                }
131:            }
132:
133:            public static class LONG_PTR extends IntegerType {
134:                public LONG_PTR() {
135:                    this (0);
136:                }
137:
138:                public LONG_PTR(long value) {
139:                    super (Pointer.SIZE, value);
140:                }
141:            }
142:
143:            public static class SSIZE_T extends LONG_PTR {
144:                public SSIZE_T() {
145:                    this (0);
146:                }
147:
148:                public SSIZE_T(long value) {
149:                    super (value);
150:                }
151:            }
152:
153:            public static class ULONG_PTR extends IntegerType {
154:                public ULONG_PTR() {
155:                    this (0);
156:                }
157:
158:                public ULONG_PTR(long value) {
159:                    super (Pointer.SIZE, value);
160:                }
161:            }
162:
163:            public static class SIZE_T extends ULONG_PTR {
164:                public SIZE_T() {
165:                    this (0);
166:                }
167:
168:                public SIZE_T(long value) {
169:                    super (value);
170:                }
171:            }
172:
173:            public static class LPARAM extends LONG_PTR {
174:                public LPARAM() {
175:                    this (0);
176:                }
177:
178:                public LPARAM(long value) {
179:                    super (value);
180:                }
181:            }
182:
183:            public static class LRESULT extends LONG_PTR {
184:                public LRESULT() {
185:                    this (0);
186:                }
187:
188:                public LRESULT(long value) {
189:                    super (value);
190:                }
191:            }
192:
193:            public static class UINT_PTR extends IntegerType {
194:                public UINT_PTR() {
195:                    super (Pointer.SIZE);
196:                }
197:
198:                public UINT_PTR(long value) {
199:                    super (Pointer.SIZE, value);
200:                }
201:
202:                public Pointer toPointer() {
203:                    return Pointer.createConstant(longValue());
204:                }
205:            }
206:
207:            public static class WPARAM extends UINT_PTR {
208:                public WPARAM() {
209:                    this (0);
210:                }
211:
212:                public WPARAM(long value) {
213:                    super(value);
214:                }
215:            }
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.