Debian Codegraph @

extensions/file_tools/gth-curve-preset.h

raw symbols SCIP
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /*
4 * GThumb
5 *
6 * Copyright (C) 2014 The Free Software Foundation, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef GTH_CURVE_PRESET_H
23 #define GTH_CURVE_PRESET_H
24
25 #include <glib.h>
26 #include <gtk/gtk.h>
27 #include <gthumb.h>
28 #include "gth-points.h"
29
30 G_BEGIN_DECLS
31
32 typedef enum {
33 GTH_PRESET_ACTION_ADDED,
34 GTH_PRESET_ACTION_RENAMED,
35 GTH_PRESET_ACTION_REMOVED,
36 GTH_PRESET_ACTION_CHANGED_ORDER
37 } GthPresetAction;
38
39 #define GTH_TYPE_CURVE_PRESET (gth_curve_preset_get_type ())
40 #define GTH_CURVE_PRESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_CURVE_PRESET, GthCurvePreset))
41 #define GTH_CURVE_PRESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_CURVE_PRESET, GthCurvePresetClass))
42 #define GTH_IS_CURVE_PRESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_CURVE_PRESET))
43 #define GTH_IS_CURVE_PRESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_CURVE_PRESET))
44 #define GTH_CURVE_PRESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTH_TYPE_CURVE_PRESET, GthCurvePresetClass))
45
46 typedef struct _GthCurvePresetPrivate GthCurvePresetPrivate;
47
48 typedef struct {
49 GObject parent_instance;
50 GthCurvePresetPrivate *priv;
51 } GthCurvePreset;
52
53 typedef struct {
54 GObjectClass parent_class;
55
56 /*< signals >*/
57
58 void (*changed) (GthCurvePreset *self);
59 void (*preset_changed) (GthCurvePreset *self,
60 int id,
61 GthPresetAction action);
62 } GthCurvePresetClass;
63
64 GType gth_curve_preset_get_type (void);
65 GthCurvePreset * gth_curve_preset_new_from_file (GFile *file);
66 int gth_curve_preset_get_size (GthCurvePreset *self);
67 gboolean gth_curve_preset_get_nth (GthCurvePreset *self,
68 int n,
69 int *id,
70 const char **name,
71 GthPoints **points);
72 gboolean gth_curve_preset_get_by_id (GthCurvePreset *self,
73 int id,
74 const char **name,
75 GthPoints **points);
76 int gth_curve_preset_get_pos (GthCurvePreset *self,
77 int id);
78 int gth_curve_preset_add (GthCurvePreset *self,
79 const char *name,
80 GthPoints *points);
81 void gth_curve_preset_remove (GthCurvePreset *self,
82 int id);
83 void gth_curve_preset_rename (GthCurvePreset *self,
84 int id,
85 const char *new_name);
86 void gth_curve_preset_change_order (GthCurvePreset *self,
87 GList *id_list);
88 GList * gth_curve_preset_get_order (GthCurvePreset *self);
89 gboolean gth_curve_preset_save (GthCurvePreset *self,
90 GError **error);
91
92 #endif /* GTH_CURVE_PRESET_H */