# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1589498876 0 # Node ID ade83a05a7d8d74db5ed5d6ac1c037e82bf9bc3b # Parent 3ccd0da075147fee6b4d542db423539b7a20525e 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. diff -r 3ccd0da07514 -r ade83a05a7d8 dw.h --- 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); diff -r 3ccd0da07514 -r ade83a05a7d8 os2/dw.c --- 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 + * (C) 2000-2020 Brian Smith * (C) 2003-2011 Mark Hessling * (C) 2000 Achim Hasenmueller * (C) 2000 Peter Nielsen @@ -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. diff -r 3ccd0da07514 -r ade83a05a7d8 os2/dw.def --- 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 diff -r 3ccd0da07514 -r ade83a05a7d8 win/dw.c --- 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 + * (C) 2000-2020 Brian Smith * (C) 2003-2011 Mark Hessling * */ @@ -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. diff -r 3ccd0da07514 -r ade83a05a7d8 win/dw.def --- 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