/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2024 * * * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * * software and associated documentation files (the "Software"), to deal in the Software * * without restriction, including without limitation the rights to use, copy, modify, * * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * * permit persons to whom the Software is furnished to do so, subject to the following * * conditions: * * * * The above copyright notice and this permission notice shall be included in all copies * * or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ #ifndef __OPENSPACE_CORE___GLOBALSCALLBACKS___H__ #define __OPENSPACE_CORE___GLOBALSCALLBACKS___H__ #include #include #include #include #include #include namespace openspace { BooleanType(IsGuiWindow); } // namespace openspace namespace openspace::global::callback { using KeyboardCallback = std::function; using CharacterCallback = std::function; using MouseButtonCallback = std::function; using MousePositionCallback = std::function; using MouseScrollWheelCallback = std::function; inline std::vector>* initialize; inline std::vector>* deinitialize; inline std::vector>* initializeGL; inline std::vector>* deinitializeGL; inline std::vector>* preSync; inline std::vector>* postSyncPreDraw; inline std::vector>* render; inline std::vector>* draw2D; inline std::vector>* postDraw; inline std::vector* keyboard; inline std::vector* character; inline std::vector* mouseButton; inline std::vector* mousePosition; inline std::vector* mouseScrollWheel; inline std::vector>* touchDetected; inline std::vector>* touchUpdated; inline std::vector>* touchExit; /** * If the framerate becomes slow, Chromium Embedded Framework (used in Web Browser Module) * needs to perform its message loop work more frequently than once per frame. If this * method is not called frequently enough, the GUI will become much less responsive. A * future more long-term may decouple the browser's message work loop from the main render * loop altogehter using a separate thread. Currently, this method is called from within * the RenderEngine, between calls to individual renderables. */ extern void (*webBrowserPerformanceHotfix)(); void create(); void destroy(); } // namespace openspace::global #endif // __OPENSPACE_CORE___GLOBALSCALLBACKS___H__