Blender  V2.59
BKE_library.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BKE_library.h 34962 2011-02-18 13:05:18Z jesterking $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 #ifndef BKE_LIBRARY_TYPES_H
00030 #define BKE_LIBRARY_TYPES_H
00031 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 struct ListBase;
00042 struct ID;
00043 struct Main;
00044 struct Library;
00045 struct wmWindowManager;
00046 struct bContext;
00047 
00048 void *alloc_libblock(struct ListBase *lb, short type, const char *name);
00049 void *copy_libblock(void *rt);
00050 void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action);
00051 
00052 void id_lib_extern(struct ID *id);
00053 void id_us_plus(struct ID *id);
00054 void id_us_min(struct ID *id);
00055 int id_make_local(struct ID *id, int test);
00056 int id_copy(struct ID *id, struct ID **newid, int test);
00057 int id_unlink(struct ID *id, int test);
00058 
00059 int new_id(struct ListBase *lb, struct ID *id, const char *name);
00060 
00061 struct ListBase *which_libbase(struct Main *mainlib, short type);
00062 
00063 #define MAX_LIBARRAY    39
00064 int set_listbasepointers(struct Main *main, struct ListBase **lb);
00065 
00066 void free_libblock(struct ListBase *lb, void *idv);
00067 void free_libblock_us(struct ListBase *lb, void *idv);
00068 void free_main(struct Main *mainvar);
00069 
00070 void tag_main_idcode(struct Main *mainvar, const short type, const short tag);
00071 void tag_main_lb(struct ListBase *lb, const short tag);
00072 void tag_main(struct Main *mainvar, const short tag);
00073 
00074 void rename_id(struct ID *id, const char *name);
00075 void name_uiprefix_id(char *name, struct ID *id);
00076 void test_idbutton(char *name);
00077 void text_idbutton(struct ID *id, char *text);
00078 void all_local(struct Library *lib, int untagged_only);
00079 struct ID *find_id(const char *type, const char *name);
00080 void clear_id_newpoins(void);
00081 
00082 void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb,struct ID* link, short *nr);
00083 void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr);
00084 void IPOnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID* link, short *nr, int blocktype);
00085 
00086 void flag_listbase_ids(ListBase *lb, short flag, short value);
00087 void flag_all_listbases_ids(short flag, short value);
00088 void recalc_all_library_objects(struct Main *main);
00089 
00090 void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
00091 
00092 /* use when "" is given to new_id() */
00093 #define ID_FALLBACK_NAME "Untitled"
00094 
00095 #define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
00096 
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100 
00101 #endif