/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _FRIENDLYWINDOW 
#define _FRIENDLYWINDOW 
static char FriendlyWindow_h_id[] = "$Header: /u/oreilly/rov/tmacs/RCS/FriendlyWindow.h,v 1.4 1998/12/18 21:07:21 oreilly Exp $";

/*
$Log: FriendlyWindow.h,v $
Revision 1.4  1998/12/18 21:07:21  oreilly
Added documentation

Revision 1.3  1997/08/12 14:44:48  oreilly
use tiburon icon

 * Revision 1.2  97/03/20  12:34:00  12:34:00  oreilly (Thomas C. O'Reilly)
 * *** empty log message ***
 * 
 * Revision 1.1  96/10/28  09:13:43  09:13:43  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/

#include <Vk/VkSimpleWindow.h>

/*
CLASS 
FriendlyWindow

DESCRIPTION
FriendlyWindow is a kind of VkSimpleWindow that can notify an 
arbitrary object when it receives a WM_DELETE_WINDOW message

AUTHOR
Tom O'Reilly
*/
class FriendlyWindow : public VkSimpleWindow
{
  public:
  FriendlyWindow(const char *name);

  ~FriendlyWindow()
  {
  }

  const char *className()
  {
    return "FriendlyWindow";
  }
  
  // Set function to be called when this window gets WM_DELETE_WINDOW
  // message, along with client data to be passed back  
  void addDeleteHandler(void (*proc)(Widget, XtPointer), 
			XtPointer clientData)
  {
    _deleteHandler = proc;
    _deleteClientData = clientData;
  }

  protected:
  // Function to call when this window gets WM_DELETE_WINDOW 
  // message
  virtual void handleWmDeleteMessage();

  // Additional function to call when this window gets WM_DELETE_WINDOW 
  // message
  void (*_deleteHandler)(Widget mainWindowWidget, XtPointer clientData);

  XtPointer _deleteClientData;  
};



#endif
