From 80ee09bb9a03a58019b2054d7e0d280658858656 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 30 Jun 2009 19:10:14 +0000 Subject: RNA * Add Image.dirty boolean. * Added Window struct, with editable Window.screen. * Make Screen.scene editable. --- source/blender/makesrna/intern/rna_image.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/blender/makesrna/intern/rna_image.c') diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 4a6fdf5a734..c74e46c17da 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -39,6 +39,8 @@ #ifdef RNA_RUNTIME +#include "IMB_imbuf_types.h" + static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) { Image *ima= (Image*)ptr->data; @@ -52,6 +54,18 @@ static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) } } +static int rna_Image_dirty_get(PointerRNA *ptr) +{ + Image *ima= (Image*)ptr->data; + ImBuf *ibuf; + + for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next) + if(ibuf->userflags & IB_BITMAPDIRTY) + return 1; + + return 0; +} + #else static void rna_def_imageuser(BlenderRNA *brna) @@ -174,6 +188,11 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved."); + /* generated image (image_generated_change_cb) */ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "gen_type"); -- cgit v1.2.3