~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/header_ipo.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Functions to draw the "Ipo Curve Editor" window header
5
5
 * and handle user events sent to it.
6
6
 * 
7
 
 * $Id: header_ipo.c,v 1.21 2004/04/20 04:59:04 guitargeek Exp $
 
7
 * $Id: header_ipo.c,v 1.28 2005/03/19 21:08:12 zuster Exp $
8
8
 *
9
9
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
10
10
 *
43
43
#include <config.h>
44
44
#endif
45
45
 
46
 
#ifdef WIN32
47
 
#include "BLI_winstuff.h"
48
 
#endif
49
 
 
50
 
#include "BMF_Api.h"
51
 
#include "BIF_language.h"
52
 
#ifdef INTERNATIONAL
53
 
#include "FTF_Api.h"
54
 
#endif
55
 
 
56
46
#include "DNA_ID.h"
57
47
#include "DNA_curve_types.h"
58
48
#include "DNA_key_types.h"
 
49
#include "DNA_material_types.h"
59
50
#include "DNA_ipo_types.h"
60
51
#include "DNA_object_types.h"
61
52
#include "DNA_scene_types.h"
71
62
#include "BKE_global.h"
72
63
#include "BKE_main.h"
73
64
#include "BKE_material.h"
 
65
#include "BKE_texture.h"
74
66
#include "BKE_utildefines.h"
75
67
#include "BLI_blenlib.h"
76
68
#include "BSE_drawipo.h"
 
69
#include "BSE_editipo_types.h"
77
70
#include "BSE_edit.h"
78
71
#include "BSE_editipo.h"
79
72
#include "BSE_headerbuttons.h"
80
73
 
81
 
#include "ipo.h"
82
74
#include "nla.h"
83
75
 
84
76
#include "blendef.h"
88
80
extern int totipo_edit, totipo_sel;
89
81
 
90
82
 
 
83
static void do_ipo_editmenu_transformmenu(void *arg, int event)
 
84
{
 
85
        switch(event)
 
86
        {
 
87
        case 0: /* grab/move */
 
88
                transform_ipo('g');
 
89
                break;
 
90
        case 1: /* scale */
 
91
                transform_ipo('s');
 
92
                break;
 
93
        }
 
94
}
 
95
 
 
96
static uiBlock *ipo_editmenu_transformmenu(void *arg_unused)
 
97
{
 
98
        uiBlock *block;
 
99
        short yco= 0, menuwidth=120;
 
100
 
 
101
        block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
 
102
        uiBlockSetButmFunc(block, do_ipo_editmenu_transformmenu, NULL);
 
103
 
 
104
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
 
105
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
 
106
 
 
107
        uiBlockSetDirection(block, UI_RIGHT);
 
108
        uiTextBoundsBlock(block, 60);
 
109
 
 
110
        return block;
 
111
}
 
112
 
91
113
static void do_ipo_editmenu_snapmenu(void *arg, int event)
92
114
{
93
115
        switch(event) {
370
392
        uiBlockSetButmFunc(block, do_ipo_editmenu, NULL);
371
393
 
372
394
        uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
 
395
        
 
396
        uiDefIconTextBlockBut(block, ipo_editmenu_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");     
 
397
        
373
398
        uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");       
374
399
 
375
400
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); 
591
616
                strcat(string,tmpstr);
592
617
        }
593
618
 
 
619
        if(OBACT && give_current_texture(OBACT, OBACT->actcol)) {
 
620
                sprintf(tmpstr,formatstring,"Texture",ID_TE, ICON_TEXTURE);
 
621
                strcat(string,tmpstr);
 
622
        }
 
623
 
594
624
        if(OBACT){
595
625
                if ELEM4(OBACT->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) {
596
626
                        sprintf(tmpstr,formatstring,"Vertex",ID_KE, ICON_EDIT);
774
804
                ei = get_editipo();
775
805
        
776
806
                xmax= GetButStringLength("View");
777
 
                uiDefBlockBut(block,ipo_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
 
807
                uiDefPulldownBut(block,ipo_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
778
808
                xco+=xmax;
779
809
        
780
810
                xmax= GetButStringLength("Select");
781
 
                uiDefBlockBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
 
811
                uiDefPulldownBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
782
812
                xco+=xmax;
783
813
        
784
814
                if (G.sipo->showkey) {
785
815
                        xmax= GetButStringLength("Key");
786
 
                        uiDefBlockBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, "");
 
816
                        uiDefPulldownBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, "");
787
817
                }
788
818
                else if(ei != NULL && (ei->flag & IPO_EDIT)) {
789
819
                        xmax= GetButStringLength("Point");
790
 
                        uiDefBlockBut(block,ipo_editmenu, NULL, "Point", xco, -2, xmax-3, 24, "");
 
820
                        uiDefPulldownBut(block,ipo_editmenu, NULL, "Point", xco, -2, xmax-3, 24, "");
791
821
                }
792
822
                else {
793
823
                        xmax= GetButStringLength("Curve");
794
 
                        uiDefBlockBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, "");
 
824
                        uiDefPulldownBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, "");
795
825
                }
796
826
                        
797
827
                xco+=xmax;
825
855
                icon = ICON_CONSTRAINT;
826
856
        else if (G.sipo->blocktype == ID_SEQ)
827
857
                icon = ICON_SEQUENCE;
 
858
        else if(G.sipo->blocktype == ID_TE)
 
859
                icon = ICON_TEXTURE;
828
860
 
829
 
        uiDefIconTextButS(block, MENU, B_IPOMAIN, icon, ipo_modeselect_pup(), xco,0,100,20, &(G.sipo->blocktype), 0, 0, 0, 0, "Display IPO type");
 
861
        uiDefIconTextButS(block, MENU, B_IPOMAIN, icon, ipo_modeselect_pup(), xco,0,100,20, &(G.sipo->blocktype), 0, 0, 0, 0, "Show IPO type");
830
862
 
831
863
        xco += 85;
832
864
 
833
865
        if(G.sipo->blocktype==ID_MA) {
834
 
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Material texture. Click to change.");
 
866
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Material texture.");
835
867
                xco-= 4;
836
868
        }
837
869
        if(G.sipo->blocktype==ID_WO) {
838
 
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active World texture. Click to change.");
 
870
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active World texture.");
839
871
                xco-= 4;
840
872
        }
841
873
        
842
874
        if(G.sipo->blocktype==ID_LA) {
843
 
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, 7.0, 0, 0, "Displays Channel Number of the active Lamp texture. Click to change.");
 
875
                uiDefButS(block, NUM, B_IPOMAIN, "",    xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Lamp texture. ");
844
876
                xco-= 4;
845
877
        }
846
878