2 PSPPIRE --- A Graphical User Interface for PSPP
3 Copyright (C) 2004 Free Software Foundation
4 Written by John Darrington
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __CASE_ARRAY_H__
23 #define __CASE_ARRAY_H__
26 #include <glib-object.h>
34 /* --- type macros --- */
35 #define G_TYPE_PSPPIRE_CASE_ARRAY (psppire_case_array_get_type ())
36 #define PSPPIRE_CASE_ARRAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_PSPPIRE_CASE_ARRAY, PsppireCaseArray))
37 #define PSPPIRE_CASE_ARRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_PSPPIRE_CASE_ARRAY, PsppireCaseArrayClass))
38 #define G_IS_PSPPIRE_CASE_ARRAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_PSPPIRE_CASE_ARRAY))
39 #define G_IS_PSPPIRE_CASE_ARRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_PSPPIRE_CASE_ARRAY))
40 #define PSPPIRE_CASE_ARRAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_PSPPIRE_CASE_ARRAY, PsppireCaseArrayClass))
45 /* --- typedefs & structures --- */
46 typedef struct _PsppireCaseArray PsppireCaseArray;
47 typedef struct _PsppireCaseArrayClass PsppireCaseArrayClass;
51 struct _PsppireCaseArray
62 struct _PsppireCaseArrayClass
64 GObjectClass parent_class;
68 /* -- PsppireCaseArray --- */
69 GType psppire_case_array_get_type (void);
71 PsppireCaseArray *psppire_case_array_new (gint capacity, gint width);
73 void psppire_case_array_resize(PsppireCaseArray *ca, gint new_size);
75 void psppire_case_array_insert_case(PsppireCaseArray *ca, gint posn);
77 void psppire_case_array_delete_cases(PsppireCaseArray *ca, gint first, gint n_cases);
80 typedef gboolean psppire_case_array_fill_case_func(struct ccase *, gpointer aux);
82 typedef gboolean psppire_case_array_use_case_func(const struct ccase *, gpointer aux);
85 gboolean psppire_case_array_add_case(PsppireCaseArray *ca,
86 psppire_case_array_fill_case_func fill_case_func,
90 gboolean psppire_case_array_iterate_case(PsppireCaseArray *ca,
91 psppire_case_array_use_case_func fill_case_func,
96 gint psppire_case_array_get_n_cases(const PsppireCaseArray *ca);
99 /* Clears the contents of CA */
100 void psppire_case_array_clear(PsppireCaseArray *ca);
103 const union value * psppire_case_array_get_value(const PsppireCaseArray *ca,
107 typedef gboolean value_fill_func_t(union value *v, gpointer data);
109 void psppire_case_array_set_value(PsppireCaseArray *ca, gint c, gint idx,
110 value_fill_func_t ff,
115 #endif /* __PSPPIRE_CASE_ARRAY_H__ */