Blender  V2.59
rna_space.c
Go to the documentation of this file.
00001 /*
00002  * $Id: rna_space.c 37891 2011-06-28 09:42:17Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): Blender Foundation (2008)
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00030 #include <stdlib.h>
00031 
00032 #include "MEM_guardedalloc.h"
00033 
00034 #include "RNA_access.h"
00035 #include "RNA_define.h"
00036 
00037 #include "rna_internal.h"
00038 
00039 #include "BKE_key.h"
00040 
00041 #include "DNA_action_types.h"
00042 #include "DNA_key_types.h"
00043 #include "DNA_node_types.h"
00044 #include "DNA_object_types.h"
00045 #include "DNA_space_types.h"
00046 #include "DNA_view3d_types.h"
00047 
00048 #include "WM_api.h"
00049 #include "WM_types.h"
00050 
00051 EnumPropertyItem space_type_items[] = {
00052         {SPACE_EMPTY, "EMPTY", 0, "Empty", ""},
00053         {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
00054         {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
00055         {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
00056         {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
00057         {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
00058         {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
00059         {SPACE_INFO, "INFO", 0, "Info", ""},
00060         {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
00061         {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
00062         //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
00063         {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""},
00064         {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""},
00065         {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""},
00066         {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""},
00067         {SPACE_TIME, "TIMELINE", 0, "Timeline", ""},
00068         {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
00069         {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
00070         {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""},
00071         {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
00072         {0, NULL, 0, NULL, NULL}};
00073 
00074 static EnumPropertyItem draw_channels_items[] = {
00075         {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
00076         {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
00077         {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
00078         {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
00079         {0, NULL, 0, NULL, NULL}};
00080 
00081 static EnumPropertyItem transform_orientation_items[] = {
00082         {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
00083         {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
00084         {V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
00085         {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
00086         {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
00087         {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
00088         {0, NULL, 0, NULL, NULL}};
00089 
00090 EnumPropertyItem autosnap_items[] = {
00091         {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
00092         {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals"},
00093         {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)"},
00094         {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
00095         {0, NULL, 0, NULL, NULL}};
00096 
00097 EnumPropertyItem viewport_shade_items[] = {
00098         {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
00099         {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
00100         {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
00101         //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
00102         {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
00103         {0, NULL, 0, NULL, NULL}};
00104 
00105 #ifdef RNA_RUNTIME
00106 
00107 #include "DNA_anim_types.h"
00108 #include "DNA_scene_types.h"
00109 #include "DNA_screen_types.h"
00110 
00111 #include "BLI_math.h"
00112 
00113 #include "BKE_screen.h"
00114 #include "BKE_animsys.h"
00115 #include "BKE_brush.h"
00116 #include "BKE_colortools.h"
00117 #include "BKE_context.h"
00118 #include "BKE_depsgraph.h"
00119 #include "BKE_paint.h"
00120 
00121 #include "ED_image.h"
00122 #include "ED_screen.h"
00123 #include "ED_view3d.h"
00124 #include "ED_sequencer.h"
00125 
00126 #include "IMB_imbuf_types.h"
00127 
00128 static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
00129 {
00130         SpaceLink *space= (SpaceLink*)ptr->data;
00131 
00132         switch(space->spacetype) {
00133                 case SPACE_VIEW3D:
00134                         return &RNA_SpaceView3D;
00135                 case SPACE_IPO:
00136                         return &RNA_SpaceGraphEditor;
00137                 case SPACE_OUTLINER:
00138                         return &RNA_SpaceOutliner;
00139                 case SPACE_BUTS:
00140                         return &RNA_SpaceProperties;
00141                 case SPACE_FILE:
00142                         return &RNA_SpaceFileBrowser;
00143                 case SPACE_IMAGE:
00144                         return &RNA_SpaceImageEditor;
00145                 case SPACE_INFO:
00146                         return &RNA_SpaceInfo;
00147                 case SPACE_SEQ:
00148                         return &RNA_SpaceSequenceEditor;
00149                 case SPACE_TEXT:
00150                         return &RNA_SpaceTextEditor;
00151                 //case SPACE_IMASEL:
00152                 //      return &RNA_SpaceImageBrowser;
00153                 /*case SPACE_SOUND:
00154                         return &RNA_SpaceAudioWindow;*/
00155                 case SPACE_ACTION:
00156                         return &RNA_SpaceDopeSheetEditor;
00157                 case SPACE_NLA:
00158                         return &RNA_SpaceNLA;
00159                 /*case SPACE_SCRIPT:
00160                         return &RNA_SpaceScriptsWindow;*/
00161                 case SPACE_TIME:
00162                         return &RNA_SpaceTimeline;
00163                 case SPACE_NODE:
00164                         return &RNA_SpaceNodeEditor;
00165                 case SPACE_LOGIC:
00166                         return &RNA_SpaceLogicEditor;
00167                 case SPACE_CONSOLE:
00168                         return &RNA_SpaceConsole;
00169                 case SPACE_USERPREF:
00170                         return &RNA_SpaceUserPreferences;
00171                 default:
00172                         return &RNA_Space;
00173         }
00174 }
00175 
00176 static ScrArea *rna_area_from_space(PointerRNA *ptr)
00177 {
00178         bScreen *sc = (bScreen*)ptr->id.data;
00179         SpaceLink *link= (SpaceLink*)ptr->data;
00180         ScrArea *sa;
00181 
00182         for(sa=sc->areabase.first; sa; sa=sa->next)
00183                 if(BLI_findindex(&sa->spacedata, link) != -1)
00184                         return sa;
00185 
00186         return NULL;
00187 }
00188 
00189 static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
00190 {
00191         bScreen *sc = (bScreen*)ptr->id.data;
00192         ScrArea *sa;
00193         ARegion *ar;
00194         void *regiondata= ptr->data;
00195 
00196         *sa_r= NULL;
00197         *ar_r= NULL;
00198 
00199         for(sa=sc->areabase.first; sa; sa=sa->next) {
00200                 for(ar=sa->regionbase.first; ar; ar=ar->next) {
00201                         if(ar->regiondata == regiondata) {
00202                                 *sa_r= sa;
00203                                 *ar_r= ar;
00204                                 return;
00205                         }
00206                 }
00207         }
00208 }
00209 
00210 static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
00211 {
00212         Scene *scene = ((bScreen*)ptr->id.data)->scene;
00213         View3D *v3d= (View3D*)ptr->data;
00214         
00215         if (v3d->twmode < V3D_MANIP_CUSTOM)
00216                 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
00217         else
00218                 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
00219 }
00220 
00221 EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00222 {
00223         Scene *scene = NULL;
00224         ListBase *transform_spaces;
00225         TransformOrientation *ts= NULL;
00226         EnumPropertyItem tmp = {0, "", 0, "", ""};
00227         EnumPropertyItem *item= NULL;
00228         int i = V3D_MANIP_CUSTOM, totitem= 0;
00229 
00230         RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
00231         RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
00232         RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GIMBAL);
00233         RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
00234         RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
00235 
00236         if (ptr->type == &RNA_SpaceView3D)
00237                 scene = ((bScreen*)ptr->id.data)->scene;
00238         else
00239                 scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
00240 
00241         if(scene) {
00242                 transform_spaces = &scene->transform_spaces;
00243                 ts = transform_spaces->first;
00244         }
00245 
00246         if(ts)
00247         {
00248                 RNA_enum_item_add_separator(&item, &totitem);
00249 
00250                 for(; ts; ts = ts->next) {
00251                         tmp.identifier = ts->name;
00252                         tmp.name= ts->name;
00253                         tmp.value = i++;
00254                         RNA_enum_item_add(&item, &totitem, &tmp);
00255                 }
00256         }
00257 
00258         RNA_enum_item_end(&item, &totitem);
00259         *free= 1;
00260 
00261         return item;
00262 }
00263 
00264 /* Space 3D View */
00265 static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
00266 {
00267         View3D *v3d= (View3D*)(ptr->data);
00268         bScreen *sc= (bScreen*)ptr->id.data;
00269 
00270         v3d->scenelock = value;
00271 
00272         if(value) {
00273                 int bit;
00274                 v3d->lay= sc->scene->lay;
00275                 /* seek for layact */
00276                 bit= 0;
00277                 while(bit<32) {
00278                         if(v3d->lay & (1<<bit)) {
00279                                 v3d->layact= 1<<bit;
00280                                 break;
00281                         }
00282                         bit++;
00283                 }
00284                 v3d->camera= sc->scene->camera;
00285         }
00286 }
00287 
00288 static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
00289 {
00290         View3D *v3d= (View3D*)(ptr->data);
00291         bScreen *sc= (bScreen*)ptr->id.data;
00292         Scene *scene= (Scene *)sc->scene;
00293         float *loc = give_cursor(scene, v3d);
00294         
00295         copy_v3_v3(values, loc);
00296 }
00297 
00298 static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
00299 {
00300         View3D *v3d= (View3D*)(ptr->data);
00301         bScreen *sc= (bScreen*)ptr->id.data;
00302         Scene *scene= (Scene *)sc->scene;
00303         float *cursor = give_cursor(scene, v3d);
00304         
00305         copy_v3_v3(cursor, values);
00306 }
00307 
00308 static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
00309 {
00310         View3D *v3d= (View3D*)(ptr->data);
00311         
00312         v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
00313 }
00314 
00315 static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00316 {
00317         DAG_on_visible_update(bmain, FALSE);
00318 }
00319 
00320 static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
00321 {
00322         if (U.uiflag & USER_LOCKAROUND) {
00323                 View3D *v3d_act= (View3D*)(ptr->data);
00324 
00325                 /* TODO, space looper */
00326                 bScreen *screen;
00327                 for(screen= bmain->screen.first; screen; screen= screen->id.next) {
00328                         ScrArea *sa;
00329                         for(sa= screen->areabase.first; sa; sa= sa->next) {
00330                                 SpaceLink *sl;
00331                                 for(sl= sa->spacedata.first; sl ;sl= sl->next) {
00332                                         if(sl->spacetype==SPACE_VIEW3D) {
00333                                                 View3D *v3d= (View3D *)sl;
00334                                                 if (v3d != v3d_act) {
00335                                                         v3d->around= v3d_act->around;
00336                                                         v3d->flag= (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
00337                                                         ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
00338                                                 }
00339                                         }
00340                                 }
00341                         }
00342                 }
00343         }
00344 }
00345 
00346 static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
00347 {
00348         View3D *v3d= (View3D*)(ptr->data);
00349         ScrArea *sa= rna_area_from_space(ptr);
00350         void *regiondata= NULL;
00351         if(sa) {
00352                 ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
00353                 ARegion *ar= regionbase->last; /* always last in list, weak .. */
00354                 regiondata= ar->regiondata;
00355         }
00356 
00357         return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
00358 }
00359 
00360 static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
00361 {
00362         View3D *v3d= (View3D*)(ptr->data);
00363         ScrArea *sa= rna_area_from_space(ptr);
00364         void *regiondata= NULL;
00365         if(sa) {
00366                 ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
00367                 ARegion *ar= regionbase->last; /* always before last in list, weak .. */
00368 
00369                 ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
00370                 if(ar) {
00371                         regiondata= ar->regiondata;
00372                 }
00373         }
00374 
00375         return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
00376 }
00377 
00378 static void rna_RegionView3D_quadview_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
00379 {
00380         ScrArea *sa;
00381         ARegion *ar;
00382 
00383         rna_area_region_from_regiondata(ptr, &sa, &ar);
00384         if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
00385                 ED_view3d_quadview_update(sa, ar, FALSE);
00386 }
00387 
00388 /* same as above but call clip==TRUE */
00389 static void rna_RegionView3D_quadview_clip_update(Main *UNUSED(main), Scene *UNUSED(scene), PointerRNA *ptr)
00390 {
00391         ScrArea *sa;
00392         ARegion *ar;
00393 
00394         rna_area_region_from_regiondata(ptr, &sa, &ar);
00395         if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
00396                 ED_view3d_quadview_update(sa, ar, TRUE);
00397 }
00398 
00399 static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
00400 {
00401         RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00402         negate_v3_v3(values, rv3d->ofs);
00403 }
00404 
00405 static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
00406 {
00407         RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00408         negate_v3_v3(rv3d->ofs, values);
00409 }
00410 
00411 static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
00412 {
00413         RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00414         invert_qt_qt(values, rv3d->viewquat);
00415 }
00416 
00417 static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
00418 {
00419         RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00420         invert_qt_qt(rv3d->viewquat, values);
00421 }
00422 
00423 static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
00424 {
00425         RegionView3D *rv3d= (RegionView3D *)(ptr->data);
00426         negate_v3_v3(rv3d->ofs, values);
00427         ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
00428 }
00429 
00430 /* Space Image Editor */
00431 
00432 static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
00433 {
00434         return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
00435 }
00436 
00437 static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr))
00438 {
00439         paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
00440 
00441         ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
00442 }
00443 
00444 static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
00445 {
00446         SpaceImage *sima= (SpaceImage*)(ptr->data);
00447         return ED_space_image_show_render(sima);
00448 }
00449 
00450 static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
00451 {
00452         SpaceImage *sima= (SpaceImage*)(ptr->data);
00453         return ED_space_image_show_paint(sima);
00454 }
00455 
00456 static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
00457 {
00458         SpaceImage *sima= (SpaceImage*)(ptr->data);
00459         bScreen *sc= (bScreen*)ptr->id.data;
00460         return ED_space_image_show_uvedit(sima, sc->scene->obedit);
00461 }
00462 
00463 static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
00464 {
00465         SpaceImage *sima= (SpaceImage*)(ptr->data);
00466         bScreen *sc= (bScreen*)ptr->id.data;
00467 
00468         ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
00469 }
00470 
00471 static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
00472 {
00473         SpaceImage *sima= (SpaceImage*)ptr->data;
00474         EnumPropertyItem *item= NULL;
00475         ImBuf *ibuf;
00476         void *lock;
00477         int zbuf, alpha, totitem= 0;
00478 
00479         ibuf= ED_space_image_acquire_buffer(sima, &lock);
00480         
00481         alpha= ibuf && (ibuf->channels == 4);
00482         zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
00483 
00484         ED_space_image_release_buffer(sima, lock);
00485 
00486         if(alpha && zbuf)
00487                 return draw_channels_items;
00488 
00489         RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
00490 
00491         if(alpha) {
00492                 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
00493                 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
00494         }
00495         else if(zbuf) {
00496                 RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
00497         }
00498 
00499         RNA_enum_item_end(&item, &totitem);
00500         *free= 1;
00501 
00502         return item;
00503 }
00504 
00505 static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
00506 {
00507         SpaceImage *sima= (SpaceImage*)ptr->data;
00508         ScrArea *sa;
00509         ARegion *ar;
00510 
00511         values[0] = values[1] = 1;
00512 
00513         /* find aregion */
00514         sa= rna_area_from_space(ptr); /* can be NULL */
00515         ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
00516         if(ar) {
00517                 ED_space_image_zoom(sima, ar, &values[0], &values[1]);
00518         }
00519 }
00520 
00521 static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
00522 {
00523         SpaceImage *sima= (SpaceImage*)ptr->data;
00524         
00525         if (sima->flag & SI_COORDFLOATS) {
00526                 copy_v2_v2(values, sima->cursor);
00527         } else {
00528                 int w, h;
00529                 ED_space_image_size(sima, &w, &h);
00530                 
00531                 values[0] = sima->cursor[0] * w;
00532                 values[1] = sima->cursor[1] * h;
00533         }
00534 }
00535 
00536 static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
00537 {
00538         SpaceImage *sima= (SpaceImage*)ptr->data;
00539         
00540         if (sima->flag & SI_COORDFLOATS) {
00541                 copy_v2_v2(sima->cursor, values);
00542         } else {
00543                 int w, h;
00544                 ED_space_image_size(sima, &w, &h);
00545                 
00546                 sima->cursor[0] = values[0] / w;
00547                 sima->cursor[1] = values[1] / h;
00548         }
00549 }
00550 
00551 static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00552 {
00553         SpaceImage *sima= (SpaceImage*)ptr->data;
00554         ImBuf *ibuf;
00555         void *lock;
00556 
00557         ibuf= ED_space_image_acquire_buffer(sima, &lock);
00558         if(ibuf->rect_float)
00559                 curvemapping_do_ibuf(sima->cumap, ibuf);
00560         ED_space_image_release_buffer(sima, lock);
00561 
00562         WM_main_add_notifier(NC_IMAGE, sima->image);
00563 }
00564 
00565 static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00566 {
00567         SpaceImage *sima= (SpaceImage*)ptr->data;
00568         ImBuf *ibuf;
00569         void *lock;
00570         
00571         ibuf= ED_space_image_acquire_buffer(sima, &lock);
00572         if(ibuf) {
00573                 scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
00574                 WM_main_add_notifier(NC_IMAGE, sima->image);
00575         }
00576         ED_space_image_release_buffer(sima, lock);
00577 }
00578 
00579 /* Space Text Editor */
00580 
00581 static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
00582 {
00583         SpaceText *st= (SpaceText*)(ptr->data);
00584 
00585         st->wordwrap= value;
00586         st->left= 0;
00587 }
00588 
00589 static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
00590 {
00591         SpaceText *st= (SpaceText*)(ptr->data);
00592 
00593         st->text= value.data;
00594         st->top= 0;
00595 }
00596 
00597 static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00598 {
00599         SpaceText *st= (SpaceText*)ptr->data;
00600 
00601         if(st->text)
00602                 WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text);
00603 }
00604 
00605 
00606 /* Space Properties */
00607 
00608 /* note: this function exists only to avoid id refcounting */
00609 static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
00610 {
00611         SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00612         sbuts->pinid= value.data;
00613 }
00614 
00615 static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
00616 {
00617         SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00618 
00619         if(sbuts->pinid)
00620                 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
00621 
00622         return &RNA_ID;
00623 }
00624 
00625 static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00626 {
00627         SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00628         ID *id = sbuts->pinid;
00629         
00630         if (id == NULL) {
00631                 sbuts->flag &= ~SB_PIN_CONTEXT;
00632                 return;
00633         }
00634         
00635         switch (GS(id->name)) {
00636                 case ID_MA:
00637                         WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL);
00638                         break;
00639                 case ID_TE:
00640                         WM_main_add_notifier(NC_TEXTURE, NULL);
00641                         break;
00642                 case ID_WO:
00643                         WM_main_add_notifier(NC_WORLD, NULL);
00644                         break;
00645                 case ID_LA:
00646                         WM_main_add_notifier(NC_LAMP, NULL);
00647                         break;
00648         }
00649 }
00650 
00651 
00652 static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
00653 {
00654         SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00655         
00656         sbuts->mainb= value;
00657         sbuts->mainbuser = value;
00658 }
00659 
00660 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
00661 {
00662         SpaceButs *sbuts= (SpaceButs*)(ptr->data);
00663 
00664         sbuts->align= value;
00665         sbuts->re_align= 1;
00666 }
00667 
00668 /* Space Console */
00669 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
00670 {
00671         ConsoleLine *ci= (ConsoleLine*)ptr->data;
00672         strcpy(value, ci->line);
00673 }
00674 
00675 static int rna_ConsoleLine_body_length(PointerRNA *ptr)
00676 {
00677         ConsoleLine *ci= (ConsoleLine*)ptr->data;
00678         return ci->len;
00679 }
00680 
00681 static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
00682 {
00683         ConsoleLine *ci= (ConsoleLine*)ptr->data;
00684         int len= strlen(value);
00685         
00686         if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */
00687                 MEM_freeN(ci->line);
00688                 ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
00689                 ci->len_alloc= len + 1;
00690         }
00691         memcpy(ci->line, value, len + 1);
00692         ci->len= len;
00693 
00694         if(ci->cursor > len) /* clamp the cursor */
00695                 ci->cursor= len;
00696 }
00697 
00698 static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
00699 {
00700         ConsoleLine *ci= (ConsoleLine*)ptr->data;
00701 
00702         *min= 0;
00703         *max= ci->len; /* intentionally _not_ -1 */
00704 }
00705 
00706 /* Space Dopesheet */
00707 
00708 static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
00709 {
00710         SpaceAction *saction= (SpaceAction*)(ptr->data);
00711         bAction *act = (bAction*)value.data;
00712         
00713         if ((act == NULL) || (act->idroot == 0)) {
00714                 /* just set if we're clearing the action or if the action is "amorphous" still */
00715                 saction->action= act;
00716         }
00717         else {
00718                 /* action to set must strictly meet the mode criteria... */
00719                 if (saction->mode == SACTCONT_ACTION) {
00720                         /* currently, this is "object-level" only, until we have some way of specifying this */
00721                         if (act->idroot == ID_OB)
00722                                 saction->action = act;
00723                         else
00724                                 printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n", act->id.name+2);
00725                 }
00726                 else if (saction->mode == SACTCONT_SHAPEKEY) {
00727                         /* as the name says, "shapekey-level" only... */
00728                         if (act->idroot == ID_KE)
00729                                 saction->action = act;
00730                         else
00731                                 printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n", act->id.name+2);
00732                 }
00733                 else {
00734                         printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
00735                 }
00736         }
00737 }
00738 
00739 static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00740 {
00741         SpaceAction *saction= (SpaceAction*)(ptr->data);
00742         Object *obact= (scene->basact)? scene->basact->object: NULL;
00743 
00744         /* we must set this action to be the one used by active object (if not pinned) */
00745         if (obact/* && saction->pin == 0*/) {
00746                 AnimData *adt = NULL;
00747                 
00748                 if (saction->mode == SACTCONT_ACTION) {
00749                         // TODO: context selector could help decide this with more control?
00750                         adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
00751                 }
00752                 else if (saction->mode == SACTCONT_SHAPEKEY) {
00753                         Key *key = ob_get_key(obact);
00754                         if (key)
00755                                 adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
00756                 }
00757                 
00758                 /* set action */
00759                 if (adt) {
00760                         /* fix id-count of action we're replacing */
00761                         id_us_min(&adt->action->id);
00762                         
00763                         /* show new id-count of action we're replacing */
00764                         adt->action= saction->action;
00765                         id_us_plus(&adt->action->id);
00766                 }
00767                 
00768                 /* force depsgraph flush too */
00769                 DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA);
00770         }
00771 }
00772 
00773 static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
00774 {
00775         SpaceAction *saction= (SpaceAction*)(ptr->data);
00776         Object *obact= (scene->basact)? scene->basact->object: NULL;
00777         
00778         /* special exceptions for ShapeKey Editor mode */
00779         if (saction->mode == SACTCONT_SHAPEKEY) {
00780                 Key *key = ob_get_key(obact);
00781                 
00782                 /* 1)   update the action stored for the editor */
00783                 if (key)
00784                         saction->action = (key->adt)? key->adt->action : NULL;
00785                 else
00786                         saction->action = NULL;
00787                 
00788                 /* 2)   enable 'show sliders' by default, since one of the main
00789                  *              points of the ShapeKey Editor is to provide a one-stop shop
00790                  *              for controlling the shapekeys, whose main control is the value
00791                  */
00792                 saction->flag |= SACTION_SLIDERS;
00793         }
00794         /* make sure action stored is valid */
00795         else if (saction->mode == SACTCONT_ACTION) {
00796                 /* 1)   update the action stored for the editor */
00797                 // TODO: context selector could help decide this with more control?
00798                 if (obact)
00799                         saction->action = (obact->adt)? obact->adt->action : NULL;
00800                 else
00801                         saction->action = NULL;
00802         }
00803 }
00804 
00805 /* Space Graph Editor */
00806 
00807 static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
00808 {
00809         //SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
00810         ScrArea *sa= CTX_wm_area(C);
00811         
00812         /* after changing view mode, must force recalculation of F-Curve colors 
00813          * which can only be achieved using refresh as opposed to redraw
00814          */
00815         ED_area_tag_refresh(sa);
00816 }
00817 
00818 static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
00819 {
00820         SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
00821         return (sipo->ghostCurves.first != NULL);
00822 }
00823 
00824 static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr)
00825 {
00826         int view = RNA_enum_get(ptr, "view_type");
00827 
00828         ED_sequencer_update_view(C, view);
00829 }
00830 
00831 static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
00832 {
00833         BGpic *bgpic= (BGpic *)ptr->data;
00834         return 1.0f-bgpic->blend;
00835 }
00836 
00837 static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
00838 {
00839         BGpic *bgpic= (BGpic *)ptr->data;
00840         bgpic->blend = 1.0f - value;
00841 }
00842 
00843 static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
00844 {
00845         Scene *scene = CTX_data_scene(C);
00846         Object *ob = CTX_data_active_object(C);
00847         EnumPropertyItem *item= NULL;
00848         EnumPropertyItem tmp= {0, "", 0, "", ""};
00849         int totitem= 0;
00850 
00851         if(ob) {
00852                 if(ob->type == OB_LAMP) {
00853                         tmp.value = SB_TEXC_MAT_OR_LAMP;
00854                         tmp.description = "Show Lamp Textures";
00855                         tmp.identifier = "LAMP";
00856                         tmp.icon = ICON_LAMP_POINT;
00857                         RNA_enum_item_add(&item, &totitem, &tmp);
00858                 }
00859                 else if(ob->totcol) {
00860                         tmp.value = SB_TEXC_MAT_OR_LAMP;
00861                         tmp.description = "Show Material Textures";
00862                         tmp.identifier = "MATERIAL";
00863                         tmp.icon = ICON_MATERIAL;
00864                         RNA_enum_item_add(&item, &totitem, &tmp);
00865                 }
00866 
00867                 if(ob->particlesystem.first) {
00868                         tmp.value = SB_TEXC_PARTICLES;
00869                         tmp.description = "Show Particle Textures";
00870                         tmp.identifier = "PARTICLE";
00871                         tmp.icon = ICON_PARTICLES;
00872                         RNA_enum_item_add(&item, &totitem, &tmp);
00873                 }
00874         }
00875 
00876         if(scene && scene->world) {
00877                 tmp.value = SB_TEXC_WORLD;
00878                 tmp.description = "Show World Textures";
00879                 tmp.identifier = "WORLD";
00880                 tmp.icon = ICON_WORLD;
00881                 RNA_enum_item_add(&item, &totitem, &tmp);
00882         }
00883 
00884         tmp.value = SB_TEXC_BRUSH;
00885         tmp.description = "Show Brush Textures";
00886         tmp.identifier = "BRUSH";
00887         tmp.icon = ICON_BRUSH_DATA;
00888         RNA_enum_item_add(&item, &totitem, &tmp);
00889         
00890         RNA_enum_item_end(&item, &totitem);
00891         *free = 1;
00892 
00893         return item;
00894 }
00895 
00896 #else
00897 
00898 static void rna_def_space(BlenderRNA *brna)
00899 {
00900         StructRNA *srna;
00901         PropertyRNA *prop;
00902         
00903         srna= RNA_def_struct(brna, "Space", NULL);
00904         RNA_def_struct_sdna(srna, "SpaceLink");
00905         RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
00906         RNA_def_struct_refine_func(srna, "rna_Space_refine");
00907         
00908         prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
00909         RNA_def_property_enum_sdna(prop, NULL, "spacetype");
00910         RNA_def_property_enum_items(prop, space_type_items);
00911         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
00912         RNA_def_property_ui_text(prop, "Type", "Space data type");
00913 }
00914 
00915 static void rna_def_space_image_uv(BlenderRNA *brna)
00916 {
00917         StructRNA *srna;
00918         PropertyRNA *prop;
00919 
00920         static EnumPropertyItem sticky_mode_items[] = {
00921                 {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
00922                 {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex"},
00923                 {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location"},
00924                 {0, NULL, 0, NULL, NULL}};
00925 
00926         static EnumPropertyItem dt_uv_items[] = {
00927                 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
00928                 {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
00929                 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
00930                 {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
00931                 {0, NULL, 0, NULL, NULL}};
00932 
00933         static EnumPropertyItem dt_uvstretch_items[] = {
00934                 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
00935                 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
00936                 {0, NULL, 0, NULL, NULL}};
00937 
00938         static EnumPropertyItem pivot_items[] = {
00939                 {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
00940                 {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
00941                 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
00942                 {0, NULL, 0, NULL, NULL}};
00943 
00944         srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
00945         RNA_def_struct_sdna(srna, "SpaceImage");
00946         RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
00947         RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
00948 
00949         /* selection */
00950         prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
00951         RNA_def_property_enum_sdna(prop, NULL, "sticky");
00952         RNA_def_property_enum_items(prop, sticky_mode_items);
00953         RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected");
00954         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00955 
00956         /* drawing */
00957         prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
00958         RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
00959         RNA_def_property_enum_items(prop, dt_uv_items);
00960         RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
00961         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00962 
00963         prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
00964         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
00965         RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
00966         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00967 
00968         prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
00969         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
00970         RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)");
00971         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00972 
00973         prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
00974         RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
00975         RNA_def_property_enum_items(prop, dt_uvstretch_items);
00976         RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
00977         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00978 
00979         prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
00980         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
00981         RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
00982         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00983 
00984         prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
00985         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
00986         RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
00987         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00988 
00989         prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
00990         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
00991         RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
00992         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00993 
00994         prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
00995         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
00996         RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
00997         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
00998 
00999         prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
01000         RNA_def_property_array(prop, 2);
01001         RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL);
01002         RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
01003         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01004 
01005         /* todo: move edge and face drawing options here from G.f */
01006 
01007         prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
01008         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
01009         RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
01010         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01011 
01012         prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
01013         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
01014         RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
01015         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01016 
01017         prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
01018         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
01019         RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices");
01020         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01021 
01022         prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
01023         RNA_def_property_enum_sdna(prop, NULL, "around");
01024         RNA_def_property_enum_items(prop, pivot_items);
01025         RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
01026         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01027 }
01028 
01029 static void rna_def_space_outliner(BlenderRNA *brna)
01030 {
01031         StructRNA *srna;
01032         PropertyRNA *prop;
01033 
01034         static EnumPropertyItem display_mode_items[] = {
01035                 {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"},
01036                 {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"},
01037                 {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"},
01038                 {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"},
01039                 {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"},
01040                 {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"},
01041                 {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"},
01042                 {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"},
01043                 {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"},
01044                 {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"},
01045                 {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"},
01046                 {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"},
01047                 {0, NULL, 0, NULL, NULL}};
01048         
01049         srna= RNA_def_struct(brna, "SpaceOutliner", "Space");
01050         RNA_def_struct_sdna(srna, "SpaceOops");
01051         RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
01052         
01053         prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
01054         RNA_def_property_enum_sdna(prop, NULL, "outlinevis");
01055         RNA_def_property_enum_items(prop, display_mode_items);
01056         RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
01057         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01058         
01059         prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
01060         RNA_def_property_string_sdna(prop, NULL, "search_string");
01061         RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
01062         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01063         
01064         prop= RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
01065         RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
01066         RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
01067         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01068         
01069         prop= RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
01070         RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
01071         RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
01072         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01073         
01074         prop= RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
01075         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
01076         RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
01077         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL);
01078 }
01079 
01080 static void rna_def_background_image(BlenderRNA *brna)
01081 {
01082         StructRNA *srna;
01083         PropertyRNA *prop;
01084 
01085         /* note: combinations work but dont flip so arnt that useful */
01086         static EnumPropertyItem bgpic_axis_items[] = {
01087                 {0, "", 0, "X Axis", ""},
01088                 {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
01089                 {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
01090                 /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
01091                 {0, "", 0, "Y Axis", ""},
01092                 {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
01093                 {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
01094                 /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
01095                 {0, "", 0, "Z Axis", ""},
01096                 {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
01097                 {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
01098                 /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
01099                 {0, "", 0, "Other", ""},
01100                 {0, "ALL", 0, "All Views", "Show background image in all views"},
01101                 {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
01102                 {0, NULL, 0, NULL, NULL}};
01103 
01104         srna= RNA_def_struct(brna, "BackgroundImage", NULL);
01105         RNA_def_struct_sdna(srna, "BGpic");
01106         RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
01107 
01108         prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
01109         RNA_def_property_pointer_sdna(prop, NULL, "ima");
01110         RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
01111         RNA_def_property_flag(prop, PROP_EDITABLE);
01112         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01113 
01114         prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
01115         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01116         RNA_def_property_pointer_sdna(prop, NULL, "iuser");
01117         RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
01118         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01119         
01120         prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
01121         RNA_def_property_float_sdna(prop, NULL, "xof");
01122         RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the world origin");
01123         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01124         
01125         prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
01126         RNA_def_property_float_sdna(prop, NULL, "yof");
01127         RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the world origin");
01128         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01129         
01130         prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
01131         RNA_def_property_float_sdna(prop, NULL, "size");
01132         RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
01133         RNA_def_property_range(prop, 0.0, FLT_MAX);
01134         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01135         
01136         prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
01137         RNA_def_property_float_sdna(prop, NULL, "blend");
01138         RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
01139         RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
01140         RNA_def_property_range(prop, 0.0, 1.0);
01141         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01142 
01143         prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
01144         RNA_def_property_enum_sdna(prop, NULL, "view");
01145         RNA_def_property_enum_items(prop, bgpic_axis_items);
01146         RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
01147         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01148 
01149         prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
01150         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
01151         RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
01152         RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
01153 
01154 }
01155 
01156 static void rna_def_space_view3d(BlenderRNA *brna)
01157 {
01158         StructRNA *srna;
01159         PropertyRNA *prop;
01160         const int matrix_dimsize[]= {4, 4};
01161                 
01162         static EnumPropertyItem pivot_items[] = {
01163                 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", "Pivot around bounding box center of selected object(s)"},
01164                 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
01165                 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"},
01166                 {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"},
01167                 {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
01168                 {0, NULL, 0, NULL, NULL}};
01169 
01170         static EnumPropertyItem rv3d_persp_items[] = {
01171                 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
01172                 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
01173                 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
01174                 {0, NULL, 0, NULL, NULL}};
01175         
01176         srna= RNA_def_struct(brna, "SpaceView3D", "Space");
01177         RNA_def_struct_sdna(srna, "View3D");
01178         RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
01179         
01180         prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
01181         RNA_def_property_flag(prop, PROP_EDITABLE);
01182         RNA_def_property_pointer_sdna(prop, NULL, "camera");
01183         RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)");
01184         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01185         
01186         prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
01187         RNA_def_property_flag(prop, PROP_EDITABLE);
01188         RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
01189         RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
01190         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01191         
01192         prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
01193         RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
01194         RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
01195         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01196 
01197         prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
01198         RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
01199         RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
01200         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01201 
01202         prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
01203         RNA_def_property_enum_sdna(prop, NULL, "drawtype");
01204         RNA_def_property_enum_items(prop, viewport_shade_items);
01205         RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
01206         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01207 
01208         prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
01209         RNA_def_property_pointer_sdna(prop, NULL, "localvd");
01210         RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility");
01211         
01212         prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
01213         RNA_def_property_array(prop, 3);
01214         RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL);
01215         RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
01216         RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
01217         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01218         
01219         prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
01220         RNA_def_property_float_sdna(prop, NULL, "lens");
01221         RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view");
01222         RNA_def_property_range(prop, 1.0f, 250.0f);
01223         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01224         
01225         prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
01226         RNA_def_property_float_sdna(prop, NULL, "near");
01227         RNA_def_property_range(prop, 0.001f, FLT_MAX);
01228         RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
01229         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01230 
01231         prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
01232         RNA_def_property_float_sdna(prop, NULL, "far");
01233         RNA_def_property_range(prop, 1.0f, FLT_MAX);
01234         RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
01235         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01236 
01237         prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
01238         RNA_def_property_float_sdna(prop, NULL, "grid");
01239         RNA_def_property_ui_text(prop, "Grid Scale", "The distance between 3D View grid lines");
01240         RNA_def_property_range(prop, 0.0f, FLT_MAX);
01241         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01242 
01243         prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
01244         RNA_def_property_int_sdna(prop, NULL, "gridlines");
01245         RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view");
01246         RNA_def_property_range(prop, 0, 1024);
01247         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01248         
01249         prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
01250         RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
01251         RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines");
01252         RNA_def_property_range(prop, 1, 1024);
01253         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01254         
01255         prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
01256         RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
01257         RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
01258         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01259         
01260         prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
01261         RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
01262         RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
01263         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01264         
01265         prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
01266         RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y);
01267         RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
01268         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01269         
01270         prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
01271         RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z);
01272         RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
01273         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01274         
01275         prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
01276         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
01277         RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views");
01278         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01279         
01280         prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
01281         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
01282         RNA_def_property_ui_text(prop, "All Object Origins", "Show the object origin center dot for all (selected and unselected) objects");
01283         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01284 
01285         prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
01286         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES);
01287         RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
01288         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01289         
01290         prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
01291         RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX);
01292         RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
01293         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01294 
01295         prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
01296         RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA);
01297         RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view");
01298         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01299 
01300         prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
01301         RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
01302         RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
01303         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01304         
01305         prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
01306         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
01307         RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
01308         RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
01309         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01310 
01311         prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
01312         RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
01313         RNA_def_property_struct_type(prop, "BackgroundImage");
01314         RNA_def_property_ui_text(prop, "Background Images", "List of background images");
01315         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01316 
01317         prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
01318         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
01319         RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
01320         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01321 
01322         prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
01323         RNA_def_property_enum_sdna(prop, NULL, "around");
01324         RNA_def_property_enum_items(prop, pivot_items);
01325         RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
01326         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
01327         
01328         prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
01329         RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
01330         RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only");
01331         RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
01332         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
01333 
01334         prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
01335         RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
01336         RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
01337         RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
01338         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01339         
01340         prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
01341         RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE);
01342         RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
01343         RNA_def_property_ui_icon(prop, ICON_MAN_TRANS, 0);
01344         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01345         
01346         prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
01347         RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE);
01348         RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
01349         RNA_def_property_ui_icon(prop, ICON_MAN_ROT, 0);
01350         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01351         
01352         prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
01353         RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE);
01354         RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
01355         RNA_def_property_ui_icon(prop, ICON_MAN_SCALE, 0);
01356         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01357         
01358         prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
01359         RNA_def_property_enum_sdna(prop, NULL, "twmode");
01360         RNA_def_property_enum_items(prop, transform_orientation_items);
01361         RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
01362         RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
01363         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01364 
01365         prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
01366         RNA_def_property_struct_type(prop, "TransformOrientation");
01367         RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
01368         RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation");
01369 
01370         prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
01371         RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
01372         RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
01373         RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
01374         RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
01375         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01376 
01377         prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01378         RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
01379         RNA_def_property_array(prop, 20);
01380         RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
01381         RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
01382         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_layer_update");
01383         
01384         prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
01385         RNA_def_property_boolean_sdna(prop, NULL, "lay_used", 1);
01386         RNA_def_property_array(prop, 20);
01387         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01388         RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");
01389 
01390         prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
01391         RNA_def_property_struct_type(prop, "RegionView3D");
01392         RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
01393         RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");
01394 
01395         prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
01396         RNA_def_property_struct_type(prop, "RegionView3D");
01397         RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL);
01398         RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");
01399 
01400         /* region */
01401 
01402         srna= RNA_def_struct(brna, "RegionView3D", NULL);
01403         RNA_def_struct_sdna(srna, "RegionView3D");
01404         RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
01405 
01406         prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
01407         RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
01408         RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
01409         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
01410         
01411         prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
01412         RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
01413         RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
01414         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
01415         
01416         prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
01417         RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
01418         RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
01419         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
01420         
01421         prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
01422         RNA_def_property_float_sdna(prop, NULL, "persmat");
01423         RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
01424         RNA_def_property_multi_array(prop, 2, matrix_dimsize);
01425         RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
01426         
01427         prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
01428         RNA_def_property_float_sdna(prop, NULL, "viewmat");
01429         RNA_def_property_multi_array(prop, 2, matrix_dimsize);
01430         RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL);
01431         RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
01432         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01433 
01434         prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
01435         RNA_def_property_enum_sdna(prop, NULL, "persp");
01436         RNA_def_property_enum_items(prop, rv3d_persp_items);
01437         RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
01438         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01439 
01440         prop= RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
01441         RNA_def_property_boolean_sdna(prop, NULL, "is_persp", 1);
01442         RNA_def_property_ui_text(prop, "Is Perspective", "");
01443         RNA_def_property_flag(prop, PROP_EDITABLE);
01444         
01445         prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
01446 #if 0
01447         RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
01448 #else
01449         RNA_def_property_array(prop, 3);
01450         RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", NULL);
01451 #endif
01452         RNA_def_property_ui_text(prop, "View Location", "View pivot location");
01453         RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
01454         RNA_def_property_update(prop, NC_WINDOW, NULL);
01455         
01456         prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); // cant use because its inverted
01457 #if 0
01458         RNA_def_property_float_sdna(prop, NULL, "viewquat");
01459 #else
01460         RNA_def_property_array(prop, 4);
01461         RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", NULL);
01462 #endif
01463         RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
01464         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01465         
01466         /* not sure we need rna access to these but adding anyway */
01467         prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
01468         RNA_def_property_float_sdna(prop, NULL, "dist");
01469         RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
01470         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
01471 }
01472 
01473 static void rna_def_space_buttons(BlenderRNA *brna)
01474 {
01475         StructRNA *srna;
01476         PropertyRNA *prop;
01477 
01478         static EnumPropertyItem buttons_context_items[] = {
01479                 {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
01480                 {BCONTEXT_RENDER, "RENDER", ICON_SCENE_DATA, "Render", "Render"},
01481                 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
01482                 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
01483                 {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
01484                 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
01485                 {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
01486                 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
01487                 {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
01488                 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
01489                 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
01490                 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
01491                 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
01492                 {0, NULL, 0, NULL, NULL}};
01493                 
01494         static EnumPropertyItem align_items[] = {
01495                 {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
01496                 {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
01497                 {0, NULL, 0, NULL, NULL}};
01498 
01499         static EnumPropertyItem buttons_texture_context_items[] = {
01500                 {SB_TEXC_MAT_OR_LAMP, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
01501                 {0, NULL, 0, NULL, NULL}}; //actually populated dynamically trough a function
01502                 
01503         srna= RNA_def_struct(brna, "SpaceProperties", "Space");
01504         RNA_def_struct_sdna(srna, "SpaceButs");
01505         RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
01506         
01507         prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
01508         RNA_def_property_enum_sdna(prop, NULL, "mainb");
01509         RNA_def_property_enum_items(prop, buttons_context_items);
01510         RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", NULL);
01511         RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
01512         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
01513         
01514         prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
01515         RNA_def_property_enum_sdna(prop, NULL, "align");
01516         RNA_def_property_enum_items(prop, align_items);
01517         RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
01518         RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
01519         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
01520 
01521         prop= RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE);
01522         RNA_def_property_enum_items(prop, buttons_texture_context_items);
01523         RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_texture_context_itemf");
01524         RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit");
01525         RNA_def_property_update(prop, NC_TEXTURE, NULL);
01526 
01527         /* pinned data */
01528         prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
01529         RNA_def_property_pointer_sdna(prop, NULL, "pinid");
01530         RNA_def_property_struct_type(prop, "ID");
01531         /* note: custom set function is ONLY to avoid rna setting a user for this. */
01532         RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL);
01533         RNA_def_property_flag(prop, PROP_EDITABLE);
01534         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
01535 
01536         prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
01537         RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
01538         RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
01539 }
01540 
01541 static void rna_def_space_image(BlenderRNA *brna)
01542 {
01543         StructRNA *srna;
01544         PropertyRNA *prop;
01545 
01546         srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
01547         RNA_def_struct_sdna(srna, "SpaceImage");
01548         RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
01549 
01550         /* image */
01551         prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
01552         RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
01553         RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
01554         RNA_def_property_flag(prop, PROP_EDITABLE);
01555         RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too
01556 
01557         prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
01558         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01559         RNA_def_property_pointer_sdna(prop, NULL, "iuser");
01560         RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
01561         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01562 
01563         prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
01564         RNA_def_property_pointer_sdna(prop, NULL, "cumap");
01565         RNA_def_property_ui_text(prop, "Curve", "Color curve mapping to use for displaying the image");
01566         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
01567 
01568         prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
01569         RNA_def_property_pointer_sdna(prop, NULL, "scopes");
01570         RNA_def_property_struct_type(prop, "Scopes");
01571         RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics.");
01572         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
01573 
01574         prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
01575         RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
01576         RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
01577         RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
01578         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01579 
01580         prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
01581         RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
01582         RNA_def_property_struct_type(prop, "Histogram");
01583         RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
01584 
01585         prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
01586         RNA_def_property_array(prop, 2);
01587         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01588         RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", NULL, NULL);
01589         RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
01590         
01591         /* image draw */
01592         prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
01593         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
01594         RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
01595         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01596 
01597         prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
01598         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
01599         RNA_def_property_enum_items(prop, draw_channels_items);
01600         RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
01601         RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
01602         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
01603 
01604         /* uv */
01605         prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
01606         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01607         RNA_def_property_struct_type(prop, "SpaceUVEditor");
01608         RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
01609         RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
01610         
01611         /* paint */
01612         prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
01613         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
01614         RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
01615         RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
01616         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
01617 
01618         /* grease pencil */
01619         prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
01620         RNA_def_property_pointer_sdna(prop, NULL, "gpd");
01621         RNA_def_property_flag(prop, PROP_EDITABLE);
01622         RNA_def_property_struct_type(prop, "GreasePencil");
01623         RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
01624 
01625         prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
01626         RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
01627         RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
01628 
01629         /* update */
01630         prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
01631         RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
01632         RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform");
01633 
01634         /* state */
01635         prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
01636         RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
01637         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01638         RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
01639 
01640         prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
01641         RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
01642         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01643         RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
01644 
01645         prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
01646         RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
01647         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
01648         RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
01649 
01650         rna_def_space_image_uv(brna);
01651 }
01652 
01653 static void rna_def_space_sequencer(BlenderRNA *brna)
01654 {
01655         StructRNA *srna;
01656         PropertyRNA *prop;
01657         
01658         static EnumPropertyItem view_type_items[] = {
01659                 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
01660                 {SEQ_VIEW_PREVIEW,  "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
01661                 {SEQ_VIEW_SEQUENCE_PREVIEW,  "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
01662                 {0, NULL, 0, NULL, NULL}};
01663 
01664         static EnumPropertyItem display_mode_items[] = {
01665                 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
01666                 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
01667                 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
01668                 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
01669                 {0, NULL, 0, NULL, NULL}};
01670 
01671         static EnumPropertyItem proxy_render_size_items[] = {
01672                 {SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
01673                 {SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
01674                 {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
01675                 {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
01676                 {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
01677                 {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
01678                 {0, NULL, 0, NULL, NULL}};
01679         
01680         srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
01681         RNA_def_struct_sdna(srna, "SpaceSeq");
01682         RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
01683         
01684         /* view type, fairly important */
01685         prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
01686         RNA_def_property_enum_sdna(prop, NULL, "view");
01687         RNA_def_property_enum_items(prop, view_type_items);
01688         RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
01689         RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
01690         RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update");
01691 
01692         /* display type, fairly important */
01693         prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
01694         RNA_def_property_enum_sdna(prop, NULL, "mainb");
01695         RNA_def_property_enum_items(prop, display_mode_items);
01696         RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output");
01697         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01698                 
01699         /* flag's */
01700         prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
01701         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
01702         RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
01703         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01704         
01705         prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
01706         RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
01707         RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
01708         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01709         
01710         prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
01711         RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
01712         RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips");
01713         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01714         
01715         prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
01716         RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
01717         RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
01718         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01719 
01720         prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
01721         RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
01722         RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");    
01723         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01724         
01725         prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
01726         RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
01727         RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay"); 
01728         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01729         
01730         /* grease pencil */
01731         prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
01732         RNA_def_property_pointer_sdna(prop, NULL, "gpd");
01733         RNA_def_property_struct_type(prop, "UnknownType");
01734         RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
01735         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01736         
01737         prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
01738         RNA_def_property_int_sdna(prop, NULL, "chanshown");
01739         RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined");
01740         RNA_def_property_range(prop, -5, 32); // MAXSEQ --- todo, move from BKE_sequencer.h, allow up to 5 layers up the metastack. Should be dynamic...
01741         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01742         
01743         prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
01744         RNA_def_property_int_sdna(prop, NULL, "zebra");
01745         RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
01746         RNA_def_property_range(prop, 0, 110);
01747         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01748         
01749         prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
01750         RNA_def_property_enum_sdna(prop, NULL, "render_size");
01751         RNA_def_property_enum_items(prop, proxy_render_size_items);
01752         RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
01753         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01754         
01755         
01756         /* not sure we need rna access to these but adding anyway */
01757         prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
01758         RNA_def_property_float_sdna(prop, NULL, "xof");
01759         RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
01760         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01761 
01762         prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
01763         RNA_def_property_float_sdna(prop, NULL, "yof");
01764         RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
01765         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01766         
01767         prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
01768         RNA_def_property_float_sdna(prop, NULL, "zoom");
01769         RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");   
01770         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
01771 }
01772 
01773 static void rna_def_space_text(BlenderRNA *brna)
01774 {
01775         StructRNA *srna;
01776         PropertyRNA *prop;
01777 
01778         srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
01779         RNA_def_struct_sdna(srna, "SpaceText");
01780         RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
01781 
01782         /* text */
01783         prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
01784         RNA_def_property_flag(prop, PROP_EDITABLE);
01785         RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
01786         RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
01787         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01788 
01789         /* display */
01790         prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
01791         RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
01792         RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
01793         RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
01794         RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
01795         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01796 
01797         prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
01798         RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
01799         RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
01800         RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
01801         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01802 
01803         prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
01804         RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
01805         RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
01806         RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
01807         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01808         
01809         prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
01810         RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
01811         RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
01812         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01813 
01814         prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
01815         RNA_def_property_int_sdna(prop, NULL, "tabnumber");
01816         RNA_def_property_range(prop, 2, 8);
01817         RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
01818         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
01819 
01820         prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
01821         RNA_def_property_int_sdna(prop, NULL, "lheight");
01822         RNA_def_property_range(prop, 8, 32);
01823         RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
01824         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01825 
01826         prop= RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
01827         RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_SHOW_MARGIN);
01828         RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
01829         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01830 
01831         prop= RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
01832         RNA_def_property_int_sdna(prop, NULL, "margin_column");
01833         RNA_def_property_range(prop, 0, 1024);
01834         RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
01835         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01836 
01837         /* functionality options */
01838         prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
01839         RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
01840         RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
01841         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01842         
01843         prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
01844         RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
01845         RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
01846         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01847         
01848         /* find */
01849         prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
01850         RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
01851         RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
01852         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01853 
01854         prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
01855         RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
01856         RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
01857         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01858 
01859         prop= RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
01860         RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_MATCH_CASE);
01861         RNA_def_property_ui_text(prop, "Match case", "Search string is sensitive to uppercase and lowercase letters");
01862         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01863 
01864         prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
01865         RNA_def_property_string_sdna(prop, NULL, "findstr");
01866         RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
01867         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01868 
01869         prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
01870         RNA_def_property_string_sdna(prop, NULL, "replacestr");
01871         RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
01872         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
01873 }
01874 
01875 static void rna_def_space_dopesheet(BlenderRNA *brna)
01876 {
01877         StructRNA *srna;
01878         PropertyRNA *prop;
01879         
01880         static EnumPropertyItem mode_items[] = {
01881                 {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", "DopeSheet Editor"},
01882                 {SACTCONT_ACTION, "ACTION", 0, "Action Editor", "Action Editor"},
01883                 {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", "ShapeKey Editor"},
01884                 {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", "Grease Pencil"},
01885                 {0, NULL, 0, NULL, NULL}};
01886                 
01887         
01888         srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
01889         RNA_def_struct_sdna(srna, "SpaceAction");
01890         RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data");
01891 
01892         /* data */
01893         prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
01894         RNA_def_property_flag(prop, PROP_EDITABLE);
01895         RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, "rna_Action_actedit_assign_poll");
01896         RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
01897         RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
01898         
01899         /* mode */
01900         prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01901         RNA_def_property_enum_sdna(prop, NULL, "mode");
01902         RNA_def_property_enum_items(prop, mode_items);
01903         RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
01904         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
01905         
01906         /* display */
01907         prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
01908         RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
01909         RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
01910         RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
01911         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01912         
01913         prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
01914         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
01915         RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
01916         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01917         
01918         prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
01919         RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
01920         RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
01921         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01922         
01923         prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
01924         RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
01925         RNA_def_property_ui_text(prop, "Show Pose Markers", "Show markers belonging to the active action instead of Scene markers (Action and Shape Key Editors only)");
01926         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01927         
01928         /* editing */
01929         prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
01930         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
01931         RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
01932         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01933         
01934         prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
01935         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
01936         RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
01937         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01938 
01939         prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
01940         RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
01941         RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
01942 
01943         /* dopesheet */
01944         prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
01945         RNA_def_property_struct_type(prop, "DopeSheet");
01946         RNA_def_property_pointer_sdna(prop, NULL, "ads");
01947         RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
01948 
01949         /* autosnap */
01950         prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
01951         RNA_def_property_enum_sdna(prop, NULL, "autosnap");
01952         RNA_def_property_enum_items(prop, autosnap_items);
01953         RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
01954         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
01955 }
01956 
01957 static void rna_def_space_graph(BlenderRNA *brna)
01958 {
01959         StructRNA *srna;
01960         PropertyRNA *prop;
01961         
01962         static EnumPropertyItem mode_items[] = {
01963                 {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", "Edit f-curves"},
01964                 {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", "Edit drivers"},
01965                 {0, NULL, 0, NULL, NULL}};
01966                 
01967                 /* this is basically the same as the one for the 3D-View, but with some entries ommitted */
01968         static EnumPropertyItem gpivot_items[] = {
01969                 {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
01970                 {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
01971                 {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
01972                 //{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
01973                 //{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
01974                 {0, NULL, 0, NULL, NULL}};
01975 
01976         
01977         srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
01978         RNA_def_struct_sdna(srna, "SpaceIpo");
01979         RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
01980         
01981         /* mode */
01982         prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
01983         RNA_def_property_enum_sdna(prop, NULL, "mode");
01984         RNA_def_property_enum_items(prop, mode_items);
01985         RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
01986         RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
01987         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
01988         
01989         /* display */
01990         prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
01991         RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
01992         RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
01993         RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
01994         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
01995         
01996         prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
01997         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
01998         RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
01999         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02000         
02001         prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
02002         RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
02003         RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
02004         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02005         
02006         prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
02007         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
02008         RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
02009         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02010         
02011         prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
02012         RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
02013         RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable");
02014         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02015         
02016         prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
02017         RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
02018         RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
02019         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02020         
02021         prop= RNA_def_property(srna, "use_fancy_drawing", PROP_BOOLEAN, PROP_NONE);
02022         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
02023         RNA_def_property_ui_text(prop, "Use Fancy Drawing", "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance");
02024         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02025         
02026         /* editing */
02027         prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
02028         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
02029         RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
02030         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02031         
02032         prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
02033         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
02034         RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
02035         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02036         
02037         /* cursor */
02038         prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
02039         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
02040         RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
02041         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02042         
02043         prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
02044         RNA_def_property_float_sdna(prop, NULL, "cursorVal");
02045         RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
02046         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02047         
02048         prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
02049         RNA_def_property_enum_sdna(prop, NULL, "around");
02050         RNA_def_property_enum_items(prop, gpivot_items);
02051         RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
02052         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02053 
02054         /* dopesheet */
02055         prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
02056         RNA_def_property_struct_type(prop, "DopeSheet");
02057         RNA_def_property_pointer_sdna(prop, NULL, "ads");
02058         RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
02059 
02060         /* autosnap */
02061         prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
02062         RNA_def_property_enum_sdna(prop, NULL, "autosnap");
02063         RNA_def_property_enum_items(prop, autosnap_items);
02064         RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
02065         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02066         
02067         /* readonly state info */
02068         prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
02069         RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
02070         RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
02071         RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
02072         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
02073 }
02074 
02075 static void rna_def_space_nla(BlenderRNA *brna)
02076 {
02077         StructRNA *srna;
02078         PropertyRNA *prop;
02079         
02080         srna= RNA_def_struct(brna, "SpaceNLA", "Space");
02081         RNA_def_struct_sdna(srna, "SpaceNla");
02082         RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
02083         
02084         /* display */
02085         prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
02086         RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
02087         RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
02088         RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
02089         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02090         
02091         prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02092         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
02093         RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02094         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02095         
02096         prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
02097         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
02098         RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips");
02099         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02100         
02101         /* editing */
02102         prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
02103         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
02104         RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views");
02105         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02106 
02107         /* dopesheet */
02108         prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
02109         RNA_def_property_struct_type(prop, "DopeSheet");
02110         RNA_def_property_pointer_sdna(prop, NULL, "ads");
02111         RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
02112 
02113         /* autosnap */
02114         prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
02115         RNA_def_property_enum_sdna(prop, NULL, "autosnap");
02116         RNA_def_property_enum_items(prop, autosnap_items);
02117         RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
02118         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
02119 }
02120 
02121 static void rna_def_space_time(BlenderRNA *brna)
02122 {
02123         StructRNA *srna;
02124         PropertyRNA *prop;
02125         
02126         srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
02127         RNA_def_struct_sdna(srna, "SpaceTime");
02128         RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
02129         
02130         /* view settings */     
02131         prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
02132         RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
02133         RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only"); 
02134         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02135         
02136         prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
02137         RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
02138         RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
02139         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02140         
02141         /* displaying cache status */
02142         prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
02143         RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
02144         RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");       
02145         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02146         
02147         prop= RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
02148         RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SOFTBODY);
02149         RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");    
02150         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02151         
02152         prop= RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
02153         RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
02154         RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");   
02155         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02156         
02157         prop= RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
02158         RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
02159         RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");  
02160         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02161         
02162         prop= RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
02163         RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SMOKE);
02164         RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");        
02165         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
02166 }
02167 
02168 static void rna_def_console_line(BlenderRNA *brna)
02169 {
02170         StructRNA *srna;
02171         PropertyRNA *prop;
02172         
02173         srna = RNA_def_struct(brna, "ConsoleLine", NULL);
02174         RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
02175         // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02176         
02177         prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
02178         RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
02179         RNA_def_property_ui_text(prop, "Line", "Text in the line");
02180         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02181         
02182         prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
02183         RNA_def_property_int_sdna(prop, NULL, "cursor");
02184         RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
02185         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02186 }
02187         
02188 static void rna_def_space_console(BlenderRNA *brna)
02189 {
02190         StructRNA *srna;
02191         PropertyRNA *prop;
02192         
02193         srna= RNA_def_struct(brna, "SpaceConsole", "Space");
02194         RNA_def_struct_sdna(srna, "SpaceConsole");
02195         RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console");
02196         
02197         /* display */
02198         prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
02199         RNA_def_property_int_sdna(prop, NULL, "lheight");
02200         RNA_def_property_range(prop, 8, 32);
02201         RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
02202         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02203 
02204 
02205         prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
02206         RNA_def_property_int_sdna(prop, NULL, "sel_start");
02207         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02208         
02209         prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
02210         RNA_def_property_int_sdna(prop, NULL, "sel_end");
02211         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
02212 
02213         prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
02214         RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
02215         
02216         prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
02217         RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
02218 
02219         prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
02220         RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
02221         RNA_def_property_struct_type(prop, "ConsoleLine");
02222         RNA_def_property_ui_text(prop, "History", "Command history");
02223         
02224         prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
02225         RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
02226         RNA_def_property_struct_type(prop, "ConsoleLine");
02227         RNA_def_property_ui_text(prop, "Output", "Command output");
02228 }
02229 
02230 static void rna_def_fileselect_params(BlenderRNA *brna)
02231 {
02232         StructRNA *srna;
02233         PropertyRNA *prop;
02234         
02235         static EnumPropertyItem file_display_items[] = {
02236                 {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
02237                 {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
02238                 {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
02239                 {0, NULL, 0, NULL, NULL}};
02240 
02241         static EnumPropertyItem file_sort_items[] = {
02242                 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically"},
02243                 {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension"},
02244                 {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
02245                 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
02246                 {0, NULL, 0, NULL, NULL}};
02247 
02248         srna= RNA_def_struct(brna, "FileSelectParams", NULL);
02249         RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
02250 
02251         prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
02252         RNA_def_property_string_sdna(prop, NULL, "title");
02253         RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
02254         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02255 
02256         prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
02257         RNA_def_property_string_sdna(prop, NULL, "dir");
02258         RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
02259         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02260 
02261         prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
02262         RNA_def_property_string_sdna(prop, NULL, "file");
02263         RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
02264         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02265 
02266         prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
02267         RNA_def_property_enum_sdna(prop, NULL, "display");
02268         RNA_def_property_enum_items(prop, file_display_items);
02269         RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
02270         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02271 
02272         prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
02273         RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
02274         RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
02275         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02276 
02277         prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
02278         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
02279         RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
02280         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
02281 
02282         prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
02283         RNA_def_property_enum_sdna(prop, NULL, "sort");
02284         RNA_def_property_enum_items(prop, file_sort_items);
02285         RNA_def_property_ui_text(prop, "Sort", "");
02286         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02287 
02288         prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
02289         RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
02290         RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
02291         RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
02292         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02293 
02294         prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
02295         RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
02296         RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
02297         RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
02298         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02299 
02300         prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
02301         RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
02302         RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
02303         RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
02304         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02305 
02306         prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
02307         RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
02308         RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
02309         RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
02310         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02311 
02312         prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
02313         RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
02314         RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
02315         RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
02316         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02317 
02318         prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
02319         RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
02320         RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
02321         RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
02322         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02323 
02324         prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
02325         RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
02326         RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
02327         RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
02328         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02329 
02330         prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
02331         RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
02332         RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
02333         RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
02334         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
02335         
02336         prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
02337         RNA_def_property_string_sdna(prop, NULL, "filter_glob");
02338         RNA_def_property_ui_text(prop, "Extension Filter", "");
02339         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
02340 
02341 }
02342 
02343 static void rna_def_space_filebrowser(BlenderRNA *brna)
02344 {
02345         StructRNA *srna;
02346         PropertyRNA *prop;
02347 
02348         srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
02349         RNA_def_struct_sdna(srna, "SpaceFile");
02350         RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
02351 
02352         prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
02353         RNA_def_property_pointer_sdna(prop, NULL, "params");
02354         RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
02355         
02356         prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
02357         RNA_def_property_pointer_sdna(prop, NULL, "op");
02358         RNA_def_property_ui_text(prop, "Operator", "");
02359 }
02360 
02361 static void rna_def_space_info(BlenderRNA *brna)
02362 {
02363         StructRNA *srna;
02364         PropertyRNA *prop;
02365 
02366         srna= RNA_def_struct(brna, "SpaceInfo", "Space");
02367         RNA_def_struct_sdna(srna, "SpaceInfo");
02368         RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
02369         
02370         /* reporting display */
02371         prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
02372         RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_DEBUG);
02373         RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
02374         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02375         
02376         prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
02377         RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_INFO);
02378         RNA_def_property_ui_text(prop, "Show Info", "Display general information");
02379         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02380         
02381         prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
02382         RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_OP);
02383         RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
02384         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02385         
02386         prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
02387         RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_WARN);
02388         RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
02389         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);
02390         
02391         prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
02392         RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", INFO_RPT_ERR);
02393         RNA_def_property_ui_text(prop, "Show Error", "Display error text");
02394         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, NULL);     
02395 }
02396 
02397 static void rna_def_space_userpref(BlenderRNA *brna)
02398 {
02399         StructRNA *srna;
02400         PropertyRNA *prop;
02401         
02402         srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
02403         RNA_def_struct_sdna(srna, "SpaceUserPref");
02404         RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
02405         
02406         prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
02407         RNA_def_property_string_sdna(prop, NULL, "filter");
02408         RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
02409 
02410 }
02411 
02412 static void rna_def_space_node(BlenderRNA *brna)
02413 {
02414         StructRNA *srna;
02415         PropertyRNA *prop;
02416 
02417         static EnumPropertyItem tree_type_items[] = {
02418                 {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes"},
02419                 {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes"},
02420                 {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes"},
02421                 {0, NULL, 0, NULL, NULL}};
02422 
02423         static EnumPropertyItem texture_type_items[] = {
02424                 {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object"},
02425                 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
02426                 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
02427                 {0, NULL, 0, NULL, NULL}};
02428 
02429         static EnumPropertyItem backdrop_channels_items[] = {
02430                 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
02431                 {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
02432                 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
02433                 {0, NULL, 0, NULL, NULL}};
02434 
02435         srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
02436         RNA_def_struct_sdna(srna, "SpaceNode");
02437         RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
02438 
02439         prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
02440         RNA_def_property_enum_sdna(prop, NULL, "treetype");
02441         RNA_def_property_enum_items(prop, tree_type_items);
02442         RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
02443         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
02444 
02445         prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
02446         RNA_def_property_enum_sdna(prop, NULL, "texfrom");
02447         RNA_def_property_enum_items(prop, texture_type_items);
02448         RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
02449         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL);
02450 
02451         prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
02452         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02453         RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited");
02454 
02455         prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
02456         RNA_def_property_pointer_sdna(prop, NULL, "from");
02457         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02458         RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked");
02459 
02460         prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
02461         RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
02462         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
02463         RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
02464 
02465         prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
02466         RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
02467         RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
02468         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02469 
02470         prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
02471         RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER);
02472         RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layer on 3D edits");
02473         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02474         
02475         prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
02476         RNA_def_property_float_sdna(prop, NULL, "zoom");
02477         RNA_def_property_float_default(prop, 1.0f);
02478         RNA_def_property_range(prop, 0.01f, FLT_MAX);
02479         RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
02480         RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
02481         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02482         
02483         prop= RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
02484         RNA_def_property_float_sdna(prop, NULL, "xof");
02485         RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset");
02486         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02487 
02488         prop= RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
02489         RNA_def_property_float_sdna(prop, NULL, "yof");
02490         RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset");
02491         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02492 
02493         prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
02494         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02495         RNA_def_property_enum_items(prop, backdrop_channels_items);
02496         RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
02497         RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
02498 }
02499 
02500 static void rna_def_space_logic(BlenderRNA *brna)
02501 {
02502         StructRNA *srna;
02503         PropertyRNA *prop;
02504 
02505         srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
02506         RNA_def_struct_sdna(srna, "SpaceLogic");
02507         RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
02508 
02509         /* sensors */
02510         prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
02511         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
02512         RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
02513         RNA_def_property_update(prop, NC_LOGIC, NULL);
02514         
02515         prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
02516         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
02517         RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
02518         RNA_def_property_update(prop, NC_LOGIC, NULL);
02519         
02520         prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
02521         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
02522         RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
02523         RNA_def_property_update(prop, NC_LOGIC, NULL);
02524 
02525         prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
02526         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
02527         RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
02528         RNA_def_property_update(prop, NC_LOGIC, NULL);
02529 
02530         /* controllers */
02531         prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
02532         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
02533         RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
02534         RNA_def_property_update(prop, NC_LOGIC, NULL);
02535         
02536         prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
02537         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
02538         RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
02539         RNA_def_property_update(prop, NC_LOGIC, NULL);
02540 
02541         prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
02542         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
02543         RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
02544         RNA_def_property_update(prop, NC_LOGIC, NULL);
02545 
02546         /* actuators */
02547         prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
02548         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
02549         RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
02550         RNA_def_property_update(prop, NC_LOGIC, NULL);
02551         
02552         prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
02553         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
02554         RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
02555         RNA_def_property_update(prop, NC_LOGIC, NULL);
02556         
02557         prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
02558         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
02559         RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
02560         RNA_def_property_update(prop, NC_LOGIC, NULL);
02561 
02562         prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
02563         RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
02564         RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
02565         RNA_def_property_update(prop, NC_LOGIC, NULL);
02566 
02567 }
02568 
02569 void RNA_def_space(BlenderRNA *brna)
02570 {
02571         rna_def_space(brna);
02572         rna_def_space_image(brna);
02573         rna_def_space_sequencer(brna);
02574         rna_def_space_text(brna);
02575         rna_def_fileselect_params(brna);
02576         rna_def_space_filebrowser(brna);
02577         rna_def_space_outliner(brna);
02578         rna_def_background_image(brna);
02579         rna_def_space_view3d(brna);
02580         rna_def_space_buttons(brna);
02581         rna_def_space_dopesheet(brna);
02582         rna_def_space_graph(brna);
02583         rna_def_space_nla(brna);
02584         rna_def_space_time(brna);
02585         rna_def_space_console(brna);
02586         rna_def_console_line(brna);
02587         rna_def_space_info(brna);
02588         rna_def_space_userpref(brna);
02589         rna_def_space_node(brna);
02590         rna_def_space_logic(brna);
02591 }
02592 
02593 #endif
02594