OSDN Git Service

ゴミデーターを削除
[marathon/ShapeFusion.git] / Shapes / SequenceView.h
1 /*
2  * This file is part of ShapeFusion (Copyright 2000 Tito Dal Canton)
3  *
4  * ShapeFusion is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * ShapeFusion is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with ShapeFusion; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18
19 //
20 // SequenceView
21 // An editor widget for sequence frames. It displays the frames of a
22 // sequence keeping them organized in views.
23 //
24
25 #ifndef SEQUENCEVIEW_H
26 #define SEQUENCEVIEW_H
27
28 #include "wx/wxprec.h"
29 #ifndef WX_PRECOMP
30     #include "wx/wx.h"
31 #endif
32 #include "wx/docview.h"
33 #include "ShapesElements.h"
34
35 DECLARE_EVENT_TYPE(wxEVT_SEQUENCEVIEW, -1)
36
37 class SequenceView: public wxScrolledWindow {
38 private:
39         vector<ShapesFrame*>    mFrames;                // pointers to frames
40         vector<ShapesBitmap*>   mBitmaps;               // pointers to bitmaps
41         vector<wxBitmap>                mThumbnails;    // scaled/rendered frame thumbnails
42         ShapesColorTable                *mColorTable;           // which palette to use for display
43         vector<wxPoint>                 mThumbnailPositions;    // thumbnail positions within window
44         wxCoord                                 mThumbnailSize,
45                                                         mMargin,                        // margin between thumbnails and window edges
46                                                         mAngleLabelSpace;
47         wxBitmap                                mPrevBtnIcon,
48                                                         mNextBtnIcon;
49         bool                                    mAutoSize,
50                                                         mWhiteTransparency;
51         int                                             mSelection;                     // selected thumbnail
52         wxPen                                   mThumbnailPen,
53                                                         mSelectionPen;
54         wxBrush                                 mAngleBrush;
55
56         int                                             mNumberOfViews,
57                                                         mFramesPerView,
58                                                         mAnimationType;
59         vector<short>                   *mFrameIndexes;
60
61         wxBitmap CreateThumbnail(ShapesFrame *fp);
62         void UpdateVirtualSize(void);
63
64         void PopupFrameIndexDialog(int index);
65         wxView* mView;
66
67         wxRect GetNextArrowButtonRect(int thumbnail_index) const;
68         wxRect GetPrevArrowButtonRect(int thumbnail_index) const;
69
70 protected:
71         DECLARE_EVENT_TABLE();
72
73 public:
74         SequenceView(wxWindow *parent, wxWindowID id);
75         // event handlers
76         void OnPaint(wxPaintEvent& e);
77         void OnSize(wxSizeEvent& e);
78         void OnMouseDown(wxMouseEvent& e);
79         void OnMouseMove(wxMouseEvent &e);
80         void OnMouseUp(wxMouseEvent& e);
81         void OnKeyDown(wxKeyEvent& e);
82         void OnMouseDoubleClick(wxMouseEvent& e);
83         // access methods
84         int GetSelection(void) const;
85         void SetThumbnailSize(int size);
86         void SetTranspPixelsDisplay(bool show);
87         void AddFrame(ShapesFrame *fp);
88         void AddBitmap(ShapesBitmap *bp);
89         void SetColorTable(ShapesColorTable *ct);
90         void SetSeqParameters(int animtype, int fpv, vector<short> *indexes, wxView* view);
91         void Clear(void);
92         // utilities
93         void RebuildThumbnail(unsigned int i);
94         void RebuildThumbnails(void);
95 };
96
97 #endif