- added UI_EMBOSSR option (rounded emboss)
authorDaniel Dunbar <daniel@zuster.org>
Thu, 4 Aug 2005 22:36:21 +0000 (22:36 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 4 Aug 2005 22:36:21 +0000 (22:36 +0000)
 - added support for vector icons, from user API side is just like using
   a regular icon... on icon side is defined by a function in resources.c
   instead of using the blenderbuttons png file. vector icons are much
   easier to add and scale properly. intent is that vector icons would
   be drawn in window coordinates which lets icon developers make the
   most beautiful icons, but this requires some tweaking of the interface
   drawing that I am not going to do atm.
 - changed BIF_draw_icon* to take coordinates of where to draw icon instead
   of using passed in raster position
 - switch modifier UI to using vector icons, and tweaked some position and
   style stuff.
 - replaced most uses of UI_EMBOSSX with UI_EMBOSS (do same thing, just there
   to confuse people I guess)

After the window coordinate stuff is sorted out with vector icons
it probably makes sense to move all non-photorealistic icons in blenderbuttons
to vector form just so scaling goes better.

25 files changed:
source/blender/include/BIF_interface.h
source/blender/include/BIF_resources.h
source/blender/src/buttons_editing.c
source/blender/src/buttons_object.c
source/blender/src/drawimage.c
source/blender/src/drawimasel.c
source/blender/src/drawnla.c
source/blender/src/drawoops.c
source/blender/src/drawtime.c
source/blender/src/drawview.c
source/blender/src/editscreen.c
source/blender/src/header_action.c
source/blender/src/header_buttonswin.c
source/blender/src/header_ipo.c
source/blender/src/header_nla.c
source/blender/src/header_oops.c
source/blender/src/header_script.c
source/blender/src/header_sound.c
source/blender/src/header_text.c
source/blender/src/header_time.c
source/blender/src/interface.c
source/blender/src/interface_draw.c
source/blender/src/interface_panel.c
source/blender/src/outliner.c
source/blender/src/resources.c

index e374cb3571e954df7de70c8c768767067363a745..db3e7c487bf7fb7b369d175ac2521bc1e1260d8a 100644 (file)
@@ -42,6 +42,7 @@ struct ScrArea;
 #define UI_EMBOSSN             1       /* Nothing */
 #define UI_EMBOSSM             2       /* Minimal builtin emboss, also for logic buttons */
 #define UI_EMBOSSP             3       /* Pulldown */
+#define UI_EMBOSSR             4       /* Rounded */
 
 #define UI_EMBOSSX             0       /* for a python file, which i can't change.... duh! */
 
index 70aa35a03d22d603bb07a74f2fe60031b19f7bb5..dba837b59aa60d6dce79cddad451000c71118aab 100644 (file)
@@ -299,9 +299,19 @@ typedef enum {
        ICON_CURSOR,
        ICON_ROTATECOLLECTION,
        ICON_ROTATECENTER,
-       ICON_ROTACTIVE
-       
-#define BIFICONID_LAST         (ICON_ROTACTIVE)
+       ICON_ROTACTIVE,
+
+       VICON_VIEW3D,
+       VICON_EDIT,
+       VICON_EDITMODE_DEHLT,
+       VICON_EDITMODE_HLT,
+       VICON_DISCLOSURE_TRI_RIGHT,
+       VICON_DISCLOSURE_TRI_DOWN,
+       VICON_MOVE_UP,
+       VICON_MOVE_DOWN,
+       VICON_X
+
+#define BIFICONID_LAST         (VICON_X)
 #define BIFNICONIDS                    (BIFICONID_LAST-BIFICONID_FIRST + 1)
 } BIFIconID;
 
@@ -495,8 +505,8 @@ 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                   (BIFIconID icon);
-void   BIF_draw_icon_blended   (BIFIconID icon, int colorid, int shade);
+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);
index 1449f8c5e2cf2be9954ba353d96e5d2afc9f3ca5..657ba97c6ebbd8a48e179ac3759bbfa5a4b94acc 100644 (file)
@@ -675,19 +675,13 @@ static void modifiers_setOnCage(void *ob_v, void *md_v)
 {
        Object *ob = ob_v;
        ModifierData *md;
-       int i, cageIndex = modifiers_getCageIndex(&ob->modifiers, NULL);
 
-       for (i=0,md=ob->modifiers.first; md; i++,md=md->next)
-               if (md==md_v)
-                       break;
-
-       md->mode ^= eModifierMode_OnCage;
-
-       md = md->next;
-
-       for (; md; md=md->next) {
+       for (md=ob->modifiers.first; md; md=md->next) {
                md->mode &= ~eModifierMode_OnCage;
        }
+
+       md = md_v;
+       md->mode |= eModifierMode_OnCage;
 }
 
 
@@ -716,7 +710,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
        short height, width = 295;
 
        uiBlockSetEmboss(block, UI_EMBOSSN);
-       uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, B_MODIFIER_REDRAW, ICON_DISCLOSURE_TRI_RIGHT, x, y, 20, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier");
+       uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, B_MODIFIER_REDRAW, VICON_DISCLOSURE_TRI_RIGHT, x, y, 20, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier");
 
        BIF_ThemeColor(color);
        uiBlockSetEmboss(block, UI_EMBOSS);
@@ -729,43 +723,50 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
        BIF_ThemeColor(color);
        uiDefBut(block, LABEL, B_NOP, mti->name, x+15, y-1, 100, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
 
-       uiBlockSetEmboss(block, UI_EMBOSSN);
+       uiBlockSetEmboss(block, UI_EMBOSSR);
+
        if (modifier_couldBeCage(md) && index<=lastCageIndex) {
-               int icon;
+               int icon, color;
 
                uiSetRoundBox(15);
                if (index==cageIndex) {
-                       BIF_ThemeColorShadeAlpha(color, 40, 40);
-                       icon = ICON_EDITMODE_HLT;
+                       color = TH_BUT_SETTING;
+                       icon = VICON_EDITMODE_HLT;
                } else if (index<cageIndex) {
-                       BIF_ThemeColorShade(color, 10);
-                       icon = ICON_EDITMODE_DEHLT;
+                       color = TH_BUT_NEUTRAL;
+                       icon = VICON_EDITMODE_DEHLT;
                } else {
-                       BIF_ThemeColorShade(color, -20);
-                       icon = ICON_EDITMODE_DEHLT;
+                       color = TH_BUT_NEUTRAL;
+                       icon = ICON_BLANK1;
                }
-               uiRoundBox(x+width-120+19, y-13, x+width-120+16+19, y+3, 6.0);
-               but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, icon, x+width-120, y, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
+               uiBlockSetCol(block, color);
+               but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, icon, x+width-120, y, 18, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
                uiButSetFunc(but, modifiers_setOnCage, ob, md);
+               uiBlockSetCol(block, TH_AUTO);
        }
 
-       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, ICON_REW, x+width-90, y, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack");
+       uiBlockSetCol(block, TH_BUT_ACTION);
+
+       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_UP, x+width-70, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack");
        uiButSetFunc(but, modifiers_moveUp, ob, md);
 
-       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, ICON_FF, x+width-90+20, y, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack");
+       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, x+width-70+20, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack");
        uiButSetFunc(but, modifiers_moveDown, ob, md);
 
-       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, ICON_X, x+width-30, y, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete modifier");
+       uiBlockSetEmboss(block, UI_EMBOSSN);
+
+       but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_X, x+width-70+40, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Delete modifier");
        uiButSetFunc(but, modifiers_del, ob, md);
+       uiBlockSetCol(block, TH_AUTO);
 
        BIF_ThemeColor(color);
        uiBlockSetEmboss(block, UI_EMBOSS);
        if (!(md->mode&eModifierMode_Expanded)) {
                uiBlockBeginAlign(block);
                uiDefIconButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, ICON_SCENE, x+width-120-90, y, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering");
-               uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, ICON_VIEW3D, x+width-120-90+20, y, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
+               uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, VICON_VIEW3D, x+width-120-90+20, y, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
                if (mti->flags&eModifierTypeFlag_SupportsEditmode) {
-                       uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, ICON_EDIT, x+width-120-90+40, y, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode");
+                       uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, VICON_EDIT, x+width-120-90+40, y, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode");
                }
                uiBlockEndAlign(block);
 
index 26f9ffe746babbbcb89eb4ef5ea1de96b33a267b..0f47dcf5b7c2990991ccd3d56834fe84193f2ebc 100644 (file)
@@ -362,7 +362,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                else
                        but = uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Object Constraint%t|Track To%x2|Copy Rotation%x8|Copy Location%x9|Null%x0", *xco+20, *yco, 100, 20, &con->type, 0.0, 0.0, 0.0, 0.0, "Constraint type"); 
                */
-               uiBlockSetEmboss(block, UI_EMBOSSX);
+               uiBlockSetEmboss(block, UI_EMBOSS);
                
                /* rounded header */
                BIF_ThemeColorShade(curCol, -20);
@@ -409,7 +409,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
        but = uiDefIconBut(block, BUT, B_CONSTRAINT_DEL, ICON_X, *xco+262, *yco, 19, 19, list, 0.0, 0.0, 0.0, 0.0, "Delete constraint");
        uiButSetFunc(but, del_constraint_func, con, list);
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
 
        /* Draw constraint data*/
index 5858a03a2c39f1b9dd800b5f686aac3e3953653a..3fd0ba7c13169ce0b89d8196fdf3d6824a8dc2c8 100644 (file)
@@ -539,22 +539,22 @@ static void draw_image_prop_circle(ImBuf *ibuf)
 
 static void draw_image_view_icon(void)
 {
+       float xPos = 5.0;
+
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
        
-       glRasterPos2f(5.0, 5.0);
-
        if(G.sima->flag & SI_STICKYUVS) {
-               BIF_draw_icon(ICON_STICKY2_UVS);
-               glRasterPos2f(25.0, 5.0);
+               BIF_draw_icon(xPos, 5.0, ICON_STICKY2_UVS);
+               xPos = 25.0;
        }
        else if(G.sima->flag & SI_LOCALSTICKY) {
-               BIF_draw_icon(ICON_STICKY_UVS);
-               glRasterPos2f(25.0, 5.0);
+               BIF_draw_icon(xPos, 5.0, ICON_STICKY_UVS);
+               xPos = 25.0;
        }
 
        if(G.sima->flag & SI_SELACTFACE) {
-                       BIF_draw_icon(ICON_DRAW_UVFACES);
+               BIF_draw_icon(xPos, 5.0, ICON_DRAW_UVFACES);
        }
        
        glBlendFunc(GL_ONE,  GL_ZERO); 
index e0116459eff944d44439e2362565f7fab7e58be9..f8d358a905134bb9a37a06f4ba8220dcf8f5ea47 100644 (file)
@@ -508,27 +508,24 @@ void draw_sima_area(SpaceImaSel *simasel)
                sx = simasel->desx;
                sy = simasel->deey+6;
                
-               glRasterPos2f(sx+16*0, sy);
                if (bitset(simasel->fase, IMS_FOUND_BIP)) {
-                       BIF_draw_icon(ICON_BPIBFOLDER_HLT);
+                       BIF_draw_icon(sx+16*0, sy, ICON_BPIBFOLDER_HLT);
                } else if (bitset(simasel->fase, IMS_WRITE_NO_BIP)) {
-                       BIF_draw_icon(ICON_BPIBFOLDER_DEHLT);
+                       BIF_draw_icon(sx+16*0, sy, ICON_BPIBFOLDER_DEHLT);
                } else {
-                       BIF_draw_icon(ICON_BPIBFOLDER_DEHLT);
+                       BIF_draw_icon(sx+16*0, sy, ICON_BPIBFOLDER_DEHLT);
                }
 
-               glRasterPos2f(sx+16*1, sy);
                if (bitset(simasel->fase, IMS_KNOW_INF)) {
-                       BIF_draw_icon(ICON_FOLDER_HLT);
+                       BIF_draw_icon(sx+16*1, sy, ICON_FOLDER_HLT);
                } else {
-                       BIF_draw_icon(ICON_FOLDER_DEHLT);
+                       BIF_draw_icon(sx+16*1, sy, ICON_FOLDER_DEHLT);
                }
                
-               glRasterPos2f(sx+16*2, sy);
                if (bitset(simasel->fase, IMS_KNOW_IMA)) {
-                       BIF_draw_icon(ICON_BLUEIMAGE_HLT);
+                       BIF_draw_icon(sx+16*2, sy, ICON_BLUEIMAGE_HLT);
                } else {
-                       BIF_draw_icon(ICON_BLUEIMAGE_DEHLT);
+                       BIF_draw_icon(sx+16*2, sy, ICON_BLUEIMAGE_DEHLT);
                }
        }
        
index 0fd3aed4229fdfebf004e1145bbeed1ad66bdbdf..98969f795bf9cd9fa17d28a0c927b862c8b837f6 100644 (file)
@@ -148,8 +148,7 @@ static void draw_nlatree(void)
        
                        /* Draw the action timeline */
                        if (ACTIVE_ARMATURE(base)){
-                               glRasterPos2f(x,  y-8);                         
-                               BIF_draw_icon(ICON_DOWNARROW_HLT);
+                               BIF_draw_icon(x, y-8, ICON_DOWNARROW_HLT);
                                y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
                                
                                if (base->object->action){
index 8d18466dff99642759ab48a4436398601538c389..8785024046f8f67aac02ad0b21430bf3eddb7ade 100644 (file)
@@ -213,8 +213,7 @@ void draw_icon_oops(float *co, short type)
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
 
-       glRasterPos2f(co[0],  co[1]-0.2);
-       BIF_draw_icon(icon);
+       BIF_draw_icon(co[0], co[1]-0.2, icon);
 
        glBlendFunc(GL_ONE,  GL_ZERO); 
        glDisable(GL_BLEND);
index a41f9c86ce33570772be943e20b43df17e7254fa..8c756972a09e243759d1f7613f121cbceec3afda 100644 (file)
@@ -133,18 +133,16 @@ static void draw_marker(TimeMarker *marker)
        xpixels= G.v2d->mask.xmax-G.v2d->mask.xmin;
        ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin;
 
-       /* 5 px to offset icon to align properly, space / pixels corrects for zoom */
-       glRasterPos2f(xpos-(5.0*(xspace/xpixels)), 12.0*yspace/ypixels);
-
        BIF_GetThemeColor3fv(TH_BACK, col);
 
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);                      
        
+       /* 5 px to offset icon to align properly, space / pixels corrects for zoom */
        if(marker->flag & SELECT)
-               BIF_draw_icon_blended(ICON_MARKER_HLT, (int)col, 0);
+               BIF_draw_icon_blended(xpos-(5.0*(xspace/xpixels)), 12.0*yspace/ypixels, ICON_MARKER_HLT, (int)col, 0);
        else
-               BIF_draw_icon_blended(ICON_MARKER, (int)col, 0);
+               BIF_draw_icon_blended(xpos-(5.0*(xspace/xpixels)), 12.0*yspace/ypixels, ICON_MARKER, (int)col, 0);
        
        glBlendFunc(GL_ONE, GL_ZERO);
        glDisable(GL_BLEND);            
index 4a0aecc9523e593827c1862ce4ec203cf9773b2e..0cbd5047821d227a10e0191a4797611165c996ac 100644 (file)
@@ -1040,8 +1040,7 @@ static void draw_view_icon(void)
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
        
-       glRasterPos2f(5.0, 5.0);
-       BIF_draw_icon(icon);
+       BIF_draw_icon(5.0, 5.0, icon);
        
        glBlendFunc(GL_ONE,  GL_ZERO); 
        glDisable(GL_BLEND);
index 1fb05cf93725600ddedeaa828f252be1fdad27d2..cf9eb5cb8d37b9b4a40fa75e962f5f2b745cc652 100644 (file)
@@ -3202,24 +3202,20 @@ void draw_area_emboss(ScrArea *sa)
        
        /* for test */
        if(FALSE && sa->spacetype==SPACE_VIEW3D) {
-       cpack(0xA0A0A0);
-       uiSetRoundBox(31);
-       uiRoundBoxEmboss(5.0, 5.0, 25.0, 100.0, 8.0, 0);
-
-       glEnable(GL_BLEND);
-       glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
-       
-       glRasterPos2f(8.0, 10.0);
-       BIF_draw_icon(ICON_MATERIAL_HLT);
-       glRasterPos2f(8.0, 30.0);
-       BIF_draw_icon(ICON_IPO_HLT);
-       glRasterPos2f(8.0, 50.0);
-       BIF_draw_icon(ICON_HOME);
-       glRasterPos2f(8.0, 70.0);
-       BIF_draw_icon(ICON_BORDERMOVE);
-       
-       glBlendFunc(GL_ONE,  GL_ZERO); 
-       glDisable(GL_BLEND);
+               cpack(0xA0A0A0);
+               uiSetRoundBox(31);
+               uiRoundBoxEmboss(5.0, 5.0, 25.0, 100.0, 8.0, 0);
+
+               glEnable(GL_BLEND);
+               glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
+               
+               BIF_draw_icon(8.0, 10.0, ICON_MATERIAL_HLT);
+               BIF_draw_icon(8.0, 30.0, ICON_IPO_HLT);
+               BIF_draw_icon(8.0, 50.0, ICON_HOME);
+               BIF_draw_icon(8.0, 70.0, ICON_BORDERMOVE);
+               
+               glBlendFunc(GL_ONE,  GL_ZERO); 
+               glDisable(GL_BLEND);
        }
 }
 
index e1367d4f72245a533c28e31ee26112fd3b49c6e8..bd14a933d428a79da92cc68c88ab6451e27f4397 100644 (file)
@@ -739,7 +739,7 @@ void action_buttons(void)
                xco+= xmax;
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        
        // object action is allowed to be zero!
        /* (ton) commented out below line, since people can apparently link Action to any object (mesh) and
index cac244f6c94bd6a1edb5c62643be19fcd71d91fa..ad8c69feb55f219f0d380383b5a1479527561ab6 100644 (file)
@@ -587,7 +587,7 @@ void buts_buttons(void)
 
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
        
        /* FULL WINDOW */
index 0a81f6454b9ba798093a39d01b6131c010da2305..3f617eb613b1c3cdff8062e9e7a8179533b5c257 100644 (file)
@@ -828,7 +828,7 @@ void ipo_buttons(void)
        }
 
        /* end of pull down menus */
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
        /* mainmenu, only when data is there and no pin */
        uiSetButLock(G.sipo->pin, "Can't change because of pinned data");
index ddedbb446cab24344c114792decd03041d0e1f55..a255247c2215e693a18ff18d72830de6bb0f532e 100644 (file)
@@ -354,7 +354,7 @@ void nla_buttons(void)
 
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
 
        /* FULL WINDOW */
index 7e79a5c447857d68109d741ec4f0211c7fbf9e11..1da5dc6100f4c53ab51c1751964233f9fb08af8e 100644 (file)
@@ -370,7 +370,7 @@ void oops_buttons(void)
                }
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
        if(soops->type==SO_OOPS) {
                /* ZOOM and BORDER */
index 0f00b03d7bfc4ad4c41dd52f091a09961f75f767..da51ddce9286d40fdc9eb29f5b311c7f41ad4190 100644 (file)
@@ -215,7 +215,7 @@ void script_buttons(void)
        if (!sc || sc->spacetype != SPACE_SCRIPT) return;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
 
        if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
        else uiBlockSetCol(block, TH_HEADERDESEL);
@@ -250,7 +250,7 @@ void script_buttons(void)
                xco+=xmax;
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
        uiDefIconBut(block, BUT, B_SCRIPT2PREV, ICON_GO_LEFT, xco+=XIC, 0, XIC, YIC,
                0, 0, 0, 0, 0, "Returns to previous window");
index f5503aaf686d3da342b9c146d46f0cf178aa2580..cebc9e9afd63686d982458a93c39d1e619566963 100644 (file)
@@ -279,7 +279,7 @@ void sound_buttons(void)
 
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        xco= std_libbuttons(block, xco+8, 0, 0, NULL, B_SOUNDBROWSE, (ID *)G.ssound->sound, 0, &(G.ssound->sndnr), 1, 0, 0, 0, 0);      
 
        if(G.ssound->sound) {
index 25c177d778f65e0ed92a3e1d6117918b60d6cfd8..33cdf97f57b78d27b2cb37c6e6a2a47b29df296a 100644 (file)
@@ -609,7 +609,7 @@ void text_buttons(void)
                        xco+=xmax;
                }
        }
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        xco += 10;
        
        /* FULL WINDOW */
index 83dafeeed8dbd257b71dbf9251f58b36eee896eb..c3261aabdeac48a08d39a8a40b3e81c9cf56eda5 100644 (file)
@@ -393,7 +393,7 @@ void time_buttons(ScrArea *sa)
                xco+= xmax;
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        
        uiBlockBeginAlign(block);
        uiDefButS(block, NUM, REDRAWALL,"Start:",       
index 5c4843e8664f6dcc871f0818f94d3415d6ed85a6..e47bd98387f8ec6851ecd4ea12345e8259663d74 100644 (file)
@@ -2541,7 +2541,7 @@ void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, ch
        }
        uiBlockEndAlign(block);
        
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
 
        // buttons
        rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
@@ -2592,7 +2592,7 @@ static int ui_do_but_COL(uiBut *but)
        }
        else poin= (float *)but->poin;
        
-       block= uiNewBlock(&listb, "colorpicker", UI_EMBOSSX, UI_HELV, but->win);
+       block= uiNewBlock(&listb, "colorpicker", UI_EMBOSS, UI_HELV, but->win);
        block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW;
        block->themecol= TH_BUT_NUM;
        
index bb204b850dcc99bc441fc1252888fb1ddba863f9..741cd1c9b640795247b818cb21ccd8101cc57534 100644 (file)
@@ -154,6 +154,10 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon)
        int blend= 0;
        float xs=0, ys=0;
 
+       if (icon==VICON_X) {
+               int i = 0;
+       }
+
        // this icon doesn't need draw...
        if(icon==ICON_BLANK1) return;
 
@@ -178,9 +182,6 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon)
                ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0;
        }
 
-       glRasterPos2f(xs, ys);
-       // BIF_icon_pos(xs, ys);
-
        if(but->aspect>1.1) glPixelZoom(1.0/but->aspect, 1.0/but->aspect);
        else if(but->aspect<0.9) glPixelZoom(1.0/but->aspect, 1.0/but->aspect);
 
@@ -193,7 +194,7 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon)
                else if(but->flag & UI_ACTIVE);
                else blend= -60;
        }
-       BIF_draw_icon_blended(icon, but->themecol, blend);
+       BIF_draw_icon_blended(xs, ys, icon, but->themecol, blend);
        
        glBlendFunc(GL_ONE, GL_ZERO);
        glDisable(GL_BLEND);
@@ -1728,6 +1729,7 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
        else if(drawtype==UI_EMBOSSM) but->embossfunc= ui_draw_minimal;
        else if(drawtype==UI_EMBOSSN) but->embossfunc= ui_draw_nothing;
        else if(drawtype==UI_EMBOSSP) but->embossfunc= ui_draw_pulldown_item;
+       else if(drawtype==UI_EMBOSSR) but->embossfunc= ui_draw_round;
        else {
                int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
                
index fae2ce91b862a37a1053bd55ab13fba0b1647cdf..a0583e9cf3be8d3c48cd20e8d269df383f555250 100644 (file)
@@ -1116,9 +1116,8 @@ void ui_draw_panel(uiBlock *block)
        
                ui_draw_x_icon(block->minx+2+ofsx, block->maxy+5);
                /*
-               glRasterPos2f(block->minx+4, block->maxy+3);
                if(block->aspect>1.1) glPixelZoom(1.0/block->aspect, 1.0/block->aspect);
-               BIF_draw_icon(ICON_PANEL_CLOSE);
+               BIF_draw_icon(block->minx+4, block->maxy+3, ICON_PANEL_CLOSE);
                if(block->aspect>1.1) glPixelZoom(1.0, 1.0);
                */
                ofsx= 22;
index 9957ef2bfdbe5832b2758d6b0acf3314c364ae97..ceae2838650e6cadc85a9ecd85b6c8b1e7bf38c8 100644 (file)
@@ -1888,75 +1888,75 @@ void outliner_operation_menu(ScrArea *sa)
 
 /* ***************** DRAW *************** */
 
-static void tselem_draw_icon(TreeStoreElem *tselem)
+static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem)
 {
        if(tselem->type) {
                switch( tselem->type) {
                        case TSE_NLA:
-                               BIF_draw_icon(ICON_NLA); break;
+                               BIF_draw_icon(x, y, ICON_NLA); break;
                        case TSE_NLA_ACTION:
-                               BIF_draw_icon(ICON_ACTION); break;
+                               BIF_draw_icon(x, y, ICON_ACTION); break;
                        case TSE_DEFGROUP_BASE:
-                               BIF_draw_icon(ICON_VERTEXSEL); break;
+                               BIF_draw_icon(x, y, ICON_VERTEXSEL); break;
                        case TSE_BONE:
                        case TSE_EBONE:
-                               BIF_draw_icon(ICON_WPAINT_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_WPAINT_DEHLT); break;
                        case TSE_CONSTRAINT_BASE:
-                               BIF_draw_icon(ICON_CONSTRAINT); break;
+                               BIF_draw_icon(x, y, ICON_CONSTRAINT); break;
                        case TSE_HOOKS_BASE:
-                               BIF_draw_icon(ICON_HOOK); break;
+                               BIF_draw_icon(x, y, ICON_HOOK); break;
                        case TSE_HOOK:
-                               BIF_draw_icon(ICON_OBJECT); break;
+                               BIF_draw_icon(x, y, ICON_OBJECT); break;
                        case TSE_SCRIPT_BASE:
-                               BIF_draw_icon(ICON_TEXT); break;
+                               BIF_draw_icon(x, y, ICON_TEXT); break;
                        case TSE_POSE_BASE:
-                               BIF_draw_icon(ICON_ARMATURE_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_ARMATURE_DEHLT); break;
                        case TSE_POSE_CHANNEL:
-                               BIF_draw_icon(ICON_WPAINT_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_WPAINT_DEHLT); break;
                        default:
-                               BIF_draw_icon(ICON_DOT); break;
+                               BIF_draw_icon(x, y, ICON_DOT); break;
                }
        }
        else {
                switch( GS(tselem->id->name)) {
                        case ID_SCE:
-                               BIF_draw_icon(ICON_SCENE_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_SCENE_DEHLT); break;
                        case ID_OB:
-                               BIF_draw_icon(ICON_OBJECT); break;
+                               BIF_draw_icon(x, y, ICON_OBJECT); break;
                        case ID_ME:
-                               BIF_draw_icon(ICON_MESH); break;
+                               BIF_draw_icon(x, y, ICON_MESH); break;
                        case ID_CU:
-                               BIF_draw_icon(ICON_CURVE); break;
+                               BIF_draw_icon(x, y, ICON_CURVE); break;
                        case ID_MB:
-                               BIF_draw_icon(ICON_MBALL); break;
+                               BIF_draw_icon(x, y, ICON_MBALL); break;
                        case ID_LT:
-                               BIF_draw_icon(ICON_LATTICE); break;
+                               BIF_draw_icon(x, y, ICON_LATTICE); break;
                        case ID_LA:
-                               BIF_draw_icon(ICON_LAMP_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_LAMP_DEHLT); break;
                        case ID_MA:
-                               BIF_draw_icon(ICON_MATERIAL_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_MATERIAL_DEHLT); break;
                        case ID_TE:
-                               BIF_draw_icon(ICON_TEXTURE_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_TEXTURE_DEHLT); break;
                        case ID_IP:
-                               BIF_draw_icon(ICON_IPO_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_IPO_DEHLT); break;
                        case ID_IM:
-                               BIF_draw_icon(ICON_IMAGE_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_IMAGE_DEHLT); break;
                        case ID_SO:
-                               BIF_draw_icon(ICON_SPEAKER); break;
+                               BIF_draw_icon(x, y, ICON_SPEAKER); break;
                        case ID_AR:
-                               BIF_draw_icon(ICON_WPAINT_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_WPAINT_DEHLT); break;
                        case ID_CA:
-                               BIF_draw_icon(ICON_CAMERA_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_CAMERA_DEHLT); break;
                        case ID_KE:
-                               BIF_draw_icon(ICON_EDIT_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_EDIT_DEHLT); break;
                        case ID_WO:
-                               BIF_draw_icon(ICON_WORLD_DEHLT); break;
+                               BIF_draw_icon(x, y, ICON_WORLD_DEHLT); break;
                        case ID_AC:
-                               BIF_draw_icon(ICON_ACTION); break;
+                               BIF_draw_icon(x, y, ICON_ACTION); break;
                        case ID_NLA:
-                               BIF_draw_icon(ICON_NLA); break;
+                               BIF_draw_icon(x, y, ICON_NLA); break;
                        case ID_TXT:
-                               BIF_draw_icon(ICON_SCRIPT); break;
+                               BIF_draw_icon(x, y, ICON_SCRIPT); break;
                }
        }
 }
@@ -1989,8 +1989,7 @@ static void outliner_draw_iconrow(SpaceOops *soops, ListBase *lb, int level, int
                                glEnable(GL_BLEND);
                        }
                        
-                       glRasterPos2i(*offsx, ys);
-                       tselem_draw_icon(tselem);
+                       tselem_draw_icon(*offsx, ys, tselem);
                        te->xs= *offsx;
                        te->ys= ys;
                        te->xend= *offsx+OL_X;
@@ -2067,21 +2066,24 @@ static void outliner_draw_tree_element(SpaceOops *soops, TreeElement *te, int st
                
                /* open/close icon, only when sublevels, except for scene */
                if(te->subtree.first || te->idcode==ID_SCE) {
+                       int icon_x;
                        if(tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE))
-                               glRasterPos2i(startx, *starty+2); // icons a bit higher
+                               icon_x = startx;
                        else
-                               glRasterPos2i(startx+5, *starty+2); // icons a bit higher
+                               icon_x = startx+5;
+
+                               // icons a bit higher
                        if(tselem->flag & TSE_CLOSED) 
-                               BIF_draw_icon(ICON_TRIA_CLOSED);
+                               BIF_draw_icon(icon_x, *starty+2, ICON_TRIA_CLOSED);
                        else
-                               BIF_draw_icon(ICON_TRIA_OPEN);
+                               BIF_draw_icon(icon_x, *starty+2, ICON_TRIA_OPEN);
                }
                offsx+= OL_X;
                
                /* datatype icon */
                
-               glRasterPos2i(startx+offsx, *starty+2); // icons a bit higher
-               tselem_draw_icon(tselem);
+                       // icons a bit higher
+               tselem_draw_icon(startx+offsx, *starty+2, tselem);
                offsx+= OL_X;
                glDisable(GL_BLEND);
 
index a841a85471827dcff3be4d42b97401295fd36e0e..8ed6beb6bbc72cf005bd1b51cd55a31c3656056d 100644 (file)
 #include "datatoc.h"
 
 /* global for themes */
+typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
+
 static bTheme *theme_active=NULL;
 static int theme_spacetype= SPACE_VIEW3D;
 
 typedef struct {
+               /* If drawFunc is defined then it is a vector icon, otherwise use data */
+       VectorDrawFunc drawFunc;
+
+       int w, h;
+
+               /* Data for image icons */
        unsigned char *data;
        float uv[4][2];
        GLuint texid;
-       int w, h;
 } Icon;
 
+static Icon *icon_new_vector(VectorDrawFunc drawFunc, int w, int h)
+{
+       Icon *icon= MEM_callocN(sizeof(*icon), "internicon");
+       icon->drawFunc = drawFunc;
+       icon->w = w;
+       icon->h = h;
+
+       return icon;
+}
 
 static Icon *icon_from_data(unsigned char *rect, GLuint texid, int xofs, int yofs, int w, int h, int rowstride)
 {
        Icon *icon= MEM_mallocN(sizeof(*icon), "internicon");
        int y;
 
+       icon->drawFunc = NULL;
        icon->texid= texid;
        icon->uv[0][0]= ((float)xofs)/512.0;
        icon->uv[0][1]= ((float)yofs)/256.0;
@@ -142,28 +159,36 @@ static void icon_draw_tex(Icon *icon)
 #endif
 
 
-static void icon_draw(Icon *icon)
+static void icon_draw(float x, float y, Icon *icon)
 {
-       glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data);
+       if (icon->drawFunc) {
+               icon->drawFunc(x, y, icon->w, icon->h, 1.0);
+       } else {
+               glRasterPos2f(x, y);
+               glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data);
+       }
 }
 
 
-static void icon_draw_blended(Icon *icon, char *blendcol, int shade)
+static void icon_draw_blended(float x, float y, Icon *icon, char *blendcol, int shade)
 {
-
-       if(shade < 0) {
-               float r= (128+shade)/128.0;
-               glPixelTransferf(GL_ALPHA_SCALE, r);
+       if (icon->drawFunc) {
+               icon->drawFunc(x, y, icon->w, icon->h, shade<0?((128+shade)/128.0):1.0);
+       } else {
+               if(shade < 0) {
+                       float r= (128+shade)/128.0;
+                       glPixelTransferf(GL_ALPHA_SCALE, r);
+               }
+               glRasterPos2f(x, y);
+               glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data);
+               glPixelTransferf(GL_ALPHA_SCALE, 1.0);
        }
-       glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data);
-       glPixelTransferf(GL_ALPHA_SCALE, 1.0);
-
 }
 
 
 static void icon_free(Icon *icon)
 {
-       MEM_freeN(icon->data);
+       if (icon->data) MEM_freeN(icon->data);
        MEM_freeN(icon);
 }
 
@@ -188,17 +213,16 @@ static void free_common_icons(void)
        }
 }
 
-void BIF_draw_icon(BIFIconID icon)
+void BIF_draw_icon(float x, float y, BIFIconID icon)
 {
-       icon_draw(get_icon(icon));
+       icon_draw(x, y, get_icon(icon));
 }
 
-void BIF_draw_icon_blended(BIFIconID icon, int colorid, int shade)
+void BIF_draw_icon_blended(float x, float y, BIFIconID icon, int colorid, int shade)
 {
        char *cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
-       icon_draw_blended(get_icon(icon), cp, shade);
+       icon_draw_blended(x, y, get_icon(icon), cp, shade);
        // icon_draw_tex(get_icon(icon));
-
 }
 
 int BIF_get_icon_width(BIFIconID icon)
@@ -227,6 +251,17 @@ static void def_icon(ImBuf *bbuf, GLuint texid, BIFIconID icon, int xidx, int yi
        }
 }
 
+static void def_vicon(BIFIconID icon, int w, int h, VectorDrawFunc drawFunc)
+{
+       int iconidx= icon-BIFICONID_FIRST;
+       
+       if (iconidx>=0 && iconidx<BIFNICONIDS) {
+               common_icons_arr[iconidx]= icon_new_vector(drawFunc, w, h);
+       } else {
+               printf("def_icon: Internal error, bad icon ID: %d\n", icon);
+       }
+}
+
 /* this only works for the hardcoded buttons image, turning the grey AA pixels to alpha, and slight off-grey to half alpha */
 
 static void clear_transp_rect_soft(unsigned char *transp, unsigned char *rect, int w, int h, int rowstride)
@@ -278,6 +313,264 @@ static void clear_transp_rect(unsigned char *transp, unsigned char *rect, int w,
        }
 }
 
+/* Vector Icon Drawing Routines */
+
+       /* Utilities */
+
+static void viconutil_set_point(int pt[2], int x, int y)
+{
+       pt[0] = x;
+       pt[1] = y;
+}
+
+static void viconutil_draw_tri(int (*pts)[2])
+{
+       glBegin(GL_TRIANGLES);
+       glVertex2iv(pts[0]);
+       glVertex2iv(pts[1]);
+       glVertex2iv(pts[2]);
+       glEnd();
+}
+
+static void viconutil_draw_quad(int (*pts)[2])
+{
+       glBegin(GL_QUADS);
+       glVertex2iv(pts[0]);
+       glVertex2iv(pts[1]);
+       glVertex2iv(pts[2]);
+       glVertex2iv(pts[3]);
+       glEnd();
+}
+
+static void viconutil_draw_lineloop(int (*pts)[2], int numPoints)
+{
+       int i;
+
+       glBegin(GL_LINE_LOOP);
+       for (i=0; i<numPoints; i++) {
+               glVertex2iv(pts[i]);
+       }
+       glEnd();
+}
+
+static void viconutil_draw_lineloop_smooth(int (*pts)[2], int numPoints)
+{
+       glEnable(GL_LINE_SMOOTH);
+       viconutil_draw_lineloop(pts, numPoints);
+       glDisable(GL_LINE_SMOOTH);
+}
+
+static void viconutil_draw_points(int (*pts)[2], int numPoints, int pointSize)
+{
+       int i;
+
+       glBegin(GL_QUADS);
+       for (i=0; i<numPoints; i++) {
+               int x = pts[i][0], y = pts[i][1];
+
+               glVertex2i(x-pointSize,y-pointSize);
+               glVertex2i(x+pointSize,y-pointSize);
+               glVertex2i(x+pointSize,y+pointSize);
+               glVertex2i(x-pointSize,y+pointSize);
+       }
+       glEnd();
+}
+
+       /* Drawing functions */
+
+static void vicon_x_draw(int x, int y, int w, int h, float alpha)
+{
+       x += 3;
+       y += 3;
+       w -= 6;
+       h -= 6;
+
+       glEnable( GL_LINE_SMOOTH );
+
+       glLineWidth(2.5);
+       
+       glColor4f(0.0, 0.0, 0.0, alpha);
+       glBegin(GL_LINES);
+       glVertex2i(x  ,y  );
+       glVertex2i(x+w,y+h);
+       glVertex2i(x+w,y  );
+       glVertex2i(x  ,y+h);
+       glEnd();
+
+       glLineWidth(1.0);
+       
+       glDisable( GL_LINE_SMOOTH );
+}
+
+static void vicon_view3d_draw(int x, int y, int w, int h, float alpha)
+{
+       int cx = x + w/2;
+       int cy = y + h/2;
+       int d = MAX2(2, h/3);
+
+       glColor4f(0.5, 0.5, 0.5, alpha);
+       glBegin(GL_LINES);
+       glVertex2i(x  , cy-d);
+       glVertex2i(x+w, cy-d);
+       glVertex2i(x  , cy+d);
+       glVertex2i(x+w, cy+d);
+
+       glVertex2i(cx-d, y  );
+       glVertex2i(cx-d, y+h);
+       glVertex2i(cx+d, y  );
+       glVertex2i(cx+d, y+h);
+       glEnd();
+       
+       glColor4f(0.0, 0.0, 0.0, alpha);
+       glBegin(GL_LINES);
+       glVertex2i(x  , cy);
+       glVertex2i(x+w, cy);
+       glVertex2i(cx, y  );
+       glVertex2i(cx, y+h);
+       glEnd();
+}
+
+static void vicon_edit_draw(int x, int y, int w, int h, float alpha)
+{
+       int pts[4][2];
+
+       viconutil_set_point(pts[0], x+3  , y+3  );
+       viconutil_set_point(pts[1], x+w-3, y+3  );
+       viconutil_set_point(pts[2], x+w-3, y+h-3);
+       viconutil_set_point(pts[3], x+3  , y+h-3);
+
+       glColor4f(0.0, 0.0, 0.0, alpha);
+       viconutil_draw_lineloop(pts, 4);
+
+       glColor3f(1, 1, 0.0);
+       viconutil_draw_points(pts, 4, 1);
+}
+
+static void vicon_editmode_hlt_draw(int x, int y, int w, int h, float alpha)
+{
+       int pts[3][2];
+
+       viconutil_set_point(pts[0], x+w/2, y+h-3);
+       viconutil_set_point(pts[1], x+3, y+3);
+       viconutil_set_point(pts[2], x+w-3, y+3);
+
+       glColor4f(0.5, 0.5, 0.5, alpha);
+       viconutil_draw_tri(pts);
+
+       glColor4f(0.0, 0.0, 0.0, 1);
+       viconutil_draw_lineloop_smooth(pts, 3);
+
+       glColor3f(1, 1, 0.0);
+       viconutil_draw_points(pts, 3, 1);
+}
+
+static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float alpha)
+{
+       int pts[3][2];
+
+       viconutil_set_point(pts[0], x+w/2, y+h-3);
+       viconutil_set_point(pts[1], x+3, y+3);
+       viconutil_set_point(pts[2], x+w-3, y+3);
+
+       glColor4f(0.0, 0.0, 0.0, 1);
+       viconutil_draw_lineloop_smooth(pts, 3);
+
+       glColor3f(.9, .9, .9);
+       viconutil_draw_points(pts, 3, 1);
+}
+
+static void vicon_disclosure_tri_right_draw(int x, int y, int w, int h, float alpha)
+{
+       int pts[3][2];
+       int cx = x+w/2;
+       int cy = y+w/2;
+       int d = w/3, d2 = w/5;
+
+       viconutil_set_point(pts[0], cx-d2, cy+d);
+       viconutil_set_point(pts[1], cx-d2, cy-d);
+       viconutil_set_point(pts[2], cx+d2, cy);
+
+       glShadeModel(GL_SMOOTH);
+       glBegin(GL_TRIANGLES);
+       glColor4f(0.8, 0.8, 0.8, alpha);
+       glVertex2iv(pts[0]);
+       glVertex2iv(pts[1]);
+       glColor4f(0.3, 0.3, 0.3, alpha);
+       glVertex2iv(pts[2]);
+       glEnd();
+       glShadeModel(GL_FLAT);
+
+       glColor4f(0.0, 0.0, 0.0, 1);
+       viconutil_draw_lineloop_smooth(pts, 3);
+}
+
+static void vicon_disclosure_tri_down_draw(int x, int y, int w, int h, float alpha)
+{
+       int pts[3][2];
+       int cx = x+w/2;
+       int cy = y+w/2;
+       int d = w/3, d2 = w/5;
+
+       viconutil_set_point(pts[0], cx+d, cy+d2);
+       viconutil_set_point(pts[1], cx-d, cy+d2);
+       viconutil_set_point(pts[2], cx, cy-d2);
+
+       glShadeModel(GL_SMOOTH);
+       glBegin(GL_TRIANGLES);
+       glColor4f(0.8, 0.8, 0.8, alpha);
+       glVertex2iv(pts[0]);
+       glVertex2iv(pts[1]);
+       glColor4f(0.3, 0.3, 0.3, alpha);
+       glVertex2iv(pts[2]);
+       glEnd();
+       glShadeModel(GL_FLAT);
+
+       glColor4f(0.0, 0.0, 0.0, 1);
+       viconutil_draw_lineloop_smooth(pts, 3);
+}
+
+static void vicon_move_up_draw(int x, int y, int w, int h, float alpha)
+{
+       int i, d=-2, pad=3;
+
+       glEnable(GL_LINE_SMOOTH);
+       glLineWidth(2);
+       glColor3f(0.0, 0.0, 0.0);
+       for (i=0; i<2; i++) {
+               int offs = (i?2:-2) + 1;
+
+               glBegin(GL_LINE_STRIP);
+               glVertex2i(x+pad, y+h/2+d + offs);
+               glVertex2i(x+w/2, y+h/2-d + offs);
+               glVertex2i(x+w-pad, y+h/2+d + offs);
+               glEnd();
+       }
+       glLineWidth(1.0);
+       glDisable(GL_LINE_SMOOTH);
+}
+
+static void vicon_move_down_draw(int x, int y, int w, int h, float alpha)
+{
+       int i, d=2, pad=3;
+
+       glEnable(GL_LINE_SMOOTH);
+       glLineWidth(2);
+       glColor3f(0.0, 0.0, 0.0);
+       for (i=0; i<2; i++) {
+               int offs = (i?2:-2) - 1;
+
+               glBegin(GL_LINE_STRIP);
+               glVertex2i(x+pad, y+h/2+d + offs);
+               glVertex2i(x+w/2, y+h/2-d + offs);
+               glVertex2i(x+w-pad, y+h/2+d + offs);
+               glEnd();
+       }
+       glLineWidth(1.0);
+       glDisable(GL_LINE_SMOOTH);
+}
+
+/***/
+
 void BIF_resources_init(void)
 {
        ImBuf *bbuf= IMB_ibImageFromMemory((int *)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect);
@@ -325,6 +618,16 @@ void BIF_resources_init(void)
                }
        }
 
+       def_vicon(VICON_VIEW3D, 16, 16, vicon_view3d_draw);
+       def_vicon(VICON_EDIT, 16, 16, vicon_edit_draw);
+       def_vicon(VICON_EDITMODE_DEHLT, 16, 16, vicon_editmode_dehlt_draw);
+       def_vicon(VICON_EDITMODE_HLT, 16, 16, vicon_editmode_hlt_draw);
+       def_vicon(VICON_DISCLOSURE_TRI_RIGHT, 16, 16, vicon_disclosure_tri_right_draw);
+       def_vicon(VICON_DISCLOSURE_TRI_DOWN, 16, 16, vicon_disclosure_tri_down_draw);
+       def_vicon(VICON_MOVE_UP, 16, 16, vicon_move_up_draw);
+       def_vicon(VICON_MOVE_DOWN, 16, 16, vicon_move_down_draw);
+       def_vicon(VICON_X, 16, 16, vicon_x_draw);
+
        IMB_freeImBuf(bbuf);    
 }