Commit 270c8d9c authored by Manish Singh's avatar Manish Singh Committed by Manish Singh
Browse files

add undo_group_{start,end} methods.

2003-12-24  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/pygimp-image.c: add undo_group_{start,end} methods.

        * plug-ins/pygimp/foggify.py
        * plug-ins/pygimp/shadow_bevel.py: and use them here, instead of
        deprecated PDB functions.
parent 98ef157e
2003-12-24 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/pygimp-image.c: add undo_group_{start,end} methods.
* plug-ins/pygimp/foggify.py
* plug-ins/pygimp/shadow_bevel.py: and use them here, instead of
deprecated PDB functions.
2003-12-23 Manish Singh <yosh@gimp.org>
 
* plug-ins/pygimp/pygimp-image.c: remove add/remove_layer_mask
......@@ -4,7 +4,7 @@ from gimpfu import *
import time
def python_foggify(img, layer, name, colour, turbulence, opacity):
pdb.gimp_undo_push_group_start(img)
img.undo_group_start()
fog = gimp.Layer(img, name, layer.width, layer.height, RGBA_IMAGE,
opacity, NORMAL_MODE)
......@@ -25,7 +25,7 @@ def python_foggify(img, layer, name, colour, turbulence, opacity):
# apply the clouds to the layer
fog.remove_mask(MASK_APPLY)
pdb.gimp_undo_push_group_end(img)
img.undo_group_end()
register(
"python_fu_foggify",
......
......@@ -4,7 +4,7 @@ from gimpfu import *
def shadow_bevel(img, drawable, blur, bevel, do_shadow, drop_x, drop_y):
# disable undo for the image
pdb.gimp_undo_push_group_start(img)
img.undo_group_start(img)
# copy the layer
shadow = drawable.copy(TRUE)
......@@ -34,7 +34,7 @@ def shadow_bevel(img, drawable, blur, bevel, do_shadow, drop_x, drop_y):
gimp.delete(shadow)
# enable undo again
pdb.gimp_undo_push_group_end(img)
img.undo_group_end(img)
register(
"shadow_bevel",
......
......@@ -452,6 +452,18 @@ img_duplicate(PyGimpImage *self)
return pygimp_image_new(gimp_image_duplicate(self->ID));
}
static PyObject *
img_undo_group_start(PyGimpImage *self)
{
return PyInt_FromLong(gimp_image_undo_group_start(self->ID));
}
static PyObject *
img_undo_group_end(PyGimpImage *self)
{
return PyInt_FromLong(gimp_image_undo_group_end(self->ID));
}
static PyMethodDef img_methods[] = {
{"add_channel", (PyCFunction)img_add_channel, METH_VARARGS},
{"add_layer", (PyCFunction)img_add_layer, METH_VARARGS},
......@@ -496,6 +508,8 @@ static PyMethodDef img_methods[] = {
{"undo_freeze", (PyCFunction)img_undo_freeze, METH_NOARGS},
{"undo_thaw", (PyCFunction)img_undo_thaw, METH_NOARGS},
{"duplicate", (PyCFunction)img_duplicate, METH_NOARGS},
{"undo_group_start", (PyCFunction)img_undo_group_start, METH_NOARGS},
{"undo_group_end", (PyCFunction)img_undo_group_end, METH_NOARGS},
{NULL, NULL} /* sentinel */
};
......
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