Author: fejj
Date: 2007-06-14 12:18:07 -0400 (Thu, 14 Jun 2007)
New Revision: 79561
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/media.cpp
trunk/moon/src/text.cpp
trunk/moon/src/text.h
trunk/moon/src/xaml.cpp
Log:
2007-06-14 Jeffrey Stedfast <[EMAIL PROTECTED]>
* xaml.cpp: Fixed the font_widths and font_stretches maps to
reflect the numeric enum values defined in text.h (and msdn docs).
* text.h: Sync enum values to documented numeric values.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-14 16:04:21 UTC (rev 79560)
+++ trunk/moon/src/ChangeLog 2007-06-14 16:18:07 UTC (rev 79561)
@@ -1,3 +1,10 @@
+2007-06-14 Jeffrey Stedfast <[EMAIL PROTECTED]>
+
+ * xaml.cpp: Fixed the font_widths and font_stretches maps to
+ reflect the numeric enum values defined in text.h (and msdn docs).
+
+ * text.h: Sync enum values to documented numeric values.
+
2007-06-14 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* transform.cpp|h, media.cpp|h, brush.cpp|h, runtime.cpp|h:
Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp 2007-06-14 16:04:21 UTC (rev 79560)
+++ trunk/moon/src/media.cpp 2007-06-14 16:18:07 UTC (rev 79561)
@@ -64,9 +64,7 @@
DependencyProperty *MediaElement::PositionProperty;
DependencyProperty *MediaElement::VolumeProperty;
-DependencyProperty *MediaElement::AttributesProperty;
-
void
MediaElement::SetSource (DependencyObject *downloader, char *name)
{
@@ -263,4 +261,4 @@
{
/* MediaAttribute */
MediaAttribute::ValueProperty = DependencyObject::Register
(Value::MEDIAATTRIBUTE, "Value", new Value (""));
-}
\ No newline at end of file
+}
Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp 2007-06-14 16:04:21 UTC (rev 79560)
+++ trunk/moon/src/text.cpp 2007-06-14 16:18:07 UTC (rev 79561)
@@ -34,8 +34,7 @@
return PANGO_STRETCH_CONDENSED;
case FontStretchesSemiCondensed:
return PANGO_STRETCH_SEMI_CONDENSED;
- case FontStretchesNormal:
- case FontStretchesMedium: // alias for FontStretchesNormal
+ case FontStretchesNormal: // FontStretchesMedium (alias)
default:
return PANGO_STRETCH_NORMAL;
case FontStretchesSemiExpanded:
@@ -88,6 +87,12 @@
DependencyProperty *Inline::ForegroundProperty;
DependencyProperty *Inline::TextDecorationsProperty;
+Inline *
+inline_new (void)
+{
+ return new Inline ();
+}
+
char *
inline_get_font_family (Inline *inline_)
{
@@ -295,6 +300,12 @@
}
}
+TextBlock *
+textblock_new (void)
+{
+ return new TextBlock ();
+}
+
double
textblock_get_actual_height (TextBlock *textblock)
{
Modified: trunk/moon/src/text.h
===================================================================
--- trunk/moon/src/text.h 2007-06-14 16:04:21 UTC (rev 79560)
+++ trunk/moon/src/text.h 2007-06-14 16:18:07 UTC (rev 79561)
@@ -7,16 +7,16 @@
#include "runtime.h"
enum FontStretches {
- FontStretchesUltraCondensed,
- FontStretchesExtraCondensed,
- FontStretchesCondensed,
- FontStretchesSemiCondensed,
- FontStretchesNormal,
- FontStretchesMedium,
- FontStretchesSemiExpanded,
- FontStretchesExpanded,
- FontStretchesExtraExpanded,
- FontStretchesUltraExpanded
+ FontStretchesUltraCondensed = 1,
+ FontStretchesExtraCondensed = 2,
+ FontStretchesCondensed = 3,
+ FontStretchesSemiCondensed = 4,
+ FontStretchesNormal = 5,
+ FontStretchesMedium = 5,
+ FontStretchesSemiExpanded = 6,
+ FontStretchesExpanded = 7,
+ FontStretchesExtraExpanded = 8,
+ FontStretchesUltraExpanded = 9
};
enum FontStyles {
@@ -26,22 +26,22 @@
};
enum FontWeights {
- FontWeightsThin,
- FontWeightsExtraLight,
- FontWeightsUltraLight,
- FontWeightsLight,
- FontWeightsNormal,
- FontWeightsRegular,
- FontWeightsMedium,
- FontWeightsSemiBold,
- FontWeightsDemiBold,
- FontWeightsBold,
- FontWeightsExtraBold,
- FontWeightsUltraBold,
- FontWeightsBlack,
- FontWeightsHeavy,
- FontWeightsExtraBlack,
- FontWeightsUltraBlack
+ FontWeightsThin = 100,
+ FontWeightsExtraLight = 200,
+ FontWeightsUltraLight = 200,
+ FontWeightsLight = 300,
+ FontWeightsNormal = 400,
+ FontWeightsRegular = 400,
+ FontWeightsMedium = 500,
+ FontWeightsSemiBold = 600,
+ FontWeightsDemiBold = 600,
+ FontWeightsBold = 700,
+ FontWeightsExtraBold = 800,
+ FontWeightsUltraBold = 800,
+ FontWeightsBlack = 900,
+ FontWeightsHeavy = 900,
+ FontWeightsExtraBlack = 950,
+ FontWeightsUltraBlack = 950
};
enum TextDecorations {
@@ -71,6 +71,8 @@
virtual Value::Kind GetObjectType () { return Value::INLINE; }
};
+Inline *inline_new (void);
+
char *inline_get_font_family (Inline *inline_);
void inline_set_font_family (Inline *inline_, char *value);
@@ -124,6 +126,8 @@
void Draw (Surface *s, bool render);
};
+TextBlock *textblock_new (void);
+
double textblock_get_actual_height (TextBlock *textblock);
void textblock_set_actual_height (TextBlock *textblock, double value);
Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp 2007-06-14 16:04:21 UTC (rev 79560)
+++ trunk/moon/src/xaml.cpp 2007-06-14 16:18:07 UTC (rev 79561)
@@ -21,6 +21,7 @@
#include "shape.h"
#include "animation.h"
#include "geometry.h"
+#include "text.h"
#define READ_BUFFER 1024
@@ -683,43 +684,43 @@
};
enum_map_t font_stretches_map [] = {
- { "UltraCondensed", 0 },
- { "ExtraCondensed", 1 },
- { "Condensed", 2 },
- { "SemiCondensed", 3 },
- { "Normal", 4 },
- { "Medium", 5 },
- { "SemiExpanded", 6 },
- { "Expanded", 7 },
- { "ExtraExpanded", 8 },
- { "UltraExpanded", 9 },
+ { "UltraCondensed", 1 },
+ { "ExtraCondensed", 2 },
+ { "Condensed", 3 },
+ { "SemiCondensed", 4 },
+ { "Normal", 5 },
+ { "Medium", 5 },
+ { "SemiExpanded", 6 },
+ { "Expanded", 7 },
+ { "ExtraExpanded", 8 },
+ { "UltraExpanded", 9 },
{ NULL, 0 },
};
enum_map_t font_styles_map [] = {
- { "Normal", 0 },
+ { "Normal", 0 },
{ "Oblique", 1 },
- { "Italic", 2 },
+ { "Italic", 2 },
{ NULL, 0 },
};
enum_map_t font_weights_map [] = {
- { "Thin", 0 },
- { "ExtraLight", 1 },
- { "UltraLight", 2 },
- { "Light", 3 },
- { "Normal", 4 },
- { "Regular", 5 },
- { "Medium", 6 },
- { "SemiBold", 7 },
- { "DemiBold", 8 },
- { "Bold", 9 },
- { "ExtraBold", 10 },
- { "UltraBold", 11 },
- { "Black", 12 },
- { "Heavy", 13 },
- { "ExtraBlack", 14 },
- { "UltraBlack", 15 },
+ { "Thin", 100 },
+ { "ExtraLight", 200 },
+ { "UltraLight", 200 },
+ { "Light", 300 },
+ { "Normal", 400 },
+ { "Regular", 400 },
+ { "Medium", 500 },
+ { "SemiBold", 600 },
+ { "DemiBold", 600 },
+ { "Bold", 700 },
+ { "ExtraBold", 800 },
+ { "UltraBold", 800 },
+ { "Black", 900 },
+ { "Heavy", 900 },
+ { "ExtraBlack", 950 },
+ { "UltraBlack", 950 },
{ NULL, 0 },
};
@@ -1176,6 +1177,14 @@
rdoe (dem, "Rectangle", shape, Value::RECTANGLE, (create_item_func)
rectangle_new);
///
+ /// Text
+ ///
+
+ //rdoe (dem, "Glyphs", fw, Value::GLYPHS, (create_item_func)
glyphs_new);
+ //rdoe (dem, "Inline", do, Value::INLINE, (create_item_func)
inline_new);
+ rdoe (dem, "TextBlock", fw, Value::TEXTBLOCK, (create_item_func)
textblock_new);
+
+ ///
/// Geometry
///
@@ -1327,5 +1336,4 @@
g_hash_table_insert (enum_map, (char *) "TextDecorations",
GINT_TO_POINTER (text_decorations_map));
g_hash_table_insert (enum_map, (char *) "TextWrapping", GINT_TO_POINTER
(text_wrapping_map));
g_hash_table_insert (enum_map, (char *) "Visibility", GINT_TO_POINTER
(visibility_map));
-
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches