MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / init

Method init

drivers/accesskit/accessibility_driver_accesskit.cpp:1534–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1532}
1533
1534Error AccessibilityDriverAccessKit::init() {
1535#ifdef ACCESSKIT_DYNAMIC
1536#ifdef DEBUG_ENABLED
1537 int dylibloader_verbose = 1;
1538#else
1539 int dylibloader_verbose = 0;
1540#endif
1541 void *library_handle = nullptr;
1542 String path;
1543 String arch = Engine::get_singleton()->get_architecture_name();
1544#ifdef LINUXBSD_ENABLED
1545 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit." + arch + ".so");
1546 if (!FileAccess::exists(path)) {
1547 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../lib").path_join("libaccesskit." + arch + ".so");
1548 }
1549 if (!FileAccess::exists(path)) {
1550 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit.so");
1551 }
1552 if (!FileAccess::exists(path)) {
1553 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../lib").path_join("libaccesskit.so");
1554 }
1555 if (!FileAccess::exists(path)) {
1556 return ERR_CANT_CREATE;
1557 }
1558#endif
1559#ifdef MACOS_ENABLED
1560 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit." + arch + ".dylib");
1561 if (!FileAccess::exists(path)) {
1562 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../Frameworks").path_join("libaccesskit." + arch + ".dylib");
1563 }
1564 if (!FileAccess::exists(path)) {
1565 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("libaccesskit.dylib");
1566 }
1567 if (!FileAccess::exists(path)) {
1568 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("../Frameworks").path_join("libaccesskit.dylib");
1569 }
1570 if (!FileAccess::exists(path)) {
1571 return ERR_CANT_CREATE;
1572 }
1573#endif
1574#ifdef WINDOWS_ENABLED
1575 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("accesskit." + arch + ".dll");
1576 if (!FileAccess::exists(path)) {
1577 path = OS::get_singleton()->get_executable_path().get_base_dir().path_join("accesskit.dll");
1578 }
1579 if (!FileAccess::exists(path)) {
1580 return ERR_CANT_CREATE;
1581 }
1582#endif
1583
1584 Error err = OS::get_singleton()->open_dynamic_library(path, library_handle);
1585 if (err == OK && initialize_libaccesskit(dylibloader_verbose, library_handle) == 0) {
1586 print_verbose("AccessKit loaded.");
1587 } else {
1588 return ERR_CANT_CREATE;
1589 }
1590#endif
1591#ifdef MACOS_ENABLED

Callers

nothing calls this directly

Calls 6

path_joinMethod · 0.80
get_base_dirMethod · 0.80
initialize_libaccesskitFunction · 0.50
get_architecture_nameMethod · 0.45
get_executable_pathMethod · 0.45
open_dynamic_libraryMethod · 0.45

Tested by

no test coverage detected