~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to display/drivers/XDRIVER/Get_w_pointer.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Using mouse device, get a new screen coordinate and button number.
2
 
 * Button numbers must be the following values which correspond to the
3
 
 * following software meanings: 1 - left button 2 - middle button 3 -
4
 
 * right button
5
 
 * 
6
 
 * This is called directly by the application programs.
7
 
 * 
8
 
 * A "pointing hand" pointer is used. Upon button depression, the current
9
 
 * coordinate is returned in (*wx, *wy) and the button pressed in
10
 
 * returned in *button. */
11
 
 
12
 
#include <grass/gis.h>
13
 
#include "includes.h"
14
 
#include <grass/glocale.h>
15
 
 
16
 
int XD_Get_location_with_pointer(int *wx, int *wy, int *button)
17
 
{
18
 
    XEvent bpevent;
19
 
 
20
 
    if (redraw_pid) {
21
 
        G_warning(_("Monitor: interactive command in redraw"));
22
 
        return -1;
23
 
    }
24
 
 
25
 
    G_debug(5, "Get_location_with_pointer()");
26
 
 
27
 
    /* set the grass cursor on (defined in Graph_Set.c) */
28
 
    XDefineCursor(dpy, grwin, cur_xh);
29
 
 
30
 
    /* wait for a button-push event in the grass window, and return the
31
 
     * x,y coord and button number */
32
 
 
33
 
    XSelectInput(dpy, grwin, ButtonPressMask | PointerMotionMask);
34
 
 
35
 
    do {
36
 
        if (!get_xevent(ButtonPressMask, &bpevent))
37
 
            break;
38
 
    } while (bpevent.type != ButtonPress);
39
 
 
40
 
    XSelectInput(dpy, grwin, gemask);
41
 
 
42
 
    *wx = bpevent.xbutton.x;
43
 
    *wy = bpevent.xbutton.y;
44
 
    *button = bpevent.xbutton.button;
45
 
 
46
 
    XUndefineCursor(dpy, grwin);
47
 
 
48
 
    return 0;
49
 
}