[gtksourceview/wip/loader-saver] GtkSourceFile, the come back (not finished)



commit e0111c03e75f93bfc8316e45a9c479db2c645785
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jun 5 22:45:42 2014 +0200

    GtkSourceFile, the come back (not finished)

 gtksourceview/Makefile.am               |    2 +
 gtksourceview/gtksource.h               |    1 +
 gtksourceview/gtksourcebuffer-private.h |   20 +--
 gtksourceview/gtksourcebuffer.c         |  216 +-----------------
 gtksourceview/gtksourcebuffer.h         |    8 -
 gtksourceview/gtksourcefile.c           |  395 +++++++++++++++++++++++++++++++
 gtksourceview/gtksourcefile.h           |   87 +++++++
 gtksourceview/gtksourcefileloader.c     |  188 ++++++++-------
 gtksourceview/gtksourcefileloader.h     |   10 +-
 gtksourceview/gtksourcetypes.h          |    1 +
 10 files changed, 598 insertions(+), 330 deletions(-)
---
diff --git a/gtksourceview/Makefile.am b/gtksourceview/Makefile.am
index 6444677..8eaa082 100644
--- a/gtksourceview/Makefile.am
+++ b/gtksourceview/Makefile.am
@@ -31,6 +31,7 @@ libgtksourceview_headers =                    \
        gtksourcecompletionproposal.h           \
        gtksourcecompletionprovider.h           \
        gtksourceencoding.h                     \
+       gtksourcefile.h                         \
        gtksourcefileloader.h                   \
        gtksourcefilesaver.h                    \
        gtksourcegutter.h                       \
@@ -105,6 +106,7 @@ libgtksourceview_c_files =          \
        gtksourcecompletionproposal.c   \
        gtksourcecompletionprovider.c   \
        gtksourceencoding.c             \
+       gtksourcefile.c                 \
        gtksourcefileloader.c           \
        gtksourcefilesaver.c            \
        gtksourcegutter.c               \
diff --git a/gtksourceview/gtksource.h b/gtksourceview/gtksource.h
index 89644d1..0903003 100644
--- a/gtksourceview/gtksource.h
+++ b/gtksourceview/gtksource.h
@@ -29,6 +29,7 @@
 #include <gtksourceview/gtksourcecompletionproposal.h>
 #include <gtksourceview/gtksourcecompletionprovider.h>
 #include <gtksourceview/gtksourceencoding.h>
+#include <gtksourceview/gtksourcefile.h>
 #include <gtksourceview/gtksourcefileloader.h>
 #include <gtksourceview/gtksourcefilesaver.h>
 #include <gtksourceview/gtksourcegutter.h>
diff --git a/gtksourceview/gtksourcebuffer-private.h b/gtksourceview/gtksourcebuffer-private.h
index 96560d0..f24df08 100644
--- a/gtksourceview/gtksourcebuffer-private.h
+++ b/gtksourceview/gtksourcebuffer-private.h
@@ -52,24 +52,8 @@ void                  _gtk_source_buffer_add_search_context          (GtkSourceBuffer      
  *buffer,
 
 G_GNUC_INTERNAL
 void                    _gtk_source_buffer_set_as_invalid_character    (GtkSourceBuffer        *buffer,
-                                                                        GtkTextIter            *start,
-                                                                        GtkTextIter            *end);
-
-G_GNUC_INTERNAL
-void                    _gtk_source_buffer_set_file                    (GtkSourceBuffer        *buffer,
-                                                                        GFile                  *file);
-
-G_GNUC_INTERNAL
-void                    _gtk_source_buffer_set_encoding                (GtkSourceBuffer         *buffer,
-                                                                        const GtkSourceEncoding *encoding);
-
-G_GNUC_INTERNAL
-void                    _gtk_source_buffer_set_newline_type            (GtkSourceBuffer        *buffer,
-                                                                        GtkSourceNewlineType    
newline_type);
-
-G_GNUC_INTERNAL
-void                    _gtk_source_buffer_set_compression_type        (GtkSourceBuffer          *buffer,
-                                                                        GtkSourceCompressionType  
compression_type);
+                                                                        const GtkTextIter      *start,
+                                                                        const GtkTextIter      *end);
 
 G_END_DECLS
 
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index 62c5cd5..3435351 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -42,7 +42,6 @@
 #include "gtksourcemark.h"
 #include "gtksourcemarkssequence.h"
 #include "gtksourcesearchcontext.h"
-#include "gtksourceencoding.h"
 #include "gtksourceview-i18n.h"
 #include "gtksourceview-marshal.h"
 #include "gtksourceview-typebuiltins.h"
@@ -142,10 +141,6 @@ enum {
        PROP_LANGUAGE,
        PROP_STYLE_SCHEME,
        PROP_UNDO_MANAGER,
-       PROP_FILE,
-       PROP_ENCODING,
-       PROP_NEWLINE_TYPE,
-       PROP_COMPRESSION_TYPE,
        PROP_IMPLICIT_TRAILING_NEWLINE
 };
 
@@ -172,11 +167,6 @@ struct _GtkSourceBufferPrivate
 
        GtkTextTag            *invalid_char_tag;
 
-       GFile                    *file;
-       const GtkSourceEncoding  *encoding;
-       GtkSourceNewlineType      newline_type;
-       GtkSourceCompressionType  compression_type;
-
        guint                  highlight_syntax : 1;
        guint                  highlight_brackets : 1;
        guint                  constructed : 1;
@@ -372,69 +362,6 @@ gtk_source_buffer_class_init (GtkSourceBufferClass *klass)
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
 
        /**
-        * GtkSourceBuffer:file:
-        *
-        * The associated #GFile.
-        *
-        * Since: 3.14
-        */
-       g_object_class_install_property (object_class,
-                                        PROP_FILE,
-                                        g_param_spec_object ("file",
-                                                             _("File"),
-                                                             "",
-                                                             G_TYPE_FILE,
-                                                             G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-       /**
-        * GtkSourceBuffer:encoding:
-        *
-        * The #GtkSourceBuffer:file's encoding. Note that the #GtkSourceBuffer
-        * always has a UTF-8 encoding.
-        *
-        * Since: 3.14
-        */
-       g_object_class_install_property (object_class,
-                                        PROP_ENCODING,
-                                        g_param_spec_boxed ("encoding",
-                                                            _("Encoding"),
-                                                            "",
-                                                            GTK_SOURCE_TYPE_ENCODING,
-                                                            G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-       /**
-        * GtkSourceBuffer:newline-type:
-        *
-        * The type of line ending.
-        *
-        * Since: 3.14
-        */
-       g_object_class_install_property (object_class,
-                                        PROP_NEWLINE_TYPE,
-                                        g_param_spec_enum ("newline-type",
-                                                           _("Newline type"),
-                                                           "",
-                                                           GTK_SOURCE_TYPE_NEWLINE_TYPE,
-                                                           GTK_SOURCE_NEWLINE_TYPE_LF,
-                                                           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-       /**
-        * GtkSourceBuffer:compression-type:
-        *
-        * The #GtkSourceBuffer:file's compression type.
-        *
-        * Since: 3.14
-        */
-       g_object_class_install_property (object_class,
-                                        PROP_COMPRESSION_TYPE,
-                                        g_param_spec_enum ("compression-type",
-                                                           _("Compression type"),
-                                                           "",
-                                                           GTK_SOURCE_TYPE_COMPRESSION_TYPE,
-                                                           GTK_SOURCE_COMPRESSION_TYPE_NONE,
-                                                           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-       /**
         * GtkSourceBuffer:implicit-trailing-newline:
         *
         * Whether the buffer has an implicit trailing newline.
@@ -626,8 +553,6 @@ gtk_source_buffer_init (GtkSourceBuffer *buffer)
        {
                g_object_ref (priv->style_scheme);
        }
-
-       priv->encoding = gtk_source_encoding_get_utf8 ();
 }
 
 static void
@@ -781,22 +706,6 @@ gtk_source_buffer_get_property (GObject    *object,
                        g_value_set_object (value, source_buffer->priv->undo_manager);
                        break;
 
-               case PROP_FILE:
-                       g_value_set_object (value, source_buffer->priv->file);
-                       break;
-
-               case PROP_ENCODING:
-                       g_value_set_boxed (value, source_buffer->priv->encoding);
-                       break;
-
-               case PROP_NEWLINE_TYPE:
-                       g_value_set_enum (value, source_buffer->priv->newline_type);
-                       break;
-
-               case PROP_COMPRESSION_TYPE:
-                       g_value_set_enum (value, source_buffer->priv->compression_type);
-                       break;
-
                case PROP_IMPLICIT_TRAILING_NEWLINE:
                        g_value_set_boolean (value, source_buffer->priv->implicit_trailing_newline);
                        break;
@@ -2631,9 +2540,9 @@ text_tag_set_highest_priority (GtkTextTag    *tag,
 }
 
 void
-_gtk_source_buffer_set_as_invalid_character (GtkSourceBuffer *buffer,
-                                            GtkTextIter     *start,
-                                            GtkTextIter     *end)
+_gtk_source_buffer_set_as_invalid_character (GtkSourceBuffer   *buffer,
+                                            const GtkTextIter *start,
+                                            const GtkTextIter *end)
 {
        if (buffer->priv->invalid_char_tag == NULL)
        {
@@ -2661,125 +2570,6 @@ _gtk_source_buffer_set_as_invalid_character (GtkSourceBuffer *buffer,
                                   end);
 }
 
-void
-_gtk_source_buffer_set_file (GtkSourceBuffer *buffer,
-                            GFile           *file)
-{
-       g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
-
-       if (buffer->priv->file != file)
-       {
-               g_clear_object (&buffer->priv->file);
-               buffer->priv->file = g_object_ref (file);
-               g_object_notify (G_OBJECT (buffer), "file");
-       }
-}
-
-/**
- * gtk_source_buffer_get_file:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns: (transfer none): the associated #GFile.
- * Since: 3.14
- */
-GFile *
-gtk_source_buffer_get_file (GtkSourceBuffer *buffer)
-{
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
-
-       return buffer->priv->file;
-}
-
-void
-_gtk_source_buffer_set_encoding (GtkSourceBuffer         *buffer,
-                                const GtkSourceEncoding *encoding)
-{
-       g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
-
-       if (encoding == NULL)
-       {
-               encoding = gtk_source_encoding_get_utf8 ();
-       }
-
-       if (buffer->priv->encoding != encoding)
-       {
-               buffer->priv->encoding = encoding;
-               g_object_notify (G_OBJECT (buffer), "encoding");
-       }
-}
-
-/**
- * gtk_source_buffer_get_encoding:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns: the #GtkSourceBuffer:file's encoding. Note that the @buffer always
- * has a UTF-8 encoding.
- * Since: 3.14
- */
-const GtkSourceEncoding *
-gtk_source_buffer_get_encoding (GtkSourceBuffer *buffer)
-{
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
-
-       return buffer->priv->encoding;
-}
-
-void
-_gtk_source_buffer_set_newline_type (GtkSourceBuffer      *buffer,
-                                    GtkSourceNewlineType  newline_type)
-{
-       g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
-
-       if (buffer->priv->newline_type != newline_type)
-       {
-               buffer->priv->newline_type = newline_type;
-               g_object_notify (G_OBJECT (buffer), "newline-type");
-       }
-}
-
-/**
- * gtk_source_buffer_get_newline_type:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns: the #GtkSourceBuffer:file's newline type.
- * Since: 3.14
- */
-GtkSourceNewlineType
-gtk_source_buffer_get_newline_type (GtkSourceBuffer *buffer)
-{
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), GTK_SOURCE_NEWLINE_TYPE_DEFAULT);
-
-       return buffer->priv->newline_type;
-}
-
-void
-_gtk_source_buffer_set_compression_type (GtkSourceBuffer          *buffer,
-                                        GtkSourceCompressionType  compression_type)
-{
-       g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
-
-       if (buffer->priv->compression_type != compression_type)
-       {
-               buffer->priv->compression_type = compression_type;
-               g_object_notify (G_OBJECT (buffer), "compression-type");
-       }
-}
-
-/**
- * gtk_source_buffer_get_compression_type:
- * @buffer: a #GtkSourceBuffer.
- *
- * Returns: the #GtkSourceBuffer:file's compression type.
- * Since: 3.14
- */
-GtkSourceCompressionType
-gtk_source_buffer_get_compression_type (GtkSourceBuffer *buffer)
-{
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), GTK_SOURCE_COMPRESSION_TYPE_NONE);
-
-       return buffer->priv->compression_type;
-}
-
 /**
  * gtk_source_buffer_set_implicit_trailing_newline:
  * @buffer: a #GtkSourceBuffer.
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index f9c8f04..449cca3 100644
--- a/gtksourceview/gtksourcebuffer.h
+++ b/gtksourceview/gtksourcebuffer.h
@@ -203,14 +203,6 @@ GtkSourceUndoManager       *gtk_source_buffer_get_undo_manager                     
(GtkSourceBuffer        *buf
 void                    gtk_source_buffer_set_undo_manager                     (GtkSourceBuffer        
*buffer,
                                                                                 GtkSourceUndoManager   
*manager);
 
-GFile                  *gtk_source_buffer_get_file                             (GtkSourceBuffer        
*buffer);
-
-const GtkSourceEncoding *gtk_source_buffer_get_encoding                                (GtkSourceBuffer      
  *buffer);
-
-GtkSourceNewlineType    gtk_source_buffer_get_newline_type                     (GtkSourceBuffer        
*buffer);
-
-GtkSourceCompressionType gtk_source_buffer_get_compression_type                        (GtkSourceBuffer      
  *buffer);
-
 void                    gtk_source_buffer_set_implicit_trailing_newline        (GtkSourceBuffer        
*buffer,
                                                                                 gboolean                
implicit_trailing_newline);
 
diff --git a/gtksourceview/gtksourcefile.c b/gtksourceview/gtksourcefile.c
new file mode 100644
index 0000000..509338c
--- /dev/null
+++ b/gtksourceview/gtksourcefile.c
@@ -0,0 +1,395 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*- */
+/* gtksourcefile.c
+ * This file is part of GtkSourceView
+ *
+ * Copyright (C) 2014 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "gtksourcefile.h"
+#include "gtksourceencoding.h"
+
+/**
+ * SECTION:file
+ * @Short_description: On-disk representation of a GtkSourceBuffer
+ * @Title: GtkSourceFile
+ * @See_also: #GtkSourceFileLoader, #GtkSourceFileSaver, #GtkSourceBuffer
+ *
+ * A #GtkSourceFile object is the on-disk representation of a #GtkSourceBuffer.
+ */
+
+enum
+{
+       PROP_0,
+       PROP_BUFFER,
+       PROP_LOCATION,
+       PROP_ENCODING,
+       PROP_NEWLINE_TYPE,
+       PROP_COMPRESSION_TYPE
+};
+
+struct _GtkSourceFilePrivate
+{
+       /* Weak ref to the buffer. A strong ref could create a reference cycle
+        * in an application. For example a subclass of GtkSourceBuffer can have
+        * a strong ref to the GtkSourceFile.
+        */
+       GtkSourceBuffer *buffer;
+
+       GFile *location;
+       const GtkSourceEncoding *encoding;
+       GtkSourceNewlineType newline_type;
+       GtkSourceCompressionType compression_type;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (GtkSourceFile, gtk_source_file, G_TYPE_OBJECT)
+
+static void
+gtk_source_file_get_property (GObject    *object,
+                             guint       prop_id,
+                             GValue     *value,
+                             GParamSpec *pspec)
+{
+       GtkSourceFile *file;
+
+       g_return_if_fail (GTK_SOURCE_IS_FILE (object));
+
+       file = GTK_SOURCE_FILE (object);
+
+       switch (prop_id)
+       {
+               case PROP_BUFFER:
+                       g_value_set_object (value, file->priv->buffer);
+                       break;
+
+               case PROP_LOCATION:
+                       g_value_set_object (value, file->priv->location);
+                       break;
+
+               case PROP_ENCODING:
+                       g_value_set_boxed (value, file->priv->encoding);
+                       break;
+
+               case PROP_NEWLINE_TYPE:
+                       g_value_set_enum (value, file->priv->newline_type);
+                       break;
+
+               case PROP_COMPRESSION_TYPE:
+                       g_value_set_enum (value, file->priv->compression_type);
+                       break;
+
+               default:
+                       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+                       break;
+       }
+}
+
+static void
+gtk_source_file_set_property (GObject      *object,
+                             guint         prop_id,
+                             const GValue *value,
+                             GParamSpec   *pspec)
+{
+       GtkSourceFile *file;
+
+       g_return_if_fail (GTK_SOURCE_IS_FILE (object));
+
+       file = GTK_SOURCE_FILE (object);
+
+       switch (prop_id)
+       {
+               case PROP_BUFFER:
+                       g_assert (file->priv->buffer == NULL);
+                       file->priv->buffer = g_value_get_object (value);
+                       g_object_add_weak_pointer (G_OBJECT (file->priv->buffer),
+                                                  (gpointer *) &file->priv->buffer);
+                       break;
+
+               default:
+                       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+                       break;
+       }
+}
+
+static void
+gtk_source_file_dispose (GObject *object)
+{
+       GtkSourceFile *file = GTK_SOURCE_FILE (object);
+
+       if (file->priv->buffer != NULL)
+       {
+               g_object_remove_weak_pointer (G_OBJECT (file->priv->buffer),
+                                             (gpointer *) &file->priv->buffer);
+
+               file->priv->buffer = NULL;
+       }
+
+       g_clear_object (&file->priv->location);
+
+       G_OBJECT_CLASS (gtk_source_file_parent_class)->dispose (object);
+}
+
+static void
+gtk_source_file_class_init (GtkSourceFileClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+       object_class->get_property = gtk_source_file_get_property;
+       object_class->set_property = gtk_source_file_set_property;
+       object_class->dispose = gtk_source_file_dispose;
+
+       /**
+        * GtkSourceFile:buffer:
+        *
+        * The buffer. #GtkSourceFile has a weak reference to the buffer.
+        *
+        * Since: 3.14
+        */
+       g_object_class_install_property (object_class,
+                                        PROP_BUFFER,
+                                        g_param_spec_object ("buffer",
+                                                             "GtkSourceBuffer",
+                                                             "",
+                                                             GTK_SOURCE_TYPE_BUFFER,
+                                                             G_PARAM_READWRITE |
+                                                             G_PARAM_CONSTRUCT_ONLY |
+                                                             G_PARAM_STATIC_STRINGS));
+
+       /**
+        * GtkSourceFile:location:
+        *
+        * The location.
+        *
+        * Since: 3.14
+        */
+       g_object_class_install_property (object_class,
+                                        PROP_LOCATION,
+                                        g_param_spec_object ("location",
+                                                             _("Location"),
+                                                             "",
+                                                             G_TYPE_FILE,
+                                                             G_PARAM_READABLE |
+                                                             G_PARAM_STATIC_STRINGS));
+
+       /**
+        * GtkSourceFile:encoding:
+        *
+        * The character encoding.
+        *
+        * Since: 3.14
+        */
+       g_object_class_install_property (object_class,
+                                        PROP_ENCODING,
+                                        g_param_spec_boxed ("encoding",
+                                                            _("Encoding"),
+                                                            "",
+                                                            GTK_SOURCE_TYPE_ENCODING,
+                                                            G_PARAM_READABLE |
+                                                            G_PARAM_STATIC_STRINGS));
+
+       /**
+        * GtkSourceFile:newline-type:
+        *
+        * The line ending type.
+        *
+        * Since: 3.14
+        */
+       g_object_class_install_property (object_class,
+                                        PROP_NEWLINE_TYPE,
+                                        g_param_spec_enum ("newline-type",
+                                                           _("Newline type"),
+                                                           "",
+                                                           GTK_SOURCE_TYPE_NEWLINE_TYPE,
+                                                           GTK_SOURCE_NEWLINE_TYPE_LF,
+                                                           G_PARAM_READABLE |
+                                                           G_PARAM_STATIC_STRINGS));
+
+       /**
+        * GtkSourceFile:compression-type:
+        *
+        * The compression type.
+        *
+        * Since: 3.14
+        */
+       g_object_class_install_property (object_class,
+                                        PROP_COMPRESSION_TYPE,
+                                        g_param_spec_enum ("compression-type",
+                                                           _("Compression type"),
+                                                           "",
+                                                           GTK_SOURCE_TYPE_COMPRESSION_TYPE,
+                                                           GTK_SOURCE_COMPRESSION_TYPE_NONE,
+                                                           G_PARAM_READABLE |
+                                                           G_PARAM_STATIC_STRINGS));
+}
+
+static void
+gtk_source_file_init (GtkSourceFile *file)
+{
+       file->priv = gtk_source_file_get_instance_private (file);
+
+       file->priv->encoding = gtk_source_encoding_get_utf8 ();
+}
+
+/**
+ * gtk_source_file_new:
+ * @buffer: a #GtkSourceBuffer.
+ *
+ * Returns: a new #GtkSourceFile object.
+ * Since: 3.14
+ */
+GtkSourceFile *
+gtk_source_file_new (GtkSourceBuffer *buffer)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
+
+       return g_object_new (GTK_SOURCE_TYPE_FILE,
+                            "buffer", buffer,
+                            NULL);
+}
+
+/**
+ * gtk_source_file_get_buffer:
+ * @file: a #GtkSourceFile.
+ *
+ * Returns: (transfer none): the buffer.
+ * Since: 3.14
+ */
+GtkSourceBuffer *
+gtk_source_file_get_buffer (GtkSourceFile *file)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), NULL);
+
+       return file->priv->buffer;
+}
+
+void
+_gtk_source_file_set_location (GtkSourceFile *file,
+                              GFile         *location)
+{
+       g_return_if_fail (GTK_SOURCE_IS_FILE (file));
+       g_return_if_fail (G_IS_FILE (location));
+
+       if (file->priv->location != location)
+       {
+               g_clear_object (&file->priv->location);
+               file->priv->location = g_object_ref (location);
+               g_object_notify (G_OBJECT (file), "location");
+       }
+}
+
+/**
+ * gtk_source_file_get_location:
+ * @file: a #GtkSourceFile.
+ *
+ * Returns: (transfer none): the #GFile.
+ * Since: 3.14
+ */
+GFile *
+gtk_source_file_get_location (GtkSourceFile *file)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), NULL);
+
+       return file->priv->location;
+}
+
+void
+_gtk_source_file_set_encoding (GtkSourceFile           *file,
+                              const GtkSourceEncoding *encoding)
+{
+       g_return_if_fail (GTK_SOURCE_IS_FILE (file));
+
+       if (encoding == NULL)
+       {
+               encoding = gtk_source_encoding_get_utf8 ();
+       }
+
+       if (file->priv->encoding != encoding)
+       {
+               file->priv->encoding = encoding;
+               g_object_notify (G_OBJECT (file), "encoding");
+       }
+}
+
+/**
+ * gtk_source_file_get_encoding:
+ * @file: a #GtkSourceFile.
+ *
+ * Returns: the character encoding.
+ * Since: 3.14
+ */
+const GtkSourceEncoding *
+gtk_source_file_get_encoding (GtkSourceFile *file)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), NULL);
+
+       return file->priv->encoding;
+}
+
+void
+_gtk_source_file_set_newline_type (GtkSourceFile        *file,
+                                  GtkSourceNewlineType  newline_type)
+{
+       g_return_if_fail (GTK_SOURCE_IS_FILE (file));
+
+       if (file->priv->newline_type != newline_type)
+       {
+               file->priv->newline_type = newline_type;
+               g_object_notify (G_OBJECT (file), "newline-type");
+       }
+}
+
+/**
+ * gtk_source_file_get_newline_type:
+ * @file: a #GtkSourceFile.
+ *
+ * Returns: the newline type.
+ * Since: 3.14
+ */
+GtkSourceNewlineType
+gtk_source_file_get_newline_type (GtkSourceFile *file)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), GTK_SOURCE_NEWLINE_TYPE_DEFAULT);
+
+       return file->priv->newline_type;
+}
+
+void
+_gtk_source_file_set_compression_type (GtkSourceFile            *file,
+                                      GtkSourceCompressionType  compression_type)
+{
+       g_return_if_fail (GTK_SOURCE_IS_FILE (file));
+
+       if (file->priv->compression_type != compression_type)
+       {
+               file->priv->compression_type = compression_type;
+               g_object_notify (G_OBJECT (file), "compression-type");
+       }
+}
+
+/**
+ * gtk_source_file_get_compression_type:
+ * @file: a #GtkSourceFile.
+ *
+ * Returns: the compression type.
+ * Since: 3.14
+ */
+GtkSourceCompressionType
+gtk_source_file_get_compression_type (GtkSourceFile *file)
+{
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), GTK_SOURCE_COMPRESSION_TYPE_NONE);
+
+       return file->priv->compression_type;
+}
diff --git a/gtksourceview/gtksourcefile.h b/gtksourceview/gtksourcefile.h
new file mode 100644
index 0000000..0748cbe
--- /dev/null
+++ b/gtksourceview/gtksourcefile.h
@@ -0,0 +1,87 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*- */
+/* gtksourcefile.h
+ * This file is part of GtkSourceView
+ *
+ * Copyright (C) 2014 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GTK_SOURCE_FILE_H__
+#define __GTK_SOURCE_FILE_H__
+
+#include <gtk/gtk.h>
+#include <gtksourceview/gtksourcetypes.h>
+
+G_BEGIN_DECLS
+
+#define GTK_SOURCE_TYPE_FILE             (gtk_source_file_get_type ())
+#define GTK_SOURCE_FILE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_FILE, 
GtkSourceFile))
+#define GTK_SOURCE_FILE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_SOURCE_TYPE_FILE, 
GtkSourceFileClass))
+#define GTK_SOURCE_IS_FILE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_SOURCE_TYPE_FILE))
+#define GTK_SOURCE_IS_FILE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_SOURCE_TYPE_FILE))
+#define GTK_SOURCE_FILE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_SOURCE_TYPE_FILE, 
GtkSourceFileClass))
+
+typedef struct _GtkSourceFileClass    GtkSourceFileClass;
+typedef struct _GtkSourceFilePrivate  GtkSourceFilePrivate;
+
+struct _GtkSourceFile
+{
+       GObject parent;
+
+       GtkSourceFilePrivate *priv;
+};
+
+struct _GtkSourceFileClass
+{
+       GObjectClass parent_class;
+};
+
+GType           gtk_source_file_get_type                       (void) G_GNUC_CONST;
+
+GtkSourceFile  *gtk_source_file_new                            (GtkSourceBuffer *buffer);
+
+GtkSourceBuffer        *gtk_source_file_get_buffer                     (GtkSourceFile *file);
+
+GFile          *gtk_source_file_get_location                   (GtkSourceFile *file);
+
+const GtkSourceEncoding *
+                gtk_source_file_get_encoding                   (GtkSourceFile *file);
+
+GtkSourceNewlineType
+                gtk_source_file_get_newline_type               (GtkSourceFile *file);
+
+GtkSourceCompressionType
+                gtk_source_file_get_compression_type           (GtkSourceFile *file);
+
+G_GNUC_INTERNAL
+void            _gtk_source_file_set_location                  (GtkSourceFile *file,
+                                                                GFile         *location);
+
+G_GNUC_INTERNAL
+void            _gtk_source_file_set_encoding                  (GtkSourceFile           *file,
+                                                                const GtkSourceEncoding *encoding);
+
+G_GNUC_INTERNAL
+void            _gtk_source_file_set_newline_type              (GtkSourceFile        *file,
+                                                                GtkSourceNewlineType  newline_type);
+
+G_GNUC_INTERNAL
+void            _gtk_source_file_set_compression_type          (GtkSourceFile            *file,
+                                                                GtkSourceCompressionType  compression_type);
+
+G_END_DECLS
+
+#endif /* __GTK_SOURCE_FILE_H__ */
diff --git a/gtksourceview/gtksourcefileloader.c b/gtksourceview/gtksourcefileloader.c
index de10f74..83bfee1 100644
--- a/gtksourceview/gtksourcefileloader.c
+++ b/gtksourceview/gtksourcefileloader.c
@@ -24,6 +24,7 @@
 
 #include <gio/gio.h>
 #include "gtksourcefileloader.h"
+#include "gtksourcefile.h"
 #include "gtksourcebufferoutputstream.h"
 #include "gtksourceencoding.h"
 #include "gtksourcebuffer-private.h"
@@ -34,7 +35,7 @@
  * SECTION:fileloader
  * @Short_description: Load a file into a GtkSourceBuffer
  * @Title: GtkSourceFileLoader
- * @See_also: #GtkSourceFileSaver, #GtkSourceBuffer
+ * @See_also: #GtkSourceFile, #GtkSourceFileSaver
  *
  * A #GtkSourceFileLoader object permits to load the content of a #GFile or a
  * #GInputStream into a #GtkSourceBuffer.
@@ -49,8 +50,8 @@
 enum
 {
        PROP_0,
-       PROP_BUFFER,
        PROP_FILE,
+       PROP_LOCATION,
        PROP_INPUT_STREAM
 };
 
@@ -63,17 +64,13 @@ enum
 
 struct _GtkSourceFileLoaderPrivate
 {
-       /* Weak reference to the source_buffer. A subclass of GtkSourceBuffer
-        * can have the ownership of the FileLoader. And a FileLoader can be
-        * used several times, so the object can be kept around until the
-        * subclass of GtkSourceBuffer is disposed.
-        * The GtkSourceBufferOutputStream has a strong reference to the
-        * source_buffer, so the buffer will not be finalized when the file is
-        * being loaded. So there can be a temporary reference cycle.
-         */
-       GtkSourceBuffer *source_buffer;
+       /* Weak ref to the GtkSourceFile. A strong ref could create a reference
+        * cycle in an application. For example a subclass of GtkSourceFile can
+        * have a strong ref to the FileLoader.
+        */
+       GtkSourceFile *file;
 
-       GFile *file;
+       GFile *location;
 
        /* The value of the "input-stream" property. */
        GInputStream *input_stream_property;
@@ -141,16 +138,16 @@ gtk_source_file_loader_set_property (GObject      *object,
 
        switch (prop_id)
        {
-               case PROP_BUFFER:
-                       g_assert (loader->priv->source_buffer == NULL);
-                       loader->priv->source_buffer = g_value_get_object (value);
-                       g_object_add_weak_pointer (G_OBJECT (loader->priv->source_buffer),
-                                                  (gpointer *)&loader->priv->source_buffer);
-                       break;
-
                case PROP_FILE:
                        g_assert (loader->priv->file == NULL);
-                       loader->priv->file = g_value_dup_object (value);
+                       loader->priv->file = g_value_get_object (value);
+                       g_object_add_weak_pointer (G_OBJECT (loader->priv->file),
+                                                  (gpointer *)&loader->priv->file);
+                       break;
+
+               case PROP_LOCATION:
+                       g_assert (loader->priv->location == NULL);
+                       loader->priv->location = g_value_dup_object (value);
                        break;
 
                case PROP_INPUT_STREAM:
@@ -174,14 +171,14 @@ gtk_source_file_loader_get_property (GObject    *object,
 
        switch (prop_id)
        {
-               case PROP_BUFFER:
-                       g_value_set_object (value, loader->priv->source_buffer);
-                       break;
-
                case PROP_FILE:
                        g_value_set_object (value, loader->priv->file);
                        break;
 
+               case PROP_LOCATION:
+                       g_value_set_object (value, loader->priv->location);
+                       break;
+
                case PROP_INPUT_STREAM:
                        g_value_set_object (value, loader->priv->input_stream_property);
                        break;
@@ -208,15 +205,15 @@ gtk_source_file_loader_dispose (GObject *object)
 
        reset (loader);
 
-       if (loader->priv->source_buffer != NULL)
+       if (loader->priv->file != NULL)
        {
-               g_object_remove_weak_pointer (G_OBJECT (loader->priv->source_buffer),
-                                             (gpointer *)&loader->priv->source_buffer);
+               g_object_remove_weak_pointer (G_OBJECT (loader->priv->file),
+                                             (gpointer *)&loader->priv->file);
 
-               loader->priv->source_buffer = NULL;
+               loader->priv->file = NULL;
        }
 
-       g_clear_object (&loader->priv->file);
+       g_clear_object (&loader->priv->location);
        g_clear_object (&loader->priv->input_stream_property);
 
        g_slist_free (loader->priv->candidate_encodings);
@@ -230,11 +227,11 @@ gtk_source_file_loader_constructed (GObject *object)
 {
        GtkSourceFileLoader *loader = GTK_SOURCE_FILE_LOADER (object);
 
-       if (loader->priv->source_buffer != NULL)
+       if (loader->priv->file != NULL)
        {
                const GtkSourceEncoding *encoding;
 
-               encoding = gtk_source_buffer_get_encoding (loader->priv->source_buffer);
+               encoding = gtk_source_file_get_encoding (loader->priv->file);
 
                g_slist_free (loader->priv->candidate_encodings);
                loader->priv->candidate_encodings = g_slist_prepend (NULL, (gpointer) encoding);
@@ -249,36 +246,36 @@ gtk_source_file_loader_class_init (GtkSourceFileLoaderClass *klass)
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->dispose = gtk_source_file_loader_dispose;
-       object_class->get_property = gtk_source_file_loader_get_property;
        object_class->set_property = gtk_source_file_loader_set_property;
+       object_class->get_property = gtk_source_file_loader_get_property;
        object_class->constructed = gtk_source_file_loader_constructed;
 
        /**
-        * GtkSourceFileLoader:buffer:
+        * GtkSourceFileLoader:file:
         *
-        * The output #GtkSourceBuffer.
+        * The #GtkSourceFile.
         *
         * Since: 3.14
         */
-       g_object_class_install_property (object_class, PROP_BUFFER,
-                                        g_param_spec_object ("buffer",
-                                                             "GtkSourceBuffer",
+       g_object_class_install_property (object_class, PROP_FILE,
+                                        g_param_spec_object ("file",
+                                                             "GtkSourceFile",
                                                              "",
-                                                             GTK_SOURCE_TYPE_BUFFER,
+                                                             GTK_SOURCE_TYPE_FILE,
                                                              G_PARAM_READWRITE |
                                                              G_PARAM_CONSTRUCT_ONLY |
                                                              G_PARAM_STATIC_STRINGS));
 
        /**
-        * GtkSourceFileLoader:file:
+        * GtkSourceFileLoader:location:
         *
         * The #GFile to load.
         *
         * Since: 3.14
         */
-       g_object_class_install_property (object_class, PROP_FILE,
-                                        g_param_spec_object ("file",
-                                                             _("File"),
+       g_object_class_install_property (object_class, PROP_LOCATION,
+                                        g_param_spec_object ("location",
+                                                             _("Location"),
                                                              "",
                                                              G_TYPE_FILE,
                                                              G_PARAM_READWRITE |
@@ -288,9 +285,8 @@ gtk_source_file_loader_class_init (GtkSourceFileLoaderClass *klass)
        /**
         * GtkSourceFileLoader:input-stream:
         *
-        * The #GInputStream to load. Useful for reading e.g. stdin. If this
-        * property is set, it has a higher priority than
-        * the #GtkSourceFileLoader:file property.
+        * The #GInputStream to load. Useful for reading stdin. If this property
+        * is set, the #GtkSourceFileLoader:location property is ignored.
         *
         * Since: 3.14
         */
@@ -636,7 +632,7 @@ recover_not_mounted (GtkSourceFileLoader *loader)
 
        loader->priv->tried_mount = TRUE;
 
-       g_file_mount_enclosing_volume (loader->priv->file,
+       g_file_mount_enclosing_volume (loader->priv->location,
                                       G_MOUNT_MOUNT_NONE,
                                       mount_operation,
                                       g_task_get_cancellable (loader->priv->task),
@@ -690,7 +686,7 @@ open_file_cb (GFile               *file,
 static void
 open_file (GtkSourceFileLoader *loader)
 {
-       g_file_read_async (loader->priv->file,
+       g_file_read_async (loader->priv->location,
                           g_task_get_priority (loader->priv->task),
                           g_task_get_cancellable (loader->priv->task),
                           (GAsyncReadyCallback) open_file_cb,
@@ -719,15 +715,15 @@ gtk_source_file_loader_error_quark (void)
  * Since: 3.14
  */
 GtkSourceFileLoader *
-gtk_source_file_loader_new (GtkSourceBuffer *buffer,
-                           GFile           *file)
+gtk_source_file_loader_new (GtkSourceFile *file,
+                           GFile         *location)
 {
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
-       g_return_val_if_fail (G_IS_FILE (file), NULL);
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), NULL);
+       g_return_val_if_fail (G_IS_FILE (location), NULL);
 
        return g_object_new (GTK_SOURCE_TYPE_FILE_LOADER,
-                            "buffer", buffer,
                             "file", file,
+                            "location", location,
                             NULL);
 }
 
@@ -740,14 +736,14 @@ gtk_source_file_loader_new (GtkSourceBuffer *buffer,
  * Since: 3.14
  */
 GtkSourceFileLoader *
-gtk_source_file_loader_new_from_stream (GtkSourceBuffer *buffer,
-                                       GInputStream    *stream)
+gtk_source_file_loader_new_from_stream (GtkSourceFile *file,
+                                       GInputStream  *stream)
 {
-       g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
+       g_return_val_if_fail (GTK_SOURCE_IS_FILE (file), NULL);
        g_return_val_if_fail (G_IS_INPUT_STREAM (stream), NULL);
 
        return g_object_new (GTK_SOURCE_TYPE_FILE_LOADER,
-                            "buffer", buffer,
+                            "file", file,
                             "input-stream", stream,
                             NULL);
 }
@@ -774,22 +770,22 @@ gtk_source_file_loader_set_candidate_encodings (GtkSourceFileLoader *loader,
 }
 
 /**
- * gtk_source_file_loader_get_buffer:
+ * gtk_source_file_loader_get_file:
  * @loader: a #GtkSourceFileLoader.
  *
- * Returns: (transfer none): the #GtkSourceBuffer to load the content into.
+ * Returns: (transfer none): the #GtkSourceFile.
  * Since: 3.14
  */
-GtkSourceBuffer *
-gtk_source_file_loader_get_buffer (GtkSourceFileLoader *loader)
+GtkSourceFile *
+gtk_source_file_loader_get_file (GtkSourceFileLoader *loader)
 {
        g_return_val_if_fail (GTK_SOURCE_IS_FILE_LOADER (loader), NULL);
 
-       return loader->priv->source_buffer;
+       return loader->priv->file;
 }
 
 /**
- * gtk_source_file_loader_get_file:
+ * gtk_source_file_loader_get_location:
  * @loader: a #GtkSourceFileLoader.
  *
  * Returns: (transfer none): the #GFile to load, or %NULL if an input stream is
@@ -797,18 +793,18 @@ gtk_source_file_loader_get_buffer (GtkSourceFileLoader *loader)
  * Since: 3.14
  */
 GFile *
-gtk_source_file_loader_get_file (GtkSourceFileLoader *loader)
+gtk_source_file_loader_get_location (GtkSourceFileLoader *loader)
 {
        g_return_val_if_fail (GTK_SOURCE_IS_FILE_LOADER (loader), NULL);
 
-       return loader->priv->file;
+       return loader->priv->location;
 }
 
 /**
  * gtk_source_file_loader_get_input_stream:
  * @loader: a #GtkSourceFileLoader.
  *
- * Returns: (transfer none): the #GInputStream to load, or %NULL if a file is
+ * Returns: (transfer none): the #GInputStream to load, or %NULL if a #GFile is
  *   used.
  * Since: 3.14
  */
@@ -848,11 +844,24 @@ gtk_source_file_loader_load_async (GtkSourceFileLoader   *loader,
                                   GAsyncReadyCallback    callback,
                                   gpointer               user_data)
 {
+       GtkSourceBuffer *buffer;
        gboolean implicit_trailing_newline;
 
        g_return_if_fail (GTK_SOURCE_IS_FILE_LOADER (loader));
        g_return_if_fail (loader->priv->task == NULL);
 
+       if (loader->priv->file == NULL)
+       {
+               return;
+       }
+
+       buffer = gtk_source_file_get_buffer (loader->priv->file);
+
+       if (buffer == NULL)
+       {
+               return;
+       }
+
        reset (loader);
 
        loader->priv->task = g_task_new (loader, cancellable, callback, user_data);
@@ -865,13 +874,13 @@ gtk_source_file_loader_load_async (GtkSourceFileLoader   *loader,
               g_print ("Start loading\n");
        });
 
-       implicit_trailing_newline = gtk_source_buffer_get_implicit_trailing_newline 
(loader->priv->source_buffer);
+       implicit_trailing_newline = gtk_source_buffer_get_implicit_trailing_newline (buffer);
 
        /* The BufferOutputStream has a strong reference to the source_buffer.
          * We create the BufferOutputStream here so we are sure that the
          * source_buffer will not be destroyed during the file loading.
          */
-       loader->priv->output_stream = gtk_source_buffer_output_stream_new (loader->priv->source_buffer,
+       loader->priv->output_stream = gtk_source_buffer_output_stream_new (buffer,
                                                                           loader->priv->candidate_encodings,
                                                                           implicit_trailing_newline);
 
@@ -896,11 +905,11 @@ gtk_source_file_loader_load_async (GtkSourceFileLoader   *loader,
  *
  * Finishes a file loading started with gtk_source_file_loader_load_async().
  *
- * If the file has been loaded, the following #GtkSourceBuffer properties will
- * be updated: the file, the encoding, the newline type and the compression
+ * If the file has been loaded, the following #GtkSourceFile properties will be
+ * updated: the location, the encoding, the newline type and the compression
  * type.
  *
- * Returns: whether the file was loaded successfully.
+ * Returns: whether the file has been loaded successfully.
  * Since: 3.14
  */
 gboolean
@@ -923,31 +932,38 @@ gtk_source_file_loader_load_finish (GtkSourceFileLoader  *loader,
                *error = g_error_copy (real_error);
        }
 
-       /* Update the buffer properties if the file has been loaded. The file
-        * can be loaded successfully, or there can be encoding conversion
-        * errors with fallback characters. In the latter case, the encoding may
-        * be wrong, but since the file has anyway be loaded, the buffer
-        * properties must be updated.
-        * With the other errors, normally the file hasn't been loaded into the
-        * buffer, i.e. the buffer is still empty.
+       /* Update the file properties if the contents has been loaded. The
+        * contents can be loaded successfully, or there can be encoding
+        * conversion errors with fallback characters. In the latter case, the
+        * encoding may be wrong, but since the contents has anyway be loaded,
+        * the file properties must be updated.
+        * With the other errors, normally the contents hasn't been loaded into
+        * the buffer, i.e. the buffer is still empty.
         */
        update_buffer_properties = ok || (real_error != NULL &&
                                          real_error->domain == GTK_SOURCE_FILE_LOADER_ERROR &&
                                          real_error->code == 
GTK_SOURCE_FILE_LOADER_ERROR_CONVERSION_FALLBACK);
 
-       if (update_buffer_properties && loader->priv->source_buffer != NULL)
+       if (update_buffer_properties && loader->priv->file != NULL)
        {
-               _gtk_source_buffer_set_file (loader->priv->source_buffer,
-                                            loader->priv->file);
+               if (loader->priv->input_stream_property != NULL)
+               {
+                       _gtk_source_file_set_location (loader->priv->file, NULL);
+               }
+               else
+               {
+                       _gtk_source_file_set_location (loader->priv->file,
+                                                      loader->priv->location);
+               }
 
-               _gtk_source_buffer_set_encoding (loader->priv->source_buffer,
-                                                loader->priv->auto_detected_encoding);
+               _gtk_source_file_set_encoding (loader->priv->file,
+                                              loader->priv->auto_detected_encoding);
 
-               _gtk_source_buffer_set_newline_type (loader->priv->source_buffer,
-                                                    loader->priv->auto_detected_newline_type);
+               _gtk_source_file_set_newline_type (loader->priv->file,
+                                                  loader->priv->auto_detected_newline_type);
 
-               _gtk_source_buffer_set_compression_type (loader->priv->source_buffer,
-                                                        loader->priv->auto_detected_compression_type);
+               _gtk_source_file_set_compression_type (loader->priv->file,
+                                                      loader->priv->auto_detected_compression_type);
        }
 
        reset (loader);
diff --git a/gtksourceview/gtksourcefileloader.h b/gtksourceview/gtksourcefileloader.h
index e6cd1e1..2ac3ced 100644
--- a/gtksourceview/gtksourcefileloader.h
+++ b/gtksourceview/gtksourcefileloader.h
@@ -77,19 +77,19 @@ GType                        gtk_source_file_loader_get_type        (void) G_GNUC_CONST;
 
 GQuark                  gtk_source_file_loader_error_quark     (void);
 
-GtkSourceFileLoader    *gtk_source_file_loader_new             (GtkSourceBuffer         *buffer,
-                                                                GFile                   *file);
+GtkSourceFileLoader    *gtk_source_file_loader_new             (GtkSourceFile           *file,
+                                                                GFile                   *location);
 
-GtkSourceFileLoader    *gtk_source_file_loader_new_from_stream (GtkSourceBuffer         *buffer,
+GtkSourceFileLoader    *gtk_source_file_loader_new_from_stream (GtkSourceFile           *file,
                                                                 GInputStream            *stream);
 
 void                    gtk_source_file_loader_set_candidate_encodings
                                                                (GtkSourceFileLoader     *loader,
                                                                 GSList                  
*candidate_encodings);
 
-GtkSourceBuffer                *gtk_source_file_loader_get_buffer      (GtkSourceFileLoader     *loader);
+GtkSourceFile          *gtk_source_file_loader_get_file        (GtkSourceFileLoader     *loader);
 
-GFile                  *gtk_source_file_loader_get_file        (GtkSourceFileLoader     *loader);
+GFile                  *gtk_source_file_loader_get_location    (GtkSourceFileLoader     *loader);
 
 GInputStream           *gtk_source_file_loader_get_input_stream
                                                                (GtkSourceFileLoader     *loader);
diff --git a/gtksourceview/gtksourcetypes.h b/gtksourceview/gtksourcetypes.h
index b0ce6bd..c646c91 100644
--- a/gtksourceview/gtksourcetypes.h
+++ b/gtksourceview/gtksourcetypes.h
@@ -34,6 +34,7 @@ typedef struct _GtkSourceCompletionItem               GtkSourceCompletionItem;
 typedef struct _GtkSourceCompletionProposal    GtkSourceCompletionProposal;
 typedef struct _GtkSourceCompletionProvider    GtkSourceCompletionProvider;
 typedef struct _GtkSourceEncoding              GtkSourceEncoding;
+typedef struct _GtkSourceFile                  GtkSourceFile;
 typedef struct _GtkSourceFileLoader            GtkSourceFileLoader;
 typedef struct _GtkSourceFileSaver             GtkSourceFileSaver;
 typedef struct _GtkSourceGutter                        GtkSourceGutter;



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