2.5
[blender-staging.git] / source / blender / editors / space_info / space_info.c
index 82bc6949c6117659188d1798116c59e3da5612bf..d72ecd60da912b187a97a66f327f1052658a4b1e 100644 (file)
 #include "BLI_arithb.h"
 #include "BLI_rand.h"
 
+#include "BKE_context.h"
 #include "BKE_colortools.h"
-#include "BKE_global.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;
@@ -119,7 +120,7 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "info", SPACE_INFO, 0);  /* XXX weak? */
@@ -129,10 +130,10 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
 static void info_main_area_draw(const bContext *C, ARegion *ar)
 {
        /* draw entirely, view changes should be handled here */
-       // SpaceInfo *sinfo= C->area->spacedata.first;
+       // 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;