Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / interface / interface_templates.c
index 1f25f96821325cab8f2ee8e15391e8c502130d1a..129f921e5fc05aca91bee40343c5d64f08aa769c 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/interface/interface_templates.c
+ *  \ingroup edinterface
+ */
+
+
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
 
 #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"
 #include "BKE_material.h"
 #include "BKE_texture.h"
 #include "BKE_report.h"
+#include "BKE_displist.h"
 
 #include "ED_screen.h"
+#include "ED_object.h"
 #include "ED_render.h"
 
 #include "RNA_access.h"
+#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -58,7 +69,7 @@
 
 #include "BLF_api.h"
 
-void ui_template_fix_linking(void)
+void UI_template_fix_linking(void)
 {
 }
 
@@ -143,7 +154,6 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
        static char search[256];
        static TemplateID template;
        PointerRNA idptr;
-       wmEvent event;
        wmWindow *win= CTX_wm_window(C);
        uiBlock *block;
        uiBut *but;
@@ -184,12 +194,10 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
        uiBlockSetDirection(block, UI_DOWN);    
        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);
+       /* give search-field focus */
+       uiButSetFocusOnEnter(win, but);
+       /* this type of search menu requires undo */
+       but->flag |= UI_BUT_UNDO;
        
        return block;
 }
@@ -231,13 +239,13 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
 {
        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) {
                case UI_ID_BROWSE:
                case UI_ID_PIN:
-                       printf("warning, id event %d shouldnt come here\n", event);
+                       RNA_warning("warning, id event %d shouldnt come here\n", event);
                        break;
                case UI_ID_OPEN:
                case UI_ID_ADD_NEW:
@@ -271,18 +279,19 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
                        break;
                case UI_ID_ALONE:
                        if(id) {
+                               const int do_scene_obj= (GS(id->name) == ID_OB) &&
+                                                       (template->ptr.type == &RNA_SceneObjects);
+
                                /* make copy */
-                               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(do_scene_obj) {
+                                       Scene *scene= CTX_data_scene(C);
+                                       ED_object_single_user(scene, (struct Object *)id);
+                                       WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);
+                               }
+                               else {
+                                       if(id) {
+                                               id_single_user(C, id, &template->ptr, template->prop);
+                                       }
                                }
                        }
                        break;
@@ -305,11 +314,13 @@ static const char *template_id_browse_tip(StructRNA *type)
                        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";
@@ -327,13 +338,14 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
        uiBut *but;
        uiBlock *block;
        PointerRNA idptr;
-       ListBase *lb;
+       // ListBase *lb; // UNUSED
        ID *id, *idfrom;
+       int editable= RNA_property_editable(&template->ptr, template->prop);
 
        idptr= RNA_property_pointer_get(&template->ptr, template->prop);
        id= idptr.data;
        idfrom= template->ptr.id.data;
-       lb= template->idlb;
+       // lb= template->idlb;
 
        block= uiLayoutGetBlock(layout);
        uiBlockBeginAlign(block);
@@ -349,14 +361,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                        if (id) but->icon = ui_id_icon_get(C, id, 1);
                        uiButSetFlag(but, UI_HAS_ICON|UI_ICON_PREVIEW);
                }
-               if((idfrom && idfrom->lib))
+               if((idfrom && idfrom->lib) || !editable)
                        uiButSetFlag(but, UI_BUT_DISABLED);
                
-               
                uiLayoutRow(layout, 1);
-       } else 
-               
-       if(flag & UI_ID_BROWSE) {
+       }
+       else if(flag & UI_ID_BROWSE) {
                but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, template_id_browse_tip(type));
                if(type) {
                        but->icon= RNA_struct_ui_icon(type);
@@ -365,7 +375,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                        uiButSetFlag(but, UI_HAS_ICON|UI_ICON_LEFT);
                }
 
-               if((idfrom && idfrom->lib))
+               if((idfrom && idfrom->lib) || !editable)
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
 
@@ -382,12 +392,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 
                if(id->lib) {
                        if(id->flag & LIB_INDIRECT) {
-                               but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0,
+                               but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
                                        "Indirect library datablock, cannot change.");
                                uiButSetFlag(but, UI_BUT_DISABLED);
                        }
                        else {
-                               but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0,
+                               but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
                                        "Direct linked library datablock, click to make local.");
                                if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
                                        uiButSetFlag(but, UI_BUT_DISABLED);
@@ -401,19 +411,16 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
 
                        sprintf(str, "%d", id->us);
 
-                       if(id->us<10)
-                               but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
-                       else
-                               but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
+                       but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
 
                        uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
-                       if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib))
+                       if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
                                uiButSetFlag(but, UI_BUT_DISABLED);
                }
        
                if(user_alert) uiButSetFlag(but, UI_BUT_REDALERT);
                
-               if(id->lib == NULL && !(ELEM4(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT))) {
+               if(id->lib == NULL && !(ELEM5(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) {
                        uiDefButR(block, TOG, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL);
                }
        }
@@ -430,7 +437,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                        uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
                }
 
-               if((idfrom && idfrom->lib))
+               if((idfrom && idfrom->lib) || !editable)
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
 
@@ -446,7 +453,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                        uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
                }
 
-               if((idfrom && idfrom->lib))
+               if((idfrom && idfrom->lib) || !editable)
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
        
@@ -455,17 +462,17 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                if(unlinkop) {
                        but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
                        /* so we can access the template from operators, font unlinking needs this */
-                       uiButSetNFunc(but, NULL, MEM_dupallocN(template), 0);
+                       uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL);
                }
                else {
-                       but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data gets not saved");
+                       but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data will then not be saved");
                        uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE));
 
                        if(RNA_property_flag(template->prop) & PROP_NEVER_NULL)
                                uiButSetFlag(but, UI_BUT_DISABLED);
                }
 
-               if((idfrom && idfrom->lib))
+               if((idfrom && idfrom->lib) || !editable)
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
        
@@ -481,7 +488,7 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
        prop= RNA_struct_find_property(ptr, propname);
 
        if(!prop || RNA_property_type(prop) != PROP_POINTER) {
-               printf("uiTemplateID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               RNA_warning("uiTemplateID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
 
@@ -542,11 +549,11 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
        propType= RNA_struct_find_property(ptr, proptypename);
 
        if (!propID || RNA_property_type(propID) != PROP_POINTER) {
-               printf("uiTemplateAnyID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               RNA_warning("uiTemplateAnyID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
        if (!propType || RNA_property_type(propType) != PROP_ENUM) { 
-               printf("uiTemplateAnyID: pointer-type property not found: %s.%s\n", RNA_struct_identifier(ptr->type), proptypename);
+               RNA_warning("uiTemplateAnyID: pointer-type property not found: %s.%s\n", RNA_struct_identifier(ptr->type), proptypename);
                return;
        }
        
@@ -555,16 +562,16 @@ void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, co
        
        /* Label - either use the provided text, or will become "ID-Block:" */
        if (text)
-               uiItemL(row, text, ICON_NULL);
+               uiItemL(row, text, ICON_NONE);
        else
-               uiItemL(row, "ID-Block:", ICON_NULL);
+               uiItemL(row, "ID-Block:", ICON_NONE);
        
        /* ID-Type Selector - just have a menu of icons */
        // FIXME: the icon-only setting doesn't work when we supply a blank name
-       uiItemFullR(row, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NULL);
+       uiItemFullR(row, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
        
        /* ID-Block Selector - just use pointer widget... */
-       uiItemFullR(row, ptr, propID, 0, 0, 0, "", ICON_NULL);
+       uiItemFullR(row, ptr, propID, 0, 0, 0, "", ICON_NONE);
 }
 
 /********************* RNA Path Builder Template ********************/
@@ -585,7 +592,7 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna
        /* check that properties are valid */
        propPath= RNA_struct_find_property(ptr, propname);
        if (!propPath || RNA_property_type(propPath) != PROP_STRING) {
-               printf("uiTemplatePathBuilder: path property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               RNA_warning("uiTemplatePathBuilder: path property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
        
@@ -670,6 +677,22 @@ static int modifier_can_delete(ModifierData *md)
        return 1;
 }
 
+// Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab
+static int modifier_is_simulation(ModifierData *md)
+{
+       // Physic Tab
+       if(ELEM6(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface)) {
+               return 1;
+       }
+       // Particle Tab
+       else if (md->type == eModifierType_ParticleSystem) {
+               return 2;
+       }
+       else {
+               return 0;
+       }
+}
+
 static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, ModifierData *md, int index, int cageIndex, int lastCageIndex)
 {
        ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -709,14 +732,14 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
                
                uiBlockSetEmboss(block, UI_EMBOSSN);
                /* Open/Close .................................  */
-               uiItemR(row, &ptr, "show_expanded", 0, "", ICON_NULL);
+               uiItemR(row, &ptr, "show_expanded", 0, "", ICON_NONE);
                
                /* modifier-type icon */
                uiItemL(row, "", RNA_struct_ui_icon(ptr.type));
                uiBlockSetEmboss(block, UI_EMBOSS);
                
                /* modifier name */
-               uiItemR(row, &ptr, "name", 0, "", ICON_NULL);
+               uiItemR(row, &ptr, "name", 0, "", ICON_NONE);
                
                /* mode enabling buttons */
                uiBlockBeginAlign(block);
@@ -724,20 +747,35 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
                if ( ((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) 
                        && (md->type!=eModifierType_Surface) ) 
                {
-                       uiItemR(row, &ptr, "show_render", 0, "", ICON_NULL);
-                       uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NULL);
+                       uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE);
+                       uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE);
                        
                        if (mti->flags & eModifierTypeFlag_SupportsEditmode)
-                               uiItemR(row, &ptr, "show_in_editmode", 0, "", ICON_NULL);
+                               uiItemR(row, &ptr, "show_in_editmode", 0, "", ICON_NONE);
                }
                if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) 
                {
                        /* -- convert to rna ? */
-                       but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, 16, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
+                       but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
                        if (index < cageIndex)
                                uiButSetFlag(but, UI_BUT_DISABLED);
                        uiButSetFunc(but, modifiers_setOnCage, ob, md);
                }
+
+               /* tesselation point for curve-typed objects */
+               if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
+                       /* some modifiers could work with pre-tesselated curves only */
+                       if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
+                               /* add disabled pre-tesselated button, so users could have
+                                  message for this modifiers */
+                               but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only");
+                               uiButSetFlag(but, UI_BUT_DISABLED);
+                       } else if (mti->type != eModifierTypeType_Constructive) {
+                               /* constructive modifiers tesselates curve before applying */
+                               uiItemR(row, &ptr, "use_apply_on_spline", 0, "", ICON_NONE);
+                       }
+               }
+
                uiBlockEndAlign(block);
                
                /* Up/Down + Delete ........................... */
@@ -747,8 +785,13 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
                uiBlockEndAlign(block);
                
                uiBlockSetEmboss(block, UI_EMBOSSN);
-               if (modifier_can_delete(md))
+               // When Modifier is a simulation, show button to switch to context rather than the delete button. 
+               if (modifier_can_delete(md) && !modifier_is_simulation(md))
                        uiItemO(row, "", ICON_X, "OBJECT_OT_modifier_remove");
+               if (modifier_is_simulation(md) == 1)
+                       uiItemStringO(row, "", ICON_BUTS, "WM_OT_properties_context_change", "context", "PHYSICS");
+               else if (modifier_is_simulation(md) == 2)
+                       uiItemStringO(row, "", ICON_BUTS, "WM_OT_properties_context_change", "context", "PARTICLES");
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
 
@@ -768,9 +811,9 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
                                
                                if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
                                        if(ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
-                                               uiItemO(row, "Convert", ICON_NULL, "OBJECT_OT_duplicates_make_real");
+                                               uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_duplicates_make_real");
                                        else if(psys->part->ren_as == PART_DRAW_PATH)
-                                               uiItemO(row, "Convert", ICON_NULL, "OBJECT_OT_modifier_convert");
+                                               uiItemO(row, "Convert", ICON_NONE, "OBJECT_OT_modifier_convert");
                                }
                        }
                        else {
@@ -785,7 +828,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
                        uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
                        
                        if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth, eModifierType_Smoke))
-                               uiItemO(row, "Copy", ICON_NULL, "OBJECT_OT_modifier_copy");
+                               uiItemO(row, "Copy", ICON_NONE, "OBJECT_OT_modifier_copy");
                }
                
                /* result is the layout block inside the box, that we return so that modifier settings can be drawn */
@@ -812,7 +855,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
 
        /* verify we have valid data */
        if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
-               printf("uiTemplateModifier: expected modifier on object.\n");
+               RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
                return NULL;
        }
 
@@ -820,7 +863,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
        md= ptr->data;
 
        if(!ob || !(GS(ob->id.name) == ID_OB)) {
-               printf("uiTemplateModifier: expected modifier on object.\n");
+               RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
                return NULL;
        }
        
@@ -858,7 +901,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
 #define REMAKEIPO                                      8
 #define B_DIFF                                         9
 
-void do_constraint_panels(bContext *C, void *ob_pt, int event)
+static void do_constraint_panels(bContext *C, void *ob_pt, int event)
 {
        Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
@@ -902,7 +945,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
        PointerRNA ptr;
        char typestr[32];
        short proxy_protected, xco=0, yco=0;
-       int rb_col;
+       // int rb_col; // UNUSED
 
        /* get constraint typeinfo */
        cti= constraint_get_typeinfo(con);
@@ -937,13 +980,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
        block= uiLayoutGetBlock(box);
 
        /* Draw constraint header */
-       
-       /* rounded header */
-       rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20;
 
        /* open/close */
        uiBlockSetEmboss(block, UI_EMBOSSN);
-       uiItemR(row, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NULL);
+       uiItemR(row, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
        uiBlockSetEmboss(block, UI_EMBOSS);
        
        /* name */
@@ -953,10 +993,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
                uiLayoutSetRedAlert(row, 1);
        
        if(proxy_protected == 0) {
-               uiItemR(row, &ptr, "name", 0, "", ICON_NULL);
+               uiItemR(row, &ptr, "name", 0, "", ICON_NONE);
        }
        else
-               uiItemL(row, con->name, ICON_NULL);
+               uiItemL(row, con->name, ICON_NONE);
        
        uiLayoutSetRedAlert(row, 0);
        
@@ -1044,7 +1084,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
 
        /* verify we have valid data */
        if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
-               printf("uiTemplateConstraint: expected constraint on object.\n");
+               RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
                return NULL;
        }
 
@@ -1052,7 +1092,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
        con= ptr->data;
 
        if(!ob || !(GS(ob->id.name) == ID_OB)) {
-               printf("uiTemplateConstraint: expected constraint on object.\n");
+               RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
                return NULL;
        }
        
@@ -1098,7 +1138,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
        PointerRNA texture_ptr;
 
        if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
-               printf("uiTemplatePreview: expected ID of type material, texture, lamp or world.\n");
+               RNA_warning("uiTemplatePreview: Expected ID of type material, texture, lamp or world.\n");
                return;
        }
 
@@ -1144,7 +1184,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
 
                        col = uiLayoutColumn(row, 1);
                        uiLayoutSetScaleX(col, 1.5);
-                       uiItemR(col, &material_ptr, "preview_render_type", UI_ITEM_R_EXPAND, "", ICON_NULL);
+                       uiItemR(col, &material_ptr, "preview_render_type", UI_ITEM_R_EXPAND, "", ICON_NONE);
                }
 
                if(pr_texture) {
@@ -1164,7 +1204,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
                        /* Alpha buton for texture preview */
                        if(*pr_texture!=TEX_PR_OTHER) {
                                row = uiLayoutRow(layout, 0);
-                               uiItemR(row, &texture_ptr, "use_preview_alpha", 0, NULL, ICON_NULL);
+                               uiItemR(row, &texture_ptr, "use_preview_alpha", 0, NULL, ICON_NONE);
                        }
                }
        }
@@ -1243,31 +1283,32 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
 /* offset aligns from bottom, standard width 300, height 115 */
 static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
 {
-       
        uiBut *bt;
        uiLayout *row;
+       const int line1_y= yoffs + 65 + UI_UNIT_Y + 2; /* 2 for some space between the buttons */
+       const int line2_y= yoffs + 65;
 
        if(coba==NULL) return;
 
-       bt= uiDefBut(block, BUT, 0,     "Add",                  0+xoffs,100+yoffs,40,20, 0, 0, 0, 0, 0, "Add a new color stop to the colorband");
+       bt= uiDefBut(block, BUT, 0,     "Add",                  0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
        uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
 
-       bt= uiDefBut(block, BUT, 0,     "Delete",               45+xoffs,100+yoffs,45,20, 0, 0, 0, 0, 0, "Delete the active position");
+       bt= uiDefBut(block, BUT, 0,     "Delete",               45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position");
        uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
 
 
        /* XXX, todo for later - convert to operator - campbell */
-       bt= uiDefBut(block, BUT, 0,     "F",            95+xoffs,100+yoffs,20,20, 0, 0, 0, 0, 0, "Flip colorband");
+       bt= uiDefBut(block, BUT, 0,     "F",            95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip colorband");
        uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
 
-       uiDefButS(block, NUM, 0,                "",                             120+xoffs,100+yoffs,80, 20, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");
+       uiDefButS(block, NUM, 0,                "",                             120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");
 
        bt= uiDefButS(block, MENU, 0,           "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
-                       210+xoffs, 100+yoffs, 90, 20,           &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
+                       210+xoffs, line1_y, 90, UI_UNIT_Y,              &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
        uiBlockEndAlign(block);
 
-       bt= uiDefBut(block, BUT_COLORBAND, 0, "",       xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, "");
+       bt= uiDefBut(block, BUT_COLORBAND, 0, "",       xoffs,line2_y,300,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
 
@@ -1279,8 +1320,8 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
                PointerRNA ptr;
                RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
                row= uiLayoutRow(layout, 0);
-               uiItemR(row, &ptr, "position", 0, "Pos", ICON_NULL);
-               uiItemR(row, &ptr, "color", 0, "", ICON_NULL);
+               uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+               uiItemR(row, &ptr, "color", 0, "", ICON_NONE);
        }
 
 }
@@ -1292,11 +1333,11 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
        float xs= butr->xmin;
 
        uiBlockBeginAlign(block);
-       bt= uiDefBut(block, BUT, 0,     "Add",                  xs,butr->ymin+20.0f,2.0f*unit,20,       NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
+       bt= uiDefBut(block, BUT, 0,     "Add",                  xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y,    NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
        uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
-       bt= uiDefBut(block, BUT, 0,     "Delete",               xs+2.0f*unit,butr->ymin+20.0f,1.5f*unit,20,     NULL, 0, 0, 0, 0, "Delete the active position");
+       bt= uiDefBut(block, BUT, 0,     "Delete",               xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y,  NULL, 0, 0, 0, 0, "Delete the active position");
        uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
-       bt= uiDefBut(block, BUT, 0,     "F",            xs+3.5f*unit,butr->ymin+20.0f,0.5f*unit,20,     NULL, 0, 0, 0, 0, "Flip the color ramp");
+       bt= uiDefBut(block, BUT, 0,     "F",            xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y,  NULL, 0, 0, 0, 0, "Flip the color ramp");
        uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
        uiBlockEndAlign(block);
 
@@ -1304,14 +1345,14 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
                CBData *cbd= coba->data + coba->cur;
                PointerRNA ptr;
                RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
-               uiItemR(layout, &ptr, "color", 0, "", ICON_NULL);
+               uiItemR(layout, &ptr, "color", 0, "", ICON_NONE);
        }
 
        bt= uiDefButS(block, MENU, 0,           "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
-                       xs+10.0f*unit, butr->ymin+20.0f, unit*4, 20,            &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
+                       xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y,         &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
-       bt= uiDefBut(block, BUT_COLORBAND, 0, "",               xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, "");
+       bt= uiDefBut(block, BUT_COLORBAND, 0, "",               xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
        uiBlockEndAlign(block);
@@ -1384,7 +1425,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
 
        hist = (Histogram *)cptr.data;
 
-       hist->height= (hist->height<=20)?20:hist->height;
+       hist->height= (hist->height<=UI_UNIT_Y)?UI_UNIT_Y:hist->height;
 
        bt= uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, hist->height, hist, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
@@ -1421,9 +1462,10 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
        
        block= uiLayoutAbsoluteBlock(layout);
        
-       scopes->wavefrm_height= (scopes->wavefrm_height<=20)?20:scopes->wavefrm_height;
+       scopes->wavefrm_height= (scopes->wavefrm_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->wavefrm_height;
 
        bt= uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->wavefrm_height, scopes, 0, 0, 0, 0, "");
+       (void)bt; // UNUSED
        
        MEM_freeN(cb);
 }
@@ -1457,7 +1499,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
        
        block= uiLayoutAbsoluteBlock(layout);
 
-       scopes->vecscope_height= (scopes->vecscope_height<=20)?20:scopes->vecscope_height;
+       scopes->vecscope_height= (scopes->vecscope_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->vecscope_height;
        
        bt= uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
@@ -1546,21 +1588,22 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu
        CurveMapping *cumap = cumap_v;
        uiBlock *block;
        uiBut *bt;
+       float width= 8*UI_UNIT_X;
 
        block= uiBeginBlock(C, ar, "curvemap_clipping_func", UI_EMBOSS);
 
        /* use this for a fake extra empy space around the buttons */
-       uiDefBut(block, LABEL, 0, "",                   -4, 16, 128, 106, NULL, 0, 0, 0, 0, "");
+       uiDefBut(block, LABEL, 0, "",                   -4, 16, width+8, 6*UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
 
        bt= uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",    
-                       0,100,120,18, &cumap->flag, 0.0, 0.0, 10, 0, "");
+                       0,5*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->flag, 0.0, 0.0, 10, 0, "");
        uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
 
        uiBlockBeginAlign(block);
-       uiDefButF(block, NUM, 0, "Min X ",       0,74,120,18, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
-       uiDefButF(block, NUM, 0, "Min Y ",       0,56,120,18, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
-       uiDefButF(block, NUM, 0, "Max X ",       0,38,120,18, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
-       uiDefButF(block, NUM, 0, "Max Y ",       0,20,120,18, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
+       uiDefButF(block, NUM, 0, "Min X ",       0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
+       uiDefButF(block, NUM, 0, "Min Y ",       0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
+       uiDefButF(block, NUM, 0, "Max X ",       0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
+       uiDefButF(block, NUM, 0, "Max Y ",       0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
 
        uiBlockSetDirection(block, UI_RIGHT);
 
@@ -1604,17 +1647,17 @@ static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event)
 static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap_v)
 {
        uiBlock *block;
-       short yco= 0, menuwidth=120;
+       short yco= 0, menuwidth=10*UI_UNIT_X;
 
        block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS);
        uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
 
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View",                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle",                  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated",    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View",                             0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle",                  0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle",                    0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal",              0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated",    0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve",                    0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
 
        uiBlockSetDirection(block, UI_RIGHT);
        uiTextBoundsBlock(block, 50);
@@ -1626,15 +1669,15 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap
 static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void *cumap_v)
 {
        uiBlock *block;
-       short yco= 0, menuwidth=120;
+       short yco= 0, menuwidth=10*UI_UNIT_X;
 
        block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS);
        uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
 
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View",                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle",                  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View",                             0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle",                  0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle",                    0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve",                    0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
 
        uiBlockSetDirection(block, UI_RIGHT);
        uiTextBoundsBlock(block, 50);
@@ -1688,15 +1731,15 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
                uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
 
                if(cumap->cm[0].curve) {
-                       bt= uiDefButI(block, ROW, 0, "X", 0, 0, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "X", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[1].curve) {
-                       bt= uiDefButI(block, ROW, 0, "Y", 0, 0, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "Y", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[2].curve) {
-                       bt= uiDefButI(block, ROW, 0, "Z", 0, 0, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "Z", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
        }
@@ -1706,19 +1749,19 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
                uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
 
                if(cumap->cm[3].curve) {
-                       bt= uiDefButI(block, ROW, 0, "C", 0, 0, dx, 16, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "C", 0, 0, dx, dx, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[0].curve) {
-                       bt= uiDefButI(block, ROW, 0, "R", 0, 0, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "R", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[1].curve) {
-                       bt= uiDefButI(block, ROW, 0, "G", 0, 0, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "G", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[2].curve) {
-                       bt= uiDefButI(block, ROW, 0, "B", 0, 0, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "B", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
        }
@@ -1728,15 +1771,15 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
                uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
                
                if(cumap->cm[0].curve) {
-                       bt= uiDefButI(block, ROW, 0, "H", 0, 0, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "H", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[1].curve) {
-                       bt= uiDefButI(block, ROW, 0, "S", 0, 0, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "S", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
                if(cumap->cm[2].curve) {
-                       bt= uiDefButI(block, ROW, 0, "V", 0, 0, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+                       bt= uiDefButI(block, ROW, 0, "V", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
                        uiButSetFunc(bt, curvemap_buttons_redraw, NULL, NULL);
                }
        }
@@ -1751,24 +1794,24 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
 
        uiBlockSetEmboss(block, UI_EMBOSSN);
 
-       bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in");
+       bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in");
        uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL);
 
-       bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out");
+       bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out");
        uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL);
 
        if(brush)
-               bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, 18, "Tools");
+               bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools");
        else
-               bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, 18, "Tools");
+               bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools");
 
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
        if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT;
-       bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, 18, "Clipping Options");
+       bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, "Clipping Options");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
-       bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
+       bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
        uiButSetNFunc(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap);
 
        uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1783,8 +1826,8 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
        /* black/white levels */
        if(levels) {
                split= uiLayoutSplit(layout, 0, 0);
-               uiItemR(uiLayoutColumn(split, 0), ptr, "black_level", UI_ITEM_R_EXPAND, NULL, ICON_NULL);
-               uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NULL);
+               uiItemR(uiLayoutColumn(split, 0), ptr, "black_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+               uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 
                uiLayoutRow(layout, 0);
                bt=uiDefBut(block, BUT, 0, "Reset",     0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves");
@@ -1800,8 +1843,15 @@ void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, const char *propn
        PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
        PointerRNA cptr;
 
-       if(!prop || RNA_property_type(prop) != PROP_POINTER)
+       if(!prop) {
+               RNA_warning("uiTemplateCurveMapping: curve property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
+       }
+
+       if(RNA_property_type(prop) != PROP_POINTER) {
+               RNA_warning("uiTemplateCurveMapping: curve is not a pointer: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               return;
+       }
 
        cptr= RNA_property_pointer_get(ptr, prop);
        if(!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_CurveMapping))
@@ -1829,7 +1879,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam
        float softmin, softmax, step, precision;
        
        if (!prop) {
-               printf("uiTemplateColorWheel: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               RNA_warning("uiTemplateColorWheel: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
 
@@ -1838,7 +1888,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam
        col = uiLayoutColumn(layout, 0);
        row= uiLayoutRow(col, 1);
        
-       but= uiDefButR(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, propname, -1, 0.0, 0.0, 0, 0, "");
+       but= uiDefButR_prop(block, HSVCIRCLE, 0, "",    0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, "");
 
        if(lock) {
                but->flag |= UI_BUT_COLOR_LOCK;
@@ -1857,7 +1907,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam
        uiItemS(row);
        
        if (value_slider)
-               uiDefButR(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, propname, -1, softmin, softmax, UI_GRAD_V_ALT, 0, "");
+               uiDefButR_prop(block, HSVCUBE, 0, "", WHEEL_SIZE+6, 0, 14, WHEEL_SIZE, ptr, prop, -1, softmin, softmax, UI_GRAD_V_ALT, 0, "");
 }
 
 /********************* Layer Buttons Template ************************/
@@ -1879,6 +1929,9 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
                                RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, i, 0);
                }
        }
+       
+       /* view3d layer change should update depsgraph (invisible object changed maybe) */
+       /* see view3d_header.c */
 }
 
 // TODO:
@@ -1893,15 +1946,12 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
        int groups, cols, layers;
        int group, col, layer, row;
        int cols_per_group = 5;
-       const char *desc;
-       
+
        prop= RNA_struct_find_property(ptr, propname);
        if (!prop) {
-               printf("uiTemplateLayer: layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+               RNA_warning("uiTemplateLayer: layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                return;
        }
-
-       desc= RNA_property_description(prop);
        
        /* the number of layers determines the way we group them 
         *      - we want 2 rows only (for now)
@@ -1916,7 +1966,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
        if(used_ptr && used_propname) {
                used_prop= RNA_struct_find_property(used_ptr, used_propname);
                if (!used_prop) {
-                       printf("uiTemplateLayer: used layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), used_propname);
+                       RNA_warning("uiTemplateLayer: used layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), used_propname);
                        return;
                }
 
@@ -1947,7 +1997,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
                                else if(used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer))
                                        icon = ICON_LAYER_USED;
                                
-                               but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, 10, 10);
+                               but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2);
                                uiButSetFunc(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer));
                                but->type= TOG;
                        }
@@ -1988,7 +2038,7 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
        return rnaicon;
 }
 
-static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, const char *activepropname)
+static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop)
 {
        uiBlock *block= uiLayoutGetBlock(layout);
        uiBut *but;
@@ -2002,14 +2052,14 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
        /* list item behind label & other buttons */
        sub= uiLayoutRow(overlap, 0);
 
-       but= uiDefButR(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, "");
+       but= uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
        uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
 
        sub= uiLayoutRow(overlap, 0);
 
        /* retrieve icon and name */
        icon= list_item_icon_get(C, itemptr, rnaicon, 0);
-       if(icon == ICON_NULL || icon == ICON_DOT)
+       if(icon == ICON_NONE || icon == ICON_DOT)
                icon= 0;
 
        namebuf= RNA_struct_name_get_alloc(itemptr, NULL, 0);
@@ -2050,12 +2100,13 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                                uiItemL(sub, str, ui_id_icon_get(C, &manode->id, 1));
                        }
                        else if(ma->use_nodes) {
-                               uiItemL(sub, "Node <none>", ICON_NULL);
+                               uiItemL(sub, "Node <none>", ICON_NONE);
                        }
                }
        }
        else if(itemptr->type == &RNA_ShapeKey) {
                Object *ob= (Object*)activeptr->data;
+               Key *key= (Key*)itemptr->id.data;
 
                split= uiLayoutSplit(sub, 0.75f, 0);
 
@@ -2063,14 +2114,23 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
 
                uiBlockSetEmboss(block, UI_EMBOSSN);
                row= uiLayoutRow(split, 1);
-               if(i == 0) uiItemL(row, "", ICON_NULL);
-               else uiItemR(row, itemptr, "value", 0, "", ICON_NULL);
+               if(i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
+               else uiItemR(row, itemptr, "value", 0, "", ICON_NONE);
 
                if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH))
                        uiLayoutSetActive(row, 0);
                //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... */
 
@@ -2097,7 +2157,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
        pa= block->panel;
 
        if(!pa) {
-               printf("uiTemplateList: only works inside a panel.\n");
+               RNA_warning("uiTemplateList: only works inside a panel.\n");
                return;
        }
 
@@ -2107,28 +2167,28 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
        if(ptr->data) {
                prop= RNA_struct_find_property(ptr, propname);
                if(!prop) {
-                       printf("uiTemplateList: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+                       RNA_warning("uiTemplateList: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
                        return;
                }
        }
 
        activeprop= RNA_struct_find_property(activeptr, activepropname);
        if(!activeprop) {
-               printf("uiTemplateList: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), activepropname);
+               RNA_warning("uiTemplateList: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), activepropname);
                return;
        }
 
        if(prop) {
                type= RNA_property_type(prop);
                if(type != PROP_COLLECTION) {
-                       printf("uiTemplateList: expected collection property.\n");
+                       RNA_warning("uiTemplateList: Expected collection property.\n");
                        return;
                }
        }
 
        activetype= RNA_property_type(activeprop);
        if(activetype != PROP_INT) {
-               printf("uiTemplateList: expected integer property.\n");
+               RNA_warning("uiTemplateList: Expected integer property.\n");
                return;
        }
 
@@ -2150,11 +2210,11 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                        /* create list items */
                        RNA_PROP_BEGIN(ptr, itemptr, prop) {
                                /* create button */
-                               if(i == 9)
+                               if(!(i % 9))
                                        row= uiLayoutRow(col, 0);
 
                                icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
-                               but= uiDefIconButR(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, "");
+                               but= uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, "");
                                uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
                                
 
@@ -2165,7 +2225,6 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
        }
        else if(listtype == 'c') {
                /* compact layout */
-               found= 0;
 
                row= uiLayoutRow(layout, 1);
 
@@ -2191,11 +2250,11 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
 
                /* if not found, add in dummy button */
                if(i == 0)
-                       uiItemL(row, "", ICON_NULL);
+                       uiItemL(row, "", ICON_NONE);
 
                /* next/prev button */
                sprintf(str, "%d :", i);
-               but= uiDefIconTextButR(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activepropname, 0, 0, 0, 0, 0, "");
+               but= uiDefIconTextButR_prop(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, "");
                if(i == 0)
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
@@ -2234,7 +2293,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                        /* create list items */
                        RNA_PROP_BEGIN(ptr, itemptr, prop) {
                                if(i >= pa->list_scroll && i<pa->list_scroll+items)
-                                       list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activepropname);
+                                       list_item_row(C, col, ptr, &itemptr, i, rnaicon, activeptr, activeprop);
 
                                i++;
                        }
@@ -2244,7 +2303,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                /* add dummy buttons to fill space */
                while(i < pa->list_scroll+items) {
                        if(i >= pa->list_scroll)
-                               uiItemL(col, "", ICON_NULL);
+                               uiItemL(col, "", ICON_NONE);
                        i++;
                }
 
@@ -2268,10 +2327,11 @@ static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2)
 
 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];
@@ -2291,6 +2351,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
                        }
                }
        }
+       BLI_ghashIterator_free(iter);
 }
 
 void uiTemplateOperatorSearch(uiLayout *layout)
@@ -2312,6 +2373,8 @@ void uiTemplateOperatorSearch(uiLayout *layout)
 #define B_STOPCAST             2
 #define B_STOPANIM             3
 #define B_STOPCOMPO            4
+#define B_STOPSEQ              5
+#define B_STOPCLIP             6
 
 static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
 {
@@ -2328,6 +2391,12 @@ 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_STOPSEQ:
+                       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;
        }
 }
 
@@ -2349,8 +2418,15 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
                if(WM_jobs_test(wm, sa))
                   owner = sa;
                handle_event= B_STOPCOMPO;
-       } 
-       else {
+       } else if (sa->spacetype==SPACE_SEQ) {
+               if(WM_jobs_test(wm, sa))
+                       owner = sa;
+               handle_event = B_STOPSEQ;
+       } else if(sa->spacetype==SPACE_CLIP) {
+               if(WM_jobs_test(wm, sa))
+                  owner = sa;
+               handle_event= B_STOPCLIP;
+       } 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)
@@ -2364,6 +2440,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
                uiLayout *ui_abs;
                
                ui_abs= uiLayoutAbsolute(layout, 0);
+               (void)ui_abs; // UNUSED
                
                uiDefIconBut(block, BUT, handle_event, ICON_PANEL_CLOSE, 
                                0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, "Stop this job");
@@ -2398,7 +2475,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
        
        rti= (ReportTimerInfo *)reports->reporttimer->customdata;
        
-       if (!rti || rti->widthfac==0.0 || !report) return;
+       if (!rti || rti->widthfac==0.0f || !report) return;
        
        ui_abs= uiLayoutAbsolute(layout, 0);
        block= uiLayoutGetBlock(ui_abs);