feat: functions to check if the app is active and make the app active are added

This commit is contained in:
Sale Djenic 2022-02-21 18:08:26 +01:00
parent 8d199aa829
commit fec518e629
2 changed files with 8 additions and 0 deletions

View File

@ -66,3 +66,8 @@ proc url_toLocalFile*(fileUrl: string): string =
proc url_fromLocalFile*(filePath: string): string =
result = $(dos_from_local_file(filePath.cstring))
proc app_isActive*(engine: QQmlApplicationEngine): bool =
result = dos_app_is_active(engine.vptr)
proc app_makeItActive*(engine: QQmlApplicationEngine) =
dos_app_make_it_active(engine.vptr)

View File

@ -388,3 +388,6 @@ proc dos_to_local_file(fileUrl: cstring): cstring
proc dos_from_local_file(filePath: cstring): cstring
{.cdecl, dynlib: dynLibName, importc.}
proc dos_app_is_active(engine: DosQQmlApplicationEngine): bool {.cdecl, dynlib: dynLibName, importc.}
proc dos_app_make_it_active(engine: DosQQmlApplicationEngine) {.cdecl, dynlib: dynLibName, importc.}