File: xfancy.h

package info (click to toggle)
yorick 1.5.08-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,508 kB
  • ctags: 7,937
  • sloc: ansic: 75,604; cpp: 1,282; lisp: 1,217; sh: 1,026; makefile: 616; fortran: 19
file content (73 lines) | stat: -rw-r--r-- 2,931 bytes parent folder | download
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
72
73
/*
 * XFANCY.H
 *
 * $Id: xfancy.h,v 1.1 1993/08/27 17:08:43 munro Exp $
 *
 * Declare the fancy X windows engine for GIST.
 *
 */
/*    Copyright (c) 1994.  The Regents of the University of California.
                    All rights reserved.  */

#ifndef XFANCY_H
#define XFANCY_H

#include "xbasic.h"

typedef struct FXEngine FXEngine;
struct FXEngine {
  XEngine xe;

  /* --------------- Specific to FXEngine ------------------- */

  int baseline;    /* y coordinate for text in button and message windows */
  int heightButton, widthButton;  /* shape of button */
  /* height of both button and message windows is xe.topMargin */

  int xmv, ymv;
  int pressed;      /* 0 - none, 1 - in button, 2 - in graphics */
  int buttonState;  /* 0 -  button inactive
		       1 -  pointer in button, button ready
		       2 -  button pressed, button armed  */
  int iSystem;      /* <0 for unlocked, else locked system number */
  char msgText[96]; /* current text displayed in message window */
  int msglen;       /* non-zero if displaying a command as message */
  int zoomState;    /* button number if zoom or pan in progress, else 0 */
  int zoomSystem;   /* system number in xe.drawing */
  int zoomAxis;     /* 1 for x-axis, 2 for y-axis, 3 for both */
  GpReal zoomX, zoomY; /* initial coordinates for zoom/pan operation */
};

/* zoom factor for point-and-click zooming */
extern GpReal gxZoomFactor;

/* The GxPointClick function initiates an interactive point-and-click
   session with the window -- it will not return until a button has
   been pressed, then released.  It returns non-zero if the operation
   was aborted by pressing a second button before releasing the first.
     engine --   an X engine whose display is to be used
     style --    1 to draw a rubber box, 2 to draw a rubber line,
                 otherwise, no visible indication of operation
     system --   system number to which the world coordinates should
                 be transformed, or -1 to use the system under the
		 pointer -- the release coordinates are always in the
		 same system as the press coordinates
     CallBack -- function to be called twice, first when the button is
                 pressed, next when it is released -- operation will
		 be aborted if CallBack returns non-zero
		 Arguments passed to CallBack:
		   engine  -- in which press/release occurred
		   system  -- system under pointer, if above system -1
		   release -- 0 on press, 1 on release
		   x, y    -- coordinates of pointer relative to system
		   butmod  -- 1 - 5 on press to tell which button
		              mask to tell which modifiers on release:
			      1 shift, 2 lock, 4 control, 8 - 128 mod1-5
		   xn, yn  -- NDC coordinates of pointer
 */
extern int GxPointClick(Engine *engine, int style, int system,
			int (*CallBack)(Engine *engine, int system,
					int release, GpReal x, GpReal y,
					int butmod, GpReal xn, GpReal yn));

#endif