Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_wm.c
| Show First 20 Lines • Show All 770 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| wmWindow *win = ptr->data; | wmWindow *win = ptr->data; | ||||
| Scene *scene = WM_window_get_active_scene(win); | Scene *scene = WM_window_get_active_scene(win); | ||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | WorkSpace *workspace = WM_window_get_active_workspace(win); | ||||
| BKE_workspace_view_layer_set(workspace, value.data, scene); | BKE_workspace_view_layer_set(workspace, value.data, scene); | ||||
| } | } | ||||
| #ifdef USE_WORKSPACE_MODE | |||||
| static int rna_Window_object_mode_get(PointerRNA *ptr) | static int rna_Window_object_mode_get(PointerRNA *ptr) | ||||
| { | { | ||||
| wmWindow *win = ptr->data; | wmWindow *win = ptr->data; | ||||
| Scene *scene = WM_window_get_active_scene(win); | Scene *scene = WM_window_get_active_scene(win); | ||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | WorkSpace *workspace = WM_window_get_active_workspace(win); | ||||
| return (int)BKE_workspace_object_mode_get(workspace, scene); | return (int)BKE_workspace_object_mode_get(workspace, scene); | ||||
| } | } | ||||
| static void rna_Window_object_mode_set(PointerRNA *ptr, int value) | static void rna_Window_object_mode_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| wmWindow *win = ptr->data; | wmWindow *win = ptr->data; | ||||
| Scene *scene = WM_window_get_active_scene(win); | Scene *scene = WM_window_get_active_scene(win); | ||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | WorkSpace *workspace = WM_window_get_active_workspace(win); | ||||
| BKE_workspace_object_mode_set(workspace, scene, value); | BKE_workspace_object_mode_set(workspace, scene, value); | ||||
| } | } | ||||
| #endif /* USE_WORKSPACE_MODE */ | |||||
| static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr) | static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr) | ||||
| { | { | ||||
| wmKeyMapItem *kmi = ptr->data; | wmKeyMapItem *kmi = ptr->data; | ||||
| if (kmi->ptr) | if (kmi->ptr) | ||||
| return *(kmi->ptr); | return *(kmi->ptr); | ||||
| ▲ Show 20 Lines • Show All 1,261 Lines • ▼ Show 20 Lines | static void rna_def_window(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "view_layer", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "view_layer", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "ViewLayer"); | RNA_def_property_struct_type(prop, "ViewLayer"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_Window_view_layer_get", "rna_Window_view_layer_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_Window_view_layer_get", "rna_Window_view_layer_set", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Active View Layer", "The active workspace view layer showing in the window"); | RNA_def_property_ui_text(prop, "Active View Layer", "The active workspace view layer showing in the window"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | ||||
| RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL); | ||||
| #ifdef USE_WORKSPACE_MODE | |||||
| prop = RNA_def_property(srna, "object_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "object_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, rna_enum_object_mode_items); | RNA_def_property_enum_items(prop, rna_enum_object_mode_items); | ||||
| RNA_def_property_enum_funcs(prop, "rna_Window_object_mode_get", "rna_Window_object_mode_set", NULL); | RNA_def_property_enum_funcs(prop, "rna_Window_object_mode_get", "rna_Window_object_mode_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Mode", "Object interaction mode used in this window"); | RNA_def_property_ui_text(prop, "Mode", "Object interaction mode used in this window"); | ||||
| #endif | |||||
| prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "posx"); | RNA_def_property_int_sdna(prop, NULL, "posx"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "X Position", "Horizontal location of the window"); | RNA_def_property_ui_text(prop, "X Position", "Horizontal location of the window"); | ||||
| prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "posy"); | RNA_def_property_int_sdna(prop, NULL, "posy"); | ||||
| ▲ Show 20 Lines • Show All 356 Lines • Show Last 20 Lines | |||||