1 #ifndef _graph_h
2 #	include "graph.h"
3 #endif
4 //
5 // Erweiterung der PBall-Klasse um X-Spezifika
6 //
7 class PBallNorm : public PBallTop {
8 	public:
9 		PBallNorm( PBallType mode=BillardQueue, char *display=0l );
10 		~PBallNorm();
11 		static void WaitForEvents();
12 
13 	protected:
14 		virtual void Update();
15 
16 		virtual void Warp( const Vec2 &dest );
17 		virtual void RedrawPointer();						// Mausanzeige
18 		virtual void SetPointer( int x, int y );		// Mausanzeige
19 
20 		static double	next_frame;
21 		static double	last_frame;
22 		static int		instance_count;
23 		static int		pwidth, pheight;
24 		static Pixmap	pmap;
25 		static GC		gc_bit;
26 		static void SetMinSize(int width, int height);
27 
28 		virtual void StartQueue(const Vec2 &end, const Vec2 &s1, const Vec2 &s2);
29 		virtual void MoveQueue(const Vec2 &end, const Vec2 &s1, const Vec2 &s2);
30 		virtual void EndQueue();
31 		virtual void DrawQueue();
32 
33 	protected:
34 		struct _XDisplay	*rem_dpy;
35 		struct _XDisplay	*warp_dpy;	// points to the original dpy for the case
36 												// the rem_dpy is at the same screen ...
37 												// This prevents from locks during server grabs
38 		int					scr;
39 		Real					w2n_x, w2n_y;
40 };
41 
42 //
43 // as an enhancement to the first derived class PBallNorm, the following
44 // class adds interpixel-movement to the cursor, which means, that the
45 // queue can be fine-adjusted be pressing the middle pointer button
46 //
47 
48 class PBall : public PBallNorm {
49 	public:
50 		PBall( PBallType mode=BillardQueue, char *display=0L );
51 		virtual ~PBall();
52 
53 
54 	protected:
55 		virtual void Update();
56 
57 		virtual void Warp( const Vec2 &dest );
58 		virtual void SetPointer( int x, int y );		// Mausanzeige
59 
60 		void StartZooming(int x,int y);
61 		void StopZooming();
62 
63 		Real					off_x, off_y;					// "interpixel"-offset
64 		int					zfact;							// zoom-factor
65 		int					zoom_x, zoom_y;				// startposition of zooming
66 		int					zoom;								// Flag, if in zoom-mode
67 		int					mid_x, mid_y;					// center position of screen
68 		int					ozoom;
69 		Real					ooff_x, ooff_y;				// last position
70 };
71 
72