[gnome-latex] LatexilaApp: skeleton



commit 92ca9e7aa088ff73c384d18597b9b010c47204d9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Apr 28 16:31:18 2020 +0200

    LatexilaApp: skeleton

 docs/reference/gnome-latex-docs.xml     |  1 +
 docs/reference/gnome-latex-sections.txt | 15 ++++++++++
 po/POTFILES.in                          |  1 +
 src/glatex_app.vala                     |  2 +-
 src/liblatexila/Makefile.am             |  2 ++
 src/liblatexila/latexila-app.c          | 49 ++++++++++++++++++++++++++++++
 src/liblatexila/latexila-app.h          | 53 +++++++++++++++++++++++++++++++++
 src/liblatexila/latexila.h              |  1 +
 8 files changed, 123 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gnome-latex-docs.xml b/docs/reference/gnome-latex-docs.xml
index 9719591..59da3e5 100644
--- a/docs/reference/gnome-latex-docs.xml
+++ b/docs/reference/gnome-latex-docs.xml
@@ -17,6 +17,7 @@
       <xi:include href="xml/init.xml"/>
       <xi:include href="xml/factory.xml"/>
       <xi:include href="xml/settings.xml"/>
+      <xi:include href="xml/app.xml"/>
       <xi:include href="xml/buffer.xml"/>
       <xi:include href="xml/view.xml"/>
     </chapter>
diff --git a/docs/reference/gnome-latex-sections.txt b/docs/reference/gnome-latex-sections.txt
index 7adfef2..2d78705 100644
--- a/docs/reference/gnome-latex-sections.txt
+++ b/docs/reference/gnome-latex-sections.txt
@@ -1,5 +1,20 @@
 <INCLUDE>latexila.h</INCLUDE>
 
+<SECTION>
+<FILE>app</FILE>
+LatexilaApp
+latexila_app_new
+<SUBSECTION Standard>
+LATEXILA_APP
+LATEXILA_APP_CLASS
+LATEXILA_APP_GET_CLASS
+LATEXILA_IS_APP
+LATEXILA_IS_APP_CLASS
+LATEXILA_TYPE_APP
+LatexilaAppClass
+latexila_app_get_type
+</SECTION>
+
 <SECTION>
 <FILE>buffer</FILE>
 latexila_buffer_setup
diff --git a/po/POTFILES.in b/po/POTFILES.in
index bb8bf25..336aecd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,6 +23,7 @@ src/file_browser.vala
 src/glatex_app.vala
 src/latex_menu.vala
 src/liblatexila/dh-dconf-migration.c
+src/liblatexila/latexila-app.c
 src/liblatexila/latexila-buffer.c
 src/liblatexila/latexila-build-job.c
 src/liblatexila/latexila-build-tool.c
diff --git a/src/glatex_app.vala b/src/glatex_app.vala
index 70b1b2b..f42d0c8 100644
--- a/src/glatex_app.vala
+++ b/src/glatex_app.vala
@@ -19,7 +19,7 @@
  * Author: Sébastien Wilmet
  */
 
-public class GlatexApp : Gtk.Application
+public class GlatexApp : Latexila.App
 {
     static Gtk.CssProvider? _provider = null;
 
diff --git a/src/liblatexila/Makefile.am b/src/liblatexila/Makefile.am
index 751ce43..b4e53b5 100644
--- a/src/liblatexila/Makefile.am
+++ b/src/liblatexila/Makefile.am
@@ -25,6 +25,7 @@ liblatexila_la_LIBADD =               \
 
 liblatexila_public_headers =                   \
        latexila.h                              \
+       latexila-app.h                          \
        latexila-buffer.h                       \
        latexila-build-job.h                    \
        latexila-build-tool.h                   \
@@ -51,6 +52,7 @@ liblatexila_public_headers =                  \
        $(NULL)
 
 liblatexila_public_c_files =                   \
+       latexila-app.c                          \
        latexila-buffer.c                       \
        latexila-build-job.c                    \
        latexila-build-tool.c                   \
diff --git a/src/liblatexila/latexila-app.c b/src/liblatexila/latexila-app.c
new file mode 100644
index 0000000..d44c30e
--- /dev/null
+++ b/src/liblatexila/latexila-app.c
@@ -0,0 +1,49 @@
+/*
+ * This file is part of GNOME LaTeX.
+ *
+ * Copyright (C) 2020 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * GNOME LaTeX 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.
+ *
+ * GNOME LaTeX 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 GNOME LaTeX.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "latexila-app.h"
+
+/**
+ * SECTION:app
+ * @title: LatexilaApp
+ * @short_description: Subclass of #GtkApplication
+ */
+
+G_DEFINE_TYPE (LatexilaApp, latexila_app, GTK_TYPE_APPLICATION)
+
+static void
+latexila_app_class_init (LatexilaAppClass *klass)
+{
+}
+
+static void
+latexila_app_init (LatexilaApp *app)
+{
+}
+
+/**
+ * latexila_app_new:
+ *
+ * Returns: (transfer full): a new #LatexilaApp object.
+ */
+LatexilaApp *
+latexila_app_new (void)
+{
+       return g_object_new (LATEXILA_TYPE_APP, NULL);
+}
diff --git a/src/liblatexila/latexila-app.h b/src/liblatexila/latexila-app.h
new file mode 100644
index 0000000..c2d50e7
--- /dev/null
+++ b/src/liblatexila/latexila-app.h
@@ -0,0 +1,53 @@
+/*
+ * This file is part of GNOME LaTeX.
+ *
+ * Copyright (C) 2020 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * GNOME LaTeX 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.
+ *
+ * GNOME LaTeX 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 GNOME LaTeX.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LATEXILA_APP_H
+#define LATEXILA_APP_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define LATEXILA_TYPE_APP             (latexila_app_get_type ())
+#define LATEXILA_APP(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), LATEXILA_TYPE_APP, LatexilaApp))
+#define LATEXILA_APP_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), LATEXILA_TYPE_APP, 
LatexilaAppClass))
+#define LATEXILA_IS_APP(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LATEXILA_TYPE_APP))
+#define LATEXILA_IS_APP_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), LATEXILA_TYPE_APP))
+#define LATEXILA_APP_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), LATEXILA_TYPE_APP, 
LatexilaAppClass))
+
+typedef struct _LatexilaApp         LatexilaApp;
+typedef struct _LatexilaAppClass    LatexilaAppClass;
+
+struct _LatexilaApp
+{
+       GtkApplication parent;
+};
+
+struct _LatexilaAppClass
+{
+       GtkApplicationClass parent_class;
+};
+
+GType          latexila_app_get_type   (void);
+
+LatexilaApp *  latexila_app_new        (void);
+
+G_END_DECLS
+
+#endif /* LATEXILA_APP_H */
diff --git a/src/liblatexila/latexila.h b/src/liblatexila/latexila.h
index 2511e2c..0266b75 100644
--- a/src/liblatexila/latexila.h
+++ b/src/liblatexila/latexila.h
@@ -27,6 +27,7 @@
 #include "latexila-types.h"
 #include "latexila-enum-types.h"
 
+#include "latexila-app.h"
 #include "latexila-buffer.h"
 #include "latexila-build-job.h"
 #include "latexila-build-tool.h"


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