~ubuntu-branches/ubuntu/breezy/gimp/breezy

« back to all changes in this revision

Viewing changes to app/core/gimpviewable.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-10-04 19:04:46 UTC
  • Revision ID: james.westby@ubuntu.com-20051004190446-ukh32kwk56s4sjhu
Tags: upstream-2.2.8
ImportĀ upstreamĀ versionĀ 2.2.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * gimpviewable.h
 
5
 * Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
20
 */
 
21
 
 
22
#ifndef __GIMP_VIEWABLE_H__
 
23
#define __GIMP_VIEWABLE_H__
 
24
 
 
25
 
 
26
#include "gimpobject.h"
 
27
 
 
28
#include <gdk-pixbuf/gdk-pixbuf.h>
 
29
 
 
30
 
 
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
 
35
 
 
36
 
 
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))
 
43
 
 
44
 
 
45
typedef struct _GimpViewableClass GimpViewableClass;
 
46
 
 
47
struct _GimpViewable
 
48
{
 
49
  GimpObject  parent_instance;
 
50
 
 
51
  /*<  private  >*/
 
52
  gchar      *stock_id;
 
53
};
 
54
 
 
55
struct _GimpViewableClass
 
56
{
 
57
  GimpObjectClass  parent_class;
 
58
 
 
59
  const gchar     *default_stock_id;
 
60
  const gchar     *name_changed_signal;
 
61
 
 
62
  /*  signals  */
 
63
  void        (* invalidate_preview) (GimpViewable  *viewable);
 
64
  void        (* size_changed)       (GimpViewable  *viewable);
 
65
 
 
66
  /*  virtual functions  */
 
67
  void        (* get_preview_size)   (GimpViewable  *viewable,
 
68
                                      gint           size,
 
69
                                      gboolean       is_popup,
 
70
                                      gboolean       dot_for_dot,
 
71
                                      gint          *width,
 
72
                                      gint          *height);
 
73
  gboolean    (* get_popup_size)     (GimpViewable  *viewable,
 
74
                                      gint           width,
 
75
                                      gint           height,
 
76
                                      gboolean       dot_for_dot,
 
77
                                      gint          *popup_width,
 
78
                                      gint          *popup_height);
 
79
  TempBuf   * (* get_preview)        (GimpViewable  *viewable,
 
80
                                      gint           width,
 
81
                                      gint           height);
 
82
  TempBuf   * (* get_new_preview)    (GimpViewable  *viewable,
 
83
                                      gint           width,
 
84
                                      gint           height);
 
85
  GdkPixbuf * (* get_pixbuf)         (GimpViewable  *viewable,
 
86
                                      gint           width,
 
87
                                      gint           height);
 
88
  GdkPixbuf * (* get_new_pixbuf)     (GimpViewable  *viewable,
 
89
                                      gint           width,
 
90
                                      gint           height);
 
91
  gchar     * (* get_description)    (GimpViewable  *viewable,
 
92
                                      gchar        **tooltip);
 
93
};
 
94
 
 
95
 
 
96
GType       gimp_viewable_get_type           (void) G_GNUC_CONST;
 
97
 
 
98
void        gimp_viewable_invalidate_preview (GimpViewable  *viewable);
 
99
void        gimp_viewable_size_changed       (GimpViewable  *viewable);
 
100
 
 
101
void        gimp_viewable_calc_preview_size  (gint           aspect_width,
 
102
                                              gint           aspect_height,
 
103
                                              gint           width,
 
104
                                              gint           height,
 
105
                                              gboolean       dot_for_dot,
 
106
                                              gdouble        xresolution,
 
107
                                              gdouble        yresolution,
 
108
                                              gint          *return_width,
 
109
                                              gint          *return_height,
 
110
                                              gboolean      *scaling_up);
 
111
 
 
112
void        gimp_viewable_get_preview_size   (GimpViewable  *viewable,
 
113
                                              gint           size,
 
114
                                              gboolean       popup,
 
115
                                              gboolean       dot_for_dot,
 
116
                                              gint          *width,
 
117
                                              gint          *height);
 
118
gboolean    gimp_viewable_get_popup_size     (GimpViewable  *viewable,
 
119
                                              gint           width,
 
120
                                              gint           height,
 
121
                                              gboolean       dot_for_dot,
 
122
                                              gint          *popup_width,
 
123
                                              gint          *popup_height);
 
124
 
 
125
TempBuf   * gimp_viewable_get_preview        (GimpViewable  *viewable,
 
126
                                              gint           width,
 
127
                                              gint           height);
 
128
TempBuf   * gimp_viewable_get_new_preview    (GimpViewable  *viewable,
 
129
                                              gint           width,
 
130
                                              gint           height);
 
131
 
 
132
TempBuf   * gimp_viewable_get_dummy_preview  (GimpViewable  *viewable,
 
133
                                              gint           width,
 
134
                                              gint           height,
 
135
                                              gint           bpp);
 
136
 
 
137
GdkPixbuf * gimp_viewable_get_pixbuf         (GimpViewable  *viewable,
 
138
                                              gint           width,
 
139
                                              gint           height);
 
140
GdkPixbuf * gimp_viewable_get_new_pixbuf     (GimpViewable  *viewable,
 
141
                                              gint           width,
 
142
                                              gint           height);
 
143
 
 
144
GdkPixbuf * gimp_viewable_get_dummy_pixbuf   (GimpViewable  *viewable,
 
145
                                              gint           width,
 
146
                                              gint           height,
 
147
                                              gint           bpp);
 
148
 
 
149
gchar     * gimp_viewable_get_description    (GimpViewable  *viewable,
 
150
                                              gchar        **tooltip);
 
151
 
 
152
const gchar * gimp_viewable_get_stock_id     (GimpViewable  *viewable);
 
153
void          gimp_viewable_set_stock_id     (GimpViewable  *viewable,
 
154
                                              const gchar   *stock_id);
 
155
 
 
156
 
 
157
#endif  /* __GIMP_VIEWABLE_H__ */