GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

object.hh

Go to the documentation of this file.
00001 /* GFC-Core: GTK+ Foundation Classes (Core Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_G_OBJECT_HH 00025 #define GFC_G_OBJECT_HH 00026 00027 #ifndef GFC_G_TYPE_HH 00028 #include <gfc/glib/type.hh> 00029 #endif 00030 00031 namespace GFC { 00032 00033 namespace G { 00034 00035 class Quark; 00036 class Value; 00037 00053 00054 class Object : public virtual TypeInstance 00055 { 00056 Object(const Object&); 00057 Object& operator=(const Object&); 00058 00059 static void destroy_notify(void *data); 00060 00061 protected: 00064 00065 explicit Object(GObject *object, bool owns_reference = true); 00080 00084 00085 typedef Signal<void, GParamSpec*> NotifySignalType; 00086 typedef SignalProxy<TypeInstance, NotifySignalType> NotifySignalProxy; 00087 static const NotifySignalType notify_signal; 00093 00095 00096 public: 00099 00100 virtual ~Object(); 00102 00106 00107 GObject* g_object() const; 00109 00110 operator GObject* () const; 00112 00113 void get_property(const char *property_name, Value& value) const; 00117 00118 void* get_data(const Quark& quark) const; 00122 00123 void* get_data(const char *key) const; 00124 void* get_data(const String& key) const; 00128 00130 00131 static Object* pointer(GObject* object); 00135 00138 00139 virtual void ref(); 00142 00143 virtual void unref(); 00146 00147 virtual void dispose(); 00150 00151 void set_property(const char *property_name, const Value& value); 00155 00156 void set_data(const Quark& quark, void *data, GDestroyNotify destroy = 0); 00166 00167 void set_data(const char *key, void *data, GDestroyNotify destroy = 0); 00168 void set_data(const String& key, void *data, GDestroyNotify destroy = 0); 00178 00179 void* remove_data(const Quark& quark, bool notify = false); 00188 00189 void* remove_data(const char *key, bool notify = false); 00190 void* remove_data(const String& key, bool notify = false); 00199 00203 00204 void emit_by_name(const char *signal_name, ...); 00211 00212 void stop_emission_by_name(const char *detailed_signal); 00219 00220 bool disconnect_by_name(const char* signal_name); 00230 00234 00235 template<typename T, typename gObject> 00236 static T* wrap(gObject *object, bool owns_reference = false); 00246 00247 template<typename T, typename gObject> 00248 static T* wrap_new(gObject *object, bool owns_reference = false); 00257 00261 00262 const NotifySignalProxy sig_notify(const char *property_name = 0); 00263 const NotifySignalProxy sig_notify(const String& property_name); 00271 00273 }; 00274 00275 } // namespace G 00276 00277 } // namespace GFC 00278 00279 #include <gfc/glib/inline/object.inl> 00280 00281 #endif // GFC_G_OBJECT_HH 00282

Generated on Tue Aug 24 00:04:56 2004 for GFC-Core by doxygen 1.3.8