[latexila/wip/latexila-next: 55/55] LatexilaPostProcessorLatexmk (not finished)



commit 49433f4f54dda1d014c7e589ac1af28b3a178e82
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Sep 17 22:15:11 2014 +0200

    LatexilaPostProcessorLatexmk (not finished)

 docs/reference/latexila-docs.xml                  |    1 +
 docs/reference/latexila-sections.txt              |   17 +++
 src/liblatexila/Makefile.am                       |    2 +
 src/liblatexila/latexila-post-processor-latexmk.c |  115 +++++++++++++++++++++
 src/liblatexila/latexila-post-processor-latexmk.h |   57 ++++++++++
 src/liblatexila/latexila-types.h                  |    1 +
 6 files changed, 193 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/latexila-docs.xml b/docs/reference/latexila-docs.xml
index 0a693c3..f8e08c3 100644
--- a/docs/reference/latexila-docs.xml
+++ b/docs/reference/latexila-docs.xml
@@ -20,6 +20,7 @@
     <xi:include href="xml/post-processor.xml"/>
     <xi:include href="xml/post-processor-all-output.xml"/>
     <xi:include href="xml/post-processor-latex.xml"/>
+    <xi:include href="xml/post-processor-latexmk.xml"/>
     <xi:include href="xml/synctex.xml"/>
     <xi:include href="xml/utils.xml"/>
   </chapter>
diff --git a/docs/reference/latexila-sections.txt b/docs/reference/latexila-sections.txt
index d273b9b..cd6895d 100644
--- a/docs/reference/latexila-sections.txt
+++ b/docs/reference/latexila-sections.txt
@@ -192,6 +192,23 @@ latexila_post_processor_latex_get_type
 </SECTION>
 
 <SECTION>
+<FILE>post-processor-latexmk</FILE>
+<TITLE>LatexilaPostProcessorLatexmk</TITLE>
+LatexilaPostProcessorLatexmk
+latexila_post_processor_latexmk_new
+<SUBSECTION Standard>
+LATEXILA_IS_POST_PROCESSOR_LATEXMK
+LATEXILA_IS_POST_PROCESSOR_LATEXMK_CLASS
+LATEXILA_POST_PROCESSOR_LATEXMK
+LATEXILA_POST_PROCESSOR_LATEXMK_CLASS
+LATEXILA_POST_PROCESSOR_LATEXMK_GET_CLASS
+LATEXILA_TYPE_POST_PROCESSOR_LATEXMK
+LatexilaPostProcessorLatexmkClass
+LatexilaPostProcessorLatexmkPrivate
+latexila_post_processor_latexmk_get_type
+</SECTION>
+
+<SECTION>
 <FILE>synctex</FILE>
 <TITLE>LatexilaSynctex</TITLE>
 LatexilaSynctex
diff --git a/src/liblatexila/Makefile.am b/src/liblatexila/Makefile.am
index e2e33fa..c0998e1 100644
--- a/src/liblatexila/Makefile.am
+++ b/src/liblatexila/Makefile.am
@@ -21,6 +21,7 @@ liblatexila_headers =                         \
        latexila-post-processor.h               \
        latexila-post-processor-all-output.h    \
        latexila-post-processor-latex.h         \
+       latexila-post-processor-latexmk.h       \
        latexila-synctex.h                      \
        latexila-types.h                        \
        latexila-utils.h
@@ -35,6 +36,7 @@ liblatexila_sources =                         \
        latexila-post-processor.c               \
        latexila-post-processor-all-output.c    \
        latexila-post-processor-latex.c         \
+       latexila-post-processor-latexmk.c       \
        latexila-synctex.c                      \
        latexila-utils.c
 
diff --git a/src/liblatexila/latexila-post-processor-latexmk.c 
b/src/liblatexila/latexila-post-processor-latexmk.c
new file mode 100644
index 0000000..51eb19f
--- /dev/null
+++ b/src/liblatexila/latexila-post-processor-latexmk.c
@@ -0,0 +1,115 @@
+/*
+ * This file is part of LaTeXila.
+ *
+ * Copyright (C) 2014 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * LaTeXila is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * LaTeXila 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION:post-processor-latexmk
+ * @title: LatexilaPostProcessorLatexmk
+ * @short_description: latexmk post-processor
+ *
+ * A post-processor used for the latexmk command. Internally, this
+ * post-processor uses other ones: #LatexilaPostProcessorLatex and
+ * #LatexilaPostProcessorAllOutput.
+ */
+
+#include "latexila-post-processor-latexmk.h"
+
+struct _LatexilaPostProcessorLatexmkPrivate
+{
+  GNode *messages;
+
+  /* The last message is used to insert in O(1) at the end of 'messages'. */
+  GNode *last_message;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (LatexilaPostProcessorLatexmk,
+                            latexila_post_processor_latexmk,
+                            LATEXILA_TYPE_POST_PROCESSOR)
+
+static void
+latexila_post_processor_latexmk_start (LatexilaPostProcessor *post_processor,
+                                       GFile                 *file)
+{
+}
+
+static void
+latexila_post_processor_latexmk_end (LatexilaPostProcessor *post_processor)
+{
+}
+
+static void
+latexila_post_processor_latexmk_process_lines (LatexilaPostProcessor  *post_processor,
+                                               gchar                 **lines)
+{
+}
+
+static const GNode *
+latexila_post_processor_latexmk_get_messages (LatexilaPostProcessor *post_processor)
+{
+  LatexilaPostProcessorLatexmk *pp = LATEXILA_POST_PROCESSOR_LATEXMK (post_processor);
+
+  return pp->priv->messages->children;
+}
+
+static void
+latexila_post_processor_latexmk_dispose (GObject *object)
+{
+
+  G_OBJECT_CLASS (latexila_post_processor_latexmk_parent_class)->dispose (object);
+}
+
+static void
+latexila_post_processor_latexmk_finalize (GObject *object)
+{
+
+  G_OBJECT_CLASS (latexila_post_processor_latexmk_parent_class)->finalize (object);
+}
+
+static void
+latexila_post_processor_latexmk_class_init (LatexilaPostProcessorLatexmkClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  LatexilaPostProcessorClass *pp_class = LATEXILA_POST_PROCESSOR_CLASS (klass);
+
+  object_class->dispose = latexila_post_processor_latexmk_dispose;
+  object_class->finalize = latexila_post_processor_latexmk_finalize;
+
+  pp_class->start = latexila_post_processor_latexmk_start;
+  pp_class->end = latexila_post_processor_latexmk_end;
+  pp_class->process_lines = latexila_post_processor_latexmk_process_lines;
+  pp_class->get_messages = latexila_post_processor_latexmk_get_messages;
+}
+
+static void
+latexila_post_processor_latexmk_init (LatexilaPostProcessorLatexmk *pp)
+{
+  pp->priv = latexila_post_processor_latexmk_get_instance_private (pp);
+
+  pp->priv->messages = g_node_new (NULL);
+}
+
+/**
+ * latexila_post_processor_latexmk_new:
+ *
+ * Returns: a new #LatexilaPostProcessorLatexmk object.
+ */
+LatexilaPostProcessor *
+latexila_post_processor_latexmk_new (void)
+{
+  return g_object_new (LATEXILA_TYPE_POST_PROCESSOR_LATEXMK, NULL);
+}
diff --git a/src/liblatexila/latexila-post-processor-latexmk.h 
b/src/liblatexila/latexila-post-processor-latexmk.h
new file mode 100644
index 0000000..f30382f
--- /dev/null
+++ b/src/liblatexila/latexila-post-processor-latexmk.h
@@ -0,0 +1,57 @@
+/*
+ * This file is part of LaTeXila.
+ *
+ * Copyright (C) 2014 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * LaTeXila is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * LaTeXila 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LATEXILA_POST_PROCESSOR_LATEXMK_H__
+#define __LATEXILA_POST_PROCESSOR_LATEXMK_H__
+
+#include <glib-object.h>
+#include "latexila-post-processor.h"
+#include "latexila-types.h"
+
+G_BEGIN_DECLS
+
+#define LATEXILA_TYPE_POST_PROCESSOR_LATEXMK             (latexila_post_processor_latexmk_get_type ())
+#define LATEXILA_POST_PROCESSOR_LATEXMK(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
LATEXILA_TYPE_POST_PROCESSOR_LATEXMK, LatexilaPostProcessorLatexmk))
+#define LATEXILA_POST_PROCESSOR_LATEXMK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), 
LATEXILA_TYPE_POST_PROCESSOR_LATEXMK, LatexilaPostProcessorLatexmkClass))
+#define LATEXILA_IS_POST_PROCESSOR_LATEXMK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
LATEXILA_TYPE_POST_PROCESSOR_LATEXMK))
+#define LATEXILA_IS_POST_PROCESSOR_LATEXMK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), 
LATEXILA_TYPE_POST_PROCESSOR_LATEXMK))
+#define LATEXILA_POST_PROCESSOR_LATEXMK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), 
LATEXILA_TYPE_POST_PROCESSOR_LATEXMK, LatexilaPostProcessorLatexmkClass))
+
+typedef struct _LatexilaPostProcessorLatexmkClass   LatexilaPostProcessorLatexmkClass;
+typedef struct _LatexilaPostProcessorLatexmkPrivate LatexilaPostProcessorLatexmkPrivate;
+
+struct _LatexilaPostProcessorLatexmk
+{
+  LatexilaPostProcessor parent;
+
+  LatexilaPostProcessorLatexmkPrivate *priv;
+};
+
+struct _LatexilaPostProcessorLatexmkClass
+{
+  LatexilaPostProcessorClass parent_class;
+};
+
+GType                   latexila_post_processor_latexmk_get_type  (void) G_GNUC_CONST;
+
+LatexilaPostProcessor * latexila_post_processor_latexmk_new       (void);
+
+G_END_DECLS
+
+#endif /* __LATEXILA_POST_PROCESSOR_LATEXMK_H__ */
diff --git a/src/liblatexila/latexila-types.h b/src/liblatexila/latexila-types.h
index 997aa99..6c01249 100644
--- a/src/liblatexila/latexila-types.h
+++ b/src/liblatexila/latexila-types.h
@@ -33,6 +33,7 @@ typedef struct _LatexilaBuildView               LatexilaBuildView;
 typedef struct _LatexilaPostProcessor           LatexilaPostProcessor;
 typedef struct _LatexilaPostProcessorAllOutput  LatexilaPostProcessorAllOutput;
 typedef struct _LatexilaPostProcessorLatex      LatexilaPostProcessorLatex;
+typedef struct _LatexilaPostProcessorLatexmk    LatexilaPostProcessorLatexmk;
 typedef struct _LatexilaSynctex                 LatexilaSynctex;
 
 G_END_DECLS


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