diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-17 02:24:31 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-17 07:52:52 +0800 |
commit | 992c8b7d58025cf4d04ed3665210f191c8048339 (patch) | |
tree | ed04bd47c142c1a35820b03c6df8e8455d86f15c /widgets/table/e-table-sort-info.h | |
parent | 2c476af581cc64bb3de8edc726149a7d8e9677b8 (diff) | |
download | gsoc2013-evolution-992c8b7d58025cf4d04ed3665210f191c8048339.tar.gz gsoc2013-evolution-992c8b7d58025cf4d04ed3665210f191c8048339.tar.zst gsoc2013-evolution-992c8b7d58025cf4d04ed3665210f191c8048339.zip |
libetable cleanups.
Diffstat (limited to 'widgets/table/e-table-sort-info.h')
-rw-r--r-- | widgets/table/e-table-sort-info.h | 127 |
1 files changed, 75 insertions, 52 deletions
diff --git a/widgets/table/e-table-sort-info.h b/widgets/table/e-table-sort-info.h index d9ffec9be2..a577481150 100644 --- a/widgets/table/e-table-sort-info.h +++ b/widgets/table/e-table-sort-info.h @@ -6,7 +6,7 @@ * * 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 + * 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 @@ -26,24 +26,38 @@ #include <glib-object.h> #include <libxml/tree.h> -G_BEGIN_DECLS +#define E_TYPE_TABLE_SORT_INFO \ + (e_table_sort_info_get_type ()) +#define E_TABLE_SORT_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_TABLE_SORT_INFO, ETableSortInfo)) +#define E_TABLE_SORT_INFO_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_TABLE_SORT_INFO, ETableSortInfoClass)) +#define E_IS_TABLE_SORT_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_TABLE_SORT_INFO)) +#define E_IS_TABLE_SORT_INFO_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_TABLE_SORT_INFO)) +#define E_TABLE_SORT_INFO_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_TABLE_SORT_INFO, ETableSortInfoClass)) -#define E_TABLE_SORT_INFO_TYPE (e_table_sort_info_get_type ()) -#define E_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfo)) -#define E_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass)) -#define E_IS_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORT_INFO_TYPE)) -#define E_IS_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORT_INFO_TYPE)) -#define E_TABLE_SORT_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass)) +G_BEGIN_DECLS typedef struct _ETableSortColumn ETableSortColumn; +typedef struct _ETableSortInfo ETableSortInfo; +typedef struct _ETableSortInfoClass ETableSortInfoClass; + struct _ETableSortColumn { guint column : 31; guint ascending : 1; }; -typedef struct { - GObject base; +struct _ETableSortInfo { + GObject parent; gint group_count; ETableSortColumn *groupings; @@ -55,51 +69,60 @@ typedef struct { guint group_info_changed : 1; guint can_group : 1; -} ETableSortInfo; +}; -typedef struct { +struct _ETableSortInfoClass { GObjectClass parent_class; - /* - * Signals - */ - void (*sort_info_changed) (ETableSortInfo *info); - void (*group_info_changed) (ETableSortInfo *info); -} ETableSortInfoClass; - -GType e_table_sort_info_get_type (void); - -void e_table_sort_info_freeze (ETableSortInfo *info); -void e_table_sort_info_thaw (ETableSortInfo *info); - -guint e_table_sort_info_grouping_get_count (ETableSortInfo *info); -void e_table_sort_info_grouping_truncate (ETableSortInfo *info, - gint length); -ETableSortColumn e_table_sort_info_grouping_get_nth (ETableSortInfo *info, - gint n); -void e_table_sort_info_grouping_set_nth (ETableSortInfo *info, - gint n, - ETableSortColumn column); - -guint e_table_sort_info_sorting_get_count (ETableSortInfo *info); -void e_table_sort_info_sorting_truncate (ETableSortInfo *info, - gint length); -ETableSortColumn e_table_sort_info_sorting_get_nth (ETableSortInfo *info, - gint n); -void e_table_sort_info_sorting_set_nth (ETableSortInfo *info, - gint n, - ETableSortColumn column); - -ETableSortInfo *e_table_sort_info_new (void); -void e_table_sort_info_load_from_node (ETableSortInfo *info, - xmlNode *node, - gdouble state_version); -xmlNode *e_table_sort_info_save_to_node (ETableSortInfo *info, - xmlNode *parent); -ETableSortInfo *e_table_sort_info_duplicate (ETableSortInfo *info); -void e_table_sort_info_set_can_group (ETableSortInfo *info, - gboolean can_group); -gboolean e_table_sort_info_get_can_group (ETableSortInfo *info); + /* Signals */ + void (*sort_info_changed) (ETableSortInfo *info); + void (*group_info_changed) (ETableSortInfo *info); +}; + +GType e_table_sort_info_get_type (void) G_GNUC_CONST; + +void e_table_sort_info_freeze (ETableSortInfo *info); +void e_table_sort_info_thaw (ETableSortInfo *info); + +guint e_table_sort_info_grouping_get_count + (ETableSortInfo *info); +void e_table_sort_info_grouping_truncate + (ETableSortInfo *info, + gint length); +ETableSortColumn + e_table_sort_info_grouping_get_nth + (ETableSortInfo *info, + gint n); +void e_table_sort_info_grouping_set_nth + (ETableSortInfo *info, + gint n, + ETableSortColumn column); + +guint e_table_sort_info_sorting_get_count + (ETableSortInfo *info); +void e_table_sort_info_sorting_truncate + (ETableSortInfo *info, + gint length); +ETableSortColumn + e_table_sort_info_sorting_get_nth + (ETableSortInfo *info, + gint n); +void e_table_sort_info_sorting_set_nth + (ETableSortInfo *info, + gint n, + ETableSortColumn column); + +ETableSortInfo *e_table_sort_info_new (void); +void e_table_sort_info_load_from_node + (ETableSortInfo *info, + xmlNode *node, + gdouble state_version); +xmlNode * e_table_sort_info_save_to_node (ETableSortInfo *info, + xmlNode *parent); +ETableSortInfo *e_table_sort_info_duplicate (ETableSortInfo *info); +void e_table_sort_info_set_can_group (ETableSortInfo *info, + gboolean can_group); +gboolean e_table_sort_info_get_can_group (ETableSortInfo *info); G_END_DECLS |