2009-11-13 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / bitmapsource.h
blobc95b6ffe98c5cc0665d9032981335e3c6cd3abd8
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * bitmapsource.h
5 * Contact:
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 <cairo.h>
19 #include "dependencyobject.h"
20 #include "imagesource.h"
22 /* @Namespace=System.Windows.Media.Imaging */
23 class BitmapSource : public ImageSource {
24 private:
25 cairo_surface_t *native_surface;
26 gpointer data;
27 bool own_data; // if true, we free in the dtor.
28 protected:
29 cairo_surface_t *image_surface;
31 virtual ~BitmapSource ();
33 public:
34 /* @GenerateCBinding,GeneratePInvoke */
35 BitmapSource ();
37 /* @PropertyType=gint32,DefaultValue=0,ManagedSetterAccess=Internal,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
38 const static int PixelWidthProperty;
39 /* @PropertyType=gint32,DefaultValue=0,ManagedSetterAccess=Internal,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
40 const static int PixelHeightProperty;
41 /* @PropertyType=PixelFormat,DefaultValue=PixelFormatPbgra32,ManagedAccess=Internal,GenerateAccessors */
42 const static int PixelFormatProperty;
44 /* @GenerateManagedEvent=false */
45 const static int PixelDataChangedEvent;
47 virtual gint32 GetPixelWidth ();
48 virtual void SetPixelWidth (gint32 width);
49 virtual gint32 GetPixelHeight ();
50 virtual void SetPixelHeight (gint32 height);
52 /* @GenerateCBinding,GeneratePInvoke */
53 gpointer GetBitmapData ();
54 /* @GenerateCBinding,GeneratePInvoke */
55 void SetBitmapData (gpointer data, bool own = true);
57 PixelFormats GetPixelFormat ();
58 void SetPixelFormat (PixelFormats weight);
60 /* @GenerateCBinding,GeneratePInvoke */
61 virtual void Invalidate ();
62 virtual cairo_surface_t *GetSurface (cairo_t *cr);
64 cairo_surface_t *GetImageSurface () { return image_surface; }
67 #endif /* __BITMAPSOURCE_H__ */