[gnome-todo] Add new Inbox panel



commit 26b71f770f56750aa3717f194d06be1b4ea8085f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Apr 26 17:43:16 2020 -0300

    Add new Inbox panel

 .../symbolic/actions/mail-inbox-symbolic.svg       |  62 +++++
 data/icons/icons.gresource.xml                     |   1 +
 data/org.gnome.todo.gschema.xml                    |   2 +-
 plugins/inbox-panel/gtd-inbox-panel.c              | 271 +++++++++++++++++++++
 plugins/inbox-panel/gtd-inbox-panel.h              |  32 +++
 plugins/inbox-panel/gtd-plugin-inbox-panel.c       | 161 ++++++++++++
 plugins/inbox-panel/gtd-plugin-inbox-panel.h       |  36 +++
 plugins/inbox-panel/inbox-panel.plugin.in          |  14 ++
 plugins/inbox-panel/meson.build                    |  19 ++
 plugins/meson.build                                |   1 +
 plugins/plugins.gresource.xml                      |   5 +
 11 files changed, 603 insertions(+), 1 deletion(-)
---
diff --git a/data/icons/hicolor/symbolic/actions/mail-inbox-symbolic.svg 
b/data/icons/hicolor/symbolic/actions/mail-inbox-symbolic.svg
new file mode 100644
index 0000000..3f1c377
--- /dev/null
+++ b/data/icons/hicolor/symbolic/actions/mail-inbox-symbolic.svg
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   id="svg7384"
+   height="16"
+   width="16"
+   version="1.1"
+   sodipodi:docname="mail-inbox-symbolic.svg"
+   inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="799"
+     inkscape:window-height="480"
+     id="namedview11"
+     showgrid="false"
+     inkscape:zoom="14.75"
+     inkscape:cx="-1.8983051"
+     inkscape:cy="7.4576271"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg7384" />
+  <title
+     id="title9167">Gnome Symbolic Icon Theme</title>
+  <defs
+     id="defs9" />
+  <metadata
+     id="metadata90">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title>Gnome Symbolic Icon Theme</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <path
+     inkscape:connector-curvature="0"
+     
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Bitstream
 Vera Sans';-inkscape-font-specification:'Bitstream Vera 
Sans';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:accumulate"
+     d="M 6.99999,0.9999 V 6.5624 L 5.71874,5.2812 C 5.53058,5.093 5.26529,4.9999 4.99999,4.9999 h -1 v 1 C 
4,6.2652 4.09309,6.5305 4.28124,6.7187 l 3,3 0.28125,0.2812 h 0.875 l 0.28125,-0.2812 3,-3 c 0.18819,-0.1882 
0.28124,-0.4535 0.28125,-0.7188 v -1 h -1 c -0.2653,0 -0.53059,0.093 -0.71875,0.2813 L 8.99999,6.5624 V 
0.9999 Z"
+     id="path11507" />
+  <path
+     inkscape:connector-curvature="0"
+     
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
+     d="M 3,9 V 11 11.502 14 a 0.9999947,0.9999947 0 0 0 0.9727,0.998 v 0 H 12 a 0.9999947,0.9999947 0 0 0 
1,-1 v -3 -2 h -2 v 2 H 5 v -2 z m 3.4941,3 h 3 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -3 
c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z"
+     id="path11509" />
+</svg>
diff --git a/data/icons/icons.gresource.xml b/data/icons/icons.gresource.xml
index fa89008..5313abe 100644
--- a/data/icons/icons.gresource.xml
+++ b/data/icons/icons.gresource.xml
@@ -3,6 +3,7 @@
   <!-- Icons -->
   <gresource prefix="/org/gnome/todo/icons">
     <file preprocess="xml-stripblanks" 
alias="scalable/actions/drag-handle-symbolic.svg">hicolor/symbolic/actions/drag-handle-symbolic.svg</file>
+    <file preprocess="xml-stripblanks" 
alias="scalable/actions/mail-inbox-symbolic.svg">hicolor/symbolic/actions/mail-inbox-symbolic.svg</file>
     <file preprocess="xml-stripblanks" 
alias="scalable/actions/view-tasks-all-symbolic.svg">hicolor/symbolic/actions/view-tasks-all-symbolic.svg</file>
     <file preprocess="xml-stripblanks" 
alias="scalable/actions/view-tasks-today-symbolic.svg">hicolor/symbolic/actions/view-tasks-today-symbolic.svg</file>
     <file preprocess="xml-stripblanks" 
alias="scalable/actions/view-tasks-unscheduled-symbolic.svg">hicolor/symbolic/actions/view-tasks-unscheduled-symbolic.svg</file>
diff --git a/data/org.gnome.todo.gschema.xml b/data/org.gnome.todo.gschema.xml
index 1cc459b..ebe4953 100644
--- a/data/org.gnome.todo.gschema.xml
+++ b/data/org.gnome.todo.gschema.xml
@@ -22,7 +22,7 @@
             <description>The identifier of the default provider to add new lists to</description>
         </key>
         <key name="active-extensions" type="as">
-            <default>["all-tasks-panel", "background", "eds", "today-panel", "next-week-panel", 
"night-light"]</default>
+            <default>["inbox-panel", "all-tasks-panel", "background", "eds", "today-panel", 
"next-week-panel", "night-light"]</default>
             <summary>List of active extensions</summary>
             <description>The list of active extensions</description>
         </key>
diff --git a/plugins/inbox-panel/gtd-inbox-panel.c b/plugins/inbox-panel/gtd-inbox-panel.c
new file mode 100644
index 0000000..5f8d691
--- /dev/null
+++ b/plugins/inbox-panel/gtd-inbox-panel.c
@@ -0,0 +1,271 @@
+/* gtd-inbox-panel.c
+ *
+ * Copyright 2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+
+#define G_LOG_DOMAIN "GtdInboxPanel"
+
+#include "gtd-inbox-panel.h"
+
+#include "gnome-todo.h"
+
+#include <glib/gi18n.h>
+#include <math.h>
+
+
+#define GTD_INBOX_PANEL_NAME     "inbox-panel"
+#define GTD_INBOX_PANEL_PRIORITY 2000
+
+struct _GtdInboxPanel
+{
+  GtkBox              parent;
+
+  GIcon              *icon;
+
+  guint               number_of_tasks;
+  GtdTaskListView    *view;
+
+  GtkFilterListModel *filter_model;
+};
+
+static void          gtd_panel_iface_init                        (GtdPanelInterface  *iface);
+
+G_DEFINE_TYPE_WITH_CODE (GtdInboxPanel, gtd_inbox_panel, GTK_TYPE_BOX,
+                         G_IMPLEMENT_INTERFACE (GTD_TYPE_PANEL, gtd_panel_iface_init))
+
+enum
+{
+  PROP_0,
+  PROP_ICON,
+  PROP_MENU,
+  PROP_NAME,
+  PROP_PRIORITY,
+  PROP_SUBTITLE,
+  PROP_TITLE,
+  N_PROPS
+};
+
+
+/*
+ * Auxiliary methods
+ */
+
+static gboolean
+filter_func (gpointer item,
+             gpointer user_data)
+{
+  GtdTaskList *task_list;
+  GtdTask *task;
+
+  task = (GtdTask*) item;
+  task_list = gtd_task_get_list (task);
+
+  return gtd_task_list_is_inbox (task_list) && !gtd_task_get_complete (task);
+}
+
+static void
+on_model_items_changed_cb (GListModel       *model,
+                           guint             position,
+                           guint             n_removed,
+                           guint             n_added,
+                           GtdInboxPanel *self)
+{
+  guint n_items = g_list_model_get_n_items (model);
+
+  if (self->number_of_tasks == n_items)
+    return;
+
+  self->number_of_tasks = n_items;
+  g_object_notify (G_OBJECT (self), "subtitle");
+}
+
+/*
+ * GtdPanel iface
+ */
+
+static const gchar*
+gtd_panel_inbox_get_panel_name (GtdPanel *panel)
+{
+  return GTD_INBOX_PANEL_NAME;
+}
+
+static const gchar*
+gtd_panel_inbox_get_panel_title (GtdPanel *panel)
+{
+  return _("Inbox");
+}
+
+static GList*
+gtd_panel_inbox_get_header_widgets (GtdPanel *panel)
+{
+  return NULL;
+}
+
+static const GMenu*
+gtd_panel_inbox_get_menu (GtdPanel *panel)
+{
+  return NULL;
+}
+
+static GIcon*
+gtd_panel_inbox_get_icon (GtdPanel *panel)
+{
+  return g_object_ref (GTD_INBOX_PANEL (panel)->icon);
+}
+
+static guint32
+gtd_panel_inbox_get_priority (GtdPanel *panel)
+{
+  return GTD_INBOX_PANEL_PRIORITY;
+}
+
+static gchar*
+gtd_panel_inbox_get_subtitle (GtdPanel *panel)
+{
+  GtdInboxPanel *self = GTD_INBOX_PANEL (panel);
+
+  return g_strdup_printf ("%d", self->number_of_tasks);
+}
+
+static void
+gtd_panel_iface_init (GtdPanelInterface *iface)
+{
+  iface->get_panel_name = gtd_panel_inbox_get_panel_name;
+  iface->get_panel_title = gtd_panel_inbox_get_panel_title;
+  iface->get_header_widgets = gtd_panel_inbox_get_header_widgets;
+  iface->get_menu = gtd_panel_inbox_get_menu;
+  iface->get_icon = gtd_panel_inbox_get_icon;
+  iface->get_priority = gtd_panel_inbox_get_priority;
+  iface->get_subtitle = gtd_panel_inbox_get_subtitle;
+}
+
+
+/*
+ * GObject overrides
+ */
+
+static void
+gtd_inbox_panel_finalize (GObject *object)
+{
+  GtdInboxPanel *self = (GtdInboxPanel *)object;
+
+  g_clear_object (&self->icon);
+  g_clear_object (&self->filter_model);
+
+  G_OBJECT_CLASS (gtd_inbox_panel_parent_class)->finalize (object);
+}
+
+static void
+gtd_inbox_panel_get_property (GObject    *object,
+                                  guint       prop_id,
+                                  GValue     *value,
+                                  GParamSpec *pspec)
+{
+  GtdInboxPanel *self = GTD_INBOX_PANEL (object);
+
+  switch (prop_id)
+    {
+    case PROP_ICON:
+      g_value_set_object (value, self->icon);
+      break;
+
+    case PROP_MENU:
+      g_value_set_object (value, NULL);
+      break;
+
+    case PROP_NAME:
+      g_value_set_string (value, GTD_INBOX_PANEL_NAME);
+      break;
+
+    case PROP_PRIORITY:
+      g_value_set_uint (value, GTD_INBOX_PANEL_PRIORITY);
+      break;
+
+    case PROP_SUBTITLE:
+      g_value_take_string (value, gtd_panel_get_subtitle (GTD_PANEL (self)));
+      break;
+
+    case PROP_TITLE:
+      g_value_set_string (value, gtd_panel_get_panel_title (GTD_PANEL (self)));
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gtd_inbox_panel_set_property (GObject      *object,
+                                  guint         prop_id,
+                                  const GValue *value,
+                                  GParamSpec   *pspec)
+{
+  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+}
+
+static void
+gtd_inbox_panel_class_init (GtdInboxPanelClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = gtd_inbox_panel_finalize;
+  object_class->get_property = gtd_inbox_panel_get_property;
+  object_class->set_property = gtd_inbox_panel_set_property;
+
+  g_object_class_override_property (object_class, PROP_ICON, "icon");
+  g_object_class_override_property (object_class, PROP_MENU, "menu");
+  g_object_class_override_property (object_class, PROP_NAME, "name");
+  g_object_class_override_property (object_class, PROP_PRIORITY, "priority");
+  g_object_class_override_property (object_class, PROP_SUBTITLE, "subtitle");
+  g_object_class_override_property (object_class, PROP_TITLE, "title");
+}
+
+static void
+gtd_inbox_panel_init (GtdInboxPanel *self)
+{
+  GtdManager *manager = gtd_manager_get_default ();
+
+  self->icon = g_themed_icon_new ("mail-inbox-symbolic");
+  self->filter_model = gtk_filter_list_model_new (gtd_manager_get_tasks_model (manager), filter_func, self, 
NULL);
+
+  /* The main view */
+  self->view = GTD_TASK_LIST_VIEW (gtd_task_list_view_new ());
+  gtd_task_list_view_set_model (GTD_TASK_LIST_VIEW (self->view), G_LIST_MODEL (self->filter_model));
+  gtd_task_list_view_set_handle_subtasks (GTD_TASK_LIST_VIEW (self->view), FALSE);
+  gtd_task_list_view_set_show_list_name (GTD_TASK_LIST_VIEW (self->view), FALSE);
+  gtd_task_list_view_set_show_due_date (GTD_TASK_LIST_VIEW (self->view), FALSE);
+  gtd_task_list_view_set_task_list_selector_behavior (GTD_TASK_LIST_VIEW (self->view),
+                                                      GTD_TASK_LIST_SELECTOR_BEHAVIOR_ALWAYS_HIDE);
+
+  gtk_widget_set_hexpand (GTK_WIDGET (self->view), TRUE);
+  gtk_widget_set_vexpand (GTK_WIDGET (self->view), TRUE);
+  gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->view));
+
+  g_signal_connect_object (self->filter_model,
+                           "items-changed",
+                           G_CALLBACK (on_model_items_changed_cb),
+                           self,
+                           0);
+}
+
+GtkWidget*
+gtd_inbox_panel_new (void)
+{
+  return g_object_new (GTD_TYPE_INBOX_PANEL, NULL);
+}
diff --git a/plugins/inbox-panel/gtd-inbox-panel.h b/plugins/inbox-panel/gtd-inbox-panel.h
new file mode 100644
index 0000000..779e6f2
--- /dev/null
+++ b/plugins/inbox-panel/gtd-inbox-panel.h
@@ -0,0 +1,32 @@
+/* gtd-inbox-panel.h
+ *
+ * Copyright 2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GTD_TYPE_INBOX_PANEL (gtd_inbox_panel_get_type())
+G_DECLARE_FINAL_TYPE (GtdInboxPanel, gtd_inbox_panel, GTD, INBOX_PANEL, GtkBox)
+
+GtkWidget*           gtd_inbox_panel_new                         (void);
+
+G_END_DECLS
diff --git a/plugins/inbox-panel/gtd-plugin-inbox-panel.c b/plugins/inbox-panel/gtd-plugin-inbox-panel.c
new file mode 100644
index 0000000..e10278f
--- /dev/null
+++ b/plugins/inbox-panel/gtd-plugin-inbox-panel.c
@@ -0,0 +1,161 @@
+/* gtd-plugin-inbox-panel.c
+ *
+ * Copyright 2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "GtdPluginInboxPanel"
+
+#include "gtd-inbox-panel.h"
+
+#include "gtd-plugin-inbox-panel.h"
+
+#include <glib/gi18n.h>
+#include <glib-object.h>
+
+struct _GtdPluginInboxPanel
+{
+  PeasExtensionBase   parent;
+
+  GList              *panels;
+  GtkCssProvider     *css_provider;
+};
+
+static void          gtd_activatable_iface_init                  (GtdActivatableInterface  *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GtdPluginInboxPanel, gtd_plugin_inbox_panel, PEAS_TYPE_EXTENSION_BASE,
+                                0,
+                                G_IMPLEMENT_INTERFACE_DYNAMIC (GTD_TYPE_ACTIVATABLE,
+                                                               gtd_activatable_iface_init))
+
+enum
+{
+  PROP_0,
+  PROP_PREFERENCES_PANEL,
+  N_PROPS
+};
+
+/*
+ * GtdActivatable interface implementation
+ */
+static void
+gtd_plugin_inbox_panel_activate (GtdActivatable *activatable)
+{
+  ;
+}
+
+static void
+gtd_plugin_inbox_panel_deactivate (GtdActivatable *activatable)
+{
+  ;
+}
+
+static GList*
+gtd_plugin_inbox_panel_get_header_widgets (GtdActivatable *activatable)
+{
+  return NULL;
+}
+
+static GtkWidget*
+gtd_plugin_inbox_panel_get_preferences_panel (GtdActivatable *activatable)
+{
+  return NULL;
+}
+
+static GList*
+gtd_plugin_inbox_panel_get_panels (GtdActivatable *activatable)
+{
+  GtdPluginInboxPanel *plugin = GTD_PLUGIN_INBOX_PANEL (activatable);
+
+  return plugin->panels;
+}
+
+static GList*
+gtd_plugin_inbox_panel_get_providers (GtdActivatable *activatable)
+{
+  return NULL;
+}
+
+static void
+gtd_activatable_iface_init (GtdActivatableInterface *iface)
+{
+  iface->activate = gtd_plugin_inbox_panel_activate;
+  iface->deactivate = gtd_plugin_inbox_panel_deactivate;
+  iface->get_header_widgets = gtd_plugin_inbox_panel_get_header_widgets;
+  iface->get_preferences_panel = gtd_plugin_inbox_panel_get_preferences_panel;
+  iface->get_panels = gtd_plugin_inbox_panel_get_panels;
+  iface->get_providers = gtd_plugin_inbox_panel_get_providers;
+}
+
+static void
+gtd_plugin_inbox_panel_finalize (GObject *object)
+{
+  GtdPluginInboxPanel *self = (GtdPluginInboxPanel *)object;
+
+  g_list_free (self->panels);
+
+  G_OBJECT_CLASS (gtd_plugin_inbox_panel_parent_class)->finalize (object);
+}
+
+static void
+gtd_plugin_inbox_panel_get_property (GObject    *object,
+                                         guint       prop_id,
+                                         GValue     *value,
+                                         GParamSpec *pspec)
+{
+  switch (prop_id)
+    {
+    case PROP_PREFERENCES_PANEL:
+      g_value_set_object (value, NULL);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gtd_plugin_inbox_panel_class_init (GtdPluginInboxPanelClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = gtd_plugin_inbox_panel_finalize;
+  object_class->get_property = gtd_plugin_inbox_panel_get_property;
+
+  g_object_class_override_property (object_class, PROP_PREFERENCES_PANEL, "preferences-panel");
+}
+
+static void
+gtd_plugin_inbox_panel_init (GtdPluginInboxPanel *self)
+{
+  self->panels = g_list_append (NULL, gtd_inbox_panel_new ());
+}
+
+static void
+gtd_plugin_inbox_panel_class_finalize (GtdPluginInboxPanelClass *klass)
+{
+}
+
+G_MODULE_EXPORT void
+gtd_plugin_inbox_panel_register_types (PeasObjectModule *module)
+{
+  gtd_plugin_inbox_panel_register_type (G_TYPE_MODULE (module));
+
+  peas_object_module_register_extension_type (module,
+                                              GTD_TYPE_ACTIVATABLE,
+                                              GTD_TYPE_PLUGIN_INBOX_PANEL);
+}
diff --git a/plugins/inbox-panel/gtd-plugin-inbox-panel.h b/plugins/inbox-panel/gtd-plugin-inbox-panel.h
new file mode 100644
index 0000000..07bf735
--- /dev/null
+++ b/plugins/inbox-panel/gtd-plugin-inbox-panel.h
@@ -0,0 +1,36 @@
+/* gtd-plugin-inbox-panel.h
+ *
+ * Copyright 2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * 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 3 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/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+
+#pragma once
+
+#include "gnome-todo.h"
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define GTD_TYPE_PLUGIN_INBOX_PANEL (gtd_plugin_inbox_panel_get_type())
+
+G_DECLARE_FINAL_TYPE (GtdPluginInboxPanel, gtd_plugin_inbox_panel, GTD, PLUGIN_INBOX_PANEL, 
PeasExtensionBase)
+
+G_MODULE_EXPORT void gtd_plugin_inbox_panel_register_types   (PeasObjectModule   *module);
+
+G_END_DECLS
diff --git a/plugins/inbox-panel/inbox-panel.plugin.in b/plugins/inbox-panel/inbox-panel.plugin.in
new file mode 100644
index 0000000..e40b7c5
--- /dev/null
+++ b/plugins/inbox-panel/inbox-panel.plugin.in
@@ -0,0 +1,14 @@
+[Plugin]
+Name = Inbox
+Module = inbox-panel
+Description = A panel to show tasks in the inbox
+Version = @VERSION@
+Authors = Georges Basile Stavracas Neto <gbsneto gnome org>
+Copyright = Copyleft © The To Do maintainers
+Website = https://wiki.gnome.org/Apps/Todo
+Hidden = true
+Builtin = true
+License = GPL
+Loader = C
+Embedded = gtd_plugin_inbox_panel_register_types
+Depends =
diff --git a/plugins/inbox-panel/meson.build b/plugins/inbox-panel/meson.build
new file mode 100644
index 0000000..9c874fa
--- /dev/null
+++ b/plugins/inbox-panel/meson.build
@@ -0,0 +1,19 @@
+plugins_ldflags += ['-Wl,--undefined=gtd_plugin_inbox_panel_register_types']
+
+sources = files(
+  'gtd-inbox-panel.c',
+  'gtd-plugin-inbox-panel.c'
+)
+
+plugins_libs += static_library(
+         'inboxpanel',
+              sources: sources,
+  include_directories: plugins_incs,
+         dependencies: gnome_todo_deps
+)
+
+plugins_confs += configure_file(
+          input: 'inbox-panel.plugin.in',
+         output: 'inbox-panel.plugin',
+  configuration: plugins_conf
+)
diff --git a/plugins/meson.build b/plugins/meson.build
index ac912a1..f175ff0 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -11,6 +11,7 @@ subdir('all-tasks-panel')
 subdir('background')
 subdir('dark-theme')
 subdir('eds')
+subdir('inbox-panel')
 subdir('next-week-panel')
 subdir('night-light')
 subdir('scheduled-panel')
diff --git a/plugins/plugins.gresource.xml b/plugins/plugins.gresource.xml
index 6546757..690911b 100644
--- a/plugins/plugins.gresource.xml
+++ b/plugins/plugins.gresource.xml
@@ -21,6 +21,11 @@
     <file alias="plugins/eds/eds.plugin">eds/eds.plugin</file>
   </gresource>
 
+  <!--EDS Plugin-->
+  <gresource prefix="/org/gnome/todo">
+    <file alias="plugins/inbox-panel/inbox-panel.plugin">inbox-panel/inbox-panel.plugin</file>
+  </gresource>
+
   <!--Next Week panel-->
   <gresource prefix="/org/gnome/todo">
     <file 
alias="plugins/next-week-panel/scheduled-panel.plugin">next-week-panel/next-week-panel.plugin</file>


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