1 | /* |
2 | * Copyright © 2011 Red Hat Inc. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2.1 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | * Authors: Benjamin Otte <otte@gnome.org> |
18 | */ |
19 | |
20 | #include "config.h" |
21 | |
22 | #include "gtkcssimageinvalidprivate.h" |
23 | |
24 | G_DEFINE_TYPE (GtkCssImageInvalid, gtk_css_image_invalid, GTK_TYPE_CSS_IMAGE) |
25 | |
26 | static void |
27 | gtk_css_image_invalid_snapshot (GtkCssImage *image, |
28 | GtkSnapshot *snapshot, |
29 | double width, |
30 | double height) |
31 | { |
32 | } |
33 | |
34 | static gboolean |
35 | gtk_css_image_invalid_equal (GtkCssImage *image1, |
36 | GtkCssImage *image2) |
37 | { |
38 | return TRUE; |
39 | } |
40 | |
41 | static void |
42 | gtk_css_image_invalid_print (GtkCssImage *image, |
43 | GString *string) |
44 | { |
45 | g_string_append (string, val: "none /* invalid image */" ); |
46 | } |
47 | |
48 | static gboolean |
49 | gtk_css_image_invalid_is_invalid (GtkCssImage *image) |
50 | { |
51 | return TRUE; |
52 | } |
53 | |
54 | static void |
55 | gtk_css_image_invalid_class_init (GtkCssImageInvalidClass *klass) |
56 | { |
57 | GtkCssImageClass *image_class = GTK_CSS_IMAGE_CLASS (klass); |
58 | |
59 | image_class->snapshot = gtk_css_image_invalid_snapshot; |
60 | image_class->print = gtk_css_image_invalid_print; |
61 | image_class->equal = gtk_css_image_invalid_equal; |
62 | image_class->is_invalid = gtk_css_image_invalid_is_invalid; |
63 | } |
64 | |
65 | static void |
66 | gtk_css_image_invalid_init (GtkCssImageInvalid *image_invalid) |
67 | { |
68 | } |
69 | |
70 | GtkCssImage * |
71 | gtk_css_image_invalid_new (void) |
72 | { |
73 | return g_object_new (GTK_TYPE_CSS_IMAGE_INVALID, NULL); |
74 | } |
75 | |