예제 #1
0
파일: gtkcssimageurl.c 프로젝트: GNOME/gtk
static void
gtk_css_image_url_print (GtkCssImage *image,
                         GString     *string)
{
  GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);

  _gtk_css_image_print (gtk_css_image_url_load_image (url, NULL), string);
}
예제 #2
0
static void
gtk_css_value_image_print (const GtkCssValue *value,
                           GString           *string)
{
  if (value->image)
    _gtk_css_image_print (value->image, string);
  else
    g_string_append (string, "none");
}
예제 #3
0
static void
gtk_css_image_cross_fade_print (GtkCssImage *image,
                                GString     *string)
{
  GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);

  g_string_append (string, "cross-fade(");
  if (cross_fade->progress != 0.5)
    {
      g_string_append_printf (string, "%g%% ", cross_fade->progress * 100.0);
    }

  if (cross_fade->start)
    _gtk_css_image_print (cross_fade->start, string);
  else
    g_string_append (string, "none");
  if (cross_fade->end)
    {
      g_string_append (string, ", ");
      _gtk_css_image_print (cross_fade->end, string);
    }
  g_string_append (string, ")");
}
예제 #4
0
static void
gtk_css_image_fallback_print (GtkCssImage *image,
                             GString     *string)
{
  GtkCssImageFallback *fallback = GTK_CSS_IMAGE_FALLBACK (image);
  int i;

  g_string_append (string, "image(");
  for (i = 0; i < fallback->n_images; i++)
    {
      if (i > 0)
        g_string_append (string, ",");
      _gtk_css_image_print (fallback->images[i], string);
    }
  if (fallback->color)
    {
      g_string_append (string, ",");
      _gtk_css_value_print (fallback->color, string);
    }

  g_string_append (string, ")");
}