2000-01-05 23:06:13 +00:00
|
|
|
|
/* GdkPixbuf library - Io handling. This is an internal header for gdk-pixbuf.
|
|
|
|
|
* You should never use it unless you are doing developement for gdkpixbuf itself.
|
1999-10-26 20:43:39 +00:00
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 1999 The Free Software Foundation
|
|
|
|
|
*
|
|
|
|
|
* Authors: Mark Crichton <crichton@gimp.org>
|
|
|
|
|
* Miguel de Icaza <miguel@gnu.org>
|
|
|
|
|
* Federico Mena-Quintero <federico@gimp.org>
|
|
|
|
|
* Jonathan Blandford <jrb@redhat.com>
|
1999-10-29 19:27:51 +00:00
|
|
|
|
* Michael Fulbright <drmike@redhat.com>
|
1999-10-26 20:43:39 +00:00
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1999-10-26 20:43:39 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library 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
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1999-10-26 20:43:39 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1999-10-26 20:43:39 +00:00
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
|
*/
|
1999-11-02 01:50:06 +00:00
|
|
|
|
|
|
|
|
|
#ifndef GDK_PIXBUF_IO_H
|
|
|
|
|
#define GDK_PIXBUF_IO_H
|
|
|
|
|
|
1999-10-26 20:43:39 +00:00
|
|
|
|
#include <gmodule.h>
|
|
|
|
|
#include <stdio.h>
|
1999-12-02 20:44:43 +00:00
|
|
|
|
#include "gdk-pixbuf.h"
|
2000-10-06 18:19:18 +00:00
|
|
|
|
#include "gdk-pixbuf-i18n.h"
|
1999-10-26 20:43:39 +00:00
|
|
|
|
|
1999-11-02 01:50:06 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-10-27 17:31:07 +00:00
|
|
|
|
|
|
|
|
|
|
2001-05-07 15:58:47 +00:00
|
|
|
|
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf,
|
|
|
|
|
GdkPixbufAnimation *anim,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
typedef void (* ModuleUpdatedNotifyFunc) (GdkPixbuf *pixbuf,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data);
|
1999-10-26 22:04:29 +00:00
|
|
|
|
|
1999-10-28 14:46:46 +00:00
|
|
|
|
typedef struct _GdkPixbufModule GdkPixbufModule;
|
|
|
|
|
struct _GdkPixbufModule {
|
1999-10-26 20:43:39 +00:00
|
|
|
|
char *module_name;
|
1999-10-27 17:31:07 +00:00
|
|
|
|
gboolean (* format_check) (guchar *buffer, int size);
|
1999-10-27 19:15:37 +00:00
|
|
|
|
GModule *module;
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GdkPixbuf *(* load) (FILE *f,
|
|
|
|
|
GError **error);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
GdkPixbuf *(* load_xpm_data) (const char **data);
|
1999-10-26 22:04:29 +00:00
|
|
|
|
|
|
|
|
|
/* Incremental loading */
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
Add built marshaller files to support GdkPixbufLoader signals
2001-01-22 Havoc Pennington <hp@redhat.com>
* Makefile.am: Add built marshaller files to support
GdkPixbufLoader signals
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): have
GDK_PIXBUF_MODULEDIR unconditionally replace the compiled-in
module location, rather than acting as a fallback, because we are
using GDK_PIXBUF_MODULEDIR to use gdk-pixbuf before installing it.
* gdk-pixbuf.h: include gdk-pixbuf-loader.h
* gdk-pixbuf-loader.h, gdk-pixbuf-loader.c: Move back over here
from gtk, and add error to close(), because stop_load may do
parsing of the image.
* pixops/have_mmx.S (_pixops_have_mmx): add newline at end of file
* io-*.c: make individual operations static, and add fill_vtable
functions which are exported. Fix the collection of type warnings
that surfaced, including a number of functions that didn't
properly take a GError and some that weren't
const-correct. Involved adding error handling for a few loaders.
* gdk-pixbuf-io.h: Add error reporting to stop_load function
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): change to just look up
a function that fills in the GdkPixbufModule vtable, instead of
looking up all the image functions individually; this means we
can get type safety within modules for the loader functions.
Also it means you don't have to keep the statically compiled and
GModule versions in sync.
* test-gdk-pixbuf.c (main): remove gdk_pixbuf_init()
* make-inline-pixbuf.c (main): remove call to gdk_pixbuf_init()
* gdk-pixbuf.h: nuke gdk_pixbuf_init()
* gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_type): g_type_init
() here
* gdk-pixbuf.c (gdk_pixbuf_get_type): g_type_init () here
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_get_type):
g_type_init() here
2001-01-22 Havoc Pennington <hp@redhat.com>
* demos/testanimation.c: fix to reflect gdk-pixbuf changes
* demos/testpixbuf.c: fix to reflect gdk-pixbuf changes
* gtk/gdk-pixbuf-loader.c, gtk/gdk-pixbuf-loader.h:
Remove, move back to gdk-pixbuf
* gtk/gtktextiter.c, gtk/gtktextiter.h: add sentence equivalents
to all the word functions
* gtk/gtktextview.c (gtk_text_view_start_cursor_blink): return
before doing anything on NULL layout or if we don't have the focus
* gtk/testtext.c (fill_example_buffer): "justification"
* gtk/gtktexttag.h, gtk/gtktexttag.c: change the tag attribute
to be called "justification" not "justify"
* demos/gtk-demo/textview.c (create_tags): "justification"
* gtk/gtktextlayout.c (set_para_values): Handle char-wise wrapping
2001-01-22 23:09:48 +00:00
|
|
|
|
gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
|
|
|
|
|
ModuleUpdatedNotifyFunc update_func,
|
|
|
|
|
gpointer user_data,
|
|
|
|
|
GError **error);
|
|
|
|
|
gboolean (* stop_load) (gpointer context,
|
|
|
|
|
GError **error);
|
2000-10-06 18:19:18 +00:00
|
|
|
|
gboolean (* load_increment) (gpointer context,
|
|
|
|
|
const guchar *buf,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
guint size,
|
|
|
|
|
GError **error);
|
1999-12-11 00:21:27 +00:00
|
|
|
|
|
|
|
|
|
/* Animation loading */
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GdkPixbufAnimation *(* load_animation) (FILE *f,
|
|
|
|
|
GError **error);
|
2000-10-06 18:19:18 +00:00
|
|
|
|
|
|
|
|
|
gboolean (* save) (FILE *f,
|
|
|
|
|
GdkPixbuf *pixbuf,
|
|
|
|
|
gchar **param_keys,
|
|
|
|
|
gchar **param_values,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GError **error);
|
1999-10-26 20:43:39 +00:00
|
|
|
|
};
|
|
|
|
|
|
Add built marshaller files to support GdkPixbufLoader signals
2001-01-22 Havoc Pennington <hp@redhat.com>
* Makefile.am: Add built marshaller files to support
GdkPixbufLoader signals
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): have
GDK_PIXBUF_MODULEDIR unconditionally replace the compiled-in
module location, rather than acting as a fallback, because we are
using GDK_PIXBUF_MODULEDIR to use gdk-pixbuf before installing it.
* gdk-pixbuf.h: include gdk-pixbuf-loader.h
* gdk-pixbuf-loader.h, gdk-pixbuf-loader.c: Move back over here
from gtk, and add error to close(), because stop_load may do
parsing of the image.
* pixops/have_mmx.S (_pixops_have_mmx): add newline at end of file
* io-*.c: make individual operations static, and add fill_vtable
functions which are exported. Fix the collection of type warnings
that surfaced, including a number of functions that didn't
properly take a GError and some that weren't
const-correct. Involved adding error handling for a few loaders.
* gdk-pixbuf-io.h: Add error reporting to stop_load function
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): change to just look up
a function that fills in the GdkPixbufModule vtable, instead of
looking up all the image functions individually; this means we
can get type safety within modules for the loader functions.
Also it means you don't have to keep the statically compiled and
GModule versions in sync.
* test-gdk-pixbuf.c (main): remove gdk_pixbuf_init()
* make-inline-pixbuf.c (main): remove call to gdk_pixbuf_init()
* gdk-pixbuf.h: nuke gdk_pixbuf_init()
* gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_type): g_type_init
() here
* gdk-pixbuf.c (gdk_pixbuf_get_type): g_type_init () here
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_get_type):
g_type_init() here
2001-01-22 Havoc Pennington <hp@redhat.com>
* demos/testanimation.c: fix to reflect gdk-pixbuf changes
* demos/testpixbuf.c: fix to reflect gdk-pixbuf changes
* gtk/gdk-pixbuf-loader.c, gtk/gdk-pixbuf-loader.h:
Remove, move back to gdk-pixbuf
* gtk/gtktextiter.c, gtk/gtktextiter.h: add sentence equivalents
to all the word functions
* gtk/gtktextview.c (gtk_text_view_start_cursor_blink): return
before doing anything on NULL layout or if we don't have the focus
* gtk/testtext.c (fill_example_buffer): "justification"
* gtk/gtktexttag.h, gtk/gtktexttag.c: change the tag attribute
to be called "justification" not "justify"
* demos/gtk-demo/textview.c (create_tags): "justification"
* gtk/gtktextlayout.c (set_para_values): Handle char-wise wrapping
2001-01-22 23:09:48 +00:00
|
|
|
|
typedef void (* ModuleFillVtableFunc) (GdkPixbufModule *module);
|
1999-10-26 20:43:39 +00:00
|
|
|
|
|
2001-02-20 02:59:30 +00:00
|
|
|
|
GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
|
|
|
|
|
const gchar *filename,
|
|
|
|
|
GError **error);
|
|
|
|
|
GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
|
|
|
|
|
GError **error);
|
|
|
|
|
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
|
|
|
|
|
GError **error);
|
1999-10-26 22:04:29 +00:00
|
|
|
|
|
1999-11-02 01:50:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|