Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

interface_templates.c File Reference

#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_key_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
#include "BLI_ghash.h"
#include "BLF_translation.h"
#include "BKE_animsys.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_dynamicpaint.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_material.h"
#include "BKE_texture.h"
#include "BKE_report.h"
#include "BKE_displist.h"
#include "BKE_scene.h"
#include "ED_screen.h"
#include "ED_object.h"
#include "ED_render.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "interface_intern.h"
#include "BLF_api.h"
#include "DNA_object_force.h"
#include "BKE_depsgraph.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "ED_util.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
#include "DNA_constraint_types.h"
#include "BKE_action.h"
#include "BKE_constraint.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_world_types.h"

Go to the source code of this file.

Classes

struct  TemplateID
struct  RNAUpdateCb

Defines

#define ERROR_LIBDATA_MESSAGE   "Can't edit external libdata"
#define REDRAWIPO   1
#define REDRAWNLA   2
#define REDRAWBUTSOBJECT   3
#define REDRAWACTION   4
#define B_CONSTRAINT_TEST   5
#define B_CONSTRAINT_CHANGETARGET   6
#define REMAKEIPO   8
#define B_DIFF   9
#define B_MATPRV   1
#define B_BANDCOL   1
#define WHEEL_SIZE   100
#define B_STOPRENDER   1
#define B_STOPCAST   2
#define B_STOPANIM   3
#define B_STOPCOMPO   4
#define B_STOPSEQ   5
#define B_STOPCLIP   6

Typedefs

typedef struct TemplateID TemplateID
typedef struct RNAUpdateCb RNAUpdateCb

Functions

void UI_template_fix_linking (void)
void uiTemplateHeader (uiLayout *layout, bContext *C, int menus)
static void id_search_call_cb (bContext *C, void *arg_template, void *item)
static void id_search_cb (const bContext *C, void *arg_template, const char *str, uiSearchItems *items)
static uiBlockid_search_menu (bContext *C, ARegion *ar, void *arg_litem)
void uiIDContextProperty (bContext *C, PointerRNA *ptr, PropertyRNA **prop)
static void template_id_cb (bContext *C, void *arg_litem, void *arg_event)
static const char * template_id_browse_tip (StructRNA *type)
static void template_ID (bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, short idcode, int flag, const char *newop, const char *openop, const char *unlinkop)
static void ui_template_id (uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int flag, int prv_rows, int prv_cols)
void uiTemplateID (uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
void uiTemplateIDBrowse (uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
void uiTemplateIDPreview (uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int rows, int cols)
void uiTemplateAnyID (uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename, const char *text)
void uiTemplatePathBuilder (uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *UNUSED(root_ptr), const char *text)
static void modifiers_setOnCage (bContext *C, void *ob_v, void *md_v)
static void modifiers_convertToReal (bContext *C, void *ob_v, void *md_v)
static int modifier_can_delete (ModifierData *md)
static int modifier_is_simulation (ModifierData *md)
static uiLayoutdraw_modifier (uiLayout *layout, Scene *scene, Object *ob, ModifierData *md, int index, int cageIndex, int lastCageIndex)
uiLayoutuiTemplateModifier (uiLayout *layout, bContext *C, PointerRNA *ptr)
static void do_constraint_panels (bContext *C, void *ob_pt, int event)
static void constraint_active_func (bContext *UNUSED(C), void *ob_v, void *con_v)
static uiLayoutdraw_constraint (uiLayout *layout, Object *ob, bConstraint *con)
uiLayoutuiTemplateConstraint (uiLayout *layout, PointerRNA *ptr)
static void do_preview_buttons (bContext *C, void *arg, int event)
void uiTemplatePreview (uiLayout *layout, ID *id, int show_buttons, ID *parent, MTex *slot)
static void rna_update_cb (bContext *C, void *arg_cb, void *UNUSED(arg))
static void colorband_add_cb (bContext *C, void *cb_v, void *coba_v)
static void colorband_del_cb (bContext *C, void *cb_v, void *coba_v)
static void colorband_flip_cb (bContext *C, void *cb_v, void *coba_v)
static void colorband_buttons_large (uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
static void colorband_buttons_small (uiLayout *layout, uiBlock *block, ColorBand *coba, rctf *butr, RNAUpdateCb *cb)
static void colorband_buttons_layout (uiLayout *layout, uiBlock *block, ColorBand *coba, rctf *butr, int small, RNAUpdateCb *cb)
void uiTemplateColorRamp (uiLayout *layout, PointerRNA *ptr, const char *propname, int expand)
void uiTemplateHistogram (uiLayout *layout, PointerRNA *ptr, const char *propname)
void uiTemplateWaveform (uiLayout *layout, PointerRNA *ptr, const char *propname)
void uiTemplateVectorscope (uiLayout *layout, PointerRNA *ptr, const char *propname)
static void curvemap_buttons_zoom_in (bContext *C, void *cumap_v, void *UNUSED(arg))
static void curvemap_buttons_zoom_out (bContext *C, void *cumap_v, void *UNUSED(unused))
static void curvemap_buttons_setclip (bContext *UNUSED(C), void *cumap_v, void *UNUSED(arg))
static void curvemap_buttons_delete (bContext *C, void *cb_v, void *cumap_v)
static uiBlockcurvemap_clipping_func (bContext *C, struct ARegion *ar, void *cumap_v)
static void curvemap_tools_dofunc (bContext *C, void *cumap_v, int event)
static uiBlockcurvemap_tools_func (bContext *C, struct ARegion *ar, void *cumap_v)
static uiBlockcurvemap_brush_tools_func (bContext *C, struct ARegion *ar, void *cumap_v)
static void curvemap_buttons_redraw (bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
static void curvemap_buttons_reset (bContext *C, void *cb_v, void *cumap_v)
static void curvemap_buttons_layout (uiLayout *layout, PointerRNA *ptr, char labeltype, int levels, int brush, RNAUpdateCb *cb)
void uiTemplateCurveMapping (uiLayout *layout, PointerRNA *ptr, const char *propname, int type, int levels, int brush)
void uiTemplateColorWheel (uiLayout *layout, PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic)
static void handle_layer_buttons (bContext *C, void *arg1, void *arg2)
void uiTemplateLayers (uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *used_ptr, const char *used_propname, int active_layer)
static int list_item_icon_get (bContext *C, PointerRNA *itemptr, int rnaicon, int big)
static void list_item_row (bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop, const char *prop_list_id)
void uiTemplateList (uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, const char *prop_list, int rows, int maxrows, int listtype)
static void operator_call_cb (bContext *C, void *UNUSED(arg1), void *arg2)
static void operator_search_cb (const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
void uiTemplateOperatorSearch (uiLayout *layout)
static void do_running_jobs (bContext *C, void *UNUSED(arg), int event)
void uiTemplateRunningJobs (uiLayout *layout, bContext *C)
void uiTemplateReportsBanner (uiLayout *layout, bContext *C)
static void keymap_item_modified (bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
static void template_keymap_item_properties (uiLayout *layout, const char *title, PointerRNA *ptr)
void uiTemplateKeymapItemProperties (uiLayout *layout, PointerRNA *ptr)

Detailed Description

Definition in file interface_templates.c.


Define Documentation

#define B_BANDCOL   1

Definition at line 1257 of file interface_templates.c.

#define B_CONSTRAINT_CHANGETARGET   6

Definition at line 929 of file interface_templates.c.

Referenced by do_constraint_panels().

#define B_CONSTRAINT_TEST   5

Definition at line 928 of file interface_templates.c.

Referenced by do_constraint_panels(), and draw_constraint().

#define B_DIFF   9

Definition at line 931 of file interface_templates.c.

#define B_MATPRV   1

Definition at line 1144 of file interface_templates.c.

Referenced by do_preview_buttons(), and uiTemplatePreview().

#define B_STOPANIM   3

Definition at line 2510 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define B_STOPCAST   2

Definition at line 2509 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define B_STOPCLIP   6

Definition at line 2513 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define B_STOPCOMPO   4

Definition at line 2511 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define B_STOPRENDER   1

Definition at line 2508 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define B_STOPSEQ   5

Definition at line 2512 of file interface_templates.c.

Referenced by do_running_jobs(), and uiTemplateRunningJobs().

#define ERROR_LIBDATA_MESSAGE   "Can't edit external libdata"

Definition at line 623 of file interface_templates.c.

Referenced by draw_modifier(), uiTemplateConstraint(), and uiTemplateModifier().

#define REDRAWACTION   4

Definition at line 927 of file interface_templates.c.

Referenced by viewRedrawPost().

#define REDRAWBUTSOBJECT   3

Definition at line 926 of file interface_templates.c.

Referenced by viewRedrawPost().

#define REDRAWIPO   1

Definition at line 924 of file interface_templates.c.

Referenced by viewRedrawPost().

#define REDRAWNLA   2

Definition at line 925 of file interface_templates.c.

Referenced by viewRedrawPost().

#define REMAKEIPO   8

Definition at line 930 of file interface_templates.c.

#define WHEEL_SIZE   100

Definition at line 1905 of file interface_templates.c.

Referenced by uiTemplateColorWheel().


Typedef Documentation

typedef struct RNAUpdateCb RNAUpdateCb
typedef struct TemplateID TemplateID

Function Documentation

static void colorband_add_cb ( bContext C,
void *  cb_v,
void *  coba_v 
) [static]
static void colorband_buttons_large ( uiLayout layout,
uiBlock block,
ColorBand coba,
int  xoffs,
int  yoffs,
RNAUpdateCb cb 
) [static]
static void colorband_buttons_layout ( uiLayout layout,
uiBlock block,
ColorBand coba,
rctf butr,
int  small,
RNAUpdateCb cb 
) [static]

Definition at line 1392 of file interface_templates.c.

References colorband_buttons_large(), and colorband_buttons_small().

Referenced by uiTemplateColorRamp().

static void colorband_buttons_small ( uiLayout layout,
uiBlock block,
ColorBand coba,
rctf butr,
RNAUpdateCb cb 
) [static]
static void colorband_del_cb ( bContext C,
void *  cb_v,
void *  coba_v 
) [static]
static void colorband_flip_cb ( bContext C,
void *  cb_v,
void *  coba_v 
) [static]
static void constraint_active_func ( bContext UNUSEDC,
void *  ob_v,
void *  con_v 
) [static]

Definition at line 962 of file interface_templates.c.

References ED_object_constraint_set_active().

Referenced by draw_constraint().

static uiBlock* curvemap_brush_tools_func ( bContext C,
struct ARegion ar,
void *  cumap_v 
) [static]
static void curvemap_buttons_delete ( bContext C,
void *  cb_v,
void *  cumap_v 
) [static]
static void curvemap_buttons_layout ( uiLayout layout,
PointerRNA ptr,
char  labeltype,
int  levels,
int  brush,
RNAUpdateCb cb 
) [static]
static void curvemap_buttons_redraw ( bContext C,
void *  UNUSEDarg1,
void *  UNUSEDarg2 
) [static]

Definition at line 1720 of file interface_templates.c.

References CTX_wm_region(), and ED_region_tag_redraw().

Referenced by curvemap_buttons_layout().

static void curvemap_buttons_reset ( bContext C,
void *  cb_v,
void *  cumap_v 
) [static]
static void curvemap_buttons_setclip ( bContext UNUSEDC,
void *  cumap_v,
void *  UNUSEDarg 
) [static]

Definition at line 1599 of file interface_templates.c.

References curvemapping_changed().

Referenced by curvemap_clipping_func().

static void curvemap_buttons_zoom_in ( bContext C,
void *  cumap_v,
void *  UNUSEDarg 
) [static]
static void curvemap_buttons_zoom_out ( bContext C,
void *  cumap_v,
void *  UNUSEDunused 
) [static]
static uiBlock* curvemap_clipping_func ( bContext C,
struct ARegion ar,
void *  cumap_v 
) [static]
static void curvemap_tools_dofunc ( bContext C,
void *  cumap_v,
int  event 
) [static]
static uiBlock* curvemap_tools_func ( bContext C,
struct ARegion ar,
void *  cumap_v 
) [static]
static void do_constraint_panels ( bContext C,
void *  ob_pt,
int  event 
) [static]
static void do_preview_buttons ( bContext C,
void *  arg,
int  event 
) [static]

Definition at line 1146 of file interface_templates.c.

References B_MATPRV, NC_MATERIAL, ND_SHADING, and WM_event_add_notifier().

Referenced by uiTemplatePreview().

static void do_running_jobs ( bContext C,
void *  UNUSEDarg,
int  event 
) [static]
static uiLayout* draw_constraint ( uiLayout layout,
Object ob,
bConstraint con 
) [static]
static uiLayout* draw_modifier ( uiLayout layout,
Scene scene,
Object ob,
ModifierData md,
int  index,
int  cageIndex,
int  lastCageIndex 
) [static]

Definition at line 711 of file interface_templates.c.

References BLI_snprintf(), BUT, PartDeflect::deflect, ELEM, ELEM3, ELEM5, eModifierMode_ApplyOnSpline, eModifierMode_Expanded, eModifierMode_OnCage, eModifierMode_Virtual, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Hook, eModifierType_MeshDeform, eModifierType_ParticleSystem, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface, eModifierTypeFlag_SupportsEditmode, eModifierTypeType_Constructive, ModifierData::error, ERROR_LIBDATA_MESSAGE, ModifierTypeInfo::flags, Object::id, IFACE_, LABEL, ID::lib, ModifierData::mode, Object::mode, MODIFIER_APPLY_DATA, MODIFIER_APPLY_SHAPE, modifier_can_delete(), modifier_couldBeCage(), modifier_is_simulation(), modifier_nonGeometrical(), modifier_sameTopology(), modifiers_convertToReal(), modifiers_setOnCage(), modifierType_getInfo(), mti, ModifierData::name, NULL, OB_CURVE, OB_FONT, OB_MESH, OB_MODE_PARTICLE_EDIT, OB_SURF, object_data_is_libdata(), ParticleSystem::part, PART_DRAW_GR, PART_DRAW_OB, PART_DRAW_PATH, ParticleSystem::pathcache, Object::pd, ParticleSettings::ren_as, RNA_Modifier, RNA_pointer_create(), RNA_struct_ui_icon(), str, TIP_, TOG, ModifierData::type, Object::type, PointerRNA::type, ModifierTypeInfo::type, UI_BUT_DISABLED, UI_EMBOSS, UI_EMBOSSN, UI_LAYOUT_ALIGN_EXPAND, UI_UNIT_X, UI_UNIT_Y, uiBlockBeginAlign(), uiBlockClearButLock(), uiBlockEndAlign(), uiBlockSetButLock(), uiBlockSetEmboss(), uiButSetFlag(), uiButSetFunc(), uiDefBut(), uiDefIconBut(), uiDefIconButBitI(), uiItemEnumO(), uiItemL(), uiItemO(), uiItemR(), uiItemStringO(), uiLayoutAbsoluteBlock(), uiLayoutBox(), uiLayoutColumn(), uiLayoutGetBlock(), uiLayoutRow(), uiLayoutSetAlignment(), uiLayoutSetContextPointer(), uiLayoutSetOperatorContext(), and WM_OP_INVOKE_DEFAULT.

Referenced by uiTemplateModifier().

static void handle_layer_buttons ( bContext C,
void *  arg1,
void *  arg2 
) [static]
static void id_search_call_cb ( bContext C,
void *  arg_template,
void *  item 
) [static]
static void id_search_cb ( const bContext C,
void *  arg_template,
const char *  str,
uiSearchItems items 
) [static]
static uiBlock* id_search_menu ( bContext C,
ARegion ar,
void *  arg_litem 
) [static]
static void keymap_item_modified ( bContext UNUSEDC,
void *  kmi_p,
void *  UNUSEDunused 
) [static]

Definition at line 2666 of file interface_templates.c.

References NULL, and WM_keyconfig_update_tag().

Referenced by uiTemplateKeymapItemProperties().

static int list_item_icon_get ( bContext C,
PointerRNA itemptr,
int  rnaicon,
int  big 
) [static]
static void list_item_row ( bContext C,
uiLayout layout,
PointerRNA ptr,
PointerRNA itemptr,
int  i,
int  rnaicon,
PointerRNA activeptr,
PropertyRNA activeprop,
const char *  prop_list_id 
) [static]
static int modifier_can_delete ( ModifierData md) [static]

Definition at line 683 of file interface_templates.c.

References eModifierType_ParticleSystem, PART_FLUID, and ModifierData::type.

Referenced by draw_modifier().

static int modifier_is_simulation ( ModifierData md) [static]
static void modifiers_convertToReal ( bContext C,
void *  ob_v,
void *  md_v 
) [static]
static void modifiers_setOnCage ( bContext C,
void *  ob_v,
void *  md_v 
) [static]
static void operator_call_cb ( bContext C,
void *  UNUSEDarg1,
void *  arg2 
) [static]
static void operator_search_cb ( const bContext C,
void *  UNUSEDarg,
const char *  str,
uiSearchItems items 
) [static]
static void rna_update_cb ( bContext C,
void *  arg_cb,
void *  UNUSEDarg 
) [static]
static void template_ID ( bContext C,
uiLayout layout,
TemplateID template,
StructRNA type,
short  idcode,
int  flag,
const char *  newop,
const char *  openop,
const char *  unlinkop 
) [static]
static const char* template_id_browse_tip ( StructRNA type) [static]
static void template_id_cb ( bContext C,
void *  arg_litem,
void *  arg_event 
) [static]
static void template_keymap_item_properties ( uiLayout layout,
const char *  title,
PointerRNA ptr 
) [static]
void UI_template_fix_linking ( void  )

Definition at line 76 of file interface_templates.c.

Referenced by uiBlockLayoutResolve().

static void ui_template_id ( uiLayout layout,
bContext C,
PointerRNA ptr,
const char *  propname,
const char *  newop,
const char *  openop,
const char *  unlinkop,
int  flag,
int  prv_rows,
int  prv_cols 
) [static]
void uiIDContextProperty ( bContext C,
PointerRNA ptr,
PropertyRNA **  prop 
)
void uiTemplateAnyID ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
const char *  proptypename,
const char *  text 
)
void uiTemplateColorRamp ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
int  expand 
)
void uiTemplateColorWheel ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
int  value_slider,
int  lock,
int  lock_luminosity,
int  cubic 
)
uiLayout* uiTemplateConstraint ( uiLayout layout,
PointerRNA ptr 
)
void uiTemplateCurveMapping ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
int  type,
int  levels,
int  brush 
)
void uiTemplateHeader ( uiLayout layout,
bContext C,
int  menus 
)
void uiTemplateHistogram ( uiLayout layout,
PointerRNA ptr,
const char *  propname 
)
void uiTemplateID ( uiLayout layout,
bContext C,
PointerRNA ptr,
const char *  propname,
const char *  newop,
const char *  openop,
const char *  unlinkop 
)
void uiTemplateIDBrowse ( uiLayout layout,
bContext C,
PointerRNA ptr,
const char *  propname,
const char *  newop,
const char *  openop,
const char *  unlinkop 
)

Definition at line 538 of file interface_templates.c.

References UI_ID_BROWSE, UI_ID_RENAME, and ui_template_id().

Referenced by node_draw_group(), and node_uifunc_group().

void uiTemplateIDPreview ( uiLayout layout,
bContext C,
PointerRNA ptr,
const char *  propname,
const char *  newop,
const char *  openop,
const char *  unlinkop,
int  rows,
int  cols 
)
void uiTemplateKeymapItemProperties ( uiLayout layout,
PointerRNA ptr 
)
void uiTemplateLayers ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
PointerRNA used_ptr,
const char *  used_propname,
int  active_layer 
)
void uiTemplateList ( uiLayout layout,
bContext C,
PointerRNA ptr,
const char *  propname,
PointerRNA activeptr,
const char *  activepropname,
const char *  prop_list,
int  rows,
int  maxrows,
int  listtype 
)
uiLayout* uiTemplateModifier ( uiLayout layout,
bContext C,
PointerRNA ptr 
)
void uiTemplateOperatorSearch ( uiLayout layout)
void uiTemplatePathBuilder ( uiLayout layout,
PointerRNA ptr,
const char *  propname,
PointerRNA UNUSEDroot_ptr,
const char *  text 
)
void uiTemplatePreview ( uiLayout layout,
ID id,
int  show_buttons,
ID parent,
MTex slot 
)
void uiTemplateReportsBanner ( uiLayout layout,
bContext C 
)
void uiTemplateRunningJobs ( uiLayout layout,
bContext C 
)
void uiTemplateVectorscope ( uiLayout layout,
PointerRNA ptr,
const char *  propname 
)
void uiTemplateWaveform ( uiLayout layout,
PointerRNA ptr,
const char *  propname 
)