diff options
Diffstat (limited to 'e-util/e-sorter.h')
-rw-r--r-- | e-util/e-sorter.h | 128 |
1 files changed, 65 insertions, 63 deletions
diff --git a/e-util/e-sorter.h b/e-util/e-sorter.h index 5a89fa4c59..70060302be 100644 --- a/e-util/e-sorter.h +++ b/e-util/e-sorter.h @@ -1,81 +1,83 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-sorter.h - * Copyright 2000, 2001, Ximian, Inc. * - * Authors: - * Chris Lahey <clahey@ximian.com> + * 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) version 3. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * 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 - * Library General Public License for more details. + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> * - * You should have received a copy of the GNU Library 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. */ -#ifndef _E_SORTER_H_ -#define _E_SORTER_H_ +#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION) +#error "Only <e-util/e-util.h> should be included directly." +#endif + +#ifndef E_SORTER_H +#define E_SORTER_H -#include <gtk/gtkobject.h> +#include <glib-object.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +/* Standard GObject macros */ +#define E_TYPE_SORTER \ + (e_sorter_get_type ()) +#define E_SORTER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_SORTER, ESorter)) +#define E_IS_SORTER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_SORTER)) +#define E_SORTER_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE \ + ((obj), E_TYPE_SORTER, ESorterInterface)) -#define E_SORTER_TYPE (e_sorter_get_type ()) -#define E_SORTER(o) (GTK_CHECK_CAST ((o), E_SORTER_TYPE, ESorter)) -#define E_SORTER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SORTER_TYPE, ESorterClass)) -#define E_IS_SORTER(o) (GTK_CHECK_TYPE ((o), E_SORTER_TYPE)) -#define E_IS_SORTER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SORTER_TYPE)) +G_BEGIN_DECLS -typedef struct { - GtkObject base; -} ESorter; +typedef struct _ESorter ESorter; +typedef struct _ESorterInterface ESorterInterface; -typedef struct { - GtkObjectClass parent_class; - gint (*model_to_sorted) (ESorter *sorter, - int row); - gint (*sorted_to_model) (ESorter *sorter, - int row); - - void (*get_model_to_sorted_array) (ESorter *sorter, - int **array, - int *count); - void (*get_sorted_to_model_array) (ESorter *sorter, - int **array, - int *count); - - gboolean (*needs_sorting) (ESorter *sorter); -} ESorterClass; +struct _ESorterInterface { + GTypeInterface parent_interface; -GtkType e_sorter_get_type (void); -ESorter *e_sorter_new (void); + gint (*model_to_sorted) (ESorter *sorter, + gint row); + gint (*sorted_to_model) (ESorter *sorter, + gint row); -gint e_sorter_model_to_sorted (ESorter *sorter, - int row); -gint e_sorter_sorted_to_model (ESorter *sorter, - int row); + void (*get_model_to_sorted_array) + (ESorter *sorter, + gint **array, + gint *count); + void (*get_sorted_to_model_array) + (ESorter *sorter, + gint **array, + gint *count); -void e_sorter_get_model_to_sorted_array (ESorter *sorter, - int **array, - int *count); -void e_sorter_get_sorted_to_model_array (ESorter *sorter, - int **array, - int *count); + gboolean (*needs_sorting) (ESorter *sorter); +}; -gboolean e_sorter_needs_sorting (ESorter *sorter); +GType e_sorter_get_type (void) G_GNUC_CONST; +gint e_sorter_model_to_sorted (ESorter *sorter, + gint row); +gint e_sorter_sorted_to_model (ESorter *sorter, + gint row); +void e_sorter_get_model_to_sorted_array + (ESorter *sorter, + gint **array, + gint *count); +void e_sorter_get_sorted_to_model_array + (ESorter *sorter, + gint **array, + gint *count); +gboolean e_sorter_needs_sorting (ESorter *sorter); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS -#endif /* _E_SORTER_H_ */ +#endif /* E_SORTER_H */ |