gtkgradient: Deprecate

This commit is contained in:
Benjamin Otte 2012-11-25 03:47:51 +01:00
parent fb643c1c12
commit 0862afaded
3 changed files with 31 additions and 0 deletions

View File

@ -715,6 +715,8 @@ gradient_value_print (const GValue *value,
{
GtkGradient *gradient = g_value_get_boxed (value);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (gradient == NULL)
g_string_append (string, "none");
else
@ -723,6 +725,8 @@ gradient_value_print (const GValue *value,
g_string_append (string, s);
g_free (s);
}
G_GNUC_END_IGNORE_DEPRECATIONS;
}
static gboolean

View File

@ -43,6 +43,11 @@
* It is not normally necessary to deal directly with #GtkGradients,
* since they are mostly used behind the scenes by #GtkStyleContext and
* #GtkCssProvider.
*
* #GtkGradient is deprecated. It was used internally by GTK's CSS engine
* to represent gradients. As its handling is not conforming to modern
* web standards, it is not used anymore. If you want to use gradients in
* your own code, please use Cairo directly.
*/
G_DEFINE_BOXED_TYPE (GtkGradient, gtk_gradient,
@ -83,6 +88,8 @@ struct _GtkGradient
* Returns: A newly created #GtkGradient
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
GtkGradient *
gtk_gradient_new_linear (gdouble x0,
@ -123,6 +130,8 @@ gtk_gradient_new_linear (gdouble x0,
* Returns: A newly created #GtkGradient
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
GtkGradient *
gtk_gradient_new_radial (gdouble x0,
@ -158,6 +167,8 @@ gtk_gradient_new_radial (gdouble x0,
* Adds a stop color to @gradient.
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
void
gtk_gradient_add_color_stop (GtkGradient *gradient,
@ -183,6 +194,8 @@ gtk_gradient_add_color_stop (GtkGradient *gradient,
* Returns: The same @gradient
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
GtkGradient *
gtk_gradient_ref (GtkGradient *gradient)
@ -202,6 +215,8 @@ gtk_gradient_ref (GtkGradient *gradient)
* if the reference count reaches 0.
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
void
gtk_gradient_unref (GtkGradient *gradient)
@ -242,6 +257,8 @@ gtk_gradient_unref (GtkGradient *gradient)
* Returns: %TRUE if the gradient has been resolved
*
* Since: 3.0
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
gboolean
gtk_gradient_resolve (GtkGradient *gradient,
@ -375,6 +392,8 @@ append_number (GString *str,
* for using in GTK CSS files.
*
* Returns: A string representation for @gradient
*
* Deprecated: 3.8: #GtkGradient is deprecated.
**/
char *
gtk_gradient_to_string (GtkGradient *gradient)

View File

@ -33,10 +33,12 @@ G_BEGIN_DECLS
GType gtk_gradient_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_8
GtkGradient * gtk_gradient_new_linear (gdouble x0,
gdouble y0,
gdouble x1,
gdouble y1);
GDK_DEPRECATED_IN_3_8
GtkGradient * gtk_gradient_new_radial (gdouble x0,
gdouble y0,
gdouble radius0,
@ -44,21 +46,27 @@ GtkGradient * gtk_gradient_new_radial (gdouble x0,
gdouble y1,
gdouble radius1);
GDK_DEPRECATED_IN_3_8
void gtk_gradient_add_color_stop (GtkGradient *gradient,
gdouble offset,
GtkSymbolicColor *color);
GDK_DEPRECATED_IN_3_8
GtkGradient * gtk_gradient_ref (GtkGradient *gradient);
GDK_DEPRECATED_IN_3_8
void gtk_gradient_unref (GtkGradient *gradient);
GDK_DEPRECATED_IN_3_8
gboolean gtk_gradient_resolve (GtkGradient *gradient,
GtkStyleProperties *props,
cairo_pattern_t **resolved_gradient);
GDK_DEPRECATED_IN_3_8
cairo_pattern_t *
gtk_gradient_resolve_for_context
(GtkGradient *gradient,
GtkStyleContext *context);
GDK_DEPRECATED_IN_3_8
char * gtk_gradient_to_string (GtkGradient *gradient);
G_END_DECLS