[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23916] branches/soc-2008-mxcurioni: merged changes to revisio 23915

Maxime Curioni maxime.curioni at gmail.com
Sun Oct 18 07:19:47 CEST 2009


Revision: 23916
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23916
Author:   mxcurioni
Date:     2009-10-18 07:19:46 +0200 (Sun, 18 Oct 2009)

Log Message:
-----------
merged changes to revisio 23915
Updated buttons_render.py to have Freestyle buttons
Added "empty" BlenderTextureManager as preliminary step to remove last remnants of OpenGL and to allow Freestyle to run on my machine.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/intern/ghost/GHOST_C-api.h
    branches/soc-2008-mxcurioni/intern/ghost/GHOST_IWindow.h
    branches/soc-2008-mxcurioni/intern/ghost/GHOST_Rect.h
    branches/soc-2008-mxcurioni/intern/ghost/GHOST_Types.h
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_C-api.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemCocoa.mm
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemX11.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_Window.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_Window.h
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCocoa.h
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCocoa.mm
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.h
    branches/soc-2008-mxcurioni/release/datafiles/blenderbuttons
    branches/soc-2008-mxcurioni/release/scripts/io/add_mesh_torus.py
    branches/soc-2008-mxcurioni/release/scripts/io/engine_render_pov.py
    branches/soc-2008-mxcurioni/release/scripts/io/mesh_skin.py
    branches/soc-2008-mxcurioni/release/scripts/io/netrender/operators.py
    branches/soc-2008-mxcurioni/release/scripts/io/netrender/ui.py
    branches/soc-2008-mxcurioni/release/scripts/modules/bpy_ops.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_data_armature.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_data_mesh.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_game.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_material.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_object_constraint.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_particle.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_scene.py
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_texture.py
    branches/soc-2008-mxcurioni/release/scripts/ui/space_filebrowser.py
    branches/soc-2008-mxcurioni/release/scripts/ui/space_info.py
    branches/soc-2008-mxcurioni/release/scripts/ui/space_outliner.py
    branches/soc-2008-mxcurioni/release/scripts/ui/space_userpref.py
    branches/soc-2008-mxcurioni/release/scripts/ui/space_view3d.py
    branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_key.h
    branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_object.h
    branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_particle.h
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/context.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/depsgraph.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/image.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/key.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/object.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/packedFile.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/particle.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/smoke.c
    branches/soc-2008-mxcurioni/source/blender/blenlib/BLI_arithb.h
    branches/soc-2008-mxcurioni/source/blender/blenlib/BLI_storage.h
    branches/soc-2008-mxcurioni/source/blender/blenlib/intern/storage.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_edit.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_filter.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/keyframing.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/keyingsets.c
    branches/soc-2008-mxcurioni/source/blender/editors/armature/editarmature_sketch.c
    branches/soc-2008-mxcurioni/source/blender/editors/armature/poselib.c
    branches/soc-2008-mxcurioni/source/blender/editors/datafiles/blenderbuttons.c
    branches/soc-2008-mxcurioni/source/blender/editors/include/ED_anim_api.h
    branches/soc-2008-mxcurioni/source/blender/editors/include/ED_mesh.h
    branches/soc-2008-mxcurioni/source/blender/editors/include/UI_icons.h
    branches/soc-2008-mxcurioni/source/blender/editors/include/UI_interface.h
    branches/soc-2008-mxcurioni/source/blender/editors/interface/interface_handlers.c
    branches/soc-2008-mxcurioni/source/blender/editors/interface/interface_templates.c
    branches/soc-2008-mxcurioni/source/blender/editors/interface/interface_widgets.c
    branches/soc-2008-mxcurioni/source/blender/editors/mesh/editmesh.c
    branches/soc-2008-mxcurioni/source/blender/editors/mesh/editmesh_mods.c
    branches/soc-2008-mxcurioni/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2008-mxcurioni/source/blender/editors/mesh/mesh_intern.h
    branches/soc-2008-mxcurioni/source/blender/editors/mesh/mesh_ops.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_add.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_edit.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_group.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_intern.h
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_modifier.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_ops.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_relations.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_select.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_shapekey.c
    branches/soc-2008-mxcurioni/source/blender/editors/object/object_vgroup.c
    branches/soc-2008-mxcurioni/source/blender/editors/screen/screen_ops.c
    branches/soc-2008-mxcurioni/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_action/action_draw.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_action/action_header.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_buttons/buttons_context.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_buttons/buttons_header.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_buttons/space_buttons.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_file/file_intern.h
    branches/soc-2008-mxcurioni/source/blender/editors/space_file/file_ops.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_file/filesel.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_file/space_file.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_graph/graph_buttons.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_graph/graph_draw.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_outliner/space_outliner.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_view3d/space_view3d.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2008-mxcurioni/source/blender/editors/space_view3d/view3d_ops.c
    branches/soc-2008-mxcurioni/source/blender/editors/transform/transform.h
    branches/soc-2008-mxcurioni/source/blender/editors/transform/transform_conversions.c
    branches/soc-2008-mxcurioni/source/blender/editors/transform/transform_generics.c
    branches/soc-2008-mxcurioni/source/blender/editors/transform/transform_ops.c
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/ikplugin/intern/itasc_plugin.cpp
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_action_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_anim_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_constraint_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_curve_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_key_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_mesh_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_meta_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_object_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_space_types.h
    branches/soc-2008-mxcurioni/source/blender/makesrna/RNA_enum_types.h
    branches/soc-2008-mxcurioni/source/blender/makesrna/RNA_types.h
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/makesrna.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_ID.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_access.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_animation.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_constraint.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_define.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_fcurve.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_image.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_key.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_material.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_mesh.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_object.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_object_force.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_particle.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_rna.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_sculpt_paint.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_space.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_texture.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_ui_api.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_wm.c
    branches/soc-2008-mxcurioni/source/blender/python/intern/bpy_rna.c
    branches/soc-2008-mxcurioni/source/blender/render/intern/source/pipeline.c
    branches/soc-2008-mxcurioni/source/blender/render/intern/source/texture.c
    branches/soc-2008-mxcurioni/source/blender/render/intern/source/zbuf.c
    branches/soc-2008-mxcurioni/source/blender/windowmanager/WM_api.h
    branches/soc-2008-mxcurioni/source/blender/windowmanager/intern/wm_cursors.c
    branches/soc-2008-mxcurioni/source/blender/windowmanager/intern/wm_event_system.c
    branches/soc-2008-mxcurioni/source/blender/windowmanager/intern/wm_operators.c

Added Paths:
-----------
    branches/soc-2008-mxcurioni/release/scripts/ui/buttons_render.py

Removed Paths:
-------------
    branches/soc-2008-mxcurioni/source/blender/editors/space_outliner/outliner_header.c

Modified: branches/soc-2008-mxcurioni/intern/ghost/GHOST_C-api.h
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/GHOST_C-api.h	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/GHOST_C-api.h	2009-10-18 05:19:46 UTC (rev 23916)
@@ -372,11 +372,13 @@
  * events when the mouse is outside the window. X11 only, others
  * do this automatically.
  * @param windowhandle The handle to the window
- * @param	grab The new grab state of the cursor.
+ * @param	mode The new grab state of the cursor.
+ * @param	bounds The grab ragion (optional) - left,top,right,bottom
  * @return	Indication of success.
  */
 extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
-										  int grab, int warp, int restore);
+												GHOST_TGrabCursorMode mode,
+												int* bounds);
 
 /***************************************************************************************
  ** Access to mouse button and keyboard states.

Modified: branches/soc-2008-mxcurioni/intern/ghost/GHOST_IWindow.h
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/GHOST_IWindow.h	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/GHOST_IWindow.h	2009-10-18 05:19:46 UTC (rev 23916)
@@ -271,7 +271,7 @@
 	 * @param	grab The new grab state of the cursor.
 	 * @return	Indication of success.
 	 */
-	virtual GHOST_TSuccess setCursorGrab(bool grab, bool warp, bool restore) { return GHOST_kSuccess; };
+	virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; };
 
 };
 

Modified: branches/soc-2008-mxcurioni/intern/ghost/GHOST_Rect.h
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/GHOST_Rect.h	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/GHOST_Rect.h	2009-10-18 05:19:46 UTC (rev 23916)
@@ -127,6 +127,13 @@
 	virtual inline void unionPoint(GHOST_TInt32 x, GHOST_TInt32 y);
 
 	/**
+	 * Grows the rectangle to included a point.
+	 * @param	x	The x-coordinate of the point.
+	 * @param	y	The y-coordinate of the point.
+	 */
+	virtual inline void wrapPoint(GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs);
+
+	/**
 	 * Returns whether the point is inside this rectangle.
 	 * Point on the boundary is considered inside.
 	 * @param x	x-coordinate of point to test.
@@ -221,7 +228,21 @@
 	if (y < m_t) m_t = y;
 	if (y > m_b) m_b = y;
 }
+#include <stdio.h>
+inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs)
+{
+	GHOST_TInt32 w= getWidth();
+	GHOST_TInt32 h= getHeight();
 
+	/* highly unlikely but avoid eternal loop */
+	if(w-ofs*2 <= 0 || h-ofs*2 <= 0)
+		return;
+	while(x-ofs < m_l)		x+= w-(ofs*2);
+	while(y-ofs < m_t)		y+= h-(ofs*2);
+	while(x+ofs > m_r)		x-= w-(ofs*2);
+	while(y+ofs > m_b)		y-= h-(ofs*2);
+}
+
 inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const
 {
 	return (x >= m_l) && (x <= m_r) && (y >= m_t) && (y <= m_b);

Modified: branches/soc-2008-mxcurioni/intern/ghost/GHOST_Types.h
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/GHOST_Types.h	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/GHOST_Types.h	2009-10-18 05:19:46 UTC (rev 23916)
@@ -341,6 +341,12 @@
 	GHOST_kKeyF24
 } GHOST_TKey;
 
+typedef enum {
+	GHOST_kGrabDisable = 0,	/* grab not set */
+	GHOST_kGrabNormal,	/* no cursor adjustments */
+	GHOST_kGrabWrap,		/* wrap the mouse location to prevent limiting screen bounds */
+	GHOST_kGrabHide,		/* hide the mouse while grabbing and restore the original location on release (numbuts) */
+} GHOST_TGrabCursorMode;
 
 typedef void* GHOST_TEventDataPtr;
 

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_C-api.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_C-api.cpp	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_C-api.cpp	2009-10-18 05:19:46 UTC (rev 23916)
@@ -355,11 +355,21 @@
 
 
 GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
-								   int grab, int warp, int restore)
+										GHOST_TGrabCursorMode mode,
+										int *bounds)
 {
 	GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
+	GHOST_Rect bounds_rect, bounds_win;
+
+	if(bounds) {
+		/* if this is X11 specific we need a function that converts */
+		window->getClientBounds(bounds_win);
+		window->clientToScreen(bounds[0], bounds_win.getHeight() - bounds[1], bounds_rect.m_l, bounds_rect.m_t);
+		window->clientToScreen(bounds[2], bounds_win.getHeight() - bounds[3], bounds_rect.m_r, bounds_rect.m_b);
+
+	}
 	
-	return window->setCursorGrab(grab?true:false, warp?true:false, restore?true:false);
+	return window->setCursorGrab(mode, bounds ? &bounds_rect:NULL);
 }
 
 

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemCocoa.mm	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemCocoa.mm	2009-10-18 05:19:46 UTC (rev 23916)
@@ -635,6 +635,7 @@
 				
 				[mainMenubar addItem:menuItem];
 				[menuItem release];
+				[NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu]; //Needed for 10.5
 				[appMenu release];
 				
 				//Create the window menu
@@ -815,7 +816,7 @@
 
 GHOST_TSuccess GHOST_SystemCocoa::getModifierKeys(GHOST_ModifierKeys& keys) const
 {
-	NSUInteger modifiers = [[NSApp currentEvent] modifierFlags];
+	unsigned int modifiers = [[NSApp currentEvent] modifierFlags];
 	//Direct query to modifierFlags can be used in 10.6
 
     keys.set(GHOST_kModifierKeyCommand, (modifiers & NSCommandKeyMask) ? true : false);
@@ -1153,9 +1154,12 @@
 		case NSScrollWheel:
 			{
 				GHOST_TInt32 delta;
-				delta = [event deltaY] > 0 ? 1 : -1;
-				pushEvent(new GHOST_EventWheel(getMilliSeconds(), window, delta));
-
+				
+				double deltaF = [event deltaY];
+				if (deltaF == 0.0) break; //discard trackpad delta=0 events
+				
+				delta = deltaF > 0.0 ? 1 : -1;
+				pushEvent(new GHOST_EventWheel([event timestamp], window, delta));
 			}
 			break;
 			
@@ -1172,7 +1176,7 @@
 {
 	NSEvent *event = (NSEvent *)eventPtr;
 	GHOST_IWindow* window = m_windowManager->getActiveWindow();
-	NSUInteger modifiers;
+	unsigned int modifiers;
 	NSString *characters;
 	GHOST_TKey keyCode;
 	unsigned char ascii;

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemX11.cpp	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_SystemX11.cpp	2009-10-18 05:19:46 UTC (rev 23916)
@@ -388,31 +388,36 @@
 		{
 			XMotionEvent &xme = xe->xmotion;
 			
-			if(window->getCursorWarp()) {
-				/* Calculate offscreen location and re-center the mouse */
-				GHOST_TInt32 x_warp, y_warp,  x_new, y_new, x_accum, y_accum;
+			if(window->getCursorGrabMode() != GHOST_kGrabDisable && window->getCursorGrabMode() != GHOST_kGrabNormal)
+			{
+				GHOST_TInt32 x_new= xme.x_root;
+				GHOST_TInt32 y_new= xme.y_root;
+				GHOST_TInt32 x_accum, y_accum;
+				GHOST_Rect bounds;
 
-				window->getCursorWarpPos(x_warp, y_warp);
-				getCursorPosition(x_new, y_new);
+				/* fallback to window bounds */
+				if(window->getCursorGrabBounds(bounds)==GHOST_kFailure)
+					window->getClientBounds(bounds);
 
-				if(x_warp != x_new || y_warp != y_new) {
-					window->getCursorWarpAccum(x_accum, y_accum);
-					x_accum += x_new - x_warp;
-					y_accum += y_new - y_warp;
+				/* could also clamp to screen bounds
+				 * wrap with a window outside the view will fail atm  */
+				bounds.wrapPoint(x_new, y_new, 2); /* offset of one incase blender is at screen bounds */
+				window->getCursorGrabAccum(x_accum, y_accum);
 
-					window->setCursorWarpAccum(x_accum, y_accum);
-					setCursorPosition(x_warp, y_warp); /* reset */
+				if(x_new != xme.x_root || y_new != xme.y_root) {
+					setCursorPosition(x_new, y_new); /* wrap */
+					window->setCursorGrabAccum(x_accum + (xme.x_root - x_new), y_accum + (xme.y_root - y_new));
+				}
 
-					g_event = new
-					GHOST_EventCursor(
-						getMilliSeconds(),
-						GHOST_kEventCursorMove,
-						window,
-						x_warp + x_accum,
-						y_warp + y_accum
-					);
+				g_event = new
+				GHOST_EventCursor(
+					getMilliSeconds(),
+					GHOST_kEventCursorMove,
+					window,
+					xme.x_root + x_accum,
+					xme.y_root + y_accum
+				);
 
-				}
 			}
 			else {
 				g_event = new

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_Window.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_Window.cpp	2009-10-18 02:55:30 UTC (rev 23915)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_Window.cpp	2009-10-18 05:19:46 UTC (rev 23916)
@@ -48,15 +48,14 @@
 :
 	m_drawingContextType(type),
 	m_cursorVisible(true),
-	m_cursorGrabbed(false),
-	m_cursorWarp(false),
+	m_cursorGrab(GHOST_kGrabDisable),
 	m_cursorShape(GHOST_kStandardCursorDefault),
 	m_stereoVisual(stereoVisual)
 {
 	m_isUnsavedChanges = false;
 	
-    m_cursorWarpAccumPos[0] = 0;
-    m_cursorWarpAccumPos[1] = 0;
+    m_cursorGrabAccumPos[0] = 0;
+    m_cursorGrabAccumPos[1] = 0;
 
     m_fullScreen = state == GHOST_kWindowStateFullScreen;
     if (m_fullScreen) {
@@ -98,13 +97,19 @@
 	}
 }
 
-GHOST_TSuccess GHOST_Window::setCursorGrab(bool grab, bool warp, bool restore)
+GHOST_TSuccess GHOST_Window::setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds)
 {
-	if(m_cursorGrabbed == grab)
+	if(m_cursorGrab == mode)
 		return GHOST_kSuccess;
 
-	if (setWindowCursorGrab(grab, warp, restore)) {
-		m_cursorGrabbed = grab;
+	if (setWindowCursorGrab(mode)) {
+
+		if(mode==GHOST_kGrabDisable)
+			m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1;
+		else if (bounds) {
+			m_cursorGrabBounds= *bounds;
+		}
+		m_cursorGrab = mode;
 		return GHOST_kSuccess;
 	}
 	else {
@@ -112,6 +117,12 @@
 	}
 }
 
+GHOST_TSuccess GHOST_Window::getCursorGrabBounds(GHOST_Rect& bounds)
+{
+	bounds= m_cursorGrabBounds;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list