2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-02-11 01:39:24 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2001-04-22 00:38:56 +00:00
|
|
|
* gimpdata.h
|
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-02-11 01:39:24 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-02-11 01:39:24 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-02-11 01:39:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_DATA_H__
|
|
|
|
#define __GIMP_DATA_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "gimpviewable.h"
|
|
|
|
|
|
|
|
|
2002-12-02 13:39:09 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GIMP_DATA_ERROR_OPEN, /* opening data file failed */
|
|
|
|
GIMP_DATA_ERROR_READ, /* reading data file failed */
|
|
|
|
GIMP_DATA_ERROR_WRITE, /* writing data file failed */
|
|
|
|
GIMP_DATA_ERROR_DELETE /* deleting data file failed */
|
|
|
|
} GimpDataError;
|
|
|
|
|
|
|
|
|
2001-02-11 01:39:24 +00:00
|
|
|
#define GIMP_TYPE_DATA (gimp_data_get_type ())
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
#define GIMP_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DATA, GimpData))
|
|
|
|
#define GIMP_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DATA, GimpDataClass))
|
|
|
|
#define GIMP_IS_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DATA))
|
|
|
|
#define GIMP_IS_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DATA))
|
|
|
|
#define GIMP_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DATA, GimpDataClass))
|
2001-02-11 01:39:24 +00:00
|
|
|
|
|
|
|
|
2019-06-29 16:41:41 +02:00
|
|
|
typedef struct _GimpDataPrivate GimpDataPrivate;
|
|
|
|
typedef struct _GimpDataClass GimpDataClass;
|
2001-02-11 01:39:24 +00:00
|
|
|
|
|
|
|
struct _GimpData
|
|
|
|
{
|
2019-06-29 16:41:41 +02:00
|
|
|
GimpViewable parent_instance;
|
|
|
|
|
|
|
|
GimpDataPrivate *priv;
|
2001-02-11 01:39:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpDataClass
|
|
|
|
{
|
|
|
|
GimpViewableClass parent_class;
|
|
|
|
|
2002-12-02 13:39:09 +00:00
|
|
|
/* signals */
|
2008-09-12 10:35:35 +00:00
|
|
|
void (* dirty) (GimpData *data);
|
2002-12-02 13:39:09 +00:00
|
|
|
|
|
|
|
/* virtual functions */
|
2014-07-03 23:44:38 +02:00
|
|
|
gboolean (* save) (GimpData *data,
|
|
|
|
GOutputStream *output,
|
|
|
|
GError **error);
|
|
|
|
const gchar * (* get_extension) (GimpData *data);
|
2017-07-26 13:42:21 -04:00
|
|
|
void (* copy) (GimpData *data,
|
|
|
|
GimpData *src_data);
|
2014-07-03 23:44:38 +02:00
|
|
|
GimpData * (* duplicate) (GimpData *data);
|
2017-07-26 14:17:59 -04:00
|
|
|
gint (* compare) (GimpData *data1,
|
|
|
|
GimpData *data2);
|
2001-02-11 01:39:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-11-22 23:46:13 +00:00
|
|
|
GType gimp_data_get_type (void) G_GNUC_CONST;
|
2001-02-11 01:39:24 +00:00
|
|
|
|
2002-12-02 13:39:09 +00:00
|
|
|
gboolean gimp_data_save (GimpData *data,
|
|
|
|
GError **error);
|
2001-02-11 01:39:24 +00:00
|
|
|
|
2002-10-30 18:46:29 +00:00
|
|
|
void gimp_data_dirty (GimpData *data);
|
2009-10-31 18:48:38 +01:00
|
|
|
void gimp_data_clean (GimpData *data);
|
|
|
|
gboolean gimp_data_is_dirty (GimpData *data);
|
|
|
|
|
2004-06-12 22:13:31 +00:00
|
|
|
void gimp_data_freeze (GimpData *data);
|
|
|
|
void gimp_data_thaw (GimpData *data);
|
2009-10-31 18:48:38 +01:00
|
|
|
gboolean gimp_data_is_frozen (GimpData *data);
|
2004-06-12 22:13:31 +00:00
|
|
|
|
2002-10-30 18:46:29 +00:00
|
|
|
gboolean gimp_data_delete_from_disk (GimpData *data,
|
|
|
|
GError **error);
|
2001-02-11 01:39:24 +00:00
|
|
|
|
2002-10-30 18:46:29 +00:00
|
|
|
const gchar * gimp_data_get_extension (GimpData *data);
|
2001-02-13 19:53:07 +00:00
|
|
|
|
2014-07-01 01:19:35 +02:00
|
|
|
void gimp_data_set_file (GimpData *data,
|
|
|
|
GFile *file,
|
2004-10-04 09:39:27 +00:00
|
|
|
gboolean writable,
|
|
|
|
gboolean deletable);
|
2014-07-01 01:19:35 +02:00
|
|
|
GFile * gimp_data_get_file (GimpData *data);
|
|
|
|
|
2002-10-30 18:46:29 +00:00
|
|
|
void gimp_data_create_filename (GimpData *data,
|
2014-07-26 16:37:30 +02:00
|
|
|
GFile *dest_dir);
|
2001-02-11 01:39:24 +00:00
|
|
|
|
2012-02-09 10:02:49 +01:00
|
|
|
void gimp_data_set_folder_tags (GimpData *data,
|
2014-08-01 20:30:45 +02:00
|
|
|
GFile *top_directory);
|
2012-02-09 10:02:49 +01:00
|
|
|
|
2005-05-25 23:25:45 +00:00
|
|
|
const gchar * gimp_data_get_mime_type (GimpData *data);
|
|
|
|
|
2009-10-31 18:48:38 +01:00
|
|
|
gboolean gimp_data_is_writable (GimpData *data);
|
|
|
|
gboolean gimp_data_is_deletable (GimpData *data);
|
|
|
|
|
|
|
|
void gimp_data_set_mtime (GimpData *data,
|
2013-07-12 16:33:12 +02:00
|
|
|
gint64 mtime);
|
|
|
|
gint64 gimp_data_get_mtime (GimpData *data);
|
2009-10-31 18:48:38 +01:00
|
|
|
|
2017-11-04 22:11:32 -04:00
|
|
|
gboolean gimp_data_is_copyable (GimpData *data);
|
2017-07-26 13:42:21 -04:00
|
|
|
void gimp_data_copy (GimpData *data,
|
|
|
|
GimpData *src_data);
|
2017-11-04 22:11:32 -04:00
|
|
|
|
|
|
|
gboolean gimp_data_is_duplicatable (GimpData *data);
|
2005-06-08 11:27:31 +00:00
|
|
|
GimpData * gimp_data_duplicate (GimpData *data);
|
2001-02-14 14:57:14 +00:00
|
|
|
|
2008-12-12 07:03:42 +00:00
|
|
|
void gimp_data_make_internal (GimpData *data,
|
|
|
|
const gchar *identifier);
|
2009-10-31 18:48:38 +01:00
|
|
|
gboolean gimp_data_is_internal (GimpData *data);
|
2004-02-13 11:53:22 +00:00
|
|
|
|
2008-07-10 09:08:54 +00:00
|
|
|
gint gimp_data_compare (GimpData *data1,
|
|
|
|
GimpData *data2);
|
2001-02-11 01:39:24 +00:00
|
|
|
|
2002-12-02 13:39:09 +00:00
|
|
|
#define GIMP_DATA_ERROR (gimp_data_error_quark ())
|
|
|
|
|
|
|
|
GQuark gimp_data_error_quark (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
|
2001-02-11 01:39:24 +00:00
|
|
|
#endif /* __GIMP_DATA_H__ */
|