refactor(@desktop/general): status custom events and os notification renamed type and methods

These changes are needed because of changes applied in `dotherside`.
This commit is contained in:
Sale Djenic 2021-09-07 10:14:28 +02:00
parent ca381eb8a2
commit fb44e71c57
6 changed files with 43 additions and 29 deletions

View File

@ -32,8 +32,8 @@ type
DosQAbstractItemModel = distinct pointer
DosQAbstractTableModel = distinct pointer
DosQAbstractListModel = distinct pointer
DosStatusEventObject = distinct pointer
DosStatusOSNotificationObject = DosQObject
DosStatusEvent = distinct pointer
DosStatusOSNotification = DosQObject
DosParameterDefinition = object
name: cstring
@ -137,7 +137,7 @@ proc dos_qapplication_quit() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_delete() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_clipboard_setText(content: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_installEventFilter(engine: DosStatusEventObject) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_installEventFilter(engine: DosStatusEvent) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_clipboard_setImage(content: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qapplication_download_image(imageSource: cstring, filePath: cstring) {.cdecl, dynlib: dynLibName, importc.}
@ -147,7 +147,7 @@ proc dos_qguiapplication_exec() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_quit() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_delete() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_installEventFilter(engine: DosStatusEventObject) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_installEventFilter(engine: DosStatusEvent) {.cdecl, dynlib: dynLibName, importc.}
# QQmlContext
proc dos_qqmlcontext_setcontextproperty(context: DosQQmlContext, propertyName: cstring, propertyValue: DosQVariant) {.cdecl, dynlib: dynLibName, importc.}
@ -342,11 +342,12 @@ proc dos_singleinstance_create(uniqueName: cstring, eventStr: cstring): DosQObje
proc dos_singleinstance_isfirst(vptr: DosQObject): bool {.cdecl, dynlib: dynLibName, importc.}
proc dos_singleinstance_delete(vptr: DosQObject) {.cdecl, dynlib: dynLibName, importc.}
# DosStatusEventObject
proc dos_statusevent_create_showAppEvent(engine: DosQQmlApplicationEngine): DosStatusEventObject {.cdecl, dynlib: dynLibName, importc.}
proc dos_statusevent_create_osThemeEvent(engine: DosQQmlApplicationEngine): DosStatusEventObject {.cdecl, dynlib: dynLibName, importc.}
proc dos_statusevent_delete(vptr: DosStatusEventObject) {.cdecl, dynlib: dynLibName, importc.}
# 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_delete(vptr: DosStatusEvent) {.cdecl, dynlib: dynLibName, importc.}
<<<<<<< HEAD
# DosStatusOSNotificationObject
proc dos_statusosnotification_create(): DosStatusOSNotificationObject
{.cdecl, dynlib: dynLibName, importc.}
@ -361,3 +362,15 @@ proc dos_to_local_file(fileUrl: cstring): cstring
proc dos_from_local_file(filePath: cstring): cstring
{.cdecl, dynlib: dynLibName, importc.}
=======
# DosStatusOSNotification
proc dos_osnotification_create(): DosStatusOSNotification
{.cdecl, dynlib: dynLibName, importc.}
proc dos_osnotification_show_notification(vptr: DosStatusOSNotification,
title: cstring, messsage: cstring, identifier: cstring)
{.cdecl, dynlib: dynLibName, importc.}
proc dos_osnotification_delete(vptr: DosStatusOSNotification)
{.cdecl, dynlib: dynLibName, importc.}
{.cdecl, dynlib: dynLibName, importc.}
>>>>>>> c58455f... refactor(@desktop/general): status custom events and os notification renamed type and methods

View File

@ -132,9 +132,11 @@ type
SingleInstance* = ref object of QObject
StatusEventObject* = ref object of RootObj ## \
## A StatusEventObject
vptr: DosStatusEventObject
StatusEvent* = ref object of RootObj ## \
## A StatusEvent
vptr: DosStatusEvent
StatusOSNotification* = ref object of QObject
StatusOSNotificationObject* = ref object of QObject

View File

@ -17,7 +17,7 @@ proc icon*(application: QApplication, filename: string) =
proc setClipboardText*(text: string = "") =
dos_qapplication_clipboard_setText(text.cstring)
proc installEventFilter*(application: QApplication, event: StatusEventObject) =
proc installEventFilter*(application: QApplication, event: StatusEvent) =
dos_qapplication_installEventFilter(event.vptr)
proc setClipboardImage*(text: string = "") =

View File

@ -16,7 +16,7 @@ proc delete*(self: QGuiApplication) =
proc icon*(application: QGuiApplication, filename: string) =
dos_qguiapplication_icon(filename.cstring)
proc installEventFilter*(application: QGuiApplication, event: StatusEventObject) =
proc installEventFilter*(application: QGuiApplication, event: StatusEvent) =
dos_qguiapplication_installEventFilter(event.vptr)
proc newQGuiApplication*(): QGuiApplication =

View File

@ -1,18 +1,17 @@
proc setupDockShowAppEventObject*(self: StatusEvent, engine: QQmlApplicationEngine) =
self.vptr = dos_event_create_showAppEvent(engine.vptr)
proc setupDockShowAppEventObject(self: StatusEventObject, engine: QQmlApplicationEngine) =
self.vptr = dos_statusevent_create_showAppEvent(engine.vptr)
proc setupOSThemeEventObject*(self: StatusEvent, engine: QQmlApplicationEngine) =
self.vptr = dos_event_create_osThemeEvent(engine.vptr)
proc setupOSThemeEventObject(self: StatusEventObject, engine: QQmlApplicationEngine) =
self.vptr = dos_statusevent_create_osThemeEvent(engine.vptr)
proc delete*(self: StatusEventObject) =
dos_statusevent_delete(self.vptr)
proc delete*(self: StatusEvent) =
dos_event_delete(self.vptr)
self.vptr.resetToNil
proc newStatusDockShowAppEventObject*(engine: QQmlApplicationEngine): StatusEventObject =
proc newStatusDockShowAppEventObject*(engine: QQmlApplicationEngine): StatusEvent =
new(result, delete)
result.setupDockShowAppEventObject(engine)
proc newStatusOSThemeEventObject*(engine: QQmlApplicationEngine): StatusEventObject =
proc newStatusOSThemeEventObject*(engine: QQmlApplicationEngine): StatusEvent =
new(result, delete)
result.setupOSThemeEventObject(engine)

View File

@ -1,14 +1,14 @@
proc setup(self: StatusOSNotificationObject) =
self.vptr = dos_statusosnotification_create()
proc setup(self: StatusOSNotification) =
self.vptr = dos_osnotification_create()
proc delete*(self: StatusOSNotificationObject) =
dos_statusosnotification_delete(self.vptr)
proc delete*(self: StatusOSNotification) =
dos_osnotification_delete(self.vptr)
self.vptr.resetToNil
proc newStatusOSNotificationObject*(): StatusOSNotificationObject =
proc newStatusOSNotification*(): StatusOSNotification =
new(result, delete)
result.setup()
proc showNotification*(self: StatusOSNotificationObject, title: string,
proc showNotification*(self: StatusOSNotification, title: string,
message: string, identifier: string) =
dos_statusosnotification_show_notification(self.vptr, title, message, identifier)
dos_osnotification_show_notification(self.vptr, title, message, identifier)