]> O.S.I.I.S - jp/crow.git/commitdiff
debug TestDRM
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 14 Jun 2017 00:12:30 +0000 (02:12 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 14 Jun 2017 00:12:30 +0000 (02:12 +0200)
Crow.csproj
Crow.dll.config
src/GraphicObjects/TestWidget.cs [new file with mode: 0644]
testDrm/Main.cs
testDrm/src/Application.cs
testDrm/src/Linux/DRIControler.cs
testDrm/test.style
testDrm/testDrm.csproj
testDrm/ui/go.crow
testDrm/ui/menu.crow
testDrm/ui/perfMeasures.crow

index 1c41900830e55d13733f2e2cb499d6493f5a6e17..d556c32a132de57c78b508ec79d66f5b636c1409 100644 (file)
     <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" />
index ef7562ac47aa7b4d9008d121bdc494f83e312639..52997305654c4acfd3a6ef27fe1cbfe68aa8aef1 100644 (file)
@@ -6,7 +6,7 @@
   <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"/>
   
diff --git a/src/GraphicObjects/TestWidget.cs b/src/GraphicObjects/TestWidget.cs
new file mode 100644 (file)
index 0000000..b4880f0
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// 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 ();
+               }
+       }
+}
+
index 45a95d63d5037b4166ebe142047df1772e549810..81216d34c34907283023c47764a4c38116779a49 100644 (file)
@@ -55,8 +55,9 @@ namespace testDrm
                        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 ());
                        }
@@ -73,7 +74,7 @@ namespace testDrm
                #endregion
 
 
-               public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDOpen;
+               public Command CMDViewPerf, CMDViewCfg, CMDViewTest0, CMDViewGO, CMDOpen;
 
                public TestApp () : base () {
                        CrowInterface.KeyboardKeyDown += CrowInterface_KeyboardKeyDown;
@@ -81,12 +82,13 @@ namespace testDrm
                        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)
index 7efc09069e3189802c89d8cca2e2e918edfa9176..30a9573f82518dd97741d81cb135782be5e393de 100644 (file)
@@ -101,7 +101,7 @@ namespace Crow
                                        Console.WriteLine (ex.ToString ());     
                                }
                        }
-
+                               
                        gpu = new DRIControler();
 
                        initCrow ();
@@ -591,11 +591,11 @@ namespace Crow
                        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);
                        }
 
index cb2794f23cec88eebca5c3cee553400319bdad82..3d5f3009abcfeefd5a93ffa994c92c9dadd727b5 100644 (file)
@@ -231,7 +231,7 @@ namespace Linux.DRI {
                        //setScanOutRegion();
                        //Thread.Sleep (100);
 
-                       initPageFlipUpdate ();
+                       //initPageFlipUpdate ();
                        return true;
                }
 
index 0db7f47dd036367f32fd84e4f1ac3934e55e3bbb..7e06174bef5d2a36d2301cf4237987af7db9fde1 100644 (file)
@@ -14,4 +14,5 @@ FpsDisp {
 }
 Window {
        Template = #Crow.ToolWindow.template;
+       Background = DimGray;
 }
index 27db51e6d9dc4277933fc8e0eb3894e5f21afaea..2cf19157770df3992b0f7ab90bd41cfb3d51dcc9 100644 (file)
         <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>
index c3eda9ccb79013f676ad13c7c23ae49155f2e330..572e2cca61368b32c3388d8a373bc0ada4dcee05 100755 (executable)
@@ -1,2 +1,4 @@
 <?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
index abe22fbcfee5cf1a3b9b64727fad984bb571671c..df760faef2ea3f955b3cad17ab5ee872c7125bc4 100755 (executable)
@@ -10,6 +10,7 @@
                <MenuItem Command="{CMDViewPerf}"/>
                <MenuItem Command="{CMDViewCfg}"/>
                <MenuItem Command="{CMDViewTest0}"/>
+               <MenuItem Command="{CMDViewGO}"/>
        </MenuItem>
        <MenuItem Caption="Edit" Name="edit" Width="Fit">
                <MenuItem Caption="Cut"/>
index efeac6536ef7ffbf3c408ec0c62419c05689b547..5584a6b7130dba0fca56da0016b8155c08c4089e 100755 (executable)
@@ -1,4 +1,5 @@
 <?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>