本文整理汇总了C++中GtkCssImageClass类的典型用法代码示例。如果您正苦于以下问题:C++ GtkCssImageClass类的具体用法?C++ GtkCssImageClass怎么用?C++ GtkCssImageClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GtkCssImageClass类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _gtk_css_image_transition
GtkCssImage *
_gtk_css_image_transition (GtkCssImage *start,
GtkCssImage *end,
guint property_id,
double progress)
{
GtkCssImageClass *klass;
g_return_val_if_fail (start == NULL || GTK_IS_CSS_IMAGE (start), NULL);
g_return_val_if_fail (end == NULL || GTK_IS_CSS_IMAGE (end), NULL);
progress = CLAMP (progress, 0.0, 1.0);
if (start == NULL)
{
if (end == NULL)
return NULL;
else
{
start = end;
end = NULL;
progress = 1.0 - progress;
}
}
klass = GTK_CSS_IMAGE_GET_CLASS (start);
return klass->transition (start, end, property_id, progress);
}
示例2: _gtk_css_image_new_parse
GtkCssImage *
_gtk_css_image_new_parse (GtkCssParser *parser)
{
GtkCssImageClass *klass;
GtkCssImage *image;
GType image_type;
g_return_val_if_fail (parser != NULL, NULL);
image_type = gtk_css_image_get_parser_type (parser);
if (image_type == G_TYPE_INVALID)
{
_gtk_css_parser_error (parser, "Not a valid image");
return NULL;
}
image = g_object_new (image_type, NULL);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
if (!klass->parse (image, parser))
{
g_object_unref (image);
return NULL;
}
return image;
}
示例3: _gtk_css_image_get_aspect_ratio
double
_gtk_css_image_get_aspect_ratio (GtkCssImage *image)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), 0);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->get_aspect_ratio (image);
}
示例4: _gtk_css_image_get_height
int
_gtk_css_image_get_height (GtkCssImage *image)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), 0);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->get_height (image);
}
示例5: _gtk_css_image_print
void
_gtk_css_image_print (GtkCssImage *image,
GString *string)
{
GtkCssImageClass *klass;
g_return_if_fail (GTK_IS_CSS_IMAGE (image));
g_return_if_fail (string != NULL);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
klass->print (image, string);
}
示例6: _gtk_css_image_compute
GtkCssImage *
_gtk_css_image_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->compute (image, property_id, provider, style, parent_style);
}
示例7: _gtk_css_image_draw
void
_gtk_css_image_draw (GtkCssImage *image,
cairo_t *cr,
double width,
double height)
{
GtkCssImageClass *klass;
g_return_if_fail (GTK_IS_CSS_IMAGE (image));
g_return_if_fail (cr != NULL);
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
cairo_save (cr);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
klass->draw (image, cr, width, height);
cairo_restore (cr);
}
示例8: _gtk_css_image_equal
gboolean
_gtk_css_image_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
GtkCssImageClass *klass;
g_return_val_if_fail (image1 == NULL || GTK_IS_CSS_IMAGE (image1), FALSE);
g_return_val_if_fail (image2 == NULL || GTK_IS_CSS_IMAGE (image2), FALSE);
if (image1 == image2)
return TRUE;
if (image1 == NULL || image2 == NULL)
return FALSE;
if (G_OBJECT_TYPE (image1) != G_OBJECT_TYPE (image2))
return FALSE;
klass = GTK_CSS_IMAGE_GET_CLASS (image1);
return klass->equal (image1, image2);
}
示例9: _gtk_css_image_compute
GtkCssImage *
_gtk_css_image_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
int scale,
GtkCssComputedValues *values,
GtkCssComputedValues *parent_values,
GtkCssDependencies *dependencies)
{
GtkCssDependencies unused;
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL);
g_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_COMPUTED_VALUES (parent_values), NULL);
if (dependencies == NULL)
dependencies = &unused;
*dependencies = 0;
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->compute (image, property_id, provider, scale, values, parent_values, dependencies);
}