Tool System: per space/mode tool support
[blender.git] / source / blender / makesrna / intern / rna_space.c
index 12bb4dd0617274e46d74f42f38cd090c6e05dd61..3ce799dfb88d3a55175fb47d3909ca728787d439 100644 (file)
@@ -103,6 +103,15 @@ const EnumPropertyItem rna_enum_space_type_items[] = {
        {0, NULL, 0, NULL, NULL}
 };
 
+
+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_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"},
+       {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"},
+       {0, NULL, 0, NULL, NULL}
+};
+
+
 #define V3D_S3D_CAMERA_LEFT        {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
 #define V3D_S3D_CAMERA_RIGHT       {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
 #define V3D_S3D_CAMERA_S3D         {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
@@ -2950,13 +2959,6 @@ static void rna_def_space_buttons(BlenderRNA *brna)
 
 static void rna_def_space_image(BlenderRNA *brna)
 {
-       static const EnumPropertyItem image_space_mode_items[] = {
-               {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_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"},
-               {0, NULL, 0, NULL, NULL}
-       };
-
        StructRNA *srna;
        PropertyRNA *prop;
 
@@ -3037,7 +3039,7 @@ static void rna_def_space_image(BlenderRNA *brna)
        /* mode */
        prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "mode");
-       RNA_def_property_enum_items(prop, image_space_mode_items);
+       RNA_def_property_enum_items(prop, rna_enum_space_image_mode_items);
        RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");