Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2005-12-22 01:21:43 +0300
committerAndrea Weikert <elubie@gmx.net>2005-12-22 01:21:43 +0300
commit80eb4d3b9e851c19638599b1821a083dc5a2f635 (patch)
treebfb42679c33f19c498d3f682924ffc3e40a5d482 /source/blender/include
parent15766e1612040c41ed66fe618af1d28ab3c6d1ec (diff)
Big commit in orange: Interface icons for materials, textures
world and lamp. Also for images in pupmenus. Also preparation for work on using preview images in imagebrowser. -- Andrea
Diffstat (limited to 'source/blender/include')
-rw-r--r--source/blender/include/BIF_interface_icons.h55
-rw-r--r--source/blender/include/BIF_previewrender.h31
-rw-r--r--source/blender/include/BIF_resources.h9
3 files changed, 86 insertions, 9 deletions
diff --git a/source/blender/include/BIF_interface_icons.h b/source/blender/include/BIF_interface_icons.h
new file mode 100644
index 00000000000..2ec14b53cf2
--- /dev/null
+++ b/source/blender/include/BIF_interface_icons.h
@@ -0,0 +1,55 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL/BL DUAL 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * 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/BL DUAL LICENSE BLOCK *****
+ */
+
+#ifndef BIF_PREVIEW_ICONS_H
+#define BIF_PREVIEW_ICONS_H
+
+struct Image;
+struct ImBuf;
+struct World;
+struct Tex;
+struct Lamp;
+struct Material;
+
+/*
+ Resizable Icons for Blender
+*/
+void BIF_icons_init(int first_dyn_id);
+int BIF_icon_get_width(int icon_id);
+int BIF_icon_get_height(int icon_id);
+void BIF_icon_set_aspect(int icon_id, float aspect);
+void BIF_icon_draw(int x, int y, int icon_id);
+void BIF_icon_draw_blended(int x, int y, int icon_id, int colorid, int shade);
+void BIF_icons_free();
+void BIF_icons_free_drawinfo(void *drawinfo);
+
+#endif /* BIF_ICONS_H */
diff --git a/source/blender/include/BIF_previewrender.h b/source/blender/include/BIF_previewrender.h
index e35aee60587..cb8041832b5 100644
--- a/source/blender/include/BIF_previewrender.h
+++ b/source/blender/include/BIF_previewrender.h
@@ -31,9 +31,36 @@
*/
struct SpaceButs;
+struct RenderInfo;
+struct Image;
+struct ScrArea;
+
+typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
+
+/* stores rendered preview - is also used for icons */
+typedef struct RenderInfo {
+ int pr_rectx;
+ int pr_recty;
+ unsigned int* rect;
+ short cury;
+} RenderInfo;
+
+/* Set the previewrect for drawing */
+void BIF_set_previewrect(int win, int xmin, int ymin, int xmax, int ymax, short pr_rectx, short pr_recty);
+void BIF_end_previewrect(void);
void BIF_all_preview_changed(void);
-void BIF_preview_changed (struct SpaceButs *area);
-void BIF_previewrender (struct SpaceButs *area);
+void BIF_preview_changed (struct SpaceButs *sbuts);
+void BIF_previewrender_buts (struct SpaceButs *sbuts);
+/* Render the preview
+ * a) into the ri->rect
+ * b) draw it in the area using the block UIMat
+
+ if doDraw is false, the preview is not drawn and the function is not dynamic,
+ so no events are processed. Hopefully fast enough for 64x64 rendering or
+ at least 32x32 */
+void BIF_previewrender (struct ID* id, struct RenderInfo *ri, struct ScrArea *area, int doDraw);
void BIF_previewdraw (void);
+void BIF_previewdraw_render(struct RenderInfo* ri, struct ScrArea* area);
+void BIF_calcpreview_image(struct Image* img, struct RenderInfo* ri, unsigned int w, unsigned int h);
diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h
index 70fecc83bad..933c619f11f 100644
--- a/source/blender/include/BIF_resources.h
+++ b/source/blender/include/BIF_resources.h
@@ -33,6 +33,8 @@
#ifndef BIF_RESOURCES_H
#define BIF_RESOURCES_H
+/* elubie: TODO: move the typedef for icons to BIF_interface_icons.h */
+/* and add/replace include of BIF_resources.h by BIF_interface_icons.h */
typedef enum {
#define BIFICONID_FIRST (ICON_VIEW3D)
ICON_VIEW3D,
@@ -508,13 +510,6 @@ void BIF_resources_free (void);
void BIF_colors_init (void);
void BIF_load_ui_colors (void);
-
-// icon API
-int BIF_get_icon_width (BIFIconID icon);
-int BIF_get_icon_height (BIFIconID icon);
-void BIF_draw_icon (float x, float y, BIFIconID icon);
-void BIF_draw_icon_blended (float x, float y, BIFIconID icon, int colorid, int shade);
-
/* only for buttons in theme editor! */
char *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
char *BIF_ThemeColorsPup(int spacetype);