static char DmInputDetector_id[] = "$Header: DmInputDetector.cc,v 1.3 97/03/20 12:29:11 oreilly Exp $";


/*
$Log:	DmInputDetector.cc,v $
Revision 1.3  97/03/20  12:29:11  12:29:11  oreilly (Thomas C. O'Reilly)
*** empty log message ***

Revision 1.2  96/10/28  09:11:59  09:11:59  oreilly (Thomas C. O'Reilly)
*** empty log message ***

Revision 1.1  96/07/22  10:41:55  10:41:55  oreilly (Thomas C. O'Reilly)
First external release

*/
#include <stdlib.h>
#include <Xm/RowColumn.h>
#include "DmInputDetector.h"

DmInputDetector::DmInputDetector(const char *name, Widget parent, 
				 DmObject *dmObject,
				 DmGuiObject *peer)
  : DmGuiObject(name, parent)
{
  // Since this has no actual GUI, just make a tiny, unmanaged manager 
  // Widget 
  _baseWidget = XtVaCreateWidget(name, xmRowColumnWidgetClass, parent,
				 XmNwidth, 0, XmNheight, 0, NULL);
  installDestroyHandler();

  char errorBuf[512];
  if (addDmObject(dmObject, DmConsumeFlag) == -1)
    return;

  if (setConsumePeriod(AperiodicGuaranteed) == -1)
    return;
  
  _dmObject = dmObject;
  _peer = peer;
  _enabled = True;
}


DmInputDetector::~DmInputDetector()
{
}


void DmInputDetector::updateGui(DM_Item handle)
{
  if (_enabled)
    _peer->updateFromPeer(this, (void *)NULL);
}


DmObject *DmInputDetector::dmObject()
{
  return _dmObject;
}

