[gtksourceview/wip/loader-saver: 2/5] Move some type definitions from File to Buffer
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/loader-saver: 2/5] Move some type definitions from File to Buffer
- Date: Sun, 16 Mar 2014 18:42:38 +0000 (UTC)
commit a477693bf692949921ddbf43897ca6f23b09bd98
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Mar 14 16:34:56 2014 +0100
Move some type definitions from File to Buffer
The plan is to remove GtkSourceFile, and make the FileLoader and
FileSaver public.
gtksourceview/gtksourcebuffer.h | 53 +++++++++++++++++++++++++++
gtksourceview/gtksourcebufferinputstream.h | 1 +
gtksourceview/gtksourcebufferoutputstream.h | 1 +
gtksourceview/gtksourcefile.h | 53 +--------------------------
4 files changed, 56 insertions(+), 52 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index f04facb..dad9348 100644
--- a/gtksourceview/gtksourcebuffer.h
+++ b/gtksourceview/gtksourcebuffer.h
@@ -6,6 +6,7 @@
* Chris Phelps <chicane reninet com> and
* Jeroen Zwartepoorte <jeroen xs4all nl>
* Copyright (C) 2003 - Paolo Maggi, Gustavo Giráldez
+ * 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
@@ -73,6 +74,58 @@ typedef enum
GTK_SOURCE_CHANGE_CASE_TITLE
} GtkSourceChangeCaseType;
+/**
+ * GtkSourceNewlineType:
+ * @GTK_SOURCE_NEWLINE_TYPE_LF: line feed, used on UNIX.
+ * @GTK_SOURCE_NEWLINE_TYPE_CR: carriage return, used on Mac.
+ * @GTK_SOURCE_NEWLINE_TYPE_CR_LF: carriage return followed by a line feed, used
+ * on Windows.
+ *
+ * Since: 3.14
+ */
+typedef enum
+{
+ GTK_SOURCE_NEWLINE_TYPE_LF,
+ GTK_SOURCE_NEWLINE_TYPE_CR,
+ GTK_SOURCE_NEWLINE_TYPE_CR_LF
+} GtkSourceNewlineType;
+
+#ifdef G_OS_WIN32
+#define GTK_SOURCE_NEWLINE_TYPE_DEFAULT GTK_SOURCE_NEWLINE_TYPE_CR_LF
+#else
+#define GTK_SOURCE_NEWLINE_TYPE_DEFAULT GTK_SOURCE_NEWLINE_TYPE_LF
+#endif
+
+/* NOTE: when adding a new compression type, make sure to update:
+ * 1) The buffer loader to support it
+ * 2) gedit_document_compression_type_for_display
+ * TODO update this comment when finished
+ */
+
+/**
+ * GtkSourceCompressionType:
+ * @GTK_SOURCE_COMPRESSION_TYPE_NONE: save file in plain text.
+ * @GTK_SOURCE_COMPRESSION_TYPE_GZIP: save file using gzip compression.
+ *
+ * Since: 3.14
+ */
+typedef enum
+{
+ GTK_SOURCE_COMPRESSION_TYPE_NONE,
+ GTK_SOURCE_COMPRESSION_TYPE_GZIP
+} GtkSourceCompressionType;
+
+/**
+ * GtkSourceMountOperationFactory:
+ * @userdata: user data
+ *
+ * Type definition for a function that will be called to create a
+ * #GMountOperation. This is useful for creating a #GtkMountOperation.
+ *
+ * Since: 3.14
+ */
+typedef GMountOperation *(*GtkSourceMountOperationFactory)(gpointer userdata);
+
struct _GtkSourceBuffer
{
GtkTextBuffer parent_instance;
diff --git a/gtksourceview/gtksourcebufferinputstream.h b/gtksourceview/gtksourcebufferinputstream.h
index 08f980e..d3d990e 100644
--- a/gtksourceview/gtksourcebufferinputstream.h
+++ b/gtksourceview/gtksourcebufferinputstream.h
@@ -26,6 +26,7 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include "gtksourcetypes-private.h"
+#include "gtksourcebuffer.h"
#include "gtksourcefile.h"
G_BEGIN_DECLS
diff --git a/gtksourceview/gtksourcebufferoutputstream.h b/gtksourceview/gtksourcebufferoutputstream.h
index 13228d0..4f93ca8 100644
--- a/gtksourceview/gtksourcebufferoutputstream.h
+++ b/gtksourceview/gtksourcebufferoutputstream.h
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include "gtksourcetypes.h"
#include "gtksourcetypes-private.h"
+#include "gtksourcebuffer.h"
#include "gtksourcefile.h"
G_BEGIN_DECLS
diff --git a/gtksourceview/gtksourcefile.h b/gtksourceview/gtksourcefile.h
index 3af168f..33d85e7 100644
--- a/gtksourceview/gtksourcefile.h
+++ b/gtksourceview/gtksourcefile.h
@@ -24,6 +24,7 @@
#include <gio/gio.h>
#include <gtksourceview/gtksourcetypes.h>
+#include <gtksourceview/gtksourcebuffer.h>
G_BEGIN_DECLS
@@ -38,47 +39,6 @@ typedef struct _GtkSourceFileClass GtkSourceFileClass;
typedef struct _GtkSourceFilePrivate GtkSourceFilePrivate;
/**
- * GtkSourceNewlineType:
- * @GTK_SOURCE_NEWLINE_TYPE_LF: line feed, used on UNIX.
- * @GTK_SOURCE_NEWLINE_TYPE_CR: carriage return, used on Mac.
- * @GTK_SOURCE_NEWLINE_TYPE_CR_LF: carriage return followed by a line feed, used
- * on Windows.
- *
- * Since: 3.14
- */
-typedef enum
-{
- GTK_SOURCE_NEWLINE_TYPE_LF,
- GTK_SOURCE_NEWLINE_TYPE_CR,
- GTK_SOURCE_NEWLINE_TYPE_CR_LF
-} GtkSourceNewlineType;
-
-#ifdef G_OS_WIN32
-#define GTK_SOURCE_NEWLINE_TYPE_DEFAULT GTK_SOURCE_NEWLINE_TYPE_CR_LF
-#else
-#define GTK_SOURCE_NEWLINE_TYPE_DEFAULT GTK_SOURCE_NEWLINE_TYPE_LF
-#endif
-
-/* NOTE: when adding a new compression type, make sure to update:
- * 1) The buffer loader to support it
- * 2) gedit_document_compression_type_for_display
- * TODO update this comment when finished
- */
-
-/**
- * GtkSourceCompressionType:
- * @GTK_SOURCE_COMPRESSION_TYPE_NONE: save file in plain text.
- * @GTK_SOURCE_COMPRESSION_TYPE_GZIP: save file using gzip compression.
- *
- * Since: 3.14
- */
-typedef enum
-{
- GTK_SOURCE_COMPRESSION_TYPE_NONE,
- GTK_SOURCE_COMPRESSION_TYPE_GZIP
-} GtkSourceCompressionType;
-
-/**
* GtkSourceFileSaveFlags:
* @GTK_SOURCE_FILE_SAVE_IGNORE_MTIME: save file despite external modifications.
* @GTK_SOURCE_FILE_SAVE_CREATE_BACKUP: create a backup before saving the file.
@@ -106,17 +66,6 @@ enum
GTK_SOURCE_FILE_ERROR_CONVERSION_FALLBACK
};
-/**
- * GtkSourceMountOperationFactory:
- * @userdata: user data
- *
- * Type definition for a function that will be called to create a
- * #GMountOperation. This is useful for creating a #GtkMountOperation.
- *
- * Since: 3.14
- */
-typedef GMountOperation *(*GtkSourceMountOperationFactory)(gpointer userdata);
-
struct _GtkSourceFile
{
GObject parent;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]