2011-11-30 03:26:19 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 2011 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Authors: Cosimo Cecchi <cosimoc@gnome.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2011-11-30 03:26:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTK_ICON_HELPER_H__
|
|
|
|
#define __GTK_ICON_HELPER_H__
|
|
|
|
|
2015-11-21 16:38:48 +00:00
|
|
|
#include "gtk/gtkimage.h"
|
|
|
|
#include "gtk/gtktypes.h"
|
2011-11-30 03:26:19 +00:00
|
|
|
|
2015-12-09 13:01:46 +00:00
|
|
|
#include "gtkcssgadgetprivate.h"
|
2015-11-25 14:59:44 +00:00
|
|
|
#include "gtkimagedefinitionprivate.h"
|
|
|
|
|
2011-11-30 03:26:19 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2015-12-09 13:01:46 +00:00
|
|
|
#define GTK_TYPE_ICON_HELPER gtk_icon_helper_get_type()
|
2011-11-30 03:26:19 +00:00
|
|
|
|
|
|
|
#define GTK_ICON_HELPER(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
|
|
GTK_TYPE_ICON_HELPER, GtkIconHelper))
|
|
|
|
|
|
|
|
#define GTK_ICON_HELPER_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
|
|
GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
|
|
|
|
|
|
|
|
#define GTK_IS_ICON_HELPER(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
|
|
GTK_TYPE_ICON_HELPER))
|
|
|
|
|
|
|
|
#define GTK_IS_ICON_HELPER_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
|
|
GTK_TYPE_ICON_HELPER))
|
|
|
|
|
|
|
|
#define GTK_ICON_HELPER_GET_CLASS(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
|
|
GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
|
|
|
|
|
|
|
|
typedef struct _GtkIconHelper GtkIconHelper;
|
|
|
|
typedef struct _GtkIconHelperClass GtkIconHelperClass;
|
|
|
|
typedef struct _GtkIconHelperPrivate GtkIconHelperPrivate;
|
|
|
|
|
|
|
|
struct _GtkIconHelper
|
|
|
|
{
|
2015-12-09 13:01:46 +00:00
|
|
|
GtkCssGadget parent;
|
2011-11-30 03:26:19 +00:00
|
|
|
|
|
|
|
GtkIconHelperPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkIconHelperClass
|
|
|
|
{
|
2015-12-09 13:01:46 +00:00
|
|
|
GtkCssGadgetClass parent_class;
|
2011-11-30 03:26:19 +00:00
|
|
|
};
|
|
|
|
|
2015-12-09 13:01:46 +00:00
|
|
|
GType gtk_icon_helper_get_type (void) G_GNUC_CONST;
|
2011-11-30 03:26:19 +00:00
|
|
|
|
2015-12-09 17:25:36 +00:00
|
|
|
GtkIconHelper *gtk_icon_helper_new (GtkCssNode *node,
|
|
|
|
GtkWidget *owner);
|
2015-12-14 03:00:31 +00:00
|
|
|
GtkCssGadget *gtk_icon_helper_new_named (const char *name,
|
|
|
|
GtkWidget *owner);
|
2011-11-30 03:26:19 +00:00
|
|
|
|
|
|
|
void _gtk_icon_helper_clear (GtkIconHelper *self);
|
|
|
|
|
|
|
|
gboolean _gtk_icon_helper_get_is_empty (GtkIconHelper *self);
|
|
|
|
|
2015-11-25 14:59:44 +00:00
|
|
|
void _gtk_icon_helper_set_definition (GtkIconHelper *self,
|
|
|
|
GtkImageDefinition *def);
|
2011-11-30 03:26:19 +00:00
|
|
|
void _gtk_icon_helper_set_gicon (GtkIconHelper *self,
|
|
|
|
GIcon *gicon,
|
|
|
|
GtkIconSize icon_size);
|
|
|
|
void _gtk_icon_helper_set_pixbuf (GtkIconHelper *self,
|
2013-06-24 12:13:43 +00:00
|
|
|
GdkPixbuf *pixbuf);
|
|
|
|
void _gtk_icon_helper_set_pixbuf_scale (GtkIconHelper *self,
|
|
|
|
int scale);
|
2011-11-30 03:26:19 +00:00
|
|
|
void _gtk_icon_helper_set_animation (GtkIconHelper *self,
|
|
|
|
GdkPixbufAnimation *animation);
|
|
|
|
void _gtk_icon_helper_set_icon_set (GtkIconHelper *self,
|
|
|
|
GtkIconSet *icon_set,
|
|
|
|
GtkIconSize icon_size);
|
|
|
|
|
|
|
|
void _gtk_icon_helper_set_icon_name (GtkIconHelper *self,
|
|
|
|
const gchar *icon_name,
|
|
|
|
GtkIconSize icon_size);
|
|
|
|
void _gtk_icon_helper_set_stock_id (GtkIconHelper *self,
|
|
|
|
const gchar *stock_id,
|
|
|
|
GtkIconSize icon_size);
|
2013-06-24 12:13:43 +00:00
|
|
|
void _gtk_icon_helper_set_surface (GtkIconHelper *self,
|
|
|
|
cairo_surface_t *surface);
|
2011-11-30 03:26:19 +00:00
|
|
|
|
2014-06-09 12:58:05 +00:00
|
|
|
gboolean _gtk_icon_helper_set_icon_size (GtkIconHelper *self,
|
|
|
|
GtkIconSize icon_size);
|
|
|
|
gboolean _gtk_icon_helper_set_pixel_size (GtkIconHelper *self,
|
|
|
|
gint pixel_size);
|
|
|
|
gboolean _gtk_icon_helper_set_use_fallback (GtkIconHelper *self,
|
|
|
|
gboolean use_fallback);
|
2011-11-30 03:26:19 +00:00
|
|
|
|
|
|
|
GtkImageType _gtk_icon_helper_get_storage_type (GtkIconHelper *self);
|
|
|
|
GtkIconSize _gtk_icon_helper_get_icon_size (GtkIconHelper *self);
|
|
|
|
gint _gtk_icon_helper_get_pixel_size (GtkIconHelper *self);
|
|
|
|
gboolean _gtk_icon_helper_get_use_fallback (GtkIconHelper *self);
|
|
|
|
|
|
|
|
GdkPixbuf *_gtk_icon_helper_peek_pixbuf (GtkIconHelper *self);
|
|
|
|
GIcon *_gtk_icon_helper_peek_gicon (GtkIconHelper *self);
|
|
|
|
GtkIconSet *_gtk_icon_helper_peek_icon_set (GtkIconHelper *self);
|
|
|
|
GdkPixbufAnimation *_gtk_icon_helper_peek_animation (GtkIconHelper *self);
|
2013-06-24 12:13:43 +00:00
|
|
|
cairo_surface_t *_gtk_icon_helper_peek_surface (GtkIconHelper *self);
|
2011-11-30 03:26:19 +00:00
|
|
|
|
2015-12-01 01:25:17 +00:00
|
|
|
GtkImageDefinition *gtk_icon_helper_get_definition (GtkIconHelper *self);
|
2011-11-30 03:26:19 +00:00
|
|
|
const gchar *_gtk_icon_helper_get_stock_id (GtkIconHelper *self);
|
|
|
|
const gchar *_gtk_icon_helper_get_icon_name (GtkIconHelper *self);
|
|
|
|
|
2015-11-29 23:55:43 +00:00
|
|
|
cairo_surface_t *gtk_icon_helper_load_surface (GtkIconHelper *self,
|
2015-11-30 00:33:14 +00:00
|
|
|
int scale);
|
2011-11-30 03:26:19 +00:00
|
|
|
void _gtk_icon_helper_get_size (GtkIconHelper *self,
|
|
|
|
gint *width_out,
|
|
|
|
gint *height_out);
|
|
|
|
|
|
|
|
void _gtk_icon_helper_draw (GtkIconHelper *self,
|
|
|
|
cairo_t *cr,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y);
|
|
|
|
|
2012-07-13 13:54:29 +00:00
|
|
|
gboolean _gtk_icon_helper_get_force_scale_pixbuf (GtkIconHelper *self);
|
|
|
|
void _gtk_icon_helper_set_force_scale_pixbuf (GtkIconHelper *self,
|
|
|
|
gboolean force_scale);
|
|
|
|
|
2016-01-05 02:22:11 +00:00
|
|
|
void gtk_icon_helper_invalidate (GtkIconHelper *self);
|
2012-07-13 13:54:29 +00:00
|
|
|
|
2011-11-30 03:26:19 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_ICON_HELPER_H__ */
|