Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef FILMSTRIP_INCLUDED
Toshihiro Shimizu 890ddd
#define FILMSTRIP_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tw/tw.h"
Toshihiro Shimizu 890ddd
//#include "tw/scrollbar.h"
Toshihiro Shimizu 890ddd
#include "tlevel_io.h"
Toshihiro Shimizu 890ddd
#include "tthread.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
// forward declaration
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TScrollbar;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TWIN_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class DVAPI TFilmStripPanel : public TWidget {
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  TPoint m_lastPos;
Shinya Kitaoka 120a6e
  int m_offset;
Shinya Kitaoka 120a6e
  TScrollbar *m_scrollbar;
Shinya Kitaoka 120a6e
  TLevelP m_level;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TUINT32 m_loaderId;
Shinya Kitaoka 120a6e
  TLevelReaderP m_levelReader;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool m_loaded;
Shinya Kitaoka 120a6e
  TThread::Mutex m_mutex;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  friend class FilmStripLoader;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  static const int m_xsize;
Shinya Kitaoka 120a6e
  static const int m_ysize;
Shinya Kitaoka 120a6e
  static const int m_frameHeight;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TFilmStripPanel(TWidget *parent, string name = "FilmStripPanel");
Shinya Kitaoka 120a6e
  ~TFilmStripPanel();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void repaint();
Shinya Kitaoka 120a6e
  void draw();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void leftButtonDown(const TMouseEvent &);
Shinya Kitaoka 120a6e
  void leftButtonDrag(const TMouseEvent &);
Shinya Kitaoka 120a6e
  void leftButtonUp(const TMouseEvent &);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void onDrop(string s);
Shinya Kitaoka 120a6e
  void onTimer(int);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setScrollbar(TScrollbar *sb);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setLevel(TLevelP level);
Shinya Kitaoka 120a6e
  TLevelP getLevel() { return m_level; };
Shinya Kitaoka 120a6e
  void onScrollbarMove(int value);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void updateScrollbar();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class DVAPI TFilmStrip : public TWidget {
Shinya Kitaoka 120a6e
  TFilmStripPanel *m_panel;
Shinya Kitaoka 120a6e
  TScrollbar *m_scrollbar;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TFilmStrip(TWidget *parent, string name = "FilmStrip");
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void configureNotify(const TDimension &d);
Shinya Kitaoka 120a6e
  void drop(string s) { m_panel->onDrop(s); };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif