home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / Logo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  116 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*---------------------------------------*/
  19. /*                                                                        */
  20. /* Name:        Logo.h                                                    */
  21. /* Description:    XFE_Logo component header file.                            */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27.  
  28. #ifndef _xfe_logo_h_
  29. #define _xfe_logo_h_
  30.  
  31. #include "Component.h"
  32. #include "Frame.h"
  33. #include "AnimationType.h"
  34.  
  35. //
  36. // Animation Size
  37. //
  38. typedef enum
  39. {
  40.     XFE_ANIMATION_LARGE,
  41.     XFE_ANIMATION_SMALL
  42. } EAnimationSize;
  43.  
  44. class XFE_Logo : public XFE_Component
  45. {
  46. public:  
  47.     
  48.     XFE_Logo        (XFE_Frame *        frame,
  49.                      Widget                parent,
  50.                      const char *        name,
  51.                      int                interval = 100);
  52.  
  53.     virtual ~XFE_Logo();
  54.  
  55.     // Accessors
  56.     Cardinal            getCurrentFrame        ();
  57.     EAnimationSize        getSize                ();
  58.     EAnimationType        getType                ();
  59.     XP_Bool                isRunning            ();
  60.  
  61.     // Mutators
  62.     void                setCurrentFrame        (Cardinal index);
  63.     void                setInterval            (Cardinal interval);
  64.     void                setSize                (EAnimationSize size);
  65.     void                setType                (EAnimationType type);
  66.  
  67.     // Control methods
  68.     void                reset                ();
  69.     void                start                ();
  70.     void                stop                ();
  71.  
  72. #ifdef NETSCAPE_PRIV
  73.     // Hee hee
  74.     void                easterEgg            (URL_Struct * url);
  75. #endif /* NETSCAPE_PRIV */
  76.  
  77.     XP_Bool        processTraversal        (XmTraversalDirection direction);
  78.  
  79. private:
  80.  
  81.     XFE_Frame *            _frame;
  82.     EAnimationType        _type;
  83.     EAnimationSize        _size;
  84. #ifdef NETSCAPE_PRIV
  85.     XP_Bool             _mozillaEasterEgg;  // Have we visted about:mozilla ?
  86. #endif /* NETSCAPE_PRIV */
  87.     
  88.  
  89.     static Pixmap **        _small_animation_pixmaps;
  90.     static fe_icon_data **    _small_animation_data;
  91.     static Pixmap **        _large_animation_pixmaps;
  92.     static fe_icon_data **    _large_animation_data;
  93.     static Cardinal             _num_animations;
  94.     static Cardinal *        _animation_frame_counts;
  95.  
  96.     void            updatePixmaps        ();
  97.  
  98.     static void        initAnimationData    ();
  99.     static XP_Bool    animationsAreValid    ();
  100.  
  101.     static Pixmap *    createAnimation        (XFE_Frame *        frame,
  102.                                          Widget                logo,
  103.                                          fe_icon_data *        animation_data,
  104.                                          Cardinal            num_frames);
  105.  
  106.     static Pixmap     createPixmap        (XFE_Frame *        frame,
  107.                                          Widget                logo,
  108.                                          fe_icon_data *        icon_data);
  109.  
  110.  
  111.     static void        logoCallback        (Widget,XtPointer,XtPointer);
  112.  
  113. };
  114.  
  115. #endif /* _xfe_logo_h_ */
  116.