~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gdk/gdkmm/pixbufanimationiter.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GDKMM_PIXBUFANIMATIONITER_H
 
4
#define _GDKMM_PIXBUFANIMATIONITER_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: pixbufanimationiter.hg,v 1.2 2004/04/12 11:04:05 murrayc Exp $ */
 
10
 
 
11
/* pixbufanimationiter.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/pixbuf.h>
 
32
#include <gdk-pixbuf/gdk-pixbuf.h>
 
33
 
 
34
 
 
35
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
36
typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
 
37
typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
 
38
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
39
 
 
40
 
 
41
namespace Gdk
 
42
{ class PixbufAnimationIter_Class; } // namespace Gdk
 
43
namespace Gdk
 
44
{
 
45
 
 
46
 
 
47
/** An iterator which points to a certain position in a PixbufAnimation.
 
48
 */
 
49
 
 
50
class PixbufAnimationIter : public Glib::Object
 
51
{
 
52
  
 
53
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
54
 
 
55
public:
 
56
  typedef PixbufAnimationIter CppObjectType;
 
57
  typedef PixbufAnimationIter_Class CppClassType;
 
58
  typedef GdkPixbufAnimationIter BaseObjectType;
 
59
  typedef GdkPixbufAnimationIterClass BaseClassType;
 
60
 
 
61
private:  friend class PixbufAnimationIter_Class;
 
62
  static CppClassType pixbufanimationiter_class_;
 
63
 
 
64
private:
 
65
  // noncopyable
 
66
  PixbufAnimationIter(const PixbufAnimationIter&);
 
67
  PixbufAnimationIter& operator=(const PixbufAnimationIter&);
 
68
 
 
69
protected:
 
70
  explicit PixbufAnimationIter(const Glib::ConstructParams& construct_params);
 
71
  explicit PixbufAnimationIter(GdkPixbufAnimationIter* castitem);
 
72
 
 
73
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
74
 
 
75
public:
 
76
  virtual ~PixbufAnimationIter();
 
77
 
 
78
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
79
  static GType get_type()      G_GNUC_CONST;
 
80
 
 
81
 
 
82
  static GType get_base_type() G_GNUC_CONST;
 
83
#endif
 
84
 
 
85
  ///Provides access to the underlying C GObject.
 
86
  GdkPixbufAnimationIter*       gobj()       { return reinterpret_cast<GdkPixbufAnimationIter*>(gobject_); }
 
87
 
 
88
  ///Provides access to the underlying C GObject.
 
89
  const GdkPixbufAnimationIter* gobj() const { return reinterpret_cast<GdkPixbufAnimationIter*>(gobject_); }
 
90
 
 
91
  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
92
  GdkPixbufAnimationIter* gobj_copy();
 
93
 
 
94
private:
 
95
 
 
96
protected:
 
97
 
 
98
  //A constructor (if any) would go here, protected.
 
99
 
 
100
public:
 
101
  
 
102
  /** Gets the number of milliseconds the current pixbuf should be displayed,
 
103
   * or -1 if the current pixbuf should be displayed forever. Glib::signal_timeout.connect()
 
104
   * conveniently takes a timeout in milliseconds, so you can use a timeout
 
105
   * to schedule the next update.
 
106
   * 
 
107
   * @newin{2,14}
 
108
   * @return Delay time in milliseconds (thousandths of a second).
 
109
   */
 
110
  int get_delay_time() const;
 
111
 
 
112
  
 
113
  /** Gets the current pixbuf which should be displayed; the pixbuf will
 
114
   * be the same size as the animation itself
 
115
   * (Gdk::Pixbuf::get_width(), Gdk::Pixbuf:get_height()). 
 
116
   * This pixbuf should be displayed for get_delay_time() milliseconds. 
 
117
   * The returned pixbuf will become invalid when the iterator advances
 
118
   * to the next frame, which may happen anytime you call
 
119
   * advance(). Copy the pixbuf to keep it, with 
 
120
   * Gdk::Pixbuf::copy() as it may get recycled as you advance the iterator.
 
121
   * 
 
122
   * @newin{2,14}
 
123
   * @return The pixbuf to be displayed.
 
124
   */
 
125
  Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
 
126
  
 
127
  /** Gets the current pixbuf which should be displayed; the pixbuf will
 
128
   * be the same size as the animation itself
 
129
   * (Gdk::Pixbuf::get_width(), Gdk::Pixbuf:get_height()). 
 
130
   * This pixbuf should be displayed for get_delay_time() milliseconds. 
 
131
   * The returned pixbuf will become invalid when the iterator advances
 
132
   * to the next frame, which may happen anytime you call
 
133
   * advance(). Copy the pixbuf to keep it, with 
 
134
   * Gdk::Pixbuf::copy() as it may get recycled as you advance the iterator.
 
135
   * 
 
136
   * @newin{2,14}
 
137
   * @return The pixbuf to be displayed.
 
138
   */
 
139
  Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
 
140
 
 
141
  
 
142
  /** Used to determine how to respond to the area_updated signal on
 
143
   * Gdk::PixbufLoader when loading an animation. The area_updated signal is emitted
 
144
   * for an area of the frame currently streaming in to the loader. So if
 
145
   * you're on the currently loading frame, you need to redraw the screen for
 
146
   * the updated area.
 
147
   * 
 
148
   * @newin{2,14}
 
149
   * @return <tt>true</tt> if the frame we're on is partially loaded, or the last frame.
 
150
   */
 
151
  bool on_currently_loading_frame() const;
 
152
 
 
153
 
 
154
  /** Possibly advances an animation to a new frame. Chooses the frame based
 
155
   * on the start time passed to Gdk::PixbufAnimation::get_iter().
 
156
   * 
 
157
   *  @a current_time would normally come from Glib::get_current_time(), and
 
158
   * must be greater than or equal to the time passed to
 
159
   * Gdk::PixbufAnimation::get_iter(), and must increase or remain
 
160
   * unchanged each time get_pixbuf() is
 
161
   * called. That is, you can't go backward in time; animations only
 
162
   * play forward.
 
163
   * 
 
164
   * If using the method overload that takes no current_time parameter then the 
 
165
   * current time will be used. So you only need to explicitly pass
 
166
   *  @a current_time if you're doing something odd like playing the animation
 
167
   * at double speed.
 
168
   * 
 
169
   * If this function returns <tt>false</tt>, there's no need to update the animation
 
170
   * display, assuming the display had been rendered prior to advancing;
 
171
   * if <tt>true</tt>, you need to call get_pixbuf() and update the
 
172
   * display with the new pixbuf.
 
173
   * 
 
174
   * @newin{2,14}
 
175
   * @param current_time Current time.
 
176
   * @return <tt>true</tt> if the image may need updating.
 
177
   */
 
178
  bool advance(const Glib::TimeVal& current_time);
 
179
  
 
180
  /** Possibly advances an animation to a new frame. Chooses the frame based
 
181
   * on the start time passed to Gdk::PixbufAnimation::get_iter().
 
182
   * 
 
183
   * If this function returns false, there's no need to update the animation
 
184
   * display, assuming the display had been rendered prior to advancing;
 
185
   * if true, you need to call get_pixbuf() and update the
 
186
   * display with the new pixbuf.
 
187
   *
 
188
   * @newin{2,14}
 
189
   *
 
190
   * @return true if the image may need updating.
 
191
   */
 
192
  bool advance();
 
193
 
 
194
 
 
195
public:
 
196
 
 
197
public:
 
198
  //C++ methods used to invoke GTK+ virtual functions:
 
199
 
 
200
protected:
 
201
  //GTK+ Virtual Functions (override these to change behaviour):
 
202
 
 
203
  //Default Signal Handlers::
 
204
 
 
205
 
 
206
};
 
207
 
 
208
} /* namespace Gdk */
 
209
 
 
210
 
 
211
namespace Glib
 
212
{
 
213
  /** A Glib::wrap() method for this object.
 
214
   * 
 
215
   * @param object The C instance.
 
216
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
217
   * @result A C++ instance that wraps this C instance.
 
218
   *
 
219
   * @relates Gdk::PixbufAnimationIter
 
220
   */
 
221
  Glib::RefPtr<Gdk::PixbufAnimationIter> wrap(GdkPixbufAnimationIter* object, bool take_copy = false);
 
222
}
 
223
 
 
224
 
 
225
#endif /* _GDKMM_PIXBUFANIMATIONITER_H */
 
226