Merged 2.5 -r 20124:21003
authorChingiz Dyussenov <chingiz.ds@gmail.com>
Fri, 19 Jun 2009 18:24:16 +0000 (18:24 +0000)
committerChingiz Dyussenov <chingiz.ds@gmail.com>
Fri, 19 Jun 2009 18:24:16 +0000 (18:24 +0000)
1  2 
config/linux2-config.py
source/blender/SConscript
source/blender/editors/include/ED_object.h
source/blender/editors/object/object_edit.c
source/blender/editors/space_info/info_header.c
source/blender/windowmanager/intern/wm_operators.c
tools/Blender.py
tools/btools.py

Simple merge
Simple merge
index c81d3cc5602b73f776fd18fad84254d89aa36061,c8dd3df8425b3d3d9c608b343f8c0930026c0aed..64bd7e3a5e7a20198f680e95c1c7f28effa875e0
@@@ -271,17 -271,11 +271,16 @@@ static void info_filemenu(bContext *C, 
        
        uiItemS(layout);
        
-       uiLayoutContext(layout, WM_OP_EXEC_AREA);
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA);
        uiItemO(layout, NULL, 0, "WM_OT_save_mainfile"); 
-       uiLayoutContext(layout, WM_OP_INVOKE_AREA);
+       uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA);
        uiItemO(layout, NULL, 0, "WM_OT_save_as_mainfile"); 
  
-       uiLayoutContext(layout, WM_OP_INVOKE_AREA);
 +      // XXX: these should move
 +      uiItemS(layout);
 +      uiItemO(layout, NULL, 0, "WM_OT_collada_import"); 
 +      uiItemO(layout, NULL, 0, "WM_OT_collada_export"); 
 +
  #if 0
        if(U.flag & USER_FILECOMPRESS) {
                uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File",     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression");
index a0f0615e71ae0b2b70df3345799eb9ab8e57375a,46e9df10adcf2f790af7db5a458b528be588e773..40634e2c616c6ba79fc25ca389b0e1a2113aa0db
@@@ -319,6 -319,6 +319,7 @@@ int WM_operator_redo_popup(bContext *C
        return OPERATOR_CANCELLED;
  }
  
++
  /* ***************** Debug menu ************************* */
  
  static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op)
@@@ -373,7 -373,97 +374,98 @@@ static void WM_OT_debug_menu(wmOperator
        RNA_def_int(ot->srna, "debugval", 0, -10000, 10000, "Debug Value", "", INT_MIN, INT_MAX);
  }
  
+ /* ***************** Search menu ************************* */
+ static void operator_call_cb(struct bContext *C, void *arg1, void *arg2)
+ {
+       wmOperatorType *ot= arg2;
+       
+       if(ot)
+               WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
+ }
+ static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items)
+ {
+       wmOperatorType *ot = WM_operatortype_first();
+       
+       for(; ot; ot= ot->next) {
+               
+               if(BLI_strcasestr(ot->name, str)) {
+                       if(ot->poll==NULL || ot->poll((bContext *)C)) {
+                               char name[256];
+                               int len= strlen(ot->name);
+                               
+                               /* display name for menu, can hold hotkey */
+                               BLI_strncpy(name, ot->name, 256);
+                               
+                               /* check for hotkey */
+                               if(len < 256-6) {
+                                       if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1))
+                                               name[len]= '|';
+                               }
+                               
+                               if(0==uiSearchItemAdd(items, name, ot))
+                                       break;
+                       }
+               }
+       }
+ }
+ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *arg_op)
+ {
+       static char search[256]= "";
+       wmEvent event;
+       wmWindow *win= CTX_wm_window(C);
+       uiBlock *block;
+       uiBut *but;
+       
+       block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
+       uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1);
+       
+       but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 180, 19, "");
+       uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb);
+       
+       /* fake button, it holds space for search items */
+       uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 180, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+       
+       uiPopupBoundsBlock(block, 6.0f, 0, -20); /* move it downwards, mouse over button */
+       uiEndBlock(C, block);
+       
+       event= *(win->eventstate);      /* XXX huh huh? make api call */
+       event.type= EVT_BUT_OPEN;
+       event.val= KM_PRESS;
+       event.customdata= but;
+       event.customdatafree= FALSE;
+       wm_event_add(win, &event);
+       
+       return block;
+ }
+ static int wm_search_menu_exec(bContext *C, wmOperator *op)
+ {
+       
+       return OPERATOR_FINISHED;       
+ }
+ static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
+ {
+       
+       uiPupBlock(C, wm_block_search_menu, op);
+       
+       return OPERATOR_CANCELLED;
+ }
+ static void WM_OT_search_menu(wmOperatorType *ot)
+ {
+       ot->name= "Search Menu";
+       ot->idname= "WM_OT_search_menu";
+       
+       ot->invoke= wm_search_menu_invoke;
+       ot->exec= wm_search_menu_exec;
+       ot->poll= WM_operator_winactive;
+ }
 +
  /* ************ window / screen operator definitions ************** */
  
  static void WM_OT_window_duplicate(wmOperatorType *ot)
@@@ -1429,6 -1417,6 +1521,7 @@@ void WM_OT_radial_control_partial(wmOpe
        RNA_def_int_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX);
  }
  
++
  /* ************************** timer for testing ***************** */
  
  /* uses no type defines, fully local testing function anyway... ;) */
@@@ -1539,10 -1527,7 +1632,11 @@@ void wm_operatortype_init(void
        WM_operatortype_append(WM_OT_save_mainfile);
        WM_operatortype_append(WM_OT_ten_timer);
        WM_operatortype_append(WM_OT_debug_menu);
+       WM_operatortype_append(WM_OT_search_menu);
 +
 +      /* XXX: move these */
 +      WM_operatortype_append(WM_OT_collada_export);
 +      WM_operatortype_append(WM_OT_collada_import);
  }
  
  /* default keymap for windows and screens, only call once per WM */
index 3368411d28670c3f5cfa76cf588175390bbe842b,164a9d097e65b444e102d9300d87ef2e8f784f1b..fb437ef2c7026b419a0dcd566a67d02d571fe927
@@@ -194,12 -189,8 +195,13 @@@ def setup_syslibs(lenv)
                syslibs += Split(lenv['BF_OPENGL_LIB'])
        if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
                syslibs += Split(lenv['BF_PTHREADS_LIB'])
++
        if lenv['WITH_BF_LCMS']:
                syslibs.append(lenv['BF_LCMS_LIB'])
 +      if lenv['WITH_BF_COLLADA']:
 +              syslibs.append(lenv['BF_OPENCOLLADA_LIB'])
 +              syslibs.append(lenv['BF_PCRE_LIB'])
 +        syslibs.append(lenv['BF_EXPAT_LIB'])
  
  
        syslibs += lenv['LLIBS']
diff --cc tools/btools.py
Simple merge