~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/photo.2target/mouse.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <grass/raster.h>
2
 
#include "globals.h"
3
 
 
4
 
static int first = 1;
5
 
static int curx, cury;
6
 
 
7
 
int Mouse_pointer(int *x, int *y, int *button)
8
 
{
9
 
    if (first) {
10
 
        curx = (SCREEN_LEFT + SCREEN_RIGHT) / 2;
11
 
        cury = (SCREEN_TOP + SCREEN_BOTTOM) / 2;
12
 
        first = 0;
13
 
    }
14
 
    R_get_location_with_pointer(&curx, &cury, button);
15
 
    *x = curx;
16
 
    *y = cury;
17
 
 
18
 
#ifdef BUTTON3
19
 
    if (*button == 3)
20
 
        quit(0);
21
 
#endif
22
 
 
23
 
    return 0;
24
 
}
25
 
 
26
 
int Mouse_box_anchored(int x1, int y1, int *x2, int *y2, int *button)
27
 
{
28
 
    R_get_location_with_box(x1, y1, x2, y2, button);
29
 
    curx = *x2;
30
 
    cury = *y2;
31
 
    first = 0;
32
 
 
33
 
#ifdef BUTTON3
34
 
    if (*button == 3)
35
 
        quit(0);
36
 
#endif
37
 
 
38
 
    return 0;
39
 
}
40
 
 
41
 
int Get_mouse_xy(int *x, int *y)
42
 
{
43
 
    *x = curx;
44
 
    *y = cury;
45
 
 
46
 
    return 0;
47
 
}
48
 
 
49
 
int Set_mouse_xy(int x, int y)
50
 
{
51
 
    first = 0;
52
 
    curx = x;
53
 
    cury = y;
54
 
 
55
 
    return 0;
56
 
}