1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
5
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
#ifndef __GIMP_VIEWABLE_H__
23
#define __GIMP_VIEWABLE_H__
26
#include "gimpobject.h"
28
#include <gdk-pixbuf/gdk-pixbuf.h>
31
#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE 1024
32
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
33
#define GIMP_VIEWABLE_MAX_BUTTON_SIZE 64
34
#define GIMP_VIEWABLE_MAX_MENU_SIZE 48
37
#define GIMP_TYPE_VIEWABLE (gimp_viewable_get_type ())
38
#define GIMP_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEWABLE, GimpViewable))
39
#define GIMP_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEWABLE, GimpViewableClass))
40
#define GIMP_IS_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VIEWABLE))
41
#define GIMP_IS_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEWABLE))
42
#define GIMP_VIEWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEWABLE, GimpViewableClass))
45
typedef struct _GimpViewableClass GimpViewableClass;
49
GimpObject parent_instance;
55
struct _GimpViewableClass
57
GimpObjectClass parent_class;
59
const gchar *default_stock_id;
60
const gchar *name_changed_signal;
63
void (* invalidate_preview) (GimpViewable *viewable);
64
void (* size_changed) (GimpViewable *viewable);
66
/* virtual functions */
67
void (* get_preview_size) (GimpViewable *viewable,
73
gboolean (* get_popup_size) (GimpViewable *viewable,
79
TempBuf * (* get_preview) (GimpViewable *viewable,
82
TempBuf * (* get_new_preview) (GimpViewable *viewable,
85
GdkPixbuf * (* get_pixbuf) (GimpViewable *viewable,
88
GdkPixbuf * (* get_new_pixbuf) (GimpViewable *viewable,
91
gchar * (* get_description) (GimpViewable *viewable,
96
GType gimp_viewable_get_type (void) G_GNUC_CONST;
98
void gimp_viewable_invalidate_preview (GimpViewable *viewable);
99
void gimp_viewable_size_changed (GimpViewable *viewable);
101
void gimp_viewable_calc_preview_size (gint aspect_width,
105
gboolean dot_for_dot,
110
gboolean *scaling_up);
112
void gimp_viewable_get_preview_size (GimpViewable *viewable,
115
gboolean dot_for_dot,
118
gboolean gimp_viewable_get_popup_size (GimpViewable *viewable,
121
gboolean dot_for_dot,
125
TempBuf * gimp_viewable_get_preview (GimpViewable *viewable,
128
TempBuf * gimp_viewable_get_new_preview (GimpViewable *viewable,
132
TempBuf * gimp_viewable_get_dummy_preview (GimpViewable *viewable,
137
GdkPixbuf * gimp_viewable_get_pixbuf (GimpViewable *viewable,
140
GdkPixbuf * gimp_viewable_get_new_pixbuf (GimpViewable *viewable,
144
GdkPixbuf * gimp_viewable_get_dummy_pixbuf (GimpViewable *viewable,
149
gchar * gimp_viewable_get_description (GimpViewable *viewable,
152
const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
153
void gimp_viewable_set_stock_id (GimpViewable *viewable,
154
const gchar *stock_id);
157
#endif /* __GIMP_VIEWABLE_H__ */