merge with/from trunk at r35190
[blender.git] / source / blender / editors / space_api / spacetypes.c
index f3db414099f26dcf46fd186dedae2d3a5fea7e3f..db857d4be9f720b3df113572e499620cde660be0 100644 (file)
@@ -1,5 +1,5 @@
-/**
- * $Id: spacetypes.c
+/*
+ * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * The Original Code is Copyright (C) Blender Foundation, 2008
  *
  *
  * The Original Code is Copyright (C) Blender Foundation, 2008
  *
 #include <stdlib.h>
 
 #include "MEM_guardedalloc.h"
 #include <stdlib.h>
 
 #include "MEM_guardedalloc.h"
+
 #include "BLI_blenlib.h"
 #include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
 
 #include "DNA_object_types.h"
 
 #include "DNA_object_types.h"
-#include "DNA_scene_types.h"
 #include "DNA_windowmanager_types.h"
 
 #include "DNA_windowmanager_types.h"
 
+
 #include "BKE_context.h"
 #include "BKE_screen.h"
 #include "BKE_context.h"
 #include "BKE_screen.h"
+#include "BKE_tessmesh.h"
+
+#include "bmesh.h"
 
 #include "UI_interface.h"
 #include "UI_view2d.h"
 
 
 #include "UI_interface.h"
 #include "UI_view2d.h"
 
-#include "BIF_gl.h"
 
 #include "ED_anim_api.h"
 #include "ED_armature.h"
 #include "ED_curve.h"
 
 #include "ED_anim_api.h"
 #include "ED_armature.h"
 #include "ED_curve.h"
+#include "ED_fileselect.h"
 #include "ED_gpencil.h"
 #include "ED_markers.h"
 #include "ED_mesh.h"
 #include "ED_gpencil.h"
 #include "ED_markers.h"
 #include "ED_mesh.h"
+#include "ED_node.h"
 #include "ED_object.h"
 #include "ED_physics.h"
 #include "ED_render.h"
 #include "ED_object.h"
 #include "ED_physics.h"
 #include "ED_render.h"
@@ -54,6 +60,7 @@
 #include "ED_sound.h"
 #include "ED_uvedit.h"
 #include "ED_mball.h"
 #include "ED_sound.h"
 #include "ED_uvedit.h"
 #include "ED_mball.h"
+#include "ED_logic.h"
 
 /* only call once on startup, storage is global in BKE kernel listbase */
 void ED_spacetypes_init(void)
 
 /* only call once on startup, storage is global in BKE kernel listbase */
 void ED_spacetypes_init(void)
@@ -99,18 +106,33 @@ void ED_spacetypes_init(void)
        ED_operatortypes_metaball();
        ED_operatortypes_sound();
        ED_operatortypes_render();
        ED_operatortypes_metaball();
        ED_operatortypes_sound();
        ED_operatortypes_render();
+       ED_operatortypes_logic();
        
        
-       ui_view2d_operatortypes();
+       UI_view2d_operatortypes();
+       UI_buttons_operatortypes();
        
        
+       /* register operators */
        spacetypes = BKE_spacetypes_list();
        spacetypes = BKE_spacetypes_list();
-       for(type=spacetypes->first; type; type=type->next)
-               type->operatortypes();
-
+       for(type=spacetypes->first; type; type=type->next) {
+               if(type->operatortypes)
+                       type->operatortypes();
+       }
 
        /* Macros's must go last since they reference other operators
         * maybe we'll need to have them go after python operators too? */
 
        /* Macros's must go last since they reference other operators
         * maybe we'll need to have them go after python operators too? */
+       ED_operatormacros_armature();
        ED_operatormacros_mesh();
        ED_operatormacros_mesh();
+       ED_operatormacros_node();
        ED_operatormacros_object();
        ED_operatormacros_object();
+       ED_operatormacros_file();
+
+       /* register dropboxes (can use macros) */
+       spacetypes = BKE_spacetypes_list();
+       for(type=spacetypes->first; type; type=type->next) {
+               if(type->dropboxes)
+                       type->dropboxes();
+       }
+       
 }
 
 /* called in wm.c */
 }
 
 /* called in wm.c */
@@ -188,6 +210,11 @@ void ED_region_draw_cb_exit(ARegionType *art, void *handle)
        }
 }
 
        }
 }
 
+void *ED_region_draw_cb_customdata(void *handle)
+{
+       return ((RegionDrawCB *)handle)->customdata;
+}
+
 void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
 {
        RegionDrawCB *rdc;
 void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
 {
        RegionDrawCB *rdc;
@@ -203,19 +230,19 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
 /* ********************* space template *********************** */
 
 /* allocate and init some vars */
 /* ********************* space template *********************** */
 
 /* allocate and init some vars */
-static SpaceLink *xxx_new(const bContext *C)
+static SpaceLink *xxx_new(const bContext *UNUSED(C))
 {
        return NULL;
 }
 
 /* not spacelink itself */
 {
        return NULL;
 }
 
 /* not spacelink itself */
-static void xxx_free(SpaceLink *sl)
+static void xxx_free(SpaceLink *UNUSED(sl))
 {
 
 }
 
 /* spacetype; init callback for usage, should be redoable */
 {
 
 }
 
 /* spacetype; init callback for usage, should be redoable */
-static void xxx_init(wmWindowManager *wm, ScrArea *sa)
+static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
 {
        
        /* link area to SpaceXXX struct */
 {
        
        /* link area to SpaceXXX struct */
@@ -225,7 +252,7 @@ static void xxx_init(wmWindowManager *wm, ScrArea *sa)
        /* add types to regions */
 }
 
        /* add types to regions */
 }
 
-static SpaceLink *xxx_duplicate(SpaceLink *sl)
+static SpaceLink *xxx_duplicate(SpaceLink *UNUSED(sl))
 {
        
        return NULL;
 {
        
        return NULL;
@@ -236,13 +263,13 @@ static void xxx_operatortypes(void)
        /* register operator types for this space */
 }
 
        /* register operator types for this space */
 }
 
-static void xxx_keymap(wmKeyConfig *keyconf)
+static void xxx_keymap(wmKeyConfig *UNUSED(keyconf))
 {
        /* add default items to keymap */
 }
 
 /* only called once, from screen/spacetypes.c */
 {
        /* add default items to keymap */
 }
 
 /* only called once, from screen/spacetypes.c */
-void ED_spacetype_xxx(void)
+static void ED_spacetype_xxx(void)
 {
        static SpaceType st;
        
 {
        static SpaceType st;