[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59334] branches/soc-2013-ui_replay/source /blender: Added a separate floating operator redo panel.

Vincent Akkermans vincent at ack-err.net
Tue Aug 20 20:51:06 CEST 2013


Revision: 59334
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59334
Author:   ack-err
Date:     2013-08-20 18:51:06 +0000 (Tue, 20 Aug 2013)
Log Message:
-----------
Added a separate floating operator redo panel. Positioning is not complete.

Modified Paths:
--------------
    branches/soc-2013-ui_replay/source/blender/blenloader/intern/readfile.c
    branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
    branches/soc-2013-ui_replay/source/blender/editors/screen/area.c
    branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c
    branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c

Modified: branches/soc-2013-ui_replay/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/blenloader/intern/readfile.c	2013-08-20 18:41:22 UTC (rev 59333)
+++ branches/soc-2013-ui_replay/source/blender/blenloader/intern/readfile.c	2013-08-20 18:51:06 UTC (rev 59334)
@@ -9499,8 +9499,8 @@
 				for (ar = sa->regionbase.first; ar; ar = ar->next) {
 					if (ar->regiontype == RGN_TYPE_TOOL_PROPS) {
 						BLI_remlink(&sa->regionbase, ar);
+						BKE_area_region_free(NULL, ar);
 						MEM_freeN(ar);
-						BKE_area_region_free(NULL, ar);
 					}
 				}
 				
@@ -9508,13 +9508,45 @@
 					for (ar = sl->regionbase.first; ar; ar = ar->next) {
 						if (ar->regiontype == RGN_TYPE_TOOL_PROPS) {
 							BLI_remlink(&sl->regionbase, ar);
+							BKE_area_region_free(NULL, ar);
 							MEM_freeN(ar);
-							BKE_area_region_free(NULL, ar);
 						}
 					}
 				}
 			}
 		}
+		
+		for (sc = main->screen.first; sc; sc = sc->id.next) {
+			ScrArea *sa;
+			for (sa = sc->areabase.first; sa; sa = sa->next) {
+				SpaceLink *sl;
+				ARegion *ar;
+				ARegion *wr;
+				
+				// TODO: also add other spacetypes that should have tool props
+				if (sa->spacetype == SPACE_VIEW3D) {
+				
+					wr = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+					
+					ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+					ar->alignment = RGN_ALIGN_FLOAT;
+					ar->regiontype = RGN_TYPE_TOOL_PROPS;
+					BLI_insertlinkbefore(&sa->regionbase, wr, ar);
+				}
+				
+				for (sl = sa->spacedata.first; sl; sl = sl->next) {
+					if (sl->spacetype == SPACE_VIEW3D) {
+
+						wr = BKE_spacelink_find_region_type(sl, RGN_TYPE_WINDOW);
+						
+						ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+						ar->alignment = RGN_ALIGN_FLOAT;
+						ar->regiontype = RGN_TYPE_TOOL_PROPS;
+						BLI_insertlinkbefore(&sl->regionbase, wr, ar);
+					}
+				}
+			}
+		}
 	}
 	
 	// TODO: what is the right version here?

Modified: branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c	2013-08-20 18:41:22 UTC (rev 59333)
+++ branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c	2013-08-20 18:51:06 UTC (rev 59334)
@@ -240,7 +240,7 @@
 				BLI_addtail(lb, ar);
 				ar->regiontype = RGN_TYPE_TOOLS;
 				ar->alignment = RGN_ALIGN_LEFT;
-				ar->flag = RGN_FLAG_HIDDEN;
+				//ar->flag = RGN_FLAG_HIDDEN;
 
 				/* buttons/list view */
 				ar = MEM_callocN(sizeof(ARegion), "buttons for view3d");
@@ -250,6 +250,8 @@
 				ar->alignment = RGN_ALIGN_RIGHT;
 				ar->flag = RGN_FLAG_HIDDEN;
 				
+				/* The tool properties are added in readfile.c */
+				
 #if 0
 			case SPACE_BUTS:
 				/* context UI region */
@@ -268,7 +270,6 @@
 
 	BLI_addtail(lb, ar);
 	ar->winrct = sa->totrct;
-
 	ar->regiontype = RGN_TYPE_WINDOW;
 
 	if (sl) {

Modified: branches/soc-2013-ui_replay/source/blender/editors/screen/area.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/screen/area.c	2013-08-20 18:41:22 UTC (rev 59333)
+++ branches/soc-2013-ui_replay/source/blender/editors/screen/area.c	2013-08-20 18:51:06 UTC (rev 59334)
@@ -971,6 +971,10 @@
 	}
 	else if (alignment == RGN_ALIGN_FLOAT) {
 		/* XXX floating area region, not handled yet here */
+		ar->winrct.ymax = 500;
+		ar->winrct.ymin = 100;
+		ar->winrct.xmax = 500;
+		ar->winrct.xmin = 200;
 	}
 	else if (rct_fits(remainder, 'v', 1) < 0 || rct_fits(remainder, 'h', 1) < 0) {
 		/* remainder is too small for any usage */

Modified: branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c	2013-08-20 18:41:22 UTC (rev 59333)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c	2013-08-20 18:51:06 UTC (rev 59334)
@@ -330,7 +330,14 @@
 	rv3d->persp = RV3D_PERSP;
 	rv3d->view = RV3D_VIEW_PERSPORTHO;
 	rv3d->dist = 10.0;
+		
+	/* tool props */
+	ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
 	
+	BLI_addtail(&v3d->regionbase, ar);
+	ar->regiontype = RGN_TYPE_TOOL_PROPS;
+	ar->alignment = RGN_ALIGN_FLOAT;
+
 	return (SpaceLink *)v3d;
 }
 
@@ -1402,9 +1409,21 @@
 	BLI_addhead(&st->regiontypes, art);
 	
 	view3d_toolbar_header_register(art);
-	view3d_tool_props_register(art);
 	view3d_grease_register(art);
 	
+	/* regions: tool properties */
+	art = MEM_callocN(sizeof(ARegionType), "spacetype view3d tool properties region");
+	art->regionid = RGN_TYPE_TOOL_PROPS;
+	art->prefsizex = 160; /* XXX */
+	art->prefsizey = 50; /* XXX */
+	art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+	art->listener = view3d_buttons_area_listener;
+	art->init = view3d_tools_area_init;
+	art->draw = view3d_tools_area_draw;
+	BLI_addhead(&st->regiontypes, art);
+	
+	view3d_tool_props_register(art);
+	
 	/* regions: operators menu bar */
 	art = MEM_callocN(sizeof(ARegionType), "spacetype view3d operators menu bar region");
 	art->regionid = RGN_TYPE_MENU_BAR;

Modified: branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c	2013-08-20 18:41:22 UTC (rev 59333)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c	2013-08-20 18:51:06 UTC (rev 59334)
@@ -120,6 +120,7 @@
 
 	/* set region back */
 	CTX_wm_region_set((bContext *)C, ar);
+	ED_region_tag_redraw(ar);
 }
 
 static void collapse_all_panels(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))




More information about the Bf-blender-cvs mailing list