gtkhtml r8721 - branches/mbarnes-composer/components/editor



Author: mbarnes
Date: Thu Feb  7 01:02:48 2008
New Revision: 8721
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8721&view=rev

Log:
Add virtual methods cut(), copy() and paste().


Modified:
   branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c
   branches/mbarnes-composer/components/editor/gtkhtml-editor.c
   branches/mbarnes-composer/components/editor/gtkhtml-editor.h

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor-actions.c	Thu Feb  7 01:02:48 2008
@@ -359,13 +359,6 @@
 }
 
 static void
-action_copy_cb (GtkAction *action,
-                GtkhtmlEditor *editor)
-{
-	gtk_html_command (gtkhtml_editor_get_html (editor), "copy");
-}
-
-static void
 action_context_delete_cell_cb (GtkAction *action,
                                GtkhtmlEditor *editor)
 {
@@ -426,10 +419,25 @@
 }
 
 static void
+action_copy_cb (GtkAction *action,
+                GtkhtmlEditor *editor)
+{
+	GtkhtmlEditorClass *class;
+
+	class = GTKHTML_EDITOR_GET_CLASS (editor);
+	g_return_if_fail (class->copy != NULL);
+	class->copy (editor);
+}
+
+static void
 action_cut_cb (GtkAction *action,
                GtkhtmlEditor *editor)
 {
-	gtk_html_command (gtkhtml_editor_get_html (editor), "cut");
+	GtkhtmlEditorClass *class;
+
+	class = GTKHTML_EDITOR_GET_CLASS (editor);
+	g_return_if_fail (class->cut != NULL);
+	class->cut (editor);
 }
 
 static void
@@ -782,6 +790,23 @@
 }
 
 static void
+action_paste_cb (GtkAction *action,
+                 GtkhtmlEditor *editor)
+{
+	GtkhtmlEditorClass *class;
+
+	class = GTKHTML_EDITOR_GET_CLASS (editor);
+	g_return_if_fail (class->paste != NULL);
+	class->paste (editor);
+}
+
+static void
+action_paste_quote_cb (GtkAction *action,
+                       GtkhtmlEditor *editor)
+{
+}
+
+static void
 action_properties_cell_cb (GtkAction *action,
                            GtkhtmlEditor *editor)
 {
@@ -890,19 +915,6 @@
 }
 
 static void
-action_paste_cb (GtkAction *action,
-                 GtkhtmlEditor *editor)
-{
-	gtk_html_command (gtkhtml_editor_get_html (editor), "paste");
-}
-
-static void
-action_paste_quote_cb (GtkAction *action,
-                       GtkhtmlEditor *editor)
-{
-}
-
-static void
 action_redo_cb (GtkAction *action,
                 GtkhtmlEditor *editor)
 {

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor.c
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor.c	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor.c	Thu Feb  7 01:02:48 2008
@@ -367,6 +367,24 @@
 	editor_method_set_language
 };
 
+static void
+editor_cut (GtkhtmlEditor *editor)
+{
+	gtk_html_command (gtkhtml_editor_get_html (editor), "cut");
+}
+
+static void
+editor_copy (GtkhtmlEditor *editor)
+{
+	gtk_html_command (gtkhtml_editor_get_html (editor), "copy");
+}
+
+static void
+editor_paste (GtkhtmlEditor *editor)
+{
+	gtk_html_command (gtkhtml_editor_get_html (editor), "paste");
+}
+
 static GObject *
 editor_constructor (GType type,
                     guint n_construct_properties,
@@ -572,6 +590,10 @@
 	object_class->dispose = editor_dispose;
 	object_class->finalize = editor_finalize;
 
+	class->cut = editor_cut;
+	class->copy = editor_copy;
+	class->paste = editor_paste;
+
 	g_object_class_install_property (
 		object_class,
 		PROP_CURRENT_FOLDER,

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor.h
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor.h	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor.h	Thu Feb  7 01:02:48 2008
@@ -65,6 +65,10 @@
 
 struct _GtkhtmlEditorClass {
 	GtkWindowClass parent_class;
+
+	void	(*cut)		(GtkhtmlEditor *editor);
+	void	(*copy)		(GtkhtmlEditor *editor);
+	void	(*paste)	(GtkhtmlEditor *editor);
 };
 
 GType		gtkhtml_editor_get_type		(void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]