svn merge -r39286:39298 https://svn.blender.org/svnroot/bf-blender/trunk/blender...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 11 Aug 2011 09:28:07 +0000 (09:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 11 Aug 2011 09:28:07 +0000 (09:28 +0000)
1  2 
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_outliner/outliner_draw.c
source/blenderplayer/bad_level_call_stubs/stubs.c

  
  #include "MEM_guardedalloc.h"
  
 +#include "DNA_anim_types.h"
  #include "DNA_key_types.h"
  #include "DNA_scene_types.h"
  #include "DNA_userdef_types.h"
  
  #include "BLI_string.h"
  #include "BLI_utildefines.h"
+ #include "BLI_ghash.h"
  
  #include "BKE_animsys.h"
  #include "BKE_colortools.h"
@@@ -58,7 -58,6 +59,7 @@@
  #include "ED_render.h"
  
  #include "RNA_access.h"
 +#include "RNA_enum_types.h"
  
  #include "WM_api.h"
  #include "WM_types.h"
@@@ -238,7 -237,7 +239,7 @@@ static void template_id_cb(bContext *C
  {
        TemplateID *template= (TemplateID*)arg_litem;
        PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop);
 -      ID *id= idptr.data, *newid;
 +      ID *id= idptr.data;
        int event= GET_INT_FROM_POINTER(arg_event);
        
        switch(event) {
                                        WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
                                }
                                else {
 -                                      if(id_copy(id, &newid, 0) && newid) {
 -                                              /* copy animation actions too */
 -                                              BKE_copy_animdata_id_action(id);
 -                                              /* us is 1 by convention, but RNA_property_pointer_set
 -                                                 will also incremement it, so set it to zero */
 -                                              newid->us= 0;
 -
 -                                              /* assign copy */
 -                                              RNA_id_pointer_create(newid, &idptr);
 -                                              RNA_property_pointer_set(&template->ptr, template->prop, idptr);
 -                                              RNA_property_update(C, &template->ptr, template->prop);
 +                                      if(id) {
 +                                              id_single_user(C, id, &template->ptr, template->prop);
                                        }
                                }
                        }
@@@ -313,13 -321,11 +314,13 @@@ static const char *template_id_browse_t
                        case ID_MA: return "Browse Material to be linked";
                        case ID_TE: return "Browse Texture to be linked";
                        case ID_IM: return "Browse Image to be linked";
 -                      case ID_LA: return "Browse Lattice Data to be linked";
 +                      case ID_LT: return "Browse Lattice Data to be linked";
 +                      case ID_LA: return "Browse Lamp Data to be linked";
                        case ID_CA: return "Browse Camera Data to be linked";
                        case ID_WO: return "Browse World Settings to be linked";
                        case ID_SCR: return "Choose Screen lay-out";
                        case ID_TXT: return "Browse Text to be linked";
 +                      case ID_SPK: return "Browse Speaker Data to be linked";
                        case ID_SO: return "Browse Sound to be linked";
                        case ID_AR: return "Browse Armature data to be linked";
                        case ID_AC: return "Browse Action to be linked";
@@@ -2121,15 -2127,6 +2122,15 @@@ static void list_item_row(bContext *C, 
                //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
 +      else if(itemptr->type == &RNA_KeyingSetPath) {
 +              KS_Path *ksp = (KS_Path*)itemptr->data;
 +              
 +              /* icon needs to be the type of ID which is currently active */
 +              RNA_enum_icon_from_value(id_type_items, ksp->idtype, &icon);
 +              
 +              /* nothing else special to do... */
 +              uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
 +      }
        else
                uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
  
@@@ -2326,10 -2323,11 +2327,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)
@@@ -1,4 -1,6 +1,4 @@@
  /*
 - * $Id$
 - *
   * ***** BEGIN GPL LICENSE BLOCK *****
   *
   * This program is free software; you can redistribute it and/or
@@@ -66,6 -68,8 +66,8 @@@
  #include "BKE_scene.h"
  #include "BKE_sequencer.h"
  
+ #include "BLI_ghash.h"
  #include "ED_armature.h"
  #include "ED_object.h"
  #include "ED_screen.h"
@@@ -584,9 -588,10 +586,10 @@@ static void operator_call_cb(struct bCo
  
  static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), 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->idname, str)) {
                        char name[OP_MAX_TYPENAME];
                                break;
                }
        }
+       BLI_ghashIterator_free(iter);
  }
  
  /* operator Search browse menu, open */
@@@ -921,7 -927,13 +925,7 @@@ static void tselem_draw_icon(uiBlock *b
                        case TSE_NLA_ACTION:
                                UI_icon_draw(x, y, ICON_ACTION); break;
                        case TSE_DRIVER_BASE:
 -
 -#if 0         // GSOC_PEPPER
 -
                                UI_icon_draw(x, y, ICON_DRIVER); break;
 -
 -#endif                // GSOC_PEPPER
 -
                        case TSE_DEFGROUP_BASE:
                                UI_icon_draw(x, y, ICON_GROUP_VERTEX); break;
                        case TSE_BONE:
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_OB_FONT); break;
                        case OB_SURF: 
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_OB_SURFACE); break;
 -
 -#if 0         // GSOC_PEPPER
 -
                        case OB_SPEAKER:
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_OB_SPEAKER); break;
 -
 -#endif                // GSOC_PEPPER
 -
                        case OB_EMPTY: 
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_OB_EMPTY); break;
                
                                tselem_draw_icon_uibut(&arg, ICON_TEXTURE_DATA); break;
                        case ID_IM:
                                tselem_draw_icon_uibut(&arg, ICON_IMAGE_DATA); break;
 -
 -#if 0         // GSOC_PEPPER
 -
                        case ID_SPK:
                        case ID_SO:
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_SPEAKER); break;
 -
 -#endif                // GSOC_PEPPER
 -
                        case ID_AR:
                                tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_ARMATURE); break;
                        case ID_CA:
@@@ -182,7 -182,6 +182,7 @@@ void       ED_area_headerprint(struct ScrAre
  
  struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;}
  struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, char *name){return (struct EditBone*) NULL;}
 +struct Object *ED_object_pose_armature(struct Object *ob){ return (struct Object *)NULL; }
  struct ListBase *get_active_constraints (struct Object *ob){return (struct ListBase *) NULL;}
  struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r){return (struct ListBase *) NULL;}
  int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan){return 0;}
@@@ -385,7 -384,7 +385,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;}