Code cleanup: removed unused B_BUTSPREVIEW event, and moved back rna_SpaceProperties_texture_context_itemf() together with its fellow functions.

This commit is contained in:
Bastien Montagne 2013-06-14 15:48:03 +00:00
parent afc3d10d1a
commit aa8f621dd9
2 changed files with 31 additions and 33 deletions

@ -58,7 +58,6 @@
#define B_CONTEXT_SWITCH 101
#define B_BUTSPREVIEW 102
static void set_texture_context(const bContext *C, SpaceButs *sbuts)
{
@ -95,7 +94,6 @@ static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event)
switch (event) {
case B_CONTEXT_SWITCH:
case B_BUTSPREVIEW:
ED_area_tag_redraw(CTX_wm_area(C));
set_texture_context(C, sbuts);

@ -839,6 +839,37 @@ static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
sbuts->re_align = 1;
}
static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *free)
{
EnumPropertyItem *item = NULL;
int totitem = 0;
if (ED_texture_context_check_world(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_WORLD);
}
if (ED_texture_context_check_lamp(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LAMP);
}
else if (ED_texture_context_check_material(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_MATERIAL);
}
if (ED_texture_context_check_particles(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_PARTICLES);
}
if (ED_texture_context_check_others(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_OTHER);
}
RNA_enum_item_end(&item, &totitem);
*free = 1;
return item;
}
/* Space Console */
static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
{
@ -1129,37 +1160,6 @@ void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
ED_node_tree_update(C);
}
static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *free)
{
EnumPropertyItem *item = NULL;
int totitem = 0;
if (ED_texture_context_check_world(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_WORLD);
}
if (ED_texture_context_check_lamp(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LAMP);
}
else if (ED_texture_context_check_material(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_MATERIAL);
}
if (ED_texture_context_check_particles(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_PARTICLES);
}
if (ED_texture_context_check_others(C)) {
RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_OTHER);
}
RNA_enum_item_end(&item, &totitem);
*free = 1;
return item;
}
static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
{
SpaceClip *sc = (SpaceClip *)(ptr->data);