[gedit-plugins] Port to the new message bus



commit 209e30b205219e6a977cdf758cb73ff787d1f469
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Mar 27 01:41:43 2011 +0100

    Port to the new message bus
    
    Note: the conversion was done mechanically since I am not sure what is
    using these bus messages... the bookmarks plugin itself at least now
    compiles and works.

 plugins/bookmarks/Makefile.am                      |   15 ++-
 plugins/bookmarks/gedit-bookmarks-plugin.c         |   50 ++-----
 .../messages/gedit-bookmarks-message-add.c         |  153 ++++++++++++++++++++
 .../messages/gedit-bookmarks-message-add.h         |   68 +++++++++
 .../messages/gedit-bookmarks-message-goto-next.c   |  153 ++++++++++++++++++++
 .../messages/gedit-bookmarks-message-goto-next.h   |   68 +++++++++
 .../gedit-bookmarks-message-goto-previous.c        |  153 ++++++++++++++++++++
 .../gedit-bookmarks-message-goto-previous.h        |   68 +++++++++
 .../messages/gedit-bookmarks-message-remove.c      |  153 ++++++++++++++++++++
 .../messages/gedit-bookmarks-message-remove.h      |   68 +++++++++
 .../messages/gedit-bookmarks-message-toggle.c      |  153 ++++++++++++++++++++
 .../messages/gedit-bookmarks-message-toggle.h      |   68 +++++++++
 plugins/bookmarks/messages/messages.h              |   10 ++
 13 files changed, 1143 insertions(+), 37 deletions(-)
---
diff --git a/plugins/bookmarks/Makefile.am b/plugins/bookmarks/Makefile.am
index 277cd2f..9b26409 100644
--- a/plugins/bookmarks/Makefile.am
+++ b/plugins/bookmarks/Makefile.am
@@ -11,8 +11,19 @@ INCLUDES = \
 plugin_LTLIBRARIES = libbookmarks.la
 
 libbookmarks_la_SOURCES = \
-	gedit-bookmarks-plugin.h			\
-	gedit-bookmarks-plugin.c	
+	gedit-bookmarks-plugin.h				\
+	gedit-bookmarks-plugin.c				\
+	messages/gedit-bookmarks-message-add.c			\
+	messages/gedit-bookmarks-message-add.h			\
+	messages/gedit-bookmarks-message-goto-next.c		\
+	messages/gedit-bookmarks-message-goto-next.h		\
+	messages/gedit-bookmarks-message-goto-previous.c	\
+	messages/gedit-bookmarks-message-goto-previous.h	\
+	messages/gedit-bookmarks-message-remove.c		\
+	messages/gedit-bookmarks-message-remove.h		\
+	messages/gedit-bookmarks-message-toggle.c		\
+	messages/gedit-bookmarks-message-toggle.h		\
+	messages/messages.h
 
 libbookmarks_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
 libbookmarks_la_LIBADD = $(GEDIT_LIBS)
diff --git a/plugins/bookmarks/gedit-bookmarks-plugin.c b/plugins/bookmarks/gedit-bookmarks-plugin.c
index bfe480b..88e6c7a 100644
--- a/plugins/bookmarks/gedit-bookmarks-plugin.c
+++ b/plugins/bookmarks/gedit-bookmarks-plugin.c
@@ -23,6 +23,7 @@
 #endif
 
 #include "gedit-bookmarks-plugin.h"
+#include "messages/messages.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
@@ -562,11 +563,8 @@ message_get_view_iter (GeditWindow    *window,
                        GtkSourceView **view,
                        GtkTextIter    *iter)
 {
-	if (gedit_message_has_key (message, "view"))
-	{
-		gedit_message_get (message, "view", view, NULL);
-	}
-	else
+	g_object_get (message, "view", view, NULL);
+	if (!*view)
 	{
 		*view = GTK_SOURCE_VIEW (gedit_window_get_active_view (window));
 	}
@@ -576,11 +574,8 @@ message_get_view_iter (GeditWindow    *window,
 		return;
 	}
 
-	if (gedit_message_has_key (message, "iter"))
-	{
-		gedit_message_get (message, "iter", iter, NULL);
-	}
-	else
+	g_object_get (message, "iter", iter, NULL);
+	if (iter)
 	{
 		GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (*view));
 		gtk_text_buffer_get_iter_at_mark (buffer,
@@ -696,44 +691,29 @@ install_messages (GeditWindow *window)
 	GeditMessageBus *bus = gedit_window_get_message_bus (window);
 
 	gedit_message_bus_register (bus,
+	                            GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE,
 	                            MESSAGE_OBJECT_PATH,
-	                           "toggle",
-	                            2,
-	                            "view", GTK_SOURCE_TYPE_VIEW,
-	                            "iter", GTK_TYPE_TEXT_ITER,
-				    NULL);
+	                            "toggle");
 
 	gedit_message_bus_register (bus,
+	                            GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD,
 	                            MESSAGE_OBJECT_PATH,
-	                            "add",
-	                            2,
-	                            "view", GTK_SOURCE_TYPE_VIEW,
-	                            "iter", GTK_TYPE_TEXT_ITER,
-				    NULL);
+	                            "add");
 
 	gedit_message_bus_register (bus,
+	                            GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE,
 	                            MESSAGE_OBJECT_PATH,
-	                            "remove",
-	                            2,
-	                            "view", GTK_SOURCE_TYPE_VIEW,
-	                            "iter", GTK_TYPE_TEXT_ITER,
-				    NULL);
+	                            "remove");
 
 	gedit_message_bus_register (bus,
+	                            GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT,
 	                            MESSAGE_OBJECT_PATH,
-	                            "goto_next",
-	                            2,
-	                            "view", GTK_SOURCE_TYPE_VIEW,
-	                            "iter", GTK_TYPE_TEXT_ITER,
-				    NULL);
+	                            "goto-next");
 
 	gedit_message_bus_register (bus,
+	                            GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS,
 	                            MESSAGE_OBJECT_PATH,
-	                            "goto_previous",
-	                            2,
-	                            "view", GTK_SOURCE_TYPE_VIEW,
-	                            "iter", GTK_TYPE_TEXT_ITER,
-				    NULL);
+	                            "goto-previous");
 
 	BUS_CONNECT (bus, toggle, window);
 	BUS_CONNECT (bus, add, window);
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-add.c b/plugins/bookmarks/messages/gedit-bookmarks-message-add.c
new file mode 100644
index 0000000..cb9eb82
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-add.c
@@ -0,0 +1,153 @@
+/*
+ * gedit-bookmarks-message-add.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-view.h>
+#include "gedit-bookmarks-message-add.h"
+
+#define GEDIT_BOOKMARKS_MESSAGE_ADD_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD, GeditBookmarksMessageAddPrivate))
+
+enum
+{
+	PROP_0,
+
+	PROP_VIEW,
+	PROP_ITER,
+};
+
+struct _GeditBookmarksMessageAddPrivate
+{
+	GeditView *view;
+	GtkTextIter *iter;
+};
+
+G_DEFINE_TYPE (GeditBookmarksMessageAdd, gedit_bookmarks_message_add, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_bookmarks_message_add_finalize (GObject *obj)
+{
+	GeditBookmarksMessageAdd *msg = GEDIT_BOOKMARKS_MESSAGE_ADD (obj);
+
+	if (msg->priv->view)
+	{
+		g_object_unref (msg->priv->view);
+	}
+	if (msg->priv->iter)
+	{
+		g_object_unref (msg->priv->iter);
+	}
+
+	G_OBJECT_CLASS (gedit_bookmarks_message_add_parent_class)->finalize (obj);
+}
+
+static void
+gedit_bookmarks_message_add_get_property (GObject    *obj,
+                                          guint       prop_id,
+                                          GValue     *value,
+                                          GParamSpec *pspec)
+{
+	GeditBookmarksMessageAdd *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_ADD (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+			g_value_set_object (value, msg->priv->view);
+			break;
+		case PROP_ITER:
+			g_value_set_boxed (value, msg->priv->iter);
+			break;
+	}
+}
+
+static void
+gedit_bookmarks_message_add_set_property (GObject      *obj,
+                                          guint         prop_id,
+                                          GValue const *value,
+                                          GParamSpec   *pspec)
+{
+	GeditBookmarksMessageAdd *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_ADD (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+		{
+			if (msg->priv->view)
+			{
+				g_object_unref (msg->priv->view);
+			}
+			msg->priv->view = g_value_dup_object (value);
+			break;
+		}
+		case PROP_ITER:
+		{
+			if (msg->priv->iter)
+			{
+				g_boxed_free (GTK_TYPE_TEXT_ITER, msg->priv->iter);
+			}
+			msg->priv->iter = g_boxed_copy (GTK_TYPE_TEXT_ITER, value);
+			break;
+		}
+	}
+}
+
+static void
+gedit_bookmarks_message_add_class_init (GeditBookmarksMessageAddClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+	object_class->finalize = gedit_bookmarks_message_add_finalize;
+
+	object_class->get_property = gedit_bookmarks_message_add_get_property;
+	object_class->set_property = gedit_bookmarks_message_add_set_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_VIEW,
+	                                 g_param_spec_object ("view",
+	                                                      "View",
+	                                                      "View",
+	                                                      GEDIT_TYPE_VIEW,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ITER,
+	                                 g_param_spec_boxed ("iter",
+	                                                      "Iter",
+	                                                      "Iter",
+	                                                      GTK_TYPE_TEXT_ITER,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof (GeditBookmarksMessageAddPrivate));
+}
+
+static void
+gedit_bookmarks_message_add_init (GeditBookmarksMessageAdd *message)
+{
+	message->priv = GEDIT_BOOKMARKS_MESSAGE_ADD_GET_PRIVATE (message);
+}
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-add.h b/plugins/bookmarks/messages/gedit-bookmarks-message-add.h
new file mode 100644
index 0000000..667ed15
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-add.h
@@ -0,0 +1,68 @@
+/*
+ * gedit-bookmarks-message-add.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_BOOKMARKS_MESSAGE_ADD_H__
+#define __GEDIT_BOOKMARKS_MESSAGE_ADD_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD            (gedit_bookmarks_message_add_get_type ())
+#define GEDIT_BOOKMARKS_MESSAGE_ADD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD,\
+                                                     GeditBookmarksMessageAdd))
+#define GEDIT_BOOKMARKS_MESSAGE_ADD_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD,\
+                                                     GeditBookmarksMessageAdd const))
+#define GEDIT_BOOKMARKS_MESSAGE_ADD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD,\
+                                                     GeditBookmarksMessageAddClass))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_ADD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD))
+#define GEDIT_BOOKMARKS_MESSAGE_ADD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                     GEDIT_TYPE_BOOKMARKS_MESSAGE_ADD,\
+                                                     GeditBookmarksMessageAddClass))
+
+typedef struct _GeditBookmarksMessageAdd        GeditBookmarksMessageAdd;
+typedef struct _GeditBookmarksMessageAddClass   GeditBookmarksMessageAddClass;
+typedef struct _GeditBookmarksMessageAddPrivate GeditBookmarksMessageAddPrivate;
+
+struct _GeditBookmarksMessageAdd
+{
+	GeditMessage parent;
+
+	GeditBookmarksMessageAddPrivate *priv;
+};
+
+struct _GeditBookmarksMessageAddClass
+{
+	GeditMessageClass parent_class;
+};
+
+GType gedit_bookmarks_message_add_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGE_ADD_H__ */
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.c b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.c
new file mode 100644
index 0000000..9cb67ec
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.c
@@ -0,0 +1,153 @@
+/*
+ * gedit-bookmarks-message-goto-next.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-view.h>
+#include "gedit-bookmarks-message-goto-next.h"
+
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT, GeditBookmarksMessageGotoNextPrivate))
+
+enum
+{
+	PROP_0,
+
+	PROP_VIEW,
+	PROP_ITER,
+};
+
+struct _GeditBookmarksMessageGotoNextPrivate
+{
+	GeditView *view;
+	GtkTextIter *iter;
+};
+
+G_DEFINE_TYPE (GeditBookmarksMessageGotoNext, gedit_bookmarks_message_goto_next, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_bookmarks_message_goto_next_finalize (GObject *obj)
+{
+	GeditBookmarksMessageGotoNext *msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT (obj);
+
+	if (msg->priv->view)
+	{
+		g_object_unref (msg->priv->view);
+	}
+	if (msg->priv->iter)
+	{
+		g_object_unref (msg->priv->iter);
+	}
+
+	G_OBJECT_CLASS (gedit_bookmarks_message_goto_next_parent_class)->finalize (obj);
+}
+
+static void
+gedit_bookmarks_message_goto_next_get_property (GObject    *obj,
+                                                guint       prop_id,
+                                                GValue     *value,
+                                                GParamSpec *pspec)
+{
+	GeditBookmarksMessageGotoNext *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+			g_value_set_object (value, msg->priv->view);
+			break;
+		case PROP_ITER:
+			g_value_set_boxed (value, msg->priv->iter);
+			break;
+	}
+}
+
+static void
+gedit_bookmarks_message_goto_next_set_property (GObject      *obj,
+                                                guint         prop_id,
+                                                GValue const *value,
+                                                GParamSpec   *pspec)
+{
+	GeditBookmarksMessageGotoNext *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+		{
+			if (msg->priv->view)
+			{
+				g_object_unref (msg->priv->view);
+			}
+			msg->priv->view = g_value_dup_object (value);
+			break;
+		}
+		case PROP_ITER:
+		{
+			if (msg->priv->iter)
+			{
+				g_boxed_free (GTK_TYPE_TEXT_ITER, msg->priv->iter);
+			}
+			msg->priv->iter = g_boxed_copy (GTK_TYPE_TEXT_ITER, value);
+			break;
+		}
+	}
+}
+
+static void
+gedit_bookmarks_message_goto_next_class_init (GeditBookmarksMessageGotoNextClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+	object_class->finalize = gedit_bookmarks_message_goto_next_finalize;
+
+	object_class->get_property = gedit_bookmarks_message_goto_next_get_property;
+	object_class->set_property = gedit_bookmarks_message_goto_next_set_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_VIEW,
+	                                 g_param_spec_object ("view",
+	                                                      "View",
+	                                                      "View",
+	                                                      GEDIT_TYPE_VIEW,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ITER,
+	                                 g_param_spec_boxed ("iter",
+	                                                      "Iter",
+	                                                      "Iter",
+	                                                      GTK_TYPE_TEXT_ITER,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof (GeditBookmarksMessageGotoNextPrivate));
+}
+
+static void
+gedit_bookmarks_message_goto_next_init (GeditBookmarksMessageGotoNext *message)
+{
+	message->priv = GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_GET_PRIVATE (message);
+}
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.h b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.h
new file mode 100644
index 0000000..e378473
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-next.h
@@ -0,0 +1,68 @@
+/*
+ * gedit-bookmarks-message-goto-next.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_H__
+#define __GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT            (gedit_bookmarks_message_goto_next_get_type ())
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT,\
+                                                           GeditBookmarksMessageGotoNext))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT,\
+                                                           GeditBookmarksMessageGotoNext const))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT,\
+                                                           GeditBookmarksMessageGotoNextClass))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_GOTO_NEXT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_GOTO_NEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                           GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_NEXT,\
+                                                           GeditBookmarksMessageGotoNextClass))
+
+typedef struct _GeditBookmarksMessageGotoNext        GeditBookmarksMessageGotoNext;
+typedef struct _GeditBookmarksMessageGotoNextClass   GeditBookmarksMessageGotoNextClass;
+typedef struct _GeditBookmarksMessageGotoNextPrivate GeditBookmarksMessageGotoNextPrivate;
+
+struct _GeditBookmarksMessageGotoNext
+{
+	GeditMessage parent;
+
+	GeditBookmarksMessageGotoNextPrivate *priv;
+};
+
+struct _GeditBookmarksMessageGotoNextClass
+{
+	GeditMessageClass parent_class;
+};
+
+GType gedit_bookmarks_message_goto_next_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGE_GOTO_NEXT_H__ */
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.c b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.c
new file mode 100644
index 0000000..8ba41cd
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.c
@@ -0,0 +1,153 @@
+/*
+ * gedit-bookmarks-message-goto-previous.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-view.h>
+#include "gedit-bookmarks-message-goto-previous.h"
+
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS, GeditBookmarksMessageGotoPreviousPrivate))
+
+enum
+{
+	PROP_0,
+
+	PROP_VIEW,
+	PROP_ITER,
+};
+
+struct _GeditBookmarksMessageGotoPreviousPrivate
+{
+	GeditView *view;
+	GtkTextIter *iter;
+};
+
+G_DEFINE_TYPE (GeditBookmarksMessageGotoPrevious, gedit_bookmarks_message_goto_previous, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_bookmarks_message_goto_previous_finalize (GObject *obj)
+{
+	GeditBookmarksMessageGotoPrevious *msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS (obj);
+
+	if (msg->priv->view)
+	{
+		g_object_unref (msg->priv->view);
+	}
+	if (msg->priv->iter)
+	{
+		g_object_unref (msg->priv->iter);
+	}
+
+	G_OBJECT_CLASS (gedit_bookmarks_message_goto_previous_parent_class)->finalize (obj);
+}
+
+static void
+gedit_bookmarks_message_goto_previous_get_property (GObject    *obj,
+                                                    guint       prop_id,
+                                                    GValue     *value,
+                                                    GParamSpec *pspec)
+{
+	GeditBookmarksMessageGotoPrevious *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+			g_value_set_object (value, msg->priv->view);
+			break;
+		case PROP_ITER:
+			g_value_set_boxed (value, msg->priv->iter);
+			break;
+	}
+}
+
+static void
+gedit_bookmarks_message_goto_previous_set_property (GObject      *obj,
+                                                    guint         prop_id,
+                                                    GValue const *value,
+                                                    GParamSpec   *pspec)
+{
+	GeditBookmarksMessageGotoPrevious *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+		{
+			if (msg->priv->view)
+			{
+				g_object_unref (msg->priv->view);
+			}
+			msg->priv->view = g_value_dup_object (value);
+			break;
+		}
+		case PROP_ITER:
+		{
+			if (msg->priv->iter)
+			{
+				g_boxed_free (GTK_TYPE_TEXT_ITER, msg->priv->iter);
+			}
+			msg->priv->iter = g_boxed_copy (GTK_TYPE_TEXT_ITER, value);
+			break;
+		}
+	}
+}
+
+static void
+gedit_bookmarks_message_goto_previous_class_init (GeditBookmarksMessageGotoPreviousClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+	object_class->finalize = gedit_bookmarks_message_goto_previous_finalize;
+
+	object_class->get_property = gedit_bookmarks_message_goto_previous_get_property;
+	object_class->set_property = gedit_bookmarks_message_goto_previous_set_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_VIEW,
+	                                 g_param_spec_object ("view",
+	                                                      "View",
+	                                                      "View",
+	                                                      GEDIT_TYPE_VIEW,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ITER,
+	                                 g_param_spec_boxed ("iter",
+	                                                      "Iter",
+	                                                      "Iter",
+	                                                      GTK_TYPE_TEXT_ITER,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof (GeditBookmarksMessageGotoPreviousPrivate));
+}
+
+static void
+gedit_bookmarks_message_goto_previous_init (GeditBookmarksMessageGotoPrevious *message)
+{
+	message->priv = GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_GET_PRIVATE (message);
+}
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.h b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.h
new file mode 100644
index 0000000..5073c94
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-goto-previous.h
@@ -0,0 +1,68 @@
+/*
+ * gedit-bookmarks-message-goto-previous.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_H__
+#define __GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS            (gedit_bookmarks_message_goto_previous_get_type ())
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS,\
+                                                               GeditBookmarksMessageGotoPrevious))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS,\
+                                                               GeditBookmarksMessageGotoPrevious const))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS,\
+                                                               GeditBookmarksMessageGotoPreviousClass))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_GOTO_PREVIOUS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS))
+#define GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                               GEDIT_TYPE_BOOKMARKS_MESSAGE_GOTO_PREVIOUS,\
+                                                               GeditBookmarksMessageGotoPreviousClass))
+
+typedef struct _GeditBookmarksMessageGotoPrevious        GeditBookmarksMessageGotoPrevious;
+typedef struct _GeditBookmarksMessageGotoPreviousClass   GeditBookmarksMessageGotoPreviousClass;
+typedef struct _GeditBookmarksMessageGotoPreviousPrivate GeditBookmarksMessageGotoPreviousPrivate;
+
+struct _GeditBookmarksMessageGotoPrevious
+{
+	GeditMessage parent;
+
+	GeditBookmarksMessageGotoPreviousPrivate *priv;
+};
+
+struct _GeditBookmarksMessageGotoPreviousClass
+{
+	GeditMessageClass parent_class;
+};
+
+GType gedit_bookmarks_message_goto_previous_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGE_GOTO_PREVIOUS_H__ */
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-remove.c b/plugins/bookmarks/messages/gedit-bookmarks-message-remove.c
new file mode 100644
index 0000000..c4ed0f4
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-remove.c
@@ -0,0 +1,153 @@
+/*
+ * gedit-bookmarks-message-remove.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-view.h>
+#include "gedit-bookmarks-message-remove.h"
+
+#define GEDIT_BOOKMARKS_MESSAGE_REMOVE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE, GeditBookmarksMessageRemovePrivate))
+
+enum
+{
+	PROP_0,
+
+	PROP_VIEW,
+	PROP_ITER,
+};
+
+struct _GeditBookmarksMessageRemovePrivate
+{
+	GeditView *view;
+	GtkTextIter *iter;
+};
+
+G_DEFINE_TYPE (GeditBookmarksMessageRemove, gedit_bookmarks_message_remove, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_bookmarks_message_remove_finalize (GObject *obj)
+{
+	GeditBookmarksMessageRemove *msg = GEDIT_BOOKMARKS_MESSAGE_REMOVE (obj);
+
+	if (msg->priv->view)
+	{
+		g_object_unref (msg->priv->view);
+	}
+	if (msg->priv->iter)
+	{
+		g_object_unref (msg->priv->iter);
+	}
+
+	G_OBJECT_CLASS (gedit_bookmarks_message_remove_parent_class)->finalize (obj);
+}
+
+static void
+gedit_bookmarks_message_remove_get_property (GObject    *obj,
+                                             guint       prop_id,
+                                             GValue     *value,
+                                             GParamSpec *pspec)
+{
+	GeditBookmarksMessageRemove *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_REMOVE (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+			g_value_set_object (value, msg->priv->view);
+			break;
+		case PROP_ITER:
+			g_value_set_boxed (value, msg->priv->iter);
+			break;
+	}
+}
+
+static void
+gedit_bookmarks_message_remove_set_property (GObject      *obj,
+                                             guint         prop_id,
+                                             GValue const *value,
+                                             GParamSpec   *pspec)
+{
+	GeditBookmarksMessageRemove *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_REMOVE (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+		{
+			if (msg->priv->view)
+			{
+				g_object_unref (msg->priv->view);
+			}
+			msg->priv->view = g_value_dup_object (value);
+			break;
+		}
+		case PROP_ITER:
+		{
+			if (msg->priv->iter)
+			{
+				g_boxed_free (GTK_TYPE_TEXT_ITER, msg->priv->iter);
+			}
+			msg->priv->iter = g_boxed_copy (GTK_TYPE_TEXT_ITER, value);
+			break;
+		}
+	}
+}
+
+static void
+gedit_bookmarks_message_remove_class_init (GeditBookmarksMessageRemoveClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+	object_class->finalize = gedit_bookmarks_message_remove_finalize;
+
+	object_class->get_property = gedit_bookmarks_message_remove_get_property;
+	object_class->set_property = gedit_bookmarks_message_remove_set_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_VIEW,
+	                                 g_param_spec_object ("view",
+	                                                      "View",
+	                                                      "View",
+	                                                      GEDIT_TYPE_VIEW,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ITER,
+	                                 g_param_spec_boxed ("iter",
+	                                                      "Iter",
+	                                                      "Iter",
+	                                                      GTK_TYPE_TEXT_ITER,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof (GeditBookmarksMessageRemovePrivate));
+}
+
+static void
+gedit_bookmarks_message_remove_init (GeditBookmarksMessageRemove *message)
+{
+	message->priv = GEDIT_BOOKMARKS_MESSAGE_REMOVE_GET_PRIVATE (message);
+}
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-remove.h b/plugins/bookmarks/messages/gedit-bookmarks-message-remove.h
new file mode 100644
index 0000000..d3e420a
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-remove.h
@@ -0,0 +1,68 @@
+/*
+ * gedit-bookmarks-message-remove.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_BOOKMARKS_MESSAGE_REMOVE_H__
+#define __GEDIT_BOOKMARKS_MESSAGE_REMOVE_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE            (gedit_bookmarks_message_remove_get_type ())
+#define GEDIT_BOOKMARKS_MESSAGE_REMOVE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE,\
+                                                        GeditBookmarksMessageRemove))
+#define GEDIT_BOOKMARKS_MESSAGE_REMOVE_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE,\
+                                                        GeditBookmarksMessageRemove const))
+#define GEDIT_BOOKMARKS_MESSAGE_REMOVE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE,\
+                                                        GeditBookmarksMessageRemoveClass))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_REMOVE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_REMOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE))
+#define GEDIT_BOOKMARKS_MESSAGE_REMOVE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_REMOVE,\
+                                                        GeditBookmarksMessageRemoveClass))
+
+typedef struct _GeditBookmarksMessageRemove        GeditBookmarksMessageRemove;
+typedef struct _GeditBookmarksMessageRemoveClass   GeditBookmarksMessageRemoveClass;
+typedef struct _GeditBookmarksMessageRemovePrivate GeditBookmarksMessageRemovePrivate;
+
+struct _GeditBookmarksMessageRemove
+{
+	GeditMessage parent;
+
+	GeditBookmarksMessageRemovePrivate *priv;
+};
+
+struct _GeditBookmarksMessageRemoveClass
+{
+	GeditMessageClass parent_class;
+};
+
+GType gedit_bookmarks_message_remove_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGE_REMOVE_H__ */
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.c b/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.c
new file mode 100644
index 0000000..26d1b83
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.c
@@ -0,0 +1,153 @@
+/*
+ * gedit-bookmarks-message-toggle.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-view.h>
+#include "gedit-bookmarks-message-toggle.h"
+
+#define GEDIT_BOOKMARKS_MESSAGE_TOGGLE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE, GeditBookmarksMessageTogglePrivate))
+
+enum
+{
+	PROP_0,
+
+	PROP_VIEW,
+	PROP_ITER,
+};
+
+struct _GeditBookmarksMessageTogglePrivate
+{
+	GeditView *view;
+	GtkTextIter *iter;
+};
+
+G_DEFINE_TYPE (GeditBookmarksMessageToggle, gedit_bookmarks_message_toggle, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_bookmarks_message_toggle_finalize (GObject *obj)
+{
+	GeditBookmarksMessageToggle *msg = GEDIT_BOOKMARKS_MESSAGE_TOGGLE (obj);
+
+	if (msg->priv->view)
+	{
+		g_object_unref (msg->priv->view);
+	}
+	if (msg->priv->iter)
+	{
+		g_object_unref (msg->priv->iter);
+	}
+
+	G_OBJECT_CLASS (gedit_bookmarks_message_toggle_parent_class)->finalize (obj);
+}
+
+static void
+gedit_bookmarks_message_toggle_get_property (GObject    *obj,
+                                             guint       prop_id,
+                                             GValue     *value,
+                                             GParamSpec *pspec)
+{
+	GeditBookmarksMessageToggle *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_TOGGLE (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+			g_value_set_object (value, msg->priv->view);
+			break;
+		case PROP_ITER:
+			g_value_set_boxed (value, msg->priv->iter);
+			break;
+	}
+}
+
+static void
+gedit_bookmarks_message_toggle_set_property (GObject      *obj,
+                                             guint         prop_id,
+                                             GValue const *value,
+                                             GParamSpec   *pspec)
+{
+	GeditBookmarksMessageToggle *msg;
+
+	msg = GEDIT_BOOKMARKS_MESSAGE_TOGGLE (obj);
+
+	switch (prop_id)
+	{
+		case PROP_VIEW:
+		{
+			if (msg->priv->view)
+			{
+				g_object_unref (msg->priv->view);
+			}
+			msg->priv->view = g_value_dup_object (value);
+			break;
+		}
+		case PROP_ITER:
+		{
+			if (msg->priv->iter)
+			{
+				g_boxed_free (GTK_TYPE_TEXT_ITER, msg->priv->iter);
+			}
+			msg->priv->iter = g_boxed_copy (GTK_TYPE_TEXT_ITER, value);
+			break;
+		}
+	}
+}
+
+static void
+gedit_bookmarks_message_toggle_class_init (GeditBookmarksMessageToggleClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+	object_class->finalize = gedit_bookmarks_message_toggle_finalize;
+
+	object_class->get_property = gedit_bookmarks_message_toggle_get_property;
+	object_class->set_property = gedit_bookmarks_message_toggle_set_property;
+
+	g_object_class_install_property (object_class,
+	                                 PROP_VIEW,
+	                                 g_param_spec_object ("view",
+	                                                      "View",
+	                                                      "View",
+	                                                      GEDIT_TYPE_VIEW,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_object_class_install_property (object_class,
+	                                 PROP_ITER,
+	                                 g_param_spec_boxed ("iter",
+	                                                      "Iter",
+	                                                      "Iter",
+	                                                      GTK_TYPE_TEXT_ITER,
+	                                                      G_PARAM_READWRITE |
+	                                                      G_PARAM_CONSTRUCT |
+	                                                      G_PARAM_STATIC_STRINGS));
+
+	g_type_class_add_private (object_class, sizeof (GeditBookmarksMessageTogglePrivate));
+}
+
+static void
+gedit_bookmarks_message_toggle_init (GeditBookmarksMessageToggle *message)
+{
+	message->priv = GEDIT_BOOKMARKS_MESSAGE_TOGGLE_GET_PRIVATE (message);
+}
diff --git a/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.h b/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.h
new file mode 100644
index 0000000..2194627
--- /dev/null
+++ b/plugins/bookmarks/messages/gedit-bookmarks-message-toggle.h
@@ -0,0 +1,68 @@
+/*
+ * gedit-bookmarks-message-toggle.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2011 - Paolo Borelli
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_BOOKMARKS_MESSAGE_TOGGLE_H__
+#define __GEDIT_BOOKMARKS_MESSAGE_TOGGLE_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE            (gedit_bookmarks_message_toggle_get_type ())
+#define GEDIT_BOOKMARKS_MESSAGE_TOGGLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE,\
+                                                        GeditBookmarksMessageToggle))
+#define GEDIT_BOOKMARKS_MESSAGE_TOGGLE_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE,\
+                                                        GeditBookmarksMessageToggle const))
+#define GEDIT_BOOKMARKS_MESSAGE_TOGGLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE,\
+                                                        GeditBookmarksMessageToggleClass))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_TOGGLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE))
+#define GEDIT_IS_BOOKMARKS_MESSAGE_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE))
+#define GEDIT_BOOKMARKS_MESSAGE_TOGGLE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                        GEDIT_TYPE_BOOKMARKS_MESSAGE_TOGGLE,\
+                                                        GeditBookmarksMessageToggleClass))
+
+typedef struct _GeditBookmarksMessageToggle        GeditBookmarksMessageToggle;
+typedef struct _GeditBookmarksMessageToggleClass   GeditBookmarksMessageToggleClass;
+typedef struct _GeditBookmarksMessageTogglePrivate GeditBookmarksMessageTogglePrivate;
+
+struct _GeditBookmarksMessageToggle
+{
+	GeditMessage parent;
+
+	GeditBookmarksMessageTogglePrivate *priv;
+};
+
+struct _GeditBookmarksMessageToggleClass
+{
+	GeditMessageClass parent_class;
+};
+
+GType gedit_bookmarks_message_toggle_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGE_TOGGLE_H__ */
diff --git a/plugins/bookmarks/messages/messages.h b/plugins/bookmarks/messages/messages.h
new file mode 100644
index 0000000..d5c76bb
--- /dev/null
+++ b/plugins/bookmarks/messages/messages.h
@@ -0,0 +1,10 @@
+#ifndef __GEDIT_BOOKMARKS_MESSAGES_MESSAGES_H__
+#define __GEDIT_BOOKMARKS_MESSAGES_MESSAGES_H__
+
+#include "gedit-bookmarks-message-add.h"
+#include "gedit-bookmarks-message-goto-next.h"
+#include "gedit-bookmarks-message-goto-previous.h"
+#include "gedit-bookmarks-message-remove.h"
+#include "gedit-bookmarks-message-toggle.h"
+
+#endif /* __GEDIT_BOOKMARKS_MESSAGES_MESSAGES_H__ */



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