32
32
namespace ClutterFlow.Captions
36
public abstract class Caption : Clutter.Text
40
public abstract string DefaultValue { get; set; }
42
private CoverManager coverManager;
43
public CoverManager CoverManager {
36
public abstract class Caption : Clutter.Text
40
public abstract string DefaultValue { get; set; }
42
private CoverManager coverManager;
43
public CoverManager CoverManager {
44
44
get { return coverManager; }
47
protected Animation aFade = null;
50
public Caption (CoverManager coverManager, string font_name, Color color) : base (clutter_text_new ())
52
this.coverManager = coverManager;
56
CursorVisible = false;
57
LineAlignment = Pango.Alignment.Center;
66
[DllImport("libclutter-glx-1.0.so.0")]
67
static extern IntPtr clutter_text_new ();
69
public virtual void FadeOut ()
71
EventHandler hFadeOut = delegate (object sender, EventArgs e) {
72
aFade = this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 0));
74
if (aFade!=null && aFade.Timeline!=null && aFade.Timeline.IsPlaying)
75
aFade.Completed += hFadeOut;
77
hFadeOut (this, EventArgs.Empty);
80
public virtual void FadeIn ()
82
EventHandler hFadeIn = delegate (object sender, EventArgs e) {
83
aFade = this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 255));
85
if (aFade!=null && aFade.Timeline!=null && aFade.Timeline.IsPlaying)
86
aFade.Completed += hFadeIn;
88
hFadeIn (this, EventArgs.Empty);
91
public virtual void Update ()
96
public abstract void UpdatePosition ();
47
protected Animation aFade = null;
50
public Caption (CoverManager coverManager, string font_name, Color color) : base (clutter_text_new ())
52
this.coverManager = coverManager;
56
CursorVisible = false;
57
LineAlignment = Pango.Alignment.Center;
66
[DllImport("libclutter-glx-1.0.so.0")]
67
static extern IntPtr clutter_text_new ();
69
public virtual void FadeOut ()
71
EventHandler hFadeOut = delegate (object sender, EventArgs e) {
72
aFade = this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 0));
74
if (aFade!=null && aFade.Timeline!=null && aFade.Timeline.IsPlaying)
75
aFade.Completed += hFadeOut;
77
hFadeOut (this, EventArgs.Empty);
80
public virtual void FadeIn ()
82
EventHandler hFadeIn = delegate (object sender, EventArgs e) {
83
aFade = this.Animatev ((ulong) AnimationMode.Linear.value__, (uint) (CoverManager.MaxAnimationSpan*0.5f), new string[] { "opacity" }, new GLib.Value ((byte) 255));
85
if (aFade!=null && aFade.Timeline!=null && aFade.Timeline.IsPlaying)
86
aFade.Completed += hFadeIn;
88
hFadeIn (this, EventArgs.Empty);
91
public virtual void Update ()
96
public abstract void UpdatePosition ();