<Compile Include="src\Mono.Cairo\EGLDevice.cs" />
<Compile Include="src\Mono.Cairo\DRMDevice.cs" />
<Compile Include="src\Mono.Cairo\DRMSurface.cs" />
+ <Compile Include="src\GraphicObjects\TestWidget.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<dllmap os="!windows,osx" dll="libgdk-3-0.dll" target="libgdk-3.so.0"/>
<dllmap os="!windows,osx" dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so.0"/>
<dllmap os="!windows,osx" dll="rsvg-2" target="librsvg-2.so.2"/>
-
+ <dllmap os="!windows,osx" dll="libinput" target="/usr/lib/x86_64-linux-gnu/libinput.so.10"/>
<dllmap os="windows" dll="rsvg-2" target="librsvg-2-2.dll"/>
--- /dev/null
+//
+// TestWidget.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace Crow
+{
+ public class TestWidget : GraphicObject
+ {
+ double angle = 0.0;
+
+ public TestWidget ():base()
+ {
+ }
+
+ protected override void onDraw (Cairo.Context gr)
+ {
+ Rectangle r = ClientRectangle;
+
+ double radius = Math.Min (r.Width / 2, r.Height / 2) - 5;
+
+ gr.SetSourceRGBA (1.0, 0, 0, 1.0);
+ gr.LineWidth = 10;
+ gr.Arc (r.Width / 2, r.Height / 2, radius, angle, angle +0.5);
+ gr.Stroke ();
+
+ if (angle > 2.0 * Math.PI)
+ angle = 0.0;
+ else
+ angle += 0.08;
+
+ RegisterForGraphicUpdate ();
+ }
+ }
+}
+
System.Threading.Thread.CurrentThread.Name = "Main";
try {
- using (TestApp crowApp = new TestApp ())
+ using (TestApp crowApp = new TestApp ()){
crowApp.Run ();
+ }
} catch (Exception ex) {
Console.WriteLine (ex.ToString ());
}
#endregion
- public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDOpen;
+ public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDViewGO, CMDOpen;
public TestApp () : base () {
CrowInterface.KeyboardKeyDown += CrowInterface_KeyboardKeyDown;
CMDViewPerf = new Command(new Action(() => Load ("#testDrm.ui.perfMeasures.crow").DataSource = this)) { Caption = "Performances"};
CMDViewCfg = new Command(new Action(() => Load ("#testDrm.ui.2.crow").DataSource = this)) { Caption = "Configuration"};
CMDViewTest0 = new Command(new Action(() => Load ("#testDrm.ui.0.crow").DataSource = this)) { Caption = "Test view 0"};
+ CMDViewGO = new Command(new Action(() => Load ("#testDrm.ui.go.crow").DataSource = this)) { Caption = "graphic test"};
CMDOpen = new Command(new Action(() => {
lock (CrowInterface.UpdateMutex) CrowInterface.AddWidget(new FileDialog());})) { Caption = "Open"};
Load ("#testDrm.ui.menu.crow").DataSource = this;
- initTests ();
+ //initTests ();
}
void CrowInterface_KeyboardKeyDown (object sender, KeyboardKeyEventArgs e)
Console.WriteLine (ex.ToString ());
}
}
-
+
gpu = new DRIControler();
initCrow ();
gpu = null;
using (VTControler master = new VTControler ()) {
- // try {
- // master.KDMode = VT.KDMode.TEXT;
- // } catch (Exception ex) {
- // Console.WriteLine (ex.ToString ());
- // }
+ try {
+ master.KDMode = KDMode.TEXT;
+ } catch (Exception ex) {
+ Console.WriteLine (ex.ToString ());
+ }
master.SwitchTo (previousVT);
}
//setScanOutRegion();
//Thread.Sleep (100);
- initPageFlipUpdate ();
+ //initPageFlipUpdate ();
return true;
}
}
Window {
Template = #Crow.ToolWindow.template;
+ Background = DimGray;
}
<Command type="Execute" command="${TargetName}" workingdir="${SolutionDir}/build/${ProjectConfigName}" />
</CustomCommands>
</CustomCommands>
- <StartupObject>testDrm.TestCrow</StartupObject>
+ <StartupObject>testDrm.TestApp</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <DefineConstants>DEBUG;</DefineConstants>
+ <DefineConstants>DEBUG;MEASURE_TIME</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<?xml version="1.0"?>
-<GraphicObject Width="200" Height="200" Background="Mantis"/>
\ No newline at end of file
+<Window Width="300" Height="300" Background="Transparent">
+ <TestWidget Width="200" Height="200" Background="Mantis"/>
+</Window>
\ No newline at end of file
<MenuItem Command="{CMDViewPerf}"/>
<MenuItem Command="{CMDViewCfg}"/>
<MenuItem Command="{CMDViewTest0}"/>
+ <MenuItem Command="{CMDViewGO}"/>
</MenuItem>
<MenuItem Caption="Edit" Name="edit" Width="Fit">
<MenuItem Caption="Cut"/>
<?xml version="1.0"?>
-<Window AlwaysOnTop="true" Focusable="true" Caption="Measures" Width="200" Height="360" MinimumSize="100,100" Background="0.2,0.2,0.2,0.2" CornerRadius="10">
+<Window AlwaysOnTop="true" Focusable="true" Caption="Measures" Width="200" Height="360" MinimumSize="100,100"
+ Background="0.2,0.2,0.2,0.7" CornerRadius="10">
<ListBox Data="{PerfMeasures}" Fit="true" ItemTemplate="#ui.perfMsr.crow" Background="Transparent"/>
</Window>