00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef INCL_VIEW
00013 #define INCL_VIEW
00014
00015 #include "ZoomView.h"
00016
00017 #ifdef USES_DRAWDIB
00018 #define CPLVIEW_BASE_CLASS CScrollView
00019 #else
00020 #define CPLVIEW_BASE_CLASS CZoomView
00021 #endif
00022
00023 class CPLView : public CPLVIEW_BASE_CLASS
00024 {
00025 protected:
00026 CPLView();
00027 DECLARE_DYNCREATE(CPLView)
00028
00029
00030 public:
00031 CPLViewerDoc* GetDocument()
00032 {
00033 ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPLViewerDoc)));
00034 return (CPLViewerDoc*) m_pDocument;
00035 }
00036
00037
00038 public:
00039
00040
00041 public:
00042 virtual ~CPLView();
00043 virtual void OnDraw(CDC* pDC);
00044
00045 virtual void OnInitialUpdate();
00046 virtual void OnActivateView(bool bActivate, CView* pActivateView,
00047 CView* pDeactiveView);
00048 void OnConvertTo8BPP();
00049
00050
00051
00052 protected:
00053 virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00054 virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
00055
00056 private:
00057 void applyFilterAndShow (PLFilter * pFilter);
00058
00059 typedef CPLVIEW_BASE_CLASS Super;
00060
00061 bool m_bFit;
00062 bool m_bDither;
00063 bool m_bZooming;
00064 HCURSOR m_curMove;
00065 HCURSOR m_curPoint;
00066 HCURSOR m_hZoomCursor;
00067 CRect m_InvalidRect;
00068 int m_nDocPosX;
00069 int m_nDocPosY;
00070
00071 void NotifyRanges();
00072 BOOL IsMovable() const;
00073
00074
00075 protected:
00076
00077 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00078 afx_msg void OnSize(UINT nType, int cx, int cy);
00079 afx_msg LRESULT OnDoRealize(WPARAM wParam, LPARAM lParam);
00080 afx_msg void OnUpdateFitImage(CCmdUI* pCmdUI);
00081 afx_msg void OnFitImage();
00082 afx_msg void OnUpdateDither(CCmdUI* pCmdUI);
00083 afx_msg void OnDither();
00084 afx_msg void OnEditCopy();
00085 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00086 afx_msg void OnFilterBilinear();
00087 afx_msg void OnFilterBox();
00088 afx_msg void OnFilterGauss();
00089 afx_msg void OnFilterHamming();
00090 afx_msg void OnFilterCrop();
00091 afx_msg void OnFilterGrayscale();
00092 afx_msg void OnEditPaste();
00093 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00094 afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
00095 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00096 afx_msg void OnSizeToFit();
00097 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00098 afx_msg void OnUpdateZoomMode(CCmdUI* pCmdUI);
00099 afx_msg void OnZoomMode();
00100 afx_msg void OnPaint();
00101 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00102 afx_msg void OnFilterThreshold();
00103 afx_msg void OnUpdateViewShowpalette(CCmdUI* pCmdUI);
00104 afx_msg void OnViewShowpalette();
00105 afx_msg void OnFilterContrast();
00106 afx_msg void OnFilterIntensity();
00107 afx_msg void OnFilterLightness();
00108 afx_msg void OnUpdateTrueColFilter(CCmdUI* pCmdUI);
00109 afx_msg void OnFilterInvert();
00110
00111 afx_msg void OnUpdateBmpInfo(CCmdUI *);
00112 afx_msg void OnUpdatePixelXIndicator(CCmdUI *pCmdUI);
00113 afx_msg void OnUpdatePixelYIndicator(CCmdUI *pCmdUI);
00114 afx_msg void OnUpdateRatioIndicator(CCmdUI *pCmdUI);
00115
00116 DECLARE_MESSAGE_MAP()
00117 };
00118
00119 #undef CPLVIEW_BASE_CLASS
00120
00121 #endif // INCL_VIEW
00122
00123
00124
00125
00126