* Partially converted constraint template to layout engine
authorMatt Ebb <matt@mke3.net>
Thu, 28 Jan 2010 23:41:34 +0000 (23:41 +0000)
committerMatt Ebb <matt@mke3.net>
Thu, 28 Jan 2010 23:41:34 +0000 (23:41 +0000)
* Removed old code

source/blender/blenkernel/intern/colortools.c
source/blender/editors/include/ED_object.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_image/image_draw.c
source/blender/makesrna/intern/rna_constraint.c

index 3c30332b18d3c38187487f6aaa4933702da9f4eb..02cfae2bba3e0b0bc526155938a5df6381a50f3e 100644 (file)
@@ -791,8 +791,7 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
        
        pix_in= ibuf->rect_float;
        pix_out= tmpbuf->rect_float;
-//     pixc= (char *)ibuf->rect;
-       
+
        if(ibuf->channels)
                stride= ibuf->channels;
        
@@ -818,7 +817,6 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
        SWAP(unsigned int *, tmpbuf->rect, ibuf->rect);
        IMB_freeImBuf(tmpbuf);
        
-       
        curvemapping_premultiply(cumap, 1);
 }
 
index 334c700ba203e2f30d31b8f84493d048fd4cb39b..006d999e729692ef4fcbbf9a5570cc50d4be5c55 100644 (file)
@@ -106,7 +106,6 @@ struct bConstraint *get_active_constraint(struct Object *ob);
 
 void object_test_constraints(struct Object *ob);
 
-void ED_object_constraint_rename(struct Object *ob, struct bConstraint *con, char *oldname);
 void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con);
 void ED_object_constraint_update(struct Object *ob);
 void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob);
index 44f653669f2191e727959af6f4cc0caaadfe6883..9607aa3678da1fa82f91ff97d5dae4dcd7a9d02a 100644 (file)
@@ -934,18 +934,6 @@ static void constraint_active_func(bContext *C, void *ob_v, void *con_v)
        ED_object_constraint_set_active(ob_v, con_v);
 }
 
-static void verify_constraint_name_func (bContext *C, void *con_v, void *dummy)
-{
-       Object *ob= CTX_data_active_object(C);
-       bConstraint *con= con_v;
-       
-       if (!con)
-               return;
-       
-       ED_object_constraint_rename(ob, con, NULL);
-       ED_object_constraint_set_active(ob, con);
-       // XXX allqueue(REDRAWACTION, 0); 
-}
 
 /* some commonly used macros in the constraints drawing code */
 #define is_armature_target(target) (target && target->type==OB_ARMATURE)
@@ -1074,7 +1062,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
        rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20;
        
        /* open/close */
-       uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_TRIA_RIGHT, xco-10, yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint");
+       uiItemR(subrow, NULL, 0, &ptr, "expand", UI_ITEM_R_ICON_ONLY);
        
        /* name */      
        uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1085,13 +1073,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
        uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
        
        if(proxy_protected == 0) {
-               but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", xco+120, yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); 
-               uiButSetFunc(but, verify_constraint_name_func, con, con->name);
+               uiItemR(subrow, "", 0, &ptr, "name", 0);
        }
        else
-               uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
-
-       // XXX uiBlockSetCol(block, TH_AUTO);   
+               uiItemL(subrow, con->name, 0);
 
        subrow= uiLayoutRow(row, 0);
        uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
index 1b801060a23eee764abf3508bf8b011625a7c57f..6e883405ef8521f60d62d9acfd45aa94c0dce6ae 100644 (file)
 
 #define HEADER_HEIGHT 18
 
-#if 0
-static int image_preview_active(SpaceImage *sima, Scene *scene, float *xim, float *yim)
-{
-       /* only when compositor shows, and image handler set */
-       if(sima->image && sima->image->type==IMA_TYPE_COMPOSITE) {
-               /* XXX panels .. */
-#if 0
-               short a;
-       
-               for(a=0; a<SPACE_MAXHANDLER; a+=2) {
-                       if(sima->blockhandler[a] == IMAGE_HANDLER_PREVIEW) {
-                               if(xim) *xim= (scene->r.size*scene->r.xsch)/100;
-                               if(yim) *yim= (scene->r.size*scene->r.ysch)/100;
-                               return 1;
-                       }
-               }
-#endif
-       }
-       return 0;
-}
-#endif
-
-/* are there curves? curves visible? and curves do something? */
-static int image_curves_active(SpaceImage *sima)
-{
-       if(sima->cumap) {
-               if(curvemapping_RGBA_does_something(sima->cumap)) {
-                       /* XXX panels .. */
-#if 0
-                       short a;
-                       for(a=0; a<SPACE_MAXHANDLER; a+=2) {
-                               if(sima->blockhandler[a] == IMAGE_HANDLER_CURVES)
-                                       return 1;
-                       }
-#endif
-               }
-       }
-
-       return 0;
-}
-
 static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf, int color_manage)
 {
        /* detect if we need to redo the curve map.
@@ -120,18 +79,13 @@ static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf,
 
        if(ibuf->rect_float) {
                if(ibuf->rect==NULL) {
-                       if(image_curves_active(sima)) {
-                               curvemapping_do_ibuf(sima->cumap, ibuf);
-                       }
-                       else {
-                               if (color_manage) {
-                                               if (ima && ima->source == IMA_SRC_VIEWER)
-                                                       ibuf->profile = IB_PROFILE_LINEAR_RGB;
-                               } else {
-                                       ibuf->profile = IB_PROFILE_NONE;
-                               }
-                               IMB_rect_from_float(ibuf);
+                       if (color_manage) {
+                                       if (ima && ima->source == IMA_SRC_VIEWER)
+                                               ibuf->profile = IB_PROFILE_LINEAR_RGB;
+                       } else {
+                               ibuf->profile = IB_PROFILE_NONE;
                        }
+                       IMB_rect_from_float(ibuf);
                }
        }
 }
index 1f023555456a1a2cf2f40f36adc4fd4c622779f7..4671dbcd80defbf5b5aa86b9cae21aa84e8cb340 100644 (file)
@@ -1850,10 +1850,10 @@ void RNA_def_constraint(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in.");
 
        /* flags */
-               // XXX do we want to wrap this?
        prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
        RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI.");
+       RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
        
                // XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
        prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);