2.5: Image Editor
[blender-staging.git] / source / blender / editors / space_image / space_image.c
index c82018a3aac1af99de15994f3563b357c801c7f5..e12f3bfe3578ef914043258021637cd64c47fa48 100644 (file)
@@ -270,13 +270,6 @@ static void image_refresh(const bContext *C, ScrArea *sa)
                                
                                if(sima->flag & SI_EDITTILE);
                                else sima->curtile= tf->tile;
-                               
-                               if(ima) {
-                                       if(tf->mode & TF_TILES)
-                                               ima->tpageflag |= IMA_TILES;
-                                       else
-                                               ima->tpageflag &= ~IMA_TILES;
-                               }
                        }
                }
 
@@ -286,8 +279,6 @@ static void image_refresh(const bContext *C, ScrArea *sa)
 
 static void image_listener(ScrArea *sa, wmNotifier *wmn)
 {
-       SpaceImage *sima= sa->spacedata.first;
-
        /* context changes */
        switch(wmn->category) {
                case NC_SCENE:
@@ -301,8 +292,7 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn)
                        }
                        break;
                case NC_IMAGE:  
-                       if(!wmn->reference || wmn->reference == sima->image)
-                               ED_area_tag_redraw(sa);
+                       ED_area_tag_redraw(sa);
                        break;
        }
 }
@@ -508,11 +498,17 @@ static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
 /* add handlers, stuff you only do once or on area/region changes */
 static void image_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
+#if 0
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+#else
+       ED_region_header_init(ar);
+#endif
 }
 
 static void image_header_area_draw(const bContext *C, ARegion *ar)
 {
+       ED_region_header(C, ar);
+#if 0
        float col[3];
        
        /* clear */
@@ -531,6 +527,7 @@ static void image_header_area_draw(const bContext *C, ARegion *ar)
        
        /* restore view matrix? */
        UI_view2d_view_restore(C);
+#endif
 }
 
 /**************************** spacetype *****************************/
@@ -616,10 +613,12 @@ void ED_space_image_set(bContext *C, SpaceImage *sima, Scene *scene, Object *obe
        if(sima->image && sima->image->id.us==0)
                sima->image->id.us= 1;
 
-       if(obedit)
-               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
+       if(C) {
+               if(obedit)
+                       WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
 
-       ED_area_tag_redraw(CTX_wm_area(C));
+               ED_area_tag_redraw(CTX_wm_area(C));
+       }
 }
 
 ImBuf *ED_space_image_buffer(SpaceImage *sima)