home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WANIMATE.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  5KB  |  166 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WAnimation -- Wrapper for the Windows 95 Animation control.
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       AnimationStart --
  19.  *
  20.  *       AnimationStop --
  21.  *
  22.  *************************************************************************/
  23.  
  24. #ifndef _WANIMATE_HPP_INCLUDED
  25. #define _WANIMATE_HPP_INCLUDED
  26.  
  27. #ifndef _WNO_PRAGMA_PUSH
  28. #pragma pack(push,8);
  29. #pragma enum int;
  30. #endif
  31.  
  32. #ifndef _WRESID_HPP_INCLUDED
  33. #  include "wresid.hpp"
  34. #endif
  35. #ifndef _WCONTROL_HPP_INCLUDED
  36. #  include "wcontrol.hpp"
  37. #endif
  38. #ifndef _WSTRING_HPP_INCLUDED
  39. #  include "wstring.hpp"
  40. #endif
  41.  
  42. //
  43. // Animation styles
  44. //
  45.  
  46. #define WSACCenter              ((WStyle)0x00000001L) // ACS_CENTER
  47. #define WSACCentered            ((WStyle)0x00000001L) // ACS_CENTER
  48. #define WSACTransparent         ((WStyle)0x00000002L) // ACS_TRANSPARENT
  49. #define WSACAutoPlay            ((WStyle)0x00000004L) // ACS_AUTOPLAY
  50.  
  51. class WCMCLASS WAnimation : public WControl {
  52.     WDeclareSubclass( WAnimation, WControl );
  53.     
  54.     public:
  55.     
  56.         /************************************************************
  57.          * Constructors and Destructors
  58.          ************************************************************/
  59.  
  60.         WAnimation();
  61.     
  62.         ~WAnimation();
  63.     
  64.         /************************************************************
  65.          * Properties
  66.          ************************************************************/
  67.  
  68.         // AutoPlay
  69.         //
  70.         //    If TRUE, animation window automatically plays the
  71.         //    animation when it is loaded.
  72.  
  73.         WBool GetAutoPlay() const;
  74.         WBool SetAutoPlay( WBool on );
  75.  
  76.         // Centered
  77.         //
  78.         //    If TRUE, animation is centered within the window
  79.         //    when played.
  80.  
  81.         WBool GetCentered() const;
  82.         WBool SetCentered( WBool center );
  83.  
  84.         // Transparent
  85.         //
  86.         //    If TRUE, animation background is transparent.
  87.  
  88.         WBool GetTransparent() const;
  89.         WBool SetTransparent( WBool transparent );
  90.  
  91.         /*************************************************************
  92.          * Methods
  93.          *************************************************************/
  94.  
  95.         // Close
  96.         //
  97.         //    Close a .AVI file/resource.
  98.  
  99.         WBool Close();
  100.  
  101.         // Open
  102.         //
  103.         //    Open a .AVI file/resource for playing.  The resource can
  104.         //    only come from the .EXE resources.
  105.  
  106.         WBool Open( const WChar *aviFileName );
  107.         WBool Open( const WResourceID & id );
  108.  
  109.         // Play
  110.         //
  111.         //    Play the opened file numTimeToRepeat times (a value
  112.         //    of -1 means play forever) from frame #startFrame
  113.         //    to frame #endFrame.  Frames are numbered from 0 to
  114.         //    65535.  A value of -1 for endFrame means play until
  115.         //    the end.
  116.  
  117.         WBool Play( WInt numTimesToRepeat=-1, WShort startFrame=0,
  118.                     WShort endFrame=-1 );
  119.  
  120.         // Seek
  121.         //
  122.         //    Move to a certain frame in the .AVI clip.
  123.  
  124.         WBool Seek( WShort frame )
  125.             { return Play( 1, frame, frame ); }
  126.  
  127.  
  128.         // Stop
  129.         //
  130.         //    Stop playing the .AVI clip.
  131.  
  132.         WBool Stop();
  133.  
  134.         /***************************************************************
  135.          * Overrides
  136.          ***************************************************************/
  137.  
  138.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  139.                                    void * data=NULL );
  140.  
  141.         virtual WBool ProcessCommand( WUInt id, WNotify code,
  142.                                       WNotifyInfo info, WLong & returns );
  143.  
  144.         virtual const WChar * InitializeClass();
  145.  
  146.         virtual WStyle GetDefaultStyle() const;
  147.  
  148.         /***************************************************************
  149.          * Data Members
  150.          ***************************************************************/
  151.  
  152.     private:
  153.  
  154.         WString                 _aviFileName;
  155.         WResourceID             _aviID;
  156.         WBool                   _hasFileName;
  157.         WBool                   _hasID;
  158. };
  159.  
  160. #ifndef _WNO_PRAGMA_PUSH
  161. #pragma enum pop;
  162. #pragma pack(pop);
  163. #endif
  164.  
  165. #endif // _WANIMATE_HPP_INCLUDED
  166.