comparison win/dw.c @ 2098:665d87a50eac

Win: Test that the OS is compatible for WinToast before returning supported.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 11 Jun 2020 22:21:53 +0000
parents 6608fc7f6465
children 296a3872ddd9
comparison
equal deleted inserted replaced
2097:6608fc7f6465 2098:665d87a50eac
322 #endif 322 #endif
323 #ifdef BUILD_TOAST 323 #ifdef BUILD_TOAST
324 void _dw_toast_init(LPWSTR AppName, LPWSTR AppID); 324 void _dw_toast_init(LPWSTR AppName, LPWSTR AppID);
325 void *_dw_notification_new(LPWSTR title, LPWSTR image, LPWSTR description); 325 void *_dw_notification_new(LPWSTR title, LPWSTR image, LPWSTR description);
326 int _dw_notification_send(void *notification); 326 int _dw_notification_send(void *notification);
327 BOOL _dw_toast_is_compatible(void);
327 #endif 328 #endif
328 LRESULT CALLBACK _colorwndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); 329 LRESULT CALLBACK _colorwndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2);
329 void _resize_notebook_page(HWND handle, int pageid); 330 void _resize_notebook_page(HWND handle, int pageid);
330 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); 331 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y);
331 int _lookup_icon(HWND handle, HICON hicon, int type); 332 int _lookup_icon(HWND handle, HICON hicon, int type);
13367 { 13368 {
13368 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) 13369 #if (defined(BUILD_DLL) || defined(BUILD_HTML))
13369 case DW_FEATURE_HTML: 13370 case DW_FEATURE_HTML:
13370 case DW_FEATURE_HTML_RESULT: 13371 case DW_FEATURE_HTML_RESULT:
13371 #endif 13372 #endif
13372 #ifdef BUILD_TOAST
13373 case DW_FEATURE_NOTIFICATION:
13374 #endif
13375 case DW_FEATURE_CONTAINER_STRIPE: 13373 case DW_FEATURE_CONTAINER_STRIPE:
13376 case DW_FEATURE_MDI: 13374 case DW_FEATURE_MDI:
13377 return DW_FEATURE_ENABLED; 13375 return DW_FEATURE_ENABLED;
13376 #ifdef BUILD_TOAST
13377 case DW_FEATURE_NOTIFICATION:
13378 {
13379 if(_dw_toast_is_compatible())
13380 return DW_FEATURE_ENABLED;
13381 return DW_FEATURE_UNSUPPORTED;
13382 }
13383 #endif
13378 #ifdef AEROGLASS 13384 #ifdef AEROGLASS
13379 case DW_FEATURE_WINDOW_TRANSPARENCY: 13385 case DW_FEATURE_WINDOW_TRANSPARENCY:
13380 { 13386 {
13381 if(_dw_composition) 13387 if(_dw_composition)
13382 return DW_FEATURE_ENABLED; 13388 return DW_FEATURE_ENABLED;
13417 case DW_FEATURE_HTML_RESULT: 13423 case DW_FEATURE_HTML_RESULT:
13418 #endif 13424 #endif
13419 #ifdef AEROGLASS 13425 #ifdef AEROGLASS
13420 case DW_FEATURE_WINDOW_TRANSPARENCY: 13426 case DW_FEATURE_WINDOW_TRANSPARENCY:
13421 #endif 13427 #endif
13422 #ifdef BUILD_TOAST
13423 case DW_FEATURE_NOTIFICATION:
13424 #endif
13425 case DW_FEATURE_CONTAINER_STRIPE: 13428 case DW_FEATURE_CONTAINER_STRIPE:
13426 case DW_FEATURE_MDI: 13429 case DW_FEATURE_MDI:
13427 return DW_ERROR_GENERAL; 13430 return DW_ERROR_GENERAL;
13431 #ifdef BUILD_TOAST
13432 case DW_FEATURE_NOTIFICATION:
13433 {
13434 if(_dw_toast_is_compatible())
13435 return DW_ERROR_GENERAL;
13436 return DW_FEATURE_UNSUPPORTED;
13437 }
13438 #endif
13428 /* These features are supported and configurable */ 13439 /* These features are supported and configurable */
13429 #ifdef AEROGLASS 13440 #ifdef AEROGLASS
13430 case DW_FEATURE_DARK_MODE: 13441 case DW_FEATURE_DARK_MODE:
13431 { 13442 {
13432 _DW_DARK_MODE_ALLOWED = state; 13443 _DW_DARK_MODE_ALLOWED = state;