File: xpball.h

package info (click to toggle)
flying 6.20-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 752 kB
  • ctags: 1,873
  • sloc: cpp: 10,966; makefile: 189
file content (71 lines) | stat: -rw-r--r-- 1,988 bytes parent folder | download | duplicates (4)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _graph_h
#	include "graph.h"
#endif
//
// Erweiterung der PBall-Klasse um X-Spezifika
//
class PBallNorm : public PBallTop {
	public:
		PBallNorm( PBallType mode=BillardQueue, char *display=0l );
		~PBallNorm();
		static void WaitForEvents();

	protected:
		virtual void Update();

		virtual void Warp( const Vec2 &dest );
		virtual void RedrawPointer();						// Mausanzeige
		virtual void SetPointer( int x, int y );		// Mausanzeige

		static double	next_frame;
		static double	last_frame;
		static int		instance_count;
		static int		pwidth, pheight;
		static Pixmap	pmap;
		static GC		gc_bit;
		static void SetMinSize(int width, int height);

		virtual void StartQueue(const Vec2 &end, const Vec2 &s1, const Vec2 &s2);
		virtual void MoveQueue(const Vec2 &end, const Vec2 &s1, const Vec2 &s2);
		virtual void EndQueue();
		virtual void DrawQueue();

	protected:
		struct _XDisplay	*rem_dpy;
		struct _XDisplay	*warp_dpy;	// points to the original dpy for the case
												// the rem_dpy is at the same screen ...
												// This prevents from locks during server grabs
		int					scr;
		Real					w2n_x, w2n_y;
};

//
// as an enhancement to the first derived class PBallNorm, the following
// class adds interpixel-movement to the cursor, which means, that the
// queue can be fine-adjusted be pressing the middle pointer button
//

class PBall : public PBallNorm {
	public:
		PBall( PBallType mode=BillardQueue, char *display=0L );
		virtual ~PBall();


	protected:
		virtual void Update();

		virtual void Warp( const Vec2 &dest );
		virtual void SetPointer( int x, int y );		// Mausanzeige

		void StartZooming(int x,int y);
		void StopZooming();

		Real					off_x, off_y;					// "interpixel"-offset
		int					zfact;							// zoom-factor
		int					zoom_x, zoom_y;				// startposition of zooming
		int					zoom;								// Flag, if in zoom-mode
		int					mid_x, mid_y;					// center position of screen
		int					ozoom;
		Real					ooff_x, ooff_y;				// last position
};