Merging r39251 through r39311 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 11 Aug 2011 18:16:29 +0000 (18:16 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 11 Aug 2011 18:16:29 +0000 (18:16 +0000)
Splash screen is kept to be tomatoes.

1  2 
build_files/scons/config/darwin-config.py
build_files/scons/tools/btools.py
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_view3d/drawobject.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 1d47892c389ba1a462fe5ae02661f92ae43a0cc6,ec6a3b082b8a0bead7854284080d489d5960e377..2737fda62e2428f94958cb33a6642d9381d22979
@@@ -98,7 -98,7 +98,7 @@@ else
  
  # enable ffmpeg  support
  WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 -BF_FFMPEG = LIBDIR + '/ffmpeg'
 +BF_FFMPEG = LIBDIR + '/ffmpeg-0.8'
  BF_FFMPEG_INC = "${BF_FFMPEG}/include"
  BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
  BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
@@@ -284,7 -284,7 +284,7 @@@ if MACOSX_ARCHITECTURE == 'i386'
  elif MACOSX_ARCHITECTURE == 'x86_64':
      BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
  
- # SpaceNavigator and related 3D mice
+ # SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
  WITH_BF_3DMOUSE = True
  
  #############################################################################
@@@ -315,9 -315,6 +315,6 @@@ if WITH_BF_QUICKTIME
        else:
                PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
  
- if FOUND_NDOF_DRIVERS:
-       PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS + ['-weak_framework','3DconnexionClient']
  #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
  LLIBS = ['stdc++', 'SystemStubs']
  
index 0259d93f6edf1e1c7c5b64f835cf187192a021b9,25e0582c536f13089213fe92763045a367804df7..e2fd5db9b22b95f664415404ee9ee1cf1cd5ca0c
@@@ -136,7 -136,7 +136,7 @@@ def validate_arguments(args, bc)
              'BF_NO_ELBEEM',
              'WITH_BF_CXX_GUARDEDALLOC',
              'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
-             'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'FOUND_NDOF_DRIVERS', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
+             'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
              ]
      
      # Have options here that scons expects to be lists
@@@ -439,7 -439,6 +439,6 @@@ def read_opts(env, cfg, args)
          (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
  
          (BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
-         (BoolVariable('FOUND_NDOF_DRIVERS', 'We detected NDOF libs or framework', False)),
          (BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
          ('BF_3DMOUSE', '3d mouse library base path', ''),
          ('BF_3DMOUSE_INC', '3d mouse library include path', ''),
          (BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)),
          (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
          
 +        (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)),
 +
          ('BF_X264_CONFIG', 'configuration flags for x264', ''),
          ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
  #        (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
index 53a17efe88deab058bf17c1ad2d2334983803e5f,169443d855fc89800f8ce056bbb77d8881470a69..01a0c81d736ab248ecceaef8eb8415d359c2fecb
@@@ -1026,28 -1026,7 +1026,28 @@@ static tGPsdata *gp_session_initpaint (
  #endif
                }
                        break;
 -
 +              case SPACE_CLIP:
 +              {
 +                      //SpaceClip *sc= curarea->spacedata.first;
 +                      
 +                      /* set the current area */
 +                      p->sa= curarea;
 +                      p->ar= ar;
 +                      p->v2d= &ar->v2d;
 +                      //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
 +                      
 +#if 0 // XXX disabled for now
 +                      /* check that gpencil data is allowed to be drawn */
 +                      if ((sc->flag & SC_DISPGP)==0) {
 +                              p->status= GP_STATUS_ERROR;
 +                              if (G.f & G_DEBUG)
 +                                      printf("Error: In active view, Grease Pencil not shown \n");
 +                              return p;
 +                      }
 +#endif
 +              }
 +                      break;
 +                      
                /* unsupported views */
                default:
                {
@@@ -1232,12 -1211,6 +1232,12 @@@ static void gp_paint_initstroke (tGPsda
                                        p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
                        }
                                break;
 +                              
 +                      case SPACE_CLIP:
 +                      {
 +                              p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
 +                      }
 +                              break;
                }
        }
  }
@@@ -1642,7 -1615,12 +1642,12 @@@ static int gpencil_area_exists(bContex
  static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
  {
        tGPsdata *p= op->customdata;
-       int estate = OPERATOR_PASS_THROUGH; /* default exit state - not handled, so let others have a share of the pie */
+       //int estate = OPERATOR_PASS_THROUGH; /* default exit state - not handled, so let others have a share of the pie */
+       /* currently, grease pencil conflicts with such operators as undo and set object mode
+          which makes behavior of operator totally unpredictable and crash for some cases.
+          the only way to solve this proper is to ger rid of pointers to data which can
+          chage stored in operator custom data (sergey) */
+       int estate = OPERATOR_RUNNING_MODAL;
        
        // if (event->type == NDOF_MOTION)
        //      return OPERATOR_PASS_THROUGH;
index c4fd67cf06fc08e0cb3f62e76e7a02263d91278c,2faac24fd783643c81c6a7daf9282de57bb3e227..1613b073ed65dee88430b9c58853207083ed8e5a
@@@ -39,6 -39,7 +39,7 @@@
  
  #include "BLI_string.h"
  #include "BLI_utildefines.h"
+ #include "BLI_ghash.h"
  
  #include "BKE_animsys.h"
  #include "BKE_colortools.h"
@@@ -2110,7 -2111,7 +2111,7 @@@ static void list_item_row(bContext *C, 
        }
        else if(itemptr->type == &RNA_ShapeKey) {
                Object *ob= (Object*)activeptr->data;
-               Key *key= (Key*)itemptr->data;
+               Key *key= (Key*)itemptr->id.data;
  
                split= uiLayoutSplit(sub, 0.75f, 0);
  
@@@ -2322,10 -2323,11 +2323,11 @@@ static void operator_call_cb(bContext *
  
  static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
  {
-       wmOperatorType *ot = WM_operatortype_first();
-       
-       for(; ot; ot= ot->next) {
-               
+       GHashIterator *iter= WM_operatortype_iter();
+       for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+               wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
                if(BLI_strcasestr(ot->name, str)) {
                        if(WM_operator_poll((bContext*)C, ot)) {
                                char name[256];
                        }
                }
        }
+       BLI_ghashIterator_free(iter);
  }
  
  void uiTemplateOperatorSearch(uiLayout *layout)
  #define B_STOPCAST            2
  #define B_STOPANIM            3
  #define B_STOPCOMPO           4
 +#define B_STOPCLIP            5
 +#define B_STOPSEQ             6
  
  static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
  {
                case B_STOPCOMPO:
                        WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL);
                        break;
 +              case B_STOPCLIP:
 +                      WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL);
 +                      break;
 +              case B_STOPSEQ:
 +                      WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL);
 +                      break;
        }
  }
  
@@@ -2412,15 -2407,7 +2415,15 @@@ void uiTemplateRunningJobs(uiLayout *la
                   owner = sa;
                handle_event= B_STOPCOMPO;
        } 
 -      else {
 +      if(sa->spacetype==SPACE_CLIP) {
 +              if(WM_jobs_test(wm, sa))
 +                 owner = sa;
 +              handle_event= B_STOPCLIP;
 +      } else if (sa->spacetype==SPACE_SEQ) {
 +              if(WM_jobs_test(wm, sa))
 +                      owner = sa;
 +              handle_event = B_STOPSEQ;
 +      } else {
                Scene *scene;
                /* another scene can be rendering too, for example via compositor */
                for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next)
index ae66511f5fc770af8cda714f79c099cef7c2658e,78788777f492b445bb15ebb447ae8afa615a5058..b7630bf9ddac8315aed85795e56a6ac9547e4df1
@@@ -74,8 -74,6 +74,8 @@@
  #include "BKE_particle.h"
  #include "BKE_pointcache.h"
  #include "BKE_unit.h"
 +#include "BKE_movieclip.h"
 +#include "BKE_tracking.h"
  
  #include "smoke_API.h"
  
@@@ -202,40 -200,6 +202,40 @@@ static void view3d_project_short_noclip
        }
  }
  
 +/* same as view3d_project_short_clip but use persmat instead of persmatob for projection */
 +static void view3d_project_short_clip_persmat(ARegion *ar, float *vec, short *adr, int local)
 +{
 +      RegionView3D *rv3d= ar->regiondata;
 +      float fx, fy, vec4[4];
 +
 +      adr[0]= IS_CLIPPED;
 +
 +      /* clipplanes in eye space */
 +      if(rv3d->rflag & RV3D_CLIPPING) {
 +              if(ED_view3d_test_clipping(rv3d, vec, local))
 +                      return;
 +      }
 +
 +      copy_v3_v3(vec4, vec);
 +      vec4[3]= 1.0;
 +
 +      mul_m4_v4(rv3d->persmat, vec4);
 +
 +      /* clipplanes in window space */
 +      if( vec4[3] > (float)BL_NEAR_CLIP ) {   /* is the NEAR clipping cutoff for picking */
 +              fx= (ar->winx/2)*(1 + vec4[0]/vec4[3]);
 +
 +              if( fx>0 && fx<ar->winx) {
 +
 +                      fy= (ar->winy/2)*(1 + vec4[1]/vec4[3]);
 +
 +                      if(fy > 0.0f && fy < (float)ar->winy) {
 +                              adr[0]= (short)floorf(fx);
 +                              adr[1]= (short)floorf(fy);
 +                      }
 +              }
 +      }
 +}
  /* ************************ */
  
  /* check for glsl drawing */
@@@ -744,12 -708,7 +744,12 @@@ void view3d_cached_text_draw_end(View3
        for(vos= strings->first; vos; vos= vos->next) {
                if(mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE))
                        mul_m4_v3(mat, vos->vec);
 -              view3d_project_short_clip(ar, vos->vec, vos->sco, 0);
 +
 +              if(vos->flag&V3D_CACHE_TEXT_GLOBALSPACE)
 +                      view3d_project_short_clip_persmat(ar, vos->vec, vos->sco, 0);
 +              else
 +                      view3d_project_short_clip(ar, vos->vec, vos->sco, 0);
 +
                if(vos->sco[0]!=IS_CLIPPED)
                        tot++;
        }
@@@ -1376,198 -1335,16 +1376,198 @@@ static void draw_focus_cross(float dist
        glEnd();
  }
  
 +/* ****************** draw clip data *************** */
 +
 +static void draw_bundle_sphere(void)
 +{
 +      static GLuint displist= 0;
 +
 +      if (displist == 0) {
 +              GLUquadricObj *qobj;
 +
 +              displist= glGenLists(1);
 +              glNewList(displist, GL_COMPILE);
 +
 +              qobj= gluNewQuadric();
 +              gluQuadricDrawStyle(qobj, GLU_FILL);
 +              glShadeModel(GL_SMOOTH);
 +              gluSphere(qobj, 0.05, 8, 8);
 +              glShadeModel(GL_FLAT);
 +              gluDeleteQuadric(qobj);
 +
 +              glEndList();
 +      }
 +
 +      glCallList(displist);
 +}
 +
 +static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d, MovieClip *clip, int flag)
 +{
 +      MovieTracking *tracking= &clip->tracking;
 +      MovieTrackingTrack *track;
 +      float mat[4][4], imat[4][4], curcol[4];
 +      unsigned char col[4], scol[4];
 +      int bundlenr= 1;
 +
 +      if((v3d->flag2&V3D_SHOW_RECONSTRUCTION)==0)
 +              return;
 +
 +      if(v3d->flag2&V3D_RENDER_OVERRIDE)
 +              return;
 +
 +      glGetFloatv(GL_CURRENT_COLOR, curcol);
 +
 +      UI_GetThemeColor4ubv(TH_TEXT, col);
 +      UI_GetThemeColor4ubv(TH_SELECT, scol);
 +
 +      BKE_get_tracking_mat(scene, mat);
 +
 +      glEnable(GL_LIGHTING);
 +      glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
 +      glEnable(GL_COLOR_MATERIAL);
 +      glShadeModel(GL_SMOOTH);
 +
 +      /* current ogl matrix is translated in camera space, bundles should
 +         be rendered in world space, so camera matrix should be "removed"
 +         from current ogl matrix */
 +      invert_m4_m4(imat, base->object->obmat);
 +
 +      glPushMatrix();
 +      glMultMatrixf(imat);
 +      glMultMatrixf(mat);
 +
 +      for ( track= tracking->tracks.first; track; track= track->next) {
 +              int selected= track->flag&SELECT || track->pat_flag&SELECT || track->search_flag&SELECT;
 +              if((track->flag&TRACK_HAS_BUNDLE)==0)
 +                      continue;
 +
 +              if(flag&DRAW_PICKING)
 +                      glLoadName(base->selcol + (bundlenr<<16));
 +
 +              glPushMatrix();
 +                      glTranslatef(track->bundle_pos[0], track->bundle_pos[1], track->bundle_pos[2]);
 +                      glScalef(v3d->bundle_size/0.05, v3d->bundle_size/0.05, v3d->bundle_size/0.05);
 +
 +                      if(v3d->drawtype==OB_WIRE) {
 +                              glDisable(GL_LIGHTING);
 +                              glDepthMask(0);
 +
 +                              if(selected) {
 +                                      if(base==BASACT) UI_ThemeColor(TH_ACTIVE);
 +                                      else UI_ThemeColor(TH_SELECT);
 +                              } else {
 +                                      if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
 +                                      else UI_ThemeColor(TH_WIRE);
 +                              }
 +
 +                              drawaxes(0.05f, v3d->bundle_drawtype);
 +
 +                              glDepthMask(1);
 +                              glEnable(GL_LIGHTING);
 +                      } else if(v3d->drawtype>OB_WIRE) {
 +                              if(v3d->bundle_drawtype==OB_EMPTY_SPHERE) {
 +                                      /* selection outline */
 +                                      if(selected) {
 +                                              if(base==BASACT) UI_ThemeColor(TH_ACTIVE);
 +                                              else UI_ThemeColor(TH_SELECT);
 +
 +                                              glDepthMask(0);
 +                                              glLineWidth(2.f);
 +                                              glDisable(GL_LIGHTING);
 +                                              glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 +
 +                                              draw_bundle_sphere();
 +
 +                                              glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 +                                              glEnable(GL_LIGHTING);
 +                                              glLineWidth(1.f);
 +                                              glDepthMask(1);
 +                                      }
 +
 +                                      if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
 +                                      else UI_ThemeColor(TH_BUNDLE_SOLID);
 +
 +                                      draw_bundle_sphere();
 +                              } else {
 +                                      glDisable(GL_LIGHTING);
 +                                      glDepthMask(0);
 +
 +                                      if(selected) {
 +                                              if(base==BASACT) UI_ThemeColor(TH_ACTIVE);
 +                                              else UI_ThemeColor(TH_SELECT);
 +                                      } else {
 +                                              if(track->flag&TRACK_CUSTOMCOLOR) glColor3fv(track->color);
 +                                              else UI_ThemeColor(TH_WIRE);
 +                                      }
 +
 +                                      drawaxes(0.05f, v3d->bundle_drawtype);
 +
 +                                      glDepthMask(1);
 +                                      glEnable(GL_LIGHTING);
 +                              }
 +                      }
 +
 +              glPopMatrix();
 +
 +              if((flag & DRAW_PICKING)==0 && (v3d->flag2&V3D_SHOW_BUNDLENAME)) {
 +                      float pos[3];
 +                      unsigned char tcol[4];
 +
 +                      if(selected) memcpy(tcol, scol, sizeof(tcol));
 +                      else memcpy(tcol, col, sizeof(tcol));
 +
 +                      mul_v3_m4v3(pos, mat, track->bundle_pos);
 +                      view3d_cached_text_draw_add(pos, track->name, 10, V3D_CACHE_TEXT_GLOBALSPACE, tcol);
 +              }
 +
 +              bundlenr++;
 +      }
 +
 +      if((flag & DRAW_PICKING)==0) {
 +              if(v3d->flag2&V3D_SHOW_CAMERAPATH && clip->tracking.reconstruction.camnr) {
 +                      int a= 0;
 +                      MovieTrackingReconstruction *reconstruction= &tracking->reconstruction;
 +                      MovieReconstructedCamera *camera= tracking->reconstruction.cameras;
 +
 +                      glDisable(GL_LIGHTING);
 +                      UI_ThemeColor(TH_CAMERA_PATH);
 +                      glLineWidth(2.0f);
 +
 +                      glBegin(GL_LINE_STRIP);
 +                              for(a= 0; a<reconstruction->camnr; a++, camera++) {
 +                                      glVertex3f(camera->mat[3][0], camera->mat[3][1], camera->mat[3][2]);
 +                              }
 +                      glEnd();
 +
 +                      glLineWidth(1.0f);
 +                      glEnable(GL_LIGHTING);
 +              }
 +      }
 +
 +      glPopMatrix();
 +
 +      /* restore */
 +      glShadeModel(GL_FLAT);
 +      glDisable(GL_COLOR_MATERIAL);
 +      glDisable(GL_LIGHTING);
 +
 +      glColor4fv(curcol);
 +
 +      if(flag&DRAW_PICKING)
 +              glLoadName(base->selcol);
 +}
 +
  #ifdef VIEW3D_CAMERA_BORDER_HACK
  float view3d_camera_border_hack_col[4];
  short view3d_camera_border_hack_test= FALSE;
  #endif
  
  /* flag similar to draw_object() */
 -static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int flag)
 +static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int flag)
  {
        /* a standing up pyramid with (0,0,0) as top */
        Camera *cam;
 +      Object *ob= base->object;
        float vec[8][4], facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy;
        int i;
        float drawsize;
        const float scay= 1.0f / len_v3(ob->obmat[1]);
        const float scaz= 1.0f / len_v3(ob->obmat[2]);
  
 +      /* draw data for movie clip set as active for scene */
 +      if(scene->clip)
 +              draw_viewport_reconstruction(scene, base, v3d, scene->clip, flag);
 +
  #ifdef VIEW3D_CAMERA_BORDER_HACK
        if(is_view && !(G.f & G_PICKSEL)) {
                glGetFloatv(GL_CURRENT_COLOR, view3d_camera_border_hack_col);
                if(is_view) {
                        /* fixed depth, variable size (avoids exceeding clipping range) */
                        depth = -(cam->clipsta + 0.1f);
 -                      fac = depth / (cam->lens/-16.0f * scaz);
 +                      fac = depth / (cam->lens/ (cam->sensor_x / 2.0f));
                }
                else {
                        /* fixed size, variable depth (stays a reasonable size in the 3D view) */
@@@ -5961,7 -5734,7 +5961,7 @@@ void draw_object(Scene *scene, ARegion 
        /* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */
        
        /* draw motion paths (in view space) */
-       if (ob->mpath) {
+       if (ob->mpath && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
                bAnimVizSettings *avs= &ob->avs;
                
                /* setup drawing environment for paths */
                        break;
                case OB_CAMERA:
                        if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */
 -                              drawcamera(scene, v3d, rv3d, ob, flag);
 +                              drawcamera(scene, v3d, rv3d, base, flag);
                        break;
                case OB_LATTICE:
                        if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
index 29d54d34acee0419080c675f4834b098efbc7f4b,d8c6933a93dfd2b9e7b34cea831c0931a168af6b..9805703d7edf815e239418ab984864d754c9e1a3
@@@ -179,7 -179,7 +179,7 @@@ void               WM_operator_free                (struct wmOpera
  void          WM_operator_stack_clear(struct wmWindowManager *wm);
  
  struct wmOperatorType *WM_operatortype_find(const char *idnamem, int quiet);
- struct wmOperatorType *WM_operatortype_first(void);
+ struct GHashIterator *WM_operatortype_iter(void);
  void          WM_operatortype_append  (void (*opfunc)(struct wmOperatorType*));
  void          WM_operatortype_append_ptr      (void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
  void          WM_operatortype_append_macro_ptr        (void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
@@@ -230,6 -230,7 +230,7 @@@ void               WM_operator_bl_idname(char *to, c
  void          WM_operator_py_idname(char *to, const char *from);
  
  /* *************** menu types ******************** */
+ void                          WM_menutype_init(void);
  struct MenuType               *WM_menutype_find(const char *idname, int quiet);
  int                                   WM_menutype_add(struct MenuType* mt);
  int                                   WM_menutype_contains(struct MenuType* mt);
@@@ -298,8 -299,6 +299,8 @@@ int                        WM_jobs_test(struct wmWindowManag
  float         WM_jobs_progress(struct wmWindowManager *wm, void *owner);
  char          *WM_jobs_name(struct wmWindowManager *wm, void *owner);
  
 +int             WM_jobs_is_running(struct wmJob *);
 +void*           WM_jobs_get_customdata(struct wmJob *);
  void          WM_jobs_customdata(struct wmJob *, void *customdata, void (*free)(void *));
  void          WM_jobs_timer(struct wmJob *, double timestep, unsigned int note, unsigned int endnote);
  void          WM_jobs_callbacks(struct wmJob *, 
index 830ccfa7d1c7337df676a94f681f10d148bc524d,cc3ae3ab753993840d6dcb47f6f1d71b884852d9..d7317f226b251487b21e54bcdc54c32418e34da6
@@@ -163,7 -163,6 +163,7 @@@ typedef struct wmNotifier 
  #define NC_NODE                               (17<<24)
  #define NC_ID                         (18<<24)
  #define NC_LOGIC                      (19<<24)
 +#define NC_MOVIECLIP                  (20<<24)
  
  /* data type, 256 entries is enough, it can overlap */
  #define NOTE_DATA                     0x00FF0000
  #define ND_SPACE_SEQUENCER            (16<<16)
  #define ND_SPACE_NODE_VIEW            (17<<16)
  #define ND_SPACE_CHANGED              (18<<16) /*sent to a new editor type after it's replaced an old one*/
 +#define ND_SPACE_CLIP                 (19<<16)
  
  /* subtype, 256 entries too */
  #define NOTE_SUBTYPE          0x0000FF00
@@@ -425,8 -423,6 +425,6 @@@ typedef struct wmTimer 
  
  
  typedef struct wmOperatorType {
-       struct wmOperatorType *next, *prev;
        const char *name;               /* text for ui, undo */
        const char *idname;             /* unique identifier */
        const char *description;        /* tooltips and python docs */
index d53b0cf6173c0f16325add2497c5a6b5440df318,66467b310eeb04d7e92a1f9d12e19d46f68a84e6..281b6aebb7fc8d677db95e97206e04f7c98f8ba3
@@@ -58,6 -58,7 +58,7 @@@
  #include "BLI_math.h"
  #include "BLI_string.h"
  #include "BLI_utildefines.h"
+ #include "BLI_ghash.h"
  
  #include "BLO_readfile.h"
  
  #include "wm_subwindow.h"
  #include "wm_window.h"
  
- static ListBase global_ops= {NULL, NULL};
+ static GHash *global_ops_hash= NULL;
  
  /* ************ operator API, exported ********** */
  
@@@ -113,7 -114,7 +114,7 @@@ wmOperatorType *WM_operatortype_find(co
        WM_operator_bl_idname(idname_bl, idname);
  
        if (idname_bl[0]) {
-               ot= (wmOperatorType *)BLI_findstring_ptr(&global_ops, idname_bl, offsetof(wmOperatorType, idname));
+               ot= BLI_ghash_lookup(global_ops_hash, idname_bl);
                if(ot) {
                        return ot;
                }
        return NULL;
  }
  
- wmOperatorType *WM_operatortype_first(void)
+ /* caller must free */
+ GHashIterator *WM_operatortype_iter(void)
  {
-       return global_ops.first;
+       return BLI_ghashIterator_new(global_ops_hash);
  }
  
  /* all ops in 1 list (for time being... needs evaluation later) */
@@@ -147,7 -149,8 +149,8 @@@ void WM_operatortype_append(void (*opfu
  
        RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)"); // XXX All ops should have a description but for now allow them not to.
        RNA_def_struct_identifier(ot->srna, ot->idname);
-       BLI_addtail(&global_ops, ot);
+       BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
  }
  
  void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *userdata)
        opfunc(ot, userdata);
        RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)");
        RNA_def_struct_identifier(ot->srna, ot->idname);
-       BLI_addtail(&global_ops, ot);
+       BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
  }
  
  /* ********************* macro operator ******************** */
@@@ -351,7 -355,7 +355,7 @@@ wmOperatorType *WM_operatortype_append_
        RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); // XXX All ops should have a description but for now allow them not to.
        RNA_def_struct_identifier(ot->srna, ot->idname);
  
-       BLI_addtail(&global_ops, ot);
+       BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
  
        return ot;
  }
@@@ -378,7 -382,7 +382,7 @@@ void WM_operatortype_append_macro_ptr(v
        RNA_def_struct_ui_text(ot->srna, ot->name, ot->description);
        RNA_def_struct_identifier(ot->srna, ot->idname);
  
-       BLI_addtail(&global_ops, ot);
+       BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
  }
  
  wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
@@@ -426,14 -430,14 +430,14 @@@ int WM_operatortype_remove(const char *
        if (ot==NULL)
                return 0;
        
-       BLI_remlink(&global_ops, ot);
        RNA_struct_free(&BLENDER_RNA, ot->srna);
        
        if(ot->macro.first)
                wm_operatortype_free_macro(ot);
-       
-       MEM_freeN(ot);
  
+       BLI_ghash_remove(global_ops_hash, (void *)ot->idname, NULL, NULL);
+       MEM_freeN(ot);
        return 1;
  }
  
@@@ -1311,9 -1315,10 +1315,10 @@@ static void operator_call_cb(struct bCo
  
  static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
  {
-       wmOperatorType *ot = WM_operatortype_first();
-       
-       for(; ot; ot= ot->next) {
+       GHashIterator *iter= WM_operatortype_iter();
+       for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+               wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
  
                if((ot->flag & OPTYPE_INTERNAL) && (G.f & G_DEBUG) == 0)
                        continue;
                        }
                }
        }
+       BLI_ghashIterator_free(iter);
  }
  
  static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_op))
@@@ -3457,26 -3463,31 +3463,31 @@@ static void WM_OT_ndof_sensitivity_chan
        RNA_def_boolean(ot->srna, "fast", 0, "Fast NDOF sensitivity change", "If true then sensitivity changes 50%, otherwise 10%");
  } 
  
+ static void operatortype_ghash_free_cb(wmOperatorType *ot)
+ {
+       if(ot->macro.first)
+               wm_operatortype_free_macro(ot);
+       if(ot->ext.srna) /* python operator, allocs own string */
+               MEM_freeN((void *)ot->idname);
+       MEM_freeN(ot);
+ }
  /* ******************************************************* */
  /* called on initialize WM_exit() */
  void wm_operatortype_free(void)
  {
-       wmOperatorType *ot;
-       
-       for(ot= global_ops.first; ot; ot= ot->next) {
-               if(ot->macro.first)
-                       wm_operatortype_free_macro(ot);
-               if(ot->ext.srna) /* python operator, allocs own string */
-                       MEM_freeN((void *)ot->idname);
-       }
-       
-       BLI_freelistN(&global_ops);
+       BLI_ghash_free(global_ops_hash, NULL, (GHashValFreeFP)operatortype_ghash_free_cb);
+       global_ops_hash= NULL;
  }
  
  /* called on initialize WM_init() */
  void wm_operatortype_init(void)
  {
+       global_ops_hash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wm_operatortype_init gh");
        WM_operatortype_append(WM_OT_window_duplicate);
        WM_operatortype_append(WM_OT_read_homefile);
        WM_operatortype_append(WM_OT_read_factory_settings);
@@@ -3559,7 -3570,6 +3570,7 @@@ static void gesture_circle_modal_keymap
        /* assign map to operators */
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_select_circle");
        WM_modalkeymap_assign(keymap, "UV_OT_circle_select");
 +      WM_modalkeymap_assign(keymap, "CLIP_OT_select_circle");
  
  }
  
@@@ -3639,7 -3649,6 +3650,7 @@@ static void gesture_border_modal_keymap
        WM_modalkeymap_assign(keymap, "SEQUENCER_OT_select_border");
        WM_modalkeymap_assign(keymap, "SEQUENCER_OT_view_ghost_border");
        WM_modalkeymap_assign(keymap, "UV_OT_select_border");
 +      WM_modalkeymap_assign(keymap, "CLIP_OT_select_border");
        WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border");
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border");
        WM_modalkeymap_assign(keymap, "VIEW3D_OT_render_border");
index 54befa03daaf9edfe9d9b2ffc6a5c7dc53304e36,0f7a02b766e4946adb5ce4c0f59cf13cd984fa5e..c74f7c9263e35b7d9f885dc9104228fe4822d8da
@@@ -193,7 -193,6 +193,7 @@@ void ED_space_image_paint_update(struc
  void ED_space_image_set(struct bContext *C, struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima){}
  struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima){return (struct ImBuf *) NULL;}
  void ED_screen_set_scene(struct bContext *C, struct Scene *scene){}
 +void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip){}
  
  void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype){}
  
@@@ -366,8 -365,6 +366,8 @@@ void uiTemplateHistogram(struct uiLayou
  void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op){}
  void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){}
  void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){}
 +void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *userptr, int compact){}
 +void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname){}
  
  /* rna render */
  struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;}
@@@ -387,7 -384,7 +387,7 @@@ void RE_engine_report(struct RenderEngi
  
  /* python */
  struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;}
- struct wmOperatorType *WM_operatortype_first(){return (struct wmOperatorType *) NULL;}
+ struct GHashIterator *WM_operatortype_iter(){return (struct GHashIterator *) NULL;}
  struct wmOperatorType *WM_operatortype_exists(const char *idname){return (struct wmOperatorType *) NULL;}
  struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname){return (struct wmOperatorTypeMacro *) NULL;}
  int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports){return 0;}