changeset 2068:ade83a05a7d8

Added notification stubs for Windows and OS/2. Windows code is in progress, but having some build system integration issues. So I wanted to commit the stubs at least to ensure things still build in the meantime.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 14 May 2020 23:27:56 +0000
parents 3ccd0da07514
children b4b49d29b940
files dw.h os2/dw.c os2/dw.def win/dw.c win/dw.def
diffstat 5 files changed, 110 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Thu May 14 13:13:45 2020 +0000
+++ b/dw.h	Thu May 14 23:27:56 2020 +0000
@@ -1790,6 +1790,7 @@
 char * API dw_file_browse(const char *title, const char *defpath, const char *ext, int flags);
 char * API dw_user_dir(void);
 char * API dw_app_dir(void);
+int API dw_app_id_set(const char *appid);
 DWDialog * API dw_dialog_new(void *data);
 int API dw_dialog_dismiss(DWDialog *dialog, void *result);
 void * API dw_dialog_wait(DWDialog *dialog);
--- a/os2/dw.c	Thu May 14 13:13:45 2020 +0000
+++ b/os2/dw.c	Thu May 14 23:27:56 2020 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the PM GUI
  *
- * (C) 2000-2019 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2020 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  * (C) 2000 Achim Hasenmueller <achimha@innotek.de>
  * (C) 2000 Peter Nielsen <peter@pmview.com>
@@ -12393,6 +12393,37 @@
 }
 
 /*
+ * Creates a new system notification if possible.
+ * Parameters:
+ *         title: The short title of the notification.
+ *         pixmap: Handle to an image to display or NULL if none.
+ *         description: A longer description of the notification,
+ *                      or NULL if none is necessary.
+ * Returns:
+ *         A handle to the notification which can be used to attach a "clicked" event if desired,
+ *         or NULL if it fails or notifications are not supported by the system.
+ * Remarks:
+ *          This will create a system notification that will show in the notifaction panel 
+ *          on supported systems, which may be clicked to perform another task.
+ */
+HWND dw_notification_new(const char *title, HPIXMAP pixmap, const char *description, ...)
+{
+   return NULL;
+}
+
+/*
+ * Sends a notification created by dw_notification_new() after attaching signal handler.
+ * Parameters:
+ *         notification: The handle to the notification returned by dw_notification_new().
+ * Returns:
+ *         DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported.
+ */
+int dw_notification_send(HWND notification)
+{
+   return DW_ERROR_UNKNOWN;
+}
+
+/*
  * Returns some information about the current operating environment.
  * Parameters:
  *       env: Pointer to a DWEnv struct.
@@ -13276,6 +13307,24 @@
 }
 
 /*
+ * Sets the application ID used by this Dynamic Windows application instance.
+ * Parameters:
+ *         appid: A string typically in the form: com.company.division.application
+ * Returns:
+ *         DW_ERROR_NONE after successfully setting the application ID.
+ *         DW_ERROR_UNKNOWN if unsupported on this system.
+ *         DW_ERROR_GENERAL if the application ID is not allowed.
+ * Remarks:
+ *          This must be called before dw_init().  If dw_init() is called first
+ *          it will create a unique ID in the form: org.dbsoft.dwindows.application
+ *          or if the application name cannot be detected: org.dbsoft.dwindows.pid.#
+ */
+int dw_app_id_set(const char *appid)
+{
+    return DW_ERROR_UNKNOWN;
+}
+
+/*
  * Call a function from the window (widget)'s context.
  * Parameters:
  *       handle: Window handle of the widget.
--- a/os2/dw.def	Thu May 14 13:13:45 2020 +0000
+++ b/os2/dw.def	Thu May 14 23:27:56 2020 +0000
@@ -24,6 +24,7 @@
   dw_app_dir                             @25
   dw_main_quit                           @26
   dw_shutdown                            @27
+  dw_app_id_set                          @28
   
   _dw_init_thread                        @30
   _dw_deinit_thread                      @31
@@ -323,3 +324,6 @@
 
   dw_utf8_to_wchar                       @520
   dw_wchar_to_utf8                       @521
+
+  dw_notification_new                    @530
+  dw_notification_send                   @531
--- a/win/dw.c	Thu May 14 13:13:45 2020 +0000
+++ b/win/dw.c	Thu May 14 23:27:56 2020 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the Win32 GUI
  *
- * (C) 2000-2019 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2020 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  *
  */
@@ -278,6 +278,7 @@
  */
 static char _dw_alternate_temp_dir[MAX_PATH+1] = {0};
 static char _dw_exec_dir[MAX_PATH+1] = {0};
+static char _dw_app_id[101]= {0};
 
 int main(int argc, char *argv[]);
 
@@ -12344,6 +12345,37 @@
 }
 
 /*
+ * Creates a new system notification if possible.
+ * Parameters:
+ *         title: The short title of the notification.
+ *         pixmap: Handle to an image to display or NULL if none.
+ *         description: A longer description of the notification,
+ *                      or NULL if none is necessary.
+ * Returns:
+ *         A handle to the notification which can be used to attach a "clicked" event if desired,
+ *         or NULL if it fails or notifications are not supported by the system.
+ * Remarks:
+ *          This will create a system notification that will show in the notifaction panel 
+ *          on supported systems, which may be clicked to perform another task.
+ */
+HWND dw_notification_new(const char *title, HPIXMAP pixmap, const char *description, ...)
+{
+   return NULL;
+}
+
+/*
+ * Sends a notification created by dw_notification_new() after attaching signal handler.
+ * Parameters:
+ *         notification: The handle to the notification returned by dw_notification_new().
+ * Returns:
+ *         DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported.
+ */
+int dw_notification_send(HWND notification)
+{
+   return DW_ERROR_UNKNOWN;
+}
+
+/*
  * Returns some information about the current operating environment.
  * Parameters:
  *       env: Pointer to a DWEnv struct.
@@ -12784,6 +12816,24 @@
 }
 
 /*
+ * Sets the application ID used by this Dynamic Windows application instance.
+ * Parameters:
+ *         appid: A string typically in the form: com.company.division.application
+ * Returns:
+ *         DW_ERROR_NONE after successfully setting the application ID.
+ *         DW_ERROR_UNKNOWN if unsupported on this system.
+ *         DW_ERROR_GENERAL if the application ID is not allowed.
+ * Remarks:
+ *          This must be called before dw_init().  If dw_init() is called first
+ *          it will create a unique ID in the form: org.dbsoft.dwindows.application
+ *          or if the application name cannot be detected: org.dbsoft.dwindows.pid.#
+ */
+int dw_app_id_set(const char *appid)
+{
+    return DW_ERROR_UNKNOWN;
+}
+
+/*
  * Call a function from the window (widget)'s context.
  * Parameters:
  *       handle: Window handle of the widget.
--- a/win/dw.def	Thu May 14 13:13:45 2020 +0000
+++ b/win/dw.def	Thu May 14 23:27:56 2020 +0000
@@ -21,6 +21,7 @@
   dw_app_dir                             @25
   dw_main_quit                           @26
   dw_shutdown                            @27
+  dw_app_id_set                          @28
   
   _dw_init_thread                        @30
   _dw_deinit_thread                      @31
@@ -320,3 +321,6 @@
   
   dw_utf8_to_wchar                       @520
   dw_wchar_to_utf8                       @521
+
+  dw_notification_new                    @530
+  dw_notification_send                   @531