app/widgets/Makefile.am removed here...

2007-12-12  Sven Neumann  <sven@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/gimpcairo-utils.[ch]: removed here...

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpcairo-utils.[ch]: and added here after some
	cleanup.

	* libgimpwidgets/gimpwidgets.h: include gimpcairo-utils.h.

	* app/widgets/gimpviewrenderer.c
	* app/widgets/gimpviewrenderergradient.c
	* app/widgets/gimpviewrendererpalette.c: changed accordingly.

	* libgimpwidgets/gimpwidgets.def: updated for Cairo utils.

	* libgimp/gimp.def: added gimp_image_get_vectors_by_tattoo.


svn path=/trunk/; revision=24339
This commit is contained in:
Sven Neumann 2007-12-12 14:17:19 +00:00 committed by Sven Neumann
parent dfaf761dc0
commit a44fa674f0
11 changed files with 75 additions and 40 deletions

View File

@ -1,3 +1,22 @@
2007-12-12 Sven Neumann <sven@gimp.org>
* app/widgets/Makefile.am
* app/widgets/gimpcairo-utils.[ch]: removed here...
* libgimpwidgets/Makefile.am
* libgimpwidgets/gimpcairo-utils.[ch]: and added here after some
cleanup.
* libgimpwidgets/gimpwidgets.h: include gimpcairo-utils.h.
* app/widgets/gimpviewrenderer.c
* app/widgets/gimpviewrenderergradient.c
* app/widgets/gimpviewrendererpalette.c: changed accordingly.
* libgimpwidgets/gimpwidgets.def: updated for Cairo utils.
* libgimp/gimp.def: added gimp_image_get_vectors_by_tattoo.
2007-12-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: added GError to GimpItem::rename().

View File

@ -36,8 +36,6 @@ libappwidgets_a_sources = \
gimpbrushselect.h \
gimpbufferview.c \
gimpbufferview.h \
gimpcairo-utils.c \
gimpcairo-utils.h \
gimpcellrendererdashes.c \
gimpcellrendererdashes.h \
gimpcellrendererviewable.c \

View File

@ -39,7 +39,6 @@
#include "core/gimpmarshal.h"
#include "core/gimpviewable.h"
#include "gimpcairo-utils.h"
#include "gimprender.h"
#include "gimpviewrenderer.h"
#include "gimpviewrenderer-utils.h"

View File

@ -27,12 +27,12 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "core/gimpgradient.h"
#include "gimpcairo-utils.h"
#include "gimprender.h"
#include "gimpviewrenderergradient.h"

View File

@ -27,12 +27,12 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "core/gimppalette.h"
#include "gimpcairo-utils.h"
#include "gimpviewrendererpalette.h"

View File

@ -336,6 +336,7 @@ EXPORTS
gimp_image_get_thumbnail_data
gimp_image_get_unit
gimp_image_get_vectors
gimp_image_get_vectors_by_tattoo
gimp_image_get_vectors_position
gimp_image_grid_get_background_color
gimp_image_grid_get_foreground_color

View File

@ -67,6 +67,8 @@ libgimpwidgets_2_0_la_sources = \
gimpbrowser.h \
gimpbutton.c \
gimpbutton.h \
gimpcairo-utils.c \
gimpcairo-utils.h \
gimpcellrenderercolor.c \
gimpcellrenderercolor.h \
gimpcellrenderertoggle.c \
@ -181,6 +183,7 @@ libgimpwidgetsinclude_HEADERS = \
gimpwidgetstypes.h \
gimpbrowser.h \
gimpbutton.h \
gimpcairo-utils.h \
gimpcellrenderercolor.h \
gimpcellrenderertoggle.h \
gimpchainbutton.h \

View File

@ -1,22 +1,23 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpcairo-utils.c
* Copyright (C) 2007 Sven Neumann <sven@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
@ -37,6 +38,8 @@
* Sets the source pattern within @cr to the 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,
@ -53,6 +56,8 @@ gimp_cairo_set_source_color (cairo_t *cr,
*
* You should avoid calling this function as there are probably more
* efficient ways of achieving the result you are looking for.
*
* Since: GIMP 2.6
**/
cairo_surface_t *
gimp_cairo_create_surface_from_pixbuf (GdkPixbuf *pixbuf)

View File

@ -1,22 +1,23 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpcairo-utils.h
* Copyright (C) 2007 Sven Neumann <sven@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_CAIRO_UTILS_H__
@ -28,9 +29,6 @@ void gimp_cairo_set_source_color (cairo_t *cr,
cairo_surface_t * gimp_cairo_create_surface_from_pixbuf (GdkPixbuf *pixbuf);
#define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8))
/* some useful macros for writing directly to a Cairo surface */
/**
@ -41,6 +39,8 @@ cairo_surface_t * gimp_cairo_create_surface_from_pixbuf (GdkPixbuf *pixbuf);
* @b: blue component
*
* Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_RGB24.
*
* Since: GIMP 2.6
**/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define GIMP_CAIRO_RGB24_SET_PIXEL(d, r, g, b) \
@ -60,24 +60,31 @@ cairo_surface_t * gimp_cairo_create_surface_from_pixbuf (GdkPixbuf *pixbuf);
* @a: alpha component
*
* Sets a single pixel in an Cairo image surface in %CAIRO_FORMAT_ARGB32.
*
* Since: GIMP 2.6
**/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \
G_STMT_START { \
guint t1, t2, t3; \
d[0] = INT_MULT ((b), (a), t1); \
d[1] = INT_MULT ((g), (a), t2); \
d[2] = INT_MULT ((r), (a), t3); \
guint tr = (a) * (r) + 0x80; \
guint tg = (a) * (g) + 0x80; \
guint tb = (a) * (b) + 0x80; \
d[0] = (((tb) >> 8) + (tb)) >> 8; \
d[1] = (((tg) >> 8) + (tg)) >> 8; \
d[2] = (((tr) >> 8) + (tr)) >> 8; \
d[3] = (a); \
} G_STMT_END
#else
#define GIMP_CAIRO_ARGB32_SET_PIXEL(d, r, g, b, a) \
G_STMT_START { \
guint t1, t2, t3; \
guint tr = (a) * (r) + 0x80; \
guint tg = (a) * (g) + 0x80; \
guint tb = (a) * (b) + 0x80; \
d[0] = (a); \
d[1] = INT_MULT ((r), (a), t1); \
d[2] = INT_MULT ((g), (a), t2); \
d[3] = INT_MULT ((b), (a), t3); \
d[1] = (((tr) >> 8) + (tr)) >> 8; \
d[2] = (((tg) >> 8) + (tg)) >> 8; \
d[3] = (((tb) >> 8) + (tb)) >> 8; \
} G_STMT_END
#endif

View File

@ -8,6 +8,8 @@ EXPORTS
gimp_button_extended_clicked
gimp_button_get_type
gimp_button_new
gimp_cairo_create_surface_from_pixbuf
gimp_cairo_set_source_color
gimp_cell_renderer_color_get_type
gimp_cell_renderer_color_new
gimp_cell_renderer_toggle_clicked

View File

@ -28,6 +28,7 @@
#include <libgimpwidgets/gimpbrowser.h>
#include <libgimpwidgets/gimpbutton.h>
#include <libgimpwidgets/gimpcairo-utils.h>
#include <libgimpwidgets/gimpcellrenderercolor.h>
#include <libgimpwidgets/gimpcellrenderertoggle.h>
#include <libgimpwidgets/gimpchainbutton.h>