Mercurial > dwindows
comparison gtk3/dw.c @ 2081:24875681eec5
Added htmlEngine to DWEnv
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 31 May 2020 05:25:18 +0000 |
parents | c2f13c5eefac |
children | 94ea915bd917 |
comparison
equal
deleted
inserted
replaced
2080:8f08d4c9d3fc | 2081:24875681eec5 |
---|---|
2030 | 2030 |
2031 _dw_init_thread(); | 2031 _dw_init_thread(); |
2032 | 2032 |
2033 /* Create a global object for glib activities */ | 2033 /* Create a global object for glib activities */ |
2034 _DWObject = g_object_new(G_TYPE_OBJECT, NULL); | 2034 _DWObject = g_object_new(G_TYPE_OBJECT, NULL); |
2035 | 2035 |
2036 #if GLIB_CHECK_VERSION(2,28,0) | 2036 #if GLIB_CHECK_VERSION(2,28,0) |
2037 if(!_dw_app_id[0]) | 2037 if(!_dw_app_id[0]) |
2038 { | 2038 { |
2039 /* Generate an Application ID based on the PID if all else fails. */ | 2039 /* Generate an Application ID based on the PID if all else fails. */ |
2040 snprintf(_dw_app_id, 100, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid()); | 2040 snprintf(_dw_app_id, 100, "%s.pid.%d", DW_APP_DOMAIN_DEFAULT, getpid()); |
2041 } | 2041 } |
2042 | 2042 |
2043 /* Initialize the application subsystem on supported versions... | 2043 /* Initialize the application subsystem on supported versions... |
2044 * we generate an application ID based on the binary name or PID | 2044 * we generate an application ID based on the binary name or PID |
2045 * instead of passing NULL to enable full application support. | 2045 * instead of passing NULL to enable full application support. |
2046 */ | 2046 */ |
2047 _DWApp = g_application_new(_dw_app_id, G_APPLICATION_FLAGS_NONE); | 2047 _DWApp = g_application_new(_dw_app_id, G_APPLICATION_FLAGS_NONE); |
11038 * or NULL if none is necessary. | 11038 * or NULL if none is necessary. |
11039 * Returns: | 11039 * Returns: |
11040 * A handle to the notification which can be used to attach a "clicked" event if desired, | 11040 * A handle to the notification which can be used to attach a "clicked" event if desired, |
11041 * or NULL if it fails or notifications are not supported by the system. | 11041 * or NULL if it fails or notifications are not supported by the system. |
11042 * Remarks: | 11042 * Remarks: |
11043 * This will create a system notification that will show in the notifaction panel | 11043 * This will create a system notification that will show in the notifaction panel |
11044 * on supported systems, which may be clicked to perform another task. | 11044 * on supported systems, which may be clicked to perform another task. |
11045 */ | 11045 */ |
11046 HWND dw_notification_new(const char *title, HPIXMAP pixmap, const char *description, ...) | 11046 HWND dw_notification_new(const char *title, HPIXMAP pixmap, const char *description, ...) |
11047 { | 11047 { |
11048 #if GLIB_CHECK_VERSION(2,40,0) | 11048 #if GLIB_CHECK_VERSION(2,40,0) |
11049 GNotification *notification = g_notification_new(title); | 11049 GNotification *notification = g_notification_new(title); |
11050 | 11050 |
11051 if(notification) | 11051 if(notification) |
11052 { | 11052 { |
11053 if(description) | 11053 if(description) |
11054 { | 11054 { |
11055 va_list args; | 11055 va_list args; |
11081 { | 11081 { |
11082 #if GLIB_CHECK_VERSION(2,40,0) | 11082 #if GLIB_CHECK_VERSION(2,40,0) |
11083 if(notification) | 11083 if(notification) |
11084 { | 11084 { |
11085 char id[101] = {0}; | 11085 char id[101] = {0}; |
11086 | 11086 |
11087 /* Generate a unique ID based on the notification handle, | 11087 /* Generate a unique ID based on the notification handle, |
11088 * so we can use it to remove the notification in dw_window_destroy(). | 11088 * so we can use it to remove the notification in dw_window_destroy(). |
11089 */ | 11089 */ |
11090 snprintf(id, 100, "dw-notification-%llu", (unsigned long long)notification); | 11090 snprintf(id, 100, "dw-notification-%llu", (unsigned long long)notification); |
11091 g_application_send_notification(_DWApp, id, (GNotification *)notification); | 11091 g_application_send_notification(_DWApp, id, (GNotification *)notification); |
11092 return DW_ERROR_NONE; | 11092 return DW_ERROR_NONE; |
11110 strncpy(env->osName, name.sysname, sizeof(env->osName)-1); | 11110 strncpy(env->osName, name.sysname, sizeof(env->osName)-1); |
11111 strncpy(tempbuf, name.release, 99); | 11111 strncpy(tempbuf, name.release, 99); |
11112 | 11112 |
11113 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1); | 11113 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1); |
11114 strncpy(env->buildTime, __TIME__, sizeof(env->buildTime)-1); | 11114 strncpy(env->buildTime, __TIME__, sizeof(env->buildTime)-1); |
11115 #ifdef USE_WEBKIT | |
11116 # ifdef USE_WEBKIT2 | |
11117 strncpy(env->htmlEngine, "WEBKIT2", sizeof(env->htmlEngine)-1); | |
11118 # else | |
11119 strncpy(env->htmlEngine, "WEBKIT", sizeof(env->htmlEngine)-1); | |
11120 # endif | |
11121 #else | |
11122 strncpy(env->htmlEngine, "N/A", sizeof(env->htmlEngine)-1); | |
11123 #endif | |
11115 env->DWMajorVersion = DW_MAJOR_VERSION; | 11124 env->DWMajorVersion = DW_MAJOR_VERSION; |
11116 env->DWMinorVersion = DW_MINOR_VERSION; | 11125 env->DWMinorVersion = DW_MINOR_VERSION; |
11117 #ifdef VER_REV | 11126 #ifdef VER_REV |
11118 env->DWSubVersion = VER_REV; | 11127 env->DWSubVersion = VER_REV; |
11119 #else | 11128 #else |