Lines Matching refs:code

432             // is really no benefit to unloading the code.
488 NativeCode* code = static_cast<NativeCode*>(activity);
489 write_work(code->mainWorkWrite, CMD_FINISH, 0);
494 NativeCode* code = static_cast<NativeCode*>(activity);
495 write_work(code->mainWorkWrite, CMD_SET_WINDOW_FORMAT, format);
500 NativeCode* code = static_cast<NativeCode*>(activity);
501 write_work(code->mainWorkWrite, CMD_SET_WINDOW_FLAGS, values, mask);
506 NativeCode* code = static_cast<NativeCode*>(activity);
507 write_work(code->mainWorkWrite, CMD_SHOW_SOFT_INPUT, flags);
512 NativeCode* code = static_cast<NativeCode*>(activity);
513 write_work(code->mainWorkWrite, CMD_HIDE_SOFT_INPUT, flags);
522 NativeCode* code = (NativeCode*)data;
528 if (!read_work(code->mainWorkRead, &work)) {
537 while ((keyEvent=code->nativeInputQueue->consumeUnhandledEvent()) != NULL) {
539 code->env, keyEvent);
542 handled = code->env->CallBooleanMethod(code->clazz,
544 code->messageQueue->raiseAndClearException(
545 code->env, "dispatchUnhandledKeyEvent");
546 code->env->DeleteLocalRef(inputEventObj);
551 code->nativeInputQueue->finishEvent(keyEvent, handled, true);
554 while ((keyEvent=code->nativeInputQueue->consumePreDispatchingEvent(&seq)) != NULL) {
556 code->env, keyEvent);
558 code->env->CallVoidMethod(code->clazz,
560 code->messageQueue->raiseAndClearException(code->env, "preDispatchKeyEvent");
561 code->env->DeleteLocalRef(inputEventObj);
568 code->env->CallVoidMethod(code->clazz, gNativeActivityClassInfo.finish);
569 code->messageQueue->raiseAndClearException(code->env, "finish");
572 code->env->CallVoidMethod(code->clazz,
574 code->messageQueue->raiseAndClearException(code->env, "setWindowFormat");
577 code->env->CallVoidMethod(code->clazz,
579 code->messageQueue->raiseAndClearException(code->env, "setWindowFlags");
582 code->env->CallVoidMethod(code->clazz,
584 code->messageQueue->raiseAndClearException(code->env, "showIme");
587 code->env->CallVoidMethod(code->clazz,
589 code->messageQueue->raiseAndClearException(code->env, "hideIme");
610 NativeCode* code = NULL;
618 code = new NativeCode(handle, (ANativeActivity_createFunc*)
622 if (code->createActivityFunc == NULL) {
624 delete code;
628 code->messageQueue = android_os_MessageQueue_getMessageQueue(env, messageQueue);
629 if (code->messageQueue == NULL) {
631 delete code;
638 delete code;
641 code->mainWorkRead = msgpipe[0];
642 code->mainWorkWrite = msgpipe[1];
643 int result = fcntl(code->mainWorkRead, F_SETFL, O_NONBLOCK);
646 result = fcntl(code->mainWorkWrite, F_SETFL, O_NONBLOCK);
649 code->messageQueue->getLooper()->addFd(
650 code->mainWorkRead, 0, ALOOPER_EVENT_INPUT, mainWorkCallback, code);
652 code->ANativeActivity::callbacks = &code->callbacks;
653 if (env->GetJavaVM(&code->vm) < 0) {
655 delete code;
658 code->env = env;
659 code->clazz = env->NewGlobalRef(clazz);
662 code->internalDataPathObj = dirStr;
663 code->internalDataPath = code->internalDataPathObj.string();
667 code->externalDataPathObj = dirStr;
668 code->externalDataPath = code->externalDataPathObj.string();
671 code->sdkVersion = sdkVersion;
673 code->assetManager = assetManagerForJavaObject(env, jAssetMgr);
676 code->obbPathObj = dirStr;
677 code->obbPath = code->obbPathObj.string();
687 code->createActivityFunc(code, rawSavedState, rawSavedSize);
694 return (jint)code;
702 NativeCode* code = (NativeCode*)handle;
703 delete code;
712 NativeCode* code = (NativeCode*)handle;
713 if (code->callbacks.onStart != NULL) {
714 code->callbacks.onStart(code);
724 NativeCode* code = (NativeCode*)handle;
725 if (code->callbacks.onResume != NULL) {
726 code->callbacks.onResume(code);
739 NativeCode* code = (NativeCode*)handle;
740 if (code->callbacks.onSaveInstanceState != NULL) {
742 jbyte* state = (jbyte*)code->callbacks.onSaveInstanceState(code, &len);
763 NativeCode* code = (NativeCode*)handle;
764 if (code->callbacks.onPause != NULL) {
765 code->callbacks.onPause(code);
775 NativeCode* code = (NativeCode*)handle;
776 if (code->callbacks.onStop != NULL) {
777 code->callbacks.onStop(code);
787 NativeCode* code = (NativeCode*)handle;
788 if (code->callbacks.onConfigurationChanged != NULL) {
789 code->callbacks.onConfigurationChanged(code);
799 NativeCode* code = (NativeCode*)handle;
800 if (code->callbacks.onLowMemory != NULL) {
801 code->callbacks.onLowMemory(code);
811 NativeCode* code = (NativeCode*)handle;
812 if (code->callbacks.onWindowFocusChanged != NULL) {
813 code->callbacks.onWindowFocusChanged(code, focused ? 1 : 0);
823 NativeCode* code = (NativeCode*)handle;
824 code->setSurface(surface);
825 if (code->nativeWindow != NULL && code->callbacks.onNativeWindowCreated != NULL) {
826 code->callbacks.onNativeWindowCreated(code,
827 code->nativeWindow.get());
844 NativeCode* code = (NativeCode*)handle;
845 sp<ANativeWindow> oldNativeWindow = code->nativeWindow;
846 code->setSurface(surface);
847 if (oldNativeWindow != code->nativeWindow) {
848 if (oldNativeWindow != NULL && code->callbacks.onNativeWindowDestroyed != NULL) {
849 code->callbacks.onNativeWindowDestroyed(code,
852 if (code->nativeWindow != NULL) {
853 if (code->callbacks.onNativeWindowCreated != NULL) {
854 code->callbacks.onNativeWindowCreated(code,
855 code->nativeWindow.get());
857 code->lastWindowWidth = getWindowProp(code->nativeWindow.get(),
859 code->lastWindowHeight = getWindowProp(code->nativeWindow.get(),
864 int32_t newWidth = getWindowProp(code->nativeWindow.get(),
866 int32_t newHeight = getWindowProp(code->nativeWindow.get(),
868 if (newWidth != code->lastWindowWidth
869 || newHeight != code->lastWindowHeight) {
870 if (code->callbacks.onNativeWindowResized != NULL) {
871 code->callbacks.onNativeWindowResized(code,
872 code->nativeWindow.get());
884 NativeCode* code = (NativeCode*)handle;
885 if (code->nativeWindow != NULL && code->callbacks.onNativeWindowRedrawNeeded != NULL) {
886 code->callbacks.onNativeWindowRedrawNeeded(code, code->nativeWindow.get());
896 NativeCode* code = (NativeCode*)handle;
897 if (code->nativeWindow != NULL && code->callbacks.onNativeWindowDestroyed != NULL) {
898 code->callbacks.onNativeWindowDestroyed(code,
899 code->nativeWindow.get());
901 code->setSurface(NULL);
910 NativeCode* code = (NativeCode*)handle;
911 status_t err = code->setInputChannel(channel);
917 if (code->callbacks.onInputQueueCreated != NULL) {
918 code->callbacks.onInputQueueCreated(code,
919 code->nativeInputQueue);
929 NativeCode* code = (NativeCode*)handle;
930 if (code->nativeInputQueue != NULL
931 && code->callbacks.onInputQueueDestroyed != NULL) {
932 code->callbacks.onInputQueueDestroyed(code,
933 code->nativeInputQueue);
935 code->setInputChannel(NULL);
945 NativeCode* code = (NativeCode*)handle;
946 if (code->callbacks.onContentRectChanged != NULL) {
952 code->callbacks.onContentRectChanged(code, &rect);
962 NativeCode* code = (NativeCode*)handle;
963 if (code->nativeInputQueue != NULL) {
964 KeyEvent* event = code->nativeInputQueue->createKeyEvent();
971 code->nativeInputQueue->dispatchEvent(event);
982 NativeCode* code = (NativeCode*)handle;
983 if (code->nativeInputQueue != NULL) {
984 code->nativeInputQueue->finishPreDispatch(seq, handled ? true : false);