OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 The Android Open Source Project | 2 * Copyright (C) 2010 The Android Open Source Project |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) { | 412 static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) { |
413 LOGV("InputQueueCreated: %p -- %p\n", activity, queue); | 413 LOGV("InputQueueCreated: %p -- %p\n", activity, queue); |
414 android_app_set_input((struct android_app*)activity->instance, queue); | 414 android_app_set_input((struct android_app*)activity->instance, queue); |
415 } | 415 } |
416 | 416 |
417 static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
{ | 417 static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
{ |
418 LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue); | 418 LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue); |
419 android_app_set_input((struct android_app*)activity->instance, NULL); | 419 android_app_set_input((struct android_app*)activity->instance, NULL); |
420 } | 420 } |
421 | 421 |
| 422 static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) { |
| 423 struct android_app* android_app = (struct android_app*)activity->instanc
e; |
| 424 LOGV("OnContentRectChanged: %p\n", activity); |
| 425 android_app->contentRect = *rect; |
| 426 android_app_write_cmd(android_app, APP_CMD_CONTENT_RECT_CHANGED); |
| 427 } |
| 428 |
422 void ANativeActivity_onCreate(ANativeActivity* activity, | 429 void ANativeActivity_onCreate(ANativeActivity* activity, |
423 void* savedState, size_t savedStateSize) { | 430 void* savedState, size_t savedStateSize) { |
424 LOGV("Creating: %p\n", activity); | 431 LOGV("Creating: %p\n", activity); |
425 activity->callbacks->onDestroy = onDestroy; | 432 activity->callbacks->onDestroy = onDestroy; |
426 activity->callbacks->onStart = onStart; | 433 activity->callbacks->onStart = onStart; |
427 activity->callbacks->onResume = onResume; | 434 activity->callbacks->onResume = onResume; |
428 activity->callbacks->onSaveInstanceState = onSaveInstanceState; | 435 activity->callbacks->onSaveInstanceState = onSaveInstanceState; |
429 activity->callbacks->onPause = onPause; | 436 activity->callbacks->onPause = onPause; |
430 activity->callbacks->onStop = onStop; | 437 activity->callbacks->onStop = onStop; |
431 activity->callbacks->onConfigurationChanged = onConfigurationChanged; | 438 activity->callbacks->onConfigurationChanged = onConfigurationChanged; |
432 activity->callbacks->onLowMemory = onLowMemory; | 439 activity->callbacks->onLowMemory = onLowMemory; |
433 activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; | 440 activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; |
434 activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; | 441 activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; |
435 activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; | 442 activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; |
436 activity->callbacks->onInputQueueCreated = onInputQueueCreated; | 443 activity->callbacks->onInputQueueCreated = onInputQueueCreated; |
437 activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; | 444 activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; |
| 445 activity->callbacks->onContentRectChanged = onContentRectChanged; |
438 | 446 |
439 activity->instance = android_app_create(activity, savedState, savedStateSize
); | 447 activity->instance = android_app_create(activity, savedState, savedStateSize
); |
440 } | 448 } |
OLD | NEW |