00001 // -*- Mode: c++ -*- 00002 /* ============================================================ 00003 * File : singleview.h 00004 * Description : 00005 * 00006 * Copyright 2004-2006 Renchi Raju, Daniel Kristjansson 00007 * 00008 * This program is free software; you can redistribute it 00009 * and/or modify it under the terms of the GNU General 00010 * Public License as published bythe Free Software Foundation; 00011 * either version 2, or (at your option) 00012 * any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * ============================================================ */ 00020 00021 #ifndef SINGLEVIEW_H 00022 #define SINGLEVIEW_H 00023 00024 #include <vector> 00025 using namespace std; 00026 00027 #include <qimage.h> 00028 #include <qpointarray.h> 00029 00030 #include "imageview.h" 00031 #include "iconview.h" 00032 #include "sequence.h" 00033 00034 class QTimer; 00035 00036 class SingleView : public MythDialog, public ImageView 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 SingleView(ThumbList itemList, int pos, int slideShow, int sortorder, 00042 MythMainWindow *parent, const char *name=0); 00043 ~SingleView(); 00044 00045 // Effect subtype enumeration 00046 static const int kSweepRightToLeft = 0; 00047 static const int kSweepLeftToRight = 1; 00048 static const int kSweepBottomToTop = 2; 00049 static const int kSweepTopToBottom = 3; 00050 00051 static const int kIncomingEdgesFixed = 0; 00052 static const int kIncomingEdgesMoving = 1; 00053 00054 protected: 00055 // Commands 00056 virtual void Rotate(int angle); 00057 virtual void DisplayNext(bool reset, bool loadImage); 00058 virtual void DisplayPrev(bool reset, bool loadImage); 00059 virtual void Load(void); 00060 virtual void paintEvent(QPaintEvent *e); 00061 virtual void keyPressEvent(QKeyEvent *e); 00062 00063 // Sets 00064 virtual void SetZoom(float zoom); 00065 void SetPixmap(QPixmap*); 00066 00067 // Effects 00068 virtual void RegisterEffects(void); 00069 virtual void RunEffect(const QString &effect); 00070 00071 private: 00072 void StartPainter(void); 00073 void CreateEffectPixmap(void); 00074 void CheckPosition(void); 00075 00076 // Various special effects methods 00077 void EffectNone(void); 00078 void EffectChessboard(void); 00079 void EffectSweep(void); 00080 void EffectGrowing(void); 00081 void EffectHorizLines(void); 00082 void EffectVertLines(void); 00083 void EffectMeltdown(void); 00084 void EffectIncomingEdges(void); 00085 void EffectMultiCircleOut(void); 00086 void EffectSpiralIn(void); 00087 void EffectCircleOut(void); 00088 void EffectBlobs(void); 00089 void EffectNoise(void); 00090 00091 static QPixmap *CreateBackground(const QSize &sz); 00092 00093 private slots: 00094 void SlideTimeout(void); 00095 void CaptionTimeout(void); 00096 00097 private: 00098 // General 00099 QPixmap *m_pixmap; 00100 QImage m_image; 00101 int m_angle; 00102 QPoint m_source_loc; 00103 bool m_scaleMax; 00104 00105 // Info variables 00106 QPixmap *m_info_pixmap; 00107 00108 // Common slideshow variables 00109 int m_caption_show; 00110 QPixmap *m_caption_pixmap; 00111 QPixmap *m_caption_restore_pixmap; 00112 QTimer *m_caption_timer; 00113 00114 // Common effect state variables 00115 QPixmap *m_effect_pixmap; 00116 QPainter *m_effect_painter; 00117 int m_effect_subtype; 00118 QRect m_effect_bounds; 00119 QPoint m_effect_delta0; 00120 QPoint m_effect_delta1; 00121 int m_effect_i; 00122 int m_effect_j; 00123 int m_effect_framerate; 00124 float m_effect_delta2_x; 00125 float m_effect_delta2_y; 00126 float m_effect_alpha; 00127 00128 // Unshared effect state variables 00129 QPoint m_effect_spiral_tmp0; 00130 QPoint m_effect_spiral_tmp1; 00131 vector<int> m_effect_meltdown_y_disp; 00132 float m_effect_multi_circle_out_delta_alpha; 00133 QPointArray m_effect_milti_circle_out_points; 00134 QPointArray m_effect_circle_out_points; 00135 }; 00136 00137 #endif /* SINGLEVIEW_H */
1.5.5