Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-17 03:37:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-17 03:37:46 +0400
commitbee5f9f09e0e2fd35c59b190449b43332a6be0b7 (patch)
tree6859f7eaf517ec489532e12f037ab3f62e390c12 /source/blender/editors
parent66c916138adb6b6febbe6c55bf1fc87a09152865 (diff)
2.5: Fix timeline space redraw properties, these were not RNA wrapped
correct, and were missing update. Also moved this update code to screen_edit.c, next to the other animation play stuff.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_screen.h1
-rw-r--r--source/blender/editors/screen/screen_edit.c39
-rw-r--r--source/blender/editors/screen/screen_ops.c31
-rw-r--r--source/blender/editors/space_time/time_header.c105
4 files changed, 41 insertions, 135 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 0430a8cecac..6cb7593e07d 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -95,6 +95,7 @@ void ED_screen_delete_scene(struct bContext *C, struct Scene *scene);
void ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event);
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable);
+void ED_screen_animation_timer_update(struct bContext *C, int redraws);
int ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
void ED_screen_full_prevspace(struct bContext *C);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index c8519355327..96f5a9f1b64 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1541,6 +1541,45 @@ void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable)
WM_event_add_notifier(C, NC_SCREEN|ND_ANIMPLAY, screen);
}
+/* helper for screen_animation_play() - only to be used for TimeLine */
+static ARegion *time_top_left_3dwindow(bScreen *screen)
+{
+ ARegion *aret= NULL;
+ ScrArea *sa;
+ int min= 10000;
+
+ for(sa= screen->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype==SPACE_VIEW3D) {
+ ARegion *ar;
+ for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ if(ar->regiontype==RGN_TYPE_WINDOW) {
+ if(ar->winrct.xmin - ar->winrct.ymin < min) {
+ aret= ar;
+ min= ar->winrct.xmin - ar->winrct.ymin;
+ }
+ }
+ }
+ }
+ }
+
+ return aret;
+}
+
+void ED_screen_animation_timer_update(bContext *C, int redraws)
+{
+ bScreen *screen= CTX_wm_screen(C);
+
+ if(screen && screen->animtimer) {
+ wmTimer *wt= screen->animtimer;
+ ScreenAnimData *sad= wt->customdata;
+
+ sad->redraws= redraws;
+ sad->ar= NULL;
+ if(redraws & TIME_REGION)
+ sad->ar= time_top_left_3dwindow(screen);
+ }
+}
+
unsigned int ED_screen_view3d_layers(bScreen *screen)
{
if(screen) {
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 922801b1ae7..3318101dd99 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2323,30 +2323,6 @@ static void SCREEN_OT_animation_step(wmOperatorType *ot)
/* ****************** anim player, starts or ends timer ***************** */
-/* helper for screen_animation_play() - only to be used for TimeLine */
-ARegion *time_top_left_3dwindow(bScreen *screen)
-{
- ARegion *aret= NULL;
- ScrArea *sa;
- int min= 10000;
-
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW) {
- if(ar->winrct.xmin - ar->winrct.ymin < min) {
- aret= ar;
- min= ar->winrct.xmin - ar->winrct.ymin;
- }
- }
- }
- }
- }
-
- return aret;
-}
-
/* toggle operator */
static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event)
{
@@ -2371,12 +2347,7 @@ static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event)
ED_screen_animation_timer(C, stime->redraws, sync, mode);
/* update region if TIME_REGION was set, to leftmost 3d window */
- if(screen->animtimer && (stime->redraws & TIME_REGION)) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
-
- sad->ar= time_top_left_3dwindow(screen);
- }
+ ED_screen_animation_timer_update(C, stime->redraws);
}
else {
ED_screen_animation_timer(C, TIME_REGION|TIME_ALL_3D_WIN, sync, mode);
diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c
index 47010a97712..13265166d98 100644
--- a/source/blender/editors/space_time/time_header.c
+++ b/source/blender/editors/space_time/time_header.c
@@ -69,106 +69,6 @@
/* ************************ header time area region *********************** */
-/* exported for use in screen_ops.c */
-ARegion *time_top_left_3dwindow(bScreen *screen)
-{
- ARegion *aret= NULL;
- ScrArea *sa;
- int min= 10000;
-
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW) {
- if(ar->winrct.xmin - ar->winrct.ymin < min) {
- aret= ar;
- min= ar->winrct.xmin - ar->winrct.ymin;
- }
- }
- }
- }
- }
- return aret;
-}
-
-static void do_time_redrawmenu(bContext *C, void *arg, int event)
-{
-
- if(event < 1001) {
- bScreen *screen= CTX_wm_screen(C);
- SpaceTime *stime= CTX_wm_space_time(C);
-
- stime->redraws ^= event;
-
- if(screen->animtimer) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
-
- sad->redraws= stime->redraws;
- sad->ar= NULL;
- if(stime->redraws & TIME_REGION)
- sad->ar= time_top_left_3dwindow(screen);
- }
- }
-}
-
-
-static uiBlock *time_redrawmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- uiBlock *block;
- short yco= 0, menuwidth=120, icon;
-
- block= uiBeginBlock(C, ar, "header time_redrawmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_time_redrawmenu, NULL);
-
- if(stime->redraws & TIME_REGION) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Top-Left 3D Window", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_REGION, "");
-
- if(stime->redraws & TIME_ALL_3D_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "All 3D Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_3D_WIN, "");
-
- if(stime->redraws & TIME_ALL_ANIM_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Animation Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_ANIM_WIN, "");
-
- if(stime->redraws & TIME_ALL_BUTS_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Buttons Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_BUTS_WIN, "");
-
- if(stime->redraws & TIME_ALL_IMAGE_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Image Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_IMAGE_WIN, "");
-
- /* Add sequencer only redraw*/
- if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(stime->redraws & TIME_CONTINUE_PHYSICS) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Continue Physics", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_CONTINUE_PHYSICS, "During playblack, continue physics simulations regardless of the frame number");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
static void do_time_viewmenu(bContext *C, void *arg, int event)
{
ScrArea *curarea= CTX_wm_area(C);
@@ -420,11 +320,6 @@ void time_header_buttons(const bContext *C, ARegion *ar)
uiDefPulldownBut(block, time_framemenu, sa,
"Frame", xco, yco, xmax-3, 20, "");
xco+= xmax;
-
- xmax= GetButStringLength("Playback");
- uiDefPulldownBut(block, time_redrawmenu, sa,
- "Playback", xco, yco, xmax-3, 20, "");
- xco+= xmax;
}
uiBlockSetEmboss(block, UI_EMBOSS);