2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-11-25 18:27:41 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-11-25 18:27:41 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-21 07:25:24 +00:00
|
|
|
/** \file UI_interface_icons.h
|
|
|
|
* \ingroup editorui
|
|
|
|
*/
|
|
|
|
|
2009-01-06 10:31:25 +00:00
|
|
|
#ifndef UI_INTERFACE_ICONS_H
|
|
|
|
#define UI_INTERFACE_ICONS_H
|
2008-11-25 18:27:41 +00:00
|
|
|
|
|
|
|
struct Image;
|
|
|
|
struct ImBuf;
|
|
|
|
struct World;
|
|
|
|
struct Tex;
|
|
|
|
struct Lamp;
|
|
|
|
struct Material;
|
|
|
|
|
|
|
|
typedef struct IconFile {
|
|
|
|
struct IconFile *next, *prev;
|
|
|
|
char filename[80]; // FILE_MAXFILE size
|
|
|
|
int index;
|
|
|
|
} IconFile;
|
|
|
|
|
|
|
|
#define ICON_DEFAULT_HEIGHT 16
|
2009-03-10 08:54:35 +00:00
|
|
|
#define ICON_DEFAULT_WIDTH 16
|
2011-06-05 14:00:06 +00:00
|
|
|
|
2011-09-25 12:33:51 +00:00
|
|
|
#define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
|
|
|
|
#define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f))
|
2011-06-05 14:00:06 +00:00
|
|
|
|
2008-11-25 18:27:41 +00:00
|
|
|
#define PREVIEW_DEFAULT_HEIGHT 96
|
|
|
|
|
|
|
|
/*
|
|
|
|
Resizable Icons for Blender
|
|
|
|
*/
|
2008-11-25 19:23:54 +00:00
|
|
|
void UI_icons_init(int first_dyn_id);
|
|
|
|
int UI_icon_get_width(int icon_id);
|
|
|
|
int UI_icon_get_height(int icon_id);
|
2008-11-25 18:27:41 +00:00
|
|
|
|
2008-11-25 19:23:54 +00:00
|
|
|
void UI_icon_draw(float x, float y, int icon_id);
|
2010-01-03 08:37:18 +00:00
|
|
|
void UI_icon_draw_preview(float x, float y, int icon_id);
|
|
|
|
void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect);
|
|
|
|
void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size);
|
2008-11-25 18:27:41 +00:00
|
|
|
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha);
|
|
|
|
void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb);
|
|
|
|
void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha);
|
2010-12-03 12:30:59 +00:00
|
|
|
void UI_icons_free(void);
|
2008-11-25 19:23:54 +00:00
|
|
|
void UI_icons_free_drawinfo(void *drawinfo);
|
2008-11-25 18:27:41 +00:00
|
|
|
|
2008-11-25 19:23:54 +00:00
|
|
|
struct ListBase *UI_iconfile_list(void);
|
2010-11-19 02:14:18 +00:00
|
|
|
int UI_iconfile_get_index(const char *filename);
|
2008-11-25 18:27:41 +00:00
|
|
|
|
|
|
|
|
2009-01-06 10:31:25 +00:00
|
|
|
#endif /* UI_INTERFACE_ICONS_H */
|