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