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

« back to all changes in this revision

Viewing changes to include/gtkmm-2.4/gtkmm/bin.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 _GTKMM_BIN_H
 
4
#define _GTKMM_BIN_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: bin.hg,v 1.2 2003/03/03 07:49:05 murrayc Exp $ */
 
10
 
 
11
/* bin.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 <gtkmm/container.h>
 
31
 
 
32
 
 
33
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
34
typedef struct _GtkBin GtkBin;
 
35
typedef struct _GtkBinClass GtkBinClass;
 
36
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
37
 
 
38
 
 
39
namespace Gtk
 
40
{ class Bin_Class; } // namespace Gtk
 
41
namespace Gtk
 
42
{
 
43
 
 
44
/** A container with just one child.
 
45
 *
 
46
 * This is an abstract base class from which all classes holding
 
47
 * up to 1 widget inside of them derive.  It provides access to methods
 
48
 * relevent to a single object, such as add_label, add_pixmap, etc.
 
49
 *
 
50
 * @ingroup Widgets
 
51
 */
 
52
 
 
53
class Bin : public Container
 
54
{
 
55
  public:
 
56
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
57
  typedef Bin CppObjectType;
 
58
  typedef Bin_Class CppClassType;
 
59
  typedef GtkBin BaseObjectType;
 
60
  typedef GtkBinClass BaseClassType;
 
61
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
62
 
 
63
  virtual ~Bin();
 
64
 
 
65
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
66
 
 
67
private:
 
68
  friend class Bin_Class;
 
69
  static CppClassType bin_class_;
 
70
 
 
71
  // noncopyable
 
72
  Bin(const Bin&);
 
73
  Bin& operator=(const Bin&);
 
74
 
 
75
protected:
 
76
  explicit Bin(const Glib::ConstructParams& construct_params);
 
77
  explicit Bin(GtkBin* castitem);
 
78
 
 
79
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
80
 
 
81
public:
 
82
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
83
  static GType get_type()      G_GNUC_CONST;
 
84
 
 
85
 
 
86
  static GType get_base_type() G_GNUC_CONST;
 
87
#endif
 
88
 
 
89
  ///Provides access to the underlying C GtkObject.
 
90
  GtkBin*       gobj()       { return reinterpret_cast<GtkBin*>(gobject_); }
 
91
 
 
92
  ///Provides access to the underlying C GtkObject.
 
93
  const GtkBin* gobj() const { return reinterpret_cast<GtkBin*>(gobject_); }
 
94
 
 
95
 
 
96
public:
 
97
  //C++ methods used to invoke GTK+ virtual functions:
 
98
 
 
99
protected:
 
100
  //GTK+ Virtual Functions (override these to change behaviour):
 
101
 
 
102
  //Default Signal Handlers::
 
103
 
 
104
 
 
105
private:
 
106
 
 
107
protected:
 
108
 
 
109
  /** This constructor is protected because only derived
 
110
   * classes should be instantiated.
 
111
   */
 
112
  Bin();
 
113
public:
 
114
 
 
115
  
 
116
  /** Gets the child of the Gtk::Bin, or <tt>0</tt> if the bin contains
 
117
   * no child widget. The returned widget does not have a reference
 
118
   * added, so you do not need to unref it.
 
119
   * @return Pointer to child of the Gtk::Bin.
 
120
   */
 
121
  Gtk::Widget* get_child();
 
122
  
 
123
  /** Gets the child of the Gtk::Bin, or <tt>0</tt> if the bin contains
 
124
   * no child widget. The returned widget does not have a reference
 
125
   * added, so you do not need to unref it.
 
126
   * @return Pointer to child of the Gtk::Bin.
 
127
   */
 
128
  const Gtk::Widget* get_child() const;
 
129
 
 
130
  /** Remove the contained object
 
131
   * Since this can only hold one object it is not necessary to
 
132
   * specify which object to remove like other containers.
 
133
   *
 
134
   * When calling remove() on a Gtk::ScrolledWindow this might not remove the
 
135
   * expected child directly, because Gtk::ScrolledWindow::add() sometimes creates a
 
136
   * Gtk::ViewPort child and places the widget in that.
 
137
   */
 
138
  void remove();
 
139
 
 
140
  //Convenience methods that don't correspond to GTK+ functions:
 
141
 
 
142
  /** Add a Label object.
 
143
   * This does not correspond to any GTK+ function and is provided purely for
 
144
   * convenience.
 
145
   * @param label The text for the label.
 
146
   * @param mnemonic If <tt>true</tt>, characters preceded by an underscore
 
147
   * (_) will be underlined and used as a keyboard accelerator (shortcut).
 
148
   * @param x_align The horizontal alignment of the text.  This ranges from
 
149
   * 0.0 (left aligned) to 1.0 (right aligned).
 
150
   * @param y_align The vertical alignment of the text.  This ranges from
 
151
   * 0.0 (top aligned) to 1.0 (bottom aligned).
 
152
   */
 
153
  void add_label(const Glib::ustring& label, bool mnemonic = false,
 
154
                 double x_align = 0.5, double y_align = 0.5);
 
155
 
 
156
  /** Add a Label object.
 
157
   * This does not correspond to any GTK+ function and is provided purely for
 
158
   * convenience.
 
159
   * @param label The label text.
 
160
   * @param mnemonic If <tt>true</tt>, characters preceded by an underscore
 
161
   * (_) will be underlined and used as a keyboard accelerator (shortcut).
 
162
   * @param x_align The horizontal alignment of the text.  For possible
 
163
   * values, see Gtk::AlignmentEnum.
 
164
   * @param y_align The vertical alignment of the text.  For possible
 
165
   * values, see Gtk::AlignmentEnum.
 
166
   */
 
167
  void add_label(const Glib::ustring& label, bool mnemonic,
 
168
                 AlignmentEnum x_align, AlignmentEnum y_align = ALIGN_CENTER);
 
169
 
 
170
  /** Add an Image object.
 
171
   * This does not correspond to any GTK+ function and is provided purely for
 
172
   * convenience.
 
173
   * This will create, manage, add, and show a new Image to this Bin.
 
174
   * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
 
175
   * @param mask A Glib::RefPtr to a Gdk::Bitmap.
 
176
   */
 
177
  void add_pixmap(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
 
178
                  const Glib::RefPtr<Gdk::Bitmap>& mask);
 
179
 
 
180
  /** Add Image and Label objects.
 
181
   * This does not correspond to any GTK+ function and is provided purely for
 
182
   * convenience.
 
183
   * This will create, manage, add, and show a new Image and Label (within an
 
184
   * HBox) to this Bin.
 
185
   * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
 
186
   * @param mask A Glib::RefPtr to a Gdk::Bitmap.
 
187
   * @param label The text for the label.
 
188
   * @param x_align The horizontal alignment of the text in the label.
 
189
   * @param y_align The vertical alignment of the text in the label.
 
190
   */
 
191
  void add_pixlabel(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
 
192
                    const Glib::RefPtr<Gdk::Bitmap>& mask,
 
193
                    const Glib::ustring& label,
 
194
                                double x_align = 0.5, double y_align = 0.5);
 
195
 
 
196
  /** Add Image and Label objects.
 
197
   * This does not correspond to any GTK+ function and is provided purely for
 
198
   * convenience.
 
199
   * This will create, manage, add, and show a new Image and Label (within an
 
200
   * HBox) to this Bin.
 
201
   * @param pixfile The path to a file to be displayed.
 
202
   * @param label The text for the label.
 
203
   * @param x_align The horizontal alignment of the text in the label.
 
204
   * @param y_align The vertical alignment of the text in the label.
 
205
   */
 
206
  void add_pixlabel(const Glib::ustring& pixfile,
 
207
                    const Glib::ustring& label,
 
208
                                double x_align = 0.5, double y_align = 0.5);
 
209
 
 
210
 
 
211
};
 
212
 
 
213
}  /* namespace Gtk */
 
214
 
 
215
 
 
216
namespace Glib
 
217
{
 
218
  /** A Glib::wrap() method for this object.
 
219
   * 
 
220
   * @param object The C instance.
 
221
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
222
   * @result A C++ instance that wraps this C instance.
 
223
   *
 
224
   * @relates Gtk::Bin
 
225
   */
 
226
  Gtk::Bin* wrap(GtkBin* object, bool take_copy = false);
 
227
} //namespace Glib
 
228
 
 
229
 
 
230
#endif /* _GTKMM_BIN_H */
 
231