Enumerations | |
enum | AndroidDialogType { TEXT_INPUT , SELECTION_INPUT } |
enum | AndroidDialogState { DIALOG_SHOWN , DIALOG_INPUTTED , DIALOG_CANCELED } |
Functions | |
bool * | signal_handler_killstatus () |
static void | signal_handler (int sig) |
void | signal_handler_init (void) |
std::string | getDataPath (const char *subpath) |
static void | pathRemoveFile (char *path, char delim) |
bool | detectMSVCBuildDir (const std::string &path) |
static std::string | detectSystemInfo () |
const std::string & | get_sysinfo () |
bool | getCurrentWorkingDir (char *buf, size_t len) |
static bool | getExecPathFromProcfs (char *buf, size_t buflen) |
bool | getCurrentExecPath (char *buf, size_t len) |
static const char * | getHomeOrFail () |
bool | setSystemPaths () |
static void | migrateCachePath () |
static void | createCacheDirTag () |
void | initializePaths () |
bool | secure_rand_fill_buf (void *buf, size_t len) |
void | osSpecificInit () |
void | attachOrCreateConsole () |
int | mt_snprintf (char *buf, const size_t buf_size, const char *fmt,...) |
static bool | open_uri (const std::string &uri) |
bool | open_url (const std::string &url) |
Opens URL in default web browser. | |
bool | open_directory (const std::string &path) |
Opens a directory in the default file manager. | |
void | os_get_clock (struct timespec *ts) |
u64 | getTimeS () |
u64 | getTimeMs () |
u64 | getTimeUs () |
u64 | getTimeNs () |
u64 | getTime (TimePrecision prec) |
u64 | getDeltaMs (u64 old_time_ms, u64 new_time_ms) |
Delta calculation function arguments. | |
const char * | getPlatformName () |
static void | TrackFreedMemory (size_t amount) |
static void | TriggerMemoryTrim () |
void | cleanupAndroid () |
std::string | getLanguageAndroid () |
static std::string | readJavaString (jstring j_str) |
void | showTextInputDialog (const std::string &hint, const std::string ¤t, int editType) |
Show a text input dialog in Java. | |
void | showComboBoxDialog (const std::string *optionList, s32 listSize, s32 selectedIdx) |
Show a selection dialog in Java. | |
void | openURIAndroid (const char *url) |
void | shareFileAndroid (const std::string &path) |
Opens a share intent to the file at path. | |
AndroidDialogType | getLastInputDialogType () |
AndroidDialogState | getInputDialogState () |
std::string | getInputDialogMessage () |
int | getInputDialogSelection () |
float | getDisplayDensity () |
v2u32 | getDisplaySize () |
bool | hasPhysicalKeyboardAndroid () |
Variables | |
static bool | g_killed = false |
std::string | path_share = "UNINITIALIZED" |
std::string | path_user = "UNINITIALIZED" |
std::string | path_locale = "UNINITIALIZED" |
std::string | path_cache = "UNINITIALIZED" |
JNIEnv * | jnienv = nullptr |
jobject | activity |
jclass | activityClass |
void porting::attachOrCreateConsole | ( | ) |
void porting::cleanupAndroid | ( | ) |
References DIR_DELIM, path_user, and warningstream.
Referenced by SDL_Main().
|
static |
References fs::CreateAllDirs(), DIR_DELIM, open_ofstream(), path_cache, and fs::PathExists().
Referenced by initializePaths().
bool porting::detectMSVCBuildDir | ( | const std::string & | path | ) |
References removeStringEnd().
Referenced by initializePaths().
|
static |
const std::string & porting::get_sysinfo | ( | ) |
References detectSystemInfo().
Referenced by default_user_agent(), and print_version().
bool porting::getCurrentExecPath | ( | char * | buf, |
size_t | len ) |
bool porting::getCurrentWorkingDir | ( | char * | buf, |
size_t | len ) |
std::string porting::getDataPath | ( | const char * | subpath | ) |
References DIR_DELIM, and path_share.
Referenced by initializePaths(), and set_default_settings().
|
inline |
Delta calculation function arguments.
old_time_ms | old time for delta calculation |
new_time_ms | new time for delta calculation |
Referenced by GUIScene::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), ClientMediaDownloader::initialStep(), PointerAction::isRelated(), GUIScrollBar::OnPostRender(), and TouchControls::step().
float porting::getDisplayDensity | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by RenderingEngine::getDisplayDensity(), and set_default_settings().
v2u32 porting::getDisplaySize | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by set_default_settings().
|
static |
|
inlinestatic |
References FATAL_ERROR_IF.
Referenced by setSystemPaths().
std::string porting::getInputDialogMessage | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and readJavaString().
int porting::getInputDialogSelection | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
AndroidDialogState porting::getInputDialogState | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
std::string porting::getLanguageAndroid | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, jnienv, and readJavaString().
AndroidDialogType porting::getLastInputDialogType | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
|
inline |
Referenced by ScriptApiBase::ScriptApiBase(), and print_version().
|
inline |
References FATAL_ERROR, getTimeMs(), getTimeNs(), getTimeS(), getTimeUs(), PRECISION_MICRO, PRECISION_MILLI, PRECISION_NANO, and PRECISION_SECONDS.
Referenced by ScopeProfiler::ScopeProfiler(), ScopeProfiler::~ScopeProfiler(), TimeTaker::getTimerTime(), TimeTaker::start(), and TimeTaker::stop().
|
inline |
References os_get_clock().
Referenced by Profiler::Profiler(), Client::afterContentReceived(), TouchControls::applyContextControls(), Database_SQLite3::busyHandler(), Profiler::clear(), GUIAnimatedImage::draw(), GUIChatConsole::draw(), GUIEditBoxWithScrollBar::draw(), GUIScene::draw(), drawItemStack(), GUIFormSpecMenu::drawMenu(), GUIButton::drawSprite(), PointerAction::fromEvent(), Profiler::getElapsedMs(), getTime(), JoystickController::handleEvent(), con::ConnectionReceiveThread::handlePacketType_Control(), ClientMediaDownloader::initialStep(), GUIEditBox::inputString(), con::Peer::isTimedOut(), ServerModManager::loadMods(), GUIButton::OnEvent(), GUITable::OnEvent(), GUIEditBox::onKeyBack(), GUIEditBox::onKeyDelete(), GUIChatConsole::openConsole(), GUIEditBox::processKey(), GUIEditBox::processMouse(), Client::ReceiveAll(), con::ConnectionReceiveThread::run(), con::ConnectionSendThread::run(), sound::OpenALSoundManager::run(), run_tests(), run_tests(), TestBase::runTest(), con::ConnectionSendThread::sendAsPacketReliable(), GUIButton::setPressed(), Client::showUpdateProgressTexture(), TouchControls::step(), AsyncEngine::stepAutoscale(), TestConnection::testConnectSendReceive(), TestBase::testModule(), ServerMap::transformLiquids(), TouchControls::translateEvent(), ClientEnvironment::updateFrameTime(), and GUIChatConsole::weblinkClick().
|
inline |
References os_get_clock().
Referenced by getTime().
|
inline |
References os_get_clock().
Referenced by getTime(), migrate_map_database(), recompress_map_database(), con::ConnectionReceiveThread::RateLimitHelper::tick(), and RemoteClient::uptime().
|
inline |
References os_get_clock().
Referenced by getTime(), init_common(), ModApiBase::l_deprecated_function(), ModApiUtil::l_get_us_time(), FpsControl::limit(), Server::Receive(), FpsControl::reset(), ServerThread::run(), ServerMap::save(), ServerEnvironment::step(), and Map::timerUpdate().
bool porting::hasPhysicalKeyboardAndroid | ( | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by Game::openConsole(), and GUIModalMenu::preprocessEvent().
void porting::initializePaths | ( | ) |
References createCacheDirTag(), detectMSVCBuildDir(), DIR_DELIM, DIR_DELIM_CHAR, errorstream, FATAL_ERROR, getCurrentExecPath(), getCurrentWorkingDir(), getDataPath(), getExecPathFromProcfs(), infostream, migrateCachePath(), path_cache, path_locale, path_share, path_user, fs::PathExists(), pathRemoveFile(), sanity_check, setSystemPaths(), and warningstream.
Referenced by main().
|
static |
References DIR_DELIM, errorstream, path_cache, path_user, fs::PathExists(), fs::RecursiveDelete(), and fs::Rename().
Referenced by initializePaths().
int porting::mt_snprintf | ( | char * | buf, |
const size_t | buf_size, | ||
const char * | fmt, | ||
... ) |
Referenced by Minimap::addMode(), analyze_block(), ProfilerGraph::draw(), fmtgettext(), getFloatSerializationType(), TestBase::getTestTempFile(), guiScalingResizeCached(), Profiler::print(), print_hexdump(), script_error(), ScriptApiBase::stackDump(), and TestConnection::testConnectSendReceive().
bool porting::open_directory | ( | const std::string & | path | ) |
Opens a directory in the default file manager.
The directory must exist.
path | Path to directory |
References errorstream, fs::IsDir(), and open_uri().
Referenced by ModApiMainMenu::l_open_dir().
|
static |
References errorstream, and openURIAndroid().
Referenced by open_directory(), and open_url().
bool porting::open_url | ( | const std::string & | url | ) |
Opens URL in default web browser.
Must begin with http:// or https://, and not contain any new lines
url | The URL |
References errorstream, open_uri(), and str_starts_with().
Referenced by ModApiMainMenu::l_open_url(), GUIFormSpecMenu::OnEvent(), GUIHyperText::OnEvent(), GUIOpenURLMenu::OnEvent(), and GUIChatConsole::weblinkClick().
void porting::openURIAndroid | ( | const char * | url | ) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by open_uri().
|
inline |
Referenced by getTimeMs(), getTimeNs(), getTimeS(), and getTimeUs().
void porting::osSpecificInit | ( | ) |
|
static |
|
static |
References jnienv.
Referenced by getInputDialogMessage(), and getLanguageAndroid().
bool porting::secure_rand_fill_buf | ( | void * | buf, |
size_t | len ) |
Referenced by LuaSecureRandom::fillRandBuf(), httpfetch_init(), mpz_fill_random(), and srp_create_salted_verification_key().
bool porting::setSystemPaths | ( | ) |
References DIR_DELIM, getHomeOrFail(), path_share, and path_user.
Referenced by initializePaths().
void porting::shareFileAndroid | ( | const std::string & | path | ) |
Opens a share intent to the file at path.
path |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by ModApiMainMenu::l_share_file().
void porting::showComboBoxDialog | ( | const std::string * | optionList, |
s32 | listSize, | ||
s32 | selectedIdx ) |
Show a selection dialog in Java.
optionList | The list of options |
listSize | Size of the list |
selectedIdx | Selected index |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by GUIModalMenu::preprocessEvent().
void porting::showTextInputDialog | ( | const std::string & | hint, |
const std::string & | current, | ||
int | editType ) |
Show a text input dialog in Java.
hint | Hint to be shown |
current | Initial value to be displayed |
editType | Type of the text field (1 = multi-line text input; 2 = single-line text input; 3 = password field) |
References activity, activityClass, FATAL_ERROR_IF, and jnienv.
Referenced by Game::openConsole(), and GUIModalMenu::preprocessEvent().
|
static |
References dstream, and g_killed.
Referenced by signal_handler_init().
void porting::signal_handler_init | ( | void | ) |
References signal_handler().
Referenced by main().
bool * porting::signal_handler_killstatus | ( | ) |
References g_killed.
Referenced by ClientLauncher::launch_game(), ClientLauncher::main_menu(), migrate_map_database(), recompress_map_database(), ClientLauncher::run(), and run_dedicated_server().
|
inlinestatic |
Referenced by MapBlock::~MapBlock(), MapBlockMesh::~MapBlockMesh(), Schematic::~Schematic(), and VoxelManipulator::clear().
|
inlinestatic |
Referenced by MeshUpdateWorkerThread::doUpdate(), and EmergeThread::run().
jobject porting::activity |
jclass porting::activityClass |
|
static |
Referenced by signal_handler(), and signal_handler_killstatus().
JNIEnv* porting::jnienv = nullptr |
Referenced by getDisplayDensity(), getDisplaySize(), getInputDialogMessage(), getInputDialogSelection(), getInputDialogState(), getLanguageAndroid(), getLastInputDialogType(), hasPhysicalKeyboardAndroid(), openURIAndroid(), readJavaString(), shareFileAndroid(), showComboBoxDialog(), and showTextInputDialog().
std::string porting::path_cache = "UNINITIALIZED" |
std::string porting::path_locale = "UNINITIALIZED" |
Referenced by init_common(), and initializePaths().
std::string porting::path_share = "UNINITIALIZED" |
Referenced by RenderingEngine::RenderingEngine(), MenuMusicFetcher::addThePaths(), SoundFallbackPathProvider::addThePaths(), ClientLauncher::config_guienv(), findSubgame(), getAvailableGameIds(), Client::getBuiltinLuaPath(), Server::getBuiltinLuaPath(), Client::getClientModsLuaPath(), getDataPath(), getShaderPath(), ButtonLayout::getTexture(), getTexturePath(), initializePaths(), ModApiUtil::l_get_builtin_path(), ModApiMainMenu::l_get_modpaths(), ModApiMainMenu::l_get_texturepath_share(), GUIEngine::loadMainMenuScript(), setSystemPaths(), and RenderingEngine::setWindowIcon().
std::string porting::path_user = "UNINITIALIZED" |
Referenced by Client::Client(), Server::Server(), MenuMusicFetcher::addThePaths(), SoundFallbackPathProvider::addThePaths(), auto_select_world(), cleanupAndroid(), create_userdata_path(), Server::fillMediaCache(), findSubgame(), getAvailableGameIds(), getAvailableWorlds(), init_log_streams(), initializePaths(), ModApiMainMenu::l_create_world(), ModApiMainMenu::l_get_clientmodpath(), ModApiMainMenu::l_get_gamepath(), ModApiMainMenu::l_get_modpath(), ModApiMainMenu::l_get_modpaths(), ModApiMainMenu::l_get_texturepath(), ModApiMainMenu::l_get_user_path(), ModApiUtil::l_get_user_path(), Client::loadMods(), Client::makeScreenshot(), MainMenuScripting::mayModifyPath(), migrateCachePath(), Client::migrateModStorage(), read_config_file(), and setSystemPaths().