Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Show All 30 Lines | |||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_studiolight.h" | #include "BKE_studiolight.h" | ||||
| #include "BKE_studiolight.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | |||||
| #include "DNA_action_types.h" | #include "DNA_action_types.h" | ||||
| #include "DNA_key_types.h" | #include "DNA_key_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| Show All 9 Lines | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #ifdef WITH_PYTHON | |||||
| # ifdef RNA_RUNTIME | |||||
| static struct { | |||||
| char *bl_idname; | |||||
| char *bl_label; | |||||
| int bl_icon; | |||||
| } g_space_type_dynamic = {NULL}; | |||||
| # endif | |||||
| #endif | |||||
| const EnumPropertyItem rna_enum_space_type_items[] = { | const EnumPropertyItem rna_enum_space_type_items[] = { | ||||
| /* empty must be here for python, is skipped for UI */ | /* empty must be here for python, is skipped for UI */ | ||||
| {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""}, | {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""}, | ||||
| /* General */ | /* General */ | ||||
| {0, "", ICON_NONE, "General", ""}, | {0, "", ICON_NONE, "General", ""}, | ||||
| {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"}, | {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"}, | ||||
| Show All 24 Lines | const EnumPropertyItem rna_enum_space_type_items[] = { | ||||
| /* Data */ | /* Data */ | ||||
| {0, "", ICON_NONE, "Data", ""}, | {0, "", ICON_NONE, "Data", ""}, | ||||
| {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"}, | {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"}, | ||||
| {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"}, | {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"}, | ||||
| {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"}, | {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"}, | ||||
| {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", | {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", | ||||
| "Edit persistent configuration settings"}, | "Edit persistent configuration settings"}, | ||||
| /* Keep Last */ | |||||
| {SPACE_SCRIPT, "SCRIPT", ICON_NONE, "Script", "Space type for dynamic spaces"}, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_space_image_mode_items[] = { | const EnumPropertyItem rna_enum_space_image_mode_items[] = { | ||||
| {SI_MODE_VIEW, "VIEW", ICON_FILE_IMAGE, "View", "View the image and UV edit in mesh editmode"}, | {SI_MODE_VIEW, "VIEW", ICON_FILE_IMAGE, "View", "View the image and UV edit in mesh editmode"}, | ||||
| {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"}, | {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"}, | ||||
| {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"}, | {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"}, | ||||
| ▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | |||||
| #include "GPU_material.h" | #include "GPU_material.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #ifdef WITH_PYTHON | |||||
| static void rna_Space_unregister(struct Main *bmain, StructRNA *type); | |||||
| static void rna_space_draw_main_region_cb( | |||||
| const struct bContext *C, struct ARegion *UNUSED(ar)) | |||||
| { | |||||
| // extern FunctionRNA rna_Space_draw_func; | |||||
| PointerRNA space_ptr; | |||||
| ParameterList list; | |||||
| FunctionRNA *func; | |||||
| ScrArea *sa = CTX_wm_area(C); | |||||
| SpaceLink *sl = sa->spacedata.first; | |||||
| struct SpaceTypeDyn *ds = BKE_screen_dynspace_from_index(sa->spacetype, sl->space_subtype); | |||||
| ExtensionRNA *ext = BKE_screen_dynspace_get_rna_ext(ds); | |||||
| RNA_pointer_create(NULL, ext->srna, sl, &space_ptr); | |||||
| func = RNA_struct_find_function(space_ptr.type, "draw"); | |||||
| // func = &rna_Space_draw_func; | |||||
| RNA_parameter_list_create(&list, &space_ptr, func); | |||||
| RNA_parameter_set_lookup(&list, "context", &C); | |||||
| ext->call((bContext *)C, &space_ptr, func, &list); | |||||
| RNA_parameter_list_free(&list); | |||||
| } | |||||
| static StructRNA *rna_Space_register_impl( | |||||
| Main *bmain, ReportList *reports, void *data, const char *identifier, | |||||
| StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free, | |||||
| /* base type is not part of RNA registration. */ | |||||
| StructRNA *base_srna, const int space_type) | |||||
| { | |||||
| struct { | |||||
| char idname[MAX_NAME]; | |||||
| char label[MAX_NAME]; | |||||
| } temp_buffers; | |||||
| g_space_type_dynamic.bl_idname = temp_buffers.idname; | |||||
| g_space_type_dynamic.bl_label = temp_buffers.label; | |||||
| g_space_type_dynamic.bl_icon = 0; | |||||
| UNUSED_VARS(bmain, reports, data, identifier, validate, call, free); | |||||
| // SpaceType dummy_st = {NULL}; | |||||
| SpaceLink dummy_space = {NULL}; | |||||
| PointerRNA space_ptr; | |||||
| /* Two sets of functions. */ | |||||
| int have_function[1]; | |||||
| /* setup dummy manipulator & manipulator type to store static properties in */ | |||||
| dummy_space.spacetype = space_type; | |||||
| // dummy_st.idname = temp_buffers.idname; | |||||
| // dummy_st.spaceid = space_type; | |||||
| RNA_pointer_create(NULL, base_srna, &dummy_space, &space_ptr); | |||||
| /* validate the python class */ | |||||
| { | |||||
| bool ok = !validate(&space_ptr, data, have_function); | |||||
| g_space_type_dynamic.bl_idname = NULL; | |||||
| g_space_type_dynamic.bl_label = NULL; | |||||
| if (!ok) { | |||||
| return NULL; | |||||
| } | |||||
| } | |||||
| /* check if we have registered this manipulator type before, and remove it */ | |||||
| #if 0 | |||||
| { | |||||
| const wmSpaceType *wt = WM_manipulatortype_find(dummy_st.idname, true); | |||||
| if (wt && wt->ext.srna) { | |||||
| rna_Space_unregister(bmain, wt->ext.srna); | |||||
| } | |||||
| } | |||||
| if (!RNA_struct_available_or_report(reports, dummy_st.idname)) { | |||||
| return NULL; | |||||
| } | |||||
| #endif | |||||
| // /* create a new manipulator type */ | |||||
| struct SpaceTypeDyn *ds = BKE_screen_dynspace_register( | |||||
| space_type, temp_buffers.idname, temp_buffers.label, g_space_type_dynamic.bl_icon); | |||||
| struct ExtensionRNA *ext = BKE_screen_dynspace_get_rna_ext(ds); | |||||
| ext->srna = RNA_def_struct_ptr(&BLENDER_RNA, temp_buffers.idname, base_srna); | |||||
| /* manipulator properties are registered separately */ | |||||
| RNA_def_struct_flag(ext->srna, STRUCT_NO_IDPROPERTIES); | |||||
| ext->data = data; | |||||
| ext->call = call; | |||||
| ext->free = free; | |||||
| { | |||||
| int i = 0; | |||||
| void *draw_main_region = (have_function[i++]) ? rna_space_draw_main_region_cb : NULL; | |||||
| BKE_screen_dynspace_set_main_region_draw(ds, draw_main_region); | |||||
| BLI_assert(i == ARRAY_SIZE(have_function)); | |||||
| } | |||||
| /* update while blender is running */ | |||||
| WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); | |||||
| return ext->srna; | |||||
| } | |||||
| static StructRNA *rna_Space_register_for_SpaceProperties( | |||||
| Main *bmain, ReportList *reports, void *data, const char *identifier, | |||||
| StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) | |||||
| { | |||||
| return rna_Space_register_impl( | |||||
| bmain, reports, data, identifier, | |||||
| validate, call, free, | |||||
| /* custom */ | |||||
| &RNA_SpaceProperties, SPACE_BUTS); | |||||
| } | |||||
| static StructRNA *rna_Space_register_for_SpaceScript( | |||||
| Main *bmain, ReportList *reports, void *data, const char *identifier, | |||||
| StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) | |||||
| { | |||||
| return rna_Space_register_impl( | |||||
| bmain, reports, data, identifier, | |||||
| validate, call, free, | |||||
| /* custom */ | |||||
| &RNA_SpaceScript, SPACE_SCRIPT); | |||||
| } | |||||
| static void rna_Space_unregister(struct Main *bmain, StructRNA *type) | |||||
| { | |||||
| UNUSED_VARS(bmain, type); | |||||
| #if 0 | |||||
| wmManipulatorType *wt = RNA_struct_blender_type_get(type); | |||||
| if (!wt) | |||||
| return; | |||||
| RNA_struct_free_extension(type, &wt->ext); | |||||
| RNA_struct_free(&BLENDER_RNA, type); | |||||
| WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); | |||||
| WM_manipulatortype_remove_ptr(NULL, bmain, wt); | |||||
| #endif | |||||
| } | |||||
| #endif /* WITH_PYTHON */ | |||||
| static StructRNA *rna_Space_refine(struct PointerRNA *ptr) | static StructRNA *rna_Space_refine(struct PointerRNA *ptr) | ||||
| { | { | ||||
| SpaceLink *space = (SpaceLink *)ptr->data; | SpaceLink *space = (SpaceLink *)ptr->data; | ||||
| if (space->link_flag & SPACE_LINK_FLAG_IS_DYNAMIC) { | |||||
| struct SpaceTypeDyn *ds = BKE_screen_dynspace_from_index(space->spacetype, space->space_subtype); | |||||
| ExtensionRNA *ext = BKE_screen_dynspace_get_rna_ext(ds); | |||||
| return ext->srna; | |||||
| } | |||||
| switch (space->spacetype) { | switch (space->spacetype) { | ||||
| case SPACE_VIEW3D: | case SPACE_VIEW3D: | ||||
| return &RNA_SpaceView3D; | return &RNA_SpaceView3D; | ||||
| case SPACE_IPO: | case SPACE_IPO: | ||||
| return &RNA_SpaceGraphEditor; | return &RNA_SpaceGraphEditor; | ||||
| case SPACE_OUTLINER: | case SPACE_OUTLINER: | ||||
| return &RNA_SpaceOutliner; | return &RNA_SpaceOutliner; | ||||
| case SPACE_BUTS: | case SPACE_BUTS: | ||||
| return &RNA_SpaceProperties; | return &RNA_SpaceProperties; | ||||
| case SPACE_FILE: | case SPACE_FILE: | ||||
| return &RNA_SpaceFileBrowser; | return &RNA_SpaceFileBrowser; | ||||
| case SPACE_IMAGE: | case SPACE_IMAGE: | ||||
| return &RNA_SpaceImageEditor; | return &RNA_SpaceImageEditor; | ||||
| case SPACE_INFO: | case SPACE_INFO: | ||||
| return &RNA_SpaceInfo; | return &RNA_SpaceInfo; | ||||
| case SPACE_SEQ: | case SPACE_SEQ: | ||||
| return &RNA_SpaceSequenceEditor; | return &RNA_SpaceSequenceEditor; | ||||
| case SPACE_TEXT: | case SPACE_TEXT: | ||||
| return &RNA_SpaceTextEditor; | return &RNA_SpaceTextEditor; | ||||
| case SPACE_ACTION: | case SPACE_ACTION: | ||||
| return &RNA_SpaceDopeSheetEditor; | return &RNA_SpaceDopeSheetEditor; | ||||
| case SPACE_NLA: | case SPACE_NLA: | ||||
| return &RNA_SpaceNLA; | return &RNA_SpaceNLA; | ||||
| case SPACE_SCRIPT: | |||||
| return &RNA_SpaceScript; | |||||
| case SPACE_NODE: | case SPACE_NODE: | ||||
| return &RNA_SpaceNodeEditor; | return &RNA_SpaceNodeEditor; | ||||
| case SPACE_CONSOLE: | case SPACE_CONSOLE: | ||||
| return &RNA_SpaceConsole; | return &RNA_SpaceConsole; | ||||
| case SPACE_USERPREF: | case SPACE_USERPREF: | ||||
| return &RNA_SpaceUserPreferences; | return &RNA_SpaceUserPreferences; | ||||
| case SPACE_CLIP: | case SPACE_CLIP: | ||||
| return &RNA_SpaceClipEditor; | return &RNA_SpaceClipEditor; | ||||
| ▲ Show 20 Lines • Show All 1,548 Lines • ▼ Show 20 Lines | static void rna_FileBrowser_FSMenuRecent_active_set(PointerRNA *ptr, int value) | ||||
| rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT); | rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT); | ||||
| } | } | ||||
| static void rna_FileBrowser_FSMenuRecent_active_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) | static void rna_FileBrowser_FSMenuRecent_active_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) | ||||
| { | { | ||||
| rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT); | rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT); | ||||
| } | } | ||||
| #ifdef WITH_PYTHON | |||||
| static void rna_Space_bl_idname_get(PointerRNA *UNUSED(ptr), char *value) | |||||
| { | |||||
| BLI_strncpy(value, g_space_type_dynamic.bl_idname, MAX_NAME); | |||||
| } | |||||
| static int rna_Space_bl_idname_length(PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| return strlen(g_space_type_dynamic.bl_idname); | |||||
| } | |||||
| static void rna_Space_bl_idname_set(PointerRNA *UNUSED(ptr), const char *value) | |||||
| { | |||||
| BLI_strncpy(g_space_type_dynamic.bl_idname, value, MAX_NAME); | |||||
| } | |||||
| static void rna_Space_bl_label_get(PointerRNA *UNUSED(ptr), char *value) | |||||
| { | |||||
| BLI_strncpy(value, g_space_type_dynamic.bl_label, MAX_NAME); | |||||
| } | |||||
| static int rna_Space_bl_label_length(PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| return strlen(g_space_type_dynamic.bl_label); | |||||
| } | |||||
| static void rna_Space_bl_label_set(PointerRNA *UNUSED(ptr), const char *value) | |||||
| { | |||||
| BLI_strncpy(g_space_type_dynamic.bl_label, value, MAX_NAME); | |||||
| } | |||||
| static int rna_Space_bl_icon_get(PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| return g_space_type_dynamic.bl_icon; | |||||
| } | |||||
| static void rna_Space_bl_icon_set(PointerRNA *UNUSED(ptr), int value) | |||||
| { | |||||
| g_space_type_dynamic.bl_icon = value; | |||||
| } | |||||
| #endif /* WITH_PYTHON */ | |||||
| #else | #else | ||||
| static const EnumPropertyItem dt_uv_items[] = { | static const EnumPropertyItem dt_uv_items[] = { | ||||
| {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"}, | {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"}, | ||||
| {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"}, | {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"}, | ||||
| {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"}, | {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"}, | ||||
| {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"}, | {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #ifdef WITH_PYTHON | |||||
| /* Avoids duplicating calls for all registerable types. */ | |||||
| static void rna_def_space_dyn_impl( | |||||
| BlenderRNA *UNUSED(brna), StructRNA *base_srna, | |||||
| const char *reg) | |||||
| { | |||||
| RNA_def_struct_register_funcs(base_srna, reg, "rna_Space_unregister", NULL); | |||||
| /* -------------------------------------------------------------------- */ | |||||
| /* Registerable Variables */ | |||||
| PropertyRNA *prop; | |||||
| RNA_define_verify_sdna(0); /* not in sdna */ | |||||
| prop = RNA_def_property(base_srna, "bl_idname", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_maxlength(prop, MAX_NAME); | |||||
| RNA_def_property_string_funcs( | |||||
| prop, "rna_Space_bl_idname_get", "rna_Space_bl_idname_length", "rna_Space_bl_idname_set"); | |||||
| /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ | |||||
| RNA_def_property_flag(prop, PROP_REGISTER); | |||||
| prop = RNA_def_property(base_srna, "bl_label", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_maxlength(prop, MAX_NAME); | |||||
| RNA_def_property_string_funcs( | |||||
| prop, "rna_Space_bl_label_get", "rna_Space_bl_label_length", "rna_Space_bl_label_set"); | |||||
| /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ | |||||
| RNA_def_property_flag(prop, PROP_REGISTER); | |||||
| prop = RNA_def_property(base_srna, "bl_icon", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_icon_items); | |||||
| RNA_def_property_enum_funcs( | |||||
| prop, "rna_Space_bl_icon_get", "rna_Space_bl_icon_set", NULL); | |||||
| /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ | |||||
| RNA_def_property_flag(prop, PROP_REGISTER); | |||||
| RNA_define_verify_sdna(1); /* not in sdna */ | |||||
| FunctionRNA *func; | |||||
| PropertyRNA *parm; | |||||
| /* Space.draw */ | |||||
| func = RNA_def_function(base_srna, "draw", NULL); | |||||
| RNA_def_function_ui_description(func, ""); | |||||
| RNA_def_function_flag(func, FUNC_REGISTER); | |||||
| parm = RNA_def_pointer(func, "context", "Context", "", ""); | |||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | |||||
| } | |||||
| #endif /* WITH_PYTHON */ | |||||
| static void rna_def_space(BlenderRNA *brna) | static void rna_def_space(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "Space", NULL); | srna = RNA_def_struct(brna, "Space", NULL); | ||||
| RNA_def_struct_sdna(srna, "SpaceLink"); | RNA_def_struct_sdna(srna, "SpaceLink"); | ||||
| RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area"); | RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area"); | ||||
| ▲ Show 20 Lines • Show All 1,091 Lines • ▼ Show 20 Lines | static const EnumPropertyItem align_items[] = { | ||||
| {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""}, | {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "SpaceProperties", "Space"); | srna = RNA_def_struct(brna, "SpaceProperties", "Space"); | ||||
| RNA_def_struct_sdna(srna, "SpaceButs"); | RNA_def_struct_sdna(srna, "SpaceButs"); | ||||
| RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data"); | RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data"); | ||||
| rna_def_space_dyn_impl(brna, srna, "rna_Space_register_for_SpaceProperties"); | |||||
| /* Not exposed to the UI (access via space-type selector). */ | /* Not exposed to the UI (access via space-type selector). */ | ||||
| prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "space_subtype"); | RNA_def_property_enum_sdna(prop, NULL, "space_subtype"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_space_button_mode_items); | RNA_def_property_enum_items(prop, rna_enum_space_button_mode_items); | ||||
| RNA_def_property_ui_text(prop, "Mode", "Arrangement of the panels"); | RNA_def_property_ui_text(prop, "Mode", "Arrangement of the panels"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); | ||||
| prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 1,750 Lines • ▼ Show 20 Lines | static void rna_def_space_clip(BlenderRNA *brna) | ||||
| /* pivot point */ | /* pivot point */ | ||||
| prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "around"); | RNA_def_property_enum_sdna(prop, NULL, "around"); | ||||
| RNA_def_property_enum_items(prop, pivot_items); | RNA_def_property_enum_items(prop, pivot_items); | ||||
| RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling"); | RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); | ||||
| } | } | ||||
| /* Only for subclassing from Python. */ | |||||
| static void rna_def_space_script(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| srna = RNA_def_struct(brna, "SpaceScript", "Space"); | |||||
| RNA_def_struct_sdna(srna, "SpaceScript"); | |||||
| RNA_def_struct_ui_text(srna, "Script Space", "Script space type"); | |||||
| rna_def_space_dyn_impl(brna, srna, "rna_Space_register_for_SpaceScript"); | |||||
| } | |||||
| void RNA_def_space(BlenderRNA *brna) | void RNA_def_space(BlenderRNA *brna) | ||||
| { | { | ||||
| rna_def_space(brna); | rna_def_space(brna); | ||||
| rna_def_space_image(brna); | rna_def_space_image(brna); | ||||
| rna_def_space_sequencer(brna); | rna_def_space_sequencer(brna); | ||||
| rna_def_space_text(brna); | rna_def_space_text(brna); | ||||
| rna_def_fileselect_params(brna); | rna_def_fileselect_params(brna); | ||||
| rna_def_filemenu_entry(brna); | rna_def_filemenu_entry(brna); | ||||
| rna_def_space_filebrowser(brna); | rna_def_space_filebrowser(brna); | ||||
| rna_def_space_outliner(brna); | rna_def_space_outliner(brna); | ||||
| rna_def_space_view3d(brna); | rna_def_space_view3d(brna); | ||||
| rna_def_space_buttons(brna); | rna_def_space_buttons(brna); | ||||
| rna_def_space_dopesheet(brna); | rna_def_space_dopesheet(brna); | ||||
| rna_def_space_graph(brna); | rna_def_space_graph(brna); | ||||
| rna_def_space_nla(brna); | rna_def_space_nla(brna); | ||||
| rna_def_space_console(brna); | rna_def_space_console(brna); | ||||
| rna_def_console_line(brna); | rna_def_console_line(brna); | ||||
| rna_def_space_info(brna); | rna_def_space_info(brna); | ||||
| rna_def_space_userpref(brna); | rna_def_space_userpref(brna); | ||||
| rna_def_node_tree_path(brna); | rna_def_node_tree_path(brna); | ||||
| rna_def_space_node(brna); | rna_def_space_node(brna); | ||||
| rna_def_space_clip(brna); | rna_def_space_clip(brna); | ||||
| rna_def_space_script(brna); | |||||
| } | } | ||||
| #endif | #endif | ||||