feat: url scheme event added

This commit is contained in:
Sale Djenic 2022-03-17 17:31:26 +01:00 committed by saledjenic
parent 7baaeee7b9
commit e66ac18ff5
3 changed files with 10 additions and 4 deletions

View File

@ -32,7 +32,7 @@ type
DosQAbstractItemModel = distinct pointer
DosQAbstractTableModel = distinct pointer
DosQAbstractListModel = distinct pointer
DosStatusEvent = distinct pointer
DosStatusEvent = DosQObject
DosStatusOSNotification = DosQObject
DosQSettings = DosQObject
DosStatusKeychainManager = DosQObject
@ -343,6 +343,7 @@ proc dos_singleinstance_delete(vptr: DosQObject) {.cdecl, dynlib: dynLibName, im
# DosStatusEvent
proc dos_event_create_showAppEvent(engine: DosQQmlApplicationEngine): DosStatusEvent {.cdecl, dynlib: dynLibName, importc.}
proc dos_event_create_osThemeEvent(engine: DosQQmlApplicationEngine): DosStatusEvent {.cdecl, dynlib: dynLibName, importc.}
proc dos_event_create_urlSchemeEvent(): DosStatusEvent {.cdecl, dynlib: dynLibName, importc.}
proc dos_event_delete(vptr: DosStatusEvent) {.cdecl, dynlib: dynLibName, importc.}
# DosStatusOSNotification

View File

@ -134,9 +134,7 @@ type
SingleInstance* = ref object of QObject
StatusEvent* = ref object of RootObj ## \
## A StatusEvent
vptr: DosStatusEvent
StatusEvent* = ref object of QObject
StatusOSNotification* = ref object of QObject

View File

@ -4,6 +4,9 @@ proc setupDockShowAppEventObject*(self: StatusEvent, engine: QQmlApplicationEngi
proc setupOSThemeEventObject*(self: StatusEvent, engine: QQmlApplicationEngine) =
self.vptr = dos_event_create_osThemeEvent(engine.vptr)
proc setupUrlSchemeEventObject(self: StatusEvent) =
self.vptr = dos_event_create_urlSchemeEvent()
proc delete*(self: StatusEvent) =
dos_event_delete(self.vptr)
self.vptr.resetToNil
@ -15,3 +18,7 @@ proc newStatusDockShowAppEventObject*(engine: QQmlApplicationEngine): StatusEven
proc newStatusOSThemeEventObject*(engine: QQmlApplicationEngine): StatusEvent =
new(result, delete)
result.setupOSThemeEventObject(engine)
proc newStatusUrlSchemeEventObject*(): StatusEvent =
new(result, delete)
result.setupUrlSchemeEventObject()