Blender V2.61 - r43446

BKE_icons.h

Go to the documentation of this file.
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) 2006-2007 Blender Foundation.
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 
00028 #ifndef BKE_ICONS_H
00029 #define BKE_ICONS_H
00030 
00035 /*
00036  Resizable Icons for Blender
00037 */
00038 
00039 typedef void (*DrawInfoFreeFP) (void *drawinfo);
00040 
00041 struct Icon
00042 {
00043     void *drawinfo;
00044     void *obj;
00045     short type;
00046     DrawInfoFreeFP drawinfo_free;
00047 };
00048 
00049 typedef struct Icon Icon;
00050 
00051 struct PreviewImage;
00052 struct ID;
00053 
00054 void BKE_icons_init(int first_dyn_id);
00055 
00056 /* return icon id for library object or create new icon if not found */
00057 int BKE_icon_getid(struct ID* id);
00058 
00059 /* retrieve icon for id */
00060 struct Icon* BKE_icon_get(int icon_id);
00061 
00062 /* set icon for id if not already defined */
00063 /* used for inserting the internal icons */
00064 void BKE_icon_set(int icon_id, struct Icon* icon);
00065 
00066 /* remove icon and free date if library object becomes invalid */
00067 void BKE_icon_delete(struct ID* id);
00068 
00069 /* report changes - icon needs to be recalculated */
00070 void BKE_icon_changed(int icon_id);
00071 
00072 /* free all icons */
00073 void BKE_icons_free(void);
00074 
00075 /* free the preview image for use in list */
00076 void BKE_previewimg_freefunc(void *link);
00077 
00078 /* free the preview image */
00079 void BKE_previewimg_free(struct PreviewImage **prv);
00080 
00081 /* free the preview image belonging to the id */
00082 void BKE_previewimg_free_id(struct ID *id);
00083 
00084 /* create a new preview image */
00085 struct PreviewImage* BKE_previewimg_create(void) ;
00086 
00087 /* create a copy of the preview image */
00088 struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv);
00089 
00090 /* retrieve existing or create new preview image */
00091 struct PreviewImage* BKE_previewimg_get(struct ID *id);
00092 
00093 #endif /*  BKE_ICONS_H */