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