2016-02-16 09:35:43 +08:00
|
|
|
/* Plug-in to load and export .gih (GIMP Brush Pipe) files.
|
1999-08-23 03:02:52 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Tor Lillqvist
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
* Copyright (C) 2000 Jens Lautenbacher, Sven Neumann
|
1999-08-23 03:02:52 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-08-23 03:02:52 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1999-08-23 03:02:52 +08: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-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1999-08-23 03:02:52 +08:00
|
|
|
*/
|
|
|
|
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
/* Example of how to call file_gih_save from script-fu:
|
2003-11-06 23:27:05 +08:00
|
|
|
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
(let ((ranks (cons-array 1 'byte)))
|
|
|
|
(aset ranks 0 12)
|
|
|
|
(file-gih-save 1
|
2008-10-20 14:04:39 +08:00
|
|
|
img
|
|
|
|
drawable
|
|
|
|
"foo.gih"
|
|
|
|
"foo.gih"
|
|
|
|
100
|
|
|
|
"test brush"
|
|
|
|
125
|
|
|
|
125
|
|
|
|
3
|
|
|
|
4
|
|
|
|
1
|
|
|
|
ranks
|
|
|
|
1
|
|
|
|
'("random")))
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
*/
|
1999-08-24 13:30:14 +08:00
|
|
|
|
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <libgimp/gimp.h>
|
1999-10-09 04:09:04 +08:00
|
|
|
#include <libgimp/gimpui.h>
|
2001-05-22 04:30:16 +08:00
|
|
|
#include <libgimpbase/gimpparasiteio.h>
|
2000-01-07 06:26:10 +08:00
|
|
|
|
2000-05-01 05:03:44 +08:00
|
|
|
#include "libgimp/stdplugins-intl.h"
|
|
|
|
|
|
|
|
|
2014-11-05 09:34:45 +08:00
|
|
|
#define SAVE_PROC "file-gih-save"
|
|
|
|
#define PLUG_IN_BINARY "file-gih"
|
|
|
|
#define PLUG_IN_ROLE "gimp-file-gih"
|
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
|
2016-02-16 09:35:43 +08:00
|
|
|
/* Parameters applicable each time we export a gih, exported in the
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
* main gimp application between invocations of this plug-in.
|
1999-08-24 13:30:14 +08:00
|
|
|
*/
|
2014-11-05 09:34:45 +08:00
|
|
|
typedef struct
|
2003-11-06 23:27:05 +08:00
|
|
|
{
|
2014-11-05 09:34:45 +08:00
|
|
|
gchar description[256];
|
|
|
|
gint spacing;
|
|
|
|
} BrushInfo;
|
1999-09-02 08:01:41 +08:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2014-06-23 05:01:31 +08:00
|
|
|
GimpOrientationType orientation;
|
2019-08-14 22:13:51 +08:00
|
|
|
GimpImage *image;
|
|
|
|
GimpLayer *toplayer;
|
2014-06-23 05:01:31 +08:00
|
|
|
gint nguides;
|
|
|
|
gint32 *guides;
|
|
|
|
gint *value;
|
|
|
|
GtkWidget *count_label; /* Corresponding count adjustment, */
|
|
|
|
gint *count; /* cols or rows */
|
|
|
|
gint *other_count; /* and the other one */
|
|
|
|
GtkAdjustment *ncells;
|
|
|
|
GtkAdjustment *rank0;
|
|
|
|
GtkWidget *warning_label;
|
|
|
|
GtkWidget *rank_entry[GIMP_PIXPIPE_MAXDIM];
|
|
|
|
GtkWidget *mode_entry[GIMP_PIXPIPE_MAXDIM];
|
1999-09-02 08:01:41 +08:00
|
|
|
} SizeAdjustmentData;
|
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
typedef struct _Gih Gih;
|
|
|
|
typedef struct _GihClass GihClass;
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
struct _Gih
|
|
|
|
{
|
|
|
|
GimpPlugIn parent_instance;
|
|
|
|
};
|
2019-03-04 02:42:22 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
struct _GihClass
|
|
|
|
{
|
|
|
|
GimpPlugInClass parent_class;
|
|
|
|
};
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
#define GIH_TYPE (gih_get_type ())
|
|
|
|
#define GIH (obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIH_TYPE, Gih))
|
|
|
|
|
|
|
|
GType gih_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
static GList * gih_query_procedures (GimpPlugIn *plug_in);
|
|
|
|
static GimpProcedure * gih_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name);
|
|
|
|
|
|
|
|
static GimpValueArray * gih_save (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode,
|
2019-08-14 22:13:51 +08:00
|
|
|
GimpImage *image,
|
2020-04-14 17:46:17 +08:00
|
|
|
gint n_drawables,
|
|
|
|
GimpDrawable **drawables,
|
2019-08-14 04:53:04 +08:00
|
|
|
GFile *file,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
static gboolean gih_save_dialog (GimpImage *image);
|
2019-08-14 04:53:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (Gih, gih, GIMP_TYPE_PLUG_IN)
|
|
|
|
|
|
|
|
GIMP_MAIN (GIH_TYPE)
|
2019-03-04 02:42:22 +08:00
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
|
2014-11-05 09:34:45 +08:00
|
|
|
static BrushInfo info =
|
|
|
|
{
|
|
|
|
"GIMP Brush Pipe",
|
|
|
|
20
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint num_layers = 0;
|
|
|
|
static GimpPixPipeParams gihparams = { 0, };
|
|
|
|
|
|
|
|
static const gchar * const selection_modes[] = { "incremental",
|
|
|
|
"angular",
|
|
|
|
"random",
|
|
|
|
"velocity",
|
|
|
|
"pressure",
|
|
|
|
"xtilt",
|
|
|
|
"ytilt" };
|
|
|
|
|
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
static void
|
2019-08-14 04:53:04 +08:00
|
|
|
gih_class_init (GihClass *klass)
|
1999-08-23 03:02:52 +08:00
|
|
|
{
|
2019-08-14 04:53:04 +08:00
|
|
|
GimpPlugInClass *plug_in_class = GIMP_PLUG_IN_CLASS (klass);
|
|
|
|
|
|
|
|
plug_in_class->query_procedures = gih_query_procedures;
|
|
|
|
plug_in_class->create_procedure = gih_create_procedure;
|
1999-08-24 13:30:14 +08:00
|
|
|
}
|
|
|
|
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
static void
|
2019-08-14 04:53:04 +08:00
|
|
|
gih_init (Gih *gih)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
gih_query_procedures (GimpPlugIn *plug_in)
|
|
|
|
{
|
|
|
|
return g_list_append (NULL, g_strdup (SAVE_PROC));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpProcedure *
|
|
|
|
gih_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
GimpProcedure *procedure = NULL;
|
|
|
|
|
|
|
|
if (! strcmp (name, SAVE_PROC))
|
|
|
|
{
|
2019-08-30 18:52:28 +08:00
|
|
|
procedure = gimp_save_procedure_new (plug_in, name,
|
|
|
|
GIMP_PDB_PROC_TYPE_PLUGIN,
|
2019-08-14 04:53:04 +08:00
|
|
|
gih_save, NULL, NULL);
|
|
|
|
|
|
|
|
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
|
|
|
|
|
|
|
gimp_procedure_set_menu_label (procedure, N_("GIMP brush (animated)"));
|
2019-08-18 19:45:58 +08:00
|
|
|
gimp_procedure_set_icon_name (procedure, GIMP_ICON_BRUSH);
|
2019-08-14 04:53:04 +08:00
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
|
|
|
"exports images in GIMP brush pipe "
|
|
|
|
"format",
|
|
|
|
"This plug-in exports an image in "
|
|
|
|
"the GIMP brush pipe format. For a "
|
|
|
|
"colored brush pipe, RGBA layers are "
|
|
|
|
"used, otherwise the layers should be "
|
|
|
|
"grayscale masks. The image can be "
|
|
|
|
"multi-layered, and additionally the "
|
|
|
|
"layers can be divided into a "
|
|
|
|
"rectangular array of brushes.",
|
|
|
|
SAVE_PROC);
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Tor Lillqvist",
|
|
|
|
"Tor Lillqvist",
|
|
|
|
"1999");
|
|
|
|
|
|
|
|
gimp_file_procedure_set_mime_types (GIMP_FILE_PROCEDURE (procedure),
|
|
|
|
"image/x-gimp-gih");
|
|
|
|
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
|
|
|
"gih");
|
2019-08-19 18:05:12 +08:00
|
|
|
gimp_file_procedure_set_handles_remote (GIMP_FILE_PROCEDURE (procedure),
|
|
|
|
TRUE);
|
2019-08-14 04:53:04 +08:00
|
|
|
|
2019-08-19 16:02:07 +08:00
|
|
|
GIMP_PROC_ARG_INT (procedure, "spacing",
|
|
|
|
"Spacing",
|
|
|
|
"Spacing of the brush",
|
|
|
|
1, 1000, 10,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
2019-08-19 18:54:52 +08:00
|
|
|
GIMP_PROC_ARG_STRING (procedure, "description",
|
|
|
|
"Description",
|
|
|
|
"Short description of the gihtern",
|
|
|
|
"GIMP Gihtern",
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
2019-08-19 16:02:07 +08:00
|
|
|
GIMP_PROC_ARG_INT (procedure, "cell-width",
|
|
|
|
"Cell width",
|
|
|
|
"Width of the brush cells",
|
|
|
|
1, 1000, 10,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_INT (procedure, "cell-height",
|
|
|
|
"Cell height",
|
|
|
|
"Height of the brush cells",
|
|
|
|
1, 1000, 10,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_INT (procedure, "display-cols",
|
|
|
|
"Display columns",
|
|
|
|
"Display column number",
|
|
|
|
1, 1000, 1,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_INT (procedure, "display-rows",
|
|
|
|
"Display rows",
|
|
|
|
"Display row number",
|
|
|
|
1, 1000, 1,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_INT (procedure, "dimension",
|
|
|
|
"Dimension",
|
|
|
|
"Dimension of the brush pipe",
|
|
|
|
1, 4, 1,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_UINT8_ARRAY (procedure, "rank",
|
|
|
|
"Rank",
|
|
|
|
"Ranks of the dimensions",
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
2019-09-02 23:56:06 +08:00
|
|
|
GIMP_PROC_ARG_INT (procedure, "dimension-2",
|
|
|
|
"Dimension 2",
|
|
|
|
"Dimension of the brush pipe (same as dimension)",
|
2019-08-19 16:02:07 +08:00
|
|
|
1, 4, 1,
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
GIMP_PROC_ARG_STRING_ARRAY (procedure, "sel",
|
|
|
|
"Sel",
|
|
|
|
"Selection modes",
|
|
|
|
GIMP_PARAM_READWRITE);
|
2019-08-14 04:53:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return procedure;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpValueArray *
|
|
|
|
gih_save (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode,
|
2019-08-14 22:13:51 +08:00
|
|
|
GimpImage *image,
|
2020-04-14 17:46:17 +08:00
|
|
|
gint n_drawables,
|
|
|
|
GimpDrawable **drawables,
|
2019-08-14 04:53:04 +08:00
|
|
|
GFile *file,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
{
|
2003-11-06 23:27:05 +08:00
|
|
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
|
|
|
GimpExportReturn export = GIMP_EXPORT_CANCEL;
|
2019-08-14 04:53:04 +08:00
|
|
|
GimpParasite *parasite;
|
2019-08-14 22:13:51 +08:00
|
|
|
GimpImage *orig_image;
|
2008-08-19 03:35:55 +08:00
|
|
|
GError *error = NULL;
|
2019-03-04 02:42:22 +08:00
|
|
|
gint i;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2012-11-19 08:28:42 +08:00
|
|
|
INIT_I18N();
|
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
orig_image = image;
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
switch (run_mode)
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
{
|
2019-08-14 04:53:04 +08:00
|
|
|
case GIMP_RUN_INTERACTIVE:
|
|
|
|
case GIMP_RUN_WITH_LAST_VALS:
|
2019-09-21 01:39:00 +08:00
|
|
|
gimp_ui_init (PLUG_IN_BINARY);
|
2019-08-14 04:53:04 +08:00
|
|
|
|
2020-04-14 17:46:17 +08:00
|
|
|
export = gimp_export_image (&image, &n_drawables, &drawables, "GIH",
|
2019-08-14 04:53:04 +08:00
|
|
|
GIMP_EXPORT_CAN_HANDLE_RGB |
|
|
|
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
|
|
|
GIMP_EXPORT_CAN_HANDLE_ALPHA |
|
|
|
|
GIMP_EXPORT_CAN_HANDLE_LAYERS);
|
|
|
|
|
|
|
|
if (export == GIMP_EXPORT_CANCEL)
|
|
|
|
return gimp_procedure_new_return_values (procedure,
|
|
|
|
GIMP_PDB_CANCEL,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Possibly retrieve data */
|
|
|
|
gimp_get_data (SAVE_PROC, &info);
|
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
parasite = gimp_image_get_parasite (orig_image,
|
2019-08-14 04:53:04 +08:00
|
|
|
"gimp-brush-pipe-name");
|
|
|
|
if (parasite)
|
2008-10-20 14:04:39 +08:00
|
|
|
{
|
2019-08-15 05:52:38 +08:00
|
|
|
g_strlcpy (info.description,
|
|
|
|
gimp_parasite_data (parasite),
|
|
|
|
MIN (sizeof (info.description),
|
|
|
|
gimp_parasite_data_size (parasite)));
|
2013-11-10 07:18:48 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gchar *name = g_path_get_basename (gimp_file_get_utf8_name (file));
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
if (g_str_has_suffix (name, ".gih"))
|
|
|
|
name[strlen (name) - 4] = '\0';
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
if (strlen (name))
|
2019-08-15 05:52:38 +08:00
|
|
|
g_strlcpy (info.description, name, sizeof (info.description));
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
g_free (name);
|
|
|
|
}
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
parasite = gimp_image_get_parasite (orig_image,
|
2019-08-14 04:53:04 +08:00
|
|
|
"gimp-brush-pipe-spacing");
|
|
|
|
if (parasite)
|
|
|
|
{
|
|
|
|
info.spacing = atoi (gimp_parasite_data (parasite));
|
|
|
|
gimp_parasite_free (parasite);
|
2008-10-20 14:04:39 +08:00
|
|
|
}
|
2019-08-14 04:53:04 +08:00
|
|
|
break;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2019-08-27 19:26:27 +08:00
|
|
|
g_free (gimp_image_get_layers (image, &num_layers));
|
2014-11-05 09:34:45 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_pixpipe_params_init (&gihparams);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
switch (run_mode)
|
|
|
|
{
|
|
|
|
case GIMP_RUN_INTERACTIVE:
|
|
|
|
gihparams.ncells = (num_layers * gihparams.rows * gihparams.cols);
|
2008-10-20 14:04:39 +08:00
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
gihparams.cellwidth = gimp_image_width (image) / gihparams.cols;
|
|
|
|
gihparams.cellheight = gimp_image_height (image) / gihparams.rows;
|
2013-01-20 03:52:27 +08:00
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
parasite = gimp_image_get_parasite (orig_image,
|
2019-08-14 04:53:04 +08:00
|
|
|
"gimp-brush-pipe-parameters");
|
|
|
|
if (parasite)
|
|
|
|
{
|
|
|
|
gimp_pixpipe_params_parse (gimp_parasite_data (parasite),
|
|
|
|
&gihparams);
|
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
}
|
2013-04-29 03:19:44 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
/* Force default rank to same as number of cells if there is
|
|
|
|
* just one dim
|
|
|
|
*/
|
|
|
|
if (gihparams.dim == 1)
|
|
|
|
gihparams.rank[0] = gihparams.ncells;
|
2008-10-20 14:04:39 +08:00
|
|
|
|
2019-08-14 22:13:51 +08:00
|
|
|
if (! gih_save_dialog (image))
|
2019-08-14 04:53:04 +08:00
|
|
|
{
|
|
|
|
status = GIMP_PDB_CANCEL;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_RUN_NONINTERACTIVE:
|
2019-08-20 07:03:38 +08:00
|
|
|
info.spacing = GIMP_VALUES_GET_INT (args, 0);
|
2019-08-15 05:52:38 +08:00
|
|
|
g_strlcpy (info.description,
|
2019-08-20 07:03:38 +08:00
|
|
|
GIMP_VALUES_GET_STRING (args, 1),
|
2019-08-15 05:52:38 +08:00
|
|
|
sizeof (info.description));
|
2019-08-14 04:53:04 +08:00
|
|
|
|
2019-08-20 07:03:38 +08:00
|
|
|
gihparams.cellwidth = GIMP_VALUES_GET_INT (args, 2);
|
|
|
|
gihparams.cellheight = GIMP_VALUES_GET_INT (args, 3);
|
|
|
|
gihparams.cols = GIMP_VALUES_GET_INT (args, 4);
|
|
|
|
gihparams.rows = GIMP_VALUES_GET_INT (args, 5);
|
|
|
|
gihparams.dim = GIMP_VALUES_GET_INT (args, 6);
|
2019-08-14 04:53:04 +08:00
|
|
|
gihparams.ncells = 1;
|
|
|
|
|
2019-08-20 07:03:38 +08:00
|
|
|
if (GIMP_VALUES_GET_INT (args, 8) != gihparams.dim)
|
2019-08-14 04:53:04 +08:00
|
|
|
{
|
|
|
|
status = GIMP_PDB_CALLING_ERROR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-08-20 07:03:38 +08:00
|
|
|
const guint8 *rank = GIMP_VALUES_GET_UINT8_ARRAY (args, 7);
|
|
|
|
const gchar **sel = GIMP_VALUES_GET_STRING_ARRAY (args, 9);
|
2008-10-20 14:04:39 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
for (i = 0; i < gihparams.dim; i++)
|
2014-11-05 09:34:45 +08:00
|
|
|
{
|
2019-08-14 04:53:04 +08:00
|
|
|
gihparams.rank[i] = rank[i];
|
|
|
|
gihparams.selection[i] = g_strdup (sel[i]);
|
|
|
|
gihparams.ncells *= gihparams.rank[i];
|
2014-11-05 09:34:45 +08:00
|
|
|
}
|
2008-10-20 14:04:39 +08:00
|
|
|
}
|
2019-08-14 04:53:04 +08:00
|
|
|
break;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
case GIMP_RUN_WITH_LAST_VALS:
|
2019-08-14 22:13:51 +08:00
|
|
|
parasite = gimp_image_get_parasite (orig_image,
|
2019-08-14 04:53:04 +08:00
|
|
|
"gimp-brush-pipe-parameters");
|
|
|
|
if (parasite)
|
2008-10-20 14:04:39 +08:00
|
|
|
{
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_pixpipe_params_parse (gimp_parasite_data (parasite),
|
|
|
|
&gihparams);
|
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2019-03-04 02:42:22 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
if (status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
GimpValueArray *save_retvals;
|
|
|
|
gchar spacing[8];
|
|
|
|
gchar *paramstring;
|
|
|
|
|
|
|
|
paramstring = gimp_pixpipe_params_build (&gihparams);
|
|
|
|
|
|
|
|
save_retvals =
|
|
|
|
gimp_pdb_run_procedure (gimp_get_pdb (),
|
|
|
|
"file-gih-save-internal",
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_RUN_MODE, GIMP_RUN_NONINTERACTIVE,
|
2020-04-14 17:46:17 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_INT, n_drawables,
|
|
|
|
GIMP_TYPE_OBJECT_ARRAY, drawables,
|
|
|
|
G_TYPE_FILE, file,
|
|
|
|
G_TYPE_INT, info.spacing,
|
|
|
|
G_TYPE_STRING, info.description,
|
|
|
|
G_TYPE_STRING, paramstring,
|
2019-08-14 04:53:04 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2019-08-20 07:03:38 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (save_retvals, 0) == GIMP_PDB_SUCCESS)
|
2019-08-14 04:53:04 +08:00
|
|
|
{
|
|
|
|
gimp_set_data (SAVE_PROC, &info, sizeof (info));
|
|
|
|
|
|
|
|
parasite = gimp_parasite_new ("gimp-brush-pipe-name",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (info.description) + 1,
|
|
|
|
info.description);
|
2019-08-14 22:13:51 +08:00
|
|
|
gimp_image_attach_parasite (orig_image, parasite);
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
|
|
|
|
g_snprintf (spacing, sizeof (spacing), "%d",
|
|
|
|
info.spacing);
|
|
|
|
|
|
|
|
parasite = gimp_parasite_new ("gimp-brush-pipe-spacing",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (spacing) + 1, spacing);
|
2019-08-14 22:13:51 +08:00
|
|
|
gimp_image_attach_parasite (orig_image, parasite);
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_parasite_free (parasite);
|
|
|
|
|
|
|
|
parasite = gimp_parasite_new ("gimp-brush-pipe-parameters",
|
|
|
|
GIMP_PARASITE_PERSISTENT,
|
|
|
|
strlen (paramstring) + 1,
|
|
|
|
paramstring);
|
2019-08-14 22:13:51 +08:00
|
|
|
gimp_image_attach_parasite (orig_image, parasite);
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_parasite_free (parasite);
|
2008-10-20 14:04:39 +08:00
|
|
|
}
|
2019-08-14 04:53:04 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
g_set_error (&error, 0, 0,
|
|
|
|
"Running procedure 'file-gih-save-internal' "
|
|
|
|
"failed: %s",
|
|
|
|
gimp_pdb_get_last_error (gimp_get_pdb ()));
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
status = GIMP_PDB_EXECUTION_ERROR;
|
|
|
|
}
|
2018-06-28 00:31:38 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
g_free (paramstring);
|
2000-12-19 03:38:43 +08:00
|
|
|
}
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
gimp_pixpipe_params_free (&gihparams);
|
|
|
|
|
|
|
|
out:
|
|
|
|
if (export == GIMP_EXPORT_EXPORT)
|
2020-04-14 17:46:17 +08:00
|
|
|
{
|
|
|
|
gimp_image_delete (image);
|
|
|
|
g_free (drawables);
|
|
|
|
}
|
2008-08-19 03:35:55 +08:00
|
|
|
|
2019-08-14 04:53:04 +08:00
|
|
|
return gimp_procedure_new_return_values (procedure, status, error);
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
}
|
|
|
|
|
2000-12-19 03:38:43 +08:00
|
|
|
|
|
|
|
/* save routines */
|
|
|
|
|
1999-09-02 08:01:41 +08:00
|
|
|
static void
|
2018-06-25 00:15:16 +08:00
|
|
|
size_adjustment_callback (GtkAdjustment *adjustment,
|
2014-11-05 09:34:45 +08:00
|
|
|
SizeAdjustmentData *adj)
|
1999-09-02 08:01:41 +08:00
|
|
|
{
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
gint i;
|
|
|
|
gint size;
|
|
|
|
gint newn;
|
|
|
|
gchar buf[10];
|
1999-09-02 08:01:41 +08:00
|
|
|
|
|
|
|
for (i = 0; i < adj->nguides; i++)
|
|
|
|
gimp_image_delete_guide (adj->image, adj->guides[i]);
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
1999-09-02 08:01:41 +08:00
|
|
|
g_free (adj->guides);
|
|
|
|
adj->guides = NULL;
|
|
|
|
gimp_displays_flush ();
|
|
|
|
|
2018-06-25 00:15:16 +08:00
|
|
|
*(adj->value) = gtk_adjustment_get_value (adjustment);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2003-02-10 05:03:36 +08:00
|
|
|
if (adj->orientation == GIMP_ORIENTATION_VERTICAL)
|
1999-09-02 08:01:41 +08:00
|
|
|
{
|
|
|
|
size = gimp_image_width (adj->image);
|
|
|
|
newn = size / *(adj->value);
|
|
|
|
adj->nguides = newn - 1;
|
|
|
|
adj->guides = g_new (gint32, adj->nguides);
|
|
|
|
for (i = 0; i < adj->nguides; i++)
|
2008-10-20 14:04:39 +08:00
|
|
|
adj->guides[i] = gimp_image_add_vguide (adj->image,
|
|
|
|
*(adj->value) * (i+1));
|
1999-09-02 08:01:41 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
size = gimp_image_height (adj->image);
|
|
|
|
newn = size / *(adj->value);
|
|
|
|
adj->nguides = newn - 1;
|
|
|
|
adj->guides = g_new (gint32, adj->nguides);
|
|
|
|
for (i = 0; i < adj->nguides; i++)
|
2008-10-20 14:04:39 +08:00
|
|
|
adj->guides[i] = gimp_image_add_hguide (adj->image,
|
|
|
|
*(adj->value) * (i+1));
|
1999-09-02 08:01:41 +08:00
|
|
|
}
|
|
|
|
gimp_displays_flush ();
|
2014-11-05 09:34:45 +08:00
|
|
|
g_snprintf (buf, sizeof (buf), "%2d", newn);
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (adj->count_label), buf);
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
1999-09-02 08:01:41 +08:00
|
|
|
*(adj->count) = newn;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2009-10-17 20:56:28 +08:00
|
|
|
gtk_widget_set_visible (GTK_WIDGET (adj->warning_label),
|
|
|
|
newn * *(adj->value) != size);
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
1999-09-02 08:01:41 +08:00
|
|
|
if (adj->ncells != NULL)
|
2010-10-25 07:26:00 +08:00
|
|
|
gtk_adjustment_set_value (adj->ncells,
|
2008-10-20 14:04:39 +08:00
|
|
|
*(adj->other_count) * *(adj->count));
|
1999-09-02 08:01:41 +08:00
|
|
|
if (adj->rank0 != NULL)
|
2010-10-25 07:26:00 +08:00
|
|
|
gtk_adjustment_set_value (adj->rank0,
|
2008-10-20 14:04:39 +08:00
|
|
|
*(adj->other_count) * *(adj->count));
|
1999-09-02 08:01:41 +08:00
|
|
|
}
|
|
|
|
|
1999-08-23 03:02:52 +08:00
|
|
|
static void
|
1999-08-24 13:30:14 +08:00
|
|
|
entry_callback (GtkWidget *widget,
|
2008-10-20 14:04:39 +08:00
|
|
|
gpointer data)
|
1999-08-23 03:02:52 +08:00
|
|
|
{
|
1999-08-24 13:30:14 +08:00
|
|
|
if (data == info.description)
|
2019-08-15 05:52:38 +08:00
|
|
|
g_strlcpy (info.description, gtk_entry_get_text (GTK_ENTRY (widget)),
|
2014-11-05 09:34:45 +08:00
|
|
|
sizeof (info.description));
|
1999-08-23 03:02:52 +08:00
|
|
|
}
|
|
|
|
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
static void
|
|
|
|
cb_callback (GtkWidget *widget,
|
2008-10-20 14:04:39 +08:00
|
|
|
gpointer data)
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
{
|
2004-08-21 18:38:38 +08:00
|
|
|
gint index;
|
|
|
|
|
|
|
|
index = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
|
|
|
|
|
|
|
|
*((const gchar **) data) = selection_modes [index];
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-11-05 09:34:45 +08:00
|
|
|
dim_callback (GtkAdjustment *adjustment,
|
2004-08-21 18:38:38 +08:00
|
|
|
SizeAdjustmentData *data)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
2009-10-10 20:36:20 +08:00
|
|
|
gihparams.dim = RINT (gtk_adjustment_get_value (adjustment));
|
2004-08-21 18:38:38 +08:00
|
|
|
|
|
|
|
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (data->rank_entry[i], i < gihparams.dim);
|
|
|
|
gtk_widget_set_sensitive (data->mode_entry[i], i < gihparams.dim);
|
|
|
|
}
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
}
|
|
|
|
|
2004-05-19 23:28:01 +08:00
|
|
|
static gboolean
|
2019-08-14 22:13:51 +08:00
|
|
|
gih_save_dialog (GimpImage *image)
|
1999-08-23 03:02:52 +08:00
|
|
|
{
|
2014-06-23 05:01:31 +08:00
|
|
|
GtkWidget *dialog;
|
2018-05-11 18:18:01 +08:00
|
|
|
GtkWidget *grid;
|
|
|
|
GtkWidget *dimgrid;
|
2014-06-23 05:01:31 +08:00
|
|
|
GtkWidget *label;
|
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
GtkWidget *entry;
|
|
|
|
GtkWidget *box;
|
|
|
|
GtkWidget *cb;
|
|
|
|
gint i;
|
|
|
|
gchar buffer[100];
|
|
|
|
SizeAdjustmentData cellw_adjust;
|
|
|
|
SizeAdjustmentData cellh_adjust;
|
2019-08-14 22:13:51 +08:00
|
|
|
GList *layers;
|
2014-06-23 05:01:31 +08:00
|
|
|
gboolean run;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
|
2009-07-21 20:10:29 +08:00
|
|
|
dialog = gimp_export_dialog_new (_("Brush Pipe"), PLUG_IN_BINARY, SAVE_PROC);
|
2005-09-10 02:38:00 +08:00
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
/* The main grid */
|
|
|
|
grid = gtk_grid_new ();
|
|
|
|
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
|
|
|
|
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (grid), 12);
|
2009-07-21 20:10:29 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (gimp_export_dialog_get_content_area (dialog)),
|
2018-05-11 18:18:01 +08:00
|
|
|
grid, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (grid);
|
1999-08-23 03:02:52 +08:00
|
|
|
|
2014-11-05 09:34:45 +08:00
|
|
|
/*
|
|
|
|
* Description: ___________
|
|
|
|
*/
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
gtk_widget_set_size_request (entry, 200, -1);
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (entry), info.description);
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 0,
|
Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.
save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-10 02:06:29 +08:00
|
|
|
_("_Description:"), 0.0, 0.5,
|
2018-05-11 18:18:01 +08:00
|
|
|
entry, 1);
|
2014-11-05 09:34:45 +08:00
|
|
|
|
|
|
|
g_signal_connect (entry, "changed",
|
|
|
|
G_CALLBACK (entry_callback),
|
|
|
|
info.description);
|
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
/*
|
|
|
|
* Spacing: __
|
|
|
|
*/
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (info.spacing, 1, 1000, 1, 10, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 1,
|
Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.
save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-10 02:06:29 +08:00
|
|
|
_("_Spacing (percent):"), 0.0, 0.5,
|
2018-05-11 18:18:01 +08:00
|
|
|
spinbutton, 1);
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&info.spacing);
|
1999-08-24 13:30:14 +08:00
|
|
|
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
/*
|
|
|
|
* Cell size: __ x __ pixels
|
|
|
|
*/
|
2011-09-30 18:17:53 +08:00
|
|
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
|
2000-01-07 06:26:10 +08:00
|
|
|
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (gihparams.cellwidth,
|
2019-08-14 22:13:51 +08:00
|
|
|
2, gimp_image_width (image), 1, 10, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2019-08-27 19:26:27 +08:00
|
|
|
layers = gimp_image_list_layers (image);
|
|
|
|
|
2003-02-10 05:03:36 +08:00
|
|
|
cellw_adjust.orientation = GIMP_ORIENTATION_VERTICAL;
|
2019-08-14 22:13:51 +08:00
|
|
|
cellw_adjust.image = image;
|
2019-08-27 19:26:27 +08:00
|
|
|
cellw_adjust.toplayer = g_list_last (layers)->data;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
cellw_adjust.nguides = 0;
|
|
|
|
cellw_adjust.guides = NULL;
|
2000-12-19 08:24:42 +08:00
|
|
|
cellw_adjust.value = &gihparams.cellwidth;
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (size_adjustment_callback),
|
|
|
|
&cellw_adjust);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2000-01-15 23:32:28 +08:00
|
|
|
label = gtk_label_new ("x");
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2000-01-15 23:32:28 +08:00
|
|
|
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (gihparams.cellheight,
|
2019-08-14 22:13:51 +08:00
|
|
|
2, gimp_image_height (image), 1, 10, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), spinbutton, FALSE, FALSE, 0);
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
2003-02-10 05:03:36 +08:00
|
|
|
cellh_adjust.orientation = GIMP_ORIENTATION_HORIZONTAL;
|
2019-08-14 22:13:51 +08:00
|
|
|
cellh_adjust.image = image;
|
2019-08-27 19:26:27 +08:00
|
|
|
cellh_adjust.toplayer = g_list_last (layers)->data;
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
cellh_adjust.nguides = 0;
|
|
|
|
cellh_adjust.guides = NULL;
|
2000-12-19 08:24:42 +08:00
|
|
|
cellh_adjust.value = &gihparams.cellheight;
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (size_adjustment_callback),
|
|
|
|
&cellh_adjust);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2000-01-15 23:32:28 +08:00
|
|
|
label = gtk_label_new ( _("Pixels"));
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2000-01-26 01:46:56 +08:00
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 2,
|
Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.
save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-10 02:06:29 +08:00
|
|
|
_("Ce_ll size:"), 0.0, 0.5,
|
2018-05-11 18:18:01 +08:00
|
|
|
box, 1);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2019-08-27 19:26:27 +08:00
|
|
|
g_list_free (layers);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
/*
|
|
|
|
* Number of cells: ___
|
|
|
|
*/
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (gihparams.ncells, 1, 1000, 1, 10, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 3,
|
Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.
save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-10 02:06:29 +08:00
|
|
|
_("_Number of cells:"), 0.0, 0.5,
|
2018-05-11 18:18:01 +08:00
|
|
|
spinbutton, 1);
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&gihparams.ncells);
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
|
2000-12-19 08:24:42 +08:00
|
|
|
if (gihparams.dim == 1)
|
1999-09-02 08:01:41 +08:00
|
|
|
cellw_adjust.ncells = cellh_adjust.ncells = adjustment;
|
|
|
|
else
|
|
|
|
cellw_adjust.ncells = cellh_adjust.ncells = NULL;
|
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
/*
|
|
|
|
* Display as: __ rows x __ cols
|
|
|
|
*/
|
2011-09-30 18:17:53 +08:00
|
|
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
2000-01-15 23:32:28 +08:00
|
|
|
|
2000-12-19 08:24:42 +08:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%2d", gihparams.rows);
|
1999-09-02 08:01:41 +08:00
|
|
|
label = gtk_label_new (buffer);
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
cellh_adjust.count_label = label;
|
2000-12-19 08:24:42 +08:00
|
|
|
cellh_adjust.count = &gihparams.rows;
|
|
|
|
cellh_adjust.other_count = &gihparams.cols;
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_widget_show (label);
|
1999-08-24 13:30:14 +08:00
|
|
|
|
2000-01-15 23:32:28 +08:00
|
|
|
label = gtk_label_new (_(" Rows of "));
|
1999-08-24 13:30:14 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2000-01-15 23:32:28 +08:00
|
|
|
|
2000-12-19 08:24:42 +08:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%2d", gihparams.cols);
|
1999-09-02 08:01:41 +08:00
|
|
|
label = gtk_label_new (buffer);
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
cellw_adjust.count_label = label;
|
2003-11-06 23:27:05 +08:00
|
|
|
cellw_adjust.count = &gihparams.cols;
|
2000-12-19 08:24:42 +08:00
|
|
|
cellw_adjust.other_count = &gihparams.rows;
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_widget_show (label);
|
1999-08-24 13:30:14 +08:00
|
|
|
|
2004-05-28 03:00:49 +08:00
|
|
|
label = gtk_label_new (_(" Columns on each layer"));
|
1999-08-24 13:30:14 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2000-01-15 23:32:28 +08:00
|
|
|
|
|
|
|
label = gtk_label_new (_(" (Width Mismatch!) "));
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
cellw_adjust.warning_label = label;
|
2003-11-06 23:27:05 +08:00
|
|
|
|
2000-01-15 23:32:28 +08:00
|
|
|
label = gtk_label_new (_(" (Height Mismatch!) "));
|
1999-09-02 08:01:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
|
|
|
cellh_adjust.warning_label = label;
|
2000-01-26 01:46:56 +08:00
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 4,
|
|
|
|
_("Display as:"), 0.0, 0.5,
|
|
|
|
box, 1);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
/*
|
|
|
|
* Dimension: ___
|
|
|
|
*/
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (gihparams.dim,
|
|
|
|
1, GIMP_PIXPIPE_MAXDIM, 1, 1, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 5,
|
Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.
save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-10 02:06:29 +08:00
|
|
|
_("Di_mension:"), 0.0, 0.5,
|
2018-05-11 18:18:01 +08:00
|
|
|
spinbutton, 1);
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2004-08-21 18:38:38 +08:00
|
|
|
G_CALLBACK (dim_callback),
|
|
|
|
&cellw_adjust);
|
1999-08-24 13:30:14 +08:00
|
|
|
|
|
|
|
/*
|
2004-08-21 18:38:38 +08:00
|
|
|
* Ranks / Selection: ______ ______ ______ ______ ______
|
1999-08-24 13:30:14 +08:00
|
|
|
*/
|
2004-08-21 18:38:38 +08:00
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
dimgrid = gtk_grid_new ();
|
|
|
|
gtk_grid_set_column_spacing (GTK_GRID (dimgrid), 4);
|
2000-05-27 06:28:40 +08:00
|
|
|
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
|
1999-08-24 13:30:14 +08:00
|
|
|
{
|
2004-08-21 18:38:38 +08:00
|
|
|
gint j;
|
2000-01-15 23:32:28 +08:00
|
|
|
|
2010-10-25 07:26:00 +08:00
|
|
|
adjustment = gtk_adjustment_new (gihparams.rank[i], 1, 100, 1, 1, 0);
|
2019-03-09 20:25:19 +08:00
|
|
|
spinbutton = gimp_spin_button_new (adjustment, 1.0, 0);
|
2014-06-23 05:01:31 +08:00
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
2018-05-11 18:18:01 +08:00
|
|
|
gtk_grid_attach (GTK_GRID (dimgrid), spinbutton, 0, i, 1, 1);
|
2004-08-21 18:38:38 +08:00
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2004-08-21 18:38:38 +08:00
|
|
|
if (i >= gihparams.dim)
|
|
|
|
gtk_widget_set_sensitive (spinbutton, FALSE);
|
|
|
|
|
2005-07-01 00:03:24 +08:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&gihparams.rank[i]);
|
|
|
|
|
2004-08-21 18:38:38 +08:00
|
|
|
cellw_adjust.rank_entry[i] = cellh_adjust.rank_entry[i] = spinbutton;
|
|
|
|
|
1999-09-02 08:01:41 +08:00
|
|
|
if (i == 0)
|
2008-10-20 14:04:39 +08:00
|
|
|
{
|
|
|
|
if (gihparams.dim == 1)
|
|
|
|
cellw_adjust.rank0 = cellh_adjust.rank0 = adjustment;
|
|
|
|
else
|
|
|
|
cellw_adjust.rank0 = cellh_adjust.rank0 = NULL;
|
|
|
|
}
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
|
2011-03-17 21:31:39 +08:00
|
|
|
cb = gtk_combo_box_text_new ();
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
|
2004-08-21 18:38:38 +08:00
|
|
|
for (j = 0; j < G_N_ELEMENTS (selection_modes); j++)
|
2011-03-17 21:31:39 +08:00
|
|
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb),
|
|
|
|
selection_modes[j]);
|
2004-08-21 18:38:38 +08:00
|
|
|
gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 2); /* random */
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2000-12-19 08:24:42 +08:00
|
|
|
if (gihparams.selection[i])
|
2004-08-21 18:38:38 +08:00
|
|
|
for (j = 0; j < G_N_ELEMENTS (selection_modes); j++)
|
|
|
|
if (!strcmp (gihparams.selection[i], selection_modes[j]))
|
|
|
|
{
|
|
|
|
gtk_combo_box_set_active (GTK_COMBO_BOX (cb), j);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
gtk_grid_attach (GTK_GRID (dimgrid), cb, 1, i, 1, 1);
|
Implement the selection of brush based on cursor direction, pressure,
1999-08-28 Tor Lillqvist <tml@iki.fi>
* app/gimpbrushpipe.c: Implement the selection of brush based on
cursor direction, pressure, tilt, or a random value. (Hmm, forgot
velocity, later.) (In addition to just incrementally stepping.)
Read the brush pipe parameters from the gih file's second line.
There is no way to tune the parameters in the GIMP, they must
currently be set when saving the gih file (in the gpb plug-in).
* app/gimpbrushpipe.h
* app/gimpbrushpipeP.h: Move the PipeSelectModes enum to the
"private" header. Add a stride array to GimpBrushPipe to make
indexing easier.
* plug-ins/common/gpb.c: Add selection mode fields to the dialog.
Attach the pipe parameters entered as a parasite, too.
* docs/parasites.txt
* plug-ins/common/psp.c: Use "placement", not "spacing" (which
means another thing).
1999-08-28 09:14:42 +08:00
|
|
|
|
|
|
|
gtk_widget_show (cb);
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2004-08-21 18:38:38 +08:00
|
|
|
if (i >= gihparams.dim)
|
|
|
|
gtk_widget_set_sensitive (cb, FALSE);
|
|
|
|
|
|
|
|
g_signal_connect (GTK_COMBO_BOX (cb), "changed",
|
2001-12-29 21:26:29 +08:00
|
|
|
G_CALLBACK (cb_callback),
|
|
|
|
&gihparams.selection[i]);
|
2004-08-21 18:38:38 +08:00
|
|
|
|
|
|
|
cellw_adjust.mode_entry[i] = cellh_adjust.mode_entry[i] = cb;
|
|
|
|
|
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
}
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2018-05-11 18:18:01 +08:00
|
|
|
gimp_grid_attach_aligned (GTK_GRID (grid), 0, 6,
|
|
|
|
_("Ranks:"), 0.0, 0.0,
|
|
|
|
dimgrid, 1);
|
2000-01-15 23:32:28 +08:00
|
|
|
|
2005-09-10 02:38:00 +08:00
|
|
|
gtk_widget_show (dialog);
|
1999-08-24 13:30:14 +08:00
|
|
|
|
2005-09-10 02:38:00 +08:00
|
|
|
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
|
1999-09-02 08:01:41 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
if (run)
|
1999-08-24 13:30:14 +08:00
|
|
|
{
|
2003-11-06 23:27:05 +08:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
|
|
|
|
gihparams.selection[i] = g_strdup (gihparams.selection[i]);
|
|
|
|
|
1999-08-24 13:30:14 +08:00
|
|
|
/* Fix up bogus values */
|
2008-12-27 06:07:53 +08:00
|
|
|
gihparams.ncells = MIN (gihparams.ncells,
|
|
|
|
num_layers * gihparams.rows * gihparams.cols);
|
1999-08-24 13:30:14 +08:00
|
|
|
}
|
2000-12-19 03:38:43 +08:00
|
|
|
|
2005-09-10 02:38:00 +08:00
|
|
|
gtk_widget_destroy (dialog);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
|
|
|
for (i = 0; i < cellw_adjust.nguides; i++)
|
2019-08-14 22:13:51 +08:00
|
|
|
gimp_image_delete_guide (image, cellw_adjust.guides[i]);
|
2003-11-06 23:27:05 +08:00
|
|
|
for (i = 0; i < cellh_adjust.nguides; i++)
|
2019-08-14 22:13:51 +08:00
|
|
|
gimp_image_delete_guide (image, cellh_adjust.guides[i]);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
|
|
|
return run;
|
1999-08-24 13:30:14 +08:00
|
|
|
}
|