using System;
using System.Collections.Generic;
using System.Text;
using Vortex.SceneFramework.CSS;
using Vortex.Drawing;

namespace Vortex.SceneFramework {

	/// <summary>
	/// This class contains precached StyleProperty accessor objects for all of stock style properties
	/// </summary>
	public static class Styles {

		public static StyleKey Background { get; private set; }
		public static StyleKey BackgroundFrameSize { get; private set; }
		public static StyleKey BackgroundColor { get; private set; }
		public static StyleKey BackgroundOpacity { get; private set; }
		public static StyleKey BackgroundBlending { get; private set; }
		public static StyleKey BackgroundPadding { get; private set; }
		public static StyleKey BackgroundOffset { get; private set; }

		public static StyleKey TextFont { get; private set; }		
		public static StyleKey TextColor { get; private set; }
		public static StyleKey TextOpacity { get; private set; }
		public static StyleKey TextBlending { get; private set; }
		public static StyleKey TextLayout { get; private set; }
		public static StyleKey TextPadding { get; private set; }
		public static StyleKey TextOffset { get; private set; }

		public static StyleKey Foreground { get; private set; }
		public static StyleKey ForegroundFrameSize { get; private set; }
		public static StyleKey ForegroundColor { get; private set; }
		public static StyleKey ForegroundOpacity { get; private set; }
		public static StyleKey ForegroundBlending { get; private set; }
		public static StyleKey ForegroundPadding { get; private set; }
		public static StyleKey ForegroundOffset { get; private set; }

		public static StyleKey Cursor { get; private set; }


		/// <summary>
		/// Configures style sheet for domain graph elements.
		/// </summary>
		internal static void Configure() {
			//register all of properties
			Background = StyleSheet.RegisterProperty<Sprite>("background", null);
			BackgroundFrameSize = StyleSheet.RegisterProperty<Vector2>("background-frame-size", Vector2.Zero);
			BackgroundColor = StyleSheet.RegisterProperty<ColorU>("background-color", ColorU.Blank);
			BackgroundOpacity = StyleSheet.RegisterProperty<float>("background-opacity", 1.0f);
			BackgroundBlending = StyleSheet.RegisterProperty<Blending>("background-blending", Blending.Normal);
			BackgroundPadding = StyleSheet.RegisterProperty<Rect>("background-padding", Rect.Empty);
			BackgroundOffset = StyleSheet.RegisterProperty<Vector2>("background-offset", Vector2.Zero);

			TextFont = StyleSheet.RegisterProperty<SpriteFont>("text-font", SpriteFont.Default);
			TextColor = StyleSheet.RegisterProperty<ColorU>("text-color", ColorU.White);
			TextOpacity = StyleSheet.RegisterProperty<float>("text-opacity", 1.0f);
			TextBlending = StyleSheet.RegisterProperty<Blending>("text-blending", Blending.Normal);
			TextLayout = StyleSheet.RegisterProperty<TextLayout>("text-layout", Vortex.Drawing.TextLayout.Middle | Vortex.Drawing.TextLayout.Center);
			TextPadding = StyleSheet.RegisterProperty<Rect>("text-padding", Rect.Empty);
			TextOffset = StyleSheet.RegisterProperty<Vector2>("text-offset", Vector2.Zero);

			Foreground = StyleSheet.RegisterProperty<Sprite>("foreground", null);
			ForegroundFrameSize = StyleSheet.RegisterProperty<Vector2>("foreground-frame-size", Vector2.Zero);
			ForegroundPadding = StyleSheet.RegisterProperty<Rect>("foreground-padding", Rect.Empty);
			ForegroundColor = StyleSheet.RegisterProperty<ColorU>("foreground-color", ColorU.Blank);
			ForegroundOpacity = StyleSheet.RegisterProperty<float>("foreground-opacity", 1.0f);
			ForegroundBlending = StyleSheet.RegisterProperty<Blending>("foreground-blending", Blending.Normal);
			ForegroundOffset = StyleSheet.RegisterProperty<Vector2>("foreground-offset", Vector2.Zero);

			Cursor = StyleSheet.RegisterProperty<GameCursor>("cursor", GameCursor.Default);
		}

	}

}
