1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __BITMAPSOURCE_H__
15 #define __BITMAPSOURCE_H__
17 #include "dependencyobject.h"
18 #include "imagesource.h"
20 /* @Namespace=System.Windows.Media.Imaging */
21 class BitmapSource
: public ImageSource
{
23 cairo_surface_t
*native_surface
;
25 bool own_data
; // if true, we free in the dtor.
27 cairo_surface_t
*image_surface
;
29 virtual ~BitmapSource ();
32 /* @GenerateCBinding,GeneratePInvoke */
35 /* @PropertyType=gint32,DefaultValue=0,ManagedSetterAccess=Internal,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
36 const static int PixelWidthProperty
;
37 /* @PropertyType=gint32,DefaultValue=0,ManagedSetterAccess=Internal,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
38 const static int PixelHeightProperty
;
39 /* @PropertyType=PixelFormat,DefaultValue=PixelFormatPbgra32,ManagedAccess=Internal,GenerateAccessors */
40 const static int PixelFormatProperty
;
42 /* @GenerateManagedEvent=false */
43 const static int PixelDataChangedEvent
;
45 virtual gint32
GetPixelWidth ();
46 virtual void SetPixelWidth (gint32 width
);
47 virtual gint32
GetPixelHeight ();
48 virtual void SetPixelHeight (gint32 height
);
50 /* @GenerateCBinding,GeneratePInvoke */
51 gpointer
GetBitmapData ();
52 /* @GenerateCBinding,GeneratePInvoke */
53 void SetBitmapData (gpointer data
, bool own
= true);
55 PixelFormats
GetPixelFormat ();
56 void SetPixelFormat (PixelFormats weight
);
58 /* @GenerateCBinding,GeneratePInvoke */
59 virtual void Invalidate ();
60 virtual cairo_surface_t
*GetSurface (cairo_t
*cr
);
62 cairo_surface_t
*GetImageSurface () { return image_surface
; }
65 #endif /* __BITMAPSOURCE_H__ */