/*------------------------------------------------------------------------------
 src/bin/djvlut/window.h

 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJVLUT_WINDOW_H
#define DJVLUT_WINDOW_H
#include "base.h"
#include <djWindow.h>

namespace dj {
class Image;
class ImageOp;
class MenuItems;
class MenubarWidget;
class ImageOpStackWidget;
};

namespace djvlut {

class VlutWidget;

// Window.
//
class Window : public dj::Window {
public:

  Window();
  ~Window();
  void die();
  
  // Set.
  //
  void vlut(const Image *);
  void stackActive(int);

  // Get.
  //
  int stackActive() const;
  
  // Widget.
  //
  void widgetUpdate();
  
private:

  DJ_FL_WIDGET_CALLBACK(Window, vlutPreviewCallback);
  DJ_CALLBACK(Window, fileSaveCallback, const Str &)
  DJ_CALLBACK(Window, fileSaveCallback, bool)
  DJ_FL_WIDGET_CALLBACK(Window, fileSaveCallback)
  DJ_FL_WIDGET_CALLBACK(Window, prefsCallback)
  DJ_FL_WIDGET_CALLBACK(Window, aboutCallback)
  DJ_FL_WIDGET_CALLBACK(Window, exitCallback)
  
  DJ_CALLBACK(Window, updateCallback, bool);

  DJ_CALLBACK(Window, stackActiveCallback, int);
  DJ_FL_WIDGET_CALLBACK(Window, stackActiveCallback)
  DJ_FL_WIDGET_CALLBACK(Window, stackNewCallback)
  DJ_FL_WIDGET_CALLBACK(Window, stackCopyCallback)
  DJ_FL_WIDGET_CALLBACK(Window, stackDelCallback)
  DJ_CALLBACK(Window, stackNameCallback, const Str &)
  DJ_FL_WIDGET_CALLBACK(Window, stackNameCallback)
  DJ_FL_WIDGET_CALLBACK(Window, stackLeftCallback)
  DJ_FL_WIDGET_CALLBACK(Window, stackRightCallback)
  DJ_CALLBACK(Window, stackUpdateCallback, int);
  
  DJ_FL_WIDGET_CALLBACK(Window, opNewCallback)
  DJ_FL_WIDGET_CALLBACK(Window, opCopyCallback)
  DJ_FL_WIDGET_CALLBACK(Window, opDelCallback)
  DJ_FL_WIDGET_CALLBACK(Window, opLeftCallback)
  DJ_FL_WIDGET_CALLBACK(Window, opRightCallback)
  
  DJ_CALLBACK(Window, closeCallback, bool)

  void menuUpdate();

  ImageOpStackWidget * _widget;
  VlutWidget * _vlutWidget;
  MenuItems * _menuItems;
  MenubarWidget * _menubar;
  IntList _stackMenuId, _opMenuId;
  bool _callbacks;
};

}

#endif
