home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 110 / EnigmaAmiga110CD.iso / indispensabili / utility / apdf / xpdf-0.80 / ltk / ltkscrollingcanvas.h < prev    next >
C/C++ Source or Header  |  1998-11-27  |  2KB  |  71 lines

  1. //========================================================================
  2. //
  3. // LTKScrollingCanvas.h
  4. //
  5. // Copyright 1996 Derek B. Noonburg
  6. //
  7. //========================================================================
  8.  
  9. #ifndef LTKSCROLLINGCANVAS_H
  10. #define LTKSCROLLINGCANVAS_H
  11.  
  12. #ifdef __GNUC__
  13. #pragma interface
  14. #endif
  15.  
  16. #include <stddef.h>
  17. #include <X11/Xlib.h>
  18. #include "LTKWidget.h"
  19.  
  20. //------------------------------------------------------------------------
  21. // LTKScrollingCanvas
  22. //------------------------------------------------------------------------
  23.  
  24. class LTKScrollingCanvas: public LTKWidget {
  25. public:
  26.  
  27.   //---------- constructor and destructor ----------
  28.  
  29.   LTKScrollingCanvas(char *name1, int widgetNum1,
  30.              int realWidth1, int realHeight1,
  31.              int minWidth1, int minHeight1);
  32.  
  33.   virtual ~LTKScrollingCanvas();
  34.  
  35.   //---------- special access ----------
  36.  
  37.   Pixmap getPixmap() { return pixmap; }
  38.   void resize(int realWidth1, int realHeight1);
  39.   int getRealWidth() { return realWidth; }
  40.   int getRealHeight() { return realHeight; }
  41.   int getMaxX() { return realWidth >= width ? realWidth - width : 0; }
  42.   int getMaxY() { return realHeight >= height ? realHeight - height : 0; }
  43.   void scroll(int x, int y);
  44.   void redrawRect(int x1, int y1, int x2, int y2);
  45.  
  46.   //---------- layout ----------
  47.  
  48.   virtual void layout1();
  49.   virtual void layout3();
  50.  
  51.   //---------- drawing ----------
  52.  
  53.   virtual void redraw();
  54.  
  55.   //---------- callbacks and event handlers ----------
  56.  
  57.   virtual void buttonPress(int mx, int my, int button, GBool dblClick);
  58.   virtual void buttonRelease(int mx, int my, int button, GBool click);
  59.   virtual void mouseMove(int mx, int my, int btn);
  60.  
  61. protected:
  62.  
  63.   int realWidth, realHeight;    // size of "real" canvas, i.e., backdrop
  64.   int minWidth, minHeight;    // minimum size
  65.  
  66.   int left, top;        // location of window in "real" canvas
  67.   Pixmap pixmap;        // the "real" canvas drawable
  68. };
  69.  
  70. #endif
  71.