00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PDFPORTRAITVIEW_H_
00020 #define PDFPORTRAITVIEW_H_
00021
00022 #include "PageInfo.h"
00023 #include "LayoutMgr.h"
00024 #include "DisplayList.h"
00025 #include "Settings.h"
00026 #include <gtk/gtk.h>
00028
00029
00030
00032 class CPDFView;
00033 class CPDFPortraitView
00034 {
00035 private:
00036 CPDFView * view;
00037 CLayoutMgr layout;
00038 CDisplayList list;
00039 int nStart, nEnd;
00040 int nOffset;
00041 GBool bReady;
00042
00043 public:
00044 CPDFPortraitView(void);
00045 ~CPDFPortraitView(void);
00046
00047 private:
00048 void onPageRendered(const int pageNumber);
00049 void updateToolbar(CPageInfo *page);
00050 void updatePagebar();
00051 void zoomFromRect(int left, int top, int right, int bottom);
00052 void zoomToRect(int left, int top, int right, int bottom);
00053 void switchMode();
00054 void drawScribble(const int x, const int y, const int pn);
00055 void getPagesRange(int & start, int & end, const int pageNumber, const ContinousModeScroll scroll);
00056 void validatePosition();
00057 void setReady(const GBool b = gTrue) { bReady = b; }
00058 void getPageScreenPosition(const int pn, int & x, int & y);
00059 void zoomBack();
00060 void backward();
00061 void forward();
00062
00064 void zoomFromRectPageMode(rectangle & rect);
00065 void adjustPositionPageMode(const rectangle & oldRect, double ratio);
00066 void zoomFitPageMode();
00067 GBool doLinkPageMode(const int x, const int y);
00068
00070 void zoomFromRectContinousMode(rectangle & rect);
00071 void adjustPositionContinousMode(const rectangle & oldRect, double ratio);
00072 void zoomFitContinousMode();
00073 GBool doLinkContinousMode(const int x, const int y);
00074
00076
00077 void displayPages(const int start, const int end);
00078 void drawPages(const int start, const int end);
00079 void drawPageImage(CPageInfo *page);
00080
00081 public:
00082 void setView(CPDFView *p) { view = p; }
00083 void init();
00084 void clear();
00085 void displayPage(const int pageNumber, const ContinousModeScroll mode = ScrollToPage);
00086
00087 void ipcCbk(gint * fd, GdkInputCondition id);
00088 int hitTest(const int x, const int y, int & ox, int & oy);
00089 GBool isReady() const { return bReady; }
00090
00092 gboolean buttonPressCbk(GdkEventButton *);
00093 gboolean buttonReleaseCbk(GdkEventButton *);
00094 gboolean motionNotifyCbk(GdkEventMotion *);
00095 gboolean keyPressCbk(GdkEventKey *);
00096 gboolean deleteCbk(GdkEvent *);
00097
00098 };
00099
00100
00101 #endif