summaryrefslogtreecommitdiff
path: root/eel/eel-gdk-extensions.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-29 17:33:19 +0200
committerraveit65 <[email protected]>2016-07-02 10:50:56 +0200
commit3b8e0d41a7adca11014a3548f3ab19fd7e400c70 (patch)
treee36502a0019b3321cd5b459ca087e96d22bf1d69 /eel/eel-gdk-extensions.c
parent0c08ec62529640df8e6c007af8ed3e4728d31e69 (diff)
downloadcaja-3b8e0d41a7adca11014a3548f3ab19fd7e400c70.tar.bz2
caja-3b8e0d41a7adca11014a3548f3ab19fd7e400c70.tar.xz
eel: make code better readable
Diffstat (limited to 'eel/eel-gdk-extensions.c')
-rw-r--r--eel/eel-gdk-extensions.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/eel/eel-gdk-extensions.c b/eel/eel-gdk-extensions.c
index 00697d4c..646c6405 100644
--- a/eel/eel-gdk-extensions.c
+++ b/eel/eel-gdk-extensions.c
@@ -414,23 +414,7 @@ eel_gdk_rgba_to_rgb (const GdkRGBA *color)
(guint) (color->green * 65535),
(guint) (color->blue * 65535));
}
-#else
-/**
- * eel_gdk_color_to_rgb
- * @color: A GdkColor style color.
- * Returns: An rgb value.
- *
- * Converts from a GdkColor style color to a gdk_rgb one.
- * Alpha gets set to fully opaque
- */
-guint32
-eel_gdk_color_to_rgb (const GdkColor *color)
-{
- return eel_rgb16_to_rgb (color->red, color->green, color->blue);
-}
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
/**
* eel_gdk_rgb_to_rgba
* @color: a gdk_rgb style value.
@@ -448,8 +432,25 @@ eel_gdk_rgb_to_rgba (guint32 color)
result.red = ((color >> 16) & 0xFF) / 0xFF;
result.green = ((color >> 8) & 0xFF) / 0xFF;
result.blue = (color & 0xff) / 0xFF;
+
+ return result;
+}
#else
/**
+ * eel_gdk_color_to_rgb
+ * @color: A GdkColor style color.
+ * Returns: An rgb value.
+ *
+ * Converts from a GdkColor style color to a gdk_rgb one.
+ * Alpha gets set to fully opaque
+ */
+guint32
+eel_gdk_color_to_rgb (const GdkColor *color)
+{
+ return eel_rgb16_to_rgb (color->red, color->green, color->blue);
+}
+
+/**
* eel_gdk_rgb_to_color
* @color: a gdk_rgb style value.
*
@@ -467,10 +468,10 @@ eel_gdk_rgb_to_color (guint32 color)
result.green = ((color >> 8) & 0xFF) * 0x101;
result.blue = (color & 0xff) * 0x101;
result.pixel = 0;
-#endif
return result;
}
+#endif
/**
* eel_gdk_rgb_to_color_spec
@@ -565,8 +566,8 @@ eel_gdk_parse_geometry (const char *string, int *x_return, int *y_return,
return gdk_flags;
}
-void
#if GTK_CHECK_VERSION(3,0,0)
+void
eel_cairo_draw_layout_with_drop_shadow (cairo_t *cr,
GdkRGBA *text_color,
GdkRGBA *shadow_color,
@@ -585,7 +586,9 @@ eel_cairo_draw_layout_with_drop_shadow (cairo_t *cr,
pango_cairo_show_layout (cr, layout);
cairo_restore (cr);
+}
#else
+void
eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable,
GdkColor *text_color,
GdkColor *shadow_color,
@@ -605,8 +608,8 @@ eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable,
pango_cairo_show_layout (cr, layout);
cairo_destroy (cr);
-#endif
}
+#endif
#if GTK_CHECK_VERSION(3,0,0)
#define CLAMP_COLOR(v) (t = (v), CLAMP (t, 0, 1))