Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 2,273 Lines • ▼ Show 20 Lines | static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, bNodeTreeType *type) | ||||
| if (type->poll) { | if (type->poll) { | ||||
| return type->poll(C, type); | return type->poll(C, type); | ||||
| } | } | ||||
| else { | else { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2]) | |||||
| { | |||||
| const SpaceNode *snode = (SpaceNode *)ptr->data; | |||||
| ED_node_cursor_location_get(snode, value); | |||||
| } | |||||
| static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2]) | |||||
| { | |||||
| SpaceNode *snode = (SpaceNode *)ptr->data; | |||||
| ED_node_cursor_location_set(snode, value); | |||||
| } | |||||
| const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free) | const EnumPropertyItem *RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free) | ||||
| { | { | ||||
| return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free); | return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free); | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C, | static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C, | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode, | static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode, | ||||
| bContext *C, | bContext *C, | ||||
| int x, | int x, | ||||
| int y) | int y) | ||||
| { | { | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| UI_view2d_region_to_view(®ion->v2d, x, y, &snode->cursor[0], &snode->cursor[1]); | float cursor_location[2]; | ||||
| snode->cursor[0] /= UI_DPI_FAC; | |||||
| snode->cursor[1] /= UI_DPI_FAC; | UI_view2d_region_to_view(®ion->v2d, x, y, &cursor_location[0], &cursor_location[1]); | ||||
| cursor_location[0] /= UI_DPI_FAC; | |||||
| cursor_location[1] /= UI_DPI_FAC; | |||||
| ED_node_cursor_location_set(snode, cursor_location); | |||||
| } | } | ||||
| static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, | static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, | ||||
| PointerRNA value, | PointerRNA value, | ||||
| struct ReportList *UNUSED(reports)) | struct ReportList *UNUSED(reports)) | ||||
| { | { | ||||
| SpaceClip *sc = (SpaceClip *)(ptr->data); | SpaceClip *sc = (SpaceClip *)(ptr->data); | ||||
| bScreen *screen = (bScreen *)ptr->owner_id; | bScreen *screen = (bScreen *)ptr->owner_id; | ||||
| ▲ Show 20 Lines • Show All 4,453 Lines • ▼ Show 20 Lines | # endif | ||||
| RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset"); | RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | ||||
| prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | ||||
| RNA_def_property_enum_items(prop, backdrop_channels_items); | RNA_def_property_enum_items(prop, backdrop_channels_items); | ||||
| RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw"); | RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | ||||
| /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */ | /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */ | ||||
| prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ); | prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ); | ||||
| RNA_def_property_array(prop, 2); | RNA_def_property_array(prop, 2); | ||||
| RNA_def_property_float_sdna(prop, NULL, "cursor"); | RNA_def_property_float_funcs(prop, | ||||
| "rna_SpaceNodeEditor_cursor_location_get", | |||||
| "rna_SpaceNodeEditor_cursor_location_set", | |||||
| NULL); | |||||
| RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes"); | RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL); | ||||
| /* insert offset (called "Auto-offset" in UI) */ | /* insert offset (called "Auto-offset" in UI) */ | ||||
| prop = RNA_def_property(srna, "use_insert_offset", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_insert_offset", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNODE_SKIP_INSOFFSET); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNODE_SKIP_INSOFFSET); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, | ||||
| "Auto-offset", | "Auto-offset", | ||||
| ▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines | |||||