Commit Graph

82 Commits

Author SHA1 Message Date
Federico Mena Quintero
37ac7d593e Your eyes are bloodshot.
Your eyes are bloodshot.

Your mouth starts to foam.

Your hands are shaking.

You know your need your fix.

NEED MORE ABSTRACTION!

2000-04-12  Federico Mena Quintero  <federico@helixcode.com>

	This comes from an excellent idea by Tim Janik (timj@gtk.org) to
	hook to the last unref operation.

	* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_set_last_unref_handler): New
	function to set the last unref handler for a pixbuf.
	(gdk_pixbuf_finalize): New function to actually finalize a pixbuf.
	It calls the pixbuf's destroy notification function and frees the
	GdkPixbuf structure itself.
	(gdk_pixbuf_unref): Use the last unref function of the pixbuf if
	available.

	* gdk-pixbuf/gdk-pixbuf-private.h (struct _GdkPixbuf): New fields
	for the last unref handler and its user data.

	* gdk-pixbuf/gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): Use
	g_new0() to allocate the pixbuf.

	* gdk-pixbuf/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init):
	Fixed the call to gtk_signal_new() for the "frame_done" signal; it
	was not specifying the `frame' argument.

	* gdk-pixbuf/gdk-pixbuf-animation.c
	(gdk_pixbuf_animation_get_width): Fixed docstring.
	(gdk_pixbuf_animation_get_height): Likewise.
	(gdk_pixbuf_animation_get_num_frames): Likewise.
	(gdk_pixbuf_animation_get_frames): Likewise.

	* doc/gdk-pixbuf-sections.txt: Updated with the new functions and
	types.

	* doc/tmpl/gdk-pixbuf.sgml: Added the description for GdkColorspace.

	* doc/tmpl/scaling.sgml: Added the description for GdkInterpType.

	* doc/tmpl/refcounting.sgml: Updated with the information about
	the last unref handler.

	* doc/tmpl/*.sgml: Markup tweaks.

	* gdk-pixbuf/Makefile.am (libgnomecanvaspixbuf_la_LDFLAGS): Sigh,
	update the libtool version number for libgnomecanvaspixbuf as
	well.
	(libpixbufloader_*_la_LDFLAGS): The loaders need to be versioned
	as well, or the old ones won't work with the new stuff.  Also,
	renamed the modules as follows.

	* gdk-pixbuf/gdk-pixbuf-io.c (gdk_pixbuf_load_module): Now the
	modules are called "libpixbufloader-<format>.so" instead of
	"libpixbuf-<format>.so".  They needed renaming so that the new
	loaders won't overwrite the old ones; even with the versioning
	stuff, the new .so symlink to the .so.1.0.0 would overwrite the
	old real .so file.
2000-04-13 01:18:41 +00:00
Federico Mena Quintero
829ed02435 Most of this patch is based on a patch by Havoc Pennington (hp@redhat.com)
2000-04-11  Federico Mena Quintero  <federico@helixcode.com>

	Most of this patch is based on a patch by Havoc Pennington
	(hp@redhat.com) to make GdkPixbuf's structures opaque and to
	remove the libart dependency.

	* gdk-pixbuf/gdk-pixbuf.h: Removed the public structures.
	(GdkColorspace): New enum that for now only contains
	GDK_COLORSPACE_RGB.
	(GdkPixbufDestroyNotify): New type for the pixbuf's pixels destroy
	notification function.
	(GdkInterpType): New num with interpolation types.

	* *.[ch]: Replace the libart stuff with our own stuff.

	* pixops/*.[ch]: Likewise.

	* gdk-pixbuf/gdk-pixbuf-private.h: New file with the private
	declarations of the GdkPixbuf structures.

	* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_new_from_art_pixbuf):
	Removed function.
	(gdk_pixbuf_get_format): Constify.
	(gdk_pixbuf_get_n_channels): Constify.
	(gdk_pixbuf_get_has_alpha): Constify.
	(gdk_pixbuf_get_bits_per_sample): Constify.
	(gdk_pixbuf_get_pixels): Constify.
	(gdk_pixbuf_get_width): Constify.
	(gdk_pixbuf_get_height): Constify.
	(gdk_pixbuf_get_rowstride): Constify.

	* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_copy): New function to copy
	a pixbuf.

	* gdk-pixbuf/gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): Added a
	bits_per_sample argument; currently only 8 bits per sample are
	supported.

	* gdk-pixbuf/gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_pixbuf):
	New accessor.
	(gdk_pixbuf_frame_get_x_offset): New accessor.
	(gdk_pixbuf_frame_get_y_offset): New accessor.
	(gdk_pixbuf_frame_get_delay_time): New accessor.
	(gdk_pixbuf_frame_get_action): New accessor.

	* gdk-pixbuf/gdk-pixbuf-render.c
	(gdk_pixbuf_render_pixmap_and_mask): Instead of returning a solid
	mask rectangle for pixbufs without an alpha channel, set the
	*mask_return to NULL.

	* gdk-pixbuf/gdk-pixbuf-util.c (gdk_pixbuf_add_alpha): Constify.

	* gdk-pixbuf/gdk-pixbuf-scale.c: Fix includes.

	* gdk-pixbuf/gdk-pixbuf-scale.c (gdk_pixbuf_scale): Added some
	preconditions.  Maybe we should also check for the colorspace,
	bits per pixel, and such.
	(gdk_pixbuf_composite): Likewise.
	(gdk_pixbuf_composite_color): Likewise.
	(gdk_pixbuf_scale_simple): Likewise, and fail gracefully if we
	cannot allocate the new pixbuf.
	(gdk_pixbuf_composite_color_simple): Likewise.

	* gdk-pixbuf/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_render):
	Use art_rgb_rgba_affine() or art_rgb_affine() since we no longer
	have an ArtPixBuf.

	* gdk-pixbuf/io-bmp.c: Fix includes.

	* gdk-pixbuf/pixops/pixops.c (pixops_scale_nearest): Fixed cast in
	an lvalue.

	* TODO: Populated.

	* configure.in: Removed checks for libart.

	* gdk-pixbuf/Makefile.am: Removed references to libart.
	(noinst_HEADERS): Added gdk-pixbuf-private.h.

	* gdk-pixbuf/Makefile.am (libgdk_pixbuf_la_LDFLAGS): Incremented
	the version number of the libtool library to indicate that this
	definitely is not compatible with the old usage.  I know you love
	me.  I know you do.

	* configure.in: Bumped version number to 0.7.0.

	* README: Updated.

	* gdk-pixbuf-config.in (--libs): We no longer require libart.

	* DEPENDS.libgdk_pixbuf: We no longer depend on libart.

	* gdk-pixbuf.spec.in: Updated, but I don't guarantee anything.
2000-04-11 07:03:25 +00:00
Federico Mena Quintero
8a680eb75c Reverted Mark's change. The refcount is private information, and the
2000-04-01  Federico Mena Quintero  <federico@helixcode.com>

	* gdk-pixbuf/gdk-pixbuf.c: Reverted Mark's change.  The refcount
	is private information, and the art_pixbuf will go away soon.
2000-04-02 18:54:17 +00:00
Mark Crichton
f77b679fe4 Added 2 more convience functions.
Added 2 more convience functions.

gdk_pixbuf_get_refcount for the current refcount of the pixbuf (per someone
at Eazel's request)

gdk_pixbuf_get_artpixbuf: returns the artpixbuf of the pixbuf.  Is this
a good idea?  I'm using it to help make->panel->do->the->right->thing.
2000-04-01 03:28:31 +00:00
Federico Mena Quintero
e7550f1c9c Return gboolean instead of int.
2000-03-29  Federico Mena Quintero  <federico@helixcode.com>

	* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_get_has_alpha): Return
	gboolean instead of int.
2000-03-29 19:54:29 +00:00
Federico Mena Quintero
bb8a563730 Return the same pixbuf as the input parameter.
2000-01-21  Federico Mena Quintero  <federico@helixcode.com>

	* gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_ref): Return the same pixbuf
	as the input parameter.

	* gdk-pixbuf/gdk-pixbuf-animation.c (gdk_pixbuf_animation_ref):
	Return the same animation as the input parameter.
2000-01-21 22:54:44 +00:00
Elliot Lee
0bce8ff54b No more libart/gdk-pixbuf as part of gnome-libs
* No more libart/gdk-pixbuf as part of gnome-libs

* Everything: Install header files & *Conf.sh in new per-interface-version locations.
Include interface version in library names.
2000-01-10 19:17:42 +00:00
Federico Mena Quintero
6e3522ab2c Added reference counting to animations. A web browser may want to share a
2000-01-01  Federico Mena Quintero  <federico@helixcode.com>

	* gdk-pixbuf/gdk-pixbuf.h (GdkPixbufAnimation): Added reference
	counting to animations.  A web browser may want to share a single
	copy of an animated GIF if it appears multiple times in a web
	page, for example.

	* gdk-pixbuf/gdk-pixbuf-animation.c: New file.  Moved the
	animation functions here.
	(gdk_pixbuf_animation_new_from_file): Prettified.  Return a NULL
	animation if the loader does not support multiframe loading and
	the single-frame load returned NULL.  Check that the filename is
	not NULL.  Updated inline documentation.
	(gdk_pixbuf_animation_ref): New function.
	(gdk_pixbuf_animation_unref): New function.
	Removed gdk_pixbuf_animation_destroy() in favor of reference
	counting.

	* gdk-pixbuf/gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
	Prettified.  Made ref_count assertion more paranoid.  Check that
	the filename is not NULL.
	(gdk_pixbuf_get_module): Use guchar * and guint for buffer and
	size, respectively.
	(gdk_pixbuf_new_from_xpm_data): Changed the "data" argument to
	const char **.

	* gdk-pixbuf/io-gif.c (image_load_animation): Create the animation
	with a reference count of 1.

	* gdk-pixbuf/Makefile.am (libgdk_pixbuf_la_SOURCES): Added
	gdk-pixbuf-animation.c.

	* doc/tmpl/animation.sgml: Populated.  It is still missing a
	description of the overlay modes.

	* doc/gdk-pixbuf-sections.txt: Added the animation section.  Moved
	the canvas item section to the end, as it will be moved later to
	gnome-libs.

	* doc/gdk-pixbuf.sgml: Added the animation section.

	* doc/Makefile.am (tmpl_sources): Added tmpl/animation.sgml.
2000-01-02 03:59:22 +00:00
Jonathan Blandford
d4984ede33 moved the file here. It seems natural to put this function here, as that's
1999-12-17  Jonathan Blandford  <jrb@redhat.com>

	* gdk-pixbuf/gdk-pixbuf-io.c (gdk_pixbuf_animation_new_from_file):
	moved the file here.  It seems natural to put this function here,
	as that's where the gdk_pixbuf_new_from_file function is, but it's
	still a little convoluted.  The source files might be played with
	in a bit.
1999-12-17 21:42:47 +00:00
Jonathan Blandford
d723183795 thinking about the new loading API.
1999-12-10  Jonathan Blandford  <jrb@redhat.com>

	* gdk-pixbuf/gdk-pixbuf-io.h: thinking about the new loading API.

	* gdk-pixbuf/gdk-pixbuf-drawable.c (gdk_pixbuf_get_from_drawable):
	make a warning go away.
1999-12-11 00:21:27 +00:00
Federico Mena Quintero
25a8142429 #include <config.h>, and fix includes.
1999-12-02  Federico Mena Quintero  <federico@redhat.com>

	* src/testpixbuf.c: #include <config.h>, and fix includes.

	* src/testpixbuf-drawable.c: #include <config.h>, and fix includes.

	* src/io-xpm.c: Fix includes.

	* src/io-tiff.c: Fix includes.

	* src/io-ras.c: Fix includes, and do not include more stuff than needed.

	* src/io-pnm.c: Fix inlcudes, and do not include more stuff than needed.

	* src/io-png.c: Fix includes.

	* src/io-ico.c: Fix includes, and do not include more stuff than needed.

	* src/io-gif.c: Fix includes, and do not include more stuff than needed.

	* src/io-bmp.c: Fix includes, and do not include more stuff than needed.

	* src/gnome-canvas-pixbuf.c: Fix includes.

	* src/gdk-pixbuf.c: Fix includes.

	* src/gdk-pixbuf-util.c: Fix includes.

	* src/gdk-pixbuf-render.c: Fix includes.

	* src/gdk-pixbuf-io.h: Fix includes.

	* src/gdk-pixbuf-drawable.c: Fix includes.

	* src/gdk-pixbuf-drawable.h: Use angle brackets for the gdk-pixbuf
	include files.

	* src/gdk-pixbuf-data.c: Fix includes.

	* src/gdk-pixbuf-loader.c: #include <config.h>

	* src/gdk-pixbuf-loader.h: Use angle brackets for the gdk-pixbuf
	include files.

	* src/Makefile.am: Commented out the gdk-pixbuf-drawable stuff,
	since it is not finished.
1999-12-02 20:44:43 +00:00
Jonathan Blandford
14237d13e2 make the symlink. Does not work for srcdir != buildir != . Beats me why; I
1999-11-22  Jonathan Blandford  <jrb@redhat.com>

	* configure.in (GDK_PIXBUF_DIR): make the symlink.  Does not work
	for srcdir != buildir != .  Beats me why; I can't figure it out.
	AC_OUTPUT_COMMANDS doesn't seem to let me substitute it correctly.
1999-11-22 20:43:58 +00:00
Arturo Espinosa
9d8da16ee9 More docs work - Federico 1999-11-04 21:52:08 +00:00
Federico Mena Quintero
567305020d Populated.
1999-11-04  Federico Mena Quintero  <federico@redhat.com>

	* doc/tmpl/gdk-pixbuf.sgml: Populated.

	* doc/tmpl/refcounting.sgml: Populated.

	* doc/tmpl/file-loading.sgml: Populated.

	* src/gdk-pixbuf.c: Added documentation comments.

	* src/gdk-pixbuf-io.c (gdk_pixbuf_new_from_file): Added
	documentation comments.
1999-11-04 08:14:32 +00:00
Jonathan Blandford
9a1c50c961 turned convenience macros into convenience
1999-10-28  Jonathan Blandford  <jrb@redhat.com>

	* src/gdk-pixbuf.h: turned convenience macros into convenience
1999-10-28 19:00:02 +00:00
Federico Mena Quintero
0eb096334e New function to threshold a pixbuf's alpha channel into a bitmap.
1999-10-27  Federico Mena Quintero  <federico@redhat.com>

	* src/gdk-pixbuf-render.c (gdk_pixbuf_render_threshold_alpha): New
	function to threshold a pixbuf's alpha channel into a bitmap.

	* src/gdk-pixbuf.c (gdk_pixbuf_new): Fixed so that it will
	contemplate future extensions to ArtPixBuf's formats.

	* src/io-png.c (png_info_callback): Use the new API of gdk_pixbuf_new().

	* src/gdk-pixbuf.h (gdk_pixbuf_get_height): Added some convenience
	macros to fetch the ArtPixBuf's fields.
1999-10-27 23:36:44 +00:00
Havoc Pennington
1a0a5d0399 New function to create a blank pixbuf.
1999-10-27  Havoc Pennington  <hp@pobox.com>

* src/gdk-pixbuf.c (gdk_pixbuf_new): New function to create a
blank pixbuf.

* src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Check all
three progressive load funcs are non-NULL, rather than checking
begin_load three times. Also, check whether begin_load returns
NULL on failure.
1999-10-27 17:28:44 +00:00
Federico Mena Quintero
7ef5dec32d Removed the unref_fn field. Now all memory management of the buffer is
1999-10-20  Federico Mena Quintero  <federico@redhat.com>

	* src/gdk-pixbuf.h (GdkPixbuf): Removed the unref_fn field.  Now
	all memory management of the buffer is done by libart.

	* src/gdk-pixbuf.c (gdk_pixbuf_unref): Do destruction here.
	Removed gdk_pixbuf_destroy, gdk_pixbuf_duplicate.

	* src/gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): Implemented in
	terms of the libart functions.  Removed the old code.

	* src/gdk-pixbuf-io.c (image_handler_load): Removed the save
	symbols.  Saving will not be implemented in GdkPixbuf.

	* src/io-gif.c: Removed the saving stub.
	(image_load): Fixed memory management to fail gracefully if we run
	out of memory while loading the image.  Close the gif file when we
	are done.  This still needs more error handling for the DGif
	functions.

	* src/io-jpeg.c (image_load): Some robustness fixes.

	* src/io-png.c: Removed the saving stuff.
	(image_load): Some memory management fixes.

	* src/io-tiff.c (image_load): Ditto.

	* src/io-xpm.c (pixbuf_create_from_xpm): Ditto.
1999-10-20 21:20:49 +00:00
Federico Mena Quintero
74268afdeb Reindented to use the GNOME Indentation.
1999-10-18  Federico Mena Quintero  <federico@redhat.com>

	* src/*: Reindented to use the GNOME Indentation.
1999-10-18 19:29:45 +00:00
Michael Meeks
6c13b03a45 Add pixbuf_duplicate,
Fix 'scale' API,
Add gdk_pixbuf_new,
clean io modules a tad.
1999-09-22 22:30:51 +00:00
Federico Mena Quintero
6fce115b98 Be more paranoid with sanity checking. (gdk_pixbuf_unref): Fix incorrect
1999-09-17  Federico Mena Quintero  <federico@redhat.com>

	* src/gdk-pixbuf.c (gdk_pixbuf_ref): Be more paranoid with sanity
	checking.
	(gdk_pixbuf_unref): Fix incorrect sanity check and comparison.
1999-09-17 05:59:53 +00:00
Federico Mena Quintero
49ca2615f8 Fixed compiler warnings. Fixed write to unallocated memory (row_ptr), and
1999-08-09  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* src/io-png.c (image_save): Fixed compiler warnings.  Fixed write
	to unallocated memory (row_ptr), and fixed its type as well.  Take
	into account the ArtPixbuf's rowstride when assigning the row
	pointers.

	* src/gdk-pixbuf.c: Fixup includes.

	* src/gdk-pixbuf-io.c: Likewise.
1999-08-09 06:09:24 +00:00
Mark Crichton
276ec82df5 More fixes to the rotation code. It really works well now. Now we need to
More fixes to the rotation code.  It really works well now.  Now we need
to fix the "clipping when rotating" problem if it is a real issue.

Mark
1999-07-20 19:30:08 +00:00
Mark Crichton
8194b3483b Added translation to the rotate
Added translation to the rotate
1999-07-20 18:59:39 +00:00
Mark Crichton
6423183a63 Ok minor changes.
Ok minor changes.

No longer make a version.h, and cleaned up some code here and there, and added
a quickie dirty-hack rotation function.  However, it rotates at the origin.
Is this what we want?  Or do we want a rotate w.r.t. the center of the pixbuf?

Anyone.

Mark
1999-07-19 02:13:34 +00:00
Larry Ewing
e9ed2c18a7 reverted the expose everything changes, I'm not sure why these went in.
1999-07-16  Larry Ewing  <lewing@gimp.org>

	* src/testpixbuf.c (expose_func): reverted the expose everything
	changes, I'm not sure why these went in.
	(config_func): bring this up to date with the new pixbuf_scale
	semantics.

	* src/gdk-pixbuf-io.c: added a couple of warnings to the module
	loading code so that poeple can diagnose problems better.

	* src/gdk-pixbuf.c (gdk_pixbux_scale): fix the borkedness, also it
	no longer allocates a new pixbuf, which make things nicer for the
	rest of the code.  Unfortunately there is still a problem with
	scaling rgba images.
1999-07-17 20:03:34 +00:00
Mark Crichton
f12fbc1b32 Fixed up the scaling routine.
Fixed up the scaling routine.
1999-07-17 03:00:10 +00:00
Mark Crichton
96ba724fc5 Added scaling of pixmaps. Currently doesn't work, however, since I'm
Added scaling of pixmaps.  Currently doesn't work, however, since I'm guessing
how art_rgb_affine really works.

Mark
1999-07-16 20:35:21 +00:00
Mark Crichton
9b462c6024 configure.in: Fixed GIF check. Actually works now! src/gdk-pixbuf.c: More
configure.in: Fixed GIF check.  Actually works now!
src/gdk-pixbuf.c: More scaling work.
1999-07-13 07:01:08 +00:00
Mark Crichton
1d146b0d58 Doh. Forgot the libgif check. Also, slowly adding the scaling support That
Doh.  Forgot the libgif check.  Also, slowly adding the scaling support
That will be the next commit.

I also hope I got the configure.in right...

M
1999-07-13 06:21:40 +00:00
Mark Crichton
68f895bd68 Massive update...
Massive update...

gdk-pixbuf-io.c: Fixed to compile and run in a very crippled state.

io-bpm.c: Rough start on a WIN/OS2 BMP loader

testpixbuf.c: Really crude test program for gdk-pixbuf

io-gif.c: Fixed some boneheaded uninitalized variables causing the
loader to choke
1999-07-08 16:04:16 +00:00
Arturo Espinosa
249f6c5326 Initial revision 1999-01-04 23:53:12 +00:00