Jspice3
point.c File Reference
#include "spice.h"
#include "sced.h"
#include "scedmacs.h"
Include dependency graph for point.c:

Go to the source code of this file.

Macros

#define DEBOUNCETIME   100
 
#define BUTTON1   1
 
#define BUTTON2   2
 
#define BUTTON3   4
 
#define BUTTON4   8
 
#define ESC   27
 
#define BSP   '\b'
 
#define DEL   127
 
#define NEWL   13
 
#define SPA   32
 
#define CTRL_A   1
 
#define CTRL_F   6
 
#define CTRL_G   7
 
#define CTRL_N   14
 
#define CTRL_T   20
 
#define CTRL_U   21
 
#define CTRL_V   22
 
#define CTRL_X   24
 

Functions

static void new_fine_window ()
 
static int control_at ()
 
static unsigned long actiontime ()
 
static void point_input ()
 
void Point ()
 
int ButtonPress (int Buttons, long X, long Y)
 
static void new_fine_window (long OldX, long OldY, long X, long Y)
 
int PointLoop (int *LookedAhead)
 
int PointLoopSafe (int *LookedAhead)
 
int PointColor (int *LookedAhead)
 
void NotPointingAtLayout ()
 
void FinePosition (long X, long Y, char Key)
 
static int control_at (long X, long Y)
 
static void point_input (long *x, long *y, char *key, int *but)
 

Variables

static int OldButton3
 
static long OldButton3X
 
static long OldButton3Y
 
static unsigned long LastPointTime = 0
 
int LockOut
 
static int EscReturn
 

Macro Definition Documentation

#define BSP   '\b'

Definition at line 45 of file point.c.

#define BUTTON1   1

Definition at line 38 of file point.c.

#define BUTTON2   2

Definition at line 39 of file point.c.

#define BUTTON3   4

Definition at line 40 of file point.c.

#define BUTTON4   8

Definition at line 41 of file point.c.

#define CTRL_A   1

Definition at line 49 of file point.c.

#define CTRL_F   6

Definition at line 50 of file point.c.

#define CTRL_G   7

Definition at line 51 of file point.c.

#define CTRL_N   14

Definition at line 52 of file point.c.

#define CTRL_T   20

Definition at line 53 of file point.c.

#define CTRL_U   21

Definition at line 54 of file point.c.

#define CTRL_V   22

Definition at line 55 of file point.c.

#define CTRL_X   24

Definition at line 56 of file point.c.

#define DEBOUNCETIME   100

Definition at line 30 of file point.c.

#define DEL   127

Definition at line 46 of file point.c.

#define ESC   27

Definition at line 44 of file point.c.

#define NEWL   13

Definition at line 47 of file point.c.

#define SPA   32

Definition at line 48 of file point.c.

Function Documentation

static unsigned long actiontime ( )
static

Definition at line 735 of file point.c.

737 {
738  return ((unsigned long)1000*seconds());
739 }
double seconds()
Definition: time.c:103
int ButtonPress ( int  Buttons,
long  X,
long  Y 
)

Definition at line 356 of file point.c.

360 {
361 
362  Parameters.kpCommand[0] = EOS;
363  if (Buttons == 0) {
364  /* shouldn't get here unless null from keyboard */
365  return (False);
366  }
367  if (Buttons == BUTTON1) {
368  if (control_at(X,Y)) return (True);
369  return (False);
370  }
371  if (Buttons == BUTTON2) {
372  if (LockOut) { /* treat like button 0 */
373  Buttons = BUTTON1;
374  if (control_at(X,Y)) return (True);
375  return (False);
376  }
377  SaveLastView();
378  /* pan if coarse viewport only */
380  if (!InBox(X,Y,View->kvCoarseViewport)) {
381  return (False);
382  }
383  PToL(View->kvCoarseWindow,&X,&Y);
385  InitFineWindow(X,Y);
388  }
389  else
390  FinePosition(X,Y,(char)0);
392  return (False);
393  }
394  if (Buttons == BUTTON3) {
395  if (Parameters.kpCellName[0] == EOS) return (False);
396  if (LockOut) { /* treat like button 0 */
397  Buttons = BUTTON1;
398  if (control_at(X,Y)) return (True);
399  return (False);
400  }
401  if (Not OldButton3) {
402  if (InBox(X,Y,View->kvCoarseViewport))
403  PToL(View->kvCoarseWindow,&X,&Y);
405  PToL(View->kvFineWindow,&X,&Y);
406  else {
407  return (False);
408  }
411  SCursor.kcRawX = X;
412  SCursor.kcRawY = Y;
413  FBSetRubberBanding('R');
416  OldButton3X = X;
417  OldButton3Y = Y;
418  OldButton3 = True;
419  }
420  else {
421  if (InBox(X,Y,View->kvCoarseViewport))
422  PToL(View->kvCoarseWindow,&X,&Y);
424  PToL(View->kvFineWindow,&X,&Y);
425  else {
427  return (False);
428  }
430  OldButton3 = False;
432  }
433  return (False);
434  }
435  if (Buttons == BUTTON4) {
436  return (False);
437  }
438  return (False);
439 }
static int OldButton3
Definition: point.c:58
static void new_fine_window()
void Redisplay()
long kcRawY
Definition: sced.h:103
struct ka * kvCoarseWindow
Definition: sced.h:149
void PToL()
long kcRawX
Definition: sced.h:103
void InitCoarseWindow()
struct kc SCursor
Definition: init.c:21
#define COARSEVIEWPORTONLY
Definition: sced.h:51
#define Not
Definition: cdmacs.h:16
char * kpCellName
Definition: sced.h:210
#define BUTTON4
Definition: point.c:41
void EraseLargeCoarseViewport()
Definition: viewport.c:583
int InBox()
char kpRedisplayControl
Definition: sced.h:312
static unsigned long actiontime()
Definition: point.c:735
struct ka * kvFineViewport
Definition: sced.h:148
char * kpCommand
Definition: sced.h:219
long X
Definition: actions.c:450
#define BUTTON2
Definition: point.c:39
struct ka * kvCoarseViewport
Definition: sced.h:150
struct kp Parameters
Definition: init.c:19
#define elif
Definition: cdmacs.h:10
static long OldButton3X
Definition: point.c:59
#define True
Definition: scedstub.c:16
void FinePosition(long X, long Y, char Key)
Definition: point.c:612
static int control_at()
struct kv * View
Definition: init.c:17
void InitFineWindow()
#define BUTTON1
Definition: point.c:38
void SaveLastView()
Definition: display.c:297
#define EOS
Definition: cdmacs.h:9
void FBSetRubberBanding()
int LockOut
Definition: point.c:65
#define BUTTON3
Definition: point.c:40
double kaWidth
Definition: sced.h:114
#define False
Definition: scedstub.c:15
long Y
Definition: actions.c:450
static unsigned long LastPointTime
Definition: point.c:62
static long OldButton3Y
Definition: point.c:59
static int control_at ( )
static
static int control_at ( long  X,
long  Y 
)
static

Definition at line 649 of file point.c.

652 {
653  int i, Row, Column;
654  MENU *Menu;
655  extern char *MenuPLACE;
656 
658  if (InBox(X,Y,View->kvCoarseViewport)) {
662  SCursor.kcX = X;
663  SCursor.kcY = Y;
664  SCursor.kcRawX = X;
665  SCursor.kcRawY = Y;
671  Parameters.kpCommand[0] = '\0';
673  return (True);
674  }
675  if (InBox(X,Y,View->kvFineViewport)) {
679  SCursor.kcX = X;
680  SCursor.kcY = Y;
681  SCursor.kcRawX = X;
682  SCursor.kcRawY = Y;
688  Parameters.kpCommand[0] = '\0';
690  return (True);
691  }
692  Menu = GetCurrentMenu();
693  Row = (gi_maxy-Y-3)/gi_fntheight+1;
694  Column = X/gi_fntwidth+1;
695  if (InBox((long)Column,(long)Row,&MenuViewport)) {
696  if (Column > 5)
697  Row += MenuViewport.kaY;
698  if (Menu == BasicMenu) {
699  for (i = 0; ; i++)
700  if (Menu[i].mEntry == NULL) break;
701 
702  if (i > Row - 1) {
703  strcpy(Parameters.kpCommand,Menu[Row-1].mEntry);
704  return (True);
705  }
706  if (Column <= 5)
707  return (False);
708  if (i < MenuViewport.kaY)
709  i = MenuViewport.kaY;
710  Row -= i;
711  for (i = 0; ; i++)
712  if (DeviceMenu[i].mEntry == NULL) break;
713  if (i > Row - 1) {
714  /* hide the cell name after a null */
715  sprintf(Parameters.kpCommand,"%s %s",MenuPLACE,
716  DeviceMenu[Row-1].mEntry);
717  Parameters.kpCommand[strlen(MenuPLACE)] = '\0';
718  return (True);
719  }
720  }
721  else {
722  for (i = 0; ; i++)
723  if (Menu[i].mEntry == NULL) break;
724  if (i > Row - 1) {
725  strcpy(Parameters.kpCommand,Menu[Row-1].mEntry);
726  return (True);
727  }
728  }
729  }
730  return (False);
731 }
long kaY
Definition: sced.h:113
long kcRawY
Definition: sced.h:103
struct ka * kvCoarseWindow
Definition: sced.h:149
void PToL()
long kcRawX
Definition: sced.h:103
char * strcpy()
struct kc SCursor
Definition: init.c:21
int InBox()
char * mEntry
Definition: sced.h:364
long kcY
Definition: sced.h:102
struct ka MenuViewport
Definition: init.c:18
struct ka * kvFineViewport
Definition: sced.h:148
#define gi_fntheight
Definition: scedmacs.h:57
int kpPointCoarseWindow
Definition: sced.h:258
char * kpCommand
Definition: sced.h:219
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
struct ka * kvCoarseViewport
Definition: sced.h:150
struct kp Parameters
Definition: init.c:19
long kcDY
Definition: sced.h:104
MENU * DeviceMenu
Definition: scedintr.c:50
struct ka * kvFineWindow
Definition: sced.h:147
#define True
Definition: scedstub.c:16
MENU * GetCurrentMenu()
Definition: viewport.c:174
long kcPredY
Definition: sced.h:102
struct kv * View
Definition: init.c:17
void ClipToGridPoint()
char * MenuPLACE
Definition: scedintr.c:94
long kcX
Definition: sced.h:102
#define gi_fntwidth
Definition: scedmacs.h:56
long kcPredX
Definition: sced.h:102
MENU * BasicMenu
Definition: scedintr.c:49
#define False
Definition: scedstub.c:15
int kcInFine
Definition: sced.h:105
Definition: sced.h:363
long Y
Definition: actions.c:450
long kcDX
Definition: sced.h:104
#define gi_maxy
Definition: scedmacs.h:59
void FinePosition ( long  X,
long  Y,
char  Key 
)

Definition at line 612 of file point.c.

616 {
617  int Buttons;
618 
619  if (Parameters.kpCellName[0] == EOS)
620  return;
622  ShowPrompt("Fine positioning isn't required.");
623  Parameters.kpCommand[0] = EOS;
624  return;
625  }
626  if (Key != EOS) {
627  ShowPrompt("Point to center of area you want magnified.");
628  loop {
629  point_input(&X,&Y,&Key,&Buttons);
630  if (Key == EOS Or Key == NEWL)
631  break;
632  }
633  }
634  if (InBox(X,Y,View->kvCoarseViewport))
635  PToL(View->kvCoarseWindow,&X,&Y);
637  PToL(View->kvFineWindow,&X,&Y);
638  else {
640  return;
641  }
643  InitFineWindow(X,Y);
645 }
#define NEWL
Definition: point.c:47
#define loop
Definition: cdmacs.h:11
#define Or
Definition: cdmacs.h:15
struct ka * kvCoarseWindow
Definition: sced.h:149
void PToL()
#define COARSEVIEWPORTONLY
Definition: sced.h:51
char * kpCellName
Definition: sced.h:210
int InBox()
char kpRedisplayControl
Definition: sced.h:312
struct ka * kvFineViewport
Definition: sced.h:148
char * kpCommand
Definition: sced.h:219
long X
Definition: actions.c:450
struct ka * kvCoarseViewport
Definition: sced.h:150
struct kp Parameters
Definition: init.c:19
#define elif
Definition: cdmacs.h:10
struct kv * View
Definition: init.c:17
static void point_input()
void InitFineWindow()
void EraseFineViewport()
Definition: viewport.c:594
void ShowFineViewport()
Definition: viewport.c:610
#define EOS
Definition: cdmacs.h:9
void NotPointingAtLayout()
Definition: point.c:604
long Y
Definition: actions.c:450
void ShowPrompt(char *str)
Definition: scedstub.c:71
static void new_fine_window ( )
static
static void new_fine_window ( long  OldX,
long  OldY,
long  X,
long  Y 
)
static

Definition at line 443 of file point.c.

446 {
447  long NewWindowWidth, Hei, Wid, Tmp, CenterX, CenterY;
448 
450 
451  SaveLastView();
452  Wid = X - OldX;
453  Hei = Y - OldY;
454  if (Wid < 0) Wid = -Wid;
455  if (Hei < 0) Hei = -Hei;
456  Tmp = Hei*
459  NewWindowWidth = Max(Wid,Tmp);
460  if (NewWindowWidth <= 0)
461  NewWindowWidth = RESOLUTION;
462  Wid /= 2;
463  Hei /= 2;
464  InitCoarseWindow(Min(X,OldX)+Wid,
465  Min(Y,OldY)+Hei,NewWindowWidth);
466  InitFineWindow(Min(X,OldX)+Wid,
467  Min(Y,OldY)+Hei);
470  }
471  else {
472  if (X > OldX)
473  SwapInts(X,OldX);
474  if ((OldX - X) < 2) { /* two lambda minimum width */
475  ShowPrompt("Magnifying glass width too small.");
476  return;
477  }
478  SaveLastView();
479  if (Y > OldY)
480  SwapInts(Y,OldY);
481  CenterX = (OldX - X)/2 + X;
482  CenterY = (OldY - Y)/2 + Y;
483  View->kvFineWindow->kaWidth = OldX - X;
489  InitFineWindow(CenterX,CenterY);
491  }
492 }
void Redisplay()
struct ka * kvCoarseWindow
Definition: sced.h:149
void InitCoarseWindow()
#define COARSEVIEWPORTONLY
Definition: sced.h:51
#define Max(Dragon, Eagle)
Definition: cdmacs.h:17
void EraseLargeCoarseViewport()
Definition: viewport.c:583
#define Min(Dragon, Eagle)
Definition: cdmacs.h:18
char kpRedisplayControl
Definition: sced.h:312
struct ka * kvFineViewport
Definition: sced.h:148
long X
Definition: actions.c:450
struct ka * kvCoarseViewport
Definition: sced.h:150
struct kp Parameters
Definition: init.c:19
struct ka * kvFineWindow
Definition: sced.h:147
#define RESOLUTION
Definition: sced.h:36
double kaHeight
Definition: sced.h:114
struct kv * View
Definition: init.c:17
void InitFineWindow()
void SaveLastView()
Definition: display.c:297
void EraseFineViewport()
Definition: viewport.c:594
void ShowFineViewport()
Definition: viewport.c:610
double kaWidth
Definition: sced.h:114
long Y
Definition: actions.c:450
void ShowPrompt(char *str)
Definition: scedstub.c:71
#define SwapInts(Dragon, Eagle)
Definition: cdmacs.h:20
void NotPointingAtLayout ( )

Definition at line 604 of file point.c.

606 {
607  ShowPrompt("You aren't pointing in the layout viewport.");
608 }
void ShowPrompt(char *str)
Definition: scedstub.c:71
void Point ( )

Definition at line 72 of file point.c.

74 {
75  /*
76  * When user has typed Condition, do Action.
77  *
78  * Condition
79  * shortest unique prefix of Menu
80  * Action
81  * Return with command selected stored in Parameters.kpCommand.
82  *
83  * Condition
84  * ESC
85  * Action
86  * Forget remembered type in, return if EscReturn == True.
87  *
88  * Condition
89  * ctrl-a
90  * Action
91  * Execute abort routine.
92  *
93  * Condition
94  * point key or tablet stylus button Z
95  * Action
96  * If user is pointing at a layer in the layer table viewport,
97  * change the current layer.
98  * If user is pointing at a command menu selection, return with
99  * command selected stored as Parameters.kpCommand.
100  * If user is pointing inside a layout viewport--coarse or fine--
101  * return with Parameters.kpCommand[0] == EOS and cursor
102  * descriptor up-to-date.
103  *
104  * Condition
105  * ctrl-f or tablet stylus button 1
106  * Action
107  * Wait for user to point.
108  * Redisplay in fine viewport around where he pointed
109  * if fine positioning is enabled, or pan otherwise.
110  *
111  * Condition
112  * ctrl-g
113  * Action
114  * Change scale of magnifying glass, or otherwise window, using
115  * next two point actions.
116  *
117  * Condition
118  * ctrl-n
119  * Action
120  * Save the present view context in a list.
121  *
122  * Condition
123  * ctrl-t or ctrl-v
124  * Action
125  * Toggle position of magnifying glass, bottom or right.
126  *
127  */
128  char *TypeIn;
129  MENU *Menu;
130  unsigned long newtime;
131  int NumCommand,Buttons,Int1,Int2,Int3;
132  int Layer;
133  long X,Y,centerX,centerY;
134  char Key;
135  extern char *MenuABORT;
136 
137  /*
138  * The best way to handle interrupts reliably is to
139  * initialize the service routines as frequently as
140  * possible. Therefore, . . .
141  */
142  InitSignals();
143  Menu = GetCurrentMenu();
144  Parameters.kpCommand[NumCommand = 0] = EOS;
146  if (OldButton3) {
147  OldButton3 = False;
149  }
151 
152  loop {
153  loop {
154  point_input(&X,&Y,&Key,&Buttons);
155 
156  if (Key)
157  break;
158 
159  if ((Buttons == BUTTON1 Or
160  Buttons == BUTTON2 Or
161  Buttons == BUTTON3 Or
162  Buttons == BUTTON4) And
163  (X < gi_maxx And X > 0 And Y < gi_maxy And Y > 0))
164  break;
165 
166  }
167 
168  newtime = actiontime();
169  if (newtime > LastPointTime && newtime - LastPointTime < DEBOUNCETIME)
170  continue;
171  LastPointTime = newtime;
172 
173  switch (Key) {
174 
175  case 0:
176  break;
177 
178  case BSP:
179  case DEL:
180  if (NumCommand) NumCommand--;
181  Parameters.kpCommand[NumCommand] = EOS;
182  continue;
183 
184  case ESC:
185  Parameters.kpCommand[NumCommand = 0] = EOS;
186  /* SRW ** so we know if esc was entered */
187  Parameters.kpCommand[1] = ESC;
188  if (EscReturn) return;
189  continue;
190 
191  case NEWL:
192  Parameters.kpCommand[NumCommand = 0] = EOS;
193  if (control_at(X,Y)) return;
194  continue;
195 
196  case '!':
197  /* shell command */
198  if (LockOut) continue; /* ignore */
199  ShowPrompt("! ");
200  TypeIn = FBEdit(NULL);
201  if (TypeIn != NULL) {
202  ShowProcess(TypeIn);
203  ErasePrompt();
204  }
205  Parameters.kpCommand[NumCommand = 0] = EOS;
206  continue;
207 
208  case CTRL_A:
209  /* SRW ** abort gracefully */
210  strcpy(Parameters.kpCommand,MenuABORT);
211  NumCommand = 0;
212  return;
213 
214  case CTRL_F:
215  if (LockOut) continue; /* ignore ^F */
216  Parameters.kpCommand[NumCommand = 0] = EOS;
217  SaveLastView();
218  /* SRW ** pan if coarse viewport only */
220  if (!InBox(X,Y,View->kvCoarseViewport)) {
222  continue;
223  }
224  PToL(View->kvCoarseWindow,&X,&Y);
226  InitFineWindow(X,Y);
229  }
230  else
231  FinePosition(X,Y,Key);
232  /*
233  * This is necessary for debouncing.
234  * It takes time to redisplay, so we set the time of the last
235  * pointing event when the redisplay is finished.
236  */
238  continue;
239 
240  case CTRL_G:
241  if (LockOut) continue; /* ignore ^G */
242  Parameters.kpCommand[NumCommand = 0] = EOS;
243  if (Parameters.kpCellName[0] == EOS)
244  return;
245  loop {
246  ShowPrompt("Point to diagonal of area to be magnified.");
247  point_input(&X,&Y,&Key,&Buttons);
248  if (Key == ESC) goto skip;
249  if (Buttons == BUTTON1) {
250  if (InBox(X,Y,View->kvCoarseViewport))
251  PToL(View->kvCoarseWindow,&X,&Y);
252  elif (InBox(X,Y,View->kvFineViewport))
253  PToL(View->kvFineWindow,&X,&Y);
254  else {
256  continue;
257  }
258  OldButton3X = X;
259  OldButton3Y = Y;
260  FBSetRubberBanding('R');
261  break;
262  }
263  }
264  loop {
265  ShowPrompt("Point to second endpoint.");
266  point_input(&X,&Y,&Key,&Buttons);
267  if (Key == ESC) {
269  goto skip;
270  }
271  if (Buttons == BUTTON1) {
272  if (InBox(X,Y,View->kvCoarseViewport))
273  PToL(View->kvCoarseWindow,&X,&Y);
274  elif (InBox(X,Y,View->kvFineViewport))
275  PToL(View->kvFineWindow,&X,&Y);
276  else {
278  continue;
279  }
281  break;
282  }
283  }
285 skip:
286  ErasePrompt();
287  continue;
288 
289  case CTRL_N:
290  Parameters.kpCommand[NumCommand = 0] = EOS;
291  SaveViewOnStack();
292  continue;
293 
294  case CTRL_U:
295  case CTRL_X:
296  case SPA:
297  NumCommand = 0;
298  Parameters.kpCommand[0] = EOS;
299  continue;
300 
301  case CTRL_T:
302  case CTRL_V:
303  if (LockOut) continue; /* ignore */
304  Parameters.kpCommand[NumCommand = 0] = EOS;
306  InitViewport();
308  continue;
309  SetPositioning();
312  continue;
313 
314  default:
315  Parameters.kpCommand[NumCommand++] = Key;
316  if (NumCommand > 80) NumCommand = 80;
317  Parameters.kpCommand[NumCommand] = EOS;
318  /*
319  * Test for shortest unique prefix, or prefix matching upper
320  * case part of menu. Stupid search is plenty fast.
321  */
322  Int3 = -1;
323  Int2 = 0;
324  for (Int1 = 0; Menu[Int1].mEntry != NULL; Int1++) {
325  for (Int2 = 0; Int2 < NumCommand; Int2++) {
326  char c = Menu[Int1].mPrefix[Int2];
327  if (isupper(c)) c = tolower(c);
328  if (Parameters.kpCommand[Int2] != c) break;
329  }
330  if (Parameters.kpCommand[Int2] == EOS And Int2 > 0) {
331  if (!Menu[Int1].mPrefix[Int2]) {
332  /* found a match */
333  if (Int3 >= 0) {
334  /* oops, more than 1 match */
335  Int2 = -1;
336  break;
337  }
338  Int3 = Int1;
339  }
340  }
341  }
342  if (Int3 >= 0 && Int2 >= 0) {
343  strcpy(Parameters.kpCommand,Menu[Int3].mEntry);
344  return;
345  }
346  continue;
347  }
348  NumCommand = 0;
349  if (ButtonPress(Buttons,X,Y))
350  return;
351  }
352 }
#define NEWL
Definition: point.c:47
void ErasePrompt()
Definition: viewport.c:538
#define CTRL_V
Definition: point.c:55
static int OldButton3
Definition: point.c:58
static void new_fine_window()
int kvFineViewportOnBottom
Definition: sced.h:156
#define CTRL_A
Definition: point.c:49
#define CTRL_N
Definition: point.c:52
#define loop
Definition: cdmacs.h:11
void Redisplay()
#define Or
Definition: cdmacs.h:15
struct ka * kvCoarseWindow
Definition: sced.h:149
void PToL()
char * strcpy()
void InitCoarseWindow()
#define COARSEVIEWPORTONLY
Definition: sced.h:51
#define CTRL_X
Definition: point.c:56
void InitViewport()
Definition: init.c:358
char * kpCellName
Definition: sced.h:210
#define BUTTON4
Definition: point.c:41
void EraseLargeCoarseViewport()
Definition: viewport.c:583
int InBox()
#define BSP
Definition: point.c:45
char * mEntry
Definition: sced.h:364
#define SPA
Definition: point.c:48
char kpRedisplayControl
Definition: sced.h:312
static unsigned long actiontime()
Definition: point.c:735
#define DEL
Definition: point.c:46
struct ka * kvFineViewport
Definition: sced.h:148
void SaveViewOnStack()
Definition: display.c:323
int kpPointCoarseWindow
Definition: sced.h:258
#define CTRL_F
Definition: point.c:50
#define DEBOUNCETIME
Definition: point.c:30
char * kpCommand
Definition: sced.h:219
long X
Definition: actions.c:450
#define skip(s)
Definition: rawfile.c:268
#define BUTTON2
Definition: point.c:39
#define CTRL_G
Definition: point.c:51
#define CTRL_U
Definition: point.c:54
#define NULL
Definition: spdefs.h:121
struct ka * kvCoarseViewport
Definition: sced.h:150
struct kp Parameters
Definition: init.c:19
#define elif
Definition: cdmacs.h:10
static long OldButton3X
Definition: point.c:59
void FinePosition(long X, long Y, char Key)
Definition: point.c:612
MENU * GetCurrentMenu()
Definition: viewport.c:174
static int control_at()
char mPrefix[6]
Definition: sced.h:366
struct kv * View
Definition: init.c:17
static void point_input()
#define ESC
Definition: point.c:44
void InitFineWindow()
#define BUTTON1
Definition: point.c:38
Definition: cddefs.h:177
void SaveLastView()
Definition: display.c:297
int Layer
Definition: cd.c:1908
void ShowProcess()
void SetPositioning()
Definition: init.c:322
#define EOS
Definition: cdmacs.h:9
static int EscReturn
Definition: point.c:68
#define And
Definition: cdmacs.h:14
void FBSetRubberBanding()
void NotPointingAtLayout()
Definition: point.c:604
char * FBEdit()
int ButtonPress(int Buttons, long X, long Y)
Definition: point.c:356
int LockOut
Definition: point.c:65
#define BUTTON3
Definition: point.c:40
double kaWidth
Definition: sced.h:114
#define False
Definition: scedstub.c:15
char * MenuABORT
Definition: scedintr.c:63
Definition: sced.h:363
void InitSignals()
Definition: scedintr.c:845
long Y
Definition: actions.c:450
void ShowPrompt(char *str)
Definition: scedstub.c:71
#define CTRL_T
Definition: point.c:53
static unsigned long LastPointTime
Definition: point.c:62
static long OldButton3Y
Definition: point.c:59
static void point_input ( )
static
static void point_input ( long *  x,
long *  y,
char *  key,
int *  but 
)
static

Definition at line 743 of file point.c.

748 {
751 
752  request.option = point_option;
753  DevInput(&request,&response);
754  *x = response.x;
755  *y = response.y;
756  *key = 0;
757  *but = 0;
758  if (response.option == char_option) {
759  *key = (isupper(response.reply.ch) ?
760  tolower(response.reply.ch) : response.reply.ch);
761  }
762  else {
763  *but = response.reply.button;
764  }
765  return;
766 }
OPTION option
Definition: ftegraph.h:187
int ch
Definition: ftegraph.h:196
union response::@11 reply
int button
Definition: ftegraph.h:198
void DevInput()
int y
Definition: ftegraph.h:194
int x
Definition: ftegraph.h:193
OPTION option
Definition: ftegraph.h:192
int PointColor ( int *  LookedAhead)

Definition at line 558 of file point.c.

564 {
565  extern char *MenuPLUSR,*MenuMINSR;
566  extern char *MenuPLUSG,*MenuMINSG;
567  extern char *MenuPLUSB,*MenuMINSB;
568  extern char *MenuRGB;
569  extern char *MenuUNDO;
570 
571  loop {
572  if (*LookedAhead == False) {
573  EscReturn = True;
574  Point();
575  EscReturn = False;
576  }
577  else
578  *LookedAhead = False;
579  if (Parameters.kpCommand[1] == ESC)
580  return (PL_ESC);
581  if (Parameters.kpCommand[0] != EOS) {
582 
583  if (Matching(MenuMINSB)) { AlterColor('b','-'); continue; }
584  if (Matching(MenuMINSG)) { AlterColor('g','-'); continue; }
585  if (Matching(MenuMINSR)) { AlterColor('r','-'); continue; }
586  if (Matching(MenuPLUSB)) { AlterColor('b','+'); continue; }
587  if (Matching(MenuPLUSG)) { AlterColor('g','+'); continue; }
588  if (Matching(MenuPLUSR)) { AlterColor('r','+'); continue; }
589  if (Matching(MenuRGB)) { RGB(); continue; }
590 
591  if (Matching(MenuUNDO))
592  return (PL_UND);
593  *LookedAhead = True;
594  return (PL_CMD);
595  }
597  return (PL_PCW);
599  }
600 }
#define PL_ESC
Definition: sced.h:62
#define loop
Definition: cdmacs.h:11
char * MenuMINSR
Definition: scedintr.c:59
void RGB()
Definition: bascmd.c:238
#define PL_UND
Definition: sced.h:63
char * MenuMINSG
Definition: scedintr.c:58
char * MenuUNDO
Definition: objects.c:115
void AlterColor()
char * MenuPLUSB
Definition: scedintr.c:60
#define PL_PCW
Definition: sced.h:65
void Point()
Definition: point.c:72
#define Matching(string)
Definition: scedmacs.h:63
char * MenuPLUSR
Definition: scedintr.c:62
char * MenuRGB
Definition: scedintr.c:100
int kpPointCoarseWindow
Definition: sced.h:258
char * kpCommand
Definition: sced.h:219
struct kp Parameters
Definition: init.c:19
char * MenuPLUSG
Definition: scedintr.c:61
#define True
Definition: scedstub.c:16
#define ESC
Definition: point.c:44
char * MenuMINSB
Definition: scedintr.c:57
#define EOS
Definition: cdmacs.h:9
static int EscReturn
Definition: point.c:68
void NotPointingAtLayout()
Definition: point.c:604
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
int PointLoop ( int *  LookedAhead)

Definition at line 496 of file point.c.

503 {
504  extern char *MenuUNDO;
505 
506  loop {
507  if (*LookedAhead == False) {
508  EscReturn = True;
509  Point();
510  EscReturn = False;
511  }
512  else
513  *LookedAhead = False;
514  if (Parameters.kpCommand[1] == ESC)
515  return (PL_ESC);
516  if (Parameters.kpCommand[0] != EOS) {
517  if (SafeCmds(LookedAhead))
518  continue;
519  if (Matching(MenuUNDO)) return (PL_UND);
520  *LookedAhead = True;
521  return (PL_CMD);
522  }
524  return (PL_PCW);
526  }
527 }
#define PL_ESC
Definition: sced.h:62
#define loop
Definition: cdmacs.h:11
#define PL_UND
Definition: sced.h:63
char * MenuUNDO
Definition: objects.c:115
#define PL_PCW
Definition: sced.h:65
int SafeCmds()
void Point()
Definition: point.c:72
#define Matching(string)
Definition: scedmacs.h:63
int kpPointCoarseWindow
Definition: sced.h:258
char * kpCommand
Definition: sced.h:219
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
#define ESC
Definition: point.c:44
#define EOS
Definition: cdmacs.h:9
static int EscReturn
Definition: point.c:68
void NotPointingAtLayout()
Definition: point.c:604
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
int PointLoopSafe ( int *  LookedAhead)

Definition at line 531 of file point.c.

538 {
539 
540  loop {
541  EscReturn = True;
542  Point();
543  EscReturn = False;
544  if (Parameters.kpCommand[1] == ESC)
545  return (PL_ESC);
546  if (Parameters.kpCommand[0] != EOS) {
547  *LookedAhead = True;
548  return (PL_CMD);
549  }
551  return (PL_PCW);
553  }
554 }
#define PL_ESC
Definition: sced.h:62
#define loop
Definition: cdmacs.h:11
#define PL_PCW
Definition: sced.h:65
void Point()
Definition: point.c:72
int kpPointCoarseWindow
Definition: sced.h:258
char * kpCommand
Definition: sced.h:219
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
#define ESC
Definition: point.c:44
#define EOS
Definition: cdmacs.h:9
static int EscReturn
Definition: point.c:68
void NotPointingAtLayout()
Definition: point.c:604
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64

Variable Documentation

int EscReturn
static

Definition at line 68 of file point.c.

unsigned long LastPointTime = 0
static

Definition at line 62 of file point.c.

int LockOut

Definition at line 65 of file point.c.

int OldButton3
static

Definition at line 58 of file point.c.

long OldButton3X
static

Definition at line 59 of file point.c.

long OldButton3Y
static

Definition at line 59 of file point.c.