home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / util / misc / reqchange / source / bottomborder.c
Text File  |  1994-07-23  |  1KB  |  42 lines

  1. //
  2. // BottomBorder.c
  3. //
  4. // Written by Magnus Holmgren  (Date: 20.07.94)
  5. //
  6. // This source is pure public domain.
  7. // You may do anything you want with it.
  8. //
  9. // Try to get the size of the bottom border, even if SysIHack have been
  10. // installed with a different size. If you need to find the size of any
  11. // of the other sysiclass images, it should be easy for you to do
  12. // the needed modifications. Remember that the Workbench usually uses
  13. // the size SYSISIZE_MEDRES (even for a 1:1 aspect screen). You only
  14. // need to change this if you know you open your window on a lowres
  15. // screen.
  16.  
  17.  
  18. LONG GetBottomBorderHeight( struct Screen *scr )
  19. {
  20.     struct DrawInfo *dri;
  21.     APTR obj;
  22.     LONG h = 10;
  23.  
  24.     if( dri = GetScreenDrawInfo( scr ) )
  25.     {
  26.         if( obj = NewObject( NULL, "sysiclass", SYSIA_DrawInfo, dri,
  27.                                                 SYSIA_Size, SYSISIZE_MEDRES,
  28.                                                 SYSIA_Which, SIZEIMAGE,
  29.                                                 TAG_DONE, 0 ) )
  30.         {
  31.             if( !GetAttr( IA_Height, obj, &h ) )
  32.                 h = 10;  // This check maybe isn't necessary... :)
  33.  
  34.             DisposeObject( obj );
  35.         }
  36.  
  37.         FreeScreenDrawInfo( scr, dri );
  38.     }
  39.  
  40.     return( h );
  41. }
  42.