~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/x11include/xorg-server-1.6.0/miwideline.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
Copyright 1988, 1998  The Open Group
4
 
 
5
 
Permission to use, copy, modify, distribute, and sell this software and its
6
 
documentation for any purpose is hereby granted without fee, provided that
7
 
the above copyright notice appear in all copies and that both that
8
 
copyright notice and this permission notice appear in supporting
9
 
documentation.
10
 
 
11
 
The above copyright notice and this permission notice shall be included
12
 
in all copies or substantial portions of the Software.
13
 
 
14
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
 
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18
 
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
 
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
 
OTHER DEALINGS IN THE SOFTWARE.
21
 
 
22
 
Except as contained in this notice, the name of The Open Group shall
23
 
not be used in advertising or otherwise to promote the sale, use or
24
 
other dealings in this Software without prior written authorization
25
 
from The Open Group.
26
 
 
27
 
*/
28
 
 
29
 
/* Author:  Keith Packard, MIT X Consortium */
30
 
 
31
 
#include "mispans.h"
32
 
#include "mifpoly.h" /* for ICEIL */
33
 
 
34
 
/* 
35
 
 * interface data to span-merging polygon filler
36
 
 */
37
 
 
38
 
typedef struct _SpanData {
39
 
    SpanGroup   fgGroup, bgGroup;
40
 
} SpanDataRec, *SpanDataPtr;
41
 
 
42
 
#define AppendSpanGroup(pGC, pixel, spanPtr, spanData) { \
43
 
        SpanGroup   *group, *othergroup = NULL; \
44
 
        if (pixel == pGC->fgPixel) \
45
 
        { \
46
 
            group = &spanData->fgGroup; \
47
 
            if (pGC->lineStyle == LineDoubleDash) \
48
 
                othergroup = &spanData->bgGroup; \
49
 
        } \
50
 
        else \
51
 
        { \
52
 
            group = &spanData->bgGroup; \
53
 
            othergroup = &spanData->fgGroup; \
54
 
        } \
55
 
        miAppendSpans (group, othergroup, spanPtr); \
56
 
}
57
 
 
58
 
/*
59
 
 * Polygon edge description for integer wide-line routines
60
 
 */
61
 
 
62
 
typedef struct _PolyEdge {
63
 
    int     height;     /* number of scanlines to process */
64
 
    int     x;          /* starting x coordinate */
65
 
    int     stepx;      /* fixed integral dx */
66
 
    int     signdx;     /* variable dx sign */
67
 
    int     e;          /* initial error term */
68
 
    int     dy;
69
 
    int     dx;
70
 
} PolyEdgeRec, *PolyEdgePtr;
71
 
 
72
 
#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - miter limit constant */
73
 
 
74
 
/*
75
 
 * types for general polygon routines
76
 
 */
77
 
 
78
 
typedef struct _PolyVertex {
79
 
    double  x, y;
80
 
} PolyVertexRec, *PolyVertexPtr;
81
 
 
82
 
typedef struct _PolySlope {
83
 
    int     dx, dy;
84
 
    double  k;      /* x0 * dy - y0 * dx */
85
 
} PolySlopeRec, *PolySlopePtr;
86
 
 
87
 
/*
88
 
 * Line face description for caps/joins
89
 
 */
90
 
 
91
 
typedef struct _LineFace {
92
 
    double  xa, ya;
93
 
    int     dx, dy;
94
 
    int     x, y;
95
 
    double  k;
96
 
} LineFaceRec, *LineFacePtr;
97
 
 
98
 
/*
99
 
 * macros for polygon fillers
100
 
 */
101
 
 
102
 
#define MIPOLYRELOADLEFT    if (!left_height && left_count) { \
103
 
                                left_height = left->height; \
104
 
                                left_x = left->x; \
105
 
                                left_stepx = left->stepx; \
106
 
                                left_signdx = left->signdx; \
107
 
                                left_e = left->e; \
108
 
                                left_dy = left->dy; \
109
 
                                left_dx = left->dx; \
110
 
                                --left_count; \
111
 
                                ++left; \
112
 
                            }
113
 
 
114
 
#define MIPOLYRELOADRIGHT   if (!right_height && right_count) { \
115
 
                                right_height = right->height; \
116
 
                                right_x = right->x; \
117
 
                                right_stepx = right->stepx; \
118
 
                                right_signdx = right->signdx; \
119
 
                                right_e = right->e; \
120
 
                                right_dy = right->dy; \
121
 
                                right_dx = right->dx; \
122
 
                                --right_count; \
123
 
                                ++right; \
124
 
                        }
125
 
 
126
 
#define MIPOLYSTEPLEFT  left_x += left_stepx; \
127
 
                        left_e += left_dx; \
128
 
                        if (left_e > 0) \
129
 
                        { \
130
 
                            left_x += left_signdx; \
131
 
                            left_e -= left_dy; \
132
 
                        }
133
 
 
134
 
#define MIPOLYSTEPRIGHT right_x += right_stepx; \
135
 
                        right_e += right_dx; \
136
 
                        if (right_e > 0) \
137
 
                        { \
138
 
                            right_x += right_signdx; \
139
 
                            right_e -= right_dy; \
140
 
                        }
141
 
 
142
 
#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
143
 
    oldPixel = pGC->fgPixel; \
144
 
    if (pixel != oldPixel) { \
145
 
        DoChangeGC (pGC, GCForeground, (XID *) &pixel, FALSE); \
146
 
        ValidateGC (pDrawable, pGC); \
147
 
    } \
148
 
}
149
 
#define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
150
 
    if (pixel != oldPixel) { \
151
 
        DoChangeGC (pGC, GCForeground, (XID *) &oldPixel, FALSE); \
152
 
        ValidateGC (pDrawable, pGC); \
153
 
    } \
154
 
}
155
 
 
156
 
extern void miRoundJoinClip(
157
 
    LineFacePtr /*pLeft*/,
158
 
    LineFacePtr /*pRight*/,
159
 
    PolyEdgePtr /*edge1*/,
160
 
    PolyEdgePtr /*edge2*/,
161
 
    int * /*y1*/,
162
 
    int * /*y2*/,
163
 
    Bool * /*left1*/,
164
 
    Bool * /*left2*/
165
 
);
166
 
 
167
 
extern int miRoundCapClip(
168
 
    LineFacePtr /*face*/,
169
 
    Bool /*isInt*/,
170
 
    PolyEdgePtr /*edge*/,
171
 
    Bool * /*leftEdge*/
172
 
);
173
 
 
174
 
extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
175
 
                                int xi, int yi, int left, PolyEdgePtr edge);
176
 
extern int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes,
177
 
                                int count, int xi, int yi, PolyEdgePtr left,
178
 
                                PolyEdgePtr right, int *pnleft, int *pnright,
179
 
                                int *h);
180