From: Matthias Clasen Date: Tue, 4 Mar 2003 00:04:26 +0000 (+0000) Subject: Add deprecation guards around gtk_object_new(). X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=15e99cdacdcc56d7d42099e150db4dd9d8a425e4;p=~andy%2Fgtk Add deprecation guards around gtk_object_new(). --- diff --git a/ChangeLog b/ChangeLog index e1dc12121..d6e18e28a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/gtkobject.h: Add deprecation guards for gtk_object_new (). + Sun Mar 2 23:35:57 2003 Jonathan Blandford * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e1dc12121..d6e18e28a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/gtkobject.h: Add deprecation guards for gtk_object_new (). + Sun Mar 2 23:35:57 2003 Jonathan Blandford * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e1dc12121..d6e18e28a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/gtkobject.h: Add deprecation guards for gtk_object_new (). + Sun Mar 2 23:35:57 2003 Jonathan Blandford * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e1dc12121..d6e18e28a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/gtkobject.h: Add deprecation guards for gtk_object_new (). + Sun Mar 2 23:35:57 2003 Jonathan Blandford * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e1dc12121..d6e18e28a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/gtkobject.h: Add deprecation guards for gtk_object_new (). + Sun Mar 2 23:35:57 2003 Jonathan Blandford * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size): diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index ae8c72d3d..e23e95e94 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2003-03-04 Matthias Clasen + + * gtk/tmpl/gtkobject.sgml: Add deprecation notes. + 2003-02-24 Matthias Clasen * gtk/tmpl/gtktreemodel.sgml: Fix self-referential documenation of diff --git a/docs/reference/gtk/tmpl/gtkobject.sgml b/docs/reference/gtk/tmpl/gtkobject.sgml index ade1ceb76..2203095ff 100644 --- a/docs/reference/gtk/tmpl/gtkobject.sgml +++ b/docs/reference/gtk/tmpl/gtkobject.sgml @@ -165,7 +165,7 @@ each child. Used by #GtkContainer. Constructs an object given its arguments, enumerated in the call to the -function. Deprecated in favor of g_object_new(). +function. @type: the type identifying this object. Returned by gtk_type_unique() @@ -176,6 +176,7 @@ a #GTK_TYPE_FOO macro.) @Varargs: the first argument's value, followed by any number of name/argument-value pairs, terminated with %NULL. @Returns: the new #GtkObject. +@Deprecated: Use g_object_new() instead. @@ -191,27 +192,26 @@ the top of the page. Increases the reference count of the object. -Deprecated in favor of g_object_ref(). @object: the object to reference. @Returns: @object. +@Deprecated: Use g_object_ref() instead. Decreases the reference count of an object. When its reference count drops -to 0, the object is finalized (i.e. its memory is freed). Deprecated in -favor of g_object_unref(). +to 0, the object is finalized (i.e. its memory is freed). @object: the object to dereference. +@Deprecated: Use g_object_unref() instead. -Adds a weak reference callback to an object. Deprecated in favor of -g_object_weak_ref(). Weak references are used for notification when an object is +Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive). @@ -220,6 +220,7 @@ a strong reference, that is, forces the object to stay alive). @object: object to weakly reference. @notify: callback to invoke before the object is freed. @data: extra data to pass to #notify. +@Deprecated: Use g_object_weak_ref() instead. @@ -230,6 +231,7 @@ Removes a weak reference callback to an object. @object: object stop weakly referencing. @notify: callback to search for. @data: data to search for. +@Deprecated: Use g_object_weak_unref() instead. @@ -249,17 +251,17 @@ reference holders to release their references, it does not free the object. -Gets properties of an object. Deprecated in favor of g_object_get(). +Gets properties of an object. @object: a #GtkObject. @first_property_name: name of first property to get the value for. @Varargs: %NULL-terminated list of name-return location pairs. - +@Deprecated: Use g_object_get() instead. -Sets properties on an object. Deprecated in favor of g_object_set(). +Sets properties on an object. @@ -278,11 +280,11 @@ void set_box_properties (GtkBox* box) @first_property_name: name of the first property to set @Varargs: the value of the first argument, followed optionally by more name/value pairs, followed by %NULL. +@Deprecated: Use g_object_set() instead. -Deprecated in favor of g_object_set_data(). Each object carries around a table of associations from strings to pointers. This function lets you set an association. @@ -294,11 +296,11 @@ the old association will be destroyed. @object: object containing the associations. @key: name of the key. @data: data to associate with that key. +@Deprecated: Use g_object_set_data() instead. -Deprecated in favor of g_object_set_data_full(). Like gtk_object_set_data() except it adds notification for when the association is destroyed, either by gtk_object_remove_data() or when the object is destroyed. @@ -308,11 +310,11 @@ gtk_object_remove_data() or when the object is destroyed. @key: name of the key. @data: data to associate with that key. @destroy: function to call when the association is destroyed. +@Deprecated: Use g_object_set_data_full() instead. -Deprecated in favor of setting object data to %NULL using g_object_set_data(). Removes a specified datum from the object's data associations (the object_data). Subsequent calls to gtk_object_get_data() will return %NULL. @@ -323,22 +325,22 @@ it will be invoked. @object: the object maintaining the association. @key: name of the key for that association. +@Deprecated: Use g_object_set_data() to set the object data to %NULL instead. -Deprecated in favor of g_object_get_data(). Get a named field from the object's table of associations (the object_data). @object: the object maintaining the associations. @key: name of the key for that association. @Returns: the data if found, or %NULL if no such data exists. +@Deprecated: Use g_object_get_data() instead. -Deprecated in favor of g_object_steal_data(). Remove a specified datum from the object's data associations (the object_data), without invoking the association's destroy handler. @@ -350,11 +352,11 @@ Therefore this only affects data set using gtk_object_set_data_full(). @object: the object maintaining the association. @key: name of the key for that association. +@Deprecated: Use g_object_steal_data() instead. -Deprecated in favor of g_object_set_data(). For convenience, every object offers a generic user data pointer. This function sets it. @@ -365,11 +367,11 @@ This function is equivalent to @object: the object whose user data should be set. @data: the new value for the user data. +@Deprecated: Use g_object_set_data() instead. -Deprecated in favor of g_object_get_data(). Get the object's user data pointer. @@ -379,6 +381,7 @@ writing applications. @object: the object. @Returns: the user data field for object. +@Deprecated: Use g_object_get_data() instead. @@ -398,7 +401,6 @@ settable or gettable, whether it is set when the object is constructed.) -Deprecated in favor of g_object_set_qdata(). Just like gtk_object_set_data() except that it takes a #GQuark instead of a string, so it is slightly faster. @@ -410,11 +412,11 @@ to get an id from a string. @object: object containing the associations. @data_id: quark of the key. @data: data to associate with that key. +@Deprecated: Use g_object_set_qdata() instead. -Deprecated in favor of g_object_set_qdata_full(). Just like gtk_object_set_data_full() except that it takes a #GQuark instead of a string, so it is slightly faster. @@ -427,11 +429,11 @@ to get an id from a string. @data_id: quark of the key. @data: data to associate with that key. @destroy: function to call when the association is destroyed. +@Deprecated: Use g_object_set_qdata_full() instead. -Deprecated in favor of g_object_get_qdata(). Just like gtk_object_get_data() except that it takes a #GQuark instead of a string, so it is slightly faster. @@ -443,11 +445,11 @@ to get an id from a string. @object: object containing the associations. @data_id: quark of the key. @Returns: the data if found, or %NULL if no such data exists. +@Deprecated: Use g_object_get_qdata() instead. -Deprecated in favor of g_object_set_qdata() called with data of %NULL. Just like gtk_object_remove_data() except that it takes a #GQuark instead of a string, so it is slightly faster. @@ -462,11 +464,11 @@ to get an id from a string. @object: object containing the associations. @data_id: quark of the key. +@Deprecated: Use g_object_set_qdata() with data of %NULL instead. -Deprecated in favor of g_object_steal_qdata(). Just like gtk_object_remove_no_notify() except that it takes a #GQuark instead of a string, so it is slightly faster. @@ -477,8 +479,7 @@ to get an id from a string. @object: object containing the associations. @key_id: quark of the key. - -@data_id: +@Deprecated: Use g_object_steal_qdata() instead. diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h index db6dc5bfd..1260a4787 100644 --- a/gtk/gtkobject.h +++ b/gtk/gtkobject.h @@ -127,10 +127,6 @@ struct _GtkObjectClass GtkType gtk_object_get_type (void) G_GNUC_CONST; -GtkObject* gtk_object_new (GtkType type, - const gchar *first_property_name, - ...); - void gtk_object_sink (GtkObject *object); void gtk_object_destroy (GtkObject *object); @@ -138,6 +134,9 @@ void gtk_object_destroy (GtkObject *object); #ifndef GTK_DISABLE_DEPRECATED +GtkObject* gtk_object_new (GtkType type, + const gchar *first_property_name, + ...); GtkObject* gtk_object_ref (GtkObject *object); void gtk_object_unref (GtkObject *object); void gtk_object_weakref (GtkObject *object,