| 1532 | } |
| 1533 | |
| 1534 | Error 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 |
nothing calls this directly
no test coverage detected