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