summaryrefslogtreecommitdiff
path: root/src/TestPlugin.cs
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <chris@Burninator.(none)>2007-08-27 20:39:03 +1000
committerChristopher James Halse Rogers <chris@Burninator.(none)>2007-08-27 20:39:03 +1000
commit2ec676133b4e0d5e6187e5339a69bcdaafa1cfcc (patch)
tree33ec0efc4e080e57cb654237f236bbbd5087f02e /src/TestPlugin.cs
parent8035bb2e2bf4fc30aaef4bfb7c3ea8ad110ecdbb (diff)
parenta871a8128029698e9e789e1a00d0e6c5258d7873 (diff)
downloadcompiz-cil-master.tar.gz
compiz-cil-master.tar.bz2
Merge ../compiz-sharpHEADmaster
Diffstat (limited to 'src/TestPlugin.cs')
-rw-r--r--src/TestPlugin.cs80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/TestPlugin.cs b/src/TestPlugin.cs
new file mode 100644
index 0000000..ac6f6ed
--- /dev/null
+++ b/src/TestPlugin.cs
@@ -0,0 +1,80 @@
+// Copyright 2006 Alp Toker <alp@atoker.com>
+// This software is made available under the MIT License
+// See COPYING for details
+
+using System;
+using Compiz;
+
+public class MtestPlugin : Plugin
+{
+ Screen s;
+
+ public override bool InitScreen (IntPtr plugin, IntPtr screen)
+ {
+ Console.WriteLine ("initScreen");
+
+ s = new Screen (screen);
+ s.PreparePaint += OnPreparePaintScreen;
+ s.Paint += OnPaintScreen;
+
+ return true;
+ }
+
+ public void OnPreparePaintScreen (PreparePaintScreenHandler inner, IntPtr s, int msSinceLastPaint)
+ {
+ Console.Error.WriteLine ("PreparePaintScreen (managed) " + msSinceLastPaint);
+ inner (s, msSinceLastPaint);
+ }
+
+ public bool OnPaintScreen (PaintScreenHandler inner, IntPtr s, ref ScreenPaintAttrib sa, IntPtr region, ScreenPaint mask)
+ {
+ Console.Error.WriteLine ("PaintScreen (managed) " + " " + s + " " + mask);
+
+ Console.Error.WriteLine ("xRotate: " + sa.xRotate);
+ Console.Error.WriteLine ("yRotate: " + sa.yRotate);
+ Console.Error.WriteLine ("vRotate: " + sa.vRotate);
+ //Console.Error.WriteLine (": " + my_screen.);
+
+ //restrict rotation on x
+ if (sa.xRotate > 6)
+ sa.xRotate = 6f;
+ else if (sa.xRotate < -6)
+ sa.xRotate = -6f;
+
+ //restrict rotation on v
+ if (sa.vRotate > 6)
+ sa.vRotate = 6f;
+ else if (sa.vRotate < -6)
+ sa.vRotate = -6f;
+
+ //zoom out
+ //sa.zCamera = -1f;
+
+ //mask &= ScreenPaint.Region;
+ //mask |= ScreenPaint.Transformed;
+
+ bool ret = inner (s, ref sa, region, mask);
+
+ return ret;
+ }
+
+ public override bool InitWindow (IntPtr plugin, IntPtr window)
+ {
+ Console.WriteLine ("initWindow");
+
+ //Console.WriteLine (window.Id);
+ //Console.WriteLine (window.Frame);
+
+ Window win = new Window (window);
+ Console.WriteLine (win.UserTime);
+ //Console.WriteLine (win.State);
+ //win.Maximize ();
+
+ return true;
+ }
+
+ public override void FiniWindow (IntPtr plugin, IntPtr window)
+ {
+ Console.WriteLine ("finiWindow");
+ }
+}