home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 400 / STARTS5.SIS / devkit.SIS / CF (.txt) next >
Encoding:
EPOC OPL Source  |  1999-02-28  |  1.9 KB  |  77 lines

  1.  
  2.  
  3. rem CF PlugIn for Start5 v2.0
  4. rem V1.00
  5. rem ┬⌐1998 Oliver T├╢lker
  6.  
  7. rem -------------------------------
  8.  
  9. include "systinfo.oxh"
  10. include "system.oxh"
  11.  
  12. const KPluginUpdateRateNever%=0
  13. const KPluginUpdateRateNormal%=1
  14. const KPluginUpdateRateHigh%=2
  15. const KPluginUpdateRateMax%=3 rem not implemented yet
  16. const KPluginHeight%=22 rem all PlugIns have the same height in v2.0PA
  17.  
  18. rem This proc is called when the PlugIn is loaded
  19. proc CF_Load:
  20. endp
  21.  
  22. rem This proc must return the PlugIn's width
  23. proc CF_Width%:
  24.     return 20
  25. endp
  26.  
  27. rem This proc must return one of the constants
  28. rem defined above
  29. proc CF_UpdateRate%:
  30.     return KPluginUpdateRateHigh%
  31. endp
  32.  
  33. rem This is called only once after the PlugIn
  34. rem got its own window. wid% is the WindowID of
  35. rem the PlugIns window.
  36. proc CF_Draw:(wid%)
  37.      CF_Update:(wid%)
  38. endp
  39.  
  40. rem This is called from time to time (depending
  41. rem on the update rate setting). As Start5 and all
  42. rem PlugIns are executed in cooperative multitasking
  43. rem this proc should return as fast as possible.
  44. rem (Normally after max. 1/4 sec.)
  45. proc CF_Update:(wid%)
  46.     LOCAL widb%, present%
  47.  
  48.     if MEDIATYPE&:(3)
  49. <KMediaRemote&
  50.         present%=1
  51.     else
  52.         present%=0
  53.     endIf
  54.     widb%=gloadbit(MyDir$+"Plugins\CF.mbm",0, present%)
  55.     guse wid%
  56.     gat 1,1
  57.     gcopy widb%,0,0,20,20,3
  58.     gclose widb%
  59. endp
  60.  
  61. rem This will be called when the PlugIn is unloaded.
  62. proc CF_Unload:
  63. endp
  64.  
  65. rem Perhaps the most important proc. Called whenever
  66. rem the PlugIns window is tapped. Note that if you
  67. rem stop the program in this proc, Start5 will not
  68. rem react to events.
  69. proc CF_Tapped:
  70.     if MEDIATYPE&:(3)
  71. <KMediaRemote&
  72.         giPrint "'"+SIVolumeName$:(3)+"' free:"+fix$(volumespacefree&:(3)/1024.0,1,12)+" of "+fix$(volumesize&:(3)/1024.0,1,12)+" MB"
  73.     else
  74.         giPrint "Slot is empty!"
  75.     endIf
  76. endp
  77.  
  78.  
  79.