// -*- c++ -*- // Generated by gtkmmproc -- DO NOT MODIFY! #ifndef _GTKMM_WIDGET_H #define _GTKMM_WIDGET_H #include /* $Id$ */ /* Copyright (C) 2002, 2003 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #include #include #include #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GtkTargetEntry GtkTargetEntry; } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef struct _GtkWidget GtkWidget; typedef struct _GtkWidgetClass GtkWidgetClass; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { class Widget_Class; } // namespace Gtk namespace Gtk { /** @addtogroup gtkmmEnums Enums and Flags */ /** * @ingroup gtkmmEnums * @par Bitwise operators: * %DestDefaults operator|(DestDefaults, DestDefaults)
* %DestDefaults operator&(DestDefaults, DestDefaults)
* %DestDefaults operator^(DestDefaults, DestDefaults)
* %DestDefaults operator~(DestDefaults)
* %DestDefaults& operator|=(DestDefaults&, DestDefaults)
* %DestDefaults& operator&=(DestDefaults&, DestDefaults)
* %DestDefaults& operator^=(DestDefaults&, DestDefaults)
*/ enum DestDefaults { DEST_DEFAULT_MOTION = 1 << 0, DEST_DEFAULT_HIGHLIGHT = 1 << 1, DEST_DEFAULT_DROP = 1 << 2, DEST_DEFAULT_ALL = 0x07 }; /** @ingroup gtkmmEnums */ inline DestDefaults operator|(DestDefaults lhs, DestDefaults rhs) { return static_cast(static_cast(lhs) | static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline DestDefaults operator&(DestDefaults lhs, DestDefaults rhs) { return static_cast(static_cast(lhs) & static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline DestDefaults operator^(DestDefaults lhs, DestDefaults rhs) { return static_cast(static_cast(lhs) ^ static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline DestDefaults operator~(DestDefaults flags) { return static_cast(~static_cast(flags)); } /** @ingroup gtkmmEnums */ inline DestDefaults& operator|=(DestDefaults& lhs, DestDefaults rhs) { return (lhs = static_cast(static_cast(lhs) | static_cast(rhs))); } /** @ingroup gtkmmEnums */ inline DestDefaults& operator&=(DestDefaults& lhs, DestDefaults rhs) { return (lhs = static_cast(static_cast(lhs) & static_cast(rhs))); } /** @ingroup gtkmmEnums */ inline DestDefaults& operator^=(DestDefaults& lhs, DestDefaults rhs) { return (lhs = static_cast(static_cast(lhs) ^ static_cast(rhs))); } } // namespace Gtk #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class Value : public Glib::Value_Flags { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { /** * @ingroup gtkmmEnums * @par Bitwise operators: * %WidgetFlags operator|(WidgetFlags, WidgetFlags)
* %WidgetFlags operator&(WidgetFlags, WidgetFlags)
* %WidgetFlags operator^(WidgetFlags, WidgetFlags)
* %WidgetFlags operator~(WidgetFlags)
* %WidgetFlags& operator|=(WidgetFlags&, WidgetFlags)
* %WidgetFlags& operator&=(WidgetFlags&, WidgetFlags)
* %WidgetFlags& operator^=(WidgetFlags&, WidgetFlags)
*/ enum WidgetFlags { TOPLEVEL = 1 << 4, NO_WINDOW = 1 << 5, REALIZED = 1 << 6, MAPPED = 1 << 7, VISIBLE = 1 << 8, SENSITIVE = 1 << 9, PARENT_SENSITIVE = 1 << 10, CAN_FOCUS = 1 << 11, HAS_FOCUS = 1 << 12, CAN_DEFAULT = 1 << 13, HAS_DEFAULT = 1 << 14, HAS_GRAB = 1 << 15, RC_STYLE = 1 << 16, COMPOSITE_CHILD = 1 << 17, NO_REPARENT = 1 << 18, APP_PAINTABLE = 1 << 19, RECEIVES_DEFAULT = 1 << 20, DOUBLE_BUFFERED = 1 << 21, NO_SHOW_ALL = 1 << 22 }; /** @ingroup gtkmmEnums */ inline WidgetFlags operator|(WidgetFlags lhs, WidgetFlags rhs) { return static_cast(static_cast(lhs) | static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline WidgetFlags operator&(WidgetFlags lhs, WidgetFlags rhs) { return static_cast(static_cast(lhs) & static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline WidgetFlags operator^(WidgetFlags lhs, WidgetFlags rhs) { return static_cast(static_cast(lhs) ^ static_cast(rhs)); } /** @ingroup gtkmmEnums */ inline WidgetFlags operator~(WidgetFlags flags) { return static_cast(~static_cast(flags)); } /** @ingroup gtkmmEnums */ inline WidgetFlags& operator|=(WidgetFlags& lhs, WidgetFlags rhs) { return (lhs = static_cast(static_cast(lhs) | static_cast(rhs))); } /** @ingroup gtkmmEnums */ inline WidgetFlags& operator&=(WidgetFlags& lhs, WidgetFlags rhs) { return (lhs = static_cast(static_cast(lhs) & static_cast(rhs))); } /** @ingroup gtkmmEnums */ inline WidgetFlags& operator^=(WidgetFlags& lhs, WidgetFlags rhs) { return (lhs = static_cast(static_cast(lhs) ^ static_cast(rhs))); } } // namespace Gtk #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class Value : public Glib::Value_Flags { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { /** * @ingroup gtkmmEnums */ enum WidgetHelpType { WIDGET_HELP_TOOLTIP, WIDGET_HELP_WHATS_THIS }; } // namespace Gtk #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Glib { template <> class Value : public Glib::Value_Enum { public: static GType value_type() G_GNUC_CONST; }; } // namespace Glib #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gtk { class Style; class AccelGroup; class Adjustment; class Window; class Container; class Settings; typedef GtkRequisition Requisition; // Gtk::Allocation is a typedef of Gdk::Rectangle because GtkAllocation is // a typedef of GdkRectangle. typedef Gdk::Rectangle Allocation; /** @defgroup Widgets Widgets */ /** Abstract Widget (Base class for all widgets) * * As the base class of all widgets this contains all of the properties * and methods common to all widgets. It is an abstract class that * can not be instantiated. * * Important part of widgets are the *_event signals and virtual methods * that every widget have. Those are events coming directly from gdk and * thus also from XLib. By overriding those virtual methods you can * trap everything a widget can ever do. * In order to capture events from a widget, the event mask must * first be set with (). * * Only widgets with a Gdk::Window on the server side are allowed to * capture events. Widgets in the Gtk::Misc group for example lack * a Gdk::Window. */ class Widget : public Object, public Atk::Implementor { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef Widget CppObjectType; typedef Widget_Class CppClassType; typedef GtkWidget BaseObjectType; typedef GtkWidgetClass BaseClassType; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ virtual ~Widget(); #ifndef DOXYGEN_SHOULD_SKIP_THIS private: friend class Widget_Class; static CppClassType widget_class_; // noncopyable Widget(const Widget&); Widget& operator=(const Widget&); protected: explicit Widget(const Glib::ConstructParams& construct_params); explicit Widget(GtkWidget* castitem); #endif /* DOXYGEN_SHOULD_SKIP_THIS */ public: #ifndef DOXYGEN_SHOULD_SKIP_THIS static GType get_type() G_GNUC_CONST; static GType get_base_type() G_GNUC_CONST; #endif ///Provides access to the underlying C GtkObject. GtkWidget* gobj() { return reinterpret_cast(gobject_); } ///Provides access to the underlying C GtkObject. const GtkWidget* gobj() const { return reinterpret_cast(gobject_); } public: //C++ methods used to invoke GTK+ virtual functions: protected: //GTK+ Virtual Functions (override these to change behaviour): //Default Signal Handlers:: virtual void on_show(); virtual void on_hide(); virtual void on_map(); virtual void on_unmap(); virtual void on_realize(); virtual void on_unrealize(); virtual void on_size_request(Requisition* requisition); virtual void on_size_allocate(Allocation& allocation); virtual void on_state_changed(Gtk::StateType previous_state); virtual void on_parent_changed(Widget* previous_parent); virtual void on_hierarchy_changed(Widget* previous_toplevel); virtual void on_style_changed(const Glib::RefPtr