~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to scipy/sandbox/xplt/src/play/x11/clips.c

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * clips.c -- $Id: clips.c 685 2003-03-08 15:26:51Z travo $
 
3
 * p_clip for X11
 
4
 *
 
5
 * Copyright (c) 1998.  See accompanying LEGAL file for details.
 
6
 */
 
7
 
 
8
#include "config.h"
 
9
#include "playx.h"
 
10
 
 
11
void
 
12
p_clip(p_win *w, int x0, int y0, int x1, int y1)
 
13
{
 
14
  p_scr *s = w->s;
 
15
  Display *dpy = s->xdpy->dpy;
 
16
  GC gc = x_getgc(s, (p_win *)0, FillSolid);
 
17
  w->xyclip[0] = x0;
 
18
  w->xyclip[1] = y0;
 
19
  w->xyclip[2] = x1;
 
20
  w->xyclip[3] = y1;
 
21
  x_clip(dpy, gc, x0, y0, x1, y1);
 
22
  s->gc_w_clip = w;
 
23
}
 
24
 
 
25
void
 
26
x_clip(Display *dpy, GC gc, int x0, int y0, int x1, int y1)
 
27
{
 
28
  XRectangle xr;
 
29
  if (x1>x0 && y1>y0) {
 
30
    xr.width = x1 - x0;
 
31
    xr.height = y1 - y0;
 
32
    xr.x = x0;
 
33
    xr.y = y0;
 
34
    XSetClipRectangles(dpy, gc, 0,0, &xr, 1, YXBanded);
 
35
  } else {
 
36
    XSetClipMask(dpy, gc, None);
 
37
  }
 
38
  if (p_signalling) p_abort();
 
39
}