home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 3_2004-2005.ISO / Data / Zips / Exploding_1734904182004.psc / mDeclares.bas < prev   
Encoding:
BASIC Source File  |  2004-04-17  |  4.2 KB  |  174 lines

  1. Attribute VB_Name = "mDeclares"
  2. Option Explicit
  3.  
  4. ' I usually put constants, types, and functions in the forms/modules/classes
  5. ' that call them, but this project had so many (and the potential to have
  6. ' even more), I decided to put them all in one module.
  7.  
  8. ' Constants.
  9. Public Const CCDEVICENAME = 32&
  10. Public Const CCFORMNAME = 32&
  11. Public Const DM_PELSWIDTH = &H80000
  12. Public Const DM_PELSHEIGHT = &H100000
  13.  
  14. Public Const GW_CHILD = 5&
  15. Public Const GWL_WNDPROC = -4&
  16. Public Const GWL_HINSTANCE = -6&
  17. Public Const GWL_HWNDPARENT = -8&
  18. Public Const GWL_STYLE = -16&
  19. Public Const GWL_EXSTYLE = -20&
  20. Public Const GWL_USERDATA = -21&
  21. Public Const GWL_ID = -12&
  22. Public Const WS_CHILD = &H40000000
  23. Public Const SWP_NOMOVE = 2&
  24. Public Const SWP_NOSIZE = 1&
  25. Public Const FLAGS = SWP_NOMOVE& Or SWP_NOSIZE&
  26. Public Const HWND_TOPMOST = -1&
  27. Public Const HWND_NOTOPMOST = -2&
  28. Public Const SPI_SCREENSAVERRUNNING = 97&
  29.  
  30. Public Const Pi       As Single = 3.14159265358979
  31. Public Const PiDiv180 As Single = 1.74532925199433E-02
  32. Public Const TPi      As Single = 6.28318530717959
  33.  
  34. Public Const HORZRES = 8&
  35. Public Const VERTRES = 10&
  36.  
  37. ' Types.
  38. Public Type tPoint
  39.     X As Long
  40.     Y As Long
  41. End Type
  42.  
  43. Public Type RECT
  44.     Left   As Long
  45.     Top    As Long
  46.     Right  As Long
  47.     Bottom As Long
  48. End Type
  49.  
  50. Public Type RGBQUAD
  51.     b As Byte
  52.     g As Byte
  53.     r As Byte
  54.     a As Byte
  55. End Type
  56.  
  57. Public Type SAFEARRAYBOUND
  58.     cElements As Long
  59.     lLbound   As Long
  60. End Type
  61.  
  62. Public Type SAFEARRAY2D
  63.     cDims      As Integer
  64.     fFeatures  As Integer
  65.     cbElements As Long
  66.     cLocks     As Long
  67.     pvData     As Long
  68.     Bounds(1)  As SAFEARRAYBOUND
  69. End Type
  70.  
  71. Public Type DEVMODE
  72.     dmDeviceName    As String * CCDEVICENAME
  73.     dmSpecVersion   As Integer
  74.     dmDriverVersion As Integer
  75.     dmSize          As Integer
  76.     dmDriverExtra   As Integer
  77.  
  78.     dmFields        As Long
  79.     dmOrientation   As Integer
  80.     dmPaperSize     As Integer
  81.     dmPaperLength   As Integer
  82.     dmPaperWidth    As Integer
  83.     dmScale         As Integer
  84.     dmCopies        As Integer
  85.     dmDefaultSource As Integer
  86.     dmPrintQuality  As Integer
  87.     dmColor         As Integer
  88.     dmDuplex        As Integer
  89.     dmYResolution   As Integer
  90.     dmTTOption      As Integer
  91.     dmCollate       As Integer
  92.  
  93.     dmFormName         As String * CCFORMNAME
  94.     dmUnusedPadding    As Integer
  95.     dmBitsPerPel       As Integer
  96.     dmPelsWidth        As Long
  97.     dmPelsHeight       As Long
  98.     dmDisplayFlags     As Long
  99.     dmDisplayFrequency As Long
  100. End Type
  101.  
  102. Public Type udtFrameRate
  103.     Text  As String
  104.     Value As Long
  105.     Ticks As Long
  106. End Type
  107.  
  108. ' Used to read/write blur settings in INI.
  109. Public Type udtBlurSettings
  110.     Enabled  As Long
  111.     Quick    As Long
  112.     Strength As Long
  113. End Type
  114.  
  115. ' Used to read/write buffer settings in INI.
  116. Public Type udtBufferSettings
  117.     Width            As Long
  118.     Height           As Long
  119.     ScreenIndex      As Long
  120.     BackColor        As Long
  121.     FillColor        As Long
  122.     StretchMode      As Long
  123.     DisplayFrameRate As Long
  124. End Type
  125.  
  126. ' Used to read/write flower settings in INI.
  127. Public Type udtFlowerSettings
  128.     FlowerCount     As Long
  129.     PetalCount      As Long
  130.     PetalWidth      As Long
  131.     PetalPointiness As Long
  132. End Type
  133.  
  134. Public Type udtSettings
  135.     Mode   As String
  136.     Flower As udtFlowerSettings
  137.     Buffer As udtBufferSettings
  138.     Blur   As udtBlurSettings
  139. End Type
  140.  
  141. Public Type udtFlowerColorPart
  142.     Value     As Integer
  143.     Direction As Integer
  144. End Type
  145.  
  146. Public Type udtFlowerColor
  147.     r As udtFlowerColorPart
  148.     g As udtFlowerColorPart
  149.     b As udtFlowerColorPart
  150. End Type
  151.  
  152. ' Used to render the flowers.
  153. Public Type udtFlower
  154.  
  155.     Points(3)   As tPoint
  156.     Center      As tPoint
  157.     Direction   As tPoint ' not really, but 2 related values
  158.     
  159.     Bounce      As Single
  160.     BounceRate  As Single
  161.     
  162.     Color       As udtFlowerColor
  163.     
  164.     Angle       As Long
  165.     SpiMode   As StrinlowerSet '     As Integer
  166.   no read/write buffer mlur   fErColor
  167.     
  168.   &o1te flower settBngs
  169.     Melatedl 
  170.   'tfertef"lTSM As).soelatedl 
  171.   'tfertef"lnO-S  dDoene  Blur   As udtBl   As Singls).soelatedl 
  172.   REdDoene  Bls7Part
  173.     g As udt1it
  174.      t8t