Commit bd1feb95 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added gimp_pdb_layer_is_text_layer().

2008-04-02  Sven Neumann  <sven@gimp.org>

	* app/pdb/gimppdb-utils.[ch]: added 
gimp_pdb_layer_is_text_layer().


svn path=/trunk/; revision=25339
parent c5143ab8
2008-04-02 Sven Neumann <sven@gimp.org>
* app/pdb/gimppdb-utils.[ch]: added gimp_pdb_layer_is_text_layer().
2008-04-02 Sven Neumann <sven@gimp.org>
* tools/pdbgen/stddefs.pdb: fixed bug in last commit.
......
......@@ -28,8 +28,11 @@
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontainer.h"
#include "core/gimpdatafactory.h"
#include "core/gimpdrawable.h"
#include "core/gimpitem.h"
#include "text/gimptextlayer.h"
#include "vectors/gimpvectors.h"
#include "gimppdb-utils.h"
......@@ -298,7 +301,7 @@ gimp_pdb_item_is_attached (GimpItem *item,
if (! gimp_item_is_attached (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_CALLING_ERROR,
_("Item '%s' (%d) cannot be used because it has not "
_("Item '%s' (%d) can not be used because it has not "
"been added to an image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
......@@ -309,6 +312,28 @@ gimp_pdb_item_is_attached (GimpItem *item,
return TRUE;
}
gboolean
gimp_pdb_layer_is_text_layer (GimpLayer *layer,
GError **error)
{
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_CALLING_ERROR,
_("Layer '%s' (%d) can not be used because it is not "
"a text layer"),
gimp_object_get_name (GIMP_OBJECT (layer)),
gimp_item_get_ID (GIMP_ITEM (layer)));
return FALSE;
}
return gimp_pdb_item_is_attached (GIMP_ITEM (layer), error);
}
GimpStroke *
gimp_pdb_get_vectors_stroke (GimpVectors *vectors,
gint stroke_ID,
......
......@@ -20,41 +20,43 @@
#define __GIMP_PDB_UTILS_H__
GimpBrush * gimp_pdb_get_brush (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpBrush * gimp_pdb_get_generated_brush (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpPattern * gimp_pdb_get_pattern (Gimp *gimp,
const gchar *name,
GError **error);
GimpGradient * gimp_pdb_get_gradient (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpPalette * gimp_pdb_get_palette (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpFont * gimp_pdb_get_font (Gimp *gimp,
const gchar *name,
GError **error);
GimpBuffer * gimp_pdb_get_buffer (Gimp *gimp,
const gchar *name,
GError **error);
GimpPaintInfo * gimp_pdb_get_paint_info (Gimp *gimp,
const gchar *name,
GError **error);
GimpBrush * gimp_pdb_get_brush (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpBrush * gimp_pdb_get_generated_brush (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpPattern * gimp_pdb_get_pattern (Gimp *gimp,
const gchar *name,
GError **error);
GimpGradient * gimp_pdb_get_gradient (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpPalette * gimp_pdb_get_palette (Gimp *gimp,
const gchar *name,
gboolean writable,
GError **error);
GimpFont * gimp_pdb_get_font (Gimp *gimp,
const gchar *name,
GError **error);
GimpBuffer * gimp_pdb_get_buffer (Gimp *gimp,
const gchar *name,
GError **error);
GimpPaintInfo * gimp_pdb_get_paint_info (Gimp *gimp,
const gchar *name,
GError **error);
gboolean gimp_pdb_item_is_attached (GimpItem *item,
GError **error);
gboolean gimp_pdb_item_is_attached (GimpItem *item,
GError **error);
gboolean gimp_pdb_layer_is_text_layer (GimpLayer *layer,
GError **error);
GimpStroke * gimp_pdb_get_vectors_stroke (GimpVectors *vectors,
gint stroke_ID,
GError **error);
GimpStroke * gimp_pdb_get_vectors_stroke (GimpVectors *vectors,
gint stroke_ID,
GError **error);
#endif /* __GIMP_PDB_UTILS_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment