[libgd/wip/rishi/main-box: 4/7] Add GdMainBoxDisplayable
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd/wip/rishi/main-box: 4/7] Add GdMainBoxDisplayable
- Date: Fri, 25 Nov 2016 15:56:10 +0000 (UTC)
commit ce4b58109318907886ee27178859f09cbc5f74aa
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Nov 23 14:43:08 2016 +0100
Add GdMainBoxDisplayable
https://bugzilla.gnome.org/show_bug.cgi?id=774914
libgd/gd-main-box-displayable.c | 77 +++++++++++++++++++++++++++++++++++++++
libgd/gd-main-box-displayable.h | 59 ++++++++++++++++++++++++++++++
2 files changed, 136 insertions(+), 0 deletions(-)
---
diff --git a/libgd/gd-main-box-displayable.c b/libgd/gd-main-box-displayable.c
new file mode 100644
index 0000000..5b3e2d0
--- /dev/null
+++ b/libgd/gd-main-box-displayable.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author: Debarshi Ray <debarshir gnome org>
+ *
+ */
+
+#include "gd-main-box-displayable.c"
+
+G_DEFINE_INTERFACE (GdMainBoxDisplayable, gd_main_box_displayable, G_TYPE_OBJECT)
+
+static void
+gd_main_box_displayable_default_init (GdMainBoxDisplayableInterface *iface)
+{
+}
+
+/**
+ * gd_main_box_displayable_get_id:
+ * @self:
+ *
+ * Returns: (transfer none): The ID
+ */
+const gchar *
+gd_main_box_displayable_get_id (GdMainBoxDisplayable *self)
+{
+ GdMainBoxDisplayableInterface *iface;
+
+ iface = GD_MAIN_BOX_DISPLAYABLE_GET_IFACE (self);
+
+ return (* iface->get_id) (self);
+}
+
+/**
+ * gd_main_box_displayable_get_uri:
+ * @self:
+ *
+ * Returns: (transfer none): The URI
+ */
+const gchar *
+gd_main_box_displayable_get_uri (GdMainBoxDisplayable *self)
+{
+ GdMainBoxDisplayableInterface *iface;
+
+ iface = GD_MAIN_BOX_DISPLAYABLE_GET_IFACE (self);
+
+ return (* iface->get_uri) (self);
+}
+
+/**
+ * gd_main_box_displayable_get_primary_text:
+ * @self:
+ *
+ * Returns: (transfer none): The primary text
+ */
+const gchar *
+gd_main_box_displayable_get_primary_text (GdMainBoxDisplayable *self)
+{
+ GdMainBoxDisplayableInterface *iface;
+
+ iface = GD_MAIN_BOX_DISPLAYABLE_GET_IFACE (self);
+
+ return (* iface->get_primary_text) (self);
+}
diff --git a/libgd/gd-main-box-displayable.h b/libgd/gd-main-box-displayable.h
new file mode 100644
index 0000000..439c416
--- /dev/null
+++ b/libgd/gd-main-box-displayable.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author: Debarshi Ray <debarshir gnome org>
+ *
+ */
+
+#ifndef __GD_MAIN_BOX_DISPLAYABLE_H__
+#define __GD_MAIN_BOX_DISPLAYABLE_H__
+
+#include <cairo.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GD_TYPE_MAIN_VIEW_GENERIC gd_main_view_generic_get_type()
+G_DEFINE_INTERFACE (GdMainBoxDisplayable, gd_main_box_displayable, GD, MAIN_BOX_DISPLAYABLE, GObject)
+
+struct _GdMainViewGenericInterface
+{
+ GTypeInterface base_iface;
+
+ /* vtable */
+ const gchar * (* get_id) (GdMainBoxDisplayable *self);
+ const gchar * (* get_uri) (GdMainBoxDisplayable *self);
+ const gchar * (* get_primary_text) (GdMainBoxDisplayable *self);
+ const gchar * (* get_secondary_text) (GdMainBoxDisplayable *self);
+ cairo_surface_t * (* get_icon) (GdMainBoxDisplayable *self);
+ gint64 (* get_mtime) (GdMainBoxDisplayable *self);
+ gboolean (* get_selected) (GdMainBoxDisplayable *self);
+ guint (* get_pulse) (GdMainBoxDisplayable *self);
+};
+
+const gchar * gd_main_box_displayable_get_id (GdMainBoxDisplayable *self);
+const gchar * gd_main_box_displayable_get_uri (GdMainBoxDisplayable *self);
+const gchar * gd_main_box_displayable_get_primary_text (GdMainBoxDisplayable *self);
+const gchar * gd_main_box_displayable_get_secondary_text (GdMainBoxDisplayable *self);
+cairo_surface_t * gd_main_box_displayable_get_icon (GdMainBoxDisplayable *self);
+guint64 gd_main_box_displayable_get_mtime (GdMainBoxDisplayable *self);
+gboolean gd_main_box_displayable_get_selected (GdMainBoxDisplayable *self);
+guint gd_main_box_displayable_get_pulse (GdMainBoxDisplayable *self);
+
+G_END_DECLS
+
+#endif /* __GD_MAIN_BOX_DISPLAYABLE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]