From 69de51a15ab85e4dca9fed93a1e03644b0e6a840 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 15 Jun 2013 14:25:16 -0400 Subject: Convert ETreeModel to an interface. This commit does a number of things which I could not subdivide into smaller commits. * Converts ETreeModel to an interface, implemented by MessageList. * Drops ETreeMemory and ETreeMemoryCallbacks, which were ETreeModel subclasses. Their functionality is subsumed by MessageList. * MessageList drops its public ETreeModel pointer, since MessageList now implements ETreeModel as an interface. * Adds message_list_set_expanded_default(), which takes over for e_tree_memory_set_expanded_default(). --- e-util/e-tree-model.h | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'e-util/e-tree-model.h') diff --git a/e-util/e-tree-model.h b/e-util/e-tree-model.h index 431f93e2a2..bdbf64ce1b 100644 --- a/e-util/e-tree-model.h +++ b/e-util/e-tree-model.h @@ -1,4 +1,5 @@ /* + * e-tree-model.h * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -13,13 +14,6 @@ * You should have received a copy of the GNU Lesser General Public * License along with the program; if not, see * - * - * Authors: - * Chris Lahey - * Chris Toshok - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * */ #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) @@ -37,40 +31,27 @@ #define E_TREE_MODEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), E_TYPE_TREE_MODEL, ETreeModel)) -#define E_TREE_MODEL_CLASS(cls) \ - (G_TYPE_CHECK_CLASS_CAST \ - ((cls), E_TYPE_TREE_MODEL, ETreeModelClass)) #define E_IS_TREE_MODEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ ((obj), E_TYPE_TREE_MODEL)) -#define E_IS_TREE_MODEL_CLASS(cls) \ - (G_TYPE_CHECK_CLASS_TYPE \ - ((cls), E_TYPE_TREE_MODEL)) -#define E_TREE_MODEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS \ - ((obj), E_TYPE_TREE_MODEL, ETreeModelClass)) +#define E_TREE_MODEL_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE \ + ((obj), E_TYPE_TREE_MODEL, ETreeModelInterface)) G_BEGIN_DECLS typedef gpointer ETreePath; typedef struct _ETreeModel ETreeModel; -typedef struct _ETreeModelClass ETreeModelClass; +typedef struct _ETreeModelInterface ETreeModelInterface; typedef gboolean (*ETreePathFunc) (ETreeModel *tree_model, ETreePath path, gpointer data); -struct _ETreeModel { - GObject parent; -}; +struct _ETreeModelInterface { + GTypeInterface parent_class; -struct _ETreeModelClass { - GObjectClass parent_class; - - /* - * Virtual methods - */ ETreePath (*get_root) (ETreeModel *tree_model); ETreePath (*get_parent) (ETreeModel *tree_model, -- cgit v1.2.3