123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- SuperStrict
- Import BRL.Event
- Import BRL.System
- Import "system.macos.m"
- Extern
- Function bbSystemStartup()
- Function bbSystemPoll()
- Function bbSystemWait()
- Function bbSystemIntr()
- Function bbSystemMoveMouse( x:Int,y:Int )
- Function bbSystemSetMouseVisible( visible:Int )
- Function bbSystemNotify( text:String,serious:Int )
- Function bbSystemConfirm:Int( text:String,serious:Int )
- Function bbSystemProceed:Int( text:String,serious:Int )
- Function bbSystemRequestFile:String( text:String,exts:String,save:Int,file:String,dir:String )
- Function bbSystemRequestDir:String( text:String,dir:String )
- Function bbOpenURL:Int( url:String )
- Function bbSystemPostSyncOp( syncOp( syncInfo:Object,asyncRet:Int ),syncInfo:Object,asyncRet:Int )
- Function bbSystemStartAsyncOp( asyncOp( asyncInfo:Int ),asyncInfo:Int,syncOp( syncInfo:Object,asyncRet:Int ),syncInfo:Object )
- Function bbSystemDesktopWidth:Int()
- Function bbSystemDesktopHeight:Int()
- Function bbSystemDesktopDepth:Int()
- Function bbSystemDesktopHertz:Int()
- End Extern
- Private
- Function Hook:Object( id:Int,data:Object,context:Object )
- bbSystemIntr
- Return data
- End Function
- AddHook EmitEventHook,Hook,Null,10000
- Public
- Type TMacOSSystemDriver Extends TSystemDriver
- Method New()
- bbSystemStartup
- End Method
- Method Poll() Override
- bbSystemPoll()
- End Method
-
- Method Wait() Override
- bbSystemWait()
- End Method
-
- Method MoveMouse( x:Int,y:Int ) Override
- bbSystemMoveMouse x,y
- End Method
-
- Method SetMouseVisible( visible:Int ) Override
- bbSystemSetMouseVisible visible
- End Method
-
- Method Notify( Text:String,serious:Int ) Override
- bbSystemNotify Text,serious
- End Method
-
- Method Confirm:Int( Text:String,serious:Int ) Override
- Return bbSystemConfirm( Text,serious)
- End Method
-
- Method Proceed:Int( Text:String,serious:Int ) Override
- Return bbSystemProceed( Text,serious )
- End Method
- Method RequestFile:String( Text:String,exts:String,save:Int,path:String ) Override
- Local file:String,dir:String,filter:String
-
- path=path.Replace( "\","/" )
- Local i:Int=path.FindLast( "/" )
- If i<>-1
- dir=path[..i]
- file=path[i+1..]
- Else
- file=path
- EndIf
-
- exts=exts.Replace( ";","," )
- While exts
- Local p:Int=exts.Find(",")+1
- If p=0 p=exts.length
- Local q:Int=exts.Find(":")+1
- If q=0 Or q>p q=0
- filter:+exts[q..p]
- exts=exts[p..]
- Wend
- If filter.find("*")>-1 filter=""
-
- Return bbSystemRequestFile( Text,filter,save,file,dir )
- End Method
- Method RequestDir:String( Text:String,dir:String ) Override
- dir=dir.Replace( "\","/" )
- Return bbSystemRequestDir( Text,dir )
- End Method
-
- Method OpenURL:Int( url:String ) Override
- ' Return system_( "open "" + url.Replace("~q","") + "~q" )
- Return bbOpenURL( url )
- End Method
- Method DesktopWidth:Int(display:Int) Override
- Return bbSystemDesktopWidth()
- End Method
-
- Method DesktopHeight:Int(display:Int) Override
- Return bbSystemDesktopHeight()
- End Method
-
- Method DesktopDepth:Int(display:Int) Override
- Return bbSystemDesktopDepth()
- End Method
-
- Method DesktopHertz:Int(display:Int) Override
- Return bbSystemDesktopHertz()
- End Method
- Method Name:String() Override
- Return "MacOSSystemDriver "
- End Method
- End Type
|