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

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

#ifndef DJVLUT_APP_H
#define DJVLUT_APP_H
#include "base.h"
#include <djImageOpStack.h>
#include <djApp.h>

namespace djvlut {

class Window;
class PrefsDialog;
class AboutDialog;

// Application.
//
class App : public dj::App {
public:

  App(int & argc, char ** argv);
  ~App();
  
  // Video lookup table.
  //
  void vlutPreview(bool);
  void vlutUpdate();
  bool vlutPreview() const { return _vlutPreview; }
  
  // Image operations.
  //
  ImageOpStack & imageOpStack() { return _imageOpStack; }
  
  // Files.
  //
  void fileSave(const Str &);
  
  // Dialogs.
  //
  void prefsDialog();
  void aboutDialog();
  
  // Preferences.
  //
  void saveWindowGeom(bool);
  bool saveWindowGeom() const { return _saveWindowGeom; }

private:
  
  void prefsSet();
  void prefsGet();
  const Str cmdln(StrList &);
  void help();

  Image _vlut;
  Str _vlutName;
  ImageIoInfo _vlutInfo;
  bool _vlutPreview;
  ImageSave * _vlutSave;

  ImageOpStack _imageOpStack;
  
  bool _saveWindowGeom;

  Window * _window;
  PrefsDialog * _prefsDialog;
  AboutDialog * _aboutDialog;
  bool _callbacks;
};

#define djvlutApp (static_cast<djvlut::App *>(djApp))

}

#endif
