[latexila/wip/build-tools-revamp: 6/15] Create liblatexila with empty GObject class



commit 57c1bea2e1b3a3cf3667e39ca95118e13c322182
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Apr 18 16:42:14 2014 +0200

    Create liblatexila with empty GObject class
    
    The liblatexila is not a real library like GTK+, it is just an internal
    library. The code will be written in C in this directory. The Vala code
    in the parent directory can use the liblatexila, but I'll try to not do
    the reverse (use the Vala code in liblatexila) so the liblatexila is
    self-contained and could be reused easily by other projects (a gedit
    plugin for example).
    
    Why the C language? Well, I now prefer the C language. The Vala syntax
    is nice, but it adds another layer. Another layer of potential bugs.
    Another layer of maintenance. Another layer for the API documentation.
    The GNOME documentation with GTK-Doc is primarily written for the C
    language. And the verbosity of the C language has advantages
    ("greppable" code, code more self-documented).

 configure.ac                              |    1 +
 src/Makefile.am                           |    2 +-
 src/liblatexila/Makefile.am               |    7 +++
 src/liblatexila/latexila-post-processor.c |   58 +++++++++++++++++++++++++++++
 src/liblatexila/latexila-post-processor.h |   51 +++++++++++++++++++++++++
 5 files changed, 118 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 98b20ba..36adb1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,7 @@ AC_CONFIG_FILES([Makefile
                 po/Makefile.in
                  src/Makefile
                 src/gedit/Makefile
+                src/liblatexila/Makefile
                 src/ui/Makefile
                  README])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 9728b21..b36511f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = gedit ui
+SUBDIRS = gedit liblatexila ui
 
 bin_PROGRAMS = latexila
 
diff --git a/src/liblatexila/Makefile.am b/src/liblatexila/Makefile.am
new file mode 100644
index 0000000..c3c190a
--- /dev/null
+++ b/src/liblatexila/Makefile.am
@@ -0,0 +1,7 @@
+noinst_LTLIBRARIES = liblatexila.la
+
+liblatexila_la_SOURCES =               \
+       latexila-post-processor.c       \
+       latexila-post-processor.h
+
+-include $(top_srcdir)/git.mk
diff --git a/src/liblatexila/latexila-post-processor.c b/src/liblatexila/latexila-post-processor.c
new file mode 100644
index 0000000..8c38029
--- /dev/null
+++ b/src/liblatexila/latexila-post-processor.c
@@ -0,0 +1,58 @@
+/*
+ * 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/>.
+ */
+
+#include "latexila-post-processor.h"
+
+typedef struct _LatexilaPostProcessorPrivate LatexilaPostProcessorPrivate;
+
+struct _LatexilaPostProcessorPrivate
+{
+  gint something;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (LatexilaPostProcessor, latexila_post_processor, G_TYPE_OBJECT)
+
+static void
+latexila_post_processor_dispose (GObject *object)
+{
+
+  G_OBJECT_CLASS (latexila_post_processor_parent_class)->dispose (object);
+}
+
+static void
+latexila_post_processor_finalize (GObject *object)
+{
+
+  G_OBJECT_CLASS (latexila_post_processor_parent_class)->finalize (object);
+}
+
+static void
+latexila_post_processor_class_init (LatexilaPostProcessorClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->dispose = latexila_post_processor_dispose;
+  object_class->finalize = latexila_post_processor_finalize;
+}
+
+static void
+latexila_post_processor_init (LatexilaPostProcessor *self)
+{
+  LatexilaPostProcessorPrivate *priv = latexila_post_processor_get_instance_private (self);
+}
diff --git a/src/liblatexila/latexila-post-processor.h b/src/liblatexila/latexila-post-processor.h
new file mode 100644
index 0000000..5689838
--- /dev/null
+++ b/src/liblatexila/latexila-post-processor.h
@@ -0,0 +1,51 @@
+/*
+ * 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_H__
+#define __LATEXILA_POST_PROCESSOR_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define LATEXILA_TYPE_POST_PROCESSOR             (latexila_post_processor_get_type ())
+#define LATEXILA_POST_PROCESSOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
LATEXILA_TYPE_POST_PROCESSOR, LatexilaPostProcessor))
+#define LATEXILA_POST_PROCESSOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), 
LATEXILA_TYPE_POST_PROCESSOR, LatexilaPostProcessorClass))
+#define LATEXILA_IS_POST_PROCESSOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
LATEXILA_TYPE_POST_PROCESSOR))
+#define LATEXILA_IS_POST_PROCESSOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), 
LATEXILA_TYPE_POST_PROCESSOR))
+#define LATEXILA_POST_PROCESSOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), 
LATEXILA_TYPE_POST_PROCESSOR, LatexilaPostProcessorClass))
+
+typedef struct _LatexilaPostProcessor      LatexilaPostProcessor;
+typedef struct _LatexilaPostProcessorClass LatexilaPostProcessorClass;
+
+struct _LatexilaPostProcessor
+{
+  GObject parent;
+};
+
+struct _LatexilaPostProcessorClass
+{
+  GObjectClass parent_class;
+};
+
+GType latexila_post_processor_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __LATEXILA_POST_PROCESSOR_H__ */


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