Mercurial > dwindows
comparison gtk3/dw.c @ 2053:026f033ac1c1
GTK3: User and Script data parameters to HTML_RESULT handler were swapped.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 02 Dec 2019 09:00:28 +0000 |
parents | a3fbe505307a |
children | 29305f8abae3 |
comparison
equal
deleted
inserted
replaced
2052:cfa0a9554118 | 2053:026f033ac1c1 |
---|---|
1197 g_object_set_data(G_OBJECT(widget), text, GINT_TO_POINTER(cid)); | 1197 g_object_set_data(G_OBJECT(widget), text, GINT_TO_POINTER(cid)); |
1198 } | 1198 } |
1199 | 1199 |
1200 static void _html_result_event(GObject *object, GAsyncResult *result, gpointer script_data) | 1200 static void _html_result_event(GObject *object, GAsyncResult *result, gpointer script_data) |
1201 { | 1201 { |
1202 #if USE_WEBKIT2 | |
1202 pthread_t saved_thread = _dw_thread; | 1203 pthread_t saved_thread = _dw_thread; |
1203 #if USE_WEBKIT2 | |
1204 WebKitJavascriptResult *js_result; | 1204 WebKitJavascriptResult *js_result; |
1205 #if WEBKIT_CHECK_VERSION(2, 22, 0) | 1205 #if WEBKIT_CHECK_VERSION(2, 22, 0) |
1206 JSCValue *value; | 1206 JSCValue *value; |
1207 #else | 1207 #else |
1208 JSValueRef value; | 1208 JSValueRef value; |
1229 } | 1229 } |
1230 | 1230 |
1231 if(!(js_result = webkit_web_view_run_javascript_finish(WEBKIT_WEB_VIEW(object), result, &error))) | 1231 if(!(js_result = webkit_web_view_run_javascript_finish(WEBKIT_WEB_VIEW(object), result, &error))) |
1232 { | 1232 { |
1233 if(htmlresultfunc) | 1233 if(htmlresultfunc) |
1234 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, error->message, user_data, script_data); | 1234 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, error->message, script_data, user_data); |
1235 g_error_free (error); | 1235 g_error_free (error); |
1236 _dw_thread = saved_thread; | 1236 _dw_thread = saved_thread; |
1237 return; | 1237 return; |
1238 } | 1238 } |
1239 | 1239 |
1261 | 1261 |
1262 if(htmlresultfunc) | 1262 if(htmlresultfunc) |
1263 { | 1263 { |
1264 #if WEBKIT_CHECK_VERSION(2, 22, 0) | 1264 #if WEBKIT_CHECK_VERSION(2, 22, 0) |
1265 if(exception) | 1265 if(exception) |
1266 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, (char *)jsc_exception_get_message(exception), user_data, script_data); | 1266 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, (char *)jsc_exception_get_message(exception), script_data, user_data); |
1267 else | 1267 else |
1268 #endif | 1268 #endif |
1269 htmlresultfunc((HWND)object, DW_ERROR_NONE, str_value, user_data, script_data); | 1269 htmlresultfunc((HWND)object, DW_ERROR_NONE, str_value, script_data, user_data); |
1270 } | 1270 } |
1271 g_free (str_value); | 1271 g_free (str_value); |
1272 } | 1272 } |
1273 else if(htmlresultfunc) | 1273 else if(htmlresultfunc) |
1274 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, NULL, user_data, script_data); | 1274 htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, NULL, script_data, user_data); |
1275 webkit_javascript_result_unref (js_result); | 1275 webkit_javascript_result_unref (js_result); |
1276 _dw_thread = saved_thread; | |
1276 #endif | 1277 #endif |
1277 _dw_thread = saved_thread; | |
1278 } | 1278 } |
1279 | 1279 |
1280 #ifdef USE_WEBKIT | 1280 #ifdef USE_WEBKIT |
1281 #ifdef USE_WEBKIT2 | 1281 #ifdef USE_WEBKIT2 |
1282 static void _html_changed_event(WebKitWebView *web_view, WebKitLoadEvent load_event, gpointer data) | 1282 static void _html_changed_event(WebKitWebView *web_view, WebKitLoadEvent load_event, gpointer data) |