Commit 053af2f1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Sven Neumann <sven@gimp.org>

2000-05-31  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>

	* libgimp/Makefile.am
	* libgimp/gimpchannel_pdb.h
	* libgimp/gimpdisplay_pdb.h
	* libgimp/gimpdrawable_pdb.h
	* libgimp/gimpgradient_pdb.h
	* libgimp/gimphelp_pdb.h
	* libgimp/gimpimage_pdb.h
	* libgimp/gimplayer_pdb.h
	* libgimp/gimpparasite_pdb.h
	* libgimp/gimpselection_pdb.h
	* libgimp/gimpunit_pdb.h
	* libgimp/gimpdrawable.[ch]
	* libgimp/gimphelp.c
	* libgimp/gimppixelrgn.h
	* libgimp/gimptile.h: new files

	* libgimp/gimp.[ch]
	* libgimp/gimpchannel_pdb.c
	* libgimp/gimpdrawable_pdb.c
	* libgimp/gimpgradient_pdb.c
	* libgimp/gimppalette_pdb.c
	* libgimp/gimpselection_pdb.c
	* libgimp/gimphelp_pdb.c
	* libgimp/gimpimage_pdb.c
	* libgimp/gimplayer_pdb.c
	* libgimp/gimpgradientmenu.c
	* libgimp/gimpbrushmenu.c
	* libgimp/gimpmenu.[ch]
	* libgimp/gimppatternmenu.c
	* libgimp/gimppixelrgn.c
	* libgimp/gimptile.c: part III of the (final) libgimp cleanup

	Split gimp.h into a bunch of headers. More or less finished the
	task of moving PDB wrappers into separate files in preparation
	of the upcoming autogen-it-all-attack.

	* libgimp/gimpcompat.h: declared the following functions obsolete:
	gimp_[channel|layer]_[width|height]
	gimp_layer_[bpp|type]
	gimp_channel_get_[image|layer]_ID

	* libgimp/gimptypes.h: new file:
	GPlugInInfo
	GTile
	GDrawable
	GPixelRgn
	GParamColor
	GParamRegion
	GParamData
	GParamDef
	GParam: s/G/Gimp/

	* app/gimphelp_cmds.c
	* app/plug_in_cmds.c
	* tools/pdbgen/pdb/gimphelp.pdb
	* tools/pdbgen/pdb/plug_in.pdb: changed help texts.
parent 804af727
2000-05-31 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
* libgimp/Makefile.am
* libgimp/gimpchannel_pdb.h
* libgimp/gimpdisplay_pdb.h
* libgimp/gimpdrawable_pdb.h
* libgimp/gimpgradient_pdb.h
* libgimp/gimphelp_pdb.h
* libgimp/gimpimage_pdb.h
* libgimp/gimplayer_pdb.h
* libgimp/gimpparasite_pdb.h
* libgimp/gimpselection_pdb.h
* libgimp/gimpunit_pdb.h
* libgimp/gimpdrawable.[ch]
* libgimp/gimphelp.c
* libgimp/gimppixelrgn.h
* libgimp/gimptile.h: new files
* libgimp/gimp.[ch]
* libgimp/gimpchannel_pdb.c
* libgimp/gimpdrawable_pdb.c
* libgimp/gimpgradient_pdb.c
* libgimp/gimppalette_pdb.c
* libgimp/gimpselection_pdb.c
* libgimp/gimphelp_pdb.c
* libgimp/gimpimage_pdb.c
* libgimp/gimplayer_pdb.c
* libgimp/gimpgradientmenu.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.[ch]
* libgimp/gimppatternmenu.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: part III of the (final) libgimp cleanup
Split gimp.h into a bunch of headers. More or less finished the
task of moving PDB wrappers into separate files in preparation
of the upcoming autogen-it-all-attack.
* libgimp/gimpcompat.h: declared the following functions obsolete:
gimp_[channel|layer]_[width|height]
gimp_layer_[bpp|type]
gimp_channel_get_[image|layer]_ID
* libgimp/gimptypes.h: new file:
GPlugInInfo
GTile
GDrawable
GPixelRgn
GParamColor
GParamRegion
GParamData
GParamDef
GParam: s/G/Gimp/
* app/gimphelp_cmds.c
* app/plug_in_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb
* tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 Michael Natterer <mitch@gimp.org>
* app/gimpunit.c
......
......@@ -123,7 +123,7 @@ static ProcRecord plugin_help_register_proc =
{
"gimp_plugin_help_register",
"Register a help path for a plug-in.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"2000",
......
......@@ -437,7 +437,7 @@ static ProcRecord plugin_domain_add_proc =
{
"gimp_plugin_domain_add",
"Adds a textdomain for localisation.",
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is use by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before a procedure is installed.",
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Sven Neumann",
"Sven Neumann",
"2000",
......
......@@ -31,6 +31,7 @@ libgimpi_a_SOURCES = \
gimpchainbutton.h \
gimpcolorbutton.c \
gimpcolorspace.c \
gimpcolorspace.h \
gimpdialog.c \
gimpdialog.h \
gimpfileselection.c \
......@@ -78,31 +79,48 @@ endif
libgimp_la_SOURCES = \
gimp.c \
gimp.h \
gimpchannel_pdb.h \
gimpchannel_pdb.c \
gimpcolorbutton.h \
gimpcolorspace.c \
gimpcolorspace.h \
gimpdisplay_pdb.c \
gimpdisplay_pdb.h \
gimpdrawable.c \
gimpdrawable.h \
gimpdrawable_pdb.c \
gimpdrawable_pdb.h \
gimpenv.c \
gimpenv.h \
gimpgradient_pdb.c \
gimphelp.c \
gimphelp_pdb.c \
gimphelp_pdb.h \
gimpimage_pdb.c \
gimpimage_pdb.h \
gimplayer_pdb.c \
gimplayer_pdb.h \
gimpmatrix.c \
gimpmatrix.h \
gimppalette_pdb.c \
gimpparasite_pdb.c \
gimpparasite.c \
gimpparasite.h \
gimpparasiteio.c \
gimpparasiteio.h \
gimpparasite_pdb.c \
gimpparasite_pdb.h \
gimppixelrgn.c \
gimppixelrgn.h \
gimpprotocol.c \
gimpprotocol.h \
gimpselection_pdb.c \
gimpselection_pdb.h \
gimpsignal.c \
gimpsignal.h \
gimptile.c \
gimptile.h \
gimpunit_pdb.c \
gimpunit_pdb.h \
gimpunit.h \
gimputils.c \
gimputils.h \
......@@ -120,6 +138,7 @@ libgimpui_la_SOURCES = \
gimppatternmenu.c \
gimpchainbutton.c \
gimpcolorbutton.c \
gimpcolorbutton.h \
gimpdialog.c \
gimpexport.c \
gimpfileselection.c \
......@@ -134,6 +153,16 @@ libgimpui_la_SOURCES = \
gimpinclude_HEADERS = \
gimp.h \
gimpchannel_pdb.h \
gimpdisplay_pdb.h \
gimpdrawable_pdb.h \
gimpgradient_pdb.h \
gimphelp_pdb.h \
gimpimage_pdb.h \
gimplayer_pdb.h \
gimppalette_pdb.h \
gimpparasite_pdb.h \
gimpselection_pdb.h \
gimpchainbutton.h \
gimpcolorbutton.h \
gimpcolordisplay.h \
......@@ -155,18 +184,23 @@ gimpinclude_HEADERS = \
gimpparasite.h \
gimpparasiteio.h \
gimppatheditor.h \
gimppixelrgn.h \
gimppixmap.h \
gimpquerybox.h \
gimpsignal.h \
gimpsizeentry.h \
gimptile.h \
gimptypes.h \
gimpui.h \
gimpunit.h \
gimpunitmenu.h \
gimputils.h \
gimpunit.h \
gimpunit_pdb.h \
gimpunitmenu.h \
gimputils.h \
gimpvector.h \
gimpwidgets.h \
gimpintl.h
libgimp_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
......
This diff is collapsed.
This diff is collapsed.
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpbrushmenu.c
* Copyright (C) 1998 Andy Thomas
*
* This library is free software; you can redistribute it and/or
......@@ -28,7 +30,7 @@
* completely controls the selection of a brush.
* you get a widget returned that you can use in a table say.
* In:- Initial brush name. Null means use current selection.
* pointer to func to call when brush changes (GRunBrushCallback).
* pointer to func to call when brush changes (GimpRunBrushCallback).
* Returned:- Pointer to a widget that you can use in UI.
*
* Widget simply made up of a preview widget (20x20) containing the brush mask
......@@ -45,22 +47,22 @@
struct __brushes_sel
{
gchar *dname;
GRunBrushCallback cback;
GtkWidget *brush_preview;
GtkWidget *device_brushpopup;
GtkWidget *device_brushpreview;
GtkWidget *button;
GtkWidget *top_hbox;
gchar *brush_name; /* Local copy */
gdouble opacity;
gint spacing;
gint paint_mode;
gint width;
gint height;
gchar *mask_data; /* local copy */
void *brush_popup_pnt; /* Pointer use to control the popup */
gpointer data;
gchar *dname;
GimpRunBrushCallback cback;
GtkWidget *brush_preview;
GtkWidget *device_brushpopup;
GtkWidget *device_brushpreview;
GtkWidget *button;
GtkWidget *top_hbox;
gchar *brush_name; /* Local copy */
gdouble opacity;
gint spacing;
gint paint_mode;
gint width;
gint height;
gchar *mask_data; /* local copy */
void *brush_popup_pnt; /* Pointer use to control the popup */
gpointer data;
};
typedef struct __brushes_sel BSelect;
......@@ -131,7 +133,7 @@ brush_popup_open (gint x,
(guchar *)buf, 0, y, bsel->width);
src += bsel->width;
}
g_free(buf);
g_free (buf);
/* Draw the brush preview */
gtk_widget_draw (bsel->device_brushpreview, NULL);
......@@ -217,19 +219,21 @@ brush_pre_update(GtkWidget *brush_preview,
/* Set buffer to white */
memset (buf, 255, CELL_SIZE);
for (i = 0; i < CELL_SIZE; i++)
gtk_preview_draw_row (GTK_PREVIEW(brush_preview), (guchar *)buf, 0, i, CELL_SIZE);
gtk_preview_draw_row (GTK_PREVIEW (brush_preview),
(guchar *)buf, 0, i, CELL_SIZE);
offset_x = ((CELL_SIZE - width) >> 1);
offset_y = ((CELL_SIZE - height) >> 1);
ystart = CLAMP (offset_y, 0, CELL_SIZE);
yend = CLAMP (offset_y + height, 0, CELL_SIZE);
yend = CLAMP (offset_y + height, 0, CELL_SIZE);
src = mask_data;
for (y = ystart; y < yend; y++)
{
int j;
gint j;
s = src;
b = buf;
for (j = 0; j < width ; j++)
......@@ -257,7 +261,7 @@ brush_select_invoker (gchar *name,
gpointer data)
{
gint mask_d_sz;
BSelect *bsel = (BSelect*)data;
BSelect *bsel = (BSelect *) data;
if(bsel->mask_data != NULL)
g_free(bsel->mask_data);
......@@ -268,16 +272,17 @@ brush_select_invoker (gchar *name,
bsel->mask_data = g_malloc (mask_d_sz);
g_memmove(bsel->mask_data, mask_data, mask_d_sz);
brush_pre_update (bsel->brush_preview, bsel->width, bsel->height, bsel->mask_data);
brush_pre_update (bsel->brush_preview,
bsel->width, bsel->height, bsel->mask_data);
bsel->opacity = opacity;
bsel->spacing = spacing;
bsel->paint_mode = paint_mode;
if(bsel->cback != NULL)
(bsel->cback)(name, opacity, spacing, paint_mode,
width, height, mask_data, closing, bsel->data);
if (bsel->cback != NULL)
(bsel->cback) (name, opacity, spacing, paint_mode,
width, height, mask_data, closing, bsel->data);
if(closing)
if (closing)
{
gtk_widget_set_sensitive (bsel->button, TRUE);
bsel->brush_popup_pnt = NULL;
......@@ -304,13 +309,13 @@ brush_select_callback (GtkWidget *widget,
}
GtkWidget *
gimp_brush_select_widget (gchar *dname,
gchar *ibrush,
gdouble opacity,
gint spacing,
gint paint_mode,
GRunBrushCallback cback,
gpointer data)
gimp_brush_select_widget (gchar *dname,
gchar *ibrush,
gdouble opacity,
gint spacing,
gint paint_mode,
GimpRunBrushCallback cback,
gpointer data)
{
GtkWidget *frame;
GtkWidget *hbox;
......@@ -369,15 +374,15 @@ gimp_brush_select_widget (gchar *dname,
bsel->brush_name = brush_name;
bsel->width = width;
bsel->height = height;
if(opacity != -1)
if (opacity != -1)
bsel->opacity = opacity;
else
bsel->opacity = init_opacity;
if(spacing != -1)
if (spacing != -1)
bsel->spacing = spacing;
else
bsel->spacing = init_spacing;
if(paint_mode != -1)
if (paint_mode != -1)
bsel->paint_mode = paint_mode;
else
bsel->paint_mode = init_paint_mode;
......@@ -394,7 +399,7 @@ gimp_brush_select_widget (gchar *dname,
(GtkSignalFunc) brush_select_callback,
(gpointer)bsel);
gtk_object_set_data(GTK_OBJECT(hbox),BSEL_DATA_KEY,(gpointer)bsel);
gtk_object_set_data (GTK_OBJECT (hbox), BSEL_DATA_KEY, (gpointer) bsel);
return hbox;
}
......@@ -405,8 +410,8 @@ gimp_brush_select_widget_close_popup (GtkWidget *widget)
{
gboolean ret_val = FALSE;
BSelect *bsel;
bsel = (BSelect*) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
bsel = (BSelect *) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
if (bsel && bsel->brush_popup_pnt)
{
......@@ -434,7 +439,7 @@ gimp_brush_select_widget_set_popup (GtkWidget *widget,
gchar *brush_name;
BSelect *bsel;
bsel = (BSelect*) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
bsel = (BSelect *) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
if (bsel)
{
......
......@@ -16,6 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
......@@ -84,30 +85,6 @@ gimp_channel_delete (gint32 channel_ID)
gimp_destroy_params (return_vals, nreturn_vals);
}
guint
gimp_channel_width (gint32 channel_ID)
{
return gimp_drawable_width (channel_ID);
}
guint
gimp_channel_height (gint32 channel_ID)
{
return gimp_drawable_height (channel_ID);
}
gint32
gimp_channel_get_image_id (gint32 channel_ID)
{
return gimp_drawable_image_id (channel_ID);
}
gint32
gimp_channel_get_layer_id (gint32 channel_ID)
{
return -1;
}
void
gimp_channel_get_color (gint32 channel_ID,
guchar *red,
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpchannel_pdb.h
*
* 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 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
* Lesser General Public License for more details.
*
* 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_CHANNEL_PDB_H__
#define __GIMP_CHANNEL_PDB_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* For information look into the C source or the html documentation */
gint32 gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color);
gint32 gimp_channel_copy (gint32 channel_ID);
void gimp_channel_delete (gint32 channel_ID);
void gimp_channel_get_color (gint32 channel_ID,
guchar *red,
guchar *green,
guchar *blue);
gchar * gimp_channel_get_name (gint32 channel_ID);
gdouble gimp_channel_get_opacity (gint32 channel_ID);
gint gimp_channel_get_show_masked (gint32 channel_ID);
gboolean gimp_channel_get_visible (gint32 channel_ID);
void gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue);
void gimp_channel_set_name (gint32 channel_ID,
gchar *name);
void gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity);
void gimp_channel_set_show_masked (gint32 channel_ID,
gint show_masked);
void gimp_channel_set_visible (gint32 channel_ID,
gboolean visible);
gint32 gimp_channel_get_tattoo (gint32 channel_ID);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_CHANNEL_PDB_H__ */
......@@ -37,16 +37,29 @@ extern "C" {
#define gimp_drawable_attach_parasite gimp_drawable_parasite_attach
#define gimp_drawable_detach_parasite gimp_drawable_parasite_detach
#define gimp_drawable_find_parasite gimp_drawable_parasite_find
#define gimp_drawable_channel gimp_drawable_is_channel
#define gimp_drawable_gray gimp_drawable_is_gray
#define gimp_drawable_color gimp_drawable_is_rgb
#define gimp_drawable_indexed gimp_drawable_is_indexed
#define gimp_drawable_layer gimp_drawable_is_layer
#define gimp_drawable_layer_mask gimp_drawable_is_layer_mask
#define gimp_image_disable_undo gimp_image_undo_disable
#define gimp_image_enable_undo gimp_image_undo_enable
#define gimp_image_freeze_undo gimp_image_undo_freeze
#define gimp_image_thaw_undo gimp_image_undo_thaw
#define gimp_channel_width gimp_drawable_width
#define gimp_channel_height gimp_drawable_height
#define gimp_channel_get_image_ID gimp_drawable_get_image_ID
#define gimp_channel_get_layer_ID -1
#define gimp_layer_width gimp_drawable_width
#define gimp_layer_height gimp_drawable_height
#define gimp_layer_bpp gimp_drawable_bpp
#define gimp_layer_type gimp_drawable_type
#define gimp_plugin_help_func gimp_standard_help_func
#define Parasite GimpParasite
......@@ -76,6 +89,16 @@ extern "C" {
#define pixpipeparams_parse gimp_pixpipe_params_parse
#define pixpipeparams_build gimp_pixpipe_params_build
#define GPlugInInfo GimpPlugInInfo
#define GTile GimpTile
#define GDrawable GimpDrawable
#define GPixelRgn GimpPixelRgn
#define GParamColor GimpParamColor
#define GParamRegion GimpParamRegion
#define GParamData GimpParamData
#define GParamDef GimpParamDef
#define GParam GimpParam
#endif /* GIMP_DISABLE_COMPAT_H */
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpdisplay_pdb.h
*
* 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 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
* Lesser General Public License for more details.
*
* 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_DISPLAY_PDB_H__
#define __GIMP_DISPLAY_PDB_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* For information look into the C source or the html documentation */
gint32 gimp_display_new (gint32 image_ID);
void gimp_display_delete (gint32 display_ID);
void gimp_displays_flush (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_DISPLAY_PDB_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpdrawable.c
*
* 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 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
* Library General Public License for more details.
*
* 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 <string.h>
#include <glib.h>
#include "gimp.h"
#define TILE_WIDTH _gimp_tile_width
#define TILE_HEIGHT _gimp_tile_height
extern gint _gimp_tile_width;
extern gint _gimp_tile_height;
GimpDrawable *
gimp_drawable_get (gint32 drawable_ID)
{
GimpDrawable *drawable;
drawable = g_new (GimpDrawable, 1);
drawable->id = drawable_ID;
drawable->width = gimp_drawable_width (drawable_ID);
drawable->height = gimp_drawable_height (drawable_ID);
drawable->bpp = gimp_drawable_bpp (drawable_ID);
drawable->ntile_rows = (drawable->height + TILE_HEIGHT - 1) / TILE_HEIGHT;
drawable->ntile_cols = (drawable->width + TILE_WIDTH - 1) / TILE_WIDTH;
drawable->tiles = NULL;
drawable->shadow_tiles = NULL;
return drawable;
}
void
gimp_drawable_detach (GimpDrawable *drawable)
{
if (drawable)
{
gimp_drawable_flush (drawable);
if (drawable->tiles)
g_free (drawable->tiles);
if (drawable->shadow_tiles)
g_free (drawable->shadow_tiles);
g_free (drawable);
}
}
void
gimp_drawable_flush (GimpDrawable *drawable)
{
GimpTile *tiles;
gint ntiles;
gint i;
if (drawable)
{
if (drawable->tiles)
{
tiles = drawable->tiles;
ntiles = drawable->ntile_rows * drawable->ntile_cols;
for (i = 0; i < ntiles; i++)
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
gimp_tile_flush (&tiles[i]);
}
if (drawable->shadow_tiles)
{
tiles = drawable->shadow_tiles;
ntiles = drawable->ntile_rows * drawable->ntile_cols;
for (i = 0; i < ntiles; i++)
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
gimp_tile_flush (&tiles[i]);
}
}
}
void
gimp_drawable_delete (GimpDrawable *drawable)
{
if (drawable)
{
if (gimp_drawable_is_layer (drawable->id))
gimp_layer_delete (drawable->id);
else
gimp_channel_delete (drawable->id);
}
}
gchar*
gimp_drawable_name (gint32 drawable_ID)
{
if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_name (drawable_ID);
return gimp_channel_get_name (drawable_ID);
}
gboolean
gimp_drawable_visible (gint32 drawable_ID)
{
if (gimp_drawable_is_layer (drawable_ID))
return gimp_layer_get_visible (drawable_ID);
return gimp_channel_get_visible (drawable_ID);
}
void
gimp_drawable_set_name (gint32 drawable_ID,
gchar *name)
{
if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_name (drawable_ID, name);
else
gimp_channel_set_name (drawable_ID, name);
}
void
gimp_drawable_set_visible (gint32 drawable_ID,
gint visible)
{
if (gimp_drawable_is_layer (drawable_ID))
gimp_layer_set_visible (drawable_ID, visible);
else
gimp_channel_set_visible (drawable_ID, visible);
}
GimpTile *
gimp_drawable_get_tile (GimpDrawable *drawable,
gboolean shadow,
gint row,
gint col)
{
GimpTile *tiles;
guint right_tile;
guint bottom_tile;
gint ntiles;
gint tile_num;
gint i, j, k;