summaryrefslogtreecommitdiffstats
path: root/tksao/magnifier/magnifier.h
blob: c007fe8ecb7323dca070f0213923951426919f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __magnifier_h__
#define __magnifier_h__

#include "widget.h"

class Magnifier : public Widget {
private:
  Pixmap thumbnail;        // current gterm thumbnail pixmap
  double crosshairSize;    // size of crosshair (diameter)
  double crosshairAngle;   // angle of rotation (radians)
  GC crosshairGC;          // gc for crosshairs
  int useCrosshair;        // flag to render crosshair
  int needsUpdate;         // flag to indicate update needed

protected:
  virtual void clearPixmap() =0;

private:
  int updatePixmap(const BBox&); // renders image/graphics into pixmap
  void update();
  void invalidPixmap();

public:
  Magnifier(Tcl_Interp*, Tk_Canvas, Tk_Item*);

  int parse(istringstream&);          // parse subcommands

  // SubCommandFunctions

  void crosshairCmd(int);
  void getBBoxCmd();
  void updateCmd(void*);
};

#endif