SVN merge r57315-57319 into soc-2013-dingto
authorThomas Dinges <blender@dingto.org>
Sun, 9 Jun 2013 20:28:16 +0000 (20:28 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 9 Jun 2013 20:28:16 +0000 (20:28 +0000)
18 files changed:
doc/guides/interface_API.txt
intern/cycles/blender/blender_sync.cpp
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_random.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/blender.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_extrude.c
source/blender/editors/screen/area.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_space.c

index 5f0fbc85ff8536f08653e1c908d9c057a1f29b2c..1874519db8d752c37eb4982e1f24c860a74752f7 100644 (file)
@@ -19,26 +19,22 @@ Contents
 4. API for uiButton 
 4.1 UiDefBut
        1. BUT
-       2. TOG or TOGN or TOGR
+       2. TOG or TOGN
           TOG|BIT|<nr>
-       3. TOG3|BIT|<nr>
-       4. ROW
-       5. SLI or NUMSLI or HSVSLI
-       6. NUM
-       7. TEX
-       8. LABEL
-       9  SEPR
-       10. MENU
-       11.     COL
+       3. ROW
+       4. NUMSLI or HSVSLI
+       5. NUM
+       6. TEX
+       7. LABEL
+       8  SEPR
+       9. MENU
+       10.     COL
 4.2 Icon buttons
-       12. ICONROW
-       13. ICONTEXTROW
 4.3 pulldown menus / block buttons
        14. BLOCK
 4.4 specials
        15. KEYEVT
        16. LINK and INLINK
-       17. IDPOIN
 4.5 uiButton control fuctions
 
 
@@ -289,55 +285,49 @@ type:
        Activation button. (like "Render")
        Passing on a pointer is not needed
        
-2. TOG or TOGN or TOGR
+2. TOG or TOGN
        Toggle button (like "Lock")
        The pointer value is set either at 0 or 1
        If pressed, it calls the optional function with arguments provided.
        Type TOGN: works negative, when pressed it sets at 0
-       Type TOGR: is part of a row, redraws automatically all buttons with same *poin
 
        "|BIT|<nr>"
        When added to type, it works on a single bit <nr> (lowest order bit: nr = '0')
 
-3. TOG3|BIT|<nr>
-       A toggle with 3 values!
-       Can be only used for short *poin.
-       In the third toggle setting, the bit <nr> of *( poin+1) is set.
-       
-4. ROW
+3. ROW
        Button that's part of a row. 
        in "min" you set a row-id number, in "max" the value you want *poin to be
        assigned when you press the button. Always pass on these values as floats.
        When this button is pressed, it sets the "max" value to *poin, and redraws
        all buttons with the same row-id number.
 
-5. SLI or NUMSLI or HSVSLI
-       Slider, number-slider or hsv-slider button.
+4. NUMSLI or HSVSLI
+       Number-slider or hsv-slider button.
        "min" and "max" are to clamp the value to.
        If you want a button type "Col" to be updated, make 'a1' equal to 'retval'
        from the COL button.
        
-6. NUM
+5. NUM
        Number button
        Set the clamping values 'min' and 'max' always as float.
        For UiDefButF, set a 'step' in 'a1', in 1/100's. The step value is the increment or
        decrement when you click once on the right or left side of a button.
        The optional button function is additionally called for each change of the *poin value.
        
-7. TEX
+6. TEX
        Text string button.
        Pointertype is standard a char. Value 'max' is length of string (pass as float).
        When button is left with ESC, it doesn't put the 'retval' at the queue.
        
-8. LABEL
+7. LABEL
        Label button.
        Only displays text. 
        If 'min' is set at 1.0, the text is printed in white.
        
-9  SEPR
+8  SEPR
        A separator line, typically used within pulldown menus.
        
-10. MENU
+9. MENU
        Menu button.
        The syntax of the string in *name defines the menu items:
                - %t means the previous text becomes the title
@@ -346,7 +336,7 @@ type:
                        without returnvalues, the first item gets value 0 (incl. title!)
        Example: "Do something %t| turn left %2| turn right %1| nothing %0"
        
-11.    COLOR
+10.    COLOR
        A special button that only visualizes a RGB value
        In 'retval' you can put a code, which is used to identify for sliders if it needs
        redraws while using the sliders. Check button '5'.
@@ -371,19 +361,6 @@ uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *s
 
        Same again, but now with an icon and string as button name.
 
-Two special icon buttons are available in Blender:
-
-12. ICONROW
-       (uiDefIconBut)
-       This button pops up a vertical menu with a row of icons to choose from.
-       'max' = amount of icons. The icons are supposed to be ordered in a sequence
-       It writes in *poin which item in the menu was choosen (starting with 0).
-
-13. ICONTEXTROW
-       (uiDefIconTextBut)
-       Same as previous, but with the texts next to it.
-
-
 
 -----------4.3 pulldown menus / block buttons
 
@@ -465,37 +442,6 @@ uiDefIconBut(block, INLINK, 0, ICON_INLINK, x1, y1, w, h, void *poin, short from
        
 
 
-17. IDPOIN
-void uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, int retval, char *str, 
-                       short x1, short y1, short x2, short y2, void *idpp, char *tip)
-
-       The ID struct is a generic part in structs like Object, Material, Mesh, etc.
-       Most linking options in Blender happens using ID's. (Mesh -> Material).
-       
-       This special button in Blender visualizes an ID pointer with its name. Typing in
-       a new name, changes the pointer. For most ID types in Blender functions have been
-       written already, needed by this button, to check validity of names, and assign the pointer.
-       
-       (BTW: the 'void *idpp' has to be a pointer to the ID pointer!)
-
-       Example function that can be put in 'func':
-       
-       void test_scriptpoin_but(char *name, ID **idpp)
-       {
-               ID *id;
-               
-               id= G.main->text.first;
-               while(id) {
-                       if( strcmp(name, id->name+2)==0 ) {
-                               *idpp= id;
-                               return;
-                       }
-                       id= id->next;
-               }
-               *idpp= 0;
-       }
-
-
 ------------- 4.5 uiButton control fuctions
 
 
index ef9ce85ddf8080cc8d34e7aff93e6439dfa25026..72ed1b84915b4ebf0289b2bc3e79891ad0e7d650 100644 (file)
@@ -211,7 +211,6 @@ void BlenderSync::sync_integrator()
 void BlenderSync::sync_film()
 {
        PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
-       BL::WorldMistSettings b_mist = b_scene.world().mist_settings();
 
        Film *film = scene->film;
        Film prevfilm = *film;
@@ -220,19 +219,23 @@ void BlenderSync::sync_film()
        film->filter_type = (FilterType)RNA_enum_get(&cscene, "filter_type");
        film->filter_width = (film->filter_type == FILTER_BOX)? 1.0f: get_float(cscene, "filter_width");
 
-       film->mist_start = b_mist.start();
-       film->mist_depth = b_mist.depth();
-
-       switch(b_mist.falloff()) {
-               case BL::WorldMistSettings::falloff_QUADRATIC:
-                       film->mist_falloff = 2.0f;
-                       break;
-               case BL::WorldMistSettings::falloff_LINEAR:
-                       film->mist_falloff = 1.0f;
-                       break;
-               case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC:
-                       film->mist_falloff = 0.5f;
-                       break;
+       if(b_scene.world()) {
+               BL::WorldMistSettings b_mist = b_scene.world().mist_settings();
+
+               film->mist_start = b_mist.start();
+               film->mist_depth = b_mist.depth();
+
+               switch(b_mist.falloff()) {
+                       case BL::WorldMistSettings::falloff_QUADRATIC:
+                               film->mist_falloff = 2.0f;
+                               break;
+                       case BL::WorldMistSettings::falloff_LINEAR:
+                               film->mist_falloff = 1.0f;
+                               break;
+                       case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC:
+                               film->mist_falloff = 0.5f;
+                               break;
+               }
        }
 
        if(film->modified(prevfilm))
index 866024ba303d0e43b07a986e10f790a6e8e74a1c..f58f83e2f820fdf10cd17e9bc71a4c627ecb4201 100644 (file)
@@ -233,7 +233,7 @@ __device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ra
        return result;
 }
 
-__device float4 kernel_path_progressive(KernelGlobals *kg, RNG rng, int sample, Ray ray, __global float *buffer)
+__device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer)
 {
        /* initialize */
        PathRadiance L;
@@ -271,7 +271,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG rng, int sample,
                        }
 
                        extmax = kernel_data.curve_kernel_data.maximum_width;
-                       lcg_state = lcg_init(rng + rng_offset + sample*0x51633e2d);
+                       lcg_state = lcg_init(*rng + rng_offset + sample*0x51633e2d);
                }
 
                bool hit = scene_intersect(kg, &ray, visibility, &isect, &lcg_state, difl, extmax);
@@ -399,7 +399,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG rng, int sample,
 
                        /* do bssrdf scatter step if we picked a bssrdf closure */
                        if(sc) {
-                               uint lcg_state = lcg_init(rng + rng_offset + sample*0x68bc21eb);
+                               uint lcg_state = lcg_init(*rng + rng_offset + sample*0x68bc21eb);
                                subsurface_scatter_step(kg, &sd, state.flag, sc, &lcg_state, false);
                        }
                }
@@ -538,7 +538,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG rng, int sample,
 
 #ifdef __NON_PROGRESSIVE__
 
-__device void kernel_path_indirect(KernelGlobals *kg, RNG rng, int sample, Ray ray, __global float *buffer,
+__device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer,
        float3 throughput, int num_samples, int num_total_samples,
        float min_ray_pdf, float ray_pdf, PathState state, int rng_offset, PathRadiance *L)
 {
@@ -644,7 +644,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG rng, int sample, Ray r
 
                        /* do bssrdf scatter step if we picked a bssrdf closure */
                        if(sc) {
-                               uint lcg_state = lcg_init(rng + rng_offset + sample*0x68bc21eb);
+                               uint lcg_state = lcg_init(*rng + rng_offset + sample*0x68bc21eb);
                                subsurface_scatter_step(kg, &sd, state.flag, sc, &lcg_state, false);
                        }
                }
@@ -767,7 +767,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG rng, int sample, Ray r
        }
 }
 
-__device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, RNG rng, int sample,
+__device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, RNG *rng, int sample,
        ShaderData *sd, float3 throughput, float num_samples_adjust,
        float min_ray_pdf, float ray_pdf, PathState state,
        int rng_offset, PathRadiance *L, __global float *buffer)
@@ -830,13 +830,13 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) {
                        int num_samples = ceil_to_int(num_samples_adjust*light_select_num_samples(kg, i));
                        float num_samples_inv = num_samples_adjust/(num_samples*kernel_data.integrator.num_all_lights);
-                       RNG lamp_rng = cmj_hash(rng, i);
+                       RNG lamp_rng = cmj_hash(*rng, i);
 
                        if(kernel_data.integrator.pdf_triangles != 0.0f)
                                num_samples_inv *= 0.5f;
 
                        for(int j = 0; j < num_samples; j++) {
-                               float2 light_uv = path_rng_2D(kg, lamp_rng, sample*num_samples + j, aa_samples*num_samples, rng_offset + PRNG_LIGHT_U);
+                               float2 light_uv = path_rng_2D(kg, &lamp_rng, sample*num_samples + j, aa_samples*num_samples, rng_offset + PRNG_LIGHT_U);
                                float light_u = light_uv.x;
                                float light_v = light_uv.y;
 
@@ -905,7 +905,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                num_samples = ceil_to_int(num_samples_adjust*num_samples);
 
                float num_samples_inv = num_samples_adjust/num_samples;
-               RNG bsdf_rng = cmj_hash(rng, i);
+               RNG bsdf_rng = cmj_hash(*rng, i);
 
                for(int j = 0; j < num_samples; j++) {
                        /* sample BSDF */
@@ -913,7 +913,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
                        BsdfEval bsdf_eval;
                        float3 bsdf_omega_in;
                        differential3 bsdf_domega_in;
-                       float2 bsdf_uv = path_rng_2D(kg, bsdf_rng, sample*num_samples + j, aa_samples*num_samples, rng_offset + PRNG_BSDF_U);
+                       float2 bsdf_uv = path_rng_2D(kg, &bsdf_rng, sample*num_samples + j, aa_samples*num_samples, rng_offset + PRNG_BSDF_U);
                        float bsdf_u = bsdf_uv.x;
                        float bsdf_v = bsdf_uv.y;
                        int label;
@@ -964,7 +964,7 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R
        }
 }
 
-__device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG rng, int sample, Ray ray, __global float *buffer)
+__device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer)
 {
        /* initialize */
        PathRadiance L;
@@ -997,7 +997,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG rng, int samp
                        }
 
                        extmax = kernel_data.curve_kernel_data.maximum_width;
-                       lcg_state = lcg_init(rng + rng_offset + sample*0x51633e2d);
+                       lcg_state = lcg_init(*rng + rng_offset + sample*0x51633e2d);
                }
 
                if(!scene_intersect(kg, &ray, visibility, &isect, &lcg_state, difl, extmax)) {
@@ -1090,7 +1090,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG rng, int samp
                                        continue;
 
                                /* set up random number generator */
-                               uint lcg_state = lcg_init(rng + rng_offset + sample*0x68bc21eb);
+                               uint lcg_state = lcg_init(*rng + rng_offset + sample*0x68bc21eb);
                                int num_samples = kernel_data.integrator.subsurface_samples;
                                float num_samples_inv = 1.0f/num_samples;
 
@@ -1163,7 +1163,7 @@ __device void kernel_path_trace(KernelGlobals *kg,
        float lens_u = 0.0f, lens_v = 0.0f;
 
        if(kernel_data.cam.aperturesize > 0.0f) {
-               float2 lens_uv = path_rng_2D(kg, rng, sample, num_samples, PRNG_LENS_U);
+               float2 lens_uv = path_rng_2D(kg, &rng, sample, num_samples, PRNG_LENS_U);
                lens_u = lens_uv.x;
                lens_v = lens_uv.y;
        }
@@ -1172,7 +1172,7 @@ __device void kernel_path_trace(KernelGlobals *kg,
 
 #ifdef __CAMERA_MOTION__
        if(kernel_data.cam.shuttertime != -1.0f)
-               time = path_rng_1D(kg, rng, sample, num_samples, PRNG_TIME);
+               time = path_rng_1D(kg, &rng, sample, num_samples, PRNG_TIME);
 #endif
 
        camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, &ray);
@@ -1184,10 +1184,10 @@ __device void kernel_path_trace(KernelGlobals *kg,
 #ifdef __NON_PROGRESSIVE__
                if(kernel_data.integrator.progressive)
 #endif
-                       L = kernel_path_progressive(kg, rng, sample, ray, buffer);
+                       L = kernel_path_progressive(kg, &rng, sample, ray, buffer);
 #ifdef __NON_PROGRESSIVE__
                else
-                       L = kernel_path_non_progressive(kg, rng, sample, ray, buffer);
+                       L = kernel_path_non_progressive(kg, &rng, sample, ray, buffer);
 #endif
        }
        else
index ecf80b817d476de92fd65d6b20b43eb8336586bd..b5f824d5cce1a750fd5f4c0a2f19691ba89f90f6 100644 (file)
@@ -102,10 +102,10 @@ __device uint sobol_lookup(const uint m, const uint frame, const uint ex, const
        return index;
 }
 
-__device_inline float path_rng(KernelGlobals *kg, RNG rng, int sample, int dimension)
+__device_inline float path_rng(KernelGlobals *kg, RNG *rng, int sample, int dimension)
 {
 #ifdef __SOBOL_FULL_SCREEN__
-       uint result = sobol_dimension(kg, rng, dimension);
+       uint result = sobol_dimension(kg, *rng, dimension);
        float r = (float)result * (1.0f/(float)0xFFFFFFFF);
        return r;
 #else
@@ -117,20 +117,20 @@ __device_inline float path_rng(KernelGlobals *kg, RNG rng, int sample, int dimen
        float shift;
 
        if(dimension & 1)
-               shift = (rng >> 16)*(1.0f/(float)0xFFFF);
+               shift = (*rng >> 16)*(1.0f/(float)0xFFFF);
        else
-               shift = (rng & 0xFFFF)*(1.0f/(float)0xFFFF);
+               shift = (*rng & 0xFFFF)*(1.0f/(float)0xFFFF);
 
        return r + shift - floorf(r + shift);
 #endif
 }
 
-__device_inline float path_rng_1D(KernelGlobals *kg, RNG rng, int sample, int num_samples, int dimension)
+__device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension)
 {
 #ifdef __CMJ__
        if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) {
                /* correlated multi-jittered */
-               int p = rng + dimension;
+               int p = *rng + dimension;
                return cmj_sample_1D(sample, num_samples, p);
        }
 #endif
@@ -139,12 +139,12 @@ __device_inline float path_rng_1D(KernelGlobals *kg, RNG rng, int sample, int nu
        return path_rng(kg, rng, sample, dimension);
 }
 
-__device_inline float2 path_rng_2D(KernelGlobals *kg, RNG rng, int sample, int num_samples, int dimension)
+__device_inline float2 path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension)
 {
 #ifdef __CMJ__
        if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) {
                /* correlated multi-jittered */
-               int p = rng + dimension;
+               int p = *rng + dimension;
                return cmj_sample_2D(sample, num_samples, p);
        }
 #endif
@@ -184,7 +184,7 @@ __device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state,
                *fy = 0.5f;
        }
        else {
-               float2 fxy = path_rng_2D(kg, *rng, sample, num_samples, PRNG_FILTER_U);
+               float2 fxy = path_rng_2D(kg, rng, sample, num_samples, PRNG_FILTER_U);
 
                *fx = fxy.x;
                *fy = fxy.y;
index 2dfdce49a71bfc5e91f6cc1830bea9d842696779..dfab15a6f12ff75df8f61d7bdb13f0db9713b572 100644 (file)
@@ -96,7 +96,6 @@ extern void BKE_undo_step(struct bContext *C, int step);
 extern void BKE_undo_name(struct bContext *C, const char *name);
 extern int BKE_undo_valid(const char *name);
 extern void BKE_reset_undo(void);
-extern char *BKE_undo_menu_string(void);
 extern void BKE_undo_number(struct bContext *C, int nr);
 extern const char *BKE_undo_get_name(int nr, int *active);
 extern int BKE_undo_save_file(const char *filename);
index d3f4d6d06b0b72b9fbb5f50dffd34911bfb7e24c..87a8def52bfa86a2a098de71f7d7461ef941d582 100644 (file)
@@ -792,25 +792,6 @@ const char *BKE_undo_get_name(int nr, int *active)
        return NULL;
 }
 
-char *BKE_undo_menu_string(void)
-{
-       UndoElem *uel;
-       DynStr *ds = BLI_dynstr_new();
-       char *menu;
-
-       BLI_dynstr_append(ds, "Global Undo History %t");
-       
-       for (uel = undobase.first; uel; uel = uel->next) {
-               BLI_dynstr_append(ds, "|");
-               BLI_dynstr_append(ds, uel->name);
-       }
-
-       menu = BLI_dynstr_get_cstring(ds);
-       BLI_dynstr_free(ds);
-
-       return menu;
-}
-
 /* saves .blend using undo buffer, returns 1 == success */
 int BKE_undo_save_file(const char *filename)
 {
index e64a5a4af577fc03666bdce96dc15b9a628613f2..cb2f3e3286e6422e7407dbe1ab35bbeeef4dbd9a 100644 (file)
@@ -210,20 +210,14 @@ typedef enum {
        BUT           = (1 << 9),
        ROW           = (2 << 9),
        TOG           = (3 << 9),
-       SLI           = (4 << 9),
        NUM           = (5 << 9),
        TEX           = (6 << 9),
-       TOG3          = (7 << 9),
-       TOGR          = (8 << 9),
        TOGN          = (9 << 9),
        LABEL         = (10 << 9),
        MENU          = (11 << 9),  /* Dropdown list, actually! */
-       ICONROW       = (12 << 9),
        ICONTOG       = (13 << 9),
        NUMSLI        = (14 << 9),
        COLOR         = (15 << 9),
-       IDPOIN        = (16 << 9),
-       /* HSVSLI     = (17 << 9), */  /* UNUSED */
        SCROLL        = (18 << 9),
        BLOCK         = (19 << 9),
        BUTM          = (20 << 9),
@@ -231,18 +225,13 @@ typedef enum {
        LINK          = (22 << 9),
        INLINK        = (23 << 9),
        KEYEVT        = (24 << 9),
-       ICONTEXTROW   = (25 << 9),
        HSVCUBE       = (26 << 9),
        PULLDOWN      = (27 << 9),  /* Menu, actually! */
        ROUNDBOX      = (28 << 9),
-       CHARTAB       = (29 << 9),
        BUT_COLORBAND = (30 << 9),
        BUT_NORMAL    = (31 << 9),
        BUT_CURVE     = (32 << 9),
-       BUT_TOGDUAL   = (33 << 9),
        ICONTOGN      = (34 << 9),
-       /* FTPREVIEW  = (35 << 9), */  /* UNUSED */
-       NUMABS        = (36 << 9),
        TOGBUT        = (37 << 9),
        OPTION        = (38 << 9),
        OPTIONN       = (39 << 9),
@@ -560,7 +549,6 @@ void uiButGetStrInfo(struct bContext *C, uiBut *but, ...);
 /* Special Buttons
  *
  * Buttons with a more specific purpose:
- * - IDPoinBut: for creating buttons that work on a pointer to an ID block.
  * - MenuBut: buttons that popup a menu (in headers usually).
  * - PulldownBut: like MenuBut, but creating a uiBlock (for compatibility).
  * - BlockBut: buttons that popup a block with more buttons.
@@ -582,12 +570,6 @@ void uiButGetStrInfo(struct bContext *C, uiBut *but, ...);
 #define UI_ID_PREVIEWS      2048
 #define UI_ID_FULL          (UI_ID_RENAME | UI_ID_BROWSE | UI_ID_ADD_NEW | UI_ID_OPEN | UI_ID_ALONE | UI_ID_DELETE | UI_ID_LOCAL)
 
-typedef void (*uiIDPoinFuncFP)(struct bContext *C, const char *str, struct ID **idpp);
-typedef void (*uiIDPoinFunc)(struct bContext *C, struct ID *id, int event);
-
-uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str,
-                      int x, int y, short width, short height, void *idpp, const char *tip);
-
 int uiIconFromID(struct ID *id);
 
 uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip);
index cce9ec50c1e0c6386082f310aef29f66ec9b5549..1bebfa8a7a02ef6aea9d481758f2cd9f3fe2181d 100644 (file)
@@ -1140,9 +1140,6 @@ int ui_is_but_push_ex(uiBut *but, double *value)
                                break;
                        case TOGBUT:
                        case TOG:
-                       case TOGR:
-                       case TOG3:
-                       case BUT_TOGDUAL:
                        case ICONTOG:
                        case OPTION:
                                UI_GET_BUT_VALUE_INIT(but, *value);
@@ -1420,7 +1417,7 @@ bool ui_is_but_float(uiBut *but)
 
 bool ui_is_but_bool(uiBut *but)
 {
-       if (ELEM5(but->type, TOG, TOGN, TOGR, ICONTOG, ICONTOGN))
+       if (ELEM4(but->type, TOG, TOGN, ICONTOG, ICONTOGN))
                return true;
 
        if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_BOOLEAN)
@@ -1620,8 +1617,6 @@ int ui_get_but_string_max_length(uiBut *but)
 {
        if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
                return but->hardmax;
-       else if (but->type == IDPOIN)
-               return MAX_ID_NAME - 2;
        else
                return UI_MAX_DRAW_STR;
 }
@@ -1716,7 +1711,7 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
  */
 void ui_get_but_string_ex(uiBut *but, char *str, const size_t maxlen, const int float_precision)
 {
-       if (but->rnaprop && ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (but->rnaprop && ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                PropertyType type;
                const char *buf = NULL;
                int buf_len;
@@ -1753,18 +1748,6 @@ void ui_get_but_string_ex(uiBut *but, char *str, const size_t maxlen, const int
                        MEM_freeN((void *)buf);
                }
        }
-       else if (but->type == IDPOIN) {
-               /* ID pointer */
-               if (but->idpoin_idpp) { /* Can be NULL for ID properties by python */
-                       ID *id = *(but->idpoin_idpp);
-                       if (id) {
-                               BLI_strncpy(str, id->name + 2, maxlen);
-                               return;
-                       }
-               }
-               str[0] = '\0';
-               return;
-       }
        else if (but->type == TEX) {
                /* string */
                BLI_strncpy(str, but->poin, maxlen);
@@ -1865,7 +1848,7 @@ bool ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
 
 bool ui_set_but_string(bContext *C, uiBut *but, const char *str)
 {
-       if (but->rnaprop && ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (but->rnaprop && ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                if (RNA_property_editable(&but->rnapoin, but->rnaprop)) {
                        PropertyType type;
 
@@ -1910,11 +1893,6 @@ bool ui_set_but_string(bContext *C, uiBut *but, const char *str)
                        }
                }
        }
-       else if (but->type == IDPOIN) {
-               /* ID pointer */
-               but->idpoin_func(C, str, but->idpoin_idpp);
-               return true;
-       }
        else if (but->type == TEX) {
                /* string */
                if (ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
@@ -1944,7 +1922,6 @@ bool ui_set_but_string(bContext *C, uiBut *but, const char *str)
                }
 
                if (!ui_is_but_float(but)) value = (int)floor(value + 0.5);
-               if (but->type == NUMABS) value = fabs(value);
 
                /* not that we use hard limits here */
                if (value < (double)but->hardmin) value = but->hardmin;
@@ -2285,7 +2262,6 @@ void ui_check_but(uiBut *but)
        /* test for min and max, icon sliders, etc */
        switch (but->type) {
                case NUM:
-               case SLI:
                case SCROLL:
                case NUMSLI:
                        UI_GET_BUT_VALUE_INIT(but, value);
@@ -2293,15 +2269,6 @@ void ui_check_but(uiBut *but)
                        else if (value > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
                        break;
                        
-               case NUMABS:
-               {
-                       double value_abs;
-                       UI_GET_BUT_VALUE_INIT(but, value);
-                       value_abs = fabs(value);
-                       if (value_abs < (double)but->hardmin) ui_set_but_val(but, but->hardmin);
-                       else if (value_abs > (double)but->hardmax) ui_set_but_val(but, but->hardmax);
-                       break;
-               }
                case ICONTOG: 
                case ICONTOGN:
                        if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
@@ -2310,20 +2277,6 @@ void ui_check_but(uiBut *but)
                        }
                        break;
                        
-               case ICONROW:
-                       if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
-                               UI_GET_BUT_VALUE_INIT(but, value);
-                               but->iconadd = (int)value - (int)(but->hardmin);
-                       }
-                       break;
-                       
-               case ICONTEXTROW:
-                       if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) {
-                               UI_GET_BUT_VALUE_INIT(but, value);
-                               but->iconadd = (int)value - (int)(but->hardmin);
-                       }
-                       break;
-
                        /* quiet warnings for unhandled types */
                default:
                        break;
@@ -2337,7 +2290,6 @@ void ui_check_but(uiBut *but)
        switch (but->type) {
        
                case MENU:
-               case ICONTEXTROW:
                
                        if (BLI_rctf_size_x(&but->rect) > 24.0f) {
                                UI_GET_BUT_VALUE_INIT(but, value);
@@ -2347,7 +2299,6 @@ void ui_check_but(uiBut *but)
        
                case NUM:
                case NUMSLI:
-               case NUMABS:
 
                        UI_GET_BUT_VALUE_INIT(but, value);
 
@@ -2394,7 +2345,6 @@ void ui_check_but(uiBut *but)
                
                        break;
 
-               case IDPOIN:
                case TEX:
                case SEARCH_MENU:
                case SEARCH_MENU_UNLINK:
@@ -2444,14 +2394,6 @@ void ui_check_but(uiBut *but)
 
                        break;
 
-               case BUT_TOGDUAL:
-                       /* trying to get the dual-icon to left of text... not very nice */
-                       if (but->str[0]) {
-                               BLI_strncpy(but->drawstr, "  ", UI_MAX_DRAW_STR);
-                               BLI_strncpy(but->drawstr + 2, but->str, UI_MAX_DRAW_STR - 2);
-                       }
-                       break;
-               
                case HSVCUBE:
                case HSVCIRCLE:
                        break;
@@ -2771,7 +2713,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        
        but->pos = -1;   /* cursor invisible */
 
-       if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {    /* add a space to name */
+       if (ELEM(but->type, NUM, NUMSLI)) {    /* add a space to name */
                /* slen remains unchanged from previous assignment, ensure this stays true */
                if (slen > 0 && slen < UI_MAX_NAME_STR - 2) {
                        if (but->str[slen - 1] != ' ') {
@@ -2782,13 +2724,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        }
 
        if ((block->flag & UI_BLOCK_LOOP) ||
-           ELEM9(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK))
+           ELEM8(but->type, MENU, TEX, LABEL, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK))
        {
                but->flag |= (UI_TEXT_LEFT | UI_ICON_LEFT);
        }
-       else if (but->type == BUT_TOGDUAL) {
-               but->flag |= UI_ICON_LEFT;
-       }
 
        but->flag |= (block->flag & UI_BUT_ALIGN);
 
@@ -3164,26 +3103,6 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname)
        MEM_freeN(autocpl);
 }
 
-/* autocomplete callback for ID buttons */
-static void autocomplete_id(bContext *C, char *str, void *arg_v)
-{
-       int blocktype = (intptr_t)arg_v;
-       ListBase *listb = which_libbase(CTX_data_main(C), blocktype);
-       
-       if (listb == NULL) return;
-       
-       /* search if str matches the beginning of an ID struct */
-       if (str[0]) {
-               AutoComplete *autocpl = autocomplete_begin(str, MAX_ID_NAME - 2);
-               ID *id;
-               
-               for (id = listb->first; id; id = id->next)
-                       autocomplete_do_name(autocpl, id->name + 2);
-
-               autocomplete_end(autocpl, str);
-       }
-}
-
 static void ui_check_but_and_iconize(uiBut *but, int icon)
 {
        if (icon) {
@@ -3675,19 +3594,6 @@ void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg)
        but->autofunc_arg = arg;
 }
 
-uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, int x, int y, short width, short height, void *idpp, const char *tip)
-{
-       uiBut *but = ui_def_but(block, IDPOIN, retval, str, x, y, width, height, NULL, 0.0, 0.0, 0.0, 0.0, tip);
-       but->idpoin_func = func;
-       but->idpoin_idpp = (ID **) idpp;
-       ui_check_but(but);
-       
-       if (blocktype)
-               uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype);
-
-       return but;
-}
-
 uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
 {
        uiBut *but = ui_def_but(block, BLOCK, 0, str, x, y, width, height, arg, 0.0, 0.0, 0.0, 0.0, tip);
index 0d8c11c003638f0db21fdf98cb332f5bf8b8cab3..d431115d84e21678e45cb8a97a0eabd78949dea3 100644 (file)
@@ -321,7 +321,7 @@ static uiBut *ui_but_last(uiBlock *block)
 static bool ui_is_a_warp_but(uiBut *but)
 {
        if (U.uiflag & USER_CONTINUOUS_MOUSE) {
-               if (ELEM7(but->type, NUM, NUMSLI, NUMABS, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
+               if (ELEM6(but->type, NUM, NUMSLI, HSVCIRCLE, TRACKPREVIEW, HSVCUBE, BUT_CURVE)) {
                        return true;
                }
        }
@@ -431,7 +431,7 @@ static void ui_apply_undo(uiBut *but)
 
                /* define which string to use for undo */
                if (ELEM(but->type, LINK, INLINK)) str = "Add button link";
-               else if (ELEM(but->type, MENU, ICONTEXTROW)) str = but->drawstr;
+               else if (but->type == MENU) str = but->drawstr;
                else if (but->drawstr[0]) str = but->drawstr;
                else str = but->tip;
 
@@ -544,7 +544,7 @@ static void ui_apply_but_BUTM(bContext *C, uiBut *but, uiHandleButtonData *data)
 
 static void ui_apply_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data)
 {
-       if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+       if (but->type == MENU)
                ui_set_but_val(but, data->value);
 
        ui_check_but(but);
@@ -558,16 +558,6 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
        double value;
        int w, lvalue, push;
        
-       /* local hack... */
-       if (but->type == BUT_TOGDUAL && data->togdual) {
-               if (but->pointype == UI_BUT_POIN_SHORT) {
-                       but->poin += 2;
-               }
-               else if (but->pointype == UI_BUT_POIN_INT) {
-                       but->poin += 4;
-               }
-       }
-       
        value = ui_get_but_val(but);
        lvalue = (int)value;
        
@@ -576,17 +566,6 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
                if (w) lvalue = UI_BITBUT_CLR(lvalue, but->bitnr);
                else   lvalue = UI_BITBUT_SET(lvalue, but->bitnr);
                
-               if (but->type == TOGR) {
-                       if (!data->togonly) {
-                               lvalue = 1 << (but->bitnr);
-       
-                               ui_set_but_val(but, (double)lvalue);
-                       }
-                       else {
-                               if (lvalue == 0) lvalue = 1 << (but->bitnr);
-                       }
-               }
-               
                ui_set_but_val(but, (double)lvalue);
                if (but->type == ICONTOG || but->type == ICONTOGN) ui_check_but(but);
        }
@@ -600,16 +579,6 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
                if (but->type == ICONTOG || but->type == ICONTOGN) ui_check_but(but);
        }
        
-       /* end local hack... */
-       if (but->type == BUT_TOGDUAL && data->togdual) {
-               if (but->pointype == UI_BUT_POIN_SHORT) {
-                       but->poin -= 2;
-               }
-               else if (but->pointype == UI_BUT_POIN_INT) {
-                       but->poin -= 4;
-               }
-       }
-       
        ui_apply_but_func(C, but);
 
        data->retval = but->retval;
@@ -673,41 +642,6 @@ static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
        data->applied = true;
 }
 
-static void ui_apply_but_TOG3(bContext *C, uiBut *but, uiHandleButtonData *data)
-{ 
-       if (but->pointype == UI_BUT_POIN_SHORT) {
-               short *sp = (short *)but->poin;
-               
-               if (UI_BITBUT_TEST(sp[1], but->bitnr)) {
-                       sp[1] = UI_BITBUT_CLR(sp[1], but->bitnr);
-                       sp[0] = UI_BITBUT_CLR(sp[0], but->bitnr);
-               }
-               else if (UI_BITBUT_TEST(sp[0], but->bitnr)) {
-                       sp[1] = UI_BITBUT_SET(sp[1], but->bitnr);
-               }
-               else {
-                       sp[0] = UI_BITBUT_SET(sp[0], but->bitnr);
-               }
-       }
-       else {
-               if (UI_BITBUT_TEST(*(but->poin + 2), but->bitnr)) {
-                       *(but->poin + 2) = UI_BITBUT_CLR(*(but->poin + 2), but->bitnr);
-                       *(but->poin)     = UI_BITBUT_CLR(*(but->poin),     but->bitnr);
-               }
-               else if (UI_BITBUT_TEST(*(but->poin), but->bitnr)) {
-                       *(but->poin + 2) = UI_BITBUT_SET(*(but->poin + 2), but->bitnr);
-               }
-               else {
-                       *(but->poin) = UI_BITBUT_SET(*(but->poin), but->bitnr);
-               }
-       }
-       
-       ui_check_but(but);
-       ui_apply_but_func(C, but);
-       data->retval = but->retval;
-       data->applied = true;
-}
-
 static void ui_apply_but_VEC(bContext *C, uiBut *but, uiHandleButtonData *data)
 {
        ui_set_but_vectorf(but, data->vec);
@@ -732,24 +666,6 @@ static void ui_apply_but_CURVE(bContext *C, uiBut *but, uiHandleButtonData *data
        data->applied = true;
 }
 
-static void ui_apply_but_IDPOIN(bContext *C, uiBut *but, uiHandleButtonData *data)
-{
-       ui_set_but_string(C, but, data->str);
-       ui_check_but(but);
-       ui_apply_but_func(C, but);
-       data->retval = but->retval;
-       data->applied = true;
-}
-
-#ifdef WITH_INTERNATIONAL
-static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *data)
-{
-       ui_apply_but_func(C, but);
-       data->retval = but->retval;
-       data->applied = true;
-}
-#endif
-
 /* ****************** drag drop code *********************** */
 
 #ifdef USE_DRAG_TOGGLE
@@ -1292,11 +1208,9 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
                        break;
                case TOGBUT: 
                case TOG: 
-               case TOGR: 
                case ICONTOG:
                case ICONTOGN:
                case TOGN:
-               case BUT_TOGDUAL:
                case OPTION:
                case OPTIONN:
                        ui_apply_but_TOG(C, but, data);
@@ -1307,17 +1221,10 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
                        break;
                case SCROLL:
                case NUM:
-               case NUMABS:
-               case SLI:
                case NUMSLI:
                        ui_apply_but_NUM(C, but, data);
                        break;
-               case TOG3:
-                       ui_apply_but_TOG3(C, but, data);
-                       break;
                case MENU:
-               case ICONROW:
-               case ICONTEXTROW:
                case BLOCK:
                case PULLDOWN:
                        ui_apply_but_BLOCK(C, but, data);
@@ -1342,14 +1249,6 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
                case BUT_CURVE:
                        ui_apply_but_CURVE(C, but, data);
                        break;
-               case IDPOIN:
-                       ui_apply_but_IDPOIN(C, but, data);
-                       break;
-#ifdef WITH_INTERNATIONAL
-               case CHARTAB:
-                       ui_apply_but_CHARTAB(C, but, data);
-                       break;
-#endif
                case KEYEVT:
                case HOTKEYEVT:
                        ui_apply_but_BUT(C, but, data);
@@ -1392,7 +1291,7 @@ static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleB
        for (wmd = drags->first; wmd; wmd = wmd->next) {
                if (wmd->type == WM_DRAG_ID) {
                        /* align these types with UI_but_active_drop_name */
-                       if (ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+                       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                                ID *id = (ID *)wmd->poin;
                                
                                if (but->poin == NULL && but->rnapoin.data == NULL) {}
@@ -1433,7 +1332,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
        }
        
        /* numeric value */
-       if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
+       if (ELEM(but->type, NUM, NUMSLI)) {
                
                if (but->poin == NULL && but->rnapoin.data == NULL) {
                        /* pass */
@@ -1497,7 +1396,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
        }
 
        /* text/string and ID data */
-       else if (ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       else if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                uiHandleButtonData *active_data = but->active;
 
                if (but->poin == NULL && but->rnapoin.data == NULL) {
@@ -2041,7 +1940,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
                BLI_str_rstrip_float_zero(data->str, '\0');
        }
 
-       if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
+       if (ELEM(but->type, NUM, NUMSLI)) {
                ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
        }
 
@@ -2113,7 +2012,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                return;
 
        for (but = actbut->next; but; but = but->next) {
-               if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2122,7 +2021,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                }
        }
        for (but = block->buttons.first; but != actbut; but = but->next) {
-               if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2141,7 +2040,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                return;
 
        for (but = actbut->prev; but; but = but->prev) {
-               if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2150,7 +2049,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
                }
        }
        for (but = block->buttons.last; but != actbut; but = but->prev) {
-               if (ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+               if (ELEM5(but->type, TEX, NUM, NUMSLI, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                        if (!(but->flag & UI_BUT_DISABLED)) {
                                data->postbut = but;
                                data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
@@ -2345,7 +2244,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
 
                        /* exception that's useful for number buttons, some keyboard
                         * numpads have a comma instead of a period */
-                       if (ELEM3(but->type, NUM, NUMABS, NUMSLI)) { /* could use data->min*/
+                       if (ELEM(but->type, NUM, NUMSLI)) { /* could use data->min*/
                                if (event->type == PADPERIOD && ascii == ',') {
                                        ascii = '.';
                                        utf8_buf = NULL; /* force ascii fallback */
@@ -2517,14 +2416,6 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
                                menustr = but->str;
                        }
                        break;
-               case ICONROW:
-                       menufunc = ui_block_func_ICONROW;
-                       arg = but;
-                       break;
-               case ICONTEXTROW:
-                       menufunc = ui_block_func_ICONTEXTROW;
-                       arg = but;
-                       break;
                case COLOR:
                        ui_get_but_vectorf(but, data->origvec);
                        copy_v3_v3(data->vec, data->origvec);
@@ -3530,7 +3421,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, co
                        button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) {
+               else if (but->type == MENU) {
                        if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
                                const int direction = (event->type == WHEELDOWNMOUSE) ? -1 : 1;
 
@@ -4793,112 +4684,6 @@ static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHand
        return WM_UI_HANDLER_CONTINUE;
 }
 
-#ifdef WITH_INTERNATIONAL
-static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut *UNUSED(but), uiHandleButtonData *UNUSED(data), const wmEvent *UNUSED(event))
-{
-       /* XXX 2.50 bad global and state access */
-#if 0
-       float sx, sy, ex, ey;
-       float width, height;
-       float butw, buth;
-       int mx, my, x, y, cs, che;
-
-       mx = event->x;
-       my = event->y;
-       ui_window_to_block(data->region, block, &mx, &my);
-
-       if (data->state == BUTTON_STATE_HIGHLIGHT) {
-               if (ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
-                       /* Calculate the size of the button */
-                       width  = abs(BLI_rctf_size_x(&but->rect));
-                       height = abs(BLI_rctf_size_y(&but->rect));
-
-                       butw = floor(width / 12);
-                       buth = floor(height / 6);
-
-                       /* Initialize variables */
-                       sx = but->rect.xmin;
-                       ex = but->rect.xmin + butw;
-                       sy = but->rect.ymin + height - buth;
-                       ey = but->rect.ymin + height;
-
-                       cs = G.charstart;
-
-                       /* And the character is */
-                       x = (int) ((mx / butw) - 0.5);
-                       y = (int) (6 - ((my / buth) - 0.5));
-
-                       che = cs + (y * 12) + x;
-
-                       if (che > G.charmax)
-                               che = 0;
-
-                       if (G.obedit) {
-                               do_textedit(0, 0, che);
-                       }
-
-                       button_activate_state(C, but, BUTTON_STATE_EXIT);
-                       return WM_UI_HANDLER_BREAK;
-               }
-               else if (ELEM(event->type, WHEELUPMOUSE, PAGEUPKEY)) {
-                       for (but = block->buttons.first; but; but = but->next) {
-                               if (but->type == CHARTAB) {
-                                       G.charstart = G.charstart - (12 * 6);
-                                       if (G.charstart < 0)
-                                               G.charstart = 0;
-                                       if (G.charstart < G.charmin)
-                                               G.charstart = G.charmin;
-                                       ui_draw_but(but);
-
-                                       //Really nasty... to update the num button from the same butblock
-                                       for (bt = block->buttons.first; bt; bt = bt->next)
-                                       {
-                                               if (ELEM(bt->type, NUM, NUMABS)) {
-                                                       ui_check_but(bt);
-                                                       ui_draw_but(bt);
-                                               }
-                                       }
-                                       retval = UI_CONT;
-                                       break;
-                               }
-                       }
-
-                       return WM_UI_HANDLER_BREAK;
-               }
-               else if (ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) {
-                       for (but = block->buttons.first; but; but = but->next) {
-                               if (but->type == CHARTAB) {
-                                       G.charstart = G.charstart + (12 * 6);
-                                       if (G.charstart > (0xffff - 12 * 6))
-                                               G.charstart = 0xffff - (12 * 6);
-                                       if (G.charstart > G.charmax - 12 * 6)
-                                               G.charstart = G.charmax - 12 * 6;
-                                       ui_draw_but(but);
-
-                                       for (bt = block->buttons.first; bt; bt = bt->next)
-                                       {
-                                               if (ELEM(bt->type, NUM, NUMABS)) {
-                                                       ui_check_but(bt);
-                                                       ui_draw_but(bt);
-                                               }
-                                       }
-                                       
-                                       but->flag |= UI_ACTIVE;
-                                       retval = UI_RETURN_OK;
-                                       break;
-                               }
-                       }
-
-                       return WM_UI_HANDLER_BREAK;
-               }
-       }
-#endif
-
-       return WM_UI_HANDLER_CONTINUE;
-}
-#endif
-
-
 static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
 {      
        VECCOPY2D(but->linkto, event->mval);
@@ -5552,11 +5337,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                        break;
                case TOGBUT:
                case TOG:
-               case TOGR:
                case ICONTOG:
                case ICONTOGN:
                case TOGN:
-               case BUT_TOGDUAL:
                case OPTION:
                case OPTIONN:
                        retval = ui_do_but_TOG(C, but, data, event);
@@ -5565,17 +5348,14 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                        retval = ui_do_but_SCROLL(C, block, but, data, event);
                        break;
                case NUM:
-               case NUMABS:
                        retval = ui_do_but_NUM(C, block, but, data, event);
                        break;
-               case SLI:
                case NUMSLI:
                        retval = ui_do_but_SLI(C, block, but, data, event);
                        break;
                case ROUNDBOX:
                case LISTBOX:
                case LABEL:
-               case TOG3:
                case ROW:
                case LISTROW:
                case BUT_IMAGE:
@@ -5593,7 +5373,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                        retval = ui_do_but_VECTORSCOPE(C, block, but, data, event);
                        break;
                case TEX:
-               case IDPOIN:
                case SEARCH_MENU:
                        retval = ui_do_but_TEX(C, block, but, data, event);
                        break;
@@ -5601,8 +5380,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                        retval = ui_do_but_SEARCH_UNLINK(C, block, but, data, event);
                        break;
                case MENU:
-               case ICONROW:
-               case ICONTEXTROW:
                case BLOCK:
                case PULLDOWN:
                        retval = ui_do_but_BLOCK(C, but, data, event);
@@ -5631,16 +5408,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                case HSVCIRCLE:
                        retval = ui_do_but_HSVCIRCLE(C, block, but, data, event);
                        break;
-#ifdef WITH_INTERNATIONAL
-               case CHARTAB:
-                       retval = ui_do_but_CHARTAB(C, block, but, data, event);
-                       break;
-#else
-                       /* do nothing */
-               case CHARTAB:
-                       break;
-#endif
-
                case LINK:
                case INLINK:
                        retval = ui_do_but_LINK(C, but, data, event);
@@ -5713,7 +5480,7 @@ int UI_but_active_drop_name(bContext *C)
        uiBut *but = ui_but_find_activated(ar);
 
        if (but) {
-               if (ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK))
+               if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK))
                        return 1;
        }
        
@@ -5923,7 +5690,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
                button_tooltip_timer_reset(C, but);
 
                /* automatic open pulldown block timer */
-               if (ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) {
+               if (ELEM(but->type, BLOCK, PULLDOWN)) {
                        if (data->used_mouse && !data->autoopentimer) {
                                int time;
 
@@ -6733,7 +6500,7 @@ static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, u
        if ((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_UPDATE)) {
                if (but->type == COLOR)
                        copy_v3_v3(data->vec, menu->retvec);
-               else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+               else if (but->type == MENU)
                        data->value = menu->retvalue;
        }
 
@@ -7207,11 +6974,6 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
                                                                                doit = TRUE;
                                                                }
                                                        }
-                                                       /* exception for menus like layer buts, with button aligning they're not drawn in order */
-                                                       else if (but->type == TOGR) {
-                                                               if (but->bitnr == act - 1)
-                                                                       doit = TRUE;
-                                                       }
                                                        else if (count == act) {
                                                                doit = TRUE;
                                                        }
index 5621aa2d0cccdc4a22b6b768287f755d553f6894..14a4d42946ca538e606804002e4fb1bbf3dac5f1 100644 (file)
@@ -230,10 +230,6 @@ struct uiBut {
        short modifier_key;
        short iconadd;
 
-       /* IDPOIN data */
-       uiIDPoinFuncFP idpoin_func;
-       ID **idpoin_idpp;
-
        /* BLOCK data */
        uiBlockCreateFunc block_create_func;
 
@@ -460,8 +456,6 @@ struct uiPopupBlockHandle {
 };
 
 uiBlock *ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
-void ui_block_func_ICONROW(struct bContext *C, uiLayout *layout, void *arg_but);
-void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_but);
 
 struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
 void ui_tooltip_free(struct bContext *C, struct ARegion *ar);
index 76e523f13299f0d1e4286625010b68b72c329960..8621a61a2d102161d04874d54a597ce0779f3b22 100644 (file)
@@ -481,7 +481,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
                data->totline++;
        }
 
-       if (ELEM4(but->type, TEX, IDPOIN, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+       if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                /* full string */
                ui_get_but_string(but, buf, sizeof(buf));
                if (buf[0]) {
@@ -1768,18 +1768,34 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
        const char *instr = arg_str;
        int columns, rows, a, b;
        int column_start = 0, column_end = 0;
+       int nbr_entries_nosepr = 0;
 
        uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
        
        /* compute menu data */
        md = decompose_menu_string(instr);
 
-       /* columns and row estimation */
-       columns = (md->nitems + 20) / 20;
+       /* Run some "tweaking" checks. */
+       entry = md->items;
+       for (a = 0; a < md->nitems; a++, entry++) {
+               if (entry->sepr) {
+                       /* inconsistent, but menus with labels do not look good flipped */
+                       if (entry->str[0]) {
+                               block->flag |= UI_BLOCK_NO_FLIP;
+                               nbr_entries_nosepr++;
+                       }
+                       /* We do not want simple separators in nbr_entries_nosepr count */
+                       continue;
+               }
+               nbr_entries_nosepr++;
+       }
+
+       /* Columns and row estimation. Ignore simple separators here. */
+       columns = (nbr_entries_nosepr + 20) / 20;
        if (columns < 1)
                columns = 1;
        if (columns > 8)
-               columns = (md->nitems + 25) / 25;
+               columns = (nbr_entries_nosepr + 25) / 25;
 
        rows = md->nitems / columns;
        if (rows < 1)
@@ -1799,15 +1815,6 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
                }
        }
 
-       /* inconsistent, but menus with labels do not look good flipped */
-       entry = md->items;
-       for (a = 0; a < md->nitems; a++, entry++) {
-               if (entry->sepr && entry->str[0]) {
-                       block->flag |= UI_BLOCK_NO_FLIP;
-                       break;
-               }
-       }
-
        /* create items */
        split = uiLayoutSplit(layout, 0.0f, FALSE);
 
@@ -1837,9 +1844,14 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
                        entry = &md->items[column_start + column_end - 1 - a];
 
                if (entry->sepr) {
-                       uiItemL(column, entry->str, entry->icon);
-                       bt = block->buttons.last;
-                       bt->flag = UI_TEXT_LEFT;
+                       if (entry->str[0]) {
+                               uiItemL(column, entry->str, entry->icon);
+                               bt = block->buttons.last;
+                               bt->flag = UI_TEXT_LEFT;
+                       }
+                       else {
+                               uiItemS(column);
+                       }
                }
                else if (entry->icon) {
                        uiDefIconTextButF(block, BUTM, B_NOP, entry->icon, entry->str, 0, 0,
@@ -1854,53 +1866,6 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
        menudata_free(md);
 }
 
-void ui_block_func_ICONROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but)
-{
-       uiBlock *block = uiLayoutGetBlock(layout);
-       uiPopupBlockHandle *handle = block->handle;
-       uiBut *but = arg_but;
-       int a;
-       
-       uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
-       
-       for (a = (int)but->hardmin; a <= (int)but->hardmax; a++)
-               uiDefIconButF(block, BUTM, B_NOP, but->icon + (a - but->hardmin), 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
-                             &handle->retvalue, (float)a, 0.0, 0, -1, "");
-}
-
-void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but)
-{
-       uiBlock *block = uiLayoutGetBlock(layout);
-       uiPopupBlockHandle *handle = block->handle;
-       uiBut *but = arg_but, *bt;
-       MenuData *md;
-       MenuEntry *entry;
-       int a;
-       
-       uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
-
-       md = decompose_menu_string(but->str);
-
-       /* title */
-       if (md->title) {
-               bt = uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
-               bt->flag = UI_TEXT_LEFT;
-       }
-
-       /* loop through the menu options and draw them out with icons & text labels */
-       for (a = 0; a < md->nitems; a++) {
-               entry = &md->items[md->nitems - a - 1];
-
-               if (entry->sepr)
-                       uiItemS(layout);
-               else
-                       uiDefIconTextButF(block, BUTM, B_NOP, (short)((but->icon) + (entry->retval - but->hardmin)), entry->str,
-                                         0, 0, UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, -1, "");
-       }
-
-       menudata_free(md);
-}
-
 #if 0
 static void ui_warp_pointer(int x, int y)
 {
index 3bf1a1a770175580a9fc1d618a7adec563819e34..7da12277372edc811f606b22e3b9b03aa085c2f1 100644 (file)
@@ -113,7 +113,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
                        if (icon == ICON_DOT)
                                icon = 0;
 
-                       but = uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+                       but = uiDefIconTextButR_prop(block, SEARCH_MENU, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
                        break;
                }
                case PROP_COLLECTION:
index c8062cd3ed27c339ed081a58a2ac94083fd67148..00eabad729ea176bdc0575a64ee50e8e12de1c44 100644 (file)
@@ -891,23 +891,12 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, const rcti
                float ofs = 1.0f / aspect;
                
                if (but->flag & UI_ICON_LEFT) {
-                       if (but->type == BUT_TOGDUAL) {
-                               if (but->drawstr[0]) {
-                                       xs = rect->xmin - ofs;
-                               }
-                               else {
-                                       xs = (rect->xmin + rect->xmax - height) / 2.0f;
-                               }
-                       }
-                       else if (but->block->flag & UI_BLOCK_LOOP) {
+                       if (but->block->flag & UI_BLOCK_LOOP) {
                                if (ELEM(but->type, SEARCH_MENU, SEARCH_MENU_UNLINK))
                                        xs = rect->xmin + 4.0f * ofs;
                                else
                                        xs = rect->xmin + ofs;
                        }
-                       else if ((but->type == ICONROW) || (but->type == ICONTEXTROW)) {
-                               xs = rect->xmin + 3.0f * ofs;
-                       }
                        else {
                                xs = rect->xmin + 4.0f * ofs;
                        }
@@ -1220,13 +1209,12 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
 
 #if 0
        ui_rasterpos_safe(x, y, but->aspect);
-       if (but->type == IDPOIN) transopts = 0;  /* no translation, of course! */
-       else transopts = ui_translate_buttons();
+       transopts = ui_translate_buttons();
 #endif
 
        /* cut string in 2 parts - only for menu entries */
        if ((but->block->flag & UI_BLOCK_LOOP)) {
-               if (ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS) == 0) {
+               if (ELEM3(but->type, NUM, TEX, NUMSLI) == 0) {
                        cpoin = strchr(but->drawstr, '|');
                        if (cpoin) *cpoin = 0;
                }
@@ -1292,7 +1280,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
        if (but->editstr && but->pos >= 0) {
                ui_text_clip_cursor(fstyle, but, rect);
        }
-       else if (ELEM4(but->type, NUM, NUMABS, NUMSLI, SLI)) {
+       else if (ELEM(but->type, NUM, NUMSLI)) {
                ui_text_clip_right_label(fstyle, but, rect);
        }
        else if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
@@ -1306,65 +1294,47 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
        }
 
        /* check for button text label */
-       if (but->type == ICONTEXTROW) {
-               widget_draw_icon(but, (BIFIconID) (but->icon + but->iconadd), 1.0f, rect);
+       if (but->type == MENU && (but->flag & UI_BUT_NODE_LINK)) {
+               int tmp = rect->xmin;
+               rect->xmin = rect->xmax - BLI_rcti_size_y(rect) - 1;
+               widget_draw_icon(but, ICON_LAYER_USED, alpha, rect);
+               rect->xmin = tmp;
        }
-       else {
 
-               if (but->type == BUT_TOGDUAL) {
-                       int dualset = 0;
-                       if (but->pointype == UI_BUT_POIN_SHORT) {
-                               dualset = UI_BITBUT_TEST(*(((short *)but->poin) + 1), but->bitnr);
-                       }
-                       else if (but->pointype == UI_BUT_POIN_INT) {
-                               dualset = UI_BITBUT_TEST(*(((int *)but->poin) + 1), but->bitnr);
-                       }
-
-                       widget_draw_icon(but, ICON_DOT, dualset ? alpha : 0.25f, rect);
-               }
-               else if (but->type == MENU && (but->flag & UI_BUT_NODE_LINK)) {
-                       int tmp = rect->xmin;
-                       rect->xmin = rect->xmax - BLI_rcti_size_y(rect) - 1;
-                       widget_draw_icon(but, ICON_LAYER_USED, alpha, rect);
-                       rect->xmin = tmp;
-               }
-
-               /* If there's an icon too (made with uiDefIconTextBut) then draw the icon
-                * and offset the text label to accommodate it */
+       /* If there's an icon too (made with uiDefIconTextBut) then draw the icon
+        * and offset the text label to accommodate it */
 
-               if (but->flag & UI_HAS_ICON) {
-                       widget_draw_icon(but, but->icon + but->iconadd, alpha, rect);
-                       
-                       /* icons default draw 0.8f x height */
-                       rect->xmin += (int)(0.8f * BLI_rcti_size_y(rect));
+       if (but->flag & UI_HAS_ICON) {
+               widget_draw_icon(but, but->icon + but->iconadd, alpha, rect);
+               
+               /* icons default draw 0.8f x height */
+               rect->xmin += (int)(0.8f * BLI_rcti_size_y(rect));
 
-                       if (but->editstr || (but->flag & UI_TEXT_LEFT)) {
-                               rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
-                       }
-                       else if ((but->flag & UI_TEXT_RIGHT)) {
-                               rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
-                       }
-               }
-               else if ((but->flag & UI_TEXT_LEFT)) {
+               if (but->editstr || (but->flag & UI_TEXT_LEFT)) {
                        rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
                }
                else if ((but->flag & UI_TEXT_RIGHT)) {
                        rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
                }
-               
-               /* unlink icon for this button type */
-               if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
-                       rcti temp = *rect;
-
-                       temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);
-                       widget_draw_icon(but, ICON_X, alpha, &temp);
-               }
-
-               /* always draw text for textbutton cursor */
-               widget_draw_text(fstyle, wcol, but, rect);
+       }
+       else if ((but->flag & UI_TEXT_LEFT)) {
+               rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
+       }
+       else if ((but->flag & UI_TEXT_RIGHT)) {
+               rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
+       }
+       
+       /* unlink icon for this button type */
+       if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
+               rcti temp = *rect;
 
+               temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);
+               widget_draw_icon(but, ICON_X, alpha, &temp);
        }
 
+       /* always draw text for textbutton cursor */
+       widget_draw_text(fstyle, wcol, but, rect);
+
        ui_button_text_password_hide(password_str, but, TRUE);
 }
 
@@ -3279,7 +3249,6 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
                        case TOGBUT:
                        case TOG:
                        case TOGN:
-                       case TOG3:
                                wt = widget_type(UI_WTYPE_TOGGLE);
                                break;
                                
@@ -3300,7 +3269,6 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
                                
                        case MENU:
                        case BLOCK:
-                       case ICONTEXTROW:
                                /* new node-link button, not active yet XXX */
                                if (but->flag & UI_BUT_NODE_LINK)
                                        wt = widget_type(UI_WTYPE_MENU_NODE_LINK);
index a7afa3f108bcbcfafad4de834e3d2472a4a0b3dd..234a45856d26542507f37952aad6c8f1361b74aa 100644 (file)
@@ -395,79 +395,6 @@ bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
        return ok;
 }
 
-/* *************************************** */
-#if 0
-static void seam_edgehash_insert_face(EdgeHash *ehash, MPoly *mp, MLoop *loopstart)
-{
-       MLoop *ml1, *ml2;
-       int a;
-
-       for (a = 0; a < mp->totloop; a++) {
-               ml1 = loopstart + a;
-               ml2 = loopstart + (a + 1) % mp->totloop;
-
-               BLI_edgehash_insert(ehash, ml1->v, ml2->v, NULL);
-       }
-}
-
-void seam_mark_clear_tface(Scene *scene, short mode)
-{
-       Mesh *me;
-       MPoly *mp;
-       MLoop *ml1, *ml2;
-       MEdge *med;
-       int a, b;
-       
-       me = BKE_mesh_from_object(OBACT);
-       if (me == 0 ||  me->totpoly == 0) return;
-
-       if (mode == 0)
-               mode = pupmenu(IFACE_("Seams %t|Mark Border Seam %x1|Clear Seam %x2"));
-
-       if (mode != 1 && mode != 2)
-               return;
-
-       if (mode == 2) {
-               EdgeHash *ehash = BLI_edgehash_new();
-
-               for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++)
-                       if (!(mp->flag & ME_HIDE) && (mp->flag & ME_FACE_SEL))
-                               seam_edgehash_insert_face(ehash, mp, me->mloop + mp->loopstart);
-
-               for (a = 0, med = me->medge; a < me->totedge; a++, med++)
-                       if (BLI_edgehash_haskey(ehash, med->v1, med->v2))
-                               med->flag &= ~ME_SEAM;
-
-               BLI_edgehash_free(ehash, NULL);
-       }
-       else {
-               /* mark edges that are on both selected and deselected faces */
-               EdgeHash *ehash1 = BLI_edgehash_new();
-               EdgeHash *ehash2 = BLI_edgehash_new();
-
-               for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++) {
-                       if ((mp->flag & ME_HIDE) || !(mp->flag & ME_FACE_SEL))
-                               seam_edgehash_insert_face(ehash1, mp, me->mloop + mp->loopstart);
-                       else
-                               seam_edgehash_insert_face(ehash2, mp, me->mloop + mp->loopstart);
-               }
-
-               for (a = 0, med = me->medge; a < me->totedge; a++, med++)
-                       if (BLI_edgehash_haskey(ehash1, med->v1, med->v2) &&
-                           BLI_edgehash_haskey(ehash2, med->v1, med->v2))
-                               med->flag |= ME_SEAM;
-
-               BLI_edgehash_free(ehash1, NULL);
-               BLI_edgehash_free(ehash2, NULL);
-       }
-
-// XXX if (G.debug_value == 8)
-//             unwrap_lscm(1);
-
-       me->drawflag |= ME_DRAWSEAMS;
-}
-#endif
-
 bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        Mesh *me;
index c1017dfce7cf92021d616e47f3b1a5643c6ed598..cccf08cfe1aadf333587b4c7ca3e001a6d99f2a3 100644 (file)
@@ -329,36 +329,27 @@ static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
 
        zero_v3(nor);
 
-       /* XXX If those popup menus were to be enabled again, please get rid of this "menu string" syntax! */
        if (em->selectmode & SCE_SELECT_VERTEX) {
                if (em->bm->totvertsel == 0) nr = 0;
                else if (em->bm->totvertsel == 1) nr = 4;
                else if (em->bm->totedgesel == 0) nr = 4;
                else if (em->bm->totfacesel == 0)
-                       nr = 3;  /* pupmenu("Extrude %t|Only Edges %x3|Only Vertices %x4"); */
+                       nr = 3;
                else if (em->bm->totfacesel == 1)
-                       nr = 1;  /* pupmenu("Extrude %t|Region %x1|Only Edges% x3|Only Vertices %x4"); */
+                       nr = 1;
                else
-                       nr = 1;  /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2|Only Edges %x3|Only Vertices %x4"); */
+                       nr = 1;
        }
        else if (em->selectmode & SCE_SELECT_EDGE) {
                if (em->bm->totedgesel == 0) nr = 0;
                
                nr = 1;
-#if 0
-               else if (em->totedgesel == 1) nr = 3;
-               else if (em->totfacesel == 0) nr = 3;
-               else if (em->totfacesel == 1)
-                       nr = 1;  /* pupmenu("Extrude %t|Region %x1|Only Edges %x3"); */
-               else
-                       nr = 1;  /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2|Only Edges %x3"); */
-#endif
        }
        else {
                if (em->bm->totfacesel == 0) nr = 0;
                else if (em->bm->totfacesel == 1) nr = 1;
                else
-                       nr = 1;  /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2"); */
+                       nr = 1;
        }
 
        if (nr < 1) return 'g';
index 9196fdc19808a49871694a200d0195179e989d18..69c1d2cf16916e77bb290454face5f70f2593454 100644 (file)
@@ -46,6 +46,9 @@
 #include "BKE_global.h"
 #include "BKE_screen.h"
 
+#include "RNA_access.h"
+#include "RNA_types.h"
+
 #include "WM_api.h"
 #include "WM_types.h"
 #include "wm_subwindow.h"
@@ -1494,71 +1497,19 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
        WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
 }
 
-static const char *editortype_pup(void)
-{
-       const char *types = N_(
-           "Editor type: %t"
-           "|3D View %x1"
-
-           "|%l"
-
-           "|Timeline %x15"
-           "|Graph Editor %x2"
-           "|Dope Sheet %x12"
-           "|NLA Editor %x13"
-
-           "|%l"
-
-           "|UV/Image Editor %x6"
-
-           "|Video Sequence Editor %x8"
-           "|Movie Clip Editor %x20"
-           "|Text Editor %x9"
-           "|Node Editor %x16"
-           "|Logic Editor %x17"
-
-           "|%l"
-
-           "|Properties %x4"
-           "|Outliner %x3"
-           "|User Preferences %x19"
-           "|Info %x7"
-
-           "|%l"
-
-           "|File Browser %x5"
-
-           "|%l"
-
-           "|Python Console %x18"
-           );
-
-       return IFACE_(types);
-}
-
-static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
-{
-       ED_area_newspace(C, CTX_wm_area(C), CTX_wm_area(C)->butspacetype);
-       ED_area_tag_redraw(CTX_wm_area(C));
-
-       /* send space change notifier */
-       WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, CTX_wm_area(C));
-}
-
 /* returns offset for next button in header */
 int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
 {
        ScrArea *sa = CTX_wm_area(C);
-       uiBut *but;
+       bScreen *scr = CTX_wm_screen(C);
+       PointerRNA areaptr;
        int xco = 0.4 * U.widget_unit;
-       
-       but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, 
-                               editortype_pup(), xco, yco, 1.5 * U.widget_unit, U.widget_unit,
-                               &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
-                               TIP_("Display current editor type (click for a menu of available types)"));
-       uiButSetFunc(but, spacefunc, NULL, NULL);
-       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
-       
+
+       RNA_pointer_create(&(scr->id), &RNA_Area, sa, &areaptr);
+
+       uiDefButR(block, MENU, 0, NULL, xco, yco, 1.5 * U.widget_unit, U.widget_unit,
+                 &areaptr, "type", 0, 0.0f, 0.0f, 0.0f, 0.0f, "");
+
        return xco + 1.7 * U.widget_unit;
 }
 
index 32e388598f5751b9dca213653d025ba232cd4e86..7db522d7f5ed533b16f291fc84febc0a76f390da 100644 (file)
@@ -105,6 +105,7 @@ static int rna_Screen_fullscreen_get(PointerRNA *ptr)
        return (sc->full != 0);
 }
 
+
 static void rna_Area_type_set(PointerRNA *ptr, int value)
 {
        ScrArea *sa = (ScrArea *)ptr->data;
@@ -204,8 +205,9 @@ static void rna_def_area(BlenderRNA *brna)
        RNA_def_property_enum_sdna(prop, NULL, "spacetype");
        RNA_def_property_enum_items(prop, space_type_items);
        RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
-       RNA_def_property_ui_text(prop, "Type", "Space type");
+       RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area");
        RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
        RNA_def_property_update(prop, 0, "rna_Area_type_update");
 
        prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
index 114773a0c1302ced2d339e952019d6e09f1b7896..7bc42700d2b3315dfe7e3afd6adba89cf9e9bc93 100644 (file)
 
 #include "RNA_enum_types.h"
 
+
 EnumPropertyItem space_type_items[] = {
-       {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
-       {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
-       {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
-       {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
-       {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
-       {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
-       {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
-       {SPACE_INFO, "INFO", 0, "Info", ""},
-       {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
-       {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
-       {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "Dope Sheet Editor", ""},
-       {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
-       {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
-       {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
-       {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
-       {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""},
-       {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
-       {SPACE_CLIP, "CLIP_EDITOR", 0, "Clip Editor", ""},
+       {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
+       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_TIME, "TIMELINE", ICON_TIME, "Timeline", ""},
+       {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
+       {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", ""},
+       {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
+       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
+       {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
+       {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
+       {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
+       {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
+       {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
+       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", ""},
+       {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", ""},
+       {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
+       {SPACE_INFO, "INFO", ICON_INFO, "Info", ""},
+       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
+       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
        {0, NULL, 0, NULL, NULL}
 };