libgimpbase/gimpchecks.h moved check size and check color defines. It

2004-09-03  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpchecks.h
	* libgimpbase/gimplimits.h: moved check size and check color
	defines. It makes a lot more sense to keep them in gimpchecks.h.

	* libgimpbase/gimpchecks.c (gimp_checks_get_shades): documented.

	* libgimp/gimpdrawablepreview.c (gimp_drawable_preview_draw):
	added a sanity check so we don't crash if the drawable pointer
	should ever be NULL here.
This commit is contained in:
Sven Neumann 2004-09-03 11:18:56 +00:00 committed by Sven Neumann
parent bf441c106f
commit 1b81142365
8 changed files with 68 additions and 46 deletions

View File

@ -1,3 +1,15 @@
2004-09-03 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpchecks.h
* libgimpbase/gimplimits.h: moved check size and check color
defines. It makes a lot more sense to keep them in gimpchecks.h.
* libgimpbase/gimpchecks.c (gimp_checks_get_shades): documented.
* libgimp/gimpdrawablepreview.c (gimp_drawable_preview_draw):
added a sanity check so we don't crash if the drawable pointer
should ever be NULL here.
2004-09-02 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite-*test.c: a regression test now

View File

@ -29,6 +29,10 @@ gimp_image_type_get_type
<SECTION>
<FILE>gimpchecks</FILE>
GIMP_CHECK_SIZE
GIMP_CHECK_SIZE_SM
GIMP_CHECK_DARK
GIMP_CHECK_LIGHT
gimp_checks_get_shades
</SECTION>
@ -54,10 +58,6 @@ GIMP_MAX_IMAGE_SIZE
GIMP_MIN_RESOLUTION
GIMP_MAX_RESOLUTION
GIMP_MAX_MEMSIZE
GIMP_CHECK_SIZE
GIMP_CHECK_SIZE_SM
GIMP_CHECK_DARK
GIMP_CHECK_LIGHT
</SECTION>
<SECTION>

View File

@ -9,12 +9,40 @@ gimpchecks
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### MACRO GIMP_CHECK_SIZE ##### -->
<para>
The default checkerboard size in pixels. This is configurable in the
core but GIMP plug-ins can't access the user preference and should use
this constant instead.
</para>
<!-- ##### MACRO GIMP_CHECK_SIZE_SM ##### -->
<para>
The default small checkerboard size in pixels.
</para>
<!-- ##### MACRO GIMP_CHECK_DARK ##### -->
<para>
The dark gray value for the default checkerboard pattern.
</para>
<!-- ##### MACRO GIMP_CHECK_LIGHT ##### -->
<para>
The light gray value for the default checkerboard pattern.
</para>
<!-- ##### FUNCTION gimp_checks_get_shades ##### -->
<para>

View File

@ -60,33 +60,3 @@ the #GimpMemsizeEntry doesn't handle larger values.
<!-- ##### MACRO GIMP_CHECK_SIZE ##### -->
<para>
The default checkerboard size in pixels. This is configurable in the
core but GIMP plug-ins can't access the user preference and should use
this constant instead.
</para>
<!-- ##### MACRO GIMP_CHECK_SIZE_SM ##### -->
<para>
The default small checkerboard size in pixels.
</para>
<!-- ##### MACRO GIMP_CHECK_DARK ##### -->
<para>
The dark gray value for the default checkerboard pattern.
</para>
<!-- ##### MACRO GIMP_CHECK_LIGHT ##### -->
<para>
The light gray value for the default checkerboard pattern.
</para>

View File

@ -229,6 +229,7 @@ gimp_drawable_preview_draw (GimpDrawablePreview *preview,
GimpDrawable *drawable;
g_return_if_fail (GIMP_IS_DRAWABLE_PREVIEW (preview));
g_return_if_fail (preview->drawable != NULL);
g_return_if_fail (buf != NULL);
gimp_preview = GIMP_PREVIEW (preview);

View File

@ -29,6 +29,17 @@
#include "gimpchecks.h"
/**
* gimp_checks_get_shades:
* @type: the checkerboard type
* @light: return location for the light shade
* @dark: return location for the dark shade
*
* Retrieves the actual shades of gray to use when drawing a
* checkerboard for a certain #GimpCheckType.
*
* Since: GIMP 2.2
**/
void
gimp_checks_get_shades (GimpCheckType type,
guchar *light,

View File

@ -21,6 +21,17 @@
#define __GIMP_CHECKS_H__
/* the default size of the checks which indicate transparency ...
*/
#define GIMP_CHECK_SIZE 8
#define GIMP_CHECK_SIZE_SM 4
/* ... and their default shades
*/
#define GIMP_CHECK_DARK 0.4
#define GIMP_CHECK_LIGHT 0.6
void gimp_checks_get_shades (GimpCheckType type,
guchar *light,
guchar *dark);

View File

@ -42,15 +42,4 @@
*/
/* the size of the checks which indicate transparency...
*/
#define GIMP_CHECK_SIZE 8
#define GIMP_CHECK_SIZE_SM 4
/* ...and their colors
*/
#define GIMP_CHECK_DARK 0.4
#define GIMP_CHECK_LIGHT 0.6
#endif /* __GIMP_LIMITS_H__ */