[gtksourceview/wip/loader-saver] GtkSourceFile, the come back (not finished)
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/loader-saver] GtkSourceFile, the come back (not finished)
- Date: Thu, 5 Jun 2014 21:02:46 +0000 (UTC)
commit f7b1dd0a13123e82527b5901519a365befcc2068
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 | 214 +----------------------
gtksourceview/gtksourcebuffer.h | 8 -
gtksourceview/gtksourcefile.c | 293 +++++++++++++++++++++++++++++++
gtksourceview/gtksourcefile.h | 83 +++++++++
gtksourceview/gtksourcetypes.h | 1 +
8 files changed, 385 insertions(+), 237 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..b889fa8 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.
@@ -781,22 +708,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 +2542,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 +2572,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..a8c9a78
--- /dev/null
+++ b/gtksourceview/gtksourcefile.c
@@ -0,0 +1,293 @@
+/* -*- 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"
+
+enum
+{
+ PROP_0,
+ PROP_LOCATION,
+ PROP_ENCODING,
+ PROP_NEWLINE_TYPE,
+ PROP_COMPRESSION_TYPE
+};
+
+struct _GtkSourceFilePrivate
+{
+ 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_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_dispose (GObject *object)
+{
+
+ G_OBJECT_CLASS (gtk_source_file_parent_class)->dispose (object);
+}
+
+static void
+gtk_source_file_finalize (GObject *object)
+{
+
+ G_OBJECT_CLASS (gtk_source_file_parent_class)->finalize (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->dispose = gtk_source_file_dispose;
+ object_class->finalize = gtk_source_file_finalize;
+
+ /**
+ * 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);
+}
+
+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..ab3b242
--- /dev/null
+++ b/gtksourceview/gtksourcefile.h
@@ -0,0 +1,83 @@
+/* -*- 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;
+
+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/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]