< prev index next >

src/java.desktop/windows/native/libawt/windows/awt.h

Print this page




 146                                                      JNI_TRUE)
 147 /*  /NEW JNI */
 148 
 149 /*
 150  * IS_WIN64 returns TRUE on 64-bit Itanium
 151  */
 152 #if defined (_WIN64)
 153     #define IS_WIN64 TRUE
 154 #else
 155     #define IS_WIN64 FALSE
 156 #endif
 157 
 158 /*
 159  * IS_WIN2000 returns TRUE on 2000, XP and Vista
 160  * IS_WINXP returns TRUE on XP and Vista
 161  * IS_WINVISTA returns TRUE on Vista
 162  */
 163 #define IS_WIN2000 (LOBYTE(LOWORD(::GetVersion())) >= 5)
 164 #define IS_WINXP ((IS_WIN2000 && HIBYTE(LOWORD(::GetVersion())) >= 1) || LOBYTE(LOWORD(::GetVersion())) > 5)
 165 #define IS_WINVISTA (LOBYTE(LOWORD(::GetVersion())) >= 6)



 166 
 167 #define IS_WINVER_ATLEAST(maj, min) \
 168                    ((maj) < LOBYTE(LOWORD(::GetVersion())) || \
 169                       (maj) == LOBYTE(LOWORD(::GetVersion())) && \
 170                       (min) <= HIBYTE(LOWORD(::GetVersion())))
 171 
 172 /*
 173  * macros to crack a LPARAM into two ints -- used for signed coordinates,
 174  * such as with mouse messages.
 175  */
 176 #define LO_INT(l)           ((int)(short)(l))
 177 #define HI_INT(l)           ((int)(short)(((DWORD)(l) >> 16) & 0xFFFF))
 178 
 179 extern JavaVM *jvm;
 180 
 181 // Platform encoding is Unicode (UTF-16), re-define JNU_ functions
 182 // to proper JNI functions.
 183 #define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast<const jchar*>(x), static_cast<jsize>(_tcslen(x)))
 184 #define JNU_GetStringPlatformChars(env, x, y) reinterpret_cast<LPCWSTR>(env->GetStringChars(x, y))
 185 #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast<const jchar*>(y))




 146                                                      JNI_TRUE)
 147 /*  /NEW JNI */
 148 
 149 /*
 150  * IS_WIN64 returns TRUE on 64-bit Itanium
 151  */
 152 #if defined (_WIN64)
 153     #define IS_WIN64 TRUE
 154 #else
 155     #define IS_WIN64 FALSE
 156 #endif
 157 
 158 /*
 159  * IS_WIN2000 returns TRUE on 2000, XP and Vista
 160  * IS_WINXP returns TRUE on XP and Vista
 161  * IS_WINVISTA returns TRUE on Vista
 162  */
 163 #define IS_WIN2000 (LOBYTE(LOWORD(::GetVersion())) >= 5)
 164 #define IS_WINXP ((IS_WIN2000 && HIBYTE(LOWORD(::GetVersion())) >= 1) || LOBYTE(LOWORD(::GetVersion())) > 5)
 165 #define IS_WINVISTA (LOBYTE(LOWORD(::GetVersion())) >= 6)
 166 #define IS_WIN8 (                                                              \
 167     (IS_WINVISTA && (HIBYTE(LOWORD(::GetVersion())) >= 2)) ||                  \
 168     (LOBYTE(LOWORD(::GetVersion())) > 6))
 169 
 170 #define IS_WINVER_ATLEAST(maj, min) \
 171                    ((maj) < LOBYTE(LOWORD(::GetVersion())) || \
 172                       (maj) == LOBYTE(LOWORD(::GetVersion())) && \
 173                       (min) <= HIBYTE(LOWORD(::GetVersion())))
 174 
 175 /*
 176  * macros to crack a LPARAM into two ints -- used for signed coordinates,
 177  * such as with mouse messages.
 178  */
 179 #define LO_INT(l)           ((int)(short)(l))
 180 #define HI_INT(l)           ((int)(short)(((DWORD)(l) >> 16) & 0xFFFF))
 181 
 182 extern JavaVM *jvm;
 183 
 184 // Platform encoding is Unicode (UTF-16), re-define JNU_ functions
 185 // to proper JNI functions.
 186 #define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast<const jchar*>(x), static_cast<jsize>(_tcslen(x)))
 187 #define JNU_GetStringPlatformChars(env, x, y) reinterpret_cast<LPCWSTR>(env->GetStringChars(x, y))
 188 #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast<const jchar*>(y))


< prev index next >