# HG changeset patch # User tdrhq@soc.pidgin.im # Date 1249890457 0 # Node ID 25d99f3621bb02137a0ca7732fcfb6b0372564ab # Parent 3bd8fb942ea46d9ebc2cc1b228dfec948a770d6d removed some ugly pointless pieces of code. diff -r 3bd8fb942ea4 -r 25d99f3621bb pidgin/gtkwebview.c --- a/pidgin/gtkwebview.c Mon Aug 10 07:42:54 2009 +0000 +++ b/pidgin/gtkwebview.c Mon Aug 10 07:47:37 2009 +0000 @@ -223,25 +223,6 @@ g_idle_add ((GSourceFunc) process_js_script_queue, view); } -char* -gtk_webview_execute_script (GtkWebView *view, const char *script) -{ - JSStringRef js_script = JSStringCreateWithUTF8CString (script); - JSContextRef ctxt = webkit_web_frame_get_global_context ( - webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view)) - ); - JSValueRef ret = JSEvaluateScript (ctxt, js_script, NULL, NULL, 0, NULL); - JSStringRef ret_as_str = JSValueToStringCopy (ctxt, ret, NULL); - - size_t cstr_len = JSStringGetMaximumUTF8CStringSize (ret_as_str); - char *cstr = g_new0(char, cstr_len + 1); - - JSStringGetUTF8CString (ret_as_str, cstr, cstr_len); - - /* TODO: I'm not sure what, if at all, I need to free here! */ - return cstr; -} - void gtk_webview_safe_execute_script (GtkWebView *view, const char* script) { @@ -327,18 +308,6 @@ g_free (escaped); } -char* -gtk_webview_get_markup (GtkWebView *view) -{ - return gtk_webview_execute_script (view, "document.body.innerHTML"); -} - -char* -gtk_webview_get_text (GtkWebView *view) -{ - return gtk_webview_execute_script (view, "document.body.textContent"); -} - gboolean gtk_webview_is_empty (GtkWebView *view) { return view->priv->empty; diff -r 3bd8fb942ea4 -r 25d99f3621bb pidgin/gtkwebview.h --- a/pidgin/gtkwebview.h Mon Aug 10 07:42:54 2009 +0000 +++ b/pidgin/gtkwebview.h Mon Aug 10 07:47:37 2009 +0000 @@ -103,20 +103,6 @@ gboolean gtk_webview_is_empty (GtkWebView *webview); /** - * Executes javascript and returns the answer of the script - * formatted as string. The return value needs to be freed using - * g_free. If the return values is not required you may instead - * use webkit_web_view_execute_script, or even better - * gtk_webview_safe_execute_script. - * - * @param webview The GtkWebView object - * @param script The JavaScript to execute - * - * @return the return value of the script. - */ -char* gtk_webview_execute_script (GtkWebView *webview, const char *script); - -/** * Execute the JavaScript only after the webkit_webview_load_string * loads completely. We also guarantee that the scripts are executed * in the order they are called here.This is useful to avoid race @@ -129,24 +115,6 @@ void gtk_webview_safe_execute_script (GtkWebView *webview, const char* script); /** - * Get the current contents of the GtkWebView object. - * - * @param webview The GtkWebView object - * - * @return a string with the contents. Needs to be g_free'd after use. - */ -char* gtk_webview_get_markup (GtkWebView *webview); - -/** - * Returns the contents of the GtkWebView object, stripped of markups - * - * @param webview The GtkWebView object - * - * @return a string with the contents. Needs to be g_free'd after use. - */ -char* gtk_webview_get_text (GtkWebView *view); - -/** * A convenience routine to quote a string for use as a JavaScript * string. For instance, "hello 'world'" becomes "'hello \\'world\\''" *