[libgd/wip/rishi/main-box: 4/7] Add GdMainBoxChild
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd/wip/rishi/main-box: 4/7] Add GdMainBoxChild
- Date: Sun, 27 Nov 2016 01:40:43 +0000 (UTC)
commit c4e6b9adb9c82712cfb15df6eab25f7da0a0f276
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Nov 25 17:10:44 2016 +0100
Add GdMainBoxChild
https://bugzilla.gnome.org/show_bug.cgi?id=774914
libgd/gd-main-box-child.c | 92 +++++++++++++++++++++++++++++++++++++++++++++
libgd/gd-main-box-child.h | 54 ++++++++++++++++++++++++++
2 files changed, 146 insertions(+), 0 deletions(-)
---
diff --git a/libgd/gd-main-box-child.c b/libgd/gd-main-box-child.c
new file mode 100644
index 0000000..67dc5cc
--- /dev/null
+++ b/libgd/gd-main-box-child.c
@@ -0,0 +1,92 @@
+/*
+ * 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-child.c"
+
+G_DEFINE_INTERFACE (GdMainBoxChild, gd_main_box_child, G_TYPE_OBJECT)
+
+static void
+gd_main_box_child_default_init (GdMainBoxChildInterface *iface)
+{
+}
+
+/**
+ * gd_main_box_child_get_item:
+ * @self:
+ *
+ * Returns: (transfer none): The #GdMainBoxItem
+ */
+GdMainBoxItem *
+gd_main_box_child_get_item (GdMainBoxChild *self)
+{
+ GdMainBoxChildInterface *iface;
+
+ iface = GD_MAIN_BOX_CHILD_GET_IFACE (self);
+
+ return (* iface->get_item) (self);
+}
+
+/**
+ * gd_main_box_child_get_index:
+ * @self:
+ *
+ * Returns: (transfer none): The index
+ */
+gint
+gd_main_box_child_get_index (GdMainBoxChild *self)
+{
+ GdMainBoxChildInterface *iface;
+
+ iface = GD_MAIN_BOX_CHILD_GET_IFACE (self);
+
+ return (* iface->get_index) (self);
+}
+
+/**
+ * gd_main_box_child_get_selection_mode:
+ * @self:
+ *
+ * Returns: (transfer none): The selection mode
+ */
+gboolean
+gd_main_box_child_get_selection_mode (GdMainBoxChild *self)
+{
+ GdMainBoxChildInterface *iface;
+
+ iface = GD_MAIN_BOX_CHILD_GET_IFACE (self);
+
+ return (* iface->get_seletion_mode) (self);
+}
+
+/**
+ * gd_main_box_child_set_selection_mode:
+ * @self:
+ * @selection_mode:
+ */
+void
+gd_main_box_child_set_selection_mode (GdMainBoxChild *self, gboolean selection_mode)
+{
+ GdMainBoxChildInterface *iface;
+
+ iface = GD_MAIN_BOX_CHILD_GET_IFACE (self);
+
+ (* iface->set_selection_mode) (self, selection_mode);
+}
diff --git a/libgd/gd-main-box-child.h b/libgd/gd-main-box-child.h
new file mode 100644
index 0000000..109593b
--- /dev/null
+++ b/libgd/gd-main-box-child.h
@@ -0,0 +1,54 @@
+/*
+ * 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_CHILD_H__
+#define __GD_MAIN_BOX_CHILD_H__
+
+#include <glib-object.h>
+
+#include "gd-main-box-item.h"
+
+G_BEGIN_DECLS
+
+#define GD_TYPE_MAIN_VIEW_GENERIC gd_main_view_generic_get_type()
+G_DEFINE_INTERFACE (GdMainBoxChild, gd_main_box_child, GD, MAIN_BOX_CHILD, GObject)
+
+struct _GdMainBoxChildInterface
+{
+ GTypeInterface base_iface;
+
+ /* vtable */
+ GdMainBoxItem * (* get_item) (GdMainBoxChild *self);
+ gint (* get_index) (GdMainBoxChild *self);
+ gboolean (* get_selection_mode) (GdMainBoxChild *self);
+ void (* set_selection_mode) (GdMainBoxChild *self, gboolean selection_mode);
+};
+
+GdMainBoxItem * gd_main_box_child_get_item (GdMainBoxChild *self);
+gint gd_main_box_child_get_index (GdMainBoxChild *self);
+gboolean gd_main_box_child_get_selected (GdMainBoxChild *self);
+gboolean gd_main_box_child_get_selection_mode (GdMainBoxChild *self);
+void gd_main_box_child_set_selected (GdMainBoxChild *self, gboolean selected);
+void gd_main_box_child_set_selection_mode (GdMainBoxChild *self, gboolean selection_mode);
+
+G_END_DECLS
+
+#endif /* __GD_MAIN_BOX_CHILD_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]