Blender  V2.59
UI_interface_icons.h
Go to the documentation of this file.
00001 /*
00002  * $Id: UI_interface_icons.h 37210 2011-06-05 14:00:06Z campbellbarton $
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 
00034 #ifndef UI_INTERFACE_ICONS_H
00035 #define UI_INTERFACE_ICONS_H
00036 
00037 struct Image;
00038 struct ImBuf;
00039 struct World;
00040 struct Tex;
00041 struct Lamp;
00042 struct Material;
00043 
00044 typedef struct IconFile {
00045         struct IconFile *next, *prev;
00046         char filename[80];      // FILE_MAXFILE size
00047         int index;
00048 } IconFile;
00049 
00050 #define ICON_DEFAULT_HEIGHT 16
00051 #define ICON_DEFAULT_WIDTH      16
00052 
00053 #define ICON_DEFAULT_HEIGHT_SCALE       (UI_UNIT_Y * 0.8f)
00054 #define ICON_DEFAULT_WIDTH_SCALE        (UI_UNIT_X * 0.8f)
00055 
00056 #define PREVIEW_DEFAULT_HEIGHT 96
00057 
00058 /*
00059  Resizable Icons for Blender
00060 */
00061 void UI_icons_init(int first_dyn_id);
00062 int UI_icon_get_width(int icon_id);
00063 int UI_icon_get_height(int icon_id);
00064 
00065 void UI_icon_draw(float x, float y, int icon_id);
00066 void UI_icon_draw_preview(float x, float y, int icon_id);
00067 void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect);
00068 void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size);
00069 
00070 void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha);
00071 void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb);
00072 void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha);
00073 void UI_icons_free(void);
00074 void UI_icons_free_drawinfo(void *drawinfo);
00075 
00076 struct ListBase *UI_iconfile_list(void);
00077 int UI_iconfile_get_index(const char *filename);
00078 
00079 
00080 #endif /*  UI_INTERFACE_ICONS_H */