renamed gimp_cairo_set_source_color() to gimp_cairo_set_source_rgb() and
2007-12-12 Sven Neumann <sven@gimp.org> * libgimpwidgets/gimpcairo-utils.[ch]: renamed gimp_cairo_set_source_color() to gimp_cairo_set_source_rgb() and added an RGBA variant. * libgimpwidgets/gimpcellrenderercolor.c (gimp_cell_renderer_color_render) * app/widgets/gimpviewrenderer.c (gimp_view_renderer_draw): changed accordingly. * libgimpwidgets/gimpwidgets.def: updated. svn path=/trunk/; revision=24342
This commit is contained in:

committed by
Sven Neumann

parent
6f3b1c1e73
commit
dbb325eba6
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2007-12-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpcairo-utils.[ch]: renamed
|
||||
gimp_cairo_set_source_color() to gimp_cairo_set_source_rgb() and
|
||||
added an RGBA variant.
|
||||
|
||||
* libgimpwidgets/gimpcellrenderercolor.c
|
||||
(gimp_cell_renderer_color_render)
|
||||
* app/widgets/gimpviewrenderer.c (gimp_view_renderer_draw): changed
|
||||
accordingly.
|
||||
|
||||
* libgimpwidgets/gimpwidgets.def: updated.
|
||||
|
||||
2007-12-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpcairo-utils.[ch]: added new function
|
||||
|
@ -635,7 +635,7 @@ gimp_view_renderer_draw (GimpViewRenderer *renderer,
|
||||
|
||||
cairo_set_line_width (cr, renderer->border_width);
|
||||
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
|
||||
gimp_cairo_set_source_color (cr, &renderer->border_color);
|
||||
gimp_cairo_set_source_rgb (cr, &renderer->border_color);
|
||||
|
||||
x = draw_area->x + (draw_area->width - width) / 2.0;
|
||||
y = draw_area->y + (draw_area->height - height) / 2.0;
|
||||
|
@ -32,23 +32,40 @@
|
||||
|
||||
|
||||
/**
|
||||
* gimp_cairo_set_source_color:
|
||||
* gimp_cairo_set_source_rgb:
|
||||
* @cr: Cairo context
|
||||
* @color: GimpRGB color
|
||||
*
|
||||
* Sets the source pattern within @cr to the color described by @color.
|
||||
* Sets the source pattern within @cr to the solid opaque color
|
||||
* described by @color.
|
||||
*
|
||||
* This function calls cairo_set_source_rgb() for you.
|
||||
*
|
||||
* Since: GIMP 2.6
|
||||
**/
|
||||
void
|
||||
gimp_cairo_set_source_rgb (cairo_t *cr,
|
||||
GimpRGB *color)
|
||||
{
|
||||
cairo_set_source_rgb (cr, color->r, color->g, color->b);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_cairo_set_source_rgba:
|
||||
* @cr: Cairo context
|
||||
* @color: GimpRGB color
|
||||
*
|
||||
* Sets the source pattern within @cr to the solid translucent color
|
||||
* described by @color.
|
||||
*
|
||||
* This function calls cairo_set_source_rgba() for you.
|
||||
*
|
||||
* Since: GIMP 2.6
|
||||
**/
|
||||
void
|
||||
gimp_cairo_set_source_color (cairo_t *cr,
|
||||
GimpRGB *color)
|
||||
gimp_cairo_set_source_rgba (cairo_t *cr,
|
||||
GimpRGB *color)
|
||||
{
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
cairo_set_source_rgba (cr, color->r, color->g, color->b, color->a);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,9 @@
|
||||
#define __GIMP_CAIRO_UTILS_H__
|
||||
|
||||
|
||||
void gimp_cairo_set_source_color (cairo_t *cr,
|
||||
void gimp_cairo_set_source_rgb (cairo_t *cr,
|
||||
GimpRGB *color);
|
||||
void gimp_cairo_set_source_rgba (cairo_t *cr,
|
||||
GimpRGB *color);
|
||||
cairo_pattern_t * gimp_cairo_checkerboard_create (cairo_t *cr,
|
||||
gint size);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpcellrenderercolor.c
|
||||
* Copyright (C) 2004 Sven Neuman <sven1@gimp.org>
|
||||
* Copyright (C) 2004,2007 Sven Neuman <sven1@gimp.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -244,8 +244,7 @@ gimp_cell_renderer_color_render (GtkCellRenderer *cell,
|
||||
rect.x + 1, rect.y + 1,
|
||||
rect.width - 2, rect.height - 2);
|
||||
|
||||
cairo_set_source_rgb (cr,
|
||||
color->color.r, color->color.g, color->color.b);
|
||||
gimp_cairo_set_source_rgb (cr, &color->color);
|
||||
cairo_fill (cr);
|
||||
|
||||
if (! color->opaque && color->color.a < 1.0)
|
||||
@ -263,7 +262,7 @@ gimp_cell_renderer_color_render (GtkCellRenderer *cell,
|
||||
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
gimp_cairo_set_source_color (cr, &color->color);
|
||||
gimp_cairo_set_source_rgba (cr, &color->color);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,8 @@ EXPORTS
|
||||
gimp_button_get_type
|
||||
gimp_button_new
|
||||
gimp_cairo_checkerboard_create
|
||||
gimp_cairo_set_source_color
|
||||
gimp_cairo_set_source_rgb
|
||||
gimp_cairo_set_source_rgba
|
||||
gimp_cairo_surface_create_from_pixbuf
|
||||
gimp_cell_renderer_color_get_type
|
||||
gimp_cell_renderer_color_new
|
||||
|
Reference in New Issue
Block a user