/usr/include/gtkmm-3.0/gtkmm/container.h is in libgtkmm-3.0-dev 3.10.1-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | // -*- c++ -*-
// Generated by gmmproc 2.38.0 -- DO NOT MODIFY!
#ifndef _GTKMM_CONTAINER_H
#define _GTKMM_CONTAINER_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vector>
#include <gtkmm/widget.h>
/** @defgroup Containers Container Widgets
* These widgets can be used to group other widgets together.
*/
/* we'll include gtkfeatures because we dont want to include the whole
gtk/gtk.h - this file is used by almost ALL our widgets, so dependencies
in minimum - adding things here will increase compile times ALOT */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GtkContainer GtkContainer;
typedef struct _GtkContainerClass GtkContainerClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gtk
{ class Container_Class; } // namespace Gtk
namespace Gtk
{
class Adjustment;
class Label;
/** Abstract container class
*
* This is the abstract container from which all gtk+ widgets which hold
* other items derive from. It mainly houses virtual functions
* used for inserting and removing children. Containers in gtk+
* may hold one item or many items depending on the implementation.
*
* This interface is used for all single item holding containers.
* Multi-item containers provide their own unique interface as their
* items are generally more complex. The methods of the derived
* classes should be prefered over these.
*
* @ingroup Widgets
*/
class Container : public Widget
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef Container CppObjectType;
typedef Container_Class CppClassType;
typedef GtkContainer BaseObjectType;
typedef GtkContainerClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
virtual ~Container();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
friend class Container_Class;
static CppClassType container_class_;
// noncopyable
Container(const Container&);
Container& operator=(const Container&);
protected:
explicit Container(const Glib::ConstructParams& construct_params);
explicit Container(GtkContainer* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
/** Get the GType for this class, for use with the underlying GObject type system.
*/
static GType get_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GtkObject.
GtkContainer* gobj() { return reinterpret_cast<GtkContainer*>(gobject_); }
///Provides access to the underlying C GtkObject.
const GtkContainer* gobj() const { return reinterpret_cast<GtkContainer*>(gobject_); }
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
/// This is a default handler for the signal signal_add().
virtual void on_add(Widget* widget);
/// This is a default handler for the signal signal_remove().
virtual void on_remove(Widget* widget);
/// This is a default handler for the signal signal_check_resize().
virtual void on_check_resize();
/// This is a default handler for the signal signal_set_focus_child().
virtual void on_set_focus_child(Widget* widget);
private:
public:
/* Application-level methods */
/** Sets the border width of the container.
*
* The border width of a container is the amount of space to leave
* around the outside of the container. The only exception to this is
* Gtk::Window; because toplevel windows can't leave space outside,
* they leave the space inside. The border is added on all sides of
* the container. To add space to only one side, one approach is to
* create a Gtk::Alignment widget, call Gtk::Widget::set_size_request()
* to give it a size, and place it on the side of the container as
* a spacer.
* @param border_width Amount of blank space to leave <em>outside</em>
* the container. Valid values are in the range 0-65535 pixels.
*/
void set_border_width(guint border_width);
/** Retrieves the border width of the container. See
* set_border_width().
* @return The current border width.
*/
guint get_border_width() const;
//This is virtual so that we can override it in Gtk::ScrolledWindow:
virtual void add(Widget& widget);
/** Removes @a widget from @a container. @a widget must be inside @a container.
* If @a widget is managed with Gtk::manage(), and you don't want to use @a widget
* again then you should delete @a widget, because there will no longer be any parent
* container to delete it automatically.
* @param widget A current child of @a container.
*/
void remove(Widget& widget);
/** Sets the resize mode for the container.
*
* The resize mode of a container determines whether a resize request
* will be passed to the container's parent, queued for later execution
* or executed immediately.
* @param resize_mode The new resize mode.
*/
void set_resize_mode(ResizeMode resize_mode);
/** Returns the resize mode for the container. See
* set_resize_mode().
* @return The current resize mode.
*/
ResizeMode get_resize_mode() const;
/** Request that contained widgets check their size
*/
void check_resize();
/** For instance,
* void on_foreach(Gtk::Widget* widget);
*/
typedef sigc::slot<void, Widget&> ForeachSlot;
/** Operate on contained items.
*
* Invokes the @a slot on each non-internal child of the container. See
* forall() for details on what constitutes an
* "internal" child. Most applications should use foreach()
* rather than forall().
*/
void foreach(const ForeachSlot& slot);
/** Operate on contained items, including internal children.
*
* Invokes the @ slot on each child of the container, including children
* that are considered "internal" (implementation details of the
* container). "Internal" children generally weren't added by the user
* of the container, but were added by the container implementation
* itself. Most applications should use foreach(),
* rather than forall().
*
* @newin{3,6}
*/
void forall(const ForeachSlot& slot);
/// (internal) Operate on contained items (see foreach())
//_WRAP_METHOD(void foreach_(GtkCallback callback,gpointer data),gtk_container_foreach)
/// (internal) Operate on contained items (see foreach())
//_WRAP_METHOD(void foreach_full_(GtkCallback callback,GtkCallbackMarshal marshal, gpointer data,GDestroyNotify notify),gtk_container_foreach_full)
/** Returns the container's non-internal children. See
* forall() for details on what constitutes an "internal" child.
* @return A newly-allocated list of the container's non-internal children.
*/
std::vector<Widget*> get_children();
/** Returns the container's non-internal children. See
* forall() for details on what constitutes an "internal" child.
* @return A newly-allocated list of the container's non-internal children.
*/
std::vector<const Widget*> get_children() const;
/** When a container receives a call to the draw function, it must send
* synthetic Gtk::Widget::signal_draw() calls to all children that don't have their
* own Gdk::Windows. This function provides a convenient way of doing this.
* A container, when it receives a call to its Gtk::Widget::signal_draw() function,
* calls propagate_draw() once for each child, passing in
* the @a cr the container received.
*
* propagate_draw() takes care of translating the origin of @a cr,
* and deciding whether the draw needs to be sent to the child. It is a
* convenient and optimized way of getting the same effect as calling
* Gtk::Widget::draw() on the child directly.
*
* In most cases, a container can simply either inherit the
* Gtk::Widget::signal_draw() implementation from Gtk::Container, or do some drawing
* and then chain to the signal_draw() implementation from Gtk::Container.
* @param child A child of @a container.
* @param cr Cairo context as passed to the container. If you want to use @a cr
* in container's draw function, consider using cairo_save() and
* cairo_restore() before calling this function.
*/
void propagate_draw(Widget& child, const ::Cairo::RefPtr< ::Cairo::Context>& cr);
/** Sets a focus chain, overriding the one computed automatically by GTK+.
*
* In principle each widget in the chain should be a descendant of the
* container, but this is not enforced by this method, since it's allowed
* to set the focus chain before you pack the widgets, or have a widget
* in the chain that isn't always packed. The necessary checks are done
* when the focus chain is actually traversed.
* @param focusable_widgets The new focus chain.
*/
void set_focus_chain(const std::vector<Widget*>& focusable_widgets);
// gtk_container_get_focus_chain() has been split up into two
// functions in order to make implicit container conversion possible.
bool has_focus_chain() const;
std::vector<Widget*> get_focus_chain();
std::vector<const Widget*> get_focus_chain() const;
/** Removes a focus chain explicitly set with set_focus_chain().
*/
void unset_focus_chain();
/* Widget-level methods */
/** Sets the @a reallocate_redraws flag of the container to the given value.
*
* Containers requesting reallocation redraws get automatically
* redrawn if any of their children changed allocation.
* @param needs_redraws The new value for the container's @a reallocate_redraws flag.
*/
void set_reallocate_redraws(bool needs_redraws = true);
/** Sets the focus on a child
*/
void set_focus_child(Widget& widget);
/** Returns the current focus child widget inside @a container. This is not the
* currently focused widget. That can be obtained by calling
* Gtk::Window::get_focus().
*
* @newin{2,14}
* @return The child widget which will receive the
* focus inside @a container when the @a conatiner is focussed,
* or <tt>0</tt> if none is set.
*/
Widget* get_focus_child();
/** Returns the current focus child widget inside @a container. This is not the
* currently focused widget. That can be obtained by calling
* Gtk::Window::get_focus().
*
* @newin{2,14}
* @return The child widget which will receive the
* focus inside @a container when the @a conatiner is focussed,
* or <tt>0</tt> if none is set.
*/
const Widget* get_focus_child() const;
/** Hooks up an adjustment to focus handling in a container, so when a
* child of the container is focused, the adjustment is scrolled to
* show that widget. This function sets the vertical alignment. See
* Gtk::ScrolledWindow::get_vadjustment() for a typical way of obtaining
* the adjustment and set_focus_hadjustment() for setting
* the horizontal adjustment.
*
* The adjustments have to be in pixel units and in the same coordinate
* system as the allocation for immediate children of the container.
* @param adjustment An adjustment which should be adjusted when the focus
* is moved among the descendents of @a container.
*/
void set_focus_vadjustment(const Glib::RefPtr<Adjustment>& adjustment);
/** Retrieves the vertical focus adjustment for the container. See
* set_focus_vadjustment().
* @return The vertical focus adjustment, or <tt>0</tt> if
* none has been set.
*/
Glib::RefPtr<Adjustment> get_focus_vadjustment();
/** Retrieves the vertical focus adjustment for the container. See
* set_focus_vadjustment().
* @return The vertical focus adjustment, or <tt>0</tt> if
* none has been set.
*/
Glib::RefPtr<const Adjustment> get_focus_vadjustment() const;
/** Hooks up an adjustment to focus handling in a container, so when a child
* of the container is focused, the adjustment is scrolled to show that
* widget. This function sets the horizontal alignment.
* See Gtk::ScrolledWindow::get_hadjustment() for a typical way of obtaining
* the adjustment and set_focus_vadjustment() for setting
* the vertical adjustment.
*
* The adjustments have to be in pixel units and in the same coordinate
* system as the allocation for immediate children of the container.
* @param adjustment An adjustment which should be adjusted when the focus is
* moved among the descendents of @a container.
*/
void set_focus_hadjustment(const Glib::RefPtr<Adjustment>& adjustment);
/** Retrieves the horizontal focus adjustment for the container. See
* set_focus_hadjustment().
* @return The horizontal focus adjustment, or <tt>0</tt> if
* none has been set.
*/
Glib::RefPtr<Adjustment> get_focus_hadjustment();
/** Retrieves the horizontal focus adjustment for the container. See
* set_focus_hadjustment().
* @return The horizontal focus adjustment, or <tt>0</tt> if
* none has been set.
*/
Glib::RefPtr<const Adjustment> get_focus_hadjustment() const;
#ifndef GTKMM_DISABLE_DEPRECATED
/** @deprecated No replacement available.
*/
void resize_children();
#endif // GTKMM_DISABLE_DEPRECATED
/** Returns the type of the children supported by the container.
*
* Note that this may return TYPE_NONE to indicate that no more
* children can be added, e.g. for a Gtk::Paned which already has two
* children.
* @return A Type.
*/
GType child_type() const;
/** Returns a newly created widget path representing all the widget hierarchy
* from the toplevel down to and including @a child.
* @param child A child of @a container.
* @return A newly created Gtk::WidgetPath.
*/
WidgetPath get_path_for_child(const Widget& child) const;
// Ignore functions such as gtk_container_class_install_child_property(), which I think are for themes, like the GtkWidget style properties.
/**
* @par Slot Prototype:
* <tt>void on_my_%add(Widget* widget)</tt>
*
*/
Glib::SignalProxy1< void,Widget* > signal_add();
//We use the optional custom_c_callback parameter with _WRAP_SIGNAL() here,
//so that we can write special code to check for deleted child widget parameters:
/**
* @par Slot Prototype:
* <tt>void on_my_%remove(Widget* widget)</tt>
*
*/
Glib::SignalProxy1< void,Widget* > signal_remove();
/**
* @par Slot Prototype:
* <tt>void on_my_%check_resize()</tt>
*
*/
Glib::SignalProxy0< void > signal_check_resize();
/**
* @par Slot Prototype:
* <tt>void on_my_%set_focus_child(Widget* widget)</tt>
*
*/
Glib::SignalProxy1< void,Widget* > signal_set_focus_child();
void show_all_children(bool recursive = true);
protected:
Container();
/** Implements child_type().
*
* The default implementation returns G_TYPE_NONE
*/
virtual GType child_type_vfunc() const;
/** Invokes a callback on all children of the container.
*
* The callback may optionally be invoked also on children that are considered
* "internal" (implementation details of the container). "Internal" children
* generally weren't added by the user of the container, but were added by the
* container implementation itself.
*
* Most applications should use foreach(), rather than forall().
*
* @param include_internals
* @param callback A callback.
* @param callback_data Callback user data
*/
virtual void forall_vfunc(gboolean include_internals, GtkCallback callback, gpointer callback_data);
//TODO: Return a ustring instead when we can break ABI.
/** Returns the composite name of a child widget.
*
* Composite widgets are children of the container that are considered
* "internal" (implementation details of the container). "Internal" children
* generally weren't added by the user of the container, but were added by
* the container implementation itself.
*
* The caller is responsible for freeing the returned string.
*
* @param child The child widget.
* @returns The composite name of the child widget.
*/
virtual char* composite_name_vfunc(GtkWidget* child);
/** Sets a child property for this container and its child.
*
* Child properties are object properties that are not specific to either the
* container or the contained widget, but rather to their relation. Typical
* examples of child properties are the position or pack-type of a widget
* which is contained in a Gtk::Box.
*
* @param child The child property.
* @param property_id The ID of the child property to set.
* @param value The new value for the child property.
* @param pspec
*/
virtual void set_child_property_vfunc(GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec);
/** Returns a child property for this container and its child.
*
* Child properties are object properties that are not specific to either the
* container or the contained widget, but rather to their relation. Typical
* examples of child properties are the position or pack-type of a widget
* which is contained in a Gtk::Box.
*
* @param child The child property.
* @param property_id The ID of the child property to get.
* @param value A GValue to fill with the child property's value.
* @param pspec
*/
virtual void get_child_property_vfunc(GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec) const;
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The width of the empty border outside the containers children.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy< guint > property_border_width() ;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The width of the empty border outside the containers children.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< guint > property_border_width() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** Specify how resize events are handled.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy< ResizeMode > property_resize_mode() ;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** Specify how resize events are handled.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< ResizeMode > property_resize_mode() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** Can be used to add a new child to the container.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy_WriteOnly that allows you to set the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_WriteOnly< Widget* > property_child() ;
#endif //#GLIBMM_PROPERTIES_ENABLED
};
} // namespace Gtk
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gtk::Container
*/
Gtk::Container* wrap(GtkContainer* object, bool take_copy = false);
} //namespace Glib
#endif /* _GTKMM_CONTAINER_H */
|