Merged changes in the trunk up to revision 34193.
[blender.git] / source / blender / blenkernel / intern / library.c
index 66b6d43d259a89d6f6c17cd43cd9892243ac3385..58167a866a3dc54817e86352af55c88ae142f0bf 100644 (file)
 #include "BKE_particle.h"
 #include "BKE_gpencil.h"
 #include "BKE_fcurve.h"
+#include "BKE_linestyle.h"
 
 #define MAX_IDPUP              60      /* was 24 */
 
@@ -234,6 +235,8 @@ int id_make_local(ID *id, int test)
                        return 0; /* can't be linked */
                case ID_GD:
                        return 0; /* not implemented */
+               case ID_LS:
+                       return 0; /* not implemented */
        }
 
        return 0;
@@ -322,6 +325,8 @@ int id_copy(ID *id, ID **newid, int test)
                        return 0; /* can't be copied from here */
                case ID_GD:
                        return 0; /* not implemented */
+               case ID_LS:
+                       return 0; /* not implemented */
        }
        
        return 0;
@@ -418,6 +423,8 @@ ListBase *which_libbase(Main *mainlib, short type)
                        return &(mainlib->wm);
                case ID_GD:
                        return &(mainlib->gpencil);
+               case ID_LS:
+                       return &(mainlib->linestyle);
        }
        return 0;
 }
@@ -498,6 +505,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
        lb[a++]= &(main->scene);
        lb[a++]= &(main->library);
        lb[a++]= &(main->wm);
+       lb[a++]= &(main->linestyle);
        
        lb[a]= NULL;
 
@@ -603,6 +611,9 @@ static ID *alloc_libblock_notest(short type)
                case ID_GD:
                        id = MEM_callocN(sizeof(bGPdata), "Grease Pencil");
                        break;
+               case ID_LS:
+                       id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
+                       break;
        }
        return id;
 }
@@ -803,6 +814,9 @@ void free_libblock(ListBase *lb, void *idv)
                case ID_GD:
                        free_gpencil_data((bGPdata *)id);
                        break;
+               case ID_LS:
+                       FRS_free_linestyle((FreestyleLineStyle *)id);
+                       break;
        }
 
        if (id->properties) {