Browse Source

WIP mojo tweaks for android/touch devices.

Mark Sibly 9 years ago
parent
commit
701efe0373

+ 121 - 47
modules/mojo/app/app.monkey2

@@ -81,6 +81,10 @@ Class AppInstance
 		If Not config config=New StringMap<String>
 	
 		_config=config
+
+#if __TARGET__="android"
+		_touchMouse=True
+#endif
 		
 		SDL_Init( SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO )
 		
@@ -89,10 +93,16 @@ Class AppInstance
 		Mouse.Init()
 		
 		Audio.Init()
+		
+#if __TARGET__="android"		
 
-#If __TARGET__<>"emscripten"
-
-#If __HOSTOS__="windows"
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,2 )
+	    SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,0 ) 
+    	SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_ES )
+    	
+#endif
+    
+#if __TARGET__="desktop" and __HOSTOS__="windows"
 
 		Local gl_major:=Int( GetConfig( "GL_context_major_version",-1 ) )
 		Local gl_minor:=Int( GetConfig( "GL_context_major_version",-1 ) )
@@ -117,6 +127,8 @@ Class AppInstance
 
 #Endif
 
+#if __TARGET__="desktop"
+
 		SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT,1 )
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
 		
@@ -250,10 +262,6 @@ Class AppInstance
 	
 	An app is active if any of its windows has system input focus.
 	
-	If Active is true, then [[ActiveWindow]] will always be non-null.
-	
-	If Active is false, then [[ActiveWindow]] will always be null.
-	
 	#end
 	Property Active:Bool()
 	
@@ -264,19 +272,13 @@ Class AppInstance
 	
 	The active window is the window that has system input focus.
 	
-	If ActiveWindow is non-null, then [[Active]] will always be true.
-	
-	If ActiveWindow is null, then [[Active]] will always be false.
-	
 	#end
 	Property ActiveWindow:Window()
-
-		#rem	
+	
 		If Not _activeWindow
 			Local windows:=Window.VisibleWindows()
 			If windows _activeWindow=windows[0]
 		Endif
-		#end
 	
 		Return _activeWindow
 	End
@@ -313,6 +315,8 @@ Class AppInstance
 		Return _modalView
 	End
 	
+	#if __TARGET__="desktop"
+	
 	#rem monkeydoc @hidden
 	#end
 	Method WaitIdle()
@@ -325,6 +329,8 @@ Class AppInstance
 		future.Get()
 	End
 	
+	#endif
+	
 	#rem monkeydoc @hidden
 	#end
 	Method GetConfig:String( name:String,defValue:String )
@@ -392,7 +398,7 @@ Class AppInstance
 			SDL_WaitEvent( Null )
 			
 		Endif
-	
+		
 		UpdateEvents()
 		
 		UpdateWindows()
@@ -440,7 +446,7 @@ Class AppInstance
 			_hoverView=Null
 		Endif
 		
-		If Not _hoverView
+		If Not _hoverView And Not _touchMouse
 			_hoverView=ActiveViewAtMouseLocation()
 			If _mouseView And _hoverView<>_mouseView _hoverView=Null
 			If _hoverView SendMouseEvent( EventType.MouseEnter,_hoverView )
@@ -461,8 +467,11 @@ Class AppInstance
 	#end
 	Method Run()
 	
+#if __TARGET__="desktop"
+	
 		SDL_AddEventWatch( _EventFilter,Null )
-		
+
+#endif
 		RequestRender()
 		
 #If __TARGET__="emscripten"
@@ -483,6 +492,8 @@ Class AppInstance
 	
 	Field _config:StringMap<String>
 	
+	Field _touchMouse:Bool=False		'mouse is really touch...
+	
 	Field _defaultFont:Font
 	Field _theme:Theme
 
@@ -539,6 +550,10 @@ Class AppInstance
 		
 		While SDL_PollEvent( Varptr event )
 		
+			Keyboard.SendEvent( Varptr event )
+			
+			Mouse.SendEvent( Varptr event )
+		
 			DispatchEvent( Varptr event )
 			
 		Wend
@@ -609,7 +624,7 @@ Class AppInstance
 	End
 	
 	Method DispatchEvent( event:SDL_Event Ptr )
-
+	
 		Select event->type
 		
 		Case SDL_KEYDOWN
@@ -658,7 +673,7 @@ Class AppInstance
 			_keyChar=String.FromChar( tevent->text[0] )
 			
 			SendKeyEvent( EventType.KeyChar )
-		
+			
 		Case SDL_MOUSEBUTTONDOWN
 		
 			Local mevent:=Cast<SDL_MouseButtonEvent Ptr>( event )
@@ -674,20 +689,22 @@ Class AppInstance
 				Local view:=ActiveViewAtMouseLocation()
 
 				If view
-'#If __HOSTOS__<>"linux"
+
+					If _touchMouse
+						_hoverView=view
+						SendMouseEvent( EventType.MouseEnter,_hoverView )
+					Endif
+					
 					SDL_CaptureMouse( SDL_TRUE )
-'#Endif
 					_mouseView=view
+					
+					_mouseClicks=mevent->clicks
+					
+					SendMouseEvent( EventType.MouseDown,_mouseView )
+					
+					_mouseClicks=0
 				Endif
-			Endif
-				
-			If _mouseView 
-			
-				_mouseClicks=mevent->clicks
 				
-				SendMouseEvent( EventType.MouseDown,_mouseView )
-				
-				_mouseClicks=0
 			Endif
 		
 		Case SDL_MOUSEBUTTONUP
@@ -703,44 +720,85 @@ Class AppInstance
 			If _mouseView
 
 				SendMouseEvent( EventType.MouseUp,_mouseView )
-'#If __HOSTOS__<>"linux"				
+				
 				SDL_CaptureMouse( SDL_FALSE )
-'#Endif
+				
 				_mouseView=Null
 
 				_mouseButton=Null
+				
+				If _touchMouse
+					SendMouseEvent( EventType.MouseLeave,_hoverView )
+					_hoverView=Null
+				Endif
+				
 			Endif
 			
 		Case SDL_MOUSEMOTION
 		
 			Local mevent:=Cast<SDL_MouseMotionEvent Ptr>( event )
-			
+				
 			_window=Window.WindowForID( mevent->windowID )
 			If Not _window Return
-			
+				
 			_mouseLocation=New Vec2i( mevent->x,mevent->y )
 			
-			Local view:=ActiveViewAtMouseLocation()
-			If _mouseView And view<>_mouseView view=Null
+			If _mouseView
+			
+				SendMouseEvent( EventType.MouseMove,_mouseView )
 			
-			If view<>_hoverView
+			Else If Not _touchMouse
 			
-				If _hoverView SendMouseEvent( EventType.MouseLeave,_hoverView )
+				Local view:=ActiveViewAtMouseLocation()
 				
-				_hoverView=view
+				If view<>_hoverView
+
+					If _hoverView SendMouseEvent( EventType.MouseLeave,_hoverView )
+					
+					_hoverView=view
+					
+					If _hoverView SendMouseEvent( EventType.MouseEnter,_hoverView )
+
+				Endif
 				
-				If _hoverView SendMouseEvent( EventType.MouseEnter,_hoverView )
+				If _hoverView SendMouseEvent( EventType.MouseMove,_hoverView )
+			
 			Endif
 			
-			If _mouseView
-
-				SendMouseEvent( EventType.MouseMove,_mouseView )
+			#rem
+			If Not _touchMouse Or _mouseView
+		
+				Local mevent:=Cast<SDL_MouseMotionEvent Ptr>( event )
 				
-			Else If _hoverView
-
-				SendMouseEvent( EventType.MouseMove,_hoverView )
+				_window=Window.WindowForID( mevent->windowID )
+				If Not _window Return
+				
+				_mouseLocation=New Vec2i( mevent->x,mevent->y )
+				
+				Local view:=ActiveViewAtMouseLocation()
+				If _mouseView And view<>_mouseView view=Null
+				
+				If view<>_hoverView
+				
+					If _hoverView SendMouseEvent( EventType.MouseLeave,_hoverView )
+					
+					_hoverView=view
+					
+					If _hoverView SendMouseEvent( EventType.MouseEnter,_hoverView )
+				Endif
+				
+				If _mouseView
+	
+					SendMouseEvent( EventType.MouseMove,_mouseView )
+					
+				Else If _hoverView
+	
+					SendMouseEvent( EventType.MouseMove,_hoverView )
+				
+				Endif
 			
 			Endif
+			#end
 
 		Case SDL_MOUSEWHEEL
 		
@@ -760,7 +818,7 @@ Class AppInstance
 				SendMouseEvent( EventType.MouseWheel,_hoverView )
 			
 			Endif
-			
+
 		Case SDL_WINDOWEVENT
 		
 			Local wevent:=Cast<SDL_WindowEvent Ptr>( event )
@@ -782,6 +840,8 @@ Class AppInstance
 			
 			Case SDL_WINDOWEVENT_FOCUS_GAINED
 			
+				Print "SDL_WINDOWEVENT_FOCUS_GAINED"
+			
 				Local active:=_active
 				_activeWindow=_window
 				_active=True
@@ -792,8 +852,10 @@ Class AppInstance
 			
 			Case SDL_WINDOWEVENT_FOCUS_LOST
 			
+				Print "SDL_WINDOWEVENT_FOCUS_LOST"
+			
 				Local active:=_active
-				_activeWindow=Null
+'				_activeWindow=Null		'too dangerous for now!
 				_active=False
 			
 				SendWindowEvent( EventType.WindowLostFocus )
@@ -824,6 +886,18 @@ Class AppInstance
 				RemoveAsyncCallback( id )
 			Endif
 
+		Case SDL_RENDER_TARGETS_RESET
+		
+			Print "SDL_RENDER_TARGETS_RESET"
+		
+			RequestRender()
+			
+		Case SDL_RENDER_DEVICE_RESET
+		
+			Print "SDL_RENDER_DEVICE_RESET"
+		
+			mojo.graphics.glutil.glGraphicsSeq+=1
+
 		End
 			
 	End

+ 3 - 3
modules/mojo/app/event.monkey2

@@ -102,7 +102,7 @@ End
 #end
 Class KeyEvent Extends Event
 
-	#rem monkeydoc @hidden
+	#rem monkeydoc Creates a new key event.
 	#end
 	Method New( type:EventType,view:View,key:Key,rawKey:Key,modifiers:Modifier,text:String )
 		Super.New( type,view )
@@ -149,7 +149,7 @@ End
 #end
 Class MouseEvent Extends Event
 
-	#rem monkeydoc @hidden
+	#rem monkeydoc Creates a new mouse event.
 	#end
 	Method New( type:EventType,view:View,location:Vec2i,button:MouseButton,wheel:Vec2i,modifiers:Modifier,clicks:Int )
 		Super.New( type,view )
@@ -209,7 +209,7 @@ End
 #end
 Class WindowEvent Extends Event
 
-	#rem monkeydoc @hidden
+	#rem monkeydoc Creates a new window event.
 	#end
 	Method New( type:EventType,window:Window )
 		Super.New( type,window )

+ 152 - 0
modules/mojo/app/sdl_rwstream.monkey2

@@ -0,0 +1,152 @@
+
+Namespace std.stream
+
+Using sdl2
+
+Class SDL_RWStream Extends Stream
+
+	#rem monkeydoc True if no more data can be read from the stream.
+	
+	You can still write to a filestream even if `Eof` is true - disk space permitting!
+	
+	#end
+	Property Eof:Bool() Override
+		Return _pos>=_end
+	End
+
+	#rem monkeydoc Current filestream position.
+	
+	The current file read/write position.
+	
+	#end
+	Property Position:Int() Override
+		Return _pos
+	End
+
+	#rem monkeydoc Current filestream length.
+	
+	The length of the filestream. This is the same as the length of the file.
+	
+	The file length can increase if you write past the end of the file.
+	
+	#end	
+	Property Length:Int() Override
+		Return _end
+	End
+	
+	#rem monkeydoc Closes the filestream.
+	
+	Closing the filestream also sets its position and length to 0.
+	
+	#end
+	Method Close() Override
+		If Not _rwops Return
+		SDL_RWclose( _rwops )
+		_rwops=Null
+		_pos=0
+		_end=0
+	End
+	
+	#rem monkeydoc Seeks to a position in the filestream.
+	
+	@param offset The position to seek to.
+	
+	#end
+	Method Seek( position:Int ) Override
+
+		DebugAssert( position>=0 And position<=_end )
+		
+		SDL_RWseek( _rwops,position,RW_SEEK_SET )
+		
+		DebugAssert( SDL_RWtell( _rwops )=position )
+		
+		_pos=position
+	End
+	
+	#rem monkeydoc Reads data from the filestream.
+	
+	@param buf A pointer to the memory to read the data into.
+	
+	@param count The number of bytes to read.
+	
+	@return The number of bytes actually read.
+	
+	#end
+	Method Read:Int( buf:Void Ptr,count:Int ) Override
+	
+		count=Clamp( count,0,_end-_pos )
+		
+		count=SDL_RWread( _rwops,buf,1,count )
+		
+		DebugAssert( SDL_RWtell( _rwops )=_pos+count )
+		
+		_pos+=count
+		
+		Return count
+	End
+	
+	#rem monkeydoc Writes data to the filestream.
+	
+	Writing past the end of the file will increase the length of a filestream.
+	
+	@param buf A pointer to the memory to write the data from.
+	
+	@param count The number of bytes to write.
+	
+	@return The number of bytes actually written.
+	
+	#end
+	Method Write:Int( buf:Void Ptr,count:Int ) Override
+	
+		If count<=0 Return 0
+		
+		count=SDL_RWwrite( _rwops,buf,1,count )
+		
+		DebugAssert( SDL_RWtell( _rwops )=_pos+count )
+		
+		_pos+=count
+		
+		Return count
+	End
+	
+	#rem monkeydoc Opens a file and returns a new filestream.
+	
+	@param path The path of the file to open.
+	
+	@param mode The mode to open the file in: "r", "w" or "rw".
+	
+	@return A new filestream, or null if the file could not be opened.
+	
+	#end
+	Function Open:SDL_RWStream( path:String,mode:String )
+	
+		Select mode
+		Case "r"
+			mode="rb"
+		Case "w"
+			mode="wb"
+		Case "rw"
+			mode="W+b"
+		Default
+			Return Null
+		End
+		
+		Local rwops:=SDL_RWFromFile( path,mode )
+		If Not rwops Return Null
+		
+		Return New SDL_RWStream( rwops )
+	End
+	
+	Private
+	
+	Field _rwops:SDL_RWops Ptr
+	Field _pos:Int
+	Field _end:Int
+	
+	Method New( rwops:SDL_RWops Ptr )
+		_rwops=rwops
+		_pos=SDL_RWtell( _rwops )
+		_end=SDL_RWsize( _rwops )
+	End
+
+End

+ 19 - 0
modules/mojo/app/theme.monkey2

@@ -64,6 +64,8 @@ Class Theme
 	#end
 	Method LoadFont:Font( file:String,size:Int )
 	
+		size*=_themeScale
+	
 		Local font:Font
 		
 		If ExtractRootDir( file )
@@ -112,6 +114,8 @@ Class Theme
 
 		If Not atlas Return Null
 		
+		atlas.Scale=New Vec2f( _themeScale,_themeScale )
+		
 		Local size:=atlas.Height
 		
 		Local n:=atlas.Width/size
@@ -147,6 +151,10 @@ Class Theme
 			If Not skin skin=Skin.Load( "asset::images/"+file )
 		Endif
 		
+		If Not skin Return Null
+		
+		skin.Image.Scale=New Vec2f( _themeScale,_themeScale )
+		
 		Return skin
 	End
 
@@ -168,6 +176,12 @@ Class Theme
 	
 	Const _jdefault:=New JsonString( "default" )
 
+#if __TARGET__="android"	
+	Field _themeScale:Int=2
+#else
+	Field _themeScale:Int=1
+#endif
+
 	Field _themePath:String
 	Field _themeDir:String
 	
@@ -237,6 +251,11 @@ Class Theme
 			b=arr[3].ToNumber()
 		End
 		
+		l*=_themeScale
+		t*=_themeScale
+		r*=_themeScale
+		b*=_themeScale
+		
 		Return New Recti( -l,-t,r,b )
 	End
 	

+ 7 - 6
modules/mojo/app/window.monkey2

@@ -260,18 +260,18 @@ Class Window Extends View
 	End
 	
 	Method LayoutWindow()
+
+		'All this polling is a bit ugly...fixme.
 	
 #If __TARGET__="emscripten"
 
-		'ugly...fixme.
 		Local w:Int,h:Int,fs:Int
 		emscripten_get_canvas_size( Varptr w,Varptr h,Varptr fs )
 		If w<>Frame.Width Or h<>Frame.Height
 			Frame=New Recti( 0,0,w,h )
 		Endif
-	
+
 #Else
-		'ugly...fixme.
 		If MinSize<>_minSize
 			SDL_SetWindowMinimumSize( _sdlWindow,MinSize.x,MinSize.y )
 			_minSize=GetMinSize()
@@ -283,7 +283,7 @@ Class Window Extends View
 			_maxSize=GetMaxSize()
 			MaxSize=_maxSize
 		Endif
-		
+
 		If Frame<>_frame
 			SDL_SetWindowPosition( _sdlWindow,Frame.X,Frame.Y )
 			SDL_SetWindowSize( _sdlWindow,Frame.Width,Frame.Height )
@@ -291,8 +291,8 @@ Class Window Extends View
 			Frame=_frame
 			_weirdHack=True
 		Endif
-		
 #Endif
+
 		Measure()
 		
 		UpdateLayout()
@@ -302,7 +302,8 @@ Class Window Extends View
 	#end
 	Method RenderWindow()
 	
-		SDL_GL_MakeCurrent( _sdlWindow,_sdlGLContext )	
+		SDL_GL_MakeCurrent( _sdlWindow,_sdlGLContext )
+
 		SDL_GL_SetSwapInterval( _swapInterval )
 	
 #If __TARGET__="desktop" And __HOSTOS__="windows"

+ 1 - 2
modules/mojo/graphics/glutil.monkey2

@@ -63,8 +63,7 @@ End
 #end
 Function glCompile:Int( type:Int,source:String )
 
-	#If __TARGET__="emscripten"	Or (__TARGET__="desktop" And __HOSTOS__="windows")
-'	#If TARGET<>"glfw" Or GLFW_USE_ANGLE_GLES20
+	#if __TARGET__<>"desktop" Or __HOSTOS__="windows"
 		source="precision mediump float;~n"+source
 	#Endif
 	

+ 5 - 7
modules/mojo/graphics/shader.monkey2

@@ -138,8 +138,8 @@ Class ShaderProgram
 	
 		glAttachShader( _glProgram,vshader )
 		glAttachShader( _glProgram,fshader )
-		glDeleteShader( vshader )
-		glDeleteShader( fshader )
+'		glDeleteShader( vshader )
+'		glDeleteShader( fshader )
 		
 		glBindAttribLocation( _glProgram,0,"mx2_VertexPosition" )
 		glBindAttribLocation( _glProgram,1,"mx2_VertexTexCoord0" )
@@ -156,20 +156,18 @@ Class ShaderProgram
 		
 		Local n:Int
 		glGetProgramiv( _glProgram,GL_ACTIVE_UNIFORMS,Varptr n )
-
+		
 		Local size:Int,type:UInt,length:Int,nameBuf:=New Byte[256],texunit:=0
 		
 		For Local i:=0 Until n
 		
-			glGetActiveUniform( _glProgram,i,nameBuf.Length,Varptr length,Varptr size,Varptr type,Cast<GLchar Ptr>( Varptr nameBuf[0] ) )
-			
+			glGetActiveUniform( _glProgram,i,nameBuf.Length,Varptr length,Varptr size,Varptr type,Cast<GLchar Ptr>( nameBuf.Data ) )
+
 			Local name:=String.FromCString( nameBuf.Data )
 			
 			Local location:=glGetUniformLocation( _glProgram,name )
 			If location=-1 Continue  'IE fix...
 			
-'			Print "Uniform "+name+" location="+location
-			
 			Local u:=New Uniform( name,location,texunit,size,type )
 			If name.StartsWith( "mx2_" )
 				envUniforms.Push( u )

+ 10 - 10
modules/mojo/input/keyboard.monkey2

@@ -198,6 +198,7 @@ Class KeyboardDevice Extends InputDevice
 			_names[key]=name
 			_raw2scan[key]=scanCode
 			_scan2raw[scanCode]=key | Key.Raw
+			
 #If __TARGET__="emscripten"
 			_key2scan[key]=scanCode
 #Else
@@ -208,10 +209,15 @@ Class KeyboardDevice Extends InputDevice
 			p=p+1
 		Wend
 		
-		SDL_AddEventWatch( _EventFilter,Null )
-		
 		Reset()
 	End
+	
+	#rem monkeydoc @hidden
+	#end
+	Method SendEvent( event:SDL_Event Ptr )
+
+		OnEvent( event )
+	End
 
 	Private
 	
@@ -229,12 +235,7 @@ Class KeyboardDevice Extends InputDevice
 	Method New()
 	End
 	
-	Function _EventFilter:Int( userData:Void Ptr,event:SDL_Event Ptr )
-	
-		Return Keyboard.EventFilter( userData,event )
-	End
-	
-	Method EventFilter:Int( userData:Void Ptr,event:SDL_Event Ptr )
+	Method OnEvent( event:SDL_Event Ptr )
 
 		Select event->type
 			
@@ -273,8 +274,7 @@ Class KeyboardDevice Extends InputDevice
 			End
 
 		End
-		
-		Return 1
+
 	End
 
 End

+ 13 - 0
modules/mojo/input/keycodes.monkey2

@@ -152,6 +152,9 @@ End
 | Control		| LeftControl | RightControl mask.
 | Alt			| LeftAlt | RightAlt mask.
 | Gui			| LeftGui | RightGui mask.
+| LeftMenu		| LeftGui on Mac target, LeftControl on other targets.
+| RightMenu		| RightGui on Mac target, RightControl on other targets.
+| Menu			| Gui on Mac target, Control on other targets.
 
 #end
 Enum Modifier
@@ -172,4 +175,14 @@ Enum Modifier
 	Control=		LeftControl|RightControl
 	Alt=			LeftAlt|RightAlt
 	Gui=			LeftGui|RightGui
+	
+#if __TARGET__="macos"
+	LeftMenu=		LeftGui
+	RightMenu=		RightGui
+	Menu=			Gui
+#else
+	LeftMenu=		LeftControl
+	RightMenu=		RightControl
+	Menu=			Control
+#endif
 End

+ 5 - 1
modules/mojo/input/mouse.monkey2

@@ -133,6 +133,10 @@ Class MouseDevice Extends InputDevice
 		Reset()
 	End
 	
+	Method SendEvent( event:SDL_Event Ptr )
+		'NOP for now...
+	End
+	
 	Private
 
 	Field _init:Bool	
@@ -152,5 +156,5 @@ Class MouseDevice Extends InputDevice
 		_buttons[MouseButton.Right]=mask & 4
 		App.Idle+=Poll
 	End
-
+	
 End

+ 12 - 0
modules/mojo/mojo.monkey2

@@ -19,6 +19,8 @@ Namespace mojo
 #Import "app/window"
 #Import "app/glwindow"
 
+#Import "app/sdl_rwstream.monkey2"
+
 #Import "graphics/canvas"
 #Import "graphics/device"
 #Import "graphics/font"
@@ -69,4 +71,14 @@ Function Main()
 		Return Stream.Open( ExtractDir( App.Theme.Path )+path,mode )
 	End
 	
+#if __TARGET__="android"
+
+	Stream.OpenFuncs["asset"]=Lambda:Stream( proto:String,path:String,mode:String )
+	
+		Return SDL_RWStream.Open( path,mode )
+
+	End
+
+#endif
+	
 End

+ 4 - 2
modules/mojo/requesters/native/requesters.cpp

@@ -204,10 +204,12 @@ void bbRequesters::OpenUrl( bbString url ){
 
 bbString bbRequesters::RequestFile( bbString title,bbString exts,bbBool save,bbString path ){
 
-	bbString cmd=BB_T("zenity --title=\"")+title+BB_T("\" --file-selection");
+//	unsetenv( "WINDOWID" );
+
+	bbString cmd=BB_T("zenity --title=\"")+title+BB_T("\" --file-selection");	// --modal");
 	
 	if( save ) cmd+=" --save";
-
+	
 	FILE *f=popen( cmd.c_str(),"r" );
 	if( !f ) return "";
 	

+ 5 - 3
modules/mojo/requesters/requesters.monkey2

@@ -8,15 +8,17 @@ Namespace mojo.requesters
 #If __HOSTOS__="macos"
 
 	#Import "native/requesters.mm"
-
+	
 #else
 
 	#Import "native/requesters.cpp"
-
+	
 	#if __HOSTOS__="windows"
+
 		#Import "<libcomdlg32.a>"
-	#endif
 
+	#endif
+	
 #endif
 
 Extern