~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to include/gdkmm-2.4/gdkmm/image.h

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GDKMM_IMAGE_H
 
4
#define _GDKMM_IMAGE_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: image.hg,v 1.5 2006/04/12 11:11:24 murrayc Exp $ */
 
10
 
 
11
/* bitmap.h
 
12
 *
 
13
 * Copyright (C) 1998-2002 The gtkmm Development Team
 
14
 *
 
15
 * This library is free software; you can redistribute it and/or
 
16
 * modify it under the terms of the GNU Lesser General Public
 
17
 * License as published by the Free Software Foundation; either
 
18
 * version 2.1 of the License, or (at your option) any later version.
 
19
 *
 
20
 * This library is distributed in the hope that it will be useful,
 
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
23
 * Lesser General Public License for more details.
 
24
 *
 
25
 * You should have received a copy of the GNU Lesser General Public
 
26
 * License along with this library; if not, write to the Free
 
27
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
28
 */
 
29
 
 
30
#include <glibmm/object.h>
 
31
#include <gdkmm/visual.h>
 
32
#include <gdkmm/colormap.h>
 
33
#include <gdkmm/types.h> //For ByteOrder.
 
34
 
 
35
 
 
36
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
37
typedef struct _GdkImage GdkImage;
 
38
typedef struct _GdkImageClass GdkImageClass;
 
39
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
40
 
 
41
 
 
42
namespace Gdk
 
43
{ class Image_Class; } // namespace Gdk
 
44
namespace Gdk
 
45
{
 
46
 
 
47
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
 
48
 
 
49
/**
 
50
 * @ingroup gdkmmEnums
 
51
 */
 
52
enum ImageType
 
53
{
 
54
  IMAGE_NORMAL,
 
55
  IMAGE_SHARED,
 
56
  IMAGE_FASTEST
 
57
};
 
58
 
 
59
} // namespace Gdk
 
60
 
 
61
 
 
62
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
63
namespace Glib
 
64
{
 
65
 
 
66
template <>
 
67
class Value<Gdk::ImageType> : public Glib::Value_Enum<Gdk::ImageType>
 
68
{
 
69
public:
 
70
  static GType value_type() G_GNUC_CONST;
 
71
};
 
72
 
 
73
} // namespace Glib
 
74
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
75
 
 
76
 
 
77
namespace Gdk
 
78
{
 
79
 
 
80
 
 
81
/** This represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible
 
82
 * Gdk::Drawable RGB functions.
 
83
 * To create an image from part of a Gdk::Window use Gdk::Drawable::get_image().
 
84
 *
 
85
 * The image can be manipulated with get_pixel() and put_pixel(), or alternatively by changing the actual pixel data, though
 
86
 * manipulating the pixel data requires complicated code to cope with the different formats that may be used.
 
87
 * To draw a Gdk::Image in a Gdk::Window or Gdk::Pixmap use Gdk::Drawable::draw_image().
 
88
 */
 
89
 
 
90
class Image : public Glib::Object
 
91
{
 
92
  
 
93
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
94
 
 
95
public:
 
96
  typedef Image CppObjectType;
 
97
  typedef Image_Class CppClassType;
 
98
  typedef GdkImage BaseObjectType;
 
99
  typedef GdkImageClass BaseClassType;
 
100
 
 
101
private:  friend class Image_Class;
 
102
  static CppClassType image_class_;
 
103
 
 
104
private:
 
105
  // noncopyable
 
106
  Image(const Image&);
 
107
  Image& operator=(const Image&);
 
108
 
 
109
protected:
 
110
  explicit Image(const Glib::ConstructParams& construct_params);
 
111
  explicit Image(GdkImage* castitem);
 
112
 
 
113
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
114
 
 
115
public:
 
116
  virtual ~Image();
 
117
 
 
118
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
119
  static GType get_type()      G_GNUC_CONST;
 
120
 
 
121
 
 
122
  static GType get_base_type() G_GNUC_CONST;
 
123
#endif
 
124
 
 
125
  ///Provides access to the underlying C GObject.
 
126
  GdkImage*       gobj()       { return reinterpret_cast<GdkImage*>(gobject_); }
 
127
 
 
128
  ///Provides access to the underlying C GObject.
 
129
  const GdkImage* gobj() const { return reinterpret_cast<GdkImage*>(gobject_); }
 
130
 
 
131
  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
132
  GdkImage* gobj_copy();
 
133
 
 
134
private:
 
135
 
 
136
  
 
137
protected:
 
138
 
 
139
  /** Instantiate a new Gdk::Image.
 
140
   *
 
141
   * @param type The type of the Gdk::Image. Gdk::IMAGE_FASTEST is probably the best choice, since it will try to create a Gdk::IMAGE_SHARED image first and if that fails it will then use Gdk::IMAGE_NORMAL.
 
142
   * @param visual The Gdk::Visual to use for the image.
 
143
   * @param width The width of the image in pixels.
 
144
   * @param height The height of the image in pixels.
 
145
   */
 
146
  Image(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height);
 
147
  
 
148
 
 
149
public:
 
150
  
 
151
  static Glib::RefPtr<Image> create(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height);
 
152
 
 
153
 
 
154
  //We ignore gdk_image_new_bitmap() because the documentation says that it is deprecated.
 
155
  
 
156
 
 
157
  void put_pixel(int x, int y, guint32 pixel);
 
158
  
 
159
  guint32 get_pixel(int x, int y) const;
 
160
  
 
161
  /** Sets the colormap for the image to the given colormap.  Normally
 
162
   * there's no need to use this function, images are created with the
 
163
   * correct colormap if you get the image from a drawable. If you
 
164
   * create the image from scratch, use the colormap of the drawable you
 
165
   * intend to render the image to.
 
166
   * 
 
167
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
168
   * @param colormap A Gdk::Colormap.
 
169
   */
 
170
  void set_colormap(const Glib::RefPtr<Colormap>& colormap);
 
171
  
 
172
  /** Retrieves the colormap for a given image, if it exists.  An image
 
173
   * will have a colormap if the drawable from which it was created has
 
174
   * a colormap, or if a colormap was set explicitely with
 
175
   * set_colormap().
 
176
   * 
 
177
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
178
   * @return Colormap for the image.
 
179
   */
 
180
  Glib::RefPtr<Colormap> get_colormap();
 
181
  
 
182
  /** Retrieves the colormap for a given image, if it exists.  An image
 
183
   * will have a colormap if the drawable from which it was created has
 
184
   * a colormap, or if a colormap was set explicitely with
 
185
   * set_colormap().
 
186
   * 
 
187
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
188
   * @return Colormap for the image.
 
189
   */
 
190
  Glib::RefPtr<const Colormap> get_colormap() const;
 
191
 
 
192
  
 
193
  /** Determines the type of a given image.
 
194
   * 
 
195
   * @newin{2,22}
 
196
   * 
 
197
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
198
   * @return The Gdk::ImageType of the image.
 
199
   */
 
200
  ImageType get_image_type() const;
 
201
  
 
202
  /** Determines the visual that was used to create the image.
 
203
   * 
 
204
   * @newin{2,22}
 
205
   * 
 
206
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
207
   * @return A Gdk::Visual.
 
208
   */
 
209
  Glib::RefPtr<Visual> get_visual();
 
210
  
 
211
  /** Determines the visual that was used to create the image.
 
212
   * 
 
213
   * @newin{2,22}
 
214
   * 
 
215
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
216
   * @return A Gdk::Visual.
 
217
   */
 
218
  Glib::RefPtr<const Visual> get_visual() const;
 
219
  
 
220
  /** Determines the byte order of the image.
 
221
   * 
 
222
   * @newin{2,22}
 
223
   * 
 
224
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
225
   * @return A Gdk::Visual.
 
226
   */
 
227
  ByteOrder get_byte_order() const;
 
228
  
 
229
  /** Determines the width of the image.
 
230
   * 
 
231
   * @newin{2,22}
 
232
   * 
 
233
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
234
   * @return The width.
 
235
   */
 
236
  int get_width() const;
 
237
  
 
238
  /** Determines the height of the image.
 
239
   * 
 
240
   * @newin{2,22}
 
241
   * 
 
242
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
243
   * @return The height.
 
244
   */
 
245
  int get_height() const;
 
246
  
 
247
  /** Determines the depth of the image.
 
248
   * 
 
249
   * @newin{2,22}
 
250
   * 
 
251
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
252
   * @return The depth.
 
253
   */
 
254
  guint16 get_depth() const;
 
255
 
 
256
  
 
257
#ifndef GDKMM_DISABLE_DEPRECATED
 
258
 
 
259
  /** Determines the number of bytes per pixel of the image.
 
260
   * 
 
261
   * @newin{2,22}
 
262
   * 
 
263
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
264
   * @deprecated Use get_bytes_per_pixel()
 
265
   * @return The bytes per pixel.
 
266
   */
 
267
  guint16 get_bpp() const;
 
268
#endif // GDKMM_DISABLE_DEPRECATED
 
269
 
 
270
 
 
271
  /** Determines the number of bytes per pixel of the image.
 
272
   * 
 
273
   * @newin{2,22}
 
274
   * 
 
275
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
276
   * @return The bytes per pixel.
 
277
   */
 
278
  guint16 get_bytes_per_pixel() const;
 
279
 
 
280
  
 
281
#ifndef GDKMM_DISABLE_DEPRECATED
 
282
 
 
283
  /** Determines the number of bytes per line of the image.
 
284
   * 
 
285
   * @newin{2,22}
 
286
   * 
 
287
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
288
   * @deprecated Use get_bytes_per_line()
 
289
   * @return The bytes per line.
 
290
   */
 
291
  guint16 get_bpl() const;
 
292
#endif // GDKMM_DISABLE_DEPRECATED
 
293
 
 
294
 
 
295
  /** Determines the number of bytes per line of the image.
 
296
   * 
 
297
   * @newin{2,22}
 
298
   * 
 
299
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
300
   * @return The bytes per line.
 
301
   */
 
302
  guint16 get_bytes_per_line() const;
 
303
 
 
304
  
 
305
  /** Determines the number of bits per pixel of the image.
 
306
   * 
 
307
   * @newin{2,22}
 
308
   * 
 
309
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
310
   * @return The bits per pixel.
 
311
   */
 
312
  guint16 get_bits_per_pixel() const;
 
313
 
 
314
  
 
315
  /** Returns a pointer to the pixel data of the image.
 
316
   * 
 
317
   * @newin{2,22}
 
318
   * 
 
319
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
320
   * @return The pixel data of the image.
 
321
   */
 
322
  void* get_pixels();
 
323
  
 
324
  /** Returns a pointer to the pixel data of the image.
 
325
   * 
 
326
   * @newin{2,22}
 
327
   * 
 
328
   * Deprecated: 2.22: Gdk::Image should not be used anymore.
 
329
   * @return The pixel data of the image.
 
330
   */
 
331
  const void* get_pixels() const;
 
332
 
 
333
#ifndef GDKMM_DISABLE_DEPRECATED
 
334
 
 
335
  //This memory block is not read-only, apparently:
 
336
  /** @deprecated Use get_pixels().
 
337
   */
 
338
   void* get_mem();
 
339
  const void* get_mem() const;
 
340
 #endif // GDKMM_DISABLE_DEPRECATED
 
341
 
 
342
 
 
343
  //TODO: This should be const really.
 
344
   void* get_windowing_data() const;
 
345
 
 
346
 
 
347
public:
 
348
 
 
349
public:
 
350
  //C++ methods used to invoke GTK+ virtual functions:
 
351
 
 
352
protected:
 
353
  //GTK+ Virtual Functions (override these to change behaviour):
 
354
 
 
355
  //Default Signal Handlers::
 
356
 
 
357
 
 
358
};
 
359
 
 
360
} /* namespace Gdk */
 
361
 
 
362
 
 
363
namespace Glib
 
364
{
 
365
  /** A Glib::wrap() method for this object.
 
366
   * 
 
367
   * @param object The C instance.
 
368
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
369
   * @result A C++ instance that wraps this C instance.
 
370
   *
 
371
   * @relates Gdk::Image
 
372
   */
 
373
  Glib::RefPtr<Gdk::Image> wrap(GdkImage* object, bool take_copy = false);
 
374
}
 
375
 
 
376
 
 
377
#endif /* _GDKMM_IMAGE_H */
 
378