[latexila/wip/latexila-next: 27/55] BuildTool: add a really basic run() function



commit 9c2b4fb261a74c963985046742ae30a56b7e83ae
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed May 7 13:22:45 2014 +0200

    BuildTool: add a really basic run() function

 src/liblatexila/latexila-build-tool.c |   25 +++++++++++++++++++++++++
 src/liblatexila/latexila-build-tool.h |    6 +++++-
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/liblatexila/latexila-build-tool.c b/src/liblatexila/latexila-build-tool.c
index aa77136..c9da018 100644
--- a/src/liblatexila/latexila-build-tool.c
+++ b/src/liblatexila/latexila-build-tool.c
@@ -30,6 +30,7 @@
 
 #include "latexila-build-tool.h"
 #include "latexila-build-job.h"
+#include "latexila-build-view.h"
 
 struct _LatexilaBuildToolPrivate
 {
@@ -391,3 +392,27 @@ latexila_build_tool_to_xml (LatexilaBuildTool *tool)
 
   return g_string_free (contents, FALSE);
 }
+
+/**
+ * latexila_build_tool_run:
+ * @build_tool: a build tool.
+ * @file: a file.
+ * @build_view: a build view.
+ *
+ * Run a build tool on a file with the messages displayed in a build view.
+ */
+void
+latexila_build_tool_run (LatexilaBuildTool *build_tool,
+                         GFile             *file,
+                         LatexilaBuildView *build_view)
+{
+  g_return_if_fail (LATEXILA_IS_BUILD_TOOL (build_tool));
+  g_return_if_fail (G_IS_FILE (file));
+  g_return_if_fail (LATEXILA_IS_BUILD_VIEW (build_view));
+
+  latexila_build_view_clear (build_view);
+
+  latexila_build_view_add_main_title (build_view,
+                                      build_tool->priv->label,
+                                      LATEXILA_BUILD_STATE_RUNNING);
+}
diff --git a/src/liblatexila/latexila-build-tool.h b/src/liblatexila/latexila-build-tool.h
index a9ff897..62635f7 100644
--- a/src/liblatexila/latexila-build-tool.h
+++ b/src/liblatexila/latexila-build-tool.h
@@ -21,7 +21,7 @@
 #define __LATEXILA_BUILD_TOOL_H__
 
 #include "latexila-types.h"
-#include <glib-object.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
@@ -60,6 +60,10 @@ GList *               latexila_build_tool_get_jobs                  (LatexilaBui
 
 gchar *               latexila_build_tool_to_xml                    (LatexilaBuildTool *tool);
 
+void                  latexila_build_tool_run                       (LatexilaBuildTool *build_tool,
+                                                                     GFile             *file,
+                                                                     LatexilaBuildView *build_view);
+
 G_END_DECLS
 
 #endif /* __LATEXILA_BUILD_TOOL_H__ */


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