Index: ChangeLog
===================================================================
--- ChangeLog	(Revision 1768)
+++ ChangeLog	(Arbeitskopie)
@@ -1,3 +1,33 @@
+2007-11-19  Johannes Schmid <jhs@gnome.org>
+
+	* gtksourceview/Makefile.am:
+	* gtksourceview/gtksourcebuffer.c: (gtk_source_buffer_class_init),
+	(gtk_source_buffer_init), (gtk_source_buffer_finalize),
+	(gtk_source_buffer_move_cursor),
+	(gtk_source_buffer_real_insert_text),
+	(gtk_source_buffer_real_delete_range), (compare_marker),
+	(gtk_source_buffer_mark_set), (gtk_source_buffer_mark_deleted),
+	(gtk_source_buffer_create_marker),
+	(gtk_source_buffer_get_markers_in_region),
+	(gtk_source_buffer_get_first_marker),
+	(gtk_source_buffer_get_last_marker),
+	(gtk_source_buffer_get_next_marker),
+	(gtk_source_buffer_get_prev_marker):
+	* gtksourceview/gtksourcebuffer.h:
+	* gtksourceview/gtksourcemark.c: (gtk_source_mark_init),
+	(gtk_source_mark_finalize), (gtk_source_mark_set_property),
+	(gtk_source_mark_get_property), (gtk_source_mark_clicked),
+	(gtk_source_mark_class_init), (gtk_source_mark_new),
+	(gtk_source_mark_get_marker_type), (gtk_source_mark_changed):
+	* gtksourceview/gtksourcemark.h:
+	* gtksourceview/gtksourcemarker.c:
+	* gtksourceview/gtksourcemarker.h:
+	* gtksourceview/gtksourceview.c: (marker_updated_cb),
+	(draw_line_markers), (gtk_source_view_paint_margin):
+	* tests/test-widget.c: (remove_all_markers), (button_press_cb):
+	
+	Added new GtkSourceMark API (#487098)
+
 2007-11-16  Steve Frécinaux  <code@istique.net>
 
 	* gtksourceview/language-specs/php.lang: fix highlighting of null,
Index: docs/reference/tmpl/languagemanager.sgml
===================================================================
--- docs/reference/tmpl/languagemanager.sgml	(Revision 1768)
+++ docs/reference/tmpl/languagemanager.sgml	(Arbeitskopie)
@@ -59,24 +59,6 @@
 @dirs: 
 
 
-<!-- ##### FUNCTION gtk_source_language_manager_get_search_path ##### -->
-<para>
-
-</para>
-
-@lm: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_language_manager_get_language_ids ##### -->
-<para>
-
-</para>
-
-@lm: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gtk_source_language_manager_get_language ##### -->
 <para>
 
Index: docs/reference/tmpl/marker.sgml
===================================================================
--- docs/reference/tmpl/marker.sgml	(Revision 1768)
+++ docs/reference/tmpl/marker.sgml	(Arbeitskopie)
@@ -17,78 +17,3 @@
 <!-- ##### SECTION Stability_Level ##### -->
 
 
-<!-- ##### TYPEDEF GtkSourceMarker ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### TYPEDEF GtkSourceMarkerClass ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### FUNCTION gtk_source_marker_get_buffer ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_get_name ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_get_line ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_set_marker_type ##### -->
-<para>
-
-</para>
-
-@marker: 
-@type: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_get_marker_type ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_next ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
-<!-- ##### FUNCTION gtk_source_marker_prev ##### -->
-<para>
-
-</para>
-
-@marker: 
-@Returns: 
-
-
Index: docs/reference/tmpl/stylescheme.sgml
===================================================================
--- docs/reference/tmpl/stylescheme.sgml	(Revision 1768)
+++ docs/reference/tmpl/stylescheme.sgml	(Arbeitskopie)
@@ -254,15 +254,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_source_style_scheme_get_authors ##### -->
-<para>
-
-</para>
-
-@scheme: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gtk_source_style_scheme_get_filename ##### -->
 <para>
 
Index: docs/reference/tmpl/buffer.sgml
===================================================================
--- docs/reference/tmpl/buffer.sgml	(Revision 1768)
+++ docs/reference/tmpl/buffer.sgml	(Arbeitskopie)
@@ -276,29 +276,11 @@
 @buffer: 
 @name: 
 @type: 
+@priority: 
 @where: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_source_buffer_delete_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@marker: 
-
-
-<!-- ##### FUNCTION gtk_source_buffer_move_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@marker: 
-@where: 
-
-
 <!-- ##### FUNCTION gtk_source_buffer_get_first_marker ##### -->
 <para>
 
@@ -317,16 +299,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_source_buffer_get_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@name: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gtk_source_buffer_get_markers_in_region ##### -->
 <para>
 
@@ -344,7 +316,7 @@
 </para>
 
 @buffer: 
-@iter: 
+@mark: 
 @Returns: 
 
 
@@ -354,20 +326,10 @@
 </para>
 
 @buffer: 
-@iter: 
+@mark: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_source_buffer_get_iter_at_marker ##### -->
-<para>
-
-</para>
-
-@buffer: 
-@iter: 
-@marker: 
-
-
 <!-- ##### FUNCTION gtk_source_buffer_ensure_highlight ##### -->
 <para>
 
Index: docs/reference/tmpl/view.sgml
===================================================================
--- docs/reference/tmpl/view.sgml	(Revision 1768)
+++ docs/reference/tmpl/view.sgml	(Arbeitskopie)
@@ -228,7 +228,7 @@
 </para>
 
 @view: 
-@marker_type: 
+@category: 
 @pixbuf: 
 
 
@@ -238,7 +238,7 @@
 </para>
 
 @view: 
-@marker_type: 
+@category: 
 @Returns: 
 
 
Index: gtksourceview/gtksourcemarker.c
===================================================================
--- gtksourceview/gtksourcemarker.c	(Revision 1768)
+++ gtksourceview/gtksourcemarker.c	(Arbeitskopie)
@@ -1,257 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- *  gtksourcemarker.c
- *
- *  Copyright (C) 2003 - Gustavo Giráldez <gustavo.giraldez@gmx.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Library General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program 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 Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gtksourcebuffer.h"
-#include "gtksourcemarker.h"
-
-static GQuark quark_marker_type = 0;
-static GQuark quark_next_marker = 0;
-static GQuark quark_prev_marker = 0;
-
-
-GType
-gtk_source_marker_get_type (void)
-{
-	static GType our_type = 0;
-
-	/* this function's solely purpose is to allow us to later
-	 * derive GtkSourceMarker from other base object and not break
-	 * ABI compatibility (since this way the type is resolved at
-	 * runtime) */
-	if (!our_type) {
-		our_type = GTK_TYPE_TEXT_MARK;
-
-		quark_marker_type = g_quark_from_static_string ("gtk-source-marker-type");
-		quark_next_marker = g_quark_from_static_string ("gtk-source-marker-next");
-		quark_prev_marker = g_quark_from_static_string ("gtk-source-marker-prev");
-	}
-
-	return our_type;
-}
-
-void
-gtk_source_marker_set_marker_type (GtkSourceMarker *marker,
-				   const gchar     *type)
-{
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-
-	g_object_set_qdata_full (G_OBJECT (marker), quark_marker_type,
-				 g_strdup (type), (GDestroyNotify) g_free);
-	_gtk_source_marker_changed (marker);
-}
-
-/**
- * gtk_source_marker_get_marker_type:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the marker type of this @marker.
- *
- * Return value: the marker type.
- **/
-gchar *
-gtk_source_marker_get_marker_type (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_strdup (g_object_get_qdata (G_OBJECT (marker), quark_marker_type));
-}
-
-/**
- * gtk_source_marker_get_line:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the line number of this @marker.
- *
- * Return value: the line number.
- **/
-gint
-gtk_source_marker_get_line (GtkSourceMarker *marker)
-{
-	GtkTextIter iter;
-
-	g_return_val_if_fail (marker != NULL, -1);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), -1);
-	g_return_val_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)), -1);
-
-	gtk_text_buffer_get_iter_at_mark (gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker)),
-					  &iter, GTK_TEXT_MARK (marker));
-
-	return gtk_text_iter_get_line (&iter);
-}
-
-/**
- * gtk_source_marker_get_name:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the name of this @marker.
- *
- * Return value: the name.
- **/
-const gchar *
-gtk_source_marker_get_name (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return gtk_text_mark_get_name (GTK_TEXT_MARK (marker));
-}
-
-/**
- * gtk_source_marker_get_buffer:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the buffer associated with this @marker.
- *
- * Return value: the #GtkSourceBuffer.
- **/
-gpointer
-gtk_source_marker_get_buffer (GtkSourceMarker *marker)
-{
-	GtkTextBuffer *buffer;
-
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	buffer = gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker));
-
-	if (GTK_IS_SOURCE_BUFFER (buffer))
-		return buffer;
-	else
-		return NULL;
-}
-
-void
-_gtk_source_marker_changed (GtkSourceMarker *marker)
-{
-	GtkSourceBuffer *buffer;
-	GtkTextIter iter;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	buffer = GTK_SOURCE_BUFFER (gtk_text_mark_get_buffer (GTK_TEXT_MARK (marker)));
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (marker));
-	gtk_text_iter_set_line_offset (&iter, 0);
-
-	g_signal_emit_by_name (buffer, "marker_updated", &iter);
-}
-
-void
-_gtk_source_marker_link (GtkSourceMarker *marker,
-			 GtkSourceMarker *sibling,
-			 gboolean         after_sibling)
-{
-	GtkSourceMarker *tmp;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	if (!sibling)
-		return;
-
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (sibling));
-
-	if (after_sibling)
-	{
-		tmp = g_object_get_qdata (G_OBJECT (sibling), quark_next_marker);
-
-		g_object_set_qdata (G_OBJECT (marker), quark_next_marker, tmp);
-		g_object_set_qdata (G_OBJECT (marker), quark_prev_marker, sibling);
-
-		g_object_set_qdata (G_OBJECT (sibling), quark_next_marker, marker);
-		if (tmp)
-			g_object_set_qdata (G_OBJECT (tmp), quark_prev_marker, marker);
-	}
-	else
-	{
-		tmp = g_object_get_qdata (G_OBJECT (sibling), quark_prev_marker);
-
-		g_object_set_qdata (G_OBJECT (marker), quark_next_marker, sibling);
-		g_object_set_qdata (G_OBJECT (marker), quark_prev_marker, tmp);
-
-		g_object_set_qdata (G_OBJECT (sibling), quark_prev_marker, marker);
-		if (tmp)
-			g_object_set_qdata (G_OBJECT (tmp), quark_next_marker, marker);
-	}
-}
-
-void
-_gtk_source_marker_unlink (GtkSourceMarker *marker)
-{
-	GtkSourceMarker *m1, *m2;
-
-	g_return_if_fail (marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	m1 = g_object_steal_qdata (G_OBJECT (marker), quark_prev_marker);
-	m2 = g_object_steal_qdata (G_OBJECT (marker), quark_next_marker);
-
-	if (m1)
-		g_object_set_qdata (G_OBJECT (m1), quark_next_marker, m2);
-	if (m2)
-		g_object_set_qdata (G_OBJECT (m2), quark_prev_marker, m1);
-}
-
-/**
- * gtk_source_marker_next:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the next marker after @marker.
- *
- * Return value: a #GtkSourceMarker.
- **/
-GtkSourceMarker *
-gtk_source_marker_next (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_object_get_qdata (G_OBJECT (marker), quark_next_marker);
-}
-
-/**
- * gtk_source_marker_prev:
- * @marker: a #GtkSourceMarker.
- *
- * Gets the previous marker before @marker.
- *
- * Return value: a #GtkSourceMarker.
- **/
-GtkSourceMarker *
-gtk_source_marker_prev (GtkSourceMarker *marker)
-{
-	g_return_val_if_fail (marker != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_MARKER (marker), NULL);
-
-	return g_object_get_qdata (G_OBJECT (marker), quark_prev_marker);
-}
-
Index: gtksourceview/gtksourcemarker.h
===================================================================
--- gtksourceview/gtksourcemarker.h	(Revision 1768)
+++ gtksourceview/gtksourcemarker.h	(Arbeitskopie)
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- *  gtksourcemarker.h
- *
- *  Copyright (C) 2003 - Gustavo Giráldez <gustavo.giraldez@gmx.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Library General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program 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 Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GTK_SOURCE_MARKER_H__
-#define __GTK_SOURCE_MARKER_H__
-
-#include <gtk/gtktextmark.h>
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SOURCE_MARKER            (gtk_source_marker_get_type ())
-#define GTK_SOURCE_MARKER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOURCE_MARKER, GtkSourceMarker))
-#define GTK_SOURCE_MARKER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_MARKER, GtkSourceMarkerClass))
-#define GTK_IS_SOURCE_MARKER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOURCE_MARKER))
-#define GTK_IS_SOURCE_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_MARKER))
-#define GTK_SOURCE_MARKER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOURCE_MARKER, GtkSourceMarkerClass))
-
-typedef GtkTextMark      GtkSourceMarker;
-typedef GtkTextMarkClass GtkSourceMarkerClass;
-
-GType                 gtk_source_marker_get_type        (void) G_GNUC_CONST;
-
-void                  gtk_source_marker_set_marker_type (GtkSourceMarker *marker,
-							 const gchar     *type);
-gchar                *gtk_source_marker_get_marker_type (GtkSourceMarker *marker);
-gint                  gtk_source_marker_get_line        (GtkSourceMarker *marker);
-const gchar	     *gtk_source_marker_get_name        (GtkSourceMarker *marker);
-/* FIXME: move GtkSourceMarker declaration to gtktextbuffer.h? */
-gpointer	      gtk_source_marker_get_buffer      (GtkSourceMarker *marker);
-GtkSourceMarker      *gtk_source_marker_next            (GtkSourceMarker *marker);
-GtkSourceMarker      *gtk_source_marker_prev            (GtkSourceMarker *marker);
-
-/* Private API */
-void                  _gtk_source_marker_changed        (GtkSourceMarker *marker);
-void                  _gtk_source_marker_link           (GtkSourceMarker *marker,
-							 GtkSourceMarker *sibling,
-							 gboolean         after_sibling);
-void                  _gtk_source_marker_unlink         (GtkSourceMarker *marker);
-
-G_END_DECLS
-
-#endif
Index: gtksourceview/gtksourcemark.c
===================================================================
--- gtksourceview/gtksourcemark.c	(Revision 0)
+++ gtksourceview/gtksourcemark.c	(Revision 0)
@@ -0,0 +1,179 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *  gtksourcebuffer.c
+ *
+ *  Copyright (C) 2007 by:
+ *		Johannes Schmid <jhs@gnome.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "gtksourcemark.h"
+
+enum
+{
+	PROP_0,
+	PROP_TOOLTIP,
+	PROP_PRIORITY,
+	PROP_CATEGORY
+};
+
+typedef struct _GtkSourceMarkPriv GtkSourceMarkPriv;
+
+struct _GtkSourceMarkPriv
+{
+	gchar* tooltip;
+	gchar* type;
+	guint priority;
+};
+
+#define GTK_SOURCE_MARK_GET_PRIV(o) \
+(G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_SOURCE_MARK, GtkSourceMarkPriv))
+
+G_DEFINE_TYPE (GtkSourceMark, gtk_source_mark, GTK_TYPE_TEXT_MARK);
+
+static void
+gtk_source_mark_init (GtkSourceMark *object)
+{
+	
+}
+
+static void
+gtk_source_mark_finalize (GObject *object)
+{
+	
+	G_OBJECT_CLASS (gtk_source_mark_parent_class)->finalize (object);
+}
+
+static void
+gtk_source_mark_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+	g_return_if_fail (GTK_IS_SOURCE_MARK (object));
+	
+	GtkSourceMarkPriv* priv = GTK_SOURCE_MARK_GET_PRIV (object);
+	
+	switch (prop_id)
+	{
+		case PROP_TOOLTIP:
+			g_free (priv->tooltip);
+			priv->tooltip = g_value_dup_string (value);
+			break;
+		case PROP_PRIORITY:
+			priv->priority = g_value_get_uint (value);
+			break;
+		case PROP_CATEGORY:
+			g_free (priv->type);
+			priv->type = g_value_dup_string (value);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+gtk_source_mark_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+	g_return_if_fail (GTK_IS_SOURCE_MARK (object));
+	
+	GtkSourceMarkPriv* priv = GTK_SOURCE_MARK_GET_PRIV (object);
+	
+	switch (prop_id)
+	{
+		case PROP_TOOLTIP:
+			g_value_set_string (value, priv->tooltip);
+			break;
+		case PROP_PRIORITY:
+			g_value_set_uint (value, priv->priority);
+			break;
+		case PROP_CATEGORY:
+			g_value_set_string (value, priv->type);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+gtk_source_mark_class_init (GtkSourceMarkClass *klass)
+{
+	GObjectClass* object_class = G_OBJECT_CLASS (klass);
+	
+	object_class->finalize = gtk_source_mark_finalize;
+	object_class->set_property = gtk_source_mark_set_property;
+	object_class->get_property = gtk_source_mark_get_property;
+	
+	g_type_class_add_private (object_class, sizeof (GtkSourceMarkPriv));
+	
+	g_object_class_install_property (object_class,
+					 PROP_CATEGORY,
+					 g_param_spec_string ("category",
+							      "category",
+							      "The marker category",
+							      "",
+							      G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+		
+	g_object_class_install_property (object_class,
+					 PROP_PRIORITY,
+					 g_param_spec_uint ("priority",
+							       "priority",
+							       "Priority of the GtkSouceMark, markers with higher priority will be drawn on top",
+							       0, G_MAXUINT, 0,
+							       G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+	
+	g_object_class_install_property (object_class,
+					 PROP_TOOLTIP,
+					 g_param_spec_string ("tooltip",
+							      "tooltip",
+							      "Tooltip to be shown when the mark hovers over the mark",
+							      "",
+							      G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
+}
+
+
+GtkSourceMark *
+gtk_source_mark_new (const gchar* name, const gchar* type, guint priority)
+{
+	return GTK_SOURCE_MARK (g_object_new (GTK_TYPE_SOURCE_MARK, 
+					    "category", type, 
+					    "name", name,
+					    "priority", priority,
+					    "left-gravity", TRUE,
+					    NULL));
+}
+
+const gchar *
+gtk_source_mark_get_category (GtkSourceMark* mark)
+{
+	g_return_val_if_fail (GTK_IS_SOURCE_MARK (mark), NULL);
+	gchar* type;
+	g_object_get (mark, "category", &type, NULL);
+	return type;
+}
+
+guint
+gtk_source_mark_get_priority (GtkSourceMark* mark)
+{
+	g_return_val_if_fail (GTK_IS_SOURCE_MARK (mark), 0);
+	guint priority;
+	g_object_get (mark, "priority", &priority, NULL);
+	return priority;
+}
+
+void 
+_gtk_source_mark_changed (GtkSourceMark* mark)
+{
+	GtkTextBuffer* buffer = gtk_text_mark_get_buffer (GTK_TEXT_MARK (mark));
+	if (buffer)
+		g_signal_emit_by_name (buffer, "marker_updated", mark);
+}
Index: gtksourceview/gtksourcemark.h
===================================================================
--- gtksourceview/gtksourcemark.h	(Revision 0)
+++ gtksourceview/gtksourcemark.h	(Revision 0)
@@ -0,0 +1,62 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *  gtksourcebuffer.c
+ *
+ *  Copyright (C) 2007 by:
+ *		Johannes Schmid <jhs@gnome.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Library General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTKSOURCEMARK_H__
+#define __GTKSOURCEMARK_H__
+
+#include <gtk/gtk.h>
+#include <gtk/gtktextmark.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_SOURCE_MARK             (gtk_source_mark_get_type ())
+#define GTK_SOURCE_MARK(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOURCE_MARK, GtkSourceMark))
+#define GTK_SOURCE_MARK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_MARK, GtkSourceMarkClass))
+#define GTK_IS_SOURCE_MARK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOURCE_MARK))
+#define GTK_IS_SOURCE_MARK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_MARK))
+#define GTK_SOURCE_MARK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOURCE_MARK, GtkSourceMarkClass))
+
+typedef struct _GtkSourceMarkClass GtkSourceMarkClass;
+typedef struct _GtkSourceMark GtkSourceMark;
+
+struct _GtkSourceMarkClass
+{
+	GtkTextMarkClass parent_class;
+};
+
+struct _GtkSourceMark
+{
+	GtkTextMark parent_instance;
+};
+
+GType gtk_source_mark_get_type (void) G_GNUC_CONST;
+GtkSourceMark* gtk_source_mark_new (const gchar* name, const gchar* type, guint priority);
+
+const gchar* gtk_source_mark_get_category (GtkSourceMark* mark);
+guint gtk_source_mark_get_priority (GtkSourceMark* mark);
+
+
+
+void _gtk_source_mark_changed (GtkSourceMark* mark);
+
+G_END_DECLS
+
+#endif /* __GTKSOURCEMARK_H__ */
Index: gtksourceview/gtksourcebuffer.c
===================================================================
--- gtksourceview/gtksourcebuffer.c	(Revision 1768)
+++ gtksourceview/gtksourcebuffer.c	(Arbeitskopie)
@@ -89,7 +89,7 @@
 	GtkTextMark           *bracket_mark;
 	guint                  bracket_found:1;
 
-	GArray                *markers;
+	GSequence             *markers;
 
 	GtkSourceLanguage     *language;
 
@@ -124,8 +124,7 @@
 
 static void 	 gtk_source_buffer_move_cursor		(GtkTextBuffer           *buffer,
 							 const GtkTextIter       *iter,
-							 GtkTextMark             *mark,
-							 gpointer                 data);
+							 GtkTextMark             *mark);
 
 static void 	 gtk_source_buffer_real_insert_text 	(GtkTextBuffer           *buffer,
 							 GtkTextIter             *iter,
@@ -135,6 +134,14 @@
 							 GtkTextIter             *iter,
 							 GtkTextIter             *end);
 
+static void 	 gtk_source_buffer_mark_set		(GtkTextBuffer		 *buffer,
+							 const GtkTextIter	 *location,
+							 GtkTextMark		 *mark);
+
+static void 	 gtk_source_buffer_mark_deleted		(GtkTextBuffer		 *buffer,
+							 GtkTextMark		 *mark);
+
+
 static gboolean	 gtk_source_buffer_find_bracket_match_with_limit (GtkTextIter    *orig,
 								  gint            max_chars);
 
@@ -157,6 +164,9 @@
 	 * that will cause problems (a loop). */
 	tb_class->insert_text 	= gtk_source_buffer_real_insert_text;
 	tb_class->delete_range 	= gtk_source_buffer_real_delete_range;
+	
+	tb_class->mark_set	= gtk_source_buffer_mark_set;
+	tb_class->mark_deleted	= gtk_source_buffer_mark_deleted;
 
 	/**
 	 * GtkSourceBuffer:highlight-syntax:
@@ -257,14 +267,14 @@
 			   2, param_types);
 
 	buffer_signals[MARKER_UPDATED] =
-	    g_signal_newv ("marker_updated",
+	    g_signal_new ("marker_updated",
 			   G_OBJECT_CLASS_TYPE (object_class),
 			   G_SIGNAL_RUN_LAST,
-			   NULL,
+			   0,
 			   NULL, NULL,
-			   _gtksourceview_marshal_VOID__BOXED,
+			   g_cclosure_marshal_VOID__OBJECT,
 			   G_TYPE_NONE,
-			   1, param_types);
+			   1, GTK_TYPE_TEXT_MARK);
 
 	g_type_class_add_private (object_class, sizeof(GtkSourceBufferPrivate));
 }
@@ -286,16 +296,12 @@
 	priv->bracket_mark = NULL;
 	priv->bracket_found = FALSE;
 
-	priv->markers = g_array_new (FALSE, FALSE, sizeof (GtkSourceMarker *));
+	priv->markers = g_sequence_new ((GDestroyNotify) g_object_unref);
 
 	priv->style_scheme = _gtk_source_style_scheme_get_default ();
 	if (priv->style_scheme != NULL)
 		g_object_ref (priv->style_scheme);
 
-	g_signal_connect (buffer,
-			  "mark_set",
-			  G_CALLBACK (gtk_source_buffer_move_cursor),
-			  NULL);
 	g_signal_connect (priv->undo_manager,
 			  "can_undo",
 			  G_CALLBACK (gtk_source_buffer_can_undo_handler),
@@ -318,7 +324,7 @@
 	g_return_if_fail (buffer->priv != NULL);
 
 	if (buffer->priv->markers)
-		g_array_free (buffer->priv->markers, TRUE);
+		g_sequence_free (buffer->priv->markers);
 
 	G_OBJECT_CLASS (gtk_source_buffer_parent_class)->finalize (object);
 }
@@ -551,8 +557,7 @@
 static void
 gtk_source_buffer_move_cursor (GtkTextBuffer     *buffer,
 			       const GtkTextIter *iter,
-			       GtkTextMark       *mark,
-			       gpointer           data)
+			       GtkTextMark       *mark)
 {
 	GtkTextIter iter1, iter2;
 
@@ -634,8 +639,7 @@
 
 	gtk_source_buffer_move_cursor (buffer,
 				       iter,
-				       gtk_text_buffer_get_insert (buffer),
-				       NULL);
+				       gtk_text_buffer_get_insert (buffer));
 
 	end_offset = gtk_text_iter_get_offset (iter);
 
@@ -673,8 +677,7 @@
 								   start, end);
 		while (markers)
 		{
-			gtk_source_buffer_delete_marker (GTK_SOURCE_BUFFER (buffer), markers->data);
-			markers = g_slist_delete_link (markers, markers);
+			gtk_text_buffer_delete_mark (buffer, markers->data);
 		}
 	}
 
@@ -685,8 +688,7 @@
 
 	gtk_source_buffer_move_cursor (buffer,
 				       &iter,
-				       mark,
-				       NULL);
+				       mark);
 
 	/* move any markers which moved to this line because of the
 	 * deletion to the beginning of the line */
@@ -701,8 +703,8 @@
 
 		gtk_text_iter_set_line_offset (&iter, 0);
 		for (m = markers; m; m = g_slist_next (m))
-			gtk_source_buffer_move_marker (GTK_SOURCE_BUFFER (buffer),
-						       GTK_SOURCE_MARKER (m->data),
+			gtk_text_buffer_move_mark (buffer,
+						       GTK_TEXT_MARK (m->data),
 						       &iter);
 		g_slist_free (markers);
 	}
@@ -1308,198 +1310,99 @@
 
 /* Markers functionality */
 
-/**
- * markers_binary_search:
- * @buffer: the GtkSourceBuffer where the markers are.
- * @iter: the position to search for.
- * @last_cmp: where to return the value of the last comparision made (optional).
- *
- * Performs a binary search among the markers in @buffer for the
- * position of the @iter.  Returns the nearest matching marker (its
- * index in the markers array) and optionally the value of the
- * comparision between the returned marker and the given iter.
- *
- * Return value: an index in the markers array or -1 if the array is
- * empty.
- **/
-static gint
-markers_binary_search (GtkSourceBuffer *buffer, GtkTextIter *iter, gint *last_cmp)
+static int 
+compare_marker (gconstpointer a, gconstpointer b, gpointer user_data)
 {
-	GtkTextIter check_iter;
-	GtkSourceMarker **check, **p;
-	GArray *markers = buffer->priv->markers;
-	gint n_markers = markers->len;
-	gint cmp, i;
+	GtkTextMark* mark1 = GTK_TEXT_MARK(a);
+	GtkTextMark* mark2 = GTK_TEXT_MARK(b);
+	GtkTextBuffer* buffer = GTK_TEXT_BUFFER (user_data);
+	GtkTextIter iter1;
+	GtkTextIter iter2;
+	int line1;
+	int line2;
+	
+	if (gtk_text_mark_get_deleted (mark1) || gtk_text_mark_get_deleted (mark2))
+	{
+		return 1;
+	}
 
-	if (n_markers == 0)
-		return -1;
+	
+	gtk_text_buffer_get_iter_at_mark (buffer, &iter1, mark1);
+	gtk_text_buffer_get_iter_at_mark (buffer, &iter2, mark2);
 
-	check = p = &g_array_index (markers, GtkSourceMarker *, 0);
-	p--;
-	cmp = 0;
-	while (n_markers)
+	line1 = gtk_text_iter_get_line(&iter1);
+	line2 = gtk_text_iter_get_line(&iter2);
+	
+	if (line1 > line2)
+		return 1;
+	else if (line1 < line2)
+		return -1;
+	else /* (line1 == line2) */
 	{
-		i = (n_markers + 1) >> 1;
-		check = p + i;
-		gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-						  &check_iter,
-						  GTK_TEXT_MARK (*check));
-		cmp = gtk_text_iter_compare (iter, &check_iter);
-		if (cmp > 0)
+		/* Check that the marks are equal so we can search savely */
+		if (mark1 == mark2)
 		{
-			n_markers -= i;
-			p = check;
+			return 0;
 		}
-		else if (cmp < 0)
-			n_markers = i - 1;
-		else /* if (cmp == 0) */
-			break;
+		int priority1 = gtk_source_mark_get_priority (GTK_SOURCE_MARK (mark1));
+		int priority2 = gtk_source_mark_get_priority (GTK_SOURCE_MARK (mark2));
+		if (priority1 < priority2)
+			return -1;
+		else if (priority1 == priority1)
+			return 0;
+		else
+			return 1;
 	}
-
-	i = check - &g_array_index (markers, GtkSourceMarker *, 0);
-	if (last_cmp)
-		*last_cmp = cmp;
-
-	return i;
 }
 
-/**
- * markers_linear_lookup:
- * @buffer: the source buffer where the markers are.
- * @marker: which marker to search for.
- * @start: index from where to start looking.
- * @direction: direction to search for.
- *
- * Searches the markers array of @buffer starting from @start for
- * markers at the same position as the one at @start.  If @marker is
- * non-%NULL search for that marker specifically, otherwise return the
- * first or the last marker at the staring position, depending on
- * @direction.
- *
- * @direction < 0 means left, @direction > 0 means right,
- * 0 means both and is mostly useful when looking for a specific
- * @marker.
- *
- * Return value: the index of the searched marker.
- **/
-static gint
-markers_linear_lookup (GtkSourceBuffer *buffer,
-		       GtkSourceMarker *marker,
-		       gint             start,
-		       gint             direction)
+static void
+gtk_source_buffer_mark_set		(GtkTextBuffer		 *buffer,
+					 const GtkTextIter	 *location,
+					 GtkTextMark		 *mark)
 {
-	GArray *markers = buffer->priv->markers;
-	gint left, right;
-	gint cmp;
-	GtkTextIter iter;
-	GtkSourceMarker *tmp;
-
-	tmp = g_array_index (markers, GtkSourceMarker *, start);
-	if (tmp == marker)
-		return start;
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (tmp));
-
-	if (direction == 0)
+	GSequenceIter* iter;
+	GtkSourceBuffer* sbuffer = GTK_SOURCE_BUFFER (buffer);
+	/* Ignore marks that are not source markers */
+	if (!GTK_IS_SOURCE_MARK (mark))
 	{
-		left = start - 1;
-		right = start + 1;
+		return;
 	}
-	else if (direction > 0)
+	/* Check if the mark was just moved and update the location */
+	iter = g_sequence_search (sbuffer->priv->markers, mark, compare_marker,
+				  sbuffer);
+	if (!g_sequence_iter_is_end (iter) && g_sequence_get (iter) == mark)
 	{
-		left = -1;
-		right = start + 1;
+		g_sequence_sort_changed (iter, compare_marker, buffer);
+		_gtk_source_mark_changed (GTK_SOURCE_MARK (mark));
+		return;
 	}
-	else
-	{
-		left = start - 1;
-		right = markers->len;
-	}
-
-	while (left >= 0 || right < markers->len)
-	{
-		GtkTextIter iter_tmp;
-
-		if (left >= 0)
-		{
-			tmp = g_array_index (markers, GtkSourceMarker *, left);
-			if (tmp == marker)
-				return left;
-
-			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-							  &iter_tmp,
-							  GTK_TEXT_MARK (tmp));
-			cmp = gtk_text_iter_compare (&iter, &iter_tmp);
-			if (cmp != 0)
-			{
-				if (marker)
-					/* searching for a particular marker */
-					left = -1;
-				else
-					/* searching for the first
-					 * marker at a given
-					 * position */
-					return left + 1;
-			} else
-				left--;
-		}
-
-		if (right < markers->len)
-		{
-			tmp = g_array_index (markers, GtkSourceMarker *, right);
-			if (tmp == marker)
-				return right;
-
-			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-							  &iter_tmp,
-							  GTK_TEXT_MARK (tmp));
-			cmp = gtk_text_iter_compare (&iter, &iter_tmp);
-			if (cmp != 0)
-			{
-				if (marker)
-					/* searching for a particular marker */
-					right = markers->len;
-				else
-					/* searching for the last
-					 * marker at a given
-					 * position */
-					return right - 1;
-			}
-			else
-				right++;
-		}
-	}
-	if (marker)
-		return -1;
-	else
-		return start;
+	/* Otherwise, insert new mark */
+	g_object_ref (G_OBJECT (mark));
+	g_sequence_insert_sorted (sbuffer->priv->markers,
+				  mark,
+				  compare_marker,
+				  sbuffer);
+	GTK_TEXT_BUFFER_CLASS(gtk_source_buffer_parent_class)->mark_set (buffer, location, mark);
+	_gtk_source_mark_changed (GTK_SOURCE_MARK (mark));
 }
 
-static void
-markers_insert (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
+static void 	 
+gtk_source_buffer_mark_deleted		(GtkTextBuffer		 *buffer,
+					 GtkTextMark		 *mark)
 {
-	GtkTextIter iter;
-	gint index, cmp;
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (marker));
-
-	index = markers_binary_search (buffer, &iter, &cmp);
-	if (index >= 0)
+	GSequenceIter* iter;
+	
+	iter = g_sequence_search (GTK_SOURCE_BUFFER (buffer)->priv->markers, mark, compare_marker,
+				  buffer);
+	if (!g_sequence_iter_is_end (iter) && g_sequence_get (iter) == mark)
 	{
-		_gtk_source_marker_link (marker, g_array_index (buffer->priv->markers,
-								GtkSourceMarker *,
-								index),	(cmp > 0));
-		if (cmp > 0)
-			index++;
+		g_sequence_remove (iter);
+		g_signal_emit_by_name (buffer, "marker_updated", mark);
+		g_object_unref (mark);
 	}
-	else
-		index = 0;
-
-	g_array_insert_val (buffer->priv->markers, index, marker);
+	
+	/* mark_deleted is NULL by default */
+	/*GTK_TEXT_BUFFER_CLASS(gtk_source_buffer_parent_class)->mark_deleted (buffer, mark);*/
 }
 
 /**
@@ -1507,6 +1410,8 @@
  * @buffer: a #GtkSourceBuffer.
  * @name: the name of the marker, or %NULL.
  * @type: a string defining the marker type, or %NULL.
+ * @priority: the marker priority. The marker with the highest priority 
+ *            will be drawn on top
  * @where: location to place the marker.
  *
  * Creates a marker in the @buffer of type @type.  A marker is
@@ -1522,7 +1427,7 @@
  * life cycle issues and "mark-set" and "mark-deleted" signal
  * emissions.
  *
- * Like a #GtkTextMark, a #GtkSourceMarker can be anonymous if the
+ * Like a #GtkTextMark, a #GtkSourceMark can be anonymous if the
  * passed @name is %NULL.  Also, the buffer owns the markers so you
  * shouldn't unreference it.
  *
@@ -1534,298 +1439,71 @@
  * Typical uses for a marker are bookmarks, breakpoints, current
  * executing instruction indication in a source file, etc..
  *
- * Return value: a new #GtkSourceMarker, owned by the buffer.
+ * Return value: a new #GtkSourceMark, owned by the buffer.
  **/
-GtkSourceMarker *
+GtkSourceMark *
 gtk_source_buffer_create_marker (GtkSourceBuffer   *buffer,
 				 const gchar       *name,
 				 const gchar       *type,
+				 guint 		    priority,
 				 const GtkTextIter *where)
 {
-	GtkTextMark *text_mark;
+	GtkSourceMark *text_mark;
 
 	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
 	g_return_val_if_fail (where != NULL, NULL);
 
-	text_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (buffer),
-						 name,
-						 where,
-						 TRUE);
-	if (text_mark)
-	{
-		g_object_ref (text_mark);
-
-		gtk_source_marker_set_marker_type (GTK_SOURCE_MARKER (text_mark), type);
-		markers_insert (buffer, GTK_SOURCE_MARKER (text_mark));
-		_gtk_source_marker_changed (GTK_SOURCE_MARKER (text_mark));
-
-		return GTK_SOURCE_MARKER (text_mark);
-	}
-
-	return NULL;
+	text_mark = gtk_source_mark_new (name, type, priority);
+	gtk_text_buffer_add_mark (GTK_TEXT_BUFFER (buffer),
+				  GTK_TEXT_MARK (text_mark),
+				  where);
+	
+	return text_mark;
 }
 
-static gint
-markers_lookup (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
-{
-	gint index, cmp;
-	GtkTextIter iter;
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  &iter,
-					  GTK_TEXT_MARK (marker));
-
-	index = markers_binary_search (buffer, &iter, &cmp);
-	if (index >= 0 && cmp == 0)
-	{
-		if (g_array_index (buffer->priv->markers,
-				   GtkSourceMarker *,
-				   index) == marker)
-			return index;
-		return markers_linear_lookup (buffer, marker, index, 0);
-	}
-	return -1;
-}
-
 /**
- * gtk_source_buffer_move_marker:
- * @buffer: a #GtkSourceBuffer.
- * @marker: a #GtkSourceMarker in @buffer.
- * @where: the new location for the marker.
- *
- * Moves @marker to the new location @where.
- **/
-void
-gtk_source_buffer_move_marker (GtkSourceBuffer   *buffer,
-			       GtkSourceMarker   *marker,
-			       const GtkTextIter *where)
-{
-	gint index;
-
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-	g_return_if_fail (where != NULL);
-
-	index = markers_lookup (buffer, marker);
-
-	g_return_if_fail (index >= 0);
-
-	/* unlink the marker first */
-	_gtk_source_marker_changed (marker);
-	_gtk_source_marker_unlink (marker);
-	g_array_remove_index (buffer->priv->markers, index);
-
-	gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (buffer),
-				   GTK_TEXT_MARK (marker),
-				   where);
-
-	/* re-link the marker using the new position */
-	markers_insert (buffer, marker);
-
-	/* FIXME: emit even the line number hasn't changed? - Gustavo */
-	_gtk_source_marker_changed (marker);
-}
-
-/**
- * gtk_source_buffer_delete_marker:
- * @buffer: a #GtkSourceBuffer.
- * @marker: a #GtkSourceMarker in the @buffer.
- *
- * Deletes @marker from the source buffer.  The same conditions as for
- * #GtkTextMark apply here.  The marker is no longer accessible from
- * the buffer, but if you held a reference to it, it will not be
- * destroyed.
- **/
-void
-gtk_source_buffer_delete_marker (GtkSourceBuffer *buffer,
-				 GtkSourceMarker *marker)
-{
-	gint index;
-
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	index = markers_lookup (buffer, marker);
-
-	g_return_if_fail (index >= 0);
-
-	_gtk_source_marker_changed (marker);
-	_gtk_source_marker_unlink (marker);
-	g_array_remove_index (buffer->priv->markers, index);
-
-	g_object_unref (marker);
-	gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer),
-				     GTK_TEXT_MARK (marker));
-}
-
-/**
- * gtk_source_buffer_get_marker:
- * @buffer: a #GtkSourceBuffer.
- * @name: name of the marker to retrieve.
- *
- * Looks up the #GtkSourceMarker named @name in @buffer, returning
- * %NULL if it doesn't exists.
- *
- * Return value: the #GtkSourceMarker whose name is @name, or %NULL.
- **/
-GtkSourceMarker *
-gtk_source_buffer_get_marker (GtkSourceBuffer *buffer,
-			      const gchar     *name)
-{
-	GtkTextMark *text_mark;
-
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (name != NULL, NULL);
-
-	text_mark = gtk_text_buffer_get_mark (GTK_TEXT_BUFFER (buffer), name);
-
-	if (text_mark && markers_lookup (buffer, GTK_SOURCE_MARKER (text_mark)) < 0)
-		text_mark = NULL;
-
-	if (text_mark)
-		return GTK_SOURCE_MARKER (text_mark);
-	else
-		return NULL;
-}
-
-#ifdef ENABLE_DEBUG
-static void
-marker_print (GtkSourceBuffer *buffer, GtkSourceMarker *marker)
-{
-	GtkTextIter iter;
-	gchar *type;
-
-	type = gtk_source_marker_get_marker_type (marker);
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer), &iter, marker);
-
-	g_print ("Marker [%p] at %d (type: %s)\n",
-		 marker,
-		 gtk_text_iter_get_offset (&iter),
-		 type);
-	g_free (type);
-}
-
-static void
-markers_debug (GtkSourceBuffer *buffer)
-{
-	GtkSourceMarker *marker, *tmp;
-	GArray *markers = buffer->priv->markers;
-	gint i;
-
-	if (markers->len == 0)
-	{
-		g_print ("No markers\n");
-		return;
-	}
-
-	g_print ("Array contents:\n");
-	for (i = 0; i < markers->len; i++)
-		marker_print (buffer, g_array_index (markers, GtkSourceMarker *, i));
-
-	g_print ("Linked list:\n");
-	marker = g_array_index (markers, GtkSourceMarker *, 0);
-
-	while ((tmp = gtk_source_marker_prev (marker)) != NULL)
-		marker = tmp;
-	while (marker)
-	{
-		marker_print (buffer, marker);
-		marker = gtk_source_marker_next (marker);
-	}
-}
-#endif
-
-/**
  * gtk_source_buffer_get_markers_in_region:
  * @buffer: a #GtkSourceBuffer.
  * @begin: beginning of the range.
  * @end: end of the range.
  *
  * Returns an <emphasis>ordered</emphasis> (by position) #GSList of
- * #GtkSourceMarker objects inside the region delimited by the
+ * #GtkSourceMark objects inside the region delimited by the
  * #GtkTextIter @begin and @end.  The iters may be in any order.
  *
- * Return value: a #GSList of the #GtkSourceMarker inside the range.
+ * Return value: a #GSList of the #GtkSourceMark inside the range.
  **/
 GSList *
 gtk_source_buffer_get_markers_in_region (GtkSourceBuffer   *buffer,
 					 const GtkTextIter *begin,
 					 const GtkTextIter *end)
 {
-	GSList *result;
-	GtkTextIter iter1, iter2;
-	gint i, j, cmp;
-	GArray *markers;
-
-	g_return_val_if_fail (buffer != NULL, NULL);
-	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (begin != NULL && end != NULL, NULL);
-
-	DEBUG (g_print ("Getting markers for [%d,%d]\n",
-			gtk_text_iter_get_offset (begin),
-			gtk_text_iter_get_offset (end)));
-	DEBUG (markers_debug (buffer));
-
-	iter1 = *begin;
-	iter2 = *end;
-	gtk_text_iter_order (&iter1, &iter2);
-
-	result = NULL;
-	markers = buffer->priv->markers;
-
-	i = markers_binary_search (buffer, &iter1, &cmp);
-	if (i < 0)
-		return NULL;
-
-	if (cmp == 0)
-		/* we got an exact match, which means the iter was at
-		 * the position of the returned marker.  now we have
-		 * to search backward for other markers at the same
-		 * position */
-		i = markers_linear_lookup (buffer, NULL, i, -1);
-	else if (cmp > 0)
-		i++;
-
-	if (i >= markers->len)
-		/* no markers to return */
-		return NULL;
-
-	j = markers_binary_search (buffer, &iter2, &cmp);
-	if (cmp == 0)
-		/* we got an exact match, which means the iter was at
-		 * the position of the returned marker.  now we have
-		 * to search forward for other markers at the same
-		 * position */
-		j = markers_linear_lookup (buffer, NULL, j, 1);
-	else if (cmp < 0)
-		j--;
-
-	if (j < 0 || i > j)
-		/* no markers to return */
-		return NULL;
-
-	/* build the resulting list */
-	while (j >= i)
+	GSList* markers = NULL;
+	gint begin_line = MIN (gtk_text_iter_get_line (begin), gtk_text_iter_get_line (end));
+	gint end_line = MAX (gtk_text_iter_get_line (begin), gtk_text_iter_get_line (end));	
+	
+	GSequenceIter* cur_marker = g_sequence_get_begin_iter (buffer->priv->markers);
+	
+	while (!g_sequence_iter_is_end (cur_marker))
 	{
-		result = g_slist_prepend (result, g_array_index (markers, GtkSourceMarker *, j));
-		j--;
+		GtkTextIter iter;
+		GtkTextMark* mark = g_sequence_get (cur_marker);
+		if (!gtk_text_mark_get_deleted (mark))
+		{
+			gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer), &iter,
+						  mark);
+			if (gtk_text_iter_get_line (&iter) >= begin_line)
+			{
+				if (gtk_text_iter_get_line (&iter) > end_line)
+					break;
+				markers = g_slist_append (markers, mark);
+			}
+		}
+		cur_marker = g_sequence_iter_next (cur_marker);
 	}
-
-	DEBUG({
-		GSList *l;
-
-		g_print ("Returned list:\n");
-		for (l = result; l; l = l->next)
-			marker_print (buffer, l->data);
-	});
-
-	return result;
+	
+	return markers;
 }
 
 /**
@@ -1835,19 +1513,23 @@
  * Returns the first (nearest to the top of the buffer) marker in
  * @buffer.
  *
- * Return value: a reference to the first #GtkSourceMarker, or %NULL if
+ * Return value: a reference to the first #GtkSourceMark, or %NULL if
  * there are no markers in the buffer.
  **/
-GtkSourceMarker *
+GtkSourceMark *
 gtk_source_buffer_get_first_marker (GtkSourceBuffer *buffer)
 {
 	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-
-	if (buffer->priv->markers->len == 0)
-		return NULL;
-
-	return g_array_index (buffer->priv->markers, GtkSourceMarker *, 0);
+	
+	GSequenceIter* iter;
+	
+	iter = g_sequence_get_begin_iter (buffer->priv->markers);
+	if (!g_sequence_iter_is_end (iter))
+	{
+		return g_sequence_get (iter);
+	}
+	return NULL;
 }
 
 /**
@@ -1857,138 +1539,64 @@
  * Returns the last (nearest to the bottom of the buffer) marker in
  * @buffer.
  *
- * Return value: a reference to the last #GtkSourceMarker, or %NULL if
+ * Return value: a reference to the last #GtkSourceMark, or %NULL if
  * there are no markers in the buffer.
  **/
-GtkSourceMarker *
+GtkSourceMark *
 gtk_source_buffer_get_last_marker (GtkSourceBuffer *buffer)
 {
 	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
 
-	if (buffer->priv->markers->len == 0)
-		return NULL;
-
-	return g_array_index (buffer->priv->markers,
-			      GtkSourceMarker *,
-			      buffer->priv->markers->len - 1);
+	GSequenceIter* iter;
+	
+	iter = g_sequence_get_end_iter (buffer->priv->markers);
+	iter = g_sequence_iter_prev (iter);
+	if (!g_sequence_iter_is_end (iter))
+	{
+		return g_sequence_get (iter);
+	}
+	return NULL;
 }
 
-/**
- * gtk_source_buffer_get_iter_at_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: a #GtkTextIter to initialize.
- * @marker: a #GtkSourceMarker of @buffer.
- *
- * Initializes @iter at the location of @marker.
- **/
-void
-gtk_source_buffer_get_iter_at_marker (GtkSourceBuffer *buffer,
-				      GtkTextIter     *iter,
-				      GtkSourceMarker *marker)
-{
-	g_return_if_fail (buffer != NULL && marker != NULL);
-	g_return_if_fail (GTK_IS_SOURCE_BUFFER (buffer));
-	g_return_if_fail (GTK_IS_SOURCE_MARKER (marker));
-	g_return_if_fail (!gtk_text_mark_get_deleted (GTK_TEXT_MARK (marker)));
-
-	gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (buffer),
-					  iter,
-					  GTK_TEXT_MARK (marker));
-}
-
-/**
- * gtk_source_buffer_get_next_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: the location to start searching from.
- *
- * Returns the nearest marker to the right of @iter.  If there are
- * multiple markers at the same position, this function will always
- * return the first one (from the internal linked list), even if
- * starting the search exactly at its location.  You can get the
- * others using gtk_source_marker_next().
- *
- * Return value: the #GtkSourceMarker nearest to the right of @iter,
- * or %NULL if there are no more markers after @iter.
- **/
-GtkSourceMarker *
+GtkSourceMark *
 gtk_source_buffer_get_next_marker (GtkSourceBuffer *buffer,
-				   GtkTextIter     *iter)
+				   GtkSourceMark* mark)
 {
-	GtkSourceMarker *marker;
-	GArray *markers;
-	gint i, cmp;
-
 	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (iter != NULL, NULL);
-
-	marker = NULL;
-	markers = buffer->priv->markers;
-
-	i = markers_binary_search (buffer, iter, &cmp);
-	if (i < 0)
-		return NULL;
-
-	if (cmp == 0)
-		/* return the first marker at the iter position */
-		i = markers_linear_lookup (buffer, NULL, i, -1);
-	else if (cmp > 0)
-		i++;
-
-	if (i < markers->len)
+	
+	GSequenceIter* iter = g_sequence_search (buffer->priv->markers,
+						mark,
+						compare_marker,
+						buffer);
+	if (!g_sequence_iter_is_end (iter))
 	{
-		marker = g_array_index (markers, GtkSourceMarker *, i);
-		gtk_source_buffer_get_iter_at_marker (buffer, iter, marker);
+		iter = g_sequence_iter_next(iter);
+		if (!g_sequence_iter_is_end (iter))
+		{
+			return g_sequence_get (iter);
+		}
 	}
-
-	return marker;
+	return NULL;
 }
 
-/**
- * gtk_source_buffer_get_prev_marker:
- * @buffer: a #GtkSourceBuffer.
- * @iter: the location to start searching from.
- *
- * Returns the nearest marker to the left of @iter.  If there are
- * multiple markers at the same position, this function will always
- * return the last one (from the internal linked list), even if
- * starting the search exactly at its location.  You can get the
- * others using gtk_source_marker_prev().
- *
- * Return value: the #GtkSourceMarker nearest to the left of @iter,
- * or %NULL if there are no more markers before @iter.
- **/
-GtkSourceMarker *
+GtkSourceMark *
 gtk_source_buffer_get_prev_marker (GtkSourceBuffer *buffer,
-				   GtkTextIter     *iter)
+				   GtkSourceMark* mark)
 {
-	GtkSourceMarker *marker;
-	GArray *markers;
-	gint i, cmp;
-
 	g_return_val_if_fail (buffer != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_BUFFER (buffer), NULL);
-	g_return_val_if_fail (iter != NULL, NULL);
 
-	marker = NULL;
-	markers = buffer->priv->markers;
-
-	i = markers_binary_search (buffer, iter, &cmp);
-	if (i < 0)
-		return NULL;
-
-	if (cmp == 0)
-		/* return the last marker at the iter position */
-		i = markers_linear_lookup (buffer, NULL, i, 1);
-	else if (cmp < 0)
-		i--;
-
-	if (i >= 0)
+	
+	GSequenceIter* iter = g_sequence_search (buffer->priv->markers,
+						mark,
+						compare_marker,
+						buffer);
+	if (!g_sequence_iter_is_end (iter))
 	{
-		marker = g_array_index (markers, GtkSourceMarker *, i);
-		gtk_source_buffer_get_iter_at_marker (buffer, iter, marker);
+		iter = g_sequence_iter_prev (iter);
+		return g_sequence_get (iter);
 	}
-
-	return marker;
+	return NULL;
 }
Index: gtksourceview/gtksourceview.c
===================================================================
--- gtksourceview/gtksourceview.c	(Revision 1768)
+++ gtksourceview/gtksourceview.c	(Arbeitskopie)
@@ -42,7 +42,7 @@
 /*
 #define ENABLE_DEBUG
 */
-#undef ENABLE_DEBUG
+//#undef ENABLE_DEBUG
 
 /*
 #define ENABLE_PROFILE
@@ -712,47 +712,26 @@
 
 static void
 marker_updated_cb (GtkSourceBuffer *buffer,
-		   GtkTextIter     *where,
+		   GtkTextMark	   *mark,
 		   GtkTextView     *text_view)
 {
 	GdkRectangle visible_rect;
-	GdkRectangle updated_rect;
-	GdkRectangle redraw_rect;
-	gint y, height;
-
+	
 	g_return_if_fail (text_view != NULL && GTK_IS_SOURCE_VIEW (text_view));
-
+	
 	if (!GTK_SOURCE_VIEW (text_view)->priv->show_line_markers)
 		return;
 
-	/* get visible area */
 	gtk_text_view_get_visible_rect (text_view, &visible_rect);
 
-	/* get updated rectangle */
-	gtk_text_view_get_line_yrange (text_view, where, &y, &height);
-	updated_rect.y = y;
-	updated_rect.height = height;
-	updated_rect.x = visible_rect.x;
-	updated_rect.width = visible_rect.width;
-
-	/* intersect both rectangles to see whether we need to queue a redraw */
-	if (gdk_rectangle_intersect (&updated_rect, &visible_rect, &redraw_rect))
-	{
-		gint y_win, width;
-
-		gtk_text_view_buffer_to_window_coords (text_view,
-						       GTK_TEXT_WINDOW_WIDGET,
-						       0,
-						       redraw_rect.y,
-						       NULL,
-						       &y_win);
-
-		width = gtk_text_view_get_border_window_size (text_view,
-							      GTK_TEXT_WINDOW_LEFT);
-
-		gtk_widget_queue_draw_area (GTK_WIDGET (text_view),
-					    0, y_win, width, height);
-	}
+	
+	visible_rect.width = gtk_text_view_get_border_window_size (text_view, GTK_TEXT_WINDOW_LEFT);
+	/*gtk_widget_queue_draw_area (GTK_WIDGET (text_view), 
+				     visible_rect.x,
+				     visible_rect.y,
+				     visible_rect.width,
+				     visible_rect.height);*/
+	gtk_widget_queue_draw (GTK_WIDGET (text_view));
 }
 
 static void
@@ -1122,10 +1101,10 @@
 		   gint           y)
 {
 	GdkPixbuf *pixbuf, *composite;
-	GtkSourceMarker *marker;
+	GtkSourceMark *marker;
 	gint width, height;
 	gint next_line;
-	gchar *marker_type;
+	const gchar *category;
 
 	g_assert (current_marker);
 
@@ -1135,14 +1114,19 @@
 	/* composite all the pixbufs for the markers present at the line */
 	do
 	{
+		GtkTextIter iter;
 		marker = current_marker->data;
-
-		next_line = gtk_source_marker_get_line (marker);
+		
+		gtk_text_buffer_get_iter_at_mark (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
+									    &iter,
+									    GTK_TEXT_MARK (marker));
+		next_line = gtk_text_iter_get_line (&iter);
 		if (next_line != *line_number)
 			break;
 
-		marker_type = gtk_source_marker_get_marker_type (marker);
-		pixbuf = gtk_source_view_get_marker_pixbuf (view, marker_type);
+		category = gtk_source_mark_get_category (marker);
+		g_message ("Marker category: %s", category);
+		pixbuf = gtk_source_view_get_marker_pixbuf (view, category);
 
 		if (pixbuf)
 		{
@@ -1172,9 +1156,8 @@
 			g_object_unref (pixbuf);
 
 		} else
-			g_warning ("Unknown marker '%s' used", marker_type);
+			g_warning ("Unknown marker '%s' used", category);
 
-		g_free (marker_type);
 		current_marker = g_slist_next (current_marker);
 	}
 	while (current_marker);
@@ -1220,7 +1203,7 @@
 	gint cur_line;
 
 	text_view = GTK_TEXT_VIEW (view);
-
+	
 	if (!view->priv->show_line_numbers && !view->priv->show_line_markers)
 	{
 		gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (text_view),
@@ -1336,10 +1319,14 @@
 	i = 0;
 	current_marker = markers;
 	if (current_marker)
-		marker_line = gtk_source_marker_get_line (
-			GTK_SOURCE_MARKER (current_marker->data));
+	{
+		GtkTextIter iter;
+		gtk_text_buffer_get_iter_at_mark (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
+									    &iter,
+									    GTK_TEXT_MARK (current_marker->data));
+		marker_line = gtk_text_iter_get_line (&iter);
+	}
 
-
 	gtk_text_buffer_get_iter_at_mark (text_view->buffer,
 					  &cur,
 					  gtk_text_buffer_get_insert (text_view->buffer));
@@ -1407,7 +1394,7 @@
 	}
 
 	/* we should have used all markers */
-	g_assert (current_marker == NULL);
+	//g_assert (current_marker == NULL);
 
 	g_slist_free (markers);
 	g_array_free (pixels, TRUE);
@@ -1992,19 +1979,19 @@
 /**
  * gtk_source_view_set_marker_pixbuf:
  * @view: a #GtkSourceView.
- * @marker_type: a marker type.
+ * @category: a marker category.
  * @pixbuf: a #GdkPixbuf.
  *
  * Associates a given @pixbuf with a given @marker_type.
  */
 void
 gtk_source_view_set_marker_pixbuf (GtkSourceView *view,
-				   const gchar   *marker_type,
+				   const gchar   *category,
 				   GdkPixbuf     *pixbuf)
 {
 	g_return_if_fail (view != NULL);
 	g_return_if_fail (GTK_IS_SOURCE_VIEW (view));
-	g_return_if_fail (marker_type != NULL);
+	g_return_if_fail (category != NULL);
 	g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
 
 	if (pixbuf)
@@ -2030,19 +2017,19 @@
 		}
 
 		g_hash_table_insert (view->priv->pixmap_cache,
-				     g_strdup (marker_type),
+				     g_strdup (category),
 				     pixbuf);
 	}
 	else
 	{
-		g_hash_table_remove (view->priv->pixmap_cache, marker_type);
+		g_hash_table_remove (view->priv->pixmap_cache, category);
 	}
 }
 
 /**
  * gtk_source_view_get_marker_pixbuf:
  * @view: a #GtkSourceView.
- * @marker_type: a marker type.
+ * @category: a marker category.
  *
  * Gets the pixbuf which is associated with the given @marker_type.
  *
@@ -2050,15 +2037,15 @@
  */
 GdkPixbuf *
 gtk_source_view_get_marker_pixbuf (GtkSourceView *view,
-				   const gchar   *marker_type)
+				   const gchar   *category)
 {
 	GdkPixbuf *pixbuf;
 
 	g_return_val_if_fail (view != NULL, NULL);
 	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), NULL);
-	g_return_val_if_fail (marker_type != NULL, NULL);
+	g_return_val_if_fail (category != NULL, NULL);
 
-	pixbuf = g_hash_table_lookup (view->priv->pixmap_cache, marker_type);
+	pixbuf = g_hash_table_lookup (view->priv->pixmap_cache, category);
 
 	if (pixbuf)
 		g_object_ref (pixbuf);
Index: gtksourceview/gtksourcebuffer.h
===================================================================
--- gtksourceview/gtksourcebuffer.h	(Revision 1768)
+++ gtksourceview/gtksourcebuffer.h	(Arbeitskopie)
@@ -28,7 +28,7 @@
 
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksourcelanguage.h>
-#include <gtksourceview/gtksourcemarker.h>
+#include <gtksourceview/gtksourcemark.h>
 #include <gtksourceview/gtksourcestylescheme.h>
 
 G_BEGIN_DECLS
@@ -110,32 +110,24 @@
 void			 gtk_source_buffer_end_not_undoable_action   (GtkSourceBuffer   *buffer);
 
 /* Marker methods */
-GtkSourceMarker         *gtk_source_buffer_create_marker        (GtkSourceBuffer        *buffer,
+GtkSourceMark         *gtk_source_buffer_create_marker        (GtkSourceBuffer        *buffer,
 								 const gchar            *name,
 								 const gchar            *type,
+ 								 guint                   priority,
 								 const GtkTextIter      *where);
 
-void                     gtk_source_buffer_move_marker          (GtkSourceBuffer        *buffer,
-								 GtkSourceMarker        *marker,
-								 const GtkTextIter      *where);
-void                     gtk_source_buffer_delete_marker        (GtkSourceBuffer        *buffer,
-								 GtkSourceMarker        *marker);
-GtkSourceMarker         *gtk_source_buffer_get_marker           (GtkSourceBuffer        *buffer,
-								 const gchar            *name);
 GSList                  *gtk_source_buffer_get_markers_in_region
                                                                 (GtkSourceBuffer        *buffer,
 								 const GtkTextIter      *begin,
 								 const GtkTextIter      *end);
-GtkSourceMarker         *gtk_source_buffer_get_first_marker     (GtkSourceBuffer        *buffer);
-GtkSourceMarker         *gtk_source_buffer_get_last_marker      (GtkSourceBuffer        *buffer);
-void                     gtk_source_buffer_get_iter_at_marker   (GtkSourceBuffer        *buffer,
-								 GtkTextIter            *iter,
-								 GtkSourceMarker        *marker);
-GtkSourceMarker         *gtk_source_buffer_get_next_marker      (GtkSourceBuffer        *buffer,
-								 GtkTextIter            *iter);
-GtkSourceMarker         *gtk_source_buffer_get_prev_marker      (GtkSourceBuffer        *buffer,
-								 GtkTextIter            *iter);
+GtkSourceMark         *gtk_source_buffer_get_first_marker     (GtkSourceBuffer        *buffer);
+GtkSourceMark         *gtk_source_buffer_get_last_marker      (GtkSourceBuffer        *buffer);
 
+GtkSourceMark         *gtk_source_buffer_get_next_marker      (GtkSourceBuffer        *buffer,
+								 GtkSourceMark           *mark);
+GtkSourceMark         *gtk_source_buffer_get_prev_marker      (GtkSourceBuffer        *buffer,
+								 GtkSourceMark            *mark);
+
 /* private */
 void			 _gtk_source_buffer_update_highlight	(GtkSourceBuffer        *buffer,
 								 const GtkTextIter      *start,
Index: gtksourceview/gtksourceview.h
===================================================================
--- gtksourceview/gtksourceview.h	(Revision 1768)
+++ gtksourceview/gtksourceview.h	(Arbeitskopie)
@@ -139,10 +139,10 @@
 					 		(GtkSourceView   *view);
 
 void             gtk_source_view_set_marker_pixbuf      (GtkSourceView   *view,
-							 const gchar     *marker_type,
+							 const gchar     *category,
 							 GdkPixbuf       *pixbuf);
 GdkPixbuf	*gtk_source_view_get_marker_pixbuf      (GtkSourceView   *view,
-				       			 const gchar     *marker_type);
+				       			 const gchar     *category);
 
 void		 gtk_source_view_set_smart_home_end	(GtkSourceView             *view,
 							 GtkSourceSmartHomeEndType  smart_he);
Index: gtksourceview/Makefile.am
===================================================================
--- gtksourceview/Makefile.am	(Revision 1768)
+++ gtksourceview/Makefile.am	(Arbeitskopie)
@@ -44,7 +44,7 @@
 	gtksourcestyle.h			\
 	gtksourcestyleschememanager.h		\
 	gtksourcestylescheme.h			\
-	gtksourcemarker.h
+	gtksourcemark.h
 
 libgtksourceview_2_0_la_SOURCES = 	\
 	gtksourcebuffer.c 		\
@@ -67,11 +67,10 @@
 	gtksourcestyle.c		\
 	gtksourcestyleschememanager.c	\
 	gtksourcestylescheme.c		\
-	gtksourcemarker.c		\
-	gtksourceengine.h		\
 	gtksourceengine.c		\
 	gtksourcecontextengine.h	\
 	gtksourcecontextengine.c	\
+	gtksourcemark.c			\	
 	$(libgtksourceview_headers)
 
 # do not distribute generated files
Index: tests/test-widget.c
===================================================================
--- tests/test-widget.c	(Revision 1768)
+++ tests/test-widget.c	(Arbeitskopie)
@@ -299,10 +299,7 @@
 	markers = gtk_source_buffer_get_markers_in_region (buffer, &begin, &end);
 	while (markers)
 	{
-		GtkSourceMarker *marker = markers->data;
-
-		gtk_source_buffer_delete_marker (buffer, marker);
-		markers = g_slist_delete_link (markers, markers);
+		gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer), markers->data);
 	}
 }
 
@@ -915,7 +912,7 @@
 		gint y_buf;
 		GtkTextIter line_start, line_end;
 		GSList *marker_list, *list_iter;
-		GtkSourceMarker *marker;
+		GtkSourceMark *marker;
 		const gchar *marker_type;
 
 		if (ev->button == 1)
@@ -948,8 +945,8 @@
 		     list_iter && !marker;
 		     list_iter = g_slist_next (list_iter))
 		{
-			GtkSourceMarker *tmp = list_iter->data;
-			gchar *tmp_type = gtk_source_marker_get_marker_type (tmp);
+			GtkSourceMark *tmp = list_iter->data;
+			gchar *tmp_type = gtk_source_mark_get_category (tmp);
 
 			if (tmp_type && !strcmp (tmp_type, marker_type))
 			{
@@ -962,13 +959,15 @@
 		if (marker)
 		{
 			/* a marker was found, so delete it */
-			gtk_source_buffer_delete_marker (buffer, marker);
+			g_message ("Deleting marker");
+			gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (buffer), GTK_TEXT_MARK (marker));
 		}
 		else
 		{
 			/* no marker found -> create one */
+			g_message ("Create marker");
 			marker = gtk_source_buffer_create_marker (buffer, NULL,
-								  marker_type, &line_start);
+								  marker_type, 0, &line_start);
 		}
 	}
 
Index: configure.ac
===================================================================
--- configure.ac	(Revision 1768)
+++ configure.ac	(Arbeitskopie)
@@ -3,7 +3,7 @@
 AC_PREREQ(2.59)
 
 m4_define(gtksourceview_major_version, 2)
-m4_define(gtksourceview_minor_version, 0)
+m4_define(gtksourceview_minor_version, 1)
 m4_define(gtksourceview_micro_version, 0)
 m4_define(gtksourceview_version, gtksourceview_major_version.gtksourceview_minor_version.gtksourceview_micro_version)
 
