2.5
[blender-staging.git] / source / blender / editors / space_info / space_info.c
index ae6b4333150d08727cb2fb6ea9519e8843c74002..d72ecd60da912b187a97a66f327f1052658a4b1e 100644 (file)
@@ -43,6 +43,7 @@
 #include "BKE_context.h"
 #include "BKE_colortools.h"
 #include "BKE_screen.h"
+#include "BKE_utildefines.h"
 
 #include "ED_space_api.h"
 #include "ED_screen.h"
@@ -62,7 +63,7 @@
 
 /* ******************** default callbacks for info space ***************** */
 
-static SpaceLink *info_new(void)
+static SpaceLink *info_new(const bContext *C)
 {
        ARegion *ar;
        SpaceInfo *sinfo;
@@ -132,7 +133,7 @@ static void info_main_area_draw(const bContext *C, ARegion *ar)
        // SpaceInfo *sinfo= (SpaceInfo*)CTX_wm_space_data(C);
        View2D *v2d= &ar->v2d;
        float col[3];
-       
+
        /* clear and setup matrix */
        UI_GetThemeColor3fv(TH_BACK, col);
        glClearColor(col[0], col[1], col[2], 0.0);
@@ -141,8 +142,7 @@ static void info_main_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_ortho(C, v2d);
                
        /* data... */
-       
-       
+
        /* reset view matrix */
        UI_view2d_view_restore(C);
        
@@ -192,6 +192,22 @@ static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
        /* context changes */
 }
 
+static void info_header_listener(ARegion *ar, wmNotifier *wmn)
+{
+       /* context changes */
+       switch(wmn->category) {
+               case NC_SCREEN:
+                       if(ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY))
+                               ED_region_tag_redraw(ar);
+                       break;
+               case NC_SCENE:
+                       if(wmn->data==ND_RENDER_RESULT)
+                               ED_region_tag_redraw(ar);
+                       break;
+       }
+       
+}
+
 /* only called once, from space/spacetypes.c */
 void ED_spacetype_info(void)
 {
@@ -222,7 +238,7 @@ void ED_spacetype_info(void)
        art->regionid = RGN_TYPE_HEADER;
        art->minsizey= HEADERY;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
-       
+       art->listener= info_header_listener;
        art->init= info_header_area_init;
        art->draw= info_header_area_draw;