pidgin: 4f8cd119: Restore Insert Horizontal Rule functiona...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jun 4 04:25:46 EDT 2012


----------------------------------------------------------------------
Revision: 4f8cd119f4719b7a0ba0ec9414225ce56170c787
Parent:   2365a0db8553f8ec5336fd2418668ad16dbe04cd
Author:   qulogic at pidgin.im
Date:     06/03/12 16:50:42
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/4f8cd119f4719b7a0ba0ec9414225ce56170c787

Changelog: 

Restore Insert Horizontal Rule functionality.

Changes against parent 2365a0db8553f8ec5336fd2418668ad16dbe04cd

  patched  pidgin/gtkwebview.c
  patched  pidgin/gtkwebview.h
  patched  pidgin/gtkwebviewtoolbar.c

-------------- next part --------------
============================================================
--- pidgin/gtkwebview.c	178fdf084ce032ee1226ed1e577e3a02b1667b2b
+++ pidgin/gtkwebview.c	e33a119702a287c67d4ca33f0dbb3861a2d4585e
@@ -1007,3 +1007,16 @@ gtk_webview_font_grow(GtkWebView *webvie
 	g_free(tmp);
 }
 
+void
+gtk_webview_insert_hr(GtkWebView *webview)
+{
+	GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
+	WebKitDOMDocument *dom;
+
+	dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview));
+
+	priv->edit.block_changed = TRUE;
+	webkit_dom_document_exec_command(dom, "insertHorizontalRule", FALSE, "");
+	priv->edit.block_changed = FALSE;
+}
+
============================================================
--- pidgin/gtkwebview.h	14436066899232f2a864bd2099e3f7b83626d75a
+++ pidgin/gtkwebview.h	7e7765d2a9fecea9e107429b9773a8ef21d63a6a
@@ -402,6 +402,14 @@ void gtk_webview_font_grow(GtkWebView *w
  */
 void gtk_webview_font_grow(GtkWebView *webview);
 
+/**
+ * Inserts a horizontal rule at the current location or selection in a
+ * GtkWebView.
+ *
+ * @param webview The GtkWebView
+ */
+void gtk_webview_insert_hr(GtkWebView *webview);
+
 G_END_DECLS
 
 #endif /* _PIDGIN_WEBVIEW_H_ */
============================================================
--- pidgin/gtkwebviewtoolbar.c	b0ab1d001837bc83afbc77be45fe5f7753bc423d
+++ pidgin/gtkwebviewtoolbar.c	28cc128a0ea27545b7a75282e6a6c4baf39b2bf5
@@ -569,16 +569,7 @@ insert_hr_cb(GtkWidget *widget, GtkWebVi
 static void
 insert_hr_cb(GtkWidget *widget, GtkWebViewToolbar *toolbar)
 {
-#if 0
-	GtkTextIter iter;
-	GtkTextMark *ins;
-	GtkIMHtmlScalable *hr;
-
-	ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview)));
-	gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->webview)), &iter, ins);
-	hr = gtk_webview_hr_new();
-	gtk_webview_hr_add_to(hr, GTK_WEBVIEW(toolbar->webview), &iter);
-#endif
+	gtk_webview_insert_hr(GTK_WEBVIEW(toolbar->webview));
 }
 
 static void


More information about the Commits mailing list