[futurebasic] RezLib [was Carbon Differences]

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2003 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Sun, 11 May 2003 12:13:35 +1200
On Sunday, May 11, 2003, at 02:43  AM, michael evans wrote:

> on 5/10/03 12:31 AM, Robert Purves at 
> robert.purves@...
> wrote:
>
>> The demo below should get you started. There are many more RezLib
>> functions defined in the RezLib shared library and discussed in the
>> RezLib documentation, but I haven't included their FB conversions 
>> here.
>>
> <snip>
>
> Are these additional RezLib toolbox declarations correct?
>
>  #define ScreenRef as long
> toolbox fn disposeScreenRef(ScreenRef)
>
>  #define pointerToRects as long
>  #define ListCount as long
> toolbox fn getDisplayList(UInt32 *ListCount) = pointerToRects
> toolbox fn disposeDisplayList(pointerToRects)
>
> Every four bytes @pointerToRects is the rect of a device, up to 
> ListCount?

Note the capitalization of the functions in this little demo:

'-----------
#define ScreenRef as long

library "RezLib"
toolbox DisposeScreenRef( ScreenRef display )
toolbox fn GetDisplayList( unsigned long *listEntryCount ) = Ptr // to 
Rect
toolbox DisposeDisplayList( Rect *list )
library


end globals

dim @ dispList as ^Rect
dim   tempList as ^Rect
dim as Rect             r
dim as unsigned long @  listEntryCount
dim as unsigned long    j

long if ( fn FBTestForLibrary( "RezLib" ) == _false )
shutdown "RezLib not found"
end if

dispList = fn GetDisplayList( @listEntryCount )
print "displays found = " listEntryCount
j = 0
tempList = dispList
// print rects of all displays
while ( j < listEntryCount )
  r = tempList
  print r
  tempList += sizeof( Rect )
j++
wend
// finished with dispList
DisposeDisplayList( @dispList )
do
HandleEvents
until 0
'-----------


Robert P.