Index: gio/gseq.c
===================================================================
--- gio/gseq.c	(revision 0)
+++ gio/gseq.c	(revision 0)
@@ -0,0 +1,151 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+
+#include "gseq.h"
+#include "glibintl.h"
+
+#include "gioalias.h"
+
+/**
+ * SECTION:gseq
+ * @short_description: Represents a collection of items in a well-defined order.
+ * @include: gio/gio.h
+ * @see_also: #GCollection, #GIterable, #GIterator
+ * 
+ * #GSeq represents a collection of items in a well-defined order
+ **/
+
+static void 
+g_seq_base_init (gpointer * g_iface) 
+{
+}
+
+GType 
+g_seq_get_type (void) 
+{
+  static volatile gsize g_define_type_id__volatile = 0;
+
+  if (g_once_init_enter (&g_define_type_id__volatile))
+    {
+      const GTypeInfo seq_info = 
+      { 
+        sizeof (GSeqIface), 
+        g_seq_base_init, 
+        NULL, 
+        NULL, 
+        NULL, 
+        NULL, 
+        0, 
+        0, 
+        NULL 
+      };
+
+      GType g_define_type_id =
+	g_type_register_static (G_TYPE_INTERFACE, I_("GSeq"),
+				&seq_info, 0);
+
+      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+    }
+
+  return g_define_type_id__volatile;
+}
+
+
+/**
+ * g_seq_get:
+ * @seq: a #GSeq.
+ * @index: zero-based index of the item to be returned
+ *
+ * Returns: the item at the specified index in this list.
+ **/
+gpointer 
+g_seq_get (GSeq *seq, gint index) 
+{
+  return G_SEQ_GET_INTERFACE (seq)->get (seq, index);
+}
+
+
+/**
+ * g_seq_set:
+ * @seq: a #GSeq.
+ * @index zero-based index of the item to be set
+ *
+ * Sets the item at the specified index in this list.
+ **/
+void 
+g_seq_set (GSeq *seq, gint index, gconstpointer item) 
+{
+  G_SEQ_GET_INTERFACE (seq)->set (seq, index, item);
+}
+
+
+/**
+ * g_seq_index_of:
+ * @seq: a #GSeq.
+ * @item: item to find
+ *
+ * Returns the index of the first occurence of the specified item in
+ * this list.
+ *
+ * Returns: the index of the first occurence of the specified item, or
+ *         -1 if the item could not be found
+ **/
+gint
+g_seq_index_of (GSeq *seq, gconstpointer item) 
+{
+  return G_SEQ_GET_INTERFACE (seq)->index_of (seq, item);
+}
+
+
+/**
+ * g_seq_insert:
+ * @seq: a #GSeq.
+ * @index: zero-based index at which item is inserted
+ * @item: item to insert into the list
+ *
+ * Inserts an item into this list at the specified position.
+ **/
+void 
+g_seq_insert (GSeq *seq, gint index, gconstpointer item) 
+{
+  G_SEQ_GET_INTERFACE (seq)->insert (seq, index, item);
+}
+
+
+/**
+ * g_seq_remove_at:
+ * @seq: a #GSeq.
+ * @index zero-based index of the item to be removed
+ *
+ * Removes the item at the specified index of this list.
+ **/
+void 
+g_seq_remove_at (GSeq *seq, gint index) 
+{
+  G_SEQ_GET_INTERFACE (seq)->remove_at (seq, index);
+}
+
+
+
+
Index: gio/gseq.h
===================================================================
--- gio/gseq.h	(revision 0)
+++ gio/gseq.h	(revision 0)
@@ -0,0 +1,64 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_SEQ_H__
+#define __G_SEQ_H__
+
+#include <gio/giotypes.h>
+#include <gio/gcollection.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_SEQ                (g_seq_get_type ())
+#define G_SEQ(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SEQ, GSeq))
+#define G_IS_SEQ(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SEQ))
+#define G_SEQ_GET_INTERFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_SEQ, GSeqIface))
+
+typedef struct _GSeqIface GSeqIface;
+
+struct _GSeqIface 
+{
+  GTypeInterface g_iface;
+
+  gpointer (* get)        (GSeq *seq, gint index);
+  void     (* set)        (GSeq *seq, gint index, gconstpointer item);
+  gint     (* index_of)   (GSeq *seq, gconstpointer item);
+  void     (* insert)     (GSeq *seq, gint index, gconstpointer item);
+  void     (* remove_at)  (GSeq *seq, gint index);
+};
+
+GType     g_seq_get_type   (void) G_GNUC_CONST;
+
+gpointer  g_seq_get        (GSeq *seq, gint index);
+void      g_seq_set        (GSeq *seq, gint index, gconstpointer item);
+gint      g_seq_index_of   (GSeq *seq, gconstpointer item);
+void      g_seq_insert     (GSeq *seq, gint index, gconstpointer item);
+void      g_seq_remove_at  (GSeq *seq, gint index);
+
+
+G_END_DECLS
+
+#endif /* __G_SEQ_H__ */
Index: gio/giotypes.h
===================================================================
--- gio/giotypes.h	(revision 7754)
+++ gio/giotypes.h	(working copy)
@@ -112,6 +112,38 @@
 typedef struct _GVolumeMonitor                GVolumeMonitor;
 
 /**
+ * GSeq
+ *
+ * Represents a collection of items in a well-defined order.
+ **/
+typedef struct _GSeq GSeq;
+
+/**
+ * GIterator
+ *
+ * Implemented by classes that support a simple iteration over instances of the
+ * collection.
+ **/
+typedef struct _GIterator GIterator;
+
+/**
+ * GCollection
+ *
+ * Serves as the base interface for implementing collection classes. Defines
+ * size, iteration, and modification methods.
+ **/
+typedef struct _GCollection GCollection;
+
+/**
+ * GIterable
+ *
+ * Implemented by classes that support a simple iteration over instances of the
+ * collection.
+ **/
+typedef struct _GIterable GIterable;
+
+
+/**
  * GAsyncReadyCallback:
  * @source_object: the object the asynchronous operation was started with.
  * @res: a #GAsyncResult.
Index: gio/giterable.c
===================================================================
--- gio/giterable.c	(revision 0)
+++ gio/giterable.c	(revision 0)
@@ -0,0 +1,132 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+#include "giterable.h"
+
+#include "glibintl.h"
+#include "gioalias.h"
+
+/**
+ * SECTION:giterable
+ * @short_description: Implemented by classes that support a simple iteration
+ * @include: gio/gio.h
+ * @see_also: #GIterator
+ * 
+ * Implemented by classes that support a simple iteration over instances of the
+ * collection.
+ **/
+
+static void 
+g_iterable_base_init (gpointer g_iface) 
+{
+}
+
+
+GType
+g_iterable_get_type (void)
+{
+  static volatile gsize g_define_type_id__volatile = 0;
+
+  if (g_once_init_enter (&g_define_type_id__volatile))
+    {
+      const GTypeInfo iterable_info =
+      {
+        sizeof (GIterableIface), /* class_size */
+	g_iterable_base_init,   /* base_init */
+	NULL,		/* base_finalize */
+	NULL,
+	NULL,		/* class_finalize */
+	NULL,		/* class_data */
+	0,
+	0,              /* n_preallocs */
+	NULL
+      };
+      GType g_define_type_id =
+	g_type_register_static (G_TYPE_INTERFACE, I_("GIterable"),
+				&iterable_info, 0);
+
+      g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
+
+      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+    }
+
+  return g_define_type_id__volatile;
+}
+
+/**
+ * g_iterable_get_element_type:
+ * @iterable: a #GIterable.
+ *
+ * Get the element-type of elements in the iterable.
+ *
+ * Returns: the element-type
+ **/
+GType 
+g_iterable_get_element_type (GIterable *iterable) 
+{
+  return G_ITERABLE_GET_INTERFACE (iterable)->get_element_type (iterable);
+}
+
+/**
+ * g_iterable_iterator:
+ * @iterable: a #GIterable.
+ *
+ * Create an iterator for this iterable. The returned value must be unreferenced
+ * after use using @g_object_unref.
+ *
+ * Returns: a new iterator
+ **/
+GIterator* 
+g_iterable_iterator (GIterable *iterable) 
+{
+  return G_ITERABLE_GET_INTERFACE (iterable)->iterator (iterable);
+}
+
+/**
+ * g_iterable_iterate:
+ * @iterable: a #GIterable that will be unreferenced
+ *
+ * Create an iterator for this iterable. The returned value must be unreferenced
+ * after use using @g_object_unref. The @iterable being passed will be unreferenced
+ * as a result of this function.
+ *
+ * Example:
+ * <informalexample><programlisting>
+ * GIterator *children;
+ * children = g_iterable_iterate (egg_container_get_children (container));
+ * while (g_iterator_next (children)) {
+ *       GtkWidget *child = g_iterator_get (children);
+ * }
+ * g_object_unref (children);
+ * </programlisting></informalexample>
+ *
+ * Returns: a new iterator and unreferences the passed value
+ **/
+GIterator*
+g_iterable_iterate (GIterable *iterable)
+{
+  GIterator *iterator = G_ITERABLE_GET_INTERFACE (iterable)->iterator (iterable);
+  g_object_unref (iterable);
+  return iterator;
+}
+
Index: gio/giterable.h
===================================================================
--- gio/giterable.h	(revision 0)
+++ gio/giterable.h	(revision 0)
@@ -0,0 +1,58 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_ITERABLE_H__
+#define __G_ITERABLE_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ITERABLE                (g_iterable_get_type ())
+#define G_ITERABLE(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ITERABLE, GIterable))
+#define G_IS_ITERABLE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ITERABLE))
+#define G_ITERABLE_GET_INTERFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ITERABLE, GIterableIface))
+
+typedef struct _GIterableIface GIterableIface;
+
+struct _GIterableIface 
+{
+  GTypeInterface g_iface;
+
+  GType       (* get_element_type)  (GIterable *iterable);
+  GIterator*  (* iterator)          (GIterable *iterable);
+};
+
+GType       g_iterable_get_type          (void) G_GNUC_CONST;
+
+GType       g_iterable_get_element_type  (GIterable *iterable);
+GIterator*  g_iterable_iterator          (GIterable *iterable);
+
+GIterator*  g_iterable_iterate           (GIterable *iterable);
+
+G_END_DECLS
+
+#endif /* __G_ITERABLE_H__ */
Index: gio/gio.h
===================================================================
--- gio/gio.h	(revision 7754)
+++ gio/gio.h	(working copy)
@@ -68,6 +68,10 @@
 #include <gio/gvfs.h>
 #include <gio/gvolume.h>
 #include <gio/gvolumemonitor.h>
+#include <gio/gseq.h>
+#include <gio/gcollection.h>
+#include <gio/giterable.h>
+#include <gio/giterator.h>
 
 #undef __GIO_GIO_H_INSIDE__
 
Index: gio/Makefile.am
===================================================================
--- gio/Makefile.am	(revision 7754)
+++ gio/Makefile.am	(working copy)
@@ -225,6 +225,14 @@
 	gioenumtypes.c		\
 	gioalias.h 		\
 	gioaliasdef.c		\
+	giterable.c		\
+	giterable.h		\
+	gcollection.c		\
+	gcollection.h		\
+	giterator.c		\
+	giterator.h		\
+	gseq.c			\
+	gseq.h			\
 	$(appinfo_sources) 	\
 	$(unix_sources) 	\
 	$(win32_sources) 	\
Index: gio/gcollection.c
===================================================================
--- gio/gcollection.c	(revision 0)
+++ gio/gcollection.c	(revision 0)
@@ -0,0 +1,155 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+#include "gcollection.h"
+
+#include "glibintl.h"
+#include "gioalias.h"
+
+/**
+ * SECTION:gcollection
+ * @short_description: Serves as the base interface for implementing collection classes.
+ * @include: gio/gio.h
+ * @see_also: #GSeq, #GIterable, #GIterator
+ * 
+ * Serves as the base interface for implementing collection classes. Defines
+ * size, iteration, and modification methods.
+ **/
+
+
+static void 
+g_collection_base_init (gpointer g_iface) 
+{
+}
+
+
+GType
+g_collection_get_type (void)
+{
+  static volatile gsize g_define_type_id__volatile = 0;
+
+  if (g_once_init_enter (&g_define_type_id__volatile))
+    {
+      const GTypeInfo collection_info =
+      {
+        sizeof (GCollectionIface), /* class_size */
+	g_collection_base_init,   /* base_init */
+	NULL,		/* base_finalize */
+	NULL,
+	NULL,		/* class_finalize */
+	NULL,		/* class_data */
+	0,
+	0,              /* n_preallocs */
+	NULL
+      };
+      GType g_define_type_id =
+	g_type_register_static (G_TYPE_INTERFACE, I_("GIterable"),
+				&collection_info, 0);
+
+      g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
+
+      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+    }
+
+  return g_define_type_id__volatile;
+}
+
+
+/**
+ * g_collection_contains:
+ * @col: a #GCollection/
+ * @item: the item to locate in the collection
+ *
+ * Determines whether this collection contains the specified item.
+ *
+ * Returns: true if item is found, false otherwise
+ **/
+gboolean 
+g_collection_contains (GCollection *col, gconstpointer item) 
+{
+  return G_COLLECTION_GET_INTERFACE (col)->contains (col, item);
+}
+
+
+/**
+ * g_collection_add:
+ * @col: a #GCollection.
+ * @item: the item to add to the collection
+ *
+ * Adds an item to this collection. Must not be called on read-only
+ * collections.
+ *
+ * Returns: true if the collection has been changed, false otherwise
+ **/
+gboolean 
+g_collection_add (GCollection *col, gconstpointer item) 
+{
+  return G_COLLECTION_GET_INTERFACE (col)->add (col, item);
+}
+
+
+/**
+ * g_collection_remove:
+ * @col: a #GCollection.
+ * @item: the item to remove from the collection
+ *
+ * Removes the first occurence of an item from this collection. Must not
+ * be called on read-only collections.
+ *
+ * Returns: true if the collection has been changed, false otherwise
+ **/
+gboolean 
+g_collection_remove (GCollection *col, gconstpointer item) 
+{
+  return G_COLLECTION_GET_INTERFACE (col)->remove (col, item);
+}
+
+
+/**
+ * g_collection_clear:
+ * @col: a #GCollection.
+ *
+ * Removes all items from this collection. Must not be called on
+ * read-only collections.
+ **/
+void 
+g_collection_clear (GCollection *col) 
+{
+  G_COLLECTION_GET_INTERFACE (col)->clear (col);
+}
+
+
+/**
+ * g_collection_get_size:
+ * @col: a #GCollection.
+ *
+ * Gets the size of the collection
+ *
+ * Returns: the size
+ **/
+gint 
+g_collection_get_size (GCollection *col) 
+{
+  return G_COLLECTION_GET_INTERFACE (col)->get_size (col);
+}
+
Index: gio/gcollection.h
===================================================================
--- gio/gcollection.h	(revision 0)
+++ gio/gcollection.h	(revision 0)
@@ -0,0 +1,63 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_COLLECTION_H__
+#define __G_COLLECTION_H__
+
+#include <gio/giotypes.h>
+#include <gio/giterable.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_COLLECTION                (g_collection_get_type ())
+#define G_COLLECTION(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_COLLECTION, GCollection))
+#define G_IS_COLLECTION(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_COLLECTION))
+#define G_COLLECTION_GET_INTERFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_COLLECTION, GCollectionIface))
+
+typedef struct _GCollectionIface GCollectionIface;
+
+struct _GCollectionIface 
+{
+  GTypeInterface g_iface;
+
+  gboolean  (* contains)  (GCollection *col, gconstpointer item);
+  gboolean  (* add)       (GCollection *col, gconstpointer item);
+  gboolean  (* remove)    (GCollection *col, gconstpointer item);
+  void      (* clear)     (GCollection *col);
+  gint      (* get_size)  (GCollection *col);
+};
+
+GType     g_collection_get_type (void) G_GNUC_CONST;
+
+gboolean  g_collection_contains  (GCollection *col, gconstpointer item);
+gboolean  g_collection_add       (GCollection *col, gconstpointer item);
+gboolean  g_collection_remove    (GCollection *col, gconstpointer item);
+void      g_collection_clear     (GCollection *col);
+gint      g_collection_get_size  (GCollection *col);
+
+G_END_DECLS
+
+#endif /* __G_COLLECTION_H__ */
Index: gio/giterator.c
===================================================================
--- gio/giterator.c	(revision 0)
+++ gio/giterator.c	(revision 0)
@@ -0,0 +1,108 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+#include "giterator.h"
+
+#include "glibintl.h"
+#include "gioalias.h"
+
+/**
+ * SECTION:giterator
+ * @short_description: Implemented by classes that support a simple iteration over instances
+ * @include: gio/gio.h
+ * @see_also: #GSeq, #GIterable, #GCollection
+ * 
+ * Implemented by classes that support a simple iteration over instances of the
+ * collection. 
+ **/
+
+
+static void 
+g_iterator_base_init (gpointer g_iface) 
+{
+}
+
+
+GType
+g_iterator_get_type (void)
+{
+  static volatile gsize g_define_type_id__volatile = 0;
+
+  if (g_once_init_enter (&g_define_type_id__volatile))
+    {
+      const GTypeInfo iterator_info =
+      {
+        sizeof (GIteratorIface), /* class_size */
+	g_iterator_base_init,   /* base_init */
+	NULL,		/* base_finalize */
+	NULL,
+	NULL,		/* class_finalize */
+	NULL,		/* class_data */
+	0,
+	0,              /* n_preallocs */
+	NULL
+      };
+      GType g_define_type_id =
+	g_type_register_static (G_TYPE_INTERFACE, I_("GIterator"),
+				&iterator_info, 0);
+
+      g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
+
+      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+    }
+
+  return g_define_type_id__volatile;
+}
+
+
+/**
+ * g_iterator_next:
+ * @iter: a #GIterator.
+ *
+ * Advances to the next element in the iteration.
+ *
+ * Returns: true if the iterator has a next element
+ **/
+gboolean 
+g_iterator_next (GIterator *iter) 
+{
+  return G_ITERATOR_GET_INTERFACE (iter)->next (iter);
+}
+
+
+/**
+ * g_iterator_get:
+ * @iter: a #GIterator.
+ *
+ * Returns: the current element in the iteration
+ **/
+gpointer 
+g_iterator_get (GIterator *iter) 
+{
+  return G_ITERATOR_GET_INTERFACE (iter)->get (iter);
+}
+
+
+
+
+
Index: gio/giterator.h
===================================================================
--- gio/giterator.h	(revision 0)
+++ gio/giterator.h	(revision 0)
@@ -0,0 +1,56 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2007-2008 Philip Van Hoof.
+ *
+ * This library 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 library 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Philip Van Hoof <philip@codeminded.be>
+ */
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#ifndef __G_ITERATOR_H__
+#define __G_ITERATOR_H__
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_ITERATOR                (g_iterator_get_type ())
+#define G_ITERATOR(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ITERATOR, GIterator))
+#define G_IS_ITERATOR(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ITERATOR))
+#define G_ITERATOR_GET_INTERFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ITERATOR, GIteratorIface))
+
+typedef struct _GIteratorIface GIteratorIface;
+
+struct _GIteratorIface 
+{
+  GTypeInterface g_iface;
+
+  gboolean (* next) (GIterator *iter);
+  gpointer (* get)  (GIterator *iter);
+};
+
+GType     g_iterator_get_type  (void) G_GNUC_CONST;
+
+gboolean  g_iterator_next      (GIterator *iter);
+gpointer  g_iterator_get       (GIterator *iter);
+
+G_END_DECLS
+
+#endif /* __G_ITERATOR_H__ */
