当前位置: 首页>>代码示例>>C++>>正文


C++ GtkCssImageClass类代码示例

本文整理汇总了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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:29,代码来源:gtkcssimage.c

示例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;
}
开发者ID:aswinas,项目名称:gtk-,代码行数:27,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:11,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:11,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:13,代码来源:gtkcssimage.c

示例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);
}
开发者ID:endlessm,项目名称:gtk,代码行数:17,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:21,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:22,代码来源:gtkcssimage.c

示例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);
}
开发者ID:aswinas,项目名称:gtk-,代码行数:24,代码来源:gtkcssimage.c


注:本文中的GtkCssImageClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。