Bug 460926 A11y hierachy is broken on Ubuntu 8.10 (GNOME 2.24), r=Evan.Yan sr=roc
[wine-gecko.git] / gfx / cairo / wince-fixes.patch
blobaf8e27d9096bfdaffa38eadad657ee21535425ce
1 diff --git a/gfx/cairo/cairo/src/cairo-win32-private.h b/gfx/cairo/cairo/src/cairo-win32-private.h
2 --- a/gfx/cairo/cairo/src/cairo-win32-private.h
3 +++ b/gfx/cairo/cairo/src/cairo-win32-private.h
4 @@ -194,4 +194,22 @@
5 cairo_bool_t
6 _cairo_win32_scaled_font_is_bitmap (cairo_scaled_font_t *scaled_font);
8 +#ifdef WINCE
10 +// These are the required stubs for windows mobile
11 +#define ETO_GLYPH_INDEX 0
12 +#define ETO_PDY 0
13 +#define HALFTONE COLORONCOLOR
14 +#define GM_ADVANCED 2
15 +#define MWT_IDENTITY 1
17 +inline int SetGraphicsMode(HDC hdc, int iMode) {return 1;}
18 +inline int GetGraphicsMode(HDC hdc) {return 1;} /*GM_COMPATIBLE*/
19 +inline void GdiFlush() {}
20 +inline BOOL SetWorldTransform(HDC hdc, CONST XFORM *lpXform) { return FALSE; }
21 +inline BOOL GetWorldTransform(HDC hdc, LPXFORM lpXform ) { return FALSE; }
22 +inline BOOL ModifyWorldTransform(HDC hdc, CONST XFORM * lpxf, DWORD mode) { return 1; }
24 +#endif
26 #endif /* CAIRO_WIN32_PRIVATE_H */
27 diff --git a/gfx/cairo/cairo/src/cairo-win32-surface.c b/gfx/cairo/cairo/src/cairo-win32-surface.c
28 --- a/gfx/cairo/cairo/src/cairo-win32-surface.c
29 +++ b/gfx/cairo/cairo/src/cairo-win32-surface.c
30 @@ -1591,8 +1591,25 @@
31 return _cairo_error (CAIRO_STATUS_NO_MEMORY);
33 /* AND the new region into our DC */
35 +#ifndef WINCE
36 if (ExtSelectClipRgn (surface->dc, gdi_region, RGN_AND) == ERROR)
37 status = _cairo_win32_print_gdi_error ("_cairo_win32_surface_set_clip_region");
38 +#else
39 + // The ExtSelectClipRgn function combines the specified
40 + // region with the current clipping region using the
41 + // specified mode. Here we do similar using basic
42 + // functions available on WINCE.
43 + {
44 + HRGN currentClip, newClip;
45 + GetClipRgn(surface->dc, &currentClip);
47 + if (CombineRgn(newClip, currentClip, gdi_region, RGN_AND) != ERROR) {
48 + SelectClipRgn(surface->dc, newClip);
49 + DeleteObject(newClip);
50 + }
51 + }
52 +#endif
54 DeleteObject (gdi_region);
56 @@ -1629,7 +1646,7 @@
57 cairo_scaled_font_t *scaled_font,
58 int *remaining_glyphs)
60 -#if CAIRO_HAS_WIN32_FONT
61 +#if defined(CAIRO_HAS_WIN32_FONT) && !defined(WINCE)
62 cairo_win32_surface_t *dst = surface;
64 WORD glyph_buf_stack[STACK_GLYPH_SIZE];