Code cleanup: remove context from RNA update functions, only one left.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 5 Sep 2011 19:34:27 +0000 (19:34 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 5 Sep 2011 19:34:27 +0000 (19:34 +0000)
14 files changed:
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/include/ED_sequencer.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_wm.c

index fac5bf1cfd2848ad42a1a57b9a0349bc7291e858..3728dd41089e805c967b8b5ecb01032255cbc863 100644 (file)
@@ -39,7 +39,6 @@
 
 struct PackedFile;
 struct bSound;
-struct bContext;
 struct ListBase;
 struct Main;
 struct Sequence;
@@ -65,12 +64,12 @@ struct bSound* sound_new_file(struct Main *main, const char *filename);
 
 // XXX unused currently
 #if 0
-struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source);
+struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source);
 
-struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end);
+struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end);
 #endif
 
-void sound_delete(struct bContext *C, struct bSound* sound);
+void sound_delete(struct Main *bmain, struct bSound* sound);
 
 void sound_cache(struct bSound* sound);
 
@@ -124,7 +123,7 @@ void sound_play_scene(struct Scene *scene);
 
 void sound_stop_scene(struct Scene *scene);
 
-void sound_seek_scene(struct bContext *C);
+void sound_seek_scene(struct Main *bmain, struct Scene *scene);
 
 float sound_sync_scene(struct Scene *scene);
 
index 9ef30bdd49bdde5b7545548be6b7c050a61cd83f..dbb2e7860c567e6bab876e78ca15b03df7f98382 100644 (file)
@@ -3603,6 +3603,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
 #ifdef WITH_AUDASPACE
 Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C); /* only for sound */
        Editing *ed= seq_give_editing(scene, TRUE);
        bSound *sound;
@@ -3624,7 +3625,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
        info = AUD_getInfo(sound->playback_handle);
 
        if (info.specs.channels == AUD_CHANNELS_INVALID) {
-               sound_delete(C, sound);
+               sound_delete(bmain, sound);
                //if(op)
                //      BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
                return NULL;
index 74f4830b86c5cb777a24b26aa606306449a1de52..ff518d69e211ebcbdc2d4aa4062831c274fd28c5 100644 (file)
@@ -203,7 +203,7 @@ void sound_exit(void)
 
 // XXX unused currently
 #if 0
-struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
+struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source)
 {
        bSound* sound = NULL;
 
@@ -211,23 +211,23 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
        strcpy(name, "buf_");
        strcpy(name + 4, source->id.name);
 
-       sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+       sound = alloc_libblock(&bmain->sound, ID_SO, name);
 
        sound->child_sound = source;
        sound->type = SOUND_TYPE_BUFFER;
 
-       sound_load(CTX_data_main(C), sound);
+       sound_load(bmain, sound);
 
        if(!sound->playback_handle)
        {
-               free_libblock(&CTX_data_main(C)->sound, sound);
+               free_libblock(&bmain->sound, sound);
                sound = NULL;
        }
 
        return sound;
 }
 
-struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end)
+struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end)
 {
        bSound* sound = NULL;
 
@@ -235,18 +235,18 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
        strcpy(name, "lim_");
        strcpy(name + 4, source->id.name);
 
-       sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+       sound = alloc_libblock(&bmain->sound, ID_SO, name);
 
        sound->child_sound = source;
        sound->start = start;
        sound->end = end;
        sound->type = SOUND_TYPE_LIMITER;
 
-       sound_load(CTX_data_main(C), sound);
+       sound_load(bmain, sound);
 
        if(!sound->playback_handle)
        {
-               free_libblock(&CTX_data_main(C)->sound, sound);
+               free_libblock(&bmain->sound, sound);
                sound = NULL;
        }
 
@@ -254,13 +254,13 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
 }
 #endif
 
-void sound_delete(struct bContext *C, struct bSound* sound)
+void sound_delete(struct Main *bmain, struct bSound* sound)
 {
        if(sound)
        {
                sound_free(sound);
 
-               free_libblock(&CTX_data_main(C)->sound, sound);
+               free_libblock(&bmain->sound, sound);
        }
 }
 
@@ -538,10 +538,11 @@ void sound_stop_scene(struct Scene *scene)
        }
 }
 
-void sound_seek_scene(struct bContext *C)
+void sound_seek_scene(struct Main *bmain, struct Scene *scene)
 {
-       struct Scene *scene = CTX_data_scene(C);
        AUD_Status status;
+       bScreen *screen;
+       int animation_playing;
 
        AUD_lock();
 
@@ -560,7 +561,12 @@ void sound_seek_scene(struct bContext *C)
                AUD_pause(scene->sound_scene_handle);
        }
 
-       if(scene->audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer)
+       animation_playing = 0;
+       for(screen=bmain->screen.first; screen; screen=screen->id.next)
+               if(screen->animtimer)
+                       animation_playing = 1;
+
+       if(scene->audio.flag & AUDIO_SCRUB && !animation_playing)
        {
                if(scene->audio.flag & AUDIO_SYNC)
                {
@@ -758,7 +764,7 @@ void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), i
 static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
 void sound_play_scene(struct Scene *UNUSED(scene)) {}
 void sound_stop_scene(struct Scene *UNUSED(scene)) {}
-void sound_seek_scene(struct bContext *UNUSED(C)) {}
+void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
 float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
 int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
 int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
index eaba8343f4d57d003ad5926f4157d23cb0972a31..aa61afbac785f3f171c52aa8d9f4e46488f50624 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "BKE_context.h"
 #include "BKE_global.h"
+#include "BKE_main.h"
 #include "BKE_sound.h"
 
 #include "UI_view2d.h"
@@ -76,6 +77,7 @@ static int change_frame_poll(bContext *C)
 /* Set the new frame number */
 static void change_frame_apply(bContext *C, wmOperator *op)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
        
        /* set the new frame number */
@@ -84,7 +86,7 @@ static void change_frame_apply(bContext *C, wmOperator *op)
        SUBFRA = 0.f;
        
        /* do updates */
-       sound_seek_scene(C);
+       sound_seek_scene(bmain, scene);
        WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
 }
 
index cd22a5c6ca4e19d61ebcff44c1b7a889951706c3..5be1403c97baefab4a0860fecdbccd35b599aa02 100644 (file)
@@ -31,8 +31,4 @@
 
 #define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f)? (szoom) : ((szoom) == 0.0f)? (1.0f) : (-1.0f/(szoom))
 
-
-/* in space_sequencer.c, for rna update function */
-void ED_sequencer_update_view(bContext *C, int view);
-
 #endif /*  ED_SEQUENCER_H */
index 66a67d7c4f2d7f5d4bc570d0b87bd46b200678ef..b199f54cde1d4bf6d0e95c8534fb308bc295b262 100644 (file)
@@ -1732,14 +1732,16 @@ static void SCREEN_OT_region_scale(wmOperatorType *ot)
 /* function to be called outside UI context, or for redo */
 static int frame_offset_exec(bContext *C, wmOperator *op)
 {
+       Main *bmain= CTX_data_main(C);
+       Scene *scene= CTX_data_scene(C);
        int delta;
        
        delta = RNA_int_get(op->ptr, "delta");
 
-       CTX_data_scene(C)->r.cfra += delta;
-       CTX_data_scene(C)->r.subframe = 0.f;
+       scene->r.cfra += delta;
+       scene->r.subframe = 0.f;
        
-       sound_seek_scene(C);
+       sound_seek_scene(bmain, scene);
 
        WM_event_add_notifier(C, NC_SCENE|ND_FRAME, CTX_data_scene(C));
        
@@ -1764,6 +1766,7 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot)
 /* function to be called outside UI context, or for redo */
 static int frame_jump_exec(bContext *C, wmOperator *op)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
        wmTimer *animtimer= CTX_wm_screen(C)->animtimer;
 
@@ -1787,7 +1790,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
                else
                        CFRA= PSFRA;
                
-               sound_seek_scene(C);
+               sound_seek_scene(bmain, scene);
 
                WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
        }
@@ -1816,6 +1819,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot)
 /* function to be called outside UI context, or for redo */
 static int keyframe_jump_exec(bContext *C, wmOperator *op)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
        Object *ob= CTX_data_active_object(C);
        bDopeSheet ads= {NULL};
@@ -1870,7 +1874,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
        /* free temp stuff */
        BLI_dlrbTree_free(&keys);
        
-       sound_seek_scene(C);
+       sound_seek_scene(bmain, scene);
 
        WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
        
@@ -2796,6 +2800,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
        bScreen *screen= CTX_wm_screen(C);
 
        if(screen->animtimer && screen->animtimer==event->customdata) {
+               Main *bmain= CTX_data_main(C);
                Scene *scene= CTX_data_scene(C);
                wmTimer *wt= screen->animtimer;
                ScreenAnimData *sad= wt->customdata;
@@ -2872,7 +2877,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e
                }
                
                if (sad->flag & ANIMPLAY_FLAG_JUMPED)
-                       sound_seek_scene(C);
+                       sound_seek_scene(bmain, scene);
                
                /* since we follow drawflags, we can't send notifier but tag regions ourselves */
                ED_update_for_newframe(CTX_data_main(C), scene, screen, 1);
index 70884d47c236f6104a75385e21dc48c03b8f535b..72dbbd9da9a1af870c085a89d0a9c6bf5557b3a9 100644 (file)
@@ -119,7 +119,7 @@ static int open_exec(bContext *C, wmOperator *op)
        info = AUD_getInfo(sound->playback_handle);
 
        if (info.specs.channels == AUD_CHANNELS_INVALID) {
-               sound_delete(C, sound);
+               sound_delete(bmain, sound);
                if(op->customdata) MEM_freeN(op->customdata);
                BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
                return OPERATOR_CANCELLED;
index 0d7cdf94bc7a81ea6543c9c6fb0b02065b9e4c6c..469184074472eb4d3f61fb914ae0e6d0851a8649 100644 (file)
@@ -41,6 +41,7 @@
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
+#include "BKE_main.h"
 #include "BKE_sound.h"
 
 #include "UI_view2d.h"
@@ -70,6 +71,7 @@
 /* Set the new frame number */
 static void graphview_cursor_apply(bContext *C, wmOperator *op)
 {
+       Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
        SpaceIpo *sipo= CTX_wm_space_graph(C);
        
@@ -78,7 +80,7 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op)
         */
        CFRA= RNA_int_get(op->ptr, "frame");
        SUBFRA=0.f;
-       sound_seek_scene(C);
+       sound_seek_scene(bmain, scene);
        
        /* set the cursor value */
        sipo->cursorVal= RNA_float_get(op->ptr, "value");
index df347506e7467511791080528640477f1f3f5905..e7673651546052e8a2ffd52f5135ce77f9904acb 100644 (file)
@@ -2174,7 +2174,7 @@ static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op))
        sseq->view++;
        if (sseq->view > SEQ_VIEW_SEQUENCE_PREVIEW) sseq->view = SEQ_VIEW_SEQUENCE;
 
-       ED_sequencer_update_view(C, sseq->view);
+       ED_area_tag_refresh(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
 }
index 36471c7ffcfd598b718f47206f697340baecb523..5a0369ef80b95dca5e0abfb948fc9607759a7270 100644 (file)
@@ -98,61 +98,6 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type)
        return ar;
 }
 
-void ED_sequencer_update_view(bContext *C, int view)
-{
-       ScrArea *sa= CTX_wm_area(C);
-       
-       ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW);
-       ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW);
-
-       switch (view) {
-               case SEQ_VIEW_SEQUENCE:
-                       if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
-                               ar_main->flag &= ~RGN_FLAG_HIDDEN;
-                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
-                       }
-                       if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) {
-                               ar_preview->flag |= RGN_FLAG_HIDDEN;
-                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
-                               WM_event_remove_handlers(C, &ar_preview->handlers);
-                       }
-                       if (ar_main) ar_main->alignment= RGN_ALIGN_NONE;
-                       if (ar_preview) ar_preview->alignment= RGN_ALIGN_NONE;
-                       break;
-               case SEQ_VIEW_PREVIEW:
-                       if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) {
-                               ar_main->flag |= RGN_FLAG_HIDDEN;
-                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
-                               WM_event_remove_handlers(C, &ar_main->handlers);
-                       }
-                       if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
-                               ar_preview->flag &= ~RGN_FLAG_HIDDEN;
-                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
-                               ar_preview->v2d.cur = ar_preview->v2d.tot;
-                       }
-                       if (ar_main) ar_main->alignment= RGN_ALIGN_NONE;
-                       if (ar_preview) ar_preview->alignment= RGN_ALIGN_NONE;
-                       break;
-               case SEQ_VIEW_SEQUENCE_PREVIEW:
-                       if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
-                               ar_main->flag &= ~RGN_FLAG_HIDDEN;
-                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
-                       }
-                       if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
-                               ar_preview->flag &= ~RGN_FLAG_HIDDEN;
-                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
-                               ar_preview->v2d.cur = ar_preview->v2d.tot;
-                       }
-                       if (ar_main) ar_main->alignment= RGN_ALIGN_NONE;
-                       if (ar_preview) ar_preview->alignment= RGN_ALIGN_TOP;
-                       break;
-       }
-
-       ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
-       ED_area_tag_redraw(sa);
-}
-
-
 /* ******************** default callbacks for sequencer space ***************** */
 
 static SpaceLink *sequencer_new(const bContext *C)
@@ -256,6 +201,88 @@ static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(s
        
 }
 
+static void sequencer_refresh(const bContext *C, ScrArea *sa)
+{
+       wmWindowManager *wm= CTX_wm_manager(C);
+       wmWindow *window= CTX_wm_window(C);
+       SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first;
+       ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW);
+       ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW);
+       int view_changed= 0;
+
+       switch (sseq->view) {
+               case SEQ_VIEW_SEQUENCE:
+                       if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
+                               ar_main->flag &= ~RGN_FLAG_HIDDEN;
+                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
+                               view_changed= 1;
+                       }
+                       if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) {
+                               ar_preview->flag |= RGN_FLAG_HIDDEN;
+                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+                               WM_event_remove_handlers((bContext*)C, &ar_preview->handlers);
+                               view_changed= 1;
+                       }
+                       if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+                               ar_main->alignment= RGN_ALIGN_NONE;
+                               view_changed= 1;
+                       }
+                       if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+                               ar_preview->alignment= RGN_ALIGN_NONE;
+                               view_changed= 1;
+                       }
+                       break;
+               case SEQ_VIEW_PREVIEW:
+                       if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) {
+                               ar_main->flag |= RGN_FLAG_HIDDEN;
+                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
+                               WM_event_remove_handlers((bContext*)C, &ar_main->handlers);
+                               view_changed= 1;
+                       }
+                       if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
+                               ar_preview->flag &= ~RGN_FLAG_HIDDEN;
+                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+                               ar_preview->v2d.cur = ar_preview->v2d.tot;
+                               view_changed= 1;
+                       }
+                       if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+                               ar_main->alignment= RGN_ALIGN_NONE;
+                               view_changed= 1;
+                       }
+                       if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+                               ar_preview->alignment= RGN_ALIGN_NONE;
+                               view_changed= 1;
+                       }
+                       break;
+               case SEQ_VIEW_SEQUENCE_PREVIEW:
+                       if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) {
+                               ar_main->flag &= ~RGN_FLAG_HIDDEN;
+                               ar_main->v2d.flag &= ~V2D_IS_INITIALISED;
+                               view_changed= 1;
+                       }
+                       if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
+                               ar_preview->flag &= ~RGN_FLAG_HIDDEN;
+                               ar_preview->v2d.flag &= ~V2D_IS_INITIALISED;
+                               ar_preview->v2d.cur = ar_preview->v2d.tot;
+                               view_changed= 1;
+                       }
+                       if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+                               ar_main->alignment= RGN_ALIGN_NONE;
+                               view_changed= 1;
+                       }
+                       if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+                               ar_preview->alignment= RGN_ALIGN_TOP;
+                               view_changed= 1;
+                       }
+                       break;
+       }
+
+       if(view_changed) {
+               ED_area_initialize(wm, window, sa);
+               ED_area_tag_redraw(sa);
+       }
+}
+
 static SpaceLink *sequencer_duplicate(SpaceLink *sl)
 {
        SpaceSeq *sseqn= MEM_dupallocN(sl);
@@ -516,6 +543,7 @@ void ED_spacetype_sequencer(void)
        st->operatortypes= sequencer_operatortypes;
        st->keymap= sequencer_keymap;
        st->dropboxes= sequencer_dropboxes;
+       st->refresh= sequencer_refresh;
 
        /* regions: main window */
        art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
index 3c60a3b4cd74365709b41beb1a40c369d9abaf53..8c2f473c65e093cba55515254b19de6c50e768df 100644 (file)
@@ -439,11 +439,10 @@ static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
        data->r.pefra= value;
 }
 
-static void rna_Scene_frame_update(bContext *C, PointerRNA *UNUSED(ptr))
+static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr)
 {
-       //Scene *scene= ptr->id.data;
-       //ED_update_for_newframe(C);
-       sound_seek_scene(C);
+       Scene *scene= (Scene*)ptr->id.data;
+       sound_seek_scene(bmain, scene);
 }
 
 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
@@ -3298,7 +3297,6 @@ void RNA_def_scene(BlenderRNA *brna)
        RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
        RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
        RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
        
        prop= RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
index be4adb405e21eb11ad1e82dacbb9ed957049ce7d..59707f05e6f60f60f86c6614ad775fa668f0e289 100644 (file)
@@ -68,13 +68,13 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
        sc->newscene= value.data;
 }
 
-static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
+static void rna_Screen_scene_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        bScreen *sc= (bScreen*)ptr->data;
 
        /* exception: can't set screens inside of area/region handers */
        if(sc->newscene) {
-               WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
+               WM_main_add_notifier(NC_SCENE|ND_SCENEBROWSE, sc->newscene);
                sc->newscene= NULL;
        }
 }
@@ -231,7 +231,6 @@ static void rna_def_screen(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL);
        RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen");
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
 
        /* collections */
index 3536091001547cb4c2a8ffd8b6154acbc876727d..35115b40d59f2eef636d68b343e18d23b4a39503 100644 (file)
@@ -805,10 +805,9 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce
 
 /* Space Graph Editor */
 
-static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
+static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
-       //SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
-       ScrArea *sa= CTX_wm_area(C);
+       ScrArea *sa= rna_area_from_space(ptr);
        
        /* after changing view mode, must force recalculation of F-Curve colors 
         * which can only be achieved using refresh as opposed to redraw
@@ -822,11 +821,10 @@ static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
        return (sipo->ghostCurves.first != NULL);
 }
 
-static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr)
+static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
-       int view = RNA_enum_get(ptr, "view_type");
-
-       ED_sequencer_update_view(C, view);
+       ScrArea *sa= rna_area_from_space(ptr);
+       ED_area_tag_refresh(sa);
 }
 
 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
@@ -1689,8 +1687,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
        RNA_def_property_enum_sdna(prop, NULL, "view");
        RNA_def_property_enum_items(prop, view_type_items);
        RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
-       RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update");
+       RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
 
        /* display type, fairly important */
        prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
@@ -1987,7 +1984,6 @@ static void rna_def_space_graph(BlenderRNA *brna)
        RNA_def_property_enum_sdna(prop, NULL, "mode");
        RNA_def_property_enum_items(prop, mode_items);
        RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
        
        /* display */
index 4c07a89a42fcfd022911df691bc6130c1d814eec..a595b121d1ae56defb86097ab515aabf6ce4f1c4 100644 (file)
@@ -482,13 +482,13 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
        win->newscreen= value.data;
 }
 
-static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
+static void rna_Window_screen_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        wmWindow *win= (wmWindow*)ptr->data;
 
        /* exception: can't set screens inside of area/region handers */
        if(win->newscreen) {
-               WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
+               WM_main_add_notifier(NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
                win->newscreen= NULL;
        }
 }
@@ -1454,7 +1454,6 @@ static void rna_def_window(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window");
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, NULL);
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, 0, "rna_Window_screen_update");
 }