[gtksourceview] Move enum types from gtksourcetypes.h to where they are used



commit 45b102f4a3091f0dddd475821ad44fb992b66b3d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jul 21 13:03:54 2016 +0200

    Move enum types from gtksourcetypes.h to where they are used
    
    It's better to keep related code together.
    
    GtkSourceBackgroundPatternType is used only in gtksourceview.[ch].
    The NewlineType and CompressionType enums are used for file loading and
    saving, and gtksourcefile.h is the obvious place for that, since it's
    where the newline type and compression type are stored.

 gtksourceview/gtksourcebufferinputstream.h  |    1 +
 gtksourceview/gtksourcebufferoutputstream.h |    1 +
 gtksourceview/gtksourcefile.h               |   42 ++++++++++++++++++++
 gtksourceview/gtksourcefileloader.h         |    1 +
 gtksourceview/gtksourcefilesaver.h          |    1 +
 gtksourceview/gtksourcetypes.h              |   57 +--------------------------
 gtksourceview/gtksourceview.h               |   13 ++++++
 7 files changed, 60 insertions(+), 56 deletions(-)
---
diff --git a/gtksourceview/gtksourcebufferinputstream.h b/gtksourceview/gtksourcebufferinputstream.h
index 375cca4..6487eec 100644
--- a/gtksourceview/gtksourcebufferinputstream.h
+++ b/gtksourceview/gtksourcebufferinputstream.h
@@ -27,6 +27,7 @@
 #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 6397fa1..87fa204 100644
--- a/gtksourceview/gtksourcebufferoutputstream.h
+++ b/gtksourceview/gtksourcebufferoutputstream.h
@@ -27,6 +27,7 @@
 #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 aae20f7..47b6bc6 100644
--- a/gtksourceview/gtksourcefile.h
+++ b/gtksourceview/gtksourcefile.h
@@ -46,6 +46,48 @@ 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 _GtkSourceNewlineType
+{
+       GTK_SOURCE_NEWLINE_TYPE_LF,
+       GTK_SOURCE_NEWLINE_TYPE_CR,
+       GTK_SOURCE_NEWLINE_TYPE_CR_LF
+} GtkSourceNewlineType;
+
+/**
+ * GTK_SOURCE_NEWLINE_TYPE_DEFAULT:
+ *
+ * The default newline type on the current OS.
+ *
+ * Since: 3.14
+ */
+#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
+
+/**
+ * GtkSourceCompressionType:
+ * @GTK_SOURCE_COMPRESSION_TYPE_NONE: plain text.
+ * @GTK_SOURCE_COMPRESSION_TYPE_GZIP: gzip compression.
+ *
+ * Since: 3.14
+ */
+typedef enum _GtkSourceCompressionType
+{
+       GTK_SOURCE_COMPRESSION_TYPE_NONE,
+       GTK_SOURCE_COMPRESSION_TYPE_GZIP
+} GtkSourceCompressionType;
+
+/**
  * GtkSourceMountOperationFactory:
  * @file: a #GtkSourceFile.
  * @userdata: user data
diff --git a/gtksourceview/gtksourcefileloader.h b/gtksourceview/gtksourcefileloader.h
index a710523..79ec902 100644
--- a/gtksourceview/gtksourcefileloader.h
+++ b/gtksourceview/gtksourcefileloader.h
@@ -35,6 +35,7 @@
 
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksourcetypes.h>
+#include <gtksourceview/gtksourcefile.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtksourceview/gtksourcefilesaver.h b/gtksourceview/gtksourcefilesaver.h
index fac8904..ccc51fa 100644
--- a/gtksourceview/gtksourcefilesaver.h
+++ b/gtksourceview/gtksourcefilesaver.h
@@ -35,6 +35,7 @@
 
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksourcetypes.h>
+#include <gtksourceview/gtksourcefile.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtksourceview/gtksourcetypes.h b/gtksourceview/gtksourcetypes.h
index fd2fc4d..a134a6a 100644
--- a/gtksourceview/gtksourcetypes.h
+++ b/gtksourceview/gtksourcetypes.h
@@ -2,7 +2,7 @@
  * gtksourcetypes.h
  * This file is part of GtkSourceView
  *
- * Copyright (C) 2012-2014 - Sébastien Wilmet <swilmet gnome org>
+ * Copyright (C) 2012-2016 - 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
@@ -64,61 +64,6 @@ typedef struct _GtkSourceTag                 GtkSourceTag;
 typedef struct _GtkSourceUndoManager           GtkSourceUndoManager;
 typedef struct _GtkSourceView                  GtkSourceView;
 
-/**
- * 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 _GtkSourceNewlineType
-{
-       GTK_SOURCE_NEWLINE_TYPE_LF,
-       GTK_SOURCE_NEWLINE_TYPE_CR,
-       GTK_SOURCE_NEWLINE_TYPE_CR_LF
-} GtkSourceNewlineType;
-
-/**
- * GTK_SOURCE_NEWLINE_TYPE_DEFAULT:
- *
- * The default newline type on the current OS.
- *
- * Since: 3.14
- */
-#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
-
-/**
- * GtkSourceCompressionType:
- * @GTK_SOURCE_COMPRESSION_TYPE_NONE: plain text.
- * @GTK_SOURCE_COMPRESSION_TYPE_GZIP: gzip compression.
- *
- * Since: 3.14
- */
-typedef enum _GtkSourceCompressionType
-{
-       GTK_SOURCE_COMPRESSION_TYPE_NONE,
-       GTK_SOURCE_COMPRESSION_TYPE_GZIP
-} GtkSourceCompressionType;
-
-/**
- * GtkSourceBackgroundPatternType:
- * @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE: no pattern
- * @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID: grid pattern
- *
- * Since: 3.16
- */
-typedef enum _GtkSourceBackgroundPatternType
-{
-       GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE,
-       GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID
-} GtkSourceBackgroundPatternType;
-
 G_END_DECLS
 
 #endif /* GTK_SOURCE_TYPES_H */
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index 30f6ebe..8e05db6 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -108,6 +108,19 @@ typedef enum _GtkSourceDrawSpacesFlags
        GTK_SOURCE_DRAW_SPACES_ALL        = 0x7f
 } GtkSourceDrawSpacesFlags;
 
+/**
+ * GtkSourceBackgroundPatternType:
+ * @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE: no pattern
+ * @GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID: grid pattern
+ *
+ * Since: 3.16
+ */
+typedef enum _GtkSourceBackgroundPatternType
+{
+       GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE,
+       GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID
+} GtkSourceBackgroundPatternType;
+
 struct _GtkSourceView
 {
        GtkTextView parent;


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