~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gdk/linux-fb/miscanfill.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $TOG: miscanfill.h /main/6 1998/02/09 14:48:35 kaleb $ */
 
2
/*
 
3
 
 
4
Copyright 1987, 1998  The Open Group
 
5
 
 
6
All Rights Reserved.
 
7
 
 
8
The above copyright notice and this permission notice shall be included
 
9
in all copies or substantial portions of the Software.
 
10
 
 
11
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
12
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
13
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
14
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
15
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
16
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
17
OTHER DEALINGS IN THE SOFTWARE.
 
18
 
 
19
Except as contained in this notice, the name of The Open Group shall
 
20
not be used in advertising or otherwise to promote the sale, use or
 
21
other dealings in this Software without prior written authorization
 
22
from The Open Group.
 
23
 
 
24
*/
 
25
 
 
26
#ifndef SCANFILLINCLUDED
 
27
#define SCANFILLINCLUDED
 
28
/*
 
29
 *     scanfill.h
 
30
 *
 
31
 *     Written by Brian Kelleher; Jan 1985
 
32
 *
 
33
 *     This file contains a few macros to help track
 
34
 *     the edge of a filled object.  The object is assumed
 
35
 *     to be filled in scanline order, and thus the
 
36
 *     algorithm used is an extension of Bresenham's line
 
37
 *     drawing algorithm which assumes that y is always the
 
38
 *     major axis.
 
39
 *     Since these pieces of code are the same for any filled shape,
 
40
 *     it is more convenient to gather the library in one
 
41
 *     place, but since these pieces of code are also in
 
42
 *     the inner loops of output primitives, procedure call
 
43
 *     overhead is out of the question.
 
44
 *     See the author for a derivation if needed.
 
45
 */
 
46
 
 
47
 
 
48
/*
 
49
 *  In scan converting polygons, we want to choose those pixels
 
50
 *  which are inside the polygon.  Thus, we add .5 to the starting
 
51
 *  x coordinate for both left and right edges.  Now we choose the
 
52
 *  first pixel which is inside the pgon for the left edge and the
 
53
 *  first pixel which is outside the pgon for the right edge.
 
54
 *  Draw the left pixel, but not the right.
 
55
 *
 
56
 *  How to add .5 to the starting x coordinate:
 
57
 *      If the edge is moving to the right, then subtract dy from the
 
58
 *  error term from the general form of the algorithm.
 
59
 *      If the edge is moving to the left, then add dy to the error term.
 
60
 *
 
61
 *  The reason for the difference between edges moving to the left
 
62
 *  and edges moving to the right is simple:  If an edge is moving
 
63
 *  to the right, then we want the algorithm to flip immediately.
 
64
 *  If it is moving to the left, then we don't want it to flip until
 
65
 *  we traverse an entire pixel.
 
66
 */
 
67
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
 
68
    int dx;      /* local storage */ \
 
69
\
 
70
    /* \
 
71
     *  if the edge is horizontal, then it is ignored \
 
72
     *  and assumed not to be processed.  Otherwise, do this stuff. \
 
73
     */ \
 
74
    if ((dy) != 0) { \
 
75
        xStart = (x1); \
 
76
        dx = (x2) - xStart; \
 
77
        if (dx < 0) { \
 
78
            m = dx / (dy); \
 
79
            m1 = m - 1; \
 
80
            incr1 = -2 * dx + 2 * (dy) * m1; \
 
81
            incr2 = -2 * dx + 2 * (dy) * m; \
 
82
            d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
 
83
        } else { \
 
84
            m = dx / (dy); \
 
85
            m1 = m + 1; \
 
86
            incr1 = 2 * dx - 2 * (dy) * m1; \
 
87
            incr2 = 2 * dx - 2 * (dy) * m; \
 
88
            d = -2 * m * (dy) + 2 * dx; \
 
89
        } \
 
90
    } \
 
91
}
 
92
 
 
93
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
 
94
    if (m1 > 0) { \
 
95
        if (d > 0) { \
 
96
            minval += m1; \
 
97
            d += incr1; \
 
98
        } \
 
99
        else { \
 
100
            minval += m; \
 
101
            d += incr2; \
 
102
        } \
 
103
    } else {\
 
104
        if (d >= 0) { \
 
105
            minval += m1; \
 
106
            d += incr1; \
 
107
        } \
 
108
        else { \
 
109
            minval += m; \
 
110
            d += incr2; \
 
111
        } \
 
112
    } \
 
113
}
 
114
 
 
115
 
 
116
/*
 
117
 *     This structure contains all of the information needed
 
118
 *     to run the bresenham algorithm.
 
119
 *     The variables may be hardcoded into the declarations
 
120
 *     instead of using this structure to make use of
 
121
 *     register declarations.
 
122
 */
 
123
typedef struct {
 
124
    int minor;         /* minor axis        */
 
125
    int d;           /* decision variable */
 
126
    int m, m1;       /* slope and slope+1 */
 
127
    int incr1, incr2; /* error increments */
 
128
} BRESINFO;
 
129
 
 
130
 
 
131
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
 
132
        BRESINITPGON(dmaj, min1, min2, bres.minor, bres.d, \
 
133
                     bres.m, bres.m1, bres.incr1, bres.incr2)
 
134
 
 
135
#define BRESINCRPGONSTRUCT(bres) \
 
136
        BRESINCRPGON(bres.d, bres.minor, bres.m, bres.m1, bres.incr1, bres.incr2)
 
137
 
 
138
 
 
139
#endif