2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_OBJECT_H
4 #define _GTKMM_OBJECT_H
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <glibmm/object.h>
29 #include <gtkmm/base.h>
30 #include <gtkmmconfig.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkObject GtkObject;
35 typedef struct _GtkObjectClass GtkObjectClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class Object_Class; } // namespace Gtk
46 /** Mark a Gtk::Object as owned by its parent container widget, so you don't need to delete it manually.
49 * Gtk::Button* button = Gtk::manage( new Gtk::Button("Hello") );
50 * vbox.pack_start(*button); //vbox will delete button when vbox is deleted.
53 * @param obj A Gtk::Object, such as a gtkmm widget.
54 * @result The Gtk::Object passed as the @a obj parameter.
63 /** Gtk::Object is the base class for all widgets, and for a few non-widget objects such as
64 * Gtk::Adjustment. Gtk::Object predates Glib::Object; non-widgets that derive from Gtk::Object
65 * rather than Glib::Object do so for backward compatibility reasons.
67 * The most interesting difference between Gtk::Object and Glib::Object is the ability to use Gtk::manage() to delegate memory management to the container widget. Gtk::Objects can also be
68 * explicitly deleted at any time, instead of using only reference-counting, and container widgets
69 * can respond when their child objects are being deleted (for instance by removing the widget).
72 class GTKMM_API Object : public Glib::Object
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 typedef Object CppObjectType;
77 typedef Object_Class CppClassType;
78 typedef GtkObject BaseObjectType;
79 typedef GtkObjectClass BaseClassType;
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87 friend class Object_Class;
88 static CppClassType object_class_;
91 Object(const Object&);
92 Object& operator=(const Object&);
95 explicit Object(const Glib::ConstructParams& construct_params);
96 explicit Object(GtkObject* castitem);
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102 static GType get_type() G_GNUC_CONST;
103 static GType get_base_type() G_GNUC_CONST;
106 ///Provides access to the underlying C GtkObject.
107 GtkObject* gobj() { return reinterpret_cast<GtkObject*>(gobject_); }
109 ///Provides access to the underlying C GtkObject.
110 const GtkObject* gobj() const { return reinterpret_cast<GtkObject*>(gobject_); }
114 //C++ methods used to invoke GTK+ virtual functions:
115 #ifdef GLIBMM_VFUNCS_ENABLED
116 #endif //GLIBMM_VFUNCS_ENABLED
119 //GTK+ Virtual Functions (override these to change behaviour):
120 #ifdef GLIBMM_VFUNCS_ENABLED
121 #endif //GLIBMM_VFUNCS_ENABLED
123 //Default Signal Handlers::
124 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
125 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
132 //void shutdown(); //We probably don't need this.
133 //void finalize(); //We probably don't need this.
135 //void set_user_data(gpointer data);
136 //gpointer get_user_data();
138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
139 /** Used by Gtk::manage(). You should not need to use this directly.
141 virtual void set_manage();
142 #endif //DOXYGEN_SHOULD_SKIP_THIS
144 #ifdef GLIBMM_PROPERTIES_ENABLED
145 /** Anonymous User Data Pointer.
147 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
148 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
149 * the value of the property changes.
151 Glib::PropertyProxy<void*> property_user_data() ;
152 #endif //#GLIBMM_PROPERTIES_ENABLED
154 #ifdef GLIBMM_PROPERTIES_ENABLED
155 /** Anonymous User Data Pointer.
157 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
158 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
159 * the value of the property changes.
161 Glib::PropertyProxy_ReadOnly<void*> property_user_data() const;
162 #endif //#GLIBMM_PROPERTIES_ENABLED
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
168 bool is_managed_() const;
169 #endif //DOXYGEN_SHOULD_SKIP_THIS
173 #ifndef DOXYGEN_SHOULD_SKIP_THIS
177 #endif //DOXYGEN_SHOULD_SKIP_THIS
179 // If you need it, give me an example. murrayc. -- Me too. daniel.
180 //_WRAP_SIGNAL(void destroy(), "destroy")
183 #ifndef DOXYGEN_SHOULD_SKIP_THIS
184 void _init_unmanage(bool is_toplevel = false);
185 virtual void destroy_notify_(); //override.
186 void disconnect_cpp_wrapper();
187 void _destroy_c_instance();
188 static void callback_destroy_(GObject* gobject, void* data); //only connected for a short time.
190 // set if flags used by derived classes.
191 bool referenced_; // = not managed.
192 bool gobject_disposed_;
193 #endif //DOXYGEN_SHOULD_SKIP_THIS
203 /** A Glib::wrap() method for this object.
205 * @param object The C instance.
206 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
207 * @result A C++ instance that wraps this C instance.
209 * @relates Gtk::Object
211 Gtk::Object* wrap(GtkObject* object, bool take_copy = false);
215 #endif /* _GTKMM_OBJECT_H */