Back to index

lightning-sunbird  0.9+nobinonly
cairo-win32-private.h
Go to the documentation of this file.
00001 /* cairo - a vector graphics library with display and print output
00002  *
00003  * Copyright © 2005 Red Hat, Inc
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it either under the terms of the GNU Lesser General Public
00007  * License version 2.1 as published by the Free Software Foundation
00008  * (the "LGPL") or, at your option, under the terms of the Mozilla
00009  * Public License Version 1.1 (the "MPL"). If you do not alter this
00010  * notice, a recipient may use your version of this file under either
00011  * the MPL or the LGPL.
00012  *
00013  * You should have received a copy of the LGPL along with this library
00014  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00016  * You should have received a copy of the MPL along with this library
00017  * in the file COPYING-MPL-1.1
00018  *
00019  * The contents of this file are subject to the Mozilla Public License
00020  * Version 1.1 (the "License"); you may not use this file except in
00021  * compliance with the License. You may obtain a copy of the License at
00022  * http://www.mozilla.org/MPL/
00023  *
00024  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
00025  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
00026  * the specific language governing rights and limitations.
00027  *
00028  * The Original Code is the cairo graphics library.
00029  *
00030  * The Initial Developer of the Original Code is Red Hat, Inc.
00031  *
00032  * Contributor(s):
00033  *     Owen Taylor <otaylor@redhat.com>
00034  */
00035 
00036 #ifndef CAIRO_WIN32_PRIVATE_H
00037 #define CAIRO_WIN32_PRIVATE_H
00038 
00039 #include <cairo-win32.h>
00040 #include <cairoint.h>
00041 
00042 typedef struct _cairo_win32_surface {
00043     cairo_surface_t base;
00044 
00045     cairo_format_t format;
00046     
00047     HDC dc;
00048 
00049     /* We create off-screen surfaces as DIBs */
00050     HBITMAP bitmap;
00051 
00052     /* Used to save the initial 1x1 monochrome bitmap for the DC to
00053      * select back into the DC before deleting the DC and our
00054      * bitmap. For Windows XP, this doesn't seem to be necessary
00055      * ... we can just delete the DC and that automatically unselects
00056      * out bitmap. But it's standard practice so apparently is needed
00057      * on some versions of Windows.
00058      */
00059     HBITMAP saved_dc_bitmap;
00060 
00061     /* We need two images that point to the same bits, because of
00062      * broken pixman clipping semantics -- pixman (brokenly) does
00063      * source clipping because Render does -- the xlib backend
00064      * avoids this by creating two Pictures for each Drawable,
00065      * one that's used as a src and one that's used as a dst.
00066      */
00067     cairo_surface_t *src_image;
00068     cairo_surface_t *dst_image;
00069     
00070     cairo_rectangle_t clip_rect;
00071 
00072     int set_clip;
00073     HRGN saved_clip;
00074 
00075 } cairo_win32_surface_t;
00076 
00077 cairo_status_t
00078 _cairo_win32_print_gdi_error (const char *context);
00079 
00080 cairo_surface_t *
00081 _cairo_win32_surface_create_dib (cairo_format_t format,
00082                              int            width,
00083                              int            height);
00084 
00085 cairo_bool_t
00086 _cairo_surface_is_win32 (cairo_surface_t *surface);
00087 
00088 #endif /* CAIRO_WIN32_PRIVATE_H */