Author: toshok
Date: 2008-02-05 15:24:42 -0500 (Tue, 05 Feb 2008)
New Revision: 94943
Modified:
trunk/moon/src/fullscreen.cs
trunk/moon/src/fullscreen.h
Log:
kinda gross, but optimize the output to removing unnecessary spaces
Modified: trunk/moon/src/fullscreen.cs
===================================================================
--- trunk/moon/src/fullscreen.cs 2008-02-05 20:22:27 UTC (rev 94942)
+++ trunk/moon/src/fullscreen.cs 2008-02-05 20:24:42 UTC (rev 94943)
@@ -2,6 +2,7 @@
using System.IO;
using System.Collections;
using System.Collections.Generic;
+using System.Text;
class convert {
static int Main (string [] args)
@@ -31,7 +32,16 @@
dest.Add ("#define FULLSCREEN_MESSAGE \\");
for (int i = 0; i < source.Length; i++) {
- dest.Add ("\"" + source [i].Replace ("\"",
"\\\"") + "\\n\" \\");
+ int j;
+ StringBuilder sb = new StringBuilder ();
+ /* put the leading whitespace in the file */
+ for (j = 0; j < source[i].Length; j ++) {
+ if (!Char.IsWhiteSpace (source[i], j))
+ break;
+ }
+ if (j > 0) sb.Append (source[i].Substring (0,
j));
+ sb.Append ("\"" + source [i].Substring
(j).Replace ("\"", "\\\"") + (source[i][source[i].Length-1] == '>' ? "" : " ")
+ "\" \\");
+ dest.Add (sb.ToString());
}
dest.Add ("\"\"");
dest.Add ("");
Modified: trunk/moon/src/fullscreen.h
===================================================================
--- trunk/moon/src/fullscreen.h 2008-02-05 20:22:27 UTC (rev 94942)
+++ trunk/moon/src/fullscreen.h 2008-02-05 20:24:42 UTC (rev 94943)
@@ -10,39 +10,39 @@
*
*/
#define FULLSCREEN_MESSAGE \
-"<Canvas\n" \
-" xmlns=\"http://schemas.microsoft.com/client/2007\"\n" \
-" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n" \
-" Width=\"500\" Height=\"68\"\n" \
-" x:Name=\"FullScreenMessage\"\n" \
-" Visibility=\"Visible\"\n" \
-" Opacity=\"1\"\n" \
-" >\n" \
-" <Canvas.Triggers>\n" \
-" <EventTrigger RoutedEvent=\"Canvas.Loaded\">\n" \
-" <BeginStoryboard>\n" \
-" <Storyboard x:Name=\"FadeOut\">\n" \
-" <DoubleAnimationUsingKeyFrames
BeginTime=\"00:00:00\" Storyboard.TargetName=\"FullScreenMessage\"
Storyboard.TargetProperty=\"(UIElement.Opacity)\">\n" \
-" <SplineDoubleKeyFrame
KeyTime=\"00:00:04.6000000\" Value=\"1\"/>\n" \
-" <SplineDoubleKeyFrame
KeyTime=\"00:00:05\" Value=\"0\"/>\n" \
-" </DoubleAnimationUsingKeyFrames>\n" \
-" </Storyboard>\n" \
-" </BeginStoryboard>\n" \
-" </EventTrigger>\n" \
-" </Canvas.Triggers>\n" \
-" <Canvas.RenderTransform>\n" \
-" <TranslateTransform X=\"0\" Y=\"0\"/>\n" \
-" </Canvas.RenderTransform>\n" \
-" <Rectangle Width=\"500\" Height=\"68\" Stroke=\"#FF000000\"
StrokeThickness=\"0\" RadiusX=\"8\" RadiusY=\"8\">\n" \
-" <Rectangle.Fill>\n" \
-" <LinearGradientBrush EndPoint=\"0,1\"
StartPoint=\"0,0\">\n" \
-" <GradientStop Color=\"#FF242323\"
Offset=\"0\"/>\n" \
-" <GradientStop Color=\"#FF515151\"
Offset=\"1\"/>\n" \
-" </LinearGradientBrush>\n" \
-" </Rectangle.Fill>\n" \
-" </Rectangle>\n" \
-" <TextBlock Width=\"458\" Height=\"27\" Canvas.Left=\"124\"
Canvas.Top=\"14\" TextWrapping=\"Wrap\" FontWeight=\"Normal\"
Foreground=\"#FFFFFFFF\" FontSize=\"14\" Text=\"Press "Esc" to exit
full-screen mode.\" x:Name=\"message\"/>\n" \
-" <TextBlock Width=\"458\" Height=\"20\" Canvas.Left=\"193\"
Canvas.Top=\"34\" Text=\"<url: file://>\" TextWrapping=\"Wrap\"
x:Name=\"url\" Foreground=\"#FFC8C4C4\" FontSize=\"13\"
FontStretch=\"Normal\"/>\n" \
-"</Canvas>\n" \
+"<Canvas " \
+ "xmlns=\"http://schemas.microsoft.com/client/2007\" " \
+ "xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" " \
+ "Width=\"500\" Height=\"68\" " \
+ "x:Name=\"FullScreenMessage\" " \
+ "Visibility=\"Visible\" " \
+ "Opacity=\"1\" " \
+ ">" \
+ "<Canvas.Triggers>" \
+ "<EventTrigger RoutedEvent=\"Canvas.Loaded\">" \
+ "<BeginStoryboard>" \
+ "<Storyboard x:Name=\"FadeOut\">" \
+ "<DoubleAnimationUsingKeyFrames
BeginTime=\"00:00:00\" Storyboard.TargetName=\"FullScreenMessage\"
Storyboard.TargetProperty=\"(UIElement.Opacity)\">" \
+ "<SplineDoubleKeyFrame
KeyTime=\"00:00:04.6000000\" Value=\"1\"/>" \
+ "<SplineDoubleKeyFrame
KeyTime=\"00:00:05\" Value=\"0\"/>" \
+ "</DoubleAnimationUsingKeyFrames>" \
+ "</Storyboard>" \
+ "</BeginStoryboard>" \
+ "</EventTrigger>" \
+ "</Canvas.Triggers>" \
+ "<Canvas.RenderTransform>" \
+ "<TranslateTransform X=\"0\" Y=\"0\"/>" \
+ "</Canvas.RenderTransform>" \
+ "<Rectangle Width=\"500\" Height=\"68\" Stroke=\"#FF000000\"
StrokeThickness=\"0\" RadiusX=\"8\" RadiusY=\"8\">" \
+ "<Rectangle.Fill>" \
+ "<LinearGradientBrush EndPoint=\"0,1\"
StartPoint=\"0,0\">" \
+ "<GradientStop Color=\"#FF242323\"
Offset=\"0\"/>" \
+ "<GradientStop Color=\"#FF515151\"
Offset=\"1\"/>" \
+ "</LinearGradientBrush>" \
+ "</Rectangle.Fill>" \
+ "</Rectangle>" \
+ "<TextBlock Width=\"458\" Height=\"27\" Canvas.Left=\"124\"
Canvas.Top=\"14\" TextWrapping=\"Wrap\" FontWeight=\"Normal\"
Foreground=\"#FFFFFFFF\" FontSize=\"14\" Text=\"Press "Esc" to exit
full-screen mode.\" x:Name=\"message\"/>" \
+ "<TextBlock Width=\"458\" Height=\"20\" Canvas.Left=\"193\"
Canvas.Top=\"34\" Text=\"<url: file://>\" TextWrapping=\"Wrap\"
x:Name=\"url\" Foreground=\"#FFC8C4C4\" FontSize=\"13\"
FontStretch=\"Normal\"/>" \
+"</Canvas>" \
""
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches