Commit Graph

38 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
79d6346057 0.6.0 - Federico 2000-02-22 00:29:00 +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
8c510f2ecf finished work to make animated gifs load correctly. Progressive loading
1999-12-20  Jonathan Blandford  <jrb@redhat.com>

	* gdk-pixbuf/io-gif.c: finished work to make animated gifs load
	correctly.  Progressive loading needs some work, but that all
	needs doing from the gdk-pixbuf-loader end, not here.
1999-12-20 22:51:05 +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
Federico Mena Quintero
e506cf37cb Patch from Arjan to fix an initializer.
1999-12-06  Federico Mena Quintero  <federico@redhat.com>

	* gdk-pixbuf/gdk-pixbuf-io.c (file_formats): Patch from Arjan to
	fix an initializer.
1999-12-06 18:57:03 +00:00
Arjan van de Ven
631f507f58 Major cleanup, added support for 32 bpp and 4 bpp (uncompressed) images,
1999-12-04  Arjan van de Ven <arjan@fenrus.demon.nl>

	* gdk-pixbuf/io-bmp.c: Major cleanup, added support for
	32 bpp and 4 bpp (uncompressed) images, fixed 1bpp.

	* gdk-pixbuf/io-ras.c: Minor cleanup, ran through lclint

	* gdk-pixbuf/io-ico.c: Minor cleanup, fixed 1bpp icons,
 	ran through lclint.

	* gdk-pixbuf/gdk-pixbuf-io.c: Added detection of .CUR files
	(Windows Cursor files). These are identical to .ICO files,
	except for the signature and 2 extra fields for the hotspot.
1999-12-04 18:17:52 +00:00
Jonathan Blandford
4aae90b5b1 Added another loader from Arjan to handle .ico files. Cool.
1999-11-29  Jonathan Blandford  <jrb@redhat.com>

        * src/Makefile.am (ICO_LIB): Added another loader from Arjan to
	handle .ico files.  Cool.
1999-11-29 16:49:39 +00:00
Elliot Lee
c8df698460 Try to fix gdk-pixbuf a bit better.
Try to fix gdk-pixbuf a bit better.
1999-11-23 01:25:28 +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
Jonathan Blandford
0652653292 added io-bmp from Arjan <arjan@fenrus.demon.nl>
1999-11-21  Jonathan Blandford  <jrb@redhat.com>

        * src/gdk-pixbuf-io.c: added io-bmp from Arjan
        <arjan@fenrus.demon.nl>
1999-11-21 21:28:28 +00:00
Federico Mena Quintero
cfb0266518 Populated.
1999-11-10  Federico Mena Quintero  <federico@redhat.com>

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

	* doc/gdk-pixbuf.signals: Put in the real names of signal
	arguments.

	* src/gdk-pixbuf-loader.c: Improved documentation comments.
1999-11-10 22:48:46 +00:00
Jonathan Blandford
12474a79ae removed spurious print statements.
1999-11-10  Jonathan Blandford  <jrb@redhat.com>

	* src/gdk-pixbuf-io.c (gdk_pixbuf_load_module): removed spurious
	print statements.
1999-11-10 17:30:13 +00:00
Federico Mena Quintero
b835084dfa Added documentation.
1999-11-10  Federico Mena Quintero  <federico@redhat.com>

	* src/gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Added
	documentation.
1999-11-10 06:40:12 +00:00
Jonathan Blandford
9ab8dfc3e4 second patch Arjan van de Ven <arjan@fenrus.demon.nl> to autodetect/load
1999-11-05  Jonathan Blandford  <jrb@redhat.com>

	* src/gdk-pixbuf-io.c: second patch Arjan van de Ven
	<arjan@fenrus.demon.nl> to autodetect/load the sunras files.
1999-11-05 21:29:33 +00:00
Michael Fulbright
01fcce4cf9 Prettied up code slightly. Start of pnm loader (from file and
999-11-04  Michael Fulbright  <drmike@redhat.com>

	* src/io-jpeg.c: Prettied up code slightly.
	* src/io-pnm.c:  Start of pnm loader (from file and progressively).
	                 Doesn't do much yet (will finish tomorrow).
	* src/gdk-pixbuf-io.c: Added pnm to structure of known types.
1999-11-05 00:16:10 +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
Michael Fulbright
5749f310e4 Actually load the image handler when we determine the image type.
1999-10-29  Michael Fulbright  <drmike@redhat.com>

        * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Actually
        load the image handler when we determine the image type.

        * src/gdk-pixbuf-io.[ch] (gdk_pixbuf_load_module): Changed the
        previously static function load_image_handler () to
        a public function gdk_pixbuf_load_module (). It is needed in
        gdk-pixbuf-loader.c to load image handler modules.  This function
        is different from gdk_pixbuf_get_module (), which only returns
        a reference to the required handler, because it actually loads
        the handler into memory. Both actions should possibly be combined
        in a convenience function since one w/o the other doesn't seem to
        make much sense.
1999-10-29 19:27:51 +00:00
Jonathan Blandford
5a8b538ee1 started work on the tiff non-incremental loader.
1999-10-28  Jonathan Blandford  <jrb@redhat.com>

	* src/io-tiff.c (image_load_increment): started work on the tiff
	non-incremental loader.

	* src/io-gif.c (image_load_increment): started work on the gif
	incremental loader.

	* src/gdk-pixbuf-io.h: Changed ModuleType to GdkPixbufModule.
1999-10-28 14:46:46 +00:00
Arturo Espinosa
9ee4ff5eee Make it build - Federico 1999-10-27 19:15:37 +00:00
Havoc Pennington
54f017171f Check properly whether the XPM module has already been loaded
1999-10-27  Havoc Pennington  <hp@pobox.com>

* src/gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Check
properly whether the XPM module has already been loaded
(gdk_pixbuf_new_from_file): Check properly if loader module
was already loaded (was checking if load symbol was present
in order to decide whether to re-load; should check module !=
NULL, then load != NULL)
(image_handler_load): Check in present working directory,
makes it easier to debug for now
(file_formats): This array initializer was seriously on crack,
was assigning a function pointer to a GModule*

* src/testpixbuf.c (main): Change type of pixbuf_loader to GdkPixbufLoader*

* src/io-png.c: Progressive loading stuff compiles, untested.
1999-10-27 18:55:00 +00:00
Jonathan Blandford
eacb3ad51f load the vtable fully.
1999-10-26  Jonathan Blandford  <jrb@redhat.com>

	* src/gdk-pixbuf-io.c (image_handler_load): load the vtable fully.
1999-10-26 23:26:16 +00:00
Jonathan Blandford
e5dfd2f5da more work on the incremental loading 1999-10-26 20:43:39 +00:00
Havoc Pennington
5f3ae6ad67 Export this symbol for loading an XPM from memory.
1999-10-22  Havoc Pennington  <hp@pobox.com>

* src/io-xpm.c (image_load_xpm_data): Export this symbol for
loading an XPM from memory.

* src/gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): New
function, loads pixbuf from xpm data
(image_handler_load): Add g_return_if_fail() to ensure the same
module isn't loaded twice. Add g_module_symbol() to scan for XPM
loader function.
1999-10-22 21:05:16 +00:00
Federico Mena Quintero
04823f40c4 Free path.
1999-10-20  Federico Mena Quintero  <federico@redhat.com>

	* src/gdk-pixbuf-io.c (image_handler_load): Free path.
1999-10-21 00:37:21 +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
Federico Mena Quintero
66779b9b26 Set the initial ref_count to 1.
1999-09-17  Federico Mena Quintero  <federico@redhat.com>

	* src/io-bmp.c (image_load): Set the initial ref_count to 1.

	* src/io-gif.c (image_load): Likewise.

	* src/io-jpeg.c (image_load): Likewise.

	* src/io-png.c (image_load): Likewise.

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

	* src/io-xpm.c (_pixbuf_create_from_xpm): Likewise.

	* src/gdk-pixbuf-io.c (gdk_pixbuf_load_image): Added an assertion
	for the ref_count to be != 0.
1999-09-17 07:57:25 +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
Daniel Veillard
91cb3bb665 Fixed 2 C syntax bugs, Daniel 1999-07-31 17:20:49 +00:00
Mark Crichton
3d679818a0 Added some first steps for file saving. Big thing is that a
Added some first steps for file saving.  Big thing is that a gdk_pixbuf_save
function needs to be setup.

Mark
1999-07-29 21:17:40 +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
38f428304e Some changes to do a "proper" install.
Some changes to do a "proper" install.

Makefile doesnt work, however.
1999-07-12 05:40:02 +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
f876ca2681 Loading framework done, start of PNG loader 1999-01-05 04:31:03 +00:00
Arturo Espinosa
249f6c5326 Initial revision 1999-01-04 23:53:12 +00:00