Mercurial > pidgin
changeset 32082:25d99f3621bb
removed some ugly pointless pieces of code.
author | tdrhq@soc.pidgin.im |
---|---|
date | Mon, 10 Aug 2009 07:47:37 +0000 |
parents | 3bd8fb942ea4 |
children | ef8d9e44cc73 |
files | pidgin/gtkwebview.c pidgin/gtkwebview.h |
diffstat | 2 files changed, 0 insertions(+), 63 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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\\''" *