Merging r50049 through r50076 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / space_node / space_node.c
index 7e63447d2a481865495f7b8988addfde87f2ee71..fbe282915000c8cc5ec2c941c7fd1842fd9bcf05 100644 (file)
  */
 
 
-#include <string.h>
-#include <stdio.h>
 
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
 #include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
 #include "DNA_world_types.h"
 
 #include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
-#include "BLI_rand.h"
-#include "BLI_utildefines.h"
 
 #include "BKE_colortools.h"
 #include "BKE_context.h"
 #include "BKE_screen.h"
 #include "BKE_node.h"
 
-#include "ED_space_api.h"
 #include "ED_render.h"
 #include "ED_screen.h"
-
+#include "ED_node.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -64,7 +57,7 @@
 
 #include "RNA_access.h"
 
-#include "node_intern.h"    // own include
+#include "node_intern.h"  /* own include */
 
 /* ******************** manage regions ********************* */
 
@@ -266,7 +259,7 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
        }
 }
 
-static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
+static void node_area_refresh(const struct bContext *C, ScrArea *sa)
 {
        /* default now: refresh node is starting preview */
        SpaceNode *snode = sa->spacedata.first;
@@ -299,8 +292,9 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
                                        snode->recalc = 0;
                                        node_render_changed_exec((struct bContext *)C, NULL);
                                }
-                               else
-                                       snode_composite_job(C, sa);
+                               else {
+                                       ED_node_composite_job(C, snode->nodetree, scene);
+                               }
                        }
                }
                else if (snode->treetype == NTREE_TEXTURE) {
@@ -349,7 +343,7 @@ static void node_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
 
        /* convert mouse coordinates to v2d space */
        UI_view2d_region_to_view(&ar->v2d, win->eventstate->x - ar->winrct.xmin, win->eventstate->y - ar->winrct.ymin,
-                                &snode->mx, &snode->my);
+                                &snode->cursor[0], &snode->cursor[1]);
 
        node_set_cursor(win, snode);
 }