-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol.h
More file actions
188 lines (149 loc) · 6.24 KB
/
Copy pathcontrol.h
File metadata and controls
188 lines (149 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* control.h:
*
* Copyright 2007 Novell, Inc. (http://www.novell.com)
*
* See the LICENSE file included with the distribution for details.
*
*/
#ifndef __CONTROL_H__
#define __CONTROL_H__
#include <glib.h>
#include "frameworkelement.h"
#include "thickness.h"
#include "brush.h"
#include "enums.h"
#include "xaml.h"
#include "template.h"
#include "fontfamily.h"
#include "fontstretch.h"
#include "fontstyle.h"
#include "fontweight.h"
#define CONTROL_FONT_FAMILY "Portable User Interface"
#define CONTROL_FONT_STRETCH FontStretchesNormal
#define CONTROL_FONT_WEIGHT FontWeightsNormal
#define CONTROL_FONT_STYLE FontStylesNormal
namespace Moonlight {
//
// Control Class
//
/* @Namespace=System.Windows.Controls */
/* @CallInitialize */
class Control : public FrameworkElement {
public:
virtual bool CanCaptureMouse () { return GetIsEnabled (); }
virtual bool CanFindElement () { return GetIsEnabled (); }
virtual void FindElementsInHostCoordinates (cairo_t *cr, Point p, List *uielement_list);
virtual void HitTest (cairo_t *cr, Point p, List *uielement_list);
virtual void Dispose ();
virtual bool IsLayoutContainer () { return true; }
virtual bool InsideObject (cairo_t *cr, double x, double y);
virtual void OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error);
virtual void ElementAdded (UIElement *item);
virtual void ElementRemoved (UIElement *item);
virtual bool DoApplyTemplateWithError (MoonError *error);
virtual void SetVisualParent (UIElement *visual_parent);
virtual void OnLogicalParentChanged (DependencyObject *old_parent, DependencyObject *new_parent);
virtual void OnIsAttachedChanged (bool attached);
virtual bool Focus (bool recurse = true);
/* @GeneratePInvoke */
DependencyObject *GetTemplateChild (const char *name);
/* @GeneratePInvoke */
UIElement *GetTemplateRoot () { return template_root; }
/* @GeneratePInvoke */
void UpdateIsEnabledSource (Control *control);
//
// Property Accessors
//
void SetBackground (Brush *bg);
Brush *GetBackground ();
void SetBorderBrush (Brush *brush);
Brush *GetBorderBrush ();
void SetBorderThickness (Thickness *thickness);
Thickness *GetBorderThickness ();
void SetFontFamily (FontFamily *family);
FontFamily *GetFontFamily ();
void SetFontSize (double size);
double GetFontSize ();
void SetFontStretch (FontStretch* stretch);
FontStretch* GetFontStretch ();
void SetFontStyle (FontStyle* style);
FontStyle* GetFontStyle ();
void SetFontWeight (FontWeight* weight);
FontWeight* GetFontWeight ();
void SetForeground (Brush *fg);
Brush *GetForeground ();
void SetHorizontalContentAlignment (HorizontalAlignment alignment);
HorizontalAlignment GetHorizontalContentAlignment ();
void SetIsEnabled (bool value);
bool GetIsEnabled ();
void SetIsTabStop (bool value);
bool GetIsTabStop ();
void SetPadding (Thickness *padding);
Thickness *GetPadding ();
void SetTabIndex (int index);
int GetTabIndex ();
void SetTabNavigation (KeyboardNavigationMode mode);
KeyboardNavigationMode GetTabNavigation ();
void SetTemplate (ControlTemplate *value);
ControlTemplate* GetTemplate ();
void SetVerticalContentAlignment (VerticalAlignment alignment);
VerticalAlignment GetVerticalContentAlignment ();
void SetDefaultStyleKey (ManagedTypeInfo *value);
ManagedTypeInfo* GetDefaultStyleKey ();
static void SetIsTemplateItem (DependencyObject *object, bool value);
static bool GetIsTemplateItem (DependencyObject *object);
// Events
/* @DelegateType=DependencyPropertyChangedEventHandler */
const static int IsEnabledChangedEvent;
/* @PropertyType=Brush,GenerateAccessors */
const static int BackgroundProperty;
/* @PropertyType=Brush,GenerateAccessors */
const static int BorderBrushProperty;
/* @PropertyType=Thickness,DefaultValue=Thickness(0.0),GenerateAccessors */
const static int BorderThicknessProperty;
/* @PropertyType=FontFamily,DefaultValue=FontFamily(CONTROL_FONT_FAMILY),GenerateAccessors,Validator=NonNullValidator*/
const static int FontFamilyProperty;
/* @PropertyType=double,AutoCreator=CreateDefaultFontSize,GenerateAccessors,Validator=DoubleGreaterThanZeroValidator */
const static int FontSizeProperty;
/* @PropertyType=FontStretch,DefaultValue=FontStretch(CONTROL_FONT_STRETCH),GenerateAccessors */
const static int FontStretchProperty;
/* @PropertyType=FontStyle,DefaultValue=FontStyle(CONTROL_FONT_STYLE),GenerateAccessors */
const static int FontStyleProperty;
/* @PropertyType=FontWeight,DefaultValue=FontWeight(CONTROL_FONT_WEIGHT),GenerateAccessors */
const static int FontWeightProperty;
/* @PropertyType=Brush,AutoCreator=CreateBlackBrush,GenerateAccessors */
const static int ForegroundProperty;
/* @PropertyType=HorizontalAlignment,DefaultValue=HorizontalAlignmentCenter,GenerateAccessors */
const static int HorizontalContentAlignmentProperty;
/* @PropertyType=bool,DefaultValue=true,GenerateAccessors */
const static int IsEnabledProperty;
/* @PropertyType=bool,DefaultValue=false,ManagedAccess=Internal,Attached,GenerateAccessors */
const static int IsTemplateItemProperty;
/* @PropertyType=bool,DefaultValue=true,MetadataOverrides=USERCONTROL;false,GenerateAccessors */
const static int IsTabStopProperty;
/* @PropertyType=Thickness,DefaultValue=Thickness(0.0),GenerateAccessors */
const static int PaddingProperty;
/* @PropertyType=gint32,DefaultValue=INT_MAX,GenerateAccessors */
const static int TabIndexProperty;
/* @PropertyType=KeyboardNavigationMode,DefaultValue=KeyboardNavigationModeLocal,GenerateAccessors */
const static int TabNavigationProperty;
/* @PropertyType=ControlTemplate,GenerateAccessors,Validator=TemplateValidator */
const static int TemplateProperty;
/* @PropertyType=VerticalAlignment,DefaultValue=VerticalAlignmentCenter,GenerateAccessors */
const static int VerticalContentAlignmentProperty;
/* @PropertyType=ManagedTypeInfo,ManagedPropertyType=object,GenerateManagedDP=false,GenerateAccessors */
const static int DefaultStyleKeyProperty;
const static void *TemplateRootWeakRef;
protected:
/* @GeneratePInvoke,ManagedAccess=Protected */
Control ();
virtual ~Control ();
friend class MoonUnmanagedFactory;
friend class MoonManagedFactory;
private:
WeakRef<UIElement> template_root;
};
};
#endif /* __CONTROL_H__ */