-#ifdef XlibSpecificationRelease
-#if XlibSpecificationRelease < 5
-typedef char *XPointer;
-#endif
-#else
-typedef char *XPointer;
-#endif
-
-// hack around old X includes which are missing these symbols
-#ifndef XK_Page_Up
-#define XK_Page_Up 0xFF55
-#endif
-#ifndef XK_Page_Down
-#define XK_Page_Down 0xFF56
-#endif
-
-//------------------------------------------------------------------------
-// misc constants / enums
-//------------------------------------------------------------------------
-
-#define remoteCmdLength 256
-
-enum XpdfMenuItem {
- menuOpen,
- menuSavePDF,
- menuRotateLeft,
- menuRotateRight,
- menuQuit
-};
-
-//------------------------------------------------------------------------
-// prototypes
-//------------------------------------------------------------------------
-
-// loadFile / displayPage
-static GBool loadFile(GString *fileName);
-static void displayPage(int page1, int zoom1, int rotate1, GBool addToHist);
-
-// key press and menu callbacks
-static void keyPressCbk(LTKWindow *win1, KeySym key, Guint modifiers,
- char *s, int n);
-static void menuCbk(LTKMenuItem *item);
-
-// mouse callbacks
-static void buttonPressCbk(LTKWidget *canvas1, int n,
- int mx, int my, int button, GBool dblClick);
-static void buttonReleaseCbk(LTKWidget *canvas1, int n,
- int mx, int my, int button, GBool click);
-static void doLink(int mx, int my);
-static void mouseMoveCbk(LTKWidget *widget, int widgetNum, int mx, int my);
-static void mouseDragCbk(LTKWidget *widget, int widgetNum,
- int mx, int my, int button);
-
-// button callbacks
-static void nextPageCbk(LTKWidget *button, int n, GBool on);
-static void nextTenPageCbk(LTKWidget *button, int n, GBool on);
-static void prevPageCbk(LTKWidget *button, int n, GBool on);
-static void prevTenPageCbk(LTKWidget *button, int n, GBool on);
-static void backCbk(LTKWidget *button, int n, GBool on);
-static void forwardCbk(LTKWidget *button, int n, GBool on);
-static void pageNumCbk(LTKWidget *textIn, int n, GString *text);
-static void zoomMenuCbk(LTKMenuItem *item);
-static void postScriptCbk(LTKWidget *button, int n, GBool on);
-static void aboutCbk(LTKWidget *button, int n, GBool on);
-static void quitCbk(LTKWidget *button, int n, GBool on);
-
-// scrollbar callbacks
-static void scrollVertCbk(LTKWidget *scrollbar, int n, int val);
-static void scrollHorizCbk(LTKWidget *scrollbar, int n, int val);
-
-// misc callbacks
-static void layoutCbk(LTKWindow *win1);
-static void updateScrollbars();
-static void propChangeCbk(LTKWindow *win1, Atom atom);
-
-// selection
-static void setSelection(int newXMin, int newYMin, int newXMax, int newYMax);
-
-// "Open" dialog
-static void mapOpenDialog();
-static void openButtonCbk(LTKWidget *button, int n, GBool on);
-static void openSelectCbk(LTKWidget *widget, int n, GString *name);
-
-// "Save PDF" dialog
-static void mapSaveDialog();
-static void saveButtonCbk(LTKWidget *button, int n, GBool on);
-static void saveSelectCbk(LTKWidget *widget, int n, GString *name);
-
-// "PostScript" dialog
-static void mapPSDialog();
-static void psButtonCbk(LTKWidget *button, int n, GBool on);
-
-// "About" window
-static void mapAboutWin();
-static void closeAboutCbk(LTKWidget *button, int n, GBool on);
-
-// "Find" window
-static void findCbk(LTKWidget *button, int n, GBool on);
-static void mapFindWin();
-static void findButtonCbk(LTKWidget *button, int n, GBool on);
-static void doFind(char *s);
-
-// app kill callback
-static void killCbk(LTKWindow *win1);
-