Blame gtk/gtkimage.h

Packit Service fb6fa5
/* GTK - The GIMP Toolkit
Packit Service fb6fa5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
/*
Packit Service fb6fa5
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit Service fb6fa5
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit Service fb6fa5
 * files for a list of changes.  These files are distributed with
Packit Service fb6fa5
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef __GTK_IMAGE_H__
Packit Service fb6fa5
#define __GTK_IMAGE_H__
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
Packit Service fb6fa5
#error "Only <gtk/gtk.h> can be included directly."
Packit Service fb6fa5
#endif
Packit Service fb6fa5
Packit Service fb6fa5
#include <gio/gio.h>
Packit Service fb6fa5
#include <gtk/gtkmisc.h>
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
G_BEGIN_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
#define GTK_TYPE_IMAGE                  (gtk_image_get_type ())
Packit Service fb6fa5
#define GTK_IMAGE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE, GtkImage))
Packit Service fb6fa5
#define GTK_IMAGE_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMAGE, GtkImageClass))
Packit Service fb6fa5
#define GTK_IS_IMAGE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE))
Packit Service fb6fa5
#define GTK_IS_IMAGE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE))
Packit Service fb6fa5
#define GTK_IMAGE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE, GtkImageClass))
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
typedef struct _GtkImage       GtkImage;
Packit Service fb6fa5
typedef struct _GtkImageClass  GtkImageClass;
Packit Service fb6fa5
Packit Service fb6fa5
typedef struct _GtkImagePixmapData  GtkImagePixmapData;
Packit Service fb6fa5
typedef struct _GtkImageImageData   GtkImageImageData;
Packit Service fb6fa5
typedef struct _GtkImagePixbufData  GtkImagePixbufData;
Packit Service fb6fa5
typedef struct _GtkImageStockData   GtkImageStockData;
Packit Service fb6fa5
typedef struct _GtkImageIconSetData GtkImageIconSetData;
Packit Service fb6fa5
typedef struct _GtkImageAnimationData GtkImageAnimationData;
Packit Service fb6fa5
typedef struct _GtkImageIconNameData  GtkImageIconNameData;
Packit Service fb6fa5
typedef struct _GtkImageGIconData     GtkImageGIconData;
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImagePixmapData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GdkPixmap *pixmap;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageImageData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GdkImage *image;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImagePixbufData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GdkPixbuf *pixbuf;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageStockData
Packit Service fb6fa5
{
Packit Service fb6fa5
  gchar *stock_id;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageIconSetData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GtkIconSet *icon_set;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageAnimationData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GdkPixbufAnimation *anim;
Packit Service fb6fa5
  GdkPixbufAnimationIter *iter;
Packit Service fb6fa5
  guint frame_timeout;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageIconNameData
Packit Service fb6fa5
{
Packit Service fb6fa5
  gchar *icon_name;
Packit Service fb6fa5
  GdkPixbuf *pixbuf;
Packit Service fb6fa5
  guint theme_change_id;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageGIconData
Packit Service fb6fa5
{
Packit Service fb6fa5
  GIcon *icon;
Packit Service fb6fa5
  GdkPixbuf *pixbuf;
Packit Service fb6fa5
  guint theme_change_id;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * GtkImageType:
Packit Service fb6fa5
 * @GTK_IMAGE_EMPTY: there is no image displayed by the widget
Packit Service fb6fa5
 * @GTK_IMAGE_PIXMAP: the widget contains a #GdkPixmap
Packit Service fb6fa5
 * @GTK_IMAGE_IMAGE: the widget contains a #GdkImage
Packit Service fb6fa5
 * @GTK_IMAGE_PIXBUF: the widget contains a #GdkPixbuf
Packit Service fb6fa5
 * @GTK_IMAGE_STOCK: the widget contains a stock icon name (see <xref linkend="gtk-Stock-Items"/>)
Packit Service fb6fa5
 * @GTK_IMAGE_ICON_SET: the widget contains a #GtkIconSet
Packit Service fb6fa5
 * @GTK_IMAGE_ANIMATION: the widget contains a #GdkPixbufAnimation
Packit Service fb6fa5
 * @GTK_IMAGE_ICON_NAME: the widget contains a named icon.
Packit Service fb6fa5
 *  This image type was added in GTK+ 2.6
Packit Service fb6fa5
 * @GTK_IMAGE_GICON: the widget contains a #GIcon.
Packit Service fb6fa5
 *  This image type was added in GTK+ 2.14
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Describes the image data representation used by a #GtkImage. If you
Packit Service fb6fa5
 * want to get the image from the widget, you can only get the
Packit Service fb6fa5
 * currently-stored representation. e.g.  if the
Packit Service fb6fa5
 * gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can
Packit Service fb6fa5
 * call gtk_image_get_pixbuf() but not gtk_image_get_stock().  For empty
Packit Service fb6fa5
 * images, you can request any storage type (call any of the "get"
Packit Service fb6fa5
 * functions), but they will all return %NULL values.
Packit Service fb6fa5
 */
Packit Service fb6fa5
typedef enum
Packit Service fb6fa5
{
Packit Service fb6fa5
  GTK_IMAGE_EMPTY,
Packit Service fb6fa5
  GTK_IMAGE_PIXMAP,
Packit Service fb6fa5
  GTK_IMAGE_IMAGE,
Packit Service fb6fa5
  GTK_IMAGE_PIXBUF,
Packit Service fb6fa5
  GTK_IMAGE_STOCK,
Packit Service fb6fa5
  GTK_IMAGE_ICON_SET,
Packit Service fb6fa5
  GTK_IMAGE_ANIMATION,
Packit Service fb6fa5
  GTK_IMAGE_ICON_NAME,
Packit Service fb6fa5
  GTK_IMAGE_GICON
Packit Service fb6fa5
} GtkImageType;
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * GtkImage:
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This struct contain private data only and should be accessed by the functions
Packit Service fb6fa5
 * below.
Packit Service fb6fa5
 */
Packit Service fb6fa5
struct _GtkImage
Packit Service fb6fa5
{
Packit Service fb6fa5
  GtkMisc misc;
Packit Service fb6fa5
Packit Service fb6fa5
  GtkImageType GSEAL (storage_type);
Packit Service fb6fa5
  
Packit Service fb6fa5
  union
Packit Service fb6fa5
  {
Packit Service fb6fa5
    GtkImagePixmapData pixmap;
Packit Service fb6fa5
    GtkImageImageData image;
Packit Service fb6fa5
    GtkImagePixbufData pixbuf;
Packit Service fb6fa5
    GtkImageStockData stock;
Packit Service fb6fa5
    GtkImageIconSetData icon_set;
Packit Service fb6fa5
    GtkImageAnimationData anim;
Packit Service fb6fa5
    GtkImageIconNameData name;
Packit Service fb6fa5
    GtkImageGIconData gicon;
Packit Service fb6fa5
  } GSEAL (data);
Packit Service fb6fa5
Packit Service fb6fa5
  /* Only used with GTK_IMAGE_PIXMAP, GTK_IMAGE_IMAGE */
Packit Service fb6fa5
  GdkBitmap *GSEAL (mask);
Packit Service fb6fa5
Packit Service fb6fa5
  /* Only used with GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET, GTK_IMAGE_ICON_NAME */
Packit Service fb6fa5
  GtkIconSize GSEAL (icon_size);
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkImageClass
Packit Service fb6fa5
{
Packit Service fb6fa5
  GtkMiscClass parent_class;
Packit Service fb6fa5
Packit Service fb6fa5
  /* Padding for future expansion */
Packit Service fb6fa5
  void (*_gtk_reserved1) (void);
Packit Service fb6fa5
  void (*_gtk_reserved2) (void);
Packit Service fb6fa5
  void (*_gtk_reserved3) (void);
Packit Service fb6fa5
  void (*_gtk_reserved4) (void);
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
#ifdef G_OS_WIN32
Packit Service fb6fa5
/* Reserve old names for DLL ABI backward compatibility */
Packit Service fb6fa5
#define gtk_image_new_from_file gtk_image_new_from_file_utf8
Packit Service fb6fa5
#define gtk_image_set_from_file gtk_image_set_from_file_utf8
Packit Service fb6fa5
#endif
Packit Service fb6fa5
Packit Service fb6fa5
GType      gtk_image_get_type (void) G_GNUC_CONST;
Packit Service fb6fa5
Packit Service fb6fa5
GtkWidget* gtk_image_new                (void);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_pixmap    (GdkPixmap       *pixmap,
Packit Service fb6fa5
                                         GdkBitmap       *mask);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_image     (GdkImage        *image,
Packit Service fb6fa5
                                         GdkBitmap       *mask);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_file      (const gchar     *filename);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_pixbuf    (GdkPixbuf       *pixbuf);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_stock     (const gchar     *stock_id,
Packit Service fb6fa5
                                         GtkIconSize      size);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_icon_set  (GtkIconSet      *icon_set,
Packit Service fb6fa5
                                         GtkIconSize      size);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_animation (GdkPixbufAnimation *animation);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_icon_name (const gchar     *icon_name,
Packit Service fb6fa5
					 GtkIconSize      size);
Packit Service fb6fa5
GtkWidget* gtk_image_new_from_gicon     (GIcon           *icon,
Packit Service fb6fa5
					 GtkIconSize      size);
Packit Service fb6fa5
Packit Service fb6fa5
void gtk_image_clear              (GtkImage        *image);
Packit Service fb6fa5
void gtk_image_set_from_pixmap    (GtkImage        *image,
Packit Service fb6fa5
                                   GdkPixmap       *pixmap,
Packit Service fb6fa5
                                   GdkBitmap       *mask);
Packit Service fb6fa5
void gtk_image_set_from_image     (GtkImage        *image,
Packit Service fb6fa5
                                   GdkImage        *gdk_image,
Packit Service fb6fa5
                                   GdkBitmap       *mask);
Packit Service fb6fa5
void gtk_image_set_from_file      (GtkImage        *image,
Packit Service fb6fa5
                                   const gchar     *filename);
Packit Service fb6fa5
void gtk_image_set_from_pixbuf    (GtkImage        *image,
Packit Service fb6fa5
                                   GdkPixbuf       *pixbuf);
Packit Service fb6fa5
void gtk_image_set_from_stock     (GtkImage        *image,
Packit Service fb6fa5
                                   const gchar     *stock_id,
Packit Service fb6fa5
                                   GtkIconSize      size);
Packit Service fb6fa5
void gtk_image_set_from_icon_set  (GtkImage        *image,
Packit Service fb6fa5
                                   GtkIconSet      *icon_set,
Packit Service fb6fa5
                                   GtkIconSize      size);
Packit Service fb6fa5
void gtk_image_set_from_animation (GtkImage           *image,
Packit Service fb6fa5
                                   GdkPixbufAnimation *animation);
Packit Service fb6fa5
void gtk_image_set_from_icon_name (GtkImage        *image,
Packit Service fb6fa5
				   const gchar     *icon_name,
Packit Service fb6fa5
				   GtkIconSize      size);
Packit Service fb6fa5
void gtk_image_set_from_gicon     (GtkImage        *image,
Packit Service fb6fa5
				   GIcon           *icon,
Packit Service fb6fa5
				   GtkIconSize      size);
Packit Service fb6fa5
void gtk_image_set_pixel_size     (GtkImage        *image,
Packit Service fb6fa5
				   gint             pixel_size);
Packit Service fb6fa5
Packit Service fb6fa5
GtkImageType gtk_image_get_storage_type (GtkImage   *image);
Packit Service fb6fa5
Packit Service fb6fa5
void       gtk_image_get_pixmap   (GtkImage         *image,
Packit Service fb6fa5
                                   GdkPixmap       **pixmap,
Packit Service fb6fa5
                                   GdkBitmap       **mask);
Packit Service fb6fa5
void       gtk_image_get_image    (GtkImage         *image,
Packit Service fb6fa5
                                   GdkImage        **gdk_image,
Packit Service fb6fa5
                                   GdkBitmap       **mask);
Packit Service fb6fa5
GdkPixbuf* gtk_image_get_pixbuf   (GtkImage         *image);
Packit Service fb6fa5
void       gtk_image_get_stock    (GtkImage         *image,
Packit Service fb6fa5
                                   gchar           **stock_id,
Packit Service fb6fa5
                                   GtkIconSize      *size);
Packit Service fb6fa5
void       gtk_image_get_icon_set (GtkImage         *image,
Packit Service fb6fa5
                                   GtkIconSet      **icon_set,
Packit Service fb6fa5
                                   GtkIconSize      *size);
Packit Service fb6fa5
GdkPixbufAnimation* gtk_image_get_animation (GtkImage *image);
Packit Service fb6fa5
void       gtk_image_get_icon_name (GtkImage              *image,
Packit Service fb6fa5
				    const gchar          **icon_name,
Packit Service fb6fa5
				    GtkIconSize           *size);
Packit Service fb6fa5
void       gtk_image_get_gicon     (GtkImage              *image,
Packit Service fb6fa5
				    GIcon                **gicon,
Packit Service fb6fa5
				    GtkIconSize           *size);
Packit Service fb6fa5
gint       gtk_image_get_pixel_size (GtkImage             *image);
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef GTK_DISABLE_DEPRECATED
Packit Service fb6fa5
/* These three are deprecated */
Packit Service fb6fa5
Packit Service fb6fa5
void       gtk_image_set      (GtkImage   *image,
Packit Service fb6fa5
			       GdkImage   *val,
Packit Service fb6fa5
			       GdkBitmap  *mask);
Packit Service fb6fa5
void       gtk_image_get      (GtkImage   *image,
Packit Service fb6fa5
			       GdkImage  **val,
Packit Service fb6fa5
			       GdkBitmap **mask);
Packit Service fb6fa5
#endif /* GTK_DISABLE_DEPRECATED */
Packit Service fb6fa5
Packit Service fb6fa5
G_END_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* __GTK_IMAGE_H__ */