"The parent of the item",
G_TYPE_OBJECT,
flags));
+
+ class->copy = NULL;
}
katze_object_assign (item->parent, parent);
g_object_notify (G_OBJECT (item), "parent");
}
+
+/**
+ * katze_item_copy:
+ * @item: a #KatzeItem
+ *
+ * Creates an exact copy of @item.
+ *
+ * Note that subclass specific features will only
+ * be preserved if the class implements it.
+ *
+ * Return value: a new #KatzeItem
+ *
+ * Since: 0.1.3
+ **/
+KatzeItem*
+katze_item_copy (KatzeItem* item)
+{
+ KatzeItem* copy;
+ KatzeItemClass* class;
+
+ g_return_val_if_fail (KATZE_IS_ITEM (item), NULL);
+
+ copy = g_object_new (G_OBJECT_TYPE (item),
+ "name", item->name,
+ "text", item->text,
+ "uri", item->uri,
+ "icon", item->icon,
+ "token", item->token,
+ "added", item->added,
+ "parent", item->parent,
+ NULL);
+ class = KATZE_ITEM_GET_CLASS (item);
+ return class->copy ? class->copy (copy) : copy;
+}
struct _KatzeItemClass
{
GObjectClass parent_class;
+
+ gpointer
+ (*copy) (KatzeItem* item);
};
GType
katze_item_set_parent (KatzeItem* item,
gpointer parent);
+KatzeItem*
+katze_item_copy (KatzeItem* item);
+
G_END_DECLS
#endif /* __MIDORI_WEB_ITEM_H__ */