Converted the Userpreference buttons to zr's new ButBit calls.
authorRob Haarsma <phaseIV@zonnet.nl>
Tue, 13 Jan 2004 14:50:45 +0000 (14:50 +0000)
committerRob Haarsma <phaseIV@zonnet.nl>
Tue, 13 Jan 2004 14:50:45 +0000 (14:50 +0000)
Also added USER_*  to each define located in DNA_userdef.h.

31 files changed:
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/object.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/python/api2_2x/Blender.c
source/blender/python/api2_2x/Object.c
source/blender/src/drawimage.c
source/blender/src/drawipo.c
source/blender/src/drawscene.c
source/blender/src/drawview.c
source/blender/src/editaction.c
source/blender/src/editipo.c
source/blender/src/editkey.c
source/blender/src/editnla.c
source/blender/src/editobject.c
source/blender/src/editscreen.c
source/blender/src/editsima.c
source/blender/src/filesel.c
source/blender/src/ghostwinlay.c
source/blender/src/header_filesel.c
source/blender/src/header_info.c
source/blender/src/headerbuttons.c
source/blender/src/interface.c
source/blender/src/interface_draw.c
source/blender/src/interface_panel.c
source/blender/src/language.c
source/blender/src/space.c
source/blender/src/toolbox.c
source/blender/src/usiblender.c
source/blender/src/view.c
source/blender/src/writeavicodec.c

index e1ff554494db5e14f7729ed3555c048d815b498b..422be9c78c732565e751a152fb4ac62939a3f9ff 100644 (file)
@@ -4014,7 +4014,7 @@ static void dxf_read(char *filename)
                                                ob->type= OB_MESH;
        
                                                ob->dt= OB_SHADED;
-                                               if(U.flag & MAT_ON_OB) ob->colbits= -1;
+                                               if(U.flag & USER_MAT_ON_OB) ob->colbits= -1;
 
                                                ob->trackflag= OB_POSY;
                                                ob->upflag= OB_POSZ;
index 77a96a168b3f322567a0136bba13537353b18350..ac795df3375980070967f89050ef6724ac6545ae 100644 (file)
@@ -633,7 +633,7 @@ Object *add_object(int type)
        Mat4One(ob->parentinv);
        Mat4One(ob->obmat);
        ob->dt= OB_SHADED;
-       if(U.flag & MAT_ON_OB) ob->colbits= -1;
+       if(U.flag & USER_MAT_ON_OB) ob->colbits= -1;
        
        if(type==OB_CAMERA || type==OB_LAMP) {
                ob->trackflag= OB_NEGZ;
index 4fda7882dcdac4d139e66186d9229a3c49ae43fc..07756d62d962518f1d3b4f4b9c2396207868fd09 100644 (file)
@@ -134,7 +134,7 @@ int IMB_ispic_name(char *name)
 
 int IMB_ispic(char *filename)
 {
-       if(U.uiflag & FILTERFILEEXTS) {
+       if(U.uiflag & USER_FILTERFILEEXTS) {
                if (G.have_quicktime){
                        if(             BLI_testextensie(filename, ".jpg")
                                ||      BLI_testextensie(filename, ".jpeg")
@@ -248,7 +248,7 @@ int imb_get_anim_type(char * name) {
 int IMB_isanim(char *filename) {
        int type;
        
-       if(U.uiflag & FILTERFILEEXTS) {
+       if(U.uiflag & USER_FILTERFILEEXTS) {
                if (G.have_quicktime){
                        if(             BLI_testextensie(filename, ".avi")
                                ||      BLI_testextensie(filename, ".flc")
index 72646db2207651fe8419afcb3bc05d508f438528..67354720e6dd4448ac731192d125cbaec092397c 100644 (file)
@@ -155,72 +155,69 @@ extern UserDef U; /* from usiblender.c !!!! */
 /* ***************** USERDEF ****************** */
 
 /* flag */
-#define AUTOSAVE               1
-#define AUTOGRABGRID   2
-#define AUTOROTGRID            4
-#define AUTOSIZEGRID   8
-#define SCENEGLOBAL            16
-#define TRACKBALL              32
-#define DUPLILINK              64
-#define FSCOLLUM               128
-#define MAT_ON_OB              256
-#define NO_CAPSLOCK            512
-#define VIEWMOVE               1024
-#define TOOLTIPS               2048
-#define TWOBUTTONMOUSE 4096
-#define NONUMPAD               8192
+#define USER_AUTOSAVE                  1
+#define USER_AUTOGRABGRID              2
+#define USER_AUTOROTGRID               4
+#define USER_AUTOSIZEGRID              8
+#define USER_SCENEGLOBAL               16
+#define USER_TRACKBALL                 32
+#define USER_DUPLILINK                 64
+#define USER_FSCOLLUM                  128
+#define USER_MAT_ON_OB                 256
+#define USER_NO_CAPSLOCK               512
+#define USER_VIEWMOVE                  1024
+#define USER_TOOLTIPS                  2048
+#define USER_TWOBUTTONMOUSE            4096
+#define USER_NONUMPAD                  8192
 
 /* uiflag */
 
-#define        KEYINSERTACT    1
-#define        KEYINSERTOBJ    2
-#define WHEELZOOMDIR   4
-#define FILTERFILEEXTS 8
-#define DRAWVIEWINFO   16
-#define EVTTOCONSOLE   32              // print ghost events, here for tuhopuu compat. --phase
+#define        USER_KEYINSERTACT               1
+#define        USER_KEYINSERTOBJ               2
+#define USER_WHEELZOOMDIR              4
+#define USER_FILTERFILEEXTS            8
+#define USER_DRAWVIEWINFO              16
+#define USER_EVTTOCONSOLE              32              // print ghost events, here for tuhopuu compat. --phase
                                                                // old flag for hide pulldown was here 
-#define FLIPFULLSCREEN 128
-#define ALLWINCODECS   256
-#define MENUOPENAUTO   512
+#define USER_FLIPFULLSCREEN            128
+#define USER_ALLWINCODECS              256
+#define USER_MENUOPENAUTO              512
 
 /* transopts */
 
-#define        TR_TOOLTIPS             1
-#define        TR_BUTTONS              2
-#define TR_MENUS               4
-#define TR_FILESELECT  8
-#define TR_TEXTEDIT            16
-#define TR_ALL                 32
+#define        USER_TR_TOOLTIPS                1
+#define        USER_TR_BUTTONS                 2
+#define USER_TR_MENUS                  4
+#define USER_TR_FILESELECT             8
+#define USER_TR_TEXTEDIT               16
+#define USER_DOTRANSLATE               32
 
 /* dupflag */
 
-#define DUPMESH                        1
-#define DUPCURVE               2
-#define DUPSURF                        4
-#define DUPFONT                        8
-#define DUPMBALL               16
-#define DUPLAMP                        32
-#define DUPIPO                 64
-#define DUPMAT                 128
-#define DUPTEX                 256
-#define        DUPARM                  512
-#define        DUPACT                  1024
+#define USER_DUP_MESH                  1
+#define USER_DUP_CURVE                 2
+#define USER_DUP_SURF                  4
+#define USER_DUP_FONT                  8
+#define USER_DUP_MBALL                 16
+#define USER_DUP_LAMP                  32
+#define USER_DUP_IPO                   64
+#define USER_DUP_MAT                   128
+#define USER_DUP_TEX                   256
+#define        USER_DUP_ARM                    512
+#define        USER_DUP_ACT                    1024
 
 /* gameflags */
 
-#define USERDEF_VERTEX_ARRAYS_BIT        0
-#define USERDEF_DISABLE_SOUND_BIT        1
-#define USERDEF_DISABLE_MIPMAP_BIT       2
+#define USER_VERTEX_ARRAYS             1
+#define USER_DISABLE_SOUND             2
+#define USER_DISABLE_MIPMAP            4
 
-#define USERDEF_VERTEX_ARRAYS        (1 << USERDEF_VERTEX_ARRAYS_BIT)
-#define USERDEF_DISABLE_SOUND        (1 << USERDEF_DISABLE_SOUND_BIT)
-#define USERDEF_DISABLE_MIPMAP       (1 << USERDEF_DISABLE_MIPMAP_BIT)
 
 /* vrml flag */
 
-#define USERDEF_VRML_LAYERS            1
-#define USERDEF_VRML_AUTOSCALE 2
-#define USERDEF_VRML_TWOSIDED  4
+#define USER_VRML_LAYERS               1
+#define USER_VRML_AUTOSCALE            2
+#define USER_VRML_TWOSIDED             4
 
 #endif
 
index 9ece702af8dbe53fc9df6060e43fa01fd2947020..a2de9891f1d6e9c01ad4f8729733a27fd9cd35a4 100644 (file)
@@ -119,13 +119,13 @@ PyObject *Blender_Get (PyObject *self, PyObject *args)
       dict = PyDict_New ();
 
       PyDict_SetItemString (dict, "twoside",
-                  PyInt_FromLong (U.vrmlflag & USERDEF_VRML_TWOSIDED));
+                  PyInt_FromLong (U.vrmlflag & USER_VRML_TWOSIDED));
 
       PyDict_SetItemString (dict, "layers",
-                  PyInt_FromLong (U.vrmlflag & USERDEF_VRML_LAYERS));
+                  PyInt_FromLong (U.vrmlflag & USER_VRML_LAYERS));
 
       PyDict_SetItemString (dict, "autoscale",
-                  PyInt_FromLong (U.vrmlflag & USERDEF_VRML_AUTOSCALE));
+                  PyInt_FromLong (U.vrmlflag & USER_VRML_AUTOSCALE));
 
       return (dict);
     } /* End 'quick hack' part. */
index ac31b7ad1952a9ed228ee4096cf5ccd292bcb68e..8448779ea7bf1c542a0218835293c3ebbc6e1ac1 100644 (file)
@@ -305,7 +305,7 @@ PyObject *M_Object_New(PyObject *self, PyObject *args)
   Mat4One(object->obmat);
   object->dt = OB_SHADED; // drawtype
 
-  if (U.flag & MAT_ON_OB)
+  if (U.flag & USER_MAT_ON_OB)
   {
                object->colbits = -1;
   }
index 9dd3bb375901209d53b52df679bfa5fc6a882c36..038bcb37159790652b8c15b89ae8ae4c4cf2f8e6 100644 (file)
@@ -553,7 +553,7 @@ void image_viewzoom(unsigned short event)
        SpaceImage *sima= curarea->spacedata.first;
        int width, height;
 
-       if(U.uiflag & WHEELZOOMDIR) {
+       if(U.uiflag & USER_WHEELZOOMDIR) {
                if (event==WHEELDOWNMOUSE || event == PADPLUSKEY) {
                        sima->zoom *= 2;
                } else {
index aa1dba8454bf1d2e5732a35e95665523d5d34b96..5d3e18c5cb97ec599cda7f234982ff48b1ecaf31 100644 (file)
@@ -1745,7 +1745,7 @@ int view2dzoom(unsigned short event)
                * alt-ctrl mousewheel:  zoom x only
                */
                if (event==WHEELUPMOUSE) {
-                       if(U.uiflag & WHEELZOOMDIR)
+                       if(U.uiflag & USER_WHEELZOOMDIR)
                                wtemp = -0.0375;
                        else
                                wtemp = 0.03;
@@ -1770,7 +1770,7 @@ int view2dzoom(unsigned short event)
                        }
                }
                else if (event==WHEELDOWNMOUSE) {
-                       if(U.uiflag & WHEELZOOMDIR)
+                       if(U.uiflag & USER_WHEELZOOMDIR)
                                wtemp = 0.03;
                        else
                                wtemp = -0.0375;
index 06453f6dc0eb15632a11053e90a8b7a7db2336b8..4ce38c93c3c93eb8301505d2b916cbbc57732589 100644 (file)
@@ -68,7 +68,7 @@ void set_scene(Scene *sce)            /* also see scene.c: set_scene_bg() */
 
        sc= G.main->screen.first;
        while(sc) {
-               if((U.flag & SCENEGLOBAL) || sc==G.curscreen) {
+               if((U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
                
                        if(sce != sc->scene) {
                                /* all areas endlocalview */
@@ -89,7 +89,7 @@ void set_scene(Scene *sce)            /* also see scene.c: set_scene_bg() */
        /* are there cameras in the views that are not in the scene? */
        sc= G.main->screen.first;
        while(sc) {
-               if( (U.flag & SCENEGLOBAL) || sc==G.curscreen) {
+               if( (U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
                        ScrArea *sa= sc->areabase.first;
                        while(sa) {
                                SpaceLink *sl= sa->spacedata.first;
index bfe4506de92a33168ab04a56b025cd268eca8326..8f7ed1040006fe82d5df623eb019de45e80e3ee3 100644 (file)
@@ -1720,7 +1720,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
        draw_view_icon();
 
        ob= OBACT;
-       if(ob!=0 && (U.uiflag & DRAWVIEWINFO)) draw_selected_name(ob->id.name+2);
+       if(ob!=0 && (U.uiflag & USER_DRAWVIEWINFO)) draw_selected_name(ob->id.name+2);
        
        draw_area_emboss(sa);
        
@@ -2358,7 +2358,7 @@ int play_anim(int mode)
                        event= extern_qread(&val);
                        if(event==ESCKEY) break;
                        else if(event==MIDDLEMOUSE) {
-                               if(U.flag & VIEWMOVE) {
+                               if(U.flag & USER_VIEWMOVE) {
                                        if(G.qual & LR_SHIFTKEY) viewmove(0);
                                        else if(G.qual & LR_CTRLKEY) viewmove(2);
                                        else viewmove(1);
index 40c458b0239817c4a4c4e86c387e2c57486dcacc..5fee23cf5dc1edd9cd503052cf37a36c0e56ad39 100644 (file)
@@ -937,7 +937,7 @@ void paste_posebuf (int flip){
        /* Safely merge all of the channels in this pose into
        any existing pose */
        if (ob->pose){
-               if (U.uiflag & KEYINSERTACT){
+               if (U.uiflag & USER_KEYINSERTACT){
                        /* Display "Avail, all" dialog */
                }
                for (chan=g_posebuf->chanbase.first; chan; chan=chan->next){
@@ -955,7 +955,7 @@ void paste_posebuf (int flip){
 
                                temp = set_pose_channel (ob->pose, temp);
 
-                               if (U.uiflag & KEYINSERTACT){
+                               if (U.uiflag & USER_KEYINSERTACT){
                                        /* Set keys on pose */
                                        if (chan->flag & POSE_ROT){
                                                set_action_key(ob->action, temp, AC_QUAT_X, newchan);
@@ -977,7 +977,7 @@ void paste_posebuf (int flip){
                        }
                }
 
-               if (U.uiflag & KEYINSERTACT){
+               if (U.uiflag & USER_KEYINSERTACT){
                        remake_action_ipos(ob->action);
                        allqueue (REDRAWIPO, 0);
                        allqueue (REDRAWVIEW3D, 0);
@@ -1200,7 +1200,7 @@ static void transform_actionchannel_keys(char mode)
                                                deltax = cval[0]-sval[0];
                                                fac= deltax;
                                                
-                                               apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & AUTOGRABGRID);
+                                               apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
 
                                                tv[i].loc[0]+=fac;
                                                break;
@@ -1209,7 +1209,7 @@ static void transform_actionchannel_keys(char mode)
                                                deltax=mvalc[0]-(ACTWIDTH/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2);
                                                fac= fabs(deltax/startx);
                                                
-                                               apply_keyb_grid(&fac, 0.0, 0.2, 0.1, U.flag & AUTOSIZEGRID);
+                                               apply_keyb_grid(&fac, 0.0, 0.2, 0.1, U.flag & USER_AUTOSIZEGRID);
                
                                                if (invert){
                                                        if (i % 03 == 0){
@@ -1374,7 +1374,7 @@ static void transform_meshchannel_keys(char mode, Key *key)
                         fac= deltax;
                                                
                         apply_keyb_grid(&fac, 0.0, 1.0, 0.1, 
-                                        U.flag & AUTOGRABGRID);
+                                        U.flag & USER_AUTOGRABGRID);
 
                         tv[i].loc[0]+=fac;
                         break;
@@ -1386,7 +1386,7 @@ static void transform_meshchannel_keys(char mode, Key *key)
                         fac= fabs(deltax/startx);
                                                
                         apply_keyb_grid(&fac, 0.0, 0.2, 0.1, 
-                                        U.flag & AUTOSIZEGRID);
+                                        U.flag & USER_AUTOSIZEGRID);
                
                         if (invert){
                             if (i % 03 == 0){
index 3e79f38de2eb7b39ccdd7771a6b8d1c767a546df..1e4b49a38102b76af9fd5cd98fa0a7ae0af0645d 100644 (file)
@@ -4760,7 +4760,7 @@ void transform_ipo(int mode)
                                vec[0]= dvec[0];
                                vec[1]= dvec[1];
                                
-                               apply_keyb_grid(vec, 0.0, (float)1.0, (float)0.1, U.flag & AUTOGRABGRID);
+                               apply_keyb_grid(vec, 0.0, (float)1.0, (float)0.1, U.flag & USER_AUTOGRABGRID);
                                apply_keyb_grid(vec+1, 0.0, (float)1.0, (float)0.1, 0);
                                
                                tv= transmain;
@@ -4781,8 +4781,8 @@ void transform_ipo(int mode)
                                size[0]*= xref;
                                size[1]*= yref;
                                
-                               apply_keyb_grid(size, 0.0, (float)0.2, (float)0.1, U.flag & AUTOSIZEGRID);
-                               apply_keyb_grid(size+1, 0.0, (float)0.2, (float)0.1, U.flag & AUTOSIZEGRID);
+                               apply_keyb_grid(size, 0.0, (float)0.2, (float)0.1, U.flag & USER_AUTOSIZEGRID);
+                               apply_keyb_grid(size+1, 0.0, (float)0.2, (float)0.1, U.flag & USER_AUTOSIZEGRID);
 
                                tv= transmain;
 
index c7c5a0d2416eb7a0aa4a83acc53a322a6f63c602..a918e3b8959f0369fab33442cb7e9a70df07947f 100644 (file)
@@ -811,8 +811,8 @@ void move_keys(void)
                        
                        VECCOPY(vec, dvec);
 
-                       apply_keyb_grid(vec, 0.0, 1.0, 0.1, U.flag & AUTOGRABGRID);
-                       apply_keyb_grid(vec+1, 0.0, 1.0, 0.1, U.flag & AUTOGRABGRID);
+                       apply_keyb_grid(vec, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
+                       apply_keyb_grid(vec+1, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
 
                        tv= transmain;
                        for(a=0; a<tot; a++, tv++) {
index be6b030727053f9570311ea61aac15ba04b4d584..e6674a01d6455c40138aebcebd6d031ce4e3feb2 100644 (file)
@@ -856,7 +856,7 @@ static void transform_nlachannel_keys(char mode)
                                                deltax = cval[0]-sval[0];
                                                fac= deltax;
                                                
-                                               apply_keyb_grid(&fac, 0.0F, 1.0F, 0.1F, U.flag & AUTOGRABGRID);
+                                               apply_keyb_grid(&fac, 0.0F, 1.0F, 0.1F, U.flag & USER_AUTOGRABGRID);
                                                
                                                if (tv[i].loc)
                                                        tv[i].loc[0]+=fac;
@@ -868,7 +868,7 @@ static void transform_nlachannel_keys(char mode)
                                                deltax=mvalc[0]-(NLAWIDTH/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2);
                                                fac= (float)fabs(deltax/startx);
                                                
-                                               apply_keyb_grid(&fac, 0.0F, 0.2F, 0.1F, U.flag & AUTOSIZEGRID);
+                                               apply_keyb_grid(&fac, 0.0F, 0.2F, 0.1F, U.flag & USER_AUTOSIZEGRID);
                                                
                                                if (invert){
                                                        if (i % 03 == 0){
index 0a2ba5628f3876dc3a4714861c54c38f893b6118..ae8384d7916ff9d59b60da2209b2ea1c21b042d9 100644 (file)
@@ -2138,7 +2138,7 @@ void copy_attr(short event)
 
                                        /* Copy the constraint channels over */
                                        copy_constraints(&base->object->constraints, &ob->constraints);
-                                       if (U.dupflag&DUPIPO)
+                                       if (U.dupflag& USER_DUP_IPO)
                                                copy_constraint_channels(&base->object->constraintChannels, &ob->constraintChannels);
                                        else
                                                clone_constraint_channels (&base->object->constraintChannels, &ob->constraintChannels, NULL);
@@ -3770,7 +3770,7 @@ void special_aftertrans_update(char mode, int flip, short canceled, int keyflags
                 */
                clear_bone_nocalc_ob(G.obpose);
 
-               if (U.uiflag & KEYINSERTACT && !canceled){
+               if (U.uiflag & USER_KEYINSERTACT && !canceled){
                        act=G.obpose->action;
                        pose=G.obpose->pose;
                        
@@ -3864,7 +3864,7 @@ void special_aftertrans_update(char mode, int flip, short canceled, int keyflags
                        where_is_object(ob);    /* always do, for track etc. */
 
                        /* Set autokey if necessary */
-                       if ((U.uiflag & KEYINSERTOBJ) && (!canceled) && (base->flag & SELECT)){
+                       if ((U.uiflag & USER_KEYINSERTOBJ) && (!canceled) && (base->flag & SELECT)){
                                if (keyflags & KEYFLAG_ROT){
                                        insertkey(&base->object->id, OB_ROT_X);
                                        insertkey(&base->object->id, OB_ROT_Y);
@@ -4224,7 +4224,7 @@ static void view_editmove(unsigned char event)
                                } else {
                                        persptoetsen(PAD4);
                                }
-                       } else if(U.uiflag & WHEELZOOMDIR) 
+                       } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                persptoetsen(PADMINUS);
                        else
                                persptoetsen(PADPLUSKEY);
@@ -4247,7 +4247,7 @@ static void view_editmove(unsigned char event)
                                } else {
                                        persptoetsen(PAD6);
                                }
-                       } else if(U.uiflag & WHEELZOOMDIR) 
+                       } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                persptoetsen(PADPLUSKEY);
                        else
                                persptoetsen(PADMINUS);
@@ -4712,9 +4712,9 @@ void transform(int mode)
                                        dvec[1]= 0.1*(dvec[1]-d_dvec[1])+d_dvec[1];
                                        dvec[2]= 0.1*(dvec[2]-d_dvec[2])+d_dvec[2];
                                }
-                               apply_keyb_grid(dvec, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & AUTOGRABGRID);
-                               apply_keyb_grid(dvec+1, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & AUTOGRABGRID);
-                               apply_keyb_grid(dvec+2, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & AUTOGRABGRID);
+                               apply_keyb_grid(dvec, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & USER_AUTOGRABGRID);
+                               apply_keyb_grid(dvec+1, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & USER_AUTOGRABGRID);
+                               apply_keyb_grid(dvec+2, 0.0, G.vd->grid, 0.1*G.vd->grid, gridflag & USER_AUTOGRABGRID);
 
                                if(dvec[0]!=oldval[0] ||dvec[1]!=oldval[1] ||dvec[2]!=oldval[2]) {
                                        VECCOPY(oldval, dvec);
@@ -4827,8 +4827,8 @@ void transform(int mode)
                                        phi0+= .007*(float)(dy2-dy1);
                                        phi1+= .007*(float)(dx1-dx2);
                                
-                                       apply_keyb_grid(&phi0, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & AUTOROTGRID);
-                                       apply_keyb_grid(&phi1, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & AUTOROTGRID);
+                                       apply_keyb_grid(&phi0, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & USER_AUTOROTGRID);
+                                       apply_keyb_grid(&phi1, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & USER_AUTOROTGRID);
 
                                        if(typemode){
                                                VecRotToMat3(rot0, addvec[1]*M_PI/180.0, smat);
@@ -4860,7 +4860,7 @@ void transform(int mode)
                                                if(G.qual & LR_SHIFTKEY) phi+= dphi/30.0;
                                                else phi+= dphi;
                                                
-                                               apply_keyb_grid(&phi, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & AUTOROTGRID);
+                                               apply_keyb_grid(&phi, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, gridflag & USER_AUTOROTGRID);
 
                                                if(axismode) {
                                                        if(axismode==XTRANS) vec[0]= -1.0; else vec[0]= 0.0;
@@ -5179,9 +5179,9 @@ void transform(int mode)
 
 
                                /* grid */
-                               apply_keyb_grid(size, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
-                               apply_keyb_grid(size+1, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
-                               apply_keyb_grid(size+2, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
+                               apply_keyb_grid(size, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
+                               apply_keyb_grid(size+1, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
+                               apply_keyb_grid(size+2, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
                                
                                if(transmain) {
                                        size[0]= MINSIZE(size[0], 0.001);
@@ -5219,9 +5219,9 @@ void transform(int mode)
                                                                sizelo[0]= totmat[0][0];        
                                                                sizelo[1]= totmat[1][1];        
                                                                sizelo[2]= totmat[2][2];
-                                                               apply_keyb_grid(sizelo, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
-                                                               apply_keyb_grid(sizelo+1, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
-                                                               apply_keyb_grid(sizelo+2, 0.0, 0.1, 0.01, gridflag & AUTOSIZEGRID);
+                                                               apply_keyb_grid(sizelo, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
+                                                               apply_keyb_grid(sizelo+1, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
+                                                               apply_keyb_grid(sizelo+2, 0.0, 0.1, 0.01, gridflag & USER_AUTOSIZEGRID);
                                                        } 
 
                                                                /* x flip */
@@ -6577,7 +6577,7 @@ void adduplicate(float *dtrans)
 
                        /* duplicates using userflags */
                        
-                       if(dupflag & DUPIPO) {
+                       if(dupflag & USER_DUP_IPO) {
                                id= (ID *)obn->ipo;
                                if(id) {
                                        ID_NEW_US( obn->ipo)
@@ -6594,7 +6594,7 @@ void adduplicate(float *dtrans)
                                        }
                                }
                        }
-                       if(dupflag & DUPACT){
+                       if(dupflag & USER_DUP_ACT){
                                id= (ID *)obn->action;
                                if (id){
                                        ID_NEW_US(obn->action)
@@ -6605,7 +6605,7 @@ void adduplicate(float *dtrans)
                                        id->us--;
                                }
                        }
-                       if(dupflag & DUPMAT) {
+                       if(dupflag & USER_DUP_MAT) {
                                for(a=0; a<obn->totcol; a++) {
                                        id= (ID *)obn->mat[a];
                                        if(id) {
@@ -6621,7 +6621,7 @@ void adduplicate(float *dtrans)
                        
                        switch(obn->type) {
                        case OB_MESH:
-                               if(dupflag & DUPMESH) {
+                               if(dupflag & USER_DUP_MESH) {
                                        ID_NEW_US2( obn->data )
                                        else {
                                                obn->data= copy_mesh(obn->data);
@@ -6631,7 +6631,7 @@ void adduplicate(float *dtrans)
                                }
                                break;
                        case OB_CURVE:
-                               if(dupflag & DUPCURVE) {
+                               if(dupflag & USER_DUP_CURVE) {
                                        ID_NEW_US2(obn->data )
                                        else {
                                                obn->data= copy_curve(obn->data);
@@ -6642,7 +6642,7 @@ void adduplicate(float *dtrans)
                                }
                                break;
                        case OB_SURF:
-                               if(dupflag & DUPSURF) {
+                               if(dupflag & USER_DUP_SURF) {
                                        ID_NEW_US2( obn->data )
                                        else {
                                                obn->data= copy_curve(obn->data);
@@ -6653,7 +6653,7 @@ void adduplicate(float *dtrans)
                                }
                                break;
                        case OB_FONT:
-                               if(dupflag & DUPFONT) {
+                               if(dupflag & USER_DUP_FONT) {
                                        ID_NEW_US2( obn->data )
                                        else {
                                                obn->data= copy_curve(obn->data);
@@ -6664,7 +6664,7 @@ void adduplicate(float *dtrans)
                                }
                                break;
                        case OB_MBALL:
-                               if(dupflag & DUPMBALL) {
+                               if(dupflag & USER_DUP_MBALL) {
                                        ID_NEW_US2(obn->data )
                                        else {
                                                obn->data= copy_mball(obn->data);
@@ -6674,7 +6674,7 @@ void adduplicate(float *dtrans)
                                }
                                break;
                        case OB_LAMP:
-                               if(dupflag & DUPLAMP) {
+                               if(dupflag & USER_DUP_LAMP) {
                                        ID_NEW_US2(obn->data )
                                        else obn->data= copy_lamp(obn->data);
                                        id->us--;
@@ -6682,7 +6682,7 @@ void adduplicate(float *dtrans)
                                break;
 
                        case OB_ARMATURE:
-                               if(dupflag & DUPARM) {
+                               if(dupflag & USER_DUP_ARM) {
                                        ID_NEW_US2(obn->data )
                                        else {
                                                obn->data= copy_armature(obn->data);
@@ -6710,7 +6710,7 @@ void adduplicate(float *dtrans)
                                break;
                        }
                        
-                       if(dupflag & DUPMAT) {
+                       if(dupflag & USER_DUP_MAT) {
                                matarar= give_matarar(obn);
                                if(didit && matarar) {
                                        for(a=0; a<obn->totcol; a++) {
@@ -6763,14 +6763,14 @@ void adduplicate(float *dtrans)
        }
 
        /* materials */
-       if( dupflag & DUPMAT) {
+       if( dupflag & USER_DUP_MAT) {
                mao= G.main->mat.first;
                while(mao) {
                        if(mao->id.newid) {
                                
                                ma= (Material *)mao->id.newid;
                                
-                               if(dupflag & DUPTEX) {
+                               if(dupflag & USER_DUP_TEX) {
                                        for(a=0; a<8; a++) {
                                                if(ma->mtex[a]) {
                                                        id= (ID *)ma->mtex[a]->tex;
index 8c940406597c62d0c2aac32564dcbc8037bf3f11..a9d39bd8eb7a28705d3371cf392e1362e79d3f5b 100644 (file)
@@ -1151,8 +1151,8 @@ void screenmain(void)
 
 #ifdef _WIN32  // FULLSCREEN
 void mainwindow_toggle_fullscreen(int fullscreen){
-       if (fullscreen) U.uiflag |= FLIPFULLSCREEN;
-       else U.uiflag &= ~FLIPFULLSCREEN;
+       if (fullscreen) U.uiflag |= USER_FLIPFULLSCREEN;
+       else U.uiflag &= ~USER_FLIPFULLSCREEN;
 
        window_toggle_fullscreen(mainwin, fullscreen);
 }
@@ -1726,7 +1726,7 @@ void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char a
 
        statechanged= 1;
 
-       if (U.flag & NONUMPAD) {
+       if (U.flag & USER_NONUMPAD) {
                evt= convert_for_nonumpad(evt);
        }
 
index 856eb8255ab55ddb22f9aa725bc5f32348c75bd2..34c99df4e68c65208a1cb3b80fb30b8a319a03cd 100644 (file)
@@ -403,8 +403,8 @@ void transform_tface_uv(int mode)
                                
                                dvec2[0]= dvec[0];
                                dvec2[1]= dvec[1];
-                               apply_keyb_grid(dvec2, 0.0, 1.0/8.0, 1.0/16.0, U.flag & AUTOGRABGRID);
-                               apply_keyb_grid(dvec2+1, 0.0, 1.0/8.0, 1.0/16.0, U.flag & AUTOGRABGRID);
+                               apply_keyb_grid(dvec2, 0.0, 1.0/8.0, 1.0/16.0, U.flag & USER_AUTOGRABGRID);
+                               apply_keyb_grid(dvec2+1, 0.0, 1.0/8.0, 1.0/16.0, U.flag & USER_AUTOGRABGRID);
 
                                vec[0]= dvec2[0];
                                vec[1]= dvec2[1];
@@ -446,7 +446,7 @@ void transform_tface_uv(int mode)
                                        if(G.qual & LR_SHIFTKEY) phi+= dphi/30.0;
                                        else phi+= dphi;
                                        
-                                       apply_keyb_grid(&phi, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, U.flag & AUTOROTGRID);
+                                       apply_keyb_grid(&phi, 0.0, (5.0/180)*M_PI, (1.0/180)*M_PI, U.flag & USER_AUTOROTGRID);
                                        
                                        dx1= dx2; 
                                        dy1= dy2;
@@ -482,8 +482,8 @@ void transform_tface_uv(int mode)
                                
                                if(midtog) size[proj]= 1.0;
                                
-                               apply_keyb_grid(size, 0.0, 0.1, 0.01, U.flag & AUTOSIZEGRID);
-                               apply_keyb_grid(size+1, 0.0, 0.1, 0.01, U.flag & AUTOSIZEGRID);
+                               apply_keyb_grid(size, 0.0, 0.1, 0.01, U.flag & USER_AUTOSIZEGRID);
+                               apply_keyb_grid(size+1, 0.0, 0.1, 0.01, U.flag & USER_AUTOSIZEGRID);
 
                                size[0]*= xref;
                                size[1]*= yref;
index f84ddc78fe87829e584aa76665ed12f05047c866..ba75cc34e89b907db05e35e8168eef3d10e0d2a2 100644 (file)
@@ -847,7 +847,7 @@ static void calc_file_rcts(SpaceFile *sfile)
        if(sfile->collums<1) sfile->collums= 1;
        else if(sfile->collums>8) sfile->collums= 8;
 
-       if((U.flag & FSCOLLUM)==0) if(sfile->type!=FILE_MAIN) sfile->collums= 1;
+       if((U.flag & USER_FSCOLLUM)==0) if(sfile->type!=FILE_MAIN) sfile->collums= 1;
        
        collumwidth= (textrct.xmax-textrct.xmin)/sfile->collums;
        
index 0ffda31aec6a0b24cf7ec9a37c0452aa5a1c51cb..df0ad9596530cda2e73d671197d2b5590b8453f6 100644 (file)
@@ -390,7 +390,7 @@ static int event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                if (val) {
                                        if (win->commandqual) {
                                                bbut= win->faked_mbut= RIGHTMOUSE;
-                                       } else if ((win->lqual & LR_ALTKEY) && (U.flag & TWOBUTTONMOUSE)) {
+                                       } else if ((win->lqual & LR_ALTKEY) && (U.flag & USER_TWOBUTTONMOUSE)) {
                                                /* finally, it actually USES the userpref! :) -intrr */
                                                bbut= win->faked_mbut= MIDDLEMOUSE;
                                        }
index 6f689ad48122d42cdc4777736388ebe70088d949..8e098af727b54eea09298e9fe951adfb43ea77f4 100644 (file)
@@ -130,8 +130,8 @@ void file_buttons(void)
        cpack(0x0);
        glRasterPos2i(xco+=XIC+10,      5);
 
-       BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & TR_BUTTONS));
-       xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & TR_BUTTONS));
+       BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & USER_TR_BUTTONS));
+       xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & USER_TR_BUTTONS));
        
        uiDefIconButS(block, ICONTOG|BIT|0, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info");
        uiDefIconButS(block, TOG|BIT|3, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files");
index f9f740bc55ad3e345a20984ceac00b07d91c8674..a5fa5937fdbc6787e10cef8f5d2b832f6f7b64a7 100644 (file)
@@ -1643,11 +1643,11 @@ static void info_text(int x, int y)
 
        glRasterPos2i(x, y);
 
-       BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS));
+       BIF_DrawString(G.font, headerstr, (U.transopts & USER_TR_MENUS));
                
        glRasterPos2i(x+122,    y);
 
-       BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS));
+       BIF_DrawString(G.font, infostr, (U.transopts & USER_TR_MENUS));
 }
 
 void info_buttons(void)
@@ -1737,7 +1737,7 @@ void info_buttons(void)
        curarea->headbutlen= xco+2*XIC;
 
 #ifdef _WIN32  // FULLSCREEN
-       if(U.uiflag & FLIPFULLSCREEN) {
+       if(U.uiflag & USER_FLIPFULLSCREEN) {
                uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW,
                                (short)(curarea->winx-XIC-5), 0,XIC,YIC,
                                0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir             */
index d57bda73cbf513da14cbe8eb6e9240a6a39a6a3e..7057dd11445cfda371852d9e651ad2d97ae80ff9 100644 (file)
@@ -230,7 +230,7 @@ char *windowtype_pup(void)
 int GetButStringLength(char *str) {
        int rt;
 
-       rt= BIF_GetStringWidth(G.font, str, (U.transopts & TR_BUTTONS));
+       rt= BIF_GetStringWidth(G.font, str, (U.transopts & USER_TR_BUTTONS));
 
        return rt + 15;
 }
@@ -1407,13 +1407,13 @@ void do_global_buttons(unsigned short event)
                allqueue(REDRAWINFO, 0);
                break;
        case B_SOUNDTOGGLE:
-               SYS_WriteCommandLineInt(SYS_GetSystem(), "noaudio", (U.gameflags & USERDEF_DISABLE_SOUND));
+               SYS_WriteCommandLineInt(SYS_GetSystem(), "noaudio", (U.gameflags & USER_DISABLE_SOUND));
                break;
        case B_SHOWSPLASH:
                                show_splash();
                break;
        case B_MIPMAPCHANGED:
-               set_mipmap(!(U.gameflags & USERDEF_DISABLE_SOUND));
+               set_mipmap(!(U.gameflags & USER_DISABLE_SOUND));
                allqueue(REDRAWVIEW3D, 0);
                break;
        case B_NEWSPACE:
@@ -1437,11 +1437,11 @@ void do_global_buttons(unsigned short event)
 
 #ifdef _WIN32 // FULLSCREEN
        case B_FLIPFULLSCREEN:
-               if(U.uiflag & FLIPFULLSCREEN)
-                       U.uiflag &= ~FLIPFULLSCREEN;
+               if(U.uiflag & USER_FLIPFULLSCREEN)
+                       U.uiflag &= ~USER_FLIPFULLSCREEN;
                else
-                       U.uiflag |= FLIPFULLSCREEN;
-               mainwindow_toggle_fullscreen((U.uiflag & FLIPFULLSCREEN));
+                       U.uiflag |= USER_FLIPFULLSCREEN;
+               mainwindow_toggle_fullscreen((U.uiflag & USER_FLIPFULLSCREEN));
                break;
 #endif
 
@@ -1557,7 +1557,7 @@ void do_global_buttons(unsigned short event)
                break;
 
        case B_DOLANGUIFONT:    /* is button from space.c  *info* */
-               if(U.transopts & TR_ALL)
+               if(U.transopts & USER_DOTRANSLATE)
                        start_interface_font();
                else
                        G.ui_international = FALSE;
index 87405f2c940fda8af1c805081f622c150d9294e1..20e85f972dd82ebf0ccd9f336b132869fd03435b 100644 (file)
@@ -289,7 +289,7 @@ void uiTextBoundsBlock(uiBlock *block, int addval)
        bt= block->buttons.first;
        while(bt) {
                if(bt->type!=SEPR) {
-                       j= BIF_GetStringWidth(bt->font, bt->drawstr, (U.transopts & TR_BUTTONS));
+                       j= BIF_GetStringWidth(bt->font, bt->drawstr, (U.transopts & USER_TR_BUTTONS));
 
                        if(j > i) i = j;
                }
@@ -840,12 +840,12 @@ static int ui_do_but_MENU(uiBut *but)
                
        /* size and location */
        if(md->title)
-               width= 1.5*but->aspect*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & TR_MENUS));
+               width= 1.5*but->aspect*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS));
        else
                width= 0;
 
        for(a=0; a<md->nitems; a++) {
-               xmax= but->aspect*BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & TR_MENUS));
+               xmax= but->aspect*BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS));
                if(xmax>width) width= xmax;
        }
 
@@ -1147,7 +1147,7 @@ static int ui_do_but_TEX(uiBut *but)
        BLI_strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR);
        but->pos= strlen(backstr)-but->ofs;
 
-       while((but->aspect*BIF_GetStringWidth(but->font, backstr+but->ofs, (U.transopts & TR_BUTTONS)) + but->x1) > mval[0]) {
+       while((but->aspect*BIF_GetStringWidth(but->font, backstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + but->x1) > mval[0]) {
                if (but->pos <= 0) break;
                but->pos--;
                backstr[but->pos+but->ofs] = 0;
@@ -1547,12 +1547,12 @@ static int ui_do_but_ICONTEXTROW(uiBut *but)
        /* size and location */
        /* expand menu width to fit labels */
        if(md->title)
-               width= 2*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & TR_MENUS));
+               width= 2*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS));
        else
                width= 0;
 
        for(a=0; a<md->nitems; a++) {
-               xmax= BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & TR_MENUS));
+               xmax= BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS));
                if(xmax>width) width= xmax;
        }
 
@@ -2693,7 +2693,7 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
                                                if(uevent->event!=LEFTMOUSE ) {
                                                        if(block->auto_open==2) time= 1;        // test for toolbox
                                                        else if(block->auto_open) time= 5*U.menuthreshold2;
-                                                       else if(U.uiflag & MENUOPENAUTO) time= 5*U.menuthreshold1;
+                                                       else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
                                                        else time= -1;
 
                                                        for (; time>0; time--) {
@@ -2792,7 +2792,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
        if(G.ui_international == TRUE) {
                float llx,lly,llz,urx,ury,urz;  //for FTF_GetBoundingBox()
 
-               if(U.transopts & TR_TOOLTIPS) {
+               if(U.transopts & USER_TR_TOOLTIPS) {
                        FTF_GetBoundingBox(but->tip, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
 
                        x1= (but->x1+but->x2)/2; x2= 10+x1+ but->aspect*FTF_GetStringWidth(but->tip, FTF_USE_GETTEXT | FTF_INPUT_UTF8);  //BMF_GetStringWidth(but->font, but->tip);
@@ -2860,7 +2860,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but)
        
        glColor3ub(0,0,0);
        glRasterPos2f( x1+3, y1+4);
-       BIF_DrawString(but->font, but->tip, (U.transopts & TR_TOOLTIPS));
+       BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS));
        
        glFinish();             /* to show it in the frontbuffer */
        return su;
@@ -3036,7 +3036,7 @@ int uiDoBlocks(ListBase *lb, int event)
                        
                        /* tooltip */   
                        if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) {
-                               if(U.flag & TOOLTIPS) ui_do_but_tip();
+                               if(U.flag & USER_TOOLTIPS) ui_do_but_tip();
                        }
                }
                
@@ -3060,7 +3060,7 @@ int uiDoBlocks(ListBase *lb, int event)
 
        /* tooltip */   
        if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) {
-               if(U.flag & TOOLTIPS) ui_do_but_tip();
+               if(U.flag & USER_TOOLTIPS) ui_do_but_tip();
        }
 
        /* doesnt harm :-) */
@@ -3409,7 +3409,7 @@ void ui_check_but(uiBut *but)
        }
 
        if(but->drawstr[0]) {
-               but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, (U.transopts & TR_BUTTONS));
+               but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, (U.transopts & USER_TR_BUTTONS));
                // here should be check for less space for icon offsets...
                if(but->type==MENU) okwidth -= 20;
        }
@@ -3431,7 +3431,7 @@ void ui_check_but(uiBut *but)
                        but->ofs++;
        
                        if(but->drawstr[but->ofs]) 
-                               but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS));
+                               but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS));
                        else but->strwidth= 0;
        
                        /* textbut exception */
@@ -4149,12 +4149,12 @@ short pupmenu(char *instr)
        md= decompose_menu_string(instr);
 
        /* size and location, title slightly bigger for bold */
-       if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts && TR_BUTTONS));
+       if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts && USER_TR_BUTTONS));
        else width= 0;
        for(a=0; a<md->nitems; a++) {
                char *name= md->items[a].str;
                
-               xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts && TR_BUTTONS));
+               xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts && USER_TR_BUTTONS));
                if(xmax>width) width= xmax;
 
                if( strcmp(name, "%l")==0) height+= 6;
@@ -4271,10 +4271,10 @@ short pupmenu_col(char *instr, int maxrow)
        while (rows*columns<(md->nitems+columns) ) rows++;
                
        /* size and location */
-       if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & TR_BUTTONS));
+       if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & USER_TR_BUTTONS));
        else width= 0;
        for(a=0; a<md->nitems; a++) {
-               xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & TR_BUTTONS));
+               xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & USER_TR_BUTTONS));
                if(xmax>width) width= xmax;
        }
 
index 058ee4c66cdf33ad5d57a726a7e2baabee6b6f97..9cc100c7d086de76c2a20d61b48d40da3b2b0337 100644 (file)
@@ -1369,7 +1369,7 @@ static void ui_draw_text_icon(uiBut *but)
                                ch= but->drawstr[pos];
                                but->drawstr[pos]= 0;
        
-                               t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS)) + 3;
+                               t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3;
        
                                but->drawstr[pos]= ch;
                                glColor3ub(255,0,0);
@@ -1428,13 +1428,13 @@ static void ui_draw_text_icon(uiBut *but)
                }
                
                glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0);
-               BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS));
+               BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS));
 
                /* part text right aligned */
                if(cpoin) {
-                       len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & TR_BUTTONS));
+                       len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS));
                        glRasterPos2f( but->x2 - len*but->aspect-3, (but->y1+but->y2- 9.0)/2.0);
-                       BIF_DrawString(but->font, cpoin+1, (U.transopts & TR_BUTTONS));
+                       BIF_DrawString(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS));
                        *cpoin= '|';
                }
        }
index 156f9bc89f079768145b27d5df5b90adc93b8a00..4be3e362e20d7438cf4ed6a4144512dd5637ce0c 100644 (file)
@@ -672,7 +672,7 @@ static char *ui_block_cut_str(uiBlock *block, char *str, short okwidth)
        
        if(ofs>127) return str;
        
-       width= block->aspect*BIF_GetStringWidth(block->curfont, str, (U.transopts & TR_BUTTONS));
+       width= block->aspect*BIF_GetStringWidth(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
 
        if(width <= okwidth) return str;
        strcpy(str1, str);
@@ -721,7 +721,7 @@ static void ui_draw_panel_header(uiBlock *block)
 
                BIF_ThemeColor(TH_TEXT_HI);
                glRasterPos2f(4+block->minx+pnl_icons, block->maxy+5);
-               BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & TR_BUTTONS));
+               BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & USER_TR_BUTTONS));
                return;
        }
        
@@ -739,7 +739,7 @@ static void ui_draw_panel_header(uiBlock *block)
                        BIF_ThemeColor(TH_TEXT);
                        glRasterPos2f(16+pnl_icons+a*width, panel->sizey+4);
                        str= ui_block_cut_str(block, pa->panelname, (short)(width-10));
-                       BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS));
+                       BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
 
                        a++;
                }
@@ -752,7 +752,7 @@ static void ui_draw_panel_header(uiBlock *block)
                        BIF_ThemeColor(TH_TEXT_HI);
                        glRasterPos2f(16+pnl_icons+a*width, panel->sizey+4);
                        str= ui_block_cut_str(block, pa->panelname, (short)(width-10));
-                       BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS));
+                       BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
                                
                        a++;
                }
@@ -785,7 +785,7 @@ void ui_draw_panel(uiBlock *block)
                if(panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON;
                BIF_ThemeColor(TH_TEXT_HI);
                glRasterPos2f(4+block->minx+ofsx, block->maxy+5);
-               BIF_DrawString(block->curfont, panel->panelname, (U.transopts & TR_BUTTONS));
+               BIF_DrawString(block->curfont, panel->panelname, (U.transopts & USER_TR_BUTTONS));
 
                //  border
                if(panel->flag & PNL_SELECT) {
index 183c0fd41c824ad6209beb6fb471f184d9d77d1f..d126444a0a9b02e2d2133bc1afecc810e25f9755 100644 (file)
@@ -92,7 +92,7 @@ float BIF_GetStringWidth(BMF_Font* font, char *str, int translate)
 
 #ifdef INTERNATIONAL
        if(G.ui_international == TRUE)
-               if(U.transopts & TR_BUTTONS)
+               if(U.transopts & USER_TR_BUTTONS)
                        rt= FTF_GetStringWidth(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
                else
                        rt= FTF_GetStringWidth(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8);
@@ -245,7 +245,7 @@ void start_interface_font(void) {
        } else {
                printf("no font found for international support\n");
                G.ui_international = FALSE;
-               U.transopts &= ~TR_ALL;
+               U.transopts &= ~USER_DOTRANSLATE;
                U.fontsize = 0;
        }
 
index 28abeb728fb7907485052e6c63947ee6e5309dfd..f0565357ad1e25a2008777a9d8eba1bd08ae2438 100644 (file)
@@ -271,13 +271,13 @@ void space_set_commmandline_options(void) {
                
        if ( (syshandle = SYS_GetSystem()) ) {
                /* User defined settings */
-               a= (U.gameflags & USERDEF_VERTEX_ARRAYS);
+               a= (U.gameflags & USER_VERTEX_ARRAYS);
                SYS_WriteCommandLineInt(syshandle, "vertexarrays", a);
 
-               a= (U.gameflags & USERDEF_DISABLE_SOUND);
+               a= (U.gameflags & USER_DISABLE_SOUND);
                SYS_WriteCommandLineInt(syshandle, "noaudio", a);
 
-               a= (U.gameflags & USERDEF_DISABLE_MIPMAP);
+               a= (U.gameflags & USER_DISABLE_MIPMAP);
                set_mipmap(!a);
                SYS_WriteCommandLineInt(syshandle, "nomipmap", a);
 
@@ -575,18 +575,18 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                break;
                        case MIDDLEMOUSE:
                                /* use '&' here, because of alt+leftmouse which emulates middlemouse */
-                               if(U.flag & VIEWMOVE) {
-                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
+                               if(U.flag & USER_VIEWMOVE) {
+                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
                                                viewmove(0);
-                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
+                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
                                                viewmove(2);
-                                       else if((G.qual==0) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
+                                       else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
                                                viewmove(1);
                                }
                                else {
-                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
+                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
                                                viewmove(1);
-                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
+                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
                                                viewmove(2);
                                        else
                                                viewmove(0);
@@ -616,7 +616,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        } else {
                                                persptoetsen(PAD4);
                                        }
-                               } else if(U.uiflag & WHEELZOOMDIR) 
+                               } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                        persptoetsen(PADMINUS);
                                else
                                        persptoetsen(PADPLUSKEY);
@@ -647,7 +647,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        } else {
                                                persptoetsen(PAD6);
                                        }
-                               } else if(U.uiflag & WHEELZOOMDIR) 
+                               } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                        persptoetsen(PADPLUSKEY);
                                else
                                        persptoetsen(PADMINUS);
@@ -708,20 +708,20 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                break;
                        case MIDDLEMOUSE:
                                /* use '&' here, because of alt+leftmouse which emulates middlemouse */
-                               if(U.flag & VIEWMOVE) {
-                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
+                               if(U.flag & USER_VIEWMOVE) {
+                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
                                                viewmove(0);
-                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
+                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
                                                viewmove(2);
-                                       else if((G.qual==0) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
+                                       else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
                                                viewmove(1);
                                }
                                else {
-                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
+                                       if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
                                                viewmove(1);
-                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
+                                       else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
                                                viewmove(2);
-                                       else if((G.qual==0) || ((U.flag & TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
+                                       else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
                                                viewmove(0);
                                }
                                break;
@@ -777,7 +777,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        } else {
                                                persptoetsen(PAD4);
                                        }
-                               } else if(U.uiflag & WHEELZOOMDIR) 
+                               } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                        persptoetsen(PADMINUS);
                                else
                                        persptoetsen(PADPLUSKEY);
@@ -807,7 +807,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        } else {
                                                persptoetsen(PAD6);
                                        }
-                               } else if(U.uiflag & WHEELZOOMDIR) 
+                               } else if(U.uiflag & USER_WHEELZOOMDIR) 
                                        persptoetsen(PADPLUSKEY);
                                else
                                        persptoetsen(PADMINUS);
@@ -1739,7 +1739,7 @@ void initipo(ScrArea *sa)
 /* ******************** SPACE: INFO ********************** */
 
 void space_mipmap_button_function(int event) {
-       set_mipmap(!(U.gameflags & USERDEF_DISABLE_MIPMAP));
+       set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
 
        allqueue(REDRAWVIEW3D, 0);
 }
@@ -1751,7 +1751,7 @@ void space_sound_button_function(int event)
 
        if ((syshandle = SYS_GetSystem()))
        {
-               a = (U.gameflags & USERDEF_DISABLE_SOUND);
+               a = (U.gameflags & USER_DISABLE_SOUND);
                SYS_WriteCommandLineInt(syshandle, "noaudio", a);
        }
 }
@@ -1993,17 +1993,17 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        xpos,y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
                
-               uiDefButS(block, TOG|BIT|11, 0, "ToolTips",
+               uiDefButBitS(block, TOG, USER_TOOLTIPS, 0, "ToolTips",
                        (xpos+edgespace),y2,smallprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Displays tooltips (help tags) over buttons");
 
-               uiDefButS(block, TOG|BIT|4, B_DRAWINFO, "Object Info",
+               uiDefButBitS(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info",
                        (xpos+edgespace+midspace+smallprefbut),y2,smallprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0,
                        "Displays current object name and frame number in the 3D viewport");
 
-               uiDefButS(block, TOG|BIT|4, 0, "Global Scene",
+               uiDefButBitS(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene",
                        (xpos+edgespace),y1,medprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Forces the current Scene to be displayed in all Screens");
@@ -2013,17 +2013,17 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+medprefbut),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|1, 0, "Grab",
+               uiDefButBitS(block, TOG, USER_AUTOGRABGRID, 0, "Grab",
                        (xpos+edgespace+medprefbut+midspace),y2,smallprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Move objects to grid units");
 
-               uiDefButS(block, TOG|BIT|3, 0, "Size",
+               uiDefButBitS(block, TOG, USER_AUTOSIZEGRID, 0, "Size",
                        (xpos+edgespace+medprefbut+midspace),y1,smallprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Scale objects to grid units");
 
-               uiDefButS(block, TOG|BIT|2, 0, "Rotate",
+               uiDefButBitS(block, TOG, USER_AUTOROTGRID, 0, "Rotate",
                        (xpos+edgespace+medprefbut+(2*midspace)+smallprefbut),y2,smallprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Rotate objects to grid units");
@@ -2034,7 +2034,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+medprefbut+(3*midspace)+(2*smallprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|9, 0, "Auto Open",
+               uiDefButBitS(block, TOG, USER_MENUOPENAUTO, 0, "Auto Open",
                        (xpos+edgespace+medprefbut+(3*midspace)+(2*smallprefbut)),y2,smallprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0,
                        "Automatic opening of menu buttons");
@@ -2069,30 +2069,30 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)+smallprefbut+2),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|5, B_DRAWINFO, "Trackball",
+               uiDefButBitS(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball",
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)+smallprefbut+2),y2,(smallprefbut+2),buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Use trackball style rotation with middle mouse button");
 
-               uiDefButS(block, TOGN|BIT|5, B_DRAWINFO, "Turntable",
+               uiDefButBitS(block, TOGN, USER_TRACKBALL, B_DRAWINFO, "Turntable",
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)+smallprefbut+2),y1,(smallprefbut+2),buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Use turntable style rotation with middle mouse button");
 
 
 
-               uiDefButS(block, TOGN|BIT|10, B_DRAWINFO, "Rotate View",
+               uiDefButBitS(block, TOGN, USER_VIEWMOVE, B_DRAWINFO, "Rotate View",
                        (xpos+edgespace+(4*midspace)+(4*medprefbut)),y2,(smallprefbut+2),buth,
                        &(U.flag), 0, 0, 0, 0, "Default action for the middle mouse button");
 
-               uiDefButS(block, TOG|BIT|10, B_DRAWINFO, "Pan View",
+               uiDefButBitS(block, TOG, USER_VIEWMOVE, B_DRAWINFO, "Pan View",
                        (xpos+edgespace+(4*midspace)+(4*medprefbut)+smallprefbut+2),y2,(smallprefbut+2),buth,
                        &(U.flag), 0, 0, 0, 0, "Default action for the middle mouse button");
 
                uiDefBut(block, LABEL,0,"Middle mouse button:",
                        (xpos+edgespace+(3*midspace)+(4*medprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
-               uiDefButS(block, TOG|BIT|12, 0, "Emulate 3 Buttons",
+               uiDefButBitS(block, TOG, USER_TWOBUTTONMOUSE, 0, "Emulate 3 Buttons",
                        (xpos+edgespace+(4*midspace)+(4*medprefbut)),y1,medprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Emulates a middle mouse button with ALT+LeftMouse");
@@ -2103,7 +2103,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                uiDefBut(block, LABEL,0,"Mousewheel:",
                        (xpos+edgespace+(4*midspace)+(5*medprefbut)),y3label,smallprefbut+15,buth,
                        0, 0, 0, 0, 0, "");
-               uiDefButS(block, TOG|BIT|2, 0, "Invert Wheel Zoom",
+               uiDefButBitS(block, TOG, USER_WHEELZOOMDIR, 0, "Invert Wheel Zoom",
                        (xpos+edgespace+(5*midspace)+(5*medprefbut)),y1,smallprefbut+15,buth,
                        &(U.uiflag), 0, 0, 0, 0,
                        "Swaps mouse wheel zoom direction");
@@ -2133,11 +2133,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        xpos,y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOGN|BIT|8, B_DRAWINFO, "ObData",
+               uiDefButBitS(block, TOGN, USER_MAT_ON_OB, B_DRAWINFO, "ObData",
                        (xpos+edgespace),y2,(smallprefbut),buth,
                        &(U.flag), 0, 0, 0, 0, "Link new objects' material to the obData block");
 
-               uiDefButS(block, TOG|BIT|8, B_DRAWINFO, "Object",
+               uiDefButBitS(block, TOG, USER_MAT_ON_OB, B_DRAWINFO, "Object",
                        (xpos+edgespace+midspace+smallprefbut),y2,(smallprefbut),buth,
                        &(U.flag), 0, 0, 0, 0, "Link new objects' material to the object block");
 
@@ -2156,52 +2156,52 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(2*medprefbut)+midspace),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|0, 0, "Action",
+               uiDefButBitS(block, TOG, USER_KEYINSERTACT, 0, "Action",
                        (xpos+edgespace+(2*medprefbut)+(2*midspace)),y2,smallprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in action ipo curve");
 
-               uiDefButS(block, TOG|BIT|1, 0, "Object",
+               uiDefButBitS(block, TOG, USER_KEYINSERTOBJ, 0, "Object",
                        (xpos+edgespace+(2*medprefbut)+(3*midspace)+smallprefbut),y2,smallprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in object ipo curve");
 
 
 
-                uiDefBut(block, LABEL,0,"Duplicate with object:",
+               uiDefBut(block, LABEL,0,"Duplicate with object:",
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)+smallprefbut),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|0, 0, "Mesh",
+               uiDefButBitS(block, TOG, USER_DUP_MESH, 0, "Mesh",
                        (xpos+edgespace+(4*midspace)+(3*medprefbut)+smallprefbut),y2,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes mesh data to be duplicated with Shift+D");
-               uiDefButS(block, TOG|BIT|9, 0, "Armature",
+               uiDefButBitS(block, TOG, USER_DUP_ARM, 0, "Armature",
                        (xpos+edgespace+(4*midspace)+(3*medprefbut)+smallprefbut),y1,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes armature data to be duplicated with Shift+D");
 
-               uiDefButS(block, TOG|BIT|2, 0, "Surface",
+               uiDefButBitS(block, TOG, USER_DUP_SURF, 0, "Surface",
                        (xpos+edgespace+(5*midspace)+(3*medprefbut)+(2*smallprefbut)),y2,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes surface data to be duplicated with Shift+D");
-               uiDefButS(block, TOG|BIT|5, 0, "Lamp",
+               uiDefButBitS(block, TOG, USER_DUP_LAMP, 0, "Lamp",
                        (xpos+edgespace+(5*midspace)+(3*medprefbut)+(2*smallprefbut)),y1,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes lamp data to be duplicated with Shift+D");
 
-                uiDefButS(block, TOG|BIT|1, 0, "Curve",
+               uiDefButBitS(block, TOG, USER_DUP_CURVE, 0, "Curve",
                        (xpos+edgespace+(6*midspace)+(3*medprefbut)+(3*smallprefbut)),y2,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes curve data to be duplicated with Shift+D");
-               uiDefButS(block, TOG|BIT|7, 0, "Material",
+               uiDefButBitS(block, TOG, USER_DUP_MAT, 0, "Material",
                        (xpos+edgespace+(6*midspace)+(3*medprefbut)+(3*smallprefbut)),y1,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes material data to be duplicated with Shift+D");
 
-               uiDefButS(block, TOG|BIT|3, 0, "Text",
+               uiDefButBitS(block, TOG, USER_DUP_FONT, 0, "Text",
                        (xpos+edgespace+(7*midspace)+(3*medprefbut)+(4*smallprefbut)),y2,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes text data to be duplicated with Shift+D");
-               uiDefButS(block, TOG|BIT|8, 0, "Texture",
+               uiDefButBitS(block, TOG, USER_DUP_TEX, 0, "Texture",
                        (xpos+edgespace+(7*midspace)+(3*medprefbut)+(4*smallprefbut)),y1,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes texture data to be duplicated with Shift+D");
 
-               uiDefButS(block, TOG|BIT|4, 0, "Metaball",
+               uiDefButBitS(block, TOG, USER_DUP_MBALL, 0, "Metaball",
                        (xpos+edgespace+(8*midspace)+(3*medprefbut)+(5*smallprefbut)),y2,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes metaball data to be duplicated with Shift+D");
-               uiDefButS(block, TOG|BIT|6, 0, "Ipo",
+               uiDefButBitS(block, TOG, USER_DUP_IPO, 0, "Ipo",
                        (xpos+edgespace+(8*midspace)+(3*medprefbut)+(5*smallprefbut)),y1,smallprefbut,buth,
                        &(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D");
        
@@ -2213,11 +2213,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                sprintf(curfont, "Interface Font: ");
                strcat(curfont,U.fontname);
 
-               uiDefButS(block, TOG|BIT|5, B_DOLANGUIFONT, "International Fonts",
+               uiDefButBitS(block, TOG, USER_DOTRANSLATE, B_DOLANGUIFONT, "International Fonts",
                        xpos,y2,medprefbut,buth,
                        &(U.transopts), 0, 0, 0, 0, "Activate international interface");
 
-               if(U.transopts & TR_ALL) {
+               if(U.transopts & USER_DOTRANSLATE) {
                        uiDefBut(block, LABEL,0,curfont,
                                (xpos+edgespace+medprefbut+midspace),y2,medprefbut,buth,
                                0, 0, 0, 0, 0, "");
@@ -2242,15 +2242,15 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                                0, 0, 0, 0, 0, "");
 */
 
-                       uiDefButS(block, TOG|BIT|0, B_SETTRANSBUTS, "Tooltips",
+                       uiDefButBitS(block, TOG, USER_TR_TOOLTIPS, B_SETTRANSBUTS, "Tooltips",
                                (xpos+edgespace+(2.2*medprefbut)+(3*midspace)),y1,smallprefbut,buth,
                                &(U.transopts), 0, 0, 0, 0, "Translate tooltips");
 
-                       uiDefButS(block, TOG|BIT|1, B_SETTRANSBUTS, "Buttons",
+                       uiDefButBitS(block, TOG, USER_TR_BUTTONS, B_SETTRANSBUTS, "Buttons",
                                (xpos+edgespace+(2.2*medprefbut)+(4*midspace)+smallprefbut),y1,smallprefbut,buth,
                                &(U.transopts), 0, 0, 0, 0, "Translate button labels");
 
-                       uiDefButS(block, TOG|BIT|2, B_SETTRANSBUTS, "Toolbox",
+                       uiDefButBitS(block, TOG, USER_TR_MENUS, B_SETTRANSBUTS, "Toolbox",
                                (xpos+edgespace+(2.2*medprefbut)+(5*midspace)+(2*smallprefbut)),y1,smallprefbut,buth,
                                &(U.transopts), 0, 0, 0, 0, "Translate toolbox menu");
 
@@ -2258,7 +2258,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                                (xpos+edgespace+(2.2*medprefbut)+(3*midspace)),y2,medprefbut+(0.5*medprefbut)+3,buth,
                                &U.language, 0, 0, 0, 0, "Select interface language");
                                
-                       /* uiDefButS(block, TOG|BIT|3, B_SETTRANSBUTS, "FTF All windows",
+                       /* uiDefButBitS(block, TOG, USER_TR_TEXTEDIT, B_SETTRANSBUTS, "FTF All windows",
                                (xpos+edgespace+(4*medprefbut)+(4*midspace)),y1,medprefbut,buth,
                                &(U.transopts), 0, 0, 0, 0,
                                "Use FTF drawing for fileselect and textwindow "
@@ -2272,12 +2272,12 @@ void drawinfospace(ScrArea *sa, void *spacedata)
        } else if(U.userpref == 3) { /* auto save */
 
 
-               uiDefButS(block, TOG|BIT|0, B_RESETAUTOSAVE, "Auto Save Temp Files",
+               uiDefButBitS(block, TOG, USER_AUTOSAVE, B_RESETAUTOSAVE, "Auto Save Temp Files",
                        (xpos+edgespace),y2,medprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Enables automatic saving of temporary files");
 
-               if(U.flag & AUTOSAVE) {
+               if(U.flag & USER_AUTOSAVE) {
 
                        uiDefBut(block, BUT, B_LOADTEMP, "Open Recent",
                                (xpos+edgespace),y1,medprefbut,buth,
@@ -2370,7 +2370,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(1*midspace)+(1*medprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|8, 0, "Enable all codecs",
+               uiDefButBitS(block, TOG, USER_ALLWINCODECS, 0, "Enable all codecs",
                        (xpos+edgespace+(1*medprefbut)+(1*midspace)),y2,medprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0, "Allows all codecs for rendering (not guaranteed)");
 #endif
@@ -2379,12 +2379,12 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButS(block, TOG|BIT|9, B_U_CAPSLOCK, "Disable Caps Lock",
+               uiDefButBitS(block, TOG, USER_NO_CAPSLOCK, B_U_CAPSLOCK, "Disable Caps Lock",
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)),y1,medprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Disables the Caps Lock key when entering text");
 
-               uiDefButS(block, TOG|BIT|13, 0, "Emulate Numpad",
+               uiDefButBitS(block, TOG, USER_NONUMPAD, 0, "Emulate Numpad",
                        (xpos+edgespace+(3*midspace)+(3*medprefbut)),y2,medprefbut,buth,
                        &(U.flag), 0, 0, 0, 0,
                        "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
@@ -2394,11 +2394,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(4*midspace)+(4*medprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButI(block, TOG|BIT|USERDEF_DISABLE_SOUND_BIT, B_SOUNDTOGGLE, "Disable Sound",
+               uiDefButBitI(block, TOG, USER_DISABLE_SOUND, B_SOUNDTOGGLE, "Disable Sound",
                        (xpos+edgespace+(4*medprefbut)+(4*midspace)),y2,medprefbut,buth,
                        &(U.gameflags), 0, 0, 0, 0, "Disables sounds from being played");
 
-               uiDefButS(block, TOG|BIT|3, 0, "Filter File Extensions",
+               uiDefButBitS(block, TOG, USER_FILTERFILEEXTS, 0, "Filter File Extensions",
                        (xpos+edgespace+(4*medprefbut)+(4*midspace)),y1,medprefbut,buth,
                        &(U.uiflag), 0, 0, 0, 0, "Display only files with extensions in the image select window");
 
@@ -2407,11 +2407,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                        (xpos+edgespace+(5*midspace)+(5*medprefbut)),y3label,medprefbut,buth,
                        0, 0, 0, 0, 0, "");
 
-               uiDefButI(block, TOGN|BIT|USERDEF_DISABLE_MIPMAP_BIT, B_MIPMAPCHANGED, "Mipmaps",
+               uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps",
                        (xpos+edgespace+(5*medprefbut)+(5*midspace)),y2,medprefbut,buth,
                        &(U.gameflags), 0, 0, 0, 0, "Toggles between mipmap textures on (beautiful) and off (fast)");
 
-               uiDefButI(block, TOG|BIT|USERDEF_VERTEX_ARRAYS_BIT, 0, "Vertex Arrays",
+               uiDefButBitI(block, TOG, USER_VERTEX_ARRAYS, 0, "Vertex Arrays",
                        (xpos+edgespace+(5*medprefbut)+(5*midspace)),y1,medprefbut,buth,
                        &(U.gameflags), 0, 0, 0, 0, "Toggles between vertex arrays on (less reliable) and off (more reliable)");
 
index fe04859fe16e46be6bf86af5d3c149d12f2a24ed..8fd32e09040bee421ee9e3d76c94bd24f88d8847 100644 (file)
@@ -847,7 +847,7 @@ void tbox_drawelem_text(x, y, type)
                }
                
                glRasterPos2i(x1+5, y1+tbfontyofs);
-               BIF_DrawString(G.font, tbstr, (U.transopts & TR_MENUS));
+               BIF_DrawString(G.font, tbstr, (U.transopts & USER_TR_MENUS));
                
                if(keystr && keystr[0]) {
                        if(type & 1) {
@@ -856,12 +856,12 @@ void tbox_drawelem_text(x, y, type)
                                glRecti(x2-len2-2,  y1+2,  x2-3,  y2-2);
                                ColorFunc(TBOXWHITE);
                                glRasterPos2i(x2-len2,  y1+tbfontyofs);
-                               BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS));
+                               BIF_DrawString(G.font, keystr, (U.transopts & USER_TR_MENUS));
                        }
                        else {
                                ColorFunc(TBOXBLACK);
                                glRasterPos2i(x2-len2,  y1+tbfontyofs);
-                               BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS));
+                               BIF_DrawString(G.font, keystr, (U.transopts & USER_TR_MENUS));
                        }
                }
        }
@@ -1280,9 +1280,9 @@ void draw_numbuts_tip(char *str, int x1, int y1, int x2, int y2)
        cpack(0x0);
 
        temp= 0;
-       while( BIF_GetStringWidth(G.fonts, str+temp, (U.transopts & TR_BUTTONS))>(x2 - x1-24)) temp++;
+       while( BIF_GetStringWidth(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS))>(x2 - x1-24)) temp++;
        glRasterPos2i(x1+16, y2-30);
-       BIF_DrawString(G.fonts, str+temp, (U.transopts & TR_BUTTONS));
+       BIF_DrawString(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS));
 }
 
 int do_clever_numbuts(char *name, int tot, int winevent)
index 9307359c2058b6cdccda0e0f470728002d1d6525..f19310fd6f75133c69dd3bad2f402bbc470382d9 100644 (file)
@@ -152,7 +152,7 @@ int BIF_read_homefile(void)
 #ifdef _WIN32  // FULLSCREEN
        static int screenmode = -1;
 
-       screenmode = U.uiflag & FLIPFULLSCREEN;
+       screenmode = U.uiflag & USER_FLIPFULLSCREEN;
 #endif
 
        BLI_make_file_string(G.sce, tstr, home, ".B.blend");
@@ -182,15 +182,15 @@ int BIF_read_homefile(void)
                        case G_WINDOWSTATE_USERDEF: /* use the usersetting */
                                break;
                        case G_WINDOWSTATE_FULLSCREEN: /* force fullscreen */
-                               U.uiflag |= FLIPFULLSCREEN;
+                               U.uiflag |= USER_FLIPFULLSCREEN;
                                break;
                        case G_WINDOWSTATE_BORDER: /* force with borders */
-                               U.uiflag &= ~FLIPFULLSCREEN;
+                               U.uiflag &= ~USER_FLIPFULLSCREEN;
                }
 
-               if(screenmode != (U.uiflag & FLIPFULLSCREEN)) {
-                       mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN));
-                       screenmode = (U.uiflag & FLIPFULLSCREEN);
+               if(screenmode != (U.uiflag & USER_FLIPFULLSCREEN)) {
+                       mainwindow_toggle_fullscreen ((U.uiflag & USER_FLIPFULLSCREEN));
+                       screenmode = (U.uiflag & USER_FLIPFULLSCREEN);
                }
 #endif
 
@@ -211,18 +211,18 @@ int BIF_read_homefile(void)
 
                        /* patch to set Dupli Armature */
                if (G.main->versionfile < 220) {
-                       U.dupflag |= DUPARM;
+                       U.dupflag |= USER_DUP_ARM;
                }
 
                        /* userdef new option */
                if (G.main->versionfile <= 222) {
-                       U.vrmlflag= USERDEF_VRML_LAYERS;
+                       U.vrmlflag= USER_VRML_LAYERS;
                }
 
 #ifndef __sgi
                /* startup 2.26 with aa fonts ! */
                if (G.main->versionfile <= 225) {
-                       U.transopts |= TR_ALL;
+                       U.transopts |= USER_DOTRANSLATE;
                }
 #endif
 
@@ -502,7 +502,7 @@ void BIF_init(void)
 #ifdef INTERNATIONAL
        read_languagefile();
 
-       if(U.transopts & TR_ALL)
+       if(U.transopts & USER_DOTRANSLATE)
                start_interface_font();
        else
                G.ui_international = FALSE;
index 0e760e3cbd9c208afc43c584c20998fad67b4e7e..f32316a9a91a7e2a8e237d2074c16439f89d6efe 100644 (file)
@@ -449,7 +449,7 @@ void viewmove(int mode)
                        
                                /* if turntable method, we don't change mvalball[0] */
                        
-                               if(U.flag & TRACKBALL) mvalball[0]= mval[0];
+                               if(U.flag & USER_TRACKBALL) mvalball[0]= mval[0];
                                mvalball[1]= mval[1];
                                
                                calctrackballvec(&curarea->winrct, mvalball, newvec);
@@ -475,7 +475,7 @@ void viewmove(int mode)
                                        
                                        QuatMul(G.vd->viewquat, q1, oldquat);
 
-                                       if( (U.flag & TRACKBALL)==0 ) {
+                                       if( (U.flag & USER_TRACKBALL)==0 ) {
                                        
                                                /* rotate around z-axis (mouse x moves)  */
                                                
index 1b6a97765151078e9c2017090cb3123f14df1f63..582b1e6503f567b564f17f7d2281149bbc45a68b 100644 (file)
@@ -789,7 +789,7 @@ int get_avicodec_settings(void)
 
        psdummy = NewBall();
 
-       if(U.uiflag & ALLWINCODECS)
+       if(U.uiflag & USER_ALLWINCODECS)
                uiFlags = ICMF_CHOOSE_ALLCOMPRESSORS;
        else
                uiFlags = ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE;