1999-10-20 21:20:49 +00:00
|
|
|
|
/* GdkPixbuf library - Main header file
|
1999-10-18 19:29:45 +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>
|
2000-04-11 07:03:25 +00:00
|
|
|
|
* Havoc Pennington <hp@redhat.com>
|
1999-10-18 19:29:45 +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-18 19:29:45 +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-18 19:29:45 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1999-10-18 19:29:45 +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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GDK_PIXBUF_H
|
|
|
|
|
#define GDK_PIXBUF_H
|
1999-01-04 23:53:12 +00:00
|
|
|
|
|
2000-06-21 20:47:22 +00:00
|
|
|
|
#include <glib.h>
|
2000-01-10 19:17:42 +00:00
|
|
|
|
#include <gdk-pixbuf/gdk-pixbuf-features.h>
|
2001-02-04 07:05:29 +00:00
|
|
|
|
#include <glib-object.h>
|
1999-09-22 22:30:51 +00:00
|
|
|
|
|
Include files outside of the extern "C" block. Makes some C++ compiler
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gdk-pixbuf/gdk-pixbuf.h, gtk/gtkhsv.h, gtk/gtktextbtree.h,
gtk/gtktextbuffer.h, gtk/gtktextchild.h, gtk/gtktextdisplay.h,
gtk/gtktextiter.h, gtk/gtktextiterprivate.h, gtk/gtktextlayout.h,
gtk/gtktextmarkprivate.h, gtk/gtktextsegment.h, gtk/gtktexttag.h,
gtk/gtktexttagtable.h, gtk/gtktexttypes.h, gtk/gtktextview.h,
gtk/gtktypeutils.h: Include files outside of the extern "C"
block. Makes some C++ compiler happy. Reported by Denis Vakatov
<vakatov@peony.nlm.nih.gov>.
I really hope not to have caused a merging nightmare for all
the branches out there. Otherwise I'll be available for crucifixion.
2000-07-19 16:11:40 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
|
1999-01-04 23:53:12 +00:00
|
|
|
|
|
2000-10-09 17:22:20 +00:00
|
|
|
|
/* Alpha compositing mode */
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GDK_PIXBUF_ALPHA_BILEVEL,
|
|
|
|
|
GDK_PIXBUF_ALPHA_FULL
|
2000-10-09 17:22:20 +00:00
|
|
|
|
} GdkPixbufAlphaMode;
|
|
|
|
|
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
/* Color spaces; right now only RGB is supported.
|
|
|
|
|
* Note that these values are encoded in inline pixbufs
|
|
|
|
|
* as ints, so don't reorder them
|
|
|
|
|
*/
|
2000-01-02 03:59:22 +00:00
|
|
|
|
typedef enum {
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GDK_COLORSPACE_RGB
|
|
|
|
|
} GdkColorspace;
|
1999-12-10 23:15:20 +00:00
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* All of these are opaque structures */
|
|
|
|
|
typedef struct _GdkPixbuf GdkPixbuf;
|
|
|
|
|
typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
|
2000-06-22 15:36:12 +00:00
|
|
|
|
typedef struct _GdkPixbufFrame GdkPixbufFrame;
|
|
|
|
|
|
|
|
|
|
#define GDK_TYPE_PIXBUF (gdk_pixbuf_get_type ())
|
|
|
|
|
#define GDK_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF, GdkPixbuf))
|
|
|
|
|
#define GDK_IS_PIXBUF(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF))
|
|
|
|
|
|
|
|
|
|
#define GDK_TYPE_PIXBUF_ANIMATION (gdk_pixbuf_animation_get_type ())
|
|
|
|
|
#define GDK_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimation))
|
|
|
|
|
#define GDK_IS_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION))
|
|
|
|
|
|
2000-04-03 08:59:43 +00:00
|
|
|
|
|
2000-04-13 01:18:41 +00:00
|
|
|
|
/* Handler that must free the pixel array */
|
2000-04-11 07:03:25 +00:00
|
|
|
|
typedef void (* GdkPixbufDestroyNotify) (guchar *pixels, gpointer data);
|
1999-12-10 23:15:20 +00:00
|
|
|
|
|
2000-10-06 18:19:18 +00:00
|
|
|
|
#define GDK_PIXBUF_ERROR gdk_pixbuf_error_quark ()
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2000-10-18 18:42:54 +00:00
|
|
|
|
/* image data hosed */
|
|
|
|
|
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
|
|
|
|
/* no mem to load image */
|
|
|
|
|
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
2000-10-06 18:19:18 +00:00
|
|
|
|
/* bad option value passed to save routine */
|
|
|
|
|
GDK_PIXBUF_ERROR_BAD_OPTION_VALUE,
|
2000-10-06 18:26:23 +00:00
|
|
|
|
/* unsupported image type (sort of an ENOSYS) */
|
|
|
|
|
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
/* unsupported operation (load, save) for image type */
|
|
|
|
|
GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
|
2000-10-06 18:19:18 +00:00
|
|
|
|
GDK_PIXBUF_ERROR_FAILED
|
2000-10-18 18:42:54 +00:00
|
|
|
|
} GdkPixbufError;
|
2000-10-06 18:19:18 +00:00
|
|
|
|
|
|
|
|
|
GQuark gdk_pixbuf_error_quark () G_GNUC_CONST;
|
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
|
|
|
|
|
|
|
2000-08-30 00:33:38 +00:00
|
|
|
|
GType gdk_pixbuf_get_type (void) G_GNUC_CONST;
|
2000-06-22 15:36:12 +00:00
|
|
|
|
|
1999-10-20 21:20:49 +00:00
|
|
|
|
/* Reference counting */
|
1999-10-18 19:29:45 +00:00
|
|
|
|
|
2000-04-13 01:18:41 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf);
|
|
|
|
|
void gdk_pixbuf_unref (GdkPixbuf *pixbuf);
|
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* GdkPixbuf accessors */
|
|
|
|
|
|
|
|
|
|
GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf);
|
|
|
|
|
int gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf);
|
|
|
|
|
gboolean gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf);
|
|
|
|
|
int gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf);
|
|
|
|
|
guchar *gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf);
|
|
|
|
|
int gdk_pixbuf_get_width (const GdkPixbuf *pixbuf);
|
|
|
|
|
int gdk_pixbuf_get_height (const GdkPixbuf *pixbuf);
|
|
|
|
|
int gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf);
|
|
|
|
|
|
|
|
|
|
|
1999-07-16 20:35:21 +00:00
|
|
|
|
|
1999-10-27 23:36:44 +00:00
|
|
|
|
/* Create a blank pixbuf with an optimal rowstride and a new buffer */
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample,
|
1999-10-27 23:36:44 +00:00
|
|
|
|
int width, int height);
|
1999-10-27 17:28:44 +00:00
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* Copy a pixbuf */
|
|
|
|
|
|
|
|
|
|
GdkPixbuf *gdk_pixbuf_copy (const GdkPixbuf *pixbuf);
|
|
|
|
|
|
2000-11-01 07:07:46 +00:00
|
|
|
|
/* Create a pixbuf which points to the pixels of another pixbuf */
|
|
|
|
|
GdkPixbuf *gdk_pixbuf_new_subpixbuf (GdkPixbuf *src_pixbuf,
|
|
|
|
|
int src_x,
|
|
|
|
|
int src_y,
|
|
|
|
|
int width,
|
|
|
|
|
int height);
|
|
|
|
|
|
1999-10-20 21:20:49 +00:00
|
|
|
|
/* Simple loading */
|
|
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_new_from_file (const char *filename,
|
|
|
|
|
GError **error);
|
2000-01-02 03:59:22 +00:00
|
|
|
|
|
2000-02-14 20:06:23 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_new_from_data (const guchar *data,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkColorspace colorspace,
|
2000-01-02 03:59:22 +00:00
|
|
|
|
gboolean has_alpha,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
int bits_per_sample,
|
2000-01-02 03:59:22 +00:00
|
|
|
|
int width, int height,
|
|
|
|
|
int rowstride,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkPixbufDestroyNotify destroy_fn,
|
|
|
|
|
gpointer destroy_fn_data);
|
1999-10-20 21:20:49 +00:00
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const char **data);
|
1999-12-02 17:45:47 +00:00
|
|
|
|
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
/* Read an inline pixbuf */
|
|
|
|
|
GdkPixbuf *gdk_pixbuf_new_from_inline (const guchar *inline_pixbuf,
|
|
|
|
|
gboolean copy_pixels,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
int length,
|
|
|
|
|
GError **error);
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
|
2000-10-06 18:19:18 +00:00
|
|
|
|
|
|
|
|
|
/* Saving */
|
|
|
|
|
|
|
|
|
|
gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf,
|
|
|
|
|
const char *filename,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
const char *type,
|
|
|
|
|
GError **error,
|
2000-10-06 18:19:18 +00:00
|
|
|
|
...);
|
|
|
|
|
|
|
|
|
|
gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf,
|
|
|
|
|
const char *filename,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
const char *type,
|
2000-10-06 18:19:18 +00:00
|
|
|
|
char **option_keys,
|
|
|
|
|
char **option_values,
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GError **error);
|
2000-10-06 18:19:18 +00:00
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
/* Adding an alpha channel */
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_add_alpha (const GdkPixbuf *pixbuf, gboolean substitute_color,
|
1999-12-02 17:45:47 +00:00
|
|
|
|
guchar r, guchar g, guchar b);
|
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* Copy an area of a pixbuf onto another one */
|
|
|
|
|
void gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
|
|
|
|
|
int src_x, int src_y,
|
|
|
|
|
int width, int height,
|
|
|
|
|
GdkPixbuf *dest_pixbuf,
|
|
|
|
|
int dest_x, int dest_y);
|
|
|
|
|
|
Move more text widget headers into the private header list
2000-09-26 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am (gtk_private_h_sources): Move more text widget
headers into the private header list
* Makefile.am (pkgconfig_DATA): install pkg-config files
* configure.in: add pkg-config files
* gdk-2.0.pc.in, gdk-pixbuf.pc.in, gtk+-2.0.pc.in: pkg-config files
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Invalidate
outstanding icon caches on theme change.
* gtk/gtkiconfactory.h, gtk/gtkiconfactory.c: New icon system. Three
important types:
(GtkIconSource): Specification for creating a pixbuf
appropriate for a direction/state/size triplet from
a source pixbuf or filename
(GtkIconSet): List of GtkIconSource objects that are used to
create the "same" icon (e.g. an OK button icon), and cache for
rendered icons
(GtkIconFactory): Hash from stock ID to GtkIconSet; used to look
up the icon set for a given stock ID. GTK maintains a stack of
GtkIconFactory to search, and applications or libraries can add
additional icon factories on top of the stack
* gtk/gtkrc.h, gtk/gtkrc.c: When loading an RcStyle, parse
the set of GtkIconSource specified for a given stock ID into
a GtkIconSet, and put the GtkIconSet into a GtkIconFactory for the
RcStyle, under the specified stock ID.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Add a virtual function
render_icon used to derive a GdkPixbuf from a GtkIconSource.
This allows people to theme how prelight, insensitive, etc. are
done.
(gtk_style_lookup_icon_set): Look up a stock ID in the list of
icon factories for a style, and return the resulting
icon set if any.
(gtk_style_render_icon): Render an icon using the render_icon
method in the GtkStyleClass.
* gtk/gtkwidget.h, gtk/gtkwidget.c (gtk_widget_render_icon):
Use the style for a given widget to look up a stock ID, get the
icon set, and render an icon using the render_icon method
of the style
* gtk/gtkstock.h, gtk/gtkstock.c: Header with the GtkStockItem type
(contains information about a stock item), the built-in stock item
IDs, and functions to add/lookup stock items.
* gtk/stock-icons/*: Stock icons that come with GTK
* gtk/gtkbutton.h, gtk/gtkbutton.c (gtk_button_new_stock): Returns
a button based on a GtkStockItem
(gtk_button_new_accel): Takes a uline string and accel group, and
installs the accelerator.
* gtk/gtkimage.h, gtk/gtkimage.c: Make this into a generic
image-display widget.
2000-09-26 20:22:17 +00:00
|
|
|
|
/* Brighten/darken and optionally make it pixelated-looking */
|
|
|
|
|
void gdk_pixbuf_saturate_and_pixelate (const GdkPixbuf *src,
|
|
|
|
|
GdkPixbuf *dest,
|
|
|
|
|
gfloat saturation,
|
|
|
|
|
gboolean pixelate);
|
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
|
|
|
|
|
|
1999-10-27 23:36:44 +00:00
|
|
|
|
/* Rendering to a drawable */
|
2000-04-11 07:03:25 +00:00
|
|
|
|
|
2000-01-13 07:24:49 +00:00
|
|
|
|
|
2000-01-05 21:33:58 +00:00
|
|
|
|
/* Scaling */
|
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* Interpolation modes */
|
|
|
|
|
typedef enum {
|
|
|
|
|
GDK_INTERP_NEAREST,
|
|
|
|
|
GDK_INTERP_TILES,
|
|
|
|
|
GDK_INTERP_BILINEAR,
|
|
|
|
|
GDK_INTERP_HYPER
|
|
|
|
|
} GdkInterpType;
|
|
|
|
|
|
2000-02-03 23:36:14 +00:00
|
|
|
|
void gdk_pixbuf_scale (const GdkPixbuf *src,
|
|
|
|
|
GdkPixbuf *dest,
|
|
|
|
|
int dest_x,
|
|
|
|
|
int dest_y,
|
|
|
|
|
int dest_width,
|
|
|
|
|
int dest_height,
|
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkInterpType interp_type);
|
2000-02-03 23:36:14 +00:00
|
|
|
|
void gdk_pixbuf_composite (const GdkPixbuf *src,
|
|
|
|
|
GdkPixbuf *dest,
|
|
|
|
|
int dest_x,
|
|
|
|
|
int dest_y,
|
|
|
|
|
int dest_width,
|
|
|
|
|
int dest_height,
|
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkInterpType interp_type,
|
2000-02-03 23:36:14 +00:00
|
|
|
|
int overall_alpha);
|
|
|
|
|
void gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
|
|
|
|
GdkPixbuf *dest,
|
|
|
|
|
int dest_x,
|
|
|
|
|
int dest_y,
|
|
|
|
|
int dest_width,
|
|
|
|
|
int dest_height,
|
|
|
|
|
double offset_x,
|
|
|
|
|
double offset_y,
|
|
|
|
|
double scale_x,
|
|
|
|
|
double scale_y,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkInterpType interp_type,
|
2000-02-03 23:36:14 +00:00
|
|
|
|
int overall_alpha,
|
|
|
|
|
int check_x,
|
|
|
|
|
int check_y,
|
|
|
|
|
int check_size,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
guint32 color1,
|
|
|
|
|
guint32 color2);
|
2000-02-03 23:36:14 +00:00
|
|
|
|
|
|
|
|
|
GdkPixbuf *gdk_pixbuf_scale_simple (const GdkPixbuf *src,
|
|
|
|
|
int dest_width,
|
|
|
|
|
int dest_height,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkInterpType interp_type);
|
|
|
|
|
|
2000-02-03 23:36:14 +00:00
|
|
|
|
GdkPixbuf *gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
|
|
|
|
|
int dest_width,
|
|
|
|
|
int dest_height,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
GdkInterpType interp_type,
|
2000-02-03 23:36:14 +00:00
|
|
|
|
int overall_alpha,
|
|
|
|
|
int check_size,
|
2000-04-11 07:03:25 +00:00
|
|
|
|
guint32 color1,
|
|
|
|
|
guint32 color2);
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 21:33:58 +00:00
|
|
|
|
|
2000-01-02 03:59:22 +00:00
|
|
|
|
/* Animation support */
|
1999-12-10 23:15:20 +00:00
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* GIF-like animation overlay modes for frames */
|
|
|
|
|
typedef enum {
|
|
|
|
|
GDK_PIXBUF_FRAME_RETAIN,
|
|
|
|
|
GDK_PIXBUF_FRAME_DISPOSE,
|
|
|
|
|
GDK_PIXBUF_FRAME_REVERT
|
|
|
|
|
} GdkPixbufFrameAction;
|
|
|
|
|
|
2000-08-30 00:33:38 +00:00
|
|
|
|
GType gdk_pixbuf_animation_get_type (void) G_GNUC_CONST;
|
2000-06-22 15:36:12 +00:00
|
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
|
GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename,
|
|
|
|
|
GError **error);
|
1999-12-10 23:15:20 +00:00
|
|
|
|
|
2000-04-04 05:17:49 +00:00
|
|
|
|
GdkPixbufAnimation *gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation);
|
|
|
|
|
void gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation);
|
|
|
|
|
|
|
|
|
|
int gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation);
|
|
|
|
|
int gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation);
|
|
|
|
|
GList *gdk_pixbuf_animation_get_frames (GdkPixbufAnimation *animation);
|
|
|
|
|
int gdk_pixbuf_animation_get_num_frames (GdkPixbufAnimation *animation);
|
1999-12-11 00:21:27 +00:00
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
|
/* Frame accessors */
|
|
|
|
|
|
|
|
|
|
GdkPixbuf *gdk_pixbuf_frame_get_pixbuf (GdkPixbufFrame *frame);
|
|
|
|
|
int gdk_pixbuf_frame_get_x_offset (GdkPixbufFrame *frame);
|
|
|
|
|
int gdk_pixbuf_frame_get_y_offset (GdkPixbufFrame *frame);
|
|
|
|
|
int gdk_pixbuf_frame_get_delay_time (GdkPixbufFrame *frame);
|
|
|
|
|
GdkPixbufFrameAction gdk_pixbuf_frame_get_action (GdkPixbufFrame *frame);
|
2001-01-09 16:23:57 +00:00
|
|
|
|
GdkPixbufFrame *gdk_pixbuf_frame_copy (GdkPixbufFrame *src);
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
|
void gdk_pixbuf_frame_free (GdkPixbufFrame *frame);
|
|
|
|
|
GType gdk_pixbuf_frame_get_type (void) G_GNUC_CONST;
|
|
|
|
|
#define GDK_TYPE_PIXBUF_FRAME gdk_pixbuf_frame_get_type ()
|
2000-04-11 07:03:25 +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
|
|
|
|
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
|
2000-01-10 19:17:42 +00:00
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
|
|
1999-10-08 23:01:05 +00:00
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
1999-10-08 23:01:05 +00:00
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
|
#endif
|