Commit e68206f0 authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

actually return a value.

2005-07-10  Manish Singh  <yosh@gimp.org>

        * libgimp/gimplayer.c (gimp_layer_set_preserve_trans): actually
        return a value.

        * plug-ins/pygimp/pygimp-drawable.c: create new lock_alpha attribute,
        and deprecate old preserve_trans attribute.

        * plug-ins/pygimp/plug-ins/shadow_bevel.py: use new lock_alpha API.
parent e1be822e
2005-07-10 Manish Singh <yosh@gimp.org>
* libgimp/gimplayer.c (gimp_layer_set_preserve_trans): actually
return a value.
* plug-ins/pygimp/pygimp-drawable.c: create new lock_alpha attribute,
and deprecate old preserve_trans attribute.
* plug-ins/pygimp/plug-ins/shadow_bevel.py: use new lock_alpha API.
2005-07-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimplayertreeview.c (gimp_layer_tree_view_init):
......
......@@ -110,5 +110,5 @@ gboolean
gimp_layer_set_preserve_trans (gint32 layer_ID,
gboolean preserve_trans)
{
gimp_layer_set_lock_alpha (layer_ID, preserve_trans);
return gimp_layer_set_lock_alpha (layer_ID, preserve_trans);
}
......@@ -27,7 +27,7 @@ def shadow_bevel(img, drawable, blur, bevel, do_shadow, drop_x, drop_y):
shadow = drawable.copy(True)
img.add_layer(shadow, img.layers.index(drawable)+1)
shadow.name = drawable.name + " shadow"
shadow.preserve_trans = False
shadow.lock_alpha = False
# threshold the shadow layer to all white
pdb.gimp_threshold(shadow, 0, 255)
......
......@@ -1596,17 +1596,17 @@ lay_set_opacity(PyGimpLayer *self, PyObject *value, void *closure)
}
static PyObject *
lay_get_preserve_trans(PyGimpLayer *self, void *closure)
lay_get_lock_alpha(PyGimpLayer *self, void *closure)
{
return PyBool_FromLong(gimp_layer_get_preserve_trans(self->ID));
return PyBool_FromLong(gimp_layer_get_lock_alpha(self->ID));
}
static int
lay_set_preserve_trans(PyGimpLayer *self, PyObject *value, void *closure)
lay_set_lock_alpha(PyGimpLayer *self, PyObject *value, void *closure)
{
if (value == NULL) {
PyErr_SetString(PyExc_TypeError,
"cannot delete preserve_transparency");
"cannot delete lock_alpha");
return -1;
}
......@@ -1615,10 +1615,9 @@ lay_set_preserve_trans(PyGimpLayer *self, PyObject *value, void *closure)
return -1;
}
if (!gimp_layer_set_preserve_trans(self->ID, PyInt_AsLong(value))) {
if (!gimp_layer_set_lock_alpha(self->ID, PyInt_AsLong(value))) {
PyErr_Format(pygimp_error,
"could not set preserve transperancy setting on "
"layer (ID %d)",
"could not set lock alpha setting on layer (ID %d)",
self->ID);
return -1;
}
......@@ -1655,6 +1654,24 @@ lay_set_show_mask(PyGimpLayer *self, PyObject *value, void *closure)
return 0;
}
static PyObject *
lay_get_preserve_trans(PyGimpLayer *self, void *closure)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use lock_alpha attribute") < 0)
return NULL;
return lay_get_lock_alpha(self, closure);
}
static int
lay_set_preserve_trans(PyGimpLayer *self, PyObject *value, void *closure)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use lock_alpha attribute") < 0)
return -1;
return lay_set_lock_alpha(self, value, closure);
}
static PyGetSetDef lay_getsets[] = {
{ "is_floating_sel", (getter)lay_get_is_floating_sel, (setter)0 },
{ "mask", (getter)lay_get_mask, (setter)0 },
......@@ -1662,9 +1679,10 @@ static PyGetSetDef lay_getsets[] = {
{ "edit_mask", (getter)lay_get_edit_mask, (setter)lay_set_edit_mask },
{ "mode", (getter)lay_get_mode, (setter)lay_set_mode },
{ "opacity", (getter)lay_get_opacity, (setter)lay_set_opacity },
{ "lock_alpha", (getter)lay_get_lock_alpha, (setter)lay_set_lock_alpha },
{ "show_mask", (getter)lay_get_show_mask, (setter)lay_set_show_mask },
{ "preserve_trans", (getter)lay_get_preserve_trans,
(setter)lay_set_preserve_trans },
{ "show_mask", (getter)lay_get_show_mask, (setter)lay_set_show_mask },
{ NULL, (getter)0, (setter)0 }
};
......
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