Commit Graph

37 Commits

Author SHA1 Message Date
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
2019-07-31 10:16:21 +02:00
Michael Natterer e93fd73fac app: implement pattern saving in the core
Add GimpData::save() implementation to GimpPattern, and change some
glue code to make patterns editable.

Also implement GimpData::duplicate() in GimpPatternClipboard, which
makes it possible to simply copy an area and duplicate the clipboard
pattern to create a new persistent pattern.
2019-02-11 20:56:07 +01:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Jehan 4c2df9b365 app: all remaining g_assert() replaced by critical warning and return...
... in app/core.
Continuing on my crusade against asserting and crashing GIMP.
2018-01-22 16:20:04 +01:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer bcc3437f5f Bug 344684 - Greyscale (no alpha) clipboard brushes are of the wrong type
Add a "mask-only" property to GimpBrushClipboard. When TRUE, only
create a brush mask (not a pixmap brush with mask and image).

Keep two clipboard brushes around: one classic "Clipboard Image" one
to be used as "stamp", and one new "Clipboard Mask" one that turns the
clipboard into a brush mask.
2017-04-19 17:33:44 -03:00
Michael Natterer 6eeb5c2ee2 app: support clipboard images in the clipboard brush and pattern 2017-04-19 16:52:10 -03:00
Michael Natterer d85157c376 app: rename gimp->global_buffer to gimp->clipboard_buffer
Also rename the "buffer-changed" signal and the setter, and add a
getter.
2016-09-17 17:39:54 +02:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
  finally acknowledging the fact that app/ depends on gdk-pixbuf almost
  globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
2013-10-15 01:58:39 +02:00
Michael Natterer 0a8135b8b0 Bug 701335 - Gimp crashing on creating huge clipboard brush
Change the maximum size of clipboard patterns and brushes to 1024x1024.
2013-06-21 12:45:20 +02:00
Michael Natterer 8bc4f008e7 Bug 692668 - Browse For Patterns
Increase the max size of the clipboard brush and pattern to 2048x2048
pixels. Still arbitrary but much better.
2013-03-26 23:55:40 +01:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer 1a624d4df4 app: remove many includes of "gegl/gimp-gegl-utils.h" 2012-05-10 23:12:39 +02:00
Michael Natterer bdf6b48138 app: move GimpTempBuf from base/ to core/
and forget about include policy in base/, it's scheduled for removal
anyway.
2012-05-02 17:51:01 +02:00
Michael Natterer dccb909009 app: make GimpTempBuf reference counted
and remove the "take_ownership" parameter from
gimp_temp_buf_create_buffer(), simply always ref the buf.
2012-05-02 17:51:00 +02:00
Michael Natterer d5d8e36d21 app: gimp_-namespace all GimpTempBuf functions 2012-05-02 17:51:00 +02:00
Michael Natterer 7441a1f6f7 app: turn the TempBuf's "bytes" into "format" and port everything to it 2012-05-02 17:50:59 +02:00
Michael Natterer ff86f85744 app: remove x, y and color parameters from temp_buf_new()
Fix the places that passed the color by either temp_buf_data_clear()
or memset(), and assign x and y manually, they are going to vanish
completely soon.
2012-05-02 17:50:58 +02:00
Øyvind Kolås 6efd812d08 app: s/GIMP_GEGL_RECT/GEGL_RECTANGLE/
Defining GeglRectangle inline is so useful that it has been added to
GEGL.
2012-05-02 17:50:52 +02:00
Michael Natterer 2d81a16bdf app: remove "bytes" from GimpBuffer and add a format API
and change all users accordingly.
2012-05-02 17:50:47 +02:00
Øyvind Kolås ee97c1f4ff app: correct usage of babl formats
GIMP was doing evil hacks lying to GEGL about it's pixels being in a linear
color space when they are not. This causes incorrect rendering, makes gaussian
blur misbehave etc.

The legacy projection modes should be implemented using the same 2.2 gamma
formats that are correct to specify for sRGB data. (for proper color
management in higher bitdepths; icc backend babl formats should be used.)

For the old image modes correct babl formats are:

R'G'B'A u8  -  8 bit RGB with 2.2 gamma (sRGB) with linear alpha component
R'G'B' u8   -  8 bit RGB with 2.2 gamma (sRGB)
Y'A u8      -  8 bit Grayscale with 2.2 gamma with linear alpha component
Y' u8       -  8 bit Grayscale with 2.2 gamma

Y u8        -  8 bit linear data, used for masks/channels
A u8        -  8 bit linear alpha

-----------------------------------------------

RGBA float  -     32bit floating point linear light RGB
RaGaBaA float  -  32bit floating point linear light RGB, premultiplied alpha
                  to be used for processing that needs to scale by the alpha,
                  (blurs, resampling etc)
R'G'B'A float  -  32bit floating point sRGB with gamma, to be used where
                  the result depends on being closer to perceptual when
                  processing, can be used a cheaper alternative to CIE Lab
                  based modes.

-----------------------------------------------

The legacy layer modes should use the formats with gamma 2.2 only for loading
and rendering legacy XCF files correctly, in the brave new world compositing
should most likely be done in linear light with "RGBA float" and even better
"RaGaBaA float" like GEGL does for porter duff and other compositing modes.

The ability to chose the legacy layer modes should probably be hidden from the
user unless an old .xcf has been opened.
2012-05-02 17:50:38 +02:00
Øyvind Kolås f68c3c7051 app: adapt to API changes in GEGL 2012-05-02 17:46:15 +02:00
Øyvind Kolås c872a9368e app: sprinkle level argument over process functions 2012-05-02 17:46:13 +02:00
Øyvind Kolås f8b1372038 app: make use of GIMP_GEGL_RECT in more places 2012-05-02 17:46:05 +02:00
Michael Natterer d771249466 app: completely port GimpBuffer to using GeglBuffer not TileManager 2012-05-02 17:45:47 +02:00
Michael Natterer 5e4eee4653 app: implement GObject::constructed() instead of ::constructor() 2011-01-12 22:53:58 +01:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

	* app/pdb/*-cmds.c: regenerated.

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +00:00
Sven Neumann 4eb3689b62 added gimp_buffer_get_tiles().
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpbuffer.[ch]: added gimp_buffer_get_tiles().

	* app/actions/edit-commands.c
	* app/core/gimpbrushclipboard.c
	* app/core/gimppatternclipboard.c: use the new accessor 
function.


svn path=/trunk/; revision=26426
2008-08-07 17:23:45 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 146e063f0a app/core/gimpbrushclipboard.c app/core/gimppatternclipboard.c
2006-11-25  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrushclipboard.c
	* app/core/gimppatternclipboard.c
	* app/core/gimptooloptions.c
	* app/core/gimpundo.c
	* app/widgets/gimpdevicestatus.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpimageparasiteview.c
	* app/widgets/gimpimagepropview.c: no need to cast the return
	value of g_value_get_object(), it's a gpointer.
2006-11-25 14:57:26 +00:00
Sven Neumann c3448b2cbf It makes more sense to have GimpData::dirty indicate a name change than to
2006-05-23  Sven Neumann  <sven@gimp.org>

	It makes more sense to have GimpData::dirty indicate a name change
	than to invalidate the previews whenever the name changes.

	* app/core/gimpdata.c: call gimp_object_name_changed() from
	gimp_data_real_dirty() instead of implementing
	GimpObject::name-changed and calling gimp_data_dirty() from there.

	* app/core/gimpbrushclipboard.c
	* app/core/gimppalette.c
	* app/core/gimppatternclipboard.c: call gimp_data_dirty() in place
	of gimp_object_name_changed().

	* app/core/gimpbrushgenerated.c (gimp_brush_generated_dirty):
	chain up unconditionally.
2006-05-23 15:39:45 +00:00
Michael Natterer aebf12dfb9 app/core/gimpbrushclipboard.c (gimp_brush_clipboard_buffer_changed) limit
2006-05-17  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrushclipboard.c
	(gimp_brush_clipboard_buffer_changed)
	* app/core/gimppatternclipboard.c
	(gimp_pattern_clipboard_buffer_changed): limit the size of
	clipboard brushes and patterns to 512x512 pixels to prevent OOM
	conditions when copying from huge drawables.
2006-05-17 19:00:49 +00:00
Michael Natterer 1b60573fae app/core/gimpbrushclipboard.c (gimp_brush_clipboard_buffer_changed) remove
2006-05-17  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrushclipboard.c
	(gimp_brush_clipboard_buffer_changed)
	* app/core/gimppatternclipboard.c
	(gimp_pattern_clipboard_buffer_changed): remove calls to
	gimp_data_dirty() because the emission of "name-changed" takes
	care of that.
2006-05-17 10:36:21 +00:00
Sven Neumann 5084a123c9 app/core/gimpbrushclipboard.c (gimp_brush_clipboard_buffer_changed) emit
2006-05-17  Sven Neumann  <sven@gimp.org>

	* app/core/gimpbrushclipboard.c
	(gimp_brush_clipboard_buffer_changed)
	* app/core/gimppatternclipboard.c
	(gimp_pattern_clipboard_buffer_changed): emit "name-changed" so that
	the description is being updated.
2006-05-17 10:24:03 +00:00
Michael Natterer d7cd890c9c app/core/Makefile.am app/core/core-types.h new GimpPattern subclass that
2006-05-16  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimppatternclipboard.[ch]: new GimpPattern subclass
	that auto-updates its contents from gimp->global_buffer.

	* app/core/gimp.c (gimp_real_initialize): add a clipboard pattern
	to the pattern factory.

	* app/widgets/gimpaction.c (gimp_action_set_proxy): replace the
	GimpView by a new one if the viewable type changes, instead of
	running into a warning (didn't happen before because this is only
	used for imagefiles and patterns, which didn't have subclasses).
2006-05-16 19:55:01 +00:00