home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / easygui_os12 / source / hybrid / drawinfo.e next >
Encoding:
Text File  |  2000-06-11  |  1.8 KB  |  57 lines

  1. /* RST: hybrid "any kick" replacement for intuition library
  2.    GetScreenDrawInfo() and FreeScreenDrawInfo()
  3.  
  4.    Please do not redistribute modified versions of this code. If you have
  5.    any ideas how to make things better contact me at metamonk@yahoo.com.
  6.  
  7.    Also, please do not distribute further 'hybrid/#?' modules since there
  8.    is already a large amount of additional stuff in work. Contact me...
  9.  
  10.    This code is Copyright (c) 2000, Ralf 'hippie2000' Steines, and
  11.    inherits the legal state from the original EasyGUI disctribution. */
  12.  
  13. OPT MODULE
  14. OPT EXPORT
  15.  
  16. MODULE 'intuition/screens',
  17.        'graphics/gfx', 'exec/memory',
  18.        'hybrid/version'
  19.  
  20. PROC getScreenDrawInfo(screen:PTR TO screen)
  21.   DEF dri=NIL:PTR TO drawinfo,newlook=FALSE
  22.   IF intuiVersion(36)
  23.     dri:=GetScreenDrawInfo(screen)
  24.   ELSE
  25.     IF screen
  26.       IF dri:=AllocMem(SIZEOF drawinfo+9,MEMF_ANY OR MEMF_CLEAR)
  27.         dri.depth:=screen.bitmap.depth
  28.         IF dri.depth>1 THEN newlook:=TRUE
  29.         dri.version:=1 -> corresponds to V37 release
  30.         dri.numpens:=9
  31.         dri.pens:=dri+SIZEOF drawinfo
  32.         dri.pens[DETAILPEN]:=screen.detailpen
  33.         dri.pens[BLOCKPEN]:=screen.blockpen
  34.         dri.pens[TEXTPEN]:=1
  35.         dri.pens[SHINEPEN]:=IF newlook THEN 2 ELSE 1
  36.         dri.pens[SHADOWPEN]:=1
  37.         dri.pens[FILLPEN]:=IF newlook THEN 3 ELSE 1
  38.         dri.pens[FILLTEXTPEN]:=IF newlook THEN 1 ELSE 0
  39.         dri.pens[BACKGROUNDPEN]:=0
  40.         dri.pens[HIGHLIGHTTEXTPEN]:=IF newlook THEN 2 ELSE 1
  41.         dri.font:=screen.font
  42.         dri.resolutionx:=44
  43.         dri.resolutiony:=44
  44.         dri.flags:=IF newlook THEN DRIF_NEWLOOK ELSE NIL
  45.       ENDIF
  46.     ENDIF
  47.   ENDIF
  48. ENDPROC dri
  49.  
  50. PROC freeScreenDrawInfo(screen:PTR TO screen,dri)
  51.   IF intuiVersion(36)
  52.     FreeScreenDrawInfo(screen,dri)
  53.   ELSE
  54.     IF dri THEN FreeMem(dri,SIZEOF drawinfo+9)
  55.   ENDIF
  56. ENDPROC
  57.