[gedit] Factory: class skeleton



commit 325aa857cd48679f3f4fbacea1e6714d67f8d0b7
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun May 3 00:38:47 2020 +0200

    Factory: class skeleton

 docs/reference/meson.build |  1 +
 gedit/gedit-factory.c      | 38 +++++++++++++++++++++++++++++++++
 gedit/gedit-factory.h      | 53 ++++++++++++++++++++++++++++++++++++++++++++++
 gedit/meson.build          |  2 ++
 po/POTFILES.in             |  1 +
 5 files changed, 95 insertions(+)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index bf903e6dd..96a1f231b 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -33,6 +33,7 @@ libgedit_reference_ignored_h = [
   'gedit-encoding-items.h',
   'gedit-encodings-dialog.h',
   'gedit-enum-types.h',
+  'gedit-factory.h',
   'gedit-file-chooser-dialog-gtk.h',
   'gedit-file-chooser-dialog-osx.h',
   'gedit-file-chooser-dialog.h',
diff --git a/gedit/gedit-factory.c b/gedit/gedit-factory.c
new file mode 100644
index 000000000..feea92fb0
--- /dev/null
+++ b/gedit/gedit-factory.c
@@ -0,0 +1,38 @@
+/*
+ * This file is part of gedit
+ *
+ * Copyright (C) 2020 Sébastien Wilmet <swilmet gnome org>
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gedit-factory.h"
+
+G_DEFINE_TYPE (GeditFactory, gedit_factory, TEPL_TYPE_ABSTRACT_FACTORY)
+
+static void
+gedit_factory_class_init (GeditFactoryClass *klass)
+{
+}
+
+static void
+gedit_factory_init (GeditFactory *factory)
+{
+}
+
+GeditFactory *
+gedit_factory_new (void)
+{
+       return g_object_new (GEDIT_TYPE_FACTORY, NULL);
+}
diff --git a/gedit/gedit-factory.h b/gedit/gedit-factory.h
new file mode 100644
index 000000000..05e19f715
--- /dev/null
+++ b/gedit/gedit-factory.h
@@ -0,0 +1,53 @@
+/*
+ * This file is part of gedit
+ *
+ * Copyright (C) 2020 Sébastien Wilmet <swilmet gnome org>
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GEDIT_FACTORY_H
+#define GEDIT_FACTORY_H
+
+#include <tepl/tepl.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_FACTORY             (gedit_factory_get_type ())
+#define GEDIT_FACTORY(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_FACTORY, GeditFactory))
+#define GEDIT_FACTORY_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_FACTORY, 
GeditFactoryClass))
+#define GEDIT_IS_FACTORY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_FACTORY))
+#define GEDIT_IS_FACTORY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_FACTORY))
+#define GEDIT_FACTORY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_FACTORY, 
GeditFactoryClass))
+
+typedef struct _GeditFactory         GeditFactory;
+typedef struct _GeditFactoryClass    GeditFactoryClass;
+
+struct _GeditFactory
+{
+       TeplAbstractFactory parent;
+};
+
+struct _GeditFactoryClass
+{
+       TeplAbstractFactoryClass parent_class;
+};
+
+GType          gedit_factory_get_type  (void);
+
+GeditFactory * gedit_factory_new       (void);
+
+G_END_DECLS
+
+#endif /* GEDIT_FACTORY_H */
diff --git a/gedit/meson.build b/gedit/meson.build
index 1b372fa0c..95fc89d13 100644
--- a/gedit/meson.build
+++ b/gedit/meson.build
@@ -27,6 +27,7 @@ libgedit_private_h = files(
   'gedit-documents-panel.h',
   'gedit-encoding-items.h',
   'gedit-encodings-dialog.h',
+  'gedit-factory.h',
   'gedit-file-chooser-dialog-gtk.h',
   'gedit-file-chooser-dialog.h',
   'gedit-highlight-mode-dialog.h',
@@ -71,6 +72,7 @@ libgedit_sources = files(
   'gedit-encoding-items.c',
   'gedit-encodings-combo-box.c',
   'gedit-encodings-dialog.c',
+  'gedit-factory.c',
   'gedit-file-chooser-dialog.c',
   'gedit-file-chooser-dialog-gtk.c',
   'gedit-highlight-mode-dialog.c',
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ab455ff3c..f6f2f17ed 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -16,6 +16,7 @@ gedit/gedit-documents-panel.c
 gedit/gedit-encodings-combo-box.c
 gedit/gedit-encoding-items.c
 gedit/gedit-encodings-dialog.c
+gedit/gedit-factory.c
 gedit/gedit-file-chooser-dialog-gtk.c
 gedit/gedit-file-chooser-dialog-osx.m
 gedit/gedit-highlight-mode-dialog.c


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