本文整理汇总了C++中AwtComponent::GetJavaModifiers方法的典型用法代码示例。如果您正苦于以下问题:C++ AwtComponent::GetJavaModifiers方法的具体用法?C++ AwtComponent::GetJavaModifiers怎么用?C++ AwtComponent::GetJavaModifiers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AwtComponent
的用法示例。
在下文中一共展示了AwtComponent::GetJavaModifiers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
/*
* Class: sun_awt_windows_WComponentPeer
* Method: handleEvent
* Signature: (Lsun/awt/windows/WComponentPeer;Ljava/awt/AWTEvent;)V
*/
JNIEXPORT void JNICALL
Java_sun_awt_windows_WInputMethod_handleNativeIMEEvent(JNIEnv *env, jobject self,
jobject peer, jobject event)
{
TRY;
PDATA pData;
JNI_CHECK_PEER_RETURN(peer);
AwtComponent* p = (AwtComponent *)pData;
JNI_CHECK_NULL_RETURN(event, "null AWTEvent");
if (env->EnsureLocalCapacity(1) < 0) {
return;
}
jbyteArray bdata = (jbyteArray)(env)->GetObjectField(event, AwtAWTEvent::bdataID);
if (bdata == 0) {
return;
}
MSG msg;
(env)->GetByteArrayRegion(bdata, 0, sizeof(MSG), (jbyte *)&msg);
(env)->DeleteLocalRef(bdata);
BOOL isConsumed =
(BOOL)(env)->GetBooleanField(event, AwtAWTEvent::consumedID);
int id = (env)->GetIntField(event, AwtAWTEvent::idID);
DASSERT(!safe_ExceptionOccurred(env));
if (isConsumed || p==NULL) return;
if (id >= java_awt_event_InputMethodEvent_INPUT_METHOD_FIRST &&
id <= java_awt_event_InputMethodEvent_INPUT_METHOD_LAST)
{
long modifiers = p->GetJavaModifiers();
if (msg.message==WM_CHAR || msg.message==WM_SYSCHAR) {
WCHAR unicodeChar = L'\0';
unicodeChar = (WCHAR)msg.wParam;
p->SendKeyEvent(java_awt_event_KeyEvent_KEY_TYPED,
0, //to be fixed nowMillis(),
java_awt_event_KeyEvent_CHAR_UNDEFINED,
unicodeChar,
modifiers,
java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
&msg);
} else {
MSG* pCopiedMsg = new MSG;
*pCopiedMsg = msg;
p->SendMessage(WM_AWT_HANDLE_EVENT, (WPARAM) FALSE,
(LPARAM) pCopiedMsg);
}
(env)->SetBooleanField(event, AwtAWTEvent::consumedID, JNI_TRUE);
}
CATCH_BAD_ALLOC;
}