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 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
19 #include "frameworkelement.h"
20 #include "downloader.h"
21 #include "fontfamily.h"
22 #include "fontstretch.h"
23 #include "fontstyle.h"
24 #include "fontweight.h"
25 #include "moon-path.h"
26 #include "thickness.h"
31 /* @Namespace=System.Windows.Documents */
32 class Glyphs
: public FrameworkElement
{
33 Downloader
*downloader
;
51 void SetIndicesInternal (const char *in
);
53 void CleanupDownloader ();
54 void DownloaderComplete ();
56 static void downloader_complete (EventObject
*sender
, EventArgs
*calldata
, gpointer closure
);
58 void LoadFont (const Uri
*uri
, const char *path
);
59 void DownloadFont (Surface
*surface
, Uri
*uri
, MoonError
*error
);
60 bool SetFontResource (const Uri
*uri
);
66 /* @PropertyType=Brush,GenerateAccessors */
67 const static int FillProperty
;
68 /* @PropertyType=double,DefaultValue=0.0,GenerateAccessors */
69 const static int FontRenderingEmSizeProperty
;
70 /* @PropertyType=Uri,GenerateAccessors,DefaultValue=Uri(),Validator=NonNullValidator */
71 const static int FontUriProperty
;
72 /* @PropertyType=string,DefaultValue=\"\",GenerateAccessors */
73 const static int IndicesProperty
;
74 /* @PropertyType=double,DefaultValue=-HUGE,Validator=FloatValidator,GenerateAccessors */
75 const static int OriginXProperty
;
76 /* @PropertyType=double,DefaultValue=-HUGE,Validator=FloatValidator,GenerateAccessors */
77 const static int OriginYProperty
;
78 /* @PropertyType=StyleSimulations,DefaultValue=StyleSimulationsNone,GenerateAccessors */
79 const static int StyleSimulationsProperty
;
80 /* @PropertyType=string,DefaultValue=\"\",GenerateAccessors */
81 const static int UnicodeStringProperty
;
83 /* @GenerateCBinding,GeneratePInvoke */
86 virtual void GetSizeForBrush (cairo_t
*cr
, double *width
, double *height
);
87 virtual void Render (cairo_t
*cr
, Region
*region
, bool path_only
= false);
88 virtual Size
ComputeActualSize ();
89 virtual void ComputeBounds ();
90 virtual Size
MeasureOverride (Size availableSize
);
91 virtual Size
ArrangeOverride (Size finalSize
);
92 virtual bool InsideObject (cairo_t
*cr
, double x
, double y
);
93 virtual Point
GetTransformOrigin ();
94 virtual Point
GetOriginPoint ();
95 virtual void SetParent (DependencyObject
*parent
, MoonError
*error
);
96 virtual void OnPropertyChanged (PropertyChangedEventArgs
*args
, MoonError
*error
);
97 virtual void OnSubPropertyChanged (DependencyProperty
*prop
, DependencyObject
*obj
, PropertyChangedEventArgs
*subobj_args
);
100 // Property Accessors
102 void SetFill (Brush
*fill
);
105 void SetFontRenderingEmSize (double size
);
106 double GetFontRenderingEmSize ();
108 void SetFontUri (Uri
*uri
);
111 void SetIndices (const char *indices
);
112 const char *GetIndices ();
114 void SetOriginX (double origin
);
115 double GetOriginX ();
117 void SetOriginY (double origin
);
118 double GetOriginY ();
120 void SetStyleSimulations (StyleSimulations style
);
121 StyleSimulations
GetStyleSimulations ();
123 void SetUnicodeString (const char *unicode
);
124 const char *GetUnicodeString ();
127 #endif /* __GLYPHS_H__ */