2002-10-03 22:39:51 +00:00
|
|
|
|
/* GdkPixbuf library - Io handling. This is an internal header for
|
|
|
|
|
* GdkPixbuf. You should never use it unless you are doing development 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
|
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
#include "gdk-pixbuf/gdk-pixbuf.h"
|
1999-10-26 20:43:39 +00:00
|
|
|
|
#include <gmodule.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2002-01-09 16:36:20 +00:00
|
|
|
|
G_BEGIN_DECLS
|
1999-11-02 01:50:06 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
#ifdef GDK_PIXBUF_ENABLE_BACKEND
|
1999-10-27 17:31:07 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
|
2002-07-06 23:10:46 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
typedef void (* GdkPixbufModuleSizeFunc) (gint *width,
|
|
|
|
|
gint *height,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
|
typedef void (* GdkPixbufModulePreparedFunc) (GdkPixbuf *pixbuf,
|
|
|
|
|
GdkPixbufAnimation *anim,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
typedef void (* GdkPixbufModuleUpdatedFunc) (GdkPixbuf *pixbuf,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
|
typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
|
|
|
|
|
struct _GdkPixbufModulePattern {
|
|
|
|
|
unsigned char *prefix;
|
|
|
|
|
unsigned char *mask;
|
|
|
|
|
int relevance;
|
|
|
|
|
};
|
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;
|
2002-10-03 22:39:51 +00:00
|
|
|
|
char *module_path;
|
1999-10-27 19:15:37 +00:00
|
|
|
|
GModule *module;
|
2002-10-03 22:39:51 +00:00
|
|
|
|
GdkPixbufFormat *info;
|
|
|
|
|
|
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
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
gpointer (* begin_load) (GdkPixbufModuleSizeFunc size_func,
|
|
|
|
|
GdkPixbufModulePreparedFunc prepare_func,
|
|
|
|
|
GdkPixbufModuleUpdatedFunc update_func,
|
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 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);
|
2002-10-03 22:39:51 +00:00
|
|
|
|
|
2002-12-08 00:18:13 +00:00
|
|
|
|
/*< private >*/
|
2002-10-03 22:39:51 +00:00
|
|
|
|
void (*_reserved1) (void);
|
|
|
|
|
void (*_reserved2) (void);
|
|
|
|
|
void (*_reserved3) (void);
|
|
|
|
|
void (*_reserved4) (void);
|
|
|
|
|
void (*_reserved5) (void);
|
|
|
|
|
void (*_reserved6) (void);
|
1999-10-26 20:43:39 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
};
|
1999-10-26 20:43:39 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
typedef void (* GdkPixbufModuleFillVtableFunc) (GdkPixbufModule *module);
|
|
|
|
|
typedef void (* GdkPixbufModuleFillInfoFunc) (GdkPixbufFormat *info);
|
|
|
|
|
|
|
|
|
|
/* key/value pairs that can be attached by the pixbuf loader */
|
|
|
|
|
|
|
|
|
|
gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
|
|
|
|
|
const gchar *key,
|
|
|
|
|
const gchar *value);
|
|
|
|
|
|
|
|
|
|
typedef enum /*< skip >*/
|
|
|
|
|
{
|
|
|
|
|
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0
|
|
|
|
|
} GdkPixbufFormatFlags;
|
|
|
|
|
|
|
|
|
|
struct _GdkPixbufFormat {
|
|
|
|
|
gchar *name;
|
|
|
|
|
GdkPixbufModulePattern *signature;
|
|
|
|
|
gchar *domain;
|
|
|
|
|
gchar *description;
|
|
|
|
|
gchar **mime_types;
|
|
|
|
|
gchar **extensions;
|
|
|
|
|
guint32 flags;
|
|
|
|
|
};
|
1999-10-26 22:04:29 +00:00
|
|
|
|
|
2002-08-22 21:32:06 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
|
1999-11-02 01:50:06 +00:00
|
|
|
|
|
2002-01-09 16:36:20 +00:00
|
|
|
|
G_END_DECLS
|
1999-11-02 01:50:06 +00:00
|
|
|
|
|
2002-10-03 22:39:51 +00:00
|
|
|
|
#endif /* GDK_PIXBUF_IO_H */
|