feat: installMessageHandler (#58)

This commit is contained in:
Igor Sirotin 2024-07-18 21:23:10 +01:00 committed by GitHub
parent 20d4db12bb
commit 861103baee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -113,6 +113,7 @@ type
canFetchMore: DosCanFetchMoreCallback
fetchMore: DosFetchMoreCallback
DosMessageHandler = proc(messageType: cint, message: cstring, category: cstring, file: cstring, function: cstring, lint: cint) {.cdecl.}
# Conversion
proc resetToNil[T](x: var T) = x = nil.pointer.T
@ -430,3 +431,6 @@ proc dos_from_local_file(filePath: cstring): cstring
proc dos_app_is_active(engine: DosQQmlApplicationEngine): bool {.cdecl, dynlib: dynLibName, importc.}
proc dos_app_make_it_active(engine: DosQQmlApplicationEngine) {.cdecl, dynlib: dynLibName, importc.}
# Common
proc dos_installMessageHandler(handler: DosMessageHandler) {.cdecl, dynlib: dynLibName, importc.}

View File

@ -75,3 +75,6 @@ proc applicationDirPath*(app: QGuiApplication): string =
let str = dos_qguiapplication_application_dir_path()
result = $str
dos_chararray_delete(str)
proc installMessageHandler*(handler: DosMessageHandler) =
dos_installMessageHandler(handler)