[gtk+/icon-shadow: 2/9] shadow: add _gtk_icon_shadow_paint_surface()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/icon-shadow: 2/9] shadow: add _gtk_icon_shadow_paint_surface()
- Date: Tue, 31 May 2011 21:57:20 +0000 (UTC)
commit 9313268bc85841ae81f2b3e8a75da197dccd04b9
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri May 20 23:51:16 2011 -0400
shadow: add _gtk_icon_shadow_paint_surface()
gtk/gtkshadow.c | 23 +++++++++++++++++++++++
gtk/gtkshadowprivate.h | 3 +++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkshadow.c b/gtk/gtkshadow.c
index f1f58c8..0e54c91 100644
--- a/gtk/gtkshadow.c
+++ b/gtk/gtkshadow.c
@@ -284,3 +284,26 @@ _gtk_text_shadow_paint_layout (GtkShadow *shadow,
}
}
+void
+_gtk_icon_shadow_paint (GtkShadow *shadow,
+ cairo_t *cr)
+{
+ GList *l;
+ GtkShadowElement *element;
+ cairo_pattern_t *pattern;
+
+ for (l = g_list_last (shadow->elements); l != NULL; l = l->prev)
+ {
+ element = l->data;
+
+ cairo_save (cr);
+ pattern = cairo_pattern_reference (cairo_get_source (cr));
+ gdk_cairo_set_source_rgba (cr, &element->color);
+
+ cairo_translate (cr, element->hoffset, element->voffset);
+ cairo_mask (cr, pattern);
+
+ cairo_restore (cr);
+ cairo_pattern_destroy (pattern);
+ }
+}
diff --git a/gtk/gtkshadowprivate.h b/gtk/gtkshadowprivate.h
index 46ef0ff..997fd89 100644
--- a/gtk/gtkshadowprivate.h
+++ b/gtk/gtkshadowprivate.h
@@ -57,6 +57,9 @@ void _gtk_text_shadow_paint_layout (GtkShadow *shadow,
cairo_t *cr,
PangoLayout *layout);
+void _gtk_icon_shadow_paint (GtkShadow *shadow,
+ cairo_t *cr);
+
G_END_DECLS
#endif /* __GTK_SHADOW_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]