1 /* 2 __ 3 / _| 4 __ _ _ _ _ __ ___ _ __ __ _ | |_ ___ ___ ___ 5 / _` | | | | '__/ _ \| '__/ _` | | _/ _ \/ __/ __| 6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \ 7 \__,_|\__,_|_| \___/|_| \__,_| |_| \___/|___/___/ 8 9 Copyright (C) 2015 The Android Open Source Project. 10 Copyright (C) 2018-2019 Aurora Free Open Source Software. 11 12 This file is part of the Aurora Free Open Source Software. This 13 organization promote free and open source software that you can 14 redistribute and/or modify under the terms of the GNU Lesser General 15 Public License Version 3 as published by the Free Software Foundation or 16 (at your option) any later version approved by the Aurora Free Open Source 17 Software Organization. The license is available in the package root path 18 as 'LICENSE' file. Please review the following information to ensure the 19 GNU Lesser General Public License version 3 requirements will be met: 20 https://www.gnu.org/licenses/lgpl.html . 21 22 Alternatively, this file may be used under the terms of the GNU General 23 Public License version 3 or later as published by the Free Software 24 Foundation. Please review the following information to ensure the GNU 25 General Public License requirements will be met: 26 https://www.gnu.org/licenses/gpl-3.0.html. 27 28 NOTE: All products, services or anything associated to trademarks and 29 service marks used or referenced on this file are the property of their 30 respective companies/owners or its subsidiaries. Other names and brands 31 may be claimed as the property of others. 32 33 For more info about intellectual property visit: aurorafoss.org or 34 directly send an email to: contact (at) aurorafoss.org . 35 36 This file has bindings for an existing code, part of The Android Open Source 37 Project implementation. Check it out at android.googlesource.com . 38 */ 39 40 module aurorafw.android.platform.choreographer; 41 42 /** 43 * @addtogroup Choreographer 44 * @{ 45 */ 46 47 /** 48 * @file aurorafw/android/platform/choreographer.d 49 */ 50 51 import core.stdc.config; 52 53 version (Android): 54 extern (C): 55 @system: 56 nothrow: 57 @nogc: 58 59 struct AChoreographer; 60 61 /** 62 * Prototype of the function that is called when a new frame is being rendered. 63 * It's passed the time that the frame is being rendered as nanoseconds in the 64 * CLOCK_MONOTONIC time base, as well as the data pointer provided by the 65 * application that registered a callback. All callbacks that run as part of 66 * rendering a frame will observe the same frame time, so it should be used 67 * whenever events need to be synchronized (e.g. animations). 68 */ 69 alias AChoreographer_frameCallback = void function (c_long frameTimeNanos, void* data); 70 71 /** 72 * Get the AChoreographer instance for the current thread. This must be called 73 * on an ALooper thread. 74 */ 75 AChoreographer* AChoreographer_getInstance (); 76 77 /** 78 * Post a callback to be run on the next frame. The data pointer provided will 79 * be passed to the callback function when it's called. 80 */ 81 void AChoreographer_postFrameCallback ( 82 AChoreographer* choreographer, 83 AChoreographer_frameCallback callback, 84 void* data); 85 86 /** 87 * Post a callback to be run on the frame following the specified delay. The 88 * data pointer provided will be passed to the callback function when it's 89 * called. 90 */ 91 void AChoreographer_postFrameCallbackDelayed ( 92 AChoreographer* choreographer, 93 AChoreographer_frameCallback callback, 94 void* data, 95 c_long delayMillis); 96 97 /* __ANDROID_API__ >= 24 */ 98 99 // ANDROID_CHOREOGRAPHER_H 100 101 /** @} */