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

« back to all changes in this revision

Viewing changes to gtk/gtkmm/offscreenwindow.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 _GTKMM_OFFSCREENWINDOW_H
 
4
#define _GTKMM_OFFSCREENWINDOW_H
 
5
 
 
6
#include <gtkmmconfig.h>
 
7
 
 
8
 
 
9
#include <glibmm.h>
 
10
 
 
11
/*
 
12
 * Copyright (C) 2010 The gtkmm Development Team
 
13
 *
 
14
 * This library is free software; you can redistribute it and/or
 
15
 * modify it under the terms of the GNU Lesser General Public
 
16
 * License as published by the Free Software Foundation; either
 
17
 * version 2.1 of the License, or (at your option) any later version.
 
18
 *
 
19
 * This library is distributed in the hope that it will be useful,
 
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
22
 * Lesser General Public License for more details.
 
23
 *
 
24
 * You should have received a copy of the GNU Lesser General Public
 
25
 * License along with this library; if not, write to the Free
 
26
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
27
 */
 
28
 
 
29
 
 
30
#include <gtkmm/window.h>
 
31
 
 
32
 
 
33
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
34
typedef struct _GtkOffscreenWindow GtkOffscreenWindow;
 
35
typedef struct _GtkOffscreenWindowClass GtkOffscreenWindowClass;
 
36
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
37
 
 
38
 
 
39
namespace Gtk
 
40
{ class OffscreenWindow_Class; } // namespace Gtk
 
41
namespace Gtk
 
42
{
 
43
 
 
44
/** A top-level container widget used to manage offscreen rendering of child widgets.
 
45
 * OffscreenWindow is strictly intended to be used for obtaining
 
46
 * snapshots of widgets that are not part of a normal widget hierarchy.
 
47
 * It differs from Gtk::Widget::get_snapshot() in that the widget you
 
48
 * want to get a snapshot of need not be displayed on the user's screen
 
49
 * as a part of a widget hierarchy.  However, since OffscreenWindow
 
50
 * is a top-level widget you cannot obtain snapshots of a full window
 
51
 * with it since you cannot pack a toplevel widget in another toplevel.
 
52
 *
 
53
 * The idea is to take a widget and manually set the state of it,
 
54
 * add it to an OffscreenWindow and then retrieve the snapshot
 
55
 * as a Gdk::Pixbuf.
 
56
 *
 
57
 * OffscreenWindow derives from Window only as an implementation
 
58
 * detail.  Applications should not use any API specific to #GtkWindow
 
59
 * to operate on this object.  It should be treated as a Bin that
 
60
 * has no parent widget.
 
61
 *
 
62
 * When contained offscreen widgets are redrawn, OffscreenWindow
 
63
 * will emit a "damage-event" signal.
 
64
 *
 
65
 * @newin{2,20}
 
66
 * @ingroup Containers
 
67
 * @ingroup Widgets
 
68
 */
 
69
 
 
70
class OffscreenWindow : public Window
 
71
{
 
72
  public:
 
73
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
74
  typedef OffscreenWindow CppObjectType;
 
75
  typedef OffscreenWindow_Class CppClassType;
 
76
  typedef GtkOffscreenWindow BaseObjectType;
 
77
  typedef GtkOffscreenWindowClass BaseClassType;
 
78
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
79
 
 
80
  virtual ~OffscreenWindow();
 
81
 
 
82
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
83
 
 
84
private:
 
85
  friend class OffscreenWindow_Class;
 
86
  static CppClassType offscreenwindow_class_;
 
87
 
 
88
  // noncopyable
 
89
  OffscreenWindow(const OffscreenWindow&);
 
90
  OffscreenWindow& operator=(const OffscreenWindow&);
 
91
 
 
92
protected:
 
93
  explicit OffscreenWindow(const Glib::ConstructParams& construct_params);
 
94
  explicit OffscreenWindow(GtkOffscreenWindow* castitem);
 
95
 
 
96
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
97
 
 
98
public:
 
99
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
100
  static GType get_type()      G_GNUC_CONST;
 
101
 
 
102
 
 
103
  static GType get_base_type() G_GNUC_CONST;
 
104
#endif
 
105
 
 
106
  ///Provides access to the underlying C GtkObject.
 
107
  GtkOffscreenWindow*       gobj()       { return reinterpret_cast<GtkOffscreenWindow*>(gobject_); }
 
108
 
 
109
  ///Provides access to the underlying C GtkObject.
 
110
  const GtkOffscreenWindow* gobj() const { return reinterpret_cast<GtkOffscreenWindow*>(gobject_); }
 
111
 
 
112
 
 
113
public:
 
114
  //C++ methods used to invoke GTK+ virtual functions:
 
115
 
 
116
protected:
 
117
  //GTK+ Virtual Functions (override these to change behaviour):
 
118
 
 
119
  //Default Signal Handlers::
 
120
 
 
121
 
 
122
private:
 
123
 
 
124
  
 
125
public:
 
126
  OffscreenWindow();
 
127
 
 
128
  //TODO: Should this always be const?
 
129
 
 
130
 
 
131
  Cairo::RefPtr<Cairo::Surface> get_surface();
 
132
  
 
133
  Cairo::RefPtr<const Cairo::Surface> get_surface() const;
 
134
 
 
135
 
 
136
  /** Retrieves a snapshot of the contained widget in the form of
 
137
   * a Gdk::Pixbuf.  This is a new pixbuf with a reference count of 1,
 
138
   * and the application should unreference it once it is no longer
 
139
   * needed.
 
140
   * 
 
141
   * @newin{2,20}
 
142
   * @return A Gdk::Pixbuf pointer, or <tt>0</tt>.
 
143
   */
 
144
  Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
 
145
  
 
146
  /** Retrieves a snapshot of the contained widget in the form of
 
147
   * a Gdk::Pixbuf.  This is a new pixbuf with a reference count of 1,
 
148
   * and the application should unreference it once it is no longer
 
149
   * needed.
 
150
   * 
 
151
   * @newin{2,20}
 
152
   * @return A Gdk::Pixbuf pointer, or <tt>0</tt>.
 
153
   */
 
154
  Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
 
155
 
 
156
 
 
157
};
 
158
 
 
159
} // namespace Gtk
 
160
 
 
161
 
 
162
namespace Glib
 
163
{
 
164
  /** A Glib::wrap() method for this object.
 
165
   * 
 
166
   * @param object The C instance.
 
167
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
168
   * @result A C++ instance that wraps this C instance.
 
169
   *
 
170
   * @relates Gtk::OffscreenWindow
 
171
   */
 
172
  Gtk::OffscreenWindow* wrap(GtkOffscreenWindow* object, bool take_copy = false);
 
173
} //namespace Glib
 
174
 
 
175
 
 
176
#endif /* _GTKMM_OFFSCREENWINDOW_H */
 
177