#ifndef _ALARMLIGHT_H
#define _ALARMLIGHT_H
static char AlarmLight_h_id[] = "$Header: /usr/tiburon/unix/gui/tmacs/RCS/AlarmLight.h,v 1.2 1997/05/30 15:43:35 oreilly Exp $";

/*
$Log: AlarmLight.h,v $
Revision 1.2  1997/05/30 15:43:35  oreilly
*** empty log message ***

 * Revision 1.1  96/10/28  09:13:12  09:13:12  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/

#include "DmGuiObject.h"
#include "Alarm.h"
#include "SystemAlarms.h"

/*
AlarmLight uses colored button to indicate current state and 
priority of active alarms
*/
class AlarmLight : public VkComponent
{
  public:
  AlarmLight(const char *name, Widget parent);
  ~AlarmLight();

  virtual const char *className() 
  {
    return "AlarmLight";
  }

  void shine();
  void flash();
  void darken();

  Priority priority()
  {
    return _priority;
  }
  
  void setPriority(Priority priority)
  {
    _priority = priority;
  }
  
  void setButtonCallback(XtCallbackProc, XtPointer clientData);
  void setLabel(char *label);
  
  protected:
  enum 
  {
    InitState, Dark, Shining, Flashing
  };

  int _state;
  
  Priority _priority;   // Highest current unacknowledged or active priority

  Widget _alarmButton;
  XtIntervalId _flashTimer;
  int _flashPeriod;
  int _phase;
  Pixel _inactiveForeground, _inactiveBackground;
  
  Pixel buttonBackground();
  Pixel buttonForeground();
  Pixel _priority1Foreground, _priority2Foreground, _priority3Foreground;  
  Pixel _priority1Background, _priority2Background, _priority3Background;
  Pixel _noPriorityForeground, _noPriorityBackground;
  
  private:
  
  static void timerCallback(XtPointer clientData, XtIntervalId *id);
  static void alarmButtonCallback(Widget w, XtPointer clientData, 
				  XtPointer callData);
};



#endif
