[gtksourceview/wip/loader-saver: 3/5] Make the FileSaver class public



commit 2df6bf311ba907f37095c6eb18373a08aa9e2ee3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Mar 14 16:56:00 2014 +0100

    Make the FileSaver class public
    
    The FileSaver cannot be used as-is, there are still modifications to do.

 docs/reference/Makefile.am             |    1 -
 gtksourceview/Makefile.am              |    4 ++--
 gtksourceview/gtksourcefile.h          |   18 +-----------------
 gtksourceview/gtksourcefilesaver.h     |   27 +++++++++++++++++++--------
 gtksourceview/gtksourcetypes-private.h |    1 -
 gtksourceview/gtksourcetypes.h         |    1 +
 6 files changed, 23 insertions(+), 29 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index ab6c2ed..06afa8e 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -34,7 +34,6 @@ IGNORE_HFILES =                                       \
        gtksourcecontextengine.h                \
        gtksourceengine.h                       \
        gtksourcefileloader.h                   \
-       gtksourcefilesaver.h                    \
        gtksourcegutter-private.h               \
        gtksourcegutterrendererlines.h          \
        gtksourcegutterrenderermarks.h          \
diff --git a/gtksourceview/Makefile.am b/gtksourceview/Makefile.am
index e2c5071..2f1406d 100644
--- a/gtksourceview/Makefile.am
+++ b/gtksourceview/Makefile.am
@@ -32,6 +32,7 @@ libgtksourceview_headers =                    \
        gtksourcecompletionprovider.h           \
        gtksourceencoding.h                     \
        gtksourcefile.h                         \
+       gtksourcefilesaver.h                    \
        gtksourcegutter.h                       \
        gtksourcegutterrenderer.h               \
        gtksourcegutterrendererpixbuf.h         \
@@ -61,7 +62,6 @@ libgtksourceview_private_headers = \
        gtksourcecontextengine.h                \
        gtksourceengine.h                       \
        gtksourcefileloader.h                   \
-       gtksourcefilesaver.h                    \
        gtksourcegutter-private.h               \
        gtksourcegutterrendererlines.h          \
        gtksourcegutterrenderermarks.h          \
@@ -85,7 +85,6 @@ libgtksourceview_private_c_files = \
        gtksourcecontextengine.c        \
        gtksourceengine.c               \
        gtksourcefileloader.c           \
-       gtksourcefilesaver.c            \
        gtksourcegutterrendererlines.c  \
        gtksourcegutterrenderermarks.c  \
        gtksourcelanguage-parser-1.c    \
@@ -109,6 +108,7 @@ libgtksourceview_c_files = \
        gtksourcecompletionprovider.c   \
        gtksourceencoding.c             \
        gtksourcefile.c                 \
+       gtksourcefilesaver.c            \
        gtksourcegutter.c               \
        gtksourcegutterrenderer.c       \
        gtksourcegutterrendererpixbuf.c \
diff --git a/gtksourceview/gtksourcefile.h b/gtksourceview/gtksourcefile.h
index 33d85e7..64e2f8a 100644
--- a/gtksourceview/gtksourcefile.h
+++ b/gtksourceview/gtksourcefile.h
@@ -25,6 +25,7 @@
 #include <gio/gio.h>
 #include <gtksourceview/gtksourcetypes.h>
 #include <gtksourceview/gtksourcebuffer.h>
+#include <gtksourceview/gtksourcefilesaver.h>
 
 G_BEGIN_DECLS
 
@@ -38,23 +39,6 @@ G_BEGIN_DECLS
 typedef struct _GtkSourceFileClass    GtkSourceFileClass;
 typedef struct _GtkSourceFilePrivate  GtkSourceFilePrivate;
 
-/**
- * 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.
- * @GTK_SOURCE_FILE_SAVE_IGNORE_INVALID_CHARS: do not save invalid characters.
- *
- * FIXME ignore invalid chars is not yet used in gsv
- *
- * Since: 3.14
- */
-typedef enum
-{
-       GTK_SOURCE_FILE_SAVE_IGNORE_MTIME               = 1 << 0,
-       GTK_SOURCE_FILE_SAVE_CREATE_BACKUP              = 1 << 1,
-       GTK_SOURCE_FILE_SAVE_IGNORE_INVALID_CHARS       = 1 << 2
-} GtkSourceFileSaveFlags;
-
 #define GTK_SOURCE_FILE_ERROR gtk_source_file_error_quark ()
 
 /* TODO document the errors */
diff --git a/gtksourceview/gtksourcefilesaver.h b/gtksourceview/gtksourcefilesaver.h
index 2ce78e7..353ae5e 100644
--- a/gtksourceview/gtksourcefilesaver.h
+++ b/gtksourceview/gtksourcefilesaver.h
@@ -26,9 +26,8 @@
 #define __GTK_SOURCE_FILE_SAVER_H__
 
 #include <gtk/gtk.h>
-#include "gtksourcetypes.h"
-#include "gtksourcetypes-private.h"
-#include "gtksourcefile.h"
+#include <gtksourceview/gtksourcetypes.h>
+#include <gtksourceview/gtksourcebuffer.h>
 
 G_BEGIN_DECLS
 
@@ -42,6 +41,23 @@ G_BEGIN_DECLS
 typedef struct _GtkSourceFileSaverClass   GtkSourceFileSaverClass;
 typedef struct _GtkSourceFileSaverPrivate GtkSourceFileSaverPrivate;
 
+/**
+ * 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.
+ * @GTK_SOURCE_FILE_SAVE_IGNORE_INVALID_CHARS: do not save invalid characters.
+ *
+ * FIXME ignore invalid chars is not yet used in gsv
+ *
+ * Since: 3.14
+ */
+typedef enum
+{
+       GTK_SOURCE_FILE_SAVE_IGNORE_MTIME               = 1 << 0,
+       GTK_SOURCE_FILE_SAVE_CREATE_BACKUP              = 1 << 1,
+       GTK_SOURCE_FILE_SAVE_IGNORE_INVALID_CHARS       = 1 << 2
+} GtkSourceFileSaveFlags;
+
 struct _GtkSourceFileSaver
 {
        GObject object;
@@ -54,10 +70,8 @@ struct _GtkSourceFileSaverClass
        GObjectClass parent_class;
 };
 
-G_GNUC_INTERNAL
 GType                   gtk_source_file_saver_get_type         (void) G_GNUC_CONST;
 
-G_GNUC_INTERNAL
 GtkSourceFileSaver     *gtk_source_file_saver_new              (GtkSourceFile            *file,
                                                                 const GtkSourceEncoding  *encoding,
                                                                 GtkSourceNewlineType      newline_type,
@@ -65,7 +79,6 @@ GtkSourceFileSaver    *gtk_source_file_saver_new              (GtkSourceFile            
*file,
                                                                 gboolean                  
ensure_trailing_newline,
                                                                 GtkSourceFileSaveFlags    flags);
 
-G_GNUC_INTERNAL
 void                    gtk_source_file_saver_save_async       (GtkSourceFileSaver       *saver,
                                                                 GTimeVal                 *old_mtime,
                                                                 gint                      io_priority,
@@ -75,12 +88,10 @@ void                         gtk_source_file_saver_save_async       (GtkSourceFileSaver   
    *saver,
                                                                 GAsyncReadyCallback       callback,
                                                                 gpointer                  user_data);
 
-G_GNUC_INTERNAL
 gboolean                gtk_source_file_saver_save_finish      (GtkSourceFileSaver       *saver,
                                                                 GAsyncResult             *result,
                                                                 GError                  **error);
 
-G_GNUC_INTERNAL
 GFileInfo              *gtk_source_file_saver_get_info         (GtkSourceFileSaver       *saver);
 
 G_END_DECLS
diff --git a/gtksourceview/gtksourcetypes-private.h b/gtksourceview/gtksourcetypes-private.h
index a1e2aa0..36995ec 100644
--- a/gtksourceview/gtksourcetypes-private.h
+++ b/gtksourceview/gtksourcetypes-private.h
@@ -33,7 +33,6 @@ typedef struct _GtkSourceCompletionModel      GtkSourceCompletionModel;
 typedef struct _GtkSourceContextEngine         GtkSourceContextEngine;
 typedef struct _GtkSourceEngine                        GtkSourceEngine;
 typedef struct _GtkSourceFileLoader            GtkSourceFileLoader;
-typedef struct _GtkSourceFileSaver             GtkSourceFileSaver;
 typedef struct _GtkSourceGutterRendererLines   GtkSourceGutterRendererLines;
 typedef struct _GtkSourceGutterRendererMarks   GtkSourceGutterRendererMarks;
 typedef struct _GtkSourceMarksSequence         GtkSourceMarksSequence;
diff --git a/gtksourceview/gtksourcetypes.h b/gtksourceview/gtksourcetypes.h
index 6929733..569bb6e 100644
--- a/gtksourceview/gtksourcetypes.h
+++ b/gtksourceview/gtksourcetypes.h
@@ -35,6 +35,7 @@ typedef struct _GtkSourceCompletionProposal   GtkSourceCompletionProposal;
 typedef struct _GtkSourceCompletionProvider    GtkSourceCompletionProvider;
 typedef struct _GtkSourceEncoding              GtkSourceEncoding;
 typedef struct _GtkSourceFile                  GtkSourceFile;
+typedef struct _GtkSourceFileSaver             GtkSourceFileSaver;
 typedef struct _GtkSourceGutter                        GtkSourceGutter;
 typedef struct _GtkSourceGutterRenderer                GtkSourceGutterRenderer;
 typedef struct _GtkSourceGutterRendererPixbuf  GtkSourceGutterRendererPixbuf;


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