[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17779] branches/blender2.5/blender/source /blender/editors: 2.5

Ton Roosendaal ton at blender.org
Wed Dec 10 18:58:18 CET 2008


Revision: 17779
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17779
Author:   ton
Date:     2008-12-10 18:58:18 +0100 (Wed, 10 Dec 2008)

Log Message:
-----------
2.5

- Brought back (most of) buttons in TimeLine window.
  They don't work yet though! Waiting for Brecht to commit callbacks
  for menus and ui-blocks

- Area headers hilite again when mouse is inside.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/ED_screen.h
    branches/blender2.5/blender/source/blender/editors/include/ED_util.h
    branches/blender2.5/blender/source/blender/editors/screen/area.c
    branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c
    branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
    branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
    branches/blender2.5/blender/source/blender/editors/space_time/time_intern.h
    branches/blender2.5/blender/source/blender/editors/util/ed_util.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/editors/space_time/time_header.c

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_screen.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_screen.h	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_screen.h	2008-12-10 17:58:18 UTC (rev 17779)
@@ -41,10 +41,10 @@
 
 /* regions */
 void	ED_region_do_listen(ARegion *ar, struct wmNotifier *note);
-void	ED_region_do_draw(struct bContext *C, ARegion *ar);
-void	ED_region_exit(struct bContext *C, ARegion *ar);
-void	ED_region_pixelspace(const struct bContext *C, ARegion *ar);
-void	ED_region_init(struct bContext *C, ARegion *ar);
+void	ED_region_do_draw(struct bContext *C, struct ARegion *ar);
+void	ED_region_exit(struct bContext *C, struct ARegion *ar);
+void	ED_region_pixelspace(const struct bContext *C, struct ARegion *ar);
+void	ED_region_init(struct bContext *C, struct ARegion *ar);
 ARegion *ED_region_copy(ARegion *ar);
 
 /* spaces */
@@ -54,17 +54,18 @@
 
 /* areas */
 void	ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
-void	ED_area_exit(struct bContext *C, ScrArea *sa);
-void	ED_area_do_draw(struct bContext *C, ScrArea *sa);
+void	ED_area_exit(struct bContext *C, struct ScrArea *sa);
+void	ED_area_do_draw(struct bContext *C, struct ScrArea *sa);
+int		ED_screen_area_active(const struct bContext *C);
 
 /* screens */
 void	ED_screens_initialize(struct wmWindowManager *wm);
 void	ED_screen_draw(struct wmWindow *win);
 void	ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
 void	ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note);
-bScreen *ED_screen_duplicate(struct wmWindow *win, bScreen *sc);
+bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
 void	ED_screen_set_subwinactive(struct wmWindow *win);
-void	ED_screen_exit(struct bContext *C, struct wmWindow *window, bScreen *screen);
+void	ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
 
 void	ED_operatortypes_screen(void);
 void	ED_keymap_screen(struct wmWindowManager *wm);

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_util.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_util.h	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_util.h	2008-12-10 17:58:18 UTC (rev 17779)
@@ -28,7 +28,14 @@
 #ifndef ED_UTIL_H
 #define ED_UTIL_H
 
+/* ************** XXX OLD CRUFT WARNING ************* */
+
+#define XIC 20
+#define YIC 20
+
 void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert);
 
+int GetButStringLength(char *str);
+
 #endif /* ED_UTIL_H */
 

Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/area.c	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/screen/area.c	2008-12-10 17:58:18 UTC (rev 17779)
@@ -98,8 +98,7 @@
 	int height= ar->winrct.ymax-ar->winrct.ymin+1;
 	
 	wmOrtho2(C->window, -0.375, (float)width-0.375, -0.375, (float)height-0.375);
-	wmLoadIdentity(C->window);
-	
+	wmLoadIdentity(C->window);	
 }
 
 void ED_region_do_listen(ARegion *ar, wmNotifier *note)

Modified: branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2008-12-10 17:58:18 UTC (rev 17779)
@@ -958,6 +958,7 @@
 	if(win->screen) {
 		wmEvent *event= win->eventstate;
 		ScrArea *sa;
+		int oldswin= win->screen->subwinactive;
 		
 		for(sa= win->screen->areabase.first; sa; sa= sa->next) {
 			if(event->x > sa->totrct.xmin && event->x < sa->totrct.xmax)
@@ -974,7 +975,34 @@
 		else
 			win->screen->subwinactive= win->screen->mainwin;
 		
+		/* check for redraw headers */
+		if(oldswin!=win->screen->subwinactive) {
+			
+			for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+				ARegion *ar;
+				int do_draw= 0;
+				
+				for(ar= sa->regionbase.first; ar; ar= ar->next)
+					if(ar->swinid==oldswin || ar->swinid==win->screen->subwinactive)
+						do_draw= 1;
+				
+				if(do_draw)
+					for(ar= sa->regionbase.first; ar; ar= ar->next)
+						if(ar->regiontype==RGN_TYPE_HEADER)
+							ar->do_draw= 1; /* XXX */
+			}
+		}
 	}
 }
 
+int ED_screen_area_active(const bContext *C)
+{
 
+	if(C->screen && C->area) {
+		ARegion *ar;
+		for(ar= C->area->regionbase.first; ar; ar= ar->next)
+			if(ar->swinid == C->screen->subwinactive)
+				return 1;
+	}	
+	return 0;
+}

Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c	2008-12-10 17:58:18 UTC (rev 17779)
@@ -452,9 +452,12 @@
 
 	path= (soutliner->rnapath)? soutliner->rnapath: "Main";
 
-	/* clear */
-	UI_GetThemeColor3fv(TH_BACK, col);
-	glClearColor(MAX2(col[0]-0.3f, 0.0f), MAX2(col[1]-0.3f, 0.0f), MAX2(col[2]-0.3f, 0.0f), 0.0);
+	if(ED_screen_area_active(C))
+		UI_GetThemeColor3fv(TH_HEADER, col);
+	else
+		UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+	
+	glClearColor(col[0], col[1], col[2], 0.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 
 	width= ar->winrct.xmax - ar->winrct.xmin;

Modified: branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_time/space_time.c	2008-12-10 15:30:43 UTC (rev 17778)
+++ branches/blender2.5/blender/source/blender/editors/space_time/space_time.c	2008-12-10 17:58:18 UTC (rev 17779)
@@ -43,6 +43,7 @@
 
 #include "ED_area.h"
 #include "ED_screen.h"
+#include "ED_util.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -126,9 +127,6 @@
 	float col[3];
 	int unit;
 	
-	/* XXX can be removed */
-	UI_view2d_size_update(v2d, ar->winx, ar->winy);
-
 	/* clear and setup matrix */
 	UI_GetThemeColor3fv(TH_BACK, col);
 	glClearColor(col[0], col[1], col[2], 0.0);
@@ -168,17 +166,20 @@
 
 /* ************************ header time area region *********************** */
 
-
 static void time_header_area_draw(const bContext *C, ARegion *ar)
 {
 	float col[3];
 
 	/* clear */
-	UI_GetThemeColor3fv(TH_HEADER, col);
+	if(ED_screen_area_active(C))
+		UI_GetThemeColor3fv(TH_HEADER, col);
+	else
+		UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+		
 	glClearColor(col[0], col[1], col[2], 0.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 
-	uiTestRegion(C);
+	time_header_buttons(C, ar);
 }
 
 static void time_header_area_free(ARegion *ar)

Added: branches/blender2.5/blender/source/blender/editors/space_time/time_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_time/time_header.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/editors/space_time/time_header.c	2008-12-10 17:58:18 UTC (rev 17779)
@@ -0,0 +1,604 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_area.h"
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "time_intern.h"
+
+
+/* ************************ header time area region *********************** */
+
+static void start_animated_screen(SpaceTime *stime)
+{
+// XXX	add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws);
+	
+//	if(stime->redraws & TIME_WITH_SEQ_AUDIO)
+//		audiostream_start( CFRA );
+	
+//	BKE_ptcache_set_continue_physics((stime->redraws & TIME_CONTINUE_PHYSICS));
+}
+
+static void end_animated_screen(SpaceTime *stime)
+{
+//	rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
+	
+//	audiostream_stop();
+//	BKE_ptcache_set_continue_physics(0);
+}
+
+#define B_TL_REW		751
+#define B_TL_PLAY		752
+#define B_TL_FF			753
+#define B_TL_PREVKEY	754
+#define B_TL_NEXTKEY	755
+#define B_TL_STOP		756
+#define B_TL_PREVIEWON	757
+#define B_TL_INSERTKEY	758
+#define B_TL_DELETEKEY	759
+
+void do_time_buttons(ScrArea *sa, unsigned short event)
+{
+	SpaceTime *stime= sa->spacedata.first;
+	
+	switch(event) {
+		
+		case B_TL_REW:
+			CFRA= PSFRA;
+			//update_for_newframe();
+			break;
+		case B_TL_PLAY:
+			start_animated_screen(stime);
+			break;
+		case B_TL_STOP:
+			end_animated_screen(stime);
+			//allqueue(REDRAWALL, 0);
+			break;
+		case B_TL_FF:
+			/* end frame */
+			CFRA= PEFRA;
+			//update_for_newframe();
+			break;
+		case B_TL_PREVKEY:
+			/* previous keyframe */
+			//nextprev_timeline_key(-1);
+			break;
+		case B_TL_NEXTKEY:
+			/* next keyframe */
+			//nextprev_timeline_key(1);
+			break;
+			

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list